All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 3/4] MX5: Introduce a function for setting the chip select size
Date: Thu, 19 May 2011 21:02:25 +0200	[thread overview]
Message-ID: <20110519190225.AB95B1491B0F@gemini.denx.de> (raw)
In-Reply-To: <1305751670-30808-3-git-send-email-fabio.estevam@freescale.com>

Dear Fabio Estevam,

In message <1305751670-30808-3-git-send-email-fabio.estevam@freescale.com> you wrote:
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
>  arch/arm/cpu/armv7/mx5/soc.c              |   30 +++++++++++++++++++++++++++++
>  arch/arm/include/asm/arch-mx5/imx-regs.h  |    5 ++++
>  arch/arm/include/asm/arch-mx5/sys_proto.h |    2 +-
>  3 files changed, 36 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/cpu/armv7/mx5/soc.c b/arch/arm/cpu/armv7/mx5/soc.c
> index 40b8b56..e599df8 100644
> --- a/arch/arm/cpu/armv7/mx5/soc.c
> +++ b/arch/arm/cpu/armv7/mx5/soc.c
> @@ -163,6 +163,36 @@ int cpu_mmc_init(bd_t *bis)
>  #endif
>  }
>  
> +void set_chipselect_size(int const cs_size)
> +{
> +	unsigned int reg;
> +	struct iomuxc *iomuxc_regs = (struct weim *)IOMUXC_BASE_ADDR;
> +	reg = readl(&iomuxc_regs->gpr1);
> +
> +	switch (cs_size) {
> +	case CS0_128:
> +		reg &= ~0x7;	/* CS0=128MB, CS1=0, CS2=0, CS3=0 */
> +		reg |= 0x5;
> +		break;
> +	case CS0_64M_CS1_64M:
> +		reg &= ~0x3F;	/* CS0=64MB, CS1=64MB, CS2=0, CS3=0 */
> +		reg |= 0x1B;
> +		break;
> +	case CS0_64M_CS1_32M_CS2_32M:
> +		reg &= ~0x1FF;	/* CS0=64MB, CS1=32MB, CS2=32MB, CS3=0 */
> +		reg |= 0x4B;
> +		break;
> +	case CS0_32M_CS1_32M_CS2_32M_CS3_32M:
> +		reg &= ~0xFFF;  /* CS0=32MB, CS1=32MB, CS2=32MB, CS3=32MB */
> +		reg |= 0x249;
> +		break;
> +	default:
> +		printf("Unknown chip select size\n");

In cases like this, please _always_ print _what_ the unknown chip size
was.  Please fix.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Hacking's just another word for nothing left to kludge.

      parent reply	other threads:[~2011-05-19 19:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-18 20:47 [U-Boot] [PATCH v3 1/4] MX5: Make the weim structure complete Fabio Estevam
2011-05-18 20:47 ` [U-Boot] [PATCH v3 2/4] MX5: Add iomux structure Fabio Estevam
2011-05-18 20:47   ` [U-Boot] [PATCH v3 3/4] MX5: Introduce a function for setting the chip select size Fabio Estevam
2011-05-18 20:47     ` [U-Boot] [PATCH v3 4/4] MX53: Add initial support for MX53ARD Fabio Estevam
2011-05-19  8:46     ` [U-Boot] [PATCH v3 3/4] MX5: Introduce a function for setting the chip select size Stefano Babic
2011-05-19 11:49       ` Fabio Estevam
2011-05-19 12:04         ` Stefano Babic
2011-05-19 19:02     ` Wolfgang Denk [this message]

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=20110519190225.AB95B1491B0F@gemini.denx.de \
    --to=wd@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.