Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Sep 2017 12:44:13 -0700
From:      Mark Millard <markmi@dsl-only.net>
To:        Emmanuel Vadot <manu@FreeBSD.org>, svn-src-head@freebsd.org, freebsd-arm <freebsd-arm@freebsd.org>
Subject:   Re: svn commit: r323641 - head/sys/arm/allwinner (BananapiM3 [an A83T] and USB: BPI-M3 historically had usb nodes listed in ofwdump -a)
Message-ID:  <A04502A5-ABEE-4F02-8924-FEAA2218702C@dsl-only.net>
In-Reply-To: <A1BD89A8-8447-43C1-B5B9-C1712762E93B@dsl-only.net>
References:  <A1BD89A8-8447-43C1-B5B9-C1712762E93B@dsl-only.net>

next in thread | previous in thread | raw e-mail | index | archive | help
[I went looking in the tree for head -r323676
and found *.dts* files listing usb things for
the BPI-M3 and a83t. So I add notes about that.]

On 2017-Sep-17, at 11:50 AM, Mark Millard <markmi@dsl-only.net> wrote:

>> Author: manu
>> Date: Sat Sep 16 15:58:20 2017
>> New Revision: 323641
>> URL:=20
>> https://svnweb.freebsd.org/changeset/base/323641
>>=20
>>=20
>> Log:
>>  Allwinner usb phy: Rework resource allocation
>>=20
>> . . .
>>=20
>>  While here remove A83T code as upstream and FreeBSD dts don't have
>>  nodes for USB.
>>=20
>> . . .
>>=20
>>  EHCI is still buggy on Pine64 (hang the board) so do not enable it =
for now.
>>=20
>>  Tested On:	Bananapi (A20), BananapiM2 (A31S), OrangePi One (H3) =
Pine64 (A64)
>=20
> I have a BPI-M3 (A83T based) that has not been updated
> since head -r317015M. It has the root file system on a
> USB SSD for how I normally boot it. The ubldr and
> ubldr.bin go back to 2016-Oct-24 or before (file
> system date).
>=20
> sysutils/u-boot-sinovoip-bpi-m3/files/ has not
> been updated since then. Nor has the distinfo
> or pkg-descr files. The Makefile has had only
> one change since then:
>=20
> Revision 430454 - (view) (download) (annotate) - [select for diffs]=20
> Modified Tue Jan 3 11:01:05 2017 UTC (8 months, 1 week ago) by mat=20
> File length: 1369 byte(s)=20
> Diff to previous 419007
> Cleanup BROKEN/IGNORE for 10.3-
>=20
> Sponsored by:	Absolight
>=20
>=20
>=20
> The BPI-M3 has usb nodes show in ofwdump. . .
>=20
> # uname -apKU
> FreeBSD bpim3 12.0-CURRENT FreeBSD 12.0-CURRENT  r317015M  arm armv6 =
1200028 1200028
>=20
> ofwdump -a shows usb nodes:
>=20
> Node 0x38:=20
> . . .
>  Node 0x19e0: soc
>   . . .
>    Node 0x1e80: pinctrl@01c20800
>      . . .
>      Node 0x21f0: usb0_vbus_pin@0
>      Node 0x2270: usb1_vbus_pin@0
>      Node 0x22f4: usb2_vbus_pin@0
>      . . .
>    Node 0x32ec: phy@01c19400
>    Node 0x3458: usb@01c1a000
>    Node 0x3550: usb@01c1b000
> . . .
>  Node 0x39fc: usb0-vbus
>  Node 0x3ae8: usb1-vbus
>  Node 0x3bdc: usb2-vbus
>=20
> More fully (followed by usb specific
> ofwdump -p listings):
>=20
> # ofwdump -a
> Node 0x38:=20
>  Node 0xcc: chosen
>  Node 0x108: aliases
>  Node 0x13c: memory
>  Node 0x174: cpus
>    Node 0x1a0: cpu@0
>    Node 0x248: cpu@1
>    Node 0x294: cpu@2
>    Node 0x2e0: cpu@3
>    Node 0x32c: cpu@100
>    Node 0x3d4: cpu@101
>    Node 0x420: cpu@102
>    Node 0x46c: cpu@103
>  Node 0x4bc: timer
>  Node 0x524: clocks
>    Node 0x55c: osc24M_clk
>    Node 0x5dc: osc16M_clk
>    Node 0x65c: osc16Md512_clk
>    Node 0x70c: clk@01c20028
>    Node 0x7b8: pll6d2_clk
>    Node 0x860: clk@01c20054
>    Node 0x918: apb1_clk@01c20054
>    Node 0x9c8: clk@01c20058
>    Node 0xa80: clk@01c2005c
>    Node 0xb2c: clk@01c20060
>    Node 0xe18: clk@01c20088
>    Node 0xedc: clk@01c2008c
>    Node 0xfa0: clk@01c20090
>    Node 0x1064: clk@01f01400
>    Node 0x111c: ahb0_clk
>    Node 0x11c4: clk@01f0140c
>    Node 0x1270: clk@01f01428
>    Node 0x1384: clk@01c20000
>    Node 0x1438: clk@01c20004
>    Node 0x14ec: c0clk@01c20050
>    Node 0x159c: c1clk@01c20050
>    Node 0x164c: clk@01c20044
>    Node 0x16fc: clk@01c200cc
>    Node 0x180c: clk@1
>    Node 0x188c: clk@2
>    Node 0x190c: clk@01c00030
>  Node 0x19e0: soc
>    Node 0x1a2c: mmc@01c0f000
>    Node 0x1bcc: mmc@01c10000
>    Node 0x1d00: mmc@01c11000
>    Node 0x1e80: pinctrl@01c20800
>      Node 0x1f74: mmc0@0
>      Node 0x1ffc: mmc0_cd_pin@0
>      Node 0x2078: uart0@0
>      Node 0x20f0: uart0@1
>      Node 0x216c: ahci_pwr_pin@0
>      Node 0x21f0: usb0_vbus_pin@0
>      Node 0x2270: usb1_vbus_pin@0
>      Node 0x22f4: usb2_vbus_pin@0
>      Node 0x2374: mmc2_8bit
>      Node 0x241c: emac_rgmii@0
>      Node 0x24e0: i2c0@0
>      Node 0x2558: i2c1@0
>      Node 0x25d0: i2c2@0
>    Node 0x264c: reset@01c202c0
>    Node 0x26d4: reset@01c202d0
>    Node 0x275c: reset@01c202d8
>    Node 0x27e4: timer@01c20c00
>    Node 0x286c: watchdog@01c20ca0
>    Node 0x28e8: serial@01c28000
>    Node 0x29ec: interrupt-controller@01c81000
>    Node 0x2ac8: reset@01f014b0
>    Node 0x2b50: pinctrl@01f02c00
>      Node 0x2c40: r_rsb
>    Node 0x2cbc: i2c@01f03400
>      Node 0x2dd0: pmic@3a3
>        Node 0x2e6c: regulators
>          Node 0x2e7c: dcdc2
>          Node 0x2ec0: dcdc3
>    Node 0x2f10: interrupt-controller@01f00c0c
>    Node 0x2fc8: i2c@01c2ac00
>    Node 0x30d4: i2c@01c2b000
>    Node 0x31e0: i2c@01c2b400
>    Node 0x32ec: phy@01c19400
>    Node 0x3458: usb@01c1a000
>    Node 0x3550: usb@01c1b000
>    Node 0x3648: ethernet@01c30000
>      Node 0x37b4: ethernet-phy@1
>    Node 0x3800: eeprom@01c14000
>    Node 0x3874: rtp@01f04000
>  Node 0x3910: ahci-5v
>  Node 0x39fc: usb0-vbus
>  Node 0x3ae8: usb1-vbus
>  Node 0x3bdc: usb2-vbus
>  Node 0x3cd4: vcc3v0
>  Node 0x3d54: vcc3v3
>  Node 0x3dd4: vcc5v0
>  Node 0x3e54: pmu
>  Node 0x3ed0: leds
>    Node 0x3ef4: green_led
>    Node 0x3f34: blue_led
>  Node 0x3f78: __symbols__
>=20
> # ofwdump -p /soc/pinctrl@01c20800/usb0_vbus_pin@0
> Node 0x21f0: usb0_vbus_pin@0
>  allwinner,pins:
>    50 42 39 00=20
>    'PB9'
>  allwinner,function:
>    67 70 69 6f 5f 6f 75 74 00=20
>    'gpio_out'
>  allwinner,drive:
>    00 00 00 00=20
>  allwinner,pull:
>    00 00 00 00=20
>  linux,phandle:
>    00 00 00 32=20
>  phandle:
>    00 00 00 32=20
>=20
> # ofwdump -p /soc/pinctrl@01c20800/usb1_vbus_pin@0
> Node 0x2270: usb1_vbus_pin@0
>  allwinner,pins:
>    50 44 32 34 00=20
>    'PD24'
>  allwinner,function:
>    67 70 69 6f 5f 6f 75 74 00=20
>    'gpio_out'
>  allwinner,drive:
>    00 00 00 00=20
>  allwinner,pull:
>    00 00 00 00=20
>  linux,phandle:
>    00 00 00 33=20
>  phandle:
>    00 00 00 33=20
>=20
> # ofwdump -p /soc/pinctrl@01c20800/usb2_vbus_pin@0
> Node 0x22f4: usb2_vbus_pin@0
>  allwinner,pins:
>    50 48 33 00=20
>    'PH3'
>  allwinner,function:
>    67 70 69 6f 5f 6f 75 74 00=20
>    'gpio_out'
>  allwinner,drive:
>    00 00 00 00=20
>  allwinner,pull:
>    00 00 00 00=20
>  linux,phandle:
>    00 00 00 34=20
>  phandle:
>    00 00 00 34=20
>=20
> # ofwdump -p /soc/phy@01c19400
> Node 0x32ec: phy@01c19400
>  compatible:
>    61 6c 6c 77 69 6e 6e 65 72 2c 73 75 6e 38 69 2d 61 38 33 74=20
>    2d 75 73 62 2d 70 68 79 00=20
>    'allwinner,sun8i-a83t-usb-phy'
>  reg:
>    01 c1 94 00 00 00 00 2c 01 c1 a8 00 00 00 00 04 01 c1 b8 00=20
>    00 00 00 04=20
>  clocks:
>    00 00 00 2b 00 00 00 08 00 00 00 2b 00 00 00 09 00 00 00 2b=20
>    00 00 00 0a 00 00 00 2b 00 00 00 0b=20
>  clock-names:
>    75 73 62 30 5f 70 68 79 00 75 73 62 31 5f 70 68 79 00 68 73=20
>    69 63 5f 70 6c 6c 00 68 73 69 63 5f 31 32 6d 00=20
>  resets:
>    00 00 00 2b 00 00 00 00 00 00 00 2b 00 00 00 01 00 00 00 2b=20
>    00 00 00 02=20
>  reset-names:
>    75 73 62 30 5f 72 65 73 65 74 00 75 73 62 31 5f 72 65 73 65=20
>    74 00 75 73 62 32 5f 72 65 73 65 74 00=20
>  status:
>    6f 6b 61 79 00=20
>    'okay'
>  #phy-cells:
>    00 00 00 01=20
>  usb1_vbus-supply:
>    00 00 00 2c=20
>  linux,phandle:
>    00 00 00 2d=20
>  phandle:
>    00 00 00 2d=20
>=20
> # ofwdump -p /soc/usb@01c1a000
> Node 0x3458: usb@01c1a000
>  compatible:
>    61 6c 6c 77 69 6e 6e 65 72 2c 73 75 6e 38 69 2d 61 38 33 74=20
>    2d 65 68 63 69 00 67 65 6e 65 72 69 63 2d 65 68 63 69 00=20
>  reg:
>    01 c1 a0 00 00 00 01 00=20
>  interrupts:
>    00 00 00 00 00 00 00 48 00 00 00 04=20
>  clocks:
>    00 00 00 17 00 00 00 1a=20
>  resets:
>    00 00 00 19 00 00 00 1a=20
>  phys:
>    00 00 00 2d 00 00 00 01=20
>  phy-names:
>    75 73 62 00=20
>    'usb'
>  status:
>    6f 6b 61 79 00=20
>    'okay'
>  linux,phandle:
>    00 00 00 41=20
>  phandle:
>    00 00 00 41=20
>=20
> # ofwdump -p /soc/usb@01c1b000
> Node 0x3550: usb@01c1b000
>  compatible:
>    61 6c 6c 77 69 6e 6e 65 72 2c 73 75 6e 38 69 2d 61 38 33 74=20
>    2d 65 68 63 69 00 67 65 6e 65 72 69 63 2d 65 68 63 69 00=20
>  reg:
>    01 c1 b0 00 00 00 01 00=20
>  interrupts:
>    00 00 00 00 00 00 00 4a 00 00 00 04=20
>  clocks:
>    00 00 00 17 00 00 00 1b=20
>  resets:
>    00 00 00 19 00 00 00 1b=20
>  phys:
>    00 00 00 2d 00 00 00 02=20
>  phy-names:
>    75 73 62 00=20
>    'usb'
>  status:
>    6f 6b 61 79 00=20
>    'okay'
>  linux,phandle:
>    00 00 00 42=20
>  phandle:
>    00 00 00 42=20
>=20
> # ofwdump -p /usb0-vbus
> Node 0x39fc: usb0-vbus
>  compatible:
>    72 65 67 75 6c 61 74 6f 72 2d 66 69 78 65 64 00=20
>    'regulator-fixed'
>  pinctrl-names:
>    64 65 66 61 75 6c 74 00=20
>    'default'
>  pinctrl-0:
>    00 00 00 32=20
>  regulator-name:
>    75 73 62 30 2d 76 62 75 73 00=20
>    'usb0-vbus'
>  regulator-min-microvolt:
>    00 4c 4b 40=20
>  regulator-max-microvolt:
>    00 4c 4b 40=20
>  enable-active-high:
>  gpio:
>    00 00 00 1d 00 00 00 01 00 00 00 09 00 00 00 00=20
>  status:
>    64 69 73 61 62 6c 65 64 00=20
>    'disabled'
>  linux,phandle:
>    00 00 00 47=20
>  phandle:
>    00 00 00 47=20
>=20
> # ofwdump -p /usb1-vbus
> Node 0x3ae8: usb1-vbus
>  compatible:
>    72 65 67 75 6c 61 74 6f 72 2d 66 69 78 65 64 00=20
>    'regulator-fixed'
>  pinctrl-names:
>    64 65 66 61 75 6c 74 00=20
>    'default'
>  pinctrl-0:
>    00 00 00 33=20
>  regulator-name:
>    75 73 62 31 2d 76 62 75 73 00=20
>    'usb1-vbus'
>  regulator-min-microvolt:
>    00 4c 4b 40=20
>  regulator-max-microvolt:
>    00 4c 4b 40=20
>  regulator-boot-on:
>  enable-active-high:
>  gpio:
>    00 00 00 1d 00 00 00 03 00 00 00 18 00 00 00 00=20
>  status:
>    6f 6b 61 79 00=20
>    'okay'
>  linux,phandle:
>    00 00 00 2c=20
>  phandle:
>    00 00 00 2c=20
>=20
> # ofwdump -p /usb2-vbus
> Node 0x3bdc: usb2-vbus
>  compatible:
>    72 65 67 75 6c 61 74 6f 72 2d 66 69 78 65 64 00=20
>    'regulator-fixed'
>  pinctrl-names:
>    64 65 66 61 75 6c 74 00=20
>    'default'
>  pinctrl-0:
>    00 00 00 34=20
>  regulator-name:
>    75 73 62 32 2d 76 62 75 73 00=20
>    'usb2-vbus'
>  regulator-min-microvolt:
>    00 4c 4b 40=20
>  regulator-max-microvolt:
>    00 4c 4b 40=20
>  regulator-boot-on:
>  enable-active-high:
>  gpio:
>    00 00 00 1d 00 00 00 07 00 00 00 03 00 00 00 00=20
>  status:
>    64 69 73 61 62 6c 65 64 00=20
>    'disabled'
>  linux,phandle:
>    00 00 00 48=20
>  phandle:
>    00 00 00 48=20


I might not have found all the usb references
but the below is a start.

/usr/src/sys/boot/fdt/dts/arm/sinovoip-bpi-m3.dts has:

&ehci0 {
        status =3D "okay";
};

&ehci1 {
        status =3D "okay";
};
. . .
&reg_usb1_vbus {
        gpio =3D <&pio 3 24 GPIO_ACTIVE_HIGH>;    /* PD24 */
        status =3D "okay";
};

&usb1_vbus_pin_a {
        allwinner,pins =3D "PD24";
};

&usbphy {
        usb1_vbus-supply =3D <&reg_usb1_vbus>;
        status =3D "okay";
};

Via #include there is:

/usr/src/sys/boot/fdt/dts/arm/sun8i-a83t.dtsi has:

                bus_gates: clk@01c20060 {
                        . . .
                        clock-output-names =3D . . .
                                             "bus_spi1", "bus_usb_otg",
                                             "bus_ehci0", "bus_ehci1",
                                             "bus_ohci0", "bus_ve",
                                             . . .
                };

/usr/src/sys/gnu/dts/arm/sunxi-common-regulators.dtsi has:

&pio {
        . . .

        usb0_vbus_pin_a: usb0_vbus_pin@0 {
                pins =3D "PB9";
                function =3D "gpio_out";
        };

        usb1_vbus_pin_a: usb1_vbus_pin@0 {
                pins =3D "PH6";
                function =3D "gpio_out";
        };

        usb2_vbus_pin_a: usb2_vbus_pin@0 {
                pins =3D "PH3";
                function =3D "gpio_out";
        };
};

/ {
        . . .
        reg_usb0_vbus: usb0-vbus {
                compatible =3D "regulator-fixed";
                pinctrl-names =3D "default";
                pinctrl-0 =3D <&usb0_vbus_pin_a>;
                regulator-name =3D "usb0-vbus";
                regulator-min-microvolt =3D <5000000>;
                regulator-max-microvolt =3D <5000000>;
                enable-active-high;
                gpio =3D <&pio 1 9 GPIO_ACTIVE_HIGH>;
                status =3D "disabled";
        };

        reg_usb1_vbus: usb1-vbus {
                compatible =3D "regulator-fixed";
                pinctrl-names =3D "default";
                pinctrl-0 =3D <&usb1_vbus_pin_a>;
                regulator-name =3D "usb1-vbus";
                regulator-min-microvolt =3D <5000000>;
                regulator-max-microvolt =3D <5000000>;
                regulator-boot-on;
                enable-active-high;
                gpio =3D <&pio 7 6 GPIO_ACTIVE_HIGH>;
                status =3D "disabled";
        };

        reg_usb2_vbus: usb2-vbus {
                compatible =3D "regulator-fixed";
                pinctrl-names =3D "default";
                pinctrl-0 =3D <&usb2_vbus_pin_a>;
                regulator-name =3D "usb2-vbus";
                regulator-min-microvolt =3D <5000000>;
                regulator-max-microvolt =3D <5000000>;
                regulator-boot-on;
                enable-active-high;
                gpio =3D <&pio 7 3 GPIO_ACTIVE_HIGH>;
                status =3D "disabled";
        };

. . .

/usr/src/sys/boot/fdt/dts/arm/a83t.dtsi has:

        clocks {
                . . .

                usb_clk: clk@01c200cc {
                        #clock-cells =3D <1>;
                        #reset-cells =3D <1>;
                        compatible =3D "allwinner,sun8i-a83t-usb-clk";
                        reg =3D <0x01c200cc 0x4>;
                        clocks =3D <&osc24M>, <&pll_hsic>;
                        clock-indices =3D <8>, <9>,
                                        <10>, <11>,
                                        <16>;
                        clock-output-names =3D "usb_phy0", "usb_phy1",
                                             "usb_hsic_pll", =
"usb_hsic_12m",
                                             "usb_ohci0";
                };
. . .
        soc {
                . . .

                usbphy: phy@01c19400 {
                        compatible =3D "allwinner,sun8i-a83t-usb-phy";
                        reg =3D <0x01c19400 0x2c>,
                              <0x01c1a800 0x4>,
                              <0x01c1b800 0x4>;
                        clocks =3D <&usb_clk 8>,
                                 <&usb_clk 9>,
                                 <&usb_clk 10>,
                                 <&usb_clk 11>;
                        clock-names =3D "usb0_phy",
                                      "usb1_phy",
                                      "hsic_pll",
                                      "hsic_12m";
                        resets =3D <&usb_clk 0>,
                                 <&usb_clk 1>,
                                 <&usb_clk 2>;
                        reset-names =3D "usb0_reset",
                                      "usb1_reset",
                                      "usb2_reset";
                        status =3D "disabled";
                        #phy-cells =3D <1>;
                };
                       =20
                ehci0: usb@01c1a000 {
                        compatible =3D "allwinner,sun8i-a83t-ehci", =
"generic-ehci";
                        reg =3D <0x01c1a000 0x100>;
                        interrupts =3D <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>;
                        clocks =3D <&bus_gates 26>;
                        resets =3D <&ahb_reset 26>;
                        phys =3D <&usbphy 1>;
                        phy-names =3D "usb";
                        status =3D "disabled";
                };
                       =20
                ehci1: usb@01c1b000 {
                        compatible =3D "allwinner,sun8i-a83t-ehci", =
"generic-ehci";
                        reg =3D <0x01c1b000 0x100>;
                        interrupts =3D <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
                        clocks =3D <&bus_gates 27>;
                        resets =3D <&ahb_reset 27>;
                        phys =3D <&usbphy 2>;
                        phy-names =3D "usb";
                        status =3D "disabled";
                };



=3D=3D=3D
Mark Millard
markmi at dsl-only.net




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?A04502A5-ABEE-4F02-8924-FEAA2218702C>