watchdog: cmsdk: Convert to use DT generated label for device name

Convert driver to use DT_INST_0_ARM_CMSDK_WATCHDOG_LABEL instead of
CONFIG_WDT_0_NAME.  This requires we introduce a "label" property in all
the related dts files.  Also introduce a standard watchdog alias
('watchdog0') that can be utilized by sample/test code in the future.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2019-11-04 11:27:22 -06:00 committed by Maureen Helm
commit c111b7e49d
10 changed files with 20 additions and 1 deletions

View file

@ -15,6 +15,7 @@
led1 = &led_1; led1 = &led_1;
sw0 = &user_button_0; sw0 = &user_button_0;
sw1 = &user_button_1; sw1 = &user_button_1;
watchdog0 = &wdog0;
}; };
chosen { chosen {
@ -141,6 +142,7 @@
compatible = "arm,cmsdk-watchdog"; compatible = "arm,cmsdk-watchdog";
clocks = <&sysclk>; clocks = <&sysclk>;
reg = <0x40008000 0x1000>; reg = <0x40008000 0x1000>;
label = "WATCHDOG";
}; };
uart4: uart@40009000 { uart4: uart@40009000 {

View file

@ -81,6 +81,7 @@ wdog0: wdog@81000 {
compatible = "arm,cmsdk-watchdog"; compatible = "arm,cmsdk-watchdog";
reg = <0x81000 0x1000>; reg = <0x81000 0x1000>;
clocks = <&sysclk>; clocks = <&sysclk>;
label = "WATCHDOG";
}; };
uart0: uart@200000 { uart0: uart@200000 {

View file

@ -19,6 +19,7 @@
led1 = &led_1; led1 = &led_1;
sw0 = &user_button_0; sw0 = &user_button_0;
sw1 = &user_button_1; sw1 = &user_button_1;
watchdog0 = &wdog0;
}; };
chosen { chosen {

View file

@ -19,6 +19,7 @@
led1 = &led_1; led1 = &led_1;
sw0 = &user_button_0; sw0 = &user_button_0;
sw1 = &user_button_1; sw1 = &user_button_1;
watchdog0 = &wdog0;
}; };
chosen { chosen {

View file

@ -9,6 +9,10 @@
#address-cells = <1>; #address-cells = <1>;
#size-cells = <1>; #size-cells = <1>;
aliases {
watchdog0 = &wdog0;
};
chosen { chosen {
zephyr,console = &uart1; zephyr,console = &uart1;
zephyr,shell-uart = &uart1; zephyr,shell-uart = &uart1;
@ -87,6 +91,7 @@
compatible = "arm,cmsdk-watchdog"; compatible = "arm,cmsdk-watchdog";
clocks = <&sysclk>; clocks = <&sysclk>;
reg = <0x40008000 0x1000>; reg = <0x40008000 0x1000>;
label = "WATCHDOG";
}; };
gpio0: gpio@40010000 { gpio0: gpio@40010000 {

View file

@ -43,6 +43,7 @@ wdog0: wdog@81000 {
compatible = "arm,cmsdk-watchdog"; compatible = "arm,cmsdk-watchdog";
clocks = <&sysclk>; clocks = <&sysclk>;
reg = <0x81000 0x1000>; reg = <0x81000 0x1000>;
label = "WATCHDOG";
}; };
uart0: uart@101000 { uart0: uart@101000 {

View file

@ -17,6 +17,7 @@
led0 = &green_led; led0 = &green_led;
led1 = &blue_led; led1 = &blue_led;
led2 = &red_led; led2 = &red_led;
watchdog0 = &wdog0;
}; };
chosen { chosen {

View file

@ -13,6 +13,10 @@
#address-cells = <1>; #address-cells = <1>;
#size-cells = <1>; #size-cells = <1>;
aliases {
watchdog0 = &wdog0;
};
chosen { chosen {
zephyr,console = &uart1; zephyr,console = &uart1;
zephyr,sram = &sram0; zephyr,sram = &sram0;

View file

@ -13,6 +13,9 @@
#address-cells = <1>; #address-cells = <1>;
#size-cells = <1>; #size-cells = <1>;
aliases {
};
chosen { chosen {
zephyr,console = &uart1; zephyr,console = &uart1;
zephyr,sram = &sram0; zephyr,sram = &sram0;

View file

@ -197,7 +197,7 @@ static int wdog_cmsdk_apb_init(struct device *dev)
return 0; return 0;
} }
DEVICE_AND_API_INIT(wdog_cmsdk_apb, CONFIG_WDT_0_NAME, DEVICE_AND_API_INIT(wdog_cmsdk_apb, DT_INST_0_ARM_CMSDK_WATCHDOG_LABEL,
wdog_cmsdk_apb_init, wdog_cmsdk_apb_init,
NULL, NULL, NULL, NULL,
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,