From patchwork Tue May 6 22:58:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 4124651 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1EC08BFF02 for ; Tue, 6 May 2014 23:01:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3FF5320256 for ; Tue, 6 May 2014 23:01:28 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6EE84202A1 for ; Tue, 6 May 2014 23:01:27 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WhoJx-0000ag-0u; Tue, 06 May 2014 22:58:45 +0000 Received: from mail-oa0-x229.google.com ([2607:f8b0:4003:c02::229]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WhoJq-0000Xx-D5 for linux-arm-kernel@lists.infradead.org; Tue, 06 May 2014 22:58:38 +0000 Received: by mail-oa0-f41.google.com with SMTP id m1so227022oag.0 for ; Tue, 06 May 2014 15:58:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rmIZmIs4ZJXRkrjx7x7mi5poq29t5Y4rCHVfKWjP5LY=; b=D0o8Ivpw+U8uawWktp+Wngvb6JZySc/FdSXP7L5dSX/dZTkX82vQ7KGdnJA/LUfrM0 B4UgGvxdCfGVq7GBltNHNnwLstwfaYrB6x+1aWyBrBysiGlu3gWwN+WvFaby3VX1MbL0 2yswCRJtHRGQQHwFhemmueqnbm8ymmomxRiyP9FkEPGEkClNO6VNIHfblSdxUNOTFbjU OZjNo5nOi7Lq67Lc4DQZQKRNeuSYbkNEE/NeVDgvD6UFwFU/r56uXB9FoJ/+CiYmEBhW cSaw6djKJrBtsb2cQbySbGQCGeglZnFH4ZrpRzZmPLJM+AwTno8s5hV31GRMzYLt9dPU Dufg== X-Received: by 10.60.134.137 with SMTP id pk9mr41913315oeb.40.1399417097161; Tue, 06 May 2014 15:58:17 -0700 (PDT) Received: from localhost.localdomain (72-48-77-163.dyn.grandenetworks.net. [72.48.77.163]) by mx.google.com with ESMTPSA id dh8sm58001745oeb.10.2014.05.06.15.58.15 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 06 May 2014 15:58:16 -0700 (PDT) From: Rob Herring To: Russell King , linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/3] arm: use generic fixmap.h Date: Tue, 6 May 2014 17:58:05 -0500 Message-Id: <1399417087-24772-2-git-send-email-robherring2@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1399417087-24772-1-git-send-email-robherring2@gmail.com> References: <1399417087-24772-1-git-send-email-robherring2@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140506_155838_493330_B054AF34 X-CRM114-Status: GOOD ( 12.86 ) X-Spam-Score: 0.1 (/) Cc: Catalin Marinas , Andrew Morton , Leif Lindholm , Mark Salter X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Mark Salter ARM is different from other architectures in that fixmap pages are indexed with a positive offset from FIXADDR_START. Other architectures index with a negative offset from FIXADDR_TOP. In order to use the generic fixmap.h definitions, this patch redefines FIXADDR_TOP to be inclusive of the useable range. That is, FIXADDR_TOP is the virtual address of the topmost fixed page. The newly defined FIXADDR_END is the first virtual address past the fixed mappings. Signed-off-by: Mark Salter Cc: Russell King Signed-off-by: Andrew Morton --- arch/arm/include/asm/fixmap.h | 29 ++++++++--------------------- arch/arm/mm/init.c | 2 +- 2 files changed, 9 insertions(+), 22 deletions(-) diff --git a/arch/arm/include/asm/fixmap.h b/arch/arm/include/asm/fixmap.h index bbae919..68ea615 100644 --- a/arch/arm/include/asm/fixmap.h +++ b/arch/arm/include/asm/fixmap.h @@ -14,28 +14,15 @@ */ #define FIXADDR_START 0xfff00000UL -#define FIXADDR_TOP 0xfffe0000UL -#define FIXADDR_SIZE (FIXADDR_TOP - FIXADDR_START) +#define FIXADDR_END 0xfffe0000UL +#define FIXADDR_TOP (FIXADDR_END - PAGE_SIZE) -#define FIX_KMAP_BEGIN 0 -#define FIX_KMAP_END (FIXADDR_SIZE >> PAGE_SHIFT) +enum fixed_addresses { + FIX_KMAP_BEGIN, + FIX_KMAP_END = (FIXADDR_TOP - FIXADDR_START) >> PAGE_SHIFT, + __end_of_fixed_addresses +}; -#define __fix_to_virt(x) (FIXADDR_START + ((x) << PAGE_SHIFT)) -#define __virt_to_fix(x) (((x) - FIXADDR_START) >> PAGE_SHIFT) - -extern void __this_fixmap_does_not_exist(void); - -static inline unsigned long fix_to_virt(const unsigned int idx) -{ - if (idx >= FIX_KMAP_END) - __this_fixmap_does_not_exist(); - return __fix_to_virt(idx); -} - -static inline unsigned int virt_to_fix(const unsigned long vaddr) -{ - BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START); - return __virt_to_fix(vaddr); -} +#include #endif diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 2a77ba8..91a4682 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -578,7 +578,7 @@ void __init mem_init(void) MLK(DTCM_OFFSET, (unsigned long) dtcm_end), MLK(ITCM_OFFSET, (unsigned long) itcm_end), #endif - MLK(FIXADDR_START, FIXADDR_TOP), + MLK(FIXADDR_START, FIXADDR_END), MLM(VMALLOC_START, VMALLOC_END), MLM(PAGE_OFFSET, (unsigned long)high_memory), #ifdef CONFIG_HIGHMEM