Skip to contentSkip to conversation

stv0991: Add flat device tree support

PATCH Superseded Vikas Manocha 2 participants 5 messages May 2, 2015 – May 3, 2015 Arm (32-bit)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover stv0991: Add flat device tree support

This patchset adds device tree support for stv0991 soc.

Changes in v2:
- added commit messages for both patches.

Vikas Manocha (2):
stv0991: fdt: add stv0991 device tree
stv0991: use fdt for serial port platform data

 arch/arm/dts/Makefile      |    1 +
 arch/arm/dts/stv0991.dts   |   23 +++++++++++++++++++++++
 board/st/stv0991/stv0991.c |    2 ++
 configs/stv0991_defconfig  |    1 +
 include/configs/stv0991.h  |    3 +++
 5 files changed, 30 insertions(+)
 create mode 100644 arch/arm/dts/stv0991.dts
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v2 1/2 stv0991: fdt: add stv0991 device tree

This patch adds device tree for the ST Micro stv0991 board & enables device tree control. Progressively device tree support for the drivers being used will also be added.

---

Changes in v2:
- added commit message.

 arch/arm/dts/Makefile     |    1 +
 arch/arm/dts/stv0991.dts  |   23 +++++++++++++++++++++++
 configs/stv0991_defconfig |    1 +
 include/configs/stv0991.h |    3 +++
 4 files changed, 28 insertions(+)
 create mode 100644 arch/arm/dts/stv0991.dts
arch/arm/dts/Makefile +1 -0
index 46a6171..86faf58 100644
@@ -54,6 +54,7 @@ dtb-$(CONFIG_SOCFPGA) +=				\
 	socfpga_arria5_socdk.dtb			\
 	socfpga_cyclone5_socdk.dtb			\
 	socfpga_cyclone5_socrates.dtb
+dtb-$(CONFIG_TARGET_STV0991) += stv0991.dtb
 
 dtb-$(CONFIG_LS102XA) += ls1021a-qds.dtb \
 	ls1021a-twr.dtb
arch/arm/dts/stv0991.dts new file +23 -0
new file mode 100644
index 0000000..b25c48b
@@ -0,0 +1,23 @@
+/dts-v1/;
+
+/ {
+	model = "ST STV0991 application board";
+	compatible = "st,stv0991";
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	chosen {
+		stdout-path = &uart0;
+	};
+
+	memory {
+		device_type="memory";
+		reg = <0x0 0x198000>;
+	};
+
+	uart0: serial at 0x80406000 {
+		compatible = "arm,pl011", "arm,primecell";
+		reg = <0x80406000 0x1000>;
+		clock = <2700000>;
+	};
+};
configs/stv0991_defconfig +1 -0
index 76ba41b..d9edc06 100644
@@ -5,3 +5,4 @@ CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_ETH_DESIGNWARE=y
 CONFIG_NETDEVICES=y
 CONFIG_NET=y
+CONFIG_DEFAULT_DEVICE_TREE="stv0991"
include/configs/stv0991.h +3 -0
index 2f65eda..750eebd 100644
@@ -80,4 +80,7 @@
 #define CONFIG_AUTOBOOT_PROMPT                 \
 	"Hit SPACE in %d seconds to stop autoboot.\n", bootdelay
 #undef CONFIG_HAS_VBAR
+#define CONFIG_OF_EMBED
+#define CONFIG_OF_CONTROL
+#define CONFIG_OF_LIBFDT
 #endif /* __CONFIG_H */
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH v2 1/2 stv0991: fdt: add stv0991 device tree

Hi Vikas,

Quoted 72 lines · Vikas Manocha

This patch adds device tree for the ST Micro stv0991 board & enables device tree control. Progressively device tree support for the drivers being used will also be added.

---

Changes in v2:
- added commit message.

 arch/arm/dts/Makefile     |    1 +
 arch/arm/dts/stv0991.dts  |   23 +++++++++++++++++++++++
 configs/stv0991_defconfig |    1 +
 include/configs/stv0991.h |    3 +++
 4 files changed, 28 insertions(+)
 create mode 100644 arch/arm/dts/stv0991.dts
arch/arm/dts/Makefile +1 -0
index 46a6171..86faf58 100644
@@ -54,6 +54,7 @@ dtb-$(CONFIG_SOCFPGA) +=                              \
        socfpga_arria5_socdk.dtb                        \
        socfpga_cyclone5_socdk.dtb                      \
        socfpga_cyclone5_socrates.dtb
+dtb-$(CONFIG_TARGET_STV0991) += stv0991.dtb
 
 dtb-$(CONFIG_LS102XA) += ls1021a-qds.dtb \
        ls1021a-twr.dtb
arch/arm/dts/stv0991.dts new file +23 -0
new file mode 100644
index 0000000..b25c48b
@@ -0,0 +1,23 @@
+/dts-v1/;
+
+/ {
+       model = "ST STV0991 application board";
+       compatible = "st,stv0991";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       chosen {
+               stdout-path = &uart0;
+       };
+
+       memory {
+               device_type="memory";
+               reg = <0x0 0x198000>;
+       };
+
+       uart0: serial at 0x80406000 {
+               compatible = "arm,pl011", "arm,primecell";
+               reg = <0x80406000 0x1000>;
+               clock = <2700000>;
+       };
+};
configs/stv0991_defconfig +1 -0
index 76ba41b..d9edc06 100644
@@ -5,3 +5,4 @@ CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_ETH_DESIGNWARE=y
 CONFIG_NETDEVICES=y
 CONFIG_NET=y
+CONFIG_DEFAULT_DEVICE_TREE="stv0991"
include/configs/stv0991.h +0 -0
index 2f65eda..750eebd 100644

