From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sughosh Ganu Date: Fri, 22 Oct 2010 14:22:47 +0530 Subject: [U-Boot] [PATCH 2/2] Add board support for hawkboard In-Reply-To: <20101022080543.6424D136320@gemini.denx.de> References: <1287690234-6109-1-git-send-email-urwithsughosh@gmail.com> <20101021204435.08FE71359B7@gemini.denx.de> <20101022075016.GB8597@Hardy> <20101022080543.6424D136320@gemini.denx.de> Message-ID: <20101022085247.GE8597@Hardy> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de hi Wolfgang, On Fri Oct 22, 2010 at 10:05:43AM +0200, Wolfgang Denk wrote: > Dear Sughosh Ganu, > > In message <20101022075016.GB8597@Hardy> you wrote: > > > > > Is there not a better way than adding such a huge #ifdef block? > > > > Not sure about this one. I need the pinmux configuration functions > > from this file. > > How about splitting the file, and using a separate file for the pinmux > stuff? Fine, will implement this. > > > Again: can we not avoid such a huge #ifdef block here? > > > > > > We need this initialisation for the nand spl part alone, and this is > > board specific. Can you please suggest any better way of handling > > this. > > If it turns out that we have code that is common to NAND SPL and > normal U-Boot, and other code that is not shared, these parts should > be separated into different files so NAND SPL can build and use the > common stuff and normal U-Boot additionally build and use the other > stuff. Ok. Will split out the code that is specific to nand spl in a different file, which would not be compiled in for the normal u-boot. > > > > #if defined(CONFIG_ARM) && !defined(CONFIG_SYS_ARM_WITHOUT_RELOC) > > > > -void board_init_f (ulong bootflag) > > > > +void __board_init_f (ulong bootflag) > > > > { > > > > relocate_code (CONFIG_SYS_TEXT_BASE - TOTAL_MALLOC_LEN, NULL, > > > > CONFIG_SYS_TEXT_BASE); > > > > } > > > > +void board_init_f (ulong bootflag)__attribute__((weak, alias("__board_init_f"))); > > > > #endif > > > > > > This is a global change that affects all NAND booting boards. This > > > must be submitted spearately, and you must explain in detail why you > > > think you need that. Also please mention on which systems this change > > > has been tested. > > > > For hawkboard, we need to do some board specific initialisation > > which can be included in board_init_f. The freescale boards which > > Can you probably do it in any of the other, board dependent init > functions? Not sure on this one. The only board specific function that gets called in the nand spl stage is board_init_f. -sughosh