From patchwork Thu Apr 11 06:52:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1083725 X-Patchwork-Delegate: uboot@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.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.b="mMAGVXCj"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=sharedspace.onmicrosoft.com header.i=@sharedspace.onmicrosoft.com header.b="DlJfwvBp"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44fsCZ5VQRz9s71 for ; Thu, 11 Apr 2019 16:52:26 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 5A777C21E2F; Thu, 11 Apr 2019 06:52:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 522C0C21C27; Thu, 11 Apr 2019 06:52:19 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id ECF0DC21C27; Thu, 11 Apr 2019 06:52:18 +0000 (UTC) Received: from esa1.hgst.iphmx.com (esa1.hgst.iphmx.com [68.232.141.245]) by lists.denx.de (Postfix) with ESMTPS id 00097C21BE5 for ; Thu, 11 Apr 2019 06:52:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1554965538; x=1586501538; h=from:to:cc:subject:date:message-id: content-transfer-encoding:mime-version; bh=MTPtkqZdvtiKZOiRNl6KQtvoee7Qb7QucaEGyfuEXXg=; b=mMAGVXCjoE7BXdi2p7bXb6Fr2bVCWzChJ+U5d2Wtxu8y735BQo3LMLz7 BJJpOpcsL+NhJKN33IfVYG4XBM50KMmTSRY9Y8m6zdWawiwhhfMfJ8PJ9 FJMAWoYqtUMYIQ6ClAw3WVFJxxMPRD4q8Ueez4kQ7neIBfWw8u0peokzf 1uYiJJh3jBCnQDef4M1WTATUZcvuQx21iCRZ2kE2ILKFfQaG6yEPx4zEw yARnidd6Ba+uYWE//g/zTXUQ9iRum+syFsJdv4kM2alpqnJATWxOA1Oa+ fEp+oM2HprhPFvnZgvxizPwoSZnEKZoqC9o/YBk5tkne60xEc1M764j0J g==; X-IronPort-AV: E=Sophos;i="5.60,336,1549900800"; d="scan'208";a="211320591" Received: from mail-by2nam03lp2055.outbound.protection.outlook.com (HELO NAM03-BY2-obe.outbound.protection.outlook.com) ([104.47.42.55]) by ob1.hgst.iphmx.com with ESMTP; 11 Apr 2019 14:52:14 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-wdc-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MTPtkqZdvtiKZOiRNl6KQtvoee7Qb7QucaEGyfuEXXg=; b=DlJfwvBphSEHKT+jeE8AUK32f/fgbfYWZblb5qw8qBO1sg8Sa5sBJbhPFIt2JBji7/jZTHSV1N4emljJUGbySQs+QGGdzjnCPCz2VROEH+9UayBF8HB1gAigJCc71vv1ISrfJFdECVYWA6ARieqaXCBmmI3fijx8aU8HRShS7y4= Received: from MN2PR04MB6061.namprd04.prod.outlook.com (20.178.246.15) by MN2PR04MB5726.namprd04.prod.outlook.com (20.179.21.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1771.16; Thu, 11 Apr 2019 06:52:13 +0000 Received: from MN2PR04MB6061.namprd04.prod.outlook.com ([fe80::ad2f:3a0f:2de1:6fb2]) by MN2PR04MB6061.namprd04.prod.outlook.com ([fe80::ad2f:3a0f:2de1:6fb2%5]) with mapi id 15.20.1771.016; Thu, 11 Apr 2019 06:52:13 +0000 From: Anup Patel To: Rick Chen , Bin Meng , Lukas Auer , Tom Rini Thread-Topic: [PATCH] riscv: qemu: Use correct SYS_TEXT_BASE for S-mode on 32bit system Thread-Index: AQHU8DMXb1iGaHq6oE2/EULoSoJrrw== Date: Thu, 11 Apr 2019 06:52:12 +0000 Message-ID: <20190411065146.34338-1-anup.patel@wdc.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BM1PR01CA0159.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:68::29) To MN2PR04MB6061.namprd04.prod.outlook.com (2603:10b6:208:d8::15) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Anup.Patel@wdc.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [106.51.19.110] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: cd8721d3-01a4-43a7-e527-08d6be4a39a5 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600139)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:MN2PR04MB5726; x-ms-traffictypediagnostic: MN2PR04MB5726: wdcipoutbound: EOP-TRUE x-microsoft-antispam-prvs: x-forefront-prvs: 00046D390F x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(366004)(346002)(396003)(39860400002)(136003)(376002)(199004)(189003)(386003)(106356001)(316002)(50226002)(3846002)(2906002)(105586002)(6116002)(8676002)(9456002)(7736002)(81166006)(478600001)(72206003)(97736004)(81156014)(8936002)(6512007)(110136005)(54906003)(1076003)(99286004)(68736007)(6436002)(6486002)(4326008)(5660300002)(305945005)(52116002)(14444005)(14454004)(256004)(486006)(71190400001)(36756003)(102836004)(186003)(6506007)(78486014)(66066001)(26005)(86362001)(71200400001)(44832011)(2616005)(55236004)(53936002)(25786009)(476003); DIR:OUT; SFP:1102; SCL:1; SRVR:MN2PR04MB5726; H:MN2PR04MB6061.namprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: s6SRD62UjOWRTnLg6nJMANgdhi2GzPTjqYbu/+nSXs0D/JgYBkx8trXQKw1GdcfKyR1ZwW2ajkl46g+DeQ92IeB0DoY5l6X6af6I8q62G+W2mOm/alFgWaFROTVI+O84NxPJgmS+/U8jHlyOiygC0o5gGDxGpORt+t4/wgv5q5qAdqPuaZiyPaUw1rZh7x1f9oiUZmNynfWw7kwZVi4phBMnbcqWj7b7Ll+DhDikKQLiHMmzlH1YG/zilnnkk7gGVxCklJ6XSqhxQAlI9IbOIcmlzUbSvlO93giCtDgGWSVjngiyMz+RF9mK/2UEXPM16hWZoXxWugYGDE/mMkRUp5Q/EiZG8rzM6wisYhArKMOJ5Tcf+Cuh3mhLTtvsjWhNOKqZWSL69soh7YxzOmXPYsjK0sI9WegqHBTvL1BxHE4= MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: cd8721d3-01a4-43a7-e527-08d6be4a39a5 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Apr 2019 06:52:12.8278 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR04MB5726 Cc: U-Boot Mailing List , Palmer Dabbelt Subject: [U-Boot] [PATCH] riscv: qemu: Use correct SYS_TEXT_BASE for S-mode on 32bit system X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" For 32bit system, the OpenSBI (or BBL) will jump to 0x80400000 address in S-mode whereas for 64bit system it will jump to 0x80200000 address in S-mode. Currently, the S-mode U-Boot sets SYS_TEXT_BASE to 0x80200000 for both 32bit and 64bit system. This breaks S-mode U-Boot for 32bit system. This patch sets different SYS_TEXT_BASE for 32bit and 64bit system so that S-mode U-Boot works fine for both. Signed-off-by: Anup Patel Reviewed-by: Bin Meng Reviewed-by: Lukas Auer Tested-by: Karsten Merker --- board/emulation/qemu-riscv/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/board/emulation/qemu-riscv/Kconfig b/board/emulation/qemu-riscv/Kconfig index cf057e7de6..20ea6dc59b 100644 --- a/board/emulation/qemu-riscv/Kconfig +++ b/board/emulation/qemu-riscv/Kconfig @@ -14,7 +14,8 @@ config SYS_CONFIG_NAME config SYS_TEXT_BASE default 0x80000000 if !RISCV_SMODE - default 0x80200000 if RISCV_SMODE + default 0x80200000 if RISCV_SMODE && ARCH_RV64I + default 0x80400000 if RISCV_SMODE && ARCH_RV32I config BOARD_SPECIFIC_OPTIONS # dummy def_bool y