Add a work around for ggc6 issue on some ARMv7 devices, Add fixes for AllWinner USB and some fixes for OrangePi devices

This commit is contained in:
Peter Robinson 2016-03-21 16:40:04 +00:00
parent 9d6210f3f1
commit 91063892f1
7 changed files with 324 additions and 4 deletions

View File

@ -0,0 +1,37 @@
From patchwork Mon Mar 21 16:08:34 2016
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot] ARMv7: Build cache_v7.c with -O1 to avoid gcc6 breakage
From: Hans de Goede <hdegoede@redhat.com>
X-Patchwork-Id: 600177
Message-Id: <1458576514-9470-2-git-send-email-hdegoede@redhat.com>
To: u-boot@lists.denx.de
Date: Mon, 21 Mar 2016 17:08:34 +0100
It seems that building cache_v7.c with gcc6 with -O2 or -Os results in
an unreliable u-boot (only boots the kernel some of the time), at least
on sunxi boards. For details see:
https://bugzilla.redhat.com/show_bug.cgi?id=1318788
This commit adds -O1 at the end of the CFLAGS when building
cache_v7.c working around this.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
arch/arm/cpu/armv7/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/cpu/armv7/Makefile b/arch/arm/cpu/armv7/Makefile
index 45f346c..45a49fe 100644
--- a/arch/arm/cpu/armv7/Makefile
+++ b/arch/arm/cpu/armv7/Makefile
@@ -8,6 +8,7 @@
extra-y := start.o
obj-y += cache_v7.o
+CFLAGS_cache_v7.o := $(KBUILD_CFLAGS) -O1
obj-y += cpu.o cp15.o
obj-y += syslib.o

View File

@ -0,0 +1,62 @@
From patchwork Fri Mar 18 07:55:06 2016
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot,
3/3] sunxi: Add a bunch of missing compatible strings to sunxi_gpio.c
From: Hans de Goede <hdegoede@redhat.com>
X-Patchwork-Id: 599343
Message-Id: <1458287706-6656-3-git-send-email-hdegoede@redhat.com>
To: Ian Campbell <ijc+uboot@hellion.org.uk>
Cc: u-boot@lists.denx.de
Date: Fri, 18 Mar 2016 08:55:06 +0100
The kernel has different compatible strings for the pio block
because the pin-muxing is different on all the different SoCs,
but sunxi_gpio.c only support the basic gpio functionality, which
is identical everywhere. Add the missing compatible strings for
various SoC models.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
drivers/gpio/sunxi_gpio.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/drivers/gpio/sunxi_gpio.c b/drivers/gpio/sunxi_gpio.c
index 9d8f11e..a7cec18 100644
--- a/drivers/gpio/sunxi_gpio.c
+++ b/drivers/gpio/sunxi_gpio.c
@@ -277,9 +277,17 @@ static int gpio_sunxi_bind(struct udevice *parent)
start = 'L' - 'A';
no_banks = 2; /* L & M */
} else if (fdt_node_check_compatible(gd->fdt_blob, parent->of_offset,
- "allwinner,sun8i-a23-r-pinctrl") == 0) {
+ "allwinner,sun8i-a23-r-pinctrl") == 0 ||
+ fdt_node_check_compatible(gd->fdt_blob, parent->of_offset,
+ "allwinner,sun8i-a83t-r-pinctrl") == 0 ||
+ fdt_node_check_compatible(gd->fdt_blob, parent->of_offset,
+ "allwinner,sun8i-h3-r-pinctrl") == 0) {
start = 'L' - 'A';
no_banks = 1; /* L only */
+ } else if (fdt_node_check_compatible(gd->fdt_blob, parent->of_offset,
+ "allwinner,sun9i-a80-r-pinctrl") == 0) {
+ start = 'L' - 'A';
+ no_banks = 3; /* L, M & N */
} else {
start = 0;
no_banks = SUNXI_GPIO_BANKS;
@@ -316,9 +324,14 @@ static const struct udevice_id sunxi_gpio_ids[] = {
{ .compatible = "allwinner,sun7i-a20-pinctrl" },
{ .compatible = "allwinner,sun8i-a23-pinctrl" },
{ .compatible = "allwinner,sun8i-a33-pinctrl" },
+ { .compatible = "allwinner,sun8i-a83t-pinctrl", },
+ { .compatible = "allwinner,sun8i-h3-pinctrl" },
{ .compatible = "allwinner,sun9i-a80-pinctrl" },
{ .compatible = "allwinner,sun6i-a31-r-pinctrl" },
{ .compatible = "allwinner,sun8i-a23-r-pinctrl" },
+ { .compatible = "allwinner,sun8i-a83t-r-pinctrl" },
+ { .compatible = "allwinner,sun8i-h3-r-pinctrl", },
+ { .compatible = "allwinner,sun9i-a80-r-pinctrl", },
{ }
};

View File

@ -0,0 +1,49 @@
From patchwork Fri Mar 18 07:55:04 2016
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot,1/3] sunxi: Add support for USB vbus pin for USB3
From: Hans de Goede <hdegoede@redhat.com>
X-Patchwork-Id: 599342
Message-Id: <1458287706-6656-1-git-send-email-hdegoede@redhat.com>
To: Ian Campbell <ijc+uboot@hellion.org.uk>
Cc: u-boot@lists.denx.de
Date: Fri, 18 Mar 2016 08:55:04 +0100
The H3 has USB0 - USB3, add support for having a USB vbus pin for USB3.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
arch/arm/cpu/armv7/sunxi/usb_phy.c | 1 +
board/sunxi/Kconfig | 6 ++++++
2 files changed, 7 insertions(+)
diff --git a/arch/arm/cpu/armv7/sunxi/usb_phy.c b/arch/arm/cpu/armv7/sunxi/usb_phy.c
index 6ac96cc..0749fbd 100644
--- a/arch/arm/cpu/armv7/sunxi/usb_phy.c
+++ b/arch/arm/cpu/armv7/sunxi/usb_phy.c
@@ -76,6 +76,7 @@ static int get_vbus_gpio(int index)
case 0: return sunxi_name_to_gpio(CONFIG_USB0_VBUS_PIN);
case 1: return sunxi_name_to_gpio(CONFIG_USB1_VBUS_PIN);
case 2: return sunxi_name_to_gpio(CONFIG_USB2_VBUS_PIN);
+ case 3: return sunxi_name_to_gpio(CONFIG_USB3_VBUS_PIN);
}
return -EINVAL;
}
diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
index 5e9d3af..5e72fac 100644
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -342,6 +342,12 @@ config USB2_VBUS_PIN
---help---
See USB1_VBUS_PIN help text.
+config USB3_VBUS_PIN
+ string "Vbus enable pin for usb3 (ehci2)"
+ default ""
+ ---help---
+ See USB1_VBUS_PIN help text.
+
config I2C0_ENABLE
bool "Enable I2C/TWI controller 0"
default y if MACH_SUN4I || MACH_SUN5I || MACH_SUN7I

