From owner-freebsd-arm@freebsd.org Sun Nov 12 07:06:50 2017 Return-Path: Delivered-To: freebsd-arm@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 0E419E6AA5E for ; Sun, 12 Nov 2017 07:06:50 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-109.reflexion.net [208.70.210.109]) (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 B62F77F02F for ; Sun, 12 Nov 2017 07:06:48 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 5760 invoked from network); 12 Nov 2017 07:06:42 -0000 Received: from unknown (HELO mail-cs-02.app.dca.reflexion.local) (10.81.19.2) by 0 (rfx-qmail) with SMTP; 12 Nov 2017 07:06:42 -0000 Received: by mail-cs-02.app.dca.reflexion.local (Reflexion email security v8.40.3) with SMTP; Sun, 12 Nov 2017 02:06:42 -0500 (EST) Received: (qmail 28481 invoked from network); 12 Nov 2017 07:06:42 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 12 Nov 2017 07:06:42 -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 AE65EEC9024; Sat, 11 Nov 2017 23:06:41 -0800 (PST) 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: head -r325700: BPI-M3 u-boot vs. FreeBSD kernel/loader and finding sinovoip-bpi-m3.dtb: fails [ -r324743 head worked] Message-Id: <8ECC1284-8843-420E-8496-9F33DF979A02@dsl-only.net> Date: Sat, 11 Nov 2017 23:06:41 -0800 Cc: Kyle Evans To: Warner Losh , Freebsd-arm X-Mailer: Apple Mail (2.3273) X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Nov 2017 07:06:50 -0000 On a BPI-M3 in u-boot: =3D> printenv . . . fdt_addr_r=3D0x43000000 fdtcontroladdr=3Dbbf42f68 fdtfile=3Dsinovoip-bpi-m3.dtb . . . But for -r325700 /boot/dtb/sinovoip-bpi-m3.dtb was not found (unlike for -r324743 where the BPI-M3 had been before): No valid device tree blob found! To work around the lack of finding the file, in /boot/loader.conf I added: fdt_file=3D"/boot/dtb/sinovoip-bpi-m3.dtb" sysutils/u-boot-sinovoip-bpi-m3 has not changed in 10 months and that was for Makefile issues. Its core material is unchanged from when it was created. And I'd not updated and, so, was using the same version as before (when the BPI-M3 was at -r324743). It would appear that the change(s) must be on the FreeBSD side of things someplace. Does it look like something that would be BPI-M3 specific? I'd guess not. Notes (if you care): As of -r324822 the BPI-M3 is officially unsupported: its .dts file was removed from: sys/modules/dtb/allwinner/Makefile Things are progressing towards use of Linux .dts files but are not there yet. I'd been able to keep going with a few local changes. Overall the things I'm now doing to keep the BPI-M3 going in my local environment are. . . In /boot/loader.conf : fdt_file=3D"/boot/dtb/sinovoip-bpi-m3.dtb" (The above is new and previously nothing like it was needed.) I use: WORLD_FLAGS=3D"${WORLD_FLAGS} UBLDR_LOADADDR=3D0x42000000" during builds and the BPI-M3 boots via ubldr . (sysutils/u-boot-sinovoip-bpi-m3 is old, not modern, although I've not tried to force ubldr.bin use to see if it would work.) # svnlite diff /usr/src/sys/modules/dtb/allwinner/Makefile = /usr/src/sys/boot/fdt/dts/arm/a83t.dtsi = /usr/src/sys/arm/allwinner/aw_usbphy.c Index: /usr/src/sys/modules/dtb/allwinner/Makefile =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/modules/dtb/allwinner/Makefile (revision 325700) +++ /usr/src/sys/modules/dtb/allwinner/Makefile (working copy) @@ -3,6 +3,7 @@ DTS=3D \ nanopi-neo.dts \ orangepi-plus-2e.dts \ + sinovoip-bpi-m3.dts \ sun4i-a10-cubieboard.dts \ sun4i-a10-olinuxino-lime.dts \ sun6i-a31s-sinovoip-bpi-m2.dts \ 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 325700) +++ /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", + "pmu1", + "pmu2"; clocks =3D <&usb_clk 8>, <&usb_clk 9>, <&usb_clk 10>, 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 325700) +++ /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, }; +static const struct aw_usbphy_conf a83t_usbphy_conf =3D { + .num_phys =3D 3, // USB-DRD/OTG and 2 USB hosts + .phy_type =3D AWUSBPHY_TYPE_A83T, + .pmu_unk1 =3D false, + .phy0_route =3D false, +}; + 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 } =3D=3D=3D Mark Millard markmi at dsl-only.net