From nobody Mon Jan 17 19:02:08 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 DCBC91964285 for ; Mon, 17 Jan 2022 19:02:39 +0000 (UTC) (envelope-from jakob@alvermark.net) Received: from out.alvermark.net (out.alvermark.net [185.34.136.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Jd1W25x4tz3PnH for ; Mon, 17 Jan 2022 19:02:35 +0000 (UTC) (envelope-from jakob@alvermark.net) Received: from c-d24b235c.06-431-73746f70.bbcust.telenor.se ([92.35.75.210] helo=mail.alvermark.net) by out.alvermark.net with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91 (FreeBSD)) (envelope-from ) id 1n9XH0-0001jA-M2 for freebsd-riscv@FreeBSD.org; Mon, 17 Jan 2022 20:02:34 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=alvermark.net; s=x; h=Content-Transfer-Encoding:Content-Type:Subject:From: To:MIME-Version:Date:Message-ID:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=t0n2SpqdXwLGzexakj8iCy/YRdjungmi3dxaS/Mx/FI=; b=LvdUhyAMOUC2lxUc29+gfVGmiK GikgRof9TRhxGA3SNasr3IQmRdOwxoOG+c4j2LamBp65plJMxbQg64BcnrYmdyoS4EavfqGweyi0r fCRXu3d22pMyWf1JwjYz8z+/pcJyEjLxastuvy1ihQFKIzD9OKHMBO9igKSeNGw4M69ISes17TEfR WmOVIaa13R4E619VipVfKJBhRFLq1zBW3ycK7tylyNx+OkUsfDjbkfpcY1m9uzzZQC1TyZzxj9YMJ WYkU3p0y2+a0vDoKJtuQtaTQSqFI7XikjB3pnixIfqAUgwB2cUCH8PmTSNMJTlXfD5Uy0BDNo9EPD LW45kz9g==; Received: from office.as33885.net ([84.55.65.101] helo=[192.168.3.66]) by mail.alvermark.net with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.91 (FreeBSD)) (envelope-from ) id 1n9XGb-0005hh-2l for freebsd-riscv@FreeBSD.org; Mon, 17 Jan 2022 20:02:09 +0100 Message-ID: Date: Mon, 17 Jan 2022 20:02:08 +0100 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.4.1 To: freebsd-riscv@FreeBSD.org Content-Language: en-US From: Jakob Alvermark Subject: Sipeed Lichee RV (Allwinner D1) Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4Jd1W25x4tz3PnH X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=alvermark.net header.s=x header.b=LvdUhyAM; dmarc=none; spf=pass (mx1.freebsd.org: domain of jakob@alvermark.net designates 185.34.136.138 as permitted sender) smtp.mailfrom=jakob@alvermark.net X-Spamd-Result: default: False [-0.25 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[alvermark.net:s=x]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:185.34.136.138]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[alvermark.net: no valid DMARC record]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_SPAM_SHORT(0.25)[0.246]; DKIM_TRACE(0.00)[alvermark.net:+]; NEURAL_SPAM_LONG(1.00)[1.000]; MLMMJ_DEST(0.00)[freebsd-riscv]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:34971, ipnet:185.34.136.0/23, country:IT]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-ThisMailContainsUnwantedMimeParts: N 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: [35]HELLO! BOOT0 is starting! [38]BOOT0 commit : 771192d [41]set pll start [42]periph0 has been enabled [45]set pll end [47]board init ok [49]DRAM only have internal ZQ!! [51]get_pmu_exist() = -1 [54]ddr_efuse_type: 0x0 [57][AUTO DEBUG] single rank and full DQ! [61]ddr_efuse_type: 0x0 [64][AUTO DEBUG] rank 0 row = 15 [67][AUTO DEBUG] rank 0 bank = 8 [70][AUTO DEBUG] rank 0 page size = 2 KB [74]DRAM BOOT DRIVE INFO: V0.24 [77]DRAM CLK = 792 MHz [79]DRAM Type = 3 (2:DDR2,3:DDR3) [82]DRAMC ZQ value: 0x7b7bfb [85]DRAM ODT value: 0x42. [87]ddr_efuse_type: 0x0 [90]DRAM SIZE =512 M [94]DRAM simple test OK. [96]dram size =512 [98]card no is 0 [99]sdcard 0 line count 4 [102][mmc]: mmc driver ver 2021-04-2 16:45 [111][mmc]: Wrong media type 0x0 [114][mmc]: ***Try SD card 0*** [131][mmc]: HSSDR52/SDR25 4 bit [134][mmc]: 50000000 Hz [136][mmc]: 15193 MB [138][mmc]: ***SD/MMC 0 init OK!!!*** [187]Loading boot-pkg Succeed(index=1). [190]Entry_name        = opensbi [193]Entry_name        = dtb [196]Entry_name        = u-boot [199]Jump to second Boot. U-Boot 2022.01-rc1-31813-gf3a0e980de-dirty (Jan 17 2022 - 13:27:57 +0100) CPU:   rv64imafdc Model: Allwinner D1 NeZha DRAM:  512 MiB 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:   Could not get PHY for ethernet@4500000: addr 1 No ethernet found. Hit any key to stop autoboot:  0 switch to partitions #0, OK mmc0 is current device Scanning mmc 0:1... 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 mdio_register: non unique device name 'ethernet@4500000' Could not get PHY for ethernet@4500000: addr 1 mdio_register: non unique device name 'ethernet@4500000' Could not get PHY for ethernet@4500000: addr 1 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: 0x5e98c000    EFI version: 2.80    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)/HD(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,0x114340) 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                    | .-                  ::/sy+:.  |  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=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? Cheers, Jakob Alvermark