From 8faac0941cd409c6ff3738fbf658de2296f48e9a Mon Sep 17 00:00:00 2001 From: Antony Antony Date: Tue, 21 Nov 2017 10:11:52 +0100 Subject: [PATCH 01/15] arm64: sun50i-h5.dtsi : update to kernel 4.14 last Kernel commit of sun50i-h5.dtsi d86e63e1f0b7 Signed-off-by: Antony Antony Reviewed-by: Jagan Teki --- arch/arm/dts/sun50i-h5.dtsi | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/arch/arm/dts/sun50i-h5.dtsi b/arch/arm/dts/sun50i-h5.dtsi index 4904c18054..c052f31131 100644 --- a/arch/arm/dts/sun50i-h5.dtsi +++ b/arch/arm/dts/sun50i-h5.dtsi @@ -72,6 +72,38 @@ }; }; +&ccu { + compatible = "allwinner,sun50i-h5-ccu"; +}; + &gic { compatible = "arm,gic-400"; }; + +&mmc0 { + compatible = "allwinner,sun50i-h5-mmc", + "allwinner,sun50i-a64-mmc"; + clocks = <&ccu CLK_BUS_MMC0>, <&ccu CLK_MMC0>; + clock-names = "ahb", "mmc"; +}; + +&mmc1 { + compatible = "allwinner,sun50i-h5-mmc", + "allwinner,sun50i-a64-mmc"; + clocks = <&ccu CLK_BUS_MMC1>, <&ccu CLK_MMC1>; + clock-names = "ahb", "mmc"; +}; + +&mmc2 { + compatible = "allwinner,sun50i-h5-emmc", + "allwinner,sun50i-a64-emmc"; + clocks = <&ccu CLK_BUS_MMC2>, <&ccu CLK_MMC2>; + clock-names = "ahb", "mmc"; +}; + +&pio { + interrupts = , + , + ; + compatible = "allwinner,sun50i-h5-pinctrl"; +}; From 6130b1f6bc237df95f057994f5fccffa6be0a6f1 Mon Sep 17 00:00:00 2001 From: Antony Antony Date: Tue, 21 Nov 2017 10:11:53 +0100 Subject: [PATCH 02/15] sun50i: h5: Add NanoPi Neo Plus2 DT initial support Add initial DT for NanoPi NEO Plus2 by FriendlyARM - Allwinner quad core H5 Cortex A53 with an ARM Mali-450MP GPU - 1 GB DDR3 RAM - 8GB eMMC flash (Samsung KLM8G1WEPD-B031) - micro SD card slot - Gigabit Ethernet (external RTL8211E-VB-CG chip) - 802.11 b/g/n WiFi, Bluetooth 4.0 (Ampak AP6212A module) - 2x USB 2.0 host ports Signed-off-by: Antony Antony Reviewed-by: Jagan Teki --- arch/arm/dts/Makefile | 1 + arch/arm/dts/sun50i-h5-nanopi-neo-plus2.dts | 106 ++++++++++++++++++++ board/sunxi/MAINTAINERS | 5 + configs/nanopi_neo_plus2_defconfig | 18 ++++ 4 files changed, 130 insertions(+) create mode 100644 arch/arm/dts/sun50i-h5-nanopi-neo-plus2.dts create mode 100644 configs/nanopi_neo_plus2_defconfig diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index cd540e99ea..f54adb2184 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -337,6 +337,7 @@ dtb-$(CONFIG_MACH_SUN8I_V3S) += \ sun8i-v3s-licheepi-zero.dtb dtb-$(CONFIG_MACH_SUN50I_H5) += \ sun50i-h5-nanopi-neo2.dtb \ + sun50i-h5-nanopi-neo-plus2.dtb \ sun50i-h5-orangepi-pc2.dtb \ sun50i-h5-orangepi-prime.dtb \ sun50i-h5-orangepi-zero-plus2.dtb diff --git a/arch/arm/dts/sun50i-h5-nanopi-neo-plus2.dts b/arch/arm/dts/sun50i-h5-nanopi-neo-plus2.dts new file mode 100644 index 0000000000..f1406c224b --- /dev/null +++ b/arch/arm/dts/sun50i-h5-nanopi-neo-plus2.dts @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2017 Antony Antony + * Copyright (c) 2016 ARM Ltd. + * + * 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 library 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 library 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 "sun50i-h5.dtsi" + +#include + +/ { + model = "FriendlyARM NanoPi NEO Plus 2"; + compatible = "friendlyarm,nanopi-neo-plus2", "allwinner,sun50i-h5"; + + aliases { + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + reg_vcc3v3: vcc3v3 { + compatible = "regulator-fixed"; + regulator-name = "vcc3v3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + }; +}; + +&ehci1 { + status = "okay"; +}; + +&mmc0 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>; + vmmc-supply = <®_vcc3v3>; + bus-width = <4>; + cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; + cd-inverted; + status = "okay"; +}; + +&mmc2 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc2_8bit_pins>; + vmmc-supply = <®_vcc3v3>; + bus-width = <8>; + non-removable; + cap-mmc-hw-reset; + status = "okay"; +}; + +&ohci1 { + status = "okay"; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins_a>; + status = "okay"; +}; + +&usbphy { + status = "okay"; +}; diff --git a/board/sunxi/MAINTAINERS b/board/sunxi/MAINTAINERS index 99809c6a1c..ee24d70913 100644 --- a/board/sunxi/MAINTAINERS +++ b/board/sunxi/MAINTAINERS @@ -286,6 +286,11 @@ M: Jagan Teki S: Maintained F: configs/nanopi_neo2_defconfig +NANOPI-NEO-PLUS2 BOARD +M: Antony Antony +S: Maintained +F: configs/nanopi_neo_plus2_defconfig + NANOPI-NEO-AIR BOARD M: Jelle van der Waa S: Maintained diff --git a/configs/nanopi_neo_plus2_defconfig b/configs/nanopi_neo_plus2_defconfig new file mode 100644 index 0000000000..83a8dff76e --- /dev/null +++ b/configs/nanopi_neo_plus2_defconfig @@ -0,0 +1,18 @@ +CONFIG_ARM=y +CONFIG_ARCH_SUNXI=y +CONFIG_MACH_SUN50I_H5=y +CONFIG_DRAM_CLK=408 +CONFIG_DRAM_ZQ=3881977 +CONFIG_MACPWR="PD6" +CONFIG_DEFAULT_DEVICE_TREE="sun50i-h5-nanopi-neo-plus2" +# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set +CONFIG_SPL=y +# CONFIG_CMD_IMLS is not set +# CONFIG_CMD_FLASH is not set +# CONFIG_CMD_FPGA is not set +# CONFIG_SPL_DOS_PARTITION is not set +# CONFIG_SPL_ISO_PARTITION is not set +# CONFIG_SPL_EFI_PARTITION is not set +CONFIG_SUN8I_EMAC=y +CONFIG_USB_EHCI_HCD=y +CONFIG_MMC_SUNXI_SLOT_EXTRA=2 From 0458e8c6fa660c40f52098e32a71aeee31e3aa92 Mon Sep 17 00:00:00 2001 From: Icenowy Zheng Date: Wed, 1 Nov 2017 22:18:07 +0800 Subject: [PATCH 03/15] video: sunxi: de2: add support for LCD SimpleFB Add support for setting up SimpleFB for LCD display output in DE2 SimpleFB setup code. Signed-off-by: Icenowy Zheng Reviewed-by: Jagan Teki Acked-by: Maxime Ripard --- drivers/video/sunxi/sunxi_de2.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/video/sunxi/sunxi_de2.c b/drivers/video/sunxi/sunxi_de2.c index 6d6bb2e0c3..860187323c 100644 --- a/drivers/video/sunxi/sunxi_de2.c +++ b/drivers/video/sunxi/sunxi_de2.c @@ -319,7 +319,7 @@ U_BOOT_DEVICE(sunxi_de2) = { #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_VIDEO_DT_SIMPLEFB) int sunxi_simplefb_setup(void *blob) { - struct udevice *de2, *hdmi; + struct udevice *de2, *hdmi, *lcd; struct video_priv *de2_priv; struct video_uc_platdata *de2_plat; int mux; @@ -355,6 +355,15 @@ int sunxi_simplefb_setup(void *blob) debug("HDMI present but not probed\n"); } + ret = uclass_find_device_by_name(UCLASS_DISPLAY, + "sunxi_lcd", &lcd); + if (ret) + debug("LCD not present\n"); + else if (device_active(lcd)) + pipeline = "mixer0-lcd0"; + else + debug("LCD present but not probed\n"); + if (!pipeline) { debug("No active display present\n"); return 0; From 3cfecee49c6fa97a4256f770d12ff476941e5a88 Mon Sep 17 00:00:00 2001 From: Icenowy Zheng Date: Tue, 31 Oct 2017 07:36:28 +0800 Subject: [PATCH 04/15] sunxi: set the default CPUx frequency of H5 to 816MHz Some H5 boards are designed to start at 1.1V CPUx voltage (e.g. Nano Pi NEO2), which may not work properly at 1008MHz if the chip's quality is not so good. Lower the default CPUx frequency of H5 to 816MHz. Signed-off-by: Icenowy Zheng Reviewed-by: Jagan Teki --- arch/arm/mach-sunxi/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig index 09cfec6f57..1fededd0a3 100644 --- a/arch/arm/mach-sunxi/Kconfig +++ b/arch/arm/mach-sunxi/Kconfig @@ -397,9 +397,9 @@ config SYS_CLK_FREQ default 1008000000 if MACH_SUN5I default 1008000000 if MACH_SUN6I default 912000000 if MACH_SUN7I + default 816000000 if MACH_SUN50I || MACH_SUN50I_H5 default 1008000000 if MACH_SUN8I default 1008000000 if MACH_SUN9I - default 816000000 if MACH_SUN50I config SYS_CONFIG_NAME default "sun4i" if MACH_SUN4I From 64089178219371a512ddca8016d78bfdbe84565d Mon Sep 17 00:00:00 2001 From: Vasily Khoruzhick Date: Tue, 28 Nov 2017 22:33:27 -0800 Subject: [PATCH 05/15] sunxi: video: HDMI: split VSYNC and HSYNC polarity settings These are actually different bits, and since some monitors (Benq BL2420PT) have modes with different HSYNC and VSYNC polarity, we should set them independently Tested on Pine64-LTS with Benq BL2420PT monitor. Signed-off-by: Vasily Khoruzhick Reviewed-by: Anatolij Gustschin Acked-by: Maxime Ripard Reviewed-by: Jagan Teki --- drivers/video/sunxi/sunxi_dw_hdmi.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/video/sunxi/sunxi_dw_hdmi.c b/drivers/video/sunxi/sunxi_dw_hdmi.c index 33920a2b67..4f01d1bded 100644 --- a/drivers/video/sunxi/sunxi_dw_hdmi.c +++ b/drivers/video/sunxi/sunxi_dw_hdmi.c @@ -304,15 +304,11 @@ static int sunxi_dw_hdmi_enable(struct udevice *dev, int panel_bpp, sunxi_dw_hdmi_lcdc_init(priv->mux, edid, panel_bpp); - /* - * Condition in original code is a bit weird. This is attempt - * to make it more reasonable and it works. It could be that - * bits and conditions are related and should be separated. - */ - if (!((edid->flags & DISPLAY_FLAGS_HSYNC_HIGH) && - (edid->flags & DISPLAY_FLAGS_VSYNC_HIGH))) { - setbits_le32(&phy->pol, 0x300); - } + if (edid->flags & DISPLAY_FLAGS_HSYNC_LOW) + setbits_le32(&phy->pol, 0x200); + + if (edid->flags & DISPLAY_FLAGS_VSYNC_LOW) + setbits_le32(&phy->pol, 0x100); setbits_le32(&phy->ctrl, 0xf << 12); From aba3924927263f23d8ca302b52b1988ed924e5b1 Mon Sep 17 00:00:00 2001 From: Stefan Mavrodiev Date: Fri, 3 Nov 2017 08:56:51 +0200 Subject: [PATCH 06/15] sunxi: Fix A20-OLinuXino-MICRO LAN8710 support >From revision J the board uses new phy chip LAN8710. Compared with RTL8201, RA17 pin is TXERR. It has pullup which causes phy not to work. To fix this PA17 is muxed with GMAC function. This makes the pin output-low. Signed-off-by: Stefan Mavrodiev Acked-by: Maxime Ripard Reviewed-by: Jagan Teki --- board/sunxi/gmac.c | 4 ++++ configs/A20-OLinuXino_MICRO-eMMC_defconfig | 1 + configs/A20-OLinuXino_MICRO_defconfig | 1 + drivers/net/Kconfig | 8 ++++++++ 4 files changed, 14 insertions(+) diff --git a/board/sunxi/gmac.c b/board/sunxi/gmac.c index 69eb8ff2d9..826650c89b 100644 --- a/board/sunxi/gmac.c +++ b/board/sunxi/gmac.c @@ -33,7 +33,11 @@ void eth_init_board(void) #ifndef CONFIG_MACH_SUN6I /* Configure pin mux settings for GMAC */ +#ifdef CONFIG_SUN7I_GMAC_FORCE_TXERR + for (pin = SUNXI_GPA(0); pin <= SUNXI_GPA(17); pin++) { +#else for (pin = SUNXI_GPA(0); pin <= SUNXI_GPA(16); pin++) { +#endif #ifdef CONFIG_RGMII /* skip unused pins in RGMII mode */ if (pin == SUNXI_GPA(9) || pin == SUNXI_GPA(14)) diff --git a/configs/A20-OLinuXino_MICRO-eMMC_defconfig b/configs/A20-OLinuXino_MICRO-eMMC_defconfig index 2ff2723065..43bcea92a5 100644 --- a/configs/A20-OLinuXino_MICRO-eMMC_defconfig +++ b/configs/A20-OLinuXino_MICRO-eMMC_defconfig @@ -19,6 +19,7 @@ CONFIG_SPL_I2C_SUPPORT=y # CONFIG_SPL_EFI_PARTITION is not set CONFIG_ETH_DESIGNWARE=y CONFIG_SUN7I_GMAC=y +CONFIG_SUN7I_GMAC_FORCE_TXERR=y CONFIG_AXP_ALDO3_VOLT=2800 CONFIG_AXP_ALDO4_VOLT=2800 CONFIG_SCSI=y diff --git a/configs/A20-OLinuXino_MICRO_defconfig b/configs/A20-OLinuXino_MICRO_defconfig index 1a0ad5a6d4..22eacb370e 100644 --- a/configs/A20-OLinuXino_MICRO_defconfig +++ b/configs/A20-OLinuXino_MICRO_defconfig @@ -20,6 +20,7 @@ CONFIG_SPL_I2C_SUPPORT=y # CONFIG_SPL_EFI_PARTITION is not set CONFIG_ETH_DESIGNWARE=y CONFIG_SUN7I_GMAC=y +CONFIG_SUN7I_GMAC_FORCE_TXERR=y CONFIG_AXP_ALDO3_VOLT=2800 CONFIG_AXP_ALDO4_VOLT=2800 CONFIG_SCSI=y diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 52555da4b3..d42d915f17 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig @@ -244,6 +244,14 @@ config SUN7I_GMAC help Enable the support for Sun7i GMAC Ethernet controller +config SUN7I_GMAC_FORCE_TXERR + bool "Force PA17 as gmac function" + depends on SUN7I_GMAC + help + Some ethernet phys needs TXERR control. Since the GMAC + doesn't have such signal, setting PA17 as GMAC function + makes the pin output low, which enables data transmission. + config SUN4I_EMAC bool "Allwinner Sun4i Ethernet MAC support" depends on DM_ETH From 4ce521977f79a883f9c47984ef675c4b2267b7ad Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Tue, 14 Nov 2017 20:50:04 +0100 Subject: [PATCH 07/15] part: efi: Add a Kconfig option for the number of partition entries On some SoCs, the SPL needs to be located right in the middle of the GPT partition entries. One way to work around that is to create partition entries for a smaller number of partitions to accomodate with where the SPL will be. Create a Kconfig option to allow to do that. Reviewed-by: Andre Przywara Reviewed-by: Tom Rini Signed-off-by: Maxime Ripard --- disk/Kconfig | 13 +++++++++++++ include/part_efi.h | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/disk/Kconfig b/disk/Kconfig index 9396562120..f82beef6e6 100644 --- a/disk/Kconfig +++ b/disk/Kconfig @@ -78,6 +78,19 @@ config EFI_PARTITION common when EFI is the bootloader. Note 2TB partition limit; see disk/part_efi.c +config EFI_PARTITION_ENTRIES_NUMBERS + int "Number of the EFI partition entries" + depends on EFI_PARTITION + default 128 + help + Specify the number of partition entries in the GPT. This is + meant to allow less than the standard specifies for devices + that might need to place their first-stage bootloader in the + middle of a regular GPT. + + If unsure, leave at 128 entries, which is the standard + number. + config EFI_PARTITION_ENTRIES_OFF int "Offset (in bytes) of the EFI partition entries" depends on EFI_PARTITION diff --git a/include/part_efi.h b/include/part_efi.h index 31e6bc6e14..4c8f6cc473 100644 --- a/include/part_efi.h +++ b/include/part_efi.h @@ -27,7 +27,7 @@ #define GPT_HEADER_SIGNATURE 0x5452415020494645ULL #define GPT_HEADER_REVISION_V1 0x00010000 #define GPT_PRIMARY_PARTITION_TABLE_LBA 1ULL -#define GPT_ENTRY_NUMBERS 128 +#define GPT_ENTRY_NUMBERS CONFIG_EFI_PARTITION_ENTRIES_NUMBERS #define GPT_ENTRY_SIZE 128 #define PARTITION_SYSTEM_GUID \ From 5dc0256d1210cb38ba11b22a8eb2ccc101460963 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Tue, 14 Nov 2017 21:07:51 +0100 Subject: [PATCH 08/15] part: efi: Add default number of partition entries for sunxi The SPL must be located at 8kB (16 sectors) offset. That's right in the middle of the GPT, so we need to define a smaller amount of partitions to accomodate for that location. Reviewed-by: Andre Przywara Signed-off-by: Maxime Ripard --- disk/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/disk/Kconfig b/disk/Kconfig index f82beef6e6..0446bb63ca 100644 --- a/disk/Kconfig +++ b/disk/Kconfig @@ -81,6 +81,7 @@ config EFI_PARTITION config EFI_PARTITION_ENTRIES_NUMBERS int "Number of the EFI partition entries" depends on EFI_PARTITION + default 56 if ARCH_SUNXI default 128 help Specify the number of partition entries in the GPT. This is From c53654fcda9db51518266cc5feb81f5fb3d71d52 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Tue, 14 Nov 2017 21:24:00 +0100 Subject: [PATCH 09/15] sunxi: Add default partition scheme The partitions variable is especially useful to create a partition table from U-Boot, either directly from the U-Boot shell, or through flashing tools like fastboot and its oem format command. This is especially useful on devices with an eMMC you can't take out to flash from another system, and booting a Linux system first to flash our system then is not really practical. Reviewed-by: Andre Przywara Signed-off-by: Maxime Ripard --- include/configs/sunxi-common.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h index 4391a8cbc8..786155f1e1 100644 --- a/include/configs/sunxi-common.h +++ b/include/configs/sunxi-common.h @@ -493,6 +493,20 @@ extern int soft_i2c_gpio_scl; #define SUNXI_MTDPARTS_DEFAULT #endif +#define PARTS_DEFAULT \ + "name=loader1,start=8k,size=32k,uuid=${uuid_gpt_loader1};" \ + "name=loader2,size=984k,uuid=${uuid_gpt_loader2};" \ + "name=esp,size=128M,bootable,uuid=${uuid_gpt_esp};" \ + "name=system,size=-,uuid=${uuid_gpt_system};" + +#define UUID_GPT_ESP "c12a7328-f81f-11d2-ba4b-00a0c93ec93b" + +#ifdef CONFIG_ARM64 +#define UUID_GPT_SYSTEM "b921b045-1df0-41c3-af44-4c6f280d3fae" +#else +#define UUID_GPT_SYSTEM "69dad710-2ce4-4e3c-b16c-21a1d49abed3" +#endif + #define CONSOLE_ENV_SETTINGS \ CONSOLE_STDIN_SETTINGS \ CONSOLE_STDOUT_SETTINGS @@ -511,6 +525,9 @@ extern int soft_i2c_gpio_scl; "console=ttyS0,115200\0" \ SUNXI_MTDIDS_DEFAULT \ SUNXI_MTDPARTS_DEFAULT \ + "uuid_gpt_esp=" UUID_GPT_ESP "\0" \ + "uuid_gpt_system=" UUID_GPT_SYSTEM "\0" \ + "partitions=" PARTS_DEFAULT "\0" \ BOOTCMD_SUNXI_COMPAT \ BOOTENV From 7c750fac22fa46546c25b3a3d2ca0598fba2f10e Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Tue, 14 Nov 2017 21:37:35 +0100 Subject: [PATCH 10/15] fastboot: Enable flashing by default on sunxi Now that more and more devices are built using eMMC, providing a way to easily flash the system without too much hassle seems like a right thing to do. Since fastboot is the most deployed tool to do that these days, we can just rely on it to provide a way to flash the various components in the system (SPL, U-Boot and the system itself) easily, especially since you can upload the U-Boot hosting the fastboot "server" through FEL. Reviewed-by: Andre Przywara Signed-off-by: Maxime Ripard --- cmd/fastboot/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/fastboot/Kconfig b/cmd/fastboot/Kconfig index 4ce7a775e2..cbb9183ea2 100644 --- a/cmd/fastboot/Kconfig +++ b/cmd/fastboot/Kconfig @@ -66,6 +66,7 @@ config FASTBOOT_USB_DEV config FASTBOOT_FLASH bool "Enable FASTBOOT FLASH command" + default y if ARCH_SUNXI help The fastboot protocol includes a "flash" command for writing the downloaded image to a non-volatile storage device. Define From 6af1a2eeee8b4eb50ea5f66c512c945927539975 Mon Sep 17 00:00:00 2001 From: Chen-Yu Tsai Date: Tue, 5 Dec 2017 14:00:07 +0800 Subject: [PATCH 11/15] sunxi: Fix UART console index for A33-OLinuXino The A33-OLinuXino defconfig was using the default CONS_INDEX value for A33, which actually points to the R_UART, which is routed to the GPIO header without proper pull-ups or diodes. The board has a separate header for UART0, which are routed to pins PB0 and PB1. This header is properly marked and is likely the first pins any user would try to get a console. Fix CONS_INDEX in the defconfig so the console appears on UART0. Fixes: ca5c37026be4 ("sunxi: Add support for A33-OLinuXino board") Signed-off-by: Chen-Yu Tsai Acked-by: Maxime Ripard Reviewed-by: Jagan Teki --- configs/A33-OLinuXino_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/A33-OLinuXino_defconfig b/configs/A33-OLinuXino_defconfig index c11991de7e..894bb19cf0 100644 --- a/configs/A33-OLinuXino_defconfig +++ b/configs/A33-OLinuXino_defconfig @@ -1,5 +1,6 @@ CONFIG_ARM=y CONFIG_ARCH_SUNXI=y +CONFIG_CONS_INDEX=1 CONFIG_MACH_SUN8I_A33=y CONFIG_DRAM_CLK=432 CONFIG_DRAM_ZQ=15291 From 03eb76b9a6777a8a935e1d20eff4698afa500d15 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 7 Dec 2017 17:20:08 +0100 Subject: [PATCH 12/15] sunxi: Add the TBS A711 tablet The TBS Tablet sports an LVDS display, an eMMC, an external SD, USB devices and USB OTG. Reviewed-by: Jagan Teki Signed-off-by: Maxime Ripard --- arch/arm/dts/Makefile | 3 +- arch/arm/dts/sun8i-a83t-tbs-a711.dts | 76 ++++++++++++++++++++++++++++ configs/tbs_a711_defconfig | 23 +++++++++ 3 files changed, 101 insertions(+), 1 deletion(-) create mode 100644 arch/arm/dts/sun8i-a83t-tbs-a711.dts create mode 100644 configs/tbs_a711_defconfig diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index f54adb2184..f82d136951 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -316,7 +316,8 @@ dtb-$(CONFIG_MACH_SUN8I_A33) += \ dtb-$(CONFIG_MACH_SUN8I_A83T) += \ sun8i-a83t-allwinner-h8homlet-v2.dtb \ sun8i-a83t-bananapi-m3.dtb \ - sun8i-a83t-cubietruck-plus.dtb + sun8i-a83t-cubietruck-plus.dtb \ + sun8i-a83t-tbs-a711.dts dtb-$(CONFIG_MACH_SUN8I_H3) += \ sun8i-h2-plus-orangepi-zero.dtb \ sun8i-h3-bananapi-m2-plus.dtb \ diff --git a/arch/arm/dts/sun8i-a83t-tbs-a711.dts b/arch/arm/dts/sun8i-a83t-tbs-a711.dts new file mode 100644 index 0000000000..80e8b1cc90 --- /dev/null +++ b/arch/arm/dts/sun8i-a83t-tbs-a711.dts @@ -0,0 +1,76 @@ +/* + * Copyright 2017 Ondřej Jirman + * Ondřej Jirman + * + * 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 "sun8i-a83t.dtsi" + +/ { + model = "TBS A711 Tablet"; + compatible = "tbs-biometrics,a711", "allwinner,sun8i-a83t"; + + aliases { + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; +}; + +&ehci0 { + status = "okay"; +}; + +&ohci0 { + status = "okay"; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins_b>; + status = "okay"; +}; + +&usb_otg { + status = "okay"; +}; diff --git a/configs/tbs_a711_defconfig b/configs/tbs_a711_defconfig new file mode 100644 index 0000000000..03deae084e --- /dev/null +++ b/configs/tbs_a711_defconfig @@ -0,0 +1,23 @@ +CONFIG_ARM=y +CONFIG_ARCH_SUNXI=y +CONFIG_MACH_SUN8I_A83T=y +CONFIG_DRAM_TYPE=7 +CONFIG_DRAM_CLK=648 +CONFIG_DRAM_ZQ=15355 +CONFIG_DRAM_ODT_EN=y +CONFIG_MMC_SUNXI_SLOT_EXTRA=2 +CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE" +CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT" +CONFIG_USB0_ID_DET="PH11" +CONFIG_AXP_GPIO=y +CONFIG_DEFAULT_DEVICE_TREE="sun8i-a83t-tbs-a711" +# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set +CONFIG_SPL=y +# CONFIG_CMD_FLASH is not set +# CONFIG_CMD_FPGA is not set +# CONFIG_SPL_DOS_PARTITION is not set +# CONFIG_SPL_ISO_PARTITION is not set +# CONFIG_SPL_EFI_PARTITION is not set +CONFIG_AXP_DCDC5_VOLT=1200 +CONFIG_USB_EHCI_HCD=y +CONFIG_USB_MUSB_GADGET=y From e628f008285289fbd377455bf9ab9ea6f2e16a2d Mon Sep 17 00:00:00 2001 From: Jagan Teki Date: Fri, 10 Nov 2017 22:21:09 +0530 Subject: [PATCH 13/15] sunxi: arm64: Increase CONFIG_SYS_BOOTM_LEN to 32MB The default value of CONFIG_SYS_BOOTM_LEN, 0x800000, causes error when uncompressing Image.gz out of FIT image. Uncompressing Kernel Image ... Error: inflate() returned -5 Image too large: increase CONFIG_SYS_BOOTM_LEN and loading Image out of FIT image. Loading Kernel Image ... Image too large: increase CONFIG_SYS_BOOTM_LEN Must RESET board to recover Signed-off-by: Jagan Teki Acked-by: Maxime Ripard --- include/configs/sunxi-common.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h index 786155f1e1..ee1cb3962c 100644 --- a/include/configs/sunxi-common.h +++ b/include/configs/sunxi-common.h @@ -34,6 +34,7 @@ #ifdef CONFIG_ARM64 #define CONFIG_BUILD_TARGET "u-boot.itb" +#define CONFIG_SYS_BOOTM_LEN (32 << 20) #endif /* Serial & console */ From 207f48345fa95afb16c52242af6ace70bf1c6bc9 Mon Sep 17 00:00:00 2001 From: Jagan Teki Date: Fri, 8 Dec 2017 17:03:17 +0530 Subject: [PATCH 14/15] configs: sunxi: Drop FASTBOOT_FLASH Now FASTBOOT_FLASH is auto select for sunxi platform, so drop explicit addition. Signed-off-by: Jagan Teki Acked-by: Maxime Ripard --- configs/A13-OLinuXino_defconfig | 1 - configs/A20-OLinuXino-Lime2-eMMC_defconfig | 1 - configs/A20-OLinuXino-Lime2_defconfig | 1 - configs/CHIP_defconfig | 1 - configs/CHIP_pro_defconfig | 1 - configs/Cubietruck_defconfig | 1 - configs/Nintendo_NES_Classic_Edition_defconfig | 1 - configs/Sinlinx_SinA33_defconfig | 1 - configs/parrot_r16_defconfig | 1 - 9 files changed, 9 deletions(-) diff --git a/configs/A13-OLinuXino_defconfig b/configs/A13-OLinuXino_defconfig index 3c2a6f8286..4e6569822b 100644 --- a/configs/A13-OLinuXino_defconfig +++ b/configs/A13-OLinuXino_defconfig @@ -16,7 +16,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun5i-a13-olinuxino" # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set CONFIG_SPL=y CONFIG_SPL_I2C_SUPPORT=y -CONFIG_FASTBOOT_FLASH=y CONFIG_CMD_DFU=y # CONFIG_CMD_FLASH is not set # CONFIG_CMD_FPGA is not set diff --git a/configs/A20-OLinuXino-Lime2-eMMC_defconfig b/configs/A20-OLinuXino-Lime2-eMMC_defconfig index cd1fa64ecb..2f2b5d1d4b 100644 --- a/configs/A20-OLinuXino-Lime2-eMMC_defconfig +++ b/configs/A20-OLinuXino-Lime2-eMMC_defconfig @@ -13,7 +13,6 @@ CONFIG_AHCI=y # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set CONFIG_SPL=y CONFIG_SPL_I2C_SUPPORT=y -CONFIG_FASTBOOT_FLASH=y CONFIG_CMD_DFU=y # CONFIG_CMD_FLASH is not set # CONFIG_CMD_FPGA is not set diff --git a/configs/A20-OLinuXino-Lime2_defconfig b/configs/A20-OLinuXino-Lime2_defconfig index 4a90ab695a..9492caecb6 100644 --- a/configs/A20-OLinuXino-Lime2_defconfig +++ b/configs/A20-OLinuXino-Lime2_defconfig @@ -12,7 +12,6 @@ CONFIG_AHCI=y # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set CONFIG_SPL=y CONFIG_SPL_I2C_SUPPORT=y -CONFIG_FASTBOOT_FLASH=y CONFIG_CMD_DFU=y # CONFIG_CMD_FLASH is not set # CONFIG_CMD_FPGA is not set diff --git a/configs/CHIP_defconfig b/configs/CHIP_defconfig index d057bee172..062ac76e6d 100644 --- a/configs/CHIP_defconfig +++ b/configs/CHIP_defconfig @@ -7,7 +7,6 @@ CONFIG_VIDEO_COMPOSITE=y CONFIG_DEFAULT_DEVICE_TREE="sun5i-r8-chip" CONFIG_SPL=y CONFIG_SPL_I2C_SUPPORT=y -CONFIG_FASTBOOT_FLASH=y CONFIG_CMD_DFU=y CONFIG_CMD_USB_MASS_STORAGE=y # CONFIG_SPL_DOS_PARTITION is not set diff --git a/configs/CHIP_pro_defconfig b/configs/CHIP_pro_defconfig index fa572eac57..f47aead6f9 100644 --- a/configs/CHIP_pro_defconfig +++ b/configs/CHIP_pro_defconfig @@ -8,7 +8,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun5i-gr8-chip-pro" CONFIG_SYS_EXTRA_OPTIONS="SYS_NAND_BLOCK_SIZE=0x40000,SYS_NAND_PAGE_SIZE=4096,SYS_NAND_OOBSIZE=256" CONFIG_SPL=y CONFIG_SPL_I2C_SUPPORT=y -CONFIG_FASTBOOT_FLASH=y # CONFIG_CMD_FLASH is not set # CONFIG_CMD_FPGA is not set # CONFIG_CMD_LOADB is not set diff --git a/configs/Cubietruck_defconfig b/configs/Cubietruck_defconfig index f9f73fdb23..f648f13e8d 100644 --- a/configs/Cubietruck_defconfig +++ b/configs/Cubietruck_defconfig @@ -14,7 +14,6 @@ CONFIG_AHCI=y # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set CONFIG_SPL=y CONFIG_SPL_I2C_SUPPORT=y -CONFIG_FASTBOOT_FLASH=y CONFIG_CMD_DFU=y # CONFIG_CMD_FLASH is not set # CONFIG_CMD_FPGA is not set diff --git a/configs/Nintendo_NES_Classic_Edition_defconfig b/configs/Nintendo_NES_Classic_Edition_defconfig index 78aa0c732d..b9e553e0a5 100644 --- a/configs/Nintendo_NES_Classic_Edition_defconfig +++ b/configs/Nintendo_NES_Classic_Edition_defconfig @@ -9,7 +9,6 @@ CONFIG_AXP_GPIO=y CONFIG_DEFAULT_DEVICE_TREE="sun8i-r16-nintendo-nes-classic-edition" # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set CONFIG_SPL=y -CONFIG_FASTBOOT_FLASH=y # CONFIG_CMD_FLASH is not set # CONFIG_CMD_FPGA is not set # CONFIG_SPL_DOS_PARTITION is not set diff --git a/configs/Sinlinx_SinA33_defconfig b/configs/Sinlinx_SinA33_defconfig index 7818e3cf79..9e2d9e2163 100644 --- a/configs/Sinlinx_SinA33_defconfig +++ b/configs/Sinlinx_SinA33_defconfig @@ -14,7 +14,6 @@ CONFIG_VIDEO_LCD_BL_PWM="PH0" CONFIG_DEFAULT_DEVICE_TREE="sun8i-a33-sinlinx-sina33" # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set CONFIG_SPL=y -CONFIG_FASTBOOT_FLASH=y CONFIG_CMD_DFU=y # CONFIG_CMD_FLASH is not set # CONFIG_CMD_FPGA is not set diff --git a/configs/parrot_r16_defconfig b/configs/parrot_r16_defconfig index c7dc889a16..c3e61784ac 100644 --- a/configs/parrot_r16_defconfig +++ b/configs/parrot_r16_defconfig @@ -12,7 +12,6 @@ CONFIG_AXP_GPIO=y CONFIG_DEFAULT_DEVICE_TREE="sun8i-r16-parrot" # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set CONFIG_SPL=y -CONFIG_FASTBOOT_FLASH=y # CONFIG_CMD_FLASH is not set # CONFIG_CMD_FPGA is not set # CONFIG_SPL_DOS_PARTITION is not set From 23cd00ab2d8c39eaa15257efcba441939ea66fa8 Mon Sep 17 00:00:00 2001 From: Jagan Teki Date: Wed, 29 Nov 2017 13:14:23 +0530 Subject: [PATCH 15/15] arm64: dts: sun50i: h5: Order nodes in alphabetic for orangepi-prime Order sun50i-h5-orangepi-prime.dts nodes in alphabetic Signed-off-by: Jagan Teki Acked-by: Maxime Ripard --- arch/arm/dts/sun50i-h5-orangepi-prime.dts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/arm/dts/sun50i-h5-orangepi-prime.dts b/arch/arm/dts/sun50i-h5-orangepi-prime.dts index 67eade7deb..d4577dfae1 100644 --- a/arch/arm/dts/sun50i-h5-orangepi-prime.dts +++ b/arch/arm/dts/sun50i-h5-orangepi-prime.dts @@ -72,6 +72,10 @@ }; }; +&ehci1 { + status = "okay"; +}; + &mmc0 { compatible = "allwinner,sun50i-h5-mmc", "allwinner,sun50i-a64-mmc", @@ -85,6 +89,10 @@ status = "okay"; }; +&ohci1 { + status = "okay"; +}; + &uart0 { pinctrl-names = "default"; pinctrl-0 = <&uart0_pins_a>; @@ -94,11 +102,3 @@ &usbphy { status = "okay"; }; - -&ohci1 { - status = "okay"; -}; - -&ehci1 { - status = "okay"; -};