From e0f531f111108a121845547b249cce14b7418cd9 Mon Sep 17 00:00:00 2001 From: Philipp Tomsich Date: Wed, 30 Mar 2016 12:25:15 +0200 Subject: ARM: sunxi: add support for the A80-Q7 module This adds a DTS and a defconfig for the A80-Q7 (a system-on-module compatible with the Qseven form-factor developed and supported by Theobroma Systems). --- arch/arm/dts/Makefile | 3 +- arch/arm/dts/sun9i-a80-armadillo.dts | 212 +++++++++++++++++++++++++++++++++++ configs/A80_Armadillo_defconfig | 60 ++++++++++ include/configs/sunxi-common.h | 21 +++- 4 files changed, 294 insertions(+), 2 deletions(-) create mode 100644 arch/arm/dts/sun9i-a80-armadillo.dts create mode 100644 configs/A80_Armadillo_defconfig diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index 50bcc0b5b9..ebfabeee9a 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -208,7 +208,8 @@ dtb-$(CONFIG_MACH_SUN8I_H3) += \ sun8i-h3-orangepi-plus.dtb dtb-$(CONFIG_MACH_SUN9I) += \ sun9i-a80-optimus.dtb \ - sun9i-a80-cubieboard4.dtb + sun9i-a80-cubieboard4.dtb \ + sun9i-a80-armadillo.dtb dtb-$(CONFIG_VF610) += vf500-colibri.dtb \ vf610-colibri.dtb \ diff --git a/arch/arm/dts/sun9i-a80-armadillo.dts b/arch/arm/dts/sun9i-a80-armadillo.dts new file mode 100644 index 0000000000..cd9fda435c --- /dev/null +++ b/arch/arm/dts/sun9i-a80-armadillo.dts @@ -0,0 +1,212 @@ +/* + * Copyright 2016 Theobroma Systems Design und Consulting GmbH + * + * Philipp Tomsich + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This file is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/dts-v1/; +#include "sun9i-a80.dtsi" +#include "sunxi-common-regulators.dtsi" + +#include +#include + +/ { + model = "Theobroma Systems A80-Q7 SoM"; + compatible = "theobroma-systems,a80-q7", "allwinner,sun9i-a80"; + + aliases { + serial0 = &uart4; + spi0 = &spi0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + pinctrl-0 = <&led_pins_armadillo>; + + green { + label = "armadillo:heartbeat:usr"; + gpios = <&pio 3 25 GPIO_ACTIVE_HIGH>; /* PD25 */ + }; + + red { + label = "armadillo:sdio_led:usr"; + gpios = <&pio 7 13 GPIO_ACTIVE_HIGH>; /* PH13 */ + }; + }; +}; + +&ehci0 { + status = "okay"; +}; + +&ehci1 { + status = "disabled"; +}; + +&ehci2 { + status = "okay"; +}; + +&ohci0 { + status = "okay"; +}; + +&ohci2 { + status = "okay"; +}; + +&pio { + led_pins_armadillo: led-pins@0 { + allwinner,pins = "PD25", "PH13"; + allwinner,function = "gpio_out"; + allwinner,drive = ; + allwinner,pull = ; + }; + + mmc0_cd_pin_armadillo: mmc0_cd_pin@0 { + allwinner,pins = "PH15"; + allwinner,function = "gpio_in"; + allwinner,drive = ; + allwinner,pull = ; + }; + + gmac_phy_reset_pin_armadillo: gmac_phy_reset_pin@0 { + allwinner,pins = "PA14"; + allwinner,function = "gpio_out"; + allwinner,drive = ; + allwinner,pull = ; + }; +}; + +&mmc0 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc0_pins>, <&mmc0_cd_pin_armadillo>; + vmmc-supply = <®_vcc3v0>; + bus-width = <4>; + cd-gpios = <&pio 7 15 GPIO_ACTIVE_HIGH>; /* PH15 */ + cd-inverted; + status = "okay"; +}; + +&mmc2 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc2_8bit_pins>; + vmmc-supply = <®_vcc3v0>; + bus-width = <8>; + non-removable; + cap-mmc-hw-reset; + status = "okay"; +}; + +&mmc2_8bit_pins { + /* Increase drive strength for DDR modes */ + allwinner,drive = ; +}; + +&r_rsb { + status = "okay"; + + axp808: pmic@2d { + compatible = "x-powers,axp808"; + status = "okay"; + reg = <0x2d>; + }; + + axp806: pmic@3a { + compatible = "x-powers,axp806"; + status = "okay"; + reg = <0x3a>; + }; +}; + +&uart4 { + pinctrl-names = "default"; + pinctrl-4 = <&uart4_pins_a>; + status = "okay"; +}; + +&usbphy1 { +/* phy-supply = <®_usb1_vbus>; */ + status = "okay"; +}; + +&usbphy2 { + status = "okay"; +}; + +&usbphy3 { +/* phy-supply = <®_usb3_vbus>; */ + status = "okay"; +}; + +&gmac { + pinctrl-names = "default"; + pinctrl-0 = <&gmac_pins_rgmii_a>, <&gmac_phy_reset_pin_armadillo>; + phy = <&phy1>; + phy-mode = "rgmii"; + snps,reset-gpio = <&pio 0 14 GPIO_ACTIVE_HIGH>; + snps,reset-active-low; + snps,reset-delays-us = <0 10000 30000>; + status = "okay"; + rxc-skew-ps = <1800>; + txc-skew-ps = <1800>; + + phy1: ethernet-phy@6 { + reg = <6>; + }; +}; + +&spi0 { + status = "okay"; + + flash: flash@0 { + compatible = "spansion,m25p40"; + spi-max-frequency = <16000000>; + spi-cpol; + spi-cpha; + }; +}; diff --git a/configs/A80_Armadillo_defconfig b/configs/A80_Armadillo_defconfig new file mode 100644 index 0000000000..e4bfd51e99 --- /dev/null +++ b/configs/A80_Armadillo_defconfig @@ -0,0 +1,60 @@ +CONFIG_ARM=y +CONFIG_ARCH_SUNXI=y +CONFIG_MACH_SUN9I=y +CONFIG_SUNXI_ARMADILLO=y +CONFIG_SUNXI_ENV_MMC=y +CONFIG_DRAM_CLK=672 +CONFIG_DRAM_ZQ=4145117 +CONFIG_SYS_CLK_FREQ=1008000000 +CONFIG_OLD_SUNXI_KERNEL_COMPAT=y +CONFIG_DEFAULT_DEVICE_TREE="sun9i-a80-armadillo" +CONFIG_SPL=y +CONFIG_CMD_GPIO=y +CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=5,SUNXI_GMAC,RGMII,MACPWR=SUNXI_GPA(14)" +CONFIG_ETH_DESIGNWARE=y +CONFIG_MMC0_CD_PIN="PH15" +CONFIG_MMC_SUNXI_SLOT_EXTRA=2 +CONFIG_SYS_MALLOC_F_LEN=0x1000 +CONFIG_DM_PMIC=y +CONFIG_AXP809_POWER=y +CONFIG_AXP806_POWER=y +CONFIG_AXP_DCDC1_VOLT=3300 +CONFIG_AXP_DCDC2_VOLT=0 +CONFIG_AXP_DCDC3_VOLT=900 +CONFIG_AXP_DCDC4_VOLT=900 +CONFIG_AXP_DCDC5_VOLT=1500 +CONFIG_AXP_DC5LDO_VOLT=900 +CONFIG_AXP_ALDO1_VOLT=3300 +CONFIG_AXP_ALDO2_VOLT=0 +CONFIG_AXP_ALDO3_VOLT=0 +CONFIG_AXP_DLDO1_VOLT=0 +CONFIG_AXP_DLDO2_VOLT=0 +CONFIG_AXP_ELDO1_VOLT=0 +CONFIG_AXP_ELDO2_VOLT=0 +CONFIG_AXP_ELDO3_VOLT=1800 +CONFIG_PMIC_AXP80X=y +# CONFIG_PMIC_CHILDREN is not set +# CONFIG_SPL_PMIC_CHILDREN is not set +CONFIG_CMD_PMIC=y +CONFIG_ERRNO_STR=y +CONFIG_DM_I2C=y +CONFIG_MTD=y +CONFIG_SUNXI_SPI=y +CONFIG_DM_SPI=y +CONFIG_DM_SPI_FLASH=y +CONFIG_SPI_FLASH=y +CONFIG_SPI_FLASH_BAR=y +CONFIG_SPI_FLASH_MACRONIX=y +CONFIG_SPI_FLASH_SPANSION=y +CONFIG_SPI_FLASH_STMICRO=y +CONFIG_SPI_FLASH_SST=y +CONFIG_SPI_FLASH_WINBOND=y +CONFIG_SPI_FLASH_USE_4K_SECTORS=y +CONFIG_SPI_FLASH_DATAFLASH=y +CONFIG_SPI_FLASH_MTD=y +CONFIG_CMD_SPI=y +CONFIG_CMD_SF=y +# CONFIG_VIDEO is not set +# CONFIG_CMD_IMLS is not set +# CONFIG_CMD_FLASH is not set +# CONFIG_CMD_FPGA is not set diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h index 7fa9833b4d..39e1b2bd07 100644 --- a/include/configs/sunxi-common.h +++ b/include/configs/sunxi-common.h @@ -145,8 +145,26 @@ #ifdef CONFIG_MMC #define CONFIG_GENERIC_MMC #define CONFIG_CMD_MMC +#define CONFIG_SUPPORT_EMMC_BOOT #define CONFIG_MMC_SUNXI #define CONFIG_MMC_SUNXI_SLOT 0 +#if defined(CONFIG_SUNXI_PANGOLIN) || defined(CONFIG_SUNXI_ARMADILLO) +#ifdef CONFIG_SUNXI_ENV_MMC +#define CONFIG_ENV_IS_IN_MMC +#define CONFIG_SYS_MMC_ENV_DEV 0 /* first detected MMC controller */ +#define CONFIG_ENV_OFFSET (544 << 10) /* (8 + 24 + 512) KiB */ +#endif +#ifdef CONFIG_SUNXI_ENV_SPI +#define CONFIG_ENV_IS_IN_SPI_FLASH +#define CONFIG_ENV_SECT_SIZE (64 * 1024) +#define CONFIG_ENV_SPI 0 +#define CONFIG_ENV_SPI_CS 0 +#define CONFIG_ENV_SPI_MAX_HZ 16000000 +#define CONFIG_ENV_OFFSET 0 +#endif +#endif +#else +#define CONFIG_ENV_OFFSET (544 << 10) /* (8 + 24 + 512) KiB */ #define CONFIG_ENV_IS_IN_MMC #define CONFIG_SYS_MMC_ENV_DEV 0 /* first detected MMC controller */ #endif @@ -181,7 +199,6 @@ #define CONFIG_IDENT_STRING " Allwinner Technology" #define CONFIG_DISPLAY_BOARDINFO -#define CONFIG_ENV_OFFSET (544 << 10) /* (8 + 24 + 512) KiB */ #define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB */ #define CONFIG_FAT_WRITE /* enable write access */ @@ -326,6 +343,8 @@ extern int soft_i2c_gpio_scl; #define CONFIG_PHY_GIGE /* GMAC can use gigabit PHY */ #define CONFIG_MII /* MII PHY management */ #define CONFIG_PHY_REALTEK +#define CONFIG_PHY_MICREL +#define CONFIG_PHY_MICREL_KSZ9031 #endif #ifdef CONFIG_USB_EHCI_HCD -- cgit v1.2.3