From nobody Fri Jul 8 22:33:02 2022 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 CE85D17F977A for ; Fri, 8 Jul 2022 22:33:13 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic307-8.consmr.mail.gq1.yahoo.com (sonic307-8.consmr.mail.gq1.yahoo.com [98.137.64.32]) (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 did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Lfp2c3myvz3rrK for ; Fri, 8 Jul 2022 22:33:12 +0000 (UTC) (envelope-from marklmi@yahoo.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1657319590; bh=4MWcEezVWN9PlKy8JsbGFJK16ZzyORbZ1Oq/CfHzm2o=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject:Reply-To; b=c/awgm5tJ0FuCzfd4jSOjU5V1FPrsqjsX0JIJi1H4vp230hIj1mTeHzEM/LMiW83sV/TK9YJjiIGVTcZGACQGQNEoz94djSqzFOzQWD2qmTu7R4dFykkyngrGiPxLACWWgnjF7pLxAg/KDQxY102vm4wd8daqnGFvbkc4YX126j6T/Vr7pNWKRj9JMMtFcuKN2FFaOAWhWzjCSpVDbgHHmwZvMh4CgOC6I+HrdmOvg+AA5wuPRC2Z5cahfVcvGX7z9WQ6gOWdXa11OCVoT/cqS4ZViGdhYk6PGqFglCPd3HNc9z234vBLYV1lmMB9TVl7QtiXLU7Q0kQd/9InoqNBw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1657319590; bh=qv0nbnzKn/gAYLs0ILjYAlGbfOZIFxTtdVz2anlzGvc=; h=X-Sonic-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Vc5mW2s6EGfzJypFtvdDV3MwIQwsuwUq3s.1khlzczPKSs6QEZTZgK aodmhlryAyMCC2lYoCcez6VbXQczbXVfLzkPDy33PmjFDTl2_.Q8sstM8LfuU9Jlcn.Ts8DNws1T g3bvzKBTp.TCFmivOP.lz5ECQd3zCe8M_RXT06LOF9f_ybVUmccPViGYQk4DWokdpjGxYhyg4yOI u3vDCWlo9iNRu4FG86GWG0uJOVzExPYON43pqZHOjrufUmVAN1u0h5DvFha10yGTTdFsZu19tDWP a74zChw5dgIrNF7C8pUo4nE1UvLMfq0qTpTOlH0jWHWjwQQp5FyVfXmPQULKUwjTuPdrKNwUzVUi xEeJggv6po4sREkdUt6s9ClUfM03aqTVjy6fFkQB6fpIHnKi3KxcSvl4i.upSG9UAQIQo6pDYwQ8 LzfHNdtSOVWZOk6To3JchTW88g60NmrdEu34kZj1j0iKahPo0If129TUzAc6HktHNgPEeEtmFCvD JhHSVixvhCXjanWNyVxb.qA2USM5k_UvpjCWho6QVbXoPr36ViThZa037r2qweZVrw.BGYF1YdwK qaZpOWEQyGa2RDIQ2aLrs9lA- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.gq1.yahoo.com with HTTP; Fri, 8 Jul 2022 22:33:10 +0000 Received: by hermes--production-bf1-58957fb66f-dd4hs (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID f4e1dc7a5dc492bdca556755ead134df; Fri, 08 Jul 2022 22:33:04 +0000 (UTC) Content-Type: text/plain; charset=us-ascii 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 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: Failed to execute custom kernels which where build on a RPi 4 operated by 13.1-RELEASE From: Mark Millard In-Reply-To: Date: Fri, 8 Jul 2022 15:33:02 -0700 Cc: freebsd-arm , John Kennedy Content-Transfer-Encoding: quoted-printable Message-Id: References: <71D4E84B-5D80-43A5-BE22-8E4F6486B7E4@cyclaero.com> To: "Dr. Rolf Jansen" X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Rspamd-Queue-Id: 4Lfp2c3myvz3rrK X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b="c/awgm5t"; dmarc=pass (policy=reject) header.from=yahoo.com; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.64.32 as permitted sender) smtp.mailfrom=marklmi@yahoo.com X-Spamd-Result: default: False [-3.49 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.99)[-0.994]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; MV_CASE(0.50)[]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; RCVD_IN_DNSWL_NONE(0.00)[98.137.64.32:from]; TO_DN_ALL(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; FREEMAIL_FROM(0.00)[yahoo.com]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; MLMMJ_DEST(0.00)[freebsd-arm] X-ThisMailContainsUnwantedMimeParts: N On 2022-Jul-8, at 14:34, Dr. Rolf Jansen = wrote: >=20 >> Am 06.07.2022 um 02:01 schrieb Mark Millard : >>=20 >> On 2022-Jul-5, at 08:09, Dr. Rolf Jansen = wrote: >>=20 >>>> . . . >>>=20 >>> That would be the second step. The first step would be that somebody = else confirms my finding that building and running a custom kernel on a = stock FreeBSD 13.1-RELEASE on RPi 4 does not work out. And actually that = was my initial question. >>>=20 >>> (1) In case somebody raises her/his hand telling, that this worked = flawlessly on their system, >>> then I would have a more in deep look, what might have gone wrong = here. >>>=20 >>> (2) In case the issue would be confirmed, then I would submit a bug = report, and the discussion >>> may continue in a more productive way on bugs.freebsd.org. >>=20 >> Summary of the later material: >>=20 >> It would appear that if building any kernels are >> broken, it is specific to some custom kernel(s) >> in question, not to building kernels in general. >> 13.1-RELEASE's install is able to build, install, >> and boot its own generic kernel on a 8GiByte >> RPi4B Rev. 1.4. >=20 > So we are talking about case (1 - works flawlessly as expected), and = as I promised, I will look more in deep on what might have gone wrong = here. For those who want to reproduce building of kernels completely = from the scratch on the RPi 4 in the shortest possible way, I leave a = transcript of the procedure at the very bottom of this message (see: *** = Installing FreeBSD on a microSD card and building a (custom) kernel = ****). >=20 > Results with the thus builded kernels: >=20 > 13.1-GENERIC does work > 13.1-GENERIC-MMCCAM does boot from the microSD, but USB does not work But for use of sys/arm64/conf/GENERIC-MMCCAM . . . For my example context, booting via a USB3 port with USB3 media attached booted just fine. I reported this in a later message. But it was an older "BOT" (3 GiByte DMA limitation) SOC Rev 1.4 board RPi4B (8 GiByte). (I did not even test booting from microsd media at all.) > 13.1-GNNERIC-RPi4 stalls when booting. > cat /usr/src/sys/arm64/conf/GENERIC-RPi4 > include GENERIC > ident GENERIC-RPi4 > nooptions SOC_NVIDIA_TEGRA210 >=20 > In the serial console: > ... > mmcsd0: Error indicated: 1 Timeout > mountroot: waiting for device /dev/ufs/rootfs... > bcm_dma0: DMA error 4 on CH5 > Mounting from ufs:/dev/ufs/rootfs failed with error 19. I will note that there are DMA related differences in our contexts. An example that I know of is: A) The "B0T" SOC's have limitations, such as the restriction to the lower 3 GiByte range. B) The "C0T" SOC's do not have that limitation. Normally (A) vs. (B) only matters for the 4 GiByte and 8 GiByte RPi4B variants, if I understand right. My understanding is that the device tree handed over by the RPi* firmware has differences for (A) vs. (B) via dynamic adjustments to the .dtb content after it is loaded. But I've no clue if such might have contributed to what you observed. > My conclusion is that we may not completely disable NVIDIA Tegra 210. = And after all, my goal was not exactly to disable the Tegra, but to = mitigate the egoistic behaviour of its internal RTC driver for the = MAX77620 (all i2c-addr 68 is mine). I achieved that goal by replacing in = the source file /usr/src/sys/arm64/nvidia/tegra210/max77620_rtc.c (of = 13.1-RELEASE) the I2C address from 0x68 to 0x7F. Nothing uses 0x7F and = so the MAX77620 driver may claim it for itself without harm to other = devices. >=20 > sed -e "s/#define MAX77620_RTC_I2C_ADDR.0x68/#define = MAX77620_RTC_I2C_ADDR 0x7F/" \ > -i "" /usr/src/sys/arm64/nvidia/tegra210/max77620_rtc.c=20 >=20 > 13.1-GENERIC (patched) does work, including the DS3231 RTC on i2c1 = address 0x68. >=20 > ... > iicbus0: on iichb0 > iic0: on iicbus0 > ds32310: at addr 0xd0 on iicbus0 > ... > ... > mmcsd0: 16GB at = mmc1 50.0MHz/4bit/65535-block > bcm2835_cpufreq0: ARM 1500MHz, Core 500MHz, SDRAM 400MHz, Turbo ON > ds32310: registered as a time-of-day clock, resolution 1.000000s > ... >=20 > Many thanks for all your inputs and efforts. Glad to hear that you got it going. > Best regards >=20 > Rolf >=20 >=20 > *** Installing FreeBSD on a microSD card and building a (custom) = kernel **** >=20 > 1. Fetch the image and write it to a pristine microSD card: >=20 > # fetch = https://download.freebsd.org/releases/arm64/aarch64/ISO-IMAGES/13.1/FreeBS= D-13.1-RELEASE-arm64-aarch64-RPI.img.xz > # xz -d FreeBSD-13.1-RELEASE-arm64-aarch64-RPI.img.xz > # dd if=3DFreeBSD-13.1-RELEASE-arm64-aarch64-RPI.img of=3D/dev/da0 = bs=3D1m conv=3Dsync >=20 >=20 > 2. Preparation before the first start which automatically would max. = out the UFS partition. > Hovever, I want to reserve space for a 2 GB swap partition > (omit this step, in case you don't want a swap p.): >=20 > # gpart resize -i 2 da0 > # gpart show da0 da0s2 > =3D> 63 31116225 da0 MBR (15G) > 63 2016 - free - (1.0M) > 2079 102312 1 fat32lba [active] (50M) > 104391 31011897 2 freebsd (15G) >=20 > =3D> 0 31011897 da0s2 BSD (15G) > 0 57 - free - (29K) > 57 6186880 1 freebsd-ufs (2.9G) > 6186937 24824960 - free - (12G) >=20 > Calculate the base (start) of the swap partition, e.g. here: 6186937 = + 24824960 - 4*1024*1024 =3D 26817593 > # gpart add -b 26817593 -t freebsd-swap da0s2 > # gpart show da0s2 > =3D> 0 31011897 da0s2 BSD (15G) > 0 57 - free - (29K) > 57 6186880 1 freebsd-ufs (2.9G) > 6186937 20630656 - free - (9.8G) > 26817593 4194304 2 freebsd-swap (2.0G) >=20 >=20 > 3. Start the RPi 4 with the SD card and enter via serial console as = root: >=20 > login: root > Password: > May 12 08:46:57 generic login[1206]: ROOT LOGIN (root) ON ttyu0 > FreeBSD 13.1-RELEASE releng/13.1-n250148-fc952ac2212 GENERIC >=20 > Welcome to FreeBSD! >=20 > Release Notes, Errata: https://www.FreeBSD.org/releases/ > Security Advisories: https://www.FreeBSD.org/security/ > FreeBSD Handbook: https://www.FreeBSD.org/handbook/ > FreeBSD FAQ: https://www.FreeBSD.org/faq/ > Questions List: = https://lists.FreeBSD.org/mailman/listinfo/freebsd-questions/ > FreeBSD Forums: https://forums.FreeBSD.org/ >=20 > Documents installed with the system are in the = /usr/local/share/doc/freebsd/ > directory, or can be installed later with: pkg install = en-freebsd-doc > For other languages, replace "en" with a language code like de or = fr. >=20 > Show the version of FreeBSD installed: freebsd-version ; uname -a > Please include that output and any error messages when posting = questions. > Introduction to manual pages: man man > FreeBSD directory layout: man hier >=20 > To change this login announcement, see motd(5). >=20 > root@generic:~ # gpart show > =3D> 63 31116225 mmcsd0 MBR (15G) > 63 2016 - free - (1.0M) > 2079 102312 1 fat32lba [active] (50M) > 104391 31011897 2 freebsd (15G) >=20 > =3D> 0 31011897 mmcsd0s2 BSD (15G) > 0 57 - free - (29K) > 57 26814464 1 freebsd-ufs (13G) > 26814521 3072 - free - (1.5M) > 26817593 4194304 2 freebsd-swap (2.0G) >=20 >=20 > 4. Donwload and install the sources: >=20 > # cd / > # fetch --no-verify-peer = https://download.freebsd.org/releases/arm64/aarch64/13.1-RELEASE/src.txz > # tar -xzf src.txz >=20 >=20 > 5. Build and install the GENERIC kernel >=20 > # cd /usr/src > # make -j4 buildkernel KERNCONF=3DGENERIC > # make installkernel KERNCONF=3DGENERIC >=20 >=20 > 6. Restart the RPi 4 =3D=3D=3D Mark Millard marklmi at yahoo.com