the following patch was just integrated into master:
commit 3322f8f5a5ce35ecc5f03ca56f587f1b85b04e78
Author: Patrick Georgi <patrick(a)georgi-clan.de>
Date: Fri Oct 7 23:01:55 2011 +0200
mptable: Refactor mptable generation some more
The last couple of lines of every mptable function were mostly
identical. Refactor into common code, a new function mptable_finalize.
Coccinelle script:
@@
identifier mc;
@@
(
-mc->mpe_checksum = smp_compute_checksum(smp_next_mpc_entry(mc), mc->mpe_length);
-mc->mpc_checksum = smp_compute_checksum(mc, mc->mpc_length);
-printk(BIOS_DEBUG, "Wrote the mp table end at: %p - %p\n", mc, smp_next_mpe_entry(mc));
-return smp_next_mpe_entry(mc);
+return mptable_finalize(mc);
|
-mc->mpe_checksum = smp_compute_checksum(smp_next_mpc_entry(mc), mc->mpe_length);
-mc->mpc_checksum = smp_compute_checksum(mc, mc->mpc_length);
-return smp_next_mpe_entry(mc);
+return mptable_finalize(mc);
)
Change-Id: Ib2270d800bdd486c5eb49b328544d36bd2298c9e
Signed-off-by: Patrick Georgi <patrick(a)georgi-clan.de>
See http://review.coreboot.org/246 for details.
-gerrit
the following patch was just integrated into master:
commit eae1696809d6e6834d08ef22aa08c8f200870c59
Author: Patrick Georgi <patrick(a)georgi-clan.de>
Date: Fri Oct 7 22:41:07 2011 +0200
mptable: Get rid of fixup_virtual_wire
As stated in some code files, fixup_virtual_wire was established
to avoid touching 200 invocations of the mptable code.
Let Coccinelle do it:
@@
type T;
identifier v;
@@
-void fixup_virtual_wire(T v)
-{ ... }
@@
expression A;
identifier v;
@@
-v = smp_write_floating_table(A);
+v = smp_write_floating_table(A, 0);
@@
expression A;
identifier v;
@@
-v = smp_write_floating_table(A, 0);
-fixup_virtual_wire(v);
+v = smp_write_floating_table(A, 1);
Change-Id: Icad8a063380bf4726be7cebb414d13b574112b14
Signed-off-by: Patrick Georgi <patrick(a)georgi-clan.de>
See http://review.coreboot.org/245 for details.
-gerrit
the following patch was just integrated into master:
commit 51caef5bb69445b65f4d7e468abe06bdb95de7b9
Author: Patrick Georgi <patrick(a)georgi-clan.de>
Date: Fri Oct 7 21:42:52 2011 +0200
mptable: Refactor lintsrc generation
We copied pretty much the same code for generating mptable entries for
local interrupts (with some notable exceptions).
This change moves these lines into a generic function "mptable_lintsrc"
and makes use of it in many places.
The remaining uses of smp_write_lintsrc should be reviewed and replaced
by mptable_lintsrc calls where possible, and smp_write_lintsrc made static.
This patch was generated using Coccinelle:
@@
expression mc;
expression isa_bus;
@@
-smp_write_lintsrc(mc, mp_ExtINT, MP_IRQ_TRIGGER_DEFAULT|MP_IRQ_POLARITY_DEFAULT, isa_bus, 0x0, MP_APIC_ALL, 0x0);
-smp_write_lintsrc(mc, mp_NMI, MP_IRQ_TRIGGER_DEFAULT|MP_IRQ_POLARITY_DEFAULT, isa_bus, 0x0, MP_APIC_ALL, 0x1);
+mptable_lintsrc(mc, isa_bus);
@@
expression mc;
expression isa_bus;
@@
-smp_write_lintsrc(mc, mp_ExtINT, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, isa_bus, 0x0, MP_APIC_ALL, 0x0);
-smp_write_lintsrc(mc, mp_NMI, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, isa_bus, 0x0, MP_APIC_ALL, 0x1);
+mptable_lintsrc(mc, isa_bus);
@m@
identifier mc;
expression BUS;
@@
-#define IO_LOCAL_INT(type, intr, apicid, pin) smp_write_lintsrc(mc, (type), MP_IRQ_TRIGGER_EDGE | MP_IRQ_POLARITY_HIGH, BUS, (intr), (apicid), (pin));
...
-IO_LOCAL_INT(mp_ExtINT, 0x0, MP_APIC_ALL, 0x0);
-IO_LOCAL_INT(mp_NMI, 0x0, MP_APIC_ALL, 0x1);
+mptable_lintsrc(mc, BUS);
Change-Id: I97421f820cd039f5fd753cb0da5c1cca68819bb4
Signed-off-by: Patrick Georgi <patrick(a)georgi-clan.de>
See http://review.coreboot.org/244 for details.
-gerrit
the following patch was just integrated into master:
commit 8125150119b0bcbf4ce588dc5c731365bbd362e4
Author: Rudolf Marek <r.marek(a)assembler.cz>
Date: Wed Oct 12 22:11:40 2011 +0200
Make Asus A8V-E SE better ACPI citizen.
Use the SSDT autogen infrastructure to support the automatic reserved resources,
automatic P-state generation and automatic _CRS PCI0 method.
Change-Id: Ic56a92eeb70a0a2a2d6de2507009ec3a832c83b3
Signed-off-by: Rudolf Marek <r.marek(a)assembler.cz>
See http://review.coreboot.org/251 for details.
-gerrit
Stefan Reinauer (stefan.reinauer(a)coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/259
-gerrit
commit 7f8e685996f65f2c67d1113fcfaab33ccc385da7
Author: Stefan Reinauer <reinauer(a)chromium.org>
Date: Wed Jun 1 14:01:46 2011 -0700
Load an IDT with NULL limit
Load an IDT with NULL limit to prevent the 16bit IDT being used
in protected mode before c_start.S sets up a 32bit IDT when entering
ram stage.
Signed-off-by: Stefan Reinauer <reinauer(a)google.com>
Change-Id: I8d048c894c863ac4971fcef8f065be6b899e1d3e
---
src/cpu/x86/16bit/entry16.inc | 15 ++++++++++++++-
src/cpu/x86/16bit/entry16.lds | 1 +
2 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/src/cpu/x86/16bit/entry16.inc b/src/cpu/x86/16bit/entry16.inc
index 1eb92c8..9f4c0e3 100644
--- a/src/cpu/x86/16bit/entry16.inc
+++ b/src/cpu/x86/16bit/entry16.inc
@@ -45,7 +45,6 @@ _start:
xorl %eax, %eax
movl %eax, %cr3 /* Invalidate TLB*/
-
/* Invalidating the cache here seems to be a bad idea on
* modern processors. Don't.
* If we are hyperthreaded or we have multiple cores it is bad,
@@ -55,6 +54,13 @@ _start:
* entry16.inc.
*/
+ /* Load an IDT with NULL limit to prevent the 16bit IDT being used
+ * in protected mode before c_start.S sets up a 32bit IDT when entering
+ * ram stage.
+ */
+ movw $nullidt_offset, %bx
+ lidt %cs:(%bx)
+
/* Note: gas handles memory addresses in 16 bit code very poorly.
* In particular it doesn't appear to have a directive allowing you
* associate a section or even an absolute offset with a segment register.
@@ -118,6 +124,13 @@ gdtptr16:
.word gdt_end - gdt -1 /* compute the table limit */
.long gdt /* we know the offset */
+.align 4
+.globl nullidt
+nullidt:
+ .word 0 /* limit */
+ .long 0
+ .word 0
+
.globl _estart
_estart:
.code32
diff --git a/src/cpu/x86/16bit/entry16.lds b/src/cpu/x86/16bit/entry16.lds
index 0580f0e..112d429 100644
--- a/src/cpu/x86/16bit/entry16.lds
+++ b/src/cpu/x86/16bit/entry16.lds
@@ -1 +1,2 @@
gdtptr16_offset = gdtptr16 & 0xffff;
+ nullidt_offset = nullidt & 0xffff;
Stefan Reinauer (stefan.reinauer(a)coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/257
-gerrit
commit 6faf97c0c1a10c44fbfebcd25d8b93967263fdfd
Author: Stefan Reinauer <reinauer(a)chromium.org>
Date: Wed Oct 12 14:35:54 2011 -0700
Fix native x86 option rom initialization
- Intel option roms want an initialized i8259 or they will
throw an exception 6. This should be done in the southbridge
code, but that is executed much later than the VGA init, so
initialize the i8259 in src/devices/oprom/x86.c.
In the long run this will allow getting rid of some of the
ugly hacks in some AMD boards' romstage.c
- Don't overwrite the mode when copying mode info information back
from 0x600.
Change-Id: Idb01f13dbcd736d8d830b222ffe1ea85799fcd9c
Signed-off-by: Stefan Reinauer <reinauer(a)google.com>
---
src/devices/oprom/x86.c | 25 ++++++++++++++-----------
1 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/src/devices/oprom/x86.c b/src/devices/oprom/x86.c
index 22fc2c5..4d7357c 100644
--- a/src/devices/oprom/x86.c
+++ b/src/devices/oprom/x86.c
@@ -27,6 +27,7 @@
#include <arch/interrupt.h>
#include <cbfs.h>
#include <delay.h>
+#include <pc80/i8259.h>
#include "x86.h"
#include "vbe.h"
#include "../../src/lib/jpeg.h"
@@ -70,14 +71,9 @@ static int intXX_exception_handler(struct eregs *regs)
{
printk(BIOS_INFO, "Oops, exception %d while executing option rom\n",
regs->vector);
-#if 0
- // Odd: The i945GM VGA oprom chokes on a pushl %eax and will
- // die with an exception #6 if we run the coreboot exception
- // handler. Just continue, as it executes fine.
x86_exception(regs); // Call coreboot exception handler
-#endif
- return 0; // Never returns?
+ return 0; // Never really returns
}
static int intXX_unknown_handler(struct eregs *regs)
@@ -186,17 +182,20 @@ static void setup_realmode_idt(void)
#if CONFIG_FRAMEBUFFER_SET_VESA_MODE
static u8 vbe_get_mode_info(vbe_mode_info_t * mode_info)
{
+ printk(BIOS_DEBUG, "Getting information about VESA mode %04x\n",
+ mode_info->video_mode);
char *buffer = (char *)&__buffer;
u16 buffer_seg = (((unsigned long)buffer) >> 4) & 0xff00;
u16 buffer_adr = ((unsigned long)buffer) & 0xffff;
realmode_interrupt(0x10, VESA_GET_MODE_INFO, 0x0000,
mode_info->video_mode, 0x0000, buffer_seg, buffer_adr);
- memcpy(mode_info, buffer, sizeof(vbe_mode_info_t));
+ memcpy(mode_info->mode_info_block, buffer, sizeof(vbe_mode_info_t));
return 0;
}
static u8 vbe_set_mode(vbe_mode_info_t * mode_info)
{
+ printk(BIOS_DEBUG, "Setting VESA mode %04x\n", mode_info->video_mode);
// request linear framebuffer mode
mode_info->video_mode |= (1 << 14);
// request clearing of framebuffer
@@ -216,9 +215,8 @@ void vbe_set_graphics(void)
mode_info.video_mode = (1 << 14) | CONFIG_FRAMEBUFFER_VESA_MODE;
vbe_get_mode_info(&mode_info);
unsigned char *framebuffer =
- (unsigned char *) le32_to_cpu(mode_info.vesa.phys_base_ptr);
+ (unsigned char *)mode_info.vesa.phys_base_ptr;
printk(BIOS_DEBUG, "framebuffer: %p\n", framebuffer);
- printk(BIOS_DEBUG, "framebuffer: %x\n", mode_info.vesa.phys_base_ptr);
vbe_set_mode(&mode_info);
#if CONFIG_BOOTSPLASH
struct jpeg_decdata *decdata;
@@ -242,8 +240,7 @@ void vbe_textmode_console(void)
void fill_lb_framebuffer(struct lb_framebuffer *framebuffer)
{
- framebuffer->physical_address =
- le32_to_cpu(mode_info.vesa.phys_base_ptr);
+ framebuffer->physical_address = mode_info.vesa.phys_base_ptr;
framebuffer->x_resolution = le16_to_cpu(mode_info.vesa.x_resolution);
framebuffer->y_resolution = le16_to_cpu(mode_info.vesa.y_resolution);
@@ -269,6 +266,12 @@ void run_bios(struct device *dev, unsigned long addr)
{
u32 num_dev = (dev->bus->secondary << 8) | dev->path.pci.devfn;
+ /* Setting up required hardware.
+ * Removing this will cause random illegal instruction exceptions
+ * in some option roms.
+ */
+ setup_i8259();
+
/* Set up BIOS Data Area */
setup_bda();