Add latest U-boot support for BPI R2 & BPI R64 (not yet)

You digging too deep to tell me your current position by few words :slight_smile:

resets are not found by ryders code…because they are deleted…i added them this way:

281         resets = <&hifsys HIFSYS_PCIE0_RST>,
282              <&hifsys HIFSYS_PCIE1_RST>,
283              <&hifsys HIFSYS_PCIE2_RST>;

but now nothing is printed on pci-enum (not the debug-messages i see before)

https://github.com/frank-w/u-boot/commits/sata_test_ryder

accidentaly removed my debug-messages by “git reset”

now i see much more, but resets still 0

DEBUG: Passed mtk_pcie_probe 247                                                                                                     
DEBUG: Passed mtk_pcie_probe 252                                                                                                     
DEBUG: Passed mtk_pcie_probe 258                                                                                                     
DEBUG: Passed mtk_pcie_probe 264                                                                                                     
DEBUG: Passed mtk_pcie_probe 269                                                                                                     
DEBUG: Passed mtk_pcie_probe 273                                                                                                     
DEBUG: Passed mtk_pcie_probe 278                                                                                                     
DEBUG: Passed mtk_pcie_parse_port 207                                                                                                
DEBUG: Passed mtk_pcie_parse_port 211                                                                                                
DEBUG: Passed mtk_pcie_parse_port 216                                                                                                
DEBUG: Passed mtk_pcie_parse_port 221 0,0,0                                                                                          
DEBUG: Passed mtk_pcie_parse_port 225                                                                                                
DEBUG: Passed mtk_pcie_parse_port 229                                                                                                
DEBUG: Passed mtk_pcie_parse_port 232                                                                                                
DEBUG: Passed mtk_pcie_parse_port 235                                                                                                
DEBUG: Passed mtk_pcie_probe 269                                                                                                     
DEBUG: Passed mtk_pcie_probe 273                                                                                                     
DEBUG: Passed mtk_pcie_probe 278                                                                                                     
DEBUG: Passed mtk_pcie_parse_port 207                                                                                                
DEBUG: Passed mtk_pcie_parse_port 211                                                                                                
DEBUG: Passed mtk_pcie_parse_port 216                                                                                                
DEBUG: Passed mtk_pcie_parse_port 221 0,0,0                                                                                          
DEBUG: Passed mtk_pcie_parse_port 225                                                                                                
DEBUG: Passed mtk_pcie_parse_port 229                                                                                                
DEBUG: Passed mtk_pcie_parse_port 232                                                                                                
DEBUG: Passed mtk_pcie_parse_port 235                                                                                                
DEBUG: Passed mtk_pcie_probe 269                                                                                                     
DEBUG: Passed mtk_pcie_probe 273                                                                                                     
DEBUG: Passed mtk_pcie_probe 278                                                                                                     
DEBUG: Passed mtk_pcie_parse_port 207                                                                                                
DEBUG: Passed mtk_pcie_parse_port 211                                                                                                
DEBUG: Passed mtk_pcie_parse_port 216                                                                                                
DEBUG: Passed mtk_pcie_parse_port 221 0,0,0                                                                                          
DEBUG: Passed mtk_pcie_parse_port 225                                                                                                
DEBUG: Passed mtk_pcie_parse_port 229                                                                                                
DEBUG: Passed mtk_pcie_parse_port 232                                                                                                
DEBUG: Passed mtk_pcie_parse_port 235                                                                                                
DEBUG: Passed mtk_pcie_probe 285                                                                                                     
DEBUG: Passed mtk_pcie_enable_port 172                                                                                               
DEBUG: Passed mtk_pcie_enable_port 184                                                                                               
DEBUG: Passed mtk_pcie_enable_port 192                                                                                               
DEBUG: Passed mtk_pcie_enable_port 172                                                                                               
DEBUG: Passed mtk_pcie_enable_port 184                                                                                               
DEBUG: Passed mtk_pcie_enable_port 192                                                                                               
DEBUG: Passed mtk_pcie_enable_port 172                                                                                               
DEBUG: Passed mtk_pcie_enable_port 184                                                                                               
DEBUG: Passed mtk_pcie_enable_port 192

ok let’s look at pinmux in dts…

should be this: https://github.com/frank-w/BPI-R2-4.14/blob/6a8cd4974ab40922aa8320f7eee1c8cc26b084de/arch/arm/boot/dts/mt7623.dtsi#L1469

seems dt-bindings for pinctrl are not there…

dt-bindings/pinctrl/mt7623-pinfunc.h

$ ls -1 ./arch/arm/dts/include/dt-bindings/pinctrl/
am33xx.h
am43xx.h
at91.h
bcm2835.h
dra.h
hisi.h
k3.h
omap.h
pads-imx8qm.h
pads-imx8qxp.h
pinctrl-snapdragon.h
pinctrl-tegra.h
pinctrl-tegra-xusb.h
pins-imx8mq.h
r7s72100-pinctrl.h
rockchip.h
stm32-pinfunc.h
sun4i-a10.h

because you lack of pinmux setting in dts and phy driver

and if i read the PCI core correctly - pci_uclass_pre_probe() in pci-uclass.c will parse range automatically.

--- a/arch/arm/dts/mt7623n-bananapi-bpi-r2.dts
+++ b/arch/arm/dts/mt7623n-bananapi-bpi-r2.dts
@@ -172,6 +172,13 @@
                };
        };

+       pcie_default: pcie-default {
+               mux {
+                       function = "pcie";
+                       groups =  "pcie0_0_perst", "pcie1_0_perst";
+               };
+       };
+
        uart0_pins_a: uart0-default {
                mux {
                        function = "uart";
@@ -201,6 +208,28 @@
        };
 };

+&pcie {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pcie_default>;
+       status = "okay";
+
+       pcie@0,0 {
+               status = "okay";
+       };
+
+       pcie@1,0 {
+               status = "okay";
+       };
+};
+
+&pcie0_phy {
+       status = "okay";
+};
+
+&pcie1_phy {
+       status = "okay";
+};

Just note that the form of uboot pinmux is different than linux mt7623 dts since we wrote a new pinctrl core after 4.19, and this new format is adopted by uboot 7623 at that time.

2 Likes

it’s time to copy complete DTS with all dependencies :slight_smile:

that brings nothing… i tried to copy relavant parts an hung on dt-bindings…

that was the point i hung :wink: maybe we should make a separate thread for pcie/ahci?

that was the point i hung :wink: maybe we should make a separate thread for pcie/ahci?

use the version i posted and add a phy driver

i have started new thread to outsource discussion about this

http://forum.banana-pi.org/t/bpi-r2-uboot-pcie-sata-ahaci/9613