psicrushgx
2008-03-17 00:39:56 UTC
Hello all,
I am working with the LEON3 processor on the Xilinx ML505 board. As a
first step in a project, I needed to replace the included memory
controller (ddr2spa64a.vhd) with one generated by Xilinx COREGEN. To
do this, I designed a simple AHB slave that interfaced to the new
memory controller and configured the slave to have the same address
space as the original memory controller. I've tested this memory
controller with a hardware testbench and it seems to work fine.
I can connect to the processor with GRMON and can successfully verify
a Linux-2.0 Snapgear image after it's been loaded into memory. (I know
this image is valid because I've tested this image before on an
unmodified LEON.) However, I get garbled output from the Linux console
over the serial port and execution seems to halt quickly. Here are
some things I've noticed:
1) Immediately upon connecting GRMON to the processor, it displays the
warning: "stack pointer not set".
2) "info sys", included at the end of this message, shows the memory
controller on the AHB bus as slave 0. I copied the membar and iobar
values from the existing memory controller so that the new controller
occupies the same address and IO space.
3) The LEON3 DSU shows the stack pointer as 0x0 instead of 0x4ffffff0,
the value seen with the original memory controller.
4) Reads and writes with "x <address>" and "wmem <address> <value>"
seem to work fine. Loading an image and running the "verify" command
on it succeeds. However, running it outputs garbled output on the
serial port and halts shortly with the message "Warning: Stack pointer
not set".
5) I tried to manually set the stack pointer to 0x4ffffff0 with
GRMON's "stack" command, but was only able to set the stack pointer to
the address 0x4fffff00. Running Linux still produces the same behavior
-- garbled output and stopped execution.
So my questions are:
1) Where is the stack pointer stored? Why is it defaulting to 0x0 on
startup? What is its relationship to the memory controller?
2) Is the ddr2spa64 module responsible for more than just writes and
reads? Is there some additional, undocumented functionality that this
module takes on?
3) If the "verify" command succeeds, does that establish that the
memory controller I added is likely to be functionally correct?
4) Is the stack pointer causing problems with Snapgear or is something
else the culprit here?
Thanks in advance everyone.
-Peter
----
Here is the "info sys" output from GRMON. The memory controller I've
added shows up under "00.01:079 Gaisler Research WildCard Interface".
(I didn't want to experiment with adding new Vendor ID's.)
grlib> info sys
00.01:003 Gaisler Research LEON3 SPARC V8 Processor (ver 0x0)
ahb master 0
01.01:007 Gaisler Research AHB Debug UART (ver 0x0)
ahb master 1
apb: 80000700 - 80000800
baud rate 115200, ahb frequency 80.00
02.01:01c Gaisler Research AHB Debug JTAG TAP (ver 0x0)
ahb master 2
03.01:01d Gaisler Research GR Ethernet MAC (ver 0x0)
ahb master 3, irq 12
apb: 80000b00 - 80000c00
edcl ip 192.168.1.52, buffer 2 kbyte
00.01:079 Gaisler Research WildCard Interface (ver 0x0)
ahb: 40000000 - 60000000
ahb: fff00100 - fff00200
01.01:006 Gaisler Research AHB/APB Bridge (ver 0x0)
ahb: 80000000 - 80100000
02.01:004 Gaisler Research LEON3 Debug Support Unit (ver 0x1)
ahb: 90000000 - a0000000
AHB trace 128 lines, stack pointer 0x00000000
CPU#0 win 8, hwbp 2, itrace 128, lddel 1
icache 2 * 8 kbyte, 32 byte/line lru
dcache 1 * 8 kbyte, 16 byte/line lru
03.04:00f European Space Agency LEON2 Memory Controller (ver 0x1)
ahb: 00000000 - 20000000
ahb: 20000000 - 40000000
ahb: c0000000 - c2000000
apb: 80000000 - 80000100
16-bit prom @ 0x00000000
01.01:00c Gaisler Research Generic APB UART (ver 0x1)
irq 2
apb: 80000100 - 80000200
baud rate 38400
02.01:00d Gaisler Research Multi-processor Interrupt Ctrl (ver 0x3)
apb: 80000200 - 80000300
03.01:011 Gaisler Research Modular Timer Unit (ver 0x0)
irq 8
apb: 80000300 - 80000400
8-bit scaler, 2 * 32-bit timers, divisor 80
04.01:060 Gaisler Research Keyboard PS/2 interface (ver 0x1)
irq 4
apb: 80000400 - 80000500
05.01:060 Gaisler Research Keyboard PS/2 interface (ver 0x1)
irq 5
apb: 80000500 - 80000600
08.01:01a Gaisler Research General purpose I/O port (ver 0x0)
apb: 80000800 - 80000900
0c.01:028 Gaisler Research AMBA Wrapper for OC I2C-master (ver 0x0)
irq 11
apb: 80000c00 - 80000d00
0f.01:052 Gaisler Research AHB status register (ver 0x0)
irq 7
apb: 80000f00 - 80001000
------------------------------------
I am working with the LEON3 processor on the Xilinx ML505 board. As a
first step in a project, I needed to replace the included memory
controller (ddr2spa64a.vhd) with one generated by Xilinx COREGEN. To
do this, I designed a simple AHB slave that interfaced to the new
memory controller and configured the slave to have the same address
space as the original memory controller. I've tested this memory
controller with a hardware testbench and it seems to work fine.
I can connect to the processor with GRMON and can successfully verify
a Linux-2.0 Snapgear image after it's been loaded into memory. (I know
this image is valid because I've tested this image before on an
unmodified LEON.) However, I get garbled output from the Linux console
over the serial port and execution seems to halt quickly. Here are
some things I've noticed:
1) Immediately upon connecting GRMON to the processor, it displays the
warning: "stack pointer not set".
2) "info sys", included at the end of this message, shows the memory
controller on the AHB bus as slave 0. I copied the membar and iobar
values from the existing memory controller so that the new controller
occupies the same address and IO space.
3) The LEON3 DSU shows the stack pointer as 0x0 instead of 0x4ffffff0,
the value seen with the original memory controller.
4) Reads and writes with "x <address>" and "wmem <address> <value>"
seem to work fine. Loading an image and running the "verify" command
on it succeeds. However, running it outputs garbled output on the
serial port and halts shortly with the message "Warning: Stack pointer
not set".
5) I tried to manually set the stack pointer to 0x4ffffff0 with
GRMON's "stack" command, but was only able to set the stack pointer to
the address 0x4fffff00. Running Linux still produces the same behavior
-- garbled output and stopped execution.
So my questions are:
1) Where is the stack pointer stored? Why is it defaulting to 0x0 on
startup? What is its relationship to the memory controller?
2) Is the ddr2spa64 module responsible for more than just writes and
reads? Is there some additional, undocumented functionality that this
module takes on?
3) If the "verify" command succeeds, does that establish that the
memory controller I added is likely to be functionally correct?
4) Is the stack pointer causing problems with Snapgear or is something
else the culprit here?
Thanks in advance everyone.
-Peter
----
Here is the "info sys" output from GRMON. The memory controller I've
added shows up under "00.01:079 Gaisler Research WildCard Interface".
(I didn't want to experiment with adding new Vendor ID's.)
grlib> info sys
00.01:003 Gaisler Research LEON3 SPARC V8 Processor (ver 0x0)
ahb master 0
01.01:007 Gaisler Research AHB Debug UART (ver 0x0)
ahb master 1
apb: 80000700 - 80000800
baud rate 115200, ahb frequency 80.00
02.01:01c Gaisler Research AHB Debug JTAG TAP (ver 0x0)
ahb master 2
03.01:01d Gaisler Research GR Ethernet MAC (ver 0x0)
ahb master 3, irq 12
apb: 80000b00 - 80000c00
edcl ip 192.168.1.52, buffer 2 kbyte
00.01:079 Gaisler Research WildCard Interface (ver 0x0)
ahb: 40000000 - 60000000
ahb: fff00100 - fff00200
01.01:006 Gaisler Research AHB/APB Bridge (ver 0x0)
ahb: 80000000 - 80100000
02.01:004 Gaisler Research LEON3 Debug Support Unit (ver 0x1)
ahb: 90000000 - a0000000
AHB trace 128 lines, stack pointer 0x00000000
CPU#0 win 8, hwbp 2, itrace 128, lddel 1
icache 2 * 8 kbyte, 32 byte/line lru
dcache 1 * 8 kbyte, 16 byte/line lru
03.04:00f European Space Agency LEON2 Memory Controller (ver 0x1)
ahb: 00000000 - 20000000
ahb: 20000000 - 40000000
ahb: c0000000 - c2000000
apb: 80000000 - 80000100
16-bit prom @ 0x00000000
01.01:00c Gaisler Research Generic APB UART (ver 0x1)
irq 2
apb: 80000100 - 80000200
baud rate 38400
02.01:00d Gaisler Research Multi-processor Interrupt Ctrl (ver 0x3)
apb: 80000200 - 80000300
03.01:011 Gaisler Research Modular Timer Unit (ver 0x0)
irq 8
apb: 80000300 - 80000400
8-bit scaler, 2 * 32-bit timers, divisor 80
04.01:060 Gaisler Research Keyboard PS/2 interface (ver 0x1)
irq 4
apb: 80000400 - 80000500
05.01:060 Gaisler Research Keyboard PS/2 interface (ver 0x1)
irq 5
apb: 80000500 - 80000600
08.01:01a Gaisler Research General purpose I/O port (ver 0x0)
apb: 80000800 - 80000900
0c.01:028 Gaisler Research AMBA Wrapper for OC I2C-master (ver 0x0)
irq 11
apb: 80000c00 - 80000d00
0f.01:052 Gaisler Research AHB status register (ver 0x0)
irq 7
apb: 80000f00 - 80001000
------------------------------------