
Wolfgang Denk wrote:
In message 200611261446.24607.sr@denx.de you wrote:
mpc83xx: fix TQM build by defining a CFG_FLASH_SIZE for it
-------------------------- include/configs/TQM834x.h -------------------------- index b1f033d..f0e4900 100644 @@ -95,6 +95,7 @@ #define CFG_FLASH_CFI_DRIVER /* use the CFI driver */ #undef CFG_FLASH_CHECKSUM #define CFG_FLASH_BASE 0x80000000 /* start of FLASH */ +#define CFG_FLASH_SIZE 8 /* FLASH size in MB */
Do you only support sizes bigger or equal to 1 MByte? What if a board only has 512kBytes?
I object against such changes which have not been discussed with the maintainer of the board, and most probably have not been tested either.
TQ has a pretty long list of configuration options for their modules, and the change above will probably break quite a few, or most.
The above change is necessary to make the board compatible with the flash-size code in mpc83xx/start.S:
/* Store 0x80000012 + log2(CFG_FLASH_SIZE) into LBLAWAR1 */ lis r4, (0x80000012)@h ori r4, r4, (0x80000012)@l li r5, CFG_FLASH_SIZE 1: srawi. r5, r5, 1 /* r5 = r5 >> 1 */ addi r4, r4, 1 bne 1b
Previously, this code just assumed that flash was 8MB. However, the 8349ITX has 16MB of flash. Rather than have #ifdefs in start.S, this code was changed to calculate the correct value for LBLAWAR1 based on CFG_FLASH_SIZE.
I believe that this code is the most elegant solution to the problem, however it does require that each board header file define a value for CFG_FLASH_SIZE. The alternative would be to add these lines above the new code:
#ifndef CFG_FLASH_SIZE #define CFG_FLASH_SIZE 8 #endif
If you prefer that we use this approach, then we can make that change. However, I think our approach makes more sense.