svn commit: r324822 - head/sys/modules/dtb/allwinner [removal of sinovoip-bpi-m3.dts from sys/modules/dtb/allwinner/Makefile DTS list]
Mark Millard
markmi at dsl-only.net
Sun Oct 22 21:35:14 UTC 2017
My attempt to adjust code failed
massively when tested. I've no clue what
I'm doing and my guesses were clearly
wrong.
Mostly this is usb stuff but pcpu_find also
reported "cpuid too large". (BPI-M3's have
8 cores, 2 clusters of 4, but FreeBSD only
classically enabled/used 4 of the 8: one
cluster.) Not stopping at 4 lead to a panic
via ofw_cpu_attach and dpcpu_alloc.
[The ubldr worked based on having supplied
UBLDR_LOADADDR=0x42000000 to buildworld.]
Unless an active committer is going to cover
the BPI-M3 it likely needs to be dropped,
sad to say for me. (I liked having the extra
memory compared to the other cortex-a7 board
that I've access to.)
Copyright (c) 1992-2017 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 12.0-CURRENT r324743M arm
FreeBSD clang version 5.0.0 (tags/RELEASE_500/final 312559) (based on LLVM 5.0.0svn)
VT: init without driver.
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
. . . (normal looking stuff) . . .
awusbphy0: <Allwinner USB PHY> mem 0x1c19400-0x1c1942b,0x1c1a800-0x1c1a803,0x1c1b800-0x1c1b803 on simplebus0
awusbphy0: Cannot locate phy control resource
awusbphy0: failed to initialize USB PHY, error 6
device_attach: awusbphy0 attach returned 6
awusbphy0: <Allwinner USB PHY> mem 0x1c19400-0x1c1942b,0x1c1a800-0x1c1a803,0x1c1b800-0x1c1b803 on simplebus0
awusbphy0: Cannot locate phy control resource
awusbphy0: failed to initialize USB PHY, error 6
device_attach: awusbphy0 attach returned 6
gic0: <ARM Generic Interrupt Controller> mem 0x1c81000-0x1c81fff,0x1c82000-0x1c82fff,0x1c84000-0x1c85fff,0x1c86000-0x1c87fff irq 18 on simplebus0
gic0: pn 0x2, arch 0x2, rev 0x1, implementer 0x43b irqs 224
awusbphy0: <Allwinner USB PHY> mem 0x1c19400-0x1c1942b,0x1c1a800-0x1c1a803,0x1c1b800-0x1c1b803 on simplebus0
awusbphy0: Cannot locate phy control resource
awusbphy0: failed to initialize USB PHY, error 6
device_attach: awusbphy0 attach returned 6
awusbphy0: <Allwinner USB PHY> mem 0x1c19400-0x1c1942b,0x1c1a800-0x1c1a803,0x1c1b800-0x1c1b803 on simplebus0
awusbphy0: Cannot locate phy control resource
awusbphy0: failed to initialize USB PHY, error 6
device_attach: awusbphy0 attach returned 6
gpio0: <Allwinner GPIO/Pinmux controller> mem 0x1c20800-0x1c20bff irq 11,12,13 on simplebus0
gpiobus0: <OFW GPIO bus> on gpio0
gpio1: <Allwinner GPIO/Pinmux controller> mem 0x1f02c00-0x1f02fff irq 19 on simplebus0
gpiobus1: <OFW GPIO bus> on gpio1
aw_nmi0: <Allwinner NMI Controller> mem 0x1f00c0c-0x1f00c43 irq 21 on simplebus0
awusbphy0: <Allwinner USB PHY> mem 0x1c19400-0x1c1942b,0x1c1a800-0x1c1a803,0x1c1b800-0x1c1b803 on simplebus0
awusbphy0: Cannot locate phy control resource
awusbphy0: failed to initialize USB PHY, error 6
device_attach: awusbphy0 attach returned 6
axp81x_pmu0: <X-Powers AXP81x Power Management Unit> at addr 0x746 irq 29 on iicbus3
gpiobus2: <OFW GPIO bus> on axp81x_pmu0
awusbphy0: <Allwinner USB PHY> mem 0x1c19400-0x1c1942b,0x1c1a800-0x1c1a803,0x1c1b800-0x1c1b803 on simplebus0
awusbphy0: Cannot locate phy control resource
awusbphy0: failed to initialize USB PHY, error 6
device_attach: awusbphy0 attach returned 6
awusbphy0: <Allwinner USB PHY> mem 0x1c19400-0x1c1942b,0x1c1a800-0x1c1a803,0x1c1b800-0x1c1b803 on simplebus0
awusbphy0: Cannot locate phy control resource
awusbphy0: failed to initialize USB PHY, error 6
device_attach: awusbphy0 attach returned 6
awusbphy0: <Allwinner USB PHY> mem 0x1c19400-0x1c1942b,0x1c1a800-0x1c1a803,0x1c1b800-0x1c1b803 on simplebus0
awusbphy0: Cannot locate phy control resource
awusbphy0: failed to initialize USB PHY, error 6
device_attach: awusbphy0 attach returned 6
generic_timer0: <ARMv7 Generic Timer> irq 0,1,2,3 on ofwbus0
Timecounter "ARM MPCore Timecounter" frequency 24000000 Hz quality 1000
Event timer "ARM MPCore Eventtimer" frequency 24000000 Hz quality 1000
awusbphy0: <Allwinner USB PHY> mem 0x1c19400-0x1c1942b,0x1c1a800-0x1c1a803,0x1c1b800-0x1c1b803 on simplebus0
awusbphy0: Cannot locate phy control resource
awusbphy0: failed to initialize USB PHY, error 6
device_attach: awusbphy0 attach returned 6
awusbphy0: <Allwinner USB PHY> mem 0x1c19400-0x1c1942b,0x1c1a800-0x1c1a803,0x1c1b800-0x1c1b803 on simplebus0
awusbphy0: Cannot locate phy control resource
awusbphy0: failed to initialize USB PHY, error 6
device_attach: awusbphy0 attach returned 6
awusbphy0: <Allwinner USB PHY> mem 0x1c19400-0x1c1942b,0x1c1a800-0x1c1a803,0x1c1b800-0x1c1b803 on simplebus0
awusbphy0: Cannot locate phy control resource
awusbphy0: failed to initialize USB PHY, error 6
device_attach: awusbphy0 attach returned 6
awusbphy0: <Allwinner USB PHY> mem 0x1c19400-0x1c1942b,0x1c1a800-0x1c1a803,0x1c1b800-0x1c1b803 on simplebus0
awusbphy0: Cannot locate phy control resource
awusbphy0: failed to initialize USB PHY, error 6
device_attach: awusbphy0 attach returned 6
awusbphy0: <Allwinner USB PHY> mem 0x1c19400-0x1c1942b,0x1c1a800-0x1c1a803,0x1c1b800-0x1c1b803 on simplebus0
awusbphy0: Cannot locate phy control resource
awusbphy0: failed to initialize USB PHY, error 6
device_attach: awusbphy0 attach returned 6
awusbphy0: <Allwinner USB PHY> mem 0x1c19400-0x1c1942b,0x1c1a800-0x1c1a803,0x1c1b800-0x1c1b803 on simplebus0
awusbphy0: Cannot locate phy control resource
awusbphy0: failed to initialize USB PHY, error 6
device_attach: awusbphy0 attach returned 6
awusbphy0: <Allwinner USB PHY> mem 0x1c19400-0x1c1942b,0x1c1a800-0x1c1a803,0x1c1b800-0x1c1b803 on simplebus0
awusbphy0: Cannot locate phy control resource
awusbphy0: failed to initialize USB PHY, error 6
device_attach: awusbphy0 attach returned 6
cpulist0: <Open Firmware CPU Group> on ofwbus0
cpu0: <Open Firmware CPU> on cpulist0
cpufreq_dt0: <Generic cpufreq driver> on cpu0
cpu1: <Open Firmware CPU> on cpulist0
cpu2: <Open Firmware CPU> on cpulist0
cpu3: <Open Firmware CPU> on cpulist0
cpu4: <Open Firmware CPU> on cpulist0
panic: pcpu_find: cpuid too large
cpuid = 0
Note the attempt to try cpu4 after
cpus 0-3. FreeBSD is no longer stopping
at its own self-imposed limit of 4
cores (one of the 2 clusters).
NOTE:
The BPI-M3 is not BIG-little: all the
cores are the same type: cortex-a7's.
It looks like having BPI-M3 supported
would be a notable effort by someone
the proper background.
The details for what I tried follow but
I know so little for this type of activity
that the material is likely of little or no
use. Nothing below is targeting stopping
at 4 cores: that was a surprise.
The later greps of the -r324743 based sorted .dts
produced from the .dtb shows references to:
usb0-vbus
usb1-vbus
usb2-vbus
I think that is the 2 USB ports and the SATA
that is via a USB bridge as I understand. (It
is known for not being fast because of this
structure.)
The clock-output-names list includes:
"bus_usb_otg", "bus_ehci0", "bus_ehci1", "bus_ohci0",
But there are only 2 or 3 usb resets?:
fixup = "/soc/usb at 01c1a000:resets:0";
. . .
fixup = "/soc/usb at 01c1b000:resets:0";
. . .
reset-names = "usb0_reset", "usb1_reset", "usb2_reset";
and 2 phys if I understand right (that show up various
ways):
fixup = "/soc/usb at 01c1a000:phys:0";
. . .
fixup = "/soc/usb at 01c1b000:phys:0";
. . .
clock-output-names = "usb_phy0", "usb_phy1", "usb_hsic_pll", "usb_hsic_12m", "usb_ohci0";
. . .
clock-names = "usb0_phy", "usb1_phy", "hsic_pll", "hsic_12m";
. . .
usb at 01c1a000 {
phy-names = "usb";
usb at 01c1b000 {
phy-names = "usb";
Although there is the following as well:
fixup = "/soc/phy at 01c19400:usb1_vbus-supply:0";
. . .
usbphy = "/soc/phy at 01c19400";
I have no clue for it.
As stands I'm testing based on my guesses for
.num_phys , .pmu_unk1 , and .phy0_route below.
I do not know how to confirm or find what the
values should be.
# svnlite diff /usr/src/sys/arm/allwinner/aw_usbphy.c
Index: /usr/src/sys/arm/allwinner/aw_usbphy.c
===================================================================
--- /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 = false,
};
+static const struct aw_usbphy_conf a83t_usbphy_conf = {
+ .num_phys = 2, // ???? SATA via USB too? ????
+ .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 }
The details for the greps:
# grep -i usb /root/bpi-m3-sorted-324743.dts | more
fixup = "/soc/phy at 01c19400:usb1_vbus-supply:0";
fixup = "/soc/usb at 01c1a000:clocks:0";
fixup = "/soc/usb at 01c1a000:resets:0";
fixup = "/soc/usb at 01c1a000:phys:0";
fixup = "/soc/usb at 01c1b000:clocks:0";
fixup = "/soc/usb at 01c1b000:resets:0";
fixup = "/soc/usb at 01c1b000:phys:0";
fixup = "/usb0-vbus:pinctrl-0:0";
fixup = "/usb0-vbus:gpio:0";
fixup = "/usb1-vbus:pinctrl-0:0";
fixup = "/usb1-vbus:gpio:0";
fixup = "/usb2-vbus:pinctrl-0:0";
fixup = "/usb2-vbus:gpio:0";
ehci0 = "/soc/usb at 01c1a000";
ehci1 = "/soc/usb at 01c1b000";
reg_usb0_vbus = "/usb0-vbus";
reg_usb1_vbus = "/usb1-vbus";
reg_usb2_vbus = "/usb2-vbus";
usb0_vbus_pin_a = "/soc/pinctrl at 01c20800/usb0_vbus_pin at 0";
usb1_vbus_pin_a = "/soc/pinctrl at 01c20800/usb1_vbus_pin at 0";
usb2_vbus_pin_a = "/soc/pinctrl at 01c20800/usb2_vbus_pin at 0";
usb_clk = "/clocks/clk at 01c200cc";
usbphy = "/soc/phy at 01c19400";
clock-output-names = "bus_mipidsi", "bus_ss", "bus_dma", "bus_mmc0", "bus_mmc1", "bus_mmc2", "bus_nand", "bus_sdram", "bus_emac", "bus_hstimer", "bus_spi0", "bus_spi1", "bus_usb_otg", "bus_ehci0", "bus_ehci1", "bus_ohci0", "bus_ve", "bus_lcd0", "bus_lcd1", "bus_csi", "bus_hdmi", "bus_de", "bus_gpu", "bus_msgbox", "bus_spinlock", "bus_spdif", "bus_pio", "bus_i2s0", "bus_i2s1", "bus_i2s2", "bus_tdm", "bus_i2c0", "bus_i2c1", "bus_i2c2", "bus_uart0", "bus_uart1", "bus_uart2", "bus_uart3", "bus_uart4";
clock-output-names = "usb_phy0", "usb_phy1", "usb_hsic_pll", "usb_hsic_12m", "usb_ohci0";
compatible = "allwinner,sun8i-a83t-usb-clk";
clock-names = "usb0_phy", "usb1_phy", "hsic_pll", "hsic_12m";
compatible = "allwinner,sun8i-a83t-usb-phy";
reset-names = "usb0_reset", "usb1_reset", "usb2_reset";
usb1_vbus-supply = <0x2c>;
usb0_vbus_pin at 0 {
usb1_vbus_pin at 0 {
usb2_vbus_pin at 0 {
usb at 01c1a000 {
phy-names = "usb";
usb at 01c1b000 {
phy-names = "usb";
usb0-vbus {
regulator-name = "usb0-vbus";
usb1-vbus {
regulator-name = "usb1-vbus";
usb2-vbus {
regulator-name = "usb2-vbus";
# grep -i hci /root/bpi-m3-sorted-324743.dts | more
fixup = "/ahci-5v:pinctrl-0:0";
fixup = "/ahci-5v:gpio:0";
ahci_pwr_pin_a = "/soc/pinctrl at 01c20800/ahci_pwr_pin at 0";
ehci0 = "/soc/usb at 01c1a000";
ehci1 = "/soc/usb at 01c1b000";
reg_ahci_5v = "/ahci-5v";
ahci-5v {
regulator-name = "ahci-5v";
clock-output-names = "bus_mipidsi", "bus_ss", "bus_dma", "bus_mmc0", "bus_mmc1", "bus_mmc2", "bus_nand", "bus_sdram", "bus_emac", "bus_hstimer", "bus_spi0", "bus_spi1", "bus_usb_otg", "bus_ehci0", "bus_ehci1", "bus_ohci0", "bus_ve", "bus_lcd0", "bus_lcd1", "bus_csi", "bus_hdmi", "bus_de", "bus_gpu", "bus_msgbox", "bus_spinlock", "bus_spdif", "bus_pio", "bus_i2s0", "bus_i2s1", "bus_i2s2", "bus_tdm", "bus_i2c0", "bus_i2c1", "bus_i2c2", "bus_uart0", "bus_uart1", "bus_uart2", "bus_uart3", "bus_uart4";
clock-output-names = "usb_phy0", "usb_phy1", "usb_hsic_pll", "usb_hsic_12m", "usb_ohci0";
ahci_pwr_pin at 0 {
compatible = "allwinner,sun8i-a83t-ehci", "generic-ehci";
compatible = "allwinner,sun8i-a83t-ehci", "generic-ehci";
===
Mark Millard
markmi at dsl-only.net
More information about the freebsd-arm
mailing list