From patchwork Wed Jul 10 08:13:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 2825547 Return-Path: X-Original-To: patchwork-linux-sh@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 32254C0AB2 for ; Wed, 10 Jul 2013 08:13:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DFCB62011D for ; Wed, 10 Jul 2013 08:13:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8A9AF20119 for ; Wed, 10 Jul 2013 08:13:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752561Ab3GJINT (ORCPT ); Wed, 10 Jul 2013 04:13:19 -0400 Received: from moutng.kundenserver.de ([212.227.126.186]:52742 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752532Ab3GJINR (ORCPT ); Wed, 10 Jul 2013 04:13:17 -0400 Received: from axis700.grange (dslb-178-001-141-087.pools.arcor-ip.net [178.1.141.87]) by mrelayeu.kundenserver.de (node=mreu3) with ESMTP (Nemesis) id 0MG3wg-1V0gsM3ycg-00EtTG; Wed, 10 Jul 2013 10:13:09 +0200 Received: by axis700.grange (Postfix, from userid 1000) id 96A3A40BB4; Wed, 10 Jul 2013 10:13:08 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by axis700.grange (Postfix) with ESMTP id 8CA1B40BB3; Wed, 10 Jul 2013 10:13:08 +0200 (CEST) Date: Wed, 10 Jul 2013 10:13:08 +0200 (CEST) From: Guennadi Liakhovetski X-X-Sender: lyakh@axis700.grange To: linux-sh@vger.kernel.org cc: Simon Horman , Magnus Damm Subject: [PATCH v4 2/7] ARM: shmobile: ape6evm: add MMCIF support Message-ID: MIME-Version: 1.0 X-Provags-ID: V02:K0:ydFndx2Ebl2GvDvuRh2Gmz3ona7/CqwYCPhXeCb00Yg RlSCmcIhEMFXQxfGaxYvPtPlmubva/BkbkGkWD915oHnQ4rvNX nZhGB0UCSYPs2edYII1UAuRzOfFU36KaQ7mkyCeXK8abGCNijT ERhVCbfuV2PD1dRupyDdJOTkk8GWf3ODo9KGItKRNG/VPfp6/b Q5OL6s88HLJXpcbqUtf07WZ/uW25yeVeZAThJYyBtncIf3Fs5R mHhUAtDpSwqPEHXGAYziiTKMnMxYUPi45FR+QXtt8zPSCN8njv gX/e6sEsrRDDzNV2mCRLoR7TDapubxZujZoFJIf4Bhj/iv3Xh/ 3YK6ebmIdz89/CBbwjDB4piZrl7fYK+Yjzo2pQuiW+I+pX+3uB RYXsNqdGwOy4Q== Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 Add MMCIF support to the APE6EVM board in PIO mode only. Power supply is fixed for now, eventually support for the tps80032 regulator, also supplying both VDD and VccQ to the MMCIF slot should be added to APE6EVM. Signed-off-by: Guennadi Liakhovetski Acked-by: Magnus Damm --- v4: dropped DMA support Hi Simon, this patch is again for the APE6EVM state before the "ARM: shmobile: ape6evm: add SDHI interfaces" patch. As discussed with you, you prefer to regenerate your tree with this patch applied first, and the "SDHI" one on top, to fix the regulator issue, that emerged due to the reversed commit order. After this patch applied, the original SDHI patch version should be used. Thanks Guennadi arch/arm/mach-shmobile/board-ape6evm.c | 31 +++++++++++++++++++++++++++++++ 1 files changed, 31 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-shmobile/board-ape6evm.c b/arch/arm/mach-shmobile/board-ape6evm.c index af6dd39..8c7529c 100644 --- a/arch/arm/mach-shmobile/board-ape6evm.c +++ b/arch/arm/mach-shmobile/board-ape6evm.c @@ -21,6 +21,8 @@ #include #include #include +#include +#include #include #include #include @@ -54,6 +56,25 @@ static const struct smsc911x_platform_config lan9220_data = { .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_HIGH, }; +/* + * On APE6EVM power is supplied to MMCIF by a tps80032 regulator. For now we + * model a VDD supply to MMCIF, using a fixed 3.3V regulator. + */ +static struct regulator_consumer_supply fixed3v3_power_consumers[] = +{ + REGULATOR_SUPPLY("vmmc", "sh_mmcif.0"), +}; + +/* MMCIF */ +static struct sh_mmcif_plat_data mmcif0_pdata = { + .caps = MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE, +}; + +static struct resource mmcif0_resources[] = { + DEFINE_RES_MEM_NAMED(0xee200000, 0x100, "MMCIF0"), + DEFINE_RES_IRQ(gic_spi(169)), +}; + static const struct pinctrl_map ape6evm_pinctrl_map[] = { /* SCIFA0 console */ PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.0", "pfc-r8a73a4", @@ -61,6 +82,11 @@ static const struct pinctrl_map ape6evm_pinctrl_map[] = { /* SMSC */ PIN_MAP_MUX_GROUP_DEFAULT("smsc911x", "pfc-r8a73a4", "irqc_irq40", "irqc"), + /* 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"), }; static void __init ape6evm_add_standard_devices(void) @@ -93,6 +119,11 @@ static void __init ape6evm_add_standard_devices(void) platform_device_register_resndata(&platform_bus, "smsc911x", -1, lan9220_res, ARRAY_SIZE(lan9220_res), &lan9220_data, sizeof(lan9220_data)); + regulator_register_always_on(1, "fixed-3.3V", fixed3v3_power_consumers, + ARRAY_SIZE(fixed3v3_power_consumers), 3300000); + platform_device_register_resndata(&platform_bus, "sh_mmcif", 0, + mmcif0_resources, ARRAY_SIZE(mmcif0_resources), + &mmcif0_pdata, sizeof(mmcif0_pdata)); } static const char *ape6evm_boards_compat_dt[] __initdata = {