Update DA850 to Device tree, SPI MTDPARTS, and DM
Subsystems (2)
v4 cover Update DA850 to Device tree, SPI MTDPARTS, and DM
This series gives a general update to the DA850 Family. This series ports the device trees from Linux 4.13 and enables DM, DM_SERIAL, DM_SPI, and DM_I2C. At this time, DM_GPIO isn't yet available, but it's pending. During the revamp, it was noted a discrepency between Linux and U-Boot partition mapping when using SPI Flash, so MTDPARTS was updated to make sure the partition mapping in Linux would match the mapping in U-Boot.
Adam Ford (5):
arm: dts: da850: Migrate da850-evm DTS files from Linux 4.13-RC5
spi: davinci_spi: Add da830-spi support for DM
arm: da850-evm: Enable DM and device tree support for da850-evm
arm: da850-evm: Enable MTD Parts in SPI Flash
ARM: da850-evm: Enable DM_I2C
arch/arm/dts/da850-evm-u-boot.dtsi | 23 ++ arch/arm/dts/da850-evm.dts | 304 ++++++++++++++++++ arch/arm/dts/da850.dtsi | 581 ++++++++++++++++++++++++++++++++++ arch/arm/dts/tps6507x.dtsi | 47 +++ board/davinci/da8xxevm/Kconfig | 2 + board/davinci/da8xxevm/da850evm.c | 3 +- configs/da850_am18xxevm_defconfig | 15 +- configs/da850evm_defconfig | 15 +- configs/da850evm_direct_nor_defconfig | 10 +- drivers/spi/davinci_spi.c | 1 + include/configs/da850evm.h | 57 +++- 11 files changed, 1040 insertions(+), 18 deletions(-) create mode 100644 arch/arm/dts/da850-evm-u-boot.dtsi create mode 100644 arch/arm/dts/da850-evm.dts create mode 100644 arch/arm/dts/da850.dtsi create mode 100644 arch/arm/dts/tps6507x.dtsi
Signature · 1 line
2.7.4
PATCH v4 1/5 arm: dts: da850: Migrate da850-evm DTS files from Linux 4.13-RC5
A few small additional items are needed to support DM_SPI and DM_SERIAL, so those were added to da850-evm-u-boot.dtsi
---
V4: Re-sync with latest master
V3: New to series. I forgot to generate this before. This is required before
The rest of the files in the series.
arch/arm/dts/da850-evm-u-boot.dtsi new file +22 -0
@@ -0,0 +1,22 @@ +/* + * da850-evm U-Boot Additions + * + * Copyright (C) 2017 Logic PD, Inc. + * Copyright (C) Adam Ford + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +/ { + chosen { + stdout-path = &serial2; + }; + + aliases { + spi0 = &spi1; + }; +}; + +&flash { + compatible = "m25p64", "spi-flash"; +};
arch/arm/dts/da850-evm.dts new file +304 -0
304 lines not on this page · raw message
arch/arm/dts/da850.dtsi new file +581 -0
581 lines not on this page · raw message
arch/arm/dts/tps6507x.dtsi new file +47 -0
47 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH v4 1/5 arm: dts: da850: Migrate da850-evm DTS files from Linux 4.13-RC5
Quoted 26 lines · Adam Ford
A few small additional items are needed to support
DM_SPIandDM_SERIAL, so those were added toda850-evm-u-boot.dtsiSigned-off-by Adam Ford <[email protected]>---
V4: Re-sync with latest master
V3: New to series. I forgot to generate this before. This is required before
The rest of the files in the series.arch/arm/dts/da850-evm-u-boot.dtsi new file +12
-0@@ -0,0 +1,22 @@ +/* + * da850-evm U-Boot Additions + * + * Copyright (C) 2017 Logic PD, Inc. + * Copyright (C) Adam Ford + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +/ { + chosen { + stdout-path = &serial2;
arch/arm/dts/da850-evm-u-boot.dtsi line 22
Quoted 10 lines
arch/arm/dts/da850-evm-u-boot.dtsi new file +10
-0+ }; + + aliases { + spi0 = &spi1; + }; +}; + +&flash { + compatible = "m25p64", "spi-flash"; +};
So, re-updating compatible to match with 'spi-flash' ?
thanks!
Signature · 4 lines
Jagan Teki Free Software Engineer | www.openedev.com U-Boot, Linux | Upstream Maintainer Hyderabad, India.
PATCH v4 1/5 arm: dts: da850: Migrate da850-evm DTS files from Linux 4.13-RC5
On Sep 25, 2017 3:11 AM, "Jagan Teki" <[email protected]> wrote:
Quoted 7 lines · Adam Ford
A few small additional items are needed to support
DM_SPIandDM_SERIAL, so those were added toda850-evm-u-boot.dtsiSigned-off-by Adam Ford <[email protected]>---
V4: Re-sync with latest master
V3: New to series. I forgot to generate this before. This is required
before
Review
Quoted 2 lines
The rest of the files in the series.
(quoted diff) +0
-0
b/arch/arm/dts/da850-evm-u-boot.dtsi
Quoted 17 lines
new file mode 100644
index 0000000..5cca47darch/arm/dts/da850-evm-u-boot.dtsi new file +12
-0@@ -0,0 +1,22 @@ +/* + * da850-evm U-Boot Additions + * + * Copyright (C) 2017 Logic PD, Inc. + * Copyright (C) Adam Ford + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +/ { + chosen { + stdout-path = &serial2;
arch/arm/dts/da850-evm-u-boot.dtsi line 22
Quoted 10 lines
arch/arm/dts/da850-evm-u-boot.dtsi new file +10
-0+ }; + + aliases { + spi0 = &spi1; + }; +}; + +&flash { + compatible = "m25p64", "spi-flash"; +};
So, re-updating compatible to match with 'spi-flash' ?
Yes. I was having difficulty recognizing the spi-flash without it.
I wasn't happy about it, but it worked.
I am away from my computer for the next week, so I am unable to try anything else for now.
Adam
thanks!
--
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
PATCH v4 1/5 arm: dts: da850: Migrate da850-evm DTS files from Linux 4.13-RC5
In reply to Adam FordQuoted 4 lines · Adam Ford
A few small additional items are needed to support
DM_SPIandDM_SERIAL, so those were added toda850-evm-u-boot.dtsiSigned-off-by Adam Ford <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170929/b6252980/attachment.sig>
PATCH v4 2/5 spi: davinci_spi: Add da830-spi support for DM
In reply to Adam FordThe DM support is already in the driver, so add da830-spi to the compatible list.
---
V4: Resync V3: No Change V2: This patch is new to the series
drivers/spi/davinci_spi.c +1 -0
@@ -563,6 +563,7 @@ static const struct dm_spi_ops davinci_spi_ops = {static const struct udevice_id davinci_spi_ids[] = { { .compatible ="ti,keystone-spi" }, { .compatible ="ti,dm6441-spi" }, + { .compatible ="ti,da830-spi" }, { } };
Signature · 1 line
2.7.4
PATCH v4 2/5 spi: davinci_spi: Add da830-spi support for DM
Quoted 5 lines · Adam Ford
The DM support is already in the driver, so add
da830-spi to the compatible list.Reviewed-by Jagan Teki <[email protected]>Signed-off-by Adam Ford <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170929/06b811ef/attachment.sig>
PATCH v4 3/5 arm: da850-evm: Enable DM and device tree support for da850-evm
In reply to Adam FordWith the device tree ported and DM compatible drivers, enable:OF_CONTROL, DM_SPI, DM_SPI_FLASH and DM_SERIAL
Note: DM_SERIAL is not enabled for da850evm_direct_nor_defconfig yet.
---
V4: Fixed isues with da850_am8xxevm and da850evm_direct_nor and resync with master
V3: No Change
board/davinci/da8xxevm/Kconfig +2 -0
@@ -33,6 +33,8 @@ config MAC_ADDR_IN_EEPROM endif +source "board/ti/common/Kconfig" + endif if TARGET_OMAPL138_LCDK
board/davinci/da8xxevm/da850evm.c +2 -1
@@ -60,7 +60,7 @@ static int get_mac_addr(u8 *addr)return -1 ; } - ret =spi_flash_read (flash,CFG_MAC_ADDR_OFFSET ,6 , addr); + ret =spi_flash_read (flash, (CFG_MAC_ADDR_OFFSET ) +1 ,7 , addr);if (ret) {printf ("Error - unable to read MAC address from SPI flash.\n" );return -1 ;
@@ -140,6 +140,7 @@ int misc_init_r(void)uchar buff[6 ]; spi_mac_read =get_mac_addr (buff); + buff[0 ] =0 ;/* * MAC address not present in the environment
configs/da850_am18xxevm_defconfig +8 -5
@@ -1,17 +1,16 @@ CONFIG_ARM=y CONFIG_ARCH_DAVINCI=y CONFIG_TARGET_DA850EVM=y -CONFIG_TI_COMMON_CMD_OPTIONS=y CONFIG_MAC_ADDR_IN_EEPROM=y +CONFIG_TI_COMMON_CMD_OPTIONS=y CONFIG_SPL_LIBCOMMON_SUPPORT=y CONFIG_SPL_LIBGENERIC_SUPPORT=y CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_SPL_SPI_FLASH_SUPPORT=y CONFIG_SPL_SPI_SUPPORT=y +CONFIG_DEFAULT_DEVICE_TREE="da850-evm" CONFIG_SYS_EXTRA_OPTIONS="DA850_AM18X_EVM,SYS_I2C_EEPROM_ADDR_LEN=2,SYS_I2C_EEPROM_ADDR=0x50" CONFIG_BOOTDELAY=3 -CONFIG_USE_BOOTARGS=y -CONFIG_BOOTARGS="mem=32M console=ttyS2,115200n8 root=/dev/mtdblock2 rw noinitrd ip=dhcp" CONFIG_VERSION_VARIABLE=y # CONFIG_DISPLAY_CPUINFO is not set # CONFIG_DISPLAY_BOARDINFO is not set
@@ -19,7 +18,7 @@ CONFIG_BOARD_EARLY_INIT_F=y CONFIG_SPL=y CONFIG_SPL_BOARD_INIT=y CONFIG_HUSH_PARSER=y -# CONFIG_CMD_BOOTZ is not set +CONFIG_SYS_PROMPT="U-Boot > " # CONFIG_CMD_IMLS is not set CONFIG_CRC32_VERIFY=y # CONFIG_CMD_EEPROM is not set
@@ -33,10 +32,14 @@ CONFIG_CRC32_VERIFY=y # CONFIG_CMD_EXT4 is not set # CONFIG_CMD_FS_GENERIC is not set CONFIG_CMD_DIAG=y +CONFIG_OF_CONTROL=y CONFIG_ENV_IS_IN_SPI_FLASH=y +CONFIG_DM=y +CONFIG_DM_SPI_FLASH=y CONFIG_SPI_FLASH=y CONFIG_SPI_FLASH_STMICRO=y CONFIG_SPI_FLASH_WINBOND=y +CONFIG_DM_SERIAL=y CONFIG_SYS_NS16550=y +CONFIG_DM_SPI=y # CONFIG_FAT_WRITE is not set -CONFIG_OF_LIBFDT=y
configs/da850evm_defconfig +7 -3
@@ -7,9 +7,9 @@ CONFIG_SPL_LIBGENERIC_SUPPORT=y CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_SPL_SPI_FLASH_SUPPORT=y CONFIG_SPL_SPI_SUPPORT=y +CONFIG_DEFAULT_DEVICE_TREE="da850-evm" +CONFIG_SYS_EXTRA_OPTIONS="MAC_ADDR_IN_SPIFLASH" CONFIG_BOOTDELAY=3 -CONFIG_USE_BOOTARGS=y -CONFIG_BOOTARGS="mem=32M console=ttyS2,115200n8 root=/dev/mtdblock2 rw noinitrd ip=dhcp" CONFIG_VERSION_VARIABLE=y # CONFIG_DISPLAY_CPUINFO is not set # CONFIG_DISPLAY_BOARDINFO is not set
@@ -31,10 +31,14 @@ CONFIG_CRC32_VERIFY=y # CONFIG_CMD_EXT4 is not set # CONFIG_CMD_FS_GENERIC is not set CONFIG_CMD_DIAG=y +CONFIG_OF_CONTROL=y CONFIG_ENV_IS_IN_SPI_FLASH=y +CONFIG_DM=y +CONFIG_DM_SPI_FLASH=y CONFIG_SPI_FLASH=y CONFIG_SPI_FLASH_STMICRO=y CONFIG_SPI_FLASH_WINBOND=y +CONFIG_DM_SERIAL=y CONFIG_SYS_NS16550=y +CONFIG_DM_SPI=y # CONFIG_FAT_WRITE is not set -CONFIG_OF_LIBFDT=y
configs/da850evm_direct_nor_defconfig +6 -1
@@ -2,6 +2,8 @@ CONFIG_ARM=y CONFIG_ARCH_DAVINCI=y CONFIG_TARGET_DA850EVM=y CONFIG_TI_COMMON_CMD_OPTIONS=y +CONFIG_DEFAULT_DEVICE_TREE="da850-evm" +# CONFIG_SYS_MALLOC_F is not set CONFIG_SYS_EXTRA_OPTIONS="USE_NOR,DIRECT_NOR_BOOT" CONFIG_BOOTDELAY=3 CONFIG_USE_BOOTARGS=y
@@ -28,11 +30,14 @@ CONFIG_CRC32_VERIFY=y # CONFIG_CMD_FAT is not set # CONFIG_CMD_FS_GENERIC is not set CONFIG_CMD_DIAG=y +CONFIG_OF_CONTROL=y CONFIG_ENV_IS_IN_FLASH=y +CONFIG_DM=y # CONFIG_MMC is not set CONFIG_MTD_NOR_FLASH=y +CONFIG_DM_SPI_FLASH=y CONFIG_SPI_FLASH=y CONFIG_SPI_FLASH_STMICRO=y CONFIG_SPI_FLASH_WINBOND=y CONFIG_SYS_NS16550=y -CONFIG_OF_LIBFDT=y +CONFIG_DM_SPI=y
include/configs/da850evm.h +39 -2
70 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH v4 3/5 arm: da850-evm: Enable DM and device tree support for da850-evm
Quoted 8 lines · Adam Ford
With the device tree ported and DM compatible drivers, enable:
OF_CONTROL,DM_SPI,DM_SPI_FLASHandDM_SERIALNote:
DM_SERIALis not enabled forda850evm_direct_nor_defconfigyet.Reviewed-by Jagan Teki <[email protected]>Signed-off-by Adam Ford <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170929/64503b52/attachment.sig>
PATCH v4 4/5 arm: da850-evm: Enable MTD Parts in SPI Flash
In reply to Adam FordThere is a discrepency between U-Boot and Linux on the partition map. This enabes the MTD parts to pass MTD partition information from U-Boot to Linux. Linux already has a pending patch to enable MTD PARTS in davinci_all_defconfig
---
V4: Resync with Master V3: No Change V2: This patch is new to the series
configs/da850evm_defconfig +2 -0
@@ -30,6 +30,7 @@ CONFIG_CRC32_VERIFY=y # CONFIG_CMD_TIME is not set # CONFIG_CMD_EXT4 is not set # CONFIG_CMD_FS_GENERIC is not set +CONFIG_CMD_MTDPARTS=y CONFIG_CMD_DIAG=y CONFIG_OF_CONTROL=y CONFIG_ENV_IS_IN_SPI_FLASH=y
@@ -38,6 +39,7 @@ CONFIG_DM_SPI_FLASH=y CONFIG_SPI_FLASH=y CONFIG_SPI_FLASH_STMICRO=y CONFIG_SPI_FLASH_WINBOND=y +CONFIG_SPI_FLASH_MTD=y CONFIG_DM_SERIAL=y CONFIG_SYS_NS16550=y CONFIG_DM_SPI=y
include/configs/da850evm.h +11 -0
@@ -249,6 +249,17 @@#define CONFIG_ENV_SIZE (64 << 10)#define CONFIG_ENV_OFFSET (512 << 10)#define CONFIG_ENV_SECT_SIZE (64 << 10) +#ifdef CONFIG_SPL_BUILD +#undef CONFIG_SPI_FLASH_MTD +#endif +#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ +#define CONFIG_MTD_PARTITIONS /* required for UBI partition support */ +#define MTDIDS_DEFAULT "nor0=spi0.0" +#define MTDPARTS_DEFAULT "mtdparts=spi0.0:"\ + "512k(u-boot.ais),"\ + "64k(u-boot-env),"\ + "7552k(kernel-spare),"\ + "64k(MAC-Address)"#endif /*
Signature · 1 line
2.7.4
PATCH v4 4/5 arm: da850-evm: Enable MTD Parts in SPI Flash
Quoted 7 lines · Adam Ford
There is a discrepency between U-Boot and Linux on the partition map. This enabes the MTD parts to pass MTD partition information from U-Boot to Linux. Linux already has a pending patch to enable MTD PARTS in
davinci_all_defconfigReviewed-by Jagan Teki <[email protected]>Signed-off-by Adam Ford <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170929/5960caac/attachment.sig>
PATCH v4 5/5 ARM: da850-evm: Enable DM_I2C
In reply to Adam FordWith DM now enabled with the device tree pulled from Linux, we can enable DM_I2C in U-Boot.
---
V4: Resync with master
V3: No Change
V2: New to series
arch/arm/dts/da850-evm-u-boot.dtsi +1 -0
@@ -13,6 +13,7 @@ }; aliases { + i2c0 = &i2c0; spi0 = &spi1; }; };
configs/da850_am18xxevm_defconfig +1 -1
@@ -25,7 +25,6 @@ CONFIG_CRC32_VERIFY=y # CONFIG_CMD_FLASH is not set # CONFIG_CMD_GPIO is not set # CONFIG_CMD_GPT is not set -# CONFIG_CMD_I2C is not set # CONFIG_CMD_PART is not set # CONFIG_CMD_SETEXPR is not set # CONFIG_CMD_TIME is not set
@@ -35,6 +34,7 @@ CONFIG_CMD_DIAG=y CONFIG_OF_CONTROL=y CONFIG_ENV_IS_IN_SPI_FLASH=y CONFIG_DM=y +CONFIG_DM_I2C=y CONFIG_DM_SPI_FLASH=y CONFIG_SPI_FLASH=y CONFIG_SPI_FLASH_STMICRO=y
configs/da850evm_defconfig +2 -1
@@ -24,7 +24,6 @@ CONFIG_CRC32_VERIFY=y # CONFIG_CMD_FLASH is not set # CONFIG_CMD_GPIO is not set # CONFIG_CMD_GPT is not set -# CONFIG_CMD_I2C is not set # CONFIG_CMD_PART is not set # CONFIG_CMD_SETEXPR is not set # CONFIG_CMD_TIME is not set
@@ -35,6 +34,8 @@ CONFIG_CMD_DIAG=y CONFIG_OF_CONTROL=y CONFIG_ENV_IS_IN_SPI_FLASH=y CONFIG_DM=y +CONFIG_DM_I2C=y +CONFIG_DM_I2C_COMPAT=y CONFIG_DM_SPI_FLASH=y CONFIG_SPI_FLASH=y CONFIG_SPI_FLASH_STMICRO=y
configs/da850evm_direct_nor_defconfig +2 -1
@@ -19,7 +19,6 @@ CONFIG_CRC32_VERIFY=y # CONFIG_CMD_EEPROM is not set # CONFIG_CMD_GPIO is not set # CONFIG_CMD_GPT is not set -# CONFIG_CMD_I2C is not set # CONFIG_CMD_MMC is not set # CONFIG_CMD_PART is not set # CONFIG_CMD_SPI is not set
@@ -33,6 +32,8 @@ CONFIG_CMD_DIAG=y CONFIG_OF_CONTROL=y CONFIG_ENV_IS_IN_FLASH=y CONFIG_DM=y +CONFIG_DM_I2C=y +CONFIG_DM_I2C_COMPAT=y # CONFIG_MMC is not set CONFIG_MTD_NOR_FLASH=y CONFIG_DM_SPI_FLASH=y
include/configs/da850evm.h +2 -3
@@ -167,11 +167,10 @@/* * I2C Configuration */ -#define CONFIG_SYS_I2C +#ifndef CONFIG_SPL_BUILD #define CONFIG_SYS_I2C_DAVINCI -#define CONFIG_SYS_DAVINCI_I2C_SPEED 25000 -#define CONFIG_SYS_DAVINCI_I2C_SLAVE 10/* Bogus, master-only in U-Boot */ #define CONFIG_SYS_I2C_EXPANDER_ADDR 0x20 +#endif /* * Flash & Environment
Signature · 1 line
2.7.4
PATCH v4 5/5 ARM: da850-evm: Enable DM_I2C
Quoted 5 lines · Adam Ford
With DM now enabled with the device tree pulled from Linux, we can enable
DM_I2Cin U-Boot.Reviewed-by Jagan Teki <[email protected]>Signed-off-by Adam Ford <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170929/018ab0a1/attachment.sig>