View File

@ -0,0 +1,32 @@
From patchwork Sun Mar 20 13:21:13 2016
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot] sunxi: Enable support for the eMMC found on the orangepi plus
From: Hans de Goede <hdegoede@redhat.com>
X-Patchwork-Id: 599840
Message-Id: <1458480073-22121-1-git-send-email-hdegoede@redhat.com>
To: Ian Campbell <ijc+uboot@hellion.org.uk>
Cc: u-boot@lists.denx.de
Date: Sun, 20 Mar 2016 14:21:13 +0100
This enables support for the eMMC found on the orangepi plus.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
configs/orangepi_plus_defconfig | 2 ++
1 file changed, 2 insertions(+)
diff --git a/configs/orangepi_plus_defconfig b/configs/orangepi_plus_defconfig
index c4885f4..770bd98 100644
--- a/configs/orangepi_plus_defconfig
+++ b/configs/orangepi_plus_defconfig
@@ -4,6 +4,8 @@ CONFIG_MACH_SUN8I_H3=y
CONFIG_DRAM_CLK=672
CONFIG_DRAM_ZQ=3881979
CONFIG_DRAM_ODT_EN=y
+CONFIG_MMC0_CD_PIN="PF6"
+CONFIG_MMC_SUNXI_SLOT_EXTRA=2
# CONFIG_VIDEO is not set
CONFIG_DEFAULT_DEVICE_TREE="sun8i-h3-orangepi-plus"
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set

View File

