From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Wed, 20 Apr 2016 11:36:32 +0200 Subject: [U-Boot] SAMA5D2 xplained SD/eMMC boot In-Reply-To: References: <5714FD86.4040309@gmail.com> <57165DFD.5040603@denx.de> Message-ID: <57174DA0.3040401@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 On 04/20/2016 03:17 AM, Yang, Wenyou wrote: > Hi Marek, > >> -----Original Message----- >> From: Marek Vasut [mailto:marex at denx.de] >> Sent: 2016?4?20? 0:34 >> To: Yang, Wenyou >> Cc: u-boot at lists.denx.de >> Subject: Re: SAMA5D2 xplained SD/eMMC boot >> >> On 04/19/2016 05:22 AM, Yang, Wenyou wrote: >>> Hi Marek, >>> >>>> -----Original Message----- >>>> From: Marek Vasut [mailto:marek.vasut at gmail.com] >>>> Sent: 2016?4?18? 23:30 >>>> To: Yang, Wenyou >>>> Cc: u-boot at lists.denx.de >>>> Subject: SAMA5D2 xplained SD/eMMC boot >>>> >>>> Hi! >>>> >>>> I've been playing around with latest mainline u-boot on sama5d2 >>>> xplained ultra. I noticed that if I want to boot the board from SD >>>> card (SDHCI1), the board will indeed load the SPL from it, but SPL >>>> will try to load u-boot.img from eMMC >>>> (SDHCI0) and fail, as my eMMC is blank. >>> >>> Yes, there is some issue to load u-boot.img. I found there is something to do on >> sdhci.c. >>> >>> You can try this branch, it should works. >>> >>> https://github.com/linux4sam/u-boot-at91/commits/u-boot-2016.03-at91 >> >> I am not interested in using non-mainline stuff. Do you have any particular >> patch/commit which I can refer to ? I do not think this has anything to do with >> sdhci.c driver at all, it has to do with detecting the boot device from which SPL >> was started and loading u-boot.img from the same boot device instead of always >> using SDHCI0. > > I will test the mainline code. I will let you know when I get something. OK. Does the SoC have any sort of register which lists the current boot device ? > Thank you. > >> >>>> This is a result of hard-coding boot >>>> device to >>>> BOOT_DEVICE_MMC1 in arch/arm/mach-at91/spl.c spl_boot_device() I think. >>>> >>>> Is there any way to discern from which SDHCI the board booted to >>>> continue loading u-boot.img from the correct one ? This would let us >>>> implement >>>> board_boot_order() and boot from correct SDHCI. >>>> >>>> -- >>>> Best regards, >>>> Marek Vasut >>> >>> >>> Best Regards, >>> Wenyou Yang >>> >> >> >> -- >> Best regards, >> Marek Vasut > > > Best Regards, > Wenyou Yang > -- Best regards, Marek Vasut