From patchwork Mon Dec 6 00:12:45 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 376862 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oB60EWNJ006802 for ; Mon, 6 Dec 2010 00:16:28 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752279Ab0LFAQ2 (ORCPT ); Sun, 5 Dec 2010 19:16:28 -0500 Received: from kirsty.vergenet.net ([202.4.237.240]:59029 "EHLO kirsty.vergenet.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752269Ab0LFAQ1 (ORCPT ); Sun, 5 Dec 2010 19:16:27 -0500 Received: from ayumi.akashicho.tokyo.vergenet.net (219-109-213-121.bitcat.net [219.109.213.121]) by kirsty.vergenet.net (Postfix) with ESMTP id BE55A24062; Mon, 6 Dec 2010 11:16:24 +1100 (EST) Received: by ayumi.akashicho.tokyo.vergenet.net (Postfix, from userid 7100) id 31F8CEDE0D0; Mon, 6 Dec 2010 09:16:24 +0900 (JST) Message-Id: <20101206001310.744889412@vergenet.net> User-Agent: quilt/0.48-1 Date: Mon, 06 Dec 2010 09:12:45 +0900 From: Simon Horman To: linux-mmc@vger.kernel.org, linux-sh@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Russell King - ARM Linux , Chris Ball , Yusuke Goda , Kuninori Morimoto , Magnus Damm , Paul Mundt Subject: [patch 2/3] mmc, sh: Remove sh_mmcif_boot_slurp() References: <20101206001243.949375995@vergenet.net> Content-Disposition: inline; filename=no-slurp.patch Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Mon, 06 Dec 2010 00:16:28 +0000 (UTC) Index: linux-2.6-ap4/arch/sh/boot/romimage/mmcif-sh7724.c =================================================================== --- linux-2.6-ap4.orig/arch/sh/boot/romimage/mmcif-sh7724.c 2010-12-06 09:08:13.000000000 +0900 +++ linux-2.6-ap4/arch/sh/boot/romimage/mmcif-sh7724.c 2010-12-06 09:08:14.000000000 +0900 @@ -60,7 +60,9 @@ asmlinkage void mmcif_loader(unsigned ch mmcif_update_progress(MMCIF_PROGRESS_LOAD); /* load kernel via MMCIF interface */ - sh_mmcif_boot_slurp(MMCIF_BASE, buf, no_bytes); + sh_mmcif_boot_do_read(MMCIF_BASE, 512, + (no_bytes + SH_MMCIF_BBS - 1) / SH_MMCIF_BBS, + buf); /* disable clock to the MMCIF hardware block */ __raw_writel(__raw_readl(MSTPCR2) | 0x20000000, MSTPCR2); Index: linux-2.6-ap4/include/linux/mmc/sh_mmcif.h =================================================================== --- linux-2.6-ap4.orig/include/linux/mmc/sh_mmcif.h 2010-12-06 09:08:13.000000000 +0900 +++ linux-2.6-ap4/include/linux/mmc/sh_mmcif.h 2010-12-06 09:08:14.000000000 +0900 @@ -162,6 +162,17 @@ static inline int sh_mmcif_boot_do_read( unsigned long k; int ret = 0; + /* In data transfer mode: Set clock to Bus clock/4 (about 20Mhz) */ + sh_mmcif_writel(base, MMCIF_CE_CLK_CTRL, + CLK_ENABLE | CLKDIV_4 | SRSPTO_256 | + SRBSYTO_29 | SRWDTO_29 | SCCSTO_29); + + /* CMD9 - Get CSD */ + sh_mmcif_boot_cmd(base, 0x09806000, 0x00010000); + + /* CMD7 - Select the card */ + sh_mmcif_boot_cmd(base, 0x07400000, 0x00010000); + /* CMD16 - Set the block size */ sh_mmcif_boot_cmd(base, 0x10400000, SH_MMCIF_BBS); @@ -205,27 +216,4 @@ static inline void sh_mmcif_boot_init(vo sh_mmcif_boot_cmd(base, 0x03400040, 0x00010000); } -static inline void sh_mmcif_boot_slurp(void __iomem *base, - unsigned char *buf, - unsigned long no_bytes) -{ - unsigned long tmp; - - /* In data transfer mode: Set clock to Bus clock/4 (about 20Mhz) */ - sh_mmcif_writel(base, MMCIF_CE_CLK_CTRL, - CLK_ENABLE | CLKDIV_4 | SRSPTO_256 | - SRBSYTO_29 | SRWDTO_29 | SCCSTO_29); - - /* CMD9 - Get CSD */ - sh_mmcif_boot_cmd(base, 0x09806000, 0x00010000); - - /* CMD7 - Select the card */ - sh_mmcif_boot_cmd(base, 0x07400000, 0x00010000); - - tmp = no_bytes / SH_MMCIF_BBS; - tmp += (no_bytes % SH_MMCIF_BBS) ? 1 : 0; - - sh_mmcif_boot_do_read(base, 512, tmp, buf); -} - #endif /* __SH_MMCIF_H__ */