From nobody Thu Jun 15 16:29:04 2023 X-Original-To: freebsd-arm@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 4Qhnmk0tFSz4fMb5 for ; Thu, 15 Jun 2023 16:29:10 +0000 (UTC) (envelope-from titus@edc.ro) Received: from eatlas.ro (eatlas.ro [86.126.82.18]) (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 (2048 bits) client-digest SHA256) (Client CN "eatlas.ro", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Qhnmj0ntbz4BFw for ; Thu, 15 Jun 2023 16:29:09 +0000 (UTC) (envelope-from titus@edc.ro) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=edc.ro header.s=mail header.b=VRXn1EXh; spf=pass (mx1.freebsd.org: domain of titus@edc.ro designates 86.126.82.18 as permitted sender) smtp.mailfrom=titus@edc.ro; dmarc=none Received: from mail.edc.ro ([10.1.4.58]) by eatlas.ro (8.16.1/8.16.1) with ESMTPS id 35FGT6AH080556 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Thu, 15 Jun 2023 19:29:06 +0300 (EEST) (envelope-from titus@edc.ro) Received: from buko.edc.ro (localhost [127.0.0.1]) by mail.edc.ro (8.16.1/8.16.1) with ESMTPS id 35FGT4qc060973 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Thu, 15 Jun 2023 19:29:04 +0300 (EEST) (envelope-from titus@buko.edc.ro) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=edc.ro; s=mail; t=1686846545; bh=BbSp2r0KV7+RWBaSllsNgJ0pKYMQsPJSuuh23lP1QEM=; h=Date:From:To:Subject; b=VRXn1EXhM0ptn1jNXrrJQyRtkE/XAXXx3aZzT3W9Fv39wNXGECXg95uAbl3wLjuON ++3Xwnr1ef1+Zjdx00mXQhEbQunyHXlLpQvJdg2ECffxHuiiygFW2hrODPNIE6wF/0 6gY0k9w3Y0hAYtAaKRysc9CJaj/X4psPu/cyrbaI= Received: (from titus@localhost) by buko.edc.ro (8.16.1/8.16.1/Submit) id 35FGT473060972 for freebsd-arm@freebsd.org; Thu, 15 Jun 2023 19:29:04 +0300 (EEST) (envelope-from titus) Date: Thu, 15 Jun 2023 19:29:04 +0300 From: titus To: freebsd-arm@freebsd.org Subject: Support for rockpi-s (rockchip rk3308) Message-ID: List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="tSRd7davl5znE93e" Content-Disposition: inline X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ns.edc.ro X-Spamd-Result: default: False [-3.50 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-0.999]; NEURAL_HAM_SHORT(-1.00)[-0.997]; R_DKIM_ALLOW(-0.20)[edc.ro:s=mail]; R_SPF_ALLOW(-0.20)[+ip4:86.126.82.18/32]; MIME_GOOD(-0.10)[multipart/mixed,text/plain]; DKIM_TRACE(0.00)[edc.ro:+]; ARC_NA(0.00)[]; MLMMJ_DEST(0.00)[freebsd-arm@freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; DMARC_NA(0.00)[edc.ro]; MIME_TRACE(0.00)[0:+,1:+,2:+]; MID_RHS_MATCH_FROMTLD(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_TLS_LAST(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; HAS_ATTACHMENT(0.00)[]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-arm@freebsd.org]; ASN(0.00)[asn:8708, ipnet:86.120.0.0/13, country:RO] X-Rspamd-Queue-Id: 4Qhnmj0ntbz4BFw X-Spamd-Bar: --- X-ThisMailContainsUnwantedMimeParts: N --tSRd7davl5znE93e Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hello, I hacked some crude support for rockpi-s. SD card works USB works UART works Ethernet works (no media autodetect but works). I added support rk3308-cru (clock), rk3308-pinctrl, rk3308-gmac mostly by looking at the linux and openbsd code https://forums.freebsd.org/threads/adding-support-for-the-rockpi-s.80956/#post-613952 dmesg attached -- --------------------------------------------------------------------- How an engineer writes a program: Starts by debugging an empty file... Titus Manea | Eastern Digital Inc. --tSRd7davl5znE93e Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="dmesg.txt" WARNING: Cannot find freebsd,dts-version property, cannot check DTB compliance 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.2-RELEASE GENERIC arm64 FreeBSD clang version 14.0.5 (https://github.com/llvm/llvm-project.git llvmorg-14.0.5-0-gc12386ae247c) VT: init without driver. module firmware already present! real memory = 534773760 (510 MB) avail memory = 499032064 (475 MB) Starting CPU 1 (1) Starting CPU 2 (2) Starting CPU 3 (3) FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs random: unblocking device. random: entropy device external interface MAP 1cf02000 mode 2 pages 2 MAP 1cf05000 mode 2 pages 6 MAP 1ff40000 mode 2 pages 16 kbd0 at kbdmux0 ofwbus0: clk_fixed0: on ofwbus0 clk_fixed1: on ofwbus0 rk_grf0: mem 0xff000000-0xff007fff on ofwbus0 rk3308_cru0: mem 0xff500000-0xff500fff on ofwbus0 regfix0: on ofwbus0 regfix1: on ofwbus0 regfix2: on ofwbus0 regfix3: on ofwbus0 regfix4: on ofwbus0 regfix5: on ofwbus0 regfix6: on ofwbus0 simple_mfd0: mem 0xff008000-0xff00afff on ofwbus0 simple_mfd1: mem 0xff00b000-0xff00bfff on ofwbus0 simple_mfd2: mem 0xff00c000-0xff00cfff on ofwbus0 psci0: on ofwbus0 gic0: mem 0xff581000-0xff581fff,0xff582000-0xff583fff,0xff584000-0xff585fff,0xff586000-0xff587fff irq 47 on ofwbus0 gic0: pn 0x2, arch 0x2, rev 0x1, implementer 0x43b irqs 160 rk_pinctrl0: on ofwbus0 gpio0: mem 0xff220000-0xff2200ff irq 48 on rk_pinctrl0 gpiobus0: on gpio0 gpio1: mem 0xff230000-0xff2300ff irq 49 on rk_pinctrl0 gpiobus1: on gpio1 gpio2: mem 0xff240000-0xff2400ff irq 50 on rk_pinctrl0 gpiobus2: on gpio2 gpio3: mem 0xff250000-0xff2500ff irq 51 on rk_pinctrl0 gpiobus3: on gpio3 gpio4: mem 0xff260000-0xff2600ff irq 52 on rk_pinctrl0 gpiobus4: on gpio4 rk_i2c0: mem 0xff050000-0xff050fff irq 9 on ofwbus0 iicbus0: on rk_i2c0 generic_timer0: irq 4,5,6,7 on ofwbus0 Timecounter "ARM MPCore Timecounter" frequency 24000000 Hz quality 1000 Event timer "ARM MPCore Eventtimer" frequency 24000000 Hz quality 1000 mmc_pwrseq0: on ofwbus0 rk_usb2phy0: mem 0-0xff007fff,0-0x2fff on simple_mfd0 cpulist0: on ofwbus0 cpu0: on cpulist0 cpufreq_dt0: on cpu0 cpufreq_dt0: no regulator for cpu@0 device_attach: cpufreq_dt0 attach returned 6 cpu1: on cpulist0 cpu2: on cpulist0 cpu3: on cpulist0 iic0: on iicbus0 uart0: <16750 or compatible> mem 0xff0a0000-0xff0a00ff irq 13 on ofwbus0 uart0: console (1500000,n,8,1) uart1: <16750 or compatible> mem 0xff0c0000-0xff0c00ff irq 15 on ofwbus0 uart2: <16750 or compatible> mem 0xff0e0000-0xff0e00ff irq 17 on ofwbus0 pwm0: mem 0xff180000-0xff18000f on ofwbus0 pwmbus0: on pwm0 pwmc0: channel 0 on pwmbus0 dwcotg0: mem 0xff400000-0xff43ffff irq 36 on ofwbus0 usbus1 on dwcotg0 ehci0: mem 0xff440000-0xff44ffff irq 37 on ofwbus0 usbus2: EHCI version 1.0 usbus2 on ehci0 ohci0: mem 0xff450000-0xff45ffff irq 38 on ofwbus0 usbus3 on ohci0 rockchip_dwmmc0: mem 0xff480000-0xff483fff irq 39 on ofwbus0 rockchip_dwmmc0: Hardware version ID is 270a mmc0: on rockchip_dwmmc0 rockchip_dwmmc1: mem 0xff490000-0xff493fff irq 40 on ofwbus0 rockchip_dwmmc1: Hardware version ID is 270a mmc1: on rockchip_dwmmc1 rockchip_dwmmc2: mem 0xff4a0000-0xff4a3fff irq 41 on ofwbus0 rockchip_dwmmc2: Hardware version ID is 270a mmc2: on rockchip_dwmmc2 dwc0: mem 0xff4e0000-0xff4effff irq 43 on ofwbus0 ETH BLAH 22 miibus0: on dwc0 ukphy0: PHY 0 on miibus0 ukphy0: none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto ukphy1: PHY 1 on miibus0 ukphy1: none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto dwc0: Ethernet address: 62:73:64:77:1b:ef gpioc0: on gpio0 gpioc1: on gpio1 gpioc2: on gpio2 gpioc3: on gpio3 gpioc4: on gpio4 gpioled0: on ofwbus0 armv8crypto0: Timecounters tick every 1.000 msec Cannot set frequency for clk: clk_sdmmc, error: 34 rockchip_dwmmc0: failed to set frequency to 400000 Hz: 34 usbus1: 480Mbps High Speed USB v2.0 usbus2: 480Mbps High Speed USB v2.0 usbus3: 12Mbps Full Speed USB v1.0 ugen3.1: at usbus3 uhub0 on usbus3 uhub0: on usbus3 ugen2.1: at usbus2 uhub1 on usbus2 uhub1: on usbus2 ugen1.1: at usbus1 uhub2 on usbus1 uhub2: on usbus1 mmcsd0: 16GB at mmc0 50.0MHz/4bit/1016-block mmc1: No compatible cards found on bus Cannot set frequency for clk: clk_sdio, error: 34 rockchip_dwmmc2: failed to set frequency to 400000 Hz: 34 mmc2: No compatible cards found on bus CPU 0: ARM Cortex-A35 r0p2 affinity: 0 Cache Type = <64 byte D-cacheline,64 byte I-cacheline,VIPT ICache,64 byte ERG,64 byte CWG> Instruction Set Attributes 0 = Instruction Set Attributes 1 = <> Instruction Set Attributes 2 = <> Processor Features 0 = Processor Features 1 = <> Memory Model Features 0 = Memory Model Features 1 = <8bit VMID> Memory Model Features 2 = <32bit CCIDX,48bit VA> Debug Features 0 = Debug Features 1 = <> Auxiliary Features 0 = <> Auxiliary Features 1 = <> AArch32 Instruction Set Attributes 5 = AArch32 Media and VFP Features 0 = AArch32 Media and VFP Features 1 = CPU 1: ARM Cortex-A35 r0p2 affinity: 1 CPU 2: ARM Cortex-A35 r0p2 affinity: 2 CPU 3: ARM Cortex-A35 r0p2 affinity: 3 Release APs...done Unresolved linked clock found: clk_rtc_32k Unresolved linked clock found: clk_ddrphy1x_out Unresolved linked clock found: clk_pvtm_32k Trying to mount root from ufs:/dev/ufs/rootfs [rw,noatime]... Unresolved linked clock found: xin32k Unresolved linked clock found: mclk_i2s0_8ch_in Unresolved linked clock found: mclk_i2s1_8ch_in Unresolved linked clock found: mclk_i2s2_8ch_in Unresolved linked clock found: mclk_i2s3_8ch_in Unresolved linked clock found: mclk_i2s0_2ch_in Unresolved linked clock found: mclk_i2s1_2ch_in Unresolved linked clock found: dummy Warning: no time-of-day clock registered, system time will not be set accurately Dual Console: Serial Primary, Video Secondary uhub0: 1 port with 1 removable, self powered uhub2: 1 port with 1 removable, self powered uhub1: 1 port with 1 removable, self powered lo0: link state changed to UP dwc0: link state changed to UP --tSRd7davl5znE93e--