From patchwork Thu Nov 30 23:51:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 10085845 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0D9E5602B5 for ; Thu, 30 Nov 2017 23:54:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F2B972A431 for ; Thu, 30 Nov 2017 23:54:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E72162A434; Thu, 30 Nov 2017 23:54:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7C3692A431 for ; Thu, 30 Nov 2017 23:54:36 +0000 (UTC) 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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=msH7zN7zx1jzGA3vx6qFKUOLiOiDHEI+LrQXyNt7ajE=; b=beuiMoi+04hAqOMIXYxQW64Ucx GE3UZrwpDUO9tECeSgTv3Kt44s6IHVrEB1Wyki7t8HpD4Z9mH9cFmoO+yHXIg5IAI5iMtWcMQ2EYB M6qz4BF1Ho+qEXHf4YM0RfyZ0cJLTIaLQj1em7nfNbXLphOdb5J2DwLvMlVrEhdHh/pA+rBmtog/O 4Jgld1qduxNpaYSFZaconr3NPZvmEd1zUHoveysZ8br7T1Tye8fPyJpodvjHPBEF69G7TbGzpLCKx Pc57lLrw46jdGyqcirgcLEOTynVDLIabQJRYKtpcRJAnuGQfc+wrpIRCXVDSaK2AyX7Yym12l5w1v KaAgNooQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eKYf5-0003Od-Vd; Thu, 30 Nov 2017 23:54:35 +0000 Received: from mail-out.m-online.net ([2001:a60:0:28:0:1:25:1]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eKYdN-0001md-IH for linux-arm-kernel@lists.infradead.org; Thu, 30 Nov 2017 23:52:56 +0000 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 3ynvMP18qMz1qyvM; Fri, 1 Dec 2017 00:52:01 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 3ynvMP0QZtz22LPp; Fri, 1 Dec 2017 00:52:01 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id Jrxr3l6C7ndh; Fri, 1 Dec 2017 00:51:59 +0100 (CET) X-Auth-Info: d5znXmsTCMQm7BXSGx8pUW5+qt9M2vkn4mlTFomD5Wg= Received: from localhost.localdomain (89-64-27-66.dynamic.chello.pl [89.64.27.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Fri, 1 Dec 2017 00:51:59 +0100 (CET) From: Lukasz Majewski To: Alexander Sverdlin , Arnd Bergmann , arndbergmann@gmail.com, Hartley Sweeten Subject: [PATCH v4 3/5] ARM: ep93xx: ts72xx: Rewrite map IO code to be reusable Date: Fri, 1 Dec 2017 00:51:38 +0100 Message-Id: <20171130235140.12243-4-lukma@denx.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171130235140.12243-1-lukma@denx.de> References: <20171116232239.16823-1-lukma@denx.de> <20171130235140.12243-1-lukma@denx.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171130_155250_417260_F05BF379 X-CRM114-Status: GOOD ( 11.33 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, Linus Walleij , Lukasz Majewski , Russell King , Olof Johansson , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The map IO common code has been excluded to be reused by other ts72xx clones. Signed-off-by: Lukasz Majewski Acked-by: Alexander Sverdlin --- Changes for v2: - New patch Changes for v3: - None Changes for v4: - None --- arch/arm/mach-ep93xx/ts72xx.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c index 141ae4c65a81..19b23c9a2efa 100644 --- a/arch/arm/mach-ep93xx/ts72xx.c +++ b/arch/arm/mach-ep93xx/ts72xx.c @@ -33,11 +33,6 @@ static struct map_desc ts72xx_io_desc[] __initdata = { { - .virtual = (unsigned long)TS72XX_MODEL_VIRT_BASE, - .pfn = __phys_to_pfn(TS72XX_MODEL_PHYS_BASE), - .length = TS72XX_MODEL_SIZE, - .type = MT_DEVICE, - }, { .virtual = (unsigned long)TS72XX_OPTIONS_VIRT_BASE, .pfn = __phys_to_pfn(TS72XX_OPTIONS_PHYS_BASE), .length = TS72XX_OPTIONS_SIZE, @@ -50,12 +45,26 @@ static struct map_desc ts72xx_io_desc[] __initdata = { } }; -static void __init ts72xx_map_io(void) +static struct map_desc ts72xx_common_io_desc[] __initdata = { + { + .virtual = (unsigned long)TS72XX_MODEL_VIRT_BASE, + .pfn = __phys_to_pfn(TS72XX_MODEL_PHYS_BASE), + .length = TS72XX_MODEL_SIZE, + .type = MT_DEVICE, + } +}; + +void __init ts72xx_common_map_io(void) { ep93xx_map_io(); - iotable_init(ts72xx_io_desc, ARRAY_SIZE(ts72xx_io_desc)); + iotable_init(ts72xx_common_io_desc, ARRAY_SIZE(ts72xx_common_io_desc)); } +static void __init ts72xx_map_io(void) +{ + ts72xx_common_map_io(); + iotable_init(ts72xx_io_desc, ARRAY_SIZE(ts72xx_io_desc)); +} /************************************************************************* * NAND flash