BPI-R64 current u-boot support

hi, it does not contain any code for r64…

it would be nice to start repo with upstream u-boot and add your Patches on top (not one commit including upstream-source mixed with your changes), so everybody can see what is changed…

as an example i’ve added content of this folder to a branch in my repo:

https://github.com/frank-w/u-boot/commits/2019-07-bpi

but good that are no objects and generated files in the folder uploaded :slight_smile:

1 Like

@sinovoip Many thanks!

Why don’t you push it as fork of mainline uboot?

1 Like

Update our latest status for developing mt7622 upstream uboot
We have some major differences with Ray’s version

  1. We use 64-bit u-boot because it is reasonable for 7622 which is ARMv8 architecture
  2. We focus on Nand/Nor flash first, due to we use RFBs which are SPI-nand/SPI-nor
    We will try Ray’s eMMC/SD patches to test eMMC and SD directly in BPIR64.

Status:

  • Serial - done
  • Timer - done
  • SD - not started
  • eMMC - ongoing
  • SNFI - done (for nand/nor)
  • Ethernet - ongoing
  • Switch - ongoing
  • PCI-E - todo
  • USB - todo
  • Clock - done (also fix some bugs in mtk-clk.c)
  • Pinctrl - done
  • Watchdog - ongoing
  • Reset - ongoing

It seems that some works are overlapping (with Ray’s works), maybe we can integrate the patches of both sides, but we think mt7622 upstrem u-boot should be 64 bits.

1 Like

Can we see your current work to compare / migrate to 64bit too?

@Ryder.Lee @moore @sam33 Hi guys!

Guys, can you please tell me: why do you put support of completely different PCI-E controller into same linux driver?

We are still sorting the patches.
It also takes some time to integrate ethernet/switch.

No reason. Just share part of probing flow.

@Ryder.Lee @sam33 Many thanks!

You can post patches without ethernet while working on it like ryder did for mt7623. This way we can work on this base. Seems like ray tries to work on pcie/sata/usb. Maybe atf-problem is only on 32bit and at least sd-card is working. Just to avoid redundant work and have same codebase for easier integration.

@sam33 I can give you access to my tree, so we will work together on it.

@sam33 @Ryder.Lee Guys, please tell me, is it possible to configure pci-e controller to not make aliases in config space?

Because, currently on every level(top where bridge is and inner where connected device) it respond with same data for all possible slots. So 0/0/0, 0/1/0, 0/2/0 reported as same bridge.

@moore @sam33 @Ryder.Lee @sinovoip Hello guys!

I have weird problem, can’t get GPIO90 to hold “1” state.

According to diagram in the manual, actual GPIOs state can be read within DIN even if DIR set to output.

But I always read “0”. (Only on uboot start it read as “1”, any operation make it “0” and no way back)

Already tried many combinations, but no luck.

10211020 DIR3 bit26 to "1"
10211120 DOUT3 bit26 "1"
10211360 MODE6 bits24-27 - tried "1" (and "0", "2")
10211C10 SR bit3 - "0" by default
10211C20 SMT bit3 - "0" by default
10211C30 PU bit3 switched from "1" to "0"
10211C40 PD bit3 - tried both "0" and "1"
10211C60 E4 bit3 - "0" be default
10211C70 E8 bit3 - tried both "0" and "1"

Can you please help me?

GPIO 90 is connected to Asmedia chip which is used to switch between PCIe@1,0 and SATA functions. i.e. output-high: PCIe, output-low: SATA. Below is my way to set GPIO90 to high for your reference, thanks.

  pcie_sata_mux_pin_default: pcie_stat_mux_default {
                pins_gpio90 {
                        pinmux = <MT7622_PIN_90_AUXIN3__FUNC_GPIO90>;
                        output-high;
                };
        };

Yes, I know that. I use gpio-hog for that:

    asm_sel {
            gpio-hog;
            gpios = <90 GPIO_ACTIVE_HIGH>;
            output-high;
    };

But I want to make a way, to switch that function any time (PCI-E/SATA/SATA-in-PCI-E-slot).

But GPIO90, even whole group 87-90, behave weird. So I want to know:

  1. is there a difference for that GPIOs in hardware?
  2. or how to make it to work correctly, so I will be able to set it in DOUT and read same value from DIN?

Currently I see preloader can set that pin, but from u-boot I can’t.

Maybe, you can give me source of GPIO control of preloader? Think it is not much secret thing :slight_smile:

AUXIN0 pin = gpio87
AUXIN1 pin = gpio88
AUXIN2 pin = gpio89
AUXIN3 pin = gpio90

and default value of 0x10211CF0 [GPIO_G4_MISC] is 0000000C.

bit3: AUX    IN3 AGPIO Digital Pad Enable
bit2: AUXIN2 AGPIO Digital Pad Enable
bit1: AUXIN1 AGPIO Digital Pad Enable
bit0: AUXIN0 AGPIO Digital Pad Enable
0: Disabled
1: Enabled

so you need to set 0x10211CF0[3:0]=0’b1111 if you want to make gpio87-90 can work at gpio mode, thanks.

Thanks a lot, @moore!

I’m tried, still no luck with read back.

But I did test, that makes me sure it works:

U-Boot MT7622> gpio clear 90
gpio: pin 90 (gpio 90) value is 0
U-Boot MT7622> gpio set 90  
gpio: pin 90 (gpio 90) value is 1
   Warning: value of pin is still 0
U-Boot MT7622> gpio clear 90
gpio: pin 90 (gpio 90) value is 0
U-Boot MT7622> scsi scan
  • If I do reset and run scsi scan, I see no HDD;
  • If I do reset, clear 90 and run scsi scan, HDD found;
  • If I do reset, clear 90, set 90 and run scsi scan, I see no HDD;
  • If I do reset, clear 90, set 90, clear 90 and run scsi scan, HDD found.

Let’s hope we have only two states :)))))

@sinovoip do you able to use PCI-E (not USB with pcie connector) device in pcie1 slot?

I can’t find any proofs that this works for anybody.

Thanks!

UPD: @frank-w tested it and got working module on both slots.

With same SD image my two cards (SATA and WiFi) detected in 1st slot, but not in second :frowning:

have tried now a fullsize card and got same issue like you…it’s recognized on cn25 but not on cn8

if no card is inserted or card is inserted in cn8 lspci does not show pcie host controller, if card is inserted in cn25 i got this output

root@bpi-r64:~# lspci                                                           
00:00.0 PCI bridge: MEDIATEK Corp. Device 3258                                  
01:00.0 Network controller: Qualcomm Atheros QCA986x/988x 802.11ac Wireless Netr
root@bpi-r64:~#

i think at least the first entry should be listed if no card is inserted or card in cn8

if i insert a halfsize-card (intel wifi card with model number: 633ANHMW) in the cn8 it is recognized:

root@bpi-r64:~# lspci                                                           
00:01.0 PCI bridge: MEDIATEK Corp. Device 3258                                  
01:00.0 Network controller: Intel Corporation Centrino Ultimate-N 6300 (rev 35) 
root@bpi-r64:~#

i wonder why pci-bus of the card is same as above because it’s the other slot and pcie-controller bus address differs

but i think we should create a new topic for this pcie-issue

@sam33 @Ryder.Lee can you give a current state? is there any timeplan?

will submit it before 12/E