riscv-software-src / opensbi

RISC-V Open Source Supervisor Binary Interface
Other
1.02k stars 507 forks source link

boot error while loading andriod kernel image. #226

Open cghalibkhan opened 3 years ago

cghalibkhan commented 3 years ago

Hi,

I'm trying to boot android kernel from u-boot but stuck with sbi_trap_error: hart1: trap handler failed (error -2), find the following procedure with error.

=> setenv ipaddr 10.168.1.76 => setenv netmask 255.255.252.0 => setenv serverip 10.168.1.25 => setenv gateway 10.168.1.1 => tftpboot ${kernel_addr_r} vmlinux ethernet@10090000: PHY present at 0 ethernet@10090000: Starting autonegotiation... ethernet@10090000: Autonegotiation complete ethernet@10090000: link up, 1000Mbps full-duplex (lpa: 0x3800) Using ethernet@10090000 device TFTP from server 10.168.1.25; our IP address is 10.168.1.76 Filename 'vmlinux'. Load address: 0x84000000 Loading: ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# #########################################=> booti ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r} Moving Image from 0x84000000 to 0x80000000, end=180f30002 sbi_trap_error: hart1: trap handler failed (error -2) sbi_trap_error: hart1: mcause=0x0000000000000007 mtval=0x0000000080000000 sbi_trap_error: hart1: mepc=0x00000000fff7c818 mstatus=0x8000000a00006800 sbi_trap_error: hart1: ra=0x00000000fff7d8c6 sp=0x00000000ff755970 sbi_trap_error: hart1: gp=0x00000000ff75ae30 tp=0x0000000000000001 sbi_trap_error: hart1: s0=0x0000000084000000 s1=0x0000000000000000 sbi_trap_error: hart1: a0=0x0000000080000000 a1=0x0000000084000000 sbi_trap_error: hart1: a2=0x00010102464c457f a3=0x0000000000000000 sbi_trap_error: hart1: a4=0x0000000100f30002 a5=0xffffffe000000000 sbi_trap_error: hart1: a6=0x0000000000000040 a7=0x00000000010946f8 sbi_trap_error: hart1: s2=0x0000000000000003 s3=0x0000000000000000 sbi_trap_error: hart1: s4=0x0000000000000000 s5=0x00000000fffe5b60 sbi_trap_error: hart1: s6=0x00000000ff771f28 s7=0x00000000ff76e360 sbi_trap_error: hart1: s8=0x0000000000000000 s9=0x0000000000000000 sbi_trap_error: hart1: s10=0x0000000000000000 s11=0x0000000000000000 sbi_trap_error: hart1: t0=0x0000000180f2ff83 t1=0x0038004000000001 sbi_trap_error: hart1: t2=0x001a001b00400004 t3=0x0000000500000001 sbi_trap_error: hart1: t4=0x0000000000001000 t5=0xffffffe000000000 sbi_trap_error: hart1: t6=0x0000000080000000######################## ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ############### 2 MiB/s done Bytes transferred = 17386936 (1094db8 hex) => tftpboot ${ramdisk_addr_r} ramdisk.img ethernet@10090000: PHY present at 0 ethernet@10090000: Starting autonegotiation... ethernet@10090000: Autonegotiation complete ethernet@10090000: link up, 1000Mbps full-duplex (lpa: 0x3800) Using ethernet@10090000 device TFTP from server 10.168.1.25; our IP address is 10.168.1.76 Filename 'ramdisk.img'. Load address: 0x88300000 Loading: # 14.6 KiB/s done Bytes transferred = 62 (3e hex) => tftpboot ${fdt_addr_r} hifive-unleashed-a00.dtb ethernet@10090000: PHY present at 0 ethernet@10090000: Starting autonegotiation... ethernet@10090000: Autonegotiation complete ethernet@10090000: link up, 1000Mbps full-duplex (lpa: 0x3800) Using ethernet@10090000 device TFTP from server 10.168.1.25; our IP address is 10.168.1.76 Filename 'hifive-unleashed-a00.dtb'. Load address: 0x88000000 Loading: # 844.7 KiB/s done Bytes transferred = 6055 (17a7 hex) => booti ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r} Moving Image from 0x84000000 to 0x80000000, end=180f30002 sbi_trap_error: hart1: trap handler failed (error -2) sbi_trap_error: hart1: mcause=0x0000000000000007 mtval=0x0000000080000000 sbi_trap_error: hart1: mepc=0x00000000fff7c818 mstatus=0x8000000a00006800 sbi_trap_error: hart1: ra=0x00000000fff7d8c6 sp=0x00000000ff755970 sbi_trap_error: hart1: gp=0x00000000ff75ae30 tp=0x0000000000000001 sbi_trap_error: hart1: s0=0x0000000084000000 s1=0x0000000000000000 sbi_trap_error: hart1: a0=0x0000000080000000 a1=0x0000000084000000 sbi_trap_error: hart1: a2=0x00010102464c457f a3=0x0000000000000000 sbi_trap_error: hart1: a4=0x0000000100f30002 a5=0xffffffe000000000 sbi_trap_error: hart1: a6=0x0000000000000040 a7=0x00000000010946f8 sbi_trap_error: hart1: s2=0x0000000000000003 s3=0x0000000000000000 sbi_trap_error: hart1: s4=0x0000000000000000 s5=0x00000000fffe5b60 sbi_trap_error: hart1: s6=0x00000000ff771f28 s7=0x00000000ff76e360 sbi_trap_error: hart1: s8=0x0000000000000000 s9=0x0000000000000000 sbi_trap_error: hart1: s10=0x0000000000000000 s11=0x0000000000000000 sbi_trap_error: hart1: t0=0x0000000180f2ff83 t1=0x0038004000000001 sbi_trap_error: hart1: t2=0x001a001b00400004 t3=0x0000000500000001 sbi_trap_error: hart1: t4=0x0000000000001000 t5=0xffffffe000000000 sbi_trap_error: hart1: t6=0x0000000080000000

Thanks & Regards Ghalib Khan.

avpatel commented 3 years ago

You are trying to TFTP at the location where OpenSBI is running which is resulting in access fault because OpenSBI protects itself using PMP.

Change your u-boot variables to TFTP at some other location.

Regards, Anup