From nobody Sun Feb 27 19:48:34 2022 X-Original-To: freebsd-riscv@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 5229D19E8468 for ; Sun, 27 Feb 2022 19:48:49 +0000 (UTC) (envelope-from julien.cassette@gmail.com) Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4K6DbN0b7hz3q5Z for ; Sun, 27 Feb 2022 19:48:48 +0000 (UTC) (envelope-from julien.cassette@gmail.com) Received: by mail-lj1-x230.google.com with SMTP id p20so14716049ljo.0 for ; Sun, 27 Feb 2022 11:48:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=EJJgEfiYuKNnNRrH3lkExpTNUsZIvZpR5947iXzu/1A=; b=jjtCgdmfKGtfRypZj6mscOzcVKALZV63g9U/15RlI3gUKndID0misVvEZJWuco7yIx a7che6UijfaSwlyKtfJ95S5GnNqEGbV+8oeeAUhk/8lapcu5dswAkotfhq9ZwLBHV0Jp 5ObcNstGBBLOWlMVZ1mN7GzNa6zyfMvL0y3BWMI093qRJxFOnXkS2ceOHbZCpEnclUQ7 vG8+QtatPxK3MREfWzHcsv2w+FFn//rQcNOtac4kU2uR2KNFfcua9pUmP8oASmi6iA8m FyzZopJyVD33tdQrwj89KShdJ1gJ3P1x1oo3N/SC218CIxIPu30XotYKx66RXy5iuRLZ 5dPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=EJJgEfiYuKNnNRrH3lkExpTNUsZIvZpR5947iXzu/1A=; b=JKyYQj/ZVfSZFT0v7Ps76MdMYxHYdzIyvo+ZF/p1+3OXd4tLZ2IvKGJS9pM+I02GNA KoDfHkNxh5oeLg38cbw7vUiAInc1u+4vxz/ajjXhrVVV4hYTTIqDvTex56jPu0JGHwEw Ciw/zMcuV/XXb5RMTP8d4ZGKF+3q6os4iGLOXxEfE+IUjFVCjfcmygvZBuLmxmysKcm1 s18dHIsZd6x+9JazMzsEA2IA+ljLLtPAbqjOsSUi3hML6s8gzi50y1bCFwhYHSN4m028 ZMQV7aGrseaTRmx2mFiV8+n09C9MQ9jDNIqxCE7FhpYpx28D6YzdiNv4RWCBuxm8tVzn B1UA== X-Gm-Message-State: AOAM5304+JQ6K2Qhz0JmGL5wSh6iELgiSjZil8X3CWvlVzRUiS+2KRrP qRTBhTUfWT0LCZULkyahTYNJH7xDjSduxi9QHWY= X-Google-Smtp-Source: ABdhPJwWA6uJEy0bg5CkUeAkVqCmt4JY1GjFzP2ts/buCHdCJISIs8m1e3r3xWH2q+iufNnG0mMN16fHLDgWAzY23hk= X-Received: by 2002:a2e:8017:0:b0:246:3fb3:1618 with SMTP id j23-20020a2e8017000000b002463fb31618mr12439620ljg.427.1645991326378; Sun, 27 Feb 2022 11:48:46 -0800 (PST) List-Id: FreeBSD on the RISC-V instruction set architecture List-Archive: https://lists.freebsd.org/archives/freebsd-riscv List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-riscv@freebsd.org X-BeenThere: freebsd-riscv@freebsd.org MIME-Version: 1.0 References: <54a1fb0c-1128-a9fc-a96d-fe973bd2cabc@alvermark.net> <41855845-4e9f-deb9-386c-3e98b99692e9@alvermark.net> In-Reply-To: <41855845-4e9f-deb9-386c-3e98b99692e9@alvermark.net> From: Julien Cassette Date: Sun, 27 Feb 2022 20:48:34 +0100 Message-ID: Subject: Re: Sipeed Lichee RV (Allwinner D1) To: Jakob Alvermark Cc: freebsd-riscv@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4K6DbN0b7hz3q5Z X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b=jjtCgdmf; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of juliencassette@gmail.com designates 2a00:1450:4864:20::230 as permitted sender) smtp.mailfrom=juliencassette@gmail.com X-Spamd-Result: default: False [-4.00 / 15.00]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; MID_RHS_MATCH_FROMTLD(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; TAGGED_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; FROM_HAS_DN(0.00)[]; SH_EMAIL_DBL_DONT_QUERY_IPS(0.00)[0.91.184.120:email,0.38.37.160:email,0.61.91.8:email,0.61.87.32:email]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-riscv@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::230:from]; MLMMJ_DEST(0.00)[freebsd-riscv]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N Le dim. 27 f=C3=A9vr. 2022 =C3=A0 20:26, Jakob Alvermark a =C3=A9crit : > > > > On 2/7/22 18:44, Jessica Clarke wrote: > > On 7 Feb 2022, at 17:38, Jakob Alvermark wrote: > >> On 1/29/22 16:12, Jakob Alvermark wrote: > >>> On 1/28/22 16:29, Mitchell Horne wrote: > >>>> On 1/19/22 18:05, Jakob Alvermark wrote: > >>>>> On 1/19/22 17:24, Mitchell Horne wrote: > >>>>>> > >>>>>> On 1/17/22 15:02, Jakob Alvermark wrote: > >>>>>>> Hi, > >>>>>>> > >>>>>>> > >>>>>>> With RISC-V SBCs now coming down in price, I got curios and got m= yself a Lichee RV (with the dock). > >>>>>>> > >>>>>>> https://linux-sunxi.org/Sipeed_Lichee_RV > >>>>>>> > >>>>>>> The instructions here, https://linux-sunxi.org/Allwinner_Nezha al= ong with some patching got me a working U-boot. > >>>>>>> > >>>>>>> Cross-building and putting together and image for and SD card got= me this far: > >>>>>>> > >>>>> > >>>>>>> Loading kernel... > >>>>>>> /boot/kernel/kernel text=3D0x609ddc text=3D0x133abc data=3D0xf442= 0 data=3D0xb54+0x1d73e4 syms=3D[0x8+0xcd188+0x8+0xee5ae] > >>>>>>> Loading configured modules... > >>>>>>> can't find '/etc/hostid' > >>>>>>> can't find '/boot/entropy' > >>>>>>> Using DTB provided by EFI at 0x47ef5000. > >>>>>>> Kernel entry at 0x56a0002e... > >>>>>>> Kernel args: (null) > >>>>>>> > >>>>>>> ----- > >>>>>>> > >>>>>>> And here it stops for ~16 seconds then restarts, that's the watc= hdog resetting it. > >>>>>>> > >>>>>>> So where do I go from here? > >>>>>>> > >>>>>> Hi Jakob, > >>>>>> > >>>>>> Looks like it bails somewhere in the initial kernel setup, before = the first output to the console. This is a wide range, so it's difficult to= say exactly where things are going wrong. > >>>>>> > >>>>>> I will say that generally FreeBSD is not expected to work on the D= 1; as far as I know you are the first to try it. This hardware has some qui= rks requiring special support, which we are entirely lacking. Specifically,= there is one related to virtual memory management, which requires custom (= spec-breaking) bits in the page tables to be set, to properly specify the a= ttributes of physical and device memory. This _may_ have something to do wi= th why it is failing where it is. It would take a motivated party to add th= e support required for this SoC, and I'm not aware of anyone currently taki= ng this on. This board has caused some headaches in Linux-land for the same= reasons, but there are more hands to do the work there. I just want to set= the expectations properly :) > >>>>>> > >>>>>> If you wanted to debug this further, you might rebuild the kernel = after adding 'options EARLY_PRINTF' to the config file, as this should enab= le a couple early outputs and narrow down the search slightly. > >>>>> > >>>>> Hi Mitchell, > >>>>> > >>>>> > >>>>> I did not expect it to work. But it would be nice if it did. > >>>>> > >>>>> I have a long experience with FreeBSD and I have played around with= a couple of different ARM-boards, but I'm not very experienced with kernel= hacking. > >>>>> > >>>>> I built a kernel with EARLY_PRINTF, but it did not give me any more= output... > >>>>> > >>>>> Is there anything else I could try? > >>>>> > >>>> Yes, I missed an important detail: the required uart driver is missi= ng from the kernel. Please add 'device uart_snps' to the kernel config as w= ell, and see if this results in any output. > >>> > >>> Hi, I tried that, but sadly it did not make any difference. > >>> > >>> I looked at what they have done in Linux, and this commit seems to ha= ve some interesting bits: > >>> > >>> https://github.com/smaeul/linux/commit/c1bc61cee73e236c3cd69fe6c998b7= f80c654263#diff-4f4bb4eea826b523d76ddb1c539dad5685a0e7fd7cc8f1089a0493efd0e= 8e5b8 > >> > >> Hi again, > >> > >> > >> I noticed they have updated the U-Boot code to specifically support th= is board. > >> > >> With nothing to loose, I decided to try it. > >> > >> Now I get a little more: > >> > >> > >> > >> Loading kernel... > >> /boot/kernel/kernel text=3D0x5ef0ec text=3D0x1704dc data=3D0xf7900 dat= a=3D0xbcc+0x2741cc syms=3D[0x8+0xd0290+0x8+0xf1d3e] > >> Loading configured modules... > >> can't find '/boot/entropy' > >> can't find '/etc/hostid' > >> Using DTB provided by EFI at 0x47ef6000. > >> Kernel entry at 0x56a0002e... > >> Kernel args: (null) > >> ERROR loading DTB > >> panic: Boot hart ID was not properly set > >> cpuid =3D 0 > >> time =3D 1 > >> KDB: stack backtrace: > >> Uptime: 1s > > Like it says, your device tree is broken. U-Boot is supposed to copy > > the previous stage=E2=80=99s /chosen/boot-hartid to any device tree it = loads, > > but something=E2=80=99s gone wrong there. Not much FreeBSD can do about= that. > > I tried this: > > ----- > > OK fdt prop /chosen > Using DTB provided by EFI at 0x47ef6000. > fixup-applied > boot-hartid =3D <0x00000000> > stdout-path =3D "serial0:115200n8" > > ----- > > And then... > > ----- > > OK boot -v > Loading kernel... > /boot/kernel/kernel text=3D0x5ef0ec text=3D0x1704dc data=3D0xf7900 > data=3D0xbcc+0x2741cc syms=3D[0x8+0xd0290+0x8+0xf1d3e] > Loading configured modules... > can't find '/boot/entropy' > can't find '/etc/hostid' > Kernel entry at 0x56a0002e... > Kernel args: -v > t[0] =3D=3D 0xffffffc00085bcb0 > t[1] =3D=3D 0xffffffc00085bcd2 > t[2] =3D=3D 0xffffffc00085bcd1 > t[3] =3D=3D 0x00000000000004b5 > t[4] =3D=3D 0x0000000000000001 > t[5] =3D=3D 0x0000000015c59000 > t[6] =3D=3D 0x0000000015c59001 > s[0] =3D=3D 0xffffffc000003ca0 > s[1] =3D=3D 0xffffffc000ccf000 > s[2] =3D=3D 0xffffffc000ac6f00 > s[3] =3D=3D 0x0000000000008000 > s[4] =3D=3D 0xffffffc000003f10 > s[5] =3D=3D 0x0000000000000800 > s[6] =3D=3D 0x000000000000001f > s[7] =3D=3D 0x00000000000f4241 > s[8] =3D=3D 0x00000000000f4240 > s[9] =3D=3D 0x0000000056a00000 > s[10] =3D=3D 0x0000000000000ff0 > s[11] =3D=3D 0x000000005eb1c7a0 > a[0] =3D=3D 0xffffffbf80cd74d0 > a[1] =3D=3D 0x0000000000008007 > a[2] =3D=3D 0x0000000000000001 > a[3] =3D=3D 0x0000000000000001 > a[4] =3D=3D 0xffffffffffffffff > a[5] =3D=3D 0x0000000000000001 > a[6] =3D=3D 0x0000000000000003 > a[7] =3D=3D 0x0000000000000010 > ra =3D=3D 0xffffffc0005d3f3c > sp =3D=3D 0xffffffc000003c90 > gp =3D=3D 0x0000000000000000 > tp =3D=3D 0x0000000000000000 > sepc =3D=3D 0xffffffc000387cbc > sstatus =3D=3D 0x8000000201806100 > panic: Fatal page fault at 0xffffffc000387cbc: 0xffffffbf80cd74d0 > cpuid =3D 0 > time =3D 1 > KDB: stack backtrace: > Uptime: 1s > > Hi all I was stuck at the same point but I managed to get further by disabling MAEE in the MMU code of the SBL. This is configured by the bit number 21 of the MXSTATUS register: julien@Julien-T460:~/sun20i_d1_spl$ git diff diff --git a/arch/riscv/cpu/riscv64/mmu.c b/arch/riscv/cpu/riscv64/mmu.c index f1bd043..4ddde0f 100644 --- a/arch/riscv/cpu/riscv64/mmu.c +++ b/arch/riscv/cpu/riscv64/mmu.c @@ -43,7 +43,7 @@ __weak void dcache_enable(void) (21) MAEE=E4=B8=BA1=E6=97=B6MMU=E7=9A=84pte=E4=B8=AD=E6=89=A9=E5=B1= =95=E5=9C=B0=E5=9D=80=E5=B1=9E=E6=80=A7=E4=BD=8D=EF=BC=8C=E7=94=A8=E6=88=B7= =E5=8F=AF=E4=BB=A5=E9=85=8D=E7=BD=AE=E9=A1=B5=E9=9D=A2=E7=9A=84=E5=9C=B0=E5= =9D=80=E5=B1=9E=E6=80=A7 (22) THEADISAEE=E4=B8=BA1=E6=97=B6=E5=8F=AF=E4=BB=A5=E4=BD=BF=E7=94= =A8C906=E6=89=A9=E5=B1=95=E6=8C=87=E4=BB=A4=E9=9B=86 */ - csr_set(CSR_MXSTATUS, 0x638000); + csr_set(CSR_MXSTATUS, 0x438000); /* I have opened a pull request for this: https://github.com/smaeul/sun20i_d1_spl/pull/5 Now the boot is failing while mouting the rootfs: Hit [Enter] to boot immediately, or any other key for command prompt. Booting [/boot/kernel/kernel]... Using DTB provided by EFI at 0x47ef6000. Kernel entry at 0x56a0002e... Kernel args: (null) ---<>--- Copyright (c) 1992-2021 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 13.0-RELEASE #0 releng/13.0-n244733-ea31abc261f: Fri Apr 9 03:30:22 UTC 2021 root@releng1.nyi.freebsd.org:/usr/obj/usr/src/riscv.riscv64/sys/GENERIC riscv FreeBSD clang version 11.0.1 (git@github.com:llvm/llvm-project.git llvmorg-11.0.1-0-g43ff75f2c3fe) SBI: OpenSBI v0.9 SBI Specification Version: 0.3 CPU(0): Unknown Implementer Unknown Processor real memory =3D 536870912 (512 MB) avail memory =3D 507383808 (483 MB) arc4random: WARNING: initial seeding bypassed the cryptographic random device because it was not yet seeded and the knob 'bypass_before_seeding' was enabled. random: entropy device external interface WARNING: Device "openfirm" is Giant locked and may be deleted before FreeBSD 14.0. ofwbus0: clk_fixed0: on ofwbus0 simplebus0: on ofwbus0 timer0: Timecounter "RISC-V Timecounter" frequency 24000000 Hz quality 1000 Event timer "RISC-V Eventtimer" frequency 24000000 Hz quality 1000 rcons0: cpulist0: on ofwbus0 cpu0: on cpulist0 cryptosoft0: Timecounters tick every 1.000 msec Trying to mount root from ufs:/dev/ufs/rootfs [rw]... mountroot: waiting for device /dev/ufs/rootfs... Mounting from ufs:/dev/ufs/rootfs failed with error 19. The full boot log is here: https://pastebin.com/BVaqnRh9 I hope this helps Julien Le dim. 27 f=C3=A9vr. 2022 =C3=A0 20:26, Jakob Alvermark a =C3=A9crit : > > > > On 2/7/22 18:44, Jessica Clarke wrote: > > On 7 Feb 2022, at 17:38, Jakob Alvermark wrote: > >> On 1/29/22 16:12, Jakob Alvermark wrote: > >>> On 1/28/22 16:29, Mitchell Horne wrote: > >>>> On 1/19/22 18:05, Jakob Alvermark wrote: > >>>>> On 1/19/22 17:24, Mitchell Horne wrote: > >>>>>> > >>>>>> On 1/17/22 15:02, Jakob Alvermark wrote: > >>>>>>> Hi, > >>>>>>> > >>>>>>> > >>>>>>> With RISC-V SBCs now coming down in price, I got curios and got m= yself a Lichee RV (with the dock). > >>>>>>> > >>>>>>> https://linux-sunxi.org/Sipeed_Lichee_RV > >>>>>>> > >>>>>>> The instructions here, https://linux-sunxi.org/Allwinner_Nezha al= ong with some patching got me a working U-boot. > >>>>>>> > >>>>>>> Cross-building and putting together and image for and SD card got= me this far: > >>>>>>> > >>>>> > >>>>>>> Loading kernel... > >>>>>>> /boot/kernel/kernel text=3D0x609ddc text=3D0x133abc data=3D0xf442= 0 data=3D0xb54+0x1d73e4 syms=3D[0x8+0xcd188+0x8+0xee5ae] > >>>>>>> Loading configured modules... > >>>>>>> can't find '/etc/hostid' > >>>>>>> can't find '/boot/entropy' > >>>>>>> Using DTB provided by EFI at 0x47ef5000. > >>>>>>> Kernel entry at 0x56a0002e... > >>>>>>> Kernel args: (null) > >>>>>>> > >>>>>>> ----- > >>>>>>> > >>>>>>> And here it stops for ~16 seconds then restarts, that's the watc= hdog resetting it. > >>>>>>> > >>>>>>> So where do I go from here? > >>>>>>> > >>>>>> Hi Jakob, > >>>>>> > >>>>>> Looks like it bails somewhere in the initial kernel setup, before = the first output to the console. This is a wide range, so it's difficult to= say exactly where things are going wrong. > >>>>>> > >>>>>> I will say that generally FreeBSD is not expected to work on the D= 1; as far as I know you are the first to try it. This hardware has some qui= rks requiring special support, which we are entirely lacking. Specifically,= there is one related to virtual memory management, which requires custom (= spec-breaking) bits in the page tables to be set, to properly specify the a= ttributes of physical and device memory. This _may_ have something to do wi= th why it is failing where it is. It would take a motivated party to add th= e support required for this SoC, and I'm not aware of anyone currently taki= ng this on. This board has caused some headaches in Linux-land for the same= reasons, but there are more hands to do the work there. I just want to set= the expectations properly :) > >>>>>> > >>>>>> If you wanted to debug this further, you might rebuild the kernel = after adding 'options EARLY_PRINTF' to the config file, as this should enab= le a couple early outputs and narrow down the search slightly. > >>>>> > >>>>> Hi Mitchell, > >>>>> > >>>>> > >>>>> I did not expect it to work. But it would be nice if it did. > >>>>> > >>>>> I have a long experience with FreeBSD and I have played around with= a couple of different ARM-boards, but I'm not very experienced with kernel= hacking. > >>>>> > >>>>> I built a kernel with EARLY_PRINTF, but it did not give me any more= output... > >>>>> > >>>>> Is there anything else I could try? > >>>>> > >>>> Yes, I missed an important detail: the required uart driver is missi= ng from the kernel. Please add 'device uart_snps' to the kernel config as w= ell, and see if this results in any output. > >>> > >>> Hi, I tried that, but sadly it did not make any difference. > >>> > >>> I looked at what they have done in Linux, and this commit seems to ha= ve some interesting bits: > >>> > >>> https://github.com/smaeul/linux/commit/c1bc61cee73e236c3cd69fe6c998b7= f80c654263#diff-4f4bb4eea826b523d76ddb1c539dad5685a0e7fd7cc8f1089a0493efd0e= 8e5b8 > >> > >> Hi again, > >> > >> > >> I noticed they have updated the U-Boot code to specifically support th= is board. > >> > >> With nothing to loose, I decided to try it. > >> > >> Now I get a little more: > >> > >> [35]HELLO! BOOT0 is starting! > >> [38]BOOT0 commit : 525883d-dirty > >> [41]set pll start > >> [43]periph0 has been enabled > >> [46]set pll end > >> [47]board init ok > >> [49]DRAM only have internal ZQ!! > >> [52]get_pmu_exist() =3D -1 > >> [55]ddr_efuse_type: 0x0 > >> [58][AUTO DEBUG] single rank and full DQ! > >> [62]ddr_efuse_type: 0x0 > >> [65][AUTO DEBUG] rank 0 row =3D 15 > >> [68][AUTO DEBUG] rank 0 bank =3D 8 > >> [71][AUTO DEBUG] rank 0 page size =3D 2 KB > >> [75]DRAM BOOT DRIVE INFO: V0.24 > >> [77]DRAM CLK =3D 792 MHz > >> [80]DRAM Type =3D 3 (2:DDR2,3:DDR3) > >> [83]DRAMC ZQ value: 0x7b7bfb > >> [85]DRAM ODT value: 0x42. > >> [88]ddr_efuse_type: 0x0 > >> [91]DRAM SIZE =3D512 M > >> [94]DRAM simple test OK. > >> [96]dram size =3D512 > >> [98]card no is 0 > >> [100]sdcard 0 line count 4 > >> [102][mmc]: mmc driver ver 2021-04-2 16:45 > >> [112][mmc]: Wrong media type 0x0 > >> [115][mmc]: ***Try SD card 0*** > >> [132][mmc]: HSSDR52/SDR25 4 bit > >> [135][mmc]: 50000000 Hz > >> [137][mmc]: 15193 MB > >> [139][mmc]: ***SD/MMC 0 init OK!!!*** > >> [176]Loading boot-pkg Succeed(index=3D1). > >> [180]Entry_name =3D opensbi > >> [183]Entry_name =3D dtb > >> [185]Entry_name =3D u-boot > >> [189]Adding DRAM info to DTB. > >> [193]Jump to second Boot. > >> > >> OpenSBI v1.0 > >> ____ _____ ____ _____ > >> / __ \ / ____| _ \_ _| > >> | | | |_ __ ___ _ __ | (___ | |_) || | > >> | | | | '_ \ / _ \ '_ \ \___ \| _ < | | > >> | |__| | |_) | __/ | | |____) | |_) || |_ > >> \____/| .__/ \___|_| |_|_____/|____/_____| > >> | | > >> |_| > >> > >> Platform Name : Sipeed Lichee RV Dock > >> Platform Features : medeleg > >> Platform HART Count : 1 > >> Platform IPI Device : aclint-mswi > >> Platform Timer Device : aclint-mtimer @ 24000000Hz > >> Platform Console Device : uart8250 > >> Platform HSM Device : --- > >> Platform Reboot Device : sunxi-wdt-reset > >> Platform Shutdown Device : --- > >> Firmware Base : 0x40000000 > >> Firmware Size : 264 KB > >> Runtime SBI Version : 0.3 > >> > >> Domain0 Name : root > >> Domain0 Boot HART : 0 > >> Domain0 HARTs : 0* > >> Domain0 Region00 : 0x0000000014008000-0x000000001400bfff (I) > >> Domain0 Region01 : 0x0000000014000000-0x0000000014007fff (I) > >> Domain0 Region02 : 0x0000000040000000-0x000000004007ffff () > >> Domain0 Region03 : 0x0000000000000000-0xffffffffffffffff (R,W= ,X) > >> Domain0 Next Address : 0x000000004a000000 > >> Domain0 Next Arg1 : 0x0000000044000000 > >> Domain0 Next Mode : S-mode > >> Domain0 SysReset : yes > >> > >> Boot HART ID : 0 > >> Boot HART Domain : root > >> Boot HART ISA : rv64imafdcvsux > >> Boot HART Features : scounteren,mcounteren,mcountinhibit,time > >> Boot HART PMP Count : 16 > >> Boot HART PMP Granularity : 2048 > >> Boot HART PMP Address Bits: 38 > >> Boot HART MHPM Count : 0 > >> Boot HART MIDELEG : 0x0000000000000222 > >> Boot HART MEDELEG : 0x000000000000b109 > >> > >> > >> U-Boot 2022.01-32931-gc249924b17-dirty (Feb 06 2022 - 17:29:00 +0100) > >> > >> DRAM: 512 MiB > >> Core: 43 devices, 18 uclasses, devicetree: board > >> WDT: Started watchdog@6011000 with servicing (16s timeout) > >> MMC: mmc@4020000: 0, mmc@4021000: 1 > >> Loading Environment from nowhere... OK > >> In: serial@2500000 > >> Out: serial@2500000 > >> Err: serial@2500000 > >> Net: No ethernet found. > >> Hit any key to stop autoboot: 0 > >> switch to partitions #0, OK > >> mmc0 is current device > >> Scanning mmc 0:1... > >> ** Unable to read file / ** > >> Failed to load '/' > >> libfdt fdt_check_header(): FDT_ERR_BADMAGIC > >> Scanning disk mmc@4020000.blk... > >> Scanning disk mmc@4021000.blk... > >> Disk mmc@4021000.blk not ready > >> Found 3 disks > >> ** Unable to read file ubootefi.var ** > >> Failed to load EFI variables > >> BootOrder not defined > >> EFI boot manager: Cannot load any image > >> Found EFI removable media binary efi/boot/bootriscv64.efi > >> 1409436 bytes read in 248 ms (5.4 MiB/s) > >> libfdt fdt_check_header(): FDT_ERR_BADMAGIC > >> Booting /efi\boot\bootriscv64.efi > >> > >> Consoles: EFI console > >> Reading loader env vars from /efi/freebsd/loader.env > >> Setting currdev to disk0p1: > >> FreeBSD/riscv EFI loader, Revision 1.1 > >> (Fri Jan 14 13:21:23 CET 2022 root@legion) > >> > >> Command line arguments: l > >> Image base: 0x5e9d8000 > >> EFI version: 2.90 > >> EFI Firmware: Das U-Boot (rev 8226.256) > >> Console: comconsole (0) > >> Load Path: /efi\boot\bootriscv64.efi > >> Load Device: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/SD(0)/SD= (0)/HD(1,GPT,1ab17495-7795-11ec-9e49-f875a47d4ead,0xa1f8,0x10418) > >> Trying ESP: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/SD(0)/SD(0)/H= D(1,GPT,1ab17495-7795-11ec-9e49-f875a47d4ead,0xa1f8,0x10418) > >> Setting currdev to disk0p1: > >> Trying: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/SD(0)/SD(0)/HD(2,= GPT,2973d4b3-7795-11ec-9e49-f875a47d4ead,0x1a610,0x200000) > >> Setting currdev to disk0p2: > >> Loading /boot/defaults/loader.conf > >> Loading /boot/defaults/loader.conf > >> Loading /boot/device.hints > >> Loading /boot/loader.conf > >> Loading /boot/loader.conf.local > >> / > >> ______ ____ _____ _____ > >> | ____| | _ \ / ____| __ \ > >> | |___ _ __ ___ ___ | |_) | (___ | | | | > >> | ___| '__/ _ \/ _ \| _ < \___ \| | | | > >> | | | | | __/ __/| |_) |____) | |__| | > >> | | | | | | || | | | > >> |_| |_| \___|\___||____/|_____/|_____/ ``` = ` > >> s` `.....---.......--= .``` -/ > >> +---------- Welcome to FreeBSD -----------+ +o .--` /y:` += . > >> | | yo`:. :o `+- > >> | 1. Boot Multi user [Enter] | y/ -/` -o/ > >> | 2. Boot Single user | .- ::/s= y+:. > >> | 3. Escape to loader prompt | / `-= - / > >> | 4. Reboot | `: = :` > >> | 5. Cons: Video | `: = :` > >> | | / = / > >> | Options: | .- = -. > >> | 6. Kernel: default/kernel (1 of 1) | -- = -. > >> | 7. Boot Options | `:` `:` > >> | | .-- `--. > >> | | .---.....----. > >> +-----------------------------------------+ > >> Autoboot in 0 seconds. [Space] to pause > >> > >> Loading kernel... > >> /boot/kernel/kernel text=3D0x5ef0ec text=3D0x1704dc data=3D0xf7900 dat= a=3D0xbcc+0x2741cc syms=3D[0x8+0xd0290+0x8+0xf1d3e] > >> Loading configured modules... > >> can't find '/boot/entropy' > >> can't find '/etc/hostid' > >> Using DTB provided by EFI at 0x47ef6000. > >> Kernel entry at 0x56a0002e... > >> Kernel args: (null) > >> ERROR loading DTB > >> panic: Boot hart ID was not properly set > >> cpuid =3D 0 > >> time =3D 1 > >> KDB: stack backtrace: > >> Uptime: 1s > > Like it says, your device tree is broken. U-Boot is supposed to copy > > the previous stage=E2=80=99s /chosen/boot-hartid to any device tree it = loads, > > but something=E2=80=99s gone wrong there. Not much FreeBSD can do about= that. > > I tried this: > > ----- > > OK fdt prop /chosen > Using DTB provided by EFI at 0x47ef6000. > fixup-applied > boot-hartid =3D <0x00000000> > stdout-path =3D "serial0:115200n8" > > ----- > > And then... > > ----- > > OK boot -v > Loading kernel... > /boot/kernel/kernel text=3D0x5ef0ec text=3D0x1704dc data=3D0xf7900 > data=3D0xbcc+0x2741cc syms=3D[0x8+0xd0290+0x8+0xf1d3e] > Loading configured modules... > can't find '/boot/entropy' > can't find '/etc/hostid' > Kernel entry at 0x56a0002e... > Kernel args: -v > t[0] =3D=3D 0xffffffc00085bcb0 > t[1] =3D=3D 0xffffffc00085bcd2 > t[2] =3D=3D 0xffffffc00085bcd1 > t[3] =3D=3D 0x00000000000004b5 > t[4] =3D=3D 0x0000000000000001 > t[5] =3D=3D 0x0000000015c59000 > t[6] =3D=3D 0x0000000015c59001 > s[0] =3D=3D 0xffffffc000003ca0 > s[1] =3D=3D 0xffffffc000ccf000 > s[2] =3D=3D 0xffffffc000ac6f00 > s[3] =3D=3D 0x0000000000008000 > s[4] =3D=3D 0xffffffc000003f10 > s[5] =3D=3D 0x0000000000000800 > s[6] =3D=3D 0x000000000000001f > s[7] =3D=3D 0x00000000000f4241 > s[8] =3D=3D 0x00000000000f4240 > s[9] =3D=3D 0x0000000056a00000 > s[10] =3D=3D 0x0000000000000ff0 > s[11] =3D=3D 0x000000005eb1c7a0 > a[0] =3D=3D 0xffffffbf80cd74d0 > a[1] =3D=3D 0x0000000000008007 > a[2] =3D=3D 0x0000000000000001 > a[3] =3D=3D 0x0000000000000001 > a[4] =3D=3D 0xffffffffffffffff > a[5] =3D=3D 0x0000000000000001 > a[6] =3D=3D 0x0000000000000003 > a[7] =3D=3D 0x0000000000000010 > ra =3D=3D 0xffffffc0005d3f3c > sp =3D=3D 0xffffffc000003c90 > gp =3D=3D 0x0000000000000000 > tp =3D=3D 0x0000000000000000 > sepc =3D=3D 0xffffffc000387cbc > sstatus =3D=3D 0x8000000201806100 > panic: Fatal page fault at 0xffffffc000387cbc: 0xffffffbf80cd74d0 > cpuid =3D 0 > time =3D 1 > KDB: stack backtrace: > Uptime: 1s > >