From owner-freebsd-hackers@freebsd.org Tue Oct 24 03:43:55 2017 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09E87E3B113 for ; Tue, 24 Oct 2017 03:43:55 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-211-164.reflexion.net [208.70.211.164]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC80E6D97E for ; Tue, 24 Oct 2017 03:43:53 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 15101 invoked from network); 24 Oct 2017 03:43:52 -0000 Received: from unknown (HELO mail-cs-01.app.dca.reflexion.local) (10.81.19.1) by 0 (rfx-qmail) with SMTP; 24 Oct 2017 03:43:52 -0000 Received: by mail-cs-01.app.dca.reflexion.local (Reflexion email security v8.40.3) with SMTP; Mon, 23 Oct 2017 23:43:52 -0400 (EDT) Received: (qmail 22553 invoked from network); 24 Oct 2017 03:43:52 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 24 Oct 2017 03:43:52 -0000 Received: from [192.168.1.25] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id 6EAD9EC7848; Mon, 23 Oct 2017 20:43:51 -0700 (PDT) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: BPI-M3 booted via a variant of head -r324743 with an external ECHI USB root file system: what I changed to have it happen Date: Mon, 23 Oct 2017 20:43:50 -0700 References: <3AD6B1F8-512C-43BB-AC76-7721454AD02F@dsl-only.net> <20171021195812.5bdb902401b8e756b6abfe40@bidouilliste.com> <20171021204356.47e3cd6066144bcd07f46699@bidouilliste.com> <50728566-11C2-45EB-8367-00CAF38D4548@dsl-only.net> <8696CCFA-AE7D-4324-90A8-BB73402FA124@dsl-only.net> <06B9A4AD-EA28-41A8-91B9-FE368EF622FE@dsl-only.net> <68CB464E-6FC6-4CB9-963B-9E7A683041EB@dsl-only.net> To: Emmanuel Vadot , freebsd-arm , freebsd-hackers In-Reply-To: Message-Id: <17D6B79E-F7AF-4395-B8A2-2CE9A5157ABF@dsl-only.net> X-Mailer: Apple Mail (2.3273) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Oct 2017 03:43:55 -0000 [This largely ignores my questions about mp_ncpu <=3D cpuid happening when there are 4 unused cores (of 8), as there are for the BPI-M3's A83T support.] For head -r324743, by making: sys/boot/fdt/dts/arm/a83t.dtsi slightly more modern (reg-names, phy_ctrl, pmu0, and pmu1) and putting in my guesses for A83T in: /usr/src/sys/arm/allwinner/aw_usbphy.c I've gotten -r324743 to boot with a root file system on an external USB drive in ECHI mode. I've tried both USB ports and both have worked as ECHI for this. The changes: # svnlite diff /usr/src/sys/boot/fdt/dts/arm/a83t.dtsi Index: /usr/src/sys/boot/fdt/dts/arm/a83t.dtsi =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- /usr/src/sys/boot/fdt/dts/arm/a83t.dtsi (revision 324743) +++ /usr/src/sys/boot/fdt/dts/arm/a83t.dtsi (working copy) @@ -179,6 +179,9 @@ reg =3D <0x01c19400 0x2c>, <0x01c1a800 0x4>, <0x01c1b800 0x4>; + reg-names =3D "phy_ctrl", + "pmu0", + "pmu1"; clocks =3D <&usb_clk 8>, <&usb_clk 9>, <&usb_clk 10>, Other than some include file usage, the BPI-M3 is not and has not been using sys/gnu/dts/ files. The above makes the .dtb that FreeBSD produces be something that the modern kernel will not reject parts of. # svnlite diff /usr/src*/sys/arm/allwinner/aw_usbphy.c Index: /usr/src/sys/arm/allwinner/aw_usbphy.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- /usr/src/sys/arm/allwinner/aw_usbphy.c (revision 324743) +++ /usr/src/sys/arm/allwinner/aw_usbphy.c (working copy) @@ -58,6 +58,7 @@ AWUSBPHY_TYPE_A13, AWUSBPHY_TYPE_A20, AWUSBPHY_TYPE_A31, + AWUSBPHY_TYPE_A83T, AWUSBPHY_TYPE_H3, AWUSBPHY_TYPE_A64 }; @@ -90,6 +91,13 @@ .phy0_route =3D false, }; =20 +static const struct aw_usbphy_conf a83t_usbphy_conf =3D { + .num_phys =3D 3, // SATA via USB bridge as well + .phy_type =3D AWUSBPHY_TYPE_A83T, + .pmu_unk1 =3D false, // ???? + .phy0_route =3D true, // ???? +}; + static const struct aw_usbphy_conf a31_usbphy_conf =3D { .num_phys =3D 3, .phy_type =3D AWUSBPHY_TYPE_A31, @@ -116,6 +124,7 @@ { "allwinner,sun5i-a13-usb-phy", = (uintptr_t)&a13_usbphy_conf }, { "allwinner,sun6i-a31-usb-phy", = (uintptr_t)&a31_usbphy_conf }, { "allwinner,sun7i-a20-usb-phy", = (uintptr_t)&a20_usbphy_conf }, + { "allwinner,sun8i-a83t-usb-phy", = (uintptr_t)&a83t_usbphy_conf }, { "allwinner,sun8i-h3-usb-phy", = (uintptr_t)&h3_usbphy_conf }, { "allwinner,sun50i-a64-usb-phy", = (uintptr_t)&a64_usbphy_conf }, { NULL, 0 } The SATA is why there are 3 USB phys for the BPI-M3 instead of 2. The root filesystem is on: da0: Fixed Direct Access SPC-4 SCSI device da0: Serial Number da0: 40.000MB/s transfers da0: 228936MB (468862128 512 byte sectors) da0: quirks=3D0x2 One new thing is: module_register: cannot register simplebus/ahci from kernel; already = loaded from kernel Module simplebus/ahci failed to register: 17 module_register: cannot register simplebus/ehci from kernel; already = loaded from kernel Module simplebus/ehci failed to register: 17 module_register: cannot register simplebus/pcib from kernel; already = loaded from kernel Module simplebus/pcib failed to register: 17 module_register: cannot register simplebus/ehci from kernel; already = loaded from kernel Module simplebus/ehci failed to register: 17 I've not figured out what those messages are about yet. There is also: real memory =3D 2147483648 (2048 MB) avail memory =3D 2089332736 (1992 MB) FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs vs. cpulist0: on ofwbus0 cpu0: on cpulist0 cpufreq_dt0: on cpu0 cpu1: on cpulist0 cpu2: on cpulist0 cpu3: on cpulist0 cpu4: on cpulist0 cpufreq_dt1: on cpu4 cpufreq_dt1: no regulator for cpu@100 device_attach: cpufreq_dt1 attach returned 6 cpu5: on cpulist0 cpu6: on cpulist0 cpu7: on cpulist0 My understanding is: only the first cluster of 4 cores is supposed to be active/used and the 2nd cluster is supposed to not be in active use. I'm not sure that the 2nd cluster is being handled as intended, or what the intended details are. But top does show only 4. An old thing is still true: a10_mmc1: error rint: 0x00000100 a10_mmc1: error rint: 0x00000100 a10_mmc1: error rint: 0x00000100 a10_mmc1: error rint: 0x00000100 a10_mmc1: error rint: 0x00000100 a10_mmc1: error rint: 0x00000100 a10_mmc1: error rint: 0x00000100 a10_mmc1: error rint: 0x00000100 a10_mmc1: error rint: 0x00008018 a10_mmc1: error rint: 0x00000100 a10_mmc1: error rint: 0x00000100 a10_mmc1: error rint: 0x00000100 a10_mmc1: error rint: 0x00000100 mmcsd1: 8GB at = mmc1 52.0MHz/8bit/65535-block mmcsd1boot0: 4MB partion 1 at mmcsd1 mmcsd1boot1: 4MB partion 2 at mmcsd1 mmcsd1rpmb: 524kB partion 3 at mmcsd1 FYI: # uname -apKU FreeBSD bpim3 12.0-CURRENT FreeBSD 12.0-CURRENT r324743M arm armv7 = 1200051 1200051 =3D=3D=3D Mark Millard markmi at dsl-only.net