[U-Boot] [PATCH 1/8] ARM: UniPhier: do not compile platform data when CONFIG_OF_CONTROL=y

Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com ---
arch/arm/cpu/armv7/uniphier/ph1-ld4/Makefile | 2 +- arch/arm/cpu/armv7/uniphier/ph1-pro4/Makefile | 2 +- arch/arm/cpu/armv7/uniphier/ph1-sld8/Makefile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/arm/cpu/armv7/uniphier/ph1-ld4/Makefile b/arch/arm/cpu/armv7/uniphier/ph1-ld4/Makefile index fba1cc7..5d682d3 100644 --- a/arch/arm/cpu/armv7/uniphier/ph1-ld4/Makefile +++ b/arch/arm/cpu/armv7/uniphier/ph1-ld4/Makefile @@ -3,7 +3,7 @@ #
obj-$(CONFIG_DISPLAY_BOARDINFO) += board_info.o -obj-y += platdevice.o +obj-$(if $(CONFIG_OF_CONTROL),,y) += platdevice.o obj-y += boot-mode.o obj-$(CONFIG_SOC_INIT) += bcu_init.o sbc_init.o sg_init.o pll_init.o \ clkrst_init.o diff --git a/arch/arm/cpu/armv7/uniphier/ph1-pro4/Makefile b/arch/arm/cpu/armv7/uniphier/ph1-pro4/Makefile index 74129bc..fd1c432 100644 --- a/arch/arm/cpu/armv7/uniphier/ph1-pro4/Makefile +++ b/arch/arm/cpu/armv7/uniphier/ph1-pro4/Makefile @@ -3,7 +3,7 @@ #
obj-$(CONFIG_DISPLAY_BOARDINFO) += board_info.o -obj-y += platdevice.o +obj-$(if $(CONFIG_OF_CONTROL),,y) += platdevice.o obj-y += boot-mode.o obj-$(CONFIG_SOC_INIT) += sbc_init.o sg_init.o pll_init.o clkrst_init.o obj-$(CONFIG_BOARD_POSTCLK_INIT) += pinctrl.o diff --git a/arch/arm/cpu/armv7/uniphier/ph1-sld8/Makefile b/arch/arm/cpu/armv7/uniphier/ph1-sld8/Makefile index fba1cc7..5d682d3 100644 --- a/arch/arm/cpu/armv7/uniphier/ph1-sld8/Makefile +++ b/arch/arm/cpu/armv7/uniphier/ph1-sld8/Makefile @@ -3,7 +3,7 @@ #
obj-$(CONFIG_DISPLAY_BOARDINFO) += board_info.o -obj-y += platdevice.o +obj-$(if $(CONFIG_OF_CONTROL),,y) += platdevice.o obj-y += boot-mode.o obj-$(CONFIG_SOC_INIT) += bcu_init.o sbc_init.o sg_init.o pll_init.o \ clkrst_init.o

If CONFIG_OF_CONTROL is enabled, lib/fdtdec.c is compiled. It includes <asm/gpio.h> and then <asm/gpio.h> includes <asm/arch/gpio.h>. Consequently, all the SoCs that enable CONFIG_OF_CONTROL must have <asm/arch/gpio.h> even if they do not support GPIO.
In the first place, GPIO has nothing to do with OF_CONTROL. It is wrong that lib/fdtdec.c includes GPIO functions; it should be split into two files, FDT-common things and GPIO things. It is, however, a pretty big work to fix that correctly.
This is a compromised commit to add a dummy <asm/arch/gpio.h> to support OF_CONTROL for UniPhier platform. This dummy header will be removed after FDT-GPIO stuff is fixed correctly.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com ---
I am working on the task to split lib/fdtdec.c and move GPIO functions to drivers/gpio/.
arch/arm/include/asm/arch-uniphier/gpio.h | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 arch/arm/include/asm/arch-uniphier/gpio.h
diff --git a/arch/arm/include/asm/arch-uniphier/gpio.h b/arch/arm/include/asm/arch-uniphier/gpio.h new file mode 100644 index 0000000..1fc4e19 --- /dev/null +++ b/arch/arm/include/asm/arch-uniphier/gpio.h @@ -0,0 +1,6 @@ +/* + * Dummy header file to enable CONFIG_OF_CONTROL. + * If CONFIG_OF_CONTROL is enabled, lib/fdtdec.c is compiled. + * It includes <asm/arch/gpio.h> via <asm/gpio.h>, so those SoCs that enable + * OF_CONTROL must have arch/gpio.h even if GPIO is not supported. + */

Hi Masahiro,
On 26 November 2014 at 02:33, Masahiro Yamada yamada.m@jp.panasonic.com wrote:
If CONFIG_OF_CONTROL is enabled, lib/fdtdec.c is compiled. It includes <asm/gpio.h> and then <asm/gpio.h> includes <asm/arch/gpio.h>. Consequently, all the SoCs that enable CONFIG_OF_CONTROL must have <asm/arch/gpio.h> even if they do not support GPIO.
In the first place, GPIO has nothing to do with OF_CONTROL. It is wrong that lib/fdtdec.c includes GPIO functions; it should be split into two files, FDT-common things and GPIO things. It is, however, a pretty big work to fix that correctly.
This is a compromised commit to add a dummy <asm/arch/gpio.h> to support OF_CONTROL for UniPhier platform. This dummy header will be removed after FDT-GPIO stuff is fixed correctly.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com
I am working on the task to split lib/fdtdec.c and move GPIO functions to drivers/gpio/.
That code is only temporary and we can probably remove it soon. It should move to the GPIO uclass.
Regards, Simon

On 26 November 2014 at 13:18, Simon Glass sjg@chromium.org wrote:
Hi Masahiro,
On 26 November 2014 at 02:33, Masahiro Yamada yamada.m@jp.panasonic.com wrote:
If CONFIG_OF_CONTROL is enabled, lib/fdtdec.c is compiled. It includes <asm/gpio.h> and then <asm/gpio.h> includes <asm/arch/gpio.h>. Consequently, all the SoCs that enable CONFIG_OF_CONTROL must have <asm/arch/gpio.h> even if they do not support GPIO.
In the first place, GPIO has nothing to do with OF_CONTROL. It is wrong that lib/fdtdec.c includes GPIO functions; it should be split into two files, FDT-common things and GPIO things. It is, however, a pretty big work to fix that correctly.
This is a compromised commit to add a dummy <asm/arch/gpio.h> to support OF_CONTROL for UniPhier platform. This dummy header will be removed after FDT-GPIO stuff is fixed correctly.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com
I am working on the task to split lib/fdtdec.c and move GPIO functions to drivers/gpio/.
That code is only temporary and we can probably remove it soon. It should move to the GPIO uclass.
Regards, Simon
Reviewed-by: Simon Glass sjg@chromium.org

Hi Simon,
2014-11-27 5:18 GMT+09:00 Simon Glass sjg@chromium.org:
Hi Masahiro,
On 26 November 2014 at 02:33, Masahiro Yamada yamada.m@jp.panasonic.com wrote:
If CONFIG_OF_CONTROL is enabled, lib/fdtdec.c is compiled. It includes <asm/gpio.h> and then <asm/gpio.h> includes <asm/arch/gpio.h>. Consequently, all the SoCs that enable CONFIG_OF_CONTROL must have <asm/arch/gpio.h> even if they do not support GPIO.
In the first place, GPIO has nothing to do with OF_CONTROL. It is wrong that lib/fdtdec.c includes GPIO functions; it should be split into two files, FDT-common things and GPIO things. It is, however, a pretty big work to fix that correctly.
This is a compromised commit to add a dummy <asm/arch/gpio.h> to support OF_CONTROL for UniPhier platform. This dummy header will be removed after FDT-GPIO stuff is fixed correctly.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com
I am working on the task to split lib/fdtdec.c and move GPIO functions to drivers/gpio/.
That code is only temporary and we can probably remove it soon. It should move to the GPIO uclass.
Do you mean, is it better to not touch lib/fdtdec.c ?
I agree that lib/libfdt/ is not enough for our use, but I am afraid our fdt support code is getting ugly.
Other than GPIO stuff, my concern is we have our libfdt extensions in some places: common/fdt_support.c and lib/fdtdec.c
The functions in the former is prefixed with fdt_ but the ones in the latter is prefixed with fdtdec_.
I do not see consistency.

+Stephen for GPIO discussion
Hi Masahiro,
On 27 November 2014 at 07:52, Masahiro YAMADA yamada.m@jp.panasonic.com wrote:
Hi Simon,
2014-11-27 5:18 GMT+09:00 Simon Glass sjg@chromium.org:
Hi Masahiro,
On 26 November 2014 at 02:33, Masahiro Yamada yamada.m@jp.panasonic.com wrote:
If CONFIG_OF_CONTROL is enabled, lib/fdtdec.c is compiled. It includes <asm/gpio.h> and then <asm/gpio.h> includes <asm/arch/gpio.h>. Consequently, all the SoCs that enable CONFIG_OF_CONTROL must have <asm/arch/gpio.h> even if they do not support GPIO.
In the first place, GPIO has nothing to do with OF_CONTROL. It is wrong that lib/fdtdec.c includes GPIO functions; it should be split into two files, FDT-common things and GPIO things. It is, however, a pretty big work to fix that correctly.
This is a compromised commit to add a dummy <asm/arch/gpio.h> to support OF_CONTROL for UniPhier platform. This dummy header will be removed after FDT-GPIO stuff is fixed correctly.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com
I am working on the task to split lib/fdtdec.c and move GPIO functions to drivers/gpio/.
That code is only temporary and we can probably remove it soon. It should move to the GPIO uclass.
Do you mean, is it better to not touch lib/fdtdec.c ?
The GPIO functions in there are not great. They are not implemented in a general way and don't respect the GPIO binding properly - e.g. a certain value of #gpio-cells is assumed. We need to to be able to decode a GPIO in a general way, something like this function in Linux:
/** * of_get_named_gpio() - Get a GPIO number to use with GPIO API * @np: device node to get GPIO from * @propname: Name of property containing gpio specifier(s) * @index: index of the GPIO * * Returns GPIO number to use with Linux generic GPIO API, or one of the errno * value on the error condition. */ static inline int of_get_named_gpio(struct device_node *np, const char *propname, int index)
(In our case it would be passed the device tree blob and an offset instead of np since we don't have unflattened' device tree support yet)
This function would replace fdtdec_decode_gpio(). If you have time to work on that, it would be great to resolve this and remove all that code from fdtdec. I get Tegra and Exynos working. Now that we have a GPIO uclass there is nothing standing in the way.
I agree that lib/libfdt/ is not enough for our use, but I am afraid our fdt support code is getting ugly.
Other than GPIO stuff, my concern is we have our libfdt extensions in some places: common/fdt_support.c and lib/fdtdec.c
The functions in the former is prefixed with fdt_ but the ones in the latter is prefixed with fdtdec_.
I do not see consistency.
fdt_support - used with CONFIG_OF_LIBFDT, provides support functions to allow booting an OS with device tree. Mostly these functions modify the device tree.
fdtdec - used with CONFIG_OF_CONTROL, provides support for device tree control of U-Boot. May be greatly simplified if we have unflattened device tree support (although we will still want basic functions for memory-constrained use so I'm not sure). Mostly these are decode functions (read-only).
Regards, Simon

2014-11-26 18:33 GMT+09:00 Masahiro Yamada yamada.m@jp.panasonic.com:
If CONFIG_OF_CONTROL is enabled, lib/fdtdec.c is compiled. It includes <asm/gpio.h> and then <asm/gpio.h> includes <asm/arch/gpio.h>. Consequently, all the SoCs that enable CONFIG_OF_CONTROL must have <asm/arch/gpio.h> even if they do not support GPIO.
In the first place, GPIO has nothing to do with OF_CONTROL. It is wrong that lib/fdtdec.c includes GPIO functions; it should be split into two files, FDT-common things and GPIO things. It is, however, a pretty big work to fix that correctly.
This is a compromised commit to add a dummy <asm/arch/gpio.h> to support OF_CONTROL for UniPhier platform. This dummy header will be removed after FDT-GPIO stuff is fixed correctly.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com
Applied to u-boot-uniphier/master.

This commit adds basic device tree sources for UniPhier SoCs/boards.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com ---
arch/arm/dts/Makefile | 4 ++++ arch/arm/dts/uniphier-ph1-ld4-ref.dts | 25 ++++++++++++++++++++++ arch/arm/dts/uniphier-ph1-ld4.dtsi | 32 ++++++++++++++++++++++++++++ arch/arm/dts/uniphier-ph1-pro4-ref.dts | 25 ++++++++++++++++++++++ arch/arm/dts/uniphier-ph1-pro4.dtsi | 38 ++++++++++++++++++++++++++++++++++ arch/arm/dts/uniphier-ph1-sld8-ref.dts | 25 ++++++++++++++++++++++ arch/arm/dts/uniphier-ph1-sld8.dtsi | 32 ++++++++++++++++++++++++++++ 7 files changed, 181 insertions(+) create mode 100644 arch/arm/dts/uniphier-ph1-ld4-ref.dts create mode 100644 arch/arm/dts/uniphier-ph1-ld4.dtsi create mode 100644 arch/arm/dts/uniphier-ph1-pro4-ref.dts create mode 100644 arch/arm/dts/uniphier-ph1-pro4.dtsi create mode 100644 arch/arm/dts/uniphier-ph1-sld8-ref.dts create mode 100644 arch/arm/dts/uniphier-ph1-sld8.dtsi
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index ba6dec9..b6e4d18 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -31,6 +31,10 @@ dtb-$(CONFIG_TEGRA) += tegra20-harmony.dtb \ tegra114-dalmore.dtb \ tegra124-jetson-tk1.dtb \ tegra124-venice2.dtb +dtb-$(CONFIG_ARCH_UNIPHIER) += \ + uniphier-ph1-pro4-ref.dtb \ + uniphier-ph1-ld4-ref.dtb \ + uniphier-ph1-sld8-ref.dtb dtb-$(CONFIG_ZYNQ) += zynq-zc702.dtb \ zynq-zc706.dtb \ zynq-zed.dtb \ diff --git a/arch/arm/dts/uniphier-ph1-ld4-ref.dts b/arch/arm/dts/uniphier-ph1-ld4-ref.dts new file mode 100644 index 0000000..9f690dd --- /dev/null +++ b/arch/arm/dts/uniphier-ph1-ld4-ref.dts @@ -0,0 +1,25 @@ +/* + * Device Tree Source for UniPhier PH1-LD4 Reference Board + * + * Copyright (C) 2014 Panasonic Corporation + * Author: Masahiro Yamada yamada.m@jp.panasonic.com + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +/dts-v1/; +/include/ "uniphier-ph1-ld4.dtsi" + +/ { + model = "Panasonic UniPhier Ph1-LD4 Reference Board"; + compatible = "panasonic,ph1-ld4-ref", "panasonic,ph1-ld4"; + + memory { + device_type = "memory"; + reg = <0x80000000 0x20000000>; + }; + + chosen { + bootargs = "console=ttyPS0,115200 earlyprintk"; + }; +}; diff --git a/arch/arm/dts/uniphier-ph1-ld4.dtsi b/arch/arm/dts/uniphier-ph1-ld4.dtsi new file mode 100644 index 0000000..ee53d9c --- /dev/null +++ b/arch/arm/dts/uniphier-ph1-ld4.dtsi @@ -0,0 +1,32 @@ +/* + * Device Tree Source for UniPhier PH1-LD4 SoC + * + * Copyright (C) 2014 Panasonic Corporation + * Author: Masahiro Yamada yamada.m@jp.panasonic.com + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +/include/ "skeleton.dtsi" + +/ { + compatible = "panasonic,ph1-ld4"; + + cpus { + #size-cells = <0>; + #address-cells = <1>; + + cpu@0 { + device_type = "cpu"; + compatible = "arm,cortex-a9"; + reg = <0>; + }; + }; + + soc { + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + ranges; + }; +}; diff --git a/arch/arm/dts/uniphier-ph1-pro4-ref.dts b/arch/arm/dts/uniphier-ph1-pro4-ref.dts new file mode 100644 index 0000000..9a5823e --- /dev/null +++ b/arch/arm/dts/uniphier-ph1-pro4-ref.dts @@ -0,0 +1,25 @@ +/* + * Device Tree Source for UniPhier PH1-Pro4 Reference Board + * + * Copyright (C) 2014 Panasonic Corporation + * Author: Masahiro Yamada yamada.m@jp.panasonic.com + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +/dts-v1/; +/include/ "uniphier-ph1-pro4.dtsi" + +/ { + model = "Panasonic UniPhier Ph1-Pro4 Reference Board"; + compatible = "panasonic,ph1-pro4-ref", "panasonic,ph1-pro4"; + + memory { + device_type = "memory"; + reg = <0x80000000 0x40000000>; + }; + + chosen { + bootargs = "console=ttyPS0,115200 earlyprintk"; + }; +}; diff --git a/arch/arm/dts/uniphier-ph1-pro4.dtsi b/arch/arm/dts/uniphier-ph1-pro4.dtsi new file mode 100644 index 0000000..7619c36 --- /dev/null +++ b/arch/arm/dts/uniphier-ph1-pro4.dtsi @@ -0,0 +1,38 @@ +/* + * Device Tree Source for UniPhier PH1-Pro4 SoC + * + * Copyright (C) 2014 Panasonic Corporation + * Author: Masahiro Yamada yamada.m@jp.panasonic.com + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +/include/ "skeleton.dtsi" + +/ { + compatible = "panasonic,ph1-pro4"; + + cpus { + #size-cells = <0>; + #address-cells = <1>; + + cpu@0 { + device_type = "cpu"; + compatible = "arm,cortex-a9"; + reg = <0>; + }; + + cpu@1 { + device_type = "cpu"; + compatible = "arm,cortex-a9"; + reg = <1>; + }; + }; + + soc { + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + ranges; + }; +}; diff --git a/arch/arm/dts/uniphier-ph1-sld8-ref.dts b/arch/arm/dts/uniphier-ph1-sld8-ref.dts new file mode 100644 index 0000000..75f35da --- /dev/null +++ b/arch/arm/dts/uniphier-ph1-sld8-ref.dts @@ -0,0 +1,25 @@ +/* + * Device Tree Source for UniPhier PH1-sLD8 Reference Board + * + * Copyright (C) 2014 Panasonic Corporation + * Author: Masahiro Yamada yamada.m@jp.panasonic.com + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +/dts-v1/; +/include/ "uniphier-ph1-sld8.dtsi" + +/ { + model = "Panasonic UniPhier Ph1-sLD8 Reference Board"; + compatible = "panasonic,ph1-sld8-ref", "panasonic,ph1-sld8"; + + memory { + device_type = "memory"; + reg = <0x80000000 0x20000000>; + }; + + chosen { + bootargs = "console=ttyPS0,115200 earlyprintk"; + }; +}; diff --git a/arch/arm/dts/uniphier-ph1-sld8.dtsi b/arch/arm/dts/uniphier-ph1-sld8.dtsi new file mode 100644 index 0000000..2f895e9 --- /dev/null +++ b/arch/arm/dts/uniphier-ph1-sld8.dtsi @@ -0,0 +1,32 @@ +/* + * Device Tree Source for UniPhier PH1-sLD8 SoC + * + * Copyright (C) 2014 Panasonic Corporation + * Author: Masahiro Yamada yamada.m@jp.panasonic.com + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +/include/ "skeleton.dtsi" + +/ { + compatible = "panasonic,ph1-sld8"; + + cpus { + #size-cells = <0>; + #address-cells = <1>; + + cpu@0 { + device_type = "cpu"; + compatible = "arm,cortex-a9"; + reg = <0>; + }; + }; + + soc { + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + ranges; + }; +};

2014-11-26 18:33 GMT+09:00 Masahiro Yamada yamada.m@jp.panasonic.com:
This commit adds basic device tree sources for UniPhier SoCs/boards.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com
Applied to u-boot-uniphier/master.

This commit implements the ofdata_to_platdata handler for the UniPhier serial driver and adds serial device nodes to the device tree sources.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com ---
arch/arm/dts/uniphier-ph1-ld4-ref.dts | 9 +++++++++ arch/arm/dts/uniphier-ph1-ld4.dtsi | 28 ++++++++++++++++++++++++++++ arch/arm/dts/uniphier-ph1-pro4-ref.dts | 9 +++++++++ arch/arm/dts/uniphier-ph1-pro4.dtsi | 28 ++++++++++++++++++++++++++++ arch/arm/dts/uniphier-ph1-sld8-ref.dts | 9 +++++++++ arch/arm/dts/uniphier-ph1-sld8.dtsi | 28 ++++++++++++++++++++++++++++ drivers/serial/serial_uniphier.c | 19 +++++++++++-------- 7 files changed, 122 insertions(+), 8 deletions(-)
diff --git a/arch/arm/dts/uniphier-ph1-ld4-ref.dts b/arch/arm/dts/uniphier-ph1-ld4-ref.dts index 9f690dd..49642e1 100644 --- a/arch/arm/dts/uniphier-ph1-ld4-ref.dts +++ b/arch/arm/dts/uniphier-ph1-ld4-ref.dts @@ -21,5 +21,14 @@
chosen { bootargs = "console=ttyPS0,115200 earlyprintk"; + stdout-path = &uart0; }; }; + +&uart0 { + status = "okay"; +}; + +&uart1 { + status = "okay"; +}; diff --git a/arch/arm/dts/uniphier-ph1-ld4.dtsi b/arch/arm/dts/uniphier-ph1-ld4.dtsi index ee53d9c..c1c2c62 100644 --- a/arch/arm/dts/uniphier-ph1-ld4.dtsi +++ b/arch/arm/dts/uniphier-ph1-ld4.dtsi @@ -28,5 +28,33 @@ #address-cells = <1>; #size-cells = <1>; ranges; + + uart0: serial@54006800 { + compatible = "panasonic,uniphier-uart"; + status = "disabled"; + reg = <0x54006800 0x20>; + clock-frequency = <36864000>; + }; + + uart1: serial@54006900 { + compatible = "panasonic,uniphier-uart"; + status = "disabled"; + reg = <0x54006900 0x20>; + clock-frequency = <36864000>; + }; + + uart2: serial@54006a00 { + compatible = "panasonic,uniphier-uart"; + status = "disabled"; + reg = <0x54006a00 0x20>; + clock-frequency = <36864000>; + }; + + uart3: serial@54006b00 { + compatible = "panasonic,uniphier-uart"; + status = "disabled"; + reg = <0x54006b00 0x20>; + clock-frequency = <36864000>; + }; }; }; diff --git a/arch/arm/dts/uniphier-ph1-pro4-ref.dts b/arch/arm/dts/uniphier-ph1-pro4-ref.dts index 9a5823e..cfed70b 100644 --- a/arch/arm/dts/uniphier-ph1-pro4-ref.dts +++ b/arch/arm/dts/uniphier-ph1-pro4-ref.dts @@ -21,5 +21,14 @@
chosen { bootargs = "console=ttyPS0,115200 earlyprintk"; + stdout-path = &uart0; }; }; + +&uart0 { + status = "okay"; +}; + +&uart1 { + status = "okay"; +}; diff --git a/arch/arm/dts/uniphier-ph1-pro4.dtsi b/arch/arm/dts/uniphier-ph1-pro4.dtsi index 7619c36..b53fbc5 100644 --- a/arch/arm/dts/uniphier-ph1-pro4.dtsi +++ b/arch/arm/dts/uniphier-ph1-pro4.dtsi @@ -34,5 +34,33 @@ #address-cells = <1>; #size-cells = <1>; ranges; + + uart0: serial@54006800 { + compatible = "panasonic,uniphier-uart"; + status = "disabled"; + reg = <0x54006800 0x20>; + clock-frequency = <73728000>; + }; + + uart1: serial@54006900 { + compatible = "panasonic,uniphier-uart"; + status = "disabled"; + reg = <0x54006900 0x20>; + clock-frequency = <73728000>; + }; + + uart2: serial@54006a00 { + compatible = "panasonic,uniphier-uart"; + status = "disabled"; + reg = <0x54006a00 0x20>; + clock-frequency = <73728000>; + }; + + uart3: serial@54006b00 { + compatible = "panasonic,uniphier-uart"; + status = "disabled"; + reg = <0x54006b00 0x20>; + clock-frequency = <73728000>; + }; }; }; diff --git a/arch/arm/dts/uniphier-ph1-sld8-ref.dts b/arch/arm/dts/uniphier-ph1-sld8-ref.dts index 75f35da..d38df3c 100644 --- a/arch/arm/dts/uniphier-ph1-sld8-ref.dts +++ b/arch/arm/dts/uniphier-ph1-sld8-ref.dts @@ -21,5 +21,14 @@
chosen { bootargs = "console=ttyPS0,115200 earlyprintk"; + stdout-path = &uart0; }; }; + +&uart0 { + status = "okay"; +}; + +&uart1 { + status = "okay"; +}; diff --git a/arch/arm/dts/uniphier-ph1-sld8.dtsi b/arch/arm/dts/uniphier-ph1-sld8.dtsi index 2f895e9..9a8da5e 100644 --- a/arch/arm/dts/uniphier-ph1-sld8.dtsi +++ b/arch/arm/dts/uniphier-ph1-sld8.dtsi @@ -28,5 +28,33 @@ #address-cells = <1>; #size-cells = <1>; ranges; + + uart0: serial@54006800 { + compatible = "panasonic,uniphier-uart"; + status = "disabled"; + reg = <0x54006800 0x20>; + clock-frequency = <80000000>; + }; + + uart1: serial@54006900 { + compatible = "panasonic,uniphier-uart"; + status = "disabled"; + reg = <0x54006900 0x20>; + clock-frequency = <80000000>; + }; + + uart2: serial@54006a00 { + compatible = "panasonic,uniphier-uart"; + status = "disabled"; + reg = <0x54006a00 0x20>; + clock-frequency = <80000000>; + }; + + uart3: serial@54006b00 { + compatible = "panasonic,uniphier-uart"; + status = "disabled"; + reg = <0x54006b00 0x20>; + clock-frequency = <80000000>; + }; }; }; diff --git a/drivers/serial/serial_uniphier.c b/drivers/serial/serial_uniphier.c index 6046efb..e8a1608 100644 --- a/drivers/serial/serial_uniphier.c +++ b/drivers/serial/serial_uniphier.c @@ -11,6 +11,7 @@ #include <dm/device.h> #include <dm/platform_data/serial-uniphier.h> #include <serial.h> +#include <fdtdec.h>
#define UART_REG(x) \ u8 x; \ @@ -113,19 +114,21 @@ static int uniphier_serial_remove(struct udevice *dev) }
#ifdef CONFIG_OF_CONTROL -static const struct udevice_id uniphier_uart_of_match = { - { .compatible = "panasonic,uniphier-uart"}, +static const struct udevice_id uniphier_uart_of_match[] = { + { .compatible = "panasonic,uniphier-uart" }, {}, };
static int uniphier_serial_ofdata_to_platdata(struct udevice *dev) { - /* - * TODO: Masahiro Yamada (yamada.m@jp.panasonic.com) - * - * Implement conversion code from DTB to platform data - * when supporting CONFIG_OF_CONTROL on UniPhir platform. - */ + struct uniphier_serial_platform_data *plat = dev_get_platdata(dev); + DECLARE_GLOBAL_DATA_PTR; + + plat->base = fdtdec_get_addr(gd->fdt_blob, dev->of_offset, "reg"); + plat->uartclk = fdtdec_get_int(gd->fdt_blob, dev->of_offset, + "clock-frequency", 0); + + return 0; } #endif

2014-11-26 18:34 GMT+09:00 Masahiro Yamada yamada.m@jp.panasonic.com:
This commit implements the ofdata_to_platdata handler for the UniPhier serial driver and adds serial device nodes to the device tree sources.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com
Applied to u-boot-uniphier/master.

If CONFIG_OF_CONTROL is defined, search device tree nodes that are compatible with "panasonic,uniphier-ehci" and take the base address from their "reg" property.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com Cc: Marek Vasut marex@denx.de ---
arch/arm/cpu/armv7/uniphier/ph1-ld4/platdevice.c | 1 - arch/arm/cpu/armv7/uniphier/ph1-pro4/platdevice.c | 1 - arch/arm/cpu/armv7/uniphier/ph1-sld8/platdevice.c | 1 - arch/arm/dts/uniphier-ph1-ld4-ref.dts | 8 +++++ arch/arm/dts/uniphier-ph1-ld4.dtsi | 18 +++++++++++ arch/arm/dts/uniphier-ph1-pro4-ref.dts | 8 +++++ arch/arm/dts/uniphier-ph1-pro4.dtsi | 12 +++++++ arch/arm/dts/uniphier-ph1-sld8-ref.dts | 8 +++++ arch/arm/dts/uniphier-ph1-sld8.dtsi | 18 +++++++++++ drivers/usb/host/ehci-uniphier.c | 38 ++++++++++++++++++++++- 10 files changed, 109 insertions(+), 4 deletions(-)
diff --git a/arch/arm/cpu/armv7/uniphier/ph1-ld4/platdevice.c b/arch/arm/cpu/armv7/uniphier/ph1-ld4/platdevice.c index 62f5b01..9d51299 100644 --- a/arch/arm/cpu/armv7/uniphier/ph1-ld4/platdevice.c +++ b/arch/arm/cpu/armv7/uniphier/ph1-ld4/platdevice.c @@ -14,7 +14,6 @@ SERIAL_DEVICE(1, 0x54006900, UART_MASTER_CLK) SERIAL_DEVICE(2, 0x54006a00, UART_MASTER_CLK) SERIAL_DEVICE(3, 0x54006b00, UART_MASTER_CLK)
-/* USB : TODO for Masahiro Yamada: move base address to Device Tree */ struct uniphier_ehci_platform_data uniphier_ehci_platdata[] = { { .base = 0x5a800100, diff --git a/arch/arm/cpu/armv7/uniphier/ph1-pro4/platdevice.c b/arch/arm/cpu/armv7/uniphier/ph1-pro4/platdevice.c index 1843d04..31ee2a2 100644 --- a/arch/arm/cpu/armv7/uniphier/ph1-pro4/platdevice.c +++ b/arch/arm/cpu/armv7/uniphier/ph1-pro4/platdevice.c @@ -14,7 +14,6 @@ SERIAL_DEVICE(1, 0x54006900, UART_MASTER_CLK) SERIAL_DEVICE(2, 0x54006a00, UART_MASTER_CLK) SERIAL_DEVICE(3, 0x54006b00, UART_MASTER_CLK)
-/* USB : TODO for Masahiro Yamada: move base address to Device Tree */ struct uniphier_ehci_platform_data uniphier_ehci_platdata[] = { { .base = 0x5a800100, diff --git a/arch/arm/cpu/armv7/uniphier/ph1-sld8/platdevice.c b/arch/arm/cpu/armv7/uniphier/ph1-sld8/platdevice.c index 72ec599..ea0691d 100644 --- a/arch/arm/cpu/armv7/uniphier/ph1-sld8/platdevice.c +++ b/arch/arm/cpu/armv7/uniphier/ph1-sld8/platdevice.c @@ -14,7 +14,6 @@ SERIAL_DEVICE(1, 0x54006900, UART_MASTER_CLK) SERIAL_DEVICE(2, 0x54006a00, UART_MASTER_CLK) SERIAL_DEVICE(3, 0x54006b00, UART_MASTER_CLK)
-/* USB : TODO for Masahiro Yamada: move base address to Device Tree */ struct uniphier_ehci_platform_data uniphier_ehci_platdata[] = { { .base = 0x5a800100, diff --git a/arch/arm/dts/uniphier-ph1-ld4-ref.dts b/arch/arm/dts/uniphier-ph1-ld4-ref.dts index 49642e1..14b6091 100644 --- a/arch/arm/dts/uniphier-ph1-ld4-ref.dts +++ b/arch/arm/dts/uniphier-ph1-ld4-ref.dts @@ -32,3 +32,11 @@ &uart1 { status = "okay"; }; + +&usb0 { + status = "okay"; +}; + +&usb1 { + status = "okay"; +}; diff --git a/arch/arm/dts/uniphier-ph1-ld4.dtsi b/arch/arm/dts/uniphier-ph1-ld4.dtsi index c1c2c62..80074c5 100644 --- a/arch/arm/dts/uniphier-ph1-ld4.dtsi +++ b/arch/arm/dts/uniphier-ph1-ld4.dtsi @@ -56,5 +56,23 @@ reg = <0x54006b00 0x20>; clock-frequency = <36864000>; }; + + usb0: usb@5a800100 { + compatible = "panasonic,uniphier-ehci", "usb-ehci"; + status = "disabled"; + reg = <0x5a800100 0x100>; + }; + + usb1: usb@5a810100 { + compatible = "panasonic,uniphier-ehci", "usb-ehci"; + status = "disabled"; + reg = <0x5a810100 0x100>; + }; + + usb2: usb@5a820100 { + compatible = "panasonic,uniphier-ehci", "usb-ehci"; + status = "disabled"; + reg = <0x5a820100 0x100>; + }; }; }; diff --git a/arch/arm/dts/uniphier-ph1-pro4-ref.dts b/arch/arm/dts/uniphier-ph1-pro4-ref.dts index cfed70b..e724d4e 100644 --- a/arch/arm/dts/uniphier-ph1-pro4-ref.dts +++ b/arch/arm/dts/uniphier-ph1-pro4-ref.dts @@ -32,3 +32,11 @@ &uart1 { status = "okay"; }; + +&usb0 { + status = "okay"; +}; + +&usb1 { + status = "okay"; +}; diff --git a/arch/arm/dts/uniphier-ph1-pro4.dtsi b/arch/arm/dts/uniphier-ph1-pro4.dtsi index b53fbc5..dd84269 100644 --- a/arch/arm/dts/uniphier-ph1-pro4.dtsi +++ b/arch/arm/dts/uniphier-ph1-pro4.dtsi @@ -62,5 +62,17 @@ reg = <0x54006b00 0x20>; clock-frequency = <73728000>; }; + + usb0: usb@5a800100 { + compatible = "panasonic,uniphier-ehci", "usb-ehci"; + status = "disabled"; + reg = <0x5a800100 0x100>; + }; + + usb1: usb@5a810100 { + compatible = "panasonic,uniphier-ehci", "usb-ehci"; + status = "disabled"; + reg = <0x5a810100 0x100>; + }; }; }; diff --git a/arch/arm/dts/uniphier-ph1-sld8-ref.dts b/arch/arm/dts/uniphier-ph1-sld8-ref.dts index d38df3c..27ddeda 100644 --- a/arch/arm/dts/uniphier-ph1-sld8-ref.dts +++ b/arch/arm/dts/uniphier-ph1-sld8-ref.dts @@ -32,3 +32,11 @@ &uart1 { status = "okay"; }; + +&usb0 { + status = "okay"; +}; + +&usb1 { + status = "okay"; +}; diff --git a/arch/arm/dts/uniphier-ph1-sld8.dtsi b/arch/arm/dts/uniphier-ph1-sld8.dtsi index 9a8da5e..43a39f5 100644 --- a/arch/arm/dts/uniphier-ph1-sld8.dtsi +++ b/arch/arm/dts/uniphier-ph1-sld8.dtsi @@ -56,5 +56,23 @@ reg = <0x54006b00 0x20>; clock-frequency = <80000000>; }; + + usb0: usb@5a800100 { + compatible = "panasonic,uniphier-ehci", "usb-ehci"; + status = "disabled"; + reg = <0x5a800100 0x100>; + }; + + usb1: usb@5a810100 { + compatible = "panasonic,uniphier-ehci", "usb-ehci"; + status = "disabled"; + reg = <0x5a810100 0x100>; + }; + + usb2: usb@5a820100 { + compatible = "panasonic,uniphier-ehci", "usb-ehci"; + status = "disabled"; + reg = <0x5a820100 0x100>; + }; }; }; diff --git a/drivers/usb/host/ehci-uniphier.c b/drivers/usb/host/ehci-uniphier.c index 77f6c9d..32a4375 100644 --- a/drivers/usb/host/ehci-uniphier.c +++ b/drivers/usb/host/ehci-uniphier.c @@ -6,10 +6,43 @@ */
#include <common.h> +#include <linux/err.h> #include <usb.h> #include <asm/arch/ehci-uniphier.h> #include "ehci.h"
+#ifdef CONFIG_OF_CONTROL +#include <fdtdec.h> +DECLARE_GLOBAL_DATA_PTR; + +#define FDT gd->fdt_blob +#define COMPAT "panasonic,uniphier-ehci" + +static int get_uniphier_ehci_base(int index, struct ehci_hccr **base) +{ + int offset; + + for (offset = fdt_node_offset_by_compatible(FDT, 0, COMPAT); + offset >= 0; + offset = fdt_node_offset_by_compatible(FDT, offset, COMPAT)) { + if (index == 0) { + *base = (struct ehci_hccr *) + fdtdec_get_addr(FDT, offset, "reg"); + return 0; + } + index--; + } + + return -ENODEV; /* not found */ +} +#else +static int get_uniphier_ehci_base(int index, struct ehci_hccr **base) +{ + *base = (struct ehci_hccr *)uniphier_ehci_platdata[index].base; + return 0; +} +#endif + /* * Create the appropriate control structures to manage * a new EHCI host controller. @@ -17,12 +50,15 @@ int ehci_hcd_init(int index, enum usb_init_type init, struct ehci_hccr **hccr, struct ehci_hcor **hcor) { + int ret; struct ehci_hccr *cr; struct ehci_hcor *or;
uniphier_ehci_reset(index, 0);
- cr = (struct ehci_hccr *)(uniphier_ehci_platdata[index].base); + ret = get_uniphier_ehci_base(index, &cr); + if (ret < 0) + return ret; or = (void *)cr + HC_LENGTH(ehci_readl(&cr->cr_capbase));
*hccr = cr;

2014-11-26 18:34 GMT+09:00 Masahiro Yamada yamada.m@jp.panasonic.com:
If CONFIG_OF_CONTROL is defined, search device tree nodes that are compatible with "panasonic,uniphier-ehci" and take the base address from their "reg" property.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com Cc: Marek Vasut marex@denx.de
Applied to u-boot-uniphier/master.

Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com ---
arch/arm/Kconfig | 1 + configs/ph1_ld4_defconfig | 1 + configs/ph1_pro4_defconfig | 1 + configs/ph1_sld8_defconfig | 1 + 4 files changed, 4 insertions(+)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index b9ac59e..0982117 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -793,6 +793,7 @@ config ARCH_UNIPHIER bool "Panasonic UniPhier platform" select CPU_V7 select SUPPORT_SPL + select OF_CONTROL if !SPL_BUILD
endchoice
diff --git a/configs/ph1_ld4_defconfig b/configs/ph1_ld4_defconfig index f54b15f..b50503f 100644 --- a/configs/ph1_ld4_defconfig +++ b/configs/ph1_ld4_defconfig @@ -2,6 +2,7 @@ CONFIG_SPL=y +S:CONFIG_ARM=y +S:CONFIG_ARCH_UNIPHIER=y +S:CONFIG_MACH_PH1_LD4=y +CONFIG_DEFAULT_DEVICE_TREE="uniphier-ph1-ld4-ref" CONFIG_DM=y CONFIG_NAND_DENALI=y CONFIG_SYS_NAND_DENALI_64BIT=y diff --git a/configs/ph1_pro4_defconfig b/configs/ph1_pro4_defconfig index e795752..acb8dc7 100644 --- a/configs/ph1_pro4_defconfig +++ b/configs/ph1_pro4_defconfig @@ -2,6 +2,7 @@ CONFIG_SPL=y +S:CONFIG_ARM=y +S:CONFIG_ARCH_UNIPHIER=y +S:CONFIG_MACH_PH1_PRO4=y +CONFIG_DEFAULT_DEVICE_TREE="uniphier-ph1-pro4-ref" CONFIG_DM=y CONFIG_NAND_DENALI=y CONFIG_SYS_NAND_DENALI_64BIT=y diff --git a/configs/ph1_sld8_defconfig b/configs/ph1_sld8_defconfig index 6510937..3f1f0c1 100644 --- a/configs/ph1_sld8_defconfig +++ b/configs/ph1_sld8_defconfig @@ -2,6 +2,7 @@ CONFIG_SPL=y +S:CONFIG_ARM=y +S:CONFIG_ARCH_UNIPHIER=y +S:CONFIG_MACH_PH1_SLD8=y +CONFIG_DEFAULT_DEVICE_TREE="uniphier-ph1-sld8-ref" CONFIG_DM=y CONFIG_NAND_DENALI=y CONFIG_SYS_NAND_DENALI_64BIT=y

2014-11-26 18:34 GMT+09:00 Masahiro Yamada yamada.m@jp.panasonic.com:
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com
Applied to u-boot-uniphier/master.

If CONFIG_OF_CONTROL is defined and the root node of the device tree has "model" property, display the model name instead of the hard-coded board name.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com ---
arch/arm/cpu/armv7/uniphier/Makefile | 1 + arch/arm/cpu/armv7/uniphier/board_info.c | 25 +++++++++++++++++++++++ arch/arm/cpu/armv7/uniphier/ph1-ld4/board_info.c | 8 +------- arch/arm/cpu/armv7/uniphier/ph1-pro4/board_info.c | 9 ++------ arch/arm/cpu/armv7/uniphier/ph1-sld8/board_info.c | 9 ++------ arch/arm/include/asm/arch-uniphier/board.h | 2 ++ 6 files changed, 33 insertions(+), 21 deletions(-) create mode 100644 arch/arm/cpu/armv7/uniphier/board_info.c
diff --git a/arch/arm/cpu/armv7/uniphier/Makefile b/arch/arm/cpu/armv7/uniphier/Makefile index 0f64d25..77650bd 100644 --- a/arch/arm/cpu/armv7/uniphier/Makefile +++ b/arch/arm/cpu/armv7/uniphier/Makefile @@ -11,6 +11,7 @@ obj-y += cache_uniphier.o obj-$(CONFIG_BOARD_POSTCLK_INIT) += board_postclk_init.o obj-y += dram_init.o obj-$(CONFIG_DISPLAY_CPUINFO) += cpu_info.o +obj-$(CONFIG_DISPLAY_BOARDINFO) += board_info.o obj-$(CONFIG_BOARD_LATE_INIT) += board_late_init.o obj-$(CONFIG_UNIPHIER_SMP) += smp.o obj-$(CONFIG_CMD_PINMON) += cmd_pinmon.o diff --git a/arch/arm/cpu/armv7/uniphier/board_info.c b/arch/arm/cpu/armv7/uniphier/board_info.c new file mode 100644 index 0000000..bd56c11 --- /dev/null +++ b/arch/arm/cpu/armv7/uniphier/board_info.c @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2014 Panasonic Corporation + * Author: Masahiro Yamada yamada.m@jp.panasonic.com + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <common.h> +#include <asm/arch/board.h> + +int checkboard(void) +{ + const char *model = NULL; +#ifdef CONFIG_OF_CONTROL + DECLARE_GLOBAL_DATA_PTR; + + model = (const char *)fdt_getprop(gd->fdt_blob, 0, "model", NULL); +#endif + if (!model) + model = uniphier_board_name; + + printf("Board: %s\n", model); + + return check_support_card(); +} diff --git a/arch/arm/cpu/armv7/uniphier/ph1-ld4/board_info.c b/arch/arm/cpu/armv7/uniphier/ph1-ld4/board_info.c index 27d772e..a84b77f 100644 --- a/arch/arm/cpu/armv7/uniphier/ph1-ld4/board_info.c +++ b/arch/arm/cpu/armv7/uniphier/ph1-ld4/board_info.c @@ -5,12 +5,6 @@ * SPDX-License-Identifier: GPL-2.0+ */
-#include <common.h> #include <asm/arch/board.h>
-int checkboard(void) -{ - puts("Board: PH1-LD4 Board\n"); - - return check_support_card(); -} +const char *uniphier_board_name = "PH1-LD4 Board"; diff --git a/arch/arm/cpu/armv7/uniphier/ph1-pro4/board_info.c b/arch/arm/cpu/armv7/uniphier/ph1-pro4/board_info.c index 325a4f6..94897d5 100644 --- a/arch/arm/cpu/armv7/uniphier/ph1-pro4/board_info.c +++ b/arch/arm/cpu/armv7/uniphier/ph1-pro4/board_info.c @@ -5,12 +5,7 @@ * SPDX-License-Identifier: GPL-2.0+ */
-#include <common.h> -#include <asm/arch/board.h>
-int checkboard(void) -{ - puts("Board: PH1-Pro4 Board\n"); +#include <asm/arch/board.h>
- return check_support_card(); -} +const char *uniphier_board_name = "PH1-Pro4 Board"; diff --git a/arch/arm/cpu/armv7/uniphier/ph1-sld8/board_info.c b/arch/arm/cpu/armv7/uniphier/ph1-sld8/board_info.c index 15dc289..3a293be 100644 --- a/arch/arm/cpu/armv7/uniphier/ph1-sld8/board_info.c +++ b/arch/arm/cpu/armv7/uniphier/ph1-sld8/board_info.c @@ -5,12 +5,7 @@ * SPDX-License-Identifier: GPL-2.0+ */
-#include <common.h> -#include <asm/arch/board.h>
-int checkboard(void) -{ - puts("Board: PH1-sLD8 Board\n"); +#include <asm/arch/board.h>
- return check_support_card(); -} +const char *uniphier_board_name = "PH1-sLD8 Board"; diff --git a/arch/arm/include/asm/arch-uniphier/board.h b/arch/arm/include/asm/arch-uniphier/board.h index e6ba4e4..1b50dd2 100644 --- a/arch/arm/include/asm/arch-uniphier/board.h +++ b/arch/arm/include/asm/arch-uniphier/board.h @@ -22,6 +22,8 @@ static inline int check_support_card(void) } #endif
+extern const char *uniphier_board_name; + static inline void uniphier_board_reset(void) { support_card_reset();

Hi Masahiro,
On 26 November 2014 at 02:34, Masahiro Yamada yamada.m@jp.panasonic.com wrote:
If CONFIG_OF_CONTROL is defined and the root node of the device tree has "model" property, display the model name instead of the hard-coded board name.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com
Reviewed-by: Simon Glass sjg@chromium.org
This works, but also see if CONFIG_DISPLAY_BOARDINFO_LATE works for you. Or perhaps we can do this prior to relocation if CONFIG_DISPLAY_BOARDINFO is not defined?
Anyway your code is not really board-specific.
Regards, Simon

Hi Simon,
2014-11-27 5:15 GMT+09:00 Simon Glass sjg@chromium.org:
Hi Masahiro,
On 26 November 2014 at 02:34, Masahiro Yamada yamada.m@jp.panasonic.com wrote:
If CONFIG_OF_CONTROL is defined and the root node of the device tree has "model" property, display the model name instead of the hard-coded board name.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com
Reviewed-by: Simon Glass sjg@chromium.org
This works, but also see if CONFIG_DISPLAY_BOARDINFO_LATE works for you. Or perhaps we can do this prior to relocation if CONFIG_DISPLAY_BOARDINFO is not defined?
Anyway your code is not really board-specific.
I knew show_model_r() in board_r.c, but I want the board name information at the top of the message of the serial console.
Maybe can ) implement show_model_f() that is similar to show_model_r().
If so, I am happy to use it.

Hi Masahiro,
On 27 November 2014 at 07:44, Masahiro YAMADA yamada.m@jp.panasonic.com wrote:
Hi Simon,
2014-11-27 5:15 GMT+09:00 Simon Glass sjg@chromium.org:
Hi Masahiro,
On 26 November 2014 at 02:34, Masahiro Yamada yamada.m@jp.panasonic.com wrote:
If CONFIG_OF_CONTROL is defined and the root node of the device tree has "model" property, display the model name instead of the hard-coded board name.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com
Reviewed-by: Simon Glass sjg@chromium.org
This works, but also see if CONFIG_DISPLAY_BOARDINFO_LATE works for you. Or perhaps we can do this prior to relocation if CONFIG_DISPLAY_BOARDINFO is not defined?
Anyway your code is not really board-specific.
I knew show_model_r() in board_r.c, but I want the board name information at the top of the message of the serial console.
Maybe can ) implement show_model_f() that is similar to show_model_r().
If so, I am happy to use it.
Sounds good to me. At least for platforms with no display (i.e. that don't need to wait for stdio to be ready) this makes sense.
Regards, Simon

Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com ---
configs/ph1_ld4_defconfig | 25 +++++++++++++++++++++++++ configs/ph1_pro4_defconfig | 25 +++++++++++++++++++++++++ configs/ph1_sld8_defconfig | 25 +++++++++++++++++++++++++ include/configs/uniphier-common.h | 15 --------------- 4 files changed, 75 insertions(+), 15 deletions(-)
diff --git a/configs/ph1_ld4_defconfig b/configs/ph1_ld4_defconfig index b50503f..de068e9 100644 --- a/configs/ph1_ld4_defconfig +++ b/configs/ph1_ld4_defconfig @@ -1,7 +1,32 @@ CONFIG_SPL=y +CONFIG_FIT=y +CONFIG_FIT_VERBOSE=y +S:CONFIG_ARM=y +S:CONFIG_ARCH_UNIPHIER=y +S:CONFIG_MACH_PH1_LD4=y +CONFIG_HUSH_PARSER=y +CONFIG_CMD_BDI=y +CONFIG_CMD_CONSOLE=y +CONFIG_CMD_BOOTD=y +CONFIG_CMD_RUN=y +CONFIG_CMD_IMI=y +CONFIG_CMD_IMLS=y +CONFIG_CMD_EDITENV=y +CONFIG_CMD_SAVEENV=y +CONFIG_CMD_MEMORY=y +CONFIG_CMD_LOADB=y +CONFIG_CMD_LOADS=y +CONFIG_CMD_FLASH=y +CONFIG_CMD_NAND=y +CONFIG_CMD_USB=y +CONFIG_CMD_ECHO=y +CONFIG_CMD_ITEST=y +CONFIG_CMD_SOURCE=y +CONFIG_CMD_NET=y +CONFIG_CMD_TFTPPUT=y +CONFIG_CMD_NFS=y +CONFIG_CMD_PING=y +CONFIG_CMD_TIME=y CONFIG_DEFAULT_DEVICE_TREE="uniphier-ph1-ld4-ref" CONFIG_DM=y CONFIG_NAND_DENALI=y diff --git a/configs/ph1_pro4_defconfig b/configs/ph1_pro4_defconfig index acb8dc7..f4ddf5f 100644 --- a/configs/ph1_pro4_defconfig +++ b/configs/ph1_pro4_defconfig @@ -1,7 +1,32 @@ CONFIG_SPL=y +CONFIG_FIT=y +CONFIG_FIT_VERBOSE=y +S:CONFIG_ARM=y +S:CONFIG_ARCH_UNIPHIER=y +S:CONFIG_MACH_PH1_PRO4=y +CONFIG_HUSH_PARSER=y +CONFIG_CMD_BDI=y +CONFIG_CMD_CONSOLE=y +CONFIG_CMD_BOOTD=y +CONFIG_CMD_RUN=y +CONFIG_CMD_IMI=y +CONFIG_CMD_IMLS=y +CONFIG_CMD_EDITENV=y +CONFIG_CMD_SAVEENV=y +CONFIG_CMD_MEMORY=y +CONFIG_CMD_LOADB=y +CONFIG_CMD_LOADS=y +CONFIG_CMD_FLASH=y +CONFIG_CMD_NAND=y +CONFIG_CMD_USB=y +CONFIG_CMD_ECHO=y +CONFIG_CMD_ITEST=y +CONFIG_CMD_SOURCE=y +CONFIG_CMD_NET=y +CONFIG_CMD_TFTPPUT=y +CONFIG_CMD_NFS=y +CONFIG_CMD_PING=y +CONFIG_CMD_TIME=y CONFIG_DEFAULT_DEVICE_TREE="uniphier-ph1-pro4-ref" CONFIG_DM=y CONFIG_NAND_DENALI=y diff --git a/configs/ph1_sld8_defconfig b/configs/ph1_sld8_defconfig index 3f1f0c1..ee14382 100644 --- a/configs/ph1_sld8_defconfig +++ b/configs/ph1_sld8_defconfig @@ -1,7 +1,32 @@ CONFIG_SPL=y +CONFIG_FIT=y +CONFIG_FIT_VERBOSE=y +S:CONFIG_ARM=y +S:CONFIG_ARCH_UNIPHIER=y +S:CONFIG_MACH_PH1_SLD8=y +CONFIG_HUSH_PARSER=y +CONFIG_CMD_BDI=y +CONFIG_CMD_CONSOLE=y +CONFIG_CMD_BOOTD=y +CONFIG_CMD_RUN=y +CONFIG_CMD_IMI=y +CONFIG_CMD_IMLS=y +CONFIG_CMD_EDITENV=y +CONFIG_CMD_SAVEENV=y +CONFIG_CMD_MEMORY=y +CONFIG_CMD_LOADB=y +CONFIG_CMD_LOADS=y +CONFIG_CMD_FLASH=y +CONFIG_CMD_NAND=y +CONFIG_CMD_USB=y +CONFIG_CMD_ECHO=y +CONFIG_CMD_ITEST=y +CONFIG_CMD_SOURCE=y +CONFIG_CMD_NET=y +CONFIG_CMD_TFTPPUT=y +CONFIG_CMD_NFS=y +CONFIG_CMD_PING=y +CONFIG_CMD_TIME=y CONFIG_DEFAULT_DEVICE_TREE="uniphier-ph1-sld8-ref" CONFIG_DM=y CONFIG_NAND_DENALI=y diff --git a/include/configs/uniphier-common.h b/include/configs/uniphier-common.h index 95f4ee1..31ab470 100644 --- a/include/configs/uniphier-common.h +++ b/include/configs/uniphier-common.h @@ -112,7 +112,6 @@ are defined. Select only one of them." #define CONFIG_SYS_LONGHELP /* undef to save memory */
#define CONFIG_CMDLINE_EDITING /* add command line history */ -#define CONFIG_SYS_HUSH_PARSER /* use "hush" command parser */ #define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */ /* Print Buffer Size */ #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) @@ -143,15 +142,6 @@ are defined. Select only one of them." */ #define CONFIG_ARP_TIMEOUT 500UL /* 0.5 msec */
-/* - * Command line configuration. - */ -#include <config_cmd_default.h> - -#define CONFIG_CMD_PING -#define CONFIG_CMD_TIME -#define CONFIG_CMD_NAND /* NAND flash suppport */ - #define CONFIG_SYS_MAX_NAND_DEVICE 1 #define CONFIG_SYS_NAND_MAX_CHIPS 2 #define CONFIG_SYS_NAND_ONFI_DETECTION @@ -167,7 +157,6 @@ are defined. Select only one of them." #define CONFIG_SYS_NAND_BAD_BLOCK_POS 0
/* USB */ -#define CONFIG_CMD_USB #define CONFIG_USB_MAX_CONTROLLER_COUNT 2 #define CONFIG_CMD_FAT #define CONFIG_FAT_WRITE @@ -224,10 +213,6 @@ are defined. Select only one of them." "add_default_bootargs=setenv bootargs $bootargs" \ " console=ttyS0,$baudrate\0" \
-/* FIT support */ -#define CONFIG_FIT -#define CONFIG_FIT_VERBOSE 1 /* enable fit_format_{error,warning}() */ - /* Open Firmware flat tree */ #define CONFIG_OF_LIBFDT

2014-11-26 18:34 GMT+09:00 Masahiro Yamada yamada.m@jp.panasonic.com:
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com
Applied to u-boot-uniphier/master.

2014-11-26 18:33 GMT+09:00 Masahiro Yamada yamada.m@jp.panasonic.com:
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com
Applied to u-boot-uniphier/master.
participants (3)
-
Masahiro YAMADA
-
Masahiro Yamada
-
Simon Glass