Alexandru Gagniuc (mr.nuke.me(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1245
-gerrit
commit fcb18c69526255bab8a8a57def996a709f66827d
Author: Alexandru Gagniuc <mr.nuke.me(a)gmail.com>
Date: Fri Jul 20 00:11:21 2012 -0500
buildsystem: Make CPU microcode updating more configurable
This patch aims to improve the microcode in CBFS handling that was
brought by the last patches from Stefan and the Chromium team.
Choices in Kconfig
- 1) Generate microcode from tree (default)
- 2) Include external microcode file
- 3) Do not put microcode in CBFS
The idea is to give the user full control over including non-free
blobs in the final ROM image.
MICROCODE_INCLUDE_PATH Kconfig variable is eliminated. Microcode
is handled by a special class, cpu_microcode, as such:
cpu_microcode-y += microcode_file.c
MICROCODE_IN_CBFS should, in the future, be eliminated. Right now it is
needed by intel microcode updating. Once all intel cpus are converted to
cbfs updating, this variable can go away.
These files are then compiled and assembled into a binary CBFS file.
The advantage of doing it this way versus the current method is that
1) The rule is CPU-agnostic
2) Gives user more control over if and how to include microcode blobs
3) The rules for building the microcode binary are kept in
src/cpu/Makefile.inc, and thus would not clobber the other makefiles,
which are already overloaded and very difficult to navigate.
Change-Id: I38d0c9851691aa112e93031860e94895857ebb76
Signed-off-by: Alexandru Gagniuc <mr.nuke.me(a)gmail.com>
---
Makefile.inc | 2 +-
src/arch/x86/Makefile.inc | 28 ++++------
src/cpu/Kconfig | 88 ++++++++++++++++++++++++++++--
src/cpu/Makefile.inc | 37 +++++++++++++
src/cpu/intel/microcode/Makefile.inc | 20 ++-----
src/cpu/intel/microcode/microcode.c | 8 +--
src/cpu/intel/microcode/microcode_blob.c | 22 --------
src/cpu/intel/model_206ax/Kconfig | 2 +-
src/cpu/intel/model_206ax/Makefile.inc | 2 +
src/cpu/intel/model_206ax/microcode_blob.c | 22 ++++++++
src/include/cpu/intel/microcode.h | 2 +-
11 files changed, 169 insertions(+), 64 deletions(-)
diff --git a/Makefile.inc b/Makefile.inc
index adc41bf..bcf0e6e 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -59,7 +59,7 @@ subdirs-y += site-local
#######################################################################
# Add source classes and their build options
-classes-y := ramstage romstage driver smm
+classes-y := ramstage romstage driver smm cpu_microcode
romstage-c-ccopts:=-D__PRE_RAM__
romstage-S-ccopts:=-D__PRE_RAM__
diff --git a/src/arch/x86/Makefile.inc b/src/arch/x86/Makefile.inc
index 71d359f..a1f914f 100644
--- a/src/arch/x86/Makefile.inc
+++ b/src/arch/x86/Makefile.inc
@@ -1,6 +1,8 @@
+################################################################################
##
## This file is part of the coreboot project.
##
+## Copyright (C) 2012 Alexandru Gagniuc <mr.nuke.me(a)gmail.com>
## Copyright (C) 2009-2010 coresystems GmbH
## Copyright (C) 2009 Ronald G. Minnich
##
@@ -17,8 +19,8 @@
## along with this program; if not, write to the Free Software
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
##
+################################################################################
-#######################################################################
# Take care of subdirectories
subdirs-y += boot
# subdirs-y += init
@@ -34,13 +36,7 @@ cmos_layout.bin-type = 0x01aa
OPTION_TABLE_H:=$(obj)/option_table.h
endif
-ifeq ($(CONFIG_MICROCODE_IN_CBFS),y)
-cbfs-files-y += microcode_blob.bin
-microcode_blob.bin-file = $(obj)/microcode_blob.bin
-microcode_blob.bin-type = 0x53
-endif
-
-#######################################################################
+################################################################################
# Build the final rom image
COREBOOT_ROM_DEPENDENCIES:=
ifeq ($(CONFIG_PAYLOAD_ELF),y)
@@ -125,7 +121,7 @@ cbfs-files-$(CONFIG_BOOTSPLASH) += bootsplash.jpg
bootsplash.jpg-file := $(call strip_quotes,$(CONFIG_BOOTSPLASH_FILE))
bootsplash.jpg-type := bootsplash
-#######################################################################
+################################################################################
# i386 specific tools
NVRAMTOOL:=$(objutil)/nvramtool/nvramtool
@@ -137,7 +133,7 @@ $(obj)/cmos_layout.bin: $(NVRAMTOOL) $(top)/src/mainboard/$(MAINBOARDDIR)/cmos.l
@printf " OPTION $(subst $(obj)/,,$(@))\n"
$(NVRAMTOOL) -y $(top)/src/mainboard/$(MAINBOARDDIR)/cmos.layout -L $@
-#######################################################################
+################################################################################
# Common recipes for all stages
$(objcbfs)/%.bin: $(objcbfs)/%.elf
@@ -152,7 +148,7 @@ $(objcbfs)/%.elf: $(objcbfs)/%.debug
$(OBJCOPY) --add-gnu-debuglink=$< $@.tmp
mv $@.tmp $@
-#######################################################################
+################################################################################
# Build the coreboot_ram (stage 2)
$(objcbfs)/coreboot_ram.debug: $(objgenerated)/coreboot_ram.o $(src)/arch/x86/coreboot_ram.ld
@@ -176,7 +172,7 @@ $(objgenerated)/ramstage.a: $$(ramstage-objs)
rm -f $@
$(AR) cr $@ $^
-#######################################################################
+################################################################################
# Ramstage for AP CPU (AMD K8, obsolete?)
$(objcbfs)/coreboot_ap.debug: $(objgenerated)/coreboot_ap.o $(src)/arch/x86/init/ldscript_apc.lb
@@ -187,7 +183,7 @@ $(objgenerated)/coreboot_ap.o: $(src)/mainboard/$(MAINBOARDDIR)/ap_romstage.c $(
@printf " CC $(subst $(obj)/,,$(@))\n"
$(CC) -MMD $(CFLAGS) -I$(src) -D__PRE_RAM__ -I. -I$(obj) -c $< -o $@
-#######################################################################
+################################################################################
# done
crt0s = $(src)/arch/x86/init/prologue.inc
@@ -266,7 +262,7 @@ ifeq ($(CONFIG_HAVE_BUS_CONFIG),y)
ramstage-srcs += src/mainboard/$(MAINBOARDDIR)/get_bus_conf.c
endif
-#######################################################################
+################################################################################
# Build the final rom image
$(obj)/coreboot.pre: $(objcbfs)/romstage_xip.elf $(obj)/coreboot.pre1 $(CBFSTOOL)
@@ -276,7 +272,7 @@ $(obj)/coreboot.pre: $(objcbfs)/romstage_xip.elf $(obj)/coreboot.pre1 $(CBFSTOOL
$(CONFIG_CBFS_PREFIX)/romstage x $(shell cat $(objcbfs)/base_xip.txt)
mv $@.tmp $@
-#######################################################################
+################################################################################
# Build the bootblock
bootblock_lds = $(src)/arch/x86/init/ldscript_failover.lb
@@ -333,7 +329,7 @@ else
$(CC) -nostdlib -nostartfiles -static -o $@ -L$(obj) -T $(objgenerated)/bootblock.ld $<
endif
-#######################################################################
+################################################################################
# Build the romstage
$(objcbfs)/romstage_null.debug: $$(romstage-objs) $(objgenerated)/romstage_null.ld
diff --git a/src/cpu/Kconfig b/src/cpu/Kconfig
index baf686e..1ed721f 100644
--- a/src/cpu/Kconfig
+++ b/src/cpu/Kconfig
@@ -62,10 +62,90 @@ config SSE2
streaming SIMD instructions. Some parts of coreboot can be built
with more efficient code if SSE2 instructions are available.
-config MICROCODE_IN_CBFS
- bool "Look for microcode in CBFS"
+endif # ARCH_X86
+
+config CPU_MICROCODE_IN_CBFS
+ bool
default n
+
+choice
+ prompt "Include CPU microcode in CBFS"
+ default CPU_MICROCODE_CBFS_GENERATE if CPU_MICROCODE_IN_CBFS
+ default CPU_MICROCODE_CBFS_NONE if !CPU_MICROCODE_IN_CBFS
+
+config CPU_MICROCODE_CBFS_GENERATE
+ bool "Generate from tree"
help
- Load microcode updates from CBFS instead of compiling them in.
+ Select this option if you want microcode updates to be assembled when
+ building coreboot and included in the final image as a separate CBFS
+ file. Microcode will not be hard-coded into ramstage.
-endif # ARCH_X86
+ The microcode file and may be removed from the ROM image at a later
+ time with cbfstool, if desired.
+
+ If unsure, select this option.
+
+config CPU_MICROCODE_CBFS_EXTERNAL
+ bool "Include external microcode file"
+ help
+ Select this option if you want to include an external file containing
+ the CPU microcode. This will be included as a separate file in CBFS.
+ A word of caution: only select this option if you are sure the
+ microcode that you have is newer than the microcode shipping with
+ coreboot.
+
+ The microcode file and may be removed from the ROM image at a later
+ time with cbfstool, if desired.
+
+ If unsure, select "Generate from tree"
+
+config CPU_MICROCODE_FILE
+ string "Path and filename of CPU microcode"
+ depends on CPU_MICROCODE_CBFS_EXTERNAL
+ default "cpu_microcode.bin"
+ help
+ The path and filename of the file containing the CPU microcode.
+
+config CPU_MICROCODE_CBFS_NONE
+ bool "Do not include microcode updates"
+ help
+ Select this option if you do not want CPU microcode included in CBFS.
+ Note that for some CPUs, the microcode is hard-coded into the source
+ tree and is not loaded from CBFS. In this case, microcode will still
+ be updated. There is a push to move all microcode to CBFS, but this
+ change is not implemented for all CPUs.
+
+ This option currently applies to:
+ - Intel SandyBridge/IvyBridge
+ - VIA Nano
+
+ Microcode may be added to the ROM image at a later time with cbfstool,
+ if desired.
+
+ If unsure, select "Generate from tree"
+
+ The GOOD:
+ Microcode updates intend to solve issues that have been discovered
+ after CPU production. The expected effect is that systems work as
+ intended with the updated microcode, but we have also seen cases where
+ issues were solved by not applying microcode updates.
+
+ The BAD:
+ Note that some operating system include these same microcode patches,
+ so you may need to also disable microcode updates in your operating
+ system for this option to have an effect.
+
+ The UGLY:
+ A word of CAUTION: some CPUs depend on microcode updates to function
+ correctly. Not updating the microcode may leave the CPU operating at
+ less than optimal performance, or may cause outright hangups.
+ There are CPUs where coreboot cannot properly initialize the CPU
+ without microcode updates
+ For example, if running with the factory microcode, some Intel
+ SandyBridge CPUs may hang when enabling CAR, or some VIA Nano CPUs
+ will hang when changing the frequency.
+
+ Make sure you have a way of flashing the ROM externally before
+ selecting this option.
+
+endchoice
diff --git a/src/cpu/Makefile.inc b/src/cpu/Makefile.inc
index 57273cf..938a8df 100644
--- a/src/cpu/Makefile.inc
+++ b/src/cpu/Makefile.inc
@@ -1,3 +1,40 @@
+################################################################################
+## Subdirectories
+################################################################################
subdirs-y += amd
subdirs-y += intel
subdirs-y += via
+
+################################################################################
+## Rules for building the microcode blob in CBFS
+################################################################################
+
+ifneq ($(CONFIG_CPU_MICROCODE_CBFS_NONE), y)
+
+cbfs-files-y += cpu_microcode_blob.bin
+
+cpu_microcode_blob.bin-type = 0x53
+
+# External microcode file, or are we generating one ?
+ifeq ($(CONFIG_CPU_MICROCODE_CBFS_EXTERNAL), y)
+cpu_microcode_blob.bin-file = $(call strip_quotes,$(CONFIG_CPU_MICROCODE_FILE))
+else
+cpu_microcode_blob.bin-file = $(obj)/cpu_microcode_blob.bin
+endif
+
+# In case we have more than one "source" (cough) files containing microcode, we
+# Link them together in one large blob, so that we get all the microcode updates
+# in one file. This makes it easier for objcopy in the final step.
+# The --entry=0 is just here to suppress the LD warning. It does not affect the
+# final microcode file.
+$(obj)/cpu_microcode_blob.o: $$(cpu_microcode-objs)
+ @printf " LD $(subst $(obj)/,,$(@))\n"
+ $(LD) -static --entry=0 $< -o $@
+
+# We have a lot of useless data in the large blob, and we are only interested in
+# the data section, so we only copy that part to the final microcode file
+$(obj)/cpu_microcode_blob.bin: $(obj)/cpu_microcode_blob.o
+ @printf " MICROCODE $(subst $(obj)/,,$(@))\n"
+ $(OBJCOPY) -j .data -O binary $< $@
+
+endif
diff --git a/src/cpu/intel/microcode/Makefile.inc b/src/cpu/intel/microcode/Makefile.inc
index f4d0102..22655c9 100644
--- a/src/cpu/intel/microcode/Makefile.inc
+++ b/src/cpu/intel/microcode/Makefile.inc
@@ -1,15 +1,5 @@
-ramstage-y += microcode.c
-
-
-ifeq ($(CONFIG_MICROCODE_IN_CBFS),y)
-
-SRC_PATH = src/cpu/intel/microcode
-FLAGS = -I $(CONFIG_MICROCODE_INCLUDE_PATH) -include $(obj)/config.h
-$(obj)/microcode_blob.o: $(SRC_PATH)/microcode_blob.c
- $(CC) $(FLAGS) -MMD -c -o $@ $<
-
-$(obj)/microcode_blob.bin: $(obj)/microcode_blob.o
- objcopy -j .data -O binary $< $@
-
--include $(obj)/microcode_blob.d
-endif
+################################################################################
+## One small file with the awesome super-power of updating the cpu microcode
+## directly from CBFS. You have been WARNED!!!
+################################################################################
+ramstage-y += microcode.c
\ No newline at end of file
diff --git a/src/cpu/intel/microcode/microcode.c b/src/cpu/intel/microcode/microcode.c
index e84bad9..a4471ca 100644
--- a/src/cpu/intel/microcode/microcode.c
+++ b/src/cpu/intel/microcode/microcode.c
@@ -28,7 +28,7 @@
#include <cpu/x86/msr.h>
#include <cpu/intel/microcode.h>
-#if CONFIG_MICROCODE_IN_CBFS
+#if CONFIG_CPU_MICROCODE_IN_CBFS
#ifdef __PRE_RAM__
#include <arch/cbfs.h>
#else
@@ -77,7 +77,7 @@ static inline u32 read_microcode_rev(void)
return msr.hi;
}
-#if CONFIG_MICROCODE_IN_CBFS
+#if CONFIG_CPU_MICROCODE_IN_CBFS
static
#endif
void intel_update_microcode(const void *microcode_updates)
@@ -144,9 +144,9 @@ void intel_update_microcode(const void *microcode_updates)
}
}
-#if CONFIG_MICROCODE_IN_CBFS
+#if CONFIG_CPU_MICROCODE_IN_CBFS
-#define MICROCODE_CBFS_FILE "microcode_blob.bin"
+#define MICROCODE_CBFS_FILE "cpu_microcode_blob.bin"
void intel_update_microcode_from_cbfs(void)
{
diff --git a/src/cpu/intel/microcode/microcode_blob.c b/src/cpu/intel/microcode/microcode_blob.c
deleted file mode 100644
index 69238a9..0000000
--- a/src/cpu/intel/microcode/microcode_blob.c
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2012 The ChromiumOS Authors. All rights reserved.
- *
- * 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
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-unsigned microcode[] = {
-#include <microcode_blob.h>
-};
diff --git a/src/cpu/intel/model_206ax/Kconfig b/src/cpu/intel/model_206ax/Kconfig
index 6635868..5c543b8 100644
--- a/src/cpu/intel/model_206ax/Kconfig
+++ b/src/cpu/intel/model_206ax/Kconfig
@@ -12,7 +12,7 @@ config CPU_SPECIFIC_OPTIONS
select SSE2
select UDELAY_LAPIC
select SMM_TSEG
- select MICROCODE_IN_CBFS
+ select CPU_MICROCODE_IN_CBFS
#select AP_IN_SIPI_WAIT
select TSC_SYNC_MFENCE
diff --git a/src/cpu/intel/model_206ax/Makefile.inc b/src/cpu/intel/model_206ax/Makefile.inc
index e9b8e6d..6ab4840 100644
--- a/src/cpu/intel/model_206ax/Makefile.inc
+++ b/src/cpu/intel/model_206ax/Makefile.inc
@@ -5,4 +5,6 @@ ramstage-$(CONFIG_GENERATE_ACPI_TABLES) += acpi.c
smm-$(CONFIG_HAVE_SMI_HANDLER) += finalize.c
+cpu_microcode-$(CONFIG_CPU_MICROCODE_CBFS_GENERATE) += microcode_blob.c
+
cpu_incs += $(src)/cpu/intel/model_206ax/cache_as_ram.inc
diff --git a/src/cpu/intel/model_206ax/microcode_blob.c b/src/cpu/intel/model_206ax/microcode_blob.c
new file mode 100644
index 0000000..c2538e8
--- /dev/null
+++ b/src/cpu/intel/model_206ax/microcode_blob.c
@@ -0,0 +1,22 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2012 The ChromiumOS Authors. All rights reserved.
+ *
+ * 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
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+unsigned microcode[] = {
+#include "microcode_blob.h"
+};
diff --git a/src/include/cpu/intel/microcode.h b/src/include/cpu/intel/microcode.h
index 289e919..e9c13f9 100644
--- a/src/include/cpu/intel/microcode.h
+++ b/src/include/cpu/intel/microcode.h
@@ -21,7 +21,7 @@
#define __CPU__INTEL__MICROCODE__
#ifndef __PRE_RAM__
-#if CONFIG_MICROCODE_IN_CBFS
+#if CONFIG_CPU_MICROCODE_IN_CBFS
void intel_update_microcode_from_cbfs(void);
#else
void intel_update_microcode(const void *microcode_updates);
Alexandru Gagniuc (mr.nuke.me(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1481
-gerrit
commit 43105b710f281d0ee1985f64d0eb94fbdb74a0f2
Author: Alexandru Gagniuc <mr.nuke.me(a)gmail.com>
Date: Wed Aug 22 19:12:49 2012 -0500
ioapic driver: typedef the ioapic_config struct (TRIVIAL)
I use the ioapic_config in my VX900 branch.
Typing:
struct drivers_generic_ioapic_config *config = (struct drivers_generic_ioapic_config *)dev->chip_info;
is clumsy at best, so just create a typedef to mahe this more elegant:
ioapic_config_t config = (ioapic_config_t)ioapic->chip_info;
Change-Id: I407899845cfbd847ba6309dd0cf9ef836a607c8e
Signed-off-by: Alexandru Gagniuc <mr.nuke.me(a)gmail.com>
---
src/drivers/generic/ioapic/chip.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/drivers/generic/ioapic/chip.h b/src/drivers/generic/ioapic/chip.h
index ad6ff0b..007c521 100644
--- a/src/drivers/generic/ioapic/chip.h
+++ b/src/drivers/generic/ioapic/chip.h
@@ -2,6 +2,7 @@
* This file is part of the coreboot project.
*
* Copyright (C) 2011 Sven Schnelle <svens(a)stackframe.org>
+ * Copyright (C) 2012 Alexandru Gagniuc <mr.nuke.me(a)gmail.com>
*
* 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
@@ -28,4 +29,6 @@ struct drivers_generic_ioapic_config {
u8 have_isa_interrupts;
u32 base;
};
+
+typedef struct drivers_generic_ioapic_config *ioapic_config_t;
#endif
Alexandru Gagniuc (mr.nuke.me(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1481
-gerrit
commit 6825716c0e9c7854e1990751cd19d25267eed84a
Author: Alexandru Gagniuc <mr.nuke.me(a)gmail.com>
Date: Wed Aug 22 19:12:49 2012 -0500
ioapic driver: typedef the ioapic_config struct (TRIVIAL)
I use the ioapic_config in my VX900 branch.
Typing:
struct drivers_generic_ioapic_config *config = (struct drivers_generic_ioapic_config *)dev->chip_info;
is clumsy at best, so just create a typedef to mahe this more elegant:
ioapic_config_t config = (ioapic_config_t)ioapic->chip_info;
Change-Id: I407899845cfbd847ba6309dd0cf9ef836a607c8e
Signed-off-by: Alexandru Gagniuc <mr.nuke.me(a)gmail.com>
---
src/drivers/generic/ioapic/chip.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/drivers/generic/ioapic/chip.h b/src/drivers/generic/ioapic/chip.h
index ad6ff0b..1d7a03e 100644
--- a/src/drivers/generic/ioapic/chip.h
+++ b/src/drivers/generic/ioapic/chip.h
@@ -2,6 +2,7 @@
* This file is part of the coreboot project.
*
* Copyright (C) 2011 Sven Schnelle <svens(a)stackframe.org>
+ * Copyright (C) 2012 Alexandru Gagniuc <mr.nuke.me(a)gmail.com>
*
* 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
@@ -20,6 +21,7 @@
#ifndef DRIVERS_GENERIC_IOAPIC_CHIP_H
#define DRIVERS_GENERIC_IOAPIC_CHIP_H
+extern struct chip_operations drivers_generic_ioapic_ops;
struct drivers_generic_ioapic_config {
u32 version;
u8 apicid;
@@ -28,4 +30,6 @@ struct drivers_generic_ioapic_config {
u8 have_isa_interrupts;
u32 base;
};
+
+typedef struct drivers_generic_ioapic_config *ioapic_config_t;
#endif
Alexandru Gagniuc (mr.nuke.me(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1479
-gerrit
commit 570f1880b5c03d2c3db2346b04ef74217a8439e7
Author: Alexandru Gagniuc <mr.nuke.me(a)gmail.com>
Date: Wed Aug 22 11:19:08 2012 -0500
lumpy: fix automatic build
Adding auto MPTABLE geeration broke the build. Not because of Sven,
but because the stupid buildsystem _requires_ an empty mptable.c.
Fix that.
Change-Id: I85aa669225d7a7c3db0c9bedd64722dedbb97c36
Signed-off-by: Alexandru Gagniuc <mr.nuke.me(a)gmail.com>
---
src/mainboard/samsung/lumpy/mptable.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/src/mainboard/samsung/lumpy/mptable.c b/src/mainboard/samsung/lumpy/mptable.c
new file mode 100644
index 0000000..dcbc95a
--- /dev/null
+++ b/src/mainboard/samsung/lumpy/mptable.c
@@ -0,0 +1,19 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2012 Alexandru Gagniuc <mr.nuke.me(a)gmail.com>
+ * Copyright (C) 2012 The Mighty Alien Dwarf <the.mighty.alien.dwarf(a)gmail.com>
+ *
+ * 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
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
\ No newline at end of file
Christian Gmeiner (christian.gmeiner(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1478
-gerrit
commit 178269b5a7c279a3c798ba9648c4c6f5355048a2
Author: Christian Gmeiner <christian.gmeiner(a)gmail.com>
Date: Wed Aug 22 16:59:02 2012 +0200
Add possibility to patch VGA oprom
In some rare cases it could be useful to patch a VGA oprom in order
to fix some stuff. In later patches this will be used to add EDID
information to SeaVIDEOBIOS in oder to support some flat panels.
Change-Id: Ic1005053265505a65b6fd99bc3c6c9cfcbffee43
Signed-off-by: Christian Gmeiner <christian.gmeiner(a)gmail.com>
---
src/devices/pci_rom.c | 7 +++++++
src/include/device/pci_rom.h | 3 +++
2 files changed, 10 insertions(+)
diff --git a/src/devices/pci_rom.c b/src/devices/pci_rom.c
index fe67515..1135d94 100644
--- a/src/devices/pci_rom.c
+++ b/src/devices/pci_rom.c
@@ -162,6 +162,13 @@ struct rom_header *pci_rom_load(struct device *dev,
memcpy((void *)PCI_VGA_RAM_IMAGE_START, rom_header,
rom_size);
}
+
+ /* In some cases it is useful to patch an pci vga oprom. A good example
+ * is adding/changing some EDID information stored in the VGA option rom.
+ */
+ if (pci_vga_rom_patch)
+ pci_vga_rom_patch(rom_data, (void *)PCI_VGA_RAM_IMAGE_START);
+
return (struct rom_header *) (PCI_VGA_RAM_IMAGE_START);
}
diff --git a/src/include/device/pci_rom.h b/src/include/device/pci_rom.h
index fe77276..690e304 100644
--- a/src/include/device/pci_rom.h
+++ b/src/include/device/pci_rom.h
@@ -37,4 +37,7 @@ struct rom_header *pci_rom_probe(struct device *dev);
struct rom_header *pci_rom_load(struct device *dev, struct rom_header *rom_header);
u32 __attribute__((weak)) map_oprom_vendev(u32 vendev);
+void __attribute__((weak))
+pci_vga_rom_patch(struct pci_data *rom_data, void *pci_vga_ram_image_start);
+
#endif
Christian Gmeiner (christian.gmeiner(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1478
-gerrit
commit d7bdd498d6ed6cbf39c72b15ea24887303740310
Author: Christian Gmeiner <christian.gmeiner(a)gmail.com>
Date: Wed Aug 22 16:51:32 2012 +0200
Add possibility to patch VGA oprom
In some rare cases it could be useful to patch a VGA oprom in order
to fix some stuff. In later patches this will be used to add EDID
information to SeaVIDEOBIOS in oder to support some flat panels.
Change-Id: Ic1005053265505a65b6fd99bc3c6c9cfcbffee43
Signed-off-by: Christian Gmeiner <christian.gmeiner(a)gmail.com>
---
src/devices/pci_rom.c | 9 ++++++++-
src/include/device/pci_rom.h | 3 +++
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/src/devices/pci_rom.c b/src/devices/pci_rom.c
index fe67515..95f8b3b 100644
--- a/src/devices/pci_rom.c
+++ b/src/devices/pci_rom.c
@@ -161,7 +161,14 @@ struct rom_header *pci_rom_load(struct device *dev,
PCI_VGA_RAM_IMAGE_START, rom_size);
memcpy((void *)PCI_VGA_RAM_IMAGE_START, rom_header,
rom_size);
- }
+ }git commit --amend -m
+
+ /* In some cases it is useful to patch an pci vga oprom. A good example
+ * is adding/changing some EDID information stored in the VGA option rom.
+ */
+ if (pci_vga_rom_patch)
+ pci_vga_rom_patch(rom_data, (void *)PCI_VGA_RAM_IMAGE_START);
+
return (struct rom_header *) (PCI_VGA_RAM_IMAGE_START);
}
diff --git a/src/include/device/pci_rom.h b/src/include/device/pci_rom.h
index fe77276..690e304 100644
--- a/src/include/device/pci_rom.h
+++ b/src/include/device/pci_rom.h
@@ -37,4 +37,7 @@ struct rom_header *pci_rom_probe(struct device *dev);
struct rom_header *pci_rom_load(struct device *dev, struct rom_header *rom_header);
u32 __attribute__((weak)) map_oprom_vendev(u32 vendev);
+void __attribute__((weak))
+pci_vga_rom_patch(struct pci_data *rom_data, void *pci_vga_ram_image_start);
+
#endif
On Tue, Aug 21, 2012 at 04:57:56PM +0200, Christian Gmeiner wrote:
> 2012/8/21 Christian Gmeiner <christian.gmeiner(a)gmail.com>:
> > Hi all,
> >
> > my vacation is over and I need to look in some stuff deeper to finally
> > get the combination coreboot/seabios fully working. The only missing part
> > aside from a lot of testing is the video bios stuff. Here I am working on
> > a patch series to extend seabios vga option rom to support flat panels.
> >
> > I would like to to use EPI (http://www.epi-standard.org/) for the description
> > of the panels. Due EOL changes my target hardware supports different
> > kind of flat panels (with different timings). I can detect what panel is used
> > with the help of an i2c eeprom. So the normal CBFS will be extended by
> > n EPI raw files. And here the troubles begins :)
> >
> > 1) Can I add symbolic links during runtime
> >
> > It would be fine if somewhere during the boot (coreboot or seabios) I
> > can readout
> > the needed bytes from the eeprom, decide which EPI file to use and create
> > something line a symlink to the choosen one.
> >
> > panel.epi -> 640_480_panel_name.epi
I don't know of anyway to do this. The effort to implement this would
probably be large.
> As I found out this can be done via nvram. So coreboot set the filename of the
> EPI file to use and seabios/... etc can simply use it.
Using CMOS for passing temporary variables around is quite ugly. I'd
recommend against it.
> > 2) Can I load a CBFS file in the option rom?
> >
> > The idea is to load the EPI raw file and provide it via VBE (vbe_104f15) BIOS
> > call. So the geode lx option rom can read out the timing informations via VBE
> > and setup the video mode.
It's possible. However, the vgabios currently runs in 16bit mode.
Getting the existing CBFS code to run in 16bit mode would be a pain.
Probably better to convert the vgabios init phase to jump into 32bit
mode. However, that is a bit of work.
> It could also be possible to store the EPI data at a defined memory
> area where the
> option rom can simply check for existing identifiers and checksum.
I'd recommend against that - magic areas of memory have been quite
troublesome in the past.
> Any hints are really welcome.
I'm not sure I fully understand your requirements. Will the board
truly have different flat screens hooked up to it? One can't simply
compile the EPI info into the BIOS? Also, if you have to interrogate
the display via i2c, can you simply fully generate the EPI info in the
vgabios at runtime?
-Kevin