ARM: kirkwood: remove automatic I2C config if DM_I2C is enabled
Subsystems (2)
PATCH 1/2 ARM: kirkwood: remove automatic I2C config if DM_I2C is enabled
The mach/config.h file would helpfully define CONFIG_SYS_I2C and CONFIG_SYS_I2C_MVTWSI if CONFIG_CMD_I2C was defined by the board. This conflicts with the way DM_I2C works. As a transitional measure don't automatically define these if CONFIG_DM_I2C is defined. It should be possible to remove this once all kirkwood boards are migrated to DM.
---
arch/arm/mach-kirkwood/include/mach/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-kirkwood/include/mach/config.h +1 -1
@@ -116,7 +116,7 @@/* * I2C related stuff */ -#ifdef CONFIG_CMD_I2C +#if defined(CONFIG_CMD_I2C ) && !defined(CONFIG_DM_I2C )#ifndef CONFIG_SYS_I2C_SOFT #define CONFIG_SYS_I2C #define CONFIG_SYS_I2C_MVTWSI
Signature · 1 line
2.17.0
PATCH 2/2 ARM: add SBx81LIFKW board
This is a series of line cards for Allied Telesis's SBx8100 chassis switch. The CPU block is common to the SBx81GS24a, SBx81XS6, SBx81XS16 and SBx81GT40 cards collectively referred to as SBx81LIFKW in u-boot.
---
This is the board I've been using for testing the device tree support for kirkwood. The Ethernet arrangement is a bit complicated and doesn't currently work on u-boot#master but I can test SPI and I2C.
arch/arm/dts/kirkwood-atl-sbx81lifkw.dts | 133 ++++++++++++++ arch/arm/mach-kirkwood/Kconfig | 4 + board/alliedtelesis/SBx81LIFKW/Kconfig | 12 ++ board/alliedtelesis/SBx81LIFKW/MAINTAINERS | 7 + board/alliedtelesis/SBx81LIFKW/Makefile | 8 + board/alliedtelesis/SBx81LIFKW/kwbimage.cfg | 47 +++++ board/alliedtelesis/SBx81LIFKW/platform.S | 108 +++++++++++ board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c | 192 ++++++++++++++++++++ configs/SBx81LIFKW_defconfig | 32 ++++ include/configs/SBx81LIFKW.h | 123 +++++++++++++ 10 files changed, 666 insertions(+) create mode 100644 arch/arm/dts/kirkwood-atl-sbx81lifkw.dts create mode 100644 board/alliedtelesis/SBx81LIFKW/Kconfig create mode 100644 board/alliedtelesis/SBx81LIFKW/MAINTAINERS create mode 100644 board/alliedtelesis/SBx81LIFKW/Makefile create mode 100644 board/alliedtelesis/SBx81LIFKW/kwbimage.cfg create mode 100644 board/alliedtelesis/SBx81LIFKW/platform.S create mode 100644 board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c create mode 100644 configs/SBx81LIFKW_defconfig create mode 100644 include/configs/SBx81LIFKW.h
arch/arm/dts/kirkwood-atl-sbx81lifkw.dts new file +133 -0
@@ -0,0 +1,133 @@ +// SPDX-License-Identifier: GPL-2.0 +/dts-v1/; + +#include "kirkwood.dtsi" +#include "kirkwood-6281.dtsi" + +/ { + model = "Allied Telesis SBx81LIFKW Board"; + compatible = "atl,SBx81LIFKW", "marvell,kirkwood-88f6281", + "marvell,kirkwood"; + + memory { + device_type = "memory"; + reg = <0x00000000 0x08000000>; /* 128 MB */ + }; + + chosen { + bootargs = "console=ttyS0,115200n8 earlyprintk"; + stdout-path = &uart0; + }; + + aliases { + ethernet0 = ð0; + i2c0 = &i2c0; + spi0 = &spi0; + }; + + dsa { + compatible = "marvell,dsa"; + #address-cells = <2>; + #size-cells = <0>; + dsa,ethernet = <ð0>; + dsa,mii-bus = <&mdio>; + status = "okay"; + + switch at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1 0>; + + port at 0 { + reg = <0>; + label = "internal0"; + }; + port at 1 { + reg = <1>; + label = "internal1"; + }; + port at 8 { + reg = <8>; + label = "internal8"; + phy-mode = "rgmii-id"; + fixed-link { + speed = <1000>; + full-duplex; + }; + }; + port at 9 { + reg = <9>; + label = "internal9"; + phy-mode = "rgmii-id"; + fixed-link { + speed = <1000>; + full-duplex; + }; + }; + port at 10 { + reg = <10>; + label = "cpu"; + }; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash at 0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "st,m25p128", "jedec,spi-nor", "spi-flash"; + reg = <0>; + spi-max-frequency = <50000000>; + mode = <0>; + + partition at u-boot { + reg = <0x00000000 0x00c00000>; + label = "u-boot"; + }; + partition at u-boot-env { + reg = <0x00c00000 0x00040000>; + label = "u-boot-env"; + }; + partition at unused { + reg = <0x00100000 0x00f00000>; + label = "unused"; + }; + }; +}; + +&i2c0 { + status = "okay"; + + eeprom at 52 { + compatible = "atmel,24c04"; + reg = <0x52>; + }; +}; + +&uart0 { + status = "okay"; +}; + +&mdio { + status = "okay"; +}; + +ð0 { + status = "okay"; + + ethernet0-port at 0 { + speed = <1000>; + duplex = <1>; + }; +}; + +&pciec { + status = "okay"; +}; + +&pcie0 { + status = "okay"; +};
arch/arm/mach-kirkwood/Kconfig +4 -0
@@ -59,6 +59,9 @@ config TARGET_NAS220 config TARGET_NSA310S bool "Zyxel NSA310S" +config TARGET_SBx81LIFKW + bool "Allied Telesis SBx81GS24/SBx81GT40/SBx81XS6/SBx81XS16" + endchoice config SYS_SOC
@@ -81,5 +84,6 @@ source "board/Seagate/dockstar/Kconfig" source "board/Seagate/goflexhome/Kconfig" source "board/Seagate/nas220/Kconfig" source "board/zyxel/nsa310s/Kconfig" +source "board/alliedtelesis/SBx81LIFKW/Kconfig" endif
board/alliedtelesis/SBx81LIFKW/Kconfig new file +12 -0
@@ -0,0 +1,12 @@ +if TARGET_SBx81LIFKW + +config SYS_BOARD + default "SBx81LIFKW" + +config SYS_VENDOR + default "alliedtelesis" + +config SYS_CONFIG_NAME + default "SBx81LIFKW" + +endif
board/alliedtelesis/SBx81LIFKW/MAINTAINERS new file +7 -0
@@ -0,0 +1,7 @@ +SBx81LIFKW BOARD +M: Chris Packham <[email protected]> +S: Maintained +F: board/alliedtelesis/SBx81LIFKW/ +F: include/configs/SBx81LIFKW +F: configs/SBx81LIFKW_defconfig +F: arch/arm/dts/kirkwood-atl-sbx81lifkw.dts
board/alliedtelesis/SBx81LIFKW/Makefile new file +8 -0
@@ -0,0 +1,8 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# (C) Copyright 2010, 2018 +# Allied Telesis <www.alliedtelesis.com> +# + +obj-y += sbx81lifkw.o +obj-y += platform.o
board/alliedtelesis/SBx81LIFKW/kwbimage.cfg new file +47 -0
47 lines not on this page · raw message
board/alliedtelesis/SBx81LIFKW/platform.S new file +108 -0
108 lines not on this page · raw message
board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c new file +192 -0
192 lines not on this page · raw message
configs/SBx81LIFKW_defconfig new file +32 -0
@@ -0,0 +1,32 @@ +CONFIG_ARM=y +CONFIG_KIRKWOOD=y +CONFIG_SYS_TEXT_BASE=0x00600000 +CONFIG_TARGET_SBx81LIFKW=y +CONFIG_IDENT_STRING="\nSBx81LIFKW" +CONFIG_DEFAULT_DEVICE_TREE="kirkwood-atl-sbx81lifkw" +# CONFIG_SYS_MALLOC_F is not set +CONFIG_BOOTDELAY=3 +CONFIG_SILENT_CONSOLE=y +CONFIG_SILENT_U_BOOT_ONLY=y +# CONFIG_CMD_FLASH is not set +CONFIG_CMD_I2C=y +CONFIG_CMD_SF=y +CONFIG_CMD_DHCP=y +CONFIG_BOOTP_NTPSERVER=y +CONFIG_CMD_PING=y +CONFIG_CMD_SNTP=y +CONFIG_OF_CONTROL=y +CONFIG_ENV_IS_IN_SPI_FLASH=y +CONFIG_DM=y +CONFIG_DM_GPIO=y +CONFIG_DM_PCA953X=y +CONFIG_DM_I2C=y +CONFIG_SYS_I2C_MVTWSI=y +CONFIG_I2C_MUX=y +CONFIG_I2C_MUX_PCA954x=y +# CONFIG_MMC is not set +CONFIG_SPI_FLASH=y +CONFIG_SPI_FLASH_STMICRO=y +# CONFIG_SPI_FLASH_USE_4K_SECTORS is not set +CONFIG_SPI=y +CONFIG_KIRKWOOD_SPI=y
include/configs/SBx81LIFKW.h new file +123 -0
123 lines not on this page · raw message
Signature · 1 line
2.17.0
PATCH 2/2 ARM: add SBx81LIFKW board
Hi Chris,
Quoted 347 lines · Chris Packham
This is a series of line cards for Allied Telesis's SBx8100 chassis switch. The CPU block is common to the SBx81GS24a, SBx81XS6, SBx81XS16 and SBx81GT40 cards collectively referred to as SBx81LIFKW in u-boot.
Signed-off-by Chris Packham <[email protected]>---
This is the board I've been using for testing the device tree support for kirkwood. The Ethernet arrangement is a bit complicated and doesn't currently work on u-boot#master but I can test SPI and I2C.arch/arm/dts/kirkwood-atl-sbx81lifkw.dts | 133 ++++++++++++++ arch/arm/mach-kirkwood/Kconfig | 4 + board/alliedtelesis/SBx81LIFKW/Kconfig | 12 ++ board/alliedtelesis/SBx81LIFKW/MAINTAINERS | 7 + board/alliedtelesis/SBx81LIFKW/Makefile | 8 + board/alliedtelesis/SBx81LIFKW/kwbimage.cfg | 47 +++++ board/alliedtelesis/SBx81LIFKW/platform.S | 108 +++++++++++ board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c | 192 ++++++++++++++++++++ configs/SBx81LIFKW_defconfig | 32 ++++ include/configs/SBx81LIFKW.h | 123 +++++++++++++ 10 files changed, 666 insertions(+)create mode 100644
arch/arm/dts/kirkwood-atl-sbx81lifkw.dtscreate mode 100644 board/alliedtelesis/SBx81LIFKW/Kconfig create mode 100644 board/alliedtelesis/SBx81LIFKW/MAINTAINERS create mode 100644 board/alliedtelesis/SBx81LIFKW/Makefile create mode 100644 board/alliedtelesis/SBx81LIFKW/kwbimage.cfg create mode 100644board/alliedtelesis/SBx81LIFKW/platform.Screate mode 100644board/alliedtelesis/SBx81LIFKW/sbx81lifkw.ccreate mode 100644 configs/SBx81LIFKW_defconfig create mode 100644include/configs/SBx81LIFKW.harch/arm/dts/kirkwood-atl-sbx81lifkw.dts new file +133
-0@@ -0,0 +1,133 @@ +// SPDX-License-Identifier: GPL-2.0 +/dts-v1/; + +#include "kirkwood.dtsi" +#include "kirkwood-6281.dtsi" + +/ { + model = "Allied Telesis SBx81LIFKW Board"; + compatible = "atl,SBx81LIFKW", "marvell,kirkwood-88f6281", + "marvell,kirkwood"; + + memory { + device_type = "memory"; + reg = <0x00000000 0x08000000>; /* 128 MB */ + }; + + chosen { + bootargs = "console=ttyS0,115200n8 earlyprintk"; + stdout-path = &uart0; + }; + + aliases { + ethernet0 = ð0; + i2c0 = &i2c0; + spi0 = &spi0; + }; + + dsa { + compatible = "marvell,dsa"; + #address-cells = <2>; + #size-cells = <0>; + dsa,ethernet = <ð0>; + dsa,mii-bus = <&mdio>; + status = "okay"; + + switch at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1 0>; + + port at 0 { + reg = <0>; + label = "internal0"; + }; + port at 1 { + reg = <1>; + label = "internal1"; + }; + port at 8 { + reg = <8>; + label = "internal8"; + phy-mode = "rgmii-id"; + fixed-link { + speed = <1000>; + full-duplex; + }; + }; + port at 9 { + reg = <9>; + label = "internal9"; + phy-mode = "rgmii-id"; + fixed-link { + speed = <1000>; + full-duplex; + }; + }; + port at 10 { + reg = <10>; + label = "cpu"; + }; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash at 0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "st,m25p128", "jedec,spi-nor", "spi-flash"; + reg = <0>; + spi-max-frequency = <50000000>; + mode = <0>; + + partition at u-boot { + reg = <0x00000000 0x00c00000>; + label = "u-boot"; + }; + partition at u-boot-env { + reg = <0x00c00000 0x00040000>; + label = "u-boot-env"; + }; + partition at unused { + reg = <0x00100000 0x00f00000>; + label = "unused"; + }; + }; +}; + +&i2c0 { + status = "okay"; + + eeprom at 52 { + compatible = "atmel,24c04"; + reg = <0x52>; + }; +}; + +&uart0 { + status = "okay"; +}; + +&mdio { + status = "okay"; +}; + +ð0 { + status = "okay"; + + ethernet0-port at 0 { + speed = <1000>; + duplex = <1>; + }; +}; + +&pciec { + status = "okay"; +}; + +&pcie0 { + status = "okay"; +};arch/arm/mach-kirkwood/Kconfig +4
-0@@ -59,6 +59,9 @@ config TARGET_NAS220 config TARGET_NSA310S bool "Zyxel NSA310S" +config TARGET_SBx81LIFKW + bool "Allied Telesis SBx81GS24/SBx81GT40/SBx81XS6/SBx81XS16" + endchoice config SYS_SOC@@ -81,5 +84,6 @@ source "board/Seagate/dockstar/Kconfig" source "board/Seagate/goflexhome/Kconfig" source "board/Seagate/nas220/Kconfig" source "board/zyxel/nsa310s/Kconfig" +source "board/alliedtelesis/SBx81LIFKW/Kconfig" endifboard/alliedtelesis/SBx81LIFKW/Kconfig new file +12
-0@@ -0,0 +1,12 @@ +if TARGET_SBx81LIFKW + +config SYS_BOARD + default "SBx81LIFKW" + +config SYS_VENDOR + default "alliedtelesis" + +config SYS_CONFIG_NAME + default "SBx81LIFKW" + +endifboard/alliedtelesis/SBx81LIFKW/MAINTAINERS new file +7
-0@@ -0,0 +1,7 @@ +SBx81LIFKW BOARD +M: Chris Packham <[email protected]> +S: Maintained +F: board/alliedtelesis/SBx81LIFKW/ +F: include/configs/SBx81LIFKW +F: configs/SBx81LIFKW_defconfig +F: arch/arm/dts/kirkwood-atl-sbx81lifkw.dtsboard/alliedtelesis/SBx81LIFKW/Makefile new file +8
-0@@ -0,0 +1,8 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# (C) Copyright 2010, 2018 +# Allied Telesis <www.alliedtelesis.com> +# + +obj-y += sbx81lifkw.o +obj-y += platform.oboard/alliedtelesis/SBx81LIFKW/kwbimage.cfg new file +47
-0@@ -0,0 +1,47 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# (C) Copyright 2018 Allied Telesis +# +# Refer docs/README.kwimage for more details about how-to configure +# and create kirkwood boot image +# + +# Boot Media configurations +BOOT_FROM spi # Boot from SPI flash + +# SOC registers configuration using bootrom header extension +# Maximum KWBIMAGE_MAX_CONFIG configurations allowed +DATA 0xffd100e0 0x1b1b1b1b +DATA 0xffd20134 0xffffffff +DATA 0xffd20138 0x009fffff +DATA 0xffd20154 0x00000000 +DATA 0xffd2014c 0x00000000 +DATA 0xffd20148 0x00000001 + +# Dram initalization for 1 x x16 +# DDR II Micron part number MT47H64M16HR-3 +# MClk 333MHz, Size 128MB, ECC disable +# +DATA 0xffd01400 0x43000618 +DATA 0xffd01404 0x35143000 +DATA 0xffd01408 0x11012227 +DATA 0xffd0140c 0x00000819 +DATA 0xffd01410 0x0000000d +DATA 0xffd01414 0x00000000 +DATA 0xffd01418 0x00000000 +DATA 0xffd0141c 0x00000632 +DATA 0xffd01420 0x00000040 +DATA 0xffd01424 0x0000f07f +DATA 0xffd01500 0x00000000 # SDRAM CS[0] Base address at 0x00000000 +DATA 0xffd01504 0x07FFFFF1 # SDRAM CS[0] Size 128MiB +DATA 0xffd01508 0x10000000 +DATA 0xffd0150c 0x00FFFFF4 # SDRAM CS[1] Size, window disabled +DATA 0xffd01514 0x00FFFFF8 # SDRAM CS[2] Size, window disabled +DATA 0xffd0151c 0x00FFFFFC # SDRAM CS[3] Size, window disabled +DATA 0xffd01494 0x00030000 +DATA 0xffd01498 0x00000000 +DATA 0xffd0149c 0x0000e803 +DATA 0xffd01480 0x00000001 + +# End of Header extension +DATA 0x0 0x0board/alliedtelesis/SBx81LIFKW/platform.S new file +52
-0@@ -0,0 +1,108 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * (C) Copyright 2010 + * Allied Telesis <www.alliedtelesis.com> + */ + +/* based (loosley) on Marvell's board/mv_feroceon/mv_kw/platform.S */ + +#include <config.h> + +platform_lowlevel_init_data: + /* AHB to Mbus Bridge + * Change CPU reg base to 0xF1000000 + * These *MUST* be first, and it hits + * both potential address to be safe + */ + .long 0xD0020080, KW_REGS_PHY_BASE + .long 0xF1020080, KW_REGS_PHY_BASE + + /* Configure RGMII-0 interface pad voltage to 1.8V */ + .long KW_REGS_PHY_BASE + 0x100E0, 0x1B1B1B1B + + .long KW_REGS_PHY_BASE + 0x20134, 0xffffffff + .long KW_REGS_PHY_BASE + 0x20138, 0x009fffff + .long KW_REGS_PHY_BASE + 0x20154, 0x00000000 + .long KW_REGS_PHY_BASE + 0x2014c, 0x00000000 + .long KW_REGS_PHY_BASE + 0x20148, 0x00000001 + + /* Dram initalization for 1 x x16 + * DDR II Micron part number MT47H64M16HR-3 + * MClk 333MHz, Size 128MB, ECC disable + */ + .long KW_REGS_PHY_BASE + 0x01400, 0x43000618 /* DDR Configuration register */ + .long KW_REGS_PHY_BASE + 0x01404, 0x35143000 /* DDR Controller Control Low */ + .long KW_REGS_PHY_BASE + 0x01408, 0x11012227 /* DDR Timing (Low) (active cycles value +1) */ + .long KW_REGS_PHY_BASE + 0x0140C, 0x00000819 /* DDR Timing (High) */ + .long KW_REGS_PHY_BASE + 0x01410, 0x0000000d /* DDR Address Control */ + .long KW_REGS_PHY_BASE + 0x01414, 0x00000000 /* DDR Open Pages Control */ + .long KW_REGS_PHY_BASE + 0x01418, 0x00000000 /* DDR Operation */ + .long KW_REGS_PHY_BASE + 0x0141C, 0x00000632 /* DDR Mode */ + .long KW_REGS_PHY_BASE + 0x01420, 0x00000040 /* DDR Extended Mode */ + .long KW_REGS_PHY_BASE + 0x01424, 0x0000f07f /* DDR Controller Control High */ + .long KW_REGS_PHY_BASE + 0x01428, 0x00063300 /* DDR2 ODT Read Timing (default values) */ + .long KW_REGS_PHY_BASE + 0x0147C, 0x00006330 /* DDR2 ODT Write Timing (default values) */ + + .long KW_REGS_PHY_BASE + 0x01500, 0x00000000 /* SDRAM CS[0] Base address at 0x00000000 */ + .long KW_REGS_PHY_BASE + 0x01504, 0x07FFFFF1 /* SDRAM CS[0] Size 128MiB */ + .long KW_REGS_PHY_BASE + 0x01508, 0x10000000 /* SDRAM CS[1] Base address */ + .long KW_REGS_PHY_BASE + 0x0150C, 0x00FFFFF4 /* SDRAM CS[1] Size, window disabled */ + .long KW_REGS_PHY_BASE + 0x01510, 0x20000000 /* SDRAM CS[2] Base address */ + .long KW_REGS_PHY_BASE + 0x01514, 0x00FFFFF8 /* SDRAM CS[2] Size, window disabled */ + .long KW_REGS_PHY_BASE + 0x01518, 0x30000000 /* SDRAM CS[3] Base address */
board/alliedtelesis/SBx81LIFKW/platform.S line 62
Quoted 10 lines
board/alliedtelesis/SBx81LIFKW/platform.S new file +10
-0+ .long KW_REGS_PHY_BASE + 0x0151C, 0x00FFFFFC /* SDRAM CS[3] Size, window disabled */ + + .long KW_REGS_PHY_BASE + 0x01494, 0x00030000 /* DDR ODT Control (Low) */ + .long KW_REGS_PHY_BASE + 0x01498, 0x00000000 /* DDR ODT Control (High) */ + .long KW_REGS_PHY_BASE + 0x0149C, 0x0000e803 /* CPU ODT Control */ + + .long KW_REGS_PHY_BASE + 0x01480, 0x00000001 /* DDR Initialization Control */ + + /* End of Header extension */ + .long 0x0, 0x0
My experience with Kirkwood and its code base is limited. But why do you have this DDR setup again in this .S file? Its already done in the SPI NOR header "kwbimage.cfg".
This is just a first comment - I'll do a more thorough review later.
Thanks,
Stefan