From nobody Sat Sep 10 07:28:50 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 4MPkxq1C80z4cZ8t for ; Sat, 10 Sep 2022 07:29:03 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mx.blih.net [212.83.155.74]) (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 "mx.blih.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MPkxm5xHcz3GXL; Sat, 10 Sep 2022 07:29:00 +0000 (UTC) (envelope-from manu@bidouilliste.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1662794932; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=P0taQcqVc2VwkEAkodWNwf9iddOLbe9M1XvYzZgUDJY=; b=NxXyy27aQPz7xg5y47NF6r8hNHiVYNWnVADTQF7pmyFXEPnRpCoRx+nT3edoMXw/DTBbfR iqO+2GwCig3AUb2DidqWIVZnDlScwqb+gTetXO03HUgQnZdqZoTPHRlgNCrI7MRE4Fd11G P+e26rrqIZwoYL6NMLY1sSQrlDxLRIY= Received: from skull.home.blih.net (mtl93-h04-176-174-252-202.dsl.sta.abo.bbox.fr [176.174.252.202]) by mx.blih.net (OpenSMTPD) with ESMTPSA id 61e5afdb (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sat, 10 Sep 2022 07:28:52 +0000 (UTC) Date: Sat, 10 Sep 2022 09:28:50 +0200 From: Emmanuel Vadot To: Peter Jeremy Cc: freebsd-arm@freebsd.org Subject: Re: Pine H64 won't boot with DTB version 5.13 Message-Id: <20220910092850.244fbdb448678642e7ae321e@bidouilliste.com> In-Reply-To: References: X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) 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: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4MPkxm5xHcz3GXL X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bidouilliste.com header.s=mx header.b=NxXyy27a; dmarc=pass (policy=none) header.from=bidouilliste.com; spf=pass (mx1.freebsd.org: domain of manu@bidouilliste.com designates 212.83.155.74 as permitted sender) smtp.mailfrom=manu@bidouilliste.com X-Spamd-Result: default: False [-3.49 / 15.00]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-0.99)[-0.994]; DMARC_POLICY_ALLOW(-0.50)[bidouilliste.com,none]; MV_CASE(0.50)[]; R_DKIM_ALLOW(-0.20)[bidouilliste.com:s=mx]; R_SPF_ALLOW(-0.20)[+ip4:212.83.155.74/32]; MIME_GOOD(-0.10)[text/plain]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MLMMJ_DEST(0.00)[freebsd-arm@freebsd.org]; ASN(0.00)[asn:12876, ipnet:212.83.128.0/19, country:FR]; MIME_TRACE(0.00)[0:+]; RCPT_COUNT_TWO(0.00)[2]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FREEFALL_USER(0.00)[manu]; ARC_NA(0.00)[]; DKIM_TRACE(0.00)[bidouilliste.com:+]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N Hi Peter, On Sat, 10 Sep 2022 15:00:48 +1000 Peter Jeremy wrote: > I have updated my Pine H64 to -current and the kernel advises me: > WARNING: DTB version is 5.9 while kernel expects 5.13, please update the DTB in the ESP > unfortunately, when I do so, it fails to attach mmc1 to aw_mmc0 (the > microSD slot) and therefore there's no root device. The onboard > flash mmc0 connected to aw_mmc1 probes normally. > > I've compared the boot messages and the critical difference seems to be > that with the newer DTB, the following device is missing: > aw_r_intc_gicp0: mem 0x7021000-0x70213ff irq 48 on simplebus0 > Instead, I get: > simplebus0: mem 0x7021000-0x70213ff irq 51 compat allwinner,sun50i-h6-r-intc (no driver attached) > > Looking through the DTS changes the crucial difference is: > > --- /tmp/zzz/5def4c47d4bd/sys/contrib/device-tree/src/arm64/allwinner/sun50i-h6.dtsi 2022-09-10 12:49:39.000000000 +1000 > +++ /tmp/zzz/src/sys/contrib/device-tree/src/arm64/allwinner/sun50i-h6.dtsi 2022-09-10 13:24:13.751345000 +1000 > ... > @@ -927,10 +929,9 @@ > }; > > r_intc: interrupt-controller@7021000 { > - compatible = "allwinner,sun50i-h6-r-intc", > - "allwinner,sun6i-a31-r-intc"; > + compatible = "allwinner,sun50i-h6-r-intc"; > interrupt-controller; > - #interrupt-cells = <2>; > + #interrupt-cells = <3>; > reg = <0x07021000 0x400>; > interrupts = ; > }; > > The problem is that the FreeBSD interrupt controller drivers > (sys/arm/allwinner/aw_nmi.c and sys/arm/allwinner/aw_r_intc.c) only > recognize "allwinner,sun6i-a31-r-intc". > > I tried adding "allwinner,sun6i-a31-r-intc" back in and the resultant > DTB works. > > I'm not sure if the correct fix is to locally patch sun50i-h6.dtsi > or fix the interrupt controller drivers. > > -- > Peter Jeremy Sorry I've missed that when I updated the DTS. The correct fix is to add the new compat string to the aw_r_intc driver (sys/arm/allwinner/aw_r_intc.c). Not really sure why the a31 compat string was removed upstream as it's not said in the commit message tought. Feel free to commit this change. While you're at it also add allwinner,sun50i-a64-r-intc to the list just in case they remove the a31 compat string in the futur. Cheers, -- Emmanuel Vadot