[U-Boot] Problem in relocate_code on Xilinx FPGA

Hi
I am trying to use u-boot on a Xilinx V4FX12 FPGA, in which a ppc405 system is running. The board includes an ST SPI Flash, which I have to use as the only non-volatile memory available (in case important, its Atmark Techno suzaku_v sz410). I have been able to add the board configuration in u-boot and build an image. But, as ppc405 in xilinx fpga can't but from spi flash, I have to use a first stage bootloader to load u-boot. This seems to be normal in xilinx FPGAs as u-boot in petalinux is loaded to. I thaught, if that's the case, I should be able to load u-boot directly to DDR and test it. But when I do so, u-boot hangs after it reaches relocate_code. I should be missing sth, but don't find it. Could anybody help me?

Seyyed Mohammad Sajjadi wrote:
Hi
I am trying to use u-boot on a Xilinx V4FX12 FPGA, in which a ppc405 system is running. The board includes an ST SPI Flash, which I have to use as the only non-volatile memory available (in case important, its Atmark Techno suzaku_v sz410).
I have been able to add the board configuration in u-boot and build an image. But, as ppc405 in xilinx fpga can't but from spi flash, I have to use a first stage bootloader to load u-boot. This seems to be normal in xilinx FPGAs as u-boot in petalinux is loaded to. I thaught, if that's the case, I should be able to load u-boot directly to DDR and test it. But when I do so, u-boot hangs after it reaches relocate_code. I should be missing sth, but don't find it. Could anybody help me?
Hi Seyyed,
I'm not familiar with your hardware (including using the ppc405), but if I understand you correctly, you are trying to manually (e.g. via a debugger) load a test u-boot into DDR and then run it from there.
The typical problem with this approach is that your code does the DDR initialization *while running out of DDR*. While DDR is being initialized, it doesn't work as RAM, which causes your program to crash.
You need to find all of your DDR and processor initialization that causes u-boot initialization to crash, and disable it. There are board configurations that do this with #if constructs, but I don't remember which ones.
For the discouraging discussion, see: http://www.denx.de/wiki/view/DULG/CanUBootBeConfiguredSuchThatItCanBeStartedInRAM
Best regards, gvb

On Sat, Apr 18, 2009 at 6:08 AM, Jerry Van Baren gvb.uboot@gmail.com wrote:
Seyyed Mohammad Sajjadi wrote:
Hi
I am trying to use u-boot on a Xilinx V4FX12 FPGA, in which a ppc405 system is running. The board includes an ST SPI Flash, which I have to use as the only non-volatile memory available (in case important, its Atmark Techno suzaku_v sz410).
I have been able to add the board configuration in u-boot and build an image. But, as ppc405 in xilinx fpga can't but from spi flash, I have to use a first stage bootloader to load u-boot. This seems to be normal in xilinx FPGAs as u-boot in petalinux is loaded to. I thaught, if that's the case, I should be able to load u-boot directly to DDR and test it. But when I do so, u-boot hangs after it reaches relocate_code. I should be missing sth, but don't find it. Could anybody help me?
Hi Seyyed,
I'm not familiar with your hardware (including using the ppc405), but if I understand you correctly, you are trying to manually (e.g. via a debugger) load a test u-boot into DDR and then run it from there.
The typical problem with this approach is that your code does the DDR initialization *while running out of DDR*. While DDR is being initialized, it doesn't work as RAM, which causes your program to crash.
Probably not the case here. The Virtex is an interesting platform because DDR is already configured when the processor comes out of reset. The software doesn't even have the ability to modify the DDR configuration.
You need to find all of your DDR and processor initialization that causes u-boot initialization to crash, and disable it. There are board configurations that do this with #if constructs, but I don't remember which ones.
This should already be the case for Virtex.
Seyyed, what you are trying to do is also already done for ml507_config. Try looking at that code for hints.
g.

I could pass the relocate_code portion in my design (Suaku_V/Xilinx Virtex 4-PPC405). I had some minor issues setting RAM variables, which I could solve using ppc405-generic platform. Now I am stuck at xilinx spi driver. I tried to develop a polled mode driver using xilinx standalone and linux drivers for spi. But the driver seems not to work, as it returns 0 all the time. hasn't anybody developed a driver for that in u-boot?
participants (3)
-
Grant Likely
-
Jerry Van Baren
-
Seyyed Mohammad Sajjadi