Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

erro recompile u-boot-with-spl.bin h616 #11

Open
jmsvigno opened this issue Nov 6, 2023 · 5 comments
Open

erro recompile u-boot-with-spl.bin h616 #11

jmsvigno opened this issue Nov 6, 2023 · 5 comments

Comments

@jmsvigno
Copy link

jmsvigno commented Nov 6, 2023

I'm trying to compile - u-boot-with-spl.bin with the dtb that I extracted from the device, but when trying to do this it takes as a base other dtbs marked with an asterisk and the error below appears, I've already tried to modify everything way but the error always appears:

CC net/net.o
CC net/ping.o
CC net/tftp.o
AR net/built-in.o
LDS u-boot.lds
LD u-boot
OBJCOPY u-boot.srec
OBJCOPY u-boot-nodtb.bin
RELOC u-boot-nodtb.bin

  • DTC arch/arm/dts/sun50i-h616-orangepi-zero2.dtb *
  • DTC arch/arm/dts/sun50i-h616-x96-mate.dtb *
    DTC arch/arm/dts/box-novembro.dtb
    arch/arm/dts/box-novembro.dtb: ERROR (path_references): /aliases: Reference to non-existent node or label "mmc0"
@apritzel
Copy link
Owner

apritzel commented Nov 6, 2023

Sorry, but taking the DTB from the vendor firmware won't work: Allwinner's DTs are not compliant to the mainline bindings, and Allwinner has a very different understanding of how this should work. So the DTs would be vastly different.
The particular error comes from a missing "mmc0" label, which U-Boot looks for. You could define a dummy node to make the compiler happy, but it will not work in any case, as U-Boot probably won't find any devices, and the kernel not as well.
The other two DTBs appear because U-Boot always compiles all DTs for a certain SoC, but then only includes the one selected in the defconfig, so this is normal.
What is this box, exactly? Some of those Chinese TV boxes, with an H616 or H618 chip? And do you know which PMIC it uses? Your best chance would probably be to copy one of the existing mainline DTs: for an older H616 TV box, with an AXP305: the X96 Mate one, for a newer box (with H618 and AXP313) the OrangePi Zero3 one.
Please note that blindly copying a DT is dangerous, though, as the box might be different in some aspect, and there is some (though rather slim) chance of damaging the box.

If you upload information somewhere, namely the DTB you extracted, maybe a pointer to a recovery image, and a vendor firmware bootlog (over serial), I could help you out with a tailored mainline compatible DT. The best would be actually to create a page in our wiki, then others can contribute and all information is in one place.

@jmsvigno
Copy link
Author

jmsvigno commented Nov 6, 2023

@apritzel my box tv is an ik316, is the same h616 with emcp chip. I've been trying to solve 2 problems for a long time: the boot problem with the TVbox's EMMC, as you already said, the network card problem and the WiFi problem, which still doesn't work. My idea was to compile it with the supplier's DTB to solve the problem. internal emmc problem. and use this dtb to solve the network and wifi problem when booting Linux, I'm using a compilation of Armbian that I created because I had to disable the thermal gpu, for now so it doesn't keep rebooting. The dtb that I saw on the Android box TV is below.
box.dts.txt
my picture of box tv
WhatsApp Image 2023-08-16 at 13 33 27

error on boot dwmac
[ 4.069743] dwmac-sun8i 5030000.ethernet: IRQ eth_wake_irq not found
[ 4.076377] dwmac-sun8i 5030000.ethernet: IRQ eth_lpi not found
[ 4.083286] dwmac-sun8i 5030000.ethernet: supply phy-io not found, using dummy regulator
[ 4.100672] dwmac-sun8i 5030000.ethernet: Cannot get CSR clock
[ 4.106651] dwmac-sun8i 5030000.ethernet: PTP uses main clock
[ 4.112642] dwmac-sun8i 5030000.ethernet: Current syscon value is not the default 58000 (expect 50000)
[ 4.124767] dwmac-sun8i 5030000.ethernet: No HW DMA feature register supported
[ 4.132361] dwmac-sun8i 5030000.ethernet: RX Checksum Offload Engine supported
[ 4.139719] dwmac-sun8i 5030000.ethernet: COE Type 2
[ 4.144758] dwmac-sun8i 5030000.ethernet: TX Checksum insertion supported
[ 4.151709] dwmac-sun8i 5030000.ethernet: Normal descriptors
[ 4.157482] dwmac-sun8i 5030000.ethernet: Chain mode enabled
[ 4.390975] dwmac-sun8i 5030000.ethernet end0: renamed from eth0
[ 24.443809] dwmac-sun8i 5030000.ethernet end0: Register MEM_TYPE_PAGE_POOL RxQ-0
[ 24.446626] dwmac-sun8i 5030000.ethernet end0: validation of rmii with support 00000000,00000000,00006280 and advertisement 00000000,00000000,00006280 failed: -EINVAL
[ 24.447009] dwmac-sun8i 5030000.ethernet end0: __stmmac_open: Cannot attach to PHY (error: -22)
[ 25.690680] dwmac-sun8i 5030000.ethernet end0: Register MEM_TYPE_PAGE_POOL RxQ-0
[ 25.693234] dwmac-sun8i 5030000.ethernet end0: validation of rmii with support 00000000,00000000,00006280 and advertisement 00000000,00000000,00006280 failed: -EINVAL
[ 25.693542] dwmac-sun8i 5030000.ethernet end0: __stmmac_open: Cannot attach to PHY (error: -22)
[ 25.971804] dwmac-sun8i 5030000.ethernet end0: Register MEM_TYPE_PAGE_POOL RxQ-0
[ 25.974732] dwmac-sun8i 5030000.ethernet end0: validation of rmii with support 00000000,00000000,00006280 and advertisement 00000000,00000000,00006280 failed: -EINVAL
[ 25.975118] dwmac-sun8i 5030000.ethernet end0: __stmmac_open: Cannot attach to PHY (error: -22)
[ 26.203391] dwmac-sun8i 5030000.ethernet end0: Register MEM_TYPE_PAGE_POOL RxQ-0
[ 26.206244] dwmac-sun8i 5030000.ethernet end0: validation of rmii with support 00000000,00000000,00006280 and advertisement 00000000,00000000,00006280 failed: -EINVAL
[ 26.206568] dwmac-sun8i 5030000.ethernet end0: __stmmac_open: Cannot attach to PHY (error: -22)
[ 26.345495] dwmac-sun8i 5030000.ethernet end0: Register MEM_TYPE_PAGE_POOL RxQ-0
[ 26.347990] dwmac-sun8i 5030000.ethernet end0: validation of rmii with support 00000000,00000000,00006280 and advertisement 00000000,00000000,00006280 failed: -EINVAL
[ 26.348602] dwmac-sun8i 5030000.ethernet end0: __stmmac_open: Cannot attach to PHY (error: -22)

