From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72A6FC2BBC7 for ; Mon, 13 Apr 2020 21:30:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4B8F9206DA for ; Mon, 13 Apr 2020 21:30:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="hoe+XuaO" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389089AbgDMVaB (ORCPT ); Mon, 13 Apr 2020 17:30:01 -0400 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:20794 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389044AbgDMV3c (ORCPT ); Mon, 13 Apr 2020 17:29:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1586813372; x=1618349372; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=I/GiEGyOV5rt1rc9GnsBz8XcyhOtNk7wcIG4+FIGGnk=; b=hoe+XuaOniPfASCqCow7b4qAaNvDCF+QWKHmJ8NwWbnpfVkKE4XCXWY8 IJdL/pkUHLteksSEkGY5eLZH8sOIEZkrmaYca8uNitQPZZaNb+t6n0v5a e7B83Oo8daMBoWO27pfLYPHhmAWlb9vhSlDMmTJxYgbNCA98gzTEf7f56 /TgQbGdW9hsgKzGdAsmEtCq9IbMqZk+Sqc1jBu6RqUmteJ5/rKSno3LGF d5Wqt+016zVw7Rf8fIlruxxN5cKvXQrHx8frT/rN185BZmvDw59VGUVLf cKvXI5gbS2b6UhKVqy7MEDO1+M/ZZOG0xawrR+JmLTs6WtDfyOqUgMb/G w==; IronPort-SDR: +BTq6wYWkwg5Wlh9/ABlL5ZfqAu0vLBTlAtl7JrEbevAuVbNTiKz64iYRn7tpOOm/SK1PdaJ7J M1uyAiHcFWTZdEEO9TvPhOLV4UdRROyscFcW4wiF6vf4F16lvY0owNS0bcPuO3tlUCPOLOQgrz cMgH0OtDQyOFUWtFEyL6Q6QY/5FjS+9fA+snWYKcYc972vcozfW9xuSpFZSv+X7acbc/dlf1q3 dudFx7GIEcYemPywlQnuT5N+FAlD0YdBSCM6fkvTawZL7rjdt7afhbsvOUhAQgxxRz5JS12Red WYE= X-IronPort-AV: E=Sophos;i="5.72,380,1580745600"; d="scan'208";a="139583357" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 14 Apr 2020 05:29:31 +0800 IronPort-SDR: WuOSxf+mMsoIIr18x/7he6AjDktMMNrqB1THYNHtaugqVOlKbH+jOTjzAxSoWHXmOXC4BfHfZ9 t01C7YmXkfmpSJNlSQ3/S7rrdrQ6DgknN8aYa25ZfqcdjzFis4VkIZ1VAqy+Vj9Wd/qDfb8n13 9LLQV6SwZtt4OMHY2+zW9lFcs29VuC3H/8DxKp7uirRlw8GKfVUdUCc1ZFUlh152yYCJG5WjjK 8vN0W9NyfOMZ/A20pAVU3UDt2z9K4pih0Q41aYnAt981J9Q5Ohkma6cx1qsMQd4gTSVxbUyocO fCKgTbIF8cXNjR1pSXwfKcg1 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2020 14:20:35 -0700 IronPort-SDR: BseMmEGbdr0tCYWbKQphuB1iCB2ANCvg+j86bIbB8nd/xBtv73df2iAf1kOIAk5mlOsLuUo43g SeaVOSRUDO6VTRZAjJ/kv7HT+qXUBbJAIkDUCSAEDyyGXFztvYsUvXRcA4n0vm2AJiwtpNVdEq +9reJHs+lT5r40PSoQustcMlul/5Wq9D+KyjZYOboxtWIaqc8NrJQFapg28YEtFYjCqlxTgeHS +zVA+KcUN0I+volZI6cqbVJfG+23HjpXQvxKOw57rKVH6lwAAKj8Oe/OXnFJYWc8vM8TXNYNCP zvA= WDCIronportException: Internal Received: from 9dg4l72.ad.shared (HELO jedi-01.hgst.com) ([10.86.55.26]) by uls-op-cesaip01.wdc.com with ESMTP; 13 Apr 2020 14:29:31 -0700 From: Atish Patra To: linux-kernel@vger.kernel.org Cc: Atish Patra , Ard Biesheuvel , Arnd Bergmann , Catalin Marinas , Greg Kroah-Hartman , Ingo Molnar , linux-efi@vger.kernel.org, linux-riscv@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Masahiro Yamada , Palmer Dabbelt , Russell King , Will Deacon Subject: [v2 PATCH 3/5] RISC-V: Define fixmap bindings for generic early ioremap support Date: Mon, 13 Apr 2020 14:29:05 -0700 Message-Id: <20200413212907.29244-4-atish.patra@wdc.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200413212907.29244-1-atish.patra@wdc.com> References: <20200413212907.29244-1-atish.patra@wdc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Acked-by: Ard Biesheuvel --- arch/riscv/Kconfig | 1 + arch/riscv/include/asm/Kbuild | 1 + arch/riscv/include/asm/fixmap.h | 18 ++++++++++++++++++ arch/riscv/include/asm/io.h | 1 + 4 files changed, 21 insertions(+) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index a197258595ef..f39e326a7a42 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -68,6 +68,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 3d9410bb4de0..59dd7be55005 100644 --- a/arch/riscv/include/asm/Kbuild +++ b/arch/riscv/include/asm/Kbuild @@ -1,4 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 +generic-y += early_ioremap.h generic-y += extable.h generic-y += flat.h generic-y += kvm_para.h diff --git a/arch/riscv/include/asm/fixmap.h b/arch/riscv/include/asm/fixmap.h index 2368d49eb4ef..ba5096d65fb0 100644 --- a/arch/riscv/include/asm/fixmap.h +++ b/arch/riscv/include/asm/fixmap.h @@ -30,6 +30,24 @@ enum fixed_addresses { FIX_TEXT_POKE1, FIX_TEXT_POKE0, 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 #include #include +#include /* * MMIO access functions are separated out to break dependency cycles -- 2.24.0 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22468C2BA2B for ; Mon, 13 Apr 2020 21:30:53 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DB2F9206DA for ; Mon, 13 Apr 2020 21:30:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Hzof8Xj4"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="jpbJvhFQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DB2F9206DA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+infradead-linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id:Date :Subject:To:From:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=tttd728ZR7pfChiGqdkLPg42rQ3qB92mFJUxcj2QtZ0=; b=Hzof8Xj4Z9IA6V BGUTS4oTuzBhZ/CWA7fdFPd/ODqXdveVQ7ePejHUDlwMvd0GyF03s/UAqNqXFMCbc/jOTNtYg8Sxj Xv+Nk8q6qejIn6XfAS6zqkFLFx0YrHXAVx0G/8eelbPJ9C80CylFEfMG4AupTN9jF5ZgdGsmwxcsJ f7tpfuNhCgPYM3Br2HB4nt2LIO79V2OiBp4M/4DJLwt0MBElfb8cFiY+fK4f5WpyRTwCl1HO+sRcZ rEzTACBIeIn2QWw37OUg0GWw6pChhcu25adiVHZaPQTpcM5OWjXr7I0PegUiUiqBmo14tN0P6zlof jwbxspYIMS1P3D1H6hkA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jO6fL-0003dZ-3X; Mon, 13 Apr 2020 21:30:51 +0000 Received: from esa6.hgst.iphmx.com ([216.71.154.45]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jO6eQ-0000Mo-Er; Mon, 13 Apr 2020 21:29:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1586813395; x=1618349395; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=I/GiEGyOV5rt1rc9GnsBz8XcyhOtNk7wcIG4+FIGGnk=; b=jpbJvhFQ+fvafcLylwFillSNZ5NNaCpXKXEA7xpjxkwzgNkNQxUpjlGJ QLbjYKAzgA0ok7RddA6x0vPgCLBm6jyJUA3DBqRms7S5LYVo30kOkoEDY Vh3uHfkSbg1nxP0wKFNKONKrbiJFwGujMMSrQ0YPhtxBXh4bhjoY1biLO XIM6BwvSBXnQC2qDxTUTRQtS+z7Lti70zku7yownkKpjq2/P8FIu7pyqw 3ObO0v4o7jHBKDtS9TENz+VJe0pQKR+CD23n+/ZS+lV68PvihEIoZOwg4 hPi4dE5HuvnfXUF4IK1NIVelAXqNyMdOXdE8mWhcZf99dqzcsMFMFSnhw g==; IronPort-SDR: S1iCwSe8/X09jFNxsNUPZLhyCYmp5YUr8iibGCUyhGbdWEb/UlqgKWGw8iJoTC2H6EdaBLe6FB uSEZSZzBnjPhbymp85PDdDCQdOmtkQhssLKjdwznXA3V4kK3H4Tg5g6cW0K6gLvpswhQJTeX56 FFhlG9lpSQ4fU1R2CIJjoYg1XxcF4VWuB5qqoIRO7xa0SQAX2eTcvZdGAbVe08UY+g18OWSUuf JKyYTy5tVbMUmM6BaaGA4KIOYygM3ysOQIGXb5YC3Btoz+t5/4BKt118/oJXMBkXRz+72vgDQn nC4= X-IronPort-AV: E=Sophos;i="5.72,380,1580745600"; d="scan'208";a="136683328" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 14 Apr 2020 05:29:31 +0800 IronPort-SDR: 4q8ic4vz0+q+XNeLS/BpY+K06h8jcucBal6OD64PQ0uIvFFm6nNnLyC2pev7Eb3OjnofEzKQB8 PvCiDuf3Hj60hbhsrHyCGOLf2gNVHGsOwlEkDCDqr6qYvVWxjmZ+vQDsZcp6OHKlPpdw1tFOtQ ujSvYc1dtdhAbuDkTRYhCU/r6WCRmwRwf7wQHmk9h5rpGxY+ZylTIZwx1dyWWtLrskTUvQ3gM+ SRaPpp75d9gK1Gv+Ot9LorDb+nXbinwGcZX4DT0HbjBM9B192Zhvg4oMi+kVtl574d+TdzdP9J 2D26SyKPzHPD/UGen5RFuPCA Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2020 14:20:02 -0700 IronPort-SDR: BseMmEGbdr0tCYWbKQphuB1iCB2ANCvg+j86bIbB8nd/xBtv73df2iAf1kOIAk5mlOsLuUo43g SeaVOSRUDO6VTRZAjJ/kv7HT+qXUBbJAIkDUCSAEDyyGXFztvYsUvXRcA4n0vm2AJiwtpNVdEq +9reJHs+lT5r40PSoQustcMlul/5Wq9D+KyjZYOboxtWIaqc8NrJQFapg28YEtFYjCqlxTgeHS +zVA+KcUN0I+volZI6cqbVJfG+23HjpXQvxKOw57rKVH6lwAAKj8Oe/OXnFJYWc8vM8TXNYNCP zvA= WDCIronportException: Internal Received: from 9dg4l72.ad.shared (HELO jedi-01.hgst.com) ([10.86.55.26]) by uls-op-cesaip01.wdc.com with ESMTP; 13 Apr 2020 14:29:31 -0700 From: Atish Patra To: linux-kernel@vger.kernel.org Subject: [v2 PATCH 3/5] RISC-V: Define fixmap bindings for generic early ioremap support Date: Mon, 13 Apr 2020 14:29:05 -0700 Message-Id: <20200413212907.29244-4-atish.patra@wdc.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200413212907.29244-1-atish.patra@wdc.com> References: <20200413212907.29244-1-atish.patra@wdc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200413_142954_544155_C099E515 X-CRM114-Status: GOOD ( 13.03 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-efi@vger.kernel.org, Arnd Bergmann , Greg Kroah-Hartman , Masahiro Yamada , Russell King , Ard Biesheuvel , Atish Patra , Palmer Dabbelt , Catalin Marinas , linux-riscv@lists.infradead.org, Will Deacon , Ingo Molnar , linux-arm-kernel@lists.infradead.org Sender: "linux-riscv" Errors-To: linux-riscv-bounces+infradead-linux-riscv=archiver.kernel.org@lists.infradead.org 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 Acked-by: Ard Biesheuvel --- arch/riscv/Kconfig | 1 + arch/riscv/include/asm/Kbuild | 1 + arch/riscv/include/asm/fixmap.h | 18 ++++++++++++++++++ arch/riscv/include/asm/io.h | 1 + 4 files changed, 21 insertions(+) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index a197258595ef..f39e326a7a42 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -68,6 +68,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 3d9410bb4de0..59dd7be55005 100644 --- a/arch/riscv/include/asm/Kbuild +++ b/arch/riscv/include/asm/Kbuild @@ -1,4 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 +generic-y += early_ioremap.h generic-y += extable.h generic-y += flat.h generic-y += kvm_para.h diff --git a/arch/riscv/include/asm/fixmap.h b/arch/riscv/include/asm/fixmap.h index 2368d49eb4ef..ba5096d65fb0 100644 --- a/arch/riscv/include/asm/fixmap.h +++ b/arch/riscv/include/asm/fixmap.h @@ -30,6 +30,24 @@ enum fixed_addresses { FIX_TEXT_POKE1, FIX_TEXT_POKE0, 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 #include #include +#include /* * MMIO access functions are separated out to break dependency cycles -- 2.24.0 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 865BCC2BB86 for ; Mon, 13 Apr 2020 21:31:03 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2356C20732 for ; Mon, 13 Apr 2020 21:31:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="YFR11Y/B"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="jpbJvhFQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2356C20732 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=miXatmVlE5vDzIQP0111O7xXZ56OIPuWxE7tBlMnzTs=; b=YFR11Y/BG3i6sN lKZ0oFpZNjY/4v8iy3g8TQnRQWgmD7/5SCRxTB7KZ+RU/r9o69jBeUM6mQf38yFS+UdNary0kmG/R +0MtoZP2rz+hNBPWc4CDIOKGA1yQwx2rYefuyyaAS2iFDXbhYVd8/aw0vHZ988HhKpP2GUMBKmZjm 0TF3EW4vJCfUfX44l5OcyW4c5D9BFwJNzuQuaqBvkSDck5e9f6YgnL3KTfx+6tPa+V+tmHYhDJ00K qk+bn5FYlDl21Sq8kcK7YBgdontMIEg/GKvZfWeXkEM/xAM94b7ay8xEP8CQT1eSwFuu6nhaQywoM uJ0AAfYTXxO4twbH/xwg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jO6fS-0003mD-Gb; Mon, 13 Apr 2020 21:30:58 +0000 Received: from esa6.hgst.iphmx.com ([216.71.154.45]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jO6eQ-0000Mo-Er; Mon, 13 Apr 2020 21:29:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1586813395; x=1618349395; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=I/GiEGyOV5rt1rc9GnsBz8XcyhOtNk7wcIG4+FIGGnk=; b=jpbJvhFQ+fvafcLylwFillSNZ5NNaCpXKXEA7xpjxkwzgNkNQxUpjlGJ QLbjYKAzgA0ok7RddA6x0vPgCLBm6jyJUA3DBqRms7S5LYVo30kOkoEDY Vh3uHfkSbg1nxP0wKFNKONKrbiJFwGujMMSrQ0YPhtxBXh4bhjoY1biLO XIM6BwvSBXnQC2qDxTUTRQtS+z7Lti70zku7yownkKpjq2/P8FIu7pyqw 3ObO0v4o7jHBKDtS9TENz+VJe0pQKR+CD23n+/ZS+lV68PvihEIoZOwg4 hPi4dE5HuvnfXUF4IK1NIVelAXqNyMdOXdE8mWhcZf99dqzcsMFMFSnhw g==; IronPort-SDR: S1iCwSe8/X09jFNxsNUPZLhyCYmp5YUr8iibGCUyhGbdWEb/UlqgKWGw8iJoTC2H6EdaBLe6FB uSEZSZzBnjPhbymp85PDdDCQdOmtkQhssLKjdwznXA3V4kK3H4Tg5g6cW0K6gLvpswhQJTeX56 FFhlG9lpSQ4fU1R2CIJjoYg1XxcF4VWuB5qqoIRO7xa0SQAX2eTcvZdGAbVe08UY+g18OWSUuf JKyYTy5tVbMUmM6BaaGA4KIOYygM3ysOQIGXb5YC3Btoz+t5/4BKt118/oJXMBkXRz+72vgDQn nC4= X-IronPort-AV: E=Sophos;i="5.72,380,1580745600"; d="scan'208";a="136683328" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 14 Apr 2020 05:29:31 +0800 IronPort-SDR: 4q8ic4vz0+q+XNeLS/BpY+K06h8jcucBal6OD64PQ0uIvFFm6nNnLyC2pev7Eb3OjnofEzKQB8 PvCiDuf3Hj60hbhsrHyCGOLf2gNVHGsOwlEkDCDqr6qYvVWxjmZ+vQDsZcp6OHKlPpdw1tFOtQ ujSvYc1dtdhAbuDkTRYhCU/r6WCRmwRwf7wQHmk9h5rpGxY+ZylTIZwx1dyWWtLrskTUvQ3gM+ SRaPpp75d9gK1Gv+Ot9LorDb+nXbinwGcZX4DT0HbjBM9B192Zhvg4oMi+kVtl574d+TdzdP9J 2D26SyKPzHPD/UGen5RFuPCA Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2020 14:20:02 -0700 IronPort-SDR: BseMmEGbdr0tCYWbKQphuB1iCB2ANCvg+j86bIbB8nd/xBtv73df2iAf1kOIAk5mlOsLuUo43g SeaVOSRUDO6VTRZAjJ/kv7HT+qXUBbJAIkDUCSAEDyyGXFztvYsUvXRcA4n0vm2AJiwtpNVdEq +9reJHs+lT5r40PSoQustcMlul/5Wq9D+KyjZYOboxtWIaqc8NrJQFapg28YEtFYjCqlxTgeHS +zVA+KcUN0I+volZI6cqbVJfG+23HjpXQvxKOw57rKVH6lwAAKj8Oe/OXnFJYWc8vM8TXNYNCP zvA= WDCIronportException: Internal Received: from 9dg4l72.ad.shared (HELO jedi-01.hgst.com) ([10.86.55.26]) by uls-op-cesaip01.wdc.com with ESMTP; 13 Apr 2020 14:29:31 -0700 From: Atish Patra To: linux-kernel@vger.kernel.org Subject: [v2 PATCH 3/5] RISC-V: Define fixmap bindings for generic early ioremap support Date: Mon, 13 Apr 2020 14:29:05 -0700 Message-Id: <20200413212907.29244-4-atish.patra@wdc.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200413212907.29244-1-atish.patra@wdc.com> References: <20200413212907.29244-1-atish.patra@wdc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200413_142954_544155_C099E515 X-CRM114-Status: GOOD ( 13.03 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-efi@vger.kernel.org, Arnd Bergmann , Greg Kroah-Hartman , Masahiro Yamada , Russell King , Ard Biesheuvel , Atish Patra , Palmer Dabbelt , Catalin Marinas , linux-riscv@lists.infradead.org, Will Deacon , Ingo Molnar , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 Acked-by: Ard Biesheuvel --- arch/riscv/Kconfig | 1 + arch/riscv/include/asm/Kbuild | 1 + arch/riscv/include/asm/fixmap.h | 18 ++++++++++++++++++ arch/riscv/include/asm/io.h | 1 + 4 files changed, 21 insertions(+) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index a197258595ef..f39e326a7a42 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -68,6 +68,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 3d9410bb4de0..59dd7be55005 100644 --- a/arch/riscv/include/asm/Kbuild +++ b/arch/riscv/include/asm/Kbuild @@ -1,4 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 +generic-y += early_ioremap.h generic-y += extable.h generic-y += flat.h generic-y += kvm_para.h diff --git a/arch/riscv/include/asm/fixmap.h b/arch/riscv/include/asm/fixmap.h index 2368d49eb4ef..ba5096d65fb0 100644 --- a/arch/riscv/include/asm/fixmap.h +++ b/arch/riscv/include/asm/fixmap.h @@ -30,6 +30,24 @@ enum fixed_addresses { FIX_TEXT_POKE1, FIX_TEXT_POKE0, 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 #include #include +#include /* * MMIO access functions are separated out to break dependency cycles -- 2.24.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel