All of lore.kernel.org
 help / color / mirror / Atom feed
From: york sun <york.sun@nxp.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v6 6/6] ls2080ardb: Convert to distro boot
Date: Wed, 19 Oct 2016 22:44:40 +0000	[thread overview]
Message-ID: <AM4PR0401MB17324E1954B14764A2D56F379AD20@AM4PR0401MB1732.eurprd04.prod.outlook.com> (raw)
In-Reply-To: 1476887477-189387-7-git-send-email-agraf@suse.de

On 10/19/2016 09:31 AM, Alexander Graf wrote:
> 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 extends the LS2080ARDB board to use that framework if the
> hard coded NOR flash location does not contain a bootable image.
>
> Signed-off-by: Alexander Graf <agraf@suse.de>
>
> ---
>
> v1 -> v2:
>
>   - Boot NOR flash before distro boot
>
> v2 -> v3:
>
>   - Actually run distro boot (s/&&/||/ after bootm)
>
> v3 -> v4:
>
>   - Add CONFIG_CMD_FS_GENERIC to defconfig
>
> v4 -> v5:
>
>   - Add qspi board
>   - Don't overwrite ethact
>
> v5 -> v6:
>
>   - Move distro conversion to end of queue
>   - use CONFIG_DISTRO_DEFAULTS
> ---
>  Kconfig                      |  1 +
>  include/configs/ls2080ardb.h | 25 ++++++++++++++++++++++++-
>  2 files changed, 25 insertions(+), 1 deletion(-)
>
> diff --git a/Kconfig b/Kconfig
> index 1263d0b..f3a9f73 100644
> --- a/Kconfig
> +++ b/Kconfig
> @@ -56,6 +56,7 @@ config CC_OPTIMIZE_FOR_SIZE
>  config DISTRO_DEFAULTS
>  	bool "Select defaults suitable for booting general purpose Linux distributions"
>  	default y if ARCH_SUNXI
> +	default y if ARCH_LS2080A
>  	default n
>  	select CMD_BOOTZ if ARM && !ARM64
>  	select CMD_BOOTI if ARM64
> diff --git a/include/configs/ls2080ardb.h b/include/configs/ls2080ardb.h
> index ee0f5fc..045cee6 100644
> --- a/include/configs/ls2080ardb.h
> +++ b/include/configs/ls2080ardb.h
> @@ -318,10 +318,24 @@ unsigned long get_board_sys_clk(void);
>  #define CONFIG_USB_MAX_CONTROLLER_COUNT         2
>  #define CONFIG_SYS_USB_XHCI_MAX_ROOT_PORTS      2
>
> +#undef CONFIG_CMDLINE_EDITING
> +#include <config_distro_defaults.h>
> +
> +#define BOOT_TARGET_DEVICES(func) \
> +	func(MMC, mmc, 0) \
> +	func(SCSI, scsi, 0) \
> +	func(DHCP, dhcp, na)

How about USB? During the initial test, I used USB disk as you 
suggested. It is not a reason to respin this patch, just in case you do 
it for other reason.

> +#include <config_distro_bootcmd.h>
> +
>  /* Initial environment variables */
>  #undef CONFIG_EXTRA_ENV_SETTINGS
>  #define CONFIG_EXTRA_ENV_SETTINGS		\
>  	"hwconfig=fsl_ddr:bank_intlv=auto\0"	\
> +	"scriptaddr=0x80800000\0"		\
> +	"kernel_addr_r=0x81000000\0"		\
> +	"pxefile_addr_r=0x81000000\0"		\
> +	"fdt_addr_r=0x88000000\0"		\
> +	"ramdisk_addr_r=0x89000000\0"		\
>  	"loadaddr=0x80100000\0"			\
>  	"kernel_addr=0x100000\0"		\
>  	"ramdisk_addr=0x800000\0"		\
> @@ -331,8 +345,10 @@ unsigned long get_board_sys_clk(void);
>  	"kernel_start=0x581100000\0"		\
>  	"kernel_load=0xa0000000\0"		\
>  	"kernel_size=0x2800000\0"		\
> +	"fdtfile=fsl-ls2080a-rdb.dtb\0"		\
>  	"mcinitcmd=fsl_mc start mc 0x580300000"	\
> -	" 0x580800000 \0"
> +	" 0x580800000 \0"			\
> +	BOOTENV
>
>  #undef CONFIG_BOOTARGS
>  #define CONFIG_BOOTARGS		"console=ttyS1,115200 root=/dev/ram0 " \
> @@ -340,6 +356,13 @@ unsigned long get_board_sys_clk(void);
>  				"ramdisk_size=0x2000000 default_hugepagesz=2m" \
>  				" hugepagesz=2m hugepages=256"
>
> +#undef CONFIG_BOOTCOMMAND
> +/* Try to boot an on-NOR kernel first, then do normal distro boot */
> +#define CONFIG_BOOTCOMMAND "run mcinitcmd && fsl_mc lazyapply dpl 0x580700000" \
> +			   " && cp.b $kernel_start $kernel_load $kernel_size" \
> +			   " && bootm $kernel_load" \
> +			   " || run distro_bootcmd"
> +
>  /* MAC/PHY configuration */
>  #ifdef CONFIG_FSL_MC_ENET
>  #define CONFIG_PHYLIB_10G
>

Reviewed-by: York Sun <york.sun@nxp.com>

  reply	other threads:[~2016-10-19 22:44 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-19 14:31 [U-Boot] [PATCH v6 0/6] LS2080ARDB: Enable EFI boot support Alexander Graf
2016-10-19 14:31 ` [U-Boot] [PATCH v6 1/6] ls2080: Exit dpaa only right before exiting U-Boot Alexander Graf
2016-10-19 14:31 ` [U-Boot] [PATCH v6 2/6] efi_loader: AArch64: Run EFI payloads in EL2 if U-Boot runs in EL3 Alexander Graf
2016-10-19 14:31 ` [U-Boot] [PATCH v6 3/6] ls2080ardb: Reserve DP-DDR RAM Alexander Graf
2016-10-19 14:31 ` [U-Boot] [PATCH v6 4/6] armv8: ls2080a: Declare spin tables as reserved for efi loader Alexander Graf
2016-10-19 22:41   ` york sun
2016-10-19 14:31 ` [U-Boot] [PATCH v6 5/6] armv8: fsl-layerscape: Add support for efi_loader RTS reset Alexander Graf
2016-10-19 14:31 ` [U-Boot] [PATCH v6 6/6] ls2080ardb: Convert to distro boot Alexander Graf
2016-10-19 22:44   ` york sun [this message]
2016-10-20  8:36     ` Alexander Graf
2016-11-15 20:36 ` [U-Boot] [PATCH v6 0/6] LS2080ARDB: Enable EFI boot support Alexander Graf
2016-11-15 22:11   ` york sun
2016-11-15 22:20     ` Alexander Graf
2016-11-16 21:57       ` york sun
2016-11-16 22:04         ` Alexander Graf
2016-11-16 22:22         ` Alexander Graf
2016-11-16 22:29           ` york sun
2016-11-17 10:46     ` Alexander Graf
2016-11-17 16:38       ` york sun

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=AM4PR0401MB17324E1954B14764A2D56F379AD20@AM4PR0401MB1732.eurprd04.prod.outlook.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.