From mboxrd@z Thu Jan 1 00:00:00 1970 From: Timur Tabi Date: Mon, 27 Nov 2006 10:41:39 -0600 Subject: [U-Boot-Users] Please pull u-boot-83xx.git In-Reply-To: <20061126200244.5E849353C30@atlas.denx.de> References: <20061126200244.5E849353C30@atlas.denx.de> Message-ID: <456B1543.2040006@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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. -- Timur Tabi Linux Kernel Developer @ Freescale