From patchwork Mon Jun 17 00:43:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Likely X-Patchwork-Id: 2730021 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 A0E56C0AB1 for ; Mon, 17 Jun 2013 00:51:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 754CF2017F for ; Mon, 17 Jun 2013 00:51:57 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6128720183 for ; Mon, 17 Jun 2013 00:51:56 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UoNfj-0001oY-7q; Mon, 17 Jun 2013 00:51:51 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UoNfg-0001sE-Lu; Mon, 17 Jun 2013 00:51:48 +0000 Received: from mail-ie0-x233.google.com ([2607:f8b0:4001:c03::233]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UoNfe-0001rb-34 for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2013 00:51:46 +0000 Received: by mail-ie0-f179.google.com with SMTP id c10so5578535ieb.10 for ; Sun, 16 Jun 2013 17:51:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=Wn03IZ7ceorwGob9MOII7J3/4TN4SV+7qcbZktnUaXs=; b=UqWF03QoUQxI6z5wGeD6pVhQmyiEerj9faupeFZ9ZyHi5HRvNeXyK1QsyWbPOo42mv mSqtzix2G8Qrm/z4Q/tfhFaoLqTbJnKkKMy/y3xMRiuBd8u4feTBzKGg0MzSF2JYXLgz gZW52GUTdRIHKl2fczUUHnEyKZxmTdg+485XGEkF4p/MkQ4PLZlIUfmAorNufJ/tr3sh b/QndUNqXbmCumc8UQDIbdivu4FVPrdCgW9KEX9+1YX5R1zWAASWqyPg62OidWNfgBpY dsadI+J/uA4+qmwoKNO4mrCGDQOqpj/GuPMbLJV64Re8bwUIuKYIB79yhTigTQmPta1d uLew== X-Received: by 10.50.136.230 with SMTP id qd6mr3632293igb.4.1371429805771; Sun, 16 Jun 2013 17:43:25 -0700 (PDT) Received: from localhost (host86-179-223-69.range86-179.btcentralplus.com. [86.179.223.69]) by mx.google.com with ESMTPSA id x10sm14671481igl.3.2013.06.16.17.43.23 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 16 Jun 2013 17:43:25 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id A7F233E0C36; Mon, 17 Jun 2013 01:43:20 +0100 (BST) From: Grant Likely To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [RFC] arm: Remove sa1111 special case from arm_mm_memblock_reserve() Date: Mon, 17 Jun 2013 01:43:19 +0100 Message-Id: <1371429799-7128-1-git-send-email-grant.likely@linaro.org> X-Mailer: git-send-email 1.8.1.2 X-Gm-Message-State: ALoCoQlczCRtJ4ts02JDkgka3EgiLgZ8GRr51A6dzoQ5+8wYH7GzrfTSo9onffqH2/emHimL4XPA X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130616_205146_165401_A17D1E7B X-CRM114-Status: GOOD ( 18.77 ) X-Spam-Score: -1.9 (-) Cc: Russell King , Arnd Bergmann , Nicolas Pitre , Catalin Marinas , Grant Likely , Grant Likely 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=-5.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 The machine desc structure has a hook for doing machine-specific memblock code, but the SA1111 still has a platform-specific hook in the generic code. This patch merely moves the needed memblock_reserve() into a callback. This still leaves a special case in mem_init() to call free_reserved_area() on the same region, but there isn't a suitable hook in mdesc for making that call so the change is left to another patch. Compile tested only. Signed-off-by: Grant Likely Cc: Russell King Cc: Nicolas Pitre Cc: Catalin Marinas Cc: Arnd Bergmann --- arch/arm/mach-sa1100/assabet.c | 1 + arch/arm/mach-sa1100/badge4.c | 1 + arch/arm/mach-sa1100/generic.c | 12 ++++++++++++ arch/arm/mach-sa1100/generic.h | 1 + arch/arm/mach-sa1100/jornada720.c | 1 + arch/arm/mm/mmu.c | 8 -------- 6 files changed, 16 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-sa1100/assabet.c b/arch/arm/mach-sa1100/assabet.c index e838ba2..aab247a 100644 --- a/arch/arm/mach-sa1100/assabet.c +++ b/arch/arm/mach-sa1100/assabet.c @@ -621,6 +621,7 @@ MACHINE_START(ASSABET, "Intel-Assabet") .fixup = fixup_assabet, .map_io = assabet_map_io, .nr_irqs = SA1100_NR_IRQS, + .reserve = sa1100_reserve, .init_irq = sa1100_init_irq, .init_time = sa1100_timer_init, .init_machine = assabet_init, diff --git a/arch/arm/mach-sa1100/badge4.c b/arch/arm/mach-sa1100/badge4.c index 63361b6..9033d74 100644 --- a/arch/arm/mach-sa1100/badge4.c +++ b/arch/arm/mach-sa1100/badge4.c @@ -334,6 +334,7 @@ MACHINE_START(BADGE4, "Hewlett-Packard Laboratories BadgePAD 4") .atag_offset = 0x100, .map_io = badge4_map_io, .nr_irqs = SA1100_NR_IRQS, + .reserve = sa1100_reserve, .init_irq = sa1100_init_irq, .init_late = sa11x0_init_late, .init_time = sa1100_timer_init, diff --git a/arch/arm/mach-sa1100/generic.c b/arch/arm/mach-sa1100/generic.c index 9db3e98..1e7164e 100644 --- a/arch/arm/mach-sa1100/generic.c +++ b/arch/arm/mach-sa1100/generic.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -26,6 +27,7 @@ #include #include #include +#include #include #include @@ -351,6 +353,16 @@ static struct platform_device *sa11x0_devices[] __initdata = { &sa11x0dma_device, }; +void __init sa1100_reserve(void) +{ + /* + * Because of the SA1111 DMA bug, we want to preserve our + * precious DMA-able memory... + */ + if (IS_ENABLED(CONFIG_SA1111)) + memblock_reserve(PHYS_OFFSET, __pa(swapper_pg_dir) - PHYS_OFFSET); +} + static int __init sa1100_init(void) { pm_power_off = sa1100_power_off; diff --git a/arch/arm/mach-sa1100/generic.h b/arch/arm/mach-sa1100/generic.h index 2abc6a1..5d8398c 100644 --- a/arch/arm/mach-sa1100/generic.h +++ b/arch/arm/mach-sa1100/generic.h @@ -5,6 +5,7 @@ */ extern void sa1100_timer_init(void); +extern void sa1100_reserve(void); extern void __init sa1100_map_io(void); extern void __init sa1100_init_irq(void); extern void __init sa1100_init_gpio(void); diff --git a/arch/arm/mach-sa1100/jornada720.c b/arch/arm/mach-sa1100/jornada720.c index c0b1f5b..d95961a 100644 --- a/arch/arm/mach-sa1100/jornada720.c +++ b/arch/arm/mach-sa1100/jornada720.c @@ -345,6 +345,7 @@ MACHINE_START(JORNADA720, "HP Jornada 720") .atag_offset = 0x100, .map_io = jornada720_map_io, .nr_irqs = SA1100_NR_IRQS, + .reserve = sa1100_reserve, .init_irq = sa1100_init_irq, .init_time = sa1100_timer_init, .init_machine = jornada720_mach_init, diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index e0d8565..f281a24 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c @@ -1147,14 +1147,6 @@ void __init arm_mm_memblock_reserve(void) * and can only be in node 0. */ memblock_reserve(__pa(swapper_pg_dir), SWAPPER_PG_DIR_SIZE); - -#ifdef CONFIG_SA1111 - /* - * Because of the SA1111 DMA bug, we want to preserve our - * precious DMA-able memory... - */ - memblock_reserve(PHYS_OFFSET, __pa(swapper_pg_dir) - PHYS_OFFSET); -#endif } /*