Skip to content

Commit

Permalink
Add patch for emmc LED and USB peripheral. Add overlay for USB host
Browse files Browse the repository at this point in the history
  • Loading branch information
eliasbakken committed Nov 24, 2023
1 parent f3fa053 commit 0858337
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 10 deletions.
1 change: 0 additions & 1 deletion armbian/customize-image-barebone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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(){
Expand Down
1 change: 0 additions & 1 deletion armbian/customize-image-fluidd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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(){
Expand Down
1 change: 0 additions & 1 deletion armbian/customize-image-mainsail.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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(){
Expand Down
1 change: 0 additions & 1 deletion armbian/customize-image-octoprint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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(){
Expand Down
1 change: 0 additions & 1 deletion armbian/customize-image-reflash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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(){
Expand Down
Original file line number Diff line number Diff line change
@@ -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 = <&reg_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";
+ };
};

&reg_usb1_vbus3 {
@@ -32,8 +44,9 @@
};

&usbphy {
- usb0_id_det-gpios = <&pio 4 7 GPIO_ACTIVE_LOW>;
+ usb1_vbus-supply = <&reg_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 = <&reg_dcdc1>;
status = "okay";
};
+
&cpu0 {
/delete-property/ cpu-idle-states;
};

&cpu1 {
Original file line number Diff line number Diff line change
Expand Up @@ -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 = <&reg_usb0_vbus>;
};
};

};

0 comments on commit 0858337

Please sign in to comment.