[BPI-R2] current uboot-support

Hi,

i decided to create a thread for bpi-r2 uboot-support, because a similar thread exists for r64…

last i have merged xhci v5 series which is about to be merged to 2020-07 and created a dts for mt7623/r2

https://github.com/frank-w/u-boot/commits/2020-04-bpi-xhciv5

the initialization works and roothub seems to be found, but driver itself does not yet support version <1 (r2 has 0.96). i hope i get a Patch for adding the support…

2 Likes

If this is merged then u-boot support for BPi-R2 is mostly done or the are still missing features ?

Imho for r2 all bootloader-relevant things are in if i get this working

1 Like

Hi All

I bought my first BPI-R2 recently and trying to make my home gateway/router. I’ve installed Frank’s deb_stretch_4.14.80_SD.img build on the SD card. BPI works but I stuck on the new kernel image. (I don;t have debug uart yet)

I’ve built new kernel image from the 4.14-main (4.14.174) branch and installed into sdcard. My /boot/bananapi/bpi-r2/linux/uImage was updated - but after restart ‘factory kernel’ was started (4.14.80) I was able to start my kernel only when I have replaced uImage_4.14.80 with my own kernel. I don’t see boot menu on my hdmi monitor and I cant choose anything.

My uEnv.txt is:

kernel=uImage
kernel414=uImage_4.14.80
kernel418=uImage_4.18.18
kernel419=uImage_4.19.1
kernel418mne=uImage_4.14.174

root=/dev/mmcblk0p2 rootfstype=ext4 rootwait
console=earlyprintk console=tty1 fbcon=map:0 console=ttyS0,115200
graphic=video=1280x1024

lskernel=ls ${device} ${partition} ${bpi}/${board}/${service};
askkernel=askenv kernelinput "enter uImage-name:";

boot0=run lskernel;run askkernel;if printenv kernelinput ;then setenv kernel ${kernelinput}; run newboot; fi
bootmenu_0=1. Enter kernel-name to boot from SD/EMMC.=run boot0

boot1=setenv kernel ${kernel414}; run newboot;
boot2=setenv kernel ${kernel419}; run newboot;
boot3=setenv kernel ${kernel418}; run newboot;
boot4=setenv kernel ${kernel418mne}; run newboot;

bootmenu_1=2. Boot from SD/EMMC 4.14.=run boot1
bootmenu_2=3. Boot from SD/EMMC 4.19.=run boot2
bootmenu_3=4. Boot from SD/EMMC 4.18.=run boot3
bootmenu_4=5. Boot from SD/EMMC 4.18plus.=run boot4`

How to change BPI-R2 to use kernel=uImage again, please help.

BR, Marcin

It looks like you override my bootmenu and bootcommands…it’s hard to do without debug-uart…

As far as i see you have not changed default selected menu-entry and this should be 2…this uses variable kernel419 so try set this to your new kernel-binary

Yes - I’ve modified your file . What command should I add in uEnv.txt to change default selected menu entry ?

bootmenu_default=2

If this does not work you should get debug-uart cable…hdmi is only available after kernel supporting it is loaded and your graphic settings are right (and resolution supported). On uart you see full boot process

Nope it doesn;t work. Green LED flashes. Only bootmenu_default=1 works I’ll try to buy USB-UART converter

BR,

Bootmenu_default=2 is default…of course you need to set it to your value…to use kernel414 it needs to be set to 1

Do not buy an profilic-adapter…i made good experiences with cp21xx

Hi

I got my cp21xx and was able to see … the typo in config. Sorry for bothering you.

Now I’m fighting with the " [BPI-R2 slow ethernet speed]" (a few kB when routing through the box. Will try the 5.4 kernel.

BR,

Hi Frank, I’m trying to catch up with what’s new w.r.t. BPi-R2 on the u-boot side since I last built it back in Nov 2019. I believe at that moment I’ve been using 2019-01 with a subset of your patches. Looks like these days on the bleeding edge front we’re nearing 2020-07 release and I don’t have any idea what is currently considered to be “stable” release of u-boot to be used with BPi-R2.

May I ask you for a quick status update on what is where? For example, do we have all the required pieces landed to the upstream to be able to build directly from upstream repo without any additional patches?

Ethernet driver changed to support also mt7531/r64 should be most important change…xhci not yet working so my patches should only add environment,build.sh and menu patch for supporting more than 10 entries with shortcut

Right,try a recent 5.4 which has phylink-patches in and trgmii-fixes. Make sure you have no soldering issues on your board (ethernet ports)

Okay, so I had tried to use ahci with new u-boot and I guess I had found a bug.

Here is what happens when I try to enumerate PCI bus on a board without anything inserted into miniPCIe slot:

BPI-R2> pci
No such bus
BPI-R2> pci enum
Port0 link down

And then board gets rebooted by watchdog after some time. But as soon as I insert an external wifi card into miniPCIe slot things start to work fine:

BPI-R2> pci enum
BPI-R2> pci
Scanning PCI devices on bus 0
BusDevFun  VendorId   DeviceId   Device Class       Sub-Class
_____________________________________________________________
00.00.00   0x14c3     0x0801     Bridge device           0x04
00.01.00   0x14c3     0x0801     Bridge device           0x04
BPI-R2> scsi scan
scanning bus for devices...
Target spinup took 0 ms.
Target spinup took 0 ms.
AHCI 0001.0200 32 slots 2 ports 6 Gbps 0x3 impl SATA mode
flags: 64bit ncq stag led clo pmp pio slum part ccc sxs
  Device 0: (0:0) Vendor: ATA Prod.: WDC WD3200BEVT-2 Rev: 01.0
            Type: Hard Disk
            Capacity: 305245.3 MB = 298.0 GB (625142448 x 512)
  Device 1: (1:0) Vendor: ATA Prod.: ST9320423AS Rev: 0002
            Type: Hard Disk
            Capacity: 305245.3 MB = 298.0 GB (625142448 x 512)

I had tried to build older versions of u-boot up to 2019-10-bpi-r2 branch and behavior is exactly the same across all versions.

Patching u-boot’s DTS to exclude port like this workarounds the problem:

diff --git a/arch/arm/dts/mt7623n-bananapi-bpi-r2.dts b/arch/arm/dts/mt7623n-bananapi-bpi-r2.dts
index bcedcf20..0f239504 100644
--- a/arch/arm/dts/mt7623n-bananapi-bpi-r2.dts
+++ b/arch/arm/dts/mt7623n-bananapi-bpi-r2.dts
@@ -214,18 +214,18 @@
        pinctrl-0 = <&pcie_default>;
        status = "okay";

-       pcie@0,0 {
+/*     pcie@0,0 {
                status = "okay";
-       };
+       };*/

        pcie@1,0 {
                status = "okay";
        };
 };

-&pcie0_phy {
+/*&pcie0_phy {
        status = "okay";
-};
+};*/

 &pcie1_phy {
        status = "okay";

But it also means u-boot won’t be able to use ethernet, usb or ahci miniPCIe controller with this workaround in place as this change essentially disables PCIe port #0.

Ethernet should not be affected…afair i only tested with mpcie card inserted…maybe pcie-controller gives errorcode if no device found which break or hang while enumerating

I was writing about external miniPCIe ethernet cards, there are some available. Having above workaround in place makes miniPCIe slot hidden from u-boot.

Here is full debug trace starting from running “pci enum” and up to the hang:

u-boot debug trace
BPI-R2> pci enum
uclass_find_device_by_seq() 0 -1
uclass_find_device_by_seq() 0 0
uclass_find_device_by_seq()    - -1 -1 'pcie@1a140000'
uclass_find_device_by_seq()    - not found
uclass_find_device_by_seq() 0 -1
uclass_find_device_by_seq() 0 0
uclass_find_device_by_seq()    - -1 -1 'ephy_default'
uclass_find_device_by_seq()    - -1 -1 'mux'
uclass_find_device_by_seq()    - -1 -1 'conf'
uclass_find_device_by_seq()    - -1 1 'mmc0default'
uclass_find_device_by_seq()    - -1 -1 'mux'
uclass_find_device_by_seq()    - -1 -1 'conf-cmd-data'
uclass_find_device_by_seq()    - -1 -1 'conf-clk'
uclass_find_device_by_seq()    - -1 -1 'conf-rst'
uclass_find_device_by_seq()    - -1 2 'mmc1default'
uclass_find_device_by_seq()    - -1 -1 'mux'
uclass_find_device_by_seq()    - -1 -1 'conf-cmd-data'
uclass_find_device_by_seq()    - -1 -1 'conf-clk'
uclass_find_device_by_seq()    - -1 -1 'conf-wp'
uclass_find_device_by_seq()    - -1 -1 'pcie-default'
uclass_find_device_by_seq()    - -1 -1 'mux'
uclass_find_device_by_seq()    - -1 -1 'uart0-default'
uclass_find_device_by_seq()    - -1 -1 'mux'
uclass_find_device_by_seq()    - -1 -1 'uart1-default'
uclass_find_device_by_seq()    - -1 -1 'mux'
uclass_find_device_by_seq()    - -1 0 'uart2-default'
uclass_find_device_by_seq()    - found
uclass_find_device_by_seq() 0 1
uclass_find_device_by_seq()    - -1 -1 'ephy_default'
uclass_find_device_by_seq()    - -1 -1 'mux'
uclass_find_device_by_seq()    - -1 -1 'conf'
uclass_find_device_by_seq()    - -1 1 'mmc0default'
uclass_find_device_by_seq()    - found
uclass_find_device_by_seq() 0 2
uclass_find_device_by_seq()    - -1 -1 'ephy_default'
uclass_find_device_by_seq()    - -1 -1 'mux'
uclass_find_device_by_seq()    - -1 -1 'conf'
uclass_find_device_by_seq()    - -1 1 'mmc0default'
uclass_find_device_by_seq()    - -1 -1 'mux'
uclass_find_device_by_seq()    - -1 -1 'conf-cmd-data'
uclass_find_device_by_seq()    - -1 -1 'conf-clk'
uclass_find_device_by_seq()    - -1 -1 'conf-rst'
uclass_find_device_by_seq()    - -1 2 'mmc1default'
uclass_find_device_by_seq()    - found
uclass_find_device_by_seq() 0 3
uclass_find_device_by_seq()    - -1 -1 'ephy_default'
uclass_find_device_by_seq()    - -1 -1 'mux'
uclass_find_device_by_seq()    - -1 -1 'conf'
uclass_find_device_by_seq()    - -1 1 'mmc0default'
uclass_find_device_by_seq()    - -1 -1 'mux'
uclass_find_device_by_seq()    - -1 -1 'conf-cmd-data'
uclass_find_device_by_seq()    - -1 -1 'conf-clk'
uclass_find_device_by_seq()    - -1 -1 'conf-rst'
uclass_find_device_by_seq()    - -1 2 'mmc1default'
uclass_find_device_by_seq()    - -1 -1 'mux'
uclass_find_device_by_seq()    - -1 -1 'conf-cmd-data'
uclass_find_device_by_seq()    - -1 -1 'conf-clk'
uclass_find_device_by_seq()    - -1 -1 'conf-wp'
uclass_find_device_by_seq()    - -1 -1 'pcie-default'
uclass_find_device_by_seq()    - -1 -1 'mux'
uclass_find_device_by_seq()    - -1 -1 'uart0-default'
uclass_find_device_by_seq()    - -1 -1 'mux'
uclass_find_device_by_seq()    - -1 -1 'uart1-default'
uclass_find_device_by_seq()    - -1 -1 'mux'
uclass_find_device_by_seq()    - -1 0 'uart2-default'
uclass_find_device_by_seq()    - -1 -1 'mux'
uclass_find_device_by_seq()    - -1 -1 'uart2-alt'
uclass_find_device_by_seq()    - -1 -1 'mux'
uclass_find_device_by_seq()    - not found
uclass_find_device_by_seq() 0 0
uclass_find_device_by_seq()    - -1 0 'pinctrl@10005000'
uclass_find_device_by_seq()    - found
clk_set_defaults() clk_set_defaults(pcie-default)
clk_set_default_parents() clk_set_default_parents: could not read assigned-clock-parents for feb7e870
ofnode_read_prop() ofnode_read_prop: assigned-clock-rates: ofnode_read_prop() <not found>
fdtdec_get_int() fdtdec_get_int: #power-domain-cells: fdtdec_get_int() 0x1 (1)
power_domain_get_by_index() power_domain_get_by_index(dev=feb7f580, power_domain=fe9fc33c)
fdtdec_get_int() fdtdec_get_int: #power-domain-cells: fdtdec_get_int() 0x1 (1)
uclass_get_device_by_ofnode() Looking for scpsys@10006000
uclass_find_device_by_ofnode() Looking for scpsys@10006000
uclass_find_device_by_ofnode()    - result for scpsys@10006000: scpsys@10006000 (ret=0)
uclass_get_device_by_ofnode()    - result for scpsys@10006000: scpsys@10006000 (ret=0)
power_domain_of_xlate_default() power_domain_of_xlate_default(power_domain=fe9fc33c)
power_domain_on() power_domain_on(power_domain=fe9fc33c)
pci_uclass_pre_probe() pci_uclass_pre_probe, bus=0/pcie@1a140000, parent=root_driver
decode_regions() decode_regions: len=12, cells_per_record=6
decode_regions() decode_regions: region 0, pci_addr=1a160000, addr=1a160000, size=10000, space_code=1
decode_regions()  - type=1, pos=0
decode_regions() decode_regions: region 1, pci_addr=60000000, addr=60000000, size=10000000, space_code=3
decode_regions()  - type=0, pos=1
ofnode_read_bool() ofnode_read_bool: u-boot,skip-auto-config-until-reloc: ofnode_read_bool() false
clk_set_defaults() clk_set_defaults(pcie@1a140000)
clk_set_default_parents() clk_set_default_parents: could not read assigned-clock-parents for feb7f580
ofnode_read_prop() ofnode_read_prop: assigned-clock-rates: ofnode_read_prop() <not found>
__of_translate_address() OF: ** translation for device pcie@1a140000 **
__of_translate_address() OF: bus is default (na=1, ns=1) on
__of_translate_address() OF: reached root node
clk_get_by_name() clk_get_by_name(dev=feb7f580, name=free_ck, clk=feb85858)
fdtdec_get_int() fdtdec_get_int: #clock-cells: fdtdec_get_int() 0x1 (1)
uclass_get_device_by_ofnode() Looking for clock-controller@10000000
uclass_find_device_by_ofnode() Looking for clock-controller@10000000
uclass_find_device_by_ofnode()    - result for clock-controller@10000000: clock-controller@10000000 (ret=0)
uclass_get_device_by_ofnode()    - result for clock-controller@10000000: clock-controller@10000000 (ret=0)
clk_of_xlate_default() clk_of_xlate_default(clk=feb85858)
clk_request() clk_request(dev=feb7e258, clk=feb85858)
clk_enable() clk_enable(clk=feb85858)
ofnode_read_pci_addr() ofnode_read_pci_addr: reg: ofnode_read_pci_addr() pci address #0: 00000000 00000000 00000000
__of_translate_address() OF: ** translation for device pcie@1a140000 **
__of_translate_address() OF: bus is default (na=1, ns=1) on
__of_translate_address() OF: reached root node
clk_get_by_name() clk_get_by_name(dev=feb7f580, name=sys_ck0, clk=feb9c8e0)
fdtdec_get_int() fdtdec_get_int: #clock-cells: fdtdec_get_int() 0x1 (1)
fdtdec_get_int() fdtdec_get_int: #clock-cells: fdtdec_get_int() 0x1 (1)
uclass_get_device_by_ofnode() Looking for syscon@1a000000
uclass_find_device_by_ofnode() Looking for syscon@1a000000
uclass_find_device_by_ofnode()    - result for syscon@1a000000: syscon@1a000000 (ret=0)
uclass_get_device_by_ofnode()    - result for syscon@1a000000: syscon@1a000000 (ret=0)
uclass_find_device_by_seq() 0 -1
uclass_find_device_by_seq() 0 0
uclass_find_device_by_seq()    - -1 1 'dummy13m'
uclass_find_device_by_seq()    - -1 -1 'oscillator-1'
uclass_find_device_by_seq()    - -1 -1 'oscillator-0'
uclass_find_device_by_seq()    - -1 0 'clock-controller@10000000'
uclass_find_device_by_seq()    - found
uclass_find_device_by_seq() 0 1
uclass_find_device_by_seq()    - -1 1 'dummy13m'
uclass_find_device_by_seq()    - found
uclass_find_device_by_seq() 0 2
uclass_find_device_by_seq()    - -1 1 'dummy13m'
uclass_find_device_by_seq()    - -1 -1 'oscillator-1'
uclass_find_device_by_seq()    - -1 -1 'oscillator-0'
uclass_find_device_by_seq()    - -1 0 'clock-controller@10000000'
uclass_find_device_by_seq()    - -1 5 'syscon@10001000'
uclass_find_device_by_seq()    - -1 2 'syscon@10003000'
uclass_find_device_by_seq()    - found
uclass_find_device_by_seq() 0 3
uclass_find_device_by_seq()    - -1 1 'dummy13m'
uclass_find_device_by_seq()    - -1 -1 'oscillator-1'
uclass_find_device_by_seq()    - -1 -1 'oscillator-0'
uclass_find_device_by_seq()    - -1 0 'clock-controller@10000000'
uclass_find_device_by_seq()    - -1 5 'syscon@10001000'
uclass_find_device_by_seq()    - -1 2 'syscon@10003000'
uclass_find_device_by_seq()    - -1 3 'clock-controller@10209000'
uclass_find_device_by_seq()    - found
uclass_find_device_by_seq() 0 4
uclass_find_device_by_seq()    - -1 1 'dummy13m'
uclass_find_device_by_seq()    - -1 -1 'oscillator-1'
uclass_find_device_by_seq()    - -1 -1 'oscillator-0'
uclass_find_device_by_seq()    - -1 0 'clock-controller@10000000'
uclass_find_device_by_seq()    - -1 5 'syscon@10001000'
uclass_find_device_by_seq()    - -1 2 'syscon@10003000'
uclass_find_device_by_seq()    - -1 3 'clock-controller@10209000'
uclass_find_device_by_seq()    - -1 -1 'syscon@1a000000'
uclass_find_device_by_seq()    - -1 4 'syscon@1b000000'
uclass_find_device_by_seq()    - found
uclass_find_device_by_seq() 0 5
uclass_find_device_by_seq()    - -1 1 'dummy13m'
uclass_find_device_by_seq()    - -1 -1 'oscillator-1'
uclass_find_device_by_seq()    - -1 -1 'oscillator-0'
uclass_find_device_by_seq()    - -1 0 'clock-controller@10000000'
uclass_find_device_by_seq()    - -1 5 'syscon@10001000'
uclass_find_device_by_seq()    - found
uclass_find_device_by_seq() 0 6
uclass_find_device_by_seq()    - -1 1 'dummy13m'
uclass_find_device_by_seq()    - -1 -1 'oscillator-1'
uclass_find_device_by_seq()    - -1 -1 'oscillator-0'
uclass_find_device_by_seq()    - -1 0 'clock-controller@10000000'
uclass_find_device_by_seq()    - -1 5 'syscon@10001000'
uclass_find_device_by_seq()    - -1 2 'syscon@10003000'
uclass_find_device_by_seq()    - -1 3 'clock-controller@10209000'
uclass_find_device_by_seq()    - -1 -1 'syscon@1a000000'
uclass_find_device_by_seq()    - -1 4 'syscon@1b000000'
uclass_find_device_by_seq()    - not found
uclass_find_device_by_seq() 0 0
uclass_find_device_by_seq()    - -1 0 'pinctrl@10005000'
uclass_find_device_by_seq()    - found
clk_set_defaults() clk_set_defaults(syscon@1a000000)
clk_set_default_parents() clk_set_default_parents: could not read assigned-clock-parents for feb7f480
ofnode_read_prop() ofnode_read_prop: assigned-clock-rates: ofnode_read_prop() <not found>
__of_translate_address() OF: ** translation for device syscon@1a000000 **
__of_translate_address() OF: bus is default (na=1, ns=1) on
__of_translate_address() OF: reached root node
clk_set_defaults() clk_set_defaults(syscon@1a000000)
clk_set_default_parents() clk_set_default_parents: could not read assigned-clock-parents for feb7f480
ofnode_read_prop() ofnode_read_prop: assigned-clock-rates: ofnode_read_prop() <not found>
clk_of_xlate_default() clk_of_xlate_default(clk=feb9c8e0)
clk_request() clk_request(dev=feb7f480, clk=feb9c8e0)
fdtdec_get_int() fdtdec_get_int: #reset-cells: fdtdec_get_int() 0x1 (1)
uclass_get_device_by_ofnode() Looking for syscon@1a000000
uclass_find_device_by_ofnode() Looking for syscon@1a000000
uclass_find_device_by_ofnode()    - result for syscon@1a000000: reset (ret=0)
uclass_get_device_by_ofnode()    - result for syscon@1a000000: reset (ret=0)
uclass_find_device_by_seq() 0 -1
uclass_find_device_by_seq() 0 0
uclass_find_device_by_seq()    - -1 -1 'reset'
uclass_find_device_by_seq()    - -1 0 'reset'
uclass_find_device_by_seq()    - found
uclass_find_device_by_seq() 0 1
uclass_find_device_by_seq()    - -1 -1 'reset'
uclass_find_device_by_seq()    - -1 0 'reset'
uclass_find_device_by_seq()    - not found
uclass_find_device_by_seq() 0 0
uclass_find_device_by_seq()    - -1 0 'pinctrl@10005000'
uclass_find_device_by_seq()    - found
clk_set_defaults() clk_set_defaults(syscon@1a000000)
clk_set_default_parents() clk_set_default_parents: could not read assigned-clock-parents for feb7f4f8
ofnode_read_prop() ofnode_read_prop: assigned-clock-rates: ofnode_read_prop() <not found>
uclass_get_device_by_ofnode() Looking for syscon@1a000000
uclass_find_device_by_ofnode() Looking for syscon@1a000000
uclass_find_device_by_ofnode()    - result for syscon@1a000000: (none) (ret=-19)
uclass_get_device_by_ofnode()    - result for syscon@1a000000: (none) (ret=-19)
uclass_find_device_by_seq() 0 -1
uclass_find_device_by_seq() 0 0
uclass_find_device_by_seq()    - -1 0 'syscon@1b000000'
uclass_find_device_by_seq()    - found
uclass_find_device_by_seq() 0 1
uclass_find_device_by_seq()    - -1 0 'syscon@1b000000'
uclass_find_device_by_seq()    - -1 1 'syscon@10001000'
uclass_find_device_by_seq()    - found
uclass_find_device_by_seq() 0 2
uclass_find_device_by_seq()    - -1 0 'syscon@1b000000'
uclass_find_device_by_seq()    - -1 1 'syscon@10001000'
uclass_find_device_by_seq()    - -1 -1 'syscon@1a000000'
uclass_find_device_by_seq()    - not found
uclass_find_device_by_seq() 0 0
uclass_find_device_by_seq()    - -1 0 'pinctrl@10005000'
uclass_find_device_by_seq()    - found
ofnode_read_prop() ofnode_read_prop: reg: fdtdec_get_addr_size_fixed() fdtdec_get_addr_size_fixed: reg: __of_translate_address() OF: ** translation for device syscon@1a000000 **
__of_translate_address() OF: bus is default (na=1, ns=1) on
__of_translate_address() OF: reached root node
fdtdec_get_addr_size_fixed() addr=1a000000, size=1000
ofnode_read_bool() ofnode_read_bool: little-endian: ofnode_read_bool() false
ofnode_read_bool() ofnode_read_bool: big-endian: ofnode_read_bool() false
ofnode_read_bool() ofnode_read_bool: native-endian: ofnode_read_bool() false
clk_set_defaults() clk_set_defaults(syscon@1a000000)
clk_set_default_parents() clk_set_default_parents: could not read assigned-clock-parents for feb85b08
ofnode_read_prop() ofnode_read_prop: assigned-clock-rates: ofnode_read_prop() <not found>
reset_of_xlate_default() reset_of_xlate_default(reset_ctl=feb9c8d0)
generic_phy_get_by_index() generic_phy_get_by_index(dev=feb7f580, index=0, phy=feb9c900)
fdtdec_get_int() fdtdec_get_int: #phy-cells: fdtdec_get_int() 0x1 (1)
uclass_get_device_by_ofnode() Looking for pcie-phy@1a149900
uclass_find_device_by_ofnode() Looking for pcie-phy@1a149900
uclass_find_device_by_ofnode()    - result for pcie-phy@1a149900: (none) (ret=-19)
uclass_get_device_by_ofnode()    - result for pcie-phy@1a149900: (none) (ret=-19)
generic_phy_get_by_index() generic_phy_get_by_index: uclass_get_device_by_ofnode failed: err=-19
uclass_get_device_by_ofnode() Looking for pcie-phy@1a149000
uclass_find_device_by_ofnode() Looking for pcie-phy@1a149000
uclass_find_device_by_ofnode()    - result for pcie-phy@1a149000: pcie-phy@1a149000 (ret=0)
uclass_get_device_by_ofnode()    - result for pcie-phy@1a149000: pcie-phy@1a149000 (ret=0)
uclass_find_device_by_seq() 0 -1
uclass_find_device_by_seq() 0 0
uclass_find_device_by_seq()    - -1 -1 'pcie-phy@1a149000'
uclass_find_device_by_seq()    - -1 -1 'pcie-phy@1a14a000'
uclass_find_device_by_seq()    - not found
uclass_find_device_by_seq() 0 0
uclass_find_device_by_seq()    - -1 0 'pinctrl@10005000'
uclass_find_device_by_seq()    - found
clk_set_defaults() clk_set_defaults(pcie-phy@1a149000)
clk_set_default_parents() clk_set_default_parents: could not read assigned-clock-parents for feb7f5f8
ofnode_read_prop() ofnode_read_prop: assigned-clock-rates: ofnode_read_prop() <not found>
__of_translate_address() OF: ** translation for device pcie-phy@1a149000 **
__of_translate_address() OF: bus is default (na=1, ns=1) on
__of_translate_address() OF: reached root node
fdtdec_get_addr_size_fixed() fdtdec_get_addr_size_fixed: reg: __of_translate_address() OF: ** translation for device pcie-phy@1a149900 **
__of_translate_address() OF: bus is default (na=1, ns=1) on pcie-phy@1a149000
__of_translate_address() OF: parent bus is default (na=1, ns=1) on
of_translate_one() OF: no ranges, 1:1 translation
of_translate_one() OF: with offset: 437557504
__of_translate_address() OF: reached root node
fdtdec_get_addr_size_fixed() addr=1a149900, size=700
clk_get_by_name_nodev() clk_get_by_name_nodev(node=fe9fe2d8, name=ref, clk=feb9ca58)
fdtdec_get_int() fdtdec_get_int: #clock-cells: fdtdec_get_int() 0x0 (0)
uclass_get_device_by_ofnode() Looking for oscillator-0
uclass_find_device_by_ofnode() Looking for oscillator-0
uclass_find_device_by_ofnode()    - result for oscillator-0: oscillator-0 (ret=0)
uclass_get_device_by_ofnode()    - result for oscillator-0: oscillator-0 (ret=0)
ofnode_read_u32() ofnode_read_u32: clock-frequency: ofnode_read_u32() 0x18cba80 (26000000)
uclass_find_device_by_seq() 0 -1
uclass_find_device_by_seq() 0 0
uclass_find_device_by_seq()    - -1 1 'dummy13m'
uclass_find_device_by_seq()    - -1 -1 'oscillator-1'
uclass_find_device_by_seq()    - -1 -1 'oscillator-0'
uclass_find_device_by_seq()    - -1 0 'clock-controller@10000000'
uclass_find_device_by_seq()    - found
uclass_find_device_by_seq() 0 1
uclass_find_device_by_seq()    - -1 1 'dummy13m'
uclass_find_device_by_seq()    - found
uclass_find_device_by_seq() 0 2
uclass_find_device_by_seq()    - -1 1 'dummy13m'
uclass_find_device_by_seq()    - -1 -1 'oscillator-1'
uclass_find_device_by_seq()    - -1 -1 'oscillator-0'
uclass_find_device_by_seq()    - -1 0 'clock-controller@10000000'
uclass_find_device_by_seq()    - -1 5 'syscon@10001000'
uclass_find_device_by_seq()    - -1 2 'syscon@10003000'
uclass_find_device_by_seq()    - found
uclass_find_device_by_seq() 0 3
uclass_find_device_by_seq()    - -1 1 'dummy13m'
uclass_find_device_by_seq()    - -1 -1 'oscillator-1'
uclass_find_device_by_seq()    - -1 -1 'oscillator-0'
uclass_find_device_by_seq()    - -1 0 'clock-controller@10000000'
uclass_find_device_by_seq()    - -1 5 'syscon@10001000'
uclass_find_device_by_seq()    - -1 2 'syscon@10003000'
uclass_find_device_by_seq()    - -1 3 'clock-controller@10209000'
uclass_find_device_by_seq()    - found
uclass_find_device_by_seq() 0 4
uclass_find_device_by_seq()    - -1 1 'dummy13m'
uclass_find_device_by_seq()    - -1 -1 'oscillator-1'
uclass_find_device_by_seq()    - -1 -1 'oscillator-0'
uclass_find_device_by_seq()    - -1 0 'clock-controller@10000000'
uclass_find_device_by_seq()    - -1 5 'syscon@10001000'
uclass_find_device_by_seq()    - -1 2 'syscon@10003000'
uclass_find_device_by_seq()    - -1 3 'clock-controller@10209000'
uclass_find_device_by_seq()    - -1 6 'syscon@1a000000'
uclass_find_device_by_seq()    - -1 4 'syscon@1b000000'
uclass_find_device_by_seq()    - found
uclass_find_device_by_seq() 0 5
uclass_find_device_by_seq()    - -1 1 'dummy13m'
uclass_find_device_by_seq()    - -1 -1 'oscillator-1'
uclass_find_device_by_seq()    - -1 -1 'oscillator-0'
uclass_find_device_by_seq()    - -1 0 'clock-controller@10000000'
uclass_find_device_by_seq()    - -1 5 'syscon@10001000'
uclass_find_device_by_seq()    - found
uclass_find_device_by_seq() 0 6
uclass_find_device_by_seq()    - -1 1 'dummy13m'
uclass_find_device_by_seq()    - -1 -1 'oscillator-1'
uclass_find_device_by_seq()    - -1 -1 'oscillator-0'
uclass_find_device_by_seq()    - -1 0 'clock-controller@10000000'
uclass_find_device_by_seq()    - -1 5 'syscon@10001000'
uclass_find_device_by_seq()    - -1 2 'syscon@10003000'
uclass_find_device_by_seq()    - -1 3 'clock-controller@10209000'
uclass_find_device_by_seq()    - -1 6 'syscon@1a000000'
uclass_find_device_by_seq()    - found
uclass_find_device_by_seq() 0 7
uclass_find_device_by_seq()    - -1 1 'dummy13m'
uclass_find_device_by_seq()    - -1 -1 'oscillator-1'
uclass_find_device_by_seq()    - -1 -1 'oscillator-0'
uclass_find_device_by_seq()    - -1 0 'clock-controller@10000000'
uclass_find_device_by_seq()    - -1 5 'syscon@10001000'
uclass_find_device_by_seq()    - -1 2 'syscon@10003000'
uclass_find_device_by_seq()    - -1 3 'clock-controller@10209000'
uclass_find_device_by_seq()    - -1 6 'syscon@1a000000'
uclass_find_device_by_seq()    - -1 4 'syscon@1b000000'
uclass_find_device_by_seq()    - not found
uclass_find_device_by_seq() 0 0
uclass_find_device_by_seq()    - -1 0 'pinctrl@10005000'
uclass_find_device_by_seq()    - found
clk_set_defaults() clk_set_defaults(oscillator-0)
clk_set_default_parents() clk_set_default_parents: could not read assigned-clock-parents for feb7e1d0
ofnode_read_prop() ofnode_read_prop: assigned-clock-rates: ofnode_read_prop() <not found>
clk_set_defaults() clk_set_defaults(oscillator-0)
clk_set_default_parents() clk_set_default_parents: could not read assigned-clock-parents for feb7e1d0
ofnode_read_prop() ofnode_read_prop: assigned-clock-rates: ofnode_read_prop() <not found>
clk_of_xlate_default() clk_of_xlate_default(clk=feb9ca58)
clk_request() clk_request(dev=feb7e1d0, clk=feb9ca58)
ofnode_read_u32() ofnode_read_u32: reg: ofnode_read_u32() 0x1a149900 (437557504)
ofnode_read_pci_addr() ofnode_read_pci_addr: reg: ofnode_read_pci_addr() pci address #0: 00000800 00000000 00000000
__of_translate_address() OF: ** translation for device pcie@1a140000 **
__of_translate_address() OF: bus is default (na=1, ns=1) on
__of_translate_address() OF: reached root node
clk_get_by_name() clk_get_by_name(dev=feb7f580, name=sys_ck1, clk=feb9cae0)
fdtdec_get_int() fdtdec_get_int: #clock-cells: fdtdec_get_int() 0x1 (1)
fdtdec_get_int() fdtdec_get_int: #clock-cells: fdtdec_get_int() 0x1 (1)
fdtdec_get_int() fdtdec_get_int: #clock-cells: fdtdec_get_int() 0x1 (1)
uclass_get_device_by_ofnode() Looking for syscon@1a000000
uclass_find_device_by_ofnode() Looking for syscon@1a000000
uclass_find_device_by_ofnode()    - result for syscon@1a000000: syscon@1a000000 (ret=0)
uclass_get_device_by_ofnode()    - result for syscon@1a000000: syscon@1a000000 (ret=0)
clk_of_xlate_default() clk_of_xlate_default(clk=feb9cae0)
clk_request() clk_request(dev=feb7f480, clk=feb9cae0)
fdtdec_get_int() fdtdec_get_int: #reset-cells: fdtdec_get_int() 0x1 (1)
fdtdec_get_int() fdtdec_get_int: #reset-cells: fdtdec_get_int() 0x1 (1)
uclass_get_device_by_ofnode() Looking for syscon@1a000000
uclass_find_device_by_ofnode() Looking for syscon@1a000000
uclass_find_device_by_ofnode()    - result for syscon@1a000000: reset (ret=0)
uclass_get_device_by_ofnode()    - result for syscon@1a000000: reset (ret=0)
reset_of_xlate_default() reset_of_xlate_default(reset_ctl=feb9cad0)
generic_phy_get_by_index() generic_phy_get_by_index(dev=feb7f580, index=1, phy=feb9cb00)
fdtdec_get_int() fdtdec_get_int: #phy-cells: fdtdec_get_int() 0x1 (1)
fdtdec_get_int() fdtdec_get_int: #phy-cells: fdtdec_get_int() 0x1 (1)
uclass_get_device_by_ofnode() Looking for pcie-phy@1a14a900
uclass_find_device_by_ofnode() Looking for pcie-phy@1a14a900
uclass_find_device_by_ofnode()    - result for pcie-phy@1a14a900: (none) (ret=-19)
uclass_get_device_by_ofnode()    - result for pcie-phy@1a14a900: (none) (ret=-19)
generic_phy_get_by_index() generic_phy_get_by_index: uclass_get_device_by_ofnode failed: err=-19
uclass_get_device_by_ofnode() Looking for pcie-phy@1a14a000
uclass_find_device_by_ofnode() Looking for pcie-phy@1a14a000
uclass_find_device_by_ofnode()    - result for pcie-phy@1a14a000: pcie-phy@1a14a000 (ret=0)
uclass_get_device_by_ofnode()    - result for pcie-phy@1a14a000: pcie-phy@1a14a000 (ret=0)
uclass_find_device_by_seq() 0 -1
uclass_find_device_by_seq() 0 0
uclass_find_device_by_seq()    - -1 0 'pcie-phy@1a149000'
uclass_find_device_by_seq()    - found
uclass_find_device_by_seq() 0 1
uclass_find_device_by_seq()    - -1 0 'pcie-phy@1a149000'
uclass_find_device_by_seq()    - -1 -1 'pcie-phy@1a14a000'
uclass_find_device_by_seq()    - not found
uclass_find_device_by_seq() 0 0
uclass_find_device_by_seq()    - -1 0 'pinctrl@10005000'
uclass_find_device_by_seq()    - found
clk_set_defaults() clk_set_defaults(pcie-phy@1a14a000)
clk_set_default_parents() clk_set_default_parents: could not read assigned-clock-parents for feb7f650
ofnode_read_prop() ofnode_read_prop: assigned-clock-rates: ofnode_read_prop() <not found>
__of_translate_address() OF: ** translation for device pcie-phy@1a14a000 **
__of_translate_address() OF: bus is default (na=1, ns=1) on
__of_translate_address() OF: reached root node
fdtdec_get_addr_size_fixed() fdtdec_get_addr_size_fixed: reg: __of_translate_address() OF: ** translation for device pcie-phy@1a14a900 **
__of_translate_address() OF: bus is default (na=1, ns=1) on pcie-phy@1a14a000
__of_translate_address() OF: parent bus is default (na=1, ns=1) on
of_translate_one() OF: no ranges, 1:1 translation
of_translate_one() OF: with offset: 437561600
__of_translate_address() OF: reached root node
fdtdec_get_addr_size_fixed() addr=1a14a900, size=700
clk_get_by_name_nodev() clk_get_by_name_nodev(node=fe9fe3f4, name=ref, clk=feb9cc18)
fdtdec_get_int() fdtdec_get_int: #clock-cells: fdtdec_get_int() 0x0 (0)
uclass_get_device_by_ofnode() Looking for oscillator-0
uclass_find_device_by_ofnode() Looking for oscillator-0
uclass_find_device_by_ofnode()    - result for oscillator-0: oscillator-0 (ret=0)
uclass_get_device_by_ofnode()    - result for oscillator-0: oscillator-0 (ret=0)
clk_of_xlate_default() clk_of_xlate_default(clk=feb9cc18)
clk_request() clk_request(dev=feb7e1d0, clk=feb9cc18)
ofnode_read_u32() ofnode_read_u32: reg: ofnode_read_u32() 0x1a14a900 (437561600)
clk_enable() clk_enable(clk=feb9c8e0)
reset_assert() reset_assert(reset_ctl=feb9c8d0)
reset_deassert() reset_deassert(reset_ctl=feb9c8d0)
clk_enable() clk_enable(clk=feb9ca58)
Port0 link down
clk_enable() clk_enable(clk=feb9cae0)
reset_assert() reset_assert(reset_ctl=feb9cad0)
reset_deassert() reset_deassert(reset_ctl=feb9cad0)
clk_enable() clk_enable(clk=feb9cc18)
pci_uclass_post_probe() pci_uclass_post_probe: probing bus 0
pci_bind_bus_devices() pci_bind_bus_devices: bus 0/pcie@1a140000: found device 0, function 0pci_bind_bus_devices() : find ret=-19
pci_find_and_bind_driver() pci_find_and_bind_driver: Searching for driver: vendor=14c3, device=801
ofnode_read_pci_addr() ofnode_read_pci_addr: reg: ofnode_read_pci_addr() pci address #0: 00000000 00000000 00000000
ofnode_read_pci_addr() ofnode_read_pci_addr: reg: ofnode_read_pci_addr() pci address #0: 00000000 00000000 00000000
pci_find_and_bind_driver() pci_find_and_bind_driver: No match found: bound generic driver instead
pci_bind_bus_devices() pci_bind_bus_devices: bus 0/pcie@1a140000: found device 1, function 0pci_bind_bus_devices() : find ret=-19
pci_find_and_bind_driver() pci_find_and_bind_driver: Searching for driver: vendor=14c3, device=801
ofnode_read_pci_addr() ofnode_read_pci_addr: reg: ofnode_read_pci_addr() pci address #0: 00000000 00000000 00000000
ofnode_read_pci_addr() ofnode_read_pci_addr: reg: ofnode_read_pci_addr() pci address #0: 00000800 00000000 00000000
fdtdec_get_alias_seq() Looking for 'pci' at 6928, name pcie@1,0
fdtdec_get_alias_seq() Not found
ofnode_read_pci_addr() ofnode_read_pci_addr: reg: ofnode_read_pci_addr() pci address #0: 00000800 00000000 00000000
pci_find_and_bind_driver() pci_find_and_bind_driver: No match found: bound generic driver instead
pci_auto_config_devices() pci_auto_config_devices: start
pciauto_show_region() PCI Autoconfig: Bus Memory region: [60000000-6fffffff],
                Physical Memory [60000000-6fffffffx]
pciauto_show_region() PCI Autoconfig: Bus I/O region: [1a160000-1a16ffff],
                Physical Memory [1a160000-1a16ffffx]
pci_auto_config_devices() pci_auto_config_devices: device pci_0:0.0
dm_pciauto_setup_device() PCI Autoconfig: BAR 0, Mem, size=0x2000000, pciauto_region_allocate() address=0x60000000 bus_lower=0x62000000
dm_pciauto_setup_device()
dm_pciauto_setup_device() PCI Autoconfig: BAR 1, Mem, size=0x10000, pciauto_region_allocate() address=0x62000000 bus_lower=0x62010000
dm_pciauto_setup_device()
dm_pciauto_setup_device() PCI Autoconfig: BAR 2, I/O, size=0x4, pciauto_region_allocate() address=0x1a160000 bus_lower=0x1a160004
dm_pciauto_setup_device()
dm_pciauto_setup_device() PCI Autoconfig: BAR 3, I/O, size=0xe10, pciauto_region_allocate() address=0x1a160e10 bus_lower=0x1a161c20
dm_pciauto_setup_device()
dm_pciauto_setup_device() PCI Autoconfig: BAR 4, Mem, size=0xf0010, pciauto_region_allocate() address=0x62100000 bus_lower=0x621f0010
dm_pciauto_setup_device()
dm_pciauto_setup_device() PCI Autoconfig: BAR 5, I/O, size=0x10, pciauto_region_allocate() address=0x1a161c20 bus_lower=0x1a161c30
dm_pciauto_setup_device()
pci_auto_config_devices() pci_auto_config_devices: device pci_0:1.0
dm_pciauto_config_device() PCI Autoconfig: Found P2P bridge, device 1
dm_pciauto_setup_device() PCI Autoconfig: BAR 0, Mem, size=0x10000, pciauto_region_allocate() address=0x62200000 bus_lower=0x62210000
dm_pciauto_setup_device()
dm_pci_hose_probe_bus() dm_pci_hose_probe_bus
pci_get_bus_max() pci_get_bus_max: ret=0
dm_pci_hose_probe_bus() dm_pci_hose_probe_bus: bus = 1/pci_0:1.0
uclass_find_device_by_seq() 0 -1
uclass_find_device_by_seq() 0 0
uclass_find_device_by_seq()    - -1 0 'pcie@1a140000'
uclass_find_device_by_seq()    - found
uclass_find_device_by_seq() 0 1
uclass_find_device_by_seq()    - -1 0 'pcie@1a140000'
uclass_find_device_by_seq()    - -1 -1 'pci_0:1.0'
uclass_find_device_by_seq()    - not found
uclass_find_device_by_seq() 0 0
uclass_find_device_by_seq()    - -1 0 'pinctrl@10005000'
uclass_find_device_by_seq()    - found
pci_uclass_pre_probe() pci_uclass_pre_probe, bus=1/pci_0:1.0, parent=pcie@1a140000
ofnode_read_bool() ofnode_read_bool: u-boot,skip-auto-config-until-reloc: ofnode_read_bool() false
clk_set_defaults() clk_set_defaults(pcie@1,0)
clk_set_default_parents() clk_set_default_parents: could not read assigned-clock-parents for feb9ccd0
ofnode_read_prop() ofnode_read_prop: assigned-clock-rates: ofnode_read_prop() <not found>
pci_uclass_post_probe() pci_uclass_post_probe: probing bus 1

Added a lot of additional debug outputs to the u-boot codebase and gathered a way-too-detailed debug trace. Looks like system hangs inside readX call attempting to read from a specific PCI config space:

pci_uclass_pre_probe() pci_uclass_pre_probe, bus=1/pci_0:1.0, parent=pcie@1a140000
ofnode_read_bool() ofnode_read_bool: u-boot,skip-auto-config-until-reloc: ofnode_read_bool() false
clk_set_defaults() clk_set_defaults(pcie@1,0)
clk_set_default_parents() clk_set_default_parents: could not read assigned-clock-parents for ffb9dcd0
ofnode_read_prop() ofnode_read_prop: assigned-clock-rates: ofnode_read_prop() <not found>
pci_uclass_post_probe() pci_uclass_post_probe: probing bus 1
pci_bind_bus_devices() pci_bind_bus_devices: binding devices on bus 1 (pci_0:1.0)
pci_bind_bus_devices() pci_bind_bus_devices: found end of the bdf list = 130816
pci_bind_bus_devices() pci_bind_bus_devices: in bdf loop, bdf = 65536
pci_bind_bus_devices() pci_bind_bus_devices: about to read device vendor
pci_bus_read_config() pci_bus_read_config: read_config = fff990a9
pci_bus_read_config() pci_bus_read_config: read_config = fff9a3c1
mtk_pcie_read_config() mtk_pcie_read_config: about to call generic mmap read config, bus 0 (pcie@1a140000)
pci_generic_mmap_read_config() pci_generic_mmap_read_config: about to call addr_f
mtk_pcie_config_address() mtk_pcie_config_address: pcie = ffb86850
mtk_pcie_config_address() mtk_pcie_config_address: calling writel to write 10000 to 1a140020
mtk_pcie_config_address() mtk_pcie_config_address: after writel
mtk_pcie_config_address() mtk_pcie_config_address: paddress = 1a140024
pci_generic_mmap_read_config() pci_generic_mmap_read_config: addr_f returned address = 1a140024, about to call readX on it

Here we see that 0x10000 is written to the 1a140020. Deciphered it is PCIE_CFG_ADDR register to which a request to read PCI_VENDOR_ID (0x10000) from bus #1 (0x10000) device 0 (0x10000, or more precisely bits 11…15) function 0 (0x10000, more precisely bits 8…10) is written. Next logical step is to read requested value from PCIE_CFG_DATA register which is at +4 offset compared to PCIE_CFG_ADDR register, i.e. at 1a140024. U-boot tries to do exactly that but readw() call never returns - instead a complete board hand occurs with subsequent reboot (probably due to HW watchdog firing).

I don’t have enough competence in PCI/PCIe bus drivers to debug it further, we need some assistance from @Ryder.Lee or some other expert of similar scale.

@frank-w did you see this problem on you board? @LeXa2 unfortunately, I have no board on hand for testing. did you enable phy driver?