x86: qemu: Add 64-bit U-Boot support
cover x86: qemu: Add 64-bit U-Boot support
This brings U-Boot x86 64-bit support on QEMU target.
This series is available at u-boot-x86/qemu64-working for testing.
Bin Meng (14):
x86: qemu: Add missing DECLARE_GLOBAL_DATA_PTR in e820.c
x86: Wrap print_ch() with config option
x86: spl: Add weak arch_cpu_init_dm()
x86: Compile irq.c for 64-bit
x86: qemu: Hide arch_cpu_init() and print_cpuinfo() for U-Boot proper
x86: qemu: Fix compiler warnings for 64-bit
x86: qemu: Set up device tree for SPL
x86: qemu: Mark ucode as optional for SPL in u-boot.dtsi
tools: binman: Call correct init for Entry_u_boot_spl_with_ucode_ptr
tools: binman: Handle optional microcode case in SPL image
spl: Add a LF to the loading message
x86: qemu: Add a text base for 64-bit U-Boot
x86: qemu: Add build options for SPL
x86: qemu: Add a config for 64-bit U-Boot
arch/x86/cpu/Makefile | 2 +- arch/x86/cpu/irq.c | 6 +- arch/x86/cpu/qemu/e820.c | 2 + arch/x86/cpu/qemu/qemu.c | 7 ++- arch/x86/cpu/x86_64/cpu.c | 2 + arch/x86/dts/emulation-u-boot.dtsi | 6 ++ arch/x86/dts/qemu-x86_i440fx.dts | 4 ++ arch/x86/dts/qemu-x86_q35.dts | 4 ++ arch/x86/lib/spl.c | 5 ++ board/emulation/Kconfig | 7 +++ board/emulation/qemu-x86/Kconfig | 6 +- board/emulation/qemu-x86/MAINTAINERS | 7 +++ common/spl/spl.c | 2 +- configs/qemu-x86_64_defconfig | 80 +++++++++++++++++++++++++ include/configs/qemu-x86.h | 9 +++ tools/binman/etype/u_boot_spl_with_ucode_ptr.py | 2 +- tools/binman/etype/u_boot_ucode.py | 6 ++ 17 files changed, 146 insertions(+), 11 deletions(-) create mode 100644 configs/qemu-x86_64_defconfig
Signature · 1 line
2.9.2
PATCH 1/14 x86: qemu: Add missing DECLARE_GLOBAL_DATA_PTR in e820.c
DECLARE_GLOBAL_DATA_PTR is missing which causes 64-bit build error.
---
arch/x86/cpu/qemu/e820.c | 2 ++ 1 file changed, 2 insertions(+)
arch/x86/cpu/qemu/e820.c +2 -0
@@ -7,6 +7,8 @@#include <common.h> #include <asm/e820.h> +DECLARE_GLOBAL_DATA_PTR ; +unsigned install_e820_map (unsigned max_entries,struct e820entry *entries) { entries[0 ].addr =0 ;
Signature · 1 line
2.9.2
PATCH 1/14 x86: qemu: Add missing DECLARE_GLOBAL_DATA_PTR in e820.c
Quoted 7 lines · Bin Meng
DECLARE_GLOBAL_DATA_PTRis missing which causes 64-bit build error.Signed-off-by Bin Meng <[email protected]>---
arch/x86/cpu/qemu/e820.c | 2 ++ 1 file changed, 2 insertions(+)
PATCH 1/14 x86: qemu: Add missing DECLARE_GLOBAL_DATA_PTR in e820.c
Quoted 10 lines · Simon Glass
Quoted 7 lines · Bin Meng
DECLARE_GLOBAL_DATA_PTRis missing which causes 64-bit build error.Signed-off-by Bin Meng <[email protected]>---
arch/x86/cpu/qemu/e820.c | 2 ++ 1 file changed, 2 insertions(+)Reviewed-by Simon Glass <[email protected]>
applied to u-boot-x86, thanks!
PATCH 2/14 x86: Wrap print_ch() with config option
In reply to Bin Mengprint_ch() should not be used if DEBUG_UART is off.
---
arch/x86/cpu/x86_64/cpu.c | 2 ++ 1 file changed, 2 insertions(+)
arch/x86/cpu/x86_64/cpu.c +2 -0
@@ -31,7 +31,9 @@ void arch_setup_gd(gd_t *new_gd)* * U-Boot SPL 2017.01 */ +#if CONFIG_IS_ENABLED (DEBUG_UART )printch (' ' ); +#endif }int cpu_has_64bit (void )
Signature · 1 line
2.9.2
PATCH 2/14 x86: Wrap print_ch() with config option
Hi Bin,
Quoted 7 lines · Bin Meng
print_ch()should not be used ifDEBUG_UARTis off.Signed-off-by Bin Meng <[email protected]>---
arch/x86/cpu/x86_64/cpu.c | 2 ++ 1 file changed, 2 insertions(+)
arch/x86/cpu/x86_64/cpu.c void arch_setup_gd(gd_t *new_gd) · line 34
Quoted 10 lines
arch/x86/cpu/x86_64/cpu.c +1
-0@@ -31,7 +31,9 @@ void arch_setup_gd(gd_t *new_gd)* * U-Boot SPL 2017.01 */ +#if CONFIG_IS_ENABLED (DEBUG_UART )
Or just #ifdef CONFIG_DEBUF_UART ?
Quoted 8 lines
arch/x86/cpu/x86_64/cpu.c +1
-1printch (' ' ); +#endif }int cpu_has_64bit (void ) --2.9.2
Regards,
Simon
PATCH 2/14 x86: Wrap print_ch() with config option
Quoted 14 lines · Simon Glass
Hi Bin,
Quoted 7 lines · Bin Meng
print_ch()should not be used ifDEBUG_UARTis off.Signed-off-by Bin Meng <[email protected]>---
arch/x86/cpu/x86_64/cpu.c | 2 ++ 1 file changed, 2 insertions(+)Reviewed-by Simon Glass <[email protected]>Quoted 1 line
Quoted 11 lines
arch/x86/cpu/x86_64/cpu.c void arch_setup_gd(gd_t *new_gd) · line 34
Quoted 9 lines
arch/x86/cpu/x86_64/cpu.c +1
-0@@ -31,7 +31,9 @@ void arch_setup_gd(gd_t *new_gd)* * U-Boot SPL 2017.01 */ +#if CONFIG_IS_ENABLED (DEBUG_UART )Or just #ifdef
CONFIG_DEBUF_UART?
Fixed, and
applied to u-boot-x86, thanks!
PATCH 3/14 x86: spl: Add weak arch_cpu_init_dm()
In reply to Bin Mengarch_cpu_init_dm() might not be implemented by every platform. Implement a weak version for SPL.
---
arch/x86/lib/spl.c | 5 +++++ 1 file changed, 5 insertions(+)
arch/x86/lib/spl.c +5 -0
@@ -15,6 +15,11 @@DECLARE_GLOBAL_DATA_PTR ; +__weak int arch_cpu_init_dm (void ) +{ +return 0 ; +} +static int x86_spl_init (void ) {/*
Signature · 1 line
2.9.2
PATCH 3/14 x86: spl: Add weak arch_cpu_init_dm()
Hi Bin,
Quoted 14 lines · Bin Meng
arch_cpu_init_dm()might not be implemented by every platform. Implement a weak version for SPL.Signed-off-by Bin Meng <[email protected]>---
arch/x86/lib/spl.c | 5 +++++ 1 file changed, 5 insertions(+)arch/x86/lib/spl.c +0
-0
arch/x86/lib/spl.c line 21
Quoted 7 lines
arch/x86/lib/spl.c +4
-0@@ -15,6 +15,11 @@DECLARE_GLOBAL_DATA_PTR ; +__weak int arch_cpu_init_dm (void ) +{ +return 0 ; +}
There is already one of these in board_f.c - do we need another?
Quoted 7 lines
arch/x86/lib/spl.c +1
-1+static int x86_spl_init (void ) {/* -- 2.9.2
Regards,
Simon
PATCH 3/14 x86: spl: Add weak arch_cpu_init_dm()
Hi Simon,
Quoted 18 lines · Simon Glass
Hi Bin,
Quoted 15 lines · Bin Meng
arch_cpu_init_dm()might not be implemented by every platform. Implement a weak version for SPL.Signed-off-by Bin Meng <[email protected]>---
arch/x86/lib/spl.c | 5 +++++ 1 file changed, 5 insertions(+)arch/x86/lib/spl.c +0
-0@@ -15,6 +15,11 @@
Quoted 9 lines
arch/x86/lib/spl.c line 21
Quoted 6 lines
arch/x86/lib/spl.c +4
-0DECLARE_GLOBAL_DATA_PTR ; +__weak int arch_cpu_init_dm (void ) +{ +return 0 ; +}There is already one of these in
board_f.c- do we need another?
board_f.c is not built for SPL.
Regards,
Bin
PATCH 3/14 x86: spl: Add weak arch_cpu_init_dm()
Quoted 31 lines · Bin Meng
Hi Simon,
Quoted 18 lines · Simon Glass
Hi Bin,
Quoted 15 lines · Bin Meng
arch_cpu_init_dm()might not be implemented by every platform. Implement a weak version for SPL.Signed-off-by Bin Meng <[email protected]>---
arch/x86/lib/spl.c | 5 +++++ 1 file changed, 5 insertions(+)arch/x86/lib/spl.c +0
-0@@ -15,6 +15,11 @@Quoted 9 lines
arch/x86/lib/spl.c line 21
Quoted 6 lines
arch/x86/lib/spl.c +4
-0DECLARE_GLOBAL_DATA_PTR ; +__weak int arch_cpu_init_dm (void ) +{ +return 0 ; +}There is already one of these in
board_f.c- do we need another?
Quoted 1 line
board_f.cis not built for SPL.
I'm not a big fan of weak functions, but OK.
PATCH 3/14 x86: spl: Add weak arch_cpu_init_dm()
Quoted 32 lines · Simon Glass
Quoted 31 lines · Bin Meng
Hi Simon,
Quoted 27 lines · Simon Glass
Hi Bin,
Quoted 14 lines · Bin Meng
arch_cpu_init_dm()might not be implemented by every platform. Implement a weak version for SPL.Signed-off-by Bin Meng <[email protected]>---
arch/x86/lib/spl.c | 5 +++++ 1 file changed, 5 insertions(+)arch/x86/lib/spl.c +0
-0arch/x86/lib/spl.c line 21
Quoted 7 lines
arch/x86/lib/spl.c +4
-0@@ -15,6 +15,11 @@DECLARE_GLOBAL_DATA_PTR ; +__weak int arch_cpu_init_dm (void ) +{ +return 0 ; +}There is already one of these in
board_f.c- do we need another?
Quoted 5 lines
Quoted 1 line
board_f.cis not built for SPL.I'm not a big fan of weak functions, but OK.
Reviewed-by Simon Glass <[email protected]>
applied to u-boot-x86, thanks!
PATCH 4/14 x86: Compile irq.c for 64-bit
In reply to Bin MengThere is no reason not to compile irq.c for 64-bit.
---
arch/x86/cpu/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/cpu/Makefile +1 -1
@@ -35,8 +35,8 @@ obj-$(CONFIG_NORTHBRIDGE_INTEL_IVYBRIDGE) += ivybridge/ obj-$(CONFIG_INTEL_QUARK) += quark/ obj-$(CONFIG_INTEL_QUEENSBAY) += queensbay/ obj-y += lapic.o ioapic.o -ifndef CONFIG_$(SPL_)X86_64 obj-y += irq.o +ifndef CONFIG_$(SPL_)X86_64 obj-$(CONFIG_SMP) += mp_init.o endif obj-y += mtrr.o
Signature · 1 line
2.9.2
PATCH 4/14 x86: Compile irq.c for 64-bit
Quoted 7 lines · Bin Meng
There is no reason not to compile
irq.cfor 64-bit.Signed-off-by Bin Meng <[email protected]>---
arch/x86/cpu/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
PATCH 4/14 x86: Compile irq.c for 64-bit
Quoted 10 lines · Simon Glass
Quoted 7 lines · Bin Meng
There is no reason not to compile
irq.cfor 64-bit.Signed-off-by Bin Meng <[email protected]>---
arch/x86/cpu/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Reviewed-by Simon Glass <[email protected]>
applied to u-boot-x86, thanks!
PATCH 5/14 x86: qemu: Hide arch_cpu_init() and print_cpuinfo() for U-Boot proper
In reply to Bin Mengarch_cpu_init() and print_cpuinfo() should be only available in SPL build.
---
arch/x86/cpu/qemu/qemu.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
arch/x86/cpu/qemu/qemu.c +4 -1
@@ -137,14 +137,17 @@ static void qemu_chipset_init(void)#endif } +#if !CONFIG_IS_ENABLED (SPL_X86_32BIT_INIT )int arch_cpu_init (void ) {post_code (POST_CPU_INIT );return x86_cpu_init_f (); } +#endif -#ifndef CONFIG_EFI_STUB +#if !CONFIG_IS_ENABLED (EFI_STUB ) && \ + !CONFIG_IS_ENABLED (SPL_X86_32BIT_INIT )int print_cpuinfo (void ) {post_code (POST_CPU_INFO );
Signature · 1 line
2.9.2
PATCH 5/14 x86: qemu: Hide arch_cpu_init() and print_cpuinfo() for U-Boot proper
Quoted 8 lines · Bin Meng
arch_cpu_init()andprint_cpuinfo()should be only available in SPL build.Signed-off-by Bin Meng <[email protected]>---
arch/x86/cpu/qemu/qemu.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
PATCH 5/14 x86: qemu: Hide arch_cpu_init() and print_cpuinfo() for U-Boot proper
Quoted 11 lines · Simon Glass
Quoted 8 lines · Bin Meng
arch_cpu_init()andprint_cpuinfo()should be only available in SPL build.Signed-off-by Bin Meng <[email protected]>---
arch/x86/cpu/qemu/qemu.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)Reviewed-by Simon Glass <[email protected]>
applied to u-boot-x86, thanks!
PATCH 6/14 x86: qemu: Fix compiler warnings for 64-bit
In reply to Bin MengThis fixes compiler warnings for QEMU in 64-bit.
---
arch/x86/cpu/irq.c | 6 +++--- arch/x86/cpu/qemu/qemu.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-)
arch/x86/cpu/irq.c +3 -3
@@ -26,7 +26,7 @@ bool pirq_check_irq_routed(struct udevice *dev, int link, u8 irq)if (priv->config ==PIRQ_VIA_PCI )dm_pci_read_config8 (dev->parent,LINK_N2V (link, base), &pirq);else - pirq =readb (priv->ibase +LINK_N2V (link, base)); + pirq =readb ((uintptr_t )priv->ibase +LINK_N2V (link, base)); pirq &=0xf ;
@@ -56,7 +56,7 @@ void pirq_assign_irq(struct udevice *dev, int link, u8 irq)if (priv->config ==PIRQ_VIA_PCI )dm_pci_write_config8 (dev->parent,LINK_N2V (link, base), irq);else -writeb (irq, priv->ibase +LINK_N2V (link, base)); +writeb (irq, (uintptr_t )priv->ibase +LINK_N2V (link, base)); } static struct irq_info *check_dup_entry(struct irq_info *slot_base,
@@ -234,7 +234,7 @@ static void irq_enable_sci(struct udevice *dev)if (priv->config ==PIRQ_VIA_PCI )dm_pci_write_config32 (dev->parent, priv->actl_addr,0 );else -writel (0 , priv->ibase + priv->actl_addr); +writel (0 , (uintptr_t )priv->ibase + priv->actl_addr); } }
arch/x86/cpu/qemu/qemu.c +1 -1
@@ -47,7 +47,7 @@ static void qemu_x86_fwcfg_read_entry_pio(uint16_t entry,static void qemu_x86_fwcfg_read_entry_dma (struct fw_cfg_dma_access *dma) {/* the DMA address register is big endian */ -outl (cpu_to_be32 ((uint32_t )dma),FW_DMA_PORT_HIGH ); +outl (cpu_to_be32 ((uintptr_t )dma),FW_DMA_PORT_HIGH );while (be32_to_cpu (dma->control) & ~FW_CFG_DMA_ERROR ) __asm__ __volatile__ ("pause" );
Signature · 1 line
2.9.2
PATCH 6/14 x86: qemu: Fix compiler warnings for 64-bit
Quoted 8 lines · Bin Meng
This fixes compiler warnings for QEMU in 64-bit.
Signed-off-by Bin Meng <[email protected]>---
arch/x86/cpu/irq.c | 6 +++--- arch/x86/cpu/qemu/qemu.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-)
PATCH 6/14 x86: qemu: Fix compiler warnings for 64-bit
Quoted 11 lines · Simon Glass
Quoted 8 lines · Bin Meng
This fixes compiler warnings for QEMU in 64-bit.
Signed-off-by Bin Meng <[email protected]>---
arch/x86/cpu/irq.c | 6 +++--- arch/x86/cpu/qemu/qemu.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-)Reviewed-by Simon Glass <[email protected]>
applied to u-boot-x86, thanks!
PATCH 7/14 x86: qemu: Set up device tree for SPL
In reply to Bin MengAdd the correct pre-relocation tag so that the required device tree nodes are present in the SPL device tree.
---
arch/x86/dts/qemu-x86_i440fx.dts | 4 ++++ arch/x86/dts/qemu-x86_q35.dts | 4 ++++ 2 files changed, 8 insertions(+)
arch/x86/dts/qemu-x86_i440fx.dts +4 -0
@@ -29,10 +29,12 @@ cpus { #address-cells = <1>; #size-cells = <0>; + u-boot,dm-pre-reloc; cpu at 0 { device_type = "cpu"; compatible = "cpu-qemu"; + u-boot,dm-pre-reloc; reg = <0>; intel,apic-id = <0>; };
@@ -54,9 +56,11 @@ pch at 1,0 { reg = <0x00000800 0 0 0 0>; compatible = "intel,pch7"; + u-boot,dm-pre-reloc; irq-router { compatible = "intel,irq-router"; + u-boot,dm-pre-reloc; intel,pirq-config = "pci"; intel,pirq-link = <0x60 4>; intel,pirq-mask = <0x0e40>;
arch/x86/dts/qemu-x86_q35.dts +4 -0
@@ -40,10 +40,12 @@ cpus { #address-cells = <1>; #size-cells = <0>; + u-boot,dm-pre-reloc; cpu at 0 { device_type = "cpu"; compatible = "cpu-qemu"; + u-boot,dm-pre-reloc; reg = <0>; intel,apic-id = <0>; };
@@ -65,9 +67,11 @@ pch at 1f,0 { reg = <0x0000f800 0 0 0 0>; compatible = "intel,pch9"; + u-boot,dm-pre-reloc; irq-router { compatible = "intel,irq-router"; + u-boot,dm-pre-reloc; intel,pirq-config = "pci"; intel,actl-8bit; intel,actl-addr = <0x44>;
Signature · 1 line
2.9.2
PATCH 7/14 x86: qemu: Set up device tree for SPL
Quoted 9 lines · Bin Meng
Add the correct pre-relocation tag so that the required device tree nodes are present in the SPL device tree.
Signed-off-by Bin Meng <[email protected]>---
arch/x86/dts/qemu-x86_i440fx.dts | 4 ++++ arch/x86/dts/qemu-x86_q35.dts | 4 ++++ 2 files changed, 8 insertions(+)
PATCH 7/14 x86: qemu: Set up device tree for SPL
Quoted 4 lines · Simon Glass
Quoted 3 lines · Bin Meng
Add the correct pre-relocation tag so that the required device tree nodes are present in the SPL device tree.
Quoted 8 lines
Quoted 6 lines
Signed-off-by Bin Meng <[email protected]>---
arch/x86/dts/qemu-x86_i440fx.dts | 4 ++++ arch/x86/dts/qemu-x86_q35.dts | 4 ++++ 2 files changed, 8 insertions(+)Reviewed-by Simon Glass <[email protected]>
applied to u-boot-x86, thanks!
PATCH 8/14 x86: qemu: Mark ucode as optional for SPL in u-boot.dtsi
In reply to Bin MengQEMU does not need ucode and this is indicated in u-boot.dtsi for U-Boot proper. Now add the same for SPL.
---
arch/x86/dts/emulation-u-boot.dtsi | 6 ++++++ 1 file changed, 6 insertions(+)
arch/x86/dts/emulation-u-boot.dtsi +6 -0
@@ -10,9 +10,15 @@ #ifdef CONFIG_ROM_SIZE / { binman { +#ifdef CONFIG_SPL + u-boot-spl-with-ucode-ptr { + optional-ucode; + }; +#else u-boot-with-ucode-ptr { optional-ucode; }; +#endif }; }; #endif
Signature · 1 line
2.9.2
PATCH 8/14 x86: qemu: Mark ucode as optional for SPL in u-boot.dtsi
Quoted 8 lines · Bin Meng
QEMU does not need ucode and this is indicated in
u-boot.dtsifor U-Boot proper. Now add the same for SPL.Signed-off-by Bin Meng <[email protected]>---
arch/x86/dts/emulation-u-boot.dtsi | 6 ++++++ 1 file changed, 6 insertions(+)
PATCH 8/14 x86: qemu: Mark ucode as optional for SPL in u-boot.dtsi
Quoted 11 lines · Simon Glass
Quoted 8 lines · Bin Meng
QEMU does not need ucode and this is indicated in
u-boot.dtsifor U-Boot proper. Now add the same for SPL.Signed-off-by Bin Meng <[email protected]>---
arch/x86/dts/emulation-u-boot.dtsi | 6 ++++++ 1 file changed, 6 insertions(+)Reviewed-by Simon Glass <[email protected]>
applied to u-boot-x86, thanks!
PATCH 9/14 tools: binman: Call correct init for Entry_u_boot_spl_with_ucode_ptr
In reply to Bin Mengu_boot_spl_with_ucode_ptr is derived from u_boot_with_ucode_ptr, hence it should call its parent's init.
---
tools/binman/etype/u_boot_spl_with_ucode_ptr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/binman/etype/u_boot_spl_with_ucode_ptr.py +1 -1
@@ -21,7 +21,7 @@ class Entry_u_boot_spl_with_ucode_ptr(Entry_u_boot_with_ucode_ptr): process. """ def __init__(self, image, etype, node): - Entry_blob.__init__(self, image, etype, node) + Entry_u_boot_with_ucode_ptr.__init__(self, image, etype, node) self.elf_fname = 'spl/u-boot-spl' def GetDefaultFilename(self):
Signature · 1 line
2.9.2
PATCH 9/14 tools: binman: Call correct init for Entry_u_boot_spl_with_ucode_ptr
Quoted 9 lines · Bin Meng
u_boot_spl_with_ucode_ptris derived fromu_boot_with_ucode_ptr, hence it should call its parent's init.Signed-off-by Bin Meng <[email protected]>---
tools/binman/etype/u_boot_spl_with_ucode_ptr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
PATCH 9/14 tools: binman: Call correct init for Entry_u_boot_spl_with_ucode_ptr
Quoted 5 lines · Simon Glass
Quoted 4 lines · Bin Meng
u_boot_spl_with_ucode_ptris derived fromu_boot_with_ucode_ptr, hence it should call its parent's init.
Quoted 7 lines
Quoted 5 lines
Signed-off-by Bin Meng <[email protected]>---
tools/binman/etype/u_boot_spl_with_ucode_ptr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Reviewed-by Simon Glass <[email protected]>
applied to u-boot-x86, thanks!
PATCH 10/14 tools: binman: Handle optional microcode case in SPL image
In reply to Bin MengOn platforms which do not require microcode in SPL, handle such case like U-Boot proper.
---
tools/binman/etype/u_boot_ucode.py | 6 ++++++ 1 file changed, 6 insertions(+)
tools/binman/etype/u_boot_ucode.py +6 -0
@@ -62,6 +62,12 @@ class Entry_u_boot_ucode(Entry_blob): self.data = '' return True + # Handle microcode in SPL image as well + ucode_dest_entry = self.image.FindEntryType('u-boot-spl-with-ucode-ptr') + if ucode_dest_entry and not ucode_dest_entry.target_pos: + self.data = '' + return True + # Get the microcode from the device tree entry fdt_entry = self.image.FindEntryType('u-boot-dtb-with-ucode') if not fdt_entry or not fdt_entry.ucode_data:
Signature · 1 line
2.9.2
PATCH 10/14 tools: binman: Handle optional microcode case in SPL image
Quoted 8 lines · Bin Meng
On platforms which do not require microcode in SPL, handle such case like U-Boot proper.
Signed-off-by Bin Meng <[email protected]>---
tools/binman/etype/u_boot_ucode.py | 6 ++++++ 1 file changed, 6 insertions(+)
PATCH 10/14 tools: binman: Handle optional microcode case in SPL image
Quoted 11 lines · Simon Glass
Quoted 8 lines · Bin Meng
On platforms which do not require microcode in SPL, handle such case like U-Boot proper.
Signed-off-by Bin Meng <[email protected]>---
tools/binman/etype/u_boot_ucode.py | 6 ++++++ 1 file changed, 6 insertions(+)Reviewed-by Simon Glass <[email protected]>
applied to u-boot-x86, thanks!
PATCH 11/14 spl: Add a LF to the loading message
In reply to Bin MengSPL prints "Trying to boot from %s" without a LF. Add one to improve reading on the serial console.
---
common/spl/spl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
common/spl/spl.c +1 -1
@@ -266,7 +266,7 @@ static int boot_from_devices(struct spl_image_info *spl_image, loader =spl_ll_find_loader (spl_boot_list[i]);#if defined(CONFIG_SPL_SERIAL_SUPPORT ) && defined(CONFIG_SPL_LIBCOMMON_SUPPORT )if (loader) -printf ("Trying to boot from %s" , loader->name); +printf ("Trying to boot from %s\n" , loader->name);else puts ("SPL: Unsupported Boot Device!\n" );#endif
Signature · 1 line
2.9.2
PATCH 11/14 spl: Add a LF to the loading message
Quoted 8 lines · Bin Meng
SPL prints "Trying to boot from %s" without a LF. Add one to improve reading on the serial console.
Signed-off-by Bin Meng <[email protected]>---
common/spl/spl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
PATCH 11/14 spl: Add a LF to the loading message
Quoted 11 lines · Simon Glass
Quoted 8 lines · Bin Meng
SPL prints "Trying to boot from %s" without a LF. Add one to improve reading on the serial console.
Signed-off-by Bin Meng <[email protected]>---
common/spl/spl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Reviewed-by Simon Glass <[email protected]>
Drop this commit, since another commit has been merged to mainstream already:
commit cf947da19aecd1b430f22d73ad109af64a6051b5
Author: Andrew F. Davis <[email protected]> Date: Thu Jan 12 10:19:55 2017 -0600
spl: Add some missing newlines
Regards,
Bin
PATCH 12/14 x86: qemu: Add a text base for 64-bit U-Boot
In reply to Bin MengSet up the 64-bit U-Boot text base if building for that target.
---
board/emulation/qemu-x86/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
board/emulation/qemu-x86/Kconfig +2 -2
@@ -13,8 +13,8 @@ config SYS_CONFIG_NAME default "qemu-x86" config SYS_TEXT_BASE - default 0xfff00000 if !EFI_STUB - default 0x01110000 if EFI_STUB + default 0xfff00000 if !EFI_STUB && !SUPPORT_SPL + default 0x01110000 if EFI_STUB || SUPPORT_SPL config BOARD_SPECIFIC_OPTIONS # dummy def_bool y
Signature · 1 line
2.9.2
PATCH 12/14 x86: qemu: Add a text base for 64-bit U-Boot
Quoted 7 lines · Bin Meng
Set up the 64-bit U-Boot text base if building for that target.
Signed-off-by Bin Meng <[email protected]>---
board/emulation/qemu-x86/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
PATCH 12/14 x86: qemu: Add a text base for 64-bit U-Boot
Quoted 10 lines · Simon Glass
Quoted 7 lines · Bin Meng
Set up the 64-bit U-Boot text base if building for that target.
Signed-off-by Bin Meng <[email protected]>---
board/emulation/qemu-x86/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)Reviewed-by Simon Glass <[email protected]>
applied to u-boot-x86, thanks!
PATCH 13/14 x86: qemu: Add build options for SPL
In reply to Bin MengIf SPL is used we want to use the generic SPL framework and boot from SPI via a board-specific means. Add these options to the board config file.
---
include/configs/qemu-x86.h | 9 +++++++++ 1 file changed, 9 insertions(+)
include/configs/qemu-x86.h +9 -0
@@ -54,4 +54,13 @@#undef CONFIG_ENV_IS_IN_SPI_FLASH#define CONFIG_ENV_IS_NOWHERE +#define CONFIG_SPL_FRAMEWORK + +#define CONFIG_SPL_TEXT_BASE 0xfffd0000 + +#define BOOT_DEVICE_SPI 10 + +#define CONFIG_SPL_BOARD_LOAD_IMAGE +#define BOOT_DEVICE_BOARD 11 +#endif /* __CONFIG_H */
Signature · 1 line
2.9.2
PATCH 13/14 x86: qemu: Add build options for SPL
Quoted 9 lines · Bin Meng
If SPL is used we want to use the generic SPL framework and boot from SPI via a board-specific means. Add these options to the board config file.
Signed-off-by Bin Meng <[email protected]>---
include/configs/qemu-x86.h | 9 +++++++++ 1 file changed, 9 insertions(+)
PATCH 13/14 x86: qemu: Add build options for SPL
Quoted 5 lines · Simon Glass
Quoted 4 lines · Bin Meng
If SPL is used we want to use the generic SPL framework and boot from SPI via a board-specific means. Add these options to the board config file.
Quoted 7 lines
Quoted 5 lines
Signed-off-by Bin Meng <[email protected]>---
include/configs/qemu-x86.h | 9 +++++++++ 1 file changed, 9 insertions(+)Reviewed-by Simon Glass <[email protected]>
applied to u-boot-x86, thanks!
PATCH 14/14 x86: qemu: Add a config for 64-bit U-Boot
In reply to Bin MengAdd a new board config which uses 64-bit U-Boot. Supported features are the same as the other 64-bit board (Google Chromebook Link). It is a start for us to test 64-bit U-Boot easily without the need to access a real hardware.
Note CONFIG_SPL_ENV_SUPPORT is required for QEMU 64-bit as without this the SPL build fails at the end. This is just a workaround as CONFIG_SPL_ENV_SUPPORT is not needed at all.
common/built-in.o:(.data.env_htab+0xc): undefined reference to 'env_flags_validate' lib/built-in.o: In function `hsearch_r':lib/hashtable.c:380: undefined reference to 'env_callback_init' lib/hashtable.c:382: undefined reference to 'env_flags_init'
make[1]: *** [spl/u-boot-spl] Error 1
Except those SPL options required by 64-bit, compared to 32-bit config, the following options are different:
- CONFIG_SYS_MALLOC_F_LEN has to be increased to 0x1000 for SPL.
- CONFIG_DEBUG_UART has to be included due to the weird issue. See TODO comments in arch/x86/cpu/x86_64/cpu.c:arch_setup_gd(). Once this issue gets fixed, debug uart can be optional.
---
board/emulation/Kconfig | 7 ++++ board/emulation/qemu-x86/Kconfig | 2 +- board/emulation/qemu-x86/MAINTAINERS | 7 ++++ configs/qemu-x86_64_defconfig | 80 ++++++++++++++++++++++++++++++++++++ 4 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 configs/qemu-x86_64_defconfig
board/emulation/Kconfig +7 -0
@@ -18,6 +18,13 @@ config TARGET_QEMU_X86 supported by U-Boot. They are via QEMU '-M pc', an i440FX/PIIX chipset platform and '-M q35', a Q35/ICH9 chipset platform. +config TARGET_QEMU_X86_64 + bool "QEMU x86 64-bit" + help + This is the QEMU emulated x86 64-bit board. With this config + U-Boot is built as a 64-bit binary. This allows testing while + this feature is being completed. + endchoice source "board/emulation/qemu-x86/Kconfig"
board/emulation/qemu-x86/Kconfig +1 -1
@@ -1,4 +1,4 @@ -if TARGET_QEMU_X86 +if TARGET_QEMU_X86 || TARGET_QEMU_X86_64 config SYS_BOARD default "qemu-x86"
board/emulation/qemu-x86/MAINTAINERS +7 -0
@@ -6,3 +6,10 @@ F: include/configs/qemu-x86.h F: configs/qemu-x86_defconfig F: configs/qemu-x86_efi_payload32_defconfig F: configs/qemu-x86_efi_payload64_defconfig + +QEMU X86 64-bit BOARD +M: Bin Meng <[email protected]> +S: Maintained +F: board/emulation/qemu-x86/ +F: include/configs/qemu-x86.h +F: configs/qemu-x86_64_defconfig
configs/qemu-x86_64_defconfig new file +80 -0
80 lines not on this page · raw message
Signature · 1 line
2.9.2
PATCH 14/14 x86: qemu: Add a config for 64-bit U-Boot
Quoted 25 lines · Bin Meng
Add a new board config which uses 64-bit U-Boot. Supported features are the same as the other 64-bit board (Google Chromebook Link). It is a start for us to test 64-bit U-Boot easily without the need to access a real hardware.
Note
CONFIG_SPL_ENV_SUPPORTis required for QEMU 64-bit as without this the SPL build fails at the end. This is just a workaround asCONFIG_SPL_ENV_SUPPORTis not needed at all.common/built-in.o:(.data.env_htab+0xc): undefined reference to '
env_flags_validate'lib/built-in.o: In function `hsearch_r':lib/hashtable.c:380: undefined reference to 'env_callback_init'lib/hashtable.c:382: undefined reference to 'env_flags_init'
make[1]: *** [spl/u-boot-spl] Error 1Except those SPL options required by 64-bit, compared to 32-bit config, the following options are different:
-
CONFIG_SYS_MALLOC_F_LENhas to be increased to0x1000for SPL.
-CONFIG_DEBUG_UARThas to be included due to the weird issue. See TODO comments in arch/x86/cpu/x86_64/cpu.c:arch_setup_gd(). Once this issue gets fixed, debug uart can be optional.Signed-off-by Bin Meng <[email protected]>
Quoted 8 lines
---
board/emulation/Kconfig | 7 ++++ board/emulation/qemu-x86/Kconfig | 2 +- board/emulation/qemu-x86/MAINTAINERS | 7 ++++ configs/qemu-x86_64_defconfig | 80 ++++++++++++++++++++++++++++++++++++ 4 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 configs/qemu-x86_64_defconfig
PATCH 14/14 x86: qemu: Add a config for 64-bit U-Boot
Quoted 28 lines · Simon Glass
Quoted 27 lines · Bin Meng
Add a new board config which uses 64-bit U-Boot. Supported features are the same as the other 64-bit board (Google Chromebook Link). It is a start for us to test 64-bit U-Boot easily without the need to access a real hardware.
Note
CONFIG_SPL_ENV_SUPPORTis required for QEMU 64-bit as without this the SPL build fails at the end. This is just a workaround asCONFIG_SPL_ENV_SUPPORTis not needed at all.common/built-in.o:(.data.env_htab+0xc): undefined reference to '
env_flags_validate'lib/built-in.o: In function `hsearch_r':lib/hashtable.c:380: undefined reference to 'env_callback_init'lib/hashtable.c:382: undefined reference to 'env_flags_init'
make[1]: *** [spl/u-boot-spl] Error 1Except those SPL options required by 64-bit, compared to 32-bit config, the following options are different:
-
CONFIG_SYS_MALLOC_F_LENhas to be increased to0x1000for SPL.
-CONFIG_DEBUG_UARThas to be included due to the weird issue. See TODO comments in arch/x86/cpu/x86_64/cpu.c:arch_setup_gd(). Once this issue gets fixed, debug uart can be optional.Signed-off-by Bin Meng <[email protected]>---
Quoted 8 lines
Quoted 6 lines
board/emulation/Kconfig | 7 ++++ board/emulation/qemu-x86/Kconfig | 2 +- board/emulation/qemu-x86/MAINTAINERS | 7 ++++ configs/qemu-x86_64_defconfig | 80 ++++++++++++++++++++++++++++++++++++ 4 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 configs/qemu-x86_64_defconfigReviewed-by Simon Glass <[email protected]>
applied to u-boot-x86, thanks!
cover x86: qemu: Add 64-bit U-Boot support
In reply to Bin MengHi Bin,
Quoted 41 lines · Bin Meng
This brings U-Boot x86 64-bit support on QEMU target.
This series is available at u-boot-x86/qemu64-working for testing.
Bin Meng (14):
x86: qemu: Add missingDECLARE_GLOBAL_DATA_PTRine820.c
x86: Wrapprint_ch()with config option
x86: spl: Add weakarch_cpu_init_dm()
x86: Compileirq.cfor 64-bit
x86: qemu: Hidearch_cpu_init()andprint_cpuinfo()for U-Boot proper
x86: qemu: Fix compiler warnings for 64-bit
x86: qemu: Set up device tree for SPL
x86: qemu: Mark ucode as optional for SPL inu-boot.dtsi
tools: binman: Call correct init forEntry_u_boot_spl_with_ucode_ptr
tools: binman: Handle optional microcode case in SPL image
spl: Add a LF to the loading message
x86: qemu: Add a text base for 64-bit U-Boot
x86: qemu: Add build options for SPL
x86: qemu: Add a config for 64-bit U-Bootarch/x86/cpu/Makefile | 2 +- arch/x86/cpu/irq.c | 6 +- arch/x86/cpu/qemu/e820.c | 2 + arch/x86/cpu/qemu/qemu.c | 7 ++- arch/x86/cpu/x86_64/cpu.c | 2 + arch/x86/dts/emulation-u-boot.dtsi | 6 ++ arch/x86/dts/qemu-x86_i440fx.dts | 4 ++ arch/x86/dts/qemu-x86_q35.dts | 4 ++ arch/x86/lib/spl.c | 5 ++ board/emulation/Kconfig | 7 +++ board/emulation/qemu-x86/Kconfig | 6 +- board/emulation/qemu-x86/MAINTAINERS | 7 +++ common/spl/spl.c | 2 +- configs/qemu-x86_64_defconfig | 80 +++++++++++++++++++++++++ include/configs/qemu-x86.h | 9 +++ tools/binman/etype/u_boot_spl_with_ucode_ptr.py | 2 +- tools/binman/etype/u_boot_ucode.py | 6 ++ 17 files changed, 146 insertions(+), 11 deletions(-) create mode 100644 configs/qemu-x86_64_defconfig
Quoted 3 lines
--
2.9.2
One point I noted in trying this out is that the binman tests fail now, since this commit:
d26a38f binman: Remove hard-coded file name for x86 CMC/FSP/VGA
Could you please take a look?
Regards,
Simon
cover x86: qemu: Add 64-bit U-Boot support
Hi Simon,
Quoted 48 lines · Simon Glass
Hi Bin,
Quoted 41 lines · Bin Meng
This brings U-Boot x86 64-bit support on QEMU target.
This series is available at u-boot-x86/qemu64-working for testing.
Bin Meng (14):
x86: qemu: Add missingDECLARE_GLOBAL_DATA_PTRine820.c
x86: Wrapprint_ch()with config option
x86: spl: Add weakarch_cpu_init_dm()
x86: Compileirq.cfor 64-bit
x86: qemu: Hidearch_cpu_init()andprint_cpuinfo()for U-Boot proper
x86: qemu: Fix compiler warnings for 64-bit
x86: qemu: Set up device tree for SPL
x86: qemu: Mark ucode as optional for SPL inu-boot.dtsi
tools: binman: Call correct init forEntry_u_boot_spl_with_ucode_ptr
tools: binman: Handle optional microcode case in SPL image
spl: Add a LF to the loading message
x86: qemu: Add a text base for 64-bit U-Boot
x86: qemu: Add build options for SPL
x86: qemu: Add a config for 64-bit U-Bootarch/x86/cpu/Makefile | 2 +- arch/x86/cpu/irq.c | 6 +- arch/x86/cpu/qemu/e820.c | 2 + arch/x86/cpu/qemu/qemu.c | 7 ++- arch/x86/cpu/x86_64/cpu.c | 2 + arch/x86/dts/emulation-u-boot.dtsi | 6 ++ arch/x86/dts/qemu-x86_i440fx.dts | 4 ++ arch/x86/dts/qemu-x86_q35.dts | 4 ++ arch/x86/lib/spl.c | 5 ++ board/emulation/Kconfig | 7 +++ board/emulation/qemu-x86/Kconfig | 6 +- board/emulation/qemu-x86/MAINTAINERS | 7 +++ common/spl/spl.c | 2 +- configs/qemu-x86_64_defconfig | 80 +++++++++++++++++++++++++ include/configs/qemu-x86.h | 9 +++ tools/binman/etype/u_boot_spl_with_ucode_ptr.py | 2 +- tools/binman/etype/u_boot_ucode.py | 6 ++ 17 files changed, 146 insertions(+), 11 deletions(-) create mode 100644 configs/qemu-x86_64_defconfigQuoted 3 lines
--
2.9.2
Quoted 6 lines
One point I noted in trying this out is that the binman tests fail now, since this commit:
d26a38f binman: Remove hard-coded file name for x86 CMC/FSP/VGA
Could you please take a look?
I will look into this.
Regards,
Bin