Re: [U-Boot] [PATCH V5 REPOST 6/7] mmc: add bcm2835 driver

2013-03-20 Thread Albert ARIBAUD
Hi Albert,

On Sat, 16 Mar 2013 09:09:53 +0100, Albert ARIBAUD
albert.u.b...@aribaud.net wrote:

 Hi Stephen,
 
 On Fri, 15 Mar 2013 16:51:00 -0600, Stephen Warren
 swar...@wwwdotorg.org wrote:
 
  On 03/11/2013 12:35 AM, Albert ARIBAUD wrote:
   Hi Stephen,
   
   On Sat, 09 Mar 2013 23:34:21 -0700, Stephen Warren
   swar...@wwwdotorg.org wrote:
   
   On 02/03/2013 04:27 AM, Albert ARIBAUD wrote:
   On Tue, 15 Jan 2013 19:26:58 -0700, Stephen Warren 
   swar...@wwwdotorg.org wrote:
  
   This adds a simple driver for the BCM2835's SD controller.
  ...
   Are you OK pulling this series out of patchwork to be applied, or should
   I repost? Thanks.
   
   I'll apply the series from patchwork to u-boot-arm/master, adding
   Andy's Ack manually in 6/7. If these apply cleanly, then all right.
  
  I know it's only been a few days, but I haven't seen these show up in
  your tree yet. Did they not apply OK from patchwork? Let me know if I
  need to rebase/repost. Thanks.
 
 I've had a few PRs to apply before this, and as soon as the current
 merge conflict with mainline is solved, I'll apply the series.
 
 Amicalement,

Pulled in locally, added Andy's Acked-by: to 6/7, build-testing.

Amicalement,
-- 
Albert.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V5 REPOST 6/7] mmc: add bcm2835 driver

2013-03-20 Thread Albert ARIBAUD
Hi Stephen,

