Hello Martin Roth, Furquan Shaikh,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/34424
to review the following change.
Change subject: _WIP_ soc/amd/picasso: Update northbridge ......................................................................
_WIP_ soc/amd/picasso: Update northbridge
todo: need to update northbridge_init() to set NP regions. Waiting on agreement for publishing NDA info in b:137781581
Family 17h devices is designed with a new internal architecture, frequently referred to as the data fabric. Although designed to behave somewhat like the older integrated northbridge designs, the D18Fx definitions are completely new.
AGESA sets up most of the necessary configuration. coreboot still enables the VGA decode if used.
Change-Id: I44a4a97765151fbcfe4c5d8de200e3e015aaaf2e Signed-off-by: Marshall Dawson marshalldawson3rd@gmail.com --- M src/soc/amd/picasso/chip.c M src/soc/amd/picasso/include/soc/northbridge.h M src/soc/amd/picasso/include/soc/pci_devs.h M src/soc/amd/picasso/northbridge.c 4 files changed, 89 insertions(+), 287 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/34424/1
diff --git a/src/soc/amd/picasso/chip.c b/src/soc/amd/picasso/chip.c index d94091d..f34e696 100644 --- a/src/soc/amd/picasso/chip.c +++ b/src/soc/amd/picasso/chip.c @@ -120,6 +120,7 @@ { fsp_silicon_init(acpi_is_wakeup_s3());
+ northbridge_init(); southbridge_init(chip_info); setup_bsp_ramtop(); } diff --git a/src/soc/amd/picasso/include/soc/northbridge.h b/src/soc/amd/picasso/include/soc/northbridge.h index cb683c2..1a440aa 100644 --- a/src/soc/amd/picasso/include/soc/northbridge.h +++ b/src/soc/amd/picasso/include/soc/northbridge.h @@ -20,58 +20,12 @@ #include <device/device.h> #include <types.h>
-/* D1F1 - HDA Configuration Registers */ -#define HDA_DEV_CTRL_STATUS 0x60 -#define HDA_NO_SNOOP_EN BIT(11) +/* D18F0 - Fabric Configuration registers */ +#define FABRIC_ID_IOMS0 9
-/* D18F0 - HT Configuration Registers */ -#define D18F0_NODE_ID 0x60 -#define D18F0_CPU_CNT 0x62 /* BKDG defines as a field in DWORD 0x60 */ -# define CPU_CNT_MASK 0x1f /* CpuCnt + 1 = no. CPUs */ -#define HT_INIT_CONTROL 0x6c -# define HTIC_BIOSR_DETECT ((1 << 5) | (1 << 9) | (1 << 10)) -# define HTIC_COLD_RST_DET BIT(4) - -/* D18F1 - Address Map Registers */ - -/* MMIO base and limit */ -#define D18F1_MMIO_BASE0_LO 0x80 -# define MMIO_WE (1 << 1) -# define MMIO_RE (1 << 0) -#define D18F1_MMIO_LIMIT0_LO 0x84 -# define MMIO_NP (1 << 7) -#define D18F1_IO_BASE0_LO 0xc0 -#define D18F1_IO_BASE1_LO 0xc8 -#define D18F1_IO_BASE2_LO 0xd0 -#define D18F1_IO_BASE3_LO 0xd8 -#define D18F1_MMIO_BASE7_LO 0xb8 -#define D18F1_MMIO_BASELIM0_HI 0x180 -#define D18F1_MMIO_BASE8_LO 0x1a0 -#define D18F1_MMIO_LIMIT8_LO 0x1a4 -#define D18F1_MMIO_BASE11_LO 0x1b8 -#define D18F1_MMIO_BASELIM8_HI 0x1c0 -#define NB_MMIO_BASE_LO(reg) ((reg) * 2 * sizeof(uint32_t) + (((reg) < 8) \ - ? D18F1_MMIO_BASE0_LO \ - : D18F1_MMIO_BASE8_LO \ - - 8 * sizeof(uint64_t))) -#define NB_MMIO_LIMIT_LO(reg) (NB_MMIO_BASE_LO(reg) + sizeof(uint32_t)) -#define NB_MMIO_BASELIM_HI(reg) ((reg) * sizeof(uint32_t) + (((reg) < 8) \ - ? D18F1_MMIO_BASELIM0_HI \ - : D18F1_MMIO_BASELIM8_HI \ - - 8 * sizeof(uint32_t))) -/* I/O base and limit */ -#define D18F1_IO_BASE0 0xc0 -# define IO_WE (1 << 1) -# define IO_RE (1 << 0) -#define D18F1_IO_LIMIT0 0xc4 -#define NB_IO_BASE(reg) ((reg) * 2 * sizeof(uint32_t) + D18F1_IO_BASE0) -#define NB_IO_LIMIT(reg) (NB_IO_BASE(reg) + sizeof(uint32_t)) - -#define D18F1_DRAM_HOLE 0xf0 -# define DRAM_HOIST_VALID (1 << 1) -# define DRAM_HOLE_VALID (1 << 0) -#define D18F1_VGAEN 0xf4 -# define VGA_ADDR_ENABLE (1 << 0) +#define D18F0_VGAEN 0x80 +#define VGA_ADDR_ENABLE BIT(0) +#define VGA_DST_ID_SH 4
enum { /* SMM handler area. */ @@ -98,7 +52,7 @@ int smm_subregion(int sub, void **start, size_t *size); void domain_enable_resources(struct device *dev); void domain_set_resources(struct device *dev); -void fam15_finalize(void *chip_info); +void northbridge_init(void); void set_warm_reset_flag(void); int is_warm_reset(void);
diff --git a/src/soc/amd/picasso/include/soc/pci_devs.h b/src/soc/amd/picasso/include/soc/pci_devs.h index acde455..9a9c184 100644 --- a/src/soc/amd/picasso/include/soc/pci_devs.h +++ b/src/soc/amd/picasso/include/soc/pci_devs.h @@ -102,47 +102,36 @@ #define HDA1_DEVFN PCI_DEVFN(HDA1_DEV, HDA1_FUNC) #define SOC_HDA1_DEV _SOC_DEV(HDA1_DEV, HDA1_FUNC)
-/* HT Configuration */ -#define HT_DEV 0x18 -#define HT_FUNC 0 -#define HT_DEVID 0x15b0 -#define HT_DEVFN PCI_DEVFN(HT_DEV, HT_FUNC) -#define SOC_HT_DEV _SOC_DEV(HT_DEV, HT_FUNC) +/* Data Fabric functions */ +#define DF_DEV 0x18
-/* Address Maps */ -#define ADDR_DEV 0x18 -#define ADDR_FUNC 1 -#define ADDR_DEVID 0x15b1 -#define ADDR_DEVFN PCI_DEVFN(ADDR_DEV, ADDR_FUNC) -#define SOC_ADDR_DEV _SOC_DEV(ADDR_DEV, ADDR_FUNC) +#define DF_F0_DEVID 0x15e8 +#define DF_F0_DEVFN PCI_DEVFN(DF_DEV, 0) +#define SOC_DF_F0_DEVFN _SOC_DEV(DF_DEV, 0)
-/* DRAM Configuration */ -#define DCT_DEV 0x18 -#define DCT_FUNC 2 -#define DCT_DEVID 0x15b2 -#define DCT_DEVFN PCI_DEVFN(DCT_DEV, DCT_FUNC) -#define SOC_DCT_DEV _SOC_DEV(DCT_DEV, DCT_FUNC) +#define DF_F1_DEVID 0x15e9 +#define DF_F1_DEVFN PCI_DEVFN(DF_DEV, 1) +#define SOC_DF_F1_DEVFN _SOC_DEV(DF_DEV, 1)
-/* Misc. Configuration */ -#define MISC_DEV 0x18 -#define MISC_FUNC 3 -#define MISC_DEVID 0x15b3 -#define MISC_DEVFN PCI_DEVFN(MISC_DEV, MISC_FUNC) -#define SOC_MISC_DEV _SOC_DEV(MISC_DEV, MISC_FUNC) +#define DF_F2_DEVID 0x15ea +#define DF_F2_DEVFN PCI_DEVFN(DF_DEV, 2) +#define SOC_DF_F2_DEVFN _SOC_DEV(DF_DEV, 2)
-/* PM Configuration */ -#define PM_DEV 0x18 -#define PM_FUNC 4 -#define PM_DEVID 0x15b4 -#define PM_DEVFN PCI_DEVFN(PM_DEV, PM_FUNC) -#define SOC_PM_DEV _SOC_DEV(PM_DEV, PM_FUNC) +#define DF_F3_DEVID 0x15eb +#define DF_F3_DEVFN PCI_DEVFN(DF_DEV, 3) +#define SOC_DF_F3_DEVFN _SOC_DEV(DF_DEV, 3)
-/* Northbridge Configuration */ -#define NB_DEV 0x18 -#define NB_FUNC 5 -#define NB_DEVID 0x15b5 -#define NB_DEVFN PCI_DEVFN(NB_DEV, NB_FUNC) -#define SOC_NB_DEV _SOC_DEV(NB_DEV, NB_FUNC) +#define DF_F4_DEVID 0x15ec +#define DF_F4_DEVFN PCI_DEVFN(DF_DEV, 4) +#define SOC_DF_F4_DEVFN _SOC_DEV(DF_DEV, 4) + +#define DF_F5_DEVID 0x15ed +#define DF_F5_DEVFN PCI_DEVFN(DF_DEV, 5) +#define SOC_DF_F5_DEVFN _SOC_DEV(DF_DEV, 5) + +#define DF_F6_DEVID 0x15ee +#define DF_F6_DEVFN PCI_DEVFN(DF_DEV, 6) +#define SOC_DF_F6_DEVFN _SOC_DEV(DF_DEV, 6)
/* USB 3.1 */ #define XHCI0_DEV 0x0 diff --git a/src/soc/amd/picasso/northbridge.c b/src/soc/amd/picasso/northbridge.c index 2335d0d..0b30efa 100644 --- a/src/soc/amd/picasso/northbridge.c +++ b/src/soc/amd/picasso/northbridge.c @@ -36,128 +36,63 @@ #include <stdlib.h> #include <string.h> #include <arch/bert_storage.h> +#include <fsp/util.h>
#include "chip.h"
-static void set_io_addr_reg(struct device *dev, u32 nodeid, u32 linkn, u32 reg, - u32 io_min, u32 io_max) -{ - u32 tempreg; - - /* io range allocation. Limit */ - tempreg = (nodeid & 0xf) | ((nodeid & 0x30) << (8 - 4)) | (linkn << 4) - | ((io_max & 0xf0) << (12 - 4)); - pci_write_config32(SOC_ADDR_DEV, reg + 4, tempreg); - tempreg = 3 | ((io_min & 0xf0) << (12 - 4)); /* base: ISA and VGA ? */ - pci_write_config32(SOC_ADDR_DEV, reg, tempreg); -} - -static void set_mmio_addr_reg(u32 nodeid, u32 linkn, u32 reg, u32 index, - u32 mmio_min, u32 mmio_max) -{ - u32 tempreg; - - /* io range allocation. Limit */ - tempreg = (nodeid & 0xf) | (linkn << 4) | (mmio_max & 0xffffff00); - pci_write_config32(SOC_ADDR_DEV, reg + 4, tempreg); - tempreg = 3 | (nodeid & 0x30) | (mmio_min & 0xffffff00); - pci_write_config32(SOC_ADDR_DEV, reg, tempreg); -} - static void read_resources(struct device *dev) { - /* - * This MMCONF resource must be reserved in the PCI domain. - * It is not honored by the coreboot resource allocator if it is in - * the CPU_CLUSTER. - */ + msr_t tom = rdmsr(TOP_MEM); + uint32_t mem_useable = (uintptr_t)cbmem_top(); + int idx = 0x10; + const struct hob_header *hob = fsp_get_hob_list(); + struct hob_resource *res; + + /* 0x0 - 0x9ffff */ + ram_resource(dev, idx++, 0, 0xa0000 / KiB); + + /* 0xa0000 - 0xbffff: legacy VGA */ + mmio_resource(dev, idx++, 0xa0000 / KiB, 0x20000 / KiB); + + /* 0xc0000 - 0xfffff: Option ROM */ + reserved_ram_resource(dev, idx++, 0xc0000 / KiB, 0x40000 / KiB); + + /* 0x100000 (1MiB) - low top useable RAM + * cbmem_top() accounts for low UMA and TSEG if they are used. */ + ram_resource(dev, idx++, (1 * MiB) / KiB, + (mem_useable - (1 * MiB)) / KiB); + + /* Low top useable RAM -> Low top RAM (bottom pci mmio hole) */ + reserved_ram_resource(dev, idx++, mem_useable / KiB, + (tom.lo - mem_useable) / KiB); + mmconf_resource(dev, MMIO_CONF_BASE); -}
-static void set_resource(struct device *dev, struct resource *res, u32 nodeid) -{ - resource_t rbase, rend; - unsigned int reg, link_num; - char buf[50]; - - /* Make certain the resource has actually been set */ - if (!(res->flags & IORESOURCE_ASSIGNED)) + if (!hob) { + printk(BIOS_ERR, "Error: %s incomplete becuase no HOB list was found\n", + __func__); return; + }
- /* If I have already stored this resource don't worry about it */ - if (res->flags & IORESOURCE_STORED) - return; + for (; hob->type != HOB_TYPE_END_OF_HOB_LIST; hob = fsp_next_hob(hob)) {
- /* Only handle PCI memory and IO resources */ - if (!(res->flags & (IORESOURCE_MEM | IORESOURCE_IO))) - return; + if (hob->type != HOB_TYPE_RESOURCE_DESCRIPTOR) + continue;
- /* Ensure I am actually looking at a resource of function 1 */ - if ((res->index & 0xffff) < 0x1000) - return; + res = (struct hob_resource *)fsp_hob_header_to_resource(hob);
- /* Get the base address */ - rbase = res->base; - - /* Get the limit (rounded up) */ - rend = resource_end(res); - - /* Get the register and link */ - reg = res->index & 0xfff; /* 4k */ - link_num = IOINDEX_LINK(res->index); - - if (res->flags & IORESOURCE_IO) - set_io_addr_reg(dev, nodeid, link_num, reg, rbase>>8, rend>>8); - else if (res->flags & IORESOURCE_MEM) - set_mmio_addr_reg(nodeid, link_num, reg, - (res->index >> 24), rbase >> 8, rend >> 8); - - res->flags |= IORESOURCE_STORED; - snprintf(buf, sizeof(buf), " <node %x link %x>", - nodeid, link_num); - report_resource_stored(dev, res, buf); -} - -/** - * I tried to reuse the resource allocation code in set_resource() - * but it is too difficult to deal with the resource allocation magic. - */ - -static void create_vga_resource(struct device *dev) -{ - struct bus *link; - - /* find out which link the VGA card is connected, - * we only deal with the 'first' vga card */ - for (link = dev->link_list ; link ; link = link->next) - if (link->bridge_ctrl & PCI_BRIDGE_CTL_VGA) - break; - - /* no VGA card installed */ - if (link == NULL) - return; - - printk(BIOS_DEBUG, "VGA: %s has VGA device\n", dev_path(dev)); - /* Route A0000-BFFFF, IO 3B0-3BB 3C0-3DF */ - pci_write_config32(SOC_ADDR_DEV, D18F1_VGAEN, VGA_ADDR_ENABLE); -} - -static void set_resources(struct device *dev) -{ - struct bus *bus; - struct resource *res; - - - /* do we need this? */ - create_vga_resource(dev); - - /* Set each resource we have found */ - for (res = dev->resource_list ; res ; res = res->next) - set_resource(dev, res, 0); - - for (bus = dev->link_list ; bus ; bus = bus->next) - if (bus->children) - assign_resources(bus); + if (res->type == EFI_RESOURCE_SYSTEM_MEMORY && !res->addr) + continue; /* 0 through TOM was set above */ + else if (res->type == EFI_RESOURCE_SYSTEM_MEMORY) + ram_resource(dev, idx++, res->addr / KiB, res->length / KiB); + else if (res->type == EFI_RESOURCE_MEMORY_MAPPED_IO) + continue; + else if (res->type == EFI_RESOURCE_MEMORY_RESERVED) + reserved_ram_resource(dev, idx++, res->addr / KiB, res->length / KiB); + else + printk(BIOS_ERR, "Error: failed to set resources for type %d\n", + res->type); + } }
unsigned long acpi_fill_mcfg(unsigned long current) @@ -203,7 +138,6 @@
static struct device_operations northbridge_operations = { .read_resources = read_resources, - .set_resources = set_resources, .enable_resources = pci_dev_enable_resources, .acpi_fill_ssdt_generator = northbridge_fill_ssdt_generator, .write_acpi_tables = agesa_write_acpi_tables, @@ -211,103 +145,27 @@ .ops_pci = 0, };
-static const struct pci_driver family15_northbridge __pci_driver = { +static const struct pci_driver family17_northbridge __pci_driver = { .ops = &northbridge_operations, .vendor = PCI_VENDOR_ID_AMD, - .device = PCI_DEVICE_ID_AMD_15H_MODEL_707F_NB_HT, + .device = PCI_DEVICE_ID_AMD_17H_MODEL_101F_NB, };
-/* - * Enable VGA cycles. Set memory ranges of the FCH legacy devices (TPM, HPET, - * BIOS RAM, Watchdog Timer, IOAPIC and ACPI) as non-posted. Set remaining - * MMIO to posted. Route all I/O to the southbridge. - */ -void amd_initcpuio(void) +void northbridge_init(void) { - uintptr_t topmem = bsp_topmem(); - uintptr_t base, limit; - - /* Enable legacy video routing: D18F1xF4 VGA Enable */ - pci_write_config32(SOC_ADDR_DEV, D18F1_VGAEN, VGA_ADDR_ENABLE); - - /* Non-posted: range(HPET-LAPIC) or 0xfed00000 through 0xfee00000-1 */ - base = (HPET_BASE_ADDRESS >> 8) | MMIO_WE | MMIO_RE; - limit = (ALIGN_DOWN(LOCAL_APIC_ADDR - 1, 64 * KiB) >> 8) | MMIO_NP; - pci_write_config32(SOC_ADDR_DEV, NB_MMIO_LIMIT_LO(0), limit); - pci_write_config32(SOC_ADDR_DEV, NB_MMIO_BASE_LO(0), base); - - /* Remaining PCI hole posted MMIO: TOM-HPET (TOM through 0xfed00000-1 */ - base = (topmem >> 8) | MMIO_WE | MMIO_RE; - limit = ALIGN_DOWN(HPET_BASE_ADDRESS - 1, 64 * KiB) >> 8; - pci_write_config32(SOC_ADDR_DEV, NB_MMIO_LIMIT_LO(1), limit); - pci_write_config32(SOC_ADDR_DEV, NB_MMIO_BASE_LO(1), base); - - /* Route all I/O downstream */ - base = 0 | IO_WE | IO_RE; - limit = ALIGN_DOWN(0xffff, 4 * KiB); - pci_write_config32(SOC_ADDR_DEV, NB_IO_LIMIT(0), limit); - pci_write_config32(SOC_ADDR_DEV, NB_IO_BASE(0), base); -} - -void fam15_finalize(void *chip_info) -{ - u32 value; - - /* disable No Snoop */ - value = pci_read_config32(SOC_HDA0_DEV, HDA_DEV_CTRL_STATUS); - value &= ~HDA_NO_SNOOP_EN; - pci_write_config32(SOC_HDA0_DEV, HDA_DEV_CTRL_STATUS, value); + /* + * AGESA has already programmed the NB MMIO routing, however nothing + * is yet marked as non-posted. + * + * TODO: Remove the settings from AGESA and allow coreboot to own + * everything. If not practical, consider erasing all settings and + * reprogram for coreboot. At that time, make the following more + * flexible. + */ }
void domain_set_resources(struct device *dev) { - uint64_t uma_base = get_uma_base(); - uint32_t uma_size = get_uma_size(); - uint32_t mem_useable = (uintptr_t)cbmem_top(); - msr_t tom = rdmsr(TOP_MEM); - msr_t high_tom = rdmsr(TOP_MEM2); - uint64_t high_mem_useable; - int idx = 0x10; - - /* 0x0 -> 0x9ffff */ - ram_resource(dev, idx++, 0, 0xa0000 / KiB); - - /* 0xa0000 -> 0xbffff: legacy VGA */ - mmio_resource(dev, idx++, 0xa0000 / KiB, 0x20000 / KiB); - - /* 0xc0000 -> 0xfffff: Option ROM */ - reserved_ram_resource(dev, idx++, 0xc0000 / KiB, 0x40000 / KiB); - - /* - * 0x100000 (1MiB) -> low top useable RAM - * cbmem_top() accounts for low UMA and TSEG if they are used. - */ - ram_resource(dev, idx++, (1 * MiB) / KiB, - (mem_useable - (1 * MiB)) / KiB); - - /* Low top useable RAM -> Low top RAM (bottom pci mmio hole) */ - reserved_ram_resource(dev, idx++, mem_useable / KiB, - (tom.lo - mem_useable) / KiB); - - /* If there is memory above 4GiB */ - if (high_tom.hi) { - /* 4GiB -> high top useable */ - if (uma_base >= (4ull * GiB)) - high_mem_useable = uma_base; - else - high_mem_useable = ((uint64_t)high_tom.lo | - ((uint64_t)high_tom.hi << 32)); - - ram_resource(dev, idx++, (4ull * GiB) / KiB, - ((high_mem_useable - (4ull * GiB)) / KiB)); - - /* High top useable RAM -> high top RAM */ - if (uma_base >= (4ull * GiB)) { - reserved_ram_resource(dev, idx++, uma_base / KiB, - uma_size / KiB); - } - } - assign_resources(dev->link_list); }
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: _WIP_ soc/amd/picasso: Update northbridge ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34424/1/src/soc/amd/picasso/northbr... File src/soc/amd/picasso/northbridge.c:
https://review.coreboot.org/c/coreboot/+/34424/1/src/soc/amd/picasso/northbr... PS1, Line 72: printk(BIOS_ERR, "Error: %s incomplete becuase no HOB list was found\n", 'becuase' may be misspelled - perhaps 'because'?
Hello build bot (Jenkins), Martin Roth, Furquan Shaikh,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34424
to look at the new patch set (#2).
Change subject: _WIP_ soc/amd/picasso: Update northbridge ......................................................................
_WIP_ soc/amd/picasso: Update northbridge
todo: need to update northbridge_init() to set NP regions. Waiting on agreement for publishing NDA info in b:137781581
Family 17h devices is designed with a new internal architecture, frequently referred to as the data fabric. Although designed to behave somewhat like the older integrated northbridge designs, the D18Fx definitions are completely new.
AGESA sets up most of the necessary configuration. coreboot still enables the VGA decode if used.
Change-Id: I44a4a97765151fbcfe4c5d8de200e3e015aaaf2e Signed-off-by: Marshall Dawson marshalldawson3rd@gmail.com --- M src/soc/amd/picasso/chip.c M src/soc/amd/picasso/include/soc/northbridge.h M src/soc/amd/picasso/include/soc/pci_devs.h M src/soc/amd/picasso/northbridge.c 4 files changed, 89 insertions(+), 287 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/34424/2
Hello build bot (Jenkins), Martin Roth, Furquan Shaikh,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34424
to look at the new patch set (#4).
Change subject: _WIP_ soc/amd/picasso: Update northbridge ......................................................................
_WIP_ soc/amd/picasso: Update northbridge
todo: reserve the location where the PSP copied the hybrid romstage and the are we used for faux-CAR.
Family 17h devices is designed with a new internal architecture, frequently referred to as the data fabric. Although designed to behave somewhat like the older integrated northbridge designs, the D18Fx definitions are completely new.
AGESA sets up most of the necessary configuration. coreboot still enables the VGA decode if used.
Change-Id: I44a4a97765151fbcfe4c5d8de200e3e015aaaf2e Signed-off-by: Marshall Dawson marshalldawson3rd@gmail.com --- M src/soc/amd/picasso/chip.c M src/soc/amd/picasso/include/soc/northbridge.h M src/soc/amd/picasso/include/soc/pci_devs.h M src/soc/amd/picasso/northbridge.c 4 files changed, 170 insertions(+), 282 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/34424/4
Hello build bot (Jenkins), Martin Roth, Furquan Shaikh,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34424
to look at the new patch set (#8).
Change subject: _WIP_ soc/amd/picasso: Update northbridge ......................................................................
_WIP_ soc/amd/picasso: Update northbridge
todo: reserve the location where the PSP copied the hybrid romstage and the are we used for faux-CAR.
Family 17h devices is designed with a new internal architecture, frequently referred to as the data fabric. Although designed to behave somewhat like the older integrated northbridge designs, the D18Fx definitions are completely new.
AGESA sets up most of the necessary configuration. coreboot still enables the VGA decode if used.
Change-Id: I44a4a97765151fbcfe4c5d8de200e3e015aaaf2e Signed-off-by: Marshall Dawson marshalldawson3rd@gmail.com --- M src/soc/amd/picasso/chip.c M src/soc/amd/picasso/include/soc/northbridge.h M src/soc/amd/picasso/include/soc/pci_devs.h M src/soc/amd/picasso/northbridge.c 4 files changed, 170 insertions(+), 282 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/34424/8
Hello build bot (Jenkins), Martin Roth, Furquan Shaikh,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34424
to look at the new patch set (#11).
Change subject: soc/amd/picasso: Update northbridge ......................................................................
soc/amd/picasso: Update northbridge
Family 17h devices is designed with a new internal architecture, frequently referred to as the data fabric. Although designed to behave somewhat like the older integrated northbridge designs, the D18Fx definitions are completely new.
AGESA sets up most of the necessary configuration. coreboot still enables the VGA decode if used.
Change-Id: I44a4a97765151fbcfe4c5d8de200e3e015aaaf2e Signed-off-by: Marshall Dawson marshalldawson3rd@gmail.com --- M src/soc/amd/picasso/chip.c M src/soc/amd/picasso/include/soc/northbridge.h M src/soc/amd/picasso/include/soc/pci_devs.h M src/soc/amd/picasso/northbridge.c 4 files changed, 172 insertions(+), 282 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/34424/11
Richard Spiegel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Update northbridge ......................................................................
Patch Set 12:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34424/12/src/soc/amd/picasso/includ... File src/soc/amd/picasso/include/soc/pci_devs.h:
https://review.coreboot.org/c/coreboot/+/34424/12/src/soc/amd/picasso/includ... PS12, Line 108: #define DF_F0_DEVID 0x15e8 Could you add comments defining what each data fabric is about? Like DRAM/MISC/PM and so on?
Hello build bot (Jenkins), Martin Roth, Furquan Shaikh,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34424
to look at the new patch set (#13).
Change subject: soc/amd/picasso: Update northbridge ......................................................................
soc/amd/picasso: Update northbridge
Family 17h devices is designed with a new internal architecture, frequently referred to as the data fabric. Although designed to behave somewhat like the older integrated northbridge designs, the D18Fx definitions are completely new.
AGESA sets up most of the necessary configuration. coreboot still enables the VGA decode if used.
Change-Id: I44a4a97765151fbcfe4c5d8de200e3e015aaaf2e Signed-off-by: Marshall Dawson marshalldawson3rd@gmail.com --- M src/soc/amd/picasso/chip.c M src/soc/amd/picasso/include/soc/northbridge.h M src/soc/amd/picasso/include/soc/pci_devs.h M src/soc/amd/picasso/northbridge.c 4 files changed, 168 insertions(+), 281 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/34424/13
Hello build bot (Jenkins), Martin Roth, Furquan Shaikh,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34424
to look at the new patch set (#14).
Change subject: soc/amd/picasso: Update northbridge ......................................................................
soc/amd/picasso: Update northbridge
Family 17h devices is designed with a new internal architecture, frequently referred to as the data fabric. Although designed to behave somewhat like the older integrated northbridge designs, the D18Fx definitions are completely new.
AGESA sets up most of the necessary configuration. coreboot still enables the VGA decode if used.
Change-Id: I44a4a97765151fbcfe4c5d8de200e3e015aaaf2e Signed-off-by: Marshall Dawson marshalldawson3rd@gmail.com --- M src/soc/amd/picasso/chip.c M src/soc/amd/picasso/include/soc/northbridge.h M src/soc/amd/picasso/include/soc/pci_devs.h M src/soc/amd/picasso/northbridge.c 4 files changed, 168 insertions(+), 281 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/34424/14
Marshall Dawson has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Update northbridge ......................................................................
Patch Set 14:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34424/12/src/soc/amd/picasso/includ... File src/soc/amd/picasso/include/soc/pci_devs.h:
https://review.coreboot.org/c/coreboot/+/34424/12/src/soc/amd/picasso/includ... PS12, Line 108: #define DF_F0_DEVID 0x15e8
Could you add comments defining what each data fabric is about? Like DRAM/MISC/PM and so on?
No, I prefer not to. The features don't line up nicely like in previous generations, and it's doubtful they'll get documented in the public PPR.
Martin Roth has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Update northbridge ......................................................................
Patch Set 14:
(2 comments)
https://review.coreboot.org/c/coreboot/+/34424/14//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/34424/14//COMMIT_MSG@9 PS14, Line 9: is are
https://review.coreboot.org/c/coreboot/+/34424/14/src/soc/amd/picasso/northb... File src/soc/amd/picasso/northbridge.c:
https://review.coreboot.org/c/coreboot/+/34424/14/src/soc/amd/picasso/northb... PS14, Line 217: What about the case where base < adj_bot && limit > adj top? Update adj_bot and adj_top then disable the mmio reg?
Hello build bot (Jenkins), Martin Roth, Furquan Shaikh,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34424
to look at the new patch set (#15).
Change subject: soc/amd/picasso: Update northbridge ......................................................................
soc/amd/picasso: Update northbridge
Family 17h devices are designed with a new internal architecture, frequently referred to as the data fabric. Although designed to behave somewhat like the older integrated northbridge designs, the D18Fx definitions are completely new.
AGESA sets up most of the necessary configuration. coreboot still enables the VGA decode if used.
Change-Id: I44a4a97765151fbcfe4c5d8de200e3e015aaaf2e Signed-off-by: Marshall Dawson marshalldawson3rd@gmail.com --- M src/soc/amd/picasso/chip.c M src/soc/amd/picasso/include/soc/northbridge.h M src/soc/amd/picasso/include/soc/pci_devs.h M src/soc/amd/picasso/northbridge.c 4 files changed, 193 insertions(+), 281 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/34424/15
Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Update northbridge ......................................................................
Patch Set 15: Code-Review+1
(3 comments)
https://review.coreboot.org/c/coreboot/+/34424/15/src/soc/amd/picasso/northb... File src/soc/amd/picasso/northbridge.c:
https://review.coreboot.org/c/coreboot/+/34424/15/src/soc/amd/picasso/northb... PS15, Line 59: hybrid romstage Is the stack here?
https://review.coreboot.org/c/coreboot/+/34424/15/src/soc/amd/picasso/northb... PS15, Line 63: DRAM consumed for hybrid romstage This is said twice here. Be more specific? hybrid romstage code?
https://review.coreboot.org/c/coreboot/+/34424/15/src/soc/amd/picasso/northb... PS15, Line 144: .read_resources = read_resources, Would you not want this to be part of a chip operation instead of a __pci_driver? It avoids needing to maintain a list of PCI ID's. With only one DID however it does not make all that much sense.
Hello Matt Papageorge, Arthur Heymans, build bot (Jenkins), Martin Roth, Furquan Shaikh,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34424
to look at the new patch set (#16).
Change subject: soc/amd/picasso: Update northbridge ......................................................................
soc/amd/picasso: Update northbridge
Family 17h devices are designed with a new internal architecture, frequently referred to as the data fabric. Although designed to behave somewhat like the older integrated northbridge designs, the D18Fx definitions are completely new.
AGESA sets up most of the necessary configuration. coreboot still enables the VGA decode if used.
Change-Id: I44a4a97765151fbcfe4c5d8de200e3e015aaaf2e Signed-off-by: Marshall Dawson marshalldawson3rd@gmail.com --- M src/soc/amd/picasso/chip.c M src/soc/amd/picasso/include/soc/northbridge.h M src/soc/amd/picasso/include/soc/pci_devs.h M src/soc/amd/picasso/northbridge.c 4 files changed, 194 insertions(+), 281 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/34424/16
Marshall Dawson has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Update northbridge ......................................................................
Patch Set 16:
(3 comments)
https://review.coreboot.org/c/coreboot/+/34424/15/src/soc/amd/picasso/northb... File src/soc/amd/picasso/northbridge.c:
https://review.coreboot.org/c/coreboot/+/34424/15/src/soc/amd/picasso/northb... PS15, Line 59: hybrid romstage
Is the stack here?
Currently the pre-ramstage stack(s) are contained within the 1st stage's region.
https://review.coreboot.org/c/coreboot/+/34424/15/src/soc/amd/picasso/northb... PS15, Line 63: DRAM consumed for hybrid romstage
This is said twice here. […]
I don't see it as duplicate. The first one was on line 59? That's the region above 1MB, but this is the stage itself. I'll try to clarify though.
https://review.coreboot.org/c/coreboot/+/34424/15/src/soc/amd/picasso/northb... PS15, Line 144: .read_resources = read_resources,
Would you not want this to be part of a chip operation instead of a __pci_driver? It avoids needing […]
Oops, missed considering this one before repushing.
Hello Matt Papageorge, Arthur Heymans, build bot (Jenkins), Martin Roth, Furquan Shaikh,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34424
to look at the new patch set (#20).
Change subject: soc/amd/picasso: Update northbridge ......................................................................
soc/amd/picasso: Update northbridge
Family 17h devices are designed with a new internal architecture, frequently referred to as the data fabric. Although designed to behave somewhat like the older integrated northbridge designs, the D18Fx definitions are completely new.
Update the process of declaring memory and reserved areas to rely on HOBs for regions above top of low memory.
AGESA sets up most of the necessary configuration * Immediately following FSP-S, update the northbridge routing registers to make the region between HPET and LAPIC as non-posted. * Keep enabling of VGA decode, if used, in coreboot.
Change-Id: I44a4a97765151fbcfe4c5d8de200e3e015aaaf2e Signed-off-by: Marshall Dawson marshalldawson3rd@gmail.com --- M src/soc/amd/picasso/chip.c M src/soc/amd/picasso/include/soc/northbridge.h M src/soc/amd/picasso/include/soc/pci_devs.h M src/soc/amd/picasso/northbridge.c 4 files changed, 183 insertions(+), 281 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/34424/20
Raul Rangel has uploaded a new patch set (#26) to the change originally created by Marshall Dawson. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Add northbridge pci driver ......................................................................
soc/amd/picasso: Add northbridge pci driver
* Declare memory and reserved areas using HOBs for regions above top of low memory. * Copy northbridge_fill_ssdt_generator from stoneyridge.
BUG=b:147042464 TEST=Boot trembyle to payload
Change-Id: I44a4a97765151fbcfe4c5d8de200e3e015aaaf2e Signed-off-by: Marshall Dawson marshalldawson3rd@gmail.com --- M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/northbridge.c 2 files changed, 96 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/34424/26
Raul Rangel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Add northbridge pci driver ......................................................................
Uploaded patch set 26.
Raul Rangel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Add northbridge pci driver ......................................................................
Patch Set 26:
PTAL, I split the patch into smaller chunks.
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Add northbridge pci driver ......................................................................
Patch Set 26:
(5 comments)
https://review.coreboot.org/c/coreboot/+/34424/26//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/34424/26//COMMIT_MSG@12 PS26, Line 12: I thought same parent commit wrote, there isn’t a northbridge.
https://review.coreboot.org/c/coreboot/+/34424/26/src/soc/amd/picasso/northb... File src/soc/amd/picasso/northbridge.c:
https://review.coreboot.org/c/coreboot/+/34424/26/src/soc/amd/picasso/northb... PS26, Line 18: int idx = 0x10; unsigned
https://review.coreboot.org/c/coreboot/+/34424/26/src/soc/amd/picasso/northb... PS26, Line 32: ram_resource(dev, idx++, 1 * MiB / KiB, (mem_usable - 1 * MiB) / KiB); MiB / KiB = KiB?
https://review.coreboot.org/c/coreboot/+/34424/26/src/soc/amd/picasso/northb... PS26, Line 88: .acpi_fill_ssdt = northbridge_fill_ssdt_generator, Please use tabs as in the first line.
https://review.coreboot.org/c/coreboot/+/34424/26/src/soc/amd/picasso/northb... PS26, Line 94: .device = PCI_DEVICE_ID_AMD_17H_MODEL_101F_NB, Ditto.
Aaron Durbin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Add northbridge pci driver ......................................................................
Patch Set 26:
(2 comments)
https://review.coreboot.org/c/coreboot/+/34424/26/src/soc/amd/picasso/northb... File src/soc/amd/picasso/northbridge.c:
https://review.coreboot.org/c/coreboot/+/34424/26/src/soc/amd/picasso/northb... PS26, Line 18: 0x10 What was 0x10 chosen here?
https://review.coreboot.org/c/coreboot/+/34424/26/src/soc/amd/picasso/northb... PS26, Line 67: char pscope[] = "\_SB.PCI0"; acpi_device_scope() is more correct. so one would just call the following on line 69:
acpigen_write_scope(acpi_device_scope(device));
Raul Rangel has uploaded a new patch set (#27) to the change originally created by Marshall Dawson. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Add northbridge pci driver ......................................................................
soc/amd/picasso: Add northbridge pci driver
* Declare memory and reserved areas using HOBs for regions above top of low memory. * Copy northbridge_fill_ssdt_generator from stoneyridge.
BUG=b:147042464 TEST=Boot trembyle and see PCI resources in the log: PCI: 00:00.0 PCI: 00:00.0 resource base 0 size a0000 align 0 gran 0 limit 0 flags e0004200 index 0 PCI: 00:00.0 resource base a0000 size 20000 align 0 gran 0 limit 0 flags f0000200 index 1 PCI: 00:00.0 resource base c0000 size 40000 align 0 gran 0 limit 0 flags f0004200 index 2 PCI: 00:00.0 resource base 100000 size cd700000 align 0 gran 0 limit 0 flags e0004200 index 3 PCI: 00:00.0 resource base f8000000 size 4000000 align 0 gran 0 limit 0 flags f0000200 index c0010058 PCI: 00:00.0 resource base ce000000 size 2000000 align 0 gran 0 limit 0 flags f0004200 index 4 PCI: 00:00.0 resource base 100000000 size 12f340000 align 0 gran 0 limit 0 flags e0004200 index 5 PCI: 00:00.0 resource base 22f340000 size cc0000 align 0 gran 0 limit 0 flags f0004200 index 6 PCI: 00:00.0 resource base cd800000 size 800000 align 0 gran 0 limit 0 flags f0004200 index 7 PCI: 00:00.0 resource base cd7fe000 size 2000 align 0 gran 0 limit 0 flags f0004200 index 8 PCI: 00:00.0 resource base cc7fe000 size 1000000 align 0 gran 0 limit 0 flags f0004200 index 9 PCI: 00:00.0 resource base 1090000 size b0000 align 0 gran 0 limit 0 flags f0004200 index a
Change-Id: I44a4a97765151fbcfe4c5d8de200e3e015aaaf2e Signed-off-by: Marshall Dawson marshalldawson3rd@gmail.com --- M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/northbridge.c 2 files changed, 95 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/34424/27
Raul Rangel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Add northbridge pci driver ......................................................................
Uploaded patch set 27.
(7 comments)
https://review.coreboot.org/c/coreboot/+/34424/26//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/34424/26//COMMIT_MSG@12 PS26, Line 12:
I thought same parent commit wrote, there isn’t a northbridge.
lol, I guess I didn't know what to call PCI0?
https://review.coreboot.org/c/coreboot/+/34424/26/src/soc/amd/picasso/northb... File src/soc/amd/picasso/northbridge.c:
https://review.coreboot.org/c/coreboot/+/34424/26/src/soc/amd/picasso/northb... PS26, Line 18: 0x10
What was 0x10 chosen here?
No idea. Changed to 0.
https://review.coreboot.org/c/coreboot/+/34424/26/src/soc/amd/picasso/northb... PS26, Line 18: int idx = 0x10;
unsigned
Done
https://review.coreboot.org/c/coreboot/+/34424/26/src/soc/amd/picasso/northb... PS26, Line 32: ram_resource(dev, idx++, 1 * MiB / KiB, (mem_usable - 1 * MiB) / KiB);
MiB / KiB = KiB?
Correct. Since the call to ram_resources takes `basek`, I think it's easier to reason having the /KiB at the end. It's also consistent with all the other calls.
https://review.coreboot.org/c/coreboot/+/34424/26/src/soc/amd/picasso/northb... PS26, Line 67: char pscope[] = "\_SB.PCI0";
acpi_device_scope() is more correct. so one would just call the following on line 69: […]
Done
https://review.coreboot.org/c/coreboot/+/34424/26/src/soc/amd/picasso/northb... PS26, Line 88: .acpi_fill_ssdt = northbridge_fill_ssdt_generator,
Please use tabs as in the first line.
Done
https://review.coreboot.org/c/coreboot/+/34424/26/src/soc/amd/picasso/northb... PS26, Line 94: .device = PCI_DEVICE_ID_AMD_17H_MODEL_101F_NB,
Ditto.
Done
Raul Rangel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Add northbridge pci driver ......................................................................
Uploaded patch set 28: Patch Set 27 was rebased.
Aaron Durbin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Add northbridge pci driver ......................................................................
Patch Set 28: Code-Review+2
Raul Rangel has uploaded a new patch set (#29) to the change originally created by Marshall Dawson. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Add northbridge pci driver ......................................................................
soc/amd/picasso: Add northbridge pci driver
* Declare memory and reserved areas using HOBs for regions above top of low memory. * Copy northbridge_fill_ssdt_generator from stoneyridge.
BUG=b:147042464 TEST=Boot trembyle and see PCI resources in the log: PCI: 00:00.0 PCI: 00:00.0 resource base 0 size a0000 align 0 gran 0 limit 0 flags e0004200 index 0 PCI: 00:00.0 resource base a0000 size 20000 align 0 gran 0 limit 0 flags f0000200 index 1 PCI: 00:00.0 resource base c0000 size 40000 align 0 gran 0 limit 0 flags f0004200 index 2 PCI: 00:00.0 resource base 100000 size cd700000 align 0 gran 0 limit 0 flags e0004200 index 3 PCI: 00:00.0 resource base f8000000 size 4000000 align 0 gran 0 limit 0 flags f0000200 index c0010058 PCI: 00:00.0 resource base ce000000 size 2000000 align 0 gran 0 limit 0 flags f0004200 index 4 PCI: 00:00.0 resource base 100000000 size 12f340000 align 0 gran 0 limit 0 flags e0004200 index 5 PCI: 00:00.0 resource base 22f340000 size cc0000 align 0 gran 0 limit 0 flags f0004200 index 6 PCI: 00:00.0 resource base cd800000 size 800000 align 0 gran 0 limit 0 flags f0004200 index 7 PCI: 00:00.0 resource base cd7fe000 size 2000 align 0 gran 0 limit 0 flags f0004200 index 8 PCI: 00:00.0 resource base cc7fe000 size 1000000 align 0 gran 0 limit 0 flags f0004200 index 9 PCI: 00:00.0 resource base 1090000 size b0000 align 0 gran 0 limit 0 flags f0004200 index a
Change-Id: I44a4a97765151fbcfe4c5d8de200e3e015aaaf2e Signed-off-by: Marshall Dawson marshalldawson3rd@gmail.com --- M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/northbridge.c 2 files changed, 94 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/34424/29
Raul Rangel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Add northbridge pci driver ......................................................................
Uploaded patch set 29.
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Add northbridge pci driver ......................................................................
Patch Set 29: Code-Review+2
(2 comments)
https://review.coreboot.org/c/coreboot/+/34424/28/src/soc/amd/picasso/northb... File src/soc/amd/picasso/northbridge.c:
https://review.coreboot.org/c/coreboot/+/34424/28/src/soc/amd/picasso/northb... PS28, Line 70: TOM1 Just curious - how do these get used from ACPI? Is it used by static asl code? Or is it the kernel using it?
https://review.coreboot.org/c/coreboot/+/34424/28/src/soc/amd/picasso/northb... PS28, Line 75: http://www.acpi.info/presentations/S01USMOBS169_OS%2520new.ppt This link is not really accessible?
Raul Rangel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Add northbridge pci driver ......................................................................
Patch Set 29:
(2 comments)
https://review.coreboot.org/c/coreboot/+/34424/28/src/soc/amd/picasso/northb... File src/soc/amd/picasso/northbridge.c:
https://review.coreboot.org/c/coreboot/+/34424/28/src/soc/amd/picasso/northb... PS28, Line 70: TOM1
Just curious - how do these get used from ACPI? Is it used by static asl code? Or is it the kernel u […]
I don't see it being used in the kernel code. Maybe I just drop this whole thing? It's in all the previous AMD northbridge impls. Maybe this was specifically for XP?
https://review.coreboot.org/c/coreboot/+/34424/28/src/soc/amd/picasso/northb... PS28, Line 75: http://www.acpi.info/presentations/S01USMOBS169_OS%2520new.ppt
This link is not really accessible?
Found one here, but need to sign up... https://www.scribd.com/presentation/7145176/s01usmobs169-Os-New
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Add northbridge pci driver ......................................................................
Patch Set 29:
(2 comments)
https://review.coreboot.org/c/coreboot/+/34424/28/src/soc/amd/picasso/northb... File src/soc/amd/picasso/northbridge.c:
https://review.coreboot.org/c/coreboot/+/34424/28/src/soc/amd/picasso/northb... PS28, Line 70: TOM1
I don't see it being used in the kernel code. […]
Yeah, nothing in coreboot seems to be using it as well. There is an External (TOM2) in pci0.asl, but nothing in zork/mandolin using it. I see some old amd mainboards used it. But, probably we can add it when really required?
https://review.coreboot.org/c/coreboot/+/34424/28/src/soc/amd/picasso/northb... PS28, Line 75: http://www.acpi.info/presentations/S01USMOBS169_OS%2520new.ppt
Found one here, but need to sign up... https://www.scribd. […]
Thanks Raul!
Raul Rangel has uploaded a new patch set (#30) to the change originally created by Marshall Dawson. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Add northbridge pci driver ......................................................................
soc/amd/picasso: Add northbridge pci driver
* Declare memory and reserved areas using HOBs for regions above top of low memory. * Copy northbridge_fill_ssdt_generator from stoneyridge.
BUG=b:147042464 TEST=Boot trembyle and see PCI resources in the log: PCI: 00:00.0 PCI: 00:00.0 resource base 0 size a0000 align 0 gran 0 limit 0 flags e0004200 index 0 PCI: 00:00.0 resource base a0000 size 20000 align 0 gran 0 limit 0 flags f0000200 index 1 PCI: 00:00.0 resource base c0000 size 40000 align 0 gran 0 limit 0 flags f0004200 index 2 PCI: 00:00.0 resource base 100000 size cd700000 align 0 gran 0 limit 0 flags e0004200 index 3 PCI: 00:00.0 resource base f8000000 size 4000000 align 0 gran 0 limit 0 flags f0000200 index c0010058 PCI: 00:00.0 resource base ce000000 size 2000000 align 0 gran 0 limit 0 flags f0004200 index 4 PCI: 00:00.0 resource base 100000000 size 12f340000 align 0 gran 0 limit 0 flags e0004200 index 5 PCI: 00:00.0 resource base 22f340000 size cc0000 align 0 gran 0 limit 0 flags f0004200 index 6 PCI: 00:00.0 resource base cd800000 size 800000 align 0 gran 0 limit 0 flags f0004200 index 7 PCI: 00:00.0 resource base cd7fe000 size 2000 align 0 gran 0 limit 0 flags f0004200 index 8 PCI: 00:00.0 resource base cc7fe000 size 1000000 align 0 gran 0 limit 0 flags f0004200 index 9 PCI: 00:00.0 resource base 1090000 size b0000 align 0 gran 0 limit 0 flags f0004200 index a
Change-Id: I44a4a97765151fbcfe4c5d8de200e3e015aaaf2e Signed-off-by: Marshall Dawson marshalldawson3rd@gmail.com --- M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/northbridge.c 2 files changed, 73 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/34424/30
Raul Rangel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Add northbridge pci driver ......................................................................
Uploaded patch set 30.
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Add northbridge pci driver ......................................................................
Patch Set 30: Code-Review+2
(1 comment)
https://review.coreboot.org/c/coreboot/+/34424/28/src/soc/amd/picasso/northb... File src/soc/amd/picasso/northbridge.c:
https://review.coreboot.org/c/coreboot/+/34424/28/src/soc/amd/picasso/northb... PS28, Line 70: TOM1
Yeah, nothing in coreboot seems to be using it as well. There is an External (TOM2) in pci0. […]
Done
Raul Rangel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Add northbridge pci driver ......................................................................
Patch Set 30:
(2 comments)
https://review.coreboot.org/c/coreboot/+/34424/15/src/soc/amd/picasso/northb... File src/soc/amd/picasso/northbridge.c:
https://review.coreboot.org/c/coreboot/+/34424/15/src/soc/amd/picasso/northb... PS15, Line 144: .read_resources = read_resources,
Oops, missed considering this one before repushing.
I guess we could move it. Let's keep it like this for now. We can move it later if required.
https://review.coreboot.org/c/coreboot/+/34424/28/src/soc/amd/picasso/northb... File src/soc/amd/picasso/northbridge.c:
https://review.coreboot.org/c/coreboot/+/34424/28/src/soc/amd/picasso/northb... PS28, Line 70: TOM1
Yeah, nothing in coreboot seems to be using it as well. There is an External (TOM2) in pci0. […]
Removed it.
Raul Rangel has uploaded a new patch set (#31) to the change originally created by Marshall Dawson. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Add northbridge pci driver ......................................................................
soc/amd/picasso: Add northbridge pci driver
* Declare memory and reserved areas using HOBs for regions above top of low memory. * Copy northbridge_fill_ssdt_generator from stoneyridge.
BUG=b:147042464 TEST=Boot trembyle and see PCI resources in the log: PCI: 00:00.0 PCI: 00:00.0 resource base 0 size a0000 align 0 gran 0 limit 0 flags e0004200 index 0 PCI: 00:00.0 resource base a0000 size 20000 align 0 gran 0 limit 0 flags f0000200 index 1 PCI: 00:00.0 resource base c0000 size 40000 align 0 gran 0 limit 0 flags f0004200 index 2 PCI: 00:00.0 resource base 100000 size cd700000 align 0 gran 0 limit 0 flags e0004200 index 3 PCI: 00:00.0 resource base f8000000 size 4000000 align 0 gran 0 limit 0 flags f0000200 index c0010058 PCI: 00:00.0 resource base ce000000 size 2000000 align 0 gran 0 limit 0 flags f0004200 index 4 PCI: 00:00.0 resource base 100000000 size 12f340000 align 0 gran 0 limit 0 flags e0004200 index 5 PCI: 00:00.0 resource base 22f340000 size cc0000 align 0 gran 0 limit 0 flags f0004200 index 6 PCI: 00:00.0 resource base cd800000 size 800000 align 0 gran 0 limit 0 flags f0004200 index 7 PCI: 00:00.0 resource base cd7fe000 size 2000 align 0 gran 0 limit 0 flags f0004200 index 8 PCI: 00:00.0 resource base cc7fe000 size 1000000 align 0 gran 0 limit 0 flags f0004200 index 9 PCI: 00:00.0 resource base 1090000 size b0000 align 0 gran 0 limit 0 flags f0004200 index a
Change-Id: I44a4a97765151fbcfe4c5d8de200e3e015aaaf2e Signed-off-by: Marshall Dawson marshalldawson3rd@gmail.com --- M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/northbridge.c 2 files changed, 96 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/34424/31
Raul Rangel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Add northbridge pci driver ......................................................................
Uploaded patch set 31.
Raul Rangel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Add northbridge pci driver ......................................................................
Patch Set 31:
Turns out we do need the ssdt generator. I filed b/156785303 to see if we can clean some of this up.
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Add northbridge pci driver ......................................................................
Patch Set 31:
(2 comments)
https://review.coreboot.org/c/coreboot/+/34424/31/src/soc/amd/picasso/northb... File src/soc/amd/picasso/northbridge.c:
https://review.coreboot.org/c/coreboot/+/34424/31/src/soc/amd/picasso/northb... PS31, Line 41: for (; hob->type != HOB_TYPE_END_OF_HOB_LIST; hob = fsp_next_hob(hob)) { I don't think we should be adding these separately. This is already handled by the FSP driver by ensuring that the HOBs get placed in reserved CBMEM area. But, I think there is a bug to fix this later?
https://review.coreboot.org/c/coreboot/+/34424/31/src/soc/amd/picasso/northb... PS31, Line 69: pscope acpi_device_scope(device) instead?
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Add northbridge pci driver ......................................................................
Patch Set 31:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34424/26//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/34424/26//COMMIT_MSG@12 PS26, Line 12:
lol, I guess I didn't know what to call PCI0?
Done
Raul Rangel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Add northbridge pci driver ......................................................................
Patch Set 31:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34424/31/src/soc/amd/picasso/northb... File src/soc/amd/picasso/northbridge.c:
https://review.coreboot.org/c/coreboot/+/34424/31/src/soc/amd/picasso/northb... PS31, Line 41: for (; hob->type != HOB_TYPE_END_OF_HOB_LIST; hob = fsp_next_hob(hob)) {
I don't think we should be adding these separately. […]
The PPR states the following: BIOS must include the DRAM system-physical addresses that are used for PSP, SMU, CC6, etc., in the E820h map to ensure that they are not used by the operating system.
I can dump some of these addresses out to see what they look like.
Raul Rangel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Add northbridge pci driver ......................................................................
Patch Set 31:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34424/31/src/soc/amd/picasso/northb... File src/soc/amd/picasso/northbridge.c:
https://review.coreboot.org/c/coreboot/+/34424/31/src/soc/amd/picasso/northb... PS31, Line 41: for (; hob->type != HOB_TYPE_END_OF_HOB_LIST; hob = fsp_next_hob(hob)) {
The PPR states the following: BIOS must include the DRAM system-physical addresses that are used for […]
Adding PCIe enhanced config space BAR 0xf8000000-0xfc000000. read_resources: SYSTEM_MEMORY: addr: 0x0000000000000000 (0 MB) length: 3456106496 (3296 MB) end: 0x00000000ce000000 (3296 MB) <- This is 8M above cbmem.. why? Is this TOM1? Skipping, below mem_usable: 0x00000000cd800000 <- cbmem_top
read_resources: RESERVED SYSTEM_MEMORY: addr: 0x00000000ce000000 (3296 MB) <-- Right after TOM1 length: 33554432 (32 MB) end: 0x00000000d0000000 (3328 MB)
read_resources: SYSTEM_MEMORY: addr: 0x0000000100000000 (4096 MB) length: 5086904320 (4851 MB) end: 0x000000022f340000 (8947 MB) <-- I'm guessing this is TOM2
read_resources: RESERVED SYSTEM_MEMORY: addr: 0x000000022f340000 (8947 MB) length: 13369344 (12 MB) end: 0x0000000230000000 (8960 MB)
read_resources: RESERVED SYSTEM_MEMORY: addr: 0x00000000cd800000 (3288 MB) length: 8388608 (8 MB) end: 0x00000000ce000000 (3296 MB) <- Looks like this is why CBMEM is 8MB below TOM1
read_resources: RESERVED SYSTEM_MEMORY: addr: 0x00000000cd7fe000 (3287 MB) length: 8192 (0 MB) end: 0x00000000cd800000 (3288 MB) <- This is inside CBMEM, is FSP-M overriding something?
read_resources: RESERVED SYSTEM_MEMORY: addr: 0x00000000cc7fe000 (3271 MB) length: 16777216 (16 MB) end: 0x00000000cd7fe000 (3287 MB) <- This is also inside CBMEM
read_resources: RESERVED SYSTEM_MEMORY: addr: 0x0000000001090000 (16 MB) length: 720896 (0 MB) end: 0x0000000001140000 (17 MB)
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Add northbridge pci driver ......................................................................
Patch Set 31:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34424/31/src/soc/amd/picasso/northb... File src/soc/amd/picasso/northbridge.c:
https://review.coreboot.org/c/coreboot/+/34424/31/src/soc/amd/picasso/northb... PS31, Line 41: for (; hob->type != HOB_TYPE_END_OF_HOB_LIST; hob = fsp_next_hob(hob)) {
The PPR states the following: BIOS must include the DRAM system-physical addresses that are used for […]
Thanks Raul.
* read_resources: SYSTEM_MEMORY: addr: 0x0000000000000000 (0 MB) length: 3456106496 (3296 MB) end: 0x00000000ce000000 (3296 MB) <- This is 8M above cbmem.. why? Is this TOM1? Skipping, below mem_usable: 0x00000000cd800000 <- cbmem_top
I think this is probably coming from: https://chromium.googlesource.com/chromiumos/third_party/coreboot/+/refs/hea.... When FSP-M is called, we ask it to reserve 8KiB for cbmem root: https://chromium.googlesource.com/chromiumos/third_party/coreboot/+/refs/hea.... When I look at the dump of HOBs on trembyle, I see that the BOOTLOADER_TOLUM is at 0xcdffe000:
Resource MEMORY_RESERVED, attribute 3c07 » 0xcdffe000 + 0x00002000 » Owner GUID: 73ff4f56-aa8e-4451-b31636353667ad44 (BOOTLOADER_TOLUM)
And cbmem_top implementation here which relies on init_topmem: https://chromium.googlesource.com/chromiumos/third_party/coreboot/+/refs/hea...
But, coreboot implementation for Picasso does not really make use of that for getting to cbmem_top. This is different between how upstream code is written and how the trembyle-brinup branch works. Upstream has moved to using cbmem_top_chipset() which uses BOOTLOADER_TOLUM to identify top of cbmem for Intel platforms: https://review.coreboot.org/c/coreboot/+/36614. I think we are going to need something like that for Picasso too. But that is a separate issue. Anyways, the address 0xce000000 seems to be the top of usable DRAM below 4GiB. My guess would be that this is still not the same as TOM. It would be good to dump TOM register to see what it is set to. As you said there are other chipset components that need DRAM space, so probably those components use space above the BOOTLOADER_TOLUM.
* read_resources: RESERVED SYSTEM_MEMORY: addr: 0x00000000ce000000 (3296 MB) <-- Right after TOM1 length: 33554432 (32 MB) end: 0x00000000d0000000 (3328 MB)
This is what I am referring to. I think this is the reserved memory used for the chipset components. It would be good to confirm this with AMD. If yes, then it should be possible to just reserve BOOTLOADER_TOLUM to TOM as reserved dram in read_resources(). Another thing to check would be if the chipset components are always allocated space between BOOTLOADER_TOLUM and TOM only or if it is sprinkled around.
* read_resources: SYSTEM_MEMORY: addr: 0x0000000100000000 (4096 MB) length: 5086904320 (4851 MB) end: 0x000000022f340000 (8947 MB) <-- I'm guessing this is TOM2
That is correct. I think we can simply do a read of TOM2 here and mark 4GiB to TOM2 as dram resource. We don't really need to check the HOB for that.
* read_resources: RESERVED SYSTEM_MEMORY: addr: 0x00000000cd800000 (3288 MB) length: 8388608 (8 MB) end: 0x00000000ce000000 (3296 MB) <- Looks like this is why CBMEM is 8MB below TOM1
I don't really see this in the HOBs that I have with trembyle-bringup branch. Can you please dump the HOBs that get printed after FSP-M somewhere?
* read_resources: RESERVED SYSTEM_MEMORY: addr: 0x00000000cd7fe000 (3287 MB) length: 8192 (0 MB) end: 0x00000000cd800000 (3288 MB) <- This is inside CBMEM, is FSP-M overriding something?
FSP reserved memory actually lives within CBMEM. It would ideally be something like:
+----------------------+ 4 GiB | | | | +----------------------+ TOM | | | Chipset reserved | | DRAM | | | +----------------------+ BOOTLOADER_TOLUM | | | CBMEM root | | | +----------------------+ | | | FSP reserved memory| | | +----------------------+ | | | Other CBMEM | | entries | | | +----------------------+ | | | | | | +----------------------+
I am not sure if the "chipset reserved DRAM" is actually done that way for Picasso. But, the FSP reserved memory lives within CBMEM. So, there is no need to mark it as reserved separately.
BTW, I think the HOBs I am seeing and what you reported here is slightly off. I see that FSP reserved memory is at 0xccffe000:
Resource MEMORY_RESERVED, attribute 3c07 » 0xccffe000 + 0x01000000 » Owner GUID: 69a79759-1373-4367-a6c4c7f59efd986e (FSP_RESERVED_MEMORY)
* read_resources: RESERVED SYSTEM_MEMORY: addr: 0x0000000001090000 (16 MB) length: 720896 (0 MB) end: 0x0000000001140000 (17 MB)
Is this something used by some other chipset component? Or is it something that FSP is reserving? If it is FSP reserving this, then it is wrong. It should place all memory it needs within the FSP reserved memory within CBMEM.
Raul Rangel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Add northbridge pci driver ......................................................................
Patch Set 31:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34424/31/src/soc/amd/picasso/northb... File src/soc/amd/picasso/northbridge.c:
https://review.coreboot.org/c/coreboot/+/34424/31/src/soc/amd/picasso/northb... PS31, Line 41: for (; hob->type != HOB_TYPE_END_OF_HOB_LIST; hob = fsp_next_hob(hob)) {
Thanks Raul. […]
Here is the memory map I came up with after dumping the GUIDS:
0x0000000230000000 (8960 MB) - TOM2 + 12 MiB - Unknown reserved memory 0x000000022f340000 (8947 MB) - SYSTEM_MEMORY_TOP_HIGH + 4851.25 MiB - DRAM 0x0000000100000000 (4096 MB) - 4 GiB boundry
+ 18 MiB - MMIO 0x00000000fedd5800 (4077 MB) + 854 KiB - FCH (GPIO/UART/I2C/...) 0x00000000fed00000 (4077 MB) + 895 KiB - MMIO 0x00000000fec200ac (4076 MB) + 128 KiB - IOAPIC / SPI / eSPI 0x00000000fec00000 (4076 MB) + 44 MiB - MMIO 0x00000000fc000000 (4032 MB) + 64 MiB - PCIe enhanced config space 0x00000000f8000000 (3968 MB) + 640 MiB - MMIO
0x00000000d0000000 (3328 MiB) - TOM1 + 32 MiB - Guessing Chipset reserved DRAM 0x00000000ce000000 (3296 MB) - SYSTEM_MEMORY_TOP_LOW + 8 MiB - TSEG 0x00000000cd800000 (3288 MB) - cbmem_top / BOOTLOADER_TOLUM_END + 8 KiB - CBMEM metadata 0x00000000cd7fe000 (3287 MB) - BOOTLOADER_TOLUM_START + 16 MiB - FSP Reserved Memory 0x00000000cc7fe000 (3271 MB) - FSP Reserved Memory + 3254 MiB - DRAM 0x0000000001140000 (17 MB) +704 KiB - FSP-M - https://chrome-internal-review.googlesource.com/c/chromeos/third_party/amd-f... 0x0000000001090000 (16 MB) + 16.5MiB - DRAM 0x0000000000000000 (0 MB)
Here is the raw data: Adding PCIe enhanced config space BAR 0xf8000000-0xfc000000. TOM1: 0x00000000d0000000 TOM2: 0x0000000230000000
read_resources: SYSTEM_MEMORY: addr: 0x0000000000000000 (0 MB) length: 3456106496 (3296 MB) end: 0x00000000ce000000 (3296 MB) Owner GUID: 00000000-0000-0000-0000000000000000 No GUID specified Skipping, below mem_usable: 0x00000000cd800000
read_resources: RESERVED_MEMORY: <- Chipset reserved DRAM? addr: 0x00000000ce000000 (3296 MB) <- System Memory Top Lower length: 33554432 (32 MB) end: 0x00000000d0000000 (3328 MB) <-- TOM1 Owner GUID: 00000000-0000-0000-0000000000000000 No GUID specified
read_resources: SYSTEM_MEMORY: addr: 0x0000000100000000 (4096 MB) length: 5086904320 (4851 MB) end: 0x000000022f340000 (8947 MB) <- System Memory Top High Owner GUID: 00000000-0000-0000-0000000000000000 No GUID specified
read_resources: RESERVED_MEMORY: addr: 0x000000022f340000 (8947 MB) <- System Memory Top High length: 13369344 (12 MB) end: 0x0000000230000000 (8960 MB) <- TOM2 Owner GUID: 00000000-0000-0000-0000000000000000 No GUID specified
read_resources: RESERVED_MEMORY: addr: 0x00000000cd800000 (3288 MB) - BOOTLOADER_TOLUM_END length: 8388608 (8 MB) end: 0x00000000ce000000 (3296 MB) Owner GUID: 5fc7897a-5aff-4c61-aa7addcfa918430c <- gAmdFspTsegHobGuid Unknown GUID
read_resources: RESERVED_MEMORY: addr: 0x00000000cd7fe000 (3287 MB) - BOOTLOADER_TOLUM_START length: 8192 (0 MB) end: 0x00000000cd800000 (3288 MB) - BOOTLOADER_TOLUM_END Owner GUID: 73ff4f56-aa8e-4451-b31636353667ad44 <- fsp_bootloader_tolum_guid BOOTLOADER_TOLUM
read_resources: RESERVED_MEMORY: addr: 0x00000000cc7fe000 (3271 MB) length: 16777216 (16 MB) end: 0x00000000cd7fe000 (3287 MB) - BOOTLOADER_TOLUM_START Owner GUID: 69a79759-1373-4367-a6c4c7f59efd986e <- fsp_reserved_memory_guid FSP_RESERVED_MEMORY read_resources: RESERVED_MEMORY: addr: 0x0000000001090000 (16 MB) length: 720896 (0 MB) end: 0x0000000001140000 (17 MB) Owner GUID: 00000000-0000-0000-0000000000000000 No GUID specified
I think everything looks correct and as expected. Do you see anything that needs changing?
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Add northbridge pci driver ......................................................................
Patch Set 31:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34424/31/src/soc/amd/picasso/northb... File src/soc/amd/picasso/northbridge.c:
https://review.coreboot.org/c/coreboot/+/34424/31/src/soc/amd/picasso/northb... PS31, Line 41: for (; hob->type != HOB_TYPE_END_OF_HOB_LIST; hob = fsp_next_hob(hob)) {
Here is the memory map I came up with after dumping the GUIDS: […]
This looks much better. Out of this, the following don't really need to be marked as separate reserved resources:
read_resources: RESERVED_MEMORY: addr: 0x00000000cd7fe000 (3287 MB) - BOOTLOADER_TOLUM_START length: 8192 (0 MB) end: 0x00000000cd800000 (3288 MB) - BOOTLOADER_TOLUM_END Owner GUID: 73ff4f56-aa8e-4451-b31636353667ad44 <- fsp_bootloader_tolum_guid BOOTLOADER_TOLUM read_resources: RESERVED_MEMORY: addr: 0x00000000cc7fe000 (3271 MB) length: 16777216 (16 MB) end: 0x00000000cd7fe000 (3287 MB) - BOOTLOADER_TOLUM_START Owner GUID: 69a79759-1373-4367-a6c4c7f59efd986e <- fsp_reserved_memory_guid FSP_RESERVED_MEMORY
They are already part of CBMEM.
I think we should be setting up the resources such that: 0 - 640KiB : ram_resource 640 - 768 KiB : mmio_resource 768KiB - 1MiB : reserved_ram_resource 1MiB - cbmem_top() : ram_resource cbmem_top() - TOM1 : reserved_ram_resource MMIO_CONF_BASE - ... : mmconf_resource 4GiB - TOM2: ram_resource
and not really have to parse the entire hob list in here. The only thing that is currently not understood is the 12MiB below TOM2. If we can identify that, it would help keep the whole map defined correctly here without having to parse the HOBs. Also, makes it simpler to visualize how the entire DRAM resources are laid out.
Anyways, if we don't really understand the 12MiB before TOM2, we can raise a bug for that and update this later on.
Raul Rangel has uploaded a new patch set (#32) to the change originally created by Marshall Dawson. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Add pcie root complex driver ......................................................................
soc/amd/picasso: Add pcie root complex driver
* Declare memory and reserved areas using HOBs for regions above top of low memory. * Copy northbridge_fill_ssdt_generator from stoneyridge.
BUG=b:147042464 TEST=Boot trembyle and see PCI resources in the log: PCI: 00:00.0 PCI: 00:00.0 resource base 0 size a0000 align 0 gran 0 limit 0 flags e0004200 index 0 PCI: 00:00.0 resource base a0000 size 20000 align 0 gran 0 limit 0 flags f0000200 index 1 PCI: 00:00.0 resource base c0000 size 40000 align 0 gran 0 limit 0 flags f0004200 index 2 PCI: 00:00.0 resource base 100000 size cd700000 align 0 gran 0 limit 0 flags e0004200 index 3 PCI: 00:00.0 resource base f8000000 size 4000000 align 0 gran 0 limit 0 flags f0000200 index c0010058 PCI: 00:00.0 resource base ce000000 size 2000000 align 0 gran 0 limit 0 flags f0004200 index 4 PCI: 00:00.0 resource base 100000000 size 12f340000 align 0 gran 0 limit 0 flags e0004200 index 5 PCI: 00:00.0 resource base 22f340000 size cc0000 align 0 gran 0 limit 0 flags f0004200 index 6 PCI: 00:00.0 resource base cd800000 size 800000 align 0 gran 0 limit 0 flags f0004200 index 7 PCI: 00:00.0 resource base cd7fe000 size 2000 align 0 gran 0 limit 0 flags f0004200 index 8 PCI: 00:00.0 resource base cc7fe000 size 1000000 align 0 gran 0 limit 0 flags f0004200 index 9 PCI: 00:00.0 resource base 1090000 size b0000 align 0 gran 0 limit 0 flags f0004200 index a
Change-Id: I44a4a97765151fbcfe4c5d8de200e3e015aaaf2e Signed-off-by: Marshall Dawson marshalldawson3rd@gmail.com --- M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/root_compex.c 2 files changed, 96 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/34424/32
Raul Rangel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Add pcie root complex driver ......................................................................
Uploaded patch set 32.
(1 comment)
https://review.coreboot.org/c/coreboot/+/34424/31/src/soc/amd/picasso/northb... File src/soc/amd/picasso/northbridge.c:
https://review.coreboot.org/c/coreboot/+/34424/31/src/soc/amd/picasso/northb... PS31, Line 69: pscope
acpi_device_scope(device) instead?
Done
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Add pcie root complex driver ......................................................................
Patch Set 32: Code-Review+1
(1 comment)
https://review.coreboot.org/c/coreboot/+/34424/32/src/soc/amd/picasso/root_c... File src/soc/amd/picasso/root_compex.c:
https://review.coreboot.org/c/coreboot/+/34424/32/src/soc/amd/picasso/root_c... PS32, Line 64: compex nit: complex?
Raul Rangel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Add pcie root complex driver ......................................................................
Patch Set 32:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34424/31/src/soc/amd/picasso/northb... File src/soc/amd/picasso/northbridge.c:
https://review.coreboot.org/c/coreboot/+/34424/31/src/soc/amd/picasso/northb... PS31, Line 41: for (; hob->type != HOB_TYPE_END_OF_HOB_LIST; hob = fsp_next_hob(hob)) {
This looks much better. […]
I agree. I filed b/156946266 to understand what the 12MB before TOM is. We also need to figure out https://chrome-internal-review.googlesource.com/c/chromeos/third_party/amd-f.... Once those two are solved, I think we can comeback and revisit this code and clean it up.
Raul Rangel has uploaded a new patch set (#33) to the change originally created by Marshall Dawson. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Add pcie root complex driver ......................................................................
soc/amd/picasso: Add pcie root complex driver
* Declare memory and reserved areas using HOBs for regions above top of low memory. * Copy northbridge_fill_ssdt_generator from stoneyridge.
BUG=b:147042464 TEST=Boot trembyle and see PCI resources in the log: PCI: 00:00.0 PCI: 00:00.0 resource base 0 size a0000 align 0 gran 0 limit 0 flags e0004200 index 0 PCI: 00:00.0 resource base a0000 size 20000 align 0 gran 0 limit 0 flags f0000200 index 1 PCI: 00:00.0 resource base c0000 size 40000 align 0 gran 0 limit 0 flags f0004200 index 2 PCI: 00:00.0 resource base 100000 size cd700000 align 0 gran 0 limit 0 flags e0004200 index 3 PCI: 00:00.0 resource base f8000000 size 4000000 align 0 gran 0 limit 0 flags f0000200 index c0010058 PCI: 00:00.0 resource base ce000000 size 2000000 align 0 gran 0 limit 0 flags f0004200 index 4 PCI: 00:00.0 resource base 100000000 size 12f340000 align 0 gran 0 limit 0 flags e0004200 index 5 PCI: 00:00.0 resource base 22f340000 size cc0000 align 0 gran 0 limit 0 flags f0004200 index 6 PCI: 00:00.0 resource base cd800000 size 800000 align 0 gran 0 limit 0 flags f0004200 index 7 PCI: 00:00.0 resource base cd7fe000 size 2000 align 0 gran 0 limit 0 flags f0004200 index 8 PCI: 00:00.0 resource base cc7fe000 size 1000000 align 0 gran 0 limit 0 flags f0004200 index 9 PCI: 00:00.0 resource base 1090000 size b0000 align 0 gran 0 limit 0 flags f0004200 index a
Change-Id: I44a4a97765151fbcfe4c5d8de200e3e015aaaf2e Signed-off-by: Marshall Dawson marshalldawson3rd@gmail.com --- M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/root_complex.c 2 files changed, 96 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/34424/33
Raul Rangel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Add pcie root complex driver ......................................................................
Uploaded patch set 33.
Raul Rangel has uploaded a new patch set (#34) to the change originally created by Marshall Dawson. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Add pcie root complex driver ......................................................................
soc/amd/picasso: Add pcie root complex driver
* Declare memory and reserved areas using HOBs for regions above top of low memory. * Copy northbridge_fill_ssdt_generator from stoneyridge.
BUG=b:147042464 TEST=Boot trembyle and see PCI resources in the log: PCI: 00:00.0 PCI: 00:00.0 resource base 0 size a0000 align 0 gran 0 limit 0 flags e0004200 index 0 PCI: 00:00.0 resource base a0000 size 20000 align 0 gran 0 limit 0 flags f0000200 index 1 PCI: 00:00.0 resource base c0000 size 40000 align 0 gran 0 limit 0 flags f0004200 index 2 PCI: 00:00.0 resource base 100000 size cd700000 align 0 gran 0 limit 0 flags e0004200 index 3 PCI: 00:00.0 resource base f8000000 size 4000000 align 0 gran 0 limit 0 flags f0000200 index c0010058 PCI: 00:00.0 resource base ce000000 size 2000000 align 0 gran 0 limit 0 flags f0004200 index 4 PCI: 00:00.0 resource base 100000000 size 12f340000 align 0 gran 0 limit 0 flags e0004200 index 5 PCI: 00:00.0 resource base 22f340000 size cc0000 align 0 gran 0 limit 0 flags f0004200 index 6 PCI: 00:00.0 resource base cd800000 size 800000 align 0 gran 0 limit 0 flags f0004200 index 7 PCI: 00:00.0 resource base cd7fe000 size 2000 align 0 gran 0 limit 0 flags f0004200 index 8 PCI: 00:00.0 resource base cc7fe000 size 1000000 align 0 gran 0 limit 0 flags f0004200 index 9 PCI: 00:00.0 resource base 1090000 size b0000 align 0 gran 0 limit 0 flags f0004200 index a
Change-Id: I44a4a97765151fbcfe4c5d8de200e3e015aaaf2e Signed-off-by: Marshall Dawson marshalldawson3rd@gmail.com --- M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/root_complex.c 2 files changed, 96 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/34424/34
Raul Rangel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Add pcie root complex driver ......................................................................
Uploaded patch set 34.
Raul Rangel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Add pcie root complex driver ......................................................................
Patch Set 34:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34424/32/src/soc/amd/picasso/root_c... File src/soc/amd/picasso/root_compex.c:
https://review.coreboot.org/c/coreboot/+/34424/32/src/soc/amd/picasso/root_c... PS32, Line 64: compex
nit: complex?
lol... another one....
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Add pcie root complex driver ......................................................................
Patch Set 34: Code-Review+2
Felix Held has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Add pcie root complex driver ......................................................................
Patch Set 34: Code-Review+1
(1 comment)
https://review.coreboot.org/c/coreboot/+/34424/34/src/soc/amd/picasso/root_c... File src/soc/amd/picasso/root_complex.c:
https://review.coreboot.org/c/coreboot/+/34424/34/src/soc/amd/picasso/root_c... PS34, Line 74: * Since XP only implements parts of ACPI 2.0, we can't use a qword : * here. do we still care about windows xp? are there still drivers for picasso for xp? or would changing this break something else? let's leave this for now and maybe addressing it in an follow-up patch though
Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Add pcie root complex driver ......................................................................
soc/amd/picasso: Add pcie root complex driver
* Declare memory and reserved areas using HOBs for regions above top of low memory. * Copy northbridge_fill_ssdt_generator from stoneyridge.
BUG=b:147042464 TEST=Boot trembyle and see PCI resources in the log: PCI: 00:00.0 PCI: 00:00.0 resource base 0 size a0000 align 0 gran 0 limit 0 flags e0004200 index 0 PCI: 00:00.0 resource base a0000 size 20000 align 0 gran 0 limit 0 flags f0000200 index 1 PCI: 00:00.0 resource base c0000 size 40000 align 0 gran 0 limit 0 flags f0004200 index 2 PCI: 00:00.0 resource base 100000 size cd700000 align 0 gran 0 limit 0 flags e0004200 index 3 PCI: 00:00.0 resource base f8000000 size 4000000 align 0 gran 0 limit 0 flags f0000200 index c0010058 PCI: 00:00.0 resource base ce000000 size 2000000 align 0 gran 0 limit 0 flags f0004200 index 4 PCI: 00:00.0 resource base 100000000 size 12f340000 align 0 gran 0 limit 0 flags e0004200 index 5 PCI: 00:00.0 resource base 22f340000 size cc0000 align 0 gran 0 limit 0 flags f0004200 index 6 PCI: 00:00.0 resource base cd800000 size 800000 align 0 gran 0 limit 0 flags f0004200 index 7 PCI: 00:00.0 resource base cd7fe000 size 2000 align 0 gran 0 limit 0 flags f0004200 index 8 PCI: 00:00.0 resource base cc7fe000 size 1000000 align 0 gran 0 limit 0 flags f0004200 index 9 PCI: 00:00.0 resource base 1090000 size b0000 align 0 gran 0 limit 0 flags f0004200 index a
Change-Id: I44a4a97765151fbcfe4c5d8de200e3e015aaaf2e Signed-off-by: Marshall Dawson marshalldawson3rd@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/34424 Reviewed-by: Furquan Shaikh furquan@google.com Reviewed-by: Felix Held felix-coreboot@felixheld.de Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/root_complex.c 2 files changed, 96 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Felix Held: Looks good to me, but someone else must approve Furquan Shaikh: Looks good to me, approved
diff --git a/src/soc/amd/picasso/Makefile.inc b/src/soc/amd/picasso/Makefile.inc index ef2b6b1..ed94cfb 100644 --- a/src/soc/amd/picasso/Makefile.inc +++ b/src/soc/amd/picasso/Makefile.inc @@ -44,6 +44,7 @@ ramstage-y += chip.c ramstage-y += cpu.c ramstage-y += data_fabric_util.c +ramstage-y += root_complex.c ramstage-y += mca.c ramstage-$(CONFIG_HAVE_ACPI_TABLES) += acpi.c ramstage-y += gpio.c diff --git a/src/soc/amd/picasso/root_complex.c b/src/soc/amd/picasso/root_complex.c new file mode 100644 index 0000000..f621eea --- /dev/null +++ b/src/soc/amd/picasso/root_complex.c @@ -0,0 +1,95 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <acpi/acpigen.h> +#include <cbmem.h> +#include <console/console.h> +#include <cpu/amd/msr.h> +#include <cpu/amd/mtrr.h> +#include <device/device.h> +#include <device/pci.h> +#include <device/pci_ids.h> +#include <fsp/util.h> +#include <stdint.h> + +static void read_resources(struct device *dev) +{ + uint32_t mem_usable = (uintptr_t)cbmem_top(); + unsigned int idx = 0; + const struct hob_header *hob = fsp_get_hob_list(); + const struct hob_resource *res; + + /* 0x0 - 0x9ffff */ + ram_resource(dev, idx++, 0, 0xa0000 / KiB); + + /* 0xa0000 - 0xbffff: legacy VGA */ + mmio_resource(dev, idx++, 0xa0000 / KiB, 0x20000 / KiB); + + /* 0xc0000 - 0xfffff: Option ROM */ + reserved_ram_resource(dev, idx++, 0xc0000 / KiB, 0x40000 / KiB); + + /* 1MB to top of low usable RAM */ + ram_resource(dev, idx++, 1 * MiB / KiB, (mem_usable - 1 * MiB) / KiB); + + mmconf_resource(dev, MMIO_CONF_BASE); + + if (!hob) { + printk(BIOS_ERR, "Error: %s incomplete because no HOB list was found\n", + __func__); + return; + } + + for (; hob->type != HOB_TYPE_END_OF_HOB_LIST; hob = fsp_next_hob(hob)) { + + if (hob->type != HOB_TYPE_RESOURCE_DESCRIPTOR) + continue; + + res = fsp_hob_header_to_resource(hob); + + if (res->type == EFI_RESOURCE_SYSTEM_MEMORY && res->addr < mem_usable) + continue; /* 0 through low usable was set above */ + if (res->type == EFI_RESOURCE_MEMORY_MAPPED_IO) + continue; /* Done separately */ + + if (res->type == EFI_RESOURCE_SYSTEM_MEMORY) + ram_resource(dev, idx++, res->addr / KiB, res->length / KiB); + else if (res->type == EFI_RESOURCE_MEMORY_RESERVED) + reserved_ram_resource(dev, idx++, res->addr / KiB, res->length / KiB); + else + printk(BIOS_ERR, "Error: failed to set resources for type %d\n", + res->type); + } +} + +/* Used by _SB.PCI0._CRS */ +static void root_complex_fill_ssdt(const struct device *device) +{ + msr_t msr; + + acpigen_write_scope(acpi_device_scope(device)); + + msr = rdmsr(TOP_MEM); + acpigen_write_name_dword("TOM1", msr.lo); + msr = rdmsr(TOP_MEM2); + /* + * Since XP only implements parts of ACPI 2.0, we can't use a qword + * here. + * See http://www.acpi.info/presentations/S01USMOBS169_OS%2520new.ppt + * slide 22ff. + * Shift value right by 20 bit to make it fit into 32bit, + * giving us 1MB granularity and a limit of almost 4Exabyte of memory. + */ + acpigen_write_name_dword("TOM2", (msr.hi << 12) | msr.lo >> 20); + acpigen_pop_len(); +} + +static struct device_operations root_complex_operations = { + .read_resources = read_resources, + .enable_resources = pci_dev_enable_resources, + .acpi_fill_ssdt = root_complex_fill_ssdt, +}; + +static const struct pci_driver family17_root_complex __pci_driver = { + .ops = &root_complex_operations, + .vendor = PCI_VENDOR_ID_AMD, + .device = PCI_DEVICE_ID_AMD_17H_MODEL_101F_NB, +};
9elements QA has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Add pcie root complex driver ......................................................................
Patch Set 35:
Automatic boot test returned (PASS/FAIL/TOTAL): 4/0/4 Emulation targets: "QEMU x86 q35/ich9" using payload TianoCore : SUCCESS : https://lava.9esec.io/r/3582 "QEMU x86 q35/ich9" using payload SeaBIOS : SUCCESS : https://lava.9esec.io/r/3581 "QEMU x86 i440fx/piix4" using payload SeaBIOS : SUCCESS : https://lava.9esec.io/r/3580 "QEMU AArch64" using payload LinuxBoot_u-root_kexec : SUCCESS : https://lava.9esec.io/r/3579
Please note: This test is under development and might not be accurate at all!
Aaron Durbin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34424 )
Change subject: soc/amd/picasso: Add pcie root complex driver ......................................................................
Patch Set 35:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34424/31/src/soc/amd/picasso/northb... File src/soc/amd/picasso/northbridge.c:
https://review.coreboot.org/c/coreboot/+/34424/31/src/soc/amd/picasso/northb... PS31, Line 41: for (; hob->type != HOB_TYPE_END_OF_HOB_LIST; hob = fsp_next_hob(hob)) {
I agree. I filed b/156946266 to understand what the 12MB before TOM is. […]
My guess is that 12MiB might be CC6 for saving core state, though I don't think the cpu can directly address that part of the physical address space.