All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v6 0/6] LS2080ARDB: Enable EFI boot support
@ 2016-10-19 14:31 Alexander Graf
  2016-10-19 14:31 ` [U-Boot] [PATCH v6 1/6] ls2080: Exit dpaa only right before exiting U-Boot Alexander Graf
                   ` (6 more replies)
  0 siblings, 7 replies; 19+ messages in thread
From: Alexander Graf @ 2016-10-19 14:31 UTC (permalink / raw)
  To: u-boot

We now have EFI support in U-Boot which worked out of the box on all systems
that I tried it on so far. Except for the LS2080ARDB. With this patch set
I can successfully boot grub2 and Linux from there on such a system - even
using PXE.

This patch set depends on the efi-next queue and the efi runtime rename patch.
For easy pulling, you can find the fully applied tree here:

  https://github.com/agraf/u-boot.git ls2085-efi-support-v6


v3 -> v4:

  - Add CONFIG_CMD_FS_GENERIC to defconfig
  - Move code into generic quiesce weak function
  - Exit device for real when going to Linux
  - Only apply DPL if we have something to apply
  - New: armv8: ls2080a: Declare spin tables as reserved for efi loader
  - New: efi_loader: Allow boards to implement get_time and reset_system
  - New: armv8: fsl-layerscape: Add support for efi_loader RTS reset
  - New: efi_loader: Declare secure memory as reserved
  - New: efi_loader: Allow bouncing for network

v4 -> v5:

  - Drop patches that are in the efi queue already
    - efi_loader: Allow boards to implement get_time and reset_system
    - efi_loader: Allow bouncing for network
  - Remove manual ttbr / tcr copy
  - Regenerate page tables in EL2, getting us non-secured page tables
  - Add qspi board
  - Don't overwrite ethact
  - Use __efi_runtime tags
  - Use gd->arch.secure_ram

v5 -> v6:

  - Move distro conversion to end of queue
  - use CONFIG_DISTRO_DEFAULTS
  - drop patch: "efi_loader: Declare secure memory as reserved"

Alexander Graf (6):
  ls2080: Exit dpaa only right before exiting U-Boot
  efi_loader: AArch64: Run EFI payloads in EL2 if U-Boot runs in EL3
  ls2080ardb: Reserve DP-DDR RAM
  armv8: ls2080a: Declare spin tables as reserved for efi loader
  armv8: fsl-layerscape: Add support for efi_loader RTS reset
  ls2080ardb: Convert to distro boot

 Kconfig                                 |  1 +
 arch/arm/cpu/armv8/fsl-layerscape/cpu.c | 33 +++++++++++++++++++++++++++++++--
 arch/arm/cpu/armv8/fsl-layerscape/fdt.c |  6 ++++++
 arch/arm/include/asm/u-boot-arm.h       |  1 +
 arch/arm/lib/bootm.c                    |  7 +++++++
 board/freescale/ls2080a/ls2080a.c       |  6 +++++-
 board/freescale/ls2080aqds/ls2080aqds.c | 11 +++++------
 board/freescale/ls2080ardb/ls2080ardb.c | 20 ++++++++++++++------
 cmd/bootefi.c                           | 11 +++++++++++
 drivers/net/fsl-mc/mc.c                 | 24 ++++++++++++++++++++++--
 include/configs/ls2080ardb.h            | 25 ++++++++++++++++++++++++-
 lib/efi_loader/efi_boottime.c           |  2 ++
 12 files changed, 129 insertions(+), 18 deletions(-)

-- 
1.8.5.6

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [U-Boot] [PATCH v6 1/6] ls2080: Exit dpaa only right before exiting U-Boot
  2016-10-19 14:31 [U-Boot] [PATCH v6 0/6] LS2080ARDB: Enable EFI boot support Alexander Graf
