[U-Boot] [PATCH v2 0/6] ARM: UniPhier: add doc, improve I2C EEPROM access

Masahiro Yamada (6): ARM: UniPhier: use "&&" instead of ";" in commands ARM: UniPhier: add environment variable to update images in NAND ARM: UniPhier: add a simple README file for UniPhier platform MAINTAINERS: claim maintainership of files with "uniphier" pattern ARM: UniPhier: move EEPROM device node into a separate DTS ARM: UniPhier: set I2C offset length of on-board EEPROM in DTS
MAINTAINERS | 2 +- arch/arm/dts/uniphier-ph1-ld4-ref.dts | 7 +-- arch/arm/dts/uniphier-ph1-pro4-ref.dts | 7 +-- arch/arm/dts/uniphier-ph1-sld3-ref.dts | 7 +-- arch/arm/dts/uniphier-ph1-sld8-ref.dts | 7 +-- arch/arm/dts/uniphier-ref-daughter.dtsi | 16 +++++++ doc/README.uniphier | 85 +++++++++++++++++++++++++++++++++ include/configs/uniphier.h | 15 ++++-- 8 files changed, 120 insertions(+), 26 deletions(-) create mode 100644 arch/arm/dts/uniphier-ref-daughter.dtsi create mode 100644 doc/README.uniphier

Run the next command only when the previous one succeeded.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com ---
Changes in v2: - Newly added
include/configs/uniphier.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/include/configs/uniphier.h b/include/configs/uniphier.h index 9ad47f6..43d2a4c 100644 --- a/include/configs/uniphier.h +++ b/include/configs/uniphier.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012-2014 Panasonic Corporation + * Copyright (C) 2012-2015 Panasonic Corporation * Author: Masahiro Yamada yamada.m@jp.panasonic.com * * SPDX-License-Identifier: GPL-2.0+ @@ -235,11 +235,11 @@ "image_offset=0x00080000\0" \ "image_size=0x00f00000\0" \ "verify=n\0" \ - "norboot=run add_default_bootargs;" \ + "norboot=run add_default_bootargs &&" \ "bootm $image_offset\0" \ - "nandboot=run add_default_bootargs;" \ - "nand read $loadaddr $image_offset $image_size;" \ - "bootm\0" \ + "nandboot=run add_default_bootargs &&" \ + "nand read $loadaddr $image_offset $image_size &&" \ + "bootm\0" \ "add_default_bootargs=setenv bootargs $bootargs" \ " console=ttyS0,$baudrate\0" \

To boot UniPhier boards with the NAND boot mode, two images (u-boot-spl.bin and u-boot-dtb.img) must be written at the correct offset addresses.
TFTP downloading is useful to update such images in the NAND device. We generally do:
=> nand erase 0 0x100000 => tftpboot u-boot-spl.bin => nand write $loadaddr 0 0x10000 => tftpboot u-boot-dtb.img => nand write $loadaddr 0x10000 0xf0000
It is a tedious and error-prone operation.
This commit provides the shorthand:
=> run nandupdate
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com ---
Changes in v2: - Newly added
include/configs/uniphier.h | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/include/configs/uniphier.h b/include/configs/uniphier.h index 43d2a4c..35bea1a 100644 --- a/include/configs/uniphier.h +++ b/include/configs/uniphier.h @@ -235,6 +235,11 @@ "image_offset=0x00080000\0" \ "image_size=0x00f00000\0" \ "verify=n\0" \ + "nandupdate=nand erase 0 0x100000 &&" \ + "tftpboot u-boot-spl.bin &&" \ + "nand write $loadaddr 0 0x10000 &&" \ + "tftpboot u-boot-dtb.img &&" \ + "nand write $loadaddr 0x10000 0xf0000\0" \ "norboot=run add_default_bootargs &&" \ "bootm $image_offset\0" \ "nandboot=run add_default_bootargs &&" \

Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com ---
Changes in v2: - Add more information
doc/README.uniphier | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 doc/README.uniphier
diff --git a/doc/README.uniphier b/doc/README.uniphier new file mode 100644 index 0000000..2b12576 --- /dev/null +++ b/doc/README.uniphier @@ -0,0 +1,85 @@ +U-Boot for UniPhier SoC family +============================== + + +Tested toolchains +----------------- + + (a) Ubuntu packages (CROSS_COMPILE=arm-linux-gnueabi-) + + If you are building U-Boot on Ubuntu, its standard package is recommended. + You can install it as follows: + + $ sudo apt-get install gcc-arm-linux-gnueabi- + + (b) Linaro compilers (CROSS_COMPILE=arm-linux-gnueabihf-) + + You can download pre-built toolchains from: + + http://www.linaro.org/downloads/ + + (c) kernel.org compilers (CROSS_COMPILE=arm-unknown-linux-gnueabi-) + + You can download pre-built toolchains from: + + ftp://www.kernel.org/pub/tools/crosstool/files/bin/ + + +Compile the source +------------------ + +PH1-Pro4: + $ make ph1_pro4_defconfig + $ make CROSS_COMPILE=arm-linux-gnueabi- + +PH1-LD4: + $ make ph1_ld4_defconfig + $ make CROSS_COMPILE=arm-linux-gnueabi- + +PH1-sLD8: + $ make ph1_sld8_defconfig + $ make CROSS_COMPILE=arm-linux-gnueabi- + +You may wish to change the "CROSS_COMPILE=arm-linux-gnueabi-" +to use your favorite compiler. + + +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 + +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 from the U-Boot command line: + + => run nandupdate + + +UniPhier specific commands +-------------------------- + + - pinmon (enabled by CONFIG_CMD_PINMON) + shows the boot mode pins that has been latched at the power-on reset + + - ddrphy (enabled by CONFIG_CMD_DDRPHY_DUMP) + shows the DDR PHY parameters set by the PHY training + + +Supported devices +----------------- + + - UART (on-chip) + - NAND + - USB (2.0) + - LAN (on-board SMSC9118) + - I2C + - EEPROM (connected to the on-board I2C bus) + - Support card (SRAM, NOR flash, some peripherals) + + +-- +Masahiro Yamada yamada.m@jp.panasonic.com +Feb. 2015

The pattern "N: uniphier" can cover - drivers/serial/serial_uniphier.c - drivers/i2c/i2c-uniphier.c - drivers/i2c/i2c-uniphier-f.c - arch/arm/dts/uniphier-*
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com ---
Changes in v2: - update git description
MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/MAINTAINERS b/MAINTAINERS index 1f77359..74a56ec 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -170,7 +170,7 @@ T: git git://git.denx.de/u-boot-uniphier.git F: arch/arm/cpu/armv7/uniphier/ F: arch/arm/include/asm/arch-uniphier/ F: configs/ph1_*_defconfig -F: drivers/serial/serial_uniphier.c +N: uniphier
ARM ZYNQ M: Michal Simek monstr@monstr.eu

This EEPROM chip is installed on the expansion board commonly used on UniPhier platform. To avoid duplicated description, move the EEPROM node to a separate file and include it from other device tree sources.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com ---
Changes in v2: - Fix the year of the credit blocks
arch/arm/dts/uniphier-ph1-ld4-ref.dts | 7 ++----- arch/arm/dts/uniphier-ph1-pro4-ref.dts | 7 ++----- arch/arm/dts/uniphier-ph1-sld3-ref.dts | 7 ++----- arch/arm/dts/uniphier-ph1-sld8-ref.dts | 7 ++----- arch/arm/dts/uniphier-ref-daughter.dtsi | 15 +++++++++++++++ 5 files changed, 23 insertions(+), 20 deletions(-) create mode 100644 arch/arm/dts/uniphier-ref-daughter.dtsi
diff --git a/arch/arm/dts/uniphier-ph1-ld4-ref.dts b/arch/arm/dts/uniphier-ph1-ld4-ref.dts index 6855878..d479be1 100644 --- a/arch/arm/dts/uniphier-ph1-ld4-ref.dts +++ b/arch/arm/dts/uniphier-ph1-ld4-ref.dts @@ -1,7 +1,7 @@ /* * Device Tree Source for UniPhier PH1-LD4 Reference Board * - * Copyright (C) 2014 Panasonic Corporation + * Copyright (C) 2014-2015 Panasonic Corporation * Author: Masahiro Yamada yamada.m@jp.panasonic.com * * SPDX-License-Identifier: GPL-2.0+ @@ -9,6 +9,7 @@
/dts-v1/; /include/ "uniphier-ph1-ld4.dtsi" +/include/ "uniphier-ref-daughter.dtsi"
/ { model = "Panasonic UniPhier PH1-LD4 Reference Board"; @@ -46,10 +47,6 @@
&i2c0 { status = "okay"; - eeprom { - compatible = "i2c-eeprom"; - reg = <0x50>; - }; };
&usb0 { diff --git a/arch/arm/dts/uniphier-ph1-pro4-ref.dts b/arch/arm/dts/uniphier-ph1-pro4-ref.dts index 1227b62..d9e7a8c 100644 --- a/arch/arm/dts/uniphier-ph1-pro4-ref.dts +++ b/arch/arm/dts/uniphier-ph1-pro4-ref.dts @@ -1,7 +1,7 @@ /* * Device Tree Source for UniPhier PH1-Pro4 Reference Board * - * Copyright (C) 2014 Panasonic Corporation + * Copyright (C) 2014-2015 Panasonic Corporation * Author: Masahiro Yamada yamada.m@jp.panasonic.com * * SPDX-License-Identifier: GPL-2.0+ @@ -9,6 +9,7 @@
/dts-v1/; /include/ "uniphier-ph1-pro4.dtsi" +/include/ "uniphier-ref-daughter.dtsi"
/ { model = "Panasonic UniPhier PH1-Pro4 Reference Board"; @@ -48,10 +49,6 @@
&i2c0 { status = "okay"; - eeprom { - compatible = "i2c-eeprom"; - reg = <0x50>; - }; };
&usb0 { diff --git a/arch/arm/dts/uniphier-ph1-sld3-ref.dts b/arch/arm/dts/uniphier-ph1-sld3-ref.dts index fefc592..8a7f90a 100644 --- a/arch/arm/dts/uniphier-ph1-sld3-ref.dts +++ b/arch/arm/dts/uniphier-ph1-sld3-ref.dts @@ -1,7 +1,7 @@ /* * Device Tree Source for UniPhier PH1-sLD3 Reference Board * - * Copyright (C) 2014 Panasonic Corporation + * Copyright (C) 2014-2015 Panasonic Corporation * Author: Masahiro Yamada yamada.m@jp.panasonic.com * * SPDX-License-Identifier: GPL-2.0+ @@ -9,6 +9,7 @@
/dts-v1/; /include/ "uniphier-ph1-sld3.dtsi" +/include/ "uniphier-ref-daughter.dtsi"
/ { model = "Panasonic UniPhier PH1-sLD3 Reference Board"; @@ -45,10 +46,6 @@
&i2c0 { status = "okay"; - eeprom { - compatible = "i2c-eeprom"; - reg = <0x50>; - }; };
&usb0 { diff --git a/arch/arm/dts/uniphier-ph1-sld8-ref.dts b/arch/arm/dts/uniphier-ph1-sld8-ref.dts index 9b6d95c..0cb9c47 100644 --- a/arch/arm/dts/uniphier-ph1-sld8-ref.dts +++ b/arch/arm/dts/uniphier-ph1-sld8-ref.dts @@ -1,7 +1,7 @@ /* * Device Tree Source for UniPhier PH1-sLD8 Reference Board * - * Copyright (C) 2014 Panasonic Corporation + * Copyright (C) 2014-2015 Panasonic Corporation * Author: Masahiro Yamada yamada.m@jp.panasonic.com * * SPDX-License-Identifier: GPL-2.0+ @@ -9,6 +9,7 @@
/dts-v1/; /include/ "uniphier-ph1-sld8.dtsi" +/include/ "uniphier-ref-daughter.dtsi"
/ { model = "Panasonic UniPhier PH1-sLD8 Reference Board"; @@ -46,10 +47,6 @@
&i2c0 { status = "okay"; - eeprom { - compatible = "i2c-eeprom"; - reg = <0x50>; - }; };
&usb0 { diff --git a/arch/arm/dts/uniphier-ref-daughter.dtsi b/arch/arm/dts/uniphier-ref-daughter.dtsi new file mode 100644 index 0000000..33dc205 --- /dev/null +++ b/arch/arm/dts/uniphier-ref-daughter.dtsi @@ -0,0 +1,15 @@ +/* + * Device Tree Source for UniPhier Reference Daughter Board + * + * Copyright (C) 2014-2015 Panasonic Corporation + * Author: Masahiro Yamada yamada.m@jp.panasonic.com + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +&i2c0 { + eeprom { + compatible = "i2c-eeprom"; + reg = <0x50>; + }; +};

The EEPROM chips on UniPhier reference daughter boards expect 2-byte offset address.
Since 7132b9fd68a1 (dm: i2c: dts: Support an offset-len device tree property), I2C sub-nodes can have "u-boot,i2c-offset-len" property.
It is convenient to set the default I2C offset address length in Device Tree, so that we do not have to set it on the command line.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com ---
Changes in v2: None
arch/arm/dts/uniphier-ref-daughter.dtsi | 1 + 1 file changed, 1 insertion(+)
diff --git a/arch/arm/dts/uniphier-ref-daughter.dtsi b/arch/arm/dts/uniphier-ref-daughter.dtsi index 33dc205..0145b51 100644 --- a/arch/arm/dts/uniphier-ref-daughter.dtsi +++ b/arch/arm/dts/uniphier-ref-daughter.dtsi @@ -11,5 +11,6 @@ eeprom { compatible = "i2c-eeprom"; reg = <0x50>; + u-boot,i2c-offset-len = <2>; }; };

2015-02-05 14:30 GMT+09:00 Masahiro Yamada yamada.m@jp.panasonic.com:
Masahiro Yamada (6): ARM: UniPhier: use "&&" instead of ";" in commands ARM: UniPhier: add environment variable to update images in NAND ARM: UniPhier: add a simple README file for UniPhier platform MAINTAINERS: claim maintainership of files with "uniphier" pattern ARM: UniPhier: move EEPROM device node into a separate DTS ARM: UniPhier: set I2C offset length of on-board EEPROM in DTS
Series, Applied to u-boot-uniphier/master.
participants (2)
-
Masahiro YAMADA
-
Masahiro Yamada