public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 5/7] S3C24XX: Add NAND Flash driver
Date: Thu, 13 Sep 2012 01:45:07 +0200	[thread overview]
Message-ID: <201209130145.08012.marex@denx.de> (raw)
In-Reply-To: <505117D3.1070303@inov.pt>

Dear Jos? Miguel Gon?alves,

> Hi Marek,
> 
> On 09/12/2012 10:11 PM, Marek Vasut wrote:
> > Dear Jos? Miguel Gon?alves,
> > 
> >> +
> >> +/*
> >> + * Hardware specific access to control-lines function
> >> + */
> >> +static void s3c_nand_hwcontrol(struct mtd_info *mtd, int cmd, unsigned
> >> int ctrl) +{
> >> +	s3c24xx_nand *const nand = s3c24xx_get_base_nand();
> >> +	struct nand_chip *this = mtd->priv;
> >> +
> >> +	if (ctrl & NAND_CTRL_CHANGE) {
> >> +		if (ctrl & NAND_CLE)
> >> +			this->IO_ADDR_W = (void __iomem *)&nand->nfcmmd;
> >> +		else if (ctrl & NAND_ALE)
> >> +			this->IO_ADDR_W = (void __iomem *)&nand->nfaddr;
> >> +		else
> >> +			this->IO_ADDR_W = (void __iomem *)&nand->nfdata;
> > 
> > Do you need this cast ?
> 
> Without it gcc gives me a warning:
> 
> s3c24xx_nand.c:90:20: warning: assignment discards `volatile' qualifier
> from pointer target type [enabled by default]

Not that you need to do the assignment into the structure .... use local 
variable, no ?

> > +/*
> > + * Board-specific NAND initialization.
> > + */
> > +int board_nand_init(struct nand_chip *nand)
> > +{
> > +	static int chip_n = 0;
> > +	s3c24xx_nand *const nand_reg = s3c24xx_get_base_nand();
> > +	u_long nfconf, nfcont;
> > +
> > +	if (chip_n == 0) {
> > +		/* Extend NAND timings to the maximum */
> > +		nfconf = readl(&nand_reg->nfconf);
> > +		nfconf |= 0x7770;
> > Magic
> > 
> >> +		writel(nfconf, &nand_reg->nfconf);
> >> +
> >> +		/* Disable chip selects and soft lock, enable controller */
> >> +		nfcont = readl(&nand_reg->nfcont);
> >> +		nfcont &= ~NFCONT_WP;
> >> +		nfcont |= NFCONT_NCE1 | NFCONT_NCE0 | NFCONT_ENABLE;
> >> +		writel(nfcont, &nand_reg->nfcont);
> > 
> > use clrsetbits_le32()
> 
> I will do that and also define some macros for the magic values.
> 
> Regards,
> Jos? Gon?alves

Best regards,
Marek Vasut

  parent reply	other threads:[~2012-09-12 23:45 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-12 11:15 [U-Boot] [PATCH 0/7] Add support to MINI2416 board José Miguel Gonçalves
2012-09-12 11:15 ` [U-Boot] [PATCH 1/7] ARM: fix relocation on ARM926EJS José Miguel Gonçalves
2012-09-12 11:15 ` [U-Boot] [PATCH 2/7] S3C24XX: Add core support for Samsung's S3C24XX SoCs José Miguel Gonçalves
2012-09-12 11:15 ` [U-Boot] [PATCH 3/7] S3C24XX: Add serial driver José Miguel Gonçalves
2012-09-12 21:01   ` Marek Vasut
2012-09-13  0:54     ` José Miguel Gonçalves
2012-09-13  9:17       ` Marek Vasut
2012-09-13  9:30         ` José Miguel Gonçalves
2012-09-12 11:15 ` [U-Boot] [PATCH 4/7] S3C24XX: Add RTC driver José Miguel Gonçalves
2012-09-12 21:03   ` Marek Vasut
2012-09-12 23:28     ` José Miguel Gonçalves
2012-09-12 11:15 ` [U-Boot] [PATCH 5/7] S3C24XX: Add NAND Flash driver José Miguel Gonçalves
2012-09-12 21:11   ` Marek Vasut
2012-09-12 23:16     ` José Miguel Gonçalves
2012-09-12 23:20       ` Scott Wood
2012-09-13  0:18         ` José Miguel Gonçalves
2012-09-13  0:24           ` Marek Vasut
2012-09-13  0:40             ` José Miguel Gonçalves
2012-09-13  0:44               ` Marek Vasut
2012-09-12 23:45       ` Marek Vasut [this message]
2012-09-12 23:55         ` José Miguel Gonçalves
2012-09-12 11:15 ` [U-Boot] [PATCH 6/7] Add u-boot-ubl.bin target to the Makefile José Miguel Gonçalves
2012-09-12 11:15 ` [U-Boot] [PATCH 7/7] S3C24XX: Add support to MINI2416 board José Miguel Gonçalves

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=201209130145.08012.marex@denx.de \
    --to=marex@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