@ 2016-10-19 14:31 ` 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
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 19+ messages in thread
From: Alexander Graf @ 2016-10-19 14:31 UTC (permalink / raw)
  To: u-boot

On ls2080 we have a separate network fabric component which we need to
shut down before we enter Linux (or any other OS). Along with that also
comes configuration of the fabric using a description file.

Today we always stop and configure the fabric in the boot script and
(again) exit it on device tree generation. This works ok for the normal
booti case, but with bootefi the payload we're running may still want to
access the network.

So let's add a new fsl_mc command that defers configuration and stopping
the hardware to when we actually exit U-Boot, so that we can still use
the fabric from an EFI payload.

For existing boot scripts, nothing should change with this patch.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: York Sun <york.sun@nxp.com>

---

v3 -> v4:

  - Move code into generic quiesce weak function
  - Exit device for real when going to Linux
  - Only apply DPL if we have something to apply
---
 arch/arm/include/asm/u-boot-arm.h       |  1 +
 arch/arm/lib/bootm.c                    |  7 +++++++
 board/freescale/ls2080a/ls2080a.c       |  6 +++++-
 board/freescale/ls2080aqds/ls2080aqds.c | 11 +++++------
 board/freescale/ls2080ardb/ls2080ardb.c | 11 +++++------
 drivers/net/fsl-mc/mc.c                 | 24 ++++++++++++++++++++++--
 lib/efi_loader/efi_boottime.c           |  2 ++
 7 files changed, 47 insertions(+), 15 deletions(-)

diff --git a/arch/arm/include/asm/u-boot-arm.h b/arch/arm/include/asm/u-boot-arm.h
index 414042d..023daf5 100644
--- a/arch/arm/include/asm/u-boot-arm.h
+++ b/arch/arm/include/asm/u-boot-arm.h
@@ -37,6 +37,7 @@ int	arch_early_init_r(void);
 /* board/.../... */
 int	board_init(void);
 void	dram_init_banksize (void);
+void    board_quiesce_devices(void);
 
 /* cpu/.../interrupt.c */
 int	arch_interrupt_init	(void);
diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
index 53c3141..dedcd1e 100644
--- a/arch/arm/lib/bootm.c
+++ b/arch/arm/lib/bootm.c
@@ -64,6 +64,10 @@ void arch_lmb_reserve(struct lmb *lmb)
 		    gd->bd->bi_dram[0].start + gd->bd->bi_dram[0].size - sp);
 }
 
+__weak void board_quiesce_devices(void)
+{
+}
+
 /**
  * announce_and_cleanup() - Print message and prepare for kernel boot
  *
@@ -84,6 +88,9 @@ static void announce_and_cleanup(int fake)
 #ifdef CONFIG_USB_DEVICE
 	udc_disconnect();
 #endif
+
+	board_quiesce_devices();
+
 	cleanup_before_linux();
 }
 
diff --git a/board/freescale/ls2080a/ls2080a.c b/board/freescale/ls2080a/ls2080a.c
index d0a88d4..4f9b9c8 100644
--- a/board/freescale/ls2080a/ls2080a.c
+++ b/board/freescale/ls2080a/ls2080a.c
@@ -102,6 +102,11 @@ void fdt_fixup_board_enet(void *fdt)
 	else
 		fdt_status_fail(fdt, offset);
 }
+
+void board_quiesce_devices(void)
+{
+	fsl_mc_ldpaa_exit(gd->bd);
+}
 #endif
 
 #ifdef CONFIG_OF_BOARD_SETUP
@@ -122,7 +127,6 @@ int ft_board_setup(void *blob, bd_t *bd)
 
 #ifdef CONFIG_FSL_MC_ENET
 	fdt_fixup_board_enet(blob);
-	fsl_mc_ldpaa_exit(bd);
 #endif
 
 	return 0;
diff --git a/board/freescale/ls2080aqds/ls2080aqds.c b/board/freescale/ls2080aqds/ls2080aqds.c
index d07ca18..73a61fd 100644
--- a/board/freescale/ls2080aqds/ls2080aqds.c
+++ b/board/freescale/ls2080aqds/ls2080aqds.c
@@ -292,14 +292,16 @@ void fdt_fixup_board_enet(void *fdt)
 	else
 		fdt_status_fail(fdt, offset);
 }
+
+void board_quiesce_devices(void)
+{
+	fsl_mc_ldpaa_exit(gd->bd);
+}
 #endif
 
 #ifdef CONFIG_OF_BOARD_SETUP
 int ft_board_setup(void *blob, bd_t *bd)
 {
-#ifdef CONFIG_FSL_MC_ENET
-	int err;
-#endif
 	u64 base[CONFIG_NR_DRAM_BANKS];
 	u64 size[CONFIG_NR_DRAM_BANKS];
 
@@ -317,9 +319,6 @@ int ft_board_setup(void *blob, bd_t *bd)
 
 #ifdef CONFIG_FSL_MC_ENET
 	fdt_fixup_board_enet(blob);
-	err = fsl_mc_ldpaa_exit(bd);
-	if (err)
-		return err;
 #endif
 
 	return 0;
diff --git a/board/freescale/ls2080ardb/ls2080ardb.c b/board/freescale/ls2080ardb/ls2080ardb.c
index 83d9e7e..fab44b9 100644
--- a/board/freescale/ls2080ardb/ls2080ardb.c
+++ b/board/freescale/ls2080ardb/ls2080ardb.c
@@ -256,14 +256,16 @@ void fdt_fixup_board_enet(void *fdt)
 	else
 		fdt_status_fail(fdt, offset);
 }
+
+void board_quiesce_devices(void)
+{
+	fsl_mc_ldpaa_exit(gd->bd);
+}
 #endif
 
 #ifdef CONFIG_OF_BOARD_SETUP
 int ft_board_setup(void *blob, bd_t *bd)
 {
-#ifdef CONFIG_FSL_MC_ENET
-	int err;
-#endif
 	u64 base[CONFIG_NR_DRAM_BANKS];
 	u64 size[CONFIG_NR_DRAM_BANKS];
 
@@ -281,9 +283,6 @@ int ft_board_setup(void *blob, bd_t *bd)
 
 #ifdef CONFIG_FSL_MC_ENET
 	fdt_fixup_board_enet(blob);
-	err = fsl_mc_ldpaa_exit(bd);
-	if (err)
-		return err;
 #endif
 
 	return 0;
diff --git a/drivers/net/fsl-mc/mc.c b/drivers/net/fsl-mc/mc.c
index 1811b0f..46b8a6b 100644
--- a/drivers/net/fsl-mc/mc.c
+++ b/drivers/net/fsl-mc/mc.c
@@ -40,6 +40,7 @@ int child_dprc_id;
 struct fsl_dpbp_obj *dflt_dpbp = NULL;
 struct fsl_dpio_obj *dflt_dpio = NULL;
 struct fsl_dpni_obj *dflt_dpni = NULL;
+static u64 mc_lazy_dpl_addr;
 
 #ifdef DEBUG
 void dump_ram_words(const char *title, void *addr)
@@ -572,6 +573,9 @@ int mc_apply_dpl(u64 mc_dpl_addr)
 	u64 mc_ram_addr = mc_get_dram_addr();
 	size_t mc_ram_size = mc_get_dram_block_size();
 
+	if (!mc_dpl_addr)
+		return -1;
+
 	error = load_mc_dpl(mc_ram_addr, mc_ram_size, mc_dpl_addr);
 	if (error != 0)
 		return error;
@@ -1156,6 +1160,11 @@ int fsl_mc_ldpaa_exit(bd_t *bd)
 {
 	int err = 0;
 
+	if (bd && mc_lazy_dpl_addr && !fsl_mc_ldpaa_exit(NULL)) {
+		mc_apply_dpl(mc_lazy_dpl_addr);
+		mc_lazy_dpl_addr = 0;
+	}
+
 	/* MC is not loaded intentionally, So return success. */
 	if (bd && get_mc_boot_status() != 0)
 		return 0;
@@ -1259,6 +1268,7 @@ static int do_fsl_mc(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 		}
 		break;
 
+	case 'l':
 	case 'a': {
 			u64 mc_dpl_addr;
 
@@ -1279,8 +1289,17 @@ static int do_fsl_mc(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 				return -ENODEV;
 			}
 
-			if (!fsl_mc_ldpaa_exit(NULL))
-				err = mc_apply_dpl(mc_dpl_addr);
+			if (argv[1][0] == 'l') {
+				/*
+				 * We will do the actual dpaa exit and dpl apply
+				 * later from announce_and_cleanup().
+				 */
+				mc_lazy_dpl_addr = mc_dpl_addr;
+			} else {
+				/* The user wants it applied now */
+				if (!fsl_mc_ldpaa_exit(NULL))
+					err = mc_apply_dpl(mc_dpl_addr);
+			}
 			break;
 		}
 	default:
@@ -1298,5 +1317,6 @@ U_BOOT_CMD(
 	"DPAA2 command to manage Management Complex (MC)",
 	"start mc [FW_addr] [DPC_addr] - Start Management Complex\n"
 	"fsl_mc apply DPL [DPL_addr] - Apply DPL file\n"
+	"fsl_mc lazyapply DPL [DPL_addr] - Apply DPL file on exit\n"
 	"fsl_mc start aiop [FW_addr] - Start AIOP\n"
 );
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index 1fdddf4..51080cb 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -538,6 +538,8 @@ static efi_status_t EFIAPI efi_exit_boot_services(void *image_handle,
 {
 	EFI_ENTRY("%p, %ld", image_handle, map_key);
 
+	board_quiesce_devices();
+
 	/* Fix up caches for EFI payloads if necessary */
 	efi_exit_caches();
 
-- 
1.8.5.6

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [U-Boot] [PATCH v6 2/6] efi_loader: AArch64: Run EFI payloads in EL2 if U-Boot runs in EL3
  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 ` Alexander Graf
  2016-10-19 14:31 ` [U-Boot] [PATCH v6 3/6] ls2080ardb: Reserve DP-DDR RAM Alexander Graf
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 19+ messages in thread
From: Alexander Graf @ 2016-10-19 14:31 UTC (permalink / raw)
  To: u-boot

Some boards decided not to run ATF or other secure firmware in EL3, so
they instead run U-Boot there. The uEFI spec doesn't know what EL3 is
though - it only knows about EL2 and EL1. So if we see that we're running
in EL3, let's get into EL2 to make payloads happy.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: York Sun <york.sun@nxp.com>

---

v4 -> v5:

  - Remove manual ttbr / tcr copy
  - Regenerate page tables in EL2, getting us non-secured page tables
---
 cmd/bootefi.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index c8079c4..a9910d7 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -226,6 +226,17 @@ static unsigned long do_bootefi_exec(void *efi, void *fdt)
 		return status == EFI_SUCCESS ? 0 : -EINVAL;
 	}
 
+#ifdef CONFIG_ARM64
+	/* On AArch64 we need to make sure we call our payload in < EL3 */
+	if (current_el() == 3) {
+		smp_kick_all_cpus();
+		dcache_disable();	/* flush cache before switch to EL2 */
+		armv8_switch_to_el2();
+		/* Enable caches again */
+		dcache_enable();
+	}
+#endif
+
 	return entry(&loaded_image_info, &systab);
 }
 
-- 
1.8.5.6

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [U-Boot] [PATCH v6 3/6] ls2080ardb: Reserve DP-DDR RAM
  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 ` 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
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 19+ messages in thread
From: Alexander Graf @ 2016-10-19 14:31 UTC (permalink / raw)
  To: u-boot

The DP-DDR shouldn't be exposed as conventional memory to an OS, so let's
rather claim it's a reserved region in the EFI memory map

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: York Sun <york.sun@nxp.com>
---
 board/freescale/ls2080ardb/ls2080ardb.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/board/freescale/ls2080ardb/ls2080ardb.c b/board/freescale/ls2080ardb/ls2080ardb.c
index fab44b9..55199ca 100644
--- a/board/freescale/ls2080ardb/ls2080ardb.c
+++ b/board/freescale/ls2080ardb/ls2080ardb.c
@@ -15,6 +15,7 @@
 #include <libfdt.h>
 #include <fsl-mc/fsl_mc.h>
 #include <environment.h>
+#include <efi_loader.h>
 #include <i2c.h>
 #include <asm/arch/soc.h>
 #include <fsl_sec.h>
@@ -201,6 +202,14 @@ int misc_init_r(void)
 	if (adjust_vdd(0))
 		printf("Warning: Adjusting core voltage failed.\n");
 
+#ifdef CONFIG_EFI_LOADER
+	if (soc_has_dp_ddr() && gd->bd->bi_dram[2].size) {
+		efi_add_memory_map(gd->bd->bi_dram[2].start,
+				   gd->bd->bi_dram[2].size >> EFI_PAGE_SHIFT,
+				   EFI_RESERVED_MEMORY_TYPE, false);
+	}
+#endif
+
 	return 0;
 }
 
-- 
1.8.5.6

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [U-Boot] [PATCH v6 4/6] armv8: ls2080a: Declare spin tables as reserved for efi loader
  2016-10-19 14:31 [U-Boot] [PATCH v6 0/6] LS2080ARDB: Enable EFI boot support Alexander Graf
                   ` (2 preceding siblings ...)
  2016-10-19 14:31 ` [U-Boot] [PATCH v6 3/6] ls2080ardb: Reserve DP-DDR RAM Alexander Graf