for ok boot i used ths dtb:
sun50i-h616-x96-mate.dts.txt

@apritzel
Copy link
Owner

apritzel commented Nov 8, 2023

Thanks for the info, I will have a closer look later. In general you cannot use the vendor DTB directly to solve any problem with mainline based code, as those two DT versions are incompatible. You (or I) can look into the vendor DTB, though, to deduce what the mainline based DT should look like.

The issue with the PHY is that the OrangePi Zero3 uses an external Gigabit PHY, whereas all those TV boxes rely on the SoC-internal PHY (only 100Mbit/s). This PHY is not supported in mainline, but Armbian carries some early patches which were sketched out a while ago. Please use the X96 Mate DT as a base, that should be closer to your box.

Can you also please check your uploaded box.dts.txt again? That downloads as a 0 byte sized file for me.

@jmsvigno
Copy link
Author

jmsvigno commented Nov 8, 2023

Thanks for the info, I will have a closer look later. In general you cannot use the vendor DTB directly to solve any problem with mainline based code, as those two DT versions are incompatible. You (or I) can look into the vendor DTB, though, to deduce what the mainline based DT should look like.

The issue with the PHY is that the OrangePi Zero3 uses an external Gigabit PHY, whereas all those TV boxes rely on the SoC-internal PHY (only 100Mbit/s). This PHY is not supported in mainline, but Armbian carries some early patches which were sketched out a while ago. Please use the X96 Mate DT as a base, that should be closer to your box.

Can you also please check your uploaded box.dts.txt again? That downloads as a 0 byte sized file for me.

box.dts.txt

@jmsvigno
Copy link
Author

jmsvigno commented Nov 8, 2023

about emac:

Well, sorry for the excess of questions, but I bought an older kernel version 5.16 with Debian 10 (https://github.com/dumtux/Allwinner-H616) and tried to use the dtb versions of miniarch, since miniarch doesn't load even after changing u-boot. and now the ehternet errors have changed.

[5.255047] dwmac-sun8i 5030000.ethernet: IRQ eth_wake_irq not found
[5.267370] dwmac-sun8i 5030000.ethernet: IRQ eth_lpi not found
[5.275686] dwmac-sun8i 5030000.ethernet: supply phy-io not found, using dummy regulator
[5.285285] dwmac-sun8i 5030000.ethernet: PTP uses main clock
[ 5.291527] dwmac-sun8i 5030000.ethernet: Current syscon value is not the default 58000 (expect 0)
[ 5.314403] dwmac-sun8i 5030000.ethernet: No HW DMA feature register supported
[5.321947] dwmac-sun8i 5030000.ethernet: RX Checksum Offload Engine supported
[5.329373] dwmac-sun8i 5030000.ethernet: COE Type 2
[ 5.334493] dwmac-sun8i 5030000.ethernet: TX Checksum insertion supported
[5.341445] dwmac-sun8i 5030000.ethernet: Normal descriptors
[5.347391] dwmac-sun8i 5030000.ethernet: Chain mode enabled
[5.522650] dwmac-sun8i 5030000.ethernet: EMAC reset timeout
[5.528749] dwmac-sun8i 5030000.ethernet eth0: stmmac_dvr_remove: removing driver

I already tried changing the syscom settings, but there was no change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants