From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Babic Date: Tue, 01 Apr 2014 10:41:50 +0200 Subject: [U-Boot] [PATCH v4 1/2] RiOTboard: add new board In-Reply-To: <20140331220234.0b2ec49e@e6520eb> References: <20140328100130.1605B38233A@gemini.denx.de> <1396128580-11129-1-git-send-email-eric@eukrea.com> <53384461.40904@denx.de> <20140331220234.0b2ec49e@e6520eb> Message-ID: <533A7BCE.7090401@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Eric, On 31/03/2014 22:02, Eric B?nard wrote: > Hi Stefano, > > Le Sun, 30 Mar 2014 18:20:49 +0200, > Stefano Babic a ?crit : >> A general remark. I agree by reading the whole thread about checking at >> runtime which is the running board (you do it getting the cpu type). >> >> However, you use also a compiler switch mechanism, adding RIOTBOARD or >> MARSBOARD in the boards.cfg. You have implemented two ways to for the >> same thing. This makes in principle your runtime detection useless, >> because you can use #if CONFIG_MARSBOARD instead of "if board_type == >> BOARD_IS_MARSBOARD)". Is it possible to use only the runtime detection ? >> I think the main problem is CONFIG_ENV_IS_*, that is different for the >> two boards. What do you think about it ? >> > I've tried and I don't see how to include functions to handle both MMC > and SF environment in the same binary with the current env code. > I was not sure, but I had the feeling this can be the major issue. > A workaround would be to use MMC to store env also on the MarSBoard but > as it is using the SPI flash as the boot source I would prefer to keep > the env in the SPI flash. > Ok - then I propose that you have still two entries in boards.cfg, and you set there ENV_IS_IN_MMC or ENV_IS_IN_SPI_FLASH. A lot of boards, having different hardware configurations, are doing in this way. You can drop CONFIG_RIOTBOARD and CONFIG_MARSBOARD as well (for example, mx28evk has an entry in boards.cfg mx28evk_nand for ENV on NAND). Best regards, Stefano -- ===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================