On Tue, 15 Jan 2013 19:26:58 -0700, Stephen Warren
swar...@wwwdotorg.org wrote:

 This adds a simple driver for the BCM2835's SD controller.
 
 Workarounds are implemented for:
 * Register writes can't be too close to each-other in time, or they will
   be lost.
 * Register accesses must all be 32-bit, so implement custom accessors.
 
 This code was extracted from:
 git://github.com/gonzoua/u-boot-pi.git master
 which was created by Oleksandr Tymoshenko.
 
 Portions of the code there were obviously based on the Linux kernel at:
 git://github.com/raspberrypi/linux.git rpi-3.6.y
 commit f5b930b Main bcm2708 linux port signed-off-by Dom Cobley.
 
 swarren changed the following for upstream:
 * Removed hack udelay()s in bcm2835_sdhci_raw_writel(); setting
   SDHCI_QUIRK_WAIT_SEND_CMD appears to solve the issues.
 * Remove register logging from read*/write* functions.
 * Sort out confusion with min/max_freq values passed to add_sdhci().
 * Use more descriptive variable names and calculations in IO accessors.
 * Simplified and commented twoticks_delay calculation.
 * checkpatch fixes.
 
 Cc: Andy Fleming aflem...@gmail.com
 Signed-off-by: Oleksandr Tymoshenko go...@bluezbox.com
 Signed-off-by: Stephen Warren swar...@wwwdotorg.org
 ---
 Andy, could you please ack this so Albert can take it through the ARM tree;
 patch 7/7 depends is an ARM patch and depends on this. Thanks.
 
 v5: Invent struct bcm2835_sdhci_host to avoid static/global variables.
 v4:
 * Merged with video patch series due to dependencies in rpi_b.h.
 * Rebased onto latest u-boot-arm/master; no real changes.
 v3: No such version was posted.
 v2:
 * Use more descriptive variable names and calculations in IO accessors.
 * Add Oleksandr's S-o-b.
 * Rewrite commit description to note that the Linux code this was derived
   from was S-o-b Dom Cobley.
 ---
  arch/arm/include/asm/arch-bcm2835/sdhci.h |   24 
  drivers/mmc/Makefile  |1 +
  drivers/mmc/bcm2835_sdhci.c   |  189 
 +
  3 files changed, 214 insertions(+)
  create mode 100644 arch/arm/include/asm/arch-bcm2835/sdhci.h
  create mode 100644 drivers/mmc/bcm2835_sdhci.c
 
 diff --git a/arch/arm/include/asm/arch-bcm2835/sdhci.h 
 b/arch/arm/include/asm/arch-bcm2835/sdhci.h
 new file mode 100644
 index 000..a4f867b
 --- /dev/null
 +++ b/arch/arm/include/asm/arch-bcm2835/sdhci.h
 @@ -0,0 +1,24 @@
 +/*
 + * (C) Copyright 2012 Stephen Warren
 + *
 + * See file CREDITS for list of people who contributed to this
 + * project.
 + *
 + * This program is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU General Public License
 + * version 2 as published by the Free Software Foundation.
 + *
 + * This program is distributed in the hope that it will be useful, but
 + * WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 + * GNU General Public License for more details.
 + */
 +
 +#ifndef _BCM2835_SDHCI_H_
 +#define _BCM2835_SDHCI_H_
 +
 +#define BCM2835_SDHCI_BASE 0x2030
 +
 +int bcm2835_sdhci_init(u32 regbase, u32 emmc_freq);
 +
 +#endif
 diff --git a/drivers/mmc/Makefile b/drivers/mmc/Makefile
 index 65791aa..1d6faa2 100644
 --- a/drivers/mmc/Makefile
 +++ b/drivers/mmc/Makefile
 @@ -43,6 +43,7 @@ COBJS-$(CONFIG_MXS_MMC) += mxsmmc.o
  COBJS-$(CONFIG_OMAP_HSMMC) += omap_hsmmc.o
  COBJS-$(CONFIG_PXA_MMC_GENERIC) += pxa_mmc_gen.o
  COBJS-$(CONFIG_SDHCI) += sdhci.o
 +COBJS-$(CONFIG_BCM2835_SDHCI) += bcm2835_sdhci.o
  COBJS-$(CONFIG_S5P_SDHCI) += s5p_sdhci.o
  COBJS-$(CONFIG_SH_MMCIF) += sh_mmcif.o
  COBJS-$(CONFIG_TEGRA_MMC) += tegra_mmc.o
 diff --git a/drivers/mmc/bcm2835_sdhci.c b/drivers/mmc/bcm2835_sdhci.c
 new file mode 100644
 index 000..b0afc3c
 --- /dev/null
 +++ b/drivers/mmc/bcm2835_sdhci.c
 @@ -0,0 +1,189 @@
 +/*
 + * This code was extracted from:
 + * git://github.com/gonzoua/u-boot-pi.git master
 + * and hence presumably (C) 2012 Oleksandr Tymoshenko
 + *
 + * Tweaks for U-Boot upstreaming
 + * (C) 2012 Stephen Warren
 + *
 + * Portions (e.g. read/write macros, concepts for back-to-back register write
 + * timing workarounds) obviously extracted from the Linux kernel at:
 + * https://github.com/raspberrypi/linux.git rpi-3.6.y
 + *
 + * The Linux kernel code has the following (c) and license, which is hence
 + * propagated to Oleksandr's tree and here:
 + *
 + * Support for SDHCI device on 2835
 + * Based on sdhci-bcm2708.c (c) 2010 Broadcom
 + *
 + * This program is free software; you can redistribute it and/or modify
 + * it under the terms of the GNU General Public License version 2 as
 + * published by the Free Software Foundation.
 + *
 + * This program is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 + * GNU General Public License for more details.
 + *
 + * 

Re: [U-Boot] [PATCH V5 REPOST 6/7] mmc: add bcm2835 driver

2013-03-16 Thread Albert ARIBAUD
Hi Stephen,

On Fri, 15 Mar 2013 16:51:00 -0600, Stephen Warren
swar...@wwwdotorg.org wrote:

 On 03/11/2013 12:35 AM, Albert ARIBAUD wrote:
  Hi Stephen,
  
  On Sat, 09 Mar 2013 23:34:21 -0700, Stephen Warren
  swar...@wwwdotorg.org wrote:
  
  On 02/03/2013 04:27 AM, Albert ARIBAUD wrote:
  On Tue, 15 Jan 2013 19:26:58 -0700, Stephen Warren 
  swar...@wwwdotorg.org wrote:
 
  This adds a simple driver for the BCM2835's SD controller.
 ...
  Are you OK pulling this series out of patchwork to be applied, or should
  I repost? Thanks.
  
  I'll apply the series from patchwork to u-boot-arm/master, adding
  Andy's Ack manually in 6/7. If these apply cleanly, then all right.
 
 I know it's only been a few days, but I haven't seen these show up in
 your tree yet. Did they not apply OK from patchwork? Let me know if I
 need to rebase/repost. Thanks.

I've had a few PRs to apply before this, and as soon as the current
merge conflict with mainline is solved, I'll apply the series.

Amicalement,
-- 
Albert.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V5 REPOST 6/7] mmc: add bcm2835 driver

2013-03-15 Thread Stephen Warren
On 03/11/2013 12:35 AM, Albert ARIBAUD wrote:
 Hi Stephen,
 
 On Sat, 09 Mar 2013 23:34:21 -0700, Stephen Warren
 swar...@wwwdotorg.org wrote:
 
 On 02/03/2013 04:27 AM, Albert ARIBAUD wrote:
 On Tue, 15 Jan 2013 19:26:58 -0700, Stephen Warren swar...@wwwdotorg.org 
 wrote:

 This adds a simple driver for the BCM2835's SD controller.
...
 Are you OK pulling this series out of patchwork to be applied, or should
 I repost? Thanks.
 
 I'll apply the series from patchwork to u-boot-arm/master, adding
 Andy's Ack manually in 6/7. If these apply cleanly, then all right.

I know it's only been a few days, but I haven't seen these show up in
your tree yet. Did they not apply OK from patchwork? Let me know if I
need to rebase/repost. Thanks.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V5 REPOST 6/7] mmc: add bcm2835 driver

2013-03-11 Thread Albert ARIBAUD
Hi Stephen,

On Sat, 09 Mar 2013 23:34:21 -0700, Stephen Warren
swar...@wwwdotorg.org wrote:

 On 02/03/2013 04:27 AM, Albert ARIBAUD wrote:
  On Tue, 15 Jan 2013 19:26:58 -0700, Stephen Warren swar...@wwwdotorg.org 
  wrote:
  
  This adds a simple driver for the BCM2835's SD controller.
 
  Workarounds are implemented for:
  * Register writes can't be too close to each-other in time, or they will
be lost.
  * Register accesses must all be 32-bit, so implement custom accessors.
 
  This code was extracted from:
  git://github.com/gonzoua/u-boot-pi.git master
  which was created by Oleksandr Tymoshenko.
 
  Portions of the code there were obviously based on the Linux kernel at:
  git://github.com/raspberrypi/linux.git rpi-3.6.y
  commit f5b930b Main bcm2708 linux port signed-off-by Dom Cobley.
 
  swarren changed the following for upstream:
  * Removed hack udelay()s in bcm2835_sdhci_raw_writel(); setting
SDHCI_QUIRK_WAIT_SEND_CMD appears to solve the issues.
  * Remove register logging from read*/write* functions.
  * Sort out confusion with min/max_freq values passed to add_sdhci().
  * Use more descriptive variable names and calculations in IO accessors.
  * Simplified and commented twoticks_delay calculation.
  * checkpatch fixes.
 
  Cc: Andy Fleming aflem...@gmail.com
  Signed-off-by: Oleksandr Tymoshenko go...@bluezbox.com
  Signed-off-by: Stephen Warren swar...@wwwdotorg.org
  ---
  Andy, could you please ack this so Albert can take it through the ARM tree;
  patch 7/7 depends is an ARM patch and depends on this. Thanks.
 ...
  Andy, can you give a formal Acked-By to this patch as per Stephen's
  request?
  
  Thanks in advance!
 
 Albert, it looks like Andy actually did already Ack this, back in
 November last year; see:
 
 http://lists.denx.de/pipermail/u-boot/2012-November/141064.html
 
 Note that when I reposted V5 in January, I merged the ARM/mailbox/video
 patches and MMC series together, hence the different patch numbers.
 
 Are you OK pulling this series out of patchwork to be applied, or should
 I repost? Thanks.

