diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2017-12-10 18:42:44 +0100 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2018-01-22 22:51:02 +0100 |
commit | ad2b3bf310f7642bd9b5f30c6c7c17a343749f46 (patch) | |
tree | 00ac533efa23cb6d047acc8f6171c683de3a1737 /target/linux/sunxi/patches-4.14 | |
parent | dda475ca307581132593d29ee2796efb645975c7 (diff) | |
download | upstream-ad2b3bf310f7642bd9b5f30c6c7c17a343749f46.tar.gz upstream-ad2b3bf310f7642bd9b5f30c6c7c17a343749f46.tar.bz2 upstream-ad2b3bf310f7642bd9b5f30c6c7c17a343749f46.zip |
sunxi: Add support for kernel 4.14
This is based on the code for kernel 4.9, but a lot of 4.9 patches are
backports from more recent kernel version and can be removed now.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Diffstat (limited to 'target/linux/sunxi/patches-4.14')
3 files changed, 314 insertions, 0 deletions
diff --git a/target/linux/sunxi/patches-4.14/115-musb-ignore-vbus-errors.patch b/target/linux/sunxi/patches-4.14/115-musb-ignore-vbus-errors.patch new file mode 100644 index 0000000000..ea9187e375 --- /dev/null +++ b/target/linux/sunxi/patches-4.14/115-musb-ignore-vbus-errors.patch @@ -0,0 +1,26 @@ +From fce20ac5d8c98f1a8ea5298051d9fa669e455f04 Mon Sep 17 00:00:00 2001 +From: Hans de Goede <hdegoede@redhat.com> +Date: Tue, 4 Aug 2015 23:22:45 +0200 +Subject: [PATCH] musb: sunxi: Ignore VBus errors in host-only mode + +For some unclear reason sometimes we get VBus errors in host-only mode, +even though we do not have any vbus-detection then. Ignore these. + +Signed-off-by: Hans de Goede <hdegoede@redhat.com> +--- + drivers/usb/musb/sunxi.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/usb/musb/sunxi.c ++++ b/drivers/usb/musb/sunxi.c +@@ -192,6 +192,10 @@ static irqreturn_t sunxi_musb_interrupt( + musb_writeb(musb->mregs, MUSB_FADDR, 0); + } + ++ /* Ignore Vbus errors when in host only mode */ ++ if (musb->port_mode == MUSB_PORT_MODE_HOST) ++ musb->int_usb &= ~MUSB_INTR_VBUSERROR; ++ + musb->int_tx = readw(musb->mregs + SUNXI_MUSB_INTRTX); + if (musb->int_tx) + writew(musb->int_tx, musb->mregs + SUNXI_MUSB_INTRTX); diff --git a/target/linux/sunxi/patches-4.14/131-reset-add-h3-resets.patch b/target/linux/sunxi/patches-4.14/131-reset-add-h3-resets.patch new file mode 100644 index 0000000000..8e8fdafca5 --- /dev/null +++ b/target/linux/sunxi/patches-4.14/131-reset-add-h3-resets.patch @@ -0,0 +1,92 @@ +From 5f0bb9d0bc545ef53a83f7bd176fdc0736eed8e5 Mon Sep 17 00:00:00 2001 +From: Jens Kuske <jenskuske@gmail.com> +Date: Tue, 27 Oct 2015 17:50:24 +0100 +Subject: [PATCH] reset: sunxi: Add Allwinner H3 bus resets + +The H3 bus resets have some holes between the registers, so we add +an of_xlate() function to skip them according to the datasheet. + +Signed-off-by: Jens Kuske <jenskuske@gmail.com> +--- + .../bindings/reset/allwinner,sunxi-clock-reset.txt | 1 + + drivers/reset/reset-sunxi.c | 30 +++++++++++++++++++--- + 2 files changed, 28 insertions(+), 3 deletions(-) + +--- a/Documentation/devicetree/bindings/reset/allwinner,sunxi-clock-reset.txt ++++ b/Documentation/devicetree/bindings/reset/allwinner,sunxi-clock-reset.txt +@@ -8,6 +8,7 @@ Required properties: + - compatible: Should be one of the following: + "allwinner,sun6i-a31-ahb1-reset" + "allwinner,sun6i-a31-clock-reset" ++ "allwinner,sun8i-h3-bus-reset" + - reg: should be register base and length as documented in the + datasheet + - #reset-cells: 1, see below +--- a/drivers/reset/reset-sunxi.c ++++ b/drivers/reset/reset-sunxi.c +@@ -77,7 +77,9 @@ static const struct reset_control_ops su + .deassert = sunxi_reset_deassert, + }; + +-static int sunxi_reset_init(struct device_node *np) ++static int sunxi_reset_init(struct device_node *np, ++ int (*of_xlate)(struct reset_controller_dev *rcdev, ++ const struct of_phandle_args *reset_spec)) + { + struct sunxi_reset_data *data; + struct resource res; +@@ -110,6 +112,7 @@ static int sunxi_reset_init(struct devic + data->rcdev.nr_resets = size * 8; + data->rcdev.ops = &sunxi_reset_ops; + data->rcdev.of_node = np; ++ data->rcdev.of_xlate = of_xlate; + + return reset_controller_register(&data->rcdev); + +@@ -118,6 +121,21 @@ err_alloc: + return ret; + }; + ++static int sun8i_h3_bus_reset_xlate(struct reset_controller_dev *rcdev, ++ const struct of_phandle_args *reset_spec) ++{ ++ unsigned int index = reset_spec->args[0]; ++ ++ if (index < 96) ++ return index; ++ else if (index < 128) ++ return index + 32; ++ else if (index < 160) ++ return index + 64; ++ else ++ return -EINVAL; ++} ++ + /* + * These are the reset controller we need to initialize early on in + * our system, before we can even think of using a regular device +@@ -125,15 +143,21 @@ err_alloc: + */ + static const struct of_device_id sunxi_early_reset_dt_ids[] __initconst = { + { .compatible = "allwinner,sun6i-a31-ahb1-reset", }, ++ { .compatible = "allwinner,sun8i-h3-bus-reset", .data = sun8i_h3_bus_reset_xlate, }, + { /* sentinel */ }, + }; + + void __init sun6i_reset_init(void) + { + struct device_node *np; +- +- for_each_matching_node(np, sunxi_early_reset_dt_ids) +- sunxi_reset_init(np); ++ const struct of_device_id *match; ++ int (*of_xlate)(struct reset_controller_dev *rcdev, ++ const struct of_phandle_args *reset_spec); ++ ++ for_each_matching_node_and_match(np, sunxi_early_reset_dt_ids, &match) { ++ of_xlate = match->data; ++ sunxi_reset_init(np, of_xlate); ++ } + } + + /* diff --git a/target/linux/sunxi/patches-4.14/200-ARM-dts-sunxi-add-support-for-Orange-Pi-R1-board.patch b/target/linux/sunxi/patches-4.14/200-ARM-dts-sunxi-add-support-for-Orange-Pi-R1-board.patch new file mode 100644 index 0000000000..8506d07344 --- /dev/null +++ b/target/linux/sunxi/patches-4.14/200-ARM-dts-sunxi-add-support-for-Orange-Pi-R1-board.patch @@ -0,0 +1,196 @@ +From daf75255fb67bf44db178e4c95a803b7972ed670 Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens <hauke@hauke-m.de> +Date: Tue, 26 Sep 2017 22:29:06 +0200 +Subject: ARM: dts: sunxi: add support for Orange Pi R1 board + +Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> +--- + arch/arm/boot/dts/Makefile | 1 + + arch/arm/boot/dts/sun8i-h2-plus-orangepi-r1.dts | 171 ++++++++++++++++++++++++ + 2 files changed, 172 insertions(+) + create mode 100644 arch/arm/boot/dts/sun8i-h2-plus-orangepi-r1.dts + +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -917,6 +917,7 @@ dtb-$(CONFIG_MACH_SUN8I) += \ + sun8i-a83t-bananapi-m3.dtb \ + sun8i-a83t-cubietruck-plus.dtb \ + sun8i-h2-plus-orangepi-zero.dtb \ ++ sun8i-h2-plus-orangepi-r1.dtb \ + sun8i-h3-bananapi-m2-plus.dtb \ + sun8i-h3-beelink-x2.dtb \ + sun8i-h3-nanopi-m1.dtb \ +--- /dev/null ++++ b/arch/arm/boot/dts/sun8i-h2-plus-orangepi-r1.dts +@@ -0,0 +1,171 @@ ++/* ++ * Copyright (C) 2017 Hauke Mehrtens <hauke@hauke-m.de> ++ * ++ * Based on sun8i-h2-plus-orangepi-zero.dts, which is: ++ * Copyright (C) 2016 Icenowy Zheng <icenowy@aosc.xyz> ++ * ++ * Based on sun8i-h3-orangepi-one.dts, which is: ++ * Copyright (C) 2016 Hans de Goede <hdegoede@redhat.com> ++ * ++ * 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-h3.dtsi" ++#include "sunxi-common-regulators.dtsi" ++ ++#include <dt-bindings/gpio/gpio.h> ++#include <dt-bindings/input/input.h> ++#include <dt-bindings/pinctrl/sun4i-a10.h> ++ ++/ { ++ model = "Xunlong Orange Pi R1"; ++ compatible = "xunlong,orangepi-r1", "allwinner,sun8i-h2-plus"; ++ ++ aliases { ++ serial0 = &uart0; ++ /* ethernet0 is the H3 emac, defined in sun8i-h3.dtsi */ ++ ethernet0 = &emac; ++ ethernet1 = &xr819; ++ }; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ pwr_led { ++ label = "orangepi:green:pwr"; ++ gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; ++ default-state = "on"; ++ }; ++ ++ status_led { ++ label = "orangepi:red:status"; ++ gpios = <&pio 0 17 GPIO_ACTIVE_HIGH>; ++ }; ++ }; ++ ++ reg_vcc_wifi: reg_vcc_wifi { ++ compatible = "regulator-fixed"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-name = "vcc-wifi"; ++ enable-active-high; ++ gpio = <&pio 0 20 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ wifi_pwrseq: wifi_pwrseq { ++ compatible = "mmc-pwrseq-simple"; ++ reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; ++ post-power-on-delay-ms = <200>; ++ }; ++}; ++ ++&ehci1 { ++ status = "okay"; ++}; ++ ++&emac { ++ phy-handle = <&int_mii_phy>; ++ phy-mode = "mii"; ++ allwinner,leds-active-low; ++ status = "okay"; ++}; ++ ++&mmc0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&mmc0_pins_a>; ++ vmmc-supply = <®_vcc3v3>; ++ bus-width = <4>; ++ cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */ ++ cd-inverted; ++ status = "okay"; ++}; ++ ++&mmc1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&mmc1_pins_a>; ++ vmmc-supply = <®_vcc_wifi>; ++ mmc-pwrseq = <&wifi_pwrseq>; ++ bus-width = <4>; ++ non-removable; ++ status = "okay"; ++ ++ /* ++ * Explicitly define the sdio device, so that we can add an ethernet ++ * alias for it (which e.g. makes u-boot set a mac-address). ++ */ ++ xr819: sdio_wifi@1 { ++ reg = <1>; ++ }; ++}; ++ ++&mmc1_pins_a { ++ bias-pull-up; ++}; ++ ++&ohci1 { ++ status = "okay"; ++}; ++ ++&uart0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart0_pins_a>; ++ status = "okay"; ++}; ++ ++&uart1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart1_pins>; ++ status = "disabled"; ++}; ++ ++&uart2 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart2_pins>; ++ status = "disabled"; ++}; ++ ++&usbphy { ++ /* USB VBUS is always on */ ++ status = "okay"; ++}; |