Temat: FriendlyARM NanoPi NEO - niewykryte UART 1 i USB 1, 2

Platforma: FriendlyARM NanoPi NEO
System: OpenWRT 19.07.10

Problem: Na zbudowanym systemie nie wykrywa USB 1 i USB 2, a także UART 1.

USB 1 i 2 na 100% nie jest problemem hardware'owym, wrzuciłem na NanoPi NEO obraz: nanopi-neo_sd_friendlycore-xenial_4.14_armhf_20210425.img
pobrany stąd: https://drive.google.com/drive/folders/ … -KYovLV6iA

pi@NanoPi-NEO:~$ lsusb -t
/:  Bus 09.Port 1: Dev 1, Class=root_hub, Driver=musb-hdrc/1p, 480M
/:  Bus 08.Port 1: Dev 1, Class=root_hub, Driver=ohci-platform/1p, 12M
/:  Bus 07.Port 1: Dev 1, Class=root_hub, Driver=ohci-platform/1p, 12M
/:  Bus 06.Port 1: Dev 1, Class=root_hub, Driver=ohci-platform/1p, 12M
/:  Bus 05.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M
    |__ Port 1: Dev 3, If 0, Class=Vendor Specific Class, Driver=rtl8192cu, 480M
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ohci-platform/1p, 12M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M

Natomiast na budowanym OpenWRT wynik jest taki:

root@OpenWrt:/# lsusb -t
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ohci-platform/1p, 12M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Vendor Specific Class, Driver=rt2800usb, 480M

Zainstalowane moduły USB:

root@OpenWrt:~# opkg list-installed | grep usb
brcmfmac-firmware-usb - 20190416-1
kmod-ath6kl-usb - 4.14.275+4.19.237-1-1
kmod-libertas-usb - 4.14.275+4.19.237-1-1
kmod-mt76-usb - 4.14.275+2021-02-15-5c768dec-1
kmod-mt76x02-usb - 4.14.275+2021-02-15-5c768dec-1
kmod-p54-usb - 4.14.275+4.19.237-1-1
kmod-rt2500-usb - 4.14.275+4.19.237-1-1
kmod-rt2800-usb - 4.14.275+4.19.237-1-1
kmod-rt2x00-usb - 4.14.275+4.19.237-1-1
kmod-rt73-usb - 4.14.275+4.19.237-1-1
kmod-rtlwifi-usb - 4.14.275+4.19.237-1-1
kmod-usb-acm - 4.14.275-1
kmod-usb-core - 4.14.275-1
kmod-usb-dwc2 - 4.14.275-1
kmod-usb-dwc3 - 4.14.275-1
kmod-usb-ehci - 4.14.275-1
kmod-usb-hid - 4.14.275-1
kmod-usb-ledtrig-usbport - 4.14.275-1
kmod-usb-net - 4.14.275-1
kmod-usb-net-cdc-ether - 4.14.275-1
kmod-usb-net-cdc-ncm - 4.14.275-1
kmod-usb-net-hso - 4.14.275-1
kmod-usb-net-huawei-cdc-ncm - 4.14.275-1
kmod-usb-net-qmi-wwan - 4.14.275-1
kmod-usb-net-rndis - 4.14.275-1
kmod-usb-net-rtl8150 - 4.14.275-1
kmod-usb-net-rtl8152 - 4.14.275-1
kmod-usb-net-sierrawireless - 4.14.275-1
kmod-usb-ohci - 4.14.275-1
kmod-usb-serial - 4.14.275-1
kmod-usb-serial-cp210x - 4.14.275-1
kmod-usb-serial-option - 4.14.275-1
kmod-usb-serial-qualcomm - 4.14.275-1
kmod-usb-serial-sierrawireless - 4.14.275-1
kmod-usb-serial-ti-usb - 4.14.275-1
kmod-usb-serial-wwan - 4.14.275-1
kmod-usb-storage - 4.14.275-1
kmod-usb-wdm - 4.14.275-1
kmod-usb2 - 4.14.275-1
kmod-usb3 - 4.14.275-1
kmod-usbmon - 4.14.275-1
libertas-usb-firmware - 20190416-1
libusb-1.0-0 - 1.0.22-2
p54-usb-firmware - 1
rt2800-usb-firmware - 20190416-1
rt73-usb-firmware - 20190416-1
usb-modeswitch - 2017-12-19-f40f84c2-2
usbutils - 007-10

Podjąłem też próbę dodania tych peryferiów do DTS (sun8i-h3-nanopi.dtsi):

/*
 * Copyright (C) 2016 James Pettigrew <james@innovum.com.au>
 * Copyright (C) 2016 Milo Kim <woogyom.kim@gmail.com>
 *
 * This file is dual-licensed: you can use it either under the terms
 * of the GPL or the X11 license, at your option. Note that this dual
 * licensing only applies to this file, and not this project as a
 * whole.
 *
 *  a) This file is free software; you can redistribute it and/or
 *     modify it under the terms of the GNU General Public License as
 *     published by the Free Software Foundation; either version 2 of the
 *     License, or (at your option) any later version.
 *
 *     This file is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU General Public License for more details.
 *
 * Or, alternatively,
 *
 *  b) Permission is hereby granted, free of charge, to any person
 *     obtaining a copy of this software and associated documentation
 *     files (the "Software"), to deal in the Software without
 *     restriction, including without limitation the rights to use,
 *     copy, modify, merge, publish, distribute, sublicense, and/or
 *     sell copies of the Software, and to permit persons to whom the
 *     Software is furnished to do so, subject to the following
 *     conditions:
 *
 *     The above copyright notice and this permission notice shall be
 *     included in all copies or substantial portions of the Software.
 *
 *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 *     OTHER DEALINGS IN THE SOFTWARE.
 */

/dts-v1/;
#include "sun8i-h3.dtsi"
#include "sunxi-common-regulators.dtsi"

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>

/ {
    aliases {
        serial0 = &uart0;
        serial1 = &uart1;
    };

    chosen {
        stdout-path = "serial0:115200n8";
    };

    leds {
        compatible = "gpio-leds";
        pinctrl-names = "default";
        pinctrl-0 = <&leds_npi>, <&leds_r_npi>;

        status {
            label = "nanopi:blue:status";
            gpios = <&pio 0 10 GPIO_ACTIVE_HIGH>;
            linux,default-trigger = "heartbeat";
        };

        pwr {
            label = "nanopi:green:pwr";
            gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>;
            default-state = "on";
        };
    };

    r_gpio_keys {
        compatible = "gpio-keys";
        input-name = "k1";
        pinctrl-names = "default";
        pinctrl-0 = <&sw_r_npi>;

        k1@0 {
            label = "k1";
            linux,code = <KEY_POWER>;
            gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
        };
    };
};

&ehci1 {
    status = "okay";
};

&ehci2 {
    status = "okay";
};

&ehci3 {
    status = "okay";
};

&mmc0 {
    bus-width = <4>;
    cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>;
    cd-inverted;
    pinctrl-names = "default";
    pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
    status = "okay";
    vmmc-supply = <&reg_vcc3v3>;
};

&ohci1 {
    status = "okay";
};

&ohci2 {
    status = "okay";
};

&ohci3 {
    status = "okay";
};

&pio {
    leds_npi: led_pins@0 {
        pins = "PA10";
        function = "gpio_out";
    };
};

&r_pio {
    leds_r_npi: led_pins@0 {
        pins = "PL10";
        function = "gpio_out";
    };

    sw_r_npi: key_pins@0 {
        pins = "PL3";
        function = "gpio_in";
    };
};

&reg_usb0_vbus {
    gpio = <&r_pio 0 2 GPIO_ACTIVE_HIGH>; /* PL2 */
    status = "okay";
};

&usb_otg {
    dr_mode = "otg";
    status = "okay";
};

&uart0 {
    pinctrl-names = "default";
    pinctrl-0 = <&uart0_pins_a>;
    status = "okay";
};

&uart1 {
    pinctrl-names = "default";
    pinctrl-0 = <&uart1_pins_a>;
    status = "okay";
};

&usbphy {
    usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
    usb0_vbus-supply = <&reg_usb0_vbus>;
    /* VBUS on USB host ports are always on */
    status = "okay";
};

Co jeszcze mogę zrobić aby te peryferia, a szczególnie UART1, ruszyły?

2

Odp: FriendlyARM NanoPi NEO - niewykryte UART 1 i USB 1, 2

OpenWrt w dtsie nie włącza tych dodatkowych usb które są na złączach, więc jeżeli chciałeś ich używać to trzeba to włączyć i przekompilować. Kiedyś tu na forum był poszukany ten temat.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

3

Odp: FriendlyARM NanoPi NEO - niewykryte UART 1 i USB 1, 2

Ok, znalazłem ten temat z USB https://eko.one.pl/forum/viewtopic.php?id=22148&p=3
A co w takim razie z UART1?

4

Odp: FriendlyARM NanoPi NEO - niewykryte UART 1 i USB 1, 2

To samo - sunxi-h3-h5.dtsi definiuje łącznie 4 uarty, włącz sobie w dts jeżeli potrzebujesz (o ile coś innego pod te piny nie jest podłączone).

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.