Message ID | 20230331182727.4062790-1-evan@rivosinc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp759141vqo; Fri, 31 Mar 2023 11:32:43 -0700 (PDT) X-Google-Smtp-Source: AKy350a6TNmWwmYc97SezEPTMWfjuBqXuxz7tpAaYv5iosUpboUKHVKle/1DwI2P3Qoy0jSpoLEk X-Received: by 2002:a17:90b:1e01:b0:234:159:4003 with SMTP id pg1-20020a17090b1e0100b0023401594003mr28384853pjb.25.1680287563060; Fri, 31 Mar 2023 11:32:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680287563; cv=none; d=google.com; s=arc-20160816; b=CDrigbZ8wfsaathj3Ai5VTAJjH30HiA7MImjuyAgdV0B6h5kyM58yXr3LwxZEKt0uE Nv7NJxi7l9vniKjOAx6mTrVS1k1gssYl0vbcLkTaeGbKinK+WSzR6Gp/8fSmXwXVGPmq 1PdjzzTrW8JjwuCNqr1AUDhStBGruO38nfsgYp0cU5UwlXopFrBuz+zl8SAyQo4RBDCa rTSFq0p5DsK+G/6ilpaWLjytS8JfFbutXvLwlXTjSDgrTkCw/W3JN253CT75LFQpf9Ke 8qNqqrxgrg0ABnXeveoKAc08cj836WgIBKoT4DYOovcT0c4GjkQtqTad6Ui4fT8BDzzh sagA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=p4FGWSIPST9m6YTXbscC7ErUtHPtpC6n3urFFBCXSuI=; b=uBzOYgtRzdr7I939/TAxaYg99mNdrO0vbskJMRTY96qJwBvC6QDfHg4RdkiHb7qL2k azmsyPa8Xg+Oi8XwpIrNYdrZdQflSYGEj30az6rd+fB8jDGVuXwjNRPHZdl0DNdkpCfJ 6ESScqLMnjyQBgYHQAG0TgYeg8WASFRxdXPvVYc1XLPcHuMoY9KQ94XHO2vEiR9g52N5 EY90moaIA5OPOytur122LOASxJU1+lSd+Iq9gFjUVIQewz/prBcUBbkxtjqmAiR+ql5e 4QfQJE5j+Z5wes+P78TFU24CcjNou7r3GdvormvLwbZJqDvLBIpLnxJpuFDVthcdnFaR WNiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20210112.gappssmtp.com header.s=20210112 header.b=74oWXDIl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nd14-20020a17090b4cce00b002263b1df9f7si9209920pjb.0.2023.03.31.11.32.29; Fri, 31 Mar 2023 11:32:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20210112.gappssmtp.com header.s=20210112 header.b=74oWXDIl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232995AbjCaS1f (ORCPT <rfc822;dexuan.linux@gmail.com> + 99 others); Fri, 31 Mar 2023 14:27:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231721AbjCaS1d (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 31 Mar 2023 14:27:33 -0400 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 732641E728 for <linux-kernel@vger.kernel.org>; Fri, 31 Mar 2023 11:27:32 -0700 (PDT) Received: by mail-pl1-x636.google.com with SMTP id o11so22097833ple.1 for <linux-kernel@vger.kernel.org>; Fri, 31 Mar 2023 11:27:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; t=1680287252; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=p4FGWSIPST9m6YTXbscC7ErUtHPtpC6n3urFFBCXSuI=; b=74oWXDIlBPU68uwXVejlOmomkabmhkdTDR+caL1MADEQSdjPjVuZ1dMDPKYm3jiBJz f89c39he3eNwXJGk9iAPuh7PGV5QlqHep+5CsA9D0jjjZt/ijv8kbwl4tOExrz03/UFv TJucNRYuNMDcIDYmsQUJs/CFGXH3IbzJL6nsSD3YASqmB3b8uJDdwCFHneyfAiEfKd// k2DilaXoubfPSHiuqOLWcY+cLX1kMibk9FbQY45f4ttJJBOyxxPLTMSX06VX6i1X1rO9 ZP/zJsdxyDYzQG+uqof4J08lbr0lWdOdvCUFGCrR6LtqcbjSN60FwFniWzA2bSx8zsUx 00jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680287252; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=p4FGWSIPST9m6YTXbscC7ErUtHPtpC6n3urFFBCXSuI=; b=eRU7gEuC8GhQuuUu8wSa5o2fn7JnhL3TX7DRpSA40JFNs81qr7PdV56/fvsh0r/Rsw EPndoD/T0hcw6Q2wvOxt/yPruKRmcbElHcSI5yChT3HzE3TlO3ufXvJiKjr2o/7XgXm/ gklcDSm0WYWfGfud7Nbwy/x58LKWIankuWOuuAmtZcV6JqOhJFJ/WoRoKk9SctKy6IB0 OTU9dYAifr8rxRkxPqLJ2UW7ugRW516IvMilZkzJ7vFtbWnhXRoyI8u7FuJueJDUd1Gi algZ90L7rg2csfpPHLJZ/pq/l1A75KSyZbQTOOUj6pltNKzu9cPb/xIMbAgl7hp2UavN qRPA== X-Gm-Message-State: AAQBX9e7+2onFNLgFOrg3Fl9lX6vOoPodU0nWm0bNeOy8StCHCZS8hud jZN+vValm1pb/2wBlJib9b1J/A== X-Received: by 2002:a17:903:3093:b0:19d:1bc1:ce22 with SMTP id u19-20020a170903309300b0019d1bc1ce22mr23992076plc.5.1680287251852; Fri, 31 Mar 2023 11:27:31 -0700 (PDT) Received: from evan.ba.rivosinc.com ([66.220.2.162]) by smtp.gmail.com with ESMTPSA id c20-20020a170902b69400b0019f1027f88bsm1826795pls.307.2023.03.31.11.27.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Mar 2023 11:27:31 -0700 (PDT) From: Evan Green <evan@rivosinc.com> To: linux-sunxi@lists.linux.dev Cc: conor.dooley@microchip.com, Evan Green <evan@rivosinc.com>, Albert Ou <aou@eecs.berkeley.edu>, Chen-Yu Tsai <wens@csie.org>, Conor Dooley <conor@kernel.org>, Jernej Skrabec <jernej.skrabec@gmail.com>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Palmer Dabbelt <palmer@dabbelt.com>, Paul Walmsley <paul.walmsley@sifive.com>, Rob Herring <robh+dt@kernel.org>, Samuel Holland <samuel@sholland.org>, Trevor Woerner <twoerner@gmail.com>, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [RFC PATCH] riscv: dts: nezha-d1: Add memory Date: Fri, 31 Mar 2023 11:27:27 -0700 Message-Id: <20230331182727.4062790-1-evan@rivosinc.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=0.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761909211587033279?= X-GMAIL-MSGID: =?utf-8?q?1761909211587033279?= |
Series |
[RFC] riscv: dts: nezha-d1: Add memory
|
|
Commit Message
Evan Green
March 31, 2023, 6:27 p.m. UTC
Add memory info for the D1 Nezha, which seems to be required for it to
boot with the stock firmware. Note that this hardcodes 1GB, which is
not technically correct as they also make models with different amounts
of RAM. Is the firmware supposed to populate this?
Signed-off-by: Evan Green <evan@rivosinc.com>
---
arch/riscv/boot/dts/allwinner/sun20i-d1-nezha.dts | 6 ++++++
1 file changed, 6 insertions(+)
Comments
On Fri, Mar 31, 2023 at 11:27:27AM -0700, Evan Green wrote: > Add memory info for the D1 Nezha, which seems to be required for it to > boot with the stock firmware. Note that this hardcodes 1GB, which is > not technically correct as they also make models with different amounts > of RAM. > Is the firmware supposed to populate this? Yup. Samuel intentionally did it this way: https://lore.kernel.org/linux-riscv/8a2194bf-93bd-de4d-8d39-0cd72aabb0a9@sholland.org/ Since I don't like using the firmware provided stuff to more easily test I do this in my u-boot boot script: tftp 0x54000000 d1-fitImage.fit bootm start 0x54000000 bootm loados 0x54000000 bootm ramdisk; bootm prep; fdt memory 0x40000000 0x20000000 bootm go; Hope either of the above are helpful, Conor. > > Signed-off-by: Evan Green <evan@rivosinc.com> > > --- > > arch/riscv/boot/dts/allwinner/sun20i-d1-nezha.dts | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/arch/riscv/boot/dts/allwinner/sun20i-d1-nezha.dts b/arch/riscv/boot/dts/allwinner/sun20i-d1-nezha.dts > index 4ed33c1e7c9c..6aba68cf5541 100644 > --- a/arch/riscv/boot/dts/allwinner/sun20i-d1-nezha.dts > +++ b/arch/riscv/boot/dts/allwinner/sun20i-d1-nezha.dts > @@ -32,6 +32,12 @@ / { > model = "Allwinner D1 Nezha"; > compatible = "allwinner,d1-nezha", "allwinner,sun20i-d1"; > > + // FIXME: this is temporary. > + memory@40000000 { > + device_type = "memory"; > + reg = <0x40000000 0x40000000>; /* 1 GB */ > + }; > + > aliases { > ethernet0 = &emac; > ethernet1 = &xr829; > -- > 2.25.1 >
On Fri, Mar 31, 2023 at 11:39 AM Conor Dooley <conor@kernel.org> wrote: > > On Fri, Mar 31, 2023 at 11:27:27AM -0700, Evan Green wrote: > > Add memory info for the D1 Nezha, which seems to be required for it to > > boot with the stock firmware. Note that this hardcodes 1GB, which is > > not technically correct as they also make models with different amounts > > of RAM. > > > Is the firmware supposed to populate this? > > Yup. Samuel intentionally did it this way: > https://lore.kernel.org/linux-riscv/8a2194bf-93bd-de4d-8d39-0cd72aabb0a9@sholland.org/ > > Since I don't like using the firmware provided stuff to more easily > test I do this in my u-boot boot script: > > tftp 0x54000000 d1-fitImage.fit > bootm start 0x54000000 > bootm loados 0x54000000 > bootm ramdisk; > bootm prep; > fdt memory 0x40000000 0x20000000 > bootm go; > > Hope either of the above are helpful, > Conor. Ah, I see, thanks for the pointers. I've got whatever firmware came with the "dd and go" Fedora image I found on the internet somewhere, which doesn't seem to do the memory node population for me. I've been hesitant to rebuild the firmware as I don't want to break the Fedora "safe OS", and if there's a way to get mired in some build environment, I seem to have a nose for finding it. I'll probably just keep the patch locally in my tree, and if I'm forced to update the firmware for some other reason I'll try removing it. -Evan
diff --git a/arch/riscv/boot/dts/allwinner/sun20i-d1-nezha.dts b/arch/riscv/boot/dts/allwinner/sun20i-d1-nezha.dts index 4ed33c1e7c9c..6aba68cf5541 100644 --- a/arch/riscv/boot/dts/allwinner/sun20i-d1-nezha.dts +++ b/arch/riscv/boot/dts/allwinner/sun20i-d1-nezha.dts @@ -32,6 +32,12 @@ / { model = "Allwinner D1 Nezha"; compatible = "allwinner,d1-nezha", "allwinner,sun20i-d1"; + // FIXME: this is temporary. + memory@40000000 { + device_type = "memory"; + reg = <0x40000000 0x40000000>; /* 1 GB */ + }; + aliases { ethernet0 = &emac; ethernet1 = &xr829;