From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 1371 invoked from network); 7 Apr 2021 08:45:50 -0000 Received: from 1ess.inri.net (216.126.196.35) by inbox.vuxu.org with ESMTPUTF8; 7 Apr 2021 08:45:50 -0000 Received: from pv50p00im-ztdg10022001.me.com ([17.58.6.58]) by 1ess; Wed Apr 7 04:39:42 -0400 2021 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1617784775; bh=EWetDcOvcQWn1h6YTaZpw+Pssgora0p8KU14cUrXglE=; h=From:Content-Type:Mime-Version:Subject:Date:To:Message-Id; b=JRo+Ads1VIb4ldShtSLyAAoaAFgJVwHf8vn0VSut871SL0ugysnkyTQj/BNLWr0Fz pOfnFS24RCziaxVWP/pC2/ZDXTryC0V0GdDHPoxp0xa+6MvHwTKGaKcxgG21DBDMc6 o8PsMSexjWAz4Qi9O9FRPyHz2JyuBu8BbnECZYfnoaDAmpXP12rJub7bJrVl6IaekP GLDy16nnzUYCSWopSDCFGKqRDbexGuX06K0nQZYE9Jjb21mvfWhIrus6yox0npleJU ZiZ/Wk3Mgbv5q4t/JiUPgpjjrv2w9dpgg+FzIncJf4jnhylBclsvsEza7MTXCbzZ/u O4bIdFeQeY20g== Received: from [192.168.1.52] (unknown [93.56.117.77]) by pv50p00im-ztdg10022001.me.com (Postfix) with ESMTPSA id 9CC46A040E for <9front@9front.org>; Wed, 7 Apr 2021 08:39:34 +0000 (UTC) From: Daniel Morandini Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.40.0.2.32\)) Date: Wed, 7 Apr 2021 10:39:31 +0200 References: <0BEAEA67139CE537F0AE008DC06176FA@felloff.net> <1721CD21-19AF-482A-B75D-F56A903A57A1@me.com> <0AD69C97-A018-4009-AA84-CC4A28FCCA78@me.com> To: 9front@9front.org In-Reply-To: Message-Id: X-Mailer: Apple Mail (2.3654.40.0.2.32) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369,18.0.761 definitions=2021-04-07_04:2021-04-06,2021-04-07 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-2009150000 definitions=main-2104070063 List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: responsive JSON injection firewall Subject: Re: [9front] PXE booting Rpi Reply-To: 9front@9front.org Precedence: bulk Hi people, 9pi2 is now getting its kernel configuration params! :D Summary: add a =E2=80=9Cdevice_tree=3D=E2=80=9C line to your config.txt = file if you want your bcm pi to load cmdline.txt (9front 18e1e1c3aaf1, bootcode.bin from [4] 8717598). I spotted the =E2=80=9Cproblem" in bcm/bootargs.c, `bootargsinit`. ``` void bootargsinit(uintptr pa) { uintptr len; /* * kernel gets DTB/ATAGS pointer in R0 on entry */ if(pa !=3D 0 && (len =3D cankaddr(pa)) !=3D 0){ void *va =3D KADDR(pa); if(parseatags(va, len) =3D=3D 0 || parsedevtree(va, len) = =3D=3D 0) { return; } } /* * /dev/reboot case, check CONFADDR */ if(parseatags(BOOTARGS, BOOTARGSLEN) !=3D 0) plan9iniinit(BOOTARGS, 0); } ``` Some notes. DTB/ATAGS pointer is passed to R2 on entry, not R0, according to [1] and [2]. We call bootargsinit(0) though (main.c:87), so the first if statement is never asserted, at least from the references within the bcm folder. Now according to the comment we should reach the second block only when rebooting (?), but apparently this is not true. Quoting [3], > The firmware will always try to load the DT and pass it to the > kernel, since all kernels since rpi-4.4.y will not function without > a DTB. You can override this by adding device_tree=3D in config.txt, > which forces the use of ATAGs, which can be useful for simple > "bare-metal" kernels. And that was it! The second block in fact does not try to parse a device tree but atags. Why is bootargsinit called with pa=3D0? I think this function is not working as intended anymore! Cheers, dan [1] https://wiki.osdev.org/ARM_RaspberryPi [2] = http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#append= ix_tag_reference [3] = https://www.raspberrypi.org/documentation/configuration/device-tree.md#par= t3 [4] = https://github.com/raspberrypi/firmware/blob/master/boot/bootcode.bin=