From patchwork Tue Feb 12 16:28:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 2129551 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id E076E40134 for ; Tue, 12 Feb 2013 16:29:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933370Ab3BLQ3k (ORCPT ); Tue, 12 Feb 2013 11:29:40 -0500 Received: from mail.free-electrons.com ([94.23.35.102]:45887 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933369Ab3BLQ3i (ORCPT ); Tue, 12 Feb 2013 11:29:38 -0500 Received: by mail.free-electrons.com (Postfix, from userid 106) id A8199B96; Tue, 12 Feb 2013 17:29:37 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.3.2 Received: from localhost (col31-4-88-188-83-94.fbx.proxad.net [88.188.83.94]) by mail.free-electrons.com (Postfix) with ESMTPSA id 21F3B825; Tue, 12 Feb 2013 17:29:37 +0100 (CET) From: Thomas Petazzoni To: Bjorn Helgaas , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Lior Amsalem , Andrew Lunn , Russell King - ARM Linux , Jason Cooper , Arnd Bergmann , Stephen Warren , Thierry Reding , Eran Ben-Avi , Nadav Haklai , Maen Suleiman , Shadi Ammouri , Gregory Clement , Jason Gunthorpe , Tawfik Bayouk Subject: [PATCH 17/32] arm: plat-orion: convert 'int remap' to 'u32 remap' Date: Tue, 12 Feb 2013 17:28:51 +0100 Message-Id: <1360686546-24277-18-git-send-email-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1360686546-24277-1-git-send-email-thomas.petazzoni@free-electrons.com> References: <1360686546-24277-1-git-send-email-thomas.petazzoni@free-electrons.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Now that we have ORION_ADDR_MAP_NO_REMAP in place, we can easily convert the 'int remap' field to a 'u32 remap' field, and accept any remapping address, except the magical ORION_ADDR_MAP_NO_REMAP. Signed-off-by: Thomas Petazzoni --- arch/arm/plat-orion/addr-map.c | 4 ++-- arch/arm/plat-orion/include/plat/addr-map.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/arm/plat-orion/addr-map.c b/arch/arm/plat-orion/addr-map.c index dd98638..b1d4806 100644 --- a/arch/arm/plat-orion/addr-map.c +++ b/arch/arm/plat-orion/addr-map.c @@ -69,7 +69,7 @@ static int __init orion_cpu_win_can_remap(const struct orion_addr_map_cfg *cfg, void __init orion_setup_cpu_win(const struct orion_addr_map_cfg *cfg, const int win, const u32 base, const u32 size, const u8 target, - const u8 attr, const int remap) + const u8 attr, const u32 remap) { void __iomem *addr = cfg->win_cfg_base(cfg, win); u32 ctrl, base_high, remap_addr; @@ -86,7 +86,7 @@ void __init orion_setup_cpu_win(const struct orion_addr_map_cfg *cfg, writel(base_high, addr + WIN_BASE_OFF); writel(ctrl, addr + WIN_CTRL_OFF); if (cfg->cpu_win_can_remap(cfg, win)) { - if (remap < 0) + if (remap == ORION_ADDR_MAP_NO_REMAP) remap_addr = base; else remap_addr = remap; diff --git a/arch/arm/plat-orion/include/plat/addr-map.h b/arch/arm/plat-orion/include/plat/addr-map.h index 0861b8c..6533c47 100644 --- a/arch/arm/plat-orion/include/plat/addr-map.h +++ b/arch/arm/plat-orion/include/plat/addr-map.h @@ -38,10 +38,10 @@ struct orion_addr_map_info { const u32 size; const u8 target; const u8 attr; - const int remap; + const u32 remap; }; -#define ORION_ADDR_MAP_NO_REMAP (-1) +#define ORION_ADDR_MAP_NO_REMAP (0xFFFFFFFF) void __init orion_config_wins(struct orion_addr_map_cfg *cfg, const struct orion_addr_map_info *info); @@ -49,7 +49,7 @@ void __init orion_config_wins(struct orion_addr_map_cfg *cfg, void __init orion_setup_cpu_win(const struct orion_addr_map_cfg *cfg, const int win, const u32 base, const u32 size, const u8 target, - const u8 attr, const int remap); + const u8 attr, const u32 remap); void __init orion_setup_cpu_mbus_target(const struct orion_addr_map_cfg *cfg, const void __iomem *ddr_window_cpu_base);