From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bin Meng Date: Thu, 25 Oct 2018 10:12:42 +0800 Subject: [U-Boot] [PATCH 06/30] riscv: add Kconfig entries for the C and A ISA extensions In-Reply-To: <1e91dbab9a841b02191a7cffc82488153b5150bb.camel@aisec.fraunhofer.de> References: <20181019220743.15020-1-lukas.auer@aisec.fraunhofer.de> <20181019220743.15020-7-lukas.auer@aisec.fraunhofer.de> <1e91dbab9a841b02191a7cffc82488153b5150bb.camel@aisec.fraunhofer.de> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Lukas, On Wed, Oct 24, 2018 at 11:41 PM Auer, Lukas wrote: > > Hi Bin, > > On Wed, 2018-10-24 at 23:32 +0800, Bin Meng wrote: > > Hi Lukas, > > > > On Wed, Oct 24, 2018 at 11:21 PM Auer, Lukas > > wrote: > > > > > > Hi Bin, > > > > > > On Mon, 2018-10-22 at 15:21 +0800, Bin Meng wrote: > > > > Hi Lukas, > > > > > > > > On Sat, Oct 20, 2018 at 6:09 AM Lukas Auer > > > > wrote: > > > > > > > > > > Add Kconfig entries for the C (compressed instructions) and A > > > > > (atomic > > > > > instructions) ISA extensions. Only the C ISA extension is > > > > > selectable. > > > > > This matches the configuration in Linux. > > > > > > > > > > The Kconfig entries are not used yet. A follow-up patch will > > > > > select > > > > > the > > > > > appropriate compiler flags based on the Kconfig configuration. > > > > > > > > > > Signed-off-by: Lukas Auer > > > > > --- > > > > > > > > > > arch/riscv/Kconfig | 9 +++++++++ > > > > > 1 file changed, 9 insertions(+) > > > > > > > > > > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig > > > > > index b81e0d990a..e15329c35e 100644 > > > > > --- a/arch/riscv/Kconfig > > > > > +++ b/arch/riscv/Kconfig > > > > > @@ -38,6 +38,15 @@ config ARCH_RV64I > > > > > > > > > > endchoice > > > > > > > > > > +config RISCV_ISA_C > > > > > + bool "Emit compressed instructions" > > > > > + default y > > > > > + help > > > > > + This enables the compressed instructions ("C") ISA > > > > > extension. > > > > > > > > This is a little bit confusing. Can we use Linux kernel's > > > > description > > > > instead like below? > > > > > > > > Adds "C" to the ISA subsets that the toolchain is > > > > allowed > > > > to emit > > > > when building U-Boot, which results in compressed > > > > instructions in the > > > > U-Boot binary. > > > > > > > > > > Sure, I will change it in v2. > > > > > > > > + > > > > > +config RISCV_ISA_A > > > > > + def_bool y > > > > > > > > I do not believe U-Boot need to care about 'A' extension. So this > > > > can > > > > be dropped? > > > > > > > > > > That's right. The only reason it might be used in U-Boot is on > > > multi- > > > core systems. Linux chooses the hart to boot on with the hart > > > lottery, > > > which requires atomics. The first core to increment a flag wins and > > > starts the boot process. We could do something similar in U-Boot, > > > but I > > > don't think it's necessary. In my patches (for the next patch > > > series) I > > > have added CONFIG_MAIN_HART to select the hart U-Boot should run > > > on. > > > > > > > Thanks for the additional details. I think we will need > > CONFIG_MAIN_HART to select the hart U-Boot should run on instead of > > Linux's lottery game, since we need handle situation like SiFive > > Freedom U540 where hart0 is something that does not run Linux. But > > even with CONFIG_MAIN_HART, U-Boot still doesn't need support 'A', > > right? > > > > Yes that's right, at least I can't think of a reason for why we might > need it. Should I drop it then? > Since we can use such to construct the "-march" string, let's keep this. Regards, Bin