Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decouple system timer and drivers #16469

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
704568b
scripts: dts: Add extraction of clock frequency for fixed clock
anangl May 24, 2019
986939e
scripts: dts: Add special handling of '+' in 'str_to_label' function
anangl Jun 18, 2019
c34304c
dts: bindings: Add bindings for ARM, ARC, Xtensa CPUs
pizi-nordic Jun 17, 2019
402bf11
dts: bindings: Add fixed-clock DTS binding
pizi-nordic May 28, 2019
b5d1f82
drivers: i2c_bitbang: Do not use CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC
pizi-nordic Apr 23, 2019
0b49c01
drivers: pwm_qmsi: Do not use CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC
pizi-nordic Apr 23, 2019
b18214b
drivers: timer: Do not use CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC
pizi-nordic Apr 23, 2019
12f632c
debug: Do not use CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC
pizi-nordic Apr 23, 2019
687cc69
logging: Do not use CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC
pizi-nordic Apr 23, 2019
d76cf39
tests: benchmarks: Do not use CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC
pizi-nordic Apr 23, 2019
fc33e13
drivers: i2c_cc32xx: Get clock frequency from DTS
pizi-nordic Apr 11, 2019
d1c89d4
soc: snps_arc_iot: Get CPU clock frequency from DTS
pizi-nordic Apr 11, 2019
6a2308a
soc: sam3x: Get CPU clock frequency from DTS
pizi-nordic Apr 11, 2019
311fdf3
soc: sam4s: Get CPU clock frequency from DTS
pizi-nordic Apr 11, 2019
8d5b4c3
soc: samd2x: Get CPU clock frequency from DTS
pizi-nordic Apr 11, 2019
0ff9f39
soc: samr21: Get CPU clock frequency from DTS
pizi-nordic May 29, 2019
94e33d3
soc: samde70: Get CPU clock frequency from DTS
pizi-nordic Apr 11, 2019
1541165
soc: k6x: Get CPU clock frequency from DTS
pizi-nordic Apr 11, 2019
36fd11d
soc: kl2x: Get CPU clock frequency from DTS
pizi-nordic Apr 11, 2019
a3db333
soc: kwx: Get CPU clock frequency from DTS
pizi-nordic Apr 11, 2019
261fa48
soc: lpc54xxx: Get CPU clock frequency from DTS
pizi-nordic Apr 11, 2019
af608ad
arch: xtensa: Get CPU clock frequency from DTS
pizi-nordic Apr 11, 2019
58b2426
soc: msp432p4xx: Get CPU clock frequency from DTS
pizi-nordic Apr 11, 2019
41eb0ee
soc: nxp_rt: Get system clock frequency from DTS
pizi-nordic May 29, 2019
a5f72f3
drivers: beetle_clock_control: Get CPU clock frequency from DTS
pizi-nordic Apr 11, 2019
41f1d3d
logging: log_backend_swo: Get clock frequency from DTS
pizi-nordic Apr 11, 2019
4e3c9ac
drivers: spi_dw: Get clock frequency from DTS
pizi-nordic Apr 11, 2019
3892174
drivers: uart_cmsdk_apb: Get clock frequency from DTS
pizi-nordic Apr 11, 2019
1a35d58
drivers: uart_pl011: Get clock frequency from DTS
pizi-nordic Apr 11, 2019
3095ead
drivers: uart_cc32xx: Get clock frequency from DTS
pizi-nordic Apr 11, 2019
79a3bf9
drivers: uart_msp432p4xx: Get clock frequency from DTS
pizi-nordic Apr 11, 2019
ed35280
drivers: uart_qmsi: Get clock frequency from DTS
pizi-nordic Apr 11, 2019
9a46b9a
drivers: uart_stellaris: Get clock frequency from DTS
pizi-nordic Apr 11, 2019
0643e51
drivers: uart_cc13xx_cc26xx: Get clock frequency from DTS
pizi-nordic May 29, 2019
ec6ff1f
drivers: wdog_cmsdk_apb: Get clock frequency from DTS
pizi-nordic Apr 11, 2019
b55dcea
drivers: adc_stm32: Get clock frequency from DTS
pizi-nordic May 30, 2019
9dfb955
debug: tracing: Fix compilation error
pizi-nordic Jun 19, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions arch/xtensa/include/xtensa_rtos.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,8 @@
#define XT_BOARD 1
#endif

#ifdef CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC
#undef XT_CLOCK_FREQ
#define XT_CLOCK_FREQ CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC
#endif
#undef XT_CLOCK_FREQ
#define XT_CLOCK_FREQ DT_CPU_CLOCK_FREQUENCY

#ifndef XT_TIMER_INDEX
#if defined configXT_TIMER_INDEX
Expand Down
2 changes: 1 addition & 1 deletion arch/xtensa/include/xtensa_timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
* anyway!).
*/
#if defined(XT_SIMULATOR) && !defined(XT_CLOCK_FREQ)
#define XT_CLOCK_FREQ CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC
#define XT_CLOCK_FREQ DT_CPU_CLOCK_FREQUENCY
#endif