@ 2016-10-19 14:31 ` 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
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 19+ messages in thread
From: Alexander Graf @ 2016-10-19 14:31 UTC (permalink / raw)
  To: u-boot

The efi loader code has its own memory map, so it needs to be aware where
the spin tables are located, to ensure that no code writes into those
regions.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 arch/arm/cpu/armv8/fsl-layerscape/fdt.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/cpu/armv8/fsl-layerscape/fdt.c b/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
index 1a8321b..facfcca 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <efi_loader.h>
 #include <libfdt.h>
 #include <fdt_support.h>
 #include <phy.h>
@@ -105,6 +106,11 @@ remove_psci_node:
 
 	fdt_add_mem_rsv(blob, (uintptr_t)&secondary_boot_code,
 			*boot_code_size);
+#ifdef CONFIG_EFI_LOADER
+	efi_add_memory_map((uintptr_t)&secondary_boot_code,
+			   ALIGN(*boot_code_size, EFI_PAGE_SIZE) >> EFI_PAGE_SHIFT,
+			   EFI_RESERVED_MEMORY_TYPE, false);
+#endif
 }
 #endif
 
-- 
1.8.5.6

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [U-Boot] [PATCH v6 5/6] armv8: fsl-layerscape: Add support for efi_loader RTS reset
  2016-10-19 14:31 [U-Boot] [PATCH v6 0/6] LS2080ARDB: Enable EFI boot support Alexander Graf
                   ` (3 preceding siblings ...)
  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 14:31 ` Alexander Graf
  2016-10-19 14:31 ` [U-Boot] [PATCH v6 6/6] ls2080ardb: Convert to distro boot Alexander Graf
  2016-11-15 20:36 ` [U-Boot] [PATCH v6 0/6] LS2080ARDB: Enable EFI boot support Alexander Graf
  6 siblings, 0 replies; 19+ messages in thread
From: Alexander Graf @ 2016-10-19 14:31 UTC (permalink / raw)
  To: u-boot

When implementing efi loader support, we can expose runtime services
for payloads. One such service is CPU reset.

This patch implements RTS CPU reset support for layerscape systems.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: York Sun <york.sun@nxp.com>

---

v4 -> v5:

  - Use __efi_runtime tags
---
 arch/arm/cpu/armv8/fsl-layerscape/cpu.c | 33 +++++++++++++++++++++++++++++++--
 1 file changed, 31 insertions(+), 2 deletions(-)

diff --git a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
index b7a2e0c..0b516e3 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
@@ -17,6 +17,7 @@
 #ifdef CONFIG_MP
 #include <asm/arch/mp.h>
 #endif
+#include <efi_loader.h>
 #include <fm_eth.h>
 #include <fsl-mc/fsl_mc.h>
 #ifdef CONFIG_FSL_ESDHC
@@ -462,9 +463,10 @@ int timer_init(void)
 	return 0;
 }
 
-void reset_cpu(ulong addr)
+__efi_runtime_data u32 __iomem *rstcr = (u32 *)CONFIG_SYS_FSL_RST_ADDR;
+
+void __efi_runtime reset_cpu(ulong addr)
 {
-	u32 __iomem *rstcr = (u32 *)CONFIG_SYS_FSL_RST_ADDR;
 	u32 val;
 
 	/* Raise RESET_REQ_B */
@@ -473,6 +475,33 @@ void reset_cpu(ulong addr)
 	scfg_out32(rstcr, val);
 }
 
+#ifdef CONFIG_EFI_LOADER
+
+void __efi_runtime EFIAPI efi_reset_system(
+		       enum efi_reset_type reset_type,
+		       efi_status_t reset_status,
+		       unsigned long data_size, void *reset_data)
+{
+	switch (reset_type) {
+	case EFI_RESET_COLD:
+	case EFI_RESET_WARM:
+		reset_cpu(0);
+		break;
+	case EFI_RESET_SHUTDOWN:
+		/* Nothing we can do */
+		break;
+	}
+
+	while (1) { }
+}
+
+void efi_reset_system_init(void)
+{
+       efi_add_runtime_mmio(&rstcr, sizeof(*rstcr));
+}
+
+#endif
+
 phys_size_t board_reserve_ram_top(phys_size_t ram_size)
 {
 	phys_size_t ram_top = ram_size;
-- 
1.8.5.6

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [U-Boot] [PATCH v6 6/6] ls2080ardb: Convert to distro boot
  2016-10-19 14:31 [U-Boot] [PATCH v6 0/6] LS2080ARDB: Enable EFI boot support Alexander Graf
                   ` (4 preceding siblings ...)
  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 ` Alexander Graf
  2016-10-19 22:44   ` york sun
  2016-11-15 20:36 ` [U-Boot] [PATCH v6 0/6] LS2080ARDB: Enable EFI boot support Alexander Graf
  6 siblings, 1 reply; 19+ messages in thread
From: Alexander Graf @ 2016-10-19 14:31 UTC (permalink / raw)
  To: u-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 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)
+#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
-- 
1.8.5.6

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [U-Boot] [PATCH v6 4/6] armv8: ls2080a: Declare spin tables as reserved for efi loader
  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
  0 siblings, 0 replies; 19+ messages in thread
From: york sun @ 2016-10-19 22:41 UTC (permalink / raw)
  To: u-boot

On 10/19/2016 09:31 AM, Alexander Graf wrote:
> The efi loader code has its own memory map, so it needs to be aware where
> the spin tables are located, to ensure that no code writes into those
> regions.
>
> Signed-off-by: Alexander Graf <agraf@suse.de>
> ---
>  arch/arm/cpu/armv8/fsl-layerscape/fdt.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/arch/arm/cpu/armv8/fsl-layerscape/fdt.c b/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
> index 1a8321b..facfcca 100644
> --- a/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
> +++ b/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
> @@ -5,6 +5,7 @@
>   */
>
>  #include <common.h>
> +#include <efi_loader.h>
>  #include <libfdt.h>
>  #include <fdt_support.h>
>  #include <phy.h>
> @@ -105,6 +106,11 @@ remove_psci_node:
>
>  	fdt_add_mem_rsv(blob, (uintptr_t)&secondary_boot_code,
>  			*boot_code_size);
> +#ifdef CONFIG_EFI_LOADER
> +	efi_add_memory_map((uintptr_t)&secondary_boot_code,
> +			   ALIGN(*boot_code_size, EFI_PAGE_SIZE) >> EFI_PAGE_SHIFT,
> +			   EFI_RESERVED_MEMORY_TYPE, false);
> +#endif
>  }
>  #endif
>
>

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

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [U-Boot] [PATCH v6 6/6] ls2080ardb: Convert to distro boot
  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
  2016-10-20  8:36     ` Alexander Graf
  0 siblings, 1 reply; 19+ messages in thread
From: york sun @ 2016-10-19 22:44 UTC (permalink / raw)
  To: u-boot

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>

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [U-Boot] [PATCH v6 6/6] ls2080ardb: Convert to distro boot
  2016-10-19 22:44   ` york sun
@ 2016-10-20  8:36     ` Alexander Graf
  0 siblings, 0 replies; 19+ messages in thread
From: Alexander Graf @ 2016-10-20  8:36 UTC (permalink / raw)
  To: u-boot


> On 20 Oct 2016, at 00:44, york sun <york.sun@nxp.com> wrote:
> 
> 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.

No particular reason, just oversight. I can send a follow-up patch on top of this set to add usb support as well.

Alex

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [U-Boot] [PATCH v6 0/6] LS2080ARDB: Enable EFI boot support
  2016-10-19 14:31 [U-Boot] [PATCH v6 0/6] LS2080ARDB: Enable EFI boot support Alexander Graf
                   ` (5 preceding siblings ...)
  2016-10-19 14:31 ` [U-Boot] [PATCH v6 6/6] ls2080ardb: Convert to distro boot Alexander Graf
@ 2016-11-15 20:36 ` Alexander Graf
  2016-11-15 22:11   ` york sun
  6 siblings, 1 reply; 19+ messages in thread
From: Alexander Graf @ 2016-11-15 20:36 UTC (permalink / raw)
  To: u-boot

Hi York,

Do you want to take that patch set?


Thanks,

Alex

On 19/10/2016 16:31, Alexander Graf wrote:
> We now have EFI support in U-Boot which worked out of the box on all systems
> that I tried it on so far. Except for the LS2080ARDB. With this patch set
> I can successfully boot grub2 and Linux from there on such a system - even
> using PXE.
>
> This patch set depends on the efi-next queue and the efi runtime rename patch.
> For easy pulling, you can find the fully applied tree here:
>
>   https://github.com/agraf/u-boot.git ls2085-efi-support-v6
>
>
> v3 -> v4:
>
>   - Add CONFIG_CMD_FS_GENERIC to defconfig
>   - Move code into generic quiesce weak function
>   - Exit device for real when going to Linux
>   - Only apply DPL if we have something to apply
>   - New: armv8: ls2080a: Declare spin tables as reserved for efi loader
>   - New: efi_loader: Allow boards to implement get_time and reset_system
>   - New: armv8: fsl-layerscape: Add support for efi_loader RTS reset
>   - New: efi_loader: Declare secure memory as reserved
>   - New: efi_loader: Allow bouncing for network
>
> v4 -> v5:
>
>   - Drop patches that are in the efi queue already
>     - efi_loader: Allow boards to implement get_time and reset_system
>     - efi_loader: Allow bouncing for network
>   - Remove manual ttbr / tcr copy
>   - Regenerate page tables in EL2, getting us non-secured page tables
>   - Add qspi board
>   - Don't overwrite ethact
>   - Use __efi_runtime tags
>   - Use gd->arch.secure_ram
>
> v5 -> v6:
>
>   - Move distro conversion to end of queue
>   - use CONFIG_DISTRO_DEFAULTS
>   - drop patch: "efi_loader: Declare secure memory as reserved"
>
> Alexander Graf (6):
>   ls2080: Exit dpaa only right before exiting U-Boot
>   efi_loader: AArch64: Run EFI payloads in EL2 if U-Boot runs in EL3
>   ls2080ardb: Reserve DP-DDR RAM
>   armv8: ls2080a: Declare spin tables as reserved for efi loader
>   armv8: fsl-layerscape: Add support for efi_loader RTS reset
>   ls2080ardb: Convert to distro boot
>
>  Kconfig                                 |  1 +
>  arch/arm/cpu/armv8/fsl-layerscape/cpu.c | 33 +++++++++++++++++++++++++++++++--
>  arch/arm/cpu/armv8/fsl-layerscape/fdt.c |  6 ++++++
>  arch/arm/include/asm/u-boot-arm.h       |  1 +
>  arch/arm/lib/bootm.c                    |  7 +++++++
>  board/freescale/ls2080a/ls2080a.c       |  6 +++++-
>  board/freescale/ls2080aqds/ls2080aqds.c | 11 +++++------
>  board/freescale/ls2080ardb/ls2080ardb.c | 20 ++++++++++++++------
>  cmd/bootefi.c                           | 11 +++++++++++
>  drivers/net/fsl-mc/mc.c                 | 24 ++++++++++++++++++++++--
>  include/configs/ls2080ardb.h            | 25 ++++++++++++++++++++++++-
>  lib/efi_loader/efi_boottime.c           |  2 ++
>  12 files changed, 129 insertions(+), 18 deletions(-)
>

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [U-Boot] [PATCH v6 0/6] LS2080ARDB: Enable EFI boot support
  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-17 10:46     ` Alexander Graf
  0 siblings, 2 replies; 19+ messages in thread
From: york sun @ 2016-11-15 22:11 UTC (permalink / raw)
  To: u-boot


On 11/15/2016 12:36 PM, Alexander Graf wrote:
> Hi York,
>
> Do you want to take that patch set?
>

Yes, I can. I saw it assigned to you in patchwork so I didn't act.

York

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [U-Boot] [PATCH v6 0/6] LS2080ARDB: Enable EFI boot support
  2016-11-15 22:11   ` york sun
@ 2016-11-15 22:20     ` Alexander Graf
  2016-11-16 21:57       ` york sun
  2016-11-17 10:46     ` Alexander Graf
  1 sibling, 1 reply; 19+ messages in thread
From: Alexander Graf @ 2016-11-15 22:20 UTC (permalink / raw)
  To: u-boot



On 15/11/2016 23:11, york sun wrote:
>
> On 11/15/2016 12:36 PM, Alexander Graf wrote:
>> Hi York,
>>
>> Do you want to take that patch set?
>>
>
> Yes, I can. I saw it assigned to you in patchwork so I didn't act.

I think since it's really hardware enablement for your platform, I'd 
prefer if you pull them all in.


Thanks,

Alex

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [U-Boot] [PATCH v6 0/6] LS2080ARDB: Enable EFI boot support
  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
  0 siblings, 2 replies; 19+ messages in thread
From: york sun @ 2016-11-16 21:57 UTC (permalink / raw)
  To: u-boot

On 11/15/2016 02:20 PM, Alexander Graf wrote:
>
>
> On 15/11/2016 23:11, york sun wrote:
>>
>> On 11/15/2016 12:36 PM, Alexander Graf wrote:
>>> Hi York,
>>>
>>> Do you want to take that patch set?
>>>
>>
>> Yes, I can. I saw it assigned to you in patchwork so I didn't act.
>
> I think since it's really hardware enablement for your platform, I'd
> prefer if you pull them all in.
>
>

Alex,

I got compiling warnings

19: ls2080: Exit dpaa only right before exiting U-Boot
20: efi_loader: AArch64: Run EFI payloads in EL2 if U-Boot runs in EL3
21: ls2080ardb: Reserve DP-DDR RAM
    aarch64:  +   ls2080ardb_nand
+(ls2080ardb_nand)    efi_add_memory_map(gd->bd->bi_dram[2].start,
+(ls2080ardb_nand)    ^
w+(ls2080ardb_nand) ../board/freescale/ls2080ardb/ls2080ardb.c: In 
function 'misc_init_r':
w+(ls2080ardb_nand) ../board/freescale/ls2080ardb/ls2080ardb.c:207:3: 
warning: implicit declaration of function 'efi_add_memory_map' 
[-Wimplicit-function-declaration]
22: armv8: ls2080a: Declare spin tables as reserved for efi loader
    aarch64:  +   ls1046aqds_sdcard_ifc ls2080aqds_nand ls1046aqds_nand 
ls1043aqds_nand ls1043ardb_nand ls1046aqds_sdcard_qspi 
ls1043aqds_sdcard_qspi ls1046ardb_sdcard ls1043ardb_sdcard 
ls1043aqds_sdcard_ifc ls1046ardb_emmc
+(ls2080ardb_nand,ls1046aqds_sdcard_ifc,ls2080aqds_nand,ls1046aqds_nand,ls1043aqds_nand,ls1043ardb_nand,ls1046aqds_sdcard_qspi,ls1043aqds_sdcard_qspi,ls1046ardb_sdcard,ls1043ardb_sdcard,ls1043aqds_sdcard_ifc,ls1046ardb_emmc) 
   efi_add_memory_map((uintptr_t)&secondary_boot_code,
+(ls2080ardb_nand,ls1046aqds_sdcard_ifc,ls2080aqds_nand,ls1046aqds_nand,ls1043aqds_nand,ls1043ardb_nand,ls1046aqds_sdcard_qspi,ls1043aqds_sdcard_qspi,ls1046ardb_sdcard,ls1043ardb_sdcard,ls1043aqds_sdcard_ifc,ls1046ardb_emmc) 
   ^
w+(ls2080ardb_nand,ls1046aqds_sdcard_ifc,ls2080aqds_nand,ls1046aqds_nand,ls1043aqds_nand,ls1043ardb_nand,ls1046aqds_sdcard_qspi,ls1043aqds_sdcard_qspi,ls1046ardb_sdcard,ls1043ardb_sdcard,ls1043aqds_sdcard_ifc,ls1046ardb_emmc) 
../arch/arm/cpu/armv8/fsl-layerscape/fdt.c: In function 'ft_fixup_cpu':
w+(ls2080ardb_nand,ls1046aqds_sdcard_ifc,ls2080aqds_nand,ls1046aqds_nand,ls1043aqds_nand,ls1043ardb_nand,ls1046aqds_sdcard_qspi,ls1043aqds_sdcard_qspi,ls1046ardb_sdcard,ls1043ardb_sdcard,ls1043aqds_sdcard_ifc,ls1046ardb_emmc) 
../arch/arm/cpu/armv8/fsl-layerscape/fdt.c:110:2: warning: implicit 
declaration of function 'efi_add_memory_map' 
[-Wimplicit-function-declaration]
23: armv8: fsl-layerscape: Add support for efi_loader RTS reset
    aarch64:  +   ls1046aqds_sdcard_ifc ls1043aqds ls1046aqds_nand 
ls1046aqds ls1046ardb_qspi ls1043aqds_qspi ls1043aqds_nand 
ls1046aqds_lpuart ls1043aqds_lpuart ls1046aqds_sdcard_qspi 
ls1043aqds_sdcard_qspi ls1046ardb_sdcard ls1043aqds_nor_ddr3 
ls1046aqds_qspi ls1043aqds_sdcard_ifc ls1046ardb_emmc
+(ls2080ardb_nand,ls2080aqds_nand,ls1043ardb_nand,ls1043ardb_sdcard) 
     efi_add_runtime_mmio(&rstcr, sizeof(*rstcr));
+(ls2080ardb_nand,ls2080aqds_nand,ls1043ardb_nand,ls1043ardb_sdcard) 
     ^
+(ls2080ardb_nand,ls2080aqds_nand,ls1043ardb_nand,ls1043ardb_sdcard) In 
file included from ../arch/arm/cpu/armv8/fsl-layerscape/cpu.c:20:0:
+(ls2080ardb_nand,ls2080aqds_nand,ls1043ardb_nand,ls1043ardb_sdcard) 
../include/efi_loader.h:184:91: note: expected 'void **' but argument is 
of type 'u32 **'
+(ls2080ardb_nand,ls2080aqds_nand,ls1043ardb_nand,ls1043ardb_sdcard) 
static inline void efi_add_runtime_mmio(void **mmio_ptr, u64 len) { }
+(ls2080ardb_nand,ls2080aqds_nand,ls1043ardb_nand,ls1043ardb_sdcard) 
 
                ^
+(ls1046aqds_sdcard_ifc,ls1043aqds,ls1046aqds_nand,ls1046aqds,ls1046ardb_qspi,ls1043aqds_qspi,ls1043aqds_nand,ls1046aqds_lpuart,ls1043aqds_lpuart,ls1046aqds_sdcard_qspi,ls1043aqds_sdcard_qspi,ls1043aqds_nor_ddr3,ls1046ardb_sdcard,ls1046aqds_qspi,ls1043aqds_sdcard_ifc,ls1046ardb_emmc) 
arch/arm/cpu/armv8/fsl-layerscape/built-in.o: In function 
`efi_reset_system':
+(ls1046aqds_sdcard_ifc,ls1043aqds,ls1046aqds_nand,ls1046aqds,ls1046ardb_qspi,ls1043aqds_qspi,ls1043aqds_nand,ls1046aqds_lpuart,ls1043aqds_lpuart,ls1046aqds_sdcard_qspi,ls1043aqds_sdcard_qspi,ls1043aqds_nor_ddr3,ls1046ardb_sdcard,ls1046aqds_qspi,ls1043aqds_sdcard_ifc,ls1046ardb_emmc) 
build/../arch/arm/cpu/armv8/fsl-layerscape/cpu.c:489: multiple 
definition of `efi_reset_system'
+(ls1046aqds_sdcard_ifc,ls1043aqds,ls1046aqds_nand,ls1046aqds,ls1046ardb_qspi,ls1043aqds_qspi,ls1043aqds_nand,ls1046aqds_lpuart,ls1043aqds_lpuart,ls1046aqds_sdcard_qspi,ls1043aqds_sdcard_qspi,ls1043aqds_nor_ddr3,ls1046ardb_sdcard,ls1046aqds_qspi,ls1043aqds_sdcard_ifc,ls1046ardb_emmc) 
arch/arm/cpu/armv8/fwcall.o:build/../arch/arm/cpu/armv8/fwcall.c:128: 
first defined here
+(ls1046aqds_sdcard_ifc,ls1043aqds,ls1046aqds_nand,ls1046aqds,ls1046ardb_qspi,ls1043aqds_qspi,ls1043aqds_nand,ls1046aqds_lpuart,ls1043aqds_lpuart,ls1046aqds_sdcard_qspi,ls1043aqds_sdcard_qspi,ls1043aqds_nor_ddr3,ls1046ardb_sdcard,ls1046aqds_qspi,ls1043aqds_sdcard_ifc,ls1046ardb_emmc) 
make[2]: *** [arch/arm/cpu/armv8/built-in.o] Error 1
+(ls1046aqds_sdcard_ifc,ls1043aqds,ls1046aqds_nand,ls1046aqds,ls1046ardb_qspi,ls1043aqds_qspi,ls1043aqds_nand,ls1046aqds_lpuart,ls1043aqds_lpuart,ls1046aqds_sdcard_qspi,ls1043aqds_sdcard_qspi,ls1043aqds_nor_ddr3,ls1046ardb_sdcard,ls1046aqds_qspi,ls1043aqds_sdcard_ifc,ls1046ardb_emmc) 
make[1]: *** [arch/arm/cpu/armv8] Error 2
+(ls1046aqds_sdcard_ifc,ls1043aqds,ls1046aqds_nand,ls1046aqds,ls1046ardb_qspi,ls1043aqds_qspi,ls1043aqds_nand,ls1046aqds_lpuart,ls1043aqds_lpuart,ls1046aqds_sdcard_qspi,ls1043aqds_sdcard_qspi,ls1043aqds_nor_ddr3,ls1046ardb_sdcard,ls1046aqds_qspi,ls1043aqds_sdcard_ifc,ls1046ardb_emmc) 
make: *** [sub-make] Error 2
w+(ls2080ardb_nand,ls2080aqds_nand,ls1043ardb_nand,ls1043ardb_sdcard) 
../arch/arm/cpu/armv8/fsl-layerscape/cpu.c: In function 
'efi_reset_system_init':
w+(ls2080ardb_nand,ls2080aqds_nand,ls1043ardb_nand,ls1043ardb_sdcard) 
../arch/arm/cpu/armv8/fsl-layerscape/cpu.c:505:8: warning: passing 
argument 1 of 'efi_add_runtime_mmio' from incompatible pointer type
24: ls2080ardb: Convert to distro boot

York

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [U-Boot] [PATCH v6 0/6] LS2080ARDB: Enable EFI boot support
  2016-11-16 21:57       ` york sun
