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

good news:

@weijiegao had posted ethernet-driver to uboot-Mailinglist and i have applied it to my repo

is ready-to-compile uboot 2018-11 with ethernet-Patches

also added menu-entry for tftp boot, filename and bootopts can be changed in uEnv.txt

also tried loading a big file (46MB) and works better than old uboot :slight_smile: not very fast, but enough

         285.2 KiB/s
done
Bytes transferred = 47428086 (2d3b1f6 hex)
2 Likes

Any chance to get sata-support?

any new state for r64?

Just FYI Version 2019-07 of U-boot is broken. Makes a board reset on initializing watchdog. 2019-04 works. Probable caused by generic watchdog-reset implementation

it seems this is because CONFIG_WATCHDOG is enabled

WDT: Started with servicing (60s timeout)

after that the reset happens. if i deactivate CONFIG_WATCHDOG i see this and no board-reset occours:

WDT:   Started without servicing (60s timeout)

it seems that problem is here:

and get_timer seems to hang on dm_timer_init

somewhere here is the hang:

if (ofnode_valid(node) &&
    uclass_get_device_by_ofnode(UCLASS_TIMER, node, &dev)) {

u-boot-bug is fixed with these 2 commits (second not yet in upstream):

have already included in my repo

1 Like

with the help of @ray we got sata working in uboot here

but we need some tuning before we can get it upstream (hifsys is currently initialized in ethsys where it is imho wrong placed)

@Ryder.Lee @weijiegao can you help here? where is the correct entry-point to initialize the hifsys? afaik there should be a new file using compatible “mediatek,mt2701-hifsys” to probe it and then initialize it independent from ethsys (= moving this code)…

https://elixir.bootlin.com/linux/v5.3-rc1/source/drivers/clk/mediatek/clk-mt2701-hif.c#L37

i tried moving code to new file, but it seems to not get probed:

seems i also need ops/bind

but I have not added hifsys in the driver…

Right,this change is from ray…he uses ethsys to initialize hifsys for pcie which is imho not the best way…but how to probe hifsys without ethsys-trigger (have it separated in my sata2-branch but probe is not called)?

Without this code pcie/ahci does not work

Is there any documentation about hifsys and the values used here?

@ray @Ryder.Lee send me 2 Patches for the hifsys-problem and i got it working using your Patches and adding power-domain in DTS

see https://github.com/frank-w/u-boot/commits/2019-07-bpi-r2-sata for full patches

BPI-R2> pci enum ; scsi scan                                                    
mtk_pcie_preinit: PCIe Link count=2                                             
scanning bus for devices...                                                     
Target spinup took 0 ms.                                                        
SATA link 1 timeout.                                                            
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.: ST750LM022 HN-M7 Rev: 2AR1                 
            Type: Hard Disk                                                     
            Capacity: 715404.8 MB = 698.6 GB (1465149168 x 512)                 
BPI-R2> ls scsi 0:1                                                             
            EFI/                                                                
      512   BOOTSECT.BAK                                                        
                                                                                
1 file(s), 1 dir(s)                                                             
                                                                                
BPI-R2> version                                                                 
U-Boot 2019.07-bpi-r2-sata-00032-g093be1b73d-dirty (Jul 29 2019 - 15:50:56 +020)
                                                                                
arm-linux-gnueabihf-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0            
GNU ld (GNU Binutils for Ubuntu) 2.30

ryder sent the Patches upstream, if they got accepted can you post your Patches too?

1 Like

ryder sent the Patches upstream, if they got accepted can you post your Patches too?

From what i see, the current PCIe driver is a intermediate version of upstream patch and it should switch to use the vanilla kernel’s one …

@ray: with the help of @ryder.lee i got the pcie-node converted to 32bit so we don’t need to change full dtsi-file to 64bit

i also used Patches from ryder (posted to mailing-list) as base and put your Patches on top (without hifsys-dts-node)

now we can focus on pcie-driver to be compatible with other soc using mainline-linux-driver

Sorry @frank-w, but it a bit silly :slight_smile: U-Boot may use FDT, may not. But it must supply full working board FDT to system. Just like PC BIOS supply ACPI info to OS. So better to include latest full DTS and make U-Boot to work with it.

imho we should only touch nodes needed to get pcie working and not convert all existing nodes to 64

do you need 64bit-nodes for EFI?

i don’t know how your EFI/Freebsd is working…but for linux there will passed the dts from linux-kernel (built-in or separately) to the system…so for this we don’t need the complete dts in uboot

Linux just hardcode everything :slight_smile:

FreeBSD has GENERIC kernel for AArch32, which cover many devices. Not all, but many.

We have option to make world better :slight_smile: And don’t make private kernel for each device.

So I vote for full, recent FDT tree.

we should add additional content later…

i’ve looked in linux pcie-driver (https://github.com/torvalds/linux/blob/master/drivers/pci/controller/pcie-mediatek.c) which is much bigger than your current version (and there is currently no mtk-pcie-driver in uboot)…so i think we also should add your version first and extend it later

i try to prepare my/your last commits for posting to mailinglist, ok?

All development kernels are private ones. Once things are sorted out, when things works, they can become a part of the GENERIC Linux kernel. Not before.

Yup. Many thanks to you!

There is nothing generic in your GENERIC, @igorpec :slight_smile:

Generic - mean something used by many.

In our case: by many devices.

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

will this be ok (patches 2-5)? i have “owned” the dts-patch as i did the 32bit-translation, in the others you are the author and i added subject-tagging and our signed-off & my tested

if you ack, i do the checkpatch and send it out if no problems found

If you don’t like idea to include whole DTS, then I just agree.

But better to copy linux one with set of required “dt-binding” and fix some drivers to work with it.