From 28aed9ae063f912fdd2578b926361afc527e78b5 Mon Sep 17 00:00:00 2001 From: Igor Pecovnik Date: Tue, 19 Apr 2016 21:08:40 +0200 Subject: [PATCH] Banana PRO sata uboot fix for 2016.01 http://forum.armbian.com/index.php/topic/836-bananapro-wifi-armbian-5-kernel-tracebacks/ --- ...nilla_v4.5.1_sun7i-a20-bananapro_dts.patch | 242 +++++++++++++++++ .../u-boot-next/bananapi-enable-ldo4.patch | 9 - .../u-boot_v2016.01_Bananapro_defconfig.patch | 9 + ...oot_v2016.01_sun7i-a20-bananapro_dts.patch | 254 ++++++++++++++++++ 4 files changed, 505 insertions(+), 9 deletions(-) create mode 100644 patch/kernel/sunxi-next/linux-vanilla_v4.5.1_sun7i-a20-bananapro_dts.patch delete mode 100644 patch/u-boot/u-boot-next/bananapi-enable-ldo4.patch create mode 100644 patch/u-boot/u-boot-next/u-boot_v2016.01_Bananapro_defconfig.patch create mode 100644 patch/u-boot/u-boot-next/u-boot_v2016.01_sun7i-a20-bananapro_dts.patch diff --git a/patch/kernel/sunxi-next/linux-vanilla_v4.5.1_sun7i-a20-bananapro_dts.patch b/patch/kernel/sunxi-next/linux-vanilla_v4.5.1_sun7i-a20-bananapro_dts.patch new file mode 100644 index 0000000000..5325398bbe --- /dev/null +++ b/patch/kernel/sunxi-next/linux-vanilla_v4.5.1_sun7i-a20-bananapro_dts.patch @@ -0,0 +1,242 @@ +diff --git a/arch/arm/boot/dts/sun7i-a20-bananapro.dts b/arch/arm/boot/dts/sun7i-a20-bananapro.dts +index 18fcc87..dd8c9bb 100644 +--- a/arch/arm/boot/dts/sun7i-a20-bananapro.dts ++++ b/arch/arm/boot/dts/sun7i-a20-bananapro.dts +@@ -42,9 +42,11 @@ + + /dts-v1/; + #include "sun7i-a20.dtsi" +-#include "sunxi-common-regulators.dtsi" ++//#include "sunxi-common-regulators.dtsi" + #include + #include ++#include ++#include + + / { + model = "LeMaker Banana Pro"; +@@ -66,7 +68,7 @@ + pinctrl-0 = <&led_pins_bananapro>; + + blue { +- label = "bananapro:blue:usr"; ++ label = "bananapro:blue:usr"; + gpios = <&pio 6 2 GPIO_ACTIVE_HIGH>; + }; + +@@ -101,6 +103,52 @@ + enable-active-high; + gpio = <&pio 7 22 GPIO_ACTIVE_HIGH>; + }; ++ ++ reg_ahci_5v: ahci-5v { ++ compatible = "regulator-fixed"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&ahci_pwr_pin_a>; ++ regulator-name = "ahci-5v"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ regulator-boot-on; ++ enable-active-high; ++ gpio = <&pio 1 8 GPIO_ACTIVE_HIGH>; ++ status = "disabled"; ++ }; ++ ++ reg_usb0_vbus: usb0-vbus { ++ compatible = "regulator-fixed"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&usb0_vbus_pin_a>; ++ regulator-name = "usb0-vbus"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ enable-active-high; ++ gpio = <&pio 1 9 GPIO_ACTIVE_HIGH>; ++ status = "disabled"; ++ }; ++ ++ reg_vcc3v0: vcc3v0 { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc3v0"; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ }; ++ ++ reg_vcc3v3: vcc3v3 { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc3v3"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ }; ++ ++ reg_vcc5v0: vcc5v0 { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc5v0"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ }; + }; + + &ahci { +@@ -111,6 +159,20 @@ + status = "okay"; + }; + ++&cpu0 { ++ cpu-supply = <®_dcdc2>; ++ operating-points = < ++ /* kHz uV */ ++ 960000 1400000 ++ 912000 1400000 ++ 864000 1350000 ++ 720000 1250000 ++ 528000 1150000 ++ 312000 1100000 ++ 144000 1050000 ++ >; ++}; ++ + &ehci0 { + status = "okay"; + }; +@@ -180,17 +242,6 @@ + non-removable; + enable-sdio-wakeup; + status = "okay"; +- +-/* +- brcmf: bcrmf@1 { +- reg = <1>; +- compatible = "brcm,bcm4329-fmac"; +- interrupt-parent = <&pio>; +- interrupts = <15 8>; +- interrupt-names = "host-wake"; +- }; +-*/ +- + }; + + &ohci0 { +@@ -207,57 +258,90 @@ + + &pio { + gmac_power_pin_bananapro: gmac_power_pin@0 { +- allwinner,pins = "PH23"; ++ allwinner,pins = "PH23"; /* EMAC-PWR-EN */ + allwinner,function = "gpio_out"; + allwinner,drive = ; + allwinner,pull = ; + }; + + led_pins_bananapro: led_pins@0 { +- allwinner,pins = "PH24", "PG2"; ++ allwinner,pins = "PH24", "PG2"; /* LED1, LED2 */ + allwinner,function = "gpio_out"; + allwinner,drive = ; + allwinner,pull = ; + }; + + mmc0_cd_pin_bananapro: mmc0_cd_pin@0 { +- allwinner,pins = "PH10"; ++ allwinner,pins = "PH10"; /* SD0-DET */ + allwinner,function = "gpio_in"; + allwinner,drive = ; + allwinner,pull = ; + }; + +- usb1_vbus_pin_bananapro: usb1_vbus_pin@0 { +- allwinner,pins = "PH0"; ++ ahci_pwr_pin_a: ahci_pwr_pin@0 { ++ allwinner,pins = "PB8"; + allwinner,function = "gpio_out"; + allwinner,drive = ; + allwinner,pull = ; + }; + +- usb2_vbus_pin_bananapro: usb2_vbus_pin@0 { +- allwinner,pins = "PH1"; ++ usb0_vbus_pin_a: usb0_vbus_pin@0 { ++ allwinner,pins = "PB9"; + allwinner,function = "gpio_out"; + allwinner,drive = ; + allwinner,pull = ; + }; + ++ usb0_id_detect_pin: usb0_id_detect_pin@0 { ++ allwinner,pins = "PH3"; /* USB0-IDDET */ ++ allwinner,function = "gpio_in"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++ + vmmc3_pin_bananapro: vmmc3_pin@0 { +- allwinner,pins = "PH22"; ++ allwinner,pins = "PH22"; /* WIFI-SHDN */ + allwinner,function = "gpio_out"; + allwinner,drive = ; + allwinner,pull = ; + }; + }; + +-®_usb1_vbus { +- pinctrl-0 = <&usb1_vbus_pin_bananapro>; +- gpio = <&pio 7 0 GPIO_ACTIVE_HIGH>; /* PH0 */ +- status = "okay"; ++#include "axp209.dtsi" ++ ++®_dcdc2 { ++ regulator-always-on; ++ regulator-min-microvolt = <1000000>; ++ regulator-max-microvolt = <1400000>; ++ regulator-name = "vdd-cpu"; ++}; ++ ++®_dcdc3 { ++ regulator-always-on; ++ regulator-min-microvolt = <1000000>; ++ regulator-max-microvolt = <1400000>; ++ regulator-name = "vdd-int-dll"; ++}; ++ ++®_ldo1 { ++ regulator-name = "vdd-rtc"; ++}; ++ ++®_ldo2 { ++ regulator-always-on; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ regulator-name = "avcc"; ++}; ++ ++®_ldo4 { ++ regulator-always-on; ++ regulator-min-microvolt = <2500000>; ++ regulator-max-microvolt = <2500000>; ++ regulator-name = "vcc-sata"; + }; + +-®_usb2_vbus { +- pinctrl-0 = <&usb2_vbus_pin_bananapro>; +- gpio = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ ++®_usb0_vbus { + status = "okay"; + }; + +@@ -292,6 +376,15 @@ + status = "okay"; + }; + ++&usb_power_supply { ++ status = "okay"; ++}; ++ + &usbphy { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&usb0_id_detect_pin>; ++ usb0_id_det-gpio = <&pio 7 3 GPIO_ACTIVE_HIGH>; /* PH3 */ ++ usb0_vbus_power-supply = <&usb_power_supply>; ++ usb0_vbus-supply = <®_usb0_vbus>; + status = "okay"; +-}; +\ No newline at end of file ++}; diff --git a/patch/u-boot/u-boot-next/bananapi-enable-ldo4.patch b/patch/u-boot/u-boot-next/bananapi-enable-ldo4.patch deleted file mode 100644 index 301ec875a8..0000000000 --- a/patch/u-boot/u-boot-next/bananapi-enable-ldo4.patch +++ /dev/null @@ -1,9 +0,0 @@ -diff --git a/configs/Bananapi_defconfig b/configs/Bananapi_defconfig -index 6cbb76c..5ed845c 100644 ---- a/configs/Bananapi_defconfig -+++ b/configs/Bananapi_defconfig -@@ -15,3 +15,4 @@ CONFIG_CMD_GPIO=y - CONFIG_NETCONSOLE=y - CONFIG_ETH_DESIGNWARE=y - CONFIG_USB_EHCI_HCD=y -+CONFIG_AXP_ALDO4_VOLT=2500 diff --git a/patch/u-boot/u-boot-next/u-boot_v2016.01_Bananapro_defconfig.patch b/patch/u-boot/u-boot-next/u-boot_v2016.01_Bananapro_defconfig.patch new file mode 100644 index 0000000000..5464609aa4 --- /dev/null +++ b/patch/u-boot/u-boot-next/u-boot_v2016.01_Bananapro_defconfig.patch @@ -0,0 +1,9 @@ +diff --git a/configs/Bananapro_defconfig b/configs/Bananapro_defconfig +index 40588b9..4f4a07b 100644 +--- a/configs/Bananapro_defconfig ++++ b/configs/Bananapro_defconfig +@@ -17,3 +17,4 @@ CONFIG_CMD_GPIO=y + CONFIG_NETCONSOLE=y + CONFIG_ETH_DESIGNWARE=y + CONFIG_USB_EHCI_HCD=y ++CONFIG_AXP_ALDO4_VOLT=2500 diff --git a/patch/u-boot/u-boot-next/u-boot_v2016.01_sun7i-a20-bananapro_dts.patch b/patch/u-boot/u-boot-next/u-boot_v2016.01_sun7i-a20-bananapro_dts.patch new file mode 100644 index 0000000000..2f50464169 --- /dev/null +++ b/patch/u-boot/u-boot-next/u-boot_v2016.01_sun7i-a20-bananapro_dts.patch @@ -0,0 +1,254 @@ +diff --git a/arch/arm/dts/sun7i-a20-bananapro.dts b/arch/arm/dts/sun7i-a20-bananapro.dts +index 18fcc87..c575a01 100644 +--- a/arch/arm/dts/sun7i-a20-bananapro.dts ++++ b/arch/arm/dts/sun7i-a20-bananapro.dts +@@ -42,9 +42,11 @@ + + /dts-v1/; + #include "sun7i-a20.dtsi" +-#include "sunxi-common-regulators.dtsi" ++//#include "sunxi-common-regulators.dtsi" + #include + #include ++#include ++#include + + / { + model = "LeMaker Banana Pro"; +@@ -73,6 +75,7 @@ + green { + label = "bananapro:green:usr"; + gpios = <&pio 7 24 GPIO_ACTIVE_HIGH>; ++ linux,default-trigger = "mmc0"; + }; + }; + +@@ -95,15 +98,84 @@ + regulator-name = "vmmc3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; ++ regulator-always-on; ++ regulator-boot-on; + enable-active-high; + gpio = <&pio 7 22 GPIO_ACTIVE_HIGH>; + }; ++ ++ reg_ahci_5v: ahci-5v { ++ compatible = "regulator-fixed"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&ahci_pwr_pin_a>; ++ regulator-name = "ahci-5v"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ regulator-boot-on; ++ enable-active-high; ++ gpio = <&pio 1 8 GPIO_ACTIVE_HIGH>; ++ status = "disabled"; ++ }; ++ ++ reg_usb0_vbus: usb0-vbus { ++ compatible = "regulator-fixed"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&usb0_vbus_pin_a>; ++ regulator-name = "usb0-vbus"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ enable-active-high; ++ gpio = <&pio 1 9 GPIO_ACTIVE_HIGH>; ++ status = "disabled"; ++ }; ++ ++ reg_vcc3v0: vcc3v0 { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc3v0"; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ }; ++ ++ reg_vcc3v3: vcc3v3 { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc3v3"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ }; ++ ++ reg_vcc5v0: vcc5v0 { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc5v0"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ }; + }; + + &ahci { + status = "okay"; + }; + ++/* ++ * for codec support in u-boot some include files are missing ++&codec { ++ status = "okay"; ++}; ++*/ ++ ++&cpu0 { ++ cpu-supply = <®_dcdc2>; ++ operating-points = < ++ /* kHz uV */ ++ 960000 1400000 ++ 912000 1400000 ++ 864000 1350000 ++ 720000 1250000 ++ 528000 1150000 ++ 312000 1100000 ++ 144000 1050000 ++ >; ++}; ++ + &ehci0 { + status = "okay"; + }; +@@ -164,11 +236,14 @@ + }; + + &mmc3 { ++ #address-cells = <1>; ++ #size-cells = <0>; + pinctrl-names = "default"; + pinctrl-0 = <&mmc3_pins_a>; + vmmc-supply = <®_vmmc3>; + bus-width = <4>; + non-removable; ++ enable-sdio-wakeup; + status = "okay"; + }; + +@@ -180,59 +255,89 @@ + status = "okay"; + }; + ++&otg_sram { ++ status = "okay"; ++}; ++ + &pio { + gmac_power_pin_bananapro: gmac_power_pin@0 { +- allwinner,pins = "PH23"; ++ allwinner,pins = "PH23"; /* EMAC-PWR-EN */ + allwinner,function = "gpio_out"; + allwinner,drive = ; + allwinner,pull = ; + }; + + led_pins_bananapro: led_pins@0 { +- allwinner,pins = "PH24", "PG2"; ++ allwinner,pins = "PH24", "PG2"; /* LED1, LED2 */ + allwinner,function = "gpio_out"; + allwinner,drive = ; + allwinner,pull = ; + }; + + mmc0_cd_pin_bananapro: mmc0_cd_pin@0 { +- allwinner,pins = "PH10"; ++ allwinner,pins = "PH10"; /* SD0-DET */ + allwinner,function = "gpio_in"; + allwinner,drive = ; + allwinner,pull = ; + }; + +- usb1_vbus_pin_bananapro: usb1_vbus_pin@0 { +- allwinner,pins = "PH0"; ++ ahci_pwr_pin_a: ahci_pwr_pin@0 { ++ allwinner,pins = "PB8"; + allwinner,function = "gpio_out"; + allwinner,drive = ; + allwinner,pull = ; + }; + +- usb2_vbus_pin_bananapro: usb2_vbus_pin@0 { +- allwinner,pins = "PH1"; ++ usb0_vbus_pin_a: usb0_vbus_pin@0 { ++ allwinner,pins = "PB9"; + allwinner,function = "gpio_out"; + allwinner,drive = ; + allwinner,pull = ; + }; + ++ usb0_id_detect_pin: usb0_id_detect_pin@0 { ++ allwinner,pins = "PH3"; /* USB0-IDDET */ ++ allwinner,function = "gpio_in"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++ + vmmc3_pin_bananapro: vmmc3_pin@0 { +- allwinner,pins = "PH22"; ++ allwinner,pins = "PH22"; /* WIFI-SHDN */ + allwinner,function = "gpio_out"; + allwinner,drive = ; + allwinner,pull = ; + }; + }; + +-®_usb1_vbus { +- pinctrl-0 = <&usb1_vbus_pin_bananapro>; +- gpio = <&pio 7 0 GPIO_ACTIVE_HIGH>; /* PH0 */ +- status = "okay"; ++#include "axp209.dtsi" ++ ++®_dcdc2 { ++ regulator-always-on; ++ regulator-min-microvolt = <1000000>; ++ regulator-max-microvolt = <1400000>; ++ regulator-name = "vdd-cpu"; ++}; ++ ++®_dcdc3 { ++ regulator-always-on; ++ regulator-min-microvolt = <1000000>; ++ regulator-max-microvolt = <1400000>; ++ regulator-name = "vdd-int-dll"; + }; + +-®_usb2_vbus { +- pinctrl-0 = <&usb2_vbus_pin_bananapro>; +- gpio = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ ++®_ldo1 { ++ regulator-name = "vdd-rtc"; ++}; ++ ++®_ldo2 { ++ regulator-always-on; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ regulator-name = "avcc"; ++}; ++ ++®_usb0_vbus { + status = "okay"; + }; + +@@ -262,8 +367,20 @@ + status = "okay"; + }; + +-&usbphy { +- usb1_vbus-supply = <®_usb1_vbus>; +- usb2_vbus-supply = <®_usb2_vbus>; ++&usb_otg { ++ dr_mode = "host"; ++ status = "okay"; ++}; ++ ++&usb_power_supply { + status = "okay"; + }; ++ ++&usbphy { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&usb0_id_detect_pin>; ++ usb0_id_det-gpio = <&pio 7 3 GPIO_ACTIVE_HIGH>; /* PH3 */ ++ usb0_vbus_power-supply = <&usb_power_supply>; ++ usb0_vbus-supply = <®_usb0_vbus>; ++ status = "okay"; ++};