litex-hub / linux-on-litex-vexriscv

Linux on LiteX-VexRiscv
BSD 2-Clause "Simplified" License
551 stars 174 forks source link

SD card booting fails #311

Open bakernat003 opened 1 year ago

bakernat003 commented 1 year ago

I have run into an issue when booting from an SD card. I am using a nexys video board. On commit 2059e65, Linux boots correctly when using a Gigastone SD card, but I get the error below when using a Sandisk SD card. On commit 82fa126e, Linux boots correctly from the Sandisk SD card but fails on the Gigastone SD card. Using SPISD, Linux boots succesfully on both SD cards.


--=============== SoC ==================--
CPU:            VexRiscv SMP-LINUX @ 100MHz
BUS:            WISHBONE 32-bit @ 4GiB
CSR:            32-bit data
ROM:            64KiB
SRAM:           6KiB
SDRAM:          524288KiB 16-bit @ 800MT/s (CL-7 CWL-5)

--========== Initialization ============--
Initializing SDRAM @0x40000000...
Switching SDRAM to software control.
Read leveling:
  m0, b00: |00000000000000000000000000000000| delays: -
  m0, b01: |00000000000000000000000000000000| delays: -
  m0, b02: |11111111111110000000000000000000| delays: 06+-06
  m0, b03: |00000000000000011111111111111000| delays: 22+-07
  m0, b04: |00000000000000000000000000000001| delays: 01+-02
  m0, b05: |00000000000000000000000000000000| delays: -
  m0, b06: |00000000000000000000000000000000| delays: -
  m0, b07: |00000000000000000000000000000000| delays: -
  best: m0, b03 delays: 22+-07
  m1, b00: |00000000000000000000000000000000| delays: -
  m1, b01: |00000000000000000000000000000000| delays: -
  m1, b02: |11111111111110000000000000000000| delays: 06+-06
  m1, b03: |00000000000000111111111111111000| delays: 21+-07
  m1, b04: |00000000000000000000000000000001| delays: 01+-02
  m1, b05: |00000000000000000000000000000000| delays: -
  m1, b06: |00000000000000000000000000000000| delays: -
  m1, b07: |00000000000000000000000000000000| delays: -
  best: m1, b03 delays: 21+-07
Switching SDRAM to hardware control.
Memtest at 0x40000000 (2.0MiB)...
  Write: 0x40000000-0x40200000 2.0MiB
   Read: 0x40000000-0x40200000 2.0MiB
Memtest OK
Memspeed at 0x40000000 (Sequential, 2.0MiB)...
  Write speed: 159.8MiB/s
   Read speed: 78.0MiB/s

--============== Boot ==================--
Booting from serial...
Press Q or ESC to abort boot completely.
sL5DdSMmkekro
             Timeout
Booting from SDCard in SD-Mode...
Booting from boot.json...
Booting from boot.bin...
SDCard boot failed.
No boot medium found

--============= Console ================--
matsbror commented 1 year ago

It might be the same issue I had. I found I had to build the bitsream using spisdcard in make.py.

However, I then get another boot problem which I will write in another issue.

enjoy-digital commented 1 year ago

Thanks @matsbror, @bakernat003 for reporting. I'll have a closer look and will try to do tests on a Nexys Video.