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: 29741 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f70.google.com (mail-pa0-f70.google.com [209.85.220.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 510CF202E6 for ; Tue, 6 May 2014 23:00:51 +0000 (UTC) Received: by mail-pa0-f70.google.com with SMTP id lj1sf810301pab.1 for ; Tue, 06 May 2014 16:00:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:content-type:content-transfer-encoding; bh=q/s98cdegWHfVynYVxWSubQrRyprBrxUi5fvbynvxB8=; b=Et+bEv9B9aiDqqaMUYaeRLvNLipPLZVhWXaxRHXytaBGzF3Ch4weY0E+8W/QrZDoYs erUQFjMx7+4MhznGRUosdT8YOr6dNZbuiu+XjfNtkXhxNHPwje2Pn2i4jZomxK/Ax5pA jSeqdvZENnnoplwvgvTDmQFuUiV39gAqGKmLoIb3cfaix39JoIECjfQ8sTbkYV9SI8ue HC7ZSiLHI68jIma0cA787FK1N95BW0e+kNBjijPd/J9lBjn7U/xI1RMBRMnKOHNRDXaz fIsQiQd44HM4UoOuRjy5AGmKvqjq3vzK7hjlis8xTYeeLJ4BJ2Sd4JHpx9HnZrWujpXE vDpA== X-Gm-Message-State: ALoCoQlsJtamj1ZAQw5RowGHEmGsTmgn90bN6P/Xkk/razKBcdmeUGeqZXLwm77KvA4v1AsdJmpk X-Received: by 10.66.141.135 with SMTP id ro7mr2626402pab.28.1399417250383; Tue, 06 May 2014 16:00:50 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.19.9 with SMTP id 9ls3079410qgg.75.gmail; Tue, 06 May 2014 16:00:50 -0700 (PDT) X-Received: by 10.58.186.71 with SMTP id fi7mr3035153vec.32.1399417250251; Tue, 06 May 2014 16:00:50 -0700 (PDT) Received: from mail-vc0-x22d.google.com (mail-vc0-x22d.google.com [2607:f8b0:400c:c03::22d]) by mx.google.com with ESMTPS id vr6si2565329vcb.190.2014.05.06.16.00.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 06 May 2014 16:00:50 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=2607:f8b0:400c:c03::22d; Received: by mail-vc0-f173.google.com with SMTP id il7so223219vcb.18 for ; Tue, 06 May 2014 16:00:50 -0700 (PDT) X-Received: by 10.52.120.39 with SMTP id kz7mr2362915vdb.41.1399417250171; Tue, 06 May 2014 16:00:50 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp261658vcb; Tue, 6 May 2014 16:00:49 -0700 (PDT) X-Received: by 10.224.115.68 with SMTP id h4mr59973766qaq.35.1399417249629; Tue, 06 May 2014 16:00:49 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id v9si5885530qar.174.2014.05.06.16.00.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 May 2014 16:00:49 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; 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) 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 (/) X-Spam-Report: SpamAssassin version 3.3.2 on bombadil.infradead.org summary: Content analysis details: (0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (robherring2[at]gmail.com) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (robherring2[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 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+patch=linaro.org@lists.infradead.org X-Original-Sender: robherring2@gmail.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=neutral (body hash did not verify) header.i=@; dmarc=fail (p=NONE dis=NONE) header.from=gmail.com Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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