From: Tom Rini Date: Thu, 30 Apr 2015 11:41:24 -0400 Subject: [U-Boot] loading environment from SATA In-Reply-To: <47683292.Z98BvacQce@fnr-ben-pc> References: <47683292.Z98BvacQce@fnr-ben-pc> Message-ID: <20150430154124.GH16702@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thu, Apr 30, 2015 at 01:57:58PM +0100, Ben Hewson wrote: > booting from SATA works very well on my iMX6 based board, however if I do > > > #define CONFIG_ENV_IS_IN_FAT > > #if defined(CONFIG_ENV_IS_IN_FAT) > #define CONFIG_FAT_WRITE > #define FAT_ENV_INTERFACE "sata" > #define FAT_ENV_DEVICE_AND_PART "0:1" > #define FAT_ENV_FILE "u-boot.env" > #endif > > > nothing is loaded as the SATA has not been initialised. > > Looking at board_r.c I can see lots of inits, for mmc, nand and other stuff, > but not sata. > > Following the format I have added a function > > #ifdef CONFIG_CMD_SATA > static int initr_sata(void) > { > puts("SATA: "); > sata_initialize(); > return 0; > } > #endif > > and inside init_fnc_t init_sequence_r[] = { after > > #ifdef CONFIG_GENERIC_MMC > initr_mmc, > #endif > > I have added > > #ifdef CONFIG_CMD_SATA > initr_sata, > #endif > > > So this compiled and booted and to my surprise worked. > Is this the best way to achieve this. I can see potential problems if > sata_inialize() depends on other sub-systems being initialized first. I am > perhaps lucky that it works for me. For today at least yes, this sounds about right. I'm sure there's going to be a case or two where it isn't enough (SATA off of PCI rather than SoC bus?). If you'd like to make and submit a patch that'd be great! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: