Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
Zephyr RTOS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Luis Gerhorst
Zephyr RTOS
Commits
dfba9c2b
Commit
dfba9c2b
authored
3 years ago
by
Luis Gerhorst
Browse files
Options
Downloads
Patches
Plain Diff
raspi3b+: Fix arm_arch_timer's HW_CYCLES_PER_SEC
parent
ebad73a6
Branches
main
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
drivers/timer/arm_arch_timer.c
+7
-0
7 additions, 0 deletions
drivers/timer/arm_arch_timer.c
soc/arm/bcm2837/Kconfig.defconfig
+3
-1
3 additions, 1 deletion
soc/arm/bcm2837/Kconfig.defconfig
with
10 additions
and
1 deletion
drivers/timer/arm_arch_timer.c
+
7
−
0
View file @
dfba9c2b
...
...
@@ -58,6 +58,13 @@ int z_clock_driver_init(const struct device *device)
irq_enable
(
ARM_ARCH_TIMER_IRQ
);
arm_arch_timer_set_irq_mask
(
false
);
/* https://gitlab.cs.fau.de/i4/jitty/jitty-os/-/blob/master/arch-pc-aarch64/hw_timer.c#L235 */
uint64_t
hw_cycles_per_sec
=
read_cntfrq_el0
()
*
(
0x400
/
256
);
if
(
hw_cycles_per_sec
!=
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC
)
{
printk
(
"Warning: cntfrq_el0 indicates that CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC should be %d, but configured value is %d.
\n
"
,
hw_cycles_per_sec
,
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC
);
}
return
0
;
}
...
...
This diff is collapsed.
Click to expand it.
soc/arm/bcm2837/Kconfig.defconfig
+
3
−
1
View file @
dfba9c2b
...
...
@@ -13,7 +13,9 @@ config NUM_IRQS
default 128
config SYS_CLOCK_HW_CYCLES_PER_SEC
default 62500000
# https://gitlab.cs.fau.de/i4/jitty/jitty-os/-/blob/master/arch-pc-aarch64/hw_timer.c#L235
default 76800000
# QEMU's raspi3 machine: default 250000000
# Workaround for not being able to have commas in macro arguments
DT_CHOSEN_Z_FLASH := zephyr,flash
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment