From patchwork Fri May 17 14:55:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 2583131 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 94FA7DF215 for ; Fri, 17 May 2013 14:55:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754972Ab3EQOzY (ORCPT ); Fri, 17 May 2013 10:55:24 -0400 Received: from moutng.kundenserver.de ([212.227.17.10]:55120 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754366Ab3EQOzY (ORCPT ); Fri, 17 May 2013 10:55:24 -0400 Received: from axis700.grange (dslb-088-076-018-110.pools.arcor-ip.net [88.76.18.110]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0M4BD1-1ULYIT1cPb-00rqqe; Fri, 17 May 2013 16:55:22 +0200 Received: from 6a.grange (6a.grange [192.168.1.11]) by axis700.grange (Postfix) with ESMTPS id 3295440BC4; Fri, 17 May 2013 16:55:21 +0200 (CEST) Received: from lyakh by 6a.grange with local (Exim 4.72) (envelope-from ) id 1UdM40-0004HC-PZ; Fri, 17 May 2013 16:55:20 +0200 From: Guennadi Liakhovetski To: linux-sh@vger.kernel.org Cc: Magnus Damm , Simon Horman , Laurent Pinchart , Linus Walleij , Guennadi Liakhovetski Subject: [PATCH 9/9] ARM: shmobile: APE6EVM: add MMCIF and SDHI devices Date: Fri, 17 May 2013 16:55:20 +0200 Message-Id: <1368802520-16378-10-git-send-email-g.liakhovetski@gmx.de> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1368802520-16378-1-git-send-email-g.liakhovetski@gmx.de> References: <1368802520-16378-1-git-send-email-g.liakhovetski@gmx.de> X-Provags-ID: V02:K0:v7blol8W81li+EfxglQ3Y8aB8tCvkcmNLi42NVvHuZi J/sAOTcGDUxmJpsS3Gq5PiDLVyrfrKkx7xkgOqhk9olY3sY1Tb HJewWGm74vnhxq5S28TMC6jQVbbGxmEFhdimPnyEDei1m0zDjk E+1xoEo45KUTXnWoGbu+UbnkNhimJ/jidNyVUwCXEmjL/t4JPK 3Le6rR6OuJdJgHjDilnv02ZgIQ302JyTftkyL4rb6l4Q5YKG5y qDrscWQoYqb8DO1Uv0XTUhZQKYQQopwkpobJkdL5DeZJTWGymK XX/qNKN8bN8gsKB8yge55mfZMpFGeOqcEFJcmmn4nj5LbRZk/i 3e0XgFeWVTacQO+X4j3vbS/xakY9LLBzXY6ZV64ASO0r5iZ236 o4U/4Lj1rwvxQ== Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org Add platform devices for MMCIF and SDHI interfaces, used on APE6EVM, regulators and pinmux data. Signed-off-by: Guennadi Liakhovetski --- arch/arm/mach-shmobile/board-ape6evm.c | 121 ++++++++++++++++++++++++++++++++ 1 files changed, 121 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-shmobile/board-ape6evm.c b/arch/arm/mach-shmobile/board-ape6evm.c index 9c69643..73fb063 100644 --- a/arch/arm/mach-shmobile/board-ape6evm.c +++ b/arch/arm/mach-shmobile/board-ape6evm.c @@ -22,15 +22,21 @@ #include #include #include +#include +#include +#include +#include #include #include #include #include #include #include + #include #include #include + #include #include @@ -65,6 +71,98 @@ static struct platform_device lan9220_device = { }, }; +/* Fixed 3.3V regulator to be used by SDHI0,1, MMCIF0 */ +static struct regulator_consumer_supply fixed3v3_power_consumers[] = { + REGULATOR_SUPPLY("vmmc", "sh_mmcif.0"), + REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"), + REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.1"), +}; + +/* SDHI0 */ +static struct sh_mobile_sdhi_info sdhi0_info = { + .tmio_caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ, + .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE, +}; + +static struct resource sdhi0_resources[] = { + { + .name = "SDHI0", + .start = 0xee100000, + .end = 0xee100100 - 1, + .flags = IORESOURCE_MEM, + }, { + .start = gic_spi(165), + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device sdhi0_device = { + .name = "sh_mobile_sdhi", + .id = 0, + .dev = { + .platform_data = &sdhi0_info, + }, + .num_resources = ARRAY_SIZE(sdhi0_resources), + .resource = sdhi0_resources, +}; + +/* SDHI1 */ +static struct sh_mobile_sdhi_info sdhi1_info = { + .tmio_caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ | MMC_CAP_NEEDS_POLL, + .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE, +}; + +static struct resource sdhi1_resources[] = { + { + .name = "SDHI1", + .start = 0xee120000, + .end = 0xee120100 - 1, + .flags = IORESOURCE_MEM, + }, { + .start = gic_spi(166), + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device sdhi1_device = { + .name = "sh_mobile_sdhi", + .id = 1, + .dev = { + .platform_data = &sdhi1_info, + }, + .num_resources = ARRAY_SIZE(sdhi1_resources), + .resource = sdhi1_resources, +}; + +/* MMCIF0 */ +static struct sh_mmcif_plat_data mmcif0_pdata = { + .caps = MMC_CAP_4_BIT_DATA | + MMC_CAP_8_BIT_DATA | + MMC_CAP_NONREMOVABLE, +}; + +static struct resource mmcif0_resources[] = { + { + .name = "MMCIF0", + .start = 0xee200000, + .end = 0xee200100 - 1, + .flags = IORESOURCE_MEM, + }, { + .start = gic_spi(169), + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device mmcif0_device = { + .name = "sh_mmcif", + .id = 0, + .dev = { + .platform_data = &mmcif0_pdata, + }, + .num_resources = ARRAY_SIZE(mmcif0_resources), + .resource = mmcif0_resources, +}; + static const struct pinctrl_map ape6evm_pinctrl_map[] = { /* SCIFA0 console */ PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.0", "pfc-r8a73a4", @@ -72,6 +170,23 @@ static const struct pinctrl_map ape6evm_pinctrl_map[] = { /* SMSC */ PIN_MAP_MUX_GROUP_DEFAULT("smsc911x", "pfc-r8a73a4", "irqc_irq40", "irqc"), + /* SDHI0: uSD: no WP */ + PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a73a4", + "sdhi0_data4", "sdhi0"), + PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a73a4", + "sdhi0_ctrl", "sdhi0"), + PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a73a4", + "sdhi0_cd", "sdhi0"), + /* SDHI1 */ + PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-r8a73a4", + "sdhi1_data4", "sdhi1"), + PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-r8a73a4", + "sdhi1_ctrl", "sdhi1"), + /* MMCIF0 */ + PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-r8a73a4", + "mmc0_data8", "mmc0"), + PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-r8a73a4", + "mmc0_ctrl", "mmc0"), }; /* @@ -79,6 +194,9 @@ static const struct pinctrl_map ape6evm_pinctrl_map[] = { */ static struct platform_device *ape6evm_devices[] __initdata = { &lan9220_device, + &sdhi0_device, + &sdhi1_device, + &mmcif0_device, }; static void __init ape6evm_add_standard_devices(void) @@ -108,6 +226,9 @@ static void __init ape6evm_add_standard_devices(void) regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); + regulator_register_always_on(1, "fixed-3.3V", fixed3v3_power_consumers, + ARRAY_SIZE(fixed3v3_power_consumers), 3300000); + platform_add_devices(ape6evm_devices, ARRAY_SIZE(ape6evm_devices)); }