build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/29343 )
Change subject: soc/amd/stoneyridge: Set IOMMU support to follow device setting
......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/#/c/29343/1/src/soc/amd/common/block/pi/agesawr…
File src/soc/amd/common/block/pi/agesawrapper.c:
https://review.coreboot.org/#/c/29343/1/src/soc/amd/common/block/pi/agesawr…
PS1, Line 329: LateParams->GnbLateConfiguration.GnbIoapicId = CONFIG_MAX_CPUS + 1;
line over 80 characters
--
To view, visit https://review.coreboot.org/29343
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I6cfd6c81f47de23c54a49ec7cf87b219215ced5e
Gerrit-Change-Number: 29343
Gerrit-PatchSet: 1
Gerrit-Owner: Martin Roth <martinroth(a)google.com>
Gerrit-CC: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Mon, 29 Oct 2018 20:24:05 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: No
Martin Roth has uploaded this change for review. ( https://review.coreboot.org/29342
Change subject: mb/google/kahlee: Disable IOMMU
......................................................................
mb/google/kahlee: Disable IOMMU
Unfortunately Stoney has an issue where enabling the IOMMU causes
a 10%-50% decrease in the integrated graphics performance. It is
also disabled by default on other stoney platforms.
BUG=b:118612241
TEST=Verify that IOMMU is disabled.
Change-Id: Ia396c7227cb21461ec8afbdf746721d4fb28083d
Signed-off-by: Martin Roth <martinroth(a)google.com>
---
M src/mainboard/google/kahlee/variants/aleena/devicetree.cb
M src/mainboard/google/kahlee/variants/careena/devicetree.cb
M src/mainboard/google/kahlee/variants/delan/devicetree.cb
M src/mainboard/google/kahlee/variants/grunt/devicetree.cb
M src/mainboard/google/kahlee/variants/liara/devicetree.cb
5 files changed, 5 insertions(+), 5 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/42/29342/1
diff --git a/src/mainboard/google/kahlee/variants/aleena/devicetree.cb b/src/mainboard/google/kahlee/variants/aleena/devicetree.cb
index 5438e6d..27a8e28 100644
--- a/src/mainboard/google/kahlee/variants/aleena/devicetree.cb
+++ b/src/mainboard/google/kahlee/variants/aleena/devicetree.cb
@@ -58,7 +58,7 @@
end
device domain 0 on
device pci 0.0 on end # Root Complex
- device pci 0.2 on end # IOMMU
+ device pci 0.2 off end # IOMMU (Disabled for performance and battery)
device pci 1.0 on end # Internal Graphics P2P bridge 0x98e4
device pci 1.1 on end # Internal Multimedia
device pci 2.0 on end # PCIe Host Bridge
diff --git a/src/mainboard/google/kahlee/variants/careena/devicetree.cb b/src/mainboard/google/kahlee/variants/careena/devicetree.cb
index b541c03..23253b2 100644
--- a/src/mainboard/google/kahlee/variants/careena/devicetree.cb
+++ b/src/mainboard/google/kahlee/variants/careena/devicetree.cb
@@ -61,7 +61,7 @@
end
device domain 0 on
device pci 0.0 on end # Root Complex
- device pci 0.2 on end # IOMMU
+ device pci 0.2 off end # IOMMU (Disabled for performance and battery)
device pci 1.0 on end # Internal Graphics P2P bridge 0x98e4
device pci 1.1 on end # Internal Multimedia
device pci 2.0 on end # PCIe Host Bridge
diff --git a/src/mainboard/google/kahlee/variants/delan/devicetree.cb b/src/mainboard/google/kahlee/variants/delan/devicetree.cb
index 0dfe204..fd30d5d 100644
--- a/src/mainboard/google/kahlee/variants/delan/devicetree.cb
+++ b/src/mainboard/google/kahlee/variants/delan/devicetree.cb
@@ -55,7 +55,7 @@
end
device domain 0 on
device pci 0.0 on end # Root Complex
- device pci 0.2 on end # IOMMU
+ device pci 0.2 off end # IOMMU (Disabled for performance and battery)
device pci 1.0 on end # Internal Graphics P2P bridge 0x98e4
device pci 1.1 on end # Internal Multimedia
device pci 2.0 on end # PCIe Host Bridge
diff --git a/src/mainboard/google/kahlee/variants/grunt/devicetree.cb b/src/mainboard/google/kahlee/variants/grunt/devicetree.cb
index 5a8906b..b37e1bf 100644
--- a/src/mainboard/google/kahlee/variants/grunt/devicetree.cb
+++ b/src/mainboard/google/kahlee/variants/grunt/devicetree.cb
@@ -61,7 +61,7 @@
end
device domain 0 on
device pci 0.0 on end # Root Complex
- device pci 0.2 on end # IOMMU
+ device pci 0.2 off end # IOMMU (Disabled for performance and battery)
device pci 1.0 on end # Internal Graphics P2P bridge 0x98e4
device pci 1.1 on end # Internal Multimedia
device pci 2.0 on end # PCIe Host Bridge
diff --git a/src/mainboard/google/kahlee/variants/liara/devicetree.cb b/src/mainboard/google/kahlee/variants/liara/devicetree.cb
index cea3425..343fbeb 100644
--- a/src/mainboard/google/kahlee/variants/liara/devicetree.cb
+++ b/src/mainboard/google/kahlee/variants/liara/devicetree.cb
@@ -58,7 +58,7 @@
end
device domain 0 on
device pci 0.0 on end # Root Complex
- device pci 0.2 on end # IOMMU
+ device pci 0.2 off end # IOMMU
device pci 1.0 on end # Internal Graphics P2P bridge 0x98e4
device pci 1.1 on end # Internal Multimedia
device pci 2.0 on end # PCIe Host Bridge
--
To view, visit https://review.coreboot.org/29342
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia396c7227cb21461ec8afbdf746721d4fb28083d
Gerrit-Change-Number: 29342
Gerrit-PatchSet: 1
Gerrit-Owner: Martin Roth <martinroth(a)google.com>
Jonathan Neuschäfer has posted comments on this change. ( https://review.coreboot.org/29339 )
Change subject: src/arch/riscv/misaligned.c: Fix an off-by-one error when loading the opcode
......................................................................
Patch Set 1: Code-Review+2
Thanks
--
To view, visit https://review.coreboot.org/29339
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2986ca5402ad86d80e0eb955478bfbdc5d50e1f5
Gerrit-Change-Number: 29339
Gerrit-PatchSet: 1
Gerrit-Owner: Philipp Hug <philipp(a)hug.cx>
Gerrit-Reviewer: Jonathan Neuschäfer <j.neuschaefer(a)gmx.net>
Gerrit-Reviewer: Philipp Hug <philipp(a)hug.cx>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Mon, 29 Oct 2018 19:28:02 +0000
Gerrit-HasComments: No
Gerrit-HasLabels: Yes
Jonathan Neuschäfer has posted comments on this change. ( https://review.coreboot.org/29340 )
Change subject: riscv: simplify timer interrupt handling
......................................................................
Patch Set 2:
I think this patch would be clearer without the formatting changes. Would you mind to split them out?
--
To view, visit https://review.coreboot.org/29340
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I5d693f872bd492c9d0017b514882a4cebd5ccadd
Gerrit-Change-Number: 29340
Gerrit-PatchSet: 2
Gerrit-Owner: Philipp Hug <philipp(a)hug.cx>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Jonathan Neuschäfer <j.neuschaefer(a)gmx.net>
Gerrit-Comment-Date: Mon, 29 Oct 2018 18:35:16 +0000
Gerrit-HasComments: No
Gerrit-HasLabels: No
Philipp Hug has uploaded a new patch set (#2). ( https://review.coreboot.org/29340 )
Change subject: riscv: simplify timer interrupt handling
......................................................................
riscv: simplify timer interrupt handling
Just disable the timer interrupt and notify supervisor.
To receive another timer interrupt just set timecmp and
enable machine mode timer interrupt again.
TEST=Run linux on sifive unleashed
Change-Id: I5d693f872bd492c9d0017b514882a4cebd5ccadd
Signed-off-by: Philipp Hug <philipp(a)hug.cx>
---
M src/arch/riscv/trap_handler.c
1 file changed, 45 insertions(+), 84 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/40/29340/2
--
To view, visit https://review.coreboot.org/29340
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I5d693f872bd492c9d0017b514882a4cebd5ccadd
Gerrit-Change-Number: 29340
Gerrit-PatchSet: 2
Gerrit-Owner: Philipp Hug <philipp(a)hug.cx>
Philipp Hug has uploaded this change for review. ( https://review.coreboot.org/29340
Change subject: riscv: simplify timer interrupt handling
......................................................................
riscv: simplify timer interrupt handling
Just disable the timer interrupt and notify supervisor.
To receive another timer interrupt just set timecmp and
enable machine mode timer interrupt again.
Change-Id: I5d693f872bd492c9d0017b514882a4cebd5ccadd
Signed-off-by: Philipp Hug <philipp(a)hug.cx>
---
M src/arch/riscv/trap_handler.c
1 file changed, 45 insertions(+), 84 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/40/29340/1
diff --git a/src/arch/riscv/trap_handler.c b/src/arch/riscv/trap_handler.c
index 772be64..c56dc0c 100644
--- a/src/arch/riscv/trap_handler.c
+++ b/src/arch/riscv/trap_handler.c
@@ -20,9 +20,6 @@
#include <string.h>
#include <vm.h>
-static uint64_t *time;
-static uint64_t *timecmp;
-
static const char *const exception_names[] = {
"Instruction address misaligned",
"Instruction access fault",
@@ -45,10 +42,14 @@
static const char *mstatus_to_previous_mode(uintptr_t ms)
{
switch (ms & MSTATUS_MPP) {
- case 0x00000000: return "user";
- case 0x00000800: return "supervisor";
- case 0x00001000: return "hypervisor";
- case 0x00001800: return "machine";
+ case 0x00000000:
+ return "user";
+ case 0x00000800:
+ return "supervisor";
+ case 0x00001000:
+ return "hypervisor";
+ case 0x00001800:
+ return "machine";
}
return "unknown";
@@ -64,76 +65,36 @@
if (tf->cause < ARRAY_SIZE(exception_names))
printk(BIOS_DEBUG, "Exception: %s\n",
- exception_names[tf->cause]);
+ exception_names[tf->cause]);
else
printk(BIOS_DEBUG, "Trap: Unknown cause %p\n",
- (void *)tf->cause);
+ (void *)tf->cause);
previous_mode = mstatus_to_previous_mode(read_csr(mstatus));
printk(BIOS_DEBUG, "Previous mode: %s%s\n",
- previous_mode, mprv? " (MPRV)":"");
+ previous_mode, mprv ? " (MPRV)" : "");
printk(BIOS_DEBUG, "Bad instruction pc: %p\n", (void *)tf->epc);
printk(BIOS_DEBUG, "Bad address: %p\n", (void *)tf->badvaddr);
- printk(BIOS_DEBUG, "Stored ra: %p\n", (void*) tf->gpr[1]);
- printk(BIOS_DEBUG, "Stored sp: %p\n", (void*) tf->gpr[2]);
-}
-
-static void gettimer(void)
-{
- /*
- * FIXME: This hard-coded value (currently) works on spike, but we
- * should really read it from the device tree.
- */
- uintptr_t clint = 0x02000000;
-
- time = (void *)(clint + 0xbff8);
- timecmp = (void *)(clint + 0x4000);
-
- if (!time)
- die("Got timer interrupt but found no timer.");
- if (!timecmp)
- die("Got timer interrupt but found no timecmp.");
+ printk(BIOS_DEBUG, "Stored ra: %p\n", (void *)tf->gpr[1]);
+ printk(BIOS_DEBUG, "Stored sp: %p\n", (void *)tf->gpr[2]);
}
static void interrupt_handler(trapframe *tf)
{
uint64_t cause = tf->cause & ~0x8000000000000000ULL;
- uint32_t msip, ssie;
switch (cause) {
case IRQ_M_TIMER:
- // The only way to reset the timer interrupt is to
- // write mtimecmp. But we also have to ensure the
- // comparison fails, for a long time, to let
- // supervisor interrupt handler compute a new value
- // and set it. Finally, it fires if mtimecmp is <=
- // mtime, not =, so setting mtimecmp to 0 won't work
- // to clear the interrupt and disable a new one. We
- // have to set the mtimecmp far into the future.
- // Akward!
- //
- // Further, maybe the platform doesn't have the
- // hardware or the payload never uses it. We hold off
- // querying some things until we are sure we need
- // them. What to do if we can not find them? There are
- // no good options.
+ /*
+ * Set interrupt pending for supervisor mode and disable timer
+ * interrupt in machine mode.
+ * To receive another timer interrupt just set timecmp and
+ * enable machine mode timer interrupt again.
+ */
- // This hart may have disabled timer interrupts. If
- // so, just return. Kernels should only enable timer
- // interrupts on one hart, and that should be hart 0
- // at present, as we only search for
- // "core{0{0{timecmp" above.
- ssie = read_csr(sie);
- if (!(ssie & SIP_STIP))
- break;
+ clear_csr(mie, MIP_MTIP);
+ set_csr(mip, MIP_STIP);
- if (!timecmp)
- gettimer();
- //printk(BIOS_SPEW, "timer interrupt\n");
- *timecmp = (uint64_t) -1;
- msip = read_csr(mip);
- msip |= SIP_STIP;
- write_csr(mip, msip);
break;
default:
printk(BIOS_EMERG, "======================================\n");
@@ -152,30 +113,30 @@
return;
}
- switch(tf->cause) {
- case CAUSE_MISALIGNED_FETCH:
- case CAUSE_FETCH_ACCESS:
- case CAUSE_ILLEGAL_INSTRUCTION:
- case CAUSE_BREAKPOINT:
- case CAUSE_LOAD_ACCESS:
- case CAUSE_STORE_ACCESS:
- case CAUSE_USER_ECALL:
- case CAUSE_SUPERVISOR_ECALL:
- case CAUSE_HYPERVISOR_ECALL:
- case CAUSE_MACHINE_ECALL:
- print_trap_information(tf);
- break;
- case CAUSE_MISALIGNED_LOAD:
- case CAUSE_MISALIGNED_STORE:
- print_trap_information(tf);
- handle_misaligned(tf);
- return;
- default:
- printk(BIOS_EMERG, "================================\n");
- printk(BIOS_EMERG, "coreboot: can not handle a trap:\n");
- printk(BIOS_EMERG, "================================\n");
- print_trap_information(tf);
- break;
+ switch (tf->cause) {
+ case CAUSE_MISALIGNED_FETCH:
+ case CAUSE_FETCH_ACCESS:
+ case CAUSE_ILLEGAL_INSTRUCTION:
+ case CAUSE_BREAKPOINT:
+ case CAUSE_LOAD_ACCESS:
+ case CAUSE_STORE_ACCESS:
+ case CAUSE_USER_ECALL:
+ case CAUSE_SUPERVISOR_ECALL:
+ case CAUSE_HYPERVISOR_ECALL:
+ case CAUSE_MACHINE_ECALL:
+ print_trap_information(tf);
+ break;
+ case CAUSE_MISALIGNED_LOAD:
+ case CAUSE_MISALIGNED_STORE:
+ print_trap_information(tf);
+ handle_misaligned(tf);
+ return;
+ default:
+ printk(BIOS_EMERG, "================================\n");
+ printk(BIOS_EMERG, "coreboot: can not handle a trap:\n");
+ printk(BIOS_EMERG, "================================\n");
+ print_trap_information(tf);
+ break;
}
die("Can't recover from trap. Halting.\n");
--
To view, visit https://review.coreboot.org/29340
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5d693f872bd492c9d0017b514882a4cebd5ccadd
Gerrit-Change-Number: 29340
Gerrit-PatchSet: 1
Gerrit-Owner: Philipp Hug <philipp(a)hug.cx>
Philipp Hug has posted comments on this change. ( https://review.coreboot.org/29339 )
Change subject: src/arch/riscv/misaligned.c: Fix an off-by-one error when loading the opcode
......................................................................
Patch Set 1:
Found this when I re-used this code for instruction emulation.
Not tested yet.
--
To view, visit https://review.coreboot.org/29339
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2986ca5402ad86d80e0eb955478bfbdc5d50e1f5
Gerrit-Change-Number: 29339
Gerrit-PatchSet: 1
Gerrit-Owner: Philipp Hug <philipp(a)hug.cx>
Gerrit-Reviewer: Jonathan Neuschäfer <j.neuschaefer(a)gmx.net>
Gerrit-Reviewer: Philipp Hug <philipp(a)hug.cx>
Gerrit-Comment-Date: Mon, 29 Oct 2018 17:11:10 +0000
Gerrit-HasComments: No
Gerrit-HasLabels: No