Initial DT support for SIMpad devices.
Subsystems (3)
PATCH 1/1 Initial DT support for SIMpad devices.
--- .../devicetree/bindings/vendor-prefixes.txt | 1 + arch/arm/boot/dts/sa1110.dtsi | 72 ++++++++++++++++++++ arch/arm/boot/dts/simpad.dts | 49 +++++++++++++ arch/arm/mach-sa1100/Kconfig | 13 ++++ arch/arm/mach-sa1100/Makefile.boot | 1 + arch/arm/mach-sa1100/simpad.c | 29 ++++++++- 6 files changed, 164 insertions(+), 1 deletions(-) create mode 100644 arch/arm/boot/dts/sa1110.dtsi create mode 100644 arch/arm/boot/dts/simpad.dts
Documentation/devicetree/bindings/vendor-prefixes.txt +1 -0
@@ -34,6 +34,7 @@ qcom Qualcomm, Inc. ramtron Ramtron International samsung Samsung Semiconductor schindler Schindler +siemens SIEMENS simtek sirf SiRF Technology, Inc. stericsson ST-Ericsson
arch/arm/boot/dts/sa1110.dtsi new file +72 -0
72 lines not on this page · raw message
arch/arm/boot/dts/simpad.dts new file +49 -0
49 lines not on this page · raw message
arch/arm/mach-sa1100/Kconfig +13 -0
@@ -157,6 +157,19 @@ config SA1100_SIMPAD like CL4 in additional it has a PCMCIA-Slot. For more information visit <http://www.usa.siemens.com/> or <http://www.siemens.ch/>. +config SA1100_SIMPAD_DT + bool "Simpad with device tree support" + select CPU_FREQ_SA1110 + select SA1100_SIMPAD + select USE_OF + help + The SIEMENS webpad SIMpad is based on the StrongARM 1110. There + are two different versions CL4 and SL4. CL4 has 32MB RAM and 16MB + FLASH. The SL4 version got 64 MB RAM and 32 MB FLASH and a + PCMCIA-Slot. The version for the Germany Telecom (DTAG) is the same + like CL4 in additional it has a PCMCIA-Slot. For more information + visit <http://www.usa.siemens.com/> or <http://www.siemens.ch/>. + config SA1100_SSP tristate "Generic PIO SSP" help
arch/arm/mach-sa1100/Makefile.boot +1 -0
@@ -6,3 +6,4 @@ endif params_phys-y := 0xc0000100 initrd_phys-y := 0xc0800000 +dtb-$(CONFIG_SA1100_SIMPAD_DT) += simpad.dtb
arch/arm/mach-sa1100/simpad.c +28 -1
@@ -10,6 +10,7 @@#include <linux/string.h> #include <linux/pm.h> #include <linux/platform_device.h> +#include <linux/of_platform.h> #include <linux/mtd/mtd.h> #include <linux/mtd/partitions.h> #include <linux/io.h>
@@ -211,8 +212,9 @@ static void __init simpad_map_io(void)sa1100_register_uart_fns (&simpad_port_fns);sa1100_register_uart (0 ,3 );/* serial interface */ +#ifndef CONFIG_OF sa1100_register_uart (1 ,1 );/* DECT */ - +#endif // Reassign UART 1 pins GAFR |=GPIO_UART_TXD |GPIO_UART_RXD ;GPDR |=GPIO_UART_TXD |GPIO_LDD13 |GPIO_LDD15 ;
@@ -392,6 +394,31 @@ static int __init simpad_init(void)arch_initcall (simpad_init); +#ifdef CONFIG_OF +const struct of_device_id simpad_bus_match_table[] = { + { .compatible ="simple-bus" , }, + { .compatible ="intel,sa1110-localbus" , }, + {}/* Empty terminated list */ +}; + +static void __init simpad_dt_device_init (void ) +{ +of_platform_populate (NULL , simpad_bus_match_table,NULL ,NULL ); +} + +static const char *simpad_dt_board_compat[]__initdata = { +"siemens,simpad" , +NULL +}; + +DT_MACHINE_START (simpad_dt,"SIMpad" ) + .timer = &sa1100_timer, + .map_io = simpad_map_io, + .init_irq = sa1100_init_irq, + .init_machine = simpad_dt_device_init, + .dt_compat = simpad_dt_board_compat, +MACHINE_END +#endif MACHINE_START (SIMPAD ,"Simpad" )/* Maintainer: Holger Freyther */
Signature · 1 line
1.7.7.3
PATCH 1/1 Initial DT support for SIMpad devices.
Hi Jochen,
Just a couple of nits inline, otherwise looks nice to me!
Jamie
Quoted 43 lines · Jochen Friedrich
Signed-off-by Jochen Friedrich <[email protected]>--- .../devicetree/bindings/vendor-prefixes.txt | 1 + arch/arm/boot/dts/sa1110.dtsi | 72 ++++++++++++++++++++ arch/arm/boot/dts/simpad.dts | 49 +++++++++++++ arch/arm/mach-sa1100/Kconfig | 13 ++++ arch/arm/mach-sa1100/Makefile.boot | 1 + arch/arm/mach-sa1100/simpad.c | 29 ++++++++- 6 files changed, 164 insertions(+), 1 deletions(-) create mode 100644 arch/arm/boot/dts/sa1110.dtsi create mode 100644 arch/arm/boot/dts/simpad.dtsDocumentation/devicetree/bindings/vendor-prefixes.txt +1
-0@@ -34,6 +34,7 @@ qcom Qualcomm, Inc. ramtron Ramtron International samsung Samsung Semiconductor schindler Schindler +siemens SIEMENS simtek sirf SiRF Technology, Inc. stericsson ST-Ericssonarch/arm/boot/dts/sa1110.dtsi new file +13
-0@@ -0,0 +1,72 @@ +/* + * sa1110.dtsi - Device Tree Include file for Intel SA1110 SoC + * + * Copyright (C) 2011 Jochen Friedrich <[email protected]> + * + * Licensed under GPLv2 or later. + */ + +/include/ "skeleton.dtsi" + +/ { + model = "Intel SA1110 SoC"; + compatible = "intel,sa1110";
arch/arm/boot/dts/sa1110.dtsi line 23
Quoted 10 lines
arch/arm/boot/dts/sa1110.dtsi new file +10
-0+ interrupt-parent = <&aic>; + + cpus { + cpu at 0 { + compatible = "intel,sa1110"; + }; + }; + + localbus { + compatible = "intel,sa1110-localbus";
Could this claim compatibility with simple-bus?
Quoted 28 lines
arch/arm/boot/dts/sa1110.dtsi new file +28
-0+ #address-cells = <2>; + #size-cells = <1>; + + ranges = < + 0x0 0x0 0x00000000 0x08000000 + 0x1 0x0 0x08000000 0x08000000 + 0x2 0x0 0x10000000 0x08000000 + 0x3 0x0 0x18000000 0x08000000 + 0x4 0x0 0x40000000 0x08000000 + 0x5 0x0 0x48000000 0x08000000 + >; + }; + + soc { + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + ranges; + + uart0: serial at 0x80010000 { + compatible = "intel,sa1100-uart"; + reg = <0x80010000 0x24>; + interrupts = <15>; + status = "disabled"; + }; + + uart1: serial at 0x80030000 { + compatible = "intel,sa1100-uart";
arch/arm/boot/dts/sa1110.dtsi line 61
Quoted 10 lines
arch/arm/boot/dts/sa1110.dtsi new file +10
-0+ reg = <0x80030000 0x24>; + interrupts = <16>; + status = "disabled"; + }; + + uart2: serial at 0x80050000 { + compatible = "intel,sa1100-uart"; + reg = <0x80050000 0x24>; + interrupts = <17>; + status = "disabled";
Hmm, I couldn't see status defined in the UART binding or where it was used... Is this required?
Quoted 17 lines
arch/arm/boot/dts/sa1110.dtsi new file +11
-0+ }; + + aic: interrupt-controller at 0x90050000 { + compatible = "intel,sa1110-icr"; + reg = <0x90050000 0x24>; + #interrupt-cells = <1>; + interrupt-controller; + interrupt-parent; + }; + }; +};arch/arm/boot/dts/simpad.dts new file +0
-0
arch/arm/boot/dts/simpad.dts line 6
Quoted 6 lines
arch/arm/boot/dts/simpad.dts new file +6
-0@@ -0,0 +1,49 @@ +/dts-v1/; +/include/ "sa1110.dtsi" + +/ { + model = "SIEMENS, SIMpad"; + compatible = "siemens,simpad";
It may be worth adding the SoC compatible string after the board one for completeness.
arch/arm/boot/dts/simpad.dts line 19
Quoted 13 lines
arch/arm/boot/dts/simpad.dts new file +13
-0+ + aliases { + serial0 = &uart2; + serial1 = &uart0; + }; + + memory { + device_type = "memory"; + reg = <0x0 0x08000000>; + }; + + chosen { + bootargs = "console=ttySA0";
It is preferred for the bootloader to set these up rather than having them statically in the DTS if at all possible.
Quoted 13 lines
arch/arm/boot/dts/simpad.dts new file +13
-0+ }; + + localbus { + flash at 0,0 { + compatible = "cfi-flash"; + reg = <0 0 0x08000000>; + bank-width = <1>; + #size-cells = <1>; + #address-cells = <1>; + }; + + flash at 1,0 { + compatible = "cfi-flash";
arch/arm/boot/dts/simpad.dts line 42
Quoted 10 lines
arch/arm/boot/dts/simpad.dts new file +10
-0+ reg = <1 0 0x08000000>; + bank-width = <1>; + #size-cells = <1>; + #address-cells = <1>; + }; + }; + + soc { + uart0: serial at 0x80010000 { + status = "okay";
And here.
Quoted 68 lines
arch/arm/boot/dts/simpad.dts new file +7
-0+ }; + + uart2: serial at 0x80050000 { + status = "okay"; + }; + }; +};arch/arm/mach-sa1100/Kconfig +13
-0@@ -157,6 +157,19 @@ config SA1100_SIMPAD like CL4 in additional it has a PCMCIA-Slot. For more information visit <http://www.usa.siemens.com/> or <http://www.siemens.ch/>. +config SA1100_SIMPAD_DT + bool "Simpad with device tree support" + select CPU_FREQ_SA1110 + select SA1100_SIMPAD + select USE_OF + help + The SIEMENS webpad SIMpad is based on the StrongARM 1110. There + are two different versions CL4 and SL4. CL4 has 32MB RAM and 16MB + FLASH. The SL4 version got 64 MB RAM and 32 MB FLASH and a + PCMCIA-Slot. The version for the Germany Telecom (DTAG) is the same + like CL4 in additional it has a PCMCIA-Slot. For more information + visit <http://www.usa.siemens.com/> or <http://www.siemens.ch/>. + config SA1100_SSP tristate "Generic PIO SSP" helparch/arm/mach-sa1100/Makefile.boot +1
-0@@ -6,3 +6,4 @@ endif params_phys-y := 0xc0000100 initrd_phys-y := 0xc0800000 +dtb-$(CONFIG_SA1100_SIMPAD_DT) += simpad.dtbarch/arm/mach-sa1100/simpad.c +4
-1@@ -10,6 +10,7 @@#include <linux/string.h> #include <linux/pm.h> #include <linux/platform_device.h> +#include <linux/of_platform.h> #include <linux/mtd/mtd.h> #include <linux/mtd/partitions.h> #include <linux/io.h> @@ -211,8 +212,9 @@ static void __init simpad_map_io(void)sa1100_register_uart_fns (&simpad_port_fns);sa1100_register_uart (0 ,3 );/* serial interface */ +#ifndef CONFIG_OF sa1100_register_uart (1 ,1 );/* DECT */ - +#endif // Reassign UART 1 pins GAFR |=GPIO_UART_TXD |GPIO_UART_RXD ;GPDR |=GPIO_UART_TXD |GPIO_LDD13 |GPIO_LDD15 ;@@ -392,6 +394,31 @@ static int __init simpad_init(void)arch_initcall (simpad_init); +#ifdef CONFIG_OF
arch/arm/mach-sa1100/simpad.c static int __init simpad_init(void) · line 407
Quoted 10 lines
arch/arm/mach-sa1100/simpad.c +10
-0+const struct of_device_id simpad_bus_match_table[] = { + { .compatible ="simple-bus" , }, + { .compatible ="intel,sa1110-localbus" , }, + {}/* Empty terminated list */ +}; + +static void __init simpad_dt_device_init (void ) +{ +of_platform_populate (NULL , simpad_bus_match_table,NULL ,NULL ); +}
If the localbus was compatible with simple-bus then you could do:
of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
and remove simpad_bus_match_table.
arch/arm/mach-sa1100/simpad.c static int __init simpad_init(void) · line 409
Quoted 2 lines
arch/arm/mach-sa1100/simpad.c +2
-0+ +static const char *simpad_dt_board_compat[]__initdata = {
I think this should be __initconst.
Quoted 22 lines
arch/arm/mach-sa1100/simpad.c +12
-0+"siemens,simpad" , +NULL +}; + +DT_MACHINE_START (simpad_dt,"SIMpad" ) + .timer = &sa1100_timer, + .map_io = simpad_map_io, + .init_irq = sa1100_init_irq, + .init_machine = simpad_dt_device_init, + .dt_compat = simpad_dt_board_compat, +MACHINE_END +#endif MACHINE_START (SIMPAD ,"Simpad" )/* Maintainer: Holger Freyther */ Signature · 6 lines
1.7.7.3 _______________________________________________ devicetree-discuss mailing list devicetree-discuss at lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
PATCH 1/1 Initial DT support for SIMpad devices.
Hi Jamie,
Quoted 4 lines
arch/arm/boot/dts/sa1110.dtsi line 23
Quoted 2 lines
arch/arm/boot/dts/sa1110.dtsi new file +2
-0+ localbus { + compatible = "intel,sa1110-localbus";Could this claim compatibility with simple-bus?
I wasn't sure about this. I took a look in the powerpc DTS files for reference and they used some kind of <chip>-localbus compatible entries. So I took the same approach here.
Quoted 8 lines
arch/arm/boot/dts/sa1110.dtsi line 61
Quoted 5 lines
arch/arm/boot/dts/sa1110.dtsi new file +5
-0+ uart2: serial at 0x80050000 { + compatible = "intel,sa1100-uart"; + reg =<0x80050000 0x24>; + interrupts =<17>; + status = "disabled";Hmm, I couldn't see status defined in the UART binding or where it was used... Is this required?
status is a global property and it's being used in drivers/of/base.c, of_device_is_available(). It is used in other dtsi files like e.g. at91sam9g45.dtsi as well to define optional nodes.
Quoted 6 lines
arch/arm/boot/dts/simpad.dts line 6
Quoted 3 lines
arch/arm/boot/dts/simpad.dts new file +3
-0+/ { + model = "SIEMENS, SIMpad"; + compatible = "siemens,simpad";It may be worth adding the SoC compatible string after the board one for completeness.
Do you mean something like this?
compatible = "siemens,simpad", "intel,sa1100";
Quoted 5 lines
arch/arm/boot/dts/simpad.dts line 19
Quoted 2 lines
arch/arm/boot/dts/simpad.dts new file +2
-0+ chosen { + bootargs = "console=ttySA0";It is preferred for the bootloader to set these up rather than having them statically in the DTS if at all possible.
Yes, my boot loader does this, but simpad support is not in official U-BOOT yet. This allows testing with a different boot loader like the hh.org one and a Linux binary with DTB appended.
Quoted 13 lines
arch/arm/mach-sa1100/simpad.c static int __init simpad_init(void) · line 407
Quoted 10 lines
arch/arm/mach-sa1100/simpad.c +10
-0+const struct of_device_id simpad_bus_match_table[] = { + { .compatible ="simple-bus" , }, + { .compatible ="intel,sa1110-localbus" , }, + {}/* Empty terminated list */ +}; + +static void __init simpad_dt_device_init (void ) +{ +of_platform_populate (NULL , simpad_bus_match_table,NULL ,NULL ); +}If the localbus was compatible with simple-bus then you could do:
Quoted 3 lines
of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);and remove
simpad_bus_match_table.
True, I just wasn't sure if it's OK to do so.
Quoted 3 lines
Quoted 1 line
+static const char *simpad_dt_board_compat[]
__initdata= {I think this should be
__initconst.
OK.
Thanks,
Jochen
PATCH 1/1 Initial DT support for SIMpad devices.
Hi Jochen,
Quoted 7 lines · Jochen Friedrich
Quoted 4 lines
arch/arm/boot/dts/sa1110.dtsi line 23
Quoted 2 lines
arch/arm/boot/dts/sa1110.dtsi new file +2
-0+ localbus { + compatible = "intel,sa1110-localbus";Could this claim compatibility with simple-bus?
I wasn't sure about this. I took a look in the powerpc DTS files for reference and they used some kind of <chip>-localbus compatible entries. So I took the same approach here.
Hmm, I haven't seen any of the ARM platforms doing this, and unless the sa1110 bus has some extra knobs that need tweaking, then simple-bus should be fine.
Quoted 11 lines
Quoted 8 lines
arch/arm/boot/dts/sa1110.dtsi line 61
Quoted 5 lines
arch/arm/boot/dts/sa1110.dtsi new file +5
-0+ uart2: serial at 0x80050000 { + compatible = "intel,sa1100-uart"; + reg =<0x80050000 0x24>; + interrupts =<17>; + status = "disabled";Hmm, I couldn't see status defined in the UART binding or where it was used... Is this required?
status is a global property and it's being used in
drivers/of/base.c,of_device_is_available(). It is used in other dtsi files like e.g.at91sam9g45.dtsias well to define optional nodes.
Ahh, I wasn't aware of that one - thanks!
Quoted 10 lines
Quoted 6 lines
arch/arm/boot/dts/simpad.dts line 6
Quoted 3 lines
arch/arm/boot/dts/simpad.dts new file +3
-0+/ { + model = "SIEMENS, SIMpad"; + compatible = "siemens,simpad";It may be worth adding the SoC compatible string after the board one for completeness.
Do you mean something like this?
compatible = "siemens,simpad", "intel,sa1100";
Yup, that looks about right.
Quoted 9 lines
Quoted 5 lines
arch/arm/boot/dts/simpad.dts line 19
Quoted 2 lines
arch/arm/boot/dts/simpad.dts new file +2
-0+ chosen { + bootargs = "console=ttySA0";It is preferred for the bootloader to set these up rather than having them statically in the DTS if at all possible.
Yes, my boot loader does this, but simpad support is not in official U-BOOT yet. This allows testing with a different boot loader like the hh.org one and a Linux binary with DTB appended.
OK, I guess that's fair enough, though I certainly shouldn't be considered an authoritative source on this!
Jamie