From patchwork Fri Nov 30 11:36:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1005898 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=none (p=none dis=none) header.from=brainfault.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=brainfault-org.20150623.gappssmtp.com header.i=@brainfault-org.20150623.gappssmtp.com header.b="OIv/P3ag"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 435sp35mk7z9s9m for ; Fri, 30 Nov 2018 22:38:03 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 62219C2244A; Fri, 30 Nov 2018 11:37:31 +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=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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 49C0BC2244C; Fri, 30 Nov 2018 11:37:28 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 3EF4BC2243B; Fri, 30 Nov 2018 11:37:14 +0000 (UTC) Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) by lists.denx.de (Postfix) with ESMTPS id 3EE73C22461 for ; Fri, 30 Nov 2018 11:37:11 +0000 (UTC) Received: by mail-pf1-f193.google.com with SMTP id 64so2660498pfr.9 for ; Fri, 30 Nov 2018 03:37:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=18QrhhAgnziZ/rQVrwBMVjCL5MAiBseC9VBMZ9qU45c=; b=OIv/P3agIsmeoKkCIU+mbvk81YSJ6VOWE/YFQNDfDRAuFc4YcvwB8s0l+dfG8seGxm pmVqHa1TGadDzYlstxcfhMs17BhMjLuZAUB3RnAQ8BXuCHO/CVg2jcD9ZgONAFWpCmXU ohY73wDdnVJ/565A8ZqTg8LBv4EneQJkByDyE9Ovj+5H9v7ingmaRZti7Hhpo/04LhVv qlmgWEK2s6gCEm56njQqUZh7J6SexiZpJ1bFu6NBaegbxj9Fua/4iFggoDk2yvkohozP nBwe+CPzXXZKnp3uyVgtec4MXgdaWRwBsZPxdmG4JuUWRxjJ1wimnWFUwusPUXUwy50i BLlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=18QrhhAgnziZ/rQVrwBMVjCL5MAiBseC9VBMZ9qU45c=; b=PKIBU7g9JDo+Jp5qXbbydgshHPIGUv2Sp2iMU/y8ZoLAEpP2FOXk8D3RusLBXQtGOd GVz8624/RwUX8Z6oELClKI9HxZ6cekz7hUHOdvrAzV3AOeDnyHjObMnd4UNnEuWwy9Bo laMSVvWti3J1k7FxFfg/UTWPtSmovWWe+Nh3lk4MgEr5FtIg+iiCD+15EjzGHRd1bd4A 5xpxhN52UHVAukBCR2L0dFAfZe6VNooDZtd9UuYpfOFlbcXsxUhvjutDvFUnE5z2TSbx HARNSjpO+itMD+6KN2QXA/AfDr7NA4f4Q5OU1yG+GvKoqBQ3vSnW2f0c0dxFMnYmt06a 06fA== X-Gm-Message-State: AA+aEWag36YeOMalXDLqjmSL/oKLUIhwzTARR63OyRaqfNlLKK/V2k+B YdrnbDOSaCgMEdXxpGtxSYH6pQ== X-Google-Smtp-Source: AFSGD/UQUb3WgItBJxThR/HkT9AAUtSQpoP/RYZopuZwHoHO/nnVMRYqCEJpHOavGAam3jN70M8ffg== X-Received: by 2002:a62:2292:: with SMTP id p18mr5390416pfj.9.1543577829623; Fri, 30 Nov 2018 03:37:09 -0800 (PST) Received: from anup-ubuntu64.qualcomm.com ([49.207.52.208]) by smtp.googlemail.com with ESMTPSA id g15sm23603506pfj.131.2018.11.30.03.37.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Nov 2018 03:37:08 -0800 (PST) From: Anup Patel To: Rick Chen Date: Fri, 30 Nov 2018 17:06:50 +0530 Message-Id: <20181130113652.7157-2-anup@brainfault.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181130113652.7157-1-anup@brainfault.org> References: <20181130113652.7157-1-anup@brainfault.org> Cc: U-Boot Mailing List , Palmer Dabbelt , Alexander Graf , Christoph Hellwig , Atish Patra Subject: [U-Boot] [PATCH v6 1/3] riscv: Add kconfig option to run U-Boot in S-mode 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: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" This patch adds kconfig option RISCV_SMODE to run U-Boot in S-mode. When this opition is enabled we use s CSRs instead of m CSRs. It is important to note that there is no equivalent S-mode CSR for misa and mhartid CSRs so we expect M-mode runtime firmware (BBL or equivalent) to emulate misa and mhartid CSR read. In-future, we will have more patches to avoid accessing misa and mhartid CSRs from S-mode. Signed-off-by: Anup Patel Reviewed-by: Bin Meng Tested-by: Bin Meng Reviewed-by: Lukas Auer --- arch/riscv/Kconfig | 5 +++++ arch/riscv/cpu/start.S | 23 +++++++++++++++-------- arch/riscv/include/asm/encoding.h | 6 ++++++ arch/riscv/lib/interrupts.c | 31 ++++++++++++++++++++++--------- 4 files changed, 48 insertions(+), 17 deletions(-) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 3e0af55e71..732a357a99 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -55,6 +55,11 @@ config RISCV_ISA_C config RISCV_ISA_A def_bool y +config RISCV_SMODE + bool "Run in S-Mode" + help + Enable this option to build U-Boot for RISC-V S-Mode + config 32BIT bool diff --git a/arch/riscv/cpu/start.S b/arch/riscv/cpu/start.S index 15e1b8199a..3f055bdb7e 100644 --- a/arch/riscv/cpu/start.S +++ b/arch/riscv/cpu/start.S @@ -41,10 +41,10 @@ _start: li t0, CONFIG_SYS_SDRAM_BASE SREG a2, 0(t0) la t0, trap_entry - csrw mtvec, t0 + csrw MODE_PREFIX(tvec), t0 /* mask all interrupts */ - csrw mie, zero + csrw MODE_PREFIX(ie), zero /* Enable cache */ jal icache_enable @@ -166,7 +166,7 @@ fix_rela_dyn: */ la t0, trap_entry add t0, t0, t6 - csrw mtvec, t0 + csrw MODE_PREFIX(tvec), t0 clear_bss: la t0, __bss_start /* t0 <- rel __bss_start in FLASH */ @@ -238,17 +238,24 @@ trap_entry: SREG x29, 29*REGBYTES(sp) SREG x30, 30*REGBYTES(sp) SREG x31, 31*REGBYTES(sp) - csrr a0, mcause - csrr a1, mepc + csrr a0, MODE_PREFIX(cause) + csrr a1, MODE_PREFIX(epc) mv a2, sp jal handle_trap - csrw mepc, a0 + csrw MODE_PREFIX(epc), a0 +#ifdef CONFIG_RISCV_SMODE +/* + * Remain in S-mode after sret + */ + li t0, SSTATUS_SPP +#else /* * Remain in M-mode after mret */ li t0, MSTATUS_MPP - csrs mstatus, t0 +#endif + csrs MODE_PREFIX(status), t0 LREG x1, 1*REGBYTES(sp) LREG x2, 2*REGBYTES(sp) LREG x3, 3*REGBYTES(sp) @@ -281,4 +288,4 @@ trap_entry: LREG x30, 30*REGBYTES(sp) LREG x31, 31*REGBYTES(sp) addi sp, sp, 32*REGBYTES - mret + MODE_PREFIX(ret) diff --git a/arch/riscv/include/asm/encoding.h b/arch/riscv/include/asm/encoding.h index 9ea50ce640..97cf906aa6 100644 --- a/arch/riscv/include/asm/encoding.h +++ b/arch/riscv/include/asm/encoding.h @@ -7,6 +7,12 @@ #ifndef RISCV_CSR_ENCODING_H #define RISCV_CSR_ENCODING_H +#ifdef CONFIG_RISCV_SMODE +#define MODE_PREFIX(__suffix) s##__suffix +#else +#define MODE_PREFIX(__suffix) m##__suffix +#endif + #define MSTATUS_UIE 0x00000001 #define MSTATUS_SIE 0x00000002 #define MSTATUS_HIE 0x00000004 diff --git a/arch/riscv/lib/interrupts.c b/arch/riscv/lib/interrupts.c index 903a1c4cd5..3aff006977 100644 --- a/arch/riscv/lib/interrupts.c +++ b/arch/riscv/lib/interrupts.c @@ -34,17 +34,30 @@ int disable_interrupts(void) return 0; } -ulong handle_trap(ulong mcause, ulong epc, struct pt_regs *regs) +ulong handle_trap(ulong cause, ulong epc, struct pt_regs *regs) { - ulong is_int; + ulong is_irq, irq; - is_int = (mcause & MCAUSE_INT); - if ((is_int) && ((mcause & MCAUSE_CAUSE) == IRQ_M_EXT)) - external_interrupt(0); /* handle_m_ext_interrupt */ - else if ((is_int) && ((mcause & MCAUSE_CAUSE) == IRQ_M_TIMER)) - timer_interrupt(0); /* handle_m_timer_interrupt */ - else - _exit_trap(mcause, epc, regs); + is_irq = (cause & MCAUSE_INT); + irq = (cause & ~MCAUSE_INT); + + if (is_irq) { + switch (irq) { + case IRQ_M_EXT: + case IRQ_S_EXT: + external_interrupt(0); /* handle external interrupt */ + break; + case IRQ_M_TIMER: + case IRQ_S_TIMER: + timer_interrupt(0); /* handle timer interrupt */ + break; + default: + _exit_trap(cause, epc, regs); + break; + }; + } else { + _exit_trap(cause, epc, regs); + } return epc; } From patchwork Fri Nov 30 11:36:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1005900 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=none (p=none dis=none) header.from=brainfault.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=brainfault-org.20150623.gappssmtp.com header.i=@brainfault-org.20150623.gappssmtp.com header.b="UbnVztcL"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 435spr5Nskz9s9m for ; Fri, 30 Nov 2018 22:38:44 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 5BBB3C2246F; Fri, 30 Nov 2018 11:38:06 +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=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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 B15EFC22479; Fri, 30 Nov 2018 11:37:46 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 22DF5C22470; Fri, 30 Nov 2018 11:37:19 +0000 (UTC) Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) by lists.denx.de (Postfix) with ESMTPS id D1804C223F4 for ; Fri, 30 Nov 2018 11:37:15 +0000 (UTC) Received: by mail-pg1-f193.google.com with SMTP id n2so2402359pgm.3 for ; Fri, 30 Nov 2018 03:37:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=cKbxcUi8EFtXRX6ZKTRteFrEA1MNrvc3hL5H4tJKH1Y=; b=UbnVztcL0gkJp312WTqAcVHV3jJxW26JvfpA0MmgLufdxvpdOg1yry06P2+fxQ0JjO fqXzteJb5zTJKHoQoOjQzrfBuT3aZ0qRWp5xoztSXZJ9iH/3XJ4kWDb3EClpRTzfzAbx gvatxEecygfCXu8xJ3BxxFRcFlFR9fToMlD940Z09CETHhsnbvB4y6qu1snViLUI5vbH LkLm7RY7lvKHCvlYosl/Pa/DRALl5xmAxh216GrsHAN4sPs+dvXIi4f8gt4dX7Kz0sHd QP6p3LmtkS9Q/V+Yoc+wstVdSn7e0g5un7dJ0GHhekvwWYwz94Rhop0VfufsiNNF68tq L76g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=cKbxcUi8EFtXRX6ZKTRteFrEA1MNrvc3hL5H4tJKH1Y=; b=NJ+6En23ItNkEYdQ12tF5Mkjf9SuT1dmfwg4Ikz3/78T5ku/Sr26Nk/Y6/jXJkIx9d gI26WZEH+vNHInSQSbNCSitowYu1d+xPf4xWJz2GOQxhSS5rk1RRI9yWWj6Vnsp/mmNZ JqMN9oWX9zhXNppg0MO086kmOvy3KJRVUNB17ikff9M1JphZ02g6wxZrcEFugHV1nYP5 geixZhyC5Qq1ItYCzP01BVXYzY3KsS6r2DDholSczmz2v7BHyO1yGrkZ/Rb7JyKIXPkc QJdwAOq2mxVRGOJjLVuVUx97YPzjR3DHJACZXWYBCD3+peaOI0FXeK/KFrUHJ8AE59+I asfg== X-Gm-Message-State: AA+aEWagWeLDj/t3eUZVgxLPfERI5ciRqlTXlmYPBT1MRZ5mMV8p0Cea rvKjJgC0CSZ1ObCc2Bmf38zxtA== X-Google-Smtp-Source: AFSGD/UGxk4rX9QHLumMKmhoHfE9Rpy7LdxbzQFeo9ITce+noJJtTzpOxSptSO52wn8qVMDaEwzMWA== X-Received: by 2002:a62:6ec8:: with SMTP id j191mr5266854pfc.198.1543577834176; Fri, 30 Nov 2018 03:37:14 -0800 (PST) Received: from anup-ubuntu64.qualcomm.com ([49.207.52.208]) by smtp.googlemail.com with ESMTPSA id g15sm23603506pfj.131.2018.11.30.03.37.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Nov 2018 03:37:13 -0800 (PST) From: Anup Patel To: Rick Chen Date: Fri, 30 Nov 2018 17:06:51 +0530 Message-Id: <20181130113652.7157-3-anup@brainfault.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181130113652.7157-1-anup@brainfault.org> References: <20181130113652.7157-1-anup@brainfault.org> Cc: U-Boot Mailing List , Palmer Dabbelt , Alexander Graf , Christoph Hellwig , Atish Patra Subject: [U-Boot] [PATCH v6 2/3] riscv: qemu: Use different SYS_TEXT_BASE for S-mode 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: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" When u-boot runs in S-mode, the M-mode runtime firmware (BBL or equivalent) uses memory range in 0x80000000 to 0x80200000. Due to this, we cannot use 0x80000000 as SYS_TEXT_BASE when running in S-mode. Instead for S-mode, we use 0x80200000 as SYS_TEXT_BASE. Even Linux RISC-V kernel ignores/reserves memory range 0x80000000 to 0x80200000 because it runs in S-mode. Signed-off-by: Anup Patel Reviewed-by: Bin Meng Tested-by: Bin Meng Reviewed-by: Lukas Auer --- 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 33ca253432..56bb5337d4 100644 --- a/board/emulation/qemu-riscv/Kconfig +++ b/board/emulation/qemu-riscv/Kconfig @@ -13,7 +13,8 @@ config SYS_CONFIG_NAME default "qemu-riscv" config SYS_TEXT_BASE - default 0x80000000 + default 0x80000000 if !RISCV_SMODE + default 0x80200000 if RISCV_SMODE config BOARD_SPECIFIC_OPTIONS # dummy def_bool y From patchwork Fri Nov 30 11:36:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1005899 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=none (p=none dis=none) header.from=brainfault.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=brainfault-org.20150623.gappssmtp.com header.i=@brainfault-org.20150623.gappssmtp.com header.b="Meg52TL2"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 435spj10SRz9s9m for ; Fri, 30 Nov 2018 22:38:37 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id D4C92C22426; Fri, 30 Nov 2018 11:37:50 +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=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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 7F715C22466; Fri, 30 Nov 2018 11:37:37 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 696A2C22468; Fri, 30 Nov 2018 11:37:27 +0000 (UTC) Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by lists.denx.de (Postfix) with ESMTPS id CE925C22463 for ; Fri, 30 Nov 2018 11:37:20 +0000 (UTC) Received: by mail-pf1-f196.google.com with SMTP id i12so2666779pfo.7 for ; Fri, 30 Nov 2018 03:37:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=kE5TOK27CoYULOVJYCIFjTFsjogrFvdIAWPXy8fp0sA=; b=Meg52TL2fNWncMExHQsniuy8vLBkXt25ARUes1pc/U51WB3nXzzkDBS3HUyz7ZC3TX S9ibrZX3mhxdss+MORHf4NbGACbizUvD3aGh3r1fdO0Z3yMZ6+DHGhg9c5SspwMhc4WR Lq7G8RwHaIOyLWohGzjrCH63jkH4rTp4UWBee0PA+4q5Gv5NMmmjnqF0pF0LOS4h31wl 6QSvBooWV7y3avbLxp78r++C/V7hWyn+K+X3ncsP7tK3AV8CKQtksg8c27RJy+u1Htq2 FLTfiozi/ZngK+83YCg1xxya0iilIXR0wXwiROfrjpz7wqoz6Lb2Odc7DHqaw716FTjO iz6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=kE5TOK27CoYULOVJYCIFjTFsjogrFvdIAWPXy8fp0sA=; b=R3DFYgac0AdO7gSTuYOb3WqCokB1dCAEu8XYl/wYMXh87H04JJ4pIoaopo6Wpkjcx3 Iae0AgFV2QvboLUiJ0Vh941GJe3dwKpqaIvgS3KkpX6bdUDfMfWmJYOsesi7RRvuVnHs joQLEZcpG90kR6YdKzAgctWqcOY228kYodTF6uDjE0EKaAruU0KuHgKrpZlCKAjJD9u7 VOvE5E+yTbOPxfrIGTMkmGgEVvQGNBo78v/Y9jV21Co0xfW6FEBzvRazwbJDUFmIY4ia iqiyI6FAixZl5YPZQuzme3wRl9D8iJz7c+RVRrviHKb/A7tQF91GNHPGyadZ+hn0qJ/Y 1WVg== X-Gm-Message-State: AA+aEWbV18izJINnN7qsVLuEvREHtM7XkcqK/57el/ZdUUzQJduh+23V 0rbPWB5gkVN2Kznk1zlVg24lv7+p4xA= X-Google-Smtp-Source: AFSGD/UWUWPGFWgGI+WIzQN7lOoHQEeuZSEskNmxCEkktVm9uLH1G2SnUag3iVH3jzROgHUVVu/ogA== X-Received: by 2002:a63:b218:: with SMTP id x24mr4405591pge.223.1543577839225; Fri, 30 Nov 2018 03:37:19 -0800 (PST) Received: from anup-ubuntu64.qualcomm.com ([49.207.52.208]) by smtp.googlemail.com with ESMTPSA id g15sm23603506pfj.131.2018.11.30.03.37.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Nov 2018 03:37:18 -0800 (PST) From: Anup Patel To: Rick Chen Date: Fri, 30 Nov 2018 17:06:52 +0530 Message-Id: <20181130113652.7157-4-anup@brainfault.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181130113652.7157-1-anup@brainfault.org> References: <20181130113652.7157-1-anup@brainfault.org> Cc: U-Boot Mailing List , Palmer Dabbelt , Alexander Graf , Christoph Hellwig , Atish Patra Subject: [U-Boot] [PATCH v6 3/3] riscv: Add S-mode defconfigs for QEMU virt machine 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: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" This patch adds S-mode defconfigs for QEMU virt machine so that we can run u-boot in S-mode on QEMU using M-mode runtime firmware (BBL or equivalent). Signed-off-by: Anup Patel Reviewed-by: Bin Meng Tested-by: Bin Meng Reviewed-by: Lukas Auer --- board/emulation/qemu-riscv/MAINTAINERS | 2 ++ configs/qemu-riscv32_smode_defconfig | 10 ++++++++++ configs/qemu-riscv64_smode_defconfig | 11 +++++++++++ 3 files changed, 23 insertions(+) create mode 100644 configs/qemu-riscv32_smode_defconfig create mode 100644 configs/qemu-riscv64_smode_defconfig diff --git a/board/emulation/qemu-riscv/MAINTAINERS b/board/emulation/qemu-riscv/MAINTAINERS index 3c6eb4f844..c701c83d77 100644 --- a/board/emulation/qemu-riscv/MAINTAINERS +++ b/board/emulation/qemu-riscv/MAINTAINERS @@ -4,4 +4,6 @@ S: Maintained F: board/emulation/qemu-riscv/ F: include/configs/qemu-riscv.h F: configs/qemu-riscv32_defconfig +F: configs/qemu-riscv32_smode_defconfig F: configs/qemu-riscv64_defconfig +F: configs/qemu-riscv64_smode_defconfig diff --git a/configs/qemu-riscv32_smode_defconfig b/configs/qemu-riscv32_smode_defconfig new file mode 100644 index 0000000000..0a84ec1874 --- /dev/null +++ b/configs/qemu-riscv32_smode_defconfig @@ -0,0 +1,10 @@ +CONFIG_RISCV=y +CONFIG_TARGET_QEMU_VIRT=y +CONFIG_RISCV_SMODE=y +CONFIG_DISTRO_DEFAULTS=y +CONFIG_NR_DRAM_BANKS=1 +CONFIG_FIT=y +CONFIG_DISPLAY_CPUINFO=y +CONFIG_DISPLAY_BOARDINFO=y +# CONFIG_CMD_MII is not set +CONFIG_OF_PRIOR_STAGE=y diff --git a/configs/qemu-riscv64_smode_defconfig b/configs/qemu-riscv64_smode_defconfig new file mode 100644 index 0000000000..b012443370 --- /dev/null +++ b/configs/qemu-riscv64_smode_defconfig @@ -0,0 +1,11 @@ +CONFIG_RISCV=y +CONFIG_TARGET_QEMU_VIRT=y +CONFIG_ARCH_RV64I=y +CONFIG_RISCV_SMODE=y +CONFIG_DISTRO_DEFAULTS=y +CONFIG_NR_DRAM_BANKS=1 +CONFIG_FIT=y +CONFIG_DISPLAY_CPUINFO=y +CONFIG_DISPLAY_BOARDINFO=y +# CONFIG_CMD_MII is not set +CONFIG_OF_PRIOR_STAGE=y