From mboxrd@z Thu Jan 1 00:00:00 1970 From: Reinhard Meyer Date: Sun, 14 Nov 2010 20:42:24 +0100 Subject: [U-Boot] previous two e-mails are RFC/demonstration! In-Reply-To: <20101114162340.9766714EA7E@gemini.denx.de> References: <4CE00793.8070501@emk-elektronik.de> <20101114162340.9766714EA7E@gemini.denx.de> Message-ID: <4CE03BA0.7010800@emk-elektronik.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Wolfgang Denk, > Dear Reinhard Meyer, > > and - do they compile? Do they work? Compile and work on top9000 = at91sam9xe = arm926ejs. Since no tricks are used anymore, it is very likely this will work on all other ARM variants or even on all architectures with a similar GLOBAL_DATA method. I made this patch as demo/reference to show how simple it is. Honestly, it should have sprung into someones' eyes long ago, but sometimes simple solutions hide themselves well :) TODOs: 1. I am quite sure that in arm/lib/board.c __asm__ __volatile__("": : :"memory"); was never needed and definitely is not needed anymore. Can anyone shed some light on why this was added? Probably just copied from other architectures where some trickery around gd was done? 2. All board config files (for ARM) should be similarly updated: -#define CONFIG_SYS_INIT_SP_ADDR \ - (ATMEL_BASE_SRAM + 0x4000 - GENERATED_GBL_DATA_SIZE) +#define CONFIG_SYS_INIT_SP_ADDR (ATMEL_BASE_SRAM + 0x4000) However, having the subtraction does not hurt except for wasted memory. 3. After this, GENERATED_GBL_DATA_SIZE is not needed anymore (for ARM). 4. start.S need just set the SP to CONFIG_SYS_INIT_SP_ADDR, if one wants to be over-cautious extra alignment *can* be done. 5. Test the change for other architectures. Best Regards, Reinhard