mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Alexander Aring <alex.aring@gmail.com>
To: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 1/1] beagle: add missing mmc twl and control init
Date: Thu, 7 Mar 2013 03:06:50 +0100	[thread overview]
Message-ID: <20130307020649.GA945@x61s.8.8.8.8> (raw)
In-Reply-To: <1362613518-15456-1-git-send-email-plagnioj@jcrosoft.com>

Hi,

On Thu, Mar 07, 2013 at 12:45:18AM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> take from xloader
> 
> with this the mmc work even when booting from nand
> 
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> ---
>  arch/arm/boards/beagle/board.c |   29 ++++++++++++++++++++++++++++-
>  1 file changed, 28 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/boards/beagle/board.c b/arch/arm/boards/beagle/board.c
> index bed4651..6e69e87 100644
> --- a/arch/arm/boards/beagle/board.c
> +++ b/arch/arm/boards/beagle/board.c
> @@ -63,6 +63,7 @@
>  #include <linux/err.h>
>  #include <usb/ehci.h>
>  #include <mach/xload.h>
> +#include <mfd/twl4030.h>
>  
>  #ifdef CONFIG_DRIVER_SERIAL_NS16550
>  
> @@ -109,6 +110,32 @@ static struct gpmc_nand_platform_data nand_plat = {
>  	.nand_cfg = &omap3_nand_cfg,
>  };
>  
> +/* T2 Register definitions */
> +#define CONTROL_DEV_CONF0	0x48002274
> +#define CONTROL_PBIAS_LITE	0x48002520
> +
> +static void beagle_add_mmc(void)
> +{
> +	unsigned int value = 0;
> +	struct twl4030 *t = twl4030_get();
> +
> +	if (!t) {
> +		pr_warn("twl4030 not ready to setup mmc\n");
> +	} else {
> +		twl4030_reg_write(t, TWL4030_USB_OTHER_FUNC_CTRL_CLR, 0x20);
> +		twl4030_reg_write(t, TWL4030_USB_OTHER_IFC_CTRL_CLR, 0x2);
> +	}
> +
> +	value = readl(CONTROL_PBIAS_LITE);
> +	value |= (1 << 2) | (1 << 1) | (1 << 9);
> +	writel(value, CONTROL_PBIAS_LITE);
> +
> +	value = readl(CONTROL_DEV_CONF0);
> +	writel(value | (1 << 24), CONTROL_PBIAS_LITE);
> +
> +	omap3_add_mmc1(NULL);
> +}
> +
>  static int beagle_mem_init(void)
>  {
>  	omap_add_ram0(SZ_128M);
> @@ -132,7 +159,7 @@ static int beagle_devices_init(void)
>  #endif
>  	omap_add_gpmc_nand_device(&nand_plat);
>  
> -	omap3_add_mmc1(NULL);
> +	beagle_add_mmc();
>  

I had a similar problem with twl6030 and pcm049 some time ago...

See commit:

659f150e90d8bfcf8aa4c51bd3ab552f42e288f0

Please make sure this will work when you insert a mmc card after
beagle_mem_init call.

In my case, I need to add the VMMC setup at probing time in omap_hsmmc.
The reason is that twl6030 doesn't setup VMMC if a mmc card is not insert.

Maybe twl4030 do the same.

Alex

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2013-03-07  2:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-04 19:37 [PATCH] OMAP3 updates Sascha Hauer
2013-03-04 19:37 ` [PATCH 1/2] ARM: OMAP3: invalidate L2 cache using ROM API Sascha Hauer
2013-03-04 19:37 ` [PATCH 2/2] ARM: OMAP: beagle: Add missing MMC iomux setup Sascha Hauer
2013-03-06 23:45   ` [PATCH 1/1] beagle: add missing mmc twl and control init Jean-Christophe PLAGNIOL-VILLARD
2013-03-07  2:06     ` Alexander Aring [this message]
2013-03-08  7:41     ` Sascha Hauer
2013-03-08 12:21       ` Jean-Christophe PLAGNIOL-VILLARD
2013-03-08 12:45         ` Sascha Hauer
2013-03-08 12:42           ` Jean-Christophe PLAGNIOL-VILLARD
2013-03-08 13:00             ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130307020649.GA945@x61s.8.8.8.8 \
    --to=alex.aring@gmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=plagnioj@jcrosoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox