From: Kyungmin Park Date: Tue, 21 Jul 2009 10:03:09 +0900 Subject: [U-Boot] [PATCH 6/6] S5PC100: Add onenand_ipl for SMDKC100 support In-Reply-To: <20090720211805.6F4D7832E416@gemini.denx.de> References: <350d1ec30906250121q4e860812s35054aaee8c2016e@mail.gmail.com> <20090719200442.B4BB6832E416@gemini.denx.de> <9c9fda240907192016i32c7312dh490629f2f2bb31be@mail.gmail.com> <20090720211805.6F4D7832E416@gemini.denx.de> Message-ID: <9c9fda240907201803u61cb14fei1c8694dd3641fa6d@mail.gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tue, Jul 21, 2009 at 6:18 AM, Wolfgang Denk wrote: > Dear Kyungmin Park, > > In message <9c9fda240907192016i32c7312dh490629f2f2bb31be@mail.gmail.com> you wrote: >> >> >> ?/* read a page with ECC */ >> >> ?static inline int onenand_read_page(ulong block, ulong page, >> >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? u_char * buf> , int pagesize) >> >> ?{ >> >> +#ifdef CONFIG_S5PC1XX >> >> + ? ? unsigned int *p = (unsigned int *) buf; >> >> + ? ? int mem_addr, i; >> >> + >> >> + ? ? mem_addr = MEM_ADDR(block, page, 0); >> >> + >> >> + ? ? pagesize >>= 2; >> >> + >> >> + ? ? for (i = 0; i < pagesize; i++) >> >> + ? ? ? ? ? ? *p++ = *(volatile unsigned int *)(CMD_MAP_01> (mem_addr)); >> >> +#else ? ? ? ?/* CONFIG_S5PC1XX */ >> >> + >> >> ? ? ? unsigned long *base; >> > >> > I don't like to see such board specific code in global files. >> >> I think it's not board specific code. S3C64XX and S5PC1XX series have >> own OneNAND controller and to access the OneNAND, it should use the >> this controller. > > OK, so it is SoC specific code in a common file - that's just > marginally better. > >> If you don't like the ifdef. we can separate the function but I'm not >> sure it's really required. > > It would be great if we can get rid of the #ifdef. As you know, OneNAND IPL has size limitation, 1KiB. So it's difficult to co-exist two different function. Thank you, Kyungmin Park