From patchwork Tue Mar 24 04:16:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Atish Patra X-Patchwork-Id: 1260448 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.a=rsa-sha256 header.s=dkim.wdc.com header.b=CElnkZr8; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48mdJN2dkMz9sRf for ; Tue, 24 Mar 2020 15:17:40 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5061E817C1; Tue, 24 Mar 2020 05:17:22 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.b="CElnkZr8"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 65C7C81822; Tue, 24 Mar 2020 05:17:16 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from esa2.hgst.iphmx.com (esa2.hgst.iphmx.com [68.232.143.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0B353812D3 for ; Tue, 24 Mar 2020 05:17:08 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=wdc.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=prvs=345a454b9=atish.patra@wdc.com DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1585023450; x=1616559450; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=VtXXA2lCbej/9T8omaRfuOZZxIk6LonXIM4T1FbMIPM=; b=CElnkZr8V1yY+jwRudz9t0LPXEK48+pHUDdWP3SMsDabIOl7/ge4/+Xb SwHFu4A0OpDQmo0nt/kqArpPoZaMFiOQZi0YhMi4qq1351dFlq2jB8y0b 6V1oHyZpwqgaUXnLaNWIIG9Vom9gxnxNauT4ersjHAEHXhm+fgZJMyXzr G96HppdbjO4gZl7ZXhMU0H3aoap/DFJGq/4w/1Siy0N3KD9BDlTzNsvKT NwY+fQjn7DYTFMSb5H9iT+DV99XG7br7S6PB0NRCwxeqc0oFrvGGguwgu fPMYI0X25IBOewb7bad5YPx1YpLADriuslJm5nk46of+Sfbie1FykLCdZ g==; IronPort-SDR: ey9uSoMQt7Q7TARw2gvtF1WFFE2MGwhu6aqByz+QMwB8HFFdfwmCEsfm1pS85191Uacp0CM53M DFfV72yBMZY/vubIVTwdzP8y6i3WHvHrrN9LRQEEr+pMbEKylYwcP5WmllNTzqz43JNMR9bpfr mNcCqo13RHGKVDkPgu+MljuRWkwPkYkjsXzGpSveN8PmpPwaAJtSjGRCGH1uOSJTHnE10Hk72T k7mFTLtKkHAjT6hTLWzRvplTLDXQIqGMGf90TXW0QAIugRNDvCHF1cuORkxYEE6yWKzn1jwQ9x xQo= X-IronPort-AV: E=Sophos;i="5.72,298,1580745600"; d="scan'208";a="235522556" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 24 Mar 2020 12:17:27 +0800 IronPort-SDR: TsrOv8zaoC0G/svn3cnynwoJaNguqq9Xlod9PDJrzWiiprayZW2UTwIjMWdwbCErcgJtsSDeQv utWvJ4amvwwihywYpny0UZFEgdHVEG39A2ya9Wf0SE5gX5VCLBVRQljrI9WCTnQSFKDaASRzdF 1puzpGbaYSiRiP0I82HB5bNXTIFG6PqVVrH+NbLznteTSx69WQDSRwUQEzpyqY958WEVjOyoiP qB4AqzDrexM9kignOyzHRXsgfVjKBX4cbxzTJXWLVXjP9EjkEkFEajDdRo0BBCRgGsN9EXjVrx ICOGP0k2QK+xh3s7v4DiieKG Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2020 21:08:47 -0700 IronPort-SDR: 9m7hxS1emJ+JcWb2Tv9SfnBm/RP3TuI26Oi9DYXUHBrZ5Ibj6Lcs3ISdDFKch98T7xn26eppCg FxVr/lCcIkY0K/0YdOz4v1s5LLy1mXfunTl+4UM7XVmW4m8TIcftw75JEXIw0xmx0zp6tU4FEh ahtwHg8XhuxmF7T4FbUJN3uCFL0GFdIARMHsghxmLDUoFHQ7TLhYcMNpmd6JFVLUP0mPZAycki 0Fldzb/IRr0r92spXeUWLWgKUyErNyTbSA7KGSVU59OqIux/6bjrnNYxvZ9Gb3rbM0FlNha3w4 ym0= WDCIronportException: Internal Received: from cm122g2.ad.shared (HELO yoda.hgst.com) ([10.86.54.193]) by uls-op-cesaip02.wdc.com with ESMTP; 23 Mar 2020 21:17:06 -0700 From: Atish Patra To: u-boot@lists.denx.de Cc: Atish Patra , Alexander Graf , Anup Patel , Bin Meng , Heinrich Schuchardt , Lukas Auer , Rick Chen , abner.chang@hpe.com, daniel.schaefer@hpe.com, Thierry Reding Subject: [PATCH v4 0/6] DT related fixes for RISC-V UEFI Date: Mon, 23 Mar 2020 21:16:44 -0700 Message-Id: <20200324041650.280302-1-atish.patra@wdc.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean This series adds few DT related fixes required for Linux EFI stub to work on RISC-V. Patch 1 adds the boot hartid property under /chosen node. The related discussion can be found here. https://patchwork.ozlabs.org/patch/1233664/ https://lists.denx.de/pipermail/u-boot/2020-March/402085.html Patch 2 fixes a generic issue in fdtdec related to reserved memory node. Patch 3,4,5 provide one of the option to update reserved-memory node for next stage. It depends on Bin's following series in OpenSBI http://lists.infradead.org/pipermail/opensbi/2020-March/001316.html The other options are SBI extension and trap/emulate on PMP csr access. The detaild discussion can be found here. https://github.com/riscv/riscv-sbi-doc/pull/37 Patch 1 & 2 can be applied independently from 3 and 4. I want to keep all the patches together to provide a holistic view of changes required for RISC-V UEFI. Changes v3->v4: 1. Dropped generic efi fix patch as it is already merged. 2. Moved all the fdt fixups to a common file. 3. Addressed few nit comments. Changes from v2->v3: 1. Update the DT meant for OS if it is different from the one used by U-Boot 2. Use different FDT api to obtain "reg" address & size to honor the cell count. Changes from v1->v2: 1. Fix the issue if chosen node is not present. Changes from previous version: 1. Renamed the DT node property to "boot-hartid" from "efi-boot-hartid". 2. Changed the property type to u32 instead of u64 for RV32 compatibility. Atish Patra (6): riscv: Add boot hartid to Device tree fdtdec: Fix boundary check riscv: Provide a mechanism to fix DT for reserved memory riscv: Setup reserved-memory node for FU540 riscv: Copy the reserved-memory nodes to final DT riscv: Move all fdt fixups together arch/riscv/cpu/start.S | 1 + arch/riscv/include/asm/global_data.h | 1 + arch/riscv/include/asm/u-boot-riscv.h | 2 + arch/riscv/lib/Makefile | 1 + arch/riscv/lib/asm-offsets.c | 1 + arch/riscv/lib/bootm.c | 5 - arch/riscv/lib/fdt_fixup.c | 128 ++++++++++++++++++++++++++ configs/sifive_fu540_defconfig | 1 + lib/fdtdec.c | 3 +- 9 files changed, 137 insertions(+), 6 deletions(-) create mode 100644 arch/riscv/lib/fdt_fixup.c --- 2.25.1