Skip to content

RFC arm: socfpga: Usability fixes

Marek Vasut u-boot 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest0 of 35 patches 0 repliesNew

Patches in v1 No applies recorded yet

None of the 35 patches the cover letter announces are in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [U-Boot] [PATCH 00/35][RFC] arm: socfpga: Usability fixes
Quoted 21 lines · dinguyen
Quoted 20 lines · Marek Vasut
Quoted 19 lines · Dinh Nguyen
Quoted 18 lines · Pavel Machek

Hi!

Quoted 11 lines · Marek Vasut

This entire RFC series is the first stab at making SoCFPGA usable with mainline U-Boot again. There are still some bits missing, but in general, this allows me to use mainline U-Boot on my SoCFPGA systems. The big missing part is the SPL generation, which still needs a lot of additional work.

This set contains patches for a few subsystems, bu the most part is the SoCFPGA chip support.

Most of the patches should be in good shape already, so I wonder if the RFC tag is really necessary.

Just... I earlier today I tested Marek's git tree based on this series, and it works well for me on board similar to sockit.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

So

Thanks and best regards,

Pavel

Quoted 27 lines
Quoted 27 lines
Quoted 27 lines

I applied all the patches to v2014.10-rc2, and I see that the watchdog has been enabled and it's getting reset:

U-Boot 2014.10-rc2-00139-g70e9e3e (Sep 16 2014 - 11:21:38)

CPU:   Altera SoCFPGA Platform
BOARD: Altera SoCFPGA Cyclone5 Board

Watchdog enabled

DRAM:
U-Boot SPL 2013.01.01-00019-g9cce15f (Jul 18 2013 - 13:05:43) SDRAM : Initializing MMR registers
SDRAM : Calibrating PHY
SEQ.C: Preparing to start memory calibration
SEQ.C: CALIBRATION PASSED
ALTERA DWMMC: 0
reading u-boot.img
reading u-boot.img

U-Boot 2014.10-rc2-00139-g70e9e3e (Sep 16 2014 - 11:21:38)

CPU:   Altera SoCFPGA Platform
BOARD: Altera SoCFPGA Cyclone5 Board
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

Watchdog enabled

DRAM:

This doesn't seem like a WDT problem. How much DRAM is there on that kit ? In

The devkit has 1GB.

Ah, thanks for this info!

Quoted 9 lines
Quoted 9 lines

any case, try this:

1) Edit arch/arm/cpu/armv7/socfpga/misc.c
2) Locate call to get_ram_size()
3) Replace this function call with the size of your DRAM in bytes.

   (that is, make it "gd->ram_size = 128 * 1024 * 1024;" if you have
   128MiB)
Quoted 6 lines
Quoted 2 lines

I suspect get_ram_size() on socfpga is still broken in mainline and causes this crash you observe.

Yes, tracked it down to get_ram_size(). I forced gd->ram_size to 1GB and it works fine for me now. I'll try to spend some cycles to debug the problem.

Hmmmmm, how much DRAM can the SoCFPGA chip drive in total ?

Well, consider a theoretical SoCFPGA board with 128MiB of DRAM attached to it, what happens if I try to write at address of the 129th MiB (which is past the DRAM) ? Will this generate an DABT for the ARM core or will some kind of DRAM "mirroring" or "wraparound" happen such that I would write to the content of 1st MiB of the DRAM ?

If I would get DABT, then there is a rather easy fix for that, see arch/arm/cpu/arm926ejs/mxs/spl_mem_init.c and mxs_mem_get_size() function. The function places an assembly return instruction into the DABT handler entry position (offset 0x14 in ARM vector table IIRC) and then runs the get_dram_size() . The assembly instruction only returns from the DABT handler right past the code where the DABT happened. For the get_ram_size(), the read from the unpopulated DRAM space contains zeroes and the function doesn't even realize the DABT happened. But it considers the DRAM invalid and thus this works correctly. That's how it detects the amount of DRAM.

You might want to consider something similar if that's how it behaves on SoCFPGA.

Quoted 4 lines
Quoted 2 lines

btw you don't happen to have a spare CV and AV kits you could send me, so I can do the testing rounds on them too, do you ?

I'll look around.

Thanks!