openhwgroup / cva6-sdk

CVA6 SDK containing RISC-V tools and Buildroot
59 stars 64 forks source link

ERROR: can't get kernel image! #75

Closed davidmallasen closed 1 year ago

davidmallasen commented 1 year ago

Hello, this is a ping from https://github.com/openhwgroup/cva6/issues/653 .

When following the make images -> make flash-sdcard workflow I get the following error when executing on the Genesys II FPGA:

Hello World!
init SPI
status: 0x0000000000000025
status: 0x0000000000000025
SPI initialized!
initializing SD... 
SD command cmd0     response : 01
SD command cmd55    response : 01
SD command cmd41    response : 01
SD command cmd55    response : 01
SD command cmd41    response : 01
SD command cmd55    response : 01
SD command cmd41    response : 01
SD command cmd55    response : 01
SD command cmd41    response : 01
SD command cmd55    response : 01
SD command cmd41    response : 01
SD command cmd55    response : 01
SD command cmd41    response : 01
SD command cmd55    response : 01
SD command cmd41    response : 01
SD command cmd55    response : 01
SD command cmd41    response : 01
SD command cmd55    response : 01
SD command cmd41    response : 01
SD command cmd55    response : 01
SD command cmd41    response : 01
SD command cmd55    response : 01
SD command cmd41    response : 01
SD command cmd55    response : 01
SD command cmd41    response : 01
SD command cmd55    response : 01
SD command cmd41    response : 01
SD command cmd55    response : 01
SD command cmd41    response : 01
SD command cmd55    response : 01
SD command cmd41    response : 01
SD command cmd55    response : 01
SD command cmd41    response : 01
SD command cmd55    response : 01
SD command cmd41    response : 01
SD command cmd55    response : 01
SD command cmd41    response : 01
SD command cmd55    response : 01
SD command cmd41    response : 01
SD command cmd55    response : 01
SD command cmd41    response : 01
SD command cmd55    response : 01
SD command cmd41    response : 01
SD command cmd55    response : 01
SD command cmd41    response : 01
SD command cmd55    response : 01
SD command cmd41    response : 01
SD command cmd55    response : 01
SD command cmd41    response : 01
SD command cmd55    response : 01
SD command cmd41    response : 00
sd initialized!
gpt partition table header:
    signature:  5452415020494645
    revision:   00010000
    size:       0000005C
    crc_header: FF2687E0
    reserved:   00000000
    current lba:    0000000000000001
    backup lda: 0000000001DACBFF
    partition entries lba:      0000000000000002
    number partition entries:   00000080
    size partition entries:     00000080
gpt partition entry 00
    partition type guid:    D5F7127456A1134B81DC867174929325
    partition guid:         17E881CAB295AA4E815C160BD796CD12
    first lba:  0000000000000800
    last lba:   0000000000001AFD
    attributes: 0000000000000000
    name:   000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
gpt partition entry 01
    partition type guid:    AF3DC60F838472478E793D69D8477DE4
    partition guid:         E953DAB848913B47AB94C61A5D7BD2B1
    first lba:  0000000000100000
    last lba:   0000000001DACBDE
    attributes: 0000000000000000
    name:   000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
gpt partition entry 02
    partition type guid:    00000000000000000000000000000000
    partition guid:         00000000000000000000000000000000
    first lba:  0000000000000000
    last lba:   0000000000000000
    attributes: 0000000000000000
    name:   000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
gpt partition entry 03
    partition type guid:    00000000000000000000000000000000
    partition guid:         00000000000000000000000000000000
    first lba:  0000000000000000
    last lba:   0000000000000000
    attributes: 0000000000000000
    name:   000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
copying boot image .... done!

OpenSBI v0.9
   ____                    _____ ____ _____
  / __ \                  / ____|  _ \_   _|
 | |  | |_ __   ___ _ __ | (___ | |_) || |
 | |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |
 | |__| | |_) |  __/ | | |____) | |_) || |_
  \____/| .__/ \___|_| |_|_____/|____/_____|
        | |
        |_|

Platform Name             : ARIANE RISC-V
Platform Features         : medeleg
Platform HART Count       : 1
Platform IPI Device       : aclint-mswi
Platform Timer Device     : aclint-mtimer @ 1000000Hz
Platform Console Device   : uart8250
Platform HSM Device       : ---
Platform Reboot Device    : ---
Platform Shutdown Device  : ---
Firmware Base             : 0x80000000
Firmware Size             : 220 KB
Runtime SBI Version       : 0.3

Domain0 Name              : root
Domain0 Boot HART         : 0
Domain0 HARTs             : 0*
Domain0 Region00          : 0x0000000002008000-0x000000000200bfff (I)
Domain0 Region01          : 0x0000000002000000-0x0000000002007fff (I)
Domain0 Region02          : 0x0000000080000000-0x000000008003ffff ()
Domain0 Region03          : 0x0000000000000000-0xffffffffffffffff (R,W,X)
Domain0 Next Address      : 0x0000000080200000
Domain0 Next Arg1         : 0x0000000082200000
Domain0 Next Mode         : S-mode
Domain0 SysReset          : yes

Boot HART ID              : 0
Boot HART Domain          : root
Boot HART ISA             : rv64imafdcsux
Boot HART Features        : scounteren,mcounteren
Boot HART PMP Count       : 16
Boot HART PMP Granularity : 8
Boot HART PMP Address Bits: 54
Boot HART MHPM Count      : 0
Boot HART MIDELEG         : 0x0000000000000222
Boot HART MEDELEG         : 0x000000000000b109

U-Boot 2021.07-rc4-g920075ecfa (Nov 24 2022 - 18:04:38 +0100)

CPU:   rv64imafdc
DRAM:  1 GiB
MMC:   xps-spi@20000000:mmc@0: 0
Loading Environment from nowhere... OK
In:    uart@10000000
Out:   uart@10000000
Err:   uart@10000000
Net:   No ethernet found.
Hit any key to stop autoboot:  5  4  3  2  1  0 
Device: xps-spi@20000000:mmc@0
Manufacturer ID: 3
OEM: 5344
Name: SC16G 
Bus Speed: 12500000
Mode: MMC legacy
Rd Block Len: 512
SD version 2.0
High Capacity: Yes
Capacity: 14.8 GiB
Bus Width: 1-bit

MMC read: dev # 0, block # 1048576, count 20480 ... 20480 blocks read: OK
## Booting kernel from Legacy Image at 90000000 ...
   Image Name:   CV64A6Linux
   Image Type:   RISC-V Linux Kernel Image (gzip compressed)
   Data Size:    10832319 Bytes = 10.3 MiB
   Load Address: 80200000
   Entry Point:  80200000
   Verifying Checksum ... Bad Data CRC
ERROR: can't get kernel image!
=>

The output of xxd /dev/sde2 | head and xxd install64/uImage | head is the same:

00000000: 2705 1956 78fd 6b8a 637f a43a 00a5 49bf  '..Vx.k.c..:..I.
00000010: 8020 0000 8020 0000 6933 677b 051a 0201  . ... ..i3g{....
00000020: 4356 3634 4136 4c69 6e75 7800 0000 0000  CV64A6Linux.....
00000030: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000040: 1f8b 0808 39a4 7f63 0203 496d 6167 6500  ....9..c..Image.
00000050: ec59 7b54 5357 badf e79c 9c84 00b6 a191  .Y{TSW..........
00000060: 1e59 ad6d 2082 35f6 ba62 ad52 6bd5 8806  .Y.m .5..b.Rk...
00000070: 3477 a48c ad5a ed2b 1804 b15a f182 c3c5  4w...Z.+...Z....
00000080: 5ea7 09c9 4908 8f8a 37e2 9682 6364 0434  ^...I...7...cd.4
00000090: 9d3a b18c 52ad 8f38 4ab9 dab1 63ef 6d75  .:..R..8J...c.mu
davidmallasen commented 1 year ago

Solved in https://github.com/openhwgroup/cva6/issues/653 thanks to @eyssartk :

You have to hit a key to stop the autoboot in u-boot. Then you type :

mmc read 90000000 100000 6000
setenv fdt_high 0xFFFFFFFFFFFFFFFF
bootm 90000000 - $(fdtcontroladdr)