arm64: mvebu: Add support for A8K community board
Subsystems (4)
cover arm64: mvebu: Add support for A8K community board
From: Konstantin Porotchkin <[email protected]>
This patch series adds initil support for A8K community board MACCHIATOBin manufactured by SolidRun.
It should be applied on top of Stefan Roese patches adding support for SD/eMMC devices on Marvell A37x0/A80x0/A70x0 SoCs. The top level patch is called:
"arm64: mvebu: Enable SDHCI/MMC support for the db-88f7040/8040" The default board DTS file is based on the original work of Rabeeh Khory from SolidRun.
Konstantin Porotchkin (6):
arm64: mvebu: Update bubt command MMC block device access
arm64: mvebu: gpio: Add GPIO nodes to A8K family devices
arm64: mvebu: dts: Add i2c1 pin definitions to CPM
mvebu: usb: xhci: Add support for VBUS controlled by GPIO
mvebu: pcie: Add support for GPIO reset for PCIe device
arm64: mvebu: Add default configuraton for MACCHIATOBin board
Rabeeh Khoury (1):
arm64: mvebu: dts: Add DTS file for MACCHIATOBin board
arch/arm/dts/Makefile | 1 + arch/arm/dts/armada-7040.dtsi | 1 + arch/arm/dts/armada-8040-mcbin.dts | 253 ++++++++++++++++++++++ arch/arm/dts/armada-8040.dtsi | 1 + arch/arm/dts/armada-ap806.dtsi | 8 + arch/arm/dts/armada-cp110-master.dtsi | 22 ++ arch/arm/dts/armada-cp110-slave.dtsi | 18 ++ board/Marvell/mvebu_armada-8k/board.c | 54 ++++- board/Marvell/mvebu_db-88f3720/board.c | 2 +- cmd/mvebu/bubt.c | 17 +- configs/mvebu_mcbin-88f8040_defconfig | 65 ++++++ doc/device-tree-bindings/pci/armada8k-pcie.txt | 49 +++++ doc/device-tree-bindings/usb/marvell.xhci-usb.txt | 29 +++ drivers/pci/pcie_dw_mvebu.c | 11 + drivers/usb/host/xhci-mvebu.c | 5 +- 15 files changed, 518 insertions(+), 18 deletions(-) create mode 100644 arch/arm/dts/armada-8040-mcbin.dts create mode 100644 configs/mvebu_mcbin-88f8040_defconfig create mode 100644 doc/device-tree-bindings/pci/armada8k-pcie.txt create mode 100644 doc/device-tree-bindings/usb/marvell.xhci-usb.txt
Signature · 1 line
2.7.4
PATCH 1/7 arm64: mvebu: Update bubt command MMC block device access
From: Konstantin Porotchkin <[email protected]>
Update the MMC block device access code in bubt command implementation according to the latest MMC driver changes
--- cmd/mvebu/bubt.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-)
cmd/mvebu/bubt.c +12 -5
@@ -18,6 +18,7 @@#include <usb.h> #include <fs.h> #include <mmc.h> +#include <blk.h> #include <u-boot/sha1.h> #include <u-boot/sha256.h>
@@ -111,6 +112,7 @@ static ulong get_load_addr(void)static int mmc_burn_image (size_t image_size) {struct mmc *mmc; +struct blk_desc *blk_desc;lbaint_t start_lba;lbaint_t blk_count;ulong blk_written;
@@ -144,13 +146,18 @@ static int mmc_burn_image(size_t image_size)* MMC/eMMC boots from LBA-0 */ start_lba =IS_SD (mmc) ?1 :0 ; - blk_count = image_size / mmc->block_dev.blksz; -if (image_size % mmc->block_dev.blksz) + blk_count = image_size / mmc->write_bl_len; +if (image_size % mmc->write_bl_len) blk_count +=1 ; - blk_written = mmc->block_dev.block_write (mmc_dev_num, - start_lba, blk_count, - (void *)get_load_addr ()); + blk_desc =mmc_get_blk_desc (mmc); +if (!blk_desc) { +printf ("Error - failed to obtain block descriptor\n" ); +return -ENODEV ; + } + blk_written =blk_dwrite (blk_desc, start_lba, blk_count, + (void *)get_load_addr ()); +if (blk_written != blk_count) {printf ("Error - written %#lx blocks\n" , blk_written);return -ENOSPC ;
Signature · 1 line
2.7.4
PATCH 2/7 arm64: mvebu: gpio: Add GPIO nodes to A8K family devices
In reply to kostap at marvell.comFrom: Konstantin Porotchkin <[email protected]>
Add GPIO nodes to AP-806 and CP-110-master DTSI files.
--- arch/arm/dts/armada-7040.dtsi | 1 + arch/arm/dts/armada-8040.dtsi | 1 + arch/arm/dts/armada-ap806.dtsi | 8 ++++++++ arch/arm/dts/armada-cp110-master.dtsi | 18 ++++++++++++++++++ arch/arm/dts/armada-cp110-slave.dtsi | 18 ++++++++++++++++++ 5 files changed, 46 insertions(+)
arch/arm/dts/armada-7040.dtsi +1 -0
@@ -45,6 +45,7 @@ * one CP110. */ +#include <dt-bindings/gpio/gpio.h> #include "armada-ap806-quad.dtsi" #include "armada-cp110-master.dtsi"
arch/arm/dts/armada-8040.dtsi +1 -0
@@ -45,6 +45,7 @@ * two CP110. */ +#include <dt-bindings/gpio/gpio.h> #include "armada-ap806-quad.dtsi" #include "armada-cp110-master.dtsi" #include "armada-cp110-slave.dtsi"
arch/arm/dts/armada-ap806.dtsi +8 -0
@@ -158,6 +158,14 @@ }; }; + ap_gpio0: gpio at 6F5040 { + compatible = "marvell,orion-gpio"; + reg = <0x6F5040 0x40>; + ngpios = <20>; + gpio-controller; + #gpio-cells = <2>; + }; + xor at 400000 { compatible = "marvell,mv-xor-v2"; reg = <0x400000 0x1000>,
arch/arm/dts/armada-cp110-master.dtsi +18 -0
@@ -113,6 +113,24 @@ }; }; + cpm_gpio0: gpio at 440100 { + compatible = "marvell,orion-gpio"; + reg = <0x440100 0x40>; + ngpios = <32>; + gpiobase = <20>; + gpio-controller; + #gpio-cells = <2>; + }; + + cpm_gpio1: gpio at 440140 { + compatible = "marvell,orion-gpio"; + reg = <0x440140 0x40>; + ngpios = <31>; + gpiobase = <52>; + gpio-controller; + #gpio-cells = <2>; + }; + cpm_sata0: sata at 540000 { compatible = "marvell,armada-8k-ahci"; reg = <0x540000 0x30000>;
arch/arm/dts/armada-cp110-slave.dtsi +18 -0
@@ -100,6 +100,24 @@ }; }; + cps_gpio0: gpio at 440100 { + compatible = "marvell,orion-gpio"; + reg = <0x440100 0x40>; + ngpios = <32>; + gpiobase = <20>; + gpio-controller; + #gpio-cells = <2>; + }; + + cps_gpio1: gpio at 440140 { + compatible = "marvell,orion-gpio"; + reg = <0x440140 0x40>; + ngpios = <31>; + gpiobase = <52>; + gpio-controller; + #gpio-cells = <2>; + }; + cps_sata0: sata at 540000 { compatible = "marvell,armada-8k-ahci"; reg = <0x540000 0x30000>;
Signature · 1 line
2.7.4
PATCH 3/7 arm64: mvebu: dts: Add i2c1 pin definitions to CPM
In reply to kostap at marvell.comFrom: Konstantin Porotchkin <[email protected]>
Add i2c-1 pin mappings to CP0(master) DTSI file
--- arch/arm/dts/armada-cp110-master.dtsi | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm/dts/armada-cp110-master.dtsi +4 -0
@@ -94,6 +94,10 @@ marvell,pins = < 37 38 >; marvell,function = <2>; }; + cpm_i2c1_pins: cpm-i2c-pins-1 { + marvell,pins = < 35 36 >; + marvell,function = <2>; + }; cpm_ge2_rgmii_pins: cpm-ge-rgmii-pins-0 { marvell,pins = < 44 45 46 47 48 49 50 51 52 53 54 55 >;
Signature · 1 line
2.7.4
PATCH 4/7 mvebu: usb: xhci: Add support for VBUS controlled by GPIO
In reply to kostap at marvell.comFrom: Konstantin Porotchkin <[email protected]>
Add support for "marvell,vbus-gpio" property to mvebu XHCI board init function.
This option is valid when CONFIG_DM_GPIO=y
--- board/Marvell/mvebu_armada-8k/board.c | 32 ++++++++++++++++------- board/Marvell/mvebu_db-88f3720/board.c | 2 +- doc/device-tree-bindings/usb/marvell.xhci-usb.txt | 29 ++++++++++++++++++++ drivers/usb/host/xhci-mvebu.c | 5 ++-- 4 files changed, 55 insertions(+), 13 deletions(-) create mode 100644 doc/device-tree-bindings/usb/marvell.xhci-usb.txt
board/Marvell/mvebu_armada-8k/board.c +23 -9
@@ -8,6 +8,7 @@#include <dm.h> #include <i2c.h> #include <asm/io.h> +#include <asm/gpio.h> #include <asm/arch/cpu.h> #include <asm/arch/soc.h>
@@ -95,19 +96,23 @@ int board_xhci_config(void)return 0 ; } -int board_xhci_enable (void ) +int board_xhci_enable (struct udevice *usb_dev) {struct udevice *dev; +#ifdef CONFIG_DM_GPIO +struct gpio_desc vbus_gpio; +#endif int ret;u8 buf[8 ]; +/* +* This function enables all USB ports simultaniously, +* it only needs to get called once +*/ +if (usb_enabled) +return 0 ; +if (of_machine_is_compatible ("marvell,armada7040-db" )) { -/* -* This function enables all USB ports simultaniously, -* it only needs to get called once -*/ -if (usb_enabled) -return 0 ;/* Configure IO exander PCA9555: 7bit address 0x21 */ ret =i2c_get_chip_for_busnum (0 ,I2C_IO_EXP_ADDR ,1 , &dev);
@@ -131,10 +136,19 @@ int board_xhci_enable(void)return -EIO ; } -mdelay (500 );/* required delay to let output value settle */ - usb_enabled =1 ; } +#ifdef CONFIG_DM_GPIO +gpio_request_by_name (usb_dev,"marvell,vbus-gpio" ,0 , + &vbus_gpio,GPIOD_IS_OUT ); + +if (dm_gpio_is_valid (&vbus_gpio)) +dm_gpio_set_value (&vbus_gpio,1 ); +#endif + +mdelay (500 );/* required delay to let output value settle */ + usb_enabled =1 ; +return 0 ; }
board/Marvell/mvebu_db-88f3720/board.c +1 -1
@@ -69,7 +69,7 @@ int board_ahci_enable(void) }/* Board specific xHCI enable code */ -int board_xhci_enable (void ) +int board_xhci_enable (struct udevice *usb_dev) {struct udevice *dev;int ret;
doc/device-tree-bindings/usb/marvell.xhci-usb.txt new file +29 -0
@@ -0,0 +1,29 @@ +Marvell SOC USB controllers + +This controller is integrated in Armada 3700/8K. +It uses the same properties as a generic XHCI host controller + +Required properties : + - compatible: should be one or more of: + - "marvell,armada3700-xhci", "generic-xhci" for Armada 37xx SoCs + - "marvell,armada-8k-xhci", "generic-xhci" for Armada A8K SoCs + - reg: should contain address and length of the standard XHCI + register set for the device. + - interrupts: one XHCI interrupt should be described here. + +Optional properties: + - clocks: reference to a clock + - marvell,vbus-gpio : If present, specifies a gpio that needs to be + activated for the bus to be powered. + +Example: + cpm_usb3_0: usb3 at 500000 { + compatible = "marvell,armada-8k-xhci", + "generic-xhci"; + reg = <0x500000 0x4000>; + interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cpm_syscon0 1 22>; + marvell,vbus-gpio = <&cpm_gpio1 15 GPIO_ACTIVE_HIGH>; + status = "disabled"; + }; +
drivers/usb/host/xhci-mvebu.c +2 -3
@@ -10,7 +10,6 @@#include <dm.h> #include <fdtdec.h> #include <usb.h> -#include <asm/gpio.h> #include "xhci.h"
@@ -34,7 +33,7 @@ struct mvebu_xhci {* Dummy implementation that can be overwritten by a board * specific function */ -__weak int board_xhci_enable (void ) +__weak int board_xhci_enable (struct udevice *usb_dev) {return 0 ; }
@@ -51,7 +50,7 @@ static int xhci_usb_probe(struct udevice *dev) hcor = (struct xhci_hcor *)((uintptr_t )ctx->hcd + len);/* Enable USB xHCI (VBUS, reset etc) in board specific code */ -board_xhci_enable (); +board_xhci_enable (dev);return xhci_register (dev, ctx->hcd, hcor); }
Signature · 1 line
2.7.4
PATCH 5/7 mvebu: pcie: Add support for GPIO reset for PCIe device
In reply to kostap at marvell.comFrom: Konstantin Porotchkin <[email protected]>
Add board init hook to mvebu DW PCIe device driver. Add support for "marvell,reset-gpio" property to A8K board init function.
This option is valid when CONFIG_DM_GPIO=y
--- board/Marvell/mvebu_armada-8k/board.c | 22 ++++++++++++ doc/device-tree-bindings/pci/armada8k-pcie.txt | 49 ++++++++++++++++++++++++++ drivers/pci/pcie_dw_mvebu.c | 11 ++++++ 3 files changed, 82 insertions(+) create mode 100644 doc/device-tree-bindings/pci/armada8k-pcie.txt
board/Marvell/mvebu_armada-8k/board.c +22 -0
@@ -152,6 +152,28 @@ int board_xhci_enable(struct udevice *usb_dev)return 0 ; } +int board_pcie_init (struct udevice *pcie_dev) +{ +#ifdef CONFIG_DM_GPIO +struct gpio_desc reset_gpio; + +gpio_request_by_name (pcie_dev,"marvell,reset-gpio" ,0 , + &reset_gpio,GPIOD_IS_OUT ); +/* +* Issue reset to add-in card trough the dedicated GPIO. +* Some boards are connecting the card reset pin to common +* system reset wire and others are using separate GPIO port. +* In the last case we have to release a reset of the addon +* card using this GPIO. +*/ +if (dm_gpio_is_valid (&reset_gpio)) { +dm_gpio_set_value (&reset_gpio,1 ); +mdelay (100 ); + } +#endif /* CONFIG_DM_GPIO */ +return 0 ; +} +int board_early_init_f (void ) {/* Nothing to do (yet), perhaps later some pin-muxing etc */
doc/device-tree-bindings/pci/armada8k-pcie.txt new file +49 -0
49 lines not on this page · raw message
drivers/pci/pcie_dw_mvebu.c +11 -0
@@ -112,6 +112,15 @@ struct pcie_dw_mvebu {int first_busno; }; +/* +* Dummy implementation that can be overwritten by a board +* specific function +*/ +__weak int board_pcie_init (struct udevice *pcie_dev) +{ +return 0 ; +} +static int pcie_dw_get_link_speed (const void *regs_base) { return (readl(regs_base + PCIE_LINK_STATUS_REG) &
@@ -464,6 +473,8 @@ static int pcie_dw_mvebu_probe(struct udevice *dev) pcie->first_busno = dev->seq; +board_pcie_init (dev); +/* Don't register host if link is down */ if (!pcie_dw_mvebu_pcie_link_up (pcie->ctrl_base,LINK_SPEED_GEN_3 )) {printf ("PCIE-%d: Link down\n" , dev->seq);
Signature · 1 line
2.7.4
PATCH 6/7 arm64: mvebu: dts: Add DTS file for MACCHIATOBin board
In reply to kostap at marvell.comFrom: Rabeeh Khoury <[email protected]>
Added A8040 dts file for community board MACCHIATIBin. The patch includes the following features:
AP - eMMC, Serial console (connected to onboard FTDI usb to serial) CP0 - PCIe x4, SATA, I2C and 10G KR
(connected to Marvell 3310 10G copper / SFP+ phy)
CP1 - Boot SPI, USB3 host, 2xSATA, 10G KR
(connected to Marvell 3310 10G copper / SFP+ phy), SGMII connected to onboard 1512 1Gbps copper phy, and additional SGMII connected to SFP
(default 1Gbps can be configured to 2.5Gbps).
Network interface naming -
egiga0 - CP0 KR
egiga1 - CP1 KR
egiga2 - CP1 RJ45 1Gbps connector (recommended for TFTP boot) egiga3 - CP1 SFP default 1Gbps and can be modified to 2.5Gbps
--- arch/arm/dts/Makefile | 1 + arch/arm/dts/armada-8040-mcbin.dts | 253 +++++++++++++++++++++++++++++++++++++ 2 files changed, 254 insertions(+) create mode 100644 arch/arm/dts/armada-8040-mcbin.dts
arch/arm/dts/Makefile +1 -0
@@ -76,6 +76,7 @@ dtb-$(CONFIG_ARCH_MVEBU) += \ armada-385-amc.dtb \ armada-7040-db.dtb \ armada-8040-db.dtb \ + armada-8040-mcbin.dtb \ armada-xp-gp.dtb \ armada-xp-maxbcm.dtb \ armada-xp-synology-ds414.dtb \
arch/arm/dts/armada-8040-mcbin.dts new file +253 -0
253 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH 7/7 arm64: mvebu: Add default configuraton for MACCHIATOBin board
In reply to kostap at marvell.comFrom: Konstantin Porotchkin <[email protected]>
Add default configuration for MACHHIATOBin community board based on Aramda-8040 SoC.
--- configs/mvebu_mcbin-88f8040_defconfig | 65 +++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 configs/mvebu_mcbin-88f8040_defconfig
configs/mvebu_mcbin-88f8040_defconfig new file +65 -0
@@ -0,0 +1,65 @@ +CONFIG_ARM=y +CONFIG_ARCH_MVEBU=y +CONFIG_SYS_MALLOC_F_LEN=0x2000 +CONFIG_TARGET_MVEBU_ARMADA_8K=y +CONFIG_DEFAULT_DEVICE_TREE="armada-8040-mcbin" +CONFIG_SMBIOS_PRODUCT_NAME="" +CONFIG_AHCI=y +# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set +CONFIG_SYS_CONSOLE_INFO_QUIET=y +# CONFIG_DISPLAY_CPUINFO is not set +# CONFIG_DISPLAY_BOARDINFO is not set +# CONFIG_CMD_IMLS is not set +# CONFIG_CMD_FLASH is not set +CONFIG_CMD_SF=y +CONFIG_CMD_SPI=y +CONFIG_CMD_I2C=y +CONFIG_CMD_USB=y +# CONFIG_CMD_FPGA is not set +# CONFIG_CMD_SETEXPR is not set +CONFIG_CMD_TFTPPUT=y +CONFIG_CMD_DHCP=y +CONFIG_CMD_MII=y +CONFIG_CMD_PING=y +CONFIG_CMD_CACHE=y +CONFIG_CMD_TIME=y +CONFIG_CMD_MMC=y +CONFIG_CMD_GPIO=y +CONFIG_CMD_EXT4=y +CONFIG_CMD_EXT4_WRITE=y +CONFIG_CMD_FAT=y +CONFIG_CMD_FS_GENERIC=y +CONFIG_CMD_MVEBU_BUBT=y +CONFIG_BLOCK_CACHE=y +CONFIG_DM_I2C=y +CONFIG_SYS_I2C_MVTWSI=y +CONFIG_DM_GPIO=y +CONFIG_MVEBU_GPIO=y +CONFIG_MISC=y +CONFIG_SPI_FLASH=y +CONFIG_SPI_FLASH_MACRONIX=y +CONFIG_SPI_FLASH_SPANSION=y +CONFIG_SPI_FLASH_STMICRO=y +CONFIG_SPI_FLASH_WINBOND=y +CONFIG_PHYLIB=y +CONFIG_PCI=y +CONFIG_DM_PCI=y +CONFIG_PCIE_DW_MVEBU=y +CONFIG_MVEBU_COMPHY_SUPPORT=y +# CONFIG_SPL_SERIAL_PRESENT is not set +CONFIG_DEBUG_UART=y +CONFIG_DEBUG_UART_BASE=0xf0512000 +CONFIG_DEBUG_UART_CLOCK=200000000 +CONFIG_DEBUG_UART_SHIFT=2 +CONFIG_DEBUG_UART_ANNOUNCE=y +CONFIG_SYS_NS16550=y +CONFIG_USB=y +CONFIG_DM_USB=y +CONFIG_USB_XHCI_HCD=y +CONFIG_USB_EHCI_HCD=y +CONFIG_USB_STORAGE=y +CONFIG_DM_MMC=y +CONFIG_XENON_SDHCI=y +CONFIG_SMBIOS_MANUFACTURER="" +CONFIG_PINCTRL=y +CONFIG_HUSH_PARSER=y
Signature · 1 line
2.7.4