-
Posts
5 -
Joined
-
Last visited
-
NanoPi DUO2 microUSB serial stop working on 24.11.0
nickycakes replied to Slawek's topic in Allwinner sunxi
no, i think there are individual patches for the stable kernels that do this that wouldnt be automatically applied to the edge kernel, see /patch/kernel/archive/sunxi-6.11/patches.armbian/ARM-dts-sun8i-nanopiduo2-Use-key-0-as-power-button.patch in the armbian build repo -
NanoPi DUO2 microUSB serial stop working on 24.11.0
nickycakes replied to Slawek's topic in Allwinner sunxi
ok, i'm also happy to report that if you simply build with the 'edge' kernel option (6.11.9 atm) instead of 'current' that it is fixed without having to go through all this trouble. tested on debian 12 and 13. apparently they've fixed it since linux 6.6.65 -
NanoPi DUO2 microUSB serial stop working on 24.11.0
nickycakes replied to Slawek's topic in Allwinner sunxi
you can compile it yourself by putting the patch i posted above into something like /userpatches/kernel/archive/sunxi-6.6/fix-nanopiduo2-otg-serial.patch and then building, but that will force a recompile of the kernel which takes a while. i would first test it out by editing your device tree in a live system like i did here -
NanoPi DUO2 microUSB serial stop working on 24.11.0
nickycakes replied to Slawek's topic in Allwinner sunxi
i didn't use an overlay because apparently overlays cannot remove lines, only add or modify. I used a patch file on the kernel dtsi and recompiled. uboot logs are identical. here is the fixed version: U-Boot SPL 2024.01-armbian-2024.01-S866c-Pe31d-Ha5c2-Vb835-Bdacf-R448a (Dec 13 2024 - 09:33:36 +0000) DRAM: 512 MiB Trying to boot from MMC1 U-Boot 2024.01-armbian-2024.01-S866c-Pe31d-Ha5c2-Vb835-Bdacf-R448a (Dec 13 2024 - 09:33:36 +0000) Allwinner Technology CPU: Allwinner H3 (SUN8I 1680) Model: FriendlyARM NanoPi NEO DRAM: 512 MiB Core: 64 devices, 19 uclasses, devicetree: separate WDT: Not starting watchdog@1c20ca0 MMC: mmc@1c0f000: 0 Loading Environment from FAT... Unable to use mmc 0:1... In: serial,usbkbd Out: serial Err: serial Starting SCP... Net: SCP/INF: Crust v0.6.10000 eth0: ethernet@1c30000 starting USB... Bus usb@1c1a000: sun4i_usb_phy phy@1c19400: External vbus detected, not enabling our own vbus USB EHCI 1.00 Bus usb@1c1a400: USB OHCI 1.0 Bus usb@1c1d000: USB EHCI 1.00 Bus usb@1c1d400: USB OHCI 1.0 scanning bus usb@1c1a000 for devices... 1 USB Device(s) found scanning bus usb@1c1a400 for devices... 1 USB Device(s) found scanning bus usb@1c1d000 for devices... 1 USB Device(s) found scanning bus usb@1c1d400 for devices... 1 USB Device(s) found scanning usb for storage devices... 0 Storage Device(s) found Autoboot in 1 seconds, press <Space> to stop switch to partitions #0, OK mmc0 is current device Scanning mmc 0:1... Found U-Boot script /boot/boot.scr 5475 bytes read in 2 ms (2.6 MiB/s) ## Executing script at 43100000 U-boot loaded from SD 273 bytes read in 1 ms (266.6 KiB/s) Load fdt: /boot/dtb/sun8i-h3-nanopi-duo2.dtb 10758303 bytes read in 442 ms (23.2 MiB/s) 8995680 bytes read in 385 ms (22.3 MiB/s) Found mainline kernel configuration 35930 bytes read in 6 ms (5.7 MiB/s) Working FDT set to 43000000 504 bytes read in 3 ms (164.1 KiB/s) Applying kernel provided DT overlay sun8i-h3-usbhost0.dtbo 504 bytes read in 3 ms (164.1 KiB/s) Applying kernel provided DT overlay sun8i-h3-usbhost2.dtbo 504 bytes read in 3 ms (164.1 KiB/s) Applying kernel provided DT overlay sun8i-h3-usbhost3.dtbo 4185 bytes read in 4 ms (1021.5 KiB/s) Applying kernel provided DT fixup script (sun8i-h3-fixup.scr) ## Executing script at 45000000 Kernel image @ 0x42000000 [ 0x000000 - 0x894360 ] ## Loading init Ramdisk from Legacy Image at 43400000 ... Image Name: uInitrd Image Type: ARM Linux RAMDisk Image (gzip compressed) Data Size: 10758239 Bytes = 10.3 MiB Load Address: 00000000 Entry Point: 00000000 Verifying Checksum ... OK ## Flattened Device Tree blob at 43000000 Booting using the fdt blob at 0x43000000 Working FDT set to 43000000 Loading Ramdisk to 495bd000, end 49fff85f ... OK Loading Device Tree to 4954b000, end 495bcfff ... OK Working FDT set to 4954b000 Starting kernel ... here is the patch: From 8e3bdad04af35210a4f4b694212351b2c94b119d Mon Sep 17 00:00:00 2001 From: nickycakes <nickycakes@gmail.com> Date: Fri, 27 Dec 2024 04:58:02 +0000 Subject: [PATCH] fix nanopi duo2 otg serial --- arch/arm/boot/dts/allwinner/sunxi-h3-h5.dtsi | 4 ---- 1 file changed, 4 deletions(-) diff --git a/arch/arm/boot/dts/allwinner/sunxi-h3-h5.dtsi b/arch/arm/boot/dts/allwinner/sunxi-h3-h5.dtsi index ade1cd50e445..fef6f6de097b 100644 --- a/arch/arm/boot/dts/allwinner/sunxi-h3-h5.dtsi +++ b/arch/arm/boot/dts/allwinner/sunxi-h3-h5.dtsi @@ -302,8 +302,6 @@ ehci0: usb@1c1a000 { interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>; clocks = <&ccu CLK_BUS_EHCI0>, <&ccu CLK_BUS_OHCI0>; resets = <&ccu RST_BUS_EHCI0>, <&ccu RST_BUS_OHCI0>; - phys = <&usbphy 0>; - phy-names = "usb"; status = "disabled"; }; @@ -314,8 +312,6 @@ ohci0: usb@1c1a400 { clocks = <&ccu CLK_BUS_EHCI0>, <&ccu CLK_BUS_OHCI0>, <&ccu CLK_USB_OHCI0>; resets = <&ccu RST_BUS_EHCI0>, <&ccu RST_BUS_OHCI0>; - phys = <&usbphy 0>; - phy-names = "usb"; status = "disabled"; }; -- 2.34.1 -
NanoPi DUO2 microUSB serial stop working on 24.11.0
nickycakes replied to Slawek's topic in Allwinner sunxi
I spent the better part of the last 2 days taking a crash course in arm device trees and armbian to fix this for myself because I don't want to solder pin headers on every new board and I think I have found the problem. The device tree between 23.11.1 and 24.2.1 changed from what appears to be this commit: ARM: dts: sunxi: H3/H5: Add phys property to USB HCI0 In the most recent bookworm minimal image (Armbian_community_25.2.0-trunk.195_Nanopiduo2_bookworm_current_6.6.62_minimal.img) I decompiled/edited/compiled the device tree via: cd /boot/dtb dtc -I dtb sun8i-h3-nanopi-duo2.dtb -O dts -o sun8i-h3-nanopi-duo2.dts nano sun8i-h3-nanopi-duo2.dts #remove those 4 lines dtc -I dts -O dtb sun8i-h3-nanopi-duo2.dts -o sun8i-h3-nanopi-duo2.dtb reboot After reboot the OTG serial shows up on boot and can be used as normal. I'm not experienced enough yet to know what other implications this has on other things, but someone with more experience can probably read that commit message and figure it out. My next step I think is figuring out how to turn this into a device tree overlay to use in my custom build or figure out how to submit this as some sort of fix for armbian.