
Hi,
-----Original Message----- From: rubini@gnudd.com [mailto:rubini@gnudd.com] On Behalf Of Alessandro Rubini Sent: Tuesday, December 01, 2009 9:36 PM To: Tom.Rix@windriver.com Cc: moorthy.apg@samsung.com; scottwood@freescale.com; u-boot@lists.denx.de; kyungmin.park@samsung.com Subject: Re: [U-Boot] Breakage on arm/next
Could the macros defined in apollo.h also be defined in the other target board's config file ?
I don't think so (my board is one of the affected ones).
The macros are CONFIG_ENV_ADDR_FLEX and CONFIG_ENV_SIZE_FLEX . I just don't have the flex device.
I get u.
In the commit that introduced the problem, I see code like this:
env_addr = CONFIG_ENV_ADDR;
if (FLEXONENAND(this))
env_addr = CONFIG_ENV_ADDR_FLEX;
So why should CONFIG_ENV_ADDR_FLEX have a different name from CONFIG_ENV_ADDR ? Same applies to CONFIG_ENV_SIZE_FLEX.
Erasesizes differ in Flex-OneNAND from OneNAND. So Default Macros cannot be used.
I think c758e947aa7d39a2be607ecdedd818ad300807b2 should be reverted and done differently. If I got my reasoning right, the first hunk should go and the next one:
instr.len = CONFIG_ENV_SIZE;
if (FLEXONENAND(this)) {
env_addr = CONFIG_ENV_ADDR_FLEX;
instr.len = CONFIG_ENV_SIZE_FLEX;
instr.len <<=
onenand_mtd.eraseregions[0].numblocks == 1 ?
1 : 0;
}
Shoul just become
if (FLEXONENAND(this))
instr.len <<=
onenand_mtd.eraseregions[0].numblocks == 1
- ? 1 : 0;
This has no adverse effect on other boards and handles the flex specifics, withouth adding two unneeded macros.
The Erase Sizes of Flex-OneNAND are 256K for SLC and 512K for MLC regions. And always 0th Block belongs to SLC region whereas, 1st Block can be of SLC or MLC region in a Die. So without these Macros Flex-OneNAND specifics cannot be handled.
I felt moving these macros "include/linux/mtd/onenand.h" will be ideal in this scenario.
With Regards Moorthy