From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751504AbdKUOcm (ORCPT ); Tue, 21 Nov 2017 09:32:42 -0500 Received: from mail-out.m-online.net ([212.18.0.10]:49707 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751228AbdKUOck (ORCPT ); Tue, 21 Nov 2017 09:32:40 -0500 X-Auth-Info: Q3Rip5MslP+UE1YwOWCTr3lFOAeJZGwlbg6rzwAeCUs= From: Lukasz Majewski To: Alexander Sverdlin , Arnd Bergmann , arndbergmann@gmail.com, Hartley Sweeten Cc: Russell King , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Olof Johansson , Linus Walleij , Lukasz Majewski Subject: [PATCH v2 4/6] ARM: ep93xx: ts72xx: Rewrite map IO code to be reusable Date: Tue, 21 Nov 2017 15:32:02 +0100 Message-Id: <20171121143204.1839-5-lukma@denx.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171121143204.1839-1-lukma@denx.de> References: <20171116232239.16823-1-lukma@denx.de> <20171121143204.1839-1-lukma@denx.de> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The map IO common code has been excluded to be reused by other ts72xx clones. Signed-off-by: Lukasz Majewski --- Changes for v2: - New patch --- 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 00e0e5b8babf..a6e473b3dcf6 100644 --- a/arch/arm/mach-ep93xx/ts72xx.c +++ b/arch/arm/mach-ep93xx/ts72xx.c @@ -30,11 +30,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, @@ -47,12 +42,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 -- 2.11.0 From mboxrd@z Thu Jan 1 00:00:00 1970 From: lukma@denx.de (Lukasz Majewski) Date: Tue, 21 Nov 2017 15:32:02 +0100 Subject: [PATCH v2 4/6] ARM: ep93xx: ts72xx: Rewrite map IO code to be reusable In-Reply-To: <20171121143204.1839-1-lukma@denx.de> References: <20171116232239.16823-1-lukma@denx.de> <20171121143204.1839-1-lukma@denx.de> Message-ID: <20171121143204.1839-5-lukma@denx.de> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org The map IO common code has been excluded to be reused by other ts72xx clones. Signed-off-by: Lukasz Majewski --- Changes for v2: - New patch --- 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 00e0e5b8babf..a6e473b3dcf6 100644 --- a/arch/arm/mach-ep93xx/ts72xx.c +++ b/arch/arm/mach-ep93xx/ts72xx.c @@ -30,11 +30,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, @@ -47,12 +42,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 -- 2.11.0