public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: York Sun <york.sun@nxp.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 5/5] ls2080ardb: Convert to distro boot
Date: Fri, 13 May 2016 12:52:52 -0700	[thread overview]
Message-ID: <57363094.5020905@nxp.com> (raw)
In-Reply-To: <57361a08-30d6-3271-5ad8-ae5810b5d468@suse.de>

On 05/13/2016 12:36 PM, Alexander Graf wrote:
> 
> 
> On 13.05.16 19:05, York Sun wrote:
>> On 05/13/2016 10:03 AM, Alexander Graf wrote:
>>>
>>>
>>>> Am 13.05.2016 um 18:21 schrieb York Sun <york.sun@nxp.com>:
>>>>
>>>>> On 05/13/2016 07:32 AM, Alexander Graf wrote:
>>>>>
>>>>>> Am 13.05.2016 um 16:26 schrieb Stuart Yoder <stuart.yoder@nxp.com>:
>>>>>>
>>>>>>
>>>>>>
>>>>>>> -----Original Message-----
>>>>>>> From: Alexander Graf [mailto:agraf at suse.de]
>>>>>>> Sent: Friday, May 13, 2016 7:22 AM
>>>>>>> To: u-boot at lists.denx.de
>>>>>>> Cc: Stuart Yoder <stuart.yoder@nxp.com>; york sun <york.sun@nxp.com>
>>>>>>> Subject: [PATCH 5/5] ls2080ardb: Convert to distro boot
>>>>>>>
>>>>>>> Most new systems in U-Boot these days make use of the generic "distro"
>>>>>>> framework which allows a user to have U-Boot scan for a bootable OS
>>>>>>> on all available media types.
>>>>>>>
>>>>>>> This patch converts the LS2080ARDB board to use that framework instead
>>>>>>> of booting from a hard coded flash offset.
>>>>>>>
>>>>>>> Signed-off-by: Alexander Graf <agraf@suse.de>
>>>>>>>
>>>>>>> ---
>>>>>>>
>>>>>>> This obviously means that we can no longer boot from said offset. Is
>>>>>>> that a reasonable thing to do or should I put the bootm back into the
>>>>>>> default boot command and only do distro boot if it fails?
>>>>>>
>>>>>> To date all armv8 FSL/NXP sdk releases, field engineers, etc have been using
>>>>>> bootm.  I'm a little concerned about changing the default boot command
>>>>>> right now...as I assume things will unexpectedly appear to just stop
>>>>>> working.  Or, is booting from the NOR flash one of the distro boot
>>>>>> "media" types?
>>>>>
>>>>> The problem with boot from NOR is that we have no source of information on what lies where. So distro boot can't have it in its target list, as you have to know magical offsets.
>>>>>
>>>>> We could put the magical bootm after tge distro list, but that would mean that field engineers get pxe boot with long timeouts first and then their NOR bootm booted.
>>>>>
>>>>> So the only option left that I can see is to always try magical offset NOR bootm and do distro boot if it fails. Then just tell people to write zeros to the NOR kernel offset and they get distro boot automatically.
>>>>
>>>> Alex,
>>>>
>>>> I suggest to attempt current boot method before moving on to other sources. I
>>>> presume booting from NOR would check the image header first. If the image is
>>>> valid, go ahead to boot it. Otherwise, move on.
>>>
>>> Ok, will do.
>>>
>>>>
>>>> Beside, it would be helpful to define a list and order of boot source.
>>>
>>> That's what the patch does, no? See the BOOT_TARGET_DEVICES define. It's probably incomplete, but describes the boot order and boot sources.
>>>
>>
>> Yes I saw it. Would it be possible to use environmental variable for this
>> purpose, so users can specify the list and order? If it is too complicated, we
>> can live with the macro and recompile as needed.
> 
> With the patches applied as is, the environment looks like this:
> 
> => printenv
> arch=arm
> baudrate=115200
> board=ls2080ardb
> board_name=ls2080ardb
> boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr}
> ${prefix}${script}; source ${scriptaddr}
> boot_efi_binary=load ${devtype} ${devnum}:${distro_bootpart}
> ${kernel_addr_r} efi/boot/bootaa64.efi; if fdt addr ${fdt_addr_r}; then
> bootefi ${kernel_addr_r} ${fdt_addr_r};elsebootefi ${kernel_addr_r}
> ${fdtcontroladdr};fi
> boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any
> ${scriptaddr} ${prefix}extlinux/extlinux.conf
> boot_net_usb_start=usb start
> boot_prefixes=/ /boot/
> boot_script_dhcp=boot.scr.uimg
> boot_scripts=boot.scr.uimg boot.scr
> boot_targets=mmc0 scsi0 dhcp
> bootargs=console=ttyS1,115200 root=/dev/ram0
> earlycon=uart8250,mmio,0x21c0600 ramdisk_size=0x2000000
> default_hugepagesz=2m hugepagesz=2m hugepages=256
> bootcmd=run mcinitcmd && fsl_mc lazyapply dpl 0x580700000 && setenv
> ethact DPMAC5 at xgmii && run distro_bootcmd
> bootcmd_dhcp=run boot_net_usb_start; if dhcp ${scriptaddr}
> ${boot_script_dhcp}; then source ${scriptaddr}; fi;setenv efi_fdtfile
> ${fdtfile}; setenv efi_old_vci ${bootp_vci};setenv efi_old_arch
> ${bootp_arch};setenv bootp_vci PXEClient:Arch:00011:UNDI:003000;setenv
> bootp_arch 0xb;if dhcp ${kernel_addr_r}; then tftpboot ${fdt_addr_r}
> dtb/${efi_fdtfile};if fdt addr ${fdt_addr_r}; then bootefi
> ${kernel_addr_r} ${fdt_addr_r}; else bootefi ${kernel_addr_r}
> ${fdtcontroladdr};fi;fi;setenv bootp_vci ${efi_old_vci};setenv
> bootp_arch ${efi_old_arch};setenv efi_fdtfile;setenv efi_old_arch;setenv
> efi_old_vci;
> bootcmd_mmc0=setenv devnum 0; run mmc_boot
> bootcmd_scsi0=setenv devnum 0; run scsi_boot
> bootdelay=2
> cpu=armv8
> distro_bootcmd=setenv scsi_need_init; for target in ${boot_targets}; do
> run bootcmd_${target}; done
> efi_dtb_prefixes=/ /dtb/ /dtb/current/
> ethact=DPMAC1 at xgmii
> ethprime=DPNI1
> fdt_addr_r=0x88000000
> fdt_high=0xa0000000
> fdtcontroladdr=ffcfd498
> fdtfile=fsl-ls2080a-rdb.dtb
> hwconfig=fsl_ddr:bank_intlv=auto
> initrd_high=0xffffffffffffffff
> kernel_addr=0x100000
> kernel_addr_r=0x81000000
> kernel_load=0xa0000000
> kernel_size=0x2800000
> kernel_start=0x581100000
> load_efi_dtb=load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r}
> ${prefix}${efi_fdtfile}
> loadaddr=0x80100000
> mcinitcmd=fsl_mc start mc 0x580300000 0x580800000
> mmc_boot=if mmc dev ${devnum}; then setenv devtype mmc; run
> scan_dev_for_boot_part; fi
> pxefile_addr_r=0x81000000
> ramdisk_addr=0x800000
> ramdisk_addr_r=0x89000000
> ramdisk_size=0x2000000
> scan_dev_for_boot=echo Scanning ${devtype}
> ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run
> scan_dev_for_extlinux; run scan_dev_for_scripts; done;run scan_dev_for_efi;
> scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable
> devplist; env exists devplist || setenv devplist 1; for distro_bootpart
> in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart}
> bootfstype; then run scan_dev_for_boot; fi; done
> scan_dev_for_efi=setenv efi_fdtfile ${fdtfile}; for prefix in
> ${efi_dtb_prefixes}; do if test -e ${devtype}
> ${devnum}:${distro_bootpart} ${prefix}${efi_fdtfile}; then run
> load_efi_dtb; fi;done;if test -e ${devtype} ${devnum}:${distro_bootpart}
> efi/boot/bootaa64.efi; then echo Found EFI removable media binary
> efi/boot/bootaa64.efi; run boot_efi_binary; echo EFI LOAD FAILED:
> continuing...; fi; setenv efi_fdtfile
> scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart}
> ${prefix}extlinux/extlinux.conf; then echo Found
> ${prefix}extlinux/extlinux.conf; run boot_extlinux; echo SCRIPT FAILED:
> continuing...; fi
> scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e
> ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo
> Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT
> FAILED: continuing...; fi; done
> scriptaddr=0x80800000
> scsi_boot=run scsi_init; if scsi dev ${devnum}; then setenv devtype
> scsi; run scan_dev_for_boot_part; fi
> scsi_init=if ${scsi_need_init}; then setenv scsi_need_init false; scsi
> scan; fi
> scsidevs=0
> soc=fsl-layerscape
> stderr=serial
> stdin=serial
> stdout=serial
> usb_boot=usb start; if usb dev ${devnum}; then setenv devtype usb; run
> scan_dev_for_boot_part; fi
> vendor=freescale
> 
> #################
> 
> In there you can see a variable called "boot_targets" which contains the
> values "mmc0 scsi0 dhcp".
> 

Ah, thanks. I didn't realize the macro ends up in the boot_targets.

York

  reply	other threads:[~2016-05-13 19:52 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-13 12:21 [U-Boot] [PATCH 0/5] LS2080ARDB: Enable EFI boot support Alexander Graf
2016-05-13 12:21 ` [U-Boot] [PATCH 1/5] ls2080: Exit dpaa only right before exiting U-Boot Alexander Graf
2016-05-18 12:29   ` Prabhakar Kushwaha
2016-05-27 14:27     ` Alexander Graf
2016-06-07  1:28       ` Prabhakar Kushwaha
2016-06-19 21:58         ` Alexander Graf
2016-06-20  6:24         ` Alexander Graf
2016-05-13 12:21 ` [U-Boot] [PATCH 2/5] ls2080: Disable dcache during ddr init Alexander Graf
2016-05-13 16:28   ` York Sun
2016-05-13 19:43     ` Alexander Graf
2016-05-18 12:17   ` Prabhakar Kushwaha
2016-05-13 12:21 ` [U-Boot] [PATCH 3/5] efi_loader: AArch64: Run EFI payloads in EL2 if U-Boot runs in EL3 Alexander Graf
2016-05-13 12:21 ` [U-Boot] [PATCH 4/5] ls2080ardb: Reserve DP-DDR RAM Alexander Graf
2016-05-13 12:21 ` [U-Boot] [PATCH 5/5] ls2080ardb: Convert to distro boot Alexander Graf
2016-05-13 14:26   ` Stuart Yoder
2016-05-13 14:31     ` Alexander Graf
2016-05-13 16:21       ` York Sun
2016-05-13 17:03         ` Alexander Graf
2016-05-13 17:05           ` York Sun
2016-05-13 19:36             ` Alexander Graf
2016-05-13 19:52               ` York Sun [this message]
2016-05-14 21:21                 ` Bhupesh Sharma
2016-05-16  6:58                   ` Amit Tomer
2016-05-16  7:38                     ` Alexander Graf
2016-05-16 12:04                       ` Bhupesh Sharma
2016-05-16 12:21                         ` Alexander Graf
2016-05-16 13:23                           ` Bhupesh Sharma
2016-05-16 13:49                           ` Peter Newton
2016-05-13 19:42   ` [U-Boot] [PATCH v2 " Alexander Graf
2016-05-15 20:33     ` [U-Boot] [PATCH v3 " Alexander Graf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=57363094.5020905@nxp.com \
    --to=york.sun@nxp.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox