Skip to content

Commit 2b369ac

Browse files
committed
nai_68int6: add the I2C0/GSPI0 board devices and pick the Linux or Multiboot2 payload per image
1 parent 6d79499 commit 2b369ac

6 files changed

Lines changed: 330 additions & 26 deletions

File tree

‎docs/Targets.md‎

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9096,7 +9096,7 @@ Notable options in [config/examples/nai_68int6.config](../config/examples/nai_68
90969096
| Option | Meaning |
90979097
|---|---|
90989098
| `X86_UART_NUMBER=2` | LPSS UART2 for all three FSP phases (Kontron uses 0) |
9099-
| `ACPI=1` | Required. Generates ACPI tables (RSDP/XSDT/FADT/MADT/MCFG and a minimal DSDT); the board's PCI interrupt routing is only in the DSDT `_PRT`, since the MP table is the Kontron one |
9099+
| `ACPI=1` | Required. Generates ACPI tables (RSDP/XSDT/FADT/MADT/MCFG and a minimal DSDT); the board's PCI interrupt routing is only in the DSDT `_PRT`, since the MP table is the Kontron one. The DSDT also declares the board devices on LPSS I2C0 (EEPROMs, RTC/watchdog) and GSPI0 (the PRC, for NAI's `naigspi` driver) |
91009100
| `ANTI_ROLLBACK=1` | Persistent version floor and boot audit counters in TPM NV |
91019101
| `MEASURED_BOOT=1`, `MEASURED_PCR_OS=4` | Firmware into PCR 0, the verified OS image into PCR 4 |
91029102
| `WOLFBOOT_BOOT_DISK=0` | Boot from GPT partitions; the A/B indices (sda3/sda4) are set in `src/update_disk.c` |
@@ -9117,7 +9117,26 @@ The booted OS cannot lower the floor. The index is platform-created and writable
91179117

91189118
### Boot, programming and recovery
91199119

9120-
wolfBoot boots the highest-versioned signed 64-bit `bzImage` that verifies from the two GPT boot partitions. It falls back to the other slot only if that is not a downgrade (see Anti-rollback), and halts if neither boots. Program the flash with a Dediprog SF100 on JP4 while the board is off; the BIOS region lock blocks `flashrom` from the booted OS. JP36 selects which bank boots and which one the programmer sees; move it only with the board off.
9120+
wolfBoot boots the highest-versioned signed 64-bit `bzImage` or Multiboot2 ELF that verifies from the two GPT boot partitions. It falls back to the other slot only if that is not a downgrade (see Anti-rollback), and halts if neither boots. Program the flash with a Dediprog SF100 on JP4 while the board is off; the BIOS region lock blocks `flashrom` from the booted OS. JP36 selects which bank boots and which one the programmer sees; move it only with the board off.
9121+
9122+
### Multiboot2 ELF payloads
9123+
9124+
The configuration builds both payload paths (`LINUX_PAYLOAD=1`, `ELF=1`, `MULTIBOOT2=1`), and `do_boot()` picks one per image: an image that starts with the ELF magic takes the Multiboot2 path, and anything else boots as Linux. A Multiboot2 RTOS image such as Green Hills INTEGRITY-178 is signed and written to an A/B slot the same way as a kernel:
9125+
9126+
```
9127+
./tools/keytools/sign --ecc384 --sha384 <payload.elf> wolfboot_signing_private_key.der <version>
9128+
```
9129+
9130+
The two paths differ only in the handoff:
9131+
9132+
| | Linux `bzImage` | Multiboot2 ELF |
9133+
|---|---|---|
9134+
| Entry | 64-bit Linux boot protocol, `boot_params` and the command line | ELF segments loaded at their physical addresses, virtual addresses mapped in wolfBoot's page tables, jump to `e_entry` in 64-bit mode with EAX=`0x36d76289` and EBX pointing to the Multiboot2 information |
9135+
| Memory map | E820 table in `boot_params` | Multiboot2 memory map and basic memory information tags, from the FSP HOBs |
9136+
| ACPI tables | Generated (`ACPI=1`) | None; they are only built on the Linux path |
9137+
| RTC | The legacy CMOS RTC is ignored under the hardware-reduced ACPI tables; the I2C0 RTC is declared in the DSDT | The CMOS RTC is usable directly; I2C0 is enabled for the board RTC |
9138+
9139+
Everything else is shared: FSP silicon setup (VT-d at the stock BIOS addresses, Hyper-Threading off), the halted PCH TCO watchdog, the BIOS region lock, measured boot, anti-rollback and A/B selection.
91219140

91229141
## Infineon PSOC Control C3
91239142

‎include/x86/acpi_dsdt.h‎

Lines changed: 69 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
* Regenerate: iasl src/x86/acpi_dsdt.asl &&
2323
* xxd -i -n acpi_dsdt_aml src/x86/acpi_dsdt.aml (append below this header). */
2424
static const unsigned char acpi_dsdt_aml[] = {
25-
0x44, 0x53, 0x44, 0x54, 0x1e, 0x02, 0x00, 0x00, 0x02, 0x48, 0x57, 0x4f,
25+
0x44, 0x53, 0x44, 0x54, 0x29, 0x05, 0x00, 0x00, 0x02, 0xa7, 0x57, 0x4f,
2626
0x4c, 0x46, 0x42, 0x54, 0x4e, 0x41, 0x49, 0x54, 0x47, 0x4c, 0x00, 0x00,
2727
0x01, 0x00, 0x00, 0x00, 0x49, 0x4e, 0x54, 0x4c, 0x28, 0x06, 0x23, 0x20,
28-
0x10, 0x49, 0x1f, 0x5f, 0x53, 0x42, 0x5f, 0x5b, 0x82, 0x41, 0x1f, 0x50,
28+
0x10, 0x44, 0x50, 0x5f, 0x53, 0x42, 0x5f, 0x5b, 0x82, 0x4c, 0x4f, 0x50,
2929
0x43, 0x49, 0x30, 0x08, 0x5f, 0x48, 0x49, 0x44, 0x0c, 0x41, 0xd0, 0x0a,
3030
0x08, 0x08, 0x5f, 0x43, 0x49, 0x44, 0x0c, 0x41, 0xd0, 0x0a, 0x03, 0x08,
3131
0x5f, 0x53, 0x45, 0x47, 0x00, 0x08, 0x5f, 0x42, 0x42, 0x4e, 0x00, 0x08,
@@ -67,6 +67,71 @@ static const unsigned char acpi_dsdt_aml[] = {
6767
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
6868
0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6969
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
70-
0x79, 0x00
70+
0x79, 0x00, 0x5b, 0x82, 0x49, 0x25, 0x49, 0x32, 0x43, 0x30, 0x08, 0x5f,
71+
0x41, 0x44, 0x52, 0x0c, 0x00, 0x00, 0x15, 0x00, 0x5b, 0x82, 0x43, 0x0c,
72+
0x45, 0x45, 0x50, 0x32, 0x08, 0x5f, 0x48, 0x49, 0x44, 0x0d, 0x31, 0x35,
73+
0x41, 0x43, 0x30, 0x30, 0x30, 0x32, 0x00, 0x08, 0x5f, 0x43, 0x49, 0x44,
74+
0x0d, 0x50, 0x52, 0x50, 0x30, 0x30, 0x30, 0x31, 0x00, 0x08, 0x5f, 0x44,
75+
0x44, 0x4e, 0x0d, 0x4e, 0x41, 0x49, 0x20, 0x4d, 0x6f, 0x74, 0x68, 0x65,
76+
0x72, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x20, 0x45, 0x45, 0x50, 0x52, 0x4f,
77+
0x4d, 0x00, 0x08, 0x5f, 0x43, 0x52, 0x53, 0x11, 0x26, 0x0a, 0x23, 0x8e,
78+
0x1e, 0x00, 0x02, 0x00, 0x01, 0x02, 0x00, 0x00, 0x01, 0x06, 0x00, 0xa0,
79+
0x86, 0x01, 0x00, 0x56, 0x00, 0x5c, 0x5f, 0x53, 0x42, 0x2e, 0x50, 0x43,
80+
0x49, 0x30, 0x2e, 0x49, 0x32, 0x43, 0x30, 0x00, 0x79, 0x00, 0x08, 0x5f,
81+
0x44, 0x53, 0x44, 0x12, 0x41, 0x05, 0x02, 0x11, 0x13, 0x0a, 0x10, 0x14,
82+
0xd8, 0xff, 0xda, 0xba, 0x6e, 0x8c, 0x4d, 0x8a, 0x91, 0xbc, 0x9b, 0xbf,
83+
0x4a, 0xa3, 0x01, 0x12, 0x39, 0x03, 0x12, 0x1b, 0x02, 0x0d, 0x63, 0x6f,
84+
0x6d, 0x70, 0x61, 0x74, 0x69, 0x62, 0x6c, 0x65, 0x00, 0x0d, 0x61, 0x74,
85+
0x6d, 0x65, 0x6c, 0x2c, 0x32, 0x34, 0x63, 0x30, 0x32, 0x00, 0x12, 0x0b,
86+
0x02, 0x0d, 0x73, 0x69, 0x7a, 0x65, 0x00, 0x0b, 0x00, 0x01, 0x12, 0x0e,
87+
0x02, 0x0d, 0x70, 0x61, 0x67, 0x65, 0x73, 0x69, 0x7a, 0x65, 0x00, 0x0a,
88+
0x08, 0x5b, 0x82, 0x46, 0x0d, 0x45, 0x45, 0x50, 0x33, 0x08, 0x5f, 0x48,
89+
0x49, 0x44, 0x0d, 0x31, 0x35, 0x41, 0x43, 0x30, 0x30, 0x30, 0x33, 0x00,
90+
0x08, 0x5f, 0x43, 0x49, 0x44, 0x0d, 0x50, 0x52, 0x50, 0x30, 0x30, 0x30,
91+
0x31, 0x00, 0x08, 0x5f, 0x44, 0x44, 0x4e, 0x0d, 0x4e, 0x41, 0x49, 0x20,
92+
0x4d, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x20,
93+
0x45, 0x45, 0x50, 0x52, 0x4f, 0x4d, 0x20, 0x53, 0x4e, 0x00, 0x08, 0x5f,
94+
0x43, 0x52, 0x53, 0x11, 0x26, 0x0a, 0x23, 0x8e, 0x1e, 0x00, 0x02, 0x00,
95+
0x01, 0x02, 0x00, 0x00, 0x01, 0x06, 0x00, 0xa0, 0x86, 0x01, 0x00, 0x5e,
96+
0x00, 0x5c, 0x5f, 0x53, 0x42, 0x2e, 0x50, 0x43, 0x49, 0x30, 0x2e, 0x49,
97+
0x32, 0x43, 0x30, 0x00, 0x79, 0x00, 0x08, 0x5f, 0x44, 0x53, 0x44, 0x12,
98+
0x41, 0x06, 0x02, 0x11, 0x13, 0x0a, 0x10, 0x14, 0xd8, 0xff, 0xda, 0xba,
99+
0x6e, 0x8c, 0x4d, 0x8a, 0x91, 0xbc, 0x9b, 0xbf, 0x4a, 0xa3, 0x01, 0x12,
100+
0x49, 0x04, 0x04, 0x12, 0x1c, 0x02, 0x0d, 0x63, 0x6f, 0x6d, 0x70, 0x61,
101+
0x74, 0x69, 0x62, 0x6c, 0x65, 0x00, 0x0d, 0x61, 0x74, 0x6d, 0x65, 0x6c,
102+
0x2c, 0x32, 0x34, 0x63, 0x73, 0x30, 0x32, 0x00, 0x12, 0x0a, 0x02, 0x0d,
103+
0x73, 0x69, 0x7a, 0x65, 0x00, 0x0a, 0x10, 0x12, 0x0e, 0x02, 0x0d, 0x70,
104+
0x61, 0x67, 0x65, 0x73, 0x69, 0x7a, 0x65, 0x00, 0x0a, 0x08, 0x12, 0x0e,
105+
0x02, 0x0d, 0x72, 0x65, 0x61, 0x64, 0x2d, 0x6f, 0x6e, 0x6c, 0x79, 0x00,
106+
0x01, 0x5b, 0x82, 0x4a, 0x0a, 0x52, 0x54, 0x43, 0x31, 0x08, 0x5f, 0x48,
107+
0x49, 0x44, 0x0d, 0x31, 0x35, 0x41, 0x43, 0x30, 0x30, 0x30, 0x34, 0x00,
108+
0x08, 0x5f, 0x43, 0x49, 0x44, 0x0d, 0x50, 0x52, 0x50, 0x30, 0x30, 0x30,
109+
0x31, 0x00, 0x08, 0x5f, 0x44, 0x44, 0x4e, 0x0d, 0x4e, 0x41, 0x49, 0x20,
110+
0x4d, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x20,
111+
0x57, 0x44, 0x54, 0x20, 0x52, 0x54, 0x43, 0x00, 0x08, 0x5f, 0x43, 0x52,
112+
0x53, 0x11, 0x26, 0x0a, 0x23, 0x8e, 0x1e, 0x00, 0x02, 0x00, 0x01, 0x02,
113+
0x00, 0x00, 0x01, 0x06, 0x00, 0xa0, 0x86, 0x01, 0x00, 0x68, 0x00, 0x5c,
114+
0x5f, 0x53, 0x42, 0x2e, 0x50, 0x43, 0x49, 0x30, 0x2e, 0x49, 0x32, 0x43,
115+
0x30, 0x00, 0x79, 0x00, 0x08, 0x5f, 0x44, 0x53, 0x44, 0x12, 0x37, 0x02,
116+
0x11, 0x13, 0x0a, 0x10, 0x14, 0xd8, 0xff, 0xda, 0xba, 0x6e, 0x8c, 0x4d,
117+
0x8a, 0x91, 0xbc, 0x9b, 0xbf, 0x4a, 0xa3, 0x01, 0x12, 0x20, 0x01, 0x12,
118+
0x1d, 0x02, 0x0d, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x74, 0x69, 0x62, 0x6c,
119+
0x65, 0x00, 0x0d, 0x64, 0x61, 0x6c, 0x6c, 0x61, 0x73, 0x2c, 0x64, 0x73,
120+
0x31, 0x33, 0x37, 0x34, 0x00, 0x5b, 0x82, 0x4e, 0x0a, 0x53, 0x50, 0x49,
121+
0x30, 0x08, 0x5f, 0x41, 0x44, 0x52, 0x0c, 0x02, 0x00, 0x1e, 0x00, 0x5b,
122+
0x82, 0x4c, 0x09, 0x50, 0x52, 0x43, 0x30, 0x08, 0x5f, 0x48, 0x49, 0x44,
123+
0x0d, 0x31, 0x35, 0x41, 0x43, 0x30, 0x30, 0x30, 0x31, 0x00, 0x08, 0x5f,
124+
0x53, 0x54, 0x52, 0x11, 0x42, 0x05, 0x0a, 0x4e, 0x4e, 0x00, 0x41, 0x00,
125+
0x49, 0x00, 0x20, 0x00, 0x47, 0x00, 0x53, 0x00, 0x50, 0x00, 0x49, 0x00,
126+
0x20, 0x00, 0x50, 0x00, 0x72, 0x00, 0x6f, 0x00, 0x63, 0x00, 0x65, 0x00,
127+
0x73, 0x00, 0x73, 0x00, 0x6f, 0x00, 0x72, 0x00, 0x20, 0x00, 0x52, 0x00,
128+
0x65, 0x00, 0x67, 0x00, 0x69, 0x00, 0x73, 0x00, 0x74, 0x00, 0x65, 0x00,
129+
0x72, 0x00, 0x20, 0x00, 0x43, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x74, 0x00,
130+
0x72, 0x00, 0x6f, 0x00, 0x6c, 0x00, 0x6c, 0x00, 0x65, 0x00, 0x72, 0x00,
131+
0x00, 0x00, 0x08, 0x5f, 0x43, 0x52, 0x53, 0x11, 0x29, 0x0a, 0x26, 0x8e,
132+
0x21, 0x00, 0x02, 0x00, 0x02, 0x02, 0x00, 0x00, 0x01, 0x09, 0x00, 0x20,
133+
0xa1, 0x07, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x5f, 0x53, 0x42,
134+
0x2e, 0x50, 0x43, 0x49, 0x30, 0x2e, 0x53, 0x50, 0x49, 0x30, 0x00, 0x79,
135+
0x00
71136
};
72-
static const unsigned int acpi_dsdt_aml_len = 542;
137+
static const unsigned int acpi_dsdt_aml_len = 1321;

‎include/x86/gpio_config.h‎

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@
3939

4040
#define GPIO_GPPC_B9_CFG_OFF (0x790)
4141
#define GPIO_GPPC_B10_CFG_OFF (0x7a0)
42+
#define GPIO_GPPC_B15_CFG_OFF (0x7f0)
43+
#define GPIO_GPPC_B16_CFG_OFF (0x800)
44+
#define GPIO_GPPC_B17_CFG_OFF (0x810)
45+
#define GPIO_GPPC_B18_CFG_OFF (0x820)
4246
#define GPIO_GPPC_C6_CFG_OFF (0x760)
4347
#define GPIO_GPPC_C7_CFG_OFF (0x770)
4448
#define GPIO_GPPC_C8_CFG_OFF (0x780)
@@ -49,6 +53,8 @@
4953
#define GPIO_GPPC_C13_CFG_OFF (0x7d0)
5054
#define GPIO_GPPC_C14_CFG_OFF (0x7e0)
5155
#define GPIO_GPPC_C15_CFG_OFF (0x7f0)
56+
#define GPIO_GPPC_C16_CFG_OFF (0x800)
57+
#define GPIO_GPPC_C17_CFG_OFF (0x810)
5258
#define GPIO_GPPC_C20_CFG_OFF (0x840)
5359
#define GPIO_GPPC_C21_CFG_OFF (0x850)
5460
#define GPIO_GPPC_C22_CFG_OFF (0x860)
@@ -688,6 +694,109 @@ static const struct tgl_gpio_conf gpio_table_presilicon[] = {
688694
.gpio_rxinv = 0x00,
689695
.gpio_rxevconf = 0x02,
690696
.gpio_reset = GPIO_RESET_PLTRST},
697+
/* GSPI0 (B15-B18) and I2C0 (C16/C17) in native mode, as stock. */
698+
/* PAD B15 (DW0=0x44000601 DW1=0x00000027) */
699+
{.gpio =
700+
{
701+
.comm_port_id = GPIO_COMM_0_PORT_ID,
702+
.cfg_offset = GPIO_GPPC_B15_CFG_OFF,
703+
},
704+
.flags =
705+
(GPIO_SET_MODE | GPIO_SET_DIRECTION | GPIO_SET_RESET |
706+
GPIO_SET_TERM | GPIO_SET_INTERRUPT | GPIO_SET_RXINV |
707+
GPIO_SET_RXEVCONF),
708+
.gpio_mode = GPIO_MODE_NATIVE_1,
709+
.gpio_dir = GPIO_DIR_OUTPUT,
710+
.gpio_term = GPIO_TERM_NONE,
711+
.gpio_interrupt = 0x00,
712+
.gpio_rxinv = 0x00,
713+
.gpio_rxevconf = 0x02,
714+
.gpio_reset = GPIO_RESET_HOSTDEEPRESET},
715+
/* PAD B16 (DW0=0x84000601 DW1=0x00000028) */
716+
{.gpio =
717+
{
718+
.comm_port_id = GPIO_COMM_0_PORT_ID,
719+
.cfg_offset = GPIO_GPPC_B16_CFG_OFF,
720+
},
721+
.flags =
722+
(GPIO_SET_MODE | GPIO_SET_DIRECTION | GPIO_SET_RESET |
723+
GPIO_SET_TERM | GPIO_SET_INTERRUPT | GPIO_SET_RXINV |
724+
GPIO_SET_RXEVCONF),
725+
.gpio_mode = GPIO_MODE_NATIVE_1,
726+
.gpio_dir = GPIO_DIR_OUTPUT,
727+
.gpio_term = GPIO_TERM_NONE,
728+
.gpio_interrupt = 0x00,
729+
.gpio_rxinv = 0x00,
730+
.gpio_rxevconf = 0x02,
731+
.gpio_reset = GPIO_RESET_PLTRST},
732+
/* PAD B17 (DW0=0x44000702 DW1=0x00010029) */
733+
{.gpio =
734+
{
735+
.comm_port_id = GPIO_COMM_0_PORT_ID,
736+
.cfg_offset = GPIO_GPPC_B17_CFG_OFF,
737+
},
738+
.flags =
739+
(GPIO_SET_MODE | GPIO_SET_DIRECTION | GPIO_SET_RESET |
740+
GPIO_SET_TERM | GPIO_SET_INTERRUPT | GPIO_SET_RXINV |
741+
GPIO_SET_RXEVCONF),
742+
.gpio_mode = GPIO_MODE_NATIVE_1,
743+
.gpio_dir = 0x03,
744+
.gpio_term = GPIO_TERM_NONE,
745+
.gpio_interrupt = 0x00,
746+
.gpio_rxinv = 0x00,
747+
.gpio_rxevconf = 0x02,
748+
.gpio_reset = GPIO_RESET_HOSTDEEPRESET},
749+
/* PAD B18 (DW0=0x84000600 DW1=0x0000002A) */
750+
{.gpio =
751+
{
752+
.comm_port_id = GPIO_COMM_0_PORT_ID,
753+
.cfg_offset = GPIO_GPPC_B18_CFG_OFF,
754+
},
755+
.flags =
756+
(GPIO_SET_MODE | GPIO_SET_DIRECTION | GPIO_SET_RESET |
757+
GPIO_SET_TERM | GPIO_SET_INTERRUPT | GPIO_SET_RXINV |
758+
GPIO_SET_RXEVCONF),
759+
.gpio_mode = GPIO_MODE_NATIVE_1,
760+
.gpio_dir = GPIO_DIR_OUTPUT,
761+
.gpio_term = GPIO_TERM_NONE,
762+
.gpio_interrupt = 0x00,
763+
.gpio_rxinv = 0x00,
764+
.gpio_rxevconf = 0x02,
765+
.gpio_reset = GPIO_RESET_PLTRST},
766+
/* PAD C16 (DW0=0x44000702 DW1=0x0000001E) */
767+
{.gpio =
768+
{
769+
.comm_port_id = GPIO_COMM_4_PORT_ID,
770+
.cfg_offset = GPIO_GPPC_C16_CFG_OFF,
771+
},
772+
.flags =
773+
(GPIO_SET_MODE | GPIO_SET_DIRECTION | GPIO_SET_RESET |
774+
GPIO_SET_TERM | GPIO_SET_INTERRUPT | GPIO_SET_RXINV |
775+
GPIO_SET_RXEVCONF),
776+
.gpio_mode = GPIO_MODE_NATIVE_1,
777+
.gpio_dir = 0x03,
778+
.gpio_term = GPIO_TERM_NONE,
779+
.gpio_interrupt = 0x00,
780+
.gpio_rxinv = 0x00,
781+
.gpio_rxevconf = 0x02,
782+
.gpio_reset = GPIO_RESET_HOSTDEEPRESET},
783+
/* PAD C17 (DW0=0x44000702 DW1=0x0000001F) */
784+
{.gpio =
785+
{
786+
.comm_port_id = GPIO_COMM_4_PORT_ID,
787+
.cfg_offset = GPIO_GPPC_C17_CFG_OFF,
788+
},
789+
.flags =
790+
(GPIO_SET_MODE | GPIO_SET_DIRECTION | GPIO_SET_RESET |
791+
GPIO_SET_TERM | GPIO_SET_INTERRUPT | GPIO_SET_RXINV |
792+
GPIO_SET_RXEVCONF),
793+
.gpio_mode = GPIO_MODE_NATIVE_1,
794+
.gpio_dir = 0x03,
795+
.gpio_term = GPIO_TERM_NONE,
796+
.gpio_interrupt = 0x00,
797+
.gpio_rxinv = 0x00,
798+
.gpio_rxevconf = 0x02,
799+
.gpio_reset = GPIO_RESET_HOSTDEEPRESET},
691800
};
692801

693802
#else /* TARGET_kontron_vx3060_s2 */

‎src/boot_x86_fsp_payload.c‎

Lines changed: 39 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -94,29 +94,16 @@ void jump(uintptr_t entry)
9494
: "g"(entry));
9595
}
9696

97+
#if defined(WOLFBOOT_ELF)
9798
/**
98-
* @brief Perform the boot process for the given application.
99-
*
100-
* This function performs the boot process for the specified application.
101-
* It either loads and boots a Linux payload or an ELF binary, depending on the
102-
* configuration.
99+
* @brief Load an ELF image and boot it, through Multiboot2 when enabled.
103100
*
104-
* @param app Pointer to the start of the application.
101+
* @param app Pointer to the start of the ELF image.
102+
* @param stage2_params Stage 2 parameters (memory layout and FSP HOBs).
105103
*/
106-
void do_boot(const uint32_t *app)
104+
static void boot_elf(const uint32_t *app,
105+
struct stage2_parameter *stage2_params)
107106
{
108-
struct stage2_parameter *stage2_params;
109-
110-
#ifdef WOLFBOOT_TPM
111-
wolfBoot_tpm2_deinit();
112-
#endif /* WOLFBOOT_TPM */
113-
114-
stage2_params = stage2_get_parameters();
115-
#if defined(WOLFBOOT_LINUX_PAYLOAD)
116-
mptable_setup();
117-
load_linux((uint8_t *)app, stage2_params->payload_size, stage2_params,
118-
cmdline);
119-
#elif defined(WOLFBOOT_ELF)
120107
int r;
121108
uint64_t e;
122109
uint8_t *mb2_header;
@@ -163,7 +150,40 @@ void do_boot(const uint32_t *app)
163150
#else
164151
jump(e);
165152
#endif /* WOLFBOOT_MULTIBOOT2 */
153+
}
154+
#endif /* WOLFBOOT_ELF */
155+
156+
/**
157+
* @brief Perform the boot process for the given application.
158+
*
159+
* This function performs the boot process for the specified application.
160+
* It either loads and boots a Linux payload or an ELF binary, depending on the
161+
* configuration. With both built in, an image starting with the ELF magic
162+
* takes the ELF path and anything else boots as Linux.
163+
*
164+
* @param app Pointer to the start of the application.
165+
*/
166+
void do_boot(const uint32_t *app)
167+
{
168+
struct stage2_parameter *stage2_params;
169+
170+
#ifdef WOLFBOOT_TPM
171+
wolfBoot_tpm2_deinit();
172+
#endif /* WOLFBOOT_TPM */
166173

174+
stage2_params = stage2_get_parameters();
175+
#if defined(WOLFBOOT_LINUX_PAYLOAD) && defined(WOLFBOOT_ELF)
176+
if (memcmp(app, ELF_IDENT_STR, 4) == 0) {
177+
boot_elf(app, stage2_params);
178+
return;
179+
}
180+
#endif
181+
#if defined(WOLFBOOT_LINUX_PAYLOAD)
182+
mptable_setup();
183+
load_linux((uint8_t *)app, stage2_params->payload_size, stage2_params,
184+
cmdline);
185+
#elif defined(WOLFBOOT_ELF)
186+
boot_elf(app, stage2_params);
167187
#else
168188
#error "No payload compiled in"
169189
#endif /* WOLFBOOT_LINUX_PAYLOAD */

0 commit comments

Comments
 (0)