Skip to content
Navigation Menu
Toggle navigation
Sign in
In this repository
All GitHub Enterprise
↵
Jump to
↵
No suggested jump to results
In this repository
All GitHub Enterprise
↵
Jump to
↵
In this organization
All GitHub Enterprise
↵
Jump to
↵
In this repository
All GitHub Enterprise
↵
Jump to
↵
Sign in
Reseting focus
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
mariux64
/
linux
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
2
Pull requests
0
Actions
Projects
0
Wiki
Security
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security
Insights
Files
138310e
Documentation
arch
alpha
arc
arm
boot
common
configs
crypto
firmware
include
kernel
kvm
lib
mach-at91
mach-axxia
mach-bcm
mach-berlin
mach-clps711x
mach-cns3xxx
mach-davinci
mach-dove
mach-ebsa110
mach-efm32
mach-ep93xx
mach-exynos
mach-footbridge
mach-gemini
mach-highbank
mach-hisi
mach-imx
mach-integrator
mach-iop13xx
mach-iop32x
mach-iop33x
mach-ixp4xx
mach-keystone
mach-ks8695
mach-lpc32xx
mach-mediatek
mach-mmp
mach-moxart
mach-msm
mach-mv78xx0
mach-mvebu
mach-mxs
mach-netx
mach-nomadik
mach-nspire
mach-omap1
mach-omap2
mach-orion5x
mach-picoxcell
mach-prima2
mach-pxa
mach-qcom
mach-realview
mach-rockchip
mach-rpc
mach-s3c24xx
mach-s3c64xx
mach-s5pv210
mach-sa1100
mach-shmobile
include
Kconfig
Makefile
Makefile.boot
board-ape6evm-reference.c
board-ape6evm.c
board-armadillo800eva.c
board-bockw-reference.c
board-bockw.c
board-koelsch-reference.c
board-koelsch.c
board-kzm9g-reference.c
board-kzm9g.c
board-lager-reference.c
board-lager.c
board-mackerel.c
board-marzen-reference.c
board-marzen.c
clock-r8a73a4.c
clock-r8a7740.c
clock-r8a7778.c
clock-r8a7779.c
clock-r8a7790.c
clock-r8a7791.c
clock-sh7372.c
clock-sh73a0.c
clock.c
clock.h
common.h
console.c
cpufreq.c
cpuidle.c
dma-register.h
entry-intc.S
headsmp-scu.S
headsmp.S
intc-sh7372.c
intc-sh73a0.c
intc.h
irqs.h
platsmp-apmu.c
platsmp-scu.c
platsmp.c
pm-r8a7740.c
pm-r8a7779.c
pm-r8a7790.c
pm-r8a7791.c
pm-rcar.c
pm-rcar.h
pm-rmobile.c
pm-rmobile.h
pm-sh7372.c
pm-sh73a0.c
r8a73a4.h
r8a7740.h
r8a7778.h
r8a7779.h
r8a7790.h
r8a7791.h
rcar-gen2.h
setup-emev2.c
setup-r7s72100.c
setup-r8a73a4.c
setup-r8a7740.c
setup-r8a7778.c
setup-r8a7779.c
setup-r8a7790.c
setup-r8a7791.c
setup-r8a7794.c
setup-rcar-gen2.c
setup-sh7372.c
setup-sh73a0.c
sh-gpio.h
sh7372.h
sh73a0.h
sleep-sh7372.S
smp-emev2.c
smp-r8a7779.c
smp-r8a7790.c
smp-r8a7791.c
smp-sh73a0.c
suspend.c
timer.c
mach-socfpga
mach-spear
mach-sti
mach-sunxi
mach-tegra
mach-u300
mach-ux500
mach-versatile
mach-vexpress
mach-vt8500
mach-w90x900
mach-zynq
mm
net
nwfpe
oprofile
plat-iop
plat-omap
plat-orion
plat-pxa
plat-samsung
plat-versatile
tools
vfp
xen
Kconfig
Kconfig-nommu
Kconfig.debug
Makefile
arm64
avr32
blackfin
c6x
cris
frv
hexagon
ia64
m32r
m68k
metag
microblaze
mips
mn10300
openrisc
parisc
powerpc
s390
score
sh
sparc
tile
um
unicore32
x86
xtensa
.gitignore
Kconfig
block
crypto
drivers
firmware
fs
include
init
ipc
kernel
lib
mm
net
samples
scripts
security
sound
tools
usr
virt
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README
REPORTING-BUGS
Breadcrumbs
linux
/
arch
/
arm
/
mach-shmobile
/
timer.c
Blame
Blame
Latest commit
History
History
98 lines (84 loc) · 2.77 KB
Breadcrumbs
linux
/
arch
/
arm
/
mach-shmobile
/
timer.c
Top
File metadata and controls
Code
Blame
98 lines (84 loc) · 2.77 KB
Raw
/* * SH-Mobile Timer * * Copyright (C) 2010 Magnus Damm * Copyright (C) 2002 - 2009 Paul Mundt * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 2 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #include <linux/platform_device.h> #include <linux/clocksource.h> #include <linux/delay.h> #include <linux/of_address.h> static void __init shmobile_setup_delay_hz(unsigned int max_cpu_core_hz, unsigned int mult, unsigned int div) { /* calculate a worst-case loops-per-jiffy value * based on maximum cpu core hz setting and the * __delay() implementation in arch/arm/lib/delay.S * * this will result in a longer delay than expected * when the cpu core runs on lower frequencies. */ unsigned int value = HZ * div / mult; if (!preset_lpj) preset_lpj = max_cpu_core_hz / value; } void __init shmobile_init_delay(void) { struct device_node *np, *cpus; bool is_a7_a8_a9 = false; bool is_a15 = false; u32 max_freq = 0; cpus = of_find_node_by_path("/cpus"); if (!cpus) return; for_each_child_of_node(cpus, np) { u32 freq; if (!of_property_read_u32(np, "clock-frequency", &freq)) max_freq = max(max_freq, freq); if (of_device_is_compatible(np, "arm,cortex-a7") || of_device_is_compatible(np, "arm,cortex-a8") || of_device_is_compatible(np, "arm,cortex-a9")) is_a7_a8_a9 = true; else if (of_device_is_compatible(np, "arm,cortex-a15")) is_a15 = true; } of_node_put(cpus); if (!max_freq) return; if (is_a7_a8_a9) shmobile_setup_delay_hz(max_freq, 1, 3); else if (is_a15 && !IS_ENABLED(CONFIG_ARM_ARCH_TIMER)) shmobile_setup_delay_hz(max_freq, 2, 4); } static void __init shmobile_late_time_init(void) { /* * Make sure all compiled-in early timers register themselves. * * Run probe() for two "earlytimer" devices, these will be the * clockevents and clocksource devices respectively. In the event * that only a clockevents device is available, we -ENODEV on the * clocksource and the jiffies clocksource is used transparently * instead. No error handling is necessary here. */ early_platform_driver_register_all("earlytimer"); early_platform_driver_probe("earlytimer", 2, 0); } void __init shmobile_earlytimer_init(void) { late_time_init = shmobile_late_time_init; }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
You can’t perform that action at this time.