Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp1630115rdb; Sat, 2 Dec 2023 03:46:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IHmQaHo6ZW51laBEEoBtToswICUjf1wQiT+A3VCGyWP5Bh0k+MErIXJ4fcNdoKfUWlDBQ8M X-Received: by 2002:a05:6830:2813:b0:6c4:8441:f90 with SMTP id w19-20020a056830281300b006c484410f90mr1591860otu.24.1701517583512; Sat, 02 Dec 2023 03:46:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701517583; cv=none; d=google.com; s=arc-20160816; b=z6VOeVgDVmsq7dGBA8cGWRBMHnrj5+AmXuGtmoWIzPpiA2Wi80tyTtDgE6ueHuXqjq jW/Gs4mTnr9fHo3l0K8ueDrEgAEo0OQAhv8c1Yekr1sgytKVFd6xAwlZbkmNwK5kOyjH 09G/vu/4r5yYXwRr/y1CAFnM6HnxijeousxPQrO2pnDcVBu8rxxbybQU5dWYU6U4hzye w1eTkJHnq1hNlz8M7GrS/R5XfR0nkh1vJu9Q1vR2V9XosdFMQQkL9SAnCvHHbOF08DI4 UqBa+7uM6svYqXY+vygm1R2MEx3v9/hh88n5xqenb/otAxkjtKrGfmhdw4FpNwWVO7PX LGzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=uSCwJobsv7eeFCBU3RQEyIImjUxRbMNqeubbtgPE2UY=; fh=rJQk8W27rFzBm3rR74vfgShBeHTv2/kNV+nG5b+Ju/w=; b=e9KJLNrWpUy59xL4rlrySgCkAWaYHETdCWHFNbiNIT6DoP/g7vxb1DWL2MRaQyBT7Q elRpHv4gI5+iXNypMR1cIQRqrn7OrBLOZhxP9pC6Cbmotog+5AGqtVb8TkEt420xwbZB wQZ5npH+qgOZIojMkCfHSMHe0TQ0sHOr17YGwjTmsbZcrHdn/buFKeKwwGqUWS4vyrFN qRybmFj5M3ZxqheWt0X8kshw/ptb/TOvptwC58MTS+G3oRslSsGDzPGnZkH06tvcnnEb V36oJ176HtGaSKqQ+RxJBraDef5WKXlT5ICkv+fhFaEWd5aZYty04UodJIDHfTA8+INE olWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=A2aZ+tpY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id c6-20020a634e06000000b005c660b46609si750333pgb.486.2023.12.02.03.46.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Dec 2023 03:46:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=A2aZ+tpY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 30B2B806500B; Sat, 2 Dec 2023 03:45:54 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232488AbjLBLpo (ORCPT + 99 others); Sat, 2 Dec 2023 06:45:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229451AbjLBLpm (ORCPT ); Sat, 2 Dec 2023 06:45:42 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1108911F for ; Sat, 2 Dec 2023 03:45:49 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1E878C433C9; Sat, 2 Dec 2023 11:45:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701517548; bh=uSCwJobsv7eeFCBU3RQEyIImjUxRbMNqeubbtgPE2UY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=A2aZ+tpYZc1B+VffwLZP5uR8wuY2wfDyB0dgPW19VJ08pMMcJVaJ778Yw9lntR0mG YIIdnB09hIBjnOp6oJGZ5fLAdKO/+ePBmoNjkjsUVxx0nbemTqNisiNhxwfjH05pNZ UUndxqxuMNmJbewMA/talTn+nliBmu6EykAaV8nLdGrUmLni/Z6cvnbz//953qDdYo Z6T1aluqOJ8HWIdIvQR86Cpx1LYoH9gd29h06f7ToxDmGG4P1sVJ5WNYxHfsY6SWHL gtGHw1dliNhYygnX8O4J9ZjX2TwwMztBTfwNeNNds2hFeiN4eC/Ua9V0Vn4NAG+HSy OiEIEp6wU/rTQ== Date: Sat, 2 Dec 2023 11:45:44 +0000 From: Conor Dooley To: Masahiro Yamada Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , "open list:SIFIVE DRIVERS" , Alexandre Ghiti , Linux Kernel Mailing List Subject: Re: Question about BUILTIN_DTB support in RISCV Message-ID: <20231202-paparazzi-thievish-744c40e351be@spud> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Gwwjm7FWxQD2puPb" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sat, 02 Dec 2023 03:45:54 -0800 (PST) --Gwwjm7FWxQD2puPb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Dec 02, 2023 at 03:45:00AM +0900, Masahiro Yamada wrote: > Hi. >=20 > I have a question about CONFIG_BUILTIN_DTB for riscv. >=20 > Please see this commit history. >=20 >=20 > [1] > 2d2682512f0faf4d09a696184bf3c0bb6838baca > added built-in DTB support, attempting > to include multiple DTB into vmlinux > by using SOC_BUILTIN_DTB_DECLARE() macro. >=20 >=20 > [2] > d5805af9fe9ffe4a9d975e9bc39496f57a161076 > pointed out that choosing the correct DTB > is impossible. It fell back to the single > built-in DTB support, like other architectures. >=20 > [3] > 0ddd7eaffa644baa78e247bbd220ab7195b1eed6 > added BUILTIN_DTB support for sifive and microchip, > while apparently multiple DTBs are embedded into vmlinux. The thread for this one is interesting: https://lore.kernel.org/all/20210604120639.1447869-1-alex@ghiti.fr/ None of the other !canaan platforms actually support this, so it is only for PolarFire and the SiFive boards that this is enabled. It sounds, =66rom your comments below, that this does not even work. If it doesn't, I would be inclined to just delete it. If XIP is the user, we want to deprecate XIP anyway, so pointing out that this has not worked properly in a long time for PolarFire and ?ever? for the SiFive unmatched is another nail in the coffin for that. My vote would be for reverting [3] and removing support for XIP :) > So, how does it work? >=20 >=20 > With > CONFIG_ARCH_MICROCHIP_POLARFIRE=3Dy > CONFIG_ARCH_SIFIVE=3Dy > CONFIG_BUILTIN_DTB=3Dy >=20 > 7 DTB files are embedded in vmlinux. >=20 >=20 > masahiro@zoe:~/ref/linux(master)$ riscv64-linux-gnu-nm -n vmlinux | > grep -A15 dtb_start > ffffffff82112620 D __dtb_start > ffffffff82115a2c D __dtb_mpfs_icicle_kit_end > ffffffff82115a40 D __dtb_mpfs_m100pfsevp_begin > ffffffff82118b3b D __dtb_mpfs_m100pfsevp_end > ffffffff82118b40 D __dtb_mpfs_polarberry_begin > ffffffff8211b9c2 D __dtb_mpfs_polarberry_end > ffffffff8211b9e0 D __dtb_mpfs_sev_kit_begin > ffffffff8211e7bb D __dtb_mpfs_sev_kit_end > ffffffff8211e7c0 D __dtb_mpfs_tysom_m_begin > ffffffff8212162e D __dtb_mpfs_tysom_m_end > ffffffff82121640 D __dtb_hifive_unleashed_a00_begin > ffffffff821236af D __dtb_hifive_unleashed_a00_end > ffffffff821236c0 D __dtb_hifive_unmatched_a00_begin > ffffffff8212621b D __dtb_hifive_unmatched_a00_end > ffffffff82126220 D __dtb_end >=20 >=20 > In my understanding, the first one > (mpfs-icicle-kit.dtb) is always used. >=20 > You cannot use the other 6 DTBs. > Am I missing something? Alex? I gave a cursory test and it does in fact behave like this. --Gwwjm7FWxQD2puPb Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZWsY6AAKCRB4tDGHoIJi 0qL1AP42NadeFiz5c/wdHAp3pzYsORuTAsof8ogQqSkVyoDWogEAqwXZrryKGWID GqGD5DMLBVzIH6oEvhsmFPSmg1sgvAs= =HWh1 -----END PGP SIGNATURE----- --Gwwjm7FWxQD2puPb--