@ 2016-11-16 22:04         ` Alexander Graf
  2016-11-16 22:22         ` Alexander Graf
  1 sibling, 0 replies; 19+ messages in thread
From: Alexander Graf @ 2016-11-16 22:04 UTC (permalink / raw)
  To: u-boot



On 16/11/2016 22:57, york sun wrote:
> On 11/15/2016 02:20 PM, Alexander Graf wrote:
>>
>>
>> On 15/11/2016 23:11, york sun wrote:
>>>
>>> On 11/15/2016 12:36 PM, Alexander Graf wrote:
>>>> Hi York,
>>>>
>>>> Do you want to take that patch set?
>>>>
>>>
>>> Yes, I can. I saw it assigned to you in patchwork so I didn't act.
>>
>> I think since it's really hardware enablement for your platform, I'd
>> prefer if you pull them all in.
>>
>>
>
> Alex,
>
> I got compiling warnings
>
> 19: ls2080: Exit dpaa only right before exiting U-Boot
> 20: efi_loader: AArch64: Run EFI payloads in EL2 if U-Boot runs in EL3
> 21: ls2080ardb: Reserve DP-DDR RAM
>     aarch64:  +   ls2080ardb_nand
> +(ls2080ardb_nand)    efi_add_memory_map(gd->bd->bi_dram[2].start,
> +(ls2080ardb_nand)    ^
> w+(ls2080ardb_nand) ../board/freescale/ls2080ardb/ls2080ardb.c: In
> function 'misc_init_r':
> w+(ls2080ardb_nand) ../board/freescale/ls2080ardb/ls2080ardb.c:207:3:
> warning: implicit declaration of function 'efi_add_memory_map'
> [-Wimplicit-function-declaration]

Let's start with the first one :).

Is this doing an SPL build? The header has a check for

#if defined(CONFIG_EFI_LOADER) && !defined(CONFIG_SPL_BUILD)

while the using code is only conditional on

#ifdef CONFIG_EFI_LOADER


Alex

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [U-Boot] [PATCH v6 0/6] LS2080ARDB: Enable EFI boot support
  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
  1 sibling, 1 reply; 19+ messages in thread
From: Alexander Graf @ 2016-11-16 22:22 UTC (permalink / raw)
  To: u-boot



On 16/11/2016 22:57, york sun wrote:
> On 11/15/2016 02:20 PM, Alexander Graf wrote:
>>
>>
>> On 15/11/2016 23:11, york sun wrote:
>>>
>>> On 11/15/2016 12:36 PM, Alexander Graf wrote:
>>>> Hi York,
>>>>
>>>> Do you want to take that patch set?
>>>>
>>>
>>> Yes, I can. I saw it assigned to you in patchwork so I didn't act.
>>
>> I think since it's really hardware enablement for your platform, I'd
>> prefer if you pull them all in.
>>
>>
>
> Alex,
>
> I got compiling warnings

Btw, speaking of warnings, you might want to compile the code base with 
gcc6 :)

drivers/ddr/fsl/options.c:80:33: warning: 'single_S' defined but not 
used [-Wunused-const-variable=]
  static const struct dynamic_odt single_S[4] = {
                                  ^~~~~~~~
drivers/ddr/fsl/options.c:63:33: warning: 'single_D' defined but not 
used [-Wunused-const-variable=]
  static const struct dynamic_odt single_D[4] = {
                                  ^~~~~~~~
drivers/ddr/fsl/options.c:36:33: warning: 'single_Q' defined but not 
used [-Wunused-const-variable=]
  static const struct dynamic_odt single_Q[4] = {
                                  ^~~~~~~~
drivers/net/e1000.c: In function 'e1000_initialize_hardware_bits':
drivers/net/e1000.c:1526:2: warning: this 'if' clause does not guard... 
[-Wmisleading-indentation]
   if (hw->mac_type == e1000_igb)
   ^~
drivers/net/e1000.c:1529:3: note: ...this statement, but the latter is 
misleadingly indented as if it is guarded by the 'if'
    switch (hw->mac_type) {
    ^~~~~~

drivers/net/ldpaa_eth/ldpaa_eth.c: In function 'ldpaa_eth_open':
drivers/net/ldpaa_eth/ldpaa_eth.c:423:2: warning: this 'if' clause does 
not guard... [-Wmisleading-indentation]
   if (priv->phydev)
   ^~
drivers/net/ldpaa_eth/ldpaa_eth.c:425:3: note: ...this statement, but 
the latter is misleadingly indented as if it is guarded by the 'if'
    if (err) {
    ^~


I'm seeing the warnings too now with the nand target. I'll fix them up 
and send v7.


Alex

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [U-Boot] [PATCH v6 0/6] LS2080ARDB: Enable EFI boot support
  2016-11-16 22:22         ` Alexander Graf
@ 2016-11-16 22:29           ` york sun
  0 siblings, 0 replies; 19+ messages in thread
From: york sun @ 2016-11-16 22:29 UTC (permalink / raw)
  To: u-boot

On 11/16/2016 02:22 PM, Alexander Graf wrote:
>
>
> On 16/11/2016 22:57, york sun wrote:
>> On 11/15/2016 02:20 PM, Alexander Graf wrote:
>>>
>>>
>>> On 15/11/2016 23:11, york sun wrote:
>>>>
>>>> On 11/15/2016 12:36 PM, Alexander Graf wrote:
>>>>> Hi York,
>>>>>
>>>>> Do you want to take that patch set?
>>>>>
>>>>
>>>> Yes, I can. I saw it assigned to you in patchwork so I didn't act.
>>>
>>> I think since it's really hardware enablement for your platform, I'd
>>> prefer if you pull them all in.
>>>
>>>
>>
>> Alex,
>>
>> I got compiling warnings
>
> Btw, speaking of warnings, you might want to compile the code base with
> gcc6 :)
>

I am not ready to move on to gcc6 yet. I have see a patch set floating 
in the mailing list, dealing with a lot of interesting found by gcc6.


> drivers/ddr/fsl/options.c:80:33: warning: 'single_S' defined but not
> used [-Wunused-const-variable=]
>   static const struct dynamic_odt single_S[4] = {
>                                   ^~~~~~~~
> drivers/ddr/fsl/options.c:63:33: warning: 'single_D' defined but not
> used [-Wunused-const-variable=]
>   static const struct dynamic_odt single_D[4] = {
>                                   ^~~~~~~~
> drivers/ddr/fsl/options.c:36:33: warning: 'single_Q' defined but not
> used [-Wunused-const-variable=]
>   static const struct dynamic_odt single_Q[4] = {
>                                   ^~~~~~~~
> drivers/net/e1000.c: In function 'e1000_initialize_hardware_bits':
> drivers/net/e1000.c:1526:2: warning: this 'if' clause does not guard...
> [-Wmisleading-indentation]
>    if (hw->mac_type == e1000_igb)
>    ^~
> drivers/net/e1000.c:1529:3: note: ...this statement, but the latter is
> misleadingly indented as if it is guarded by the 'if'
>     switch (hw->mac_type) {
>     ^~~~~~
>
> drivers/net/ldpaa_eth/ldpaa_eth.c: In function 'ldpaa_eth_open':
> drivers/net/ldpaa_eth/ldpaa_eth.c:423:2: warning: this 'if' clause does
> not guard... [-Wmisleading-indentation]
>    if (priv->phydev)
>    ^~
> drivers/net/ldpaa_eth/ldpaa_eth.c:425:3: note: ...this statement, but
> the latter is misleadingly indented as if it is guarded by the 'if'
>     if (err) {
>     ^~
>
>
> I'm seeing the warnings too now with the nand target. I'll fix them up
> and send v7.

Thanks.

York

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [U-Boot] [PATCH v6 0/6] LS2080ARDB: Enable EFI boot support
  2016-11-15 22:11   ` york sun
  2016-11-15 22:20     ` Alexander Graf
@ 2016-11-17 10:46     ` Alexander Graf
  2016-11-17 16:38       ` york sun
  1 sibling, 1 reply; 19+ messages in thread
From: Alexander Graf @ 2016-11-17 10:46 UTC (permalink / raw)
  To: u-boot

On 11/15/2016 11:11 PM, york sun wrote:
> On 11/15/2016 12:36 PM, Alexander Graf wrote:
>> Hi York,
>>
>> Do you want to take that patch set?
>>
> Yes, I can. I saw it assigned to you in patchwork so I didn't act.

Hm, I've added a few fixups to my efi-next queue to make the ls2080 
patches not break. I think I'll just add them to my queue directly after 
all - that way we don't have dependencies on each other.

I hope that's ok for you.


Alex

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [U-Boot] [PATCH v6 0/6] LS2080ARDB: Enable EFI boot support
  2016-11-17 10:46     ` Alexander Graf
@ 2016-11-17 16:38       ` york sun
  0 siblings, 0 replies; 19+ messages in thread
From: york sun @ 2016-11-17 16:38 UTC (permalink / raw)
  To: u-boot

On 11/17/2016 02:46 AM, Alexander Graf wrote:
> On 11/15/2016 11:11 PM, york sun wrote:
>> On 11/15/2016 12:36 PM, Alexander Graf wrote:
>>> Hi York,
>>>
>>> Do you want to take that patch set?
>>>
>> Yes, I can. I saw it assigned to you in patchwork so I didn't act.
>
> Hm, I've added a few fixups to my efi-next queue to make the ls2080
> patches not break. I think I'll just add them to my queue directly after
> all - that way we don't have dependencies on each other.
>
> I hope that's ok for you.

Totally. You have my review-by signature in most of them. I saw another 
compiling error last night. Please see the email thread for the related 
patch.

York

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2016-11-17 16:38 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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.