@ -0,0 +1,88 @@
From patchwork Mon Mar 21 13:50:16 2016
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot] sunxi: Fix 2nd usb controller on sun4i/sun7i no longer
working
From: Hans de Goede <hdegoede@redhat.com>
X-Patchwork-Id: 600131
Message-Id: <1458568216-18179-1-git-send-email-hdegoede@redhat.com>
To: Ian Campbell <ijc+uboot@hellion.org.uk>
Cc: u-boot@lists.denx.de
Date: Mon, 21 Mar 2016 14:50:16 +0100
The 2nd usb controller on sun4i/sun7i has its base address 0x8000
bytes from the 1st one, rather then 0x1000. Also the ahb clk gates
are interleaved with the ohci clk-gates introducing a hole between
the clks for usb1 and usb2.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
drivers/usb/host/ehci-sunxi.c | 13 +++++++++++--
drivers/usb/host/ohci-sunxi.c | 15 ++++++++++++---
2 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/drivers/usb/host/ehci-sunxi.c b/drivers/usb/host/ehci-sunxi.c
index cf3dcc4..677a5d3 100644
--- a/drivers/usb/host/ehci-sunxi.c
+++ b/drivers/usb/host/ehci-sunxi.c
@@ -17,6 +17,14 @@
#include <dm.h>
#include "ehci.h"
+#ifdef CONFIG_SUNXI_GEN_SUN4I
+#define BASE_DIST 0x8000
+#define AHB_CLK_DIST 2
+#else
+#define BASE_DIST 0x1000
+#define AHB_CLK_DIST 1
+#endif
+
struct ehci_sunxi_priv {
struct ehci_ctrl ehci;
int ahb_gate_mask; /* Mask of ahb_gate0 clk gate bits for this hcd */
@@ -39,8 +47,9 @@ static int ehci_usb_probe(struct udevice *dev)
#ifdef CONFIG_MACH_SUN8I_H3
priv->ahb_gate_mask |= 1 << AHB_GATE_OFFSET_USB_OHCI0;
#endif
- priv->phy_index = ((u32)hccr - SUNXI_USB1_BASE) / 0x1000 + 1;
- priv->ahb_gate_mask <<= priv->phy_index - 1;
+ priv->phy_index = ((u32)hccr - SUNXI_USB1_BASE) / BASE_DIST;
+ priv->ahb_gate_mask <<= priv->phy_index * AHB_CLK_DIST;
+ priv->phy_index++; /* Non otg phys start at 1 */
setbits_le32(&ccm->ahb_gate0, priv->ahb_gate_mask);
#ifdef CONFIG_SUNXI_GEN_SUN6I
diff --git a/drivers/usb/host/ohci-sunxi.c b/drivers/usb/host/ohci-sunxi.c
index 1b1f651..d4fb95a 100644
--- a/drivers/usb/host/ohci-sunxi.c
+++ b/drivers/usb/host/ohci-sunxi.c
@@ -17,6 +17,14 @@
#include <usb.h>
#include "ohci.h"
+#ifdef CONFIG_SUNXI_GEN_SUN4I
+#define BASE_DIST 0x8000
+#define AHB_CLK_DIST 2
+#else
+#define BASE_DIST 0x1000
+#define AHB_CLK_DIST 1
+#endif
+
struct ohci_sunxi_priv {
ohci_t ohci;
int ahb_gate_mask; /* Mask of ahb_gate0 clk gate bits for this hcd */
@@ -42,9 +50,10 @@ static int ohci_usb_probe(struct udevice *dev)
priv->ahb_gate_mask |= 1 << AHB_GATE_OFFSET_USB_EHCI0;
#endif
priv->usb_gate_mask = CCM_USB_CTRL_OHCI0_CLK;
- priv->phy_index = ((u32)regs - (SUNXI_USB1_BASE + 0x400)) / 0x1000 + 1;
- priv->ahb_gate_mask <<= priv->phy_index - 1;
- priv->usb_gate_mask <<= priv->phy_index - 1;
+ priv->phy_index = ((u32)regs - (SUNXI_USB1_BASE + 0x400)) / BASE_DIST;
+ priv->ahb_gate_mask <<= priv->phy_index * AHB_CLK_DIST;
+ priv->usb_gate_mask <<= priv->phy_index;
+ priv->phy_index++; /* Non otg phys start at 1 */
setbits_le32(&ccm->ahb_gate0, priv->ahb_gate_mask);
setbits_le32(&ccm->usb_clk_cfg, priv->usb_gate_mask);

View File

@ -0,0 +1,42 @@
From patchwork Fri Mar 18 07:55:05 2016
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot,2/3] sunxi: Specify USB vbus pins for orangepi boards
From: Hans de Goede <hdegoede@redhat.com>
X-Patchwork-Id: 599344
Message-Id: <1458287706-6656-2-git-send-email-hdegoede@redhat.com>
To: Ian Campbell <ijc+uboot@hellion.org.uk>
Cc: u-boot@lists.denx.de
Date: Fri, 18 Mar 2016 08:55:05 +0100
This fixes the USB ports not working on the orangepi_plus and stops us
from messing with gpio-s which we should not touch on the orangepi_pc.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
configs/orangepi_pc_defconfig | 3 +++
configs/orangepi_plus_defconfig | 2 ++
2 files changed, 5 insertions(+)
diff --git a/configs/orangepi_pc_defconfig b/configs/orangepi_pc_defconfig
index aaf0f68..4e9051d 100644
--- a/configs/orangepi_pc_defconfig
+++ b/configs/orangepi_pc_defconfig
@@ -14,3 +14,6 @@ CONFIG_SPL=y
CONFIG_CMD_GPIO=y
CONFIG_SY8106A_POWER=y
CONFIG_USB_EHCI_HCD=y
+CONFIG_USB1_VBUS_PIN=""
+CONFIG_USB2_VBUS_PIN=""
+CONFIG_USB3_VBUS_PIN=""
diff --git a/configs/orangepi_plus_defconfig b/configs/orangepi_plus_defconfig
index e52dcfc..c4885f4 100644
--- a/configs/orangepi_plus_defconfig
+++ b/configs/orangepi_plus_defconfig
@@ -14,3 +14,5 @@ CONFIG_SPL=y
CONFIG_CMD_GPIO=y
CONFIG_SY8106A_POWER=y
CONFIG_USB_EHCI_HCD=y
+CONFIG_USB1_VBUS_PIN="PG13"
+CONFIG_USB3_VBUS_PIN="PG11"

View File

@ -2,7 +2,7 @@
Name: uboot-tools
Version: 2016.03
Release: 2%{?candidate:.%{candidate}}%{?dist}
Release: 3%{?candidate:.%{candidate}}%{?dist}
Summary: U-Boot utilities
Group: Development/Tools
@ -11,15 +11,21 @@ URL: http://www.denx.de/wiki/U-Boot
Source0: ftp://ftp.denx.de/pub/u-boot/u-boot-%{version}%{?candidate:-%{candidate}}.tar.bz2
Source1: armv7-boards
Patch1: 0004-Add-BOOTENV_INIT_COMMAND-for-commands-that-may-be-ne.patch
Patch2: 0005-port-utilite-to-distro-generic-boot-commands.patch
Patch3: 0001-Copy-gcc5-over-to-compiler-gcc6.h-as-a-beginning-of-.patch
Patch0: ARMv7-Build-cache_v7.c-with--O1-to-avoid-gcc6-breakage.patch
Patch1: 0001-Copy-gcc5-over-to-compiler-gcc6.h-as-a-beginning-of-.patch
Patch2: 0004-Add-BOOTENV_INIT_COMMAND-for-commands-that-may-be-ne.patch
Patch3: 0005-port-utilite-to-distro-generic-boot-commands.patch
Patch4: mvebu-enable-generic-distro-boot-config.patch
Patch5: 0001-WIP-RPi-3-32-bit-port.patch
Patch6: sunxi-chip-enable-composite-video-out.patch
Patch7: sunxi-fix-DCDC2-output-in-CHIP_defconfig.patch
Patch8: 0001-sunxi-A23-Fix-some-revisions-needing-a-different-mag.patch
Patch9: 0002-sunxi-Fix-gmac-not-working-due-to-cpu_eth_init-no-lo.patch
Patch10: sunxi-Fix-2nd-usb-controller-on-sun4i-sun7i-no-longer-working.patch
Patch11: sunxi-Enable-support-for-the-eMMC-found-on-the-orangepi-plus.patch
Patch12: sunxi-Add-support-for-USB-vbus-pin-for-USB3.patch
Patch13: sunxi-Specify-USB-vbus-pins-for-orangepi-boards.patch
Patch14: sunxi-Add-a-bunch-of-missing-compatible-strings-to-sunxi_gpio.c.patch
BuildRequires: bc
BuildRequires: dtc
@ -169,6 +175,10 @@ install -p -m 0644 tools/env/fw_env.config $RPM_BUILD_ROOT%{_sysconfdir}
%endif
%changelog
* Mon Mar 21 2016 Peter Robinson <pbrobinson@fedoraproject.org> 2016.03-3
- Add a work around for ggc6 issue on some ARMv7 devices
- Add fixes for AllWinner USB and some fixes for OrangePi devices
* Fri Mar 18 2016 Peter Robinson <pbrobinson@fedoraproject.org> 2016.03-2
- Add upstream patches to fix some issues on some AllWinner devices