From: Atish Patra <Atish.Patra@wdc.com>
To: "ardb@kernel.org" <ardb@kernel.org>
Cc: "alexios.zavras@intel.com" <alexios.zavras@intel.com>,
"tglx@linutronix.de" <tglx@linutronix.de>,
"mchehab+samsung@kernel.org" <mchehab+samsung@kernel.org>,
"pbonzini@redhat.com" <pbonzini@redhat.com>,
"michal.simek@xilinx.com" <michal.simek@xilinx.com>,
"linux@armlinux.org.uk" <linux@armlinux.org.uk>,
"abner.chang@hpe.com" <abner.chang@hpe.com>,
"linux-riscv@lists.infradead.org"
<linux-riscv@lists.infradead.org>,
"catalin.marinas@arm.com" <catalin.marinas@arm.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"daniel.schaefer@hpe.com" <daniel.schaefer@hpe.com>,
Anup Patel <Anup.Patel@wdc.com>,
"kstewart@linuxfoundation.org" <kstewart@linuxfoundation.org>,
"palmer@dabbelt.com" <palmer@dabbelt.com>,
"aou@eecs.berkeley.edu" <aou@eecs.berkeley.edu>,
"arnd@arndb.de" <arnd@arndb.de>,
"rppt@linux.ibm.com" <rppt@linux.ibm.com>,
"linux-efi@vger.kernel.org" <linux-efi@vger.kernel.org>,
"bp@suse.de" <bp@suse.de>,
"greentime.hu@sifive.com" <greentime.hu@sifive.com>,
"keescook@chromium.org" <keescook@chromium.org>,
"agraf@csgraf.de" <agraf@csgraf.de>,
"will@kernel.org" <will@kernel.org>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"mingo@kernel.org" <mingo@kernel.org>,
"allison@lohutok.net" <allison@lohutok.net>,
"han_mao@c-sky.com" <han_mao@c-sky.com>,
"paul.walmsley@sifive.com" <paul.walmsley@sifive.com>,
"linus.walleij@linaro.org" <linus.walleij@linaro.org>,
"leif@nuviainc.com" <leif@nuviainc.com>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>
Subject: Re: [RFC PATCH 3/5] RISC-V: Define fixmap bindings for generic early ioremap support
Date: Thu, 27 Feb 2020 19:58:13 +0000 [thread overview]
Message-ID: <08322b0eeb26b564954a14273baf18db72e2f1e9.camel@wdc.com> (raw)
In-Reply-To: <CAKv+Gu8HdRa5k=h1XF2fm80VEgvuxa_tX_P0qFSdkk=CVc6ffA@mail.gmail.com>
On Wed, 2020-02-26 at 08:08 +0100, Ard Biesheuvel wrote:
> On Wed, 26 Feb 2020 at 02:10, Atish Patra <atish.patra@wdc.com>
> wrote:
> > UEFI uses early IO or memory mappings for runtime services before
> > normal ioremap() is usable. This patch only adds minimum necessary
> > fixmap bindings and headers for generic ioremap support to work.
> >
> > Signed-off-by: Atish Patra <atish.patra@wdc.com>
>
> Looks reasonable to me,
>
> Acked-by: Ard Biesheuvel <ardb@kernel.org>
>
> although I wonder why it is part of this series?
>
because of CONFIG_EFI. With CONFIG_EFI enabled, all the run time
service memory mapping code is compiled for RISC-V. I could have
createa a separate config for only boot time services or used EFI_STUB
at places where CONFI_EFI. But it seems redundant as we will support
runtime services soon. Let me know if that's a wrong approach.
> > ---
> > arch/riscv/Kconfig | 1 +
> > arch/riscv/include/asm/Kbuild | 1 +
> > arch/riscv/include/asm/fixmap.h | 21 ++++++++++++++++++++-
> > arch/riscv/include/asm/io.h | 1 +
> > 4 files changed, 23 insertions(+), 1 deletion(-)
> >
> > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> > index 27bfc7947e44..42c122170cfd 100644
> > --- a/arch/riscv/Kconfig
> > +++ b/arch/riscv/Kconfig
> > @@ -65,6 +65,7 @@ config RISCV
> > select ARCH_HAS_GCOV_PROFILE_ALL
> > select HAVE_COPY_THREAD_TLS
> > select HAVE_ARCH_KASAN if MMU && 64BIT
> > + select GENERIC_EARLY_IOREMAP
> >
> > config ARCH_MMAP_RND_BITS_MIN
> > default 18 if 64BIT
> > diff --git a/arch/riscv/include/asm/Kbuild
> > b/arch/riscv/include/asm/Kbuild
> > index ec0ca8c6ab64..517394390106 100644
> > --- a/arch/riscv/include/asm/Kbuild
> > +++ b/arch/riscv/include/asm/Kbuild
> > @@ -4,6 +4,7 @@ generic-y += checksum.h
> > generic-y += compat.h
> > generic-y += device.h
> > generic-y += div64.h
> > +generic-y += early_ioremap.h
> > generic-y += extable.h
> > generic-y += flat.h
> > generic-y += dma.h
> > diff --git a/arch/riscv/include/asm/fixmap.h
> > b/arch/riscv/include/asm/fixmap.h
> > index 42d2c42f3cc9..7a4beb7e29a3 100644
> > --- a/arch/riscv/include/asm/fixmap.h
> > +++ b/arch/riscv/include/asm/fixmap.h
> > @@ -25,9 +25,28 @@ enum fixed_addresses {
> > #define FIX_FDT_SIZE SZ_1M
> > FIX_FDT_END,
> > FIX_FDT = FIX_FDT_END + FIX_FDT_SIZE / PAGE_SIZE - 1,
> > + FIX_EARLYCON_MEM_BASE,
> > +
> > FIX_PTE,
> > FIX_PMD,
> > - FIX_EARLYCON_MEM_BASE,
> > + /*
> > + * Make sure that it is 2MB aligned.
> > + */
> > +#define NR_FIX_SZ_2M (SZ_2M / PAGE_SIZE)
> > + FIX_THOLE = NR_FIX_SZ_2M - FIX_PMD - 1,
> > +
> > + __end_of_permanent_fixed_addresses,
> > + /*
> > + * Temporary boot-time mappings, used by early_ioremap(),
> > + * before ioremap() is functional.
> > + */
> > +#define NR_FIX_BTMAPS (SZ_256K / PAGE_SIZE)
> > +#define FIX_BTMAPS_SLOTS 7
> > +#define TOTAL_FIX_BTMAPS (NR_FIX_BTMAPS * FIX_BTMAPS_SLOTS)
> > +
> > + FIX_BTMAP_END = __end_of_permanent_fixed_addresses,
> > + FIX_BTMAP_BEGIN = FIX_BTMAP_END + TOTAL_FIX_BTMAPS - 1,
> > +
> > __end_of_fixed_addresses
> > };
> >
> > diff --git a/arch/riscv/include/asm/io.h
> > b/arch/riscv/include/asm/io.h
> > index 0f477206a4ed..047f414b6948 100644
> > --- a/arch/riscv/include/asm/io.h
> > +++ b/arch/riscv/include/asm/io.h
> > @@ -14,6 +14,7 @@
> > #include <linux/types.h>
> > #include <asm/mmiowb.h>
> > #include <asm/pgtable.h>
> > +#include <asm/early_ioremap.h>
> >
> > /*
> > * MMIO access functions are separated out to break dependency
> > cycles
> > --
> > 2.24.0
> >
--
Regards,
Atish
next prev parent reply other threads:[~2020-02-27 19:58 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-26 1:10 [RFC PATCH 0/5] Add UEFI support for RISC-V Atish Patra
2020-02-26 1:10 ` [RFC PATCH 1/5] efi: Move arm-stub to a common file Atish Patra
2020-02-26 7:04 ` Ard Biesheuvel
2020-02-27 1:16 ` Atish Patra
2020-02-26 1:10 ` [RFC PATCH 2/5] include: pe.h: Add RISC-V related PE definition Atish Patra
2020-02-26 7:06 ` Ard Biesheuvel
2020-02-27 0:53 ` Atish Patra
2020-02-26 1:10 ` [RFC PATCH 3/5] RISC-V: Define fixmap bindings for generic early ioremap support Atish Patra
2020-02-26 7:08 ` Ard Biesheuvel
2020-02-27 19:58 ` Atish Patra [this message]
2020-02-27 20:00 ` Ard Biesheuvel
2020-02-26 1:10 ` [RFC PATCH 4/5] RISC-V: Add PE/COFF header for EFI stub Atish Patra
2020-02-26 7:14 ` Ard Biesheuvel
2020-02-27 1:29 ` Atish Patra
2020-02-27 7:44 ` Ard Biesheuvel
2020-02-26 1:10 ` [RFC PATCH 5/5] RISC-V: Add EFI stub support Atish Patra
2020-02-26 7:28 ` Ard Biesheuvel
2020-02-27 19:53 ` Atish Patra
2020-02-27 19:59 ` Ard Biesheuvel
2020-02-28 1:05 ` Atish Patra
2020-02-28 6:57 ` Ard Biesheuvel
2020-03-10 7:08 ` Atish Patra
2020-03-10 7:38 ` Anup Patel
2020-03-10 13:18 ` Ard Biesheuvel
2020-02-26 23:46 ` [RFC PATCH 0/5] Add UEFI support for RISC-V Palmer Dabbelt
2020-02-27 2:09 ` Atish Patra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=08322b0eeb26b564954a14273baf18db72e2f1e9.camel@wdc.com \
--to=atish.patra@wdc.com \
--cc=Anup.Patel@wdc.com \
--cc=abner.chang@hpe.com \
--cc=agraf@csgraf.de \
--cc=akpm@linux-foundation.org \
--cc=alexios.zavras@intel.com \
--cc=allison@lohutok.net \
--cc=aou@eecs.berkeley.edu \
--cc=ardb@kernel.org \
--cc=arnd@arndb.de \
--cc=bp@suse.de \
--cc=catalin.marinas@arm.com \
--cc=daniel.schaefer@hpe.com \
--cc=greentime.hu@sifive.com \
--cc=gregkh@linuxfoundation.org \
--cc=han_mao@c-sky.com \
--cc=keescook@chromium.org \
--cc=kstewart@linuxfoundation.org \
--cc=leif@nuviainc.com \
--cc=linus.walleij@linaro.org \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux@armlinux.org.uk \
--cc=mchehab+samsung@kernel.org \
--cc=michal.simek@xilinx.com \
--cc=mingo@kernel.org \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=pbonzini@redhat.com \
--cc=rppt@linux.ibm.com \
--cc=tglx@linutronix.de \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).