ARM: uniphier: enable SPL_OF_CONTROL
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@socionext.com> Reviewed-by: Marek Vasut <marex@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
		
							parent
							
								
									9271614eb3
								
							
						
					
					
						commit
						f4e190e317
					
				| 
						 | 
					@ -816,6 +816,7 @@ config ARCH_UNIPHIER
 | 
				
			||||||
	select SUPPORT_SPL
 | 
						select SUPPORT_SPL
 | 
				
			||||||
	select SPL
 | 
						select SPL
 | 
				
			||||||
	select OF_CONTROL
 | 
						select OF_CONTROL
 | 
				
			||||||
 | 
						select SPL_OF_CONTROL
 | 
				
			||||||
	select DM
 | 
						select DM
 | 
				
			||||||
	select SPL_DM
 | 
						select SPL_DM
 | 
				
			||||||
	select DM_SERIAL
 | 
						select DM_SERIAL
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,9 +1,7 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * Device Tree Source for UniPhier PH1-LD4 Reference Board
 | 
					 * Device Tree Source for UniPhier PH1-LD4 Reference Board
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * Copyright (C) 2014-2015 Panasonic Corporation
 | 
					 * Copyright (C) 2014-2015 Masahiro Yamada <yamada.masahiro@socionext.com>
 | 
				
			||||||
 * Copyright (C) 2015      Socionext Inc.
 | 
					 | 
				
			||||||
 *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
 | 
					 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * SPDX-License-Identifier:	GPL-2.0+	X11
 | 
					 * SPDX-License-Identifier:	GPL-2.0+	X11
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
| 
						 | 
					@ -57,3 +55,8 @@
 | 
				
			||||||
&usb1 {
 | 
					&usb1 {
 | 
				
			||||||
	status = "okay";
 | 
						status = "okay";
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/* for U-boot only */
 | 
				
			||||||
 | 
					&uart0 {
 | 
				
			||||||
 | 
					       u-boot,dm-pre-reloc;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,9 +1,7 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * Device Tree Source for UniPhier PH1-Pro4 Reference Board
 | 
					 * Device Tree Source for UniPhier PH1-Pro4 Reference Board
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * Copyright (C) 2014-2015 Panasonic Corporation
 | 
					 * Copyright (C) 2014-2015 Masahiro Yamada <yamada.masahiro@socionext.com>
 | 
				
			||||||
 * Copyright (C) 2015      Socionext Inc.
 | 
					 | 
				
			||||||
 *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
 | 
					 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * SPDX-License-Identifier:	GPL-2.0+	X11
 | 
					 * SPDX-License-Identifier:	GPL-2.0+	X11
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
| 
						 | 
					@ -56,3 +54,8 @@
 | 
				
			||||||
&usb0 {
 | 
					&usb0 {
 | 
				
			||||||
	status = "okay";
 | 
						status = "okay";
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/* for U-boot only */
 | 
				
			||||||
 | 
					&uart0 {
 | 
				
			||||||
 | 
					       u-boot,dm-pre-reloc;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,9 +1,7 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * Device Tree Source for UniPhier PH1-sLD3 Reference Board
 | 
					 * Device Tree Source for UniPhier PH1-sLD3 Reference Board
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * Copyright (C) 2014-2015 Panasonic Corporation
 | 
					 * Copyright (C) 2014-2015 Masahiro Yamada <yamada.masahiro@socionext.com>
 | 
				
			||||||
 * Copyright (C) 2015      Socionext Inc.
 | 
					 | 
				
			||||||
 *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
 | 
					 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * SPDX-License-Identifier:	GPL-2.0+	X11
 | 
					 * SPDX-License-Identifier:	GPL-2.0+	X11
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
| 
						 | 
					@ -56,3 +54,8 @@
 | 
				
			||||||
&usb1 {
 | 
					&usb1 {
 | 
				
			||||||
	status = "okay";
 | 
						status = "okay";
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/* for U-boot only */
 | 
				
			||||||
 | 
					&uart0 {
 | 
				
			||||||
 | 
					       u-boot,dm-pre-reloc;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,9 +1,7 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * Device Tree Source for UniPhier PH1-sLD8 Reference Board
 | 
					 * Device Tree Source for UniPhier PH1-sLD8 Reference Board
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * Copyright (C) 2014-2015 Panasonic Corporation
 | 
					 * Copyright (C) 2014-2015 Masahiro Yamada <yamada.masahiro@socionext.com>
 | 
				
			||||||
 * Copyright (C) 2015      Socionext Inc.
 | 
					 | 
				
			||||||
 *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
 | 
					 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * SPDX-License-Identifier:	GPL-2.0+	X11
 | 
					 * SPDX-License-Identifier:	GPL-2.0+	X11
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
| 
						 | 
					@ -57,3 +55,8 @@
 | 
				
			||||||
&usb1 {
 | 
					&usb1 {
 | 
				
			||||||
	status = "okay";
 | 
						status = "okay";
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/* for U-boot only */
 | 
				
			||||||
 | 
					&uart0 {
 | 
				
			||||||
 | 
					       u-boot,dm-pre-reloc;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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
 | 
						early_pinctrl.o pll_spectrum.o umc_init.o ddrphy_init.o
 | 
				
			||||||
obj-$(CONFIG_PFC_MICRO_SUPPORT_CARD) += sbc_init.o
 | 
					obj-$(CONFIG_PFC_MICRO_SUPPORT_CARD) += sbc_init.o
 | 
				
			||||||
obj-$(CONFIG_DCC_MICRO_SUPPORT_CARD) += sbc_init_3cs.o
 | 
					obj-$(CONFIG_DCC_MICRO_SUPPORT_CARD) += sbc_init_3cs.o
 | 
				
			||||||
obj-$(CONFIG_SPL_DM) += platdevice.o
 | 
					 | 
				
			||||||
else
 | 
					else
 | 
				
			||||||
obj-$(CONFIG_BOARD_EARLY_INIT_F) += pinctrl.o clkrst_init.o
 | 
					obj-$(CONFIG_BOARD_EARLY_INIT_F) += pinctrl.o clkrst_init.o
 | 
				
			||||||
endif
 | 
					endif
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,15 +0,0 @@
 | 
				
			||||||
/*
 | 
					 | 
				
			||||||
 * Copyright (C) 2014-2015 Panasonic Corporation
 | 
					 | 
				
			||||||
 *   Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * SPDX-License-Identifier:	GPL-2.0+
 | 
					 | 
				
			||||||
 */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#include <mach/platdevice.h>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#define UART_MASTER_CLK		36864000
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
SERIAL_DEVICE(0, 0x54006800, UART_MASTER_CLK)
 | 
					 | 
				
			||||||
SERIAL_DEVICE(1, 0x54006900, UART_MASTER_CLK)
 | 
					 | 
				
			||||||
SERIAL_DEVICE(2, 0x54006a00, UART_MASTER_CLK)
 | 
					 | 
				
			||||||
SERIAL_DEVICE(3, 0x54006b00, UART_MASTER_CLK)
 | 
					 | 
				
			||||||
| 
						 | 
					@ -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
 | 
						early_pinctrl.o pll_spectrum.o umc_init.o ddrphy_init.o
 | 
				
			||||||
obj-$(CONFIG_PFC_MICRO_SUPPORT_CARD) += sbc_init.o
 | 
					obj-$(CONFIG_PFC_MICRO_SUPPORT_CARD) += sbc_init.o
 | 
				
			||||||
obj-$(CONFIG_DCC_MICRO_SUPPORT_CARD) += sbc_init_3cs.o
 | 
					obj-$(CONFIG_DCC_MICRO_SUPPORT_CARD) += sbc_init_3cs.o
 | 
				
			||||||
obj-$(CONFIG_SPL_DM) += platdevice.o
 | 
					 | 
				
			||||||
else
 | 
					else
 | 
				
			||||||
obj-$(CONFIG_BOARD_EARLY_INIT_F) += pinctrl.o clkrst_init.o
 | 
					obj-$(CONFIG_BOARD_EARLY_INIT_F) += pinctrl.o clkrst_init.o
 | 
				
			||||||
endif
 | 
					endif
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,15 +0,0 @@
 | 
				
			||||||
/*
 | 
					 | 
				
			||||||
 * Copyright (C) 2014-2015 Panasonic Corporation
 | 
					 | 
				
			||||||
 *   Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * SPDX-License-Identifier:	GPL-2.0+
 | 
					 | 
				
			||||||
 */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#include <mach/platdevice.h>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#define UART_MASTER_CLK		73728000
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
SERIAL_DEVICE(0, 0x54006800, UART_MASTER_CLK)
 | 
					 | 
				
			||||||
SERIAL_DEVICE(1, 0x54006900, UART_MASTER_CLK)
 | 
					 | 
				
			||||||
SERIAL_DEVICE(2, 0x54006a00, UART_MASTER_CLK)
 | 
					 | 
				
			||||||
SERIAL_DEVICE(3, 0x54006b00, UART_MASTER_CLK)
 | 
					 | 
				
			||||||
| 
						 | 
					@ -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
 | 
						early_pinctrl.o pll_spectrum.o umc_init.o
 | 
				
			||||||
obj-$(CONFIG_PFC_MICRO_SUPPORT_CARD) += sbc_init.o
 | 
					obj-$(CONFIG_PFC_MICRO_SUPPORT_CARD) += sbc_init.o
 | 
				
			||||||
obj-$(CONFIG_DCC_MICRO_SUPPORT_CARD) += sbc_init_3cs.o
 | 
					obj-$(CONFIG_DCC_MICRO_SUPPORT_CARD) += sbc_init_3cs.o
 | 
				
			||||||
obj-$(CONFIG_SPL_DM) += platdevice.o
 | 
					 | 
				
			||||||
else
 | 
					else
 | 
				
			||||||
obj-$(CONFIG_BOARD_EARLY_INIT_F) += pinctrl.o clkrst_init.o
 | 
					obj-$(CONFIG_BOARD_EARLY_INIT_F) += pinctrl.o clkrst_init.o
 | 
				
			||||||
endif
 | 
					endif
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1 +0,0 @@
 | 
				
			||||||
#include "../ph1-ld4/platdevice.c"
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,15 +0,0 @@
 | 
				
			||||||
/*
 | 
					 | 
				
			||||||
 * Copyright (C) 2014-2015 Panasonic Corporation
 | 
					 | 
				
			||||||
 *   Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * SPDX-License-Identifier:	GPL-2.0+
 | 
					 | 
				
			||||||
 */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#include <mach/platdevice.h>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#define UART_MASTER_CLK		80000000
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
SERIAL_DEVICE(0, 0x54006800, UART_MASTER_CLK)
 | 
					 | 
				
			||||||
SERIAL_DEVICE(1, 0x54006900, UART_MASTER_CLK)
 | 
					 | 
				
			||||||
SERIAL_DEVICE(2, 0x54006a00, UART_MASTER_CLK)
 | 
					 | 
				
			||||||
SERIAL_DEVICE(3, 0x54006b00, UART_MASTER_CLK)
 | 
					 | 
				
			||||||
| 
						 | 
					@ -52,12 +52,12 @@ Burn U-Boot images to NAND
 | 
				
			||||||
--------------------------
 | 
					--------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Write two files to the NAND device as follows:
 | 
					Write two files to the NAND device as follows:
 | 
				
			||||||
 - spl/u-boot-spl.bin at the offset address 0x00000000
 | 
					 - spl/u-boot-spl-dtb.bin at the offset address 0x00000000
 | 
				
			||||||
 - u-boot-dtb.img         at the offset address 0x00010000
 | 
					 - u-boot-dtb.img         at the offset address 0x00010000
 | 
				
			||||||
 | 
					
 | 
				
			||||||
If a TFTP server is available, the images can be easily updated.
 | 
					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,
 | 
					Just copy the u-boot-spl-dtb.bin and u-boot-dtb.img to the TFTP public
 | 
				
			||||||
and then run the following command at the U-Boot command line:
 | 
					directory, and then run the following command at the U-Boot command line:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  => run nandupdate
 | 
					  => 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@socionext.com>
 | 
					Masahiro Yamada <yamada.masahiro@socionext.com>
 | 
				
			||||||
Jul. 2015
 | 
					Aug. 2015
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -288,7 +288,7 @@
 | 
				
			||||||
	"netdev=eth0\0"						\
 | 
						"netdev=eth0\0"						\
 | 
				
			||||||
	"verify=n\0"						\
 | 
						"verify=n\0"						\
 | 
				
			||||||
	"nandupdate=nand erase 0 0x00100000 &&"			\
 | 
						"nandupdate=nand erase 0 0x00100000 &&"			\
 | 
				
			||||||
		"tftpboot u-boot-spl.bin &&"			\
 | 
							"tftpboot u-boot-spl-dtb.bin &&"		\
 | 
				
			||||||
		"nand write $loadaddr 0 0x00010000 &&"		\
 | 
							"nand write $loadaddr 0 0x00010000 &&"		\
 | 
				
			||||||
		"tftpboot u-boot-dtb.img &&"			\
 | 
							"tftpboot u-boot-dtb.img &&"			\
 | 
				
			||||||
		"nand write $loadaddr 0x00010000 0x000f0000\0"	\
 | 
							"nand write $loadaddr 0x00010000 0x000f0000\0"	\
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue