From mboxrd@z Thu Jan 1 00:00:00 1970 From: Masahiro Yamada Date: Thu, 10 Jul 2014 19:52:19 +0900 Subject: [U-Boot] [PATCH 1/6] nand: denali: add Denali NAND driver for SPL In-Reply-To: <201407101210.25186.marex@denx.de> References: <20140710190620.CCBE.AA925319@jp.panasonic.com> <201407101210.25186.marex@denx.de> Message-ID: <20140710195219.CCC6.AA925319@jp.panasonic.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Marek, On Thu, 10 Jul 2014 12:10:25 +0200 Marek Vasut wrote: > > > On Fri, 4 Jul 2014 16:34:11 +0200 > > > > Marek Vasut 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. > > Or just use put_unaligned() ? Oh, year! put_unaligned() would be better. Thanks! > > > > + > > > > + /* 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. > > OK, I see. Is there any chance to fix this in Linux maybe eventually? > OK. I will send a patch to linux-mtd ML to use "#define PIPELINE_ACCESS 2000" Best Regards Masahiro Yamada