head -r325700: BPI-M3 u-boot vs. FreeBSD kernel/loader and finding sinovoip-bpi-m3.dtb: fails [ -r324743 head worked]

Mark Millard markmi at dsl-only.net
Sun Nov 12 07:06:50 UTC 2017


On a BPI-M3 in u-boot:

=> printenv
. . .
fdt_addr_r=0x43000000
fdtcontroladdr=bbf42f68
fdtfile=sinovoip-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="/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="/boot/dtb/sinovoip-bpi-m3.dtb"

(The above is new and previously nothing
like it was needed.)

I use:

WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x42000000"

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
===================================================================
--- /usr/src/sys/modules/dtb/allwinner/Makefile	(revision 325700)
+++ /usr/src/sys/modules/dtb/allwinner/Makefile	(working copy)
@@ -3,6 +3,7 @@
DTS=	\
	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
===================================================================
--- /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 = <0x01c19400 0x2c>,
			      <0x01c1a800 0x4>,
			      <0x01c1b800 0x4>;
+			reg-names = "phy_ctrl",
+				    "pmu1",
+				    "pmu2";
			clocks = <&usb_clk 8>,
				 <&usb_clk 9>,
				 <&usb_clk 10>,
Index: /usr/src/sys/arm/allwinner/aw_usbphy.c
===================================================================
--- /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 = false,
};

+static const struct aw_usbphy_conf a83t_usbphy_conf = {
+	.num_phys = 3, // USB-DRD/OTG and 2 USB hosts
+	.phy_type = AWUSBPHY_TYPE_A83T,
+	.pmu_unk1 = false,
+	.phy0_route = false,
+};
+
static const struct aw_usbphy_conf a31_usbphy_conf = {
	.num_phys = 3,
	.phy_type = 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 }



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



More information about the freebsd-arm mailing list