Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Nov 2017 23:06:41 -0800
From:      Mark Millard <markmi@dsl-only.net>
To:        Warner Losh <imp@bsdimp.com>, Freebsd-arm <freebsd-arm@freebsd.org>
Cc:        Kyle Evans <kevans@freebsd.org>
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>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8ECC1284-8843-420E-8496-9F33DF979A02>