From nobody Fri Jan 28 15:29:26 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 4D6C21980F95 for ; Fri, 28 Jan 2022 15:29:31 +0000 (UTC) (envelope-from mhorne@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JlhG31TL0z4bdw; Fri, 28 Jan 2022 15:29:31 +0000 (UTC) (envelope-from mhorne@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643383771; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=y0jGD4ubQYm+46CX3yOOaVqVmVNy9RneIxilMgqVM90=; b=wswdpzmGi1gGdIOpCTVOjWcjORmglcuDbTfveWYjeqM4Jm25GCdCaSxjX5U7A7HzwXR/33 vMXZnBNsAY0f4O5XLrY7TdHN+qGghAucU32ekNICzqYkiE+26cZAflPdIUAgzmuDv+WvPv DaQ1bKx2G8j6wwEc3rcw/ffcWk+Qkl8uXpIpPZRs/U0kT3tnO7s+i371Y6l20mBL8n6JQP R4EkhleBJZkN7tmUfm6Ict7BZtKFOS5EkpyRR7Omur/IergV7ZbRUSDs+MJpr/ifX+3unB 7Rq/c9Qg2O+m8Ra37eUvSgoR0u1zWf37XHzlkfIFB940BxUx514gjIVfipaedA== Received: from [192.168.1.106] (host-173-212-73-28.public.eastlink.ca [173.212.73.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: mhorne) by smtp.freebsd.org (Postfix) with ESMTPSA id C97C6E055; Fri, 28 Jan 2022 15:29:30 +0000 (UTC) (envelope-from mhorne@freebsd.org) Message-ID: <5a74bd6d-4000-c413-02e2-33608f9ae683@freebsd.org> Date: Fri, 28 Jan 2022 11:29:26 -0400 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 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: Sipeed Lichee RV (Allwinner D1) Content-Language: en-CA To: Jakob Alvermark , freebsd-riscv@FreeBSD.org References: From: Mitchell Horne In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643383771; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=y0jGD4ubQYm+46CX3yOOaVqVmVNy9RneIxilMgqVM90=; b=mdb4HU3aWR3oj5d0OonoF2V6j2Sl+437uJT3tHMmr6rsk+7aKQqy0JPbKL8xStyyXRa6Mx nNoda6Tpf3f1kiIUD3mAPFoDXHSKCxgQ2fhZdIYrMa4V2wSRLduUjSMGDAkei9NZzAoKkE +N6c35KT4HqbA6l9Xws9EM9GQG4k+KhntKvHCpcqktyjw/fjMCAIr1WKGhSPTle4h+qqIt rJ973zYD/hPPqbuyosf1dB80VbwFfD273G0Da7KaLpW9gC15O9MwDc7cnpFe21ANVZRD9P jtblqqoWyQuHqTAhmNTBtEVZJOT6W+WOEmRNbUYHuqlmvTu/DiXuXyi6RTLsNw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1643383771; a=rsa-sha256; cv=none; b=feFoHDO76z21XeFVxfpjd/iSbJgLMEwKdhzFBI48nIbd5LXqb97hM4zj/aANPyuUqeIsFB laEyGwk7t9UlFDmNuFmCaP6rJWPvMP8JNmerAselMaAUrBrVB3MOB1z8PmYtk5hoWtmCu4 ZEyJoimPXnCCCeYEUjcPzfw/AFu3Bpx62JDKV2AitB2d8fEUp5UVgzDDn50zBxB/QpnpQv isAsHykFytcP1ali0jb1qhqKW/2bcfFZtuNShXmyq2MSWi8ObK5h6Jddk1G3JfPTOTuPaN SNGE6rTTRQRmFz4tCxoocKt8mbAcyR+DMY9omQCW+6GdOYjgQVd81mwN3chRmw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N 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 >>> myself a Lichee RV (with the dock). >>> >>> https://linux-sunxi.org/Sipeed_Lichee_RV >>> >>> The instructions here, https://linux-sunxi.org/Allwinner_Nezha along >>> 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=0x609ddc text=0x133abc data=0xf4420 >>> data=0xb54+0x1d73e4 syms=[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 watchdog >>> 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 D1; >> as far as I know you are the first to try it. This hardware has some >> quirks 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 attributes of physical and device memory. This >> _may_ have something to do with why it is failing where it is. It >> would take a motivated party to add the support required for this SoC, >> and I'm not aware of anyone currently taking 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 >> enable 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 missing from the kernel. Please add 'device uart_snps' to the kernel config as well, and see if this results in any output. Mitchell > > Jakob >