Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp2735254ybe; Thu, 12 Sep 2019 14:11:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqx8hd6J1cCSA00CixRmLulHD3oLLcYWj2cZBbUn9UIdp/hrYuzG7LbvCFsl8j8T7lfDR8CB X-Received: by 2002:a05:6402:611:: with SMTP id n17mr45049204edv.33.1568322678252; Thu, 12 Sep 2019 14:11:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568322678; cv=none; d=google.com; s=arc-20160816; b=S0iwhKrD5OvLovj/2hxykL+x/BS0oQr/gsmKbWz4XptZ+LkvUx+tJWWzR6uSOtDgmI X6ow8napy5D2KBvFWY49rsXlmQBcFS9MdCZeqFv0/iuuOgCVDSncMfE6s8h9lOLW/R6z 0AV2N3dQEsppIfOLPayz1X98W1Y+GjcOAXCy3a34C66pCuL4XetyFW5R85hX7BBo0PFK QheRvilEiItQ0JLmCxxDK+9ODrRuzaTpDe7seOFLEMCPS2fldf93l5s5uSYR0wTYzdee a3yo4ea89eWw+AyV5bi+tSS+QUdJTztdc3pyudj9u52VAOF6sXJnOgZgR/kQZ42/fKgW Asbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=rBGiULs1NyTdcrz2zHoe9lENua+/z+AYlMPJ+PkhuXY=; b=t38WbXTW1V6nO+/Yq/y5qF8xJHDDAYxjobZh0zD/AIwXxsW0GcIT5RGi9p+dYE+yN8 8wibVTZjz0EJNdgmbA/LUi9DY0JoB449XGiMF7fRxq6Taptkw3py9cl3/H/rzmTxwTI7 Mj2vth/dm0Y6VI0yZdAzRSzovCsyv1uAQ9F8leCenbi3Et7JLZ0+gwy21ruBaS2zVnEC BeRpmLK7LE9NEOIn3G0fZIbyjgdNkzGw39KRYEtSN0jjzrBR0ewExH7/m8wPjWDietdV 1RVDd3HLUT/u8B3PMjOzVxiKUq6tqPjvFMG2kIMHNz8mE2upYPB8ErNNSCwrPWN6n+gK yb6g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z5si12993740edr.96.2019.09.12.14.10.53; Thu, 12 Sep 2019 14:11:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733066AbfILPiK (ORCPT + 99 others); Thu, 12 Sep 2019 11:38:10 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:14000 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732566AbfILPiK (ORCPT ); Thu, 12 Sep 2019 11:38:10 -0400 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x8CFXnVO121175; Thu, 12 Sep 2019 11:37:40 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 2uyqkyud71-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 12 Sep 2019 11:37:39 -0400 Received: from m0098404.ppops.net (m0098404.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.27/8.16.0.27) with SMTP id x8CFYAgU124640; Thu, 12 Sep 2019 11:37:38 -0400 Received: from ppma04dal.us.ibm.com (7a.29.35a9.ip4.static.sl-reverse.com [169.53.41.122]) by mx0a-001b2d01.pphosted.com with ESMTP id 2uyqkyud6h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 12 Sep 2019 11:37:38 -0400 Received: from pps.filterd (ppma04dal.us.ibm.com [127.0.0.1]) by ppma04dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id x8CFZlwr019516; Thu, 12 Sep 2019 15:37:38 GMT Received: from b01cxnp23033.gho.pok.ibm.com (b01cxnp23033.gho.pok.ibm.com [9.57.198.28]) by ppma04dal.us.ibm.com with ESMTP id 2uyqd8rsdf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 12 Sep 2019 15:37:38 +0000 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp23033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x8CFbbXN40501738 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 12 Sep 2019 15:37:37 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 190BBB2067; Thu, 12 Sep 2019 15:37:37 +0000 (GMT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9B3E2B2064; Thu, 12 Sep 2019 15:37:34 +0000 (GMT) Received: from skywalker.linux.ibm.com (unknown [9.199.32.243]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Thu, 12 Sep 2019 15:37:34 +0000 (GMT) X-Mailer: emacs 26.2 (via feedmail 11-beta-1 I) From: "Aneesh Kumar K.V" To: Christophe Leroy , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , npiggin@gmail.com, hch@infradead.org Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 3/4] powerpc: Add support for GENERIC_EARLY_IOREMAP In-Reply-To: <412c7eaa6a373d8f82a3c3ee01e6a65a1a6589de.1568295907.git.christophe.leroy@c-s.fr> References: <412c7eaa6a373d8f82a3c3ee01e6a65a1a6589de.1568295907.git.christophe.leroy@c-s.fr> Date: Thu, 12 Sep 2019 21:07:32 +0530 Message-ID: <87ftl1seyr.fsf@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-09-12_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1909120160 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Christophe Leroy writes: > Add support for GENERIC_EARLY_IOREMAP. > > Let's define 16 slots of 256Kbytes each for early ioremap. > > Signed-off-by: Christophe Leroy > --- > arch/powerpc/Kconfig | 1 + > arch/powerpc/include/asm/Kbuild | 1 + > arch/powerpc/include/asm/fixmap.h | 12 ++++++++++++ > arch/powerpc/kernel/setup_32.c | 3 +++ > arch/powerpc/kernel/setup_64.c | 3 +++ > 5 files changed, 20 insertions(+) > > diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig > index 6a7c797fa9d2..8fe252962518 100644 > --- a/arch/powerpc/Kconfig > +++ b/arch/powerpc/Kconfig > @@ -161,6 +161,7 @@ config PPC > select GENERIC_CMOS_UPDATE > select GENERIC_CPU_AUTOPROBE > select GENERIC_CPU_VULNERABILITIES if PPC_BARRIER_NOSPEC > + select GENERIC_EARLY_IOREMAP > select GENERIC_IRQ_SHOW > select GENERIC_IRQ_SHOW_LEVEL > select GENERIC_PCI_IOMAP if PCI > diff --git a/arch/powerpc/include/asm/Kbuild b/arch/powerpc/include/asm/Kbuild > index 9a1d2fc6ceb7..30829120659c 100644 > --- a/arch/powerpc/include/asm/Kbuild > +++ b/arch/powerpc/include/asm/Kbuild > @@ -12,3 +12,4 @@ generic-y += preempt.h > generic-y += vtime.h > generic-y += msi.h > generic-y += simd.h > +generic-y += early_ioremap.h > diff --git a/arch/powerpc/include/asm/fixmap.h b/arch/powerpc/include/asm/fixmap.h > index 722289a1d000..d5c4d357bd33 100644 > --- a/arch/powerpc/include/asm/fixmap.h > +++ b/arch/powerpc/include/asm/fixmap.h > @@ -15,6 +15,7 @@ > #define _ASM_FIXMAP_H > > #ifndef __ASSEMBLY__ > +#include > #include > #include > #ifdef CONFIG_HIGHMEM > @@ -64,6 +65,14 @@ enum fixed_addresses { > FIX_IMMR_SIZE, > #endif > /* FIX_PCIE_MCFG, */ > + __end_of_permanent_fixed_addresses, > + > +#define NR_FIX_BTMAPS (SZ_256K / PAGE_SIZE) > +#define FIX_BTMAPS_SLOTS 16 > +#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 > }; > > @@ -71,6 +80,7 @@ enum fixed_addresses { > #define FIXADDR_START (FIXADDR_TOP - __FIXADDR_SIZE) > > #define FIXMAP_PAGE_NOCACHE PAGE_KERNEL_NCG > +#define FIXMAP_PAGE_IO PAGE_KERNEL_NCG > > #include > > @@ -85,5 +95,7 @@ static inline void __set_fixmap(enum fixed_addresses idx, > map_kernel_page(__fix_to_virt(idx), phys, flags); > } > > +#define __early_set_fixmap __set_fixmap > + > #endif /* !__ASSEMBLY__ */ > #endif > diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c > index a7541edf0cdb..dcffe927f5b9 100644 > --- a/arch/powerpc/kernel/setup_32.c > +++ b/arch/powerpc/kernel/setup_32.c > @@ -44,6 +44,7 @@ > #include > #include > #include > +#include > > #include "setup.h" > > @@ -80,6 +81,8 @@ notrace void __init machine_init(u64 dt_ptr) > /* Configure static keys first, now that we're relocated. */ > setup_feature_keys(); > > + early_ioremap_setup(); > + > /* Enable early debugging if any specified (see udbg.h) */ > udbg_early_init(); > > diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c > index 44b4c432a273..b85f6a1cc3a1 100644 > --- a/arch/powerpc/kernel/setup_64.c > +++ b/arch/powerpc/kernel/setup_64.c > @@ -65,6 +65,7 @@ > #include > #include > #include > +#include > > #include "setup.h" > > @@ -338,6 +339,8 @@ void __init early_setup(unsigned long dt_ptr) > apply_feature_fixups(); > setup_feature_keys(); > > + early_ioremap_setup(); > + > /* Initialize the hash table or TLB handling */ > early_init_mmu(); > Can we remove early_ioremap_range() after this? -aneesh