I'll apply the series from patchwork to u-boot-arm/master, adding
Andy's Ack manually in 6/7. If these apply cleanly, then all right.

Amicalement,
-- 
Albert.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V5 REPOST 6/7] mmc: add bcm2835 driver

2013-03-09 Thread Stephen Warren
On 02/03/2013 04:27 AM, Albert ARIBAUD wrote:
 On Tue, 15 Jan 2013 19:26:58 -0700, Stephen Warren swar...@wwwdotorg.org 
 wrote:
 
 This adds a simple driver for the BCM2835's SD controller.

 Workarounds are implemented for:
 * Register writes can't be too close to each-other in time, or they will
   be lost.
 * Register accesses must all be 32-bit, so implement custom accessors.

 This code was extracted from:
 git://github.com/gonzoua/u-boot-pi.git master
 which was created by Oleksandr Tymoshenko.

 Portions of the code there were obviously based on the Linux kernel at:
 git://github.com/raspberrypi/linux.git rpi-3.6.y
 commit f5b930b Main bcm2708 linux port signed-off-by Dom Cobley.

 swarren changed the following for upstream:
 * Removed hack udelay()s in bcm2835_sdhci_raw_writel(); setting
   SDHCI_QUIRK_WAIT_SEND_CMD appears to solve the issues.
 * Remove register logging from read*/write* functions.
 * Sort out confusion with min/max_freq values passed to add_sdhci().
 * Use more descriptive variable names and calculations in IO accessors.
 * Simplified and commented twoticks_delay calculation.
 * checkpatch fixes.

 Cc: Andy Fleming aflem...@gmail.com
 Signed-off-by: Oleksandr Tymoshenko go...@bluezbox.com
 Signed-off-by: Stephen Warren swar...@wwwdotorg.org
 ---
 Andy, could you please ack this so Albert can take it through the ARM tree;
 patch 7/7 depends is an ARM patch and depends on this. Thanks.
...
 Andy, can you give a formal Acked-By to this patch as per Stephen's
 request?
 
 Thanks in advance!

Albert, it looks like Andy actually did already Ack this, back in
November last year; see:

http://lists.denx.de/pipermail/u-boot/2012-November/141064.html

Note that when I reposted V5 in January, I merged the ARM/mailbox/video
patches and MMC series together, hence the different patch numbers.

Are you OK pulling this series out of patchwork to be applied, or should
I repost? Thanks.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V5 REPOST 6/7] mmc: add bcm2835 driver

2013-02-14 Thread Stephen Warren
On 02/03/2013 04:27 AM, Albert ARIBAUD wrote:
 On Tue, 15 Jan 2013 19:26:58 -0700, Stephen Warren
 swar...@wwwdotorg.org wrote:
 
 This adds a simple driver for the BCM2835's SD controller.

 Workarounds are implemented for:
 * Register writes can't be too close to each-other in time, or they will
   be lost.
 * Register accesses must all be 32-bit, so implement custom accessors.

 This code was extracted from:
 git://github.com/gonzoua/u-boot-pi.git master
 which was created by Oleksandr Tymoshenko.

 Portions of the code there were obviously based on the Linux kernel at:
 git://github.com/raspberrypi/linux.git rpi-3.6.y
 commit f5b930b Main bcm2708 linux port signed-off-by Dom Cobley.

 swarren changed the following for upstream:
 * Removed hack udelay()s in bcm2835_sdhci_raw_writel(); setting
   SDHCI_QUIRK_WAIT_SEND_CMD appears to solve the issues.
 * Remove register logging from read*/write* functions.
 * Sort out confusion with min/max_freq values passed to add_sdhci().
 * Use more descriptive variable names and calculations in IO accessors.
 * Simplified and commented twoticks_delay calculation.
 * checkpatch fixes.

 Cc: Andy Fleming aflem...@gmail.com
 Signed-off-by: Oleksandr Tymoshenko go...@bluezbox.com
 Signed-off-by: Stephen Warren swar...@wwwdotorg.org
 ---
 Andy, could you please ack this so Albert can take it through the ARM tree;
 patch 7/7 depends is an ARM patch and depends on this. Thanks.
...
 Andy, can you give a formal Acked-By to this patch as per Stephen's
 request?

Albert, perhaps you could apply patches 1-5 without waiting on this; the
MMC driver could be added once Andy ack's it.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V5 REPOST 6/7] mmc: add bcm2835 driver

2013-02-03 Thread Albert ARIBAUD
On Tue, 15 Jan 2013 19:26:58 -0700, Stephen Warren
swar...@wwwdotorg.org wrote:

 This adds a simple driver for the BCM2835's SD controller.
 
 Workarounds are implemented for:
 * Register writes can't be too close to each-other in time, or they will
   be lost.
 * Register accesses must all be 32-bit, so implement custom accessors.
 
 This code was extracted from:
 git://github.com/gonzoua/u-boot-pi.git master
 which was created by Oleksandr Tymoshenko.
 
 Portions of the code there were obviously based on the Linux kernel at:
 git://github.com/raspberrypi/linux.git rpi-3.6.y
 commit f5b930b Main bcm2708 linux port signed-off-by Dom Cobley.
 
 swarren changed the following for upstream:
 * Removed hack udelay()s in bcm2835_sdhci_raw_writel(); setting
   SDHCI_QUIRK_WAIT_SEND_CMD appears to solve the issues.
 * Remove register logging from read*/write* functions.
 * Sort out confusion with min/max_freq values passed to add_sdhci().
 * Use more descriptive variable names and calculations in IO accessors.
 * Simplified and commented twoticks_delay calculation.
 * checkpatch fixes.
 
 Cc: Andy Fleming aflem...@gmail.com
 Signed-off-by: Oleksandr Tymoshenko go...@bluezbox.com
 Signed-off-by: Stephen Warren swar...@wwwdotorg.org
 ---
 Andy, could you please ack this so Albert can take it through the ARM tree;
 patch 7/7 depends is an ARM patch and depends on this. Thanks.
 
 v5: Invent struct bcm2835_sdhci_host to avoid static/global variables.
 v4:
 * Merged with video patch series due to dependencies in rpi_b.h.
 * Rebased onto latest u-boot-arm/master; no real changes.
 v3: No such version was posted.
 v2:
 * Use more descriptive variable names and calculations in IO accessors.
 * Add Oleksandr's S-o-b.
 * Rewrite commit description to note that the Linux code this was derived
   from was S-o-b Dom Cobley.
 ---
  arch/arm/include/asm/arch-bcm2835/sdhci.h |   24 
  drivers/mmc/Makefile  |1 +
  drivers/mmc/bcm2835_sdhci.c   |  189 
 +
  3 files changed, 214 insertions(+)
  create mode 100644 arch/arm/include/asm/arch-bcm2835/sdhci.h
  create mode 100644 drivers/mmc/bcm2835_sdhci.c
 
 diff --git a/arch/arm/include/asm/arch-bcm2835/sdhci.h 
 b/arch/arm/include/asm/arch-bcm2835/sdhci.h
 new file mode 100644
 index 000..a4f867b
 --- /dev/null
 +++ b/arch/arm/include/asm/arch-bcm2835/sdhci.h
 @@ -0,0 +1,24 @@
 +/*
 + * (C) Copyright 2012 Stephen Warren
 + *
 + * See file CREDITS for list of people who contributed to this
 + * project.
 + *
 + * This program is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU General Public License
 + * version 2 as published by the Free Software Foundation.
 + *
 + * This program is distributed in the hope that it will be useful, but
 + * WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 + * GNU General Public License for more details.
 + */
 +
 +#ifndef _BCM2835_SDHCI_H_
 +#define _BCM2835_SDHCI_H_
 +
 +#define BCM2835_SDHCI_BASE 0x2030
 +
 +int bcm2835_sdhci_init(u32 regbase, u32 emmc_freq);
 +
 +#endif
 diff --git a/drivers/mmc/Makefile b/drivers/mmc/Makefile
 index 65791aa..1d6faa2 100644
 --- a/drivers/mmc/Makefile
 +++ b/drivers/mmc/Makefile
 @@ -43,6 +43,7 @@ COBJS-$(CONFIG_MXS_MMC) += mxsmmc.o
  COBJS-$(CONFIG_OMAP_HSMMC) += omap_hsmmc.o
  COBJS-$(CONFIG_PXA_MMC_GENERIC) += pxa_mmc_gen.o
  COBJS-$(CONFIG_SDHCI) += sdhci.o
 +COBJS-$(CONFIG_BCM2835_SDHCI) += bcm2835_sdhci.o
  COBJS-$(CONFIG_S5P_SDHCI) += s5p_sdhci.o
  COBJS-$(CONFIG_SH_MMCIF) += sh_mmcif.o
  COBJS-$(CONFIG_TEGRA_MMC) += tegra_mmc.o
 diff --git a/drivers/mmc/bcm2835_sdhci.c b/drivers/mmc/bcm2835_sdhci.c
 new file mode 100644
 index 000..b0afc3c
 --- /dev/null
 +++ b/drivers/mmc/bcm2835_sdhci.c
 @@ -0,0 +1,189 @@
 +/*
 + * This code was extracted from:
 + * git://github.com/gonzoua/u-boot-pi.git master
 + * and hence presumably (C) 2012 Oleksandr Tymoshenko
 + *
 + * Tweaks for U-Boot upstreaming
 + * (C) 2012 Stephen Warren
 + *
 + * Portions (e.g. read/write macros, concepts for back-to-back register write
 + * timing workarounds) obviously extracted from the Linux kernel at:
 + * https://github.com/raspberrypi/linux.git rpi-3.6.y
 + *
 + * The Linux kernel code has the following (c) and license, which is hence
 + * propagated to Oleksandr's tree and here:
 + *
 + * Support for SDHCI device on 2835
 + * Based on sdhci-bcm2708.c (c) 2010 Broadcom
 + *
 + * This program is free software; you can redistribute it and/or modify
 + * it under the terms of the GNU General Public License version 2 as
 + * published by the Free Software Foundation.
 + *
 + * This program is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 + * GNU General Public License for more details.
 + *
 + * You should 

[U-Boot] [PATCH V5 REPOST 6/7] mmc: add bcm2835 driver

2013-01-15 Thread Stephen Warren
This adds a simple driver for the BCM2835's SD controller.

Workarounds are implemented for:
* Register writes can't be too close to each-other in time, or they will
  be lost.
* Register accesses must all be 32-bit, so implement custom accessors.

This code was extracted from:
git://github.com/gonzoua/u-boot-pi.git master
which was created by Oleksandr Tymoshenko.

Portions of the code there were obviously based on the Linux kernel at:
git://github.com/raspberrypi/linux.git rpi-3.6.y
commit f5b930b Main bcm2708 linux port signed-off-by Dom Cobley.

swarren changed the following for upstream:
* Removed hack udelay()s in bcm2835_sdhci_raw_writel(); setting
  SDHCI_QUIRK_WAIT_SEND_CMD appears to solve the issues.
* Remove register logging from read*/write* functions.
* Sort out confusion with min/max_freq values passed to add_sdhci().
* Use more descriptive variable names and calculations in IO accessors.
* Simplified and commented twoticks_delay calculation.
* checkpatch fixes.

Cc: Andy Fleming aflem...@gmail.com
Signed-off-by: Oleksandr Tymoshenko go...@bluezbox.com
Signed-off-by: Stephen Warren swar...@wwwdotorg.org
---
Andy, could you please ack this so Albert can take it through the ARM tree;
patch 7/7 depends is an ARM patch and depends on this. Thanks.

v5: Invent struct bcm2835_sdhci_host to avoid static/global variables.
v4:
* Merged with video patch series due to dependencies in rpi_b.h.
* Rebased onto latest u-boot-arm/master; no real changes.
v3: No such version was posted.
v2:
* Use more descriptive variable names and calculations in IO accessors.
* Add Oleksandr's S-o-b.
* Rewrite commit description to note that the Linux code this was derived
  from was S-o-b Dom Cobley.
---
 arch/arm/include/asm/arch-bcm2835/sdhci.h |   24 
 drivers/mmc/Makefile  |1 +
 drivers/mmc/bcm2835_sdhci.c   |  189 +
 3 files changed, 214 insertions(+)
 create mode 100644 arch/arm/include/asm/arch-bcm2835/sdhci.h
 create mode 100644 drivers/mmc/bcm2835_sdhci.c

diff --git a/arch/arm/include/asm/arch-bcm2835/sdhci.h 
b/arch/arm/include/asm/arch-bcm2835/sdhci.h
new file mode 100644
index 000..a4f867b
--- /dev/null
+++ b/arch/arm/include/asm/arch-bcm2835/sdhci.h
@@ -0,0 +1,24 @@
+/*
+ * (C) Copyright 2012 Stephen Warren
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef _BCM2835_SDHCI_H_
+#define _BCM2835_SDHCI_H_
+
+#define BCM2835_SDHCI_BASE 0x2030
+
+int bcm2835_sdhci_init(u32 regbase, u32 emmc_freq);
+
+#endif
diff --git a/drivers/mmc/Makefile b/drivers/mmc/Makefile
index 65791aa..1d6faa2 100644
--- a/drivers/mmc/Makefile
+++ b/drivers/mmc/Makefile
@@ -43,6 +43,7 @@ COBJS-$(CONFIG_MXS_MMC) += mxsmmc.o
 COBJS-$(CONFIG_OMAP_HSMMC) += omap_hsmmc.o
 COBJS-$(CONFIG_PXA_MMC_GENERIC) += pxa_mmc_gen.o
 COBJS-$(CONFIG_SDHCI) += sdhci.o
+COBJS-$(CONFIG_BCM2835_SDHCI) += bcm2835_sdhci.o
 COBJS-$(CONFIG_S5P_SDHCI) += s5p_sdhci.o
 COBJS-$(CONFIG_SH_MMCIF) += sh_mmcif.o
 COBJS-$(CONFIG_TEGRA_MMC) += tegra_mmc.o
diff --git a/drivers/mmc/bcm2835_sdhci.c b/drivers/mmc/bcm2835_sdhci.c
new file mode 100644
index 000..b0afc3c
--- /dev/null
+++ b/drivers/mmc/bcm2835_sdhci.c
@@ -0,0 +1,189 @@
+/*
+ * This code was extracted from:
+ * git://github.com/gonzoua/u-boot-pi.git master
+ * and hence presumably (C) 2012 Oleksandr Tymoshenko
+ *
+ * Tweaks for U-Boot upstreaming
+ * (C) 2012 Stephen Warren
+ *
+ * Portions (e.g. read/write macros, concepts for back-to-back register write
+ * timing workarounds) obviously extracted from the Linux kernel at:
+ * https://github.com/raspberrypi/linux.git rpi-3.6.y
+ *
+ * The Linux kernel code has the following (c) and license, which is hence
+ * propagated to Oleksandr's tree and here:
+ *
+ * Support for SDHCI device on 2835
+ * Based on sdhci-bcm2708.c (c) 2010 Broadcom
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/* Supports:
+ *