From 0858337c1a409b7101b6975533c720775ed13313 Mon Sep 17 00:00:00 2001 From: Elias Bakken Date: Fri, 24 Nov 2023 14:57:55 +0100 Subject: [PATCH] Add patch for emmc LED and USB peripheral. Add overlay for USB host --- armbian/customize-image-barebone.sh | 1 - armbian/customize-image-fluidd.sh | 1 - armbian/customize-image-mainsail.sh | 1 - armbian/customize-image-octoprint.sh | 1 - armbian/customize-image-reflash.sh | 1 - ...un50i-a64-recore-fix-otg-and-mmc-led.patch | 88 +++++++++++++++++++ ...usb-device.dts => sun50i-a64-usb-host.dts} | 8 +- 7 files changed, 91 insertions(+), 10 deletions(-) create mode 100644 userpatches/kernel/archive/sunxi-5.15/sun50i-a64-recore-fix-otg-and-mmc-led.patch rename userpatches/overlay/dts/{sun50i-a64-usb-device.dts => sun50i-a64-usb-host.dts} (64%) diff --git a/armbian/customize-image-barebone.sh b/armbian/customize-image-barebone.sh index 02a5a4c..a4be68e 100644 --- a/armbian/customize-image-barebone.sh +++ b/armbian/customize-image-barebone.sh @@ -25,7 +25,6 @@ install_bins(){ add_overlays(){ mkdir /boot/overlay-user cp /tmp/overlay/dts/* /boot/overlay-user - armbian-add-overlay /boot/overlay-user/sun50i-a64-usb-device.dts } fix_netplan(){ diff --git a/armbian/customize-image-fluidd.sh b/armbian/customize-image-fluidd.sh index 07898f7..4fd93fd 100644 --- a/armbian/customize-image-fluidd.sh +++ b/armbian/customize-image-fluidd.sh @@ -159,7 +159,6 @@ post_build() { add_overlays(){ mkdir /boot/overlay-user cp /tmp/overlay/dts/* /boot/overlay-user - armbian-add-overlay /boot/overlay-user/sun50i-a64-usb-device.dts } fix_netplan(){ diff --git a/armbian/customize-image-mainsail.sh b/armbian/customize-image-mainsail.sh index 985b124..0e1bed7 100644 --- a/armbian/customize-image-mainsail.sh +++ b/armbian/customize-image-mainsail.sh @@ -169,7 +169,6 @@ post_build() { add_overlays(){ mkdir /boot/overlay-user cp /tmp/overlay/dts/* /boot/overlay-user - armbian-add-overlay /boot/overlay-user/sun50i-a64-usb-device.dts } fix_netplan(){ diff --git a/armbian/customize-image-octoprint.sh b/armbian/customize-image-octoprint.sh index b2b2fe1..76699a3 100644 --- a/armbian/customize-image-octoprint.sh +++ b/armbian/customize-image-octoprint.sh @@ -176,7 +176,6 @@ prepare_build() { add_overlays(){ mkdir /boot/overlay-user cp /tmp/overlay/dts/* /boot/overlay-user - armbian-add-overlay /boot/overlay-user/sun50i-a64-usb-device.dts } fix_netplan(){ diff --git a/armbian/customize-image-reflash.sh b/armbian/customize-image-reflash.sh index 9a95d90..631b4ad 100644 --- a/armbian/customize-image-reflash.sh +++ b/armbian/customize-image-reflash.sh @@ -53,7 +53,6 @@ install_autohotspot() { add_overlays(){ mkdir /boot/overlay-user cp /tmp/overlay/dts/* /boot/overlay-user - armbian-add-overlay /boot/overlay-user/sun50i-a64-usb-device.dts } fix_netplan(){ diff --git a/userpatches/kernel/archive/sunxi-5.15/sun50i-a64-recore-fix-otg-and-mmc-led.patch b/userpatches/kernel/archive/sunxi-5.15/sun50i-a64-recore-fix-otg-and-mmc-led.patch new file mode 100644 index 0000000..4fedf0a --- /dev/null +++ b/userpatches/kernel/archive/sunxi-5.15/sun50i-a64-recore-fix-otg-and-mmc-led.patch @@ -0,0 +1,88 @@ +diff -u b/arch/arm64/boot/dts/allwinner/sun50i-a64-recore-a7.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-recore-a7.dts +--- b/arch/arm64/boot/dts/allwinner/sun50i-a64-recore-a7.dts ++++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-recore-a7.dts +@@ -8,6 +8,18 @@ + / { + model = "Recore-A7"; + compatible = "iagent,recore-a7", "allwinner,sun50i-a64"; ++ ++ reg_usb0_vbus: usb0-vbus { ++ compatible = "regulator-fixed"; ++ vin-supply = <®_5v>; ++ regulator-name = "usb0-vbus0"; ++ regulator-type = "voltage"; ++ gpio = <&pio 3 7 GPIO_ACTIVE_HIGH>; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ enable-active-high; ++ status = "okay"; ++ }; + }; + + ®_usb1_vbus3 { +@@ -32,8 +44,9 @@ + }; + + &usbphy { +- usb0_id_det-gpios = <&pio 4 7 GPIO_ACTIVE_LOW>; ++ usb1_vbus-supply = <®_5v>; + }; ++ + &uart2 { + pinctrl-names = "default"; + pinctrl-0 = <&uart2_pins>; +unchanged: +--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-recore.dtsi ++++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-recore.dtsi +@@ -40,11 +40,11 @@ heartbeat-led { + }; + + emmc-led { + label = "recore:white:emmc"; + gpios = <&pio 1 5 GPIO_ACTIVE_HIGH>; +- linux,default-trigger = "mmc0"; ++ linux,default-trigger = "mmc2"; + }; + + cpu-led { + label = "recore:white:cpu"; + gpios = <&pio 1 6 GPIO_ACTIVE_HIGH>; +@@ -190,22 +190,14 @@ &mmc2 { + cap-mmc-hw-reset; + mmc-hs200-1_8v; + status = "okay"; + }; + +-&ohci0 { +- status = "okay"; +-}; +- + &ohci1 { + status = "okay"; + }; + +-&ehci0 { +- status = "okay"; +-}; +- + &ehci1 { + status = "okay"; + }; + + &pio { +@@ -369,14 +361,13 @@ &usb_otg { + &usb_power_supply { + status = "okay"; + }; + + &usbphy { +- usb0_vbus_power-supply = <&usb_power_supply>; +- vcc-supply = <®_dcdc1>; + status = "okay"; + }; ++ + &cpu0 { + /delete-property/ cpu-idle-states; + }; + + &cpu1 { diff --git a/userpatches/overlay/dts/sun50i-a64-usb-device.dts b/userpatches/overlay/dts/sun50i-a64-usb-host.dts similarity index 64% rename from userpatches/overlay/dts/sun50i-a64-usb-device.dts rename to userpatches/overlay/dts/sun50i-a64-usb-host.dts index 8f74e0c..f0ca741 100644 --- a/userpatches/overlay/dts/sun50i-a64-usb-device.dts +++ b/userpatches/overlay/dts/sun50i-a64-usb-host.dts @@ -7,23 +7,21 @@ fragment@0 { target = <&ehci0>; __overlay__ { - status = "disabled"; + status = "okay"; }; }; fragment@1 { target = <&ohci0>; __overlay__ { - status = "disabled"; + status = "okay"; }; }; fragment@2 { target = <&usbphy>; __overlay__ { - usb0_vbus_det-gpios = <&pio 7 10 0>; - usb0_vbus_power-supply = <&usb_power_supply>; + usb0_vbus-supply = <®_usb0_vbus>; }; }; - }; \ No newline at end of file