public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] socfpga/dwmmc: Adding DesignWare MMC driver support for SOCFPGA
Date: Thu, 26 Dec 2013 09:38:10 +0100	[thread overview]
Message-ID: <20131226083810.C08C03824CD@gemini.denx.de> (raw)
In-Reply-To: <1387386987-3581-1-git-send-email-clsee@altera.com>

Dear Chin Liang See,

PLease fix your address list.  There is no such address as
"Andy at denx.de".

In message <1387386987-3581-1-git-send-email-clsee@altera.com> you wrote:
> To add the DesignWare MMC driver support for Altera SOCFPGA. It
> required information such as clocks and bus width from platform
> specific files (SOCFPGA handoff files)
...
> +#define CLKMGR_PERPLLGRP_EN_REG		(SOCFPGA_CLKMGR_ADDRESS + 0xA0)
...
> +#define SYSMGR_SDMMCGRP_CTRL_REG	(SOCFPGA_SYSMGR_ADDRESS + 0x108)

This looks as if you were trying to access device rtegisters through a
base address plus offset notation?

We do not allow this in U-Boot, as the compiler then has no chance to
check if you are using the correct data types, i. e. it cannot warn
you for example when you access a 32 bit register for a 16 bit data
type.

Please use C structs and proper I/O accessors instead.

> +	/* Disable SDMMC clock. */
> +	en = readl(CLKMGR_PERPLLGRP_EN_REG);
> +	en &= ~CLKMGR_SDMMC_CLK_ENABLE;
> +	writel(en, CLKMGR_PERPLLGRP_EN_REG);

Please fix such code.  Use proper I/O accessors.  This could (and
should) be written as:

	clrbits_le32(clkmgr->perpllgrp_en, CLKMGR_SDMMC_CLK_ENABLE);

[or similar struct member name].

> +	/* Enable SDMMC clock */
> +	en = readl(CLKMGR_PERPLLGRP_EN_REG);
> +	en |= CLKMGR_SDMMC_CLK_ENABLE;
> +	writel(en, CLKMGR_PERPLLGRP_EN_REG);

Ditto here, etc.

Please check all your device accesses.

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
That was the thing about deserts. They had their  own  gravity.  They
sucked you into the centre.           - Terry Pratchett, _Small Gods_

  parent reply	other threads:[~2013-12-26  8:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-18 17:16 [U-Boot] [PATCH v2] socfpga/dwmmc: Adding DesignWare MMC driver support for SOCFPGA Chin Liang See
2013-12-26  5:05 ` Jaehoon Chung
2013-12-31  0:12   ` Chin Liang See
2013-12-26  8:38 ` Wolfgang Denk [this message]
2013-12-31  0:25   ` Chin Liang See

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=20131226083810.C08C03824CD@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox