drivers/smmstore: Support 64-bit MMIO addresses
Currently the SMMSTOREv2 only supports MMIO ROM below 4GiB. As the space below 4GiB is typically limited on x86, add support for extended MMIO ROM windows as found on recent hardware. Allow the SMMSTOREv2 to be memory mapped above 4GiB by adding a new field to the coreboot table called 'mmap_addr'. The users outside of coreboot must check the size field of the coreboot struct to determine if mmap_addr is supported. When it is it holds the 64-bit physical address to the MMIO ROM window. The old 'mmap_addr' was renamed to 'mmap_addr_deprecated' to indicate that it should not be used any more. Change-Id: I1131cfa5cdbf92bbd33de3e5b22a305136eec9f7 Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/87114 Reviewed-by: Naresh Solanki <naresh.solanki@9elements.com> Reviewed-by: Paul Menzel <paulepanter@mailbox.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Maximilian Brune <maximilian.brune@9elements.com>
This commit is contained in:
parent
2706ce0266
commit
5bf88a44e9
4 changed files with 30 additions and 9 deletions
|
|
@ -74,19 +74,30 @@ has to read the coreboot table with tag `0x0039`, containing:
|
|||
struct lb_smmstorev2 {
|
||||
uint32_t tag;
|
||||
uint32_t size;
|
||||
uint32_t num_blocks; /* Number of writeable blocks in SMM */
|
||||
uint32_t block_size; /* Size of a block in byte. Default: 64 KiB */
|
||||
uint32_t mmap_addr; /* MMIO address of the store for read only access */
|
||||
uint32_t com_buffer; /* Physical address of the communication buffer */
|
||||
uint32_t com_buffer_size; /* Size of the communication buffer in byte */
|
||||
uint8_t apm_cmd; /* The command byte to write to the APM I/O port */
|
||||
uint8_t unused[3]; /* Set to zero */
|
||||
uint32_t num_blocks; /* Number of writable blocks in SMM */
|
||||
uint32_t block_size; /* Size of a block in byte. Default: 64 KiB */
|
||||
uint32_t mmap_addr_deprecated; /* 32-bit MMIO address of the store for read only access.
|
||||
Prefer 'mmap_addr' for new software.
|
||||
Zero when the address won't fit into 32-bits. */
|
||||
uint32_t com_buffer; /* Physical address of the communication buffer */
|
||||
uint32_t com_buffer_size; /* Size of the communication buffer in bytes */
|
||||
uint8_t apm_cmd; /* The command byte to write to the APM I/O port */
|
||||
uint8_t unused[3]; /* Set to zero */
|
||||
uint64_t mmap_addr; /* 64-bit MMIO address of the store for read only access.
|
||||
Introduced after the initial implementation. Users of
|
||||
this table must check the 'size' field to detect if its
|
||||
written out by coreboot. */
|
||||
};
|
||||
```
|
||||
|
||||
The absence of this coreboot table entry indicates that there's no
|
||||
SMMSTOREv2 support.
|
||||
|
||||
`mmap_addr` is an optional field added after the initial implementation.
|
||||
Users of this table must check the size field to know if it's written by coreboot.
|
||||
In case it's not present 'mmap_addr_deprecated' is to be used as the SPI ROM MMIO
|
||||
address and it must be below 4 GiB.
|
||||
|
||||
### Blocks
|
||||
|
||||
The SMMSTOREv2 splits the SMMSTORE FMAP partition into smaller chunks
|
||||
|
|
|
|||
|
|
@ -539,11 +539,17 @@ struct lb_smmstorev2 {
|
|||
uint32_t size;
|
||||
uint32_t num_blocks; /* Number of writable blocks in SMM */
|
||||
uint32_t block_size; /* Size of a block in byte. Default: 64 KiB */
|
||||
uint32_t mmap_addr; /* MMIO address of the store for read only access */
|
||||
uint32_t mmap_addr_deprecated; /* 32-bit MMIO address of the store for read only access.
|
||||
Prefer 'mmap_addr' for new software.
|
||||
Zero when the address won't fit into 32-bits. */
|
||||
uint32_t com_buffer; /* Physical address of the communication buffer */
|
||||
uint32_t com_buffer_size; /* Size of the communication buffer in bytes */
|
||||
uint8_t apm_cmd; /* The command byte to write to the APM I/O port */
|
||||
uint8_t unused[3]; /* Set to zero */
|
||||
uint64_t mmap_addr; /* 64-bit MMIO address of the store for read only access.
|
||||
Introduced after the initial implementation. Users of
|
||||
this table must check the 'size' field to detect if its
|
||||
written out by coreboot. */
|
||||
};
|
||||
|
||||
enum lb_tpm_ppi_tpm_version {
|
||||
|
|
|
|||
|
|
@ -28,6 +28,10 @@ void lb_smmstorev2(struct lb_header *header)
|
|||
store->size = sizeof(*store);
|
||||
store->com_buffer = (uintptr_t)cbmem_entry_start(e);
|
||||
store->com_buffer_size = cbmem_entry_size(e);
|
||||
if (info.mmap_addr < 4ULL * GiB)
|
||||
store->mmap_addr_deprecated = info.mmap_addr;
|
||||
else
|
||||
store->mmap_addr_deprecated = 0;
|
||||
store->mmap_addr = info.mmap_addr;
|
||||
store->num_blocks = info.num_blocks;
|
||||
store->block_size = info.block_size;
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ struct smmstore_params_init {
|
|||
struct smmstore_params_info {
|
||||
uint32_t num_blocks;
|
||||
uint32_t block_size;
|
||||
uint32_t mmap_addr;
|
||||
uint64_t mmap_addr;
|
||||
} __packed;
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue