Skip to content

Commit b05a184

Browse files
committed
Merge tag 'x86-pull-20230922' of https://source.denx.de/u-boot/custodians/u-boot-x86 into next
- Add bootstd support to 64-bit efi payload - Fix a bug of missing setting size of initrd in pxeboot - Allow Python packages to be dropped - Reland "x86: Move FACP table into separate functions" - Fixes for chromebook_link64 and chromebook_samus_tpl - Fixes and improvements for coreboot - x86 documentation updates
2 parents 5d2fae7 + 5728246 commit b05a184

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+752
-440
lines changed

Makefile

+9
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,15 @@ export RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o \
485485
export RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn \
486486
--exclude CVS --exclude .pc --exclude .hg --exclude .git
487487

488+
export PYTHON_ENABLE
489+
490+
# This is y if U-Boot should not build any Python tools or libraries. Typically
491+
# you would need to set this if those tools/libraries (typically binman and
492+
# pylibfdt) cannot be built by your environment and are provided separately.
493+
ifeq ($(NO_PYTHON),)
494+
PYTHON_ENABLE=y
495+
endif
496+
488497
# ===========================================================================
489498
# Rules shared between *config targets and build targets
490499

arch/arm/include/asm/global_data.h

+3
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ struct arch_global_data {
102102
#ifdef CONFIG_ARCH_IMX8ULP
103103
bool m33_handshake_done;
104104
#endif
105+
#ifdef CONFIG_SMBIOS
106+
ulong smbios_start; /* Start address of SMBIOS table */
107+
#endif
105108
};
106109

107110
#include <asm-generic/global_data.h>

arch/riscv/include/asm/global_data.h

+3
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ struct arch_global_data {
3232
ulong available_harts;
3333
#endif
3434
#endif
35+
#ifdef CONFIG_SMBIOS
36+
ulong smbios_start; /* Start address of SMBIOS table */
37+
#endif
3538
};
3639

3740
#include <asm-generic/global_data.h>

arch/sandbox/include/asm/global_data.h

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ struct arch_global_data {
1717
ulong table_end; /* End address of x86 tables */
1818
ulong table_start_high; /* Start address of high x86 tables */
1919
ulong table_end_high; /* End address of high x86 tables */
20+
ulong smbios_start; /* Start address of SMBIOS table */
2021
};
2122

2223
#include <asm-generic/global_data.h>

arch/x86/cpu/apollolake/acpi.c

+9-4
Original file line numberDiff line numberDiff line change
@@ -146,16 +146,21 @@ void fill_fadt(struct acpi_fadt *fadt)
146146
fadt->x_pm_tmr_blk.addrl = IOMAP_ACPI_BASE + PM1_TMR;
147147
}
148148

149-
void acpi_create_fadt(struct acpi_fadt *fadt, struct acpi_facs *facs,
150-
void *dsdt)
149+
static int apl_write_fadt(struct acpi_ctx *ctx, const struct acpi_writer *entry)
151150
{
152-
struct acpi_table_header *header = &fadt->header;
151+
struct acpi_table_header *header;
152+
struct acpi_fadt *fadt;
153153

154-
acpi_fadt_common(fadt, facs, dsdt);
154+
fadt = ctx->current;
155+
acpi_fadt_common(fadt, ctx->facs, ctx->dsdt);
155156
intel_acpi_fill_fadt(fadt);
156157
fill_fadt(fadt);
158+
header = &fadt->header;
157159
header->checksum = table_compute_checksum(fadt, header->length);
160+
161+
return acpi_add_fadt(ctx, fadt);
158162
}
163+
ACPI_WRITER(5fadt, "FADT", apl_write_fadt, 0);
159164

160165
int apl_acpi_fill_dmar(struct acpi_ctx *ctx)
161166
{

arch/x86/cpu/baytrail/acpi.c

+15-8
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,24 @@
1515
#include <asm/arch/iomap.h>
1616
#include <dm/uclass-internal.h>
1717

18-
void acpi_create_fadt(struct acpi_fadt *fadt, struct acpi_facs *facs,
19-
void *dsdt)
18+
static int baytrail_write_fadt(struct acpi_ctx *ctx,
19+
const struct acpi_writer *entry)
2020
{
21-
struct acpi_table_header *header = &(fadt->header);
21+
struct acpi_table_header *header;
22+
struct acpi_fadt *fadt;
23+
24+
fadt = ctx->current;
25+
header = &fadt->header;
2226
u16 pmbase = ACPI_BASE_ADDRESS;
2327

24-
memset((void *)fadt, 0, sizeof(struct acpi_fadt));
28+
memset(fadt, '\0', sizeof(struct acpi_fadt));
2529

2630
acpi_fill_header(header, "FACP");
2731
header->length = sizeof(struct acpi_fadt);
2832
header->revision = 4;
2933

30-
fadt->firmware_ctrl = (u32)facs;
31-
fadt->dsdt = (u32)dsdt;
34+
fadt->firmware_ctrl = (u32)ctx->facs;
35+
fadt->dsdt = (u32)ctx->dsdt;
3236
fadt->preferred_pm_profile = ACPI_PM_MOBILE;
3337
fadt->sci_int = 9;
3438
fadt->smi_cmd = 0;
@@ -75,9 +79,9 @@ void acpi_create_fadt(struct acpi_fadt *fadt, struct acpi_facs *facs,
7579
fadt->reset_reg.addrh = 0;
7680
fadt->reset_value = SYS_RST | RST_CPU | FULL_RST;
7781

78-
fadt->x_firmware_ctl_l = (u32)facs;
82+
fadt->x_firmware_ctl_l = (u32)ctx->facs;
7983
fadt->x_firmware_ctl_h = 0;
80-
fadt->x_dsdt_l = (u32)dsdt;
84+
fadt->x_dsdt_l = (u32)ctx->dsdt;
8185
fadt->x_dsdt_h = 0;
8286

8387
fadt->x_pm1a_evt_blk.space_id = ACPI_ADDRESS_SPACE_IO;
@@ -137,7 +141,10 @@ void acpi_create_fadt(struct acpi_fadt *fadt, struct acpi_facs *facs,
137141
fadt->x_gpe1_blk.addrh = 0x0;
138142

139143
header->checksum = table_compute_checksum(fadt, header->length);
144+
145+
return acpi_add_fadt(ctx, fadt);
140146
}
147+
ACPI_WRITER(5fadt, "FADT", baytrail_write_fadt, 0);
141148

142149
int acpi_create_gnvs(struct acpi_global_nvs *gnvs)
143150
{

arch/x86/cpu/broadwell/cpu.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <event.h>
1212
#include <init.h>
1313
#include <log.h>
14+
#include <spl.h>
1415
#include <asm/cpu.h>
1516
#include <asm/cpu_x86.h>
1617
#include <asm/cpu_common.h>
@@ -67,12 +68,11 @@ int arch_cpu_init(void)
6768
{
6869
post_code(POST_CPU_INIT);
6970

70-
#ifdef CONFIG_TPL
7171
/* Do a mini-init if TPL has already done the full init */
72-
return x86_cpu_reinit_f();
73-
#else
74-
return x86_cpu_init_f();
75-
#endif
72+
if (IS_ENABLED(CONFIG_TPL) && spl_phase() != PHASE_TPL)
73+
return x86_cpu_reinit_f();
74+
else
75+
return x86_cpu_init_f();
7676
}
7777

7878
int checkcpu(void)

arch/x86/cpu/broadwell/sdram.c

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
* From coreboot src/soc/intel/broadwell/romstage/raminit.c
66
*/
77

8+
#define LOG_CATEGORY UCLASS_RAM
9+
810
#include <common.h>
911
#include <dm.h>
1012
#include <init.h>

arch/x86/cpu/coreboot/Kconfig

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ config SYS_COREBOOT
2525
imply FS_CBFS
2626
imply CBMEM_CONSOLE
2727
imply X86_TSC_READ_BASE
28+
imply USE_PREBOOT
2829
select BINMAN if X86_64
2930

3031
endif

arch/x86/cpu/coreboot/coreboot.c

+9-7
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,22 @@
2121

2222
int arch_cpu_init(void)
2323
{
24-
int ret = get_coreboot_info(&lib_sysinfo);
24+
int ret;
25+
26+
ret = IS_ENABLED(CONFIG_X86_RUN_64BIT) ? x86_cpu_reinit_f() :
27+
x86_cpu_init_f();
28+
if (ret)
29+
return ret;
30+
31+
ret = get_coreboot_info(&lib_sysinfo);
2532
if (ret != 0) {
2633
printf("Failed to parse coreboot tables.\n");
2734
return ret;
2835
}
2936

3037
timestamp_init();
3138

32-
return IS_ENABLED(CONFIG_X86_RUN_64BIT) ? x86_cpu_reinit_f() :
33-
x86_cpu_init_f();
39+
return 0;
3440
}
3541

3642
int checkcpu(void)
@@ -80,10 +86,6 @@ static int last_stage_init(void)
8086
if (IS_ENABLED(CONFIG_SPL_BUILD))
8187
return 0;
8288

83-
/* start usb so that usb keyboard can be used as input device */
84-
if (IS_ENABLED(CONFIG_USB_KEYBOARD))
85-
usb_init();
86-
8789
board_final_init();
8890

8991
return 0;

arch/x86/cpu/i386/cpu.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ int cpu_phys_address_size(void)
415415
/* Don't allow PCI region 3 to use memory in the 2-4GB memory hole */
416416
static void setup_pci_ram_top(void)
417417
{
418-
gd->pci_ram_top = 0x80000000U;
418+
gd_set_pci_ram_top(0x80000000U);
419419
}
420420

421421
static void setup_mtrr(void)

arch/x86/cpu/intel_common/mrc.c

+17-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <dm.h>
1010
#include <init.h>
1111
#include <log.h>
12+
#include <spl.h>
1213
#include <syscon.h>
1314
#include <asm/cpu.h>
1415
#include <asm/global_data.h>
@@ -251,13 +252,28 @@ static int sdram_initialise(struct udevice *dev, struct udevice *me_dev,
251252
int mrc_common_init(struct udevice *dev, void *pei_data, bool use_asm_linkage)
252253
{
253254
struct udevice *me_dev;
254-
int ret;
255+
int ret, delay;
255256

256257
ret = syscon_get_by_driver_data(X86_SYSCON_ME, &me_dev);
257258
if (ret)
258259
return ret;
259260

261+
delay = dev_read_u32_default(dev, "fspm,training-delay", 0);
262+
if (spl_phase() == PHASE_SPL) {
263+
if (delay)
264+
printf("SDRAM training (%d seconds)...", delay);
265+
else
266+
log_debug("SDRAM init...");
267+
} else {
268+
if (delay)
269+
printf("(%d seconds)...", delay);
270+
}
271+
260272
ret = sdram_initialise(dev, me_dev, pei_data, use_asm_linkage);
273+
if (delay)
274+
printf("done\n");
275+
else
276+
log_debug("done\n");
261277
if (ret)
262278
return ret;
263279
quick_ram_check();

arch/x86/cpu/quark/acpi.c

+15-8
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,24 @@
1010
#include <asm/arch/global_nvs.h>
1111
#include <asm/arch/iomap.h>
1212

13-
void acpi_create_fadt(struct acpi_fadt *fadt, struct acpi_facs *facs,
14-
void *dsdt)
13+
static int quark_write_fadt(struct acpi_ctx *ctx,
14+
const struct acpi_writer *entry)
1515
{
16-
struct acpi_table_header *header = &(fadt->header);
1716
u16 pmbase = ACPI_PM1_BASE_ADDRESS;
17+
struct acpi_table_header *header;
18+
struct acpi_fadt *fadt;
1819

19-
memset((void *)fadt, 0, sizeof(struct acpi_fadt));
20+
fadt = ctx->current;
21+
header = &fadt->header;
22+
23+
memset(fadt, '\0', sizeof(struct acpi_fadt));
2024

2125
acpi_fill_header(header, "FACP");
2226
header->length = sizeof(struct acpi_fadt);
2327
header->revision = 4;
2428

25-
fadt->firmware_ctrl = (u32)facs;
26-
fadt->dsdt = (u32)dsdt;
29+
fadt->firmware_ctrl = (u32)ctx->facs;
30+
fadt->dsdt = (u32)ctx->dsdt;
2731
fadt->preferred_pm_profile = ACPI_PM_UNSPECIFIED;
2832
fadt->sci_int = 9;
2933
fadt->smi_cmd = 0;
@@ -70,9 +74,9 @@ void acpi_create_fadt(struct acpi_fadt *fadt, struct acpi_facs *facs,
7074
fadt->reset_reg.addrh = 0;
7175
fadt->reset_value = SYS_RST | RST_CPU | FULL_RST;
7276

73-
fadt->x_firmware_ctl_l = (u32)facs;
77+
fadt->x_firmware_ctl_l = (u32)ctx->facs;
7478
fadt->x_firmware_ctl_h = 0;
75-
fadt->x_dsdt_l = (u32)dsdt;
79+
fadt->x_dsdt_l = (u32)ctx->dsdt;
7680
fadt->x_dsdt_h = 0;
7781

7882
fadt->x_pm1a_evt_blk.space_id = ACPI_ADDRESS_SPACE_IO;
@@ -132,7 +136,10 @@ void acpi_create_fadt(struct acpi_fadt *fadt, struct acpi_facs *facs,
132136
fadt->x_gpe1_blk.addrh = 0x0;
133137

134138
header->checksum = table_compute_checksum(fadt, header->length);
139+
140+
return acpi_add_fadt(ctx, fadt);
135141
}
142+
ACPI_WRITER(5fadt, "FADT", quark_write_fadt, 0);
136143

137144
int acpi_create_gnvs(struct acpi_global_nvs *gnvs)
138145
{

arch/x86/cpu/tangier/acpi.c

+15-8
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,23 @@
1616
#include <asm/arch/iomap.h>
1717
#include <dm/uclass-internal.h>
1818

19-
void acpi_create_fadt(struct acpi_fadt *fadt, struct acpi_facs *facs,
20-
void *dsdt)
19+
static int tangier_write_fadt(struct acpi_ctx *ctx,
20+
const struct acpi_writer *entry)
2121
{
22-
struct acpi_table_header *header = &(fadt->header);
22+
struct acpi_table_header *header;
23+
struct acpi_fadt *fadt;
2324

24-
memset((void *)fadt, 0, sizeof(struct acpi_fadt));
25+
fadt = ctx->current;
26+
header = &fadt->header;
27+
28+
memset(fadt, '\0', sizeof(struct acpi_fadt));
2529

2630
acpi_fill_header(header, "FACP");
2731
header->length = sizeof(struct acpi_fadt);
2832
header->revision = 6;
2933

30-
fadt->firmware_ctrl = (u32)facs;
31-
fadt->dsdt = (u32)dsdt;
34+
fadt->firmware_ctrl = (u32)ctx->facs;
35+
fadt->dsdt = (u32)ctx->dsdt;
3236
fadt->preferred_pm_profile = ACPI_PM_UNSPECIFIED;
3337

3438
fadt->iapc_boot_arch = ACPI_FADT_VGA_NOT_PRESENT |
@@ -41,13 +45,16 @@ void acpi_create_fadt(struct acpi_fadt *fadt, struct acpi_facs *facs,
4145

4246
fadt->minor_revision = 2;
4347

44-
fadt->x_firmware_ctl_l = (u32)facs;
48+
fadt->x_firmware_ctl_l = (u32)ctx->facs;
4549
fadt->x_firmware_ctl_h = 0;
46-
fadt->x_dsdt_l = (u32)dsdt;
50+
fadt->x_dsdt_l = (u32)ctx->dsdt;
4751
fadt->x_dsdt_h = 0;
4852

4953
header->checksum = table_compute_checksum(fadt, header->length);
54+
55+
return acpi_add_fadt(ctx, fadt);
5056
}
57+
ACPI_WRITER(5fadt, "FADT", tangier_write_fadt, 0);
5158

5259
u32 acpi_fill_madt(u32 current)
5360
{

arch/x86/cpu/x86_64/cpu.c

+7
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@
88
#include <cpu_func.h>
99
#include <debug_uart.h>
1010
#include <init.h>
11+
#include <asm/cpu.h>
1112
#include <asm/global_data.h>
1213

14+
DECLARE_GLOBAL_DATA_PTR;
15+
1316
int cpu_has_64bit(void)
1417
{
1518
return true;
@@ -38,6 +41,10 @@ int x86_mp_init(void)
3841

3942
int x86_cpu_reinit_f(void)
4043
{
44+
/* set the vendor to Intel so that native_calibrate_tsc() works */
45+
gd->arch.x86_vendor = X86_VENDOR_INTEL;
46+
gd->arch.has_mtrr = true;
47+
4148
return 0;
4249
}
4350

arch/x86/dts/chromebook_samus.dts

+1
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@
266266
board-id-gpios = <&gpio_c 5 0>, <&gpio_c 4 0>,
267267
<&gpio_c 3 0>, <&gpio_c 1 0>;
268268
bootph-all;
269+
fspm,training-delay = <7>;
269270
spd {
270271
#address-cells = <1>;
271272
#size-cells = <0>;

arch/x86/dts/coreboot.dts

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
};
4343

4444
coreboot-fb {
45+
bootph-some-ram;
4546
compatible = "coreboot-fb";
4647
};
4748
};

0 commit comments

Comments
 (0)