public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Masahiro Yamada <yamada.m@jp.panasonic.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/6] nand: denali: add Denali NAND driver for SPL
Date: Thu, 10 Jul 2014 19:06:20 +0900	[thread overview]
Message-ID: <20140710190620.CCBE.AA925319@jp.panasonic.com> (raw)
In-Reply-To: <201407041634.11523.marex@denx.de>

Hi Marek,


On Fri, 4 Jul 2014 16:34:11 +0200
Marek Vasut <marex@denx.de> wrote:

> 
> > +static void read_data_from_flash_mem(uint8_t *buf, int len)
> > +{
> > +	int i;
> > +	uint32_t *buf32;
> > +
> > +	/* transfer the data from the flash */
> > +	buf32 = (uint32_t *)buf;
> > +	for (i = 0; i < len / 4; i++)
> > +		*buf32++ = readl(denali_flash_mem + INDEX_DATA_REG);
> 
> Won't this trigger unaligned access if $buf is not aligned to 4-byte boundary ?


Thanks for catching this.

Actually, it would seldom happen because the aligned load address is generally given.

But I will add a sanity check here in v2, just in case.



> > +
> > +	/* setup the pipeline command */
> > +	index_addr(cmd, 0x2000 | page_count);
> 
> Magic value 0x2000 should be fixed here.


Actually, this part is the same as that of the normal Denali driver
by Chin Liang See
http://patchwork.ozlabs.org/patch/357717/

Moreover, it is the same as in Linux Kernel.

I understand what you mean, but I guess we can excuse here.




> > +	cmd = MODE_01 | addr;
> > +	writel(cmd, denali_flash_mem + INDEX_CTRL_REG);
> 
> Somehow, eventually, this should be migrated to "struct" based register access 
> instead of such offset computation. If you feel like doing it, that'd be nice 
> ;-)

Dito.
I am following the coding style of the normal Denali driver and the Linux one.

We might perhaps do that migration as the separated task in future, but not now.



Best Regards
Masahiro Yamada

  reply	other threads:[~2014-07-10 10:06 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-04 10:19 [U-Boot] [PATCH 0/6] Add support for Panasonic UniPhier SoCs/boards Masahiro Yamada
2014-07-04 10:19 ` [U-Boot] [PATCH 1/6] nand: denali: add Denali NAND driver for SPL Masahiro Yamada
2014-07-04 14:34   ` Marek Vasut
2014-07-10 10:06     ` Masahiro Yamada [this message]
2014-07-10 10:10       ` Marek Vasut
2014-07-10 10:52         ` Masahiro Yamada
2014-07-10 11:30           ` Marek Vasut
2014-07-11  2:19             ` Masahiro Yamada
2014-07-04 10:19 ` [U-Boot] [PATCH 2/6] serial: add UniPhier serial driver Masahiro Yamada
2014-07-04 14:40   ` Marek Vasut
2014-07-10 10:06     ` Masahiro Yamada
2014-07-10 10:14       ` Marek Vasut
2014-07-10 11:31         ` Masahiro Yamada
2014-07-10 12:37           ` Marek Vasut
2014-07-11  5:37             ` Masahiro Yamada
2014-07-11  8:07               ` Marek Vasut
2014-07-04 10:19 ` [U-Boot] [PATCH 3/6] arm: uniphier: add UniPhier SoC suppurt code Masahiro Yamada
2014-08-20  9:31   ` Albert ARIBAUD
2014-08-21 11:27     ` Masahiro Yamada
2014-07-04 10:19 ` [U-Boot] [PATCH 4/6] arm: uniphier: add UniPhier config headers Masahiro Yamada
2014-07-04 10:19 ` [U-Boot] [PATCH 5/6] arm: uniphier: add board entries to boards.cfg Masahiro Yamada
2014-07-04 10:19 ` [U-Boot] [PATCH 6/6] git-mailrc: add me as the maintainer of UniPhier SoCs Masahiro Yamada

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=20140710190620.CCBE.AA925319@jp.panasonic.com \
    --to=yamada.m@jp.panasonic.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