[U-Boot] [PATCH 2/3] ARM: uniphier: enable SPL_OF_CONTROL

Masahiro Yamada yamada.masahiro at socionext.com
Fri Aug 28 13:13:18 CEST 2015


Device Tree really improves code maintainability and is now
available for SPL too.

This is the state-of-the-art implementation in U-boot.

The board files (platform data) are no longer needed.

Signed-off-by: Masahiro Yamada <yamada.masahiro at socionext.com>
---

 arch/arm/Kconfig                             |  1 +
 arch/arm/dts/uniphier-ph1-ld4-ref.dts        |  9 ++++++---
 arch/arm/dts/uniphier-ph1-pro4-ref.dts       |  9 ++++++---
 arch/arm/dts/uniphier-ph1-sld3-ref.dts       |  9 ++++++---
 arch/arm/dts/uniphier-ph1-sld8-ref.dts       |  9 ++++++---
 arch/arm/mach-uniphier/ph1-ld4/Makefile      |  1 -
 arch/arm/mach-uniphier/ph1-ld4/platdevice.c  | 15 ---------------
 arch/arm/mach-uniphier/ph1-pro4/Makefile     |  1 -
 arch/arm/mach-uniphier/ph1-pro4/platdevice.c | 15 ---------------
 arch/arm/mach-uniphier/ph1-sld3/Makefile     |  1 -
 arch/arm/mach-uniphier/ph1-sld3/platdevice.c |  1 -
 arch/arm/mach-uniphier/ph1-sld8/platdevice.c | 15 ---------------
 doc/README.uniphier                          | 10 +++++-----
 include/configs/uniphier.h                   |  2 +-
 14 files changed, 31 insertions(+), 67 deletions(-)
 delete mode 100644 arch/arm/mach-uniphier/ph1-ld4/platdevice.c
 delete mode 100644 arch/arm/mach-uniphier/ph1-pro4/platdevice.c
 delete mode 100644 arch/arm/mach-uniphier/ph1-sld3/platdevice.c
 delete mode 100644 arch/arm/mach-uniphier/ph1-sld8/platdevice.c

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 5f3af77..cd88df4 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -816,6 +816,7 @@ config ARCH_UNIPHIER
 	select SUPPORT_SPL
 	select SPL
 	select OF_CONTROL
+	select SPL_OF_CONTROL
 	select DM
 	select SPL_DM
 	select DM_SERIAL
diff --git a/arch/arm/dts/uniphier-ph1-ld4-ref.dts b/arch/arm/dts/uniphier-ph1-ld4-ref.dts
index 25e487a..7c36581 100644
--- a/arch/arm/dts/uniphier-ph1-ld4-ref.dts
+++ b/arch/arm/dts/uniphier-ph1-ld4-ref.dts
@@ -1,9 +1,7 @@
 /*
  * Device Tree Source for UniPhier PH1-LD4 Reference Board
  *
- * Copyright (C) 2014-2015 Panasonic Corporation
- * Copyright (C) 2015      Socionext Inc.
- *   Author: Masahiro Yamada <yamada.masahiro at socionext.com>
+ * Copyright (C) 2014-2015 Masahiro Yamada <yamada.masahiro at socionext.com>
  *
  * SPDX-License-Identifier:	GPL-2.0+	X11
  */
@@ -57,3 +55,8 @@
 &usb1 {
 	status = "okay";
 };
+
+/* for U-boot only */
+&uart0 {
+       u-boot,dm-pre-reloc;
+};
diff --git a/arch/arm/dts/uniphier-ph1-pro4-ref.dts b/arch/arm/dts/uniphier-ph1-pro4-ref.dts
index b4b7f61..fd3e8c6 100644
--- a/arch/arm/dts/uniphier-ph1-pro4-ref.dts
+++ b/arch/arm/dts/uniphier-ph1-pro4-ref.dts
@@ -1,9 +1,7 @@
 /*
  * Device Tree Source for UniPhier PH1-Pro4 Reference Board
  *
- * Copyright (C) 2014-2015 Panasonic Corporation
- * Copyright (C) 2015      Socionext Inc.
- *   Author: Masahiro Yamada <yamada.masahiro at socionext.com>
+ * Copyright (C) 2014-2015 Masahiro Yamada <yamada.masahiro at socionext.com>
  *
  * SPDX-License-Identifier:	GPL-2.0+	X11
  */
@@ -56,3 +54,8 @@
 &usb0 {
 	status = "okay";
 };
+
+/* for U-boot only */
+&uart0 {
+       u-boot,dm-pre-reloc;
+};
diff --git a/arch/arm/dts/uniphier-ph1-sld3-ref.dts b/arch/arm/dts/uniphier-ph1-sld3-ref.dts
index 9dc9296..2406bfc 100644
--- a/arch/arm/dts/uniphier-ph1-sld3-ref.dts
+++ b/arch/arm/dts/uniphier-ph1-sld3-ref.dts
@@ -1,9 +1,7 @@
 /*
  * Device Tree Source for UniPhier PH1-sLD3 Reference Board
  *
- * Copyright (C) 2014-2015 Panasonic Corporation
- * Copyright (C) 2015      Socionext Inc.
- *   Author: Masahiro Yamada <yamada.masahiro at socionext.com>
+ * Copyright (C) 2014-2015 Masahiro Yamada <yamada.masahiro at socionext.com>
  *
  * SPDX-License-Identifier:	GPL-2.0+	X11
  */
@@ -56,3 +54,8 @@
 &usb1 {
 	status = "okay";
 };
+
+/* for U-boot only */
+&uart0 {
+       u-boot,dm-pre-reloc;
+};
diff --git a/arch/arm/dts/uniphier-ph1-sld8-ref.dts b/arch/arm/dts/uniphier-ph1-sld8-ref.dts
index 2d1359c..b7ed275 100644
--- a/arch/arm/dts/uniphier-ph1-sld8-ref.dts
+++ b/arch/arm/dts/uniphier-ph1-sld8-ref.dts
@@ -1,9 +1,7 @@
 /*
  * Device Tree Source for UniPhier PH1-sLD8 Reference Board
  *
- * Copyright (C) 2014-2015 Panasonic Corporation
- * Copyright (C) 2015      Socionext Inc.
- *   Author: Masahiro Yamada <yamada.masahiro at socionext.com>
+ * Copyright (C) 2014-2015 Masahiro Yamada <yamada.masahiro at socionext.com>
  *
  * SPDX-License-Identifier:	GPL-2.0+	X11
  */
@@ -57,3 +55,8 @@
 &usb1 {
 	status = "okay";
 };
+
+/* for U-boot only */
+&uart0 {
+       u-boot,dm-pre-reloc;
+};
diff --git a/arch/arm/mach-uniphier/ph1-ld4/Makefile b/arch/arm/mach-uniphier/ph1-ld4/Makefile
index af815c3..1410b12 100644
--- a/arch/arm/mach-uniphier/ph1-ld4/Makefile
+++ b/arch/arm/mach-uniphier/ph1-ld4/Makefile
@@ -8,7 +8,6 @@ obj-y += bcu_init.o sg_init.o pll_init.o early_clkrst_init.o \
 	early_pinctrl.o pll_spectrum.o umc_init.o ddrphy_init.o
 obj-$(CONFIG_PFC_MICRO_SUPPORT_CARD) += sbc_init.o
 obj-$(CONFIG_DCC_MICRO_SUPPORT_CARD) += sbc_init_3cs.o
-obj-$(CONFIG_SPL_DM) += platdevice.o
 else
 obj-$(CONFIG_BOARD_EARLY_INIT_F) += pinctrl.o clkrst_init.o
 endif
diff --git a/arch/arm/mach-uniphier/ph1-ld4/platdevice.c b/arch/arm/mach-uniphier/ph1-ld4/platdevice.c
deleted file mode 100644
index c0e6294..0000000
diff --git a/arch/arm/mach-uniphier/ph1-pro4/Makefile b/arch/arm/mach-uniphier/ph1-pro4/Makefile
index f6a584e..229f443 100644
--- a/arch/arm/mach-uniphier/ph1-pro4/Makefile
+++ b/arch/arm/mach-uniphier/ph1-pro4/Makefile
@@ -8,7 +8,6 @@ obj-y += sg_init.o pll_init.o early_clkrst_init.o \
 	early_pinctrl.o pll_spectrum.o umc_init.o ddrphy_init.o
 obj-$(CONFIG_PFC_MICRO_SUPPORT_CARD) += sbc_init.o
 obj-$(CONFIG_DCC_MICRO_SUPPORT_CARD) += sbc_init_3cs.o
