Werner Zeh has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/30989
Change subject: intelblocks/systemagent: Add ACPI table generation hook ......................................................................
intelblocks/systemagent: Add ACPI table generation hook
In preparation of generating DMAR tables provide the hook in SoC-scope for the systemagent to write ACPI tables. The complete functionality is SoC-specific. Therefore event the entry hook is defined as a weak-function which can be overridden by SoC-code. If the SoC does not have support for generating DMAR tables this hook will make no harm.
Change-Id: I1333ae2b79f1a855e6f3bb39bf534da170ddc9e1 Signed-off-by: Werner Zeh werner.zeh@siemens.com --- M src/soc/intel/common/block/include/intelblocks/acpi.h M src/soc/intel/common/block/systemagent/systemagent.c 2 files changed, 21 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/89/30989/1
diff --git a/src/soc/intel/common/block/include/intelblocks/acpi.h b/src/soc/intel/common/block/include/intelblocks/acpi.h index 6b1b9bd..671aabb 100644 --- a/src/soc/intel/common/block/include/intelblocks/acpi.h +++ b/src/soc/intel/common/block/include/intelblocks/acpi.h @@ -2,7 +2,7 @@ * This file is part of the coreboot project. * * Copyright (C) 2017 Intel Corp. - * Copyright (C) 2017 Siemens AG + * Copyright (C) 2018 Siemens AG * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -75,6 +75,11 @@ /* Chipset specific settings for filling up fadt table */ void soc_fill_fadt(acpi_fadt_t *fadt);
+/* Chipset specific settings for filling up dmar table */ +unsigned long sa_write_acpi_tables(struct device *const dev, + unsigned long current, + struct acpi_rsdp *const rsdp); + /* Return the polarity flag for SCI IRQ */ int soc_madt_sci_irq_polarity(int sci);
diff --git a/src/soc/intel/common/block/systemagent/systemagent.c b/src/soc/intel/common/block/systemagent/systemagent.c index 9608359..7552afe 100644 --- a/src/soc/intel/common/block/systemagent/systemagent.c +++ b/src/soc/intel/common/block/systemagent/systemagent.c @@ -2,6 +2,7 @@ * This file is part of the coreboot project. * * Copyright (C) 2017-2018 Intel Corporation. + * Copyright (C) 2018 Siemens AG * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,9 +20,9 @@ #include <device/pci.h> #include <device/pci_ids.h> #include <intelblocks/systemagent.h> +#include <intelblocks/acpi.h> #include <soc/iomap.h> #include <soc/pci_devs.h> -#include <soc/systemagent.h> #include "systemagent_def.h"
/* SoC override function */ @@ -48,6 +49,13 @@ return 0; }
+__weak unsigned long sa_write_acpi_tables(struct device *const dev, + unsigned long current, + struct acpi_rsdp *const rsdp) +{ + return current; +} + /* * Add all known fixed MMIO ranges that hang off the host bridge/memory * controller device. @@ -278,11 +286,12 @@ }
static struct device_operations systemagent_ops = { - .read_resources = &systemagent_read_resources, - .set_resources = &pci_dev_set_resources, - .enable_resources = &pci_dev_enable_resources, - .init = soc_systemagent_init, - .ops_pci = &pci_dev_ops_pci, + .read_resources = &systemagent_read_resources, + .set_resources = &pci_dev_set_resources, + .enable_resources = &pci_dev_enable_resources, + .init = soc_systemagent_init, + .ops_pci = &pci_dev_ops_pci, + .write_acpi_tables = sa_write_acpi_tables, };
static const unsigned short systemagent_ids[] = {
Mario Scheithauer has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30989 )
Change subject: intelblocks/systemagent: Add ACPI table generation hook ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/#/c/30989/1/src/soc/intel/common/block/systemage... File src/soc/intel/common/block/systemagent/systemagent.c:
https://review.coreboot.org/#/c/30989/1/src/soc/intel/common/block/systemage... PS1, Line 5: 2018 we already have the year 2019 :)
Hello Patrick Rudolph, Mario Scheithauer, build bot (Jenkins), Nico Huber,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/30989
to look at the new patch set (#2).
Change subject: intelblocks/systemagent: Add ACPI table generation hook ......................................................................
intelblocks/systemagent: Add ACPI table generation hook
In preparation of generating DMAR tables provide the hook in SoC-scope for the systemagent to write ACPI tables. The complete functionality is SoC-specific. Therefore event the entry hook is defined as a weak-function which can be overridden by SoC-code. If the SoC does not have support for generating DMAR tables this hook will make no harm.
Change-Id: I1333ae2b79f1a855e6f3bb39bf534da170ddc9e1 Signed-off-by: Werner Zeh werner.zeh@siemens.com --- M src/soc/intel/common/block/include/intelblocks/acpi.h M src/soc/intel/common/block/systemagent/systemagent.c 2 files changed, 21 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/89/30989/2
Mario Scheithauer has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30989 )
Change subject: intelblocks/systemagent: Add ACPI table generation hook ......................................................................
Patch Set 2: Code-Review+2
Alex Thiessen has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30989 )
Change subject: intelblocks/systemagent: Add ACPI table generation hook ......................................................................
Patch Set 2:
(5 comments)
not quite there yet :)
https://review.coreboot.org/#/c/30989/2//COMMIT_MSG Commit Message:
https://review.coreboot.org/#/c/30989/2//COMMIT_MSG@9 PS2, Line 9: SoC-scope just `SoC scope` I guess, same for `weak function` and `SoC-code` cause they aren't compound adjectives ;)
https://review.coreboot.org/#/c/30989/2//COMMIT_MSG@9 PS2, Line 9: I am not a native speaker, but I think that there should be a comma here.
https://review.coreboot.org/#/c/30989/2//COMMIT_MSG@13 PS2, Line 13: make `do no harm` should be the right one
https://review.coreboot.org/#/c/30989/2/src/soc/intel/common/block/include/i... File src/soc/intel/common/block/include/intelblocks/acpi.h:
https://review.coreboot.org/#/c/30989/2/src/soc/intel/common/block/include/i... PS2, Line 79: const Don't declare constness for function-local variables, same for the `rsdp` parameter. If you want `dev` to point to constant data, then `const` must be moved _before_ the `*`, typically written as `const struct device* dev`.
https://review.coreboot.org/#/c/30989/2/src/soc/intel/common/block/systemage... File src/soc/intel/common/block/systemagent/systemagent.c:
https://review.coreboot.org/#/c/30989/2/src/soc/intel/common/block/systemage... PS2, Line 23: #include <intelblocks/acpi.h> Is there a specific reason to not sort the includes? If so, consider documenting with a comment.
Werner Zeh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30989 )
Change subject: intelblocks/systemagent: Add ACPI table generation hook ......................................................................
Patch Set 2:
(5 comments)
Thanks for having a look Alex
https://review.coreboot.org/#/c/30989/2//COMMIT_MSG Commit Message:
https://review.coreboot.org/#/c/30989/2//COMMIT_MSG@9 PS2, Line 9:
I am not a native speaker, but I think that there should be a comma here.
Ack
https://review.coreboot.org/#/c/30989/2//COMMIT_MSG@9 PS2, Line 9: SoC-scope
just `SoC scope` I guess, same for `weak function` and `SoC-code` cause they aren't compound adjecti […]
Ack
https://review.coreboot.org/#/c/30989/2//COMMIT_MSG@13 PS2, Line 13: make
`do no harm` should be the right one
Ack
https://review.coreboot.org/#/c/30989/2/src/soc/intel/common/block/include/i... File src/soc/intel/common/block/include/intelblocks/acpi.h:
https://review.coreboot.org/#/c/30989/2/src/soc/intel/common/block/include/i... PS2, Line 79: const
Don't declare constness for function-local variables, same for the `rsdp` parameter. […]
Agree, will change.
https://review.coreboot.org/#/c/30989/2/src/soc/intel/common/block/systemage... File src/soc/intel/common/block/systemagent/systemagent.c:
https://review.coreboot.org/#/c/30989/2/src/soc/intel/common/block/systemage... PS2, Line 23: #include <intelblocks/acpi.h>
Is there a specific reason to not sort the includes? If so, consider documenting with a comment.
No specific reason, will sort the include.
Werner Zeh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30989 )
Change subject: intelblocks/systemagent: Add ACPI table generation hook ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/#/c/30989/2/src/soc/intel/common/block/include/i... File src/soc/intel/common/block/include/intelblocks/acpi.h:
https://review.coreboot.org/#/c/30989/2/src/soc/intel/common/block/include/i... PS2, Line 79: const
Agree, will change.
Wait a moment, in device/device.h the function prototype for this hook does not use const at all:
unsigned long (*write_acpi_tables)(struct device *dev, unsigned long start, struct acpi_rsdp *rsdp);
In addition, it is inside the "#if IS_ENABLED(CONFIG_HAVE_ACPI_TABLES)" switch which I would like to add to my code as well.
Hello Patrick Rudolph, Mario Scheithauer, build bot (Jenkins), Nico Huber,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/30989
to look at the new patch set (#3).
Change subject: intelblocks/systemagent: Add ACPI table generation hook ......................................................................
intelblocks/systemagent: Add ACPI table generation hook
In preparation of generating DMAR tables, provide the hook in SoC scope for the systemagent to write ACPI tables. The complete functionality is SoC-specific. Therefore event the entry hook is defined as a weak function which can be overridden by SoC code. If the SoC does not have support for generating DMAR tables this hook will do no harm.
Change-Id: I1333ae2b79f1a855e6f3bb39bf534da170ddc9e1 Signed-off-by: Werner Zeh werner.zeh@siemens.com --- M src/soc/intel/common/block/include/intelblocks/acpi.h M src/soc/intel/common/block/systemagent/systemagent.c 2 files changed, 24 insertions(+), 8 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/89/30989/3
Alex Thiessen has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30989 )
Change subject: intelblocks/systemagent: Add ACPI table generation hook ......................................................................
Patch Set 3:
(3 comments)
converging...
https://review.coreboot.org/#/c/30989/3//COMMIT_MSG Commit Message:
https://review.coreboot.org/#/c/30989/3//COMMIT_MSG@11 PS3, Line 11: event the entry hook `the entry hook event`?
https://review.coreboot.org/#/c/30989/2/src/soc/intel/common/block/include/i... File src/soc/intel/common/block/include/intelblocks/acpi.h:
https://review.coreboot.org/#/c/30989/2/src/soc/intel/common/block/include/i... PS2, Line 79: const
Wait a moment, in device/device.h the function prototype for this hook does not use const at all: […]
looks fine to me now in the patchset 3
https://review.coreboot.org/#/c/30989/3/src/soc/intel/common/block/systemage... File src/soc/intel/common/block/systemagent/systemagent.c:
https://review.coreboot.org/#/c/30989/3/src/soc/intel/common/block/systemage... PS3, Line 23: #include <intelblocks/acpi.h> : #include <soc/iomap.h> : #include "systemagent_def.h" : #include <soc/pci_devs.h> now the order looks, hm, random to me
Werner Zeh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30989 )
Change subject: intelblocks/systemagent: Add ACPI table generation hook ......................................................................
Patch Set 3:
(2 comments)
https://review.coreboot.org/#/c/30989/3//COMMIT_MSG Commit Message:
https://review.coreboot.org/#/c/30989/3//COMMIT_MSG@11 PS3, Line 11: event the entry hook
`the entry hook event`?
Ack
https://review.coreboot.org/#/c/30989/3/src/soc/intel/common/block/systemage... File src/soc/intel/common/block/systemagent/systemagent.c:
https://review.coreboot.org/#/c/30989/3/src/soc/intel/common/block/systemage... PS3, Line 23: #include <intelblocks/acpi.h> : #include <soc/iomap.h> : #include "systemagent_def.h" : #include <soc/pci_devs.h>
now the order looks, hm, random to me
Ups, sorry. Will update.
Hello Patrick Rudolph, Mario Scheithauer, build bot (Jenkins), Nico Huber,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/30989
to look at the new patch set (#4).
Change subject: intelblocks/systemagent: Add ACPI table generation hook ......................................................................
intelblocks/systemagent: Add ACPI table generation hook
In preparation of generating DMAR tables, provide the hook in SoC scope for the systemagent to write ACPI tables. The complete functionality is SoC-specific. Therefore the entry hook is defined as a weak function which can be overridden by SoC code. If the SoC does not have support for generating DMAR tables this hook will do no harm.
Change-Id: I1333ae2b79f1a855e6f3bb39bf534da170ddc9e1 Signed-off-by: Werner Zeh werner.zeh@siemens.com --- M src/soc/intel/common/block/include/intelblocks/acpi.h M src/soc/intel/common/block/systemagent/systemagent.c 2 files changed, 23 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/89/30989/4
Alex Thiessen has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30989 )
Change subject: intelblocks/systemagent: Add ACPI table generation hook ......................................................................
Patch Set 4:
(2 comments)
https://review.coreboot.org/#/c/30989/2/src/soc/intel/common/block/systemage... File src/soc/intel/common/block/systemagent/systemagent.c:
https://review.coreboot.org/#/c/30989/2/src/soc/intel/common/block/systemage... PS2, Line 23: #include <intelblocks/acpi.h>
No specific reason, will sort the include.
Done
https://review.coreboot.org/#/c/30989/4/src/soc/intel/common/block/systemage... File src/soc/intel/common/block/systemagent/systemagent.c:
https://review.coreboot.org/#/c/30989/4/src/soc/intel/common/block/systemage... PS4, Line 24: You dropped this include, was this intentional?
Werner Zeh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30989 )
Change subject: intelblocks/systemagent: Add ACPI table generation hook ......................................................................
Patch Set 4:
(1 comment)
https://review.coreboot.org/#/c/30989/4/src/soc/intel/common/block/systemage... File src/soc/intel/common/block/systemagent/systemagent.c:
https://review.coreboot.org/#/c/30989/4/src/soc/intel/common/block/systemage... PS4, Line 24:
You dropped this include, was this intentional?
Damn...not by intention. Need to concentrate on just one thing at a time, sorry.
Hello Patrick Rudolph, Mario Scheithauer, build bot (Jenkins), Nico Huber,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/30989
to look at the new patch set (#5).
Change subject: intelblocks/systemagent: Add ACPI table generation hook ......................................................................
intelblocks/systemagent: Add ACPI table generation hook
In preparation of generating DMAR tables, provide the hook in SoC scope for the systemagent to write ACPI tables. The complete functionality is SoC-specific. Therefore the entry hook is defined as a weak function which can be overridden by SoC code. If the SoC does not have support for generating DMAR tables this hook will do no harm.
Change-Id: I1333ae2b79f1a855e6f3bb39bf534da170ddc9e1 Signed-off-by: Werner Zeh werner.zeh@siemens.com --- M src/soc/intel/common/block/include/intelblocks/acpi.h M src/soc/intel/common/block/systemagent/systemagent.c 2 files changed, 23 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/89/30989/5
Alex Thiessen has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30989 )
Change subject: intelblocks/systemagent: Add ACPI table generation hook ......................................................................
Patch Set 5: Code-Review+2
(3 comments)
https://review.coreboot.org/#/c/30989/1/src/soc/intel/common/block/systemage... File src/soc/intel/common/block/systemagent/systemagent.c:
https://review.coreboot.org/#/c/30989/1/src/soc/intel/common/block/systemage... PS1, Line 5: 2018
we already have the year 2019 :)
Done
https://review.coreboot.org/#/c/30989/3/src/soc/intel/common/block/systemage... File src/soc/intel/common/block/systemagent/systemagent.c:
https://review.coreboot.org/#/c/30989/3/src/soc/intel/common/block/systemage... PS3, Line 23: #include <intelblocks/acpi.h> : #include <soc/iomap.h> : #include "systemagent_def.h" : #include <soc/pci_devs.h>
Ups, sorry. Will update.
Done
https://review.coreboot.org/#/c/30989/4/src/soc/intel/common/block/systemage... File src/soc/intel/common/block/systemagent/systemagent.c:
https://review.coreboot.org/#/c/30989/4/src/soc/intel/common/block/systemage... PS4, Line 24:
Damn...not by intention. Need to concentrate on just one thing at a time, sorry.
Done
Stefan Reinauer has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30989 )
Change subject: intelblocks/systemagent: Add ACPI table generation hook ......................................................................
Patch Set 5: Code-Review+2
Hello Alex Thiessen, Patrick Rudolph, Mario Scheithauer, Stefan Reinauer, build bot (Jenkins), Nico Huber,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/30989
to look at the new patch set (#6).
Change subject: intelblocks/systemagent: Add ACPI table generation hook ......................................................................
intelblocks/systemagent: Add ACPI table generation hook
In preparation of generating DMAR tables, provide the hook in SoC scope for the systemagent to write ACPI tables. The complete functionality is SoC-specific. Therefore the entry hook is defined as a weak function which can be overridden by SoC code. If the SoC does not have support for generating DMAR tables this hook will do no harm.
Change-Id: I1333ae2b79f1a855e6f3bb39bf534da170ddc9e1 Signed-off-by: Werner Zeh werner.zeh@siemens.com --- M src/soc/intel/common/block/include/intelblocks/acpi.h M src/soc/intel/common/block/systemagent/systemagent.c 2 files changed, 18 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/89/30989/6
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30989 )
Change subject: intelblocks/systemagent: Add ACPI table generation hook ......................................................................
Patch Set 6:
(2 comments)
https://review.coreboot.org/#/c/30989/6/src/soc/intel/common/block/include/i... File src/soc/intel/common/block/include/intelblocks/acpi.h:
https://review.coreboot.org/#/c/30989/6/src/soc/intel/common/block/include/i... PS6, Line 5: * Copyright (C) 2019 Siemens AG NB. I don't see how this change affects copyright. Also, even if, I think this would have to be written as `2017, 2019` as the additions from 2017 haven't been removed.
https://review.coreboot.org/#/c/30989/6/src/soc/intel/common/block/systemage... File src/soc/intel/common/block/systemagent/systemagent.c:
https://review.coreboot.org/#/c/30989/6/src/soc/intel/common/block/systemage... PS6, Line 58: } NB. with all these weak function, I wonder why the driver is defined here instead of the SoC level. Drivers at the SoC level could still directly point to common/ functions, so this indirection here seems unnecessary.
Werner Zeh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30989 )
Change subject: intelblocks/systemagent: Add ACPI table generation hook ......................................................................
Patch Set 6:
(2 comments)
https://review.coreboot.org/#/c/30989/6/src/soc/intel/common/block/include/i... File src/soc/intel/common/block/include/intelblocks/acpi.h:
https://review.coreboot.org/#/c/30989/6/src/soc/intel/common/block/include/i... PS6, Line 5: * Copyright (C) 2019 Siemens AG
NB. I don't see how this change affects copyright. […]
Sure, agree. Can switch it back to 2017.
https://review.coreboot.org/#/c/30989/6/src/soc/intel/common/block/systemage... File src/soc/intel/common/block/systemagent/systemagent.c:
https://review.coreboot.org/#/c/30989/6/src/soc/intel/common/block/systemage... PS6, Line 58: }
NB. with all these weak function, I wonder why the driver […]
Well, this approach just fits in current infrastructure we have around.
So your idea would be to define a second driver just on SoC level which just covers the PCI IDs of that single SoC? And then duplicate it for the SoC even if we have this driver around already which will match the given IDs?
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30989 )
Change subject: intelblocks/systemagent: Add ACPI table generation hook ......................................................................
Patch Set 6:
(1 comment)
https://review.coreboot.org/#/c/30989/6/src/soc/intel/common/block/systemage... File src/soc/intel/common/block/systemagent/systemagent.c:
https://review.coreboot.org/#/c/30989/6/src/soc/intel/common/block/systemage... PS6, Line 58: }
Well, this approach just fits in current infrastructure we have around.
You mean your change? That's fine. I just commented on this driver generally, not meant as incentive to adapt your change.
So your idea would be to define a second driver just on SoC level which just covers the PCI IDs of that single SoC? And then duplicate it for the SoC even if we have this driver around already which will match the given IDs?
No, I wouldn't place a pci_driver into common/ code in the first place (unless it is 100% common). With the current weak-function approach, you have to jump back and forth between soc and common code if you want to read it. It would be much easier if we would keep the driver in the soc code and don't jump back.
With the abstraction mechanism (function pointers) of pci_driver, we could already solve such problems better before we made excessive use of weak functions. Now this code is layering abstraction mechanisms, making it harder to maintain.
Werner Zeh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30989 )
Change subject: intelblocks/systemagent: Add ACPI table generation hook ......................................................................
Patch Set 6:
Patch Set 6:
(1 comment)
OK, got it.
Hello Alex Thiessen, Patrick Rudolph, Mario Scheithauer, Stefan Reinauer, build bot (Jenkins), Nico Huber,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/30989
to look at the new patch set (#7).
Change subject: intelblocks/systemagent: Add ACPI table generation hook ......................................................................
intelblocks/systemagent: Add ACPI table generation hook
In preparation of generating DMAR tables, provide the hook in SoC scope for the systemagent to write ACPI tables. The complete functionality is SoC-specific. Therefore the entry hook is defined as a weak function which can be overridden by SoC code. If the SoC does not have support for generating DMAR tables this hook will do no harm.
Change-Id: I1333ae2b79f1a855e6f3bb39bf534da170ddc9e1 Signed-off-by: Werner Zeh werner.zeh@siemens.com --- M src/soc/intel/common/block/include/intelblocks/acpi.h M src/soc/intel/common/block/systemagent/systemagent.c 2 files changed, 17 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/89/30989/7
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30989 )
Change subject: intelblocks/systemagent: Add ACPI table generation hook ......................................................................
Patch Set 7: Code-Review+2
Patrick Georgi has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/30989 )
Change subject: intelblocks/systemagent: Add ACPI table generation hook ......................................................................
intelblocks/systemagent: Add ACPI table generation hook
In preparation of generating DMAR tables, provide the hook in SoC scope for the systemagent to write ACPI tables. The complete functionality is SoC-specific. Therefore the entry hook is defined as a weak function which can be overridden by SoC code. If the SoC does not have support for generating DMAR tables this hook will do no harm.
Change-Id: I1333ae2b79f1a855e6f3bb39bf534da170ddc9e1 Signed-off-by: Werner Zeh werner.zeh@siemens.com Reviewed-on: https://review.coreboot.org/c/30989 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Nico Huber nico.h@gmx.de --- M src/soc/intel/common/block/include/intelblocks/acpi.h M src/soc/intel/common/block/systemagent/systemagent.c 2 files changed, 17 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Nico Huber: Looks good to me, approved
diff --git a/src/soc/intel/common/block/include/intelblocks/acpi.h b/src/soc/intel/common/block/include/intelblocks/acpi.h index 029174f..e615ccd 100644 --- a/src/soc/intel/common/block/include/intelblocks/acpi.h +++ b/src/soc/intel/common/block/include/intelblocks/acpi.h @@ -81,6 +81,11 @@ /* Chipset specific settings for filling up fadt table */ void soc_fill_fadt(acpi_fadt_t *fadt);
+/* Chipset specific settings for filling up dmar table */ +unsigned long sa_write_acpi_tables(struct device *dev, + unsigned long current, + struct acpi_rsdp *rsdp); + /* Return the polarity flag for SCI IRQ */ int soc_madt_sci_irq_polarity(int sci);
diff --git a/src/soc/intel/common/block/systemagent/systemagent.c b/src/soc/intel/common/block/systemagent/systemagent.c index a85bcab..299cc5f 100644 --- a/src/soc/intel/common/block/systemagent/systemagent.c +++ b/src/soc/intel/common/block/systemagent/systemagent.c @@ -2,6 +2,7 @@ * This file is part of the coreboot project. * * Copyright (C) 2017-2018 Intel Corporation. + * Copyright (C) 2019 Siemens AG * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,6 +19,7 @@ #include <device/device.h> #include <device/pci.h> #include <device/pci_ids.h> +#include <intelblocks/acpi.h> #include <intelblocks/systemagent.h> #include <soc/iomap.h> #include <soc/pci_devs.h> @@ -48,6 +50,13 @@ return 0; }
+__weak unsigned long sa_write_acpi_tables(struct device *dev, + unsigned long current, + struct acpi_rsdp *rsdp) +{ + return current; +} + /* * Add all known fixed MMIO ranges that hang off the host bridge/memory * controller device. @@ -283,6 +292,9 @@ .enable_resources = pci_dev_enable_resources, .init = soc_systemagent_init, .ops_pci = &pci_dev_ops_pci, +#if IS_ENABLED(CONFIG_HAVE_ACPI_TABLES) + .write_acpi_tables = sa_write_acpi_tables, +#endif };
static const unsigned short systemagent_ids[] = {