include/configs/stv0991.h line 83

Quoted 4 lines
include/configs/stv0991.h +1 -0
@@ -80,4 +80,7 @@
 #define CONFIG_AUTOBOOT_PROMPT                 \
        "Hit SPACE in %d seconds to stop autoboot.\n", bootdelay
 #undef CONFIG_HAS_VBAR
+#define CONFIG_OF_EMBED

I just noticed that you use CONFIG_OF_EMBED. Is this just for debugging? It should not be used for normal operation.

From README.fdt-control:

"If CONFIG_OF_EMBED is defined, then it will be picked up and built into the U-Boot image (including u-boot.bin). This is suitable for debugging and development only and is not recommended for production devices."

Quoted 6 lines
include/configs/stv0991.h +2 -1
+#define CONFIG_OF_CONTROL
+#define CONFIG_OF_LIBFDT
 #endif /* __CONFIG_H */
--

1.7.9.5

Regards,
Simon

author
#3 lore raw

PATCH v2 1/2 stv0991: fdt: add stv0991 device tree

Thanks Simon,

Quoted 82 lines · Simon Glass

Hi Vikas,

Quoted 72 lines · Vikas Manocha

This patch adds device tree for the ST Micro stv0991 board & enables device tree control. Progressively device tree support for the drivers being used will also be added.

---

Changes in v2:
- added commit message.

 arch/arm/dts/Makefile     |    1 +
 arch/arm/dts/stv0991.dts  |   23 +++++++++++++++++++++++
 configs/stv0991_defconfig |    1 +
 include/configs/stv0991.h |    3 +++
 4 files changed, 28 insertions(+)
 create mode 100644 arch/arm/dts/stv0991.dts
arch/arm/dts/Makefile +1 -0
index 46a6171..86faf58 100644
@@ -54,6 +54,7 @@ dtb-$(CONFIG_SOCFPGA) +=                              \
        socfpga_arria5_socdk.dtb                        \
        socfpga_cyclone5_socdk.dtb                      \
        socfpga_cyclone5_socrates.dtb
+dtb-$(CONFIG_TARGET_STV0991) += stv0991.dtb
 
 dtb-$(CONFIG_LS102XA) += ls1021a-qds.dtb \
        ls1021a-twr.dtb
arch/arm/dts/stv0991.dts new file +23 -0
new file mode 100644
index 0000000..b25c48b
@@ -0,0 +1,23 @@
+/dts-v1/;
+
+/ {
+       model = "ST STV0991 application board";
+       compatible = "st,stv0991";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       chosen {
+               stdout-path = &uart0;
+       };
+
+       memory {
+               device_type="memory";
+               reg = <0x0 0x198000>;
+       };
+
+       uart0: serial at 0x80406000 {
+               compatible = "arm,pl011", "arm,primecell";
+               reg = <0x80406000 0x1000>;
+               clock = <2700000>;
+       };
+};
configs/stv0991_defconfig +1 -0
index 76ba41b..d9edc06 100644
@@ -5,3 +5,4 @@ CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_ETH_DESIGNWARE=y
 CONFIG_NETDEVICES=y
 CONFIG_NET=y
+CONFIG_DEFAULT_DEVICE_TREE="stv0991"
include/configs/stv0991.h +0 -0
index 2f65eda..750eebd 100644

include/configs/stv0991.h line 83

Quoted 4 lines
include/configs/stv0991.h +1 -0
@@ -80,4 +80,7 @@
 #define CONFIG_AUTOBOOT_PROMPT                 \
        "Hit SPACE in %d seconds to stop autoboot.\n", bootdelay
 #undef CONFIG_HAS_VBAR
+#define CONFIG_OF_EMBED

I just noticed that you use CONFIG_OF_EMBED. Is this just for debugging? It should not be used for normal operation.

Quoted 5 lines

From README.fdt-control:

"If CONFIG_OF_EMBED is defined, then it will be picked up and built into the U-Boot image (including u-boot.bin). This is suitable for debugging and development only and is not recommended for production devices."

You are right, it should be CONFIG_OF_SEPARATE for production.

Rgds,
Vikas

Quoted 8 lines
Quoted 6 lines
include/configs/stv0991.h +2 -1
+#define CONFIG_OF_CONTROL
+#define CONFIG_OF_LIBFDT
 #endif /* __CONFIG_H */
--

1.7.9.5

Regards,
Simon

#4 lore raw

PATCH v2 2/2 stv0991: use fdt for serial port platform data

In reply to Vikas Manocha

This patch ignores the serial port static platform data at compilation time in case of device tree control.

---

Changes in v2:
- added commit message.

 board/st/stv0991/stv0991.c |    2 ++
 1 file changed, 2 insertions(+)
board/st/stv0991/stv0991.c +2 -0
index 38f6e1d..09f973f 100644
@@ -21,6 +21,7 @@ DECLARE_GLOBAL_DATA_PTR;
 struct gpio_regs *const gpioa_regs =
 		(struct gpio_regs *) GPIOA_BASE_ADDR;
 
+#ifndef CONFIG_OF_CONTROL
 static const struct pl01x_serial_platdata serial_platdata = {
 	.base = 0x80406000,
 	.type = TYPE_PL011,
@@ -31,6 +32,7 @@ U_BOOT_DEVICE(stv09911_serials) = {
 	.name = "serial_pl01x",
 	.platdata = &serial_platdata,
 };
+#endif
 
 #ifdef CONFIG_SHOW_BOOT_PROGRESS
 void show_boot_progress(int progress)
Signature · 1 line
1.7.9.5