-obj-$(CONFIG_SPL_DM) += platdevice.o
 else
 obj-$(CONFIG_BOARD_EARLY_INIT_F) += pinctrl.o clkrst_init.o
 endif
diff --git a/arch/arm/mach-uniphier/ph1-pro4/platdevice.c b/arch/arm/mach-uniphier/ph1-pro4/platdevice.c
deleted file mode 100644
index 7440ced..0000000
diff --git a/arch/arm/mach-uniphier/ph1-sld3/Makefile b/arch/arm/mach-uniphier/ph1-sld3/Makefile
index f3f7ad4..aff5d64 100644
--- a/arch/arm/mach-uniphier/ph1-sld3/Makefile
+++ b/arch/arm/mach-uniphier/ph1-sld3/Makefile
@@ -8,7 +8,6 @@ obj-y += bcu_init.o memconf.o sg_init.o pll_init.o early_clkrst_init.o \
 	early_pinctrl.o pll_spectrum.o umc_init.o
 obj-$(CONFIG_PFC_MICRO_SUPPORT_CARD) += sbc_init.o
 obj-$(CONFIG_DCC_MICRO_SUPPORT_CARD) += sbc_init_3cs.o
-obj-$(CONFIG_SPL_DM) += platdevice.o
 else
 obj-$(CONFIG_BOARD_EARLY_INIT_F) += pinctrl.o clkrst_init.o
 endif
diff --git a/arch/arm/mach-uniphier/ph1-sld3/platdevice.c b/arch/arm/mach-uniphier/ph1-sld3/platdevice.c
deleted file mode 100644
index 6521067..0000000
diff --git a/arch/arm/mach-uniphier/ph1-sld8/platdevice.c b/arch/arm/mach-uniphier/ph1-sld8/platdevice.c
deleted file mode 100644
index aa334a1..0000000
diff --git a/doc/README.uniphier b/doc/README.uniphier
index 52d681b..e936f40 100644
--- a/doc/README.uniphier
+++ b/doc/README.uniphier
@@ -52,12 +52,12 @@ Burn U-Boot images to NAND
 --------------------------
 
 Write two files to the NAND device as follows:
- - spl/u-boot-spl.bin at the offset address 0x00000000
- - u-boot-dtb.img     at the offset address 0x00010000
+ - spl/u-boot-spl-dtb.bin at the offset address 0x00000000
+ - u-boot-dtb.img         at the offset address 0x00010000
 
 If a TFTP server is available, the images can be easily updated.
-Just copy the u-boot-spl.bin and u-boot-dtb.img to the TFTP public directory,
-and then run the following command at the U-Boot command line:
+Just copy the u-boot-spl-dtb.bin and u-boot-dtb.img to the TFTP public
+directory, and then run the following command at the U-Boot command line:
 
   => run nandupdate
 
@@ -129,4 +129,4 @@ newer SoCs.  Even if it is, EA[25] is not connected on most of the boards.
 
 --
 Masahiro Yamada <yamada.masahiro at socionext.com>
-Jul. 2015
+Aug. 2015
diff --git a/include/configs/uniphier.h b/include/configs/uniphier.h
index b0a7daa..d59564b 100644
--- a/include/configs/uniphier.h
+++ b/include/configs/uniphier.h
@@ -288,7 +288,7 @@
 	"netdev=eth0\0"						\
 	"verify=n\0"						\
 	"nandupdate=nand erase 0 0x00100000 &&"			\
-		"tftpboot u-boot-spl.bin &&"			\
+		"tftpboot u-boot-spl-dtb.bin &&"		\
 		"nand write $loadaddr 0 0x00010000 &&"		\
 		"tftpboot u-boot-dtb.img &&"			\
 		"nand write $loadaddr 0x00010000 0x000f0000\0"	\
-- 
1.9.1



More information about the U-Boot mailing list