All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] mmc: access mxcmmc from mx31 boards
Date: Tue, 25 Oct 2011 11:43:49 +0200	[thread overview]
Message-ID: <4EA684D5.8030608@denx.de> (raw)
In-Reply-To: <1319474745-8409-1-git-send-email-helmut.raiger@hale.at>

On 10/24/2011 06:45 PM, Helmut Raiger wrote:
> This patch modifies mxcmmc.c to be used
> not only by i.MX27 but also by i.MX31 boards.
> Both use the same SD controller, but have different
> clock set-ups.
> The clock access was renamed to imx_get_mmcclk() to
> allow both architectures to provide their respective
> clock. Pins, base address and prototypes for board_init_mmc()
> are provided.
> 
> Signed-off-by: Helmut Raiger <helmut.raiger@hale.at>
> ---
>  arch/arm/cpu/arm1136/mx31/generic.c        |    5 +++++
>  arch/arm/include/asm/arch-mx27/clock.h     |    1 +
>  arch/arm/include/asm/arch-mx31/clock.h     |    1 +
>  arch/arm/include/asm/arch-mx31/imx-regs.h  |   11 +++++++++++
>  arch/arm/include/asm/arch-mx31/sys_proto.h |    3 ++-
>  drivers/mmc/mxcmmc.c                       |    8 +++-----
>  6 files changed, 23 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/arm/cpu/arm1136/mx31/generic.c b/arch/arm/cpu/arm1136/mx31/generic.c
> index 7ab5631..3008099 100644
> --- a/arch/arm/cpu/arm1136/mx31/generic.c
> +++ b/arch/arm/cpu/arm1136/mx31/generic.c
> @@ -99,6 +99,11 @@ u32 imx_get_uartclk(void)
>  	return mxc_get_clock(MXC_UART_CLK);
>  }
>  
> +u32 imx_get_mmcclk(void)
> +{
> +	return mxc_get_clock(MXC_IPG_PERCLK);
> +}

This introduces a new function and does not use the mxc_get_clock() that
hides the specific implementation for each SOC (if any).

The common way to get a clock for a i.MX SOC is to call the
mxc_get_clock() passing as parameter the peripheral (in this case, the
MMC) you need. In this way we hide if a SOC is using perclk and another
one perclk2 or maybe something else. We have MXC_CSPI_CLK, MXC_UART_CLK,
MXC_FEC_CLK,MXC_USB_CLK.

There is already MXC_ESDHC_CLK (check in the mx35 directory). Please use
the same interface and add only the case for MXC_ESDHC_CLK to the SOC
you requires.

> +
>  void mx31_gpio_mux(unsigned long mode)
>  {
>  	unsigned long reg, shift, tmp;
> diff --git a/arch/arm/include/asm/arch-mx27/clock.h b/arch/arm/include/asm/arch-mx27/clock.h
> index 7e9c7aa..2c078d5 100644
> --- a/arch/arm/include/asm/arch-mx27/clock.h
> +++ b/arch/arm/include/asm/arch-mx27/clock.h
> @@ -38,5 +38,6 @@ ulong imx_get_ahbclk(void);
>  
>  #define imx_get_uartclk imx_get_perclk1
>  #define imx_get_fecclk imx_get_ahbclk
> +#define imx_get_mmcclk imx_get_perclk2

also for i.mx27 we should call mxc_get_clk()

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

  reply	other threads:[~2011-10-25  9:43 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-24 16:45 [U-Boot] [PATCH] mmc: access mxcmmc from mx31 boards Helmut Raiger
2011-10-25  9:43 ` Stefano Babic [this message]
2011-10-27 12:19   ` [U-Boot] [PATCH V2] " Helmut Raiger
2011-11-02  7:02     ` [U-Boot] [PATCH V2] imx: " Helmut Raiger
2011-11-07  7:59       ` Helmut Raiger
2011-11-07  9:04         ` Stefano Babic
2011-11-14  9:06           ` Helmut Raiger
2011-11-14 10:55             ` Stefano Babic
2011-11-14 15:37               ` Helmut Raiger
2012-01-11 13:59               ` [U-Boot] [PATCH V3] " Helmut Raiger
2012-01-11 13:59                 ` [U-Boot] [PATCH 1/2] " Helmut Raiger
2012-01-13  8:28                   ` Stefano Babic
2012-01-17  9:56                   ` Stefano Babic
2012-01-11 13:59                 ` [U-Boot] [PATCH 2/2] tt01: add MMC support Helmut Raiger
2012-01-12 10:15                   ` [U-Boot] [PATCH 2/2] imx: " Helmut Raiger
2012-01-13  8:32                   ` [U-Boot] [PATCH 2/2] " Stefano Babic
2012-01-16 11:10                     ` [U-Boot] [PATCH V2] " Helmut Raiger
2012-01-16 11:10                       ` [U-Boot] [PATCH 1/2] fsl_pmic.h: add regulator mode 0 and 1 bits Helmut Raiger
2012-01-17 10:12                         ` Stefano Babic
2012-01-18 10:41                           ` [U-Boot] [PATCH V3 1/2] mc13783.h: create and add regulator mode 0 and 1 Helmut Raiger
2012-01-18 10:41                             ` [U-Boot] [PATCH V3 2/2] tt01: add MMC support Helmut Raiger
2012-01-18 12:37                               ` Stefano Babic
2012-01-19  7:21                                 ` Helmut Raiger
2012-01-19  7:27                                   ` [U-Boot] [PATCH V4] " Helmut Raiger
2012-01-30 14:35                                     ` Stefano Babic
2012-01-30 14:38                             ` [U-Boot] [PATCH V3 1/2] mc13783.h: create and add regulator mode 0 and 1 Stefano Babic
2012-01-16 11:10                       ` [U-Boot] [PATCH 2/2] tt01: add MMC support Helmut Raiger

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=4EA684D5.8030608@denx.de \
    --to=sbabic@denx.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.