public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marek.vasut@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] FSL_ESDHC: Make the base address configurable at runtime
Date: Sun, 14 Nov 2010 17:35:30 +0100	[thread overview]
Message-ID: <201011141735.30504.marek.vasut@gmail.com> (raw)
In-Reply-To: <1289750462-6119-1-git-send-email-marek.vasut@gmail.com>

On Sunday 14 November 2010 17:01:02 Marek Vasut wrote:
> This allows -after reimplementation of board_mmc_init() function- to set up
> the base address of the eSDHC controller at runtime. This is useful on
> iMX515 board I have, where there are two controllers and on different
> revisions of the board, only one of them is used. The board revision can
> be detected on runtime.

Just discussed this with Stefano, I guess this one will be a no-go, nevermind.
> 
> Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
> ---
>  arch/arm/cpu/armv7/mx5/soc.c              |    2 +-
>  arch/powerpc/cpu/mpc83xx/cpu.c            |    2 +-
>  arch/powerpc/cpu/mpc85xx/cpu.c            |    2 +-
>  board/freescale/mpc837xemds/mpc837xemds.c |    2 +-
>  board/freescale/mpc837xerdb/mpc837xerdb.c |    2 +-
>  board/freescale/mpc8569mds/mpc8569mds.c   |    2 +-
>  drivers/mmc/fsl_esdhc.c                   |    4 ++--
>  include/fsl_esdhc.h                       |    4 ++--
>  8 files changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/arch/arm/cpu/armv7/mx5/soc.c b/arch/arm/cpu/armv7/mx5/soc.c
> index 7c7a565..4a73491 100644
> --- a/arch/arm/cpu/armv7/mx5/soc.c
> +++ b/arch/arm/cpu/armv7/mx5/soc.c
> @@ -107,7 +107,7 @@ int cpu_eth_init(bd_t *bis)
>  int cpu_mmc_init(bd_t *bis)
>  {
>  #ifdef CONFIG_FSL_ESDHC
> -	return fsl_esdhc_mmc_init(bis);
> +	return fsl_esdhc_mmc_init(bis, CONFIG_SYS_FSL_ESDHC_ADDR);
>  #else
>  	return 0;
>  #endif
> diff --git a/arch/powerpc/cpu/mpc83xx/cpu.c
> b/arch/powerpc/cpu/mpc83xx/cpu.c index 6635109..4739edd 100644
> --- a/arch/powerpc/cpu/mpc83xx/cpu.c
> +++ b/arch/powerpc/cpu/mpc83xx/cpu.c
> @@ -234,7 +234,7 @@ int cpu_eth_init(bd_t *bis)
>  int cpu_mmc_init(bd_t *bis)
>  {
>  #ifdef CONFIG_FSL_ESDHC
> -	return fsl_esdhc_mmc_init(bis);
> +	return fsl_esdhc_mmc_init(bis, CONFIG_SYS_FSL_ESDHC_ADDR);
>  #else
>  	return 0;
>  #endif
> diff --git a/arch/powerpc/cpu/mpc85xx/cpu.c
> b/arch/powerpc/cpu/mpc85xx/cpu.c index fc5d951..7bc9147 100644
> --- a/arch/powerpc/cpu/mpc85xx/cpu.c
> +++ b/arch/powerpc/cpu/mpc85xx/cpu.c
> @@ -269,7 +269,7 @@ reset_85xx_watchdog(void)
>  int cpu_mmc_init(bd_t *bis)
>  {
>  #ifdef CONFIG_FSL_ESDHC
> -	return fsl_esdhc_mmc_init(bis);
> +	return fsl_esdhc_mmc_init(bis, CONFIG_SYS_FSL_ESDHC_ADDR);
>  #else
>  	return 0;
>  #endif
> diff --git a/board/freescale/mpc837xemds/mpc837xemds.c
> b/board/freescale/mpc837xemds/mpc837xemds.c index 51dd692..41dce43 100644
> --- a/board/freescale/mpc837xemds/mpc837xemds.c
> +++ b/board/freescale/mpc837xemds/mpc837xemds.c
> @@ -79,7 +79,7 @@ int board_mmc_init(bd_t *bd)
>  	clrsetbits_be32(&im->sysconf.sicrh, SICRH_GPIO2_E | SICRH_SPI,
>  			SICRH_GPIO2_E_SD | SICRH_SPI_SD);
> 
> -	return fsl_esdhc_mmc_init(bd);
> +	return fsl_esdhc_mmc_init(bd, CONFIG_SYS_FSL_ESDHC_ADDR);
>  }
>  #endif
> 
> diff --git a/board/freescale/mpc837xerdb/mpc837xerdb.c
> b/board/freescale/mpc837xerdb/mpc837xerdb.c index d636796..8c3cf7b 100644
> --- a/board/freescale/mpc837xerdb/mpc837xerdb.c
> +++ b/board/freescale/mpc837xerdb/mpc837xerdb.c
> @@ -179,7 +179,7 @@ int board_mmc_init(bd_t *bd)
>  	clrsetbits_be32(&im->sysconf.sicrl, SICRL_USB_B, SICRL_USB_B_SD);
>  	clrsetbits_be32(&im->sysconf.sicrh, SICRH_SPI, SICRH_SPI_SD);
> 
> -	return fsl_esdhc_mmc_init(bd);
> +	return fsl_esdhc_mmc_init(bd, CONFIG_SYS_FSL_ESDHC_ADDR);
>  }
>  #endif
> 
> diff --git a/board/freescale/mpc8569mds/mpc8569mds.c
> b/board/freescale/mpc8569mds/mpc8569mds.c index 743e712..31e8f1f 100644
> --- a/board/freescale/mpc8569mds/mpc8569mds.c
> +++ b/board/freescale/mpc8569mds/mpc8569mds.c
> @@ -485,7 +485,7 @@ int board_mmc_init(bd_t *bd)
>  	/* Mux I2C2 (and optionally UART0) signals to eSDHC. */
>  	setbits_8(&bcsr[6], bcsr6);
> 
> -	return fsl_esdhc_mmc_init(bd);
> +	return fsl_esdhc_mmc_init(bd, CONFIG_SYS_FSL_ESDHC_ADDR);
>  }
> 
>  static void fdt_board_fixup_esdhc(void *blob, bd_t *bd)
> diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
> index a368fe6..a078bce 100644
> --- a/drivers/mmc/fsl_esdhc.c
> +++ b/drivers/mmc/fsl_esdhc.c
> @@ -484,13 +484,13 @@ int fsl_esdhc_initialize(bd_t *bis, struct
> fsl_esdhc_cfg *cfg) return 0;
>  }
> 
> -int fsl_esdhc_mmc_init(bd_t *bis)
> +int fsl_esdhc_mmc_init(bd_t *bis, uint32_t base)
>  {
>  	struct fsl_esdhc_cfg *cfg;
> 
>  	cfg = malloc(sizeof(struct fsl_esdhc_cfg));
>  	memset(cfg, 0, sizeof(struct fsl_esdhc_cfg));
> -	cfg->esdhc_base = CONFIG_SYS_FSL_ESDHC_ADDR;
> +	cfg->esdhc_base = base;
>  	return fsl_esdhc_initialize(bis, cfg);
>  }
> 
> diff --git a/include/fsl_esdhc.h b/include/fsl_esdhc.h
> index 477bbd7..e78d25c 100644
> --- a/include/fsl_esdhc.h
> +++ b/include/fsl_esdhc.h
> @@ -173,11 +173,11 @@ struct fsl_esdhc_cfg {
>  #endif
> 
>  #ifdef CONFIG_FSL_ESDHC
> -int fsl_esdhc_mmc_init(bd_t *bis);
> +int fsl_esdhc_mmc_init(bd_t *bis, uint32_t base);
>  int fsl_esdhc_initialize(bd_t *bis, struct fsl_esdhc_cfg *cfg);
>  void fdt_fixup_esdhc(void *blob, bd_t *bd);
>  #else
> -static inline int fsl_esdhc_mmc_init(bd_t *bis) { return -ENOSYS; }
> +static inline int fsl_esdhc_mmc_init(bd_t *bis, uint32_t base) { return
> -ENOSYS; } static inline void fdt_fixup_esdhc(void *blob, bd_t *bd) {}
>  #endif /* CONFIG_FSL_ESDHC */

  reply	other threads:[~2010-11-14 16:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-14 16:01 [U-Boot] [PATCH] FSL_ESDHC: Make the base address configurable at runtime Marek Vasut
2010-11-14 16:35 ` Marek Vasut [this message]
2010-11-14 16:59   ` Wolfgang Denk
2010-11-14 17:01     ` Marek Vasut
2010-11-14 17:08       ` Stefano Babic

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=201011141735.30504.marek.vasut@gmail.com \
    --to=marek.vasut@gmail.com \
    --cc=u-boot@lists.denx.de \
    /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