jts Posted January 17, 2018 Share Posted January 17, 2018 I am trying to enable USB on Nanopi-neo-air in mainline kernel. Followed these links to do that. But any device on USB port is not recognized at all. http://linux-sunxi.org/USB_Gadget/Ethernet http://linux-sunxi.org/USB_Gadget/Mass_storage Any clue, what's missing? Thank you. Link to comment Share on other sites More sharing options...
jts Posted January 22, 2018 Author Share Posted January 22, 2018 Hi all, I applied aptches to the dts file and finally USB worked. Kernel version 4.12.12. These patches enable both wifi and USB. I copied wifi patch from other sources. But for USB, I had to to patch sunxi-h3-h5.dtsi or USB wouldn't work. Is it worth applying this patch to the mainline kernel? The source I worked on : https://github.com/torvalds/linux/tree/v4.12 Here are the patches: --- linux-4.12/arch/arm/boot/dts/sun8i-h3-nanopi-neo-air.dts 2017-07-03 01:07:02.000000000 +0200 +++ /home/nuvo/air-kernel/linux-4.12/linux-4.12.12/arch/arm/boot/dts/sun8i-h3-nanopi-neo-air.dts 2018-01-05 11:13:26.083622528 +0100 @@ -45,7 +45,7 @@ #include "sunxi-common-regulators.dtsi" #include <dt-bindings/gpio/gpio.h> - +#include <dt-bindings/pinctrl/sun4i-a10.h> / { model = "FriendlyARM NanoPi NEO Air"; compatible = "friendlyarm,nanopi-neo-air", "allwinner,sun8i-h3"; @@ -72,6 +72,16 @@ gpios = <&pio 0 10 GPIO_ACTIVE_HIGH>; /* PA10 */ }; }; + wifi_pwrseq: wifi_pwrseq { + compatible = "mmc-pwrseq-simple"; + pinctrl-names = "default"; + pinctrl-0 = <&wifi_en_nanopi_neo_air>; + reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */ + }; +}; + +&ehci3 { + status = "okay"; }; &mmc0 { @@ -84,13 +94,61 @@ status = "okay"; }; +&ohci3 { + status = "okay"; +}; + +&mmc1 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc1_pins_a>; + vmmc-supply = <®_vcc3v3>; + vqmmc-supply = <®_vcc3v3>; + mmc-pwrseq = <&wifi_pwrseq>; + bus-width = <4>; + non-removable; + status = "okay"; + + brcmf: bcrmf@1 { + reg = <1>; + compatible = "brcm,brcmfmac"; + interrupt-parent = <&pio>; + interrupts = <6 10 IRQ_TYPE_LEVEL_LOW>; /* PG10 / EINT10 */ + interrupt-names = "host-wake"; + }; +}; + +&mmc2 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc2_8bit_pins>; + vmmc-supply = <®_vcc3v3>; + vqmmc-supply = <®_vcc3v3>; + bus-width = <8>; + non-removable; + status = "okay"; +}; + +&r_pio { + wifi_en_nanopi_neo_air: wifi_en_pin { + allwinner,pins = "PL7"; + allwinner,function = "gpio_out"; + allwinner,drive = <SUN4I_PINCTRL_10_MA>; + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; + }; +}; + &uart0 { pinctrl-names = "default"; pinctrl-0 = <&uart0_pins_a>; status = "okay"; }; +/*&usb_otg { + dr_mode = "otg"; + status = "okay"; +}; +*/ &usbphy { /* USB VBUS is always on */ status = "okay"; }; + and --- linux-4.12/arch/arm/boot/dts/sunxi-h3-h5.dtsi 2017-07-03 01:07:02.000000000 +0200 +++ /home/nuvo/air-kernel/linux-4.12/linux-4.12.12/arch/arm/boot/dts/sunxi-h3-h5.dtsi 2018-01-05 11:30:32.891423644 +0100 @@ -176,7 +176,7 @@ 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>; - status = "disabled"; + status = "okay"; }; ohci0: usb@01c1a400 { @@ -186,7 +186,7 @@ clocks = <&ccu CLK_BUS_EHCI0>, <&ccu CLK_BUS_OHCI0>, <&ccu CLK_USB_OHCI0>; resets = <&ccu RST_BUS_EHCI0>, <&ccu RST_BUS_OHCI0>; - status = "disabled"; + status = "okay"; }; ehci1: usb@01c1b000 { @@ -197,7 +197,7 @@ resets = <&ccu RST_BUS_EHCI1>, <&ccu RST_BUS_OHCI1>; phys = <&usbphy 1>; phy-names = "usb"; - status = "disabled"; + status = "okay"; }; ohci1: usb@01c1b400 { @@ -209,7 +209,7 @@ resets = <&ccu RST_BUS_EHCI1>, <&ccu RST_BUS_OHCI1>; phys = <&usbphy 1>; phy-names = "usb"; - status = "disabled"; + status = "okay"; }; ehci2: usb@01c1c000 { @@ -220,7 +220,8 @@ resets = <&ccu RST_BUS_EHCI2>, <&ccu RST_BUS_OHCI2>; phys = <&usbphy 2>; phy-names = "usb"; - status = "disabled"; + status = "okay"; + }; ohci2: usb@01c1c400 { @@ -232,7 +233,7 @@ resets = <&ccu RST_BUS_EHCI2>, <&ccu RST_BUS_OHCI2>; phys = <&usbphy 2>; phy-names = "usb"; - status = "disabled"; + status = "okay"; }; ehci3: usb@01c1d000 { @@ -243,7 +244,7 @@ resets = <&ccu RST_BUS_EHCI3>, <&ccu RST_BUS_OHCI3>; phys = <&usbphy 3>; phy-names = "usb"; - status = "disabled"; + status = "okay"; }; ohci3: usb@01c1d400 { @@ -255,7 +256,7 @@ resets = <&ccu RST_BUS_EHCI3>, <&ccu RST_BUS_OHCI3>; phys = <&usbphy 3>; phy-names = "usb"; - status = "disabled"; + status = "okay"; }; ccu: clock@01c20000 { Link to comment Share on other sites More sharing options...
Igor Posted January 22, 2018 Share Posted January 22, 2018 This is far more simple - just use our beta build, update (to 4.14.y) kernel and use armbian-config -> system -> hardware Link to comment Share on other sites More sharing options...
jts Posted January 22, 2018 Author Share Posted January 22, 2018 Thank you. Will try Link to comment Share on other sites More sharing options...
Igor Posted January 22, 2018 Share Posted January 22, 2018 You can also start with a clean image - check this (testing) build: https://dl.armbian.com/nanopiair/Debian_stretch_next.7z Ubuntu version also exists . Link to comment Share on other sites More sharing options...
Recommended Posts