#if !defined(XT_CLOCK_FREQ) && !defined(XT_BOARD)
Expand Down
4 changes: 4 additions & 0 deletions boards/arc/iotdk/iotdk.dts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
};
};

&cpu0 {
clock-frequency = <144000000>;
};

&uart0 {
status = "okay";
current-speed = <115200>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
};
};

&cpu0 {
clock-frequency = <48000000>;
};

&sercom0 {
status = "okay";
compatible = "atmel,sam0-uart";
Expand Down
4 changes: 4 additions & 0 deletions boards/arm/adafruit_trinket_m0/adafruit_trinket_m0.dts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
};
};

&cpu0 {
clock-frequency = <48000000>;
};

&sercom0 {
status = "okay";
compatible = "atmel,sam0-uart";
Expand Down
4 changes: 4 additions & 0 deletions boards/arm/arduino_due/arduino_due.dts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
};
};

&cpu0 {
clock-frequency = <84000000>;
};

&wdog {
status = "okay";
};
Expand Down
4 changes: 4 additions & 0 deletions boards/arm/arduino_zero/arduino_zero.dts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@

};

&cpu0 {
clock-frequency = <48000000>;
};

&sercom0 {
status = "okay";
compatible = "atmel,sam0-uart";
Expand Down
4 changes: 4 additions & 0 deletions boards/arm/atsamd20_xpro/atsamd20_xpro.dts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
};
};

&cpu0 {
clock-frequency = <48000000>;
};

&sercom0 {
status = "okay";
compatible = "atmel,sam0-spi";
Expand Down
4 changes: 4 additions & 0 deletions boards/arm/atsamd21_xpro/atsamd21_xpro.dts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
};
};

&cpu0 {
clock-frequency = <48000000>;
};

&sercom0 {
status = "okay";
compatible = "atmel,sam0-uart";
Expand Down
4 changes: 4 additions & 0 deletions boards/arm/atsamr21_xpro/atsamr21_xpro.dts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
};
};

&cpu0 {
clock-frequency = <48000000>;
};

&sercom0 {
status = "okay";
compatible = "atmel,sam0-uart";
Expand Down
4 changes: 4 additions & 0 deletions boards/arm/efm32hg_slstk3400a/efm32hg_slstk3400a.dts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@

};

&cpu0 {
clock-frequency = <24000000>;
};

&usart1 {
current-speed = <115200>;
location-rx = <GECKO_LOCATION(4) GECKO_PORT_A GECKO_PIN(0)>;
Expand Down
4 changes: 4 additions & 0 deletions boards/arm/efm32pg_stk3402a/efm32pg_stk3402a.dts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@
};
};

&cpu0 {
clock-frequency = <40000000>;
};

&usart0 {
current-speed = <115200>;
location-rx = <GECKO_LOCATION(0) GECKO_PORT_A GECKO_PIN(1)>;
Expand Down
4 changes: 4 additions & 0 deletions boards/arm/efm32wg_stk3800/efm32wg_stk3800.dts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@
};
};

&cpu0 {
clock-frequency = <48000000>;
};

&uart0 {
current-speed = <115200>;
location-rx = <GECKO_LOCATION(1) GECKO_PORT_E GECKO_PIN(1)>;
Expand Down
4 changes: 4 additions & 0 deletions boards/arm/efr32_slwstk6061a/efr32_slwstk6061a.dts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@

};

&cpu0 {
clock-frequency = <38400000>;
};

&usart0 {
current-speed = <115200>;
location-rx = <GECKO_LOCATION(0) GECKO_PORT_A GECKO_PIN(1)>;
Expand Down
4 changes: 4 additions & 0 deletions boards/arm/efr32mg_sltb004a/efr32mg_sltb004a.dts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@
};
};

&cpu0 {
clock-frequency = <38400000>;
};

&usart0 {
current-speed = <115200>;
location-rx = <GECKO_LOCATION(0) GECKO_PORT_A GECKO_PIN(1)>;
Expand Down
4 changes: 4 additions & 0 deletions boards/arm/frdm_k64f/frdm_k64f.dts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@

arduino_serial: &uart3 {};

&cpu0 {
clock-frequency = <120000000>;
};

&adc0 {
status = "okay";
};
Expand Down
4 changes: 4 additions & 0 deletions boards/arm/frdm_kl25z/frdm_kl25z.dts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@
};
};

&cpu0 {
clock-frequency = <48000000>;
};

&adc0 {
status = "okay";
};
Expand Down
4 changes: 4 additions & 0 deletions boards/arm/hexiwear_k64/hexiwear_k64.dts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@
};
};

&cpu0 {
clock-frequency = <120000000>;
};

&adc0 {
status = "okay";
};
Expand Down
4 changes: 4 additions & 0 deletions boards/arm/lpcxpresso54114/lpcxpresso54114_m0.dts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
};
};

&cpu1 {
clock-frequency = <48000000>;
};

&mailbox0 {
status = "okay";
};
4 changes: 4 additions & 0 deletions boards/arm/lpcxpresso54114/lpcxpresso54114_m4.dts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
};
};

&cpu0 {
clock-frequency = <48000000>;
};

&usart0 {
status = "okay";
current-speed = <115200>;
Expand Down
12 changes: 12 additions & 0 deletions boards/arm/mps2_an385/mps2_an385.dts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@
reg = <0 0x400000>;
};

sysclk: system-clock {
compatible = "fixed-clock";
clock-frequency = <25000000>;
#clock-cells = <0>;
};

soc {
timer0: timer@40000000 {
compatible = "arm,cmsdk-timer";
Expand Down Expand Up @@ -65,6 +71,7 @@
reg = <0x40004000 0x1000>;
interrupts = <1 3 0 3>;
interrupt-names = "tx", "rx";
clocks = <&sysclk>;
current-speed = <115200>;
label = "UART_0";
};
Expand All @@ -74,6 +81,7 @@
reg = <0x40005000 0x1000>;
interrupts = <3 3 2 3>;
interrupt-names = "tx", "rx";
clocks = <&sysclk>;
current-speed = <115200>;
label = "UART_1";
};
Expand All @@ -83,6 +91,7 @@
reg = <0x40006000 0x1000>;
interrupts = <5 3 4 3>;
interrupt-names = "tx", "rx";
clocks = <&sysclk>;
current-speed = <115200>;
label = "UART_2";
};
Expand All @@ -92,12 +101,14 @@
reg = <0x40007000 0x1000>;
interrupts = <19 3 18 3>;
interrupt-names = "tx", "rx";
clocks = <&sysclk>;
current-speed = <115200>;
label = "UART_3";
};

wdog0: wdog@40008000 {
compatible = "arm,cmsdk-watchdog";
clocks = <&sysclk>;
reg = <0x40008000 0x1000>;
};

Expand All @@ -106,6 +117,7 @@
reg = <0x40009000 0x1000>;
interrupts = <21 3 20 3>;
interrupt-names = "tx", "rx";
clocks = <&sysclk>;
current-speed = <115200>;
label = "UART_4";
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
};
};

&cpu0 {
clock-frequency = <48000000>;
};

&uart0 {
status = "okay";
current-speed = <115200>;
Expand Down
4 changes: 4 additions & 0 deletions boards/arm/sam4s_xplained/sam4s_xplained.dts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
};
};

&cpu0 {
clock-frequency = <120000000>;
};

&i2c0 {
status = "okay";
};
Expand Down
4 changes: 4 additions & 0 deletions boards/arm/sam_e70_xplained/sam_e70_xplained.dts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@
};
};

&cpu0 {
clock-frequency = <300000000>;
};

&adc0 {
status = "okay";
};
Expand Down
4 changes: 4 additions & 0 deletions boards/arm/usb_kw24d512/usb_kw24d512.dts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@
};
};

&cpu0 {
clock-frequency = <48000000>;
};

&adc0 {
status = "okay";
};
Expand Down
10 changes: 10 additions & 0 deletions boards/arm/v2m_beetle/v2m_beetle.dts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

cpu@0 {
compatible = "arm,cortex-m3";
clock-frequency = <24000000>;
reg = <0>;
};
};
Expand All @@ -36,6 +37,12 @@
reg = <0 0x40000>;
};

sysclk: system-clock {
compatible = "fixed-clock";
clock-frequency = <24000000>;
#clock-cells = <0>;
};

soc {
timer0: timer@40000000 {
compatible = "arm,cmsdk-timer";
Expand All @@ -62,6 +69,7 @@
compatible = "arm,cmsdk-uart";
reg = <0x40004000 0x1000>;
interrupts = <0 3>;
clocks = <&sysclk>;
current-speed = <115200>;
label = "UART_0";
};
Expand All @@ -70,12 +78,14 @@
compatible = "arm,cmsdk-uart";
reg = <0x40005000 0x1000>;
interrupts = <2 3>;
clocks = <&sysclk>;
current-speed = <115200>;
label = "UART_1";
};

wdog0: wdog@40008000 {
compatible = "arm,cmsdk-watchdog";
clocks = <&sysclk>;
reg = <0x40008000 0x1000>;
};

Expand Down
3 changes: 3 additions & 0 deletions boards/arm/v2m_musca/v2m_musca-common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ mhu1: mhu@4000 {

wdog0: wdog@81000 {
compatible = "arm,cmsdk-watchdog";
clocks = <&sysclk>;
reg = <0x81000 0x1000>;
};

Expand All @@ -49,6 +50,7 @@ uart0: uart@101000 {
reg = <0x101000 0x1000>;
interrupts = <39 3 40 3 41 3 43 3>;
interrupt-names = "rx", "tx", "rxtim", "err";
clocks = <&sysclk>;
current-speed = <115200>;
label = "UART_0";
};
Expand All @@ -58,6 +60,7 @@ uart1: uart@102000 {
reg = <0x102000 0x1000>;
interrupts = <45 3 46 3 47 3 49 3>;
interrupt-names = "rx", "tx", "rxtim", "err";
clocks = <&sysclk>;
current-speed = <115200>;
label = "UART_1";
};
Expand Down
Loading