Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp1253095rdb; Fri, 1 Dec 2023 10:46:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IEswuIylbZdqP86oio7u7/XWg6cNTTXUVOKTBBlQcvEaOoFK1pfjflPeDv7XGsbzlyaEVfY X-Received: by 2002:a92:dc4f:0:b0:35c:f9f9:2e14 with SMTP id x15-20020a92dc4f000000b0035cf9f92e14mr15278600ilq.0.1701456373544; Fri, 01 Dec 2023 10:46:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701456373; cv=none; d=google.com; s=arc-20160816; b=M4v812eqMKWQYgjwz7Q0i8WoKVObWusHImqptYHKG/7FM3nODfAON+d1NjmBTy5/hG eVkuTR35gqxbYFpWV6pCAmiAJruIMFhGiIOiHy4/31bqBpUIkXLAFThIEb83/jHtduzG vMKGEcP0nNqTBh7SGhdOyWOvdeVlqFZ8QYUFe2B1W9ya3G3YQIZZX83kn2a++Chei7NE 5WQCvnq5to4ZVIM3ylfsqZWedIU7elu2VwmCGFI25dOnM3l1xA5GVbBh0ke0EQlb03Lj 7tMCfJINla70GZxP7bo1u34oEOnmks6nhkQo4w3+/Uq+/jde6QlhVfJqsTl1E2Wq+x6X p1aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:subject:message-id:date:from:mime-version :dkim-signature; bh=lOde/BNv4QkexQb9OV2fsrEXcJxXtvi71d/6ChNE6NY=; fh=VSqQ45fATDmC1OjB3vnwd6P3oMTvSrdn3RU4OxoZJ/w=; b=EXto4c1km/dZYkDRhlgcvMTJ4/CmTTYtbG5L9QQ8BAs0yfaZT9zEZmA5u0k73JEOht iTVfwg9R3Whqwl2V+uEkEYFiDmhQ0wMvVPcZpIcksrvSMD2NmjppptG8+SWpDghQfZXU qQfZHy1BK2l68Cw5PTYVkorwl/3tHILAit5moAtGWwDY/MyeT9K7/wHh4ZWGkCQIS1UL pcjEfypzhOiOdf/E1dzNf7eK7vLHtE/Dz0Yj8Nmqpr/K4uGi4fH7u1V7HleiUqRH6rJG Ro8fjhhEBT/X6Oewrb0ZJ3O9+TbGTrASmrDGrPv83OHeP/yYf3tUe2kepIB0iukzZvyD qDQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bIHd+PIq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id s7-20020a635e07000000b005be1ee5dcd4si4079550pgb.492.2023.12.01.10.46.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 10:46:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bIHd+PIq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id A9131806A63F; Fri, 1 Dec 2023 10:45:51 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230364AbjLASpg (ORCPT + 99 others); Fri, 1 Dec 2023 13:45:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229534AbjLASpe (ORCPT ); Fri, 1 Dec 2023 13:45:34 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8A9910D7 for ; Fri, 1 Dec 2023 10:45:40 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E70FC433C9 for ; Fri, 1 Dec 2023 18:45:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701456340; bh=xsaxZc0KDMl85GF4GH4Yoo9cd+8f9Y9i3cFqKb8mFrs=; h=From:Date:Subject:To:From; b=bIHd+PIqaCH3KnUpbCBl/xHTAwBfq3OB/8Wc2UWOxQV8/2xeJC82EkJCqh7CYKH8t 0Ybt0MpspXxSmiuCr9e4/4s0X29us2ApQCYm/6pAMjvk7SB9YRp44m3yY0pdvuQLkC vf2uzSTHbXQFd2C/uWcd/Ai3HfmD6Do2cLqb0jnPXokNuG7xqEGgzrKQPnRQEkto7N D/c8zI9hCLWeTRb28aj7GSHQzUEO2nJWU67EVxKZzixRqvYqSFRo88h6Pt/CzS+SoI 4EHXQ04WtNPmH2GKrKcrHyRWl6ieQGeIyy31PK8w3Nd8SxTMCXA9wQZWv/0VdmjWNP 84UiccT5y1i+Q== Received: by mail-lj1-f182.google.com with SMTP id 38308e7fff4ca-2c9d1b07e79so24808181fa.1 for ; Fri, 01 Dec 2023 10:45:40 -0800 (PST) X-Gm-Message-State: AOJu0YzFqqcM2D1X1AU1qMdMlDdQoLLa12ffLc9AVrzm82soIChLOw4L Y0/uZnG/vka3cCDySvfhB3vmknWiSOhgQZuuVT0= X-Received: by 2002:a2e:8185:0:b0:2c9:bc36:89c4 with SMTP id e5-20020a2e8185000000b002c9bc3689c4mr1232506ljg.0.1701456338890; Fri, 01 Dec 2023 10:45:38 -0800 (PST) MIME-Version: 1.0 From: Masahiro Yamada Date: Sat, 2 Dec 2023 03:45:00 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Question about BUILTIN_DTB support in RISCV To: Paul Walmsley , Palmer Dabbelt , Albert Ou , "open list:SIFIVE DRIVERS" , Alexandre Ghiti , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email 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 (lipwig.vger.email [0.0.0.0]); Fri, 01 Dec 2023 10:45:51 -0800 (PST) Hi. I have a question about CONFIG_BUILTIN_DTB for riscv. Please see this commit history. [1] 2d2682512f0faf4d09a696184bf3c0bb6838baca added built-in DTB support, attempting to include multiple DTB into vmlinux by using SOC_BUILTIN_DTB_DECLARE() macro. [2] d5805af9fe9ffe4a9d975e9bc39496f57a161076 pointed out that choosing the correct DTB is impossible. It fell back to the single built-in DTB support, like other architectures. [3] 0ddd7eaffa644baa78e247bbd220ab7195b1eed6 added BUILTIN_DTB support for sifive and microchip, while apparently multiple DTBs are embedded into vmlinux. So, how does it work? With CONFIG_ARCH_MICROCHIP_POLARFIRE=y CONFIG_ARCH_SIFIVE=y CONFIG_BUILTIN_DTB=y 7 DTB files are embedded in vmlinux. 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 In my understanding, the first one (mpfs-icicle-kit.dtb) is always used. You cannot use the other 6 DTBs. Am I missing something? arch/riscv64/boot/dts/canaan/Makefile is correct because only one DTB is embedded if CONFIG_ARCH_CANAAN_K210_DTB_SOURCE contains a single word. -- Best Regards Masahiro Yamada