From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Nelson Date: Sun, 13 Dec 2015 19:19:50 -0700 Subject: [U-Boot] spl: mmc: use block device number, not hard-coded 0 In-Reply-To: <20151214012109.GA3253@bill-the-cat> References: <1449343948-14839-1-git-send-email-eric@nelint.com> <20151214012109.GA3253@bill-the-cat> Message-ID: <566E2746.3010608@nelint.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Tom, On 12/13/2015 06:21 PM, Tom Rini wrote: > On Sat, Dec 05, 2015 at 12:32:28PM -0700, Eric Nelson wrote: > >> In order to support boot from multiple devices through board_boot_order, >> it's necessary to use the block number of a device. >> >> The use of a hard-coded 0 for the device number also creates a need >> to re-order block devices for use in SPL like this: >> http://git.denx.de/?p=u-boot.git;a=blob;f=board/freescale/mx6slevk/mx6slevk.c;hb=HEAD#l195 > > We also do similar'ish things for TI parts (we only register what we're > booting from). > > So, before this can be applied don't we also need a patch for mx6slevk > and for TI ones too (but that should be "easier" since I think it > just becomes we always use the normal board_mmc_init) ? We don't **need** a patch to support existing use cases because the patch uses the dev number in the block device directly (mmc->block_dev.dev). https://patchwork.ozlabs.org/patch/553026/ I'm not sure about TI boards, but the i.MX6SL EVK code swaps the non-SPL ordering of mmc devices when compiled for SPL in order to handle the hard-coded zero: http://git.denx.de/?p=u-boot.git;a=blob;f=board/freescale/mx6slevk/mx6slevk.c;hb=HEAD#l195 In other words, "mmc 0" becomes "mmc 1" and vice versa. The trouble with this approach is that you can't allow for multiple MMC devices through board_boot_order, because the second will be device number 1. Regards, Eric