coreboot.git
12 years agoMTRR: add alternate allocation method for odd memory maps
Duncan Laurie [Thu, 22 Dec 2011 18:59:40 +0000 (10:59 -0800)]
MTRR: add alternate allocation method for odd memory maps

With >= 4GB memory installed we get a memory map split in the middle
due to remap that has boundaries that are inconveniently aligned for
MTRRs due to the various UMA regions.

0000MB-2780MB  2780MB  RAM     (writeback)
2780MB-2782MB     2MB  TSEG    (uncached/SMRR)
2782MB-2784MB     2MB  GFX GTT (uncached)
2784MB-2816MB    32MB  GFX UMA (uncached)
2816MB-4096MB  1280MB  EMPTY   (N/A)
4096MB-5368MB  1272MB  RAM     (writeback)
5368MB-5376MB     8MB  ME UMA  (uncached)

The default MTRR allocation method of trying to cover everything
with one MTRR and then carve out a single uncached region does
not work for the GPU aperture which needs write-combining type,
and it also has issues trying to cover the uneven boundaries
in the avaiable variable MTRRs.

My goal was to make a minimal set of changes and avoid modifying
behavior on existing systems with an algorithm that is not always
optimal for a typical memory layout.  So the flag 'above4gb=2'
will change these allocation behaviors:

1) Detect the number of available variable MTRRs rather than
limiting to hardcoded value.  We need every last MTRR.

2) Don't try to cover all RAM with one MTRR, instead let each
RAM region get covered independently.

3) Don't assume uma_memory_base is part of the last region
and increase the size of that region.  In this case the UMA
region is carved out from the lower memory region and it is
already declared as part of the ram region.

4) If a memory region can't be covered with MTRRs >= 16MB then
instead make a larger region and trim it with uncached MTRRs.

Change-Id: I5a60a44ab6d3ae2f46ea6ffa9e3677aaad2485eb
Signed-off-by: Duncan Laurie <dlaurie@google.com>
Reviewed-on: http://review.coreboot.org/761
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
12 years agoDon't re-init EBDA in S3 resume path.
Duncan Laurie [Wed, 18 Jan 2012 18:05:18 +0000 (10:05 -0800)]
Don't re-init EBDA in S3 resume path.

I forgot to implement this the first time around.

It does not seem to cause noticeable problems but
in heavy suspend/resume testing I saw a suspicious
crash in the kernel when trying to bring one of the
CPUs back online.

Change-Id: I950ac260f251e2683693d9bd20a0dd5e041aa26e
Signed-off-by: Duncan Laurie <dlaurie@google.com>
Reviewed-on: http://review.coreboot.org/770
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
12 years agoPrepare the BIOS data areas before device init.
Duncan Laurie [Tue, 17 Jan 2012 17:03:11 +0000 (09:03 -0800)]
Prepare the BIOS data areas before device init.

Since we do not run option roms in normal mode nothing was
initializing the BDA/EBDA and yet Linux depends very much
on it having sane values here.  For the most part the kernel
tries to work around this not being initialized, but every
once in awhile (1/300 boots or so) it would end up reading
something that looked sane from BDA but was not and then
it would panic.

In this change the EBDA is unconditionally setup before devices
are initialized.  I'm not set on the location in dev_initialize()
but there does not seem to be another place to hook it in so
that it runs just once for ALL platforms regardless of whether
they use option roms or not. (possibly hardwaremain?)

The EBDA setup code has been moved into its own location in
arch/x86/lib/ebda.c so it can be compiled in even if the option
rom code is not.

The low memory size is still set to 1MB which is enough to make
linux happy without having to hook into each mainboard to get a
more appropriate value.  The setup_ebda() function takes inputs
so it could be changed for a mainboard if needed.

OLD/BROKEN would read garbage.  Examples from different boots:
ebda_addr=0x75e80 lowmem=0x1553400
ebda_addr=0x5e080 lowmem=0x3e51400
ebda_addr=0x7aa80 lowmem=0x2f8a800

NEW/FIXED now reads consistent values:
ebda_addr=0xf6000 lowmem=0x100000

Change-Id: I6cb79f0e3e43cc65f7e5fe98b6cad1a557ccd949
Signed-off-by: Duncan Laurie <dlaurie@google.com>
Reviewed-on: http://review.coreboot.org/769
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
12 years agovga_io.c is not needed unless CONFIG_VGA is set
Stefan Reinauer [Thu, 17 Nov 2011 19:13:36 +0000 (11:13 -0800)]
vga_io.c is not needed unless CONFIG_VGA is set

hence disable it.

Change-Id: I7b406251a2f3830748140a111f76f2792fe923ed
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/753
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
12 years agoAllow components smaller than declared size.
Vadim Bendebury [Wed, 9 Nov 2011 22:11:26 +0000 (14:11 -0800)]
Allow components smaller than declared size.

idftool was failing to add the ME blobs into the output image in case
the blob size does not exactly match the size allocated for it in the
flashrom structure.

It is difficult to set the field in the structure to exactly match the
size (for some reason Intel flash tool fails to insert the correct
size even when given the exact ME blob). On the other hand there is no
harm in using am ME blob smaller than the allocated size, this change
modifies the tool building the image to allow for smaller components.

Change-Id: I1b04f90051b91157391943c9bad0eb06dd297431
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: http://review.coreboot.org/751
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
12 years agoAdd Kconfig options to enable TSEG and set a size
Duncan Laurie [Tue, 10 Jan 2012 06:11:25 +0000 (22:11 -0800)]
Add Kconfig options to enable TSEG and set a size

Future CPUs will require TSEG use for SMM

Change-Id: I1432569ece4371d6e12c997e90d66c175fa54c5c
Signed-off-by: Duncan Laurie <dlaurie@google.com>
Reviewed-on: http://review.coreboot.org/766
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
12 years agoMake cpuid functions usable when compiled with PIC
Duncan Laurie [Tue, 10 Jan 2012 06:00:30 +0000 (22:00 -0800)]
Make cpuid functions usable when compiled with PIC

This avoids using EBX and instead uses EDI where possible,
and ESI when necessary to get the EBX value out.

This allows me to enable -fpic for SMM TSEG code.

Also add a new CPUID extended function to query with ECX set.

Change-Id: I10dbded3f3ad98a39ba7b53da59af6ca3145e2e5
Signed-off-by: Duncan Laurie <dlaurie@google.com>
Reviewed-on: http://review.coreboot.org/764
Tested-by: build bot (Jenkins)
Reviewed-by: Mathias Krause <minipli@googlemail.com>
12 years agoRevamp cbmem.py to use the coreboot tables.
Gabe Black [Sat, 7 Jan 2012 09:03:42 +0000 (01:03 -0800)]
Revamp cbmem.py to use the coreboot tables.

This change makes significant changes to cbmem.py to make it use the
coreboot tables to find the memory console and timestamp areas instead
of looking for the in memory table TOC structure. That appears to be
more robust and gets cbmem.py working again after some unrelated
changes that affected memory layout.

It also introduces some small infrastructure to make accessing C style
structures in physical memory easier and more transparent.

Change-Id: I51833055a50c2d76423520ba6e059bf8fc50adea
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://review.coreboot.org/762
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
12 years agodrop use of MAX_PHYSICAL_CPUS and MAX_CPUS where not needed
Stefan Reinauer [Thu, 15 Dec 2011 17:24:40 +0000 (09:24 -0800)]
drop use of MAX_PHYSICAL_CPUS and MAX_CPUS where not needed

Change-Id: Idf875ddec417e627f1e72a6d834860e7fd324a50
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/760
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
12 years agoMake PCI CONF2 support a compile time option
Stefan Reinauer [Thu, 17 Nov 2011 21:05:31 +0000 (13:05 -0800)]
Make PCI CONF2 support a compile time option

It's not used on any board supported by coreboot but has been
detected at run time since ages. No new boards (since 2000?)
are using the CONF2 method, so it is unlikely we ever have to
turn this on for a board.

Change-Id: I17df94a8a77b9338fde10a6b114b44d393776e66
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/758
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
12 years agoAdd more timestamps in coreboot.
Stefan Reinauer [Fri, 4 Nov 2011 19:31:58 +0000 (12:31 -0700)]
Add more timestamps in coreboot.

This adds a number of timestamps in ramstage and romstage
so we can figure out where execution time goes.

Change-Id: Iea17c08774e623fc1ca3fa4505b70523ba4cbf01
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/749
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
12 years agoFix coreboot makefiles not to produce half baked output.
Vadim Bendebury [Sat, 5 Nov 2011 02:07:01 +0000 (02:07 +0000)]
Fix coreboot makefiles not to produce half baked output.

It looks like the cbfstool utility generates the output file even when
it fails to generate it properly. This causes make, if started second
time in a row, after cbfstool failure, to continue beyond the point of
failure (as the corrupted output file is present in the output tree,
the second make invocation presumes that it is valid, as it is newer
than the dependencies).

The output file should be created only when successful, in an atomic
operation. There could be other places in the make system which
require a similar fix, this needs to be investigated further.

Change-Id: I7c17f033ee5937eb712b1a594122430cee5c9146
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: http://review.coreboot.org/750
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: build bot (Jenkins)
12 years agoAdd timestamps for selfboot and acpi wake
Duncan Laurie [Wed, 19 Oct 2011 22:32:39 +0000 (15:32 -0700)]
Add timestamps for selfboot and acpi wake

Change-Id: I28224867610b947739d940d25c98399d219f10f4
Signed-off-by: Duncan Laurie <dlaurie@google.com>
Reviewed-on: http://review.coreboot.org/733
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
12 years agoMake TPM driver work in rom stage.
Stefan Reinauer [Thu, 27 Oct 2011 21:28:25 +0000 (21:28 +0000)]
Make TPM driver work in rom stage.

Change-Id: Ifc827d0cd0159aa3f6752d395974f2812334f262
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/738
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Tested-by: build bot (Jenkins)
12 years agoAdd TPM support to coreboot
Stefan Reinauer [Tue, 11 Oct 2011 21:46:25 +0000 (14:46 -0700)]
Add TPM support to coreboot

and initialize the TPM on S3 resume

This patch integrates the TPM driver and runs TPM resume upon an ACPI S3
resume without including any other parts of vboot.

We could link against vboot_fw.a but it is compiled with u-boot's CFLAGS
(that are incompatible with coreboot's) and it does a lot more than we
want it to do.

Change-Id: I000d4322ef313e931e23c56defaa17e3a4d7f8cf
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/731
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
12 years agoAdd Google ChromeOS vendorcode directory
Stefan Reinauer [Thu, 29 Mar 2012 23:01:51 +0000 (01:01 +0200)]
Add Google ChromeOS vendorcode directory

... and hook it up in Kconfig. More code to come.

Change-Id: I24542d8ef97e2bce112c3aface681ceeb1a7c061
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/813
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
12 years agoAdd an option to keep the ROM cached after romstage
Stefan Reinauer [Wed, 2 Nov 2011 23:12:34 +0000 (16:12 -0700)]
Add an option to keep the ROM cached after romstage

Change-Id: I05f1cbd33f0cb7d80ec90c636d1607774b4a74ef
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/739
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
12 years agoAdd native memset() function on x86
Stefan Reinauer [Wed, 26 Oct 2011 22:11:52 +0000 (22:11 +0000)]
Add native memset() function on x86

Change-Id: Ia118ebe0a4b59bdcefd78895141a365170f6aed2
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/737
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Tested-by: build bot (Jenkins)
12 years agoAdd faster, architecture dependent memcpy()
Stefan Reinauer [Tue, 25 Oct 2011 23:43:34 +0000 (23:43 +0000)]
Add faster, architecture dependent memcpy()

Change-Id: I38d15f3f1ec65f0cb7974d2dd4ae6356433bddd8
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-by: Duncan Laurie <dlaurie@google.com>
Reviewed-on: http://review.coreboot.org/736
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Tested-by: build bot (Jenkins)
12 years agoAdd infrastructure for global data in the CAR phase of boot
Gabe Black [Sat, 1 Oct 2011 11:27:32 +0000 (04:27 -0700)]
Add infrastructure for global data in the CAR phase of boot

The cbmem console structure and car global data are put in their own section,
with the cbmem console coming after the global data. These areas are linked
to be where CAR is available and at the very bottom of the stack.

There is one shortcoming of this change:
The section created by this change needs to be stripped out by the Makefile
since leaving it in confuses cbfstool when it installs the stage in the image.
I would like to make the tools link those symbols at the right location but
leave allocation of that space out of the ELF.

Change-Id: Iccfb99b128d59c5b7d6164796d21ba46d2a674e0
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://review.coreboot.org/727
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
12 years agoDetect whether the OXPCIE card is really present while in the ROM stage.
Gabe Black [Wed, 5 Oct 2011 08:52:08 +0000 (01:52 -0700)]
Detect whether the OXPCIE card is really present while in the ROM stage.

Use an int in CAR global data to store whether or not the OXPCIE serial card
is actually there. Also, time out if the card doesn't show up quickly enough,
don't continue initialization if it's not there, and don't make the
initialization routine default to a card if none is found.

Change-Id: I9c72d3abc6ee2867b77ab2f2180e6f01f647af8c
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://review.coreboot.org/728
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
12 years agoFix typos in src/console/Kconfig
Stefan Reinauer [Tue, 4 Oct 2011 23:21:17 +0000 (16:21 -0700)]
Fix typos in src/console/Kconfig

- cash -> Cache
- make the new size of the cbmem console buffer the default

Change-Id: Ia906077257e93622ad56bc54a42f8184ade78b29
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/726
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
12 years agoAdd support for enabling PCIe Common Clock and ASPM
Duncan Laurie [Tue, 25 Oct 2011 21:15:11 +0000 (14:15 -0700)]
Add support for enabling PCIe Common Clock and ASPM

These are guarded by individual Kconfig entries. The deprecated
CONFIG_PCIE_TUNING defines have been removed in favor of using specific
config options.

This is the generic half, there is board-specific pieces
still to come that tune before and after ASPM is enabled.

Change-Id: I3fe46282eada67629e9eeeed07e487dff54f2729
Signed-off-by: Duncan Laurie <dlaurie@google.com>
Reviewed-on: http://review.coreboot.org/735
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Tested-by: build bot (Jenkins)
12 years agoRefactor publishing CBMEM addresses through coreboot table.
Vadim Bendebury [Mon, 3 Oct 2011 21:58:57 +0000 (14:58 -0700)]
Refactor publishing CBMEM addresses through coreboot table.

We need to provide u-boot access to several different CBMEM
sections. To do that, a common coreboot table structure is used,
just different tags match different coreboot table sections.

Also, the code is added to export CBMEM console and MRC cache
addresses through the same mechanism.

Change-Id: I63adb67093b8b50ee61b0deb0b56ebb2c4856895
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: http://review.coreboot.org/724
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
12 years agoAdd timestamp table pointer to the coreboot table.
Vadim Bendebury [Fri, 23 Sep 2011 16:56:11 +0000 (09:56 -0700)]
Add timestamp table pointer to the coreboot table.

This change exports the timestamp table pointer through coreboot
table to make it possible for u-boot to add timestamps to the
table.

Inclusion of cbmem.h allows to drop external declarations in
coreboot_table.c.

Change-Id: Ia070198cee7a6ffdaeece03d9d15bd91e033b6d1
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: http://review.coreboot.org/716
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
12 years agoIntroduce utility for parsing CBMEM contents.
Vadim Bendebury [Fri, 30 Sep 2011 21:21:03 +0000 (14:21 -0700)]
Introduce utility for parsing CBMEM contents.

This is a python script which is supposed to run on a target
which is controlled by coreboot. The script examines top of
memory looking for the CBMEM signature at addresses aligned at
128K boundary. Once the script finds the CBMEM, it iterates
through the CBMEM table of contents and parses two entries: the
timestamps and the console log.

This submission is just a template to build upon to create a
utility for displaying CBMEM information while running Linux on
the target.

BUG=chrome-os-partner:4200
TEST=manual

See test description of d81e6b8c8d41f2d6 for test procedure.

Change-Id: Id863a8598eaadc2d20d728f9186843e65cbe6f37
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://gerrit-int.chromium.org/5942
Tested-by: Vadim Bendebury <vbendeb@google.com>
Reviewed-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/723
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
12 years agoCBMEM CONSOLE: Enable coreboot CBMEM console.
Vadim Bendebury [Fri, 30 Sep 2011 19:02:18 +0000 (12:02 -0700)]
CBMEM CONSOLE: Enable coreboot CBMEM console.

The appropriate Makefiles are modified to include the required
source code in compilation.

Change-Id: I91842b1ba0f89d611d3249b63c020a2713a9124f
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: http://review.coreboot.org/722
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
12 years agoCBMEM CONSOLE: Add code using the new console driver.
Vadim Bendebury [Fri, 30 Sep 2011 18:16:49 +0000 (11:16 -0700)]
CBMEM CONSOLE: Add code using the new console driver.

The new added code is compiled in when the CBMEM_CONSOLE config
flag is enabled.

Change-Id: Ifd1f492ce6321412a014333babbc5b3f14635988
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: http://review.coreboot.org/721
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
12 years agoCBMEM CONSOLE: Add CBMEM type for console buffer.
Vadim Bendebury [Fri, 30 Sep 2011 18:13:06 +0000 (11:13 -0700)]
CBMEM CONSOLE: Add CBMEM type for console buffer.

Add CBMEM type for the console buffer section.

Change-Id: I02757c06d71e46af77b02b90b0e6018a37b62406
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: http://review.coreboot.org/720
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
12 years agoCBMEM CONSOLE: Add CBMEM console driver implementation.
Vadim Bendebury [Fri, 30 Sep 2011 00:27:15 +0000 (17:27 -0700)]
CBMEM CONSOLE: Add CBMEM console driver implementation.

The CBMEM console driver saves console output in a CBMEM area, which
then is made available to Linux applications for perusing.

There are some system limitations which need to be worked around
to achieve this goal:

- some console traffic is generated before DRAM is initialized,
  leave alone CBMEM initialized.

- after the RAM based stage starts, a lot of traffic is generated
  before CBMEM is initialized.

As a result, the console log lives in three different places -
the bottom of the cache as RAM space, the CBMEM buffer (where it
is expected to be) and a static buffer used early in the RAM
stage.

When execution starts (in the cache as RAM mode), the console
buffer is allocated at the bottom of the cache as RAM memory
address range. Once DRAM is initialized, the CBMEM structure is
initialized, and then the console buffer contents are copied from
the bottom of the cache as RAM space into the CBMEM area right
before the cache as RAM mode is disabled. The
src/lib/cbmem_console.c:cbmemc_reinit() takes care of the
copying.

At this point the cache as RAM memory is about to be disabled,
but the ROM stage is still going generating console output. To
make sure this output is not lost, cbmemc_reinit() saves the new
buffer address at a fixed location (0x600 was chosen for this),
and the actual "printing" function checks to see if the RAM is
already initialized (the stack is in RAM), and if so, gets the
console buffer pointer from this location instead of using the
cache as RAM address.

When the RAM stage starts, a static buffer is used to store the
console output, as the CBMEM buffer location is not known. Then,
when CBMEM is reinitialized, cbmemc_reinit() again takes care of
the copying.

In case the allocated buffers are not large enough, the excessive
data is dropped, and the copying routine adds some text to the
output buffer to indicate that there has been data lost and how
many characters were dropped.

Change-Id: I8c126e31db6cb2141f7f4f97c5047f39a8db44fc
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: http://review.coreboot.org/719
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
12 years agoCBMEM CONSOLE: Add config option for CBMEM stored console log.
Vadim Bendebury [Wed, 28 Sep 2011 20:51:30 +0000 (13:51 -0700)]
CBMEM CONSOLE: Add config option for CBMEM stored console log.

Some experiments have demonstrated that total amount of text
generated by coreboot console when BIOS_SPEW level is enabled
exceeds 40KB.

Console output generated before DRAM is initialized can exceed
2KB. This patch introduces the new configuration option and
assigns adequate default values to cache based and DRAM based
console buffers.

BUG=chrome-os-partner:4200
TEST=manual

 . run the following commands in the root directory

   cp config.stumpy .config
   make menuconfig

 . enable the new option (Console->Send console output to a CBMEM buffer)
 . save the configuration

Observe the following settings added to the config:
+CONFIG_CONSOLE_CBMEM=y
+CONFIG_CONSOLE_CBMEM_BUFFER_SIZE=0xae00
+CONFIG_CONSOLE_CAR_BUFFER_SIZE=0xc00

Change-Id: I209603f516244ae136631e6281ba21ebc6fb1710
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://gerrit-int.chromium.org/5855
Tested-by: Vadim Bendebury <vbendeb@google.com>
Reviewed-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/718
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
12 years agoIncrease CBMEM to accommodate larger console.
Vadim Bendebury [Tue, 4 Oct 2011 17:44:16 +0000 (10:44 -0700)]
Increase CBMEM to accommodate larger console.

This change adds 128K to the memory amount set aside for CBMEM in
case the CBMEM console is enabled (to keep the CBMEM 128K byte
aligned). The console buffer size is being set to 64K, which is
enough to accommodate the most verbose coreboot console and
u-boot console.

Change-Id: If583013dfb210de5028d69577675095c6fe2f3ab
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: http://review.coreboot.org/725
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
12 years agoAdd cmos helper functions for reading/writing a dword
Duncan Laurie [Mon, 26 Sep 2011 20:24:40 +0000 (13:24 -0700)]
Add cmos helper functions for reading/writing a dword

These get used later for saving/restoring the MRC scrambler
seed values on each boot.

Change-Id: I6e23f17649bea6d22c4b279ed8d0e5cb6c0885e7
Signed-off-by: Duncan Laurie <dlaurie@google.com>
Reviewed-on: http://review.coreboot.org/717
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
12 years agoselfboot: Allow loading SeaBIOS into a reserved region in the lower 1MB
Stefan Reinauer [Tue, 18 Oct 2011 22:11:04 +0000 (15:11 -0700)]
selfboot: Allow loading SeaBIOS into a reserved region in the lower 1MB

This fixes loading SeaBIOS when lower memory is reserved.

Change-Id: Idbdcaf95f3307f97307f304d6d677406d059927d
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/732
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
12 years agoInclude arch/acpi.h instead of manually adding acpi_slp_type.
Stefan Reinauer [Fri, 23 Sep 2011 17:24:49 +0000 (10:24 -0700)]
Include arch/acpi.h instead of manually adding acpi_slp_type.

acpi_slp_type is defined in arch/acpi.h, so let's use that instead
of manually spreading extern u8 acpi_slp_type throughout the code.

Change-Id: Ia5eb420364c15ab5a764bc328bbd201ca9cb7837
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/714
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
12 years agoAdd timestamp collecting to coreboot.
Vadim Bendebury [Wed, 21 Sep 2011 23:12:39 +0000 (16:12 -0700)]
Add timestamp collecting to coreboot.

This patch adds code to initialize the time stamp collection
facility in coreboot. It adds a table in the CBMEM section, which
provides the base timer reading value (all other readings are
offsets of this one) and an array of timestamp id/timestamp value
pairs.

Just two values are being added now, this will have to be used
more extensively and also integrated into payloads to provide more
comprehensive boot process time measurements.

Also, since the CBMEM area could already contain a section (from the
previous run, before reset), when processing a section addition
request we should check if a section already exists and return its
address, if so.

Change-Id: I7ed9f5c400bc5432f228348b41fd19a67c36d533
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: http://review.coreboot.org/713
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Tested-by: build bot (Jenkins)
12 years agoAdd a config flag to enable time stamp collection
Vadim Bendebury [Wed, 21 Sep 2011 21:46:43 +0000 (14:46 -0700)]
Add a config flag to enable time stamp collection

Add a new flag, make it dependent on EARLY_CBMEM_INIT

Change-Id: Idbebcaf298238f31a73e9eb4a9af7b03e857bc74
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: http://review.coreboot.org/712
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Tested-by: build bot (Jenkins)
Reviewed-by: Rudolf Marek <r.marek@assembler.cz>
12 years agoInitialize CBMEM early.
Vadim Bendebury [Wed, 21 Sep 2011 00:07:14 +0000 (17:07 -0700)]
Initialize CBMEM early.

We want to be able to share data between different phases of firmware
(rom stage/ram stage/payload). Coreboot CBMEM seems an appropriate
location for this data, but normally it is not initialized
until coreboot reaches the ram stage.

This change initializes the CBMEM while still in rom stage in
case CONFIG_EARLY_CBMEM_INIT is set.

Note that there is a discrepancy in how coreboot determines the
size of DRAM at rom and ram stages, get_top_of_ram() is used at
rom stage and is not defined for all platforms. Those platforms
will have to define this function should they enable the
CONFIG_EARLY_CBMEM_INIT flag.

Change-Id: I81691d45e28de59496fb227f2cca4e8c15ece717
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: http://review.coreboot.org/711
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
12 years agoIntroduce config option to initialize CBMEM early.
Vadim Bendebury [Tue, 20 Sep 2011 23:46:46 +0000 (16:46 -0700)]
Introduce config option to initialize CBMEM early.

We want to be able to communicate information between rom and ram
stages of coreboot. This configuration option will be used to
compile such ability in.

Change-Id: I6736fdc264ecd0b63369b28462d7bb96e4c2b012
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: http://review.coreboot.org/710
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
12 years agoAdd bifferboard
Rudolf Marek [Sun, 25 Mar 2012 17:55:43 +0000 (19:55 +0200)]
Add bifferboard

This commit adds support for Bifferboard, a 32MB 486 PC

Change-Id: Iad790ebf242ef07bf6298f8e3577783e5e743113
Signed-off-by: Rudolf Marek <r.marek@assembler.cz>
Reviewed-on: http://review.coreboot.org/810
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
12 years agoAdd 64KB romchip chip size
Rudolf Marek [Sun, 25 Mar 2012 17:19:03 +0000 (19:19 +0200)]
Add 64KB romchip chip size

This is handy for bifferboard to provide same size as original bootloader.

Change-Id: I179917d8c6354fa55cebdd70918a96cd299c4f3c
Signed-off-by: Rudolf Marek <r.marek@assembler.cz>
Reviewed-on: http://review.coreboot.org/809
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
12 years agoAdd support for RDC R8610 Southbridge
Rudolf Marek [Sun, 25 Mar 2012 16:16:11 +0000 (18:16 +0200)]
Add support for RDC R8610 Southbridge

So far it just setups things right for Bifferboard. We may change it
in the future to fit other hardware.

Change-Id: I1c4ccff4e47b9cb9e31a738f038fc4f4ebe59087
Signed-off-by: Rudolf Marek <r.marek@assembler.cz>
Reviewed-on: http://review.coreboot.org/808
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
12 years agoAdd the support for RDC R8610 Northbridge
Rudolf Marek [Sun, 25 Mar 2012 16:14:02 +0000 (18:14 +0200)]
Add the support for RDC R8610 Northbridge

So far the it just setups the internal resource management for coreboot and
detects the memory size.

Change-Id: I8506390fa6656abfa40d92b8f6ede9b91fe98680
Signed-off-by: Rudolf Marek <r.marek@assembler.cz>
Reviewed-on: http://review.coreboot.org/807
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
12 years agoAdd RDC R8610 PCI IDs.
Rudolf Marek [Sun, 25 Mar 2012 13:58:09 +0000 (15:58 +0200)]
Add RDC R8610 PCI IDs.

Change-Id: I3f3585f15265aa1377f72ba23accf1adb08cb8ac
Signed-off-by: Rudolf Marek <r.marek@assembler.cz>
Reviewed-on: http://review.coreboot.org/806
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
12 years agoFix cleaning SeaBIOS from coreboot makefile
Marc Jones [Mon, 19 Mar 2012 23:32:33 +0000 (17:32 -0600)]
Fix cleaning SeaBIOS from coreboot makefile

The coreboot makefile didn't pass the OUT and CC variables to seabios,
so the clean didn't clean anything.

Change-Id: Ieaf0c417d6e5dfb9e0a11df70b03d6313919578b
Signed-off-by: Marc Jones <marc.jones@se-eng.com>
Reviewed-on: http://review.coreboot.org/801
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martin@se-eng.com>
Reviewed-by: Marc Jones <marcj303@gmail.com>
12 years agoDisable the GDB stub by default
Rudolf Marek [Sun, 25 Mar 2012 18:51:16 +0000 (20:51 +0200)]
Disable the GDB stub by default

I would prefer to see the exception dump on serial rather than cryptic
GDB protocol.

Change-Id: Ib25513d33e6a31da24586fecb00adb5206bb43bd
Signed-off-by: Rudolf Marek <r.marek@assembler.cz>
Reviewed-on: http://review.coreboot.org/811
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
Tested-by: build bot (Jenkins)
12 years agoFix possible deadlock on SMP stop_this_cpu
Kyösti Mälkki [Sun, 4 Mar 2012 00:24:36 +0000 (02:24 +0200)]
Fix possible deadlock on SMP stop_this_cpu

Do not use printk on the running thread after it has been sent
the INIT IPI, execution may halt with console spinlock held.

Change-Id: I64608935ea740fb827fa0307442f3fb102de7a08
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/776
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Tested-by: build bot (Jenkins)
Reviewed-by: Rudolf Marek <r.marek@assembler.cz>
12 years agoIntel cpus: Fix deadlock on hyper-threading init
Kyösti Mälkki [Fri, 9 Mar 2012 15:02:37 +0000 (17:02 +0200)]
Intel cpus: Fix deadlock on hyper-threading init

Only the BSP CPU was able to start its hyper-threading CPU siblings.
When an AP CPU attempts this it calls start_cpu() within start_cpu(),
deadlocking the system with start_cpu_lock.

At the time intel_sibling_init() is run, the BSP CPU is still
walking the cpu_bus linked list in lapic_cpu_init: start_other_cpus().
A sibling CPU appended at the end of this list will get started.

Also fail compile with #error if SERIAL_CPU_INIT==0, as microcode
updates on hyper-threading sibling CPUs must be serialized.

Tested with HT-enabled P4 Xeons on dual-socket604 platform.

Change-Id: I0053f58f49ed604605ce0a55e826d3e1afdc90b6
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/775
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Tested-by: build bot (Jenkins)
Reviewed-by: Rudolf Marek <r.marek@assembler.cz>
12 years agoMakefile: rename linker intermediate variable
Kyösti Mälkki [Mon, 19 Mar 2012 17:12:49 +0000 (19:12 +0200)]
Makefile: rename linker intermediate variable

Renamed CONFIG_ROMBASE to ROMSTAGE_BASE and removed it from Kconfig.
Removed no-op calculation in ldscript.

Change-Id: I53d39b60f07db76c8537b3133e59360687b9d4a7
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/802
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-by: Rudolf Marek <r.marek@assembler.cz>
12 years agogitconfig: Improve commit-msg hook
Patrick Georgi [Wed, 7 Mar 2012 08:30:03 +0000 (09:30 +0100)]
gitconfig: Improve commit-msg hook

There was some corner case where commit-msg failed. Update to
latest upstream version.

Change-Id: I822d6c3f64728de7356401465e00575ac5af8196
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/798
Tested-by: build bot (Jenkins)
Reviewed-by: Bernhard Urban <lewurm@gmail.com>
Reviewed-by: Rudolf Marek <r.marek@assembler.cz>
12 years agoReplace ramtest pattern to assist in DIMM configuration
Kyösti Mälkki [Sat, 17 Mar 2012 07:09:14 +0000 (08:09 +0100)]
Replace ramtest pattern to assist in DIMM configuration

This is developer's testtool. Output from a "rotate ones" -style
pattern helps figure out how DIMM addresses are encoded or routed
on a certain mainboard.

Scattered test should cover every data and address lines on the memory
bus, but is probably limited to the first bank of first DIMM.

Change-Id: I533a7a873bcc434f99e7faed9dc9337d9ab64196
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
[pg: rebase]
Reviewed-on: http://review.coreboot.org/294
Tested-by: build bot (Jenkins)
Reviewed-by: Rudolf Marek <r.marek@assembler.cz>
12 years agoi82801gx: Support power-on-after-power-fail better
Patrick Georgi [Tue, 22 Nov 2011 09:52:43 +0000 (10:52 +0100)]
i82801gx: Support power-on-after-power-fail better

Changing CMOS value for power-on-after-power-fail was only honored
after reboot, which is counter intuitive (set from "enable" to "disable",
power-off, replug device -> device turns on; and similar cases).

Change-Id: If1d88c1c34c3333b636ed3ec1e1fb9bea394e615
Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com>
Reviewed-on: http://review.coreboot.org/444
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
12 years agoi82801gx: Use CMOS variable if available for power-on on power failure
Patrick Georgi [Tue, 22 Nov 2011 09:28:46 +0000 (10:28 +0100)]
i82801gx: Use CMOS variable if available for power-on on power failure

We used a hard coded value for some reason. Don't do that, but use CMOS
instead.

Change-Id: Ib83aa07a3e55bed075150354a060317ebc9d5ba7
Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com>
Reviewed-on: http://review.coreboot.org/443
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
12 years agoprintf: Remove some L modifier uses
Patrick Georgi [Sun, 11 Mar 2012 18:31:03 +0000 (19:31 +0100)]
printf: Remove some L modifier uses

We use the L modifier in a non-standard way (for
long long instead of long double, which we have no
business with).
clang complains, to reduce its use, to make
emulation/qemu-x86 happier.
Long term, we should consider eliminating public uses
of 'L' (but internal use in vtxprintf to denote
long long is fine)

Change-Id: If9a17d9ae9925cdc8736445e7d5eedc59c7028c6
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/781
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
12 years agoFix libpayload alloc() size and gcc pointer optimization problems.
Marc Jones [Tue, 20 Mar 2012 22:53:44 +0000 (16:53 -0600)]
Fix libpayload alloc() size and gcc pointer optimization problems.

The previous commit was incomplete and missed setting the entire
alloc area.

There are also additional problems with gcc optimizations of the
pointer math. The "auto" casting by gcc wouldn't return warnings,
but it was causing the optimization to be incorrect. We are now
very explicit in the casting in the pointer math.

Change-Id: I020808c8d1dda544fe862b9efb0e5345eeab5aab
Signed-off-by: Marc Jones <marc.jones@se-eng.com>
Reviewed-on: http://review.coreboot.org/804
Tested-by: build bot (Jenkins)
Reviewed-by: Peter Stuge <peter@stuge.se>
12 years agoAvoid using CPUID in SMBIOS tables. Check for CPUID otherwise claim 486 class cpu.
Rudolf Marek [Sat, 25 Feb 2012 22:51:12 +0000 (23:51 +0100)]
Avoid using CPUID in SMBIOS tables. Check for CPUID otherwise claim 486 class cpu.

Change-Id: Ic7c4452a1b55bae0cefee118003540ec39ef9fd4
Signed-off-by: Rudolf Marek <r.marek@assembler.cz>
Reviewed-on: http://review.coreboot.org/683
Tested-by: build bot (Jenkins)
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-by: Peter Stuge <peter@stuge.se>
12 years agoAnother indirection for normal/fallback bootblock
Patrick Georgi [Sat, 7 Jan 2012 18:15:43 +0000 (19:15 +0100)]
Another indirection for normal/fallback bootblock

Provide a way to redefine the names of normal and fallback via CBFS.
This way updates can use some more expressive naming scheme (numbers,
dates, version numbers) and replace the coreboot-stages file to
point to the new version (with the current version as new "old").

If coreboot-stages doesn't exist, the default behaviour remains to
use "normal" and "fallback".

Change-Id: I77c134d79ed95831ad5098b7663c15e95d3b5a2a
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/589
Tested-by: build bot (Jenkins)
Reviewed-by: Marc Jones <marcj303@gmail.com>
12 years agoIntel cpus: Include CAR from socket
Kyösti Mälkki [Mon, 13 Feb 2012 11:38:27 +0000 (13:38 +0200)]
Intel cpus: Include CAR from socket

It was not obvious which CAR was compiled in. Also build would fail
if a socket included two models with both having an include for CAR.

Change-Id: I000c2e24807c3d99347a43d120333c13fbf91af4
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/626
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
12 years agoFix AMD Fam15 CBMEM allocation
Stefan Reinauer [Fri, 16 Mar 2012 17:31:37 +0000 (10:31 -0700)]
Fix AMD Fam15 CBMEM allocation

The Fam15 northbridge.c had hardcoded the CBMEM size. It should use
the one in cbmem.h instead.

Change-Id: I8a00e05884bdb1d1a4a012433b0adfbb9eb22983
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/796
Tested-by: build bot (Jenkins)
Reviewed-by: Marc Jones <marcj303@gmail.com>
12 years agoFix AMD Fam12 CBMEM allocation
Stefan Reinauer [Fri, 16 Mar 2012 17:26:39 +0000 (10:26 -0700)]
Fix AMD Fam12 CBMEM allocation

The Fam12 northbridge.c had hardcoded the CBMEM size. It should use
the one in cbmem.h instead.

Change-Id: I1eca18e21fa59ae32e802d8452e42e8b7a3575cf
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/795
Tested-by: build bot (Jenkins)
Reviewed-by: Marc Jones <marcj303@gmail.com>
12 years agoFix AMD Fam10 CBMEM allocation
Stefan Reinauer [Fri, 16 Mar 2012 17:19:51 +0000 (10:19 -0700)]
Fix AMD Fam10 CBMEM allocation

The Fam10 northbridge.c had hardcoded the CBMEM size. It should use
the one in cbmem.h instead.

Change-Id: Id6c4128d8f5f6a417f83daa3a39b2bfc8e810f8a
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/794
Tested-by: build bot (Jenkins)
Reviewed-by: Marc Jones <marcj303@gmail.com>
12 years agoAMD Agesa: delete no-op bootblock files
Kyösti Mälkki [Fri, 16 Mar 2012 13:54:18 +0000 (15:54 +0200)]
AMD Agesa: delete no-op bootblock files

Removes files:
  src/northbridge/amd/agesa/family10/bootblock.c
  src/northbridge/amd/agesa/family12/bootblock.c
  src/northbridge/amd/agesa/family14/bootblock.c
  src/northbridge/amd/agesa/family15/bootblock.c

Change-Id: Ic3617a673b38d065ca272c4de8ef765ecd3f98b1
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/793
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
12 years agoRename AMD_AGESA to CPU_AMD_AGESA
Kyösti Mälkki [Fri, 16 Mar 2012 13:40:56 +0000 (15:40 +0200)]
Rename AMD_AGESA to CPU_AMD_AGESA

Also any CPU_AMD_AGESA_FAMILYxx selects CPU_AMD_AGESA, so remove
the explicit selects from the mainboards.

Change-Id: I4d71726bccd446b0f4db4e26448b5c91e406a641
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/792
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
12 years agoFix AMD Agesa leaking Kconfig
Kyösti Mälkki [Fri, 16 Mar 2012 13:15:20 +0000 (15:15 +0200)]
Fix AMD Agesa leaking Kconfig

Kconfig leaked XIP_ROM_SIZE to other platforms and also
defined obsolete option XIP_ROM_BASE.

Alias AMD_AGESA as NORTHBRIDGE_AMD_AGESA.
Break the circular dependency with family15 Kconfig.

Change-Id: Ic7891012220e1bef758a5a39002b66971d5206e3
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/773
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
12 years agoROMCC boards have no XIP limit
Patrick Georgi [Fri, 16 Mar 2012 20:16:55 +0000 (21:16 +0100)]
ROMCC boards have no XIP limit

So set their XIP configuration to ROM_SIZE.

Change-Id: I6c1abccec3b1d7389c85df55343ff0fc68a61eec
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/797
Tested-by: build bot (Jenkins)
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
12 years agoUse search path when building dependencies
Patrick Georgi [Sun, 11 Mar 2012 18:29:46 +0000 (19:29 +0100)]
Use search path when building dependencies

clang is more picky on that.

Change-Id: Iaa8472beb6e275c39037d11e1a72dbb80d46424b
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/779
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
12 years agoxchg is atomic with side-effects
Patrick Georgi [Sun, 11 Mar 2012 18:42:33 +0000 (19:42 +0100)]
xchg is atomic with side-effects

clang doesn't know about the side effect, so we have to tell it
that it's okay not to care about the result.

Change-Id: Ib11890bff6779e36cf09c178d224695ea16a8ae8
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/783
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
12 years agoclang: Don't use mmx nor sse
Patrick Georgi [Sun, 11 Mar 2012 19:44:22 +0000 (20:44 +0100)]
clang: Don't use mmx nor sse

clang is much more trigger happy than gcc on those.

Change-Id: Ie7c219de3cc26675692eab7361a4ad551f1c65a7
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/786
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
12 years agoIntel northbridge I945: Apply un-written naming rules
Kyösti Mälkki [Fri, 24 Feb 2012 14:08:18 +0000 (16:08 +0200)]
Intel northbridge I945: Apply un-written naming rules

Use NORTHBRIDGE_INTEL_I945 to select the driver directory for build.

Use _SUBTYPE_945GC and _SUBTYPE_945GM to define at compile-time
which model of I945 the driver is built for.

Change-Id: I11b1e0998d0fc28f8946bad4f0989036a9b18af4
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/684
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
12 years agoVia Epia-N and C3: Set ioapic delivery type in Kconfig
Patrick Georgi [Fri, 16 Mar 2012 18:28:15 +0000 (19:28 +0100)]
Via Epia-N and C3: Set ioapic delivery type in Kconfig

The original comment says it's a Via C3 and not Epia requirement
to deliver IOAPIC interrupts on APIC serial bus.

Change-Id: I73c55755e0ec1ac5756b4ee7ccdfc8eb93184e4f
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/435
Tested-by: build bot (Jenkins)
12 years agoVIA southbridge K8T890: Apply un-written naming rules
Kyösti Mälkki [Sat, 25 Feb 2012 15:14:20 +0000 (17:14 +0200)]
VIA southbridge K8T890: Apply un-written naming rules

Use separate Kconfig option to select a driver directory for
build and the specific type of southbridge to support.

Change-Id: I9482d4ea0f0234b9b7ff38144e45022ab95cf3f3
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/685
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
12 years agoFix address of IDT in real-mode entry
Kyösti Mälkki [Mon, 5 Mar 2012 07:25:12 +0000 (09:25 +0200)]
Fix address of IDT in real-mode entry

In a case of CS & 0x0fff != 0x0, lidt memory operand does not point
to nullidt, this can raise an exception and shutdown the CPU.

When an AP CPU receives 8-bit Start-Up IPI vector yzH, it starts
execute at physical address 000yz000H. Seems this translates to
either yz00:0000 or y000:z000 (CS:IP), depending of the CPU model.
With the change entry16.inc is relocatable as the commentary suggests
and can be used as ap_sipi_vector on SMP systems.

Change-Id: I885a2888179700ba6e2b11d4f2d6a64ddea4c2dc
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/707
Tested-by: build bot (Jenkins)
Reviewed-by: Idwer Vollering <vidwer@gmail.com>
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
12 years agoFix AMD Fam14 cbmen allocation
Marc Jones [Thu, 15 Mar 2012 19:21:41 +0000 (13:21 -0600)]
Fix AMD Fam14 cbmen allocation

The Fam14 northbridge.c had hardcoded the cbmem size. It should use
in cbmem.h instead.

Change-Id: I910329fc98a4cf04dc81ef66f3aa05a1916f5b1d
Signed-off-by: Marc Jones <marc.jones@se-eng.com>
Reviewed-on: http://review.coreboot.org/790
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: build bot (Jenkins)
12 years agoClean up whitespace in fam14 northbridge.c
Marc Jones [Thu, 15 Mar 2012 18:55:26 +0000 (12:55 -0600)]
Clean up whitespace in fam14 northbridge.c

Change-Id: Id7947d7f3c67fdda67861065b1bc7a519b97208f
Signed-off-by: Marc Jones <marc.jones@se-eng.com>
Reviewed-on: http://review.coreboot.org/789
Tested-by: build bot (Jenkins)
Reviewed-by: Peter Stuge <peter@stuge.se>
12 years agoSince cbfs_core.h provides a macro that uses ntohl, make sure ntohl is available
Gabe Black [Fri, 16 Sep 2011 09:24:03 +0000 (02:24 -0700)]
Since cbfs_core.h provides a macro that uses ntohl, make sure ntohl is available

Since cbfs_core.h provides a macro that uses ntohl, make sure ntohl is available by
including byteorder.h

Change-Id: I9ab8cb51bd680e861b28d5130d09547bb9ab3b1f
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://review.coreboot.org/709
Tested-by: build bot (Jenkins)
Reviewed-by: Peter Stuge <peter@stuge.se>
12 years agoAGESA family 12 changes to fix torpedo warnings
Martin Roth [Fri, 17 Feb 2012 20:16:04 +0000 (13:16 -0700)]
AGESA family 12 changes to fix torpedo warnings

Fixes the warnings generated in the torpedo mainboard build by AGESA.
Removing broken tests.

Change-Id: Ib444fa2bf4dd94cadb4ce33040eb5650d1c0325b
Signed-off-by: Martin L Roth <martin@se-eng.com>
Reviewed-on: http://review.coreboot.org/667
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
12 years agoUnion Station: Fixes to turn on HDMI
Frank Vibrans [Tue, 13 Mar 2012 17:02:04 +0000 (11:02 -0600)]
Union Station: Fixes to turn on HDMI

This commit includes the changes to enable the HDMI on Union
Station.  The changes switch the output from the display port
to the HDMI.

Change-Id: I4e15ff6db7d056f156791ff1406d4bae35ff2767
Signed-off-by: Frank Vibrans <frank.vibrans@se-eng.com>
Reviewed-on: http://review.coreboot.org/788
Tested-by: build bot (Jenkins)
Reviewed-by: Peter Stuge <peter@stuge.se>
12 years agoUnion Station: Remove SIO support
Frank Vibrans [Tue, 13 Mar 2012 16:57:49 +0000 (10:57 -0600)]
Union Station: Remove SIO support

Because the Union Station platform doesn't have an SIO chip,
this commit removes the Fintek SIO support.

Change-Id: Idba4222ce136821dee2530a72d1630eb5ad613a2
Signed-off-by: Frank Vibrans <frank.vibrans@se-eng.com>
Reviewed-on: http://review.coreboot.org/787
Reviewed-by: Peter Stuge <peter@stuge.se>
Tested-by: build bot (Jenkins)
12 years agoNo need to setup include paths with .s files
Patrick Georgi [Sun, 11 Mar 2012 18:34:12 +0000 (19:34 +0100)]
No need to setup include paths with .s files

They're already preprocessed, and clang whines.

Change-Id: I57fe936f84a2fe1aa50ee8510fef606f2ed2ea23
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/782
Tested-by: build bot (Jenkins)
Reviewed-by: Mathias Krause <minipli@googlemail.com>
12 years agomalloc: size is unsigned, don't test for size < 0
Patrick Georgi [Sun, 11 Mar 2012 18:30:36 +0000 (19:30 +0100)]
malloc: size is unsigned, don't test for size < 0

clang complains

Change-Id: Ifadf73cf377c0d1808e20731803e01101bad7e1d
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/780
Tested-by: build bot (Jenkins)
Reviewed-by: Mathias Krause <minipli@googlemail.com>
12 years agomainboard/aopen/Kconfig: remove extra whitespace
Patrick Georgi [Fri, 9 Mar 2012 22:03:01 +0000 (23:03 +0100)]
mainboard/aopen/Kconfig: remove extra whitespace

Change-Id: I69ee67c35113d98e034bdccf5d00e8452d3d9bd2
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/778
Tested-by: build bot (Jenkins)
Reviewed-by: Rudolf Marek <r.marek@assembler.cz>
12 years agoPortability improvement
Patrick Georgi [Fri, 9 Mar 2012 22:02:09 +0000 (23:02 +0100)]
Portability improvement

Makefile.inc uses $( ) syntax on the shell. That's isn't as universal
as one would like.

Change-Id: I9a8fd511eef7fefc1458d5bae2cd7ef5475b7392
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/777
Tested-by: build bot (Jenkins)
Reviewed-by: Bernhard Urban <lewurm@gmail.com>
12 years agoMake libpayload alloc() memory pointers volatile
Marc Jones [Thu, 1 Mar 2012 23:12:11 +0000 (16:12 -0700)]
Make libpayload alloc() memory pointers volatile

gcc4.6.2 was optimizing the libpayload alloc() function and failing to
reload a pointer after the memory had been manipulated by a pointer in
the inlined function setup(). Change the pointer type to volatile
and now pass it to the setup() function. Also clean up the
declaration so that it isn't cast a bunch times in the function.

Change-Id: I1637bd7bd5d9cf82ac88925cbfe76d319aa3cd82
Signed-off-by: Marc Jones <marc.jones@se-eng.com>
Reviewed-on: http://review.coreboot.org/705
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
12 years agoIf the memory mapped UART isn't present, leave it out of the cb tables.
Gabe Black [Wed, 5 Oct 2011 08:57:03 +0000 (01:57 -0700)]
If the memory mapped UART isn't present, leave it out of the cb tables.

This way u-boot won't try to use a UART that isn't plugged in.

Change-Id: I9a3a0d074dd03add8afbd4dad836c4c6a05abe6f
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://review.coreboot.org/729
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
Tested-by: build bot (Jenkins)
12 years agotell superiotool about the ITE 8772
Stefan Reinauer [Tue, 25 Oct 2011 17:12:53 +0000 (17:12 +0000)]
tell superiotool about the ITE 8772

no dumping yet

Change-Id: I4e687ca816c8d6d1c95255b0abf6a19513e23f86
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/734
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Tested-by: build bot (Jenkins)
12 years agoIncrease size of the coreboot table area
Stefan Reinauer [Sun, 14 Aug 2011 20:52:03 +0000 (13:52 -0700)]
Increase size of the coreboot table area

Packing a device tree into the coreboot table can easily make
the table exceed the current limit of 8KB. However, right now
there is no error handling in place to catch that case.

Increase the maximum memory usable for all tables from 64KB to
128KB and increase the maximum coreboot table size from 8KB
to 32KB.

Change-Id: I2025bf070d0adb276c1cd610aa8402b50bdf2525
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/704
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
12 years agoFix compilation when USE_OPTION_TABLE is not defined.
Duncan Laurie [Mon, 15 Aug 2011 23:35:10 +0000 (16:35 -0700)]
Fix compilation when USE_OPTION_TABLE is not defined.

Change-Id: Id622e4e96b6c8e87b00a96c324a0b4dbfac3391d
Signed-off-by: Duncan Laurie <dlaurie@google.com>
Reviewed-on: http://review.coreboot.org/702
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
12 years agoFix coreboot table size calculations.
Vadim Bendebury [Tue, 16 Aug 2011 18:44:35 +0000 (11:44 -0700)]
Fix coreboot table size calculations.

The code when reporting the coreboot table size did not account
for the last added table record. This change fixes the problem.

 . rebuild coreboot, program it on the target, restart it
 . look for 'Wrote coreboot table at:' in the console log
 . observe the adequate table size reported

 $  grep 'Wrote coreboot table:' /tmp/cb.log
 Wrote coreboot table at: 00000500, 0x10 bytes, checksum c06f
 Wrote coreboot table at: 7f6fc000, 0x1a73 bytes, checksum 3e45
 $

Change-Id: Ic55501a4ae06fab2bcda9aea58e362325f2edccf
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: http://review.coreboot.org/703
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
12 years agoClean up use of CONFIG_ variables in coreboot_table.c
Stefan Reinauer [Mon, 15 Aug 2011 18:26:35 +0000 (11:26 -0700)]
Clean up use of CONFIG_ variables in coreboot_table.c

CONFIG_ variables are used inconsistently within the file
src/arch/x86/boot/coreboot_table.c. #ifdef will do the wrong
thing if the option is disabled. #if (CONFIG_FOO == 1) is
not needed.

Change-Id: Ifcac6ceac5fb34b931281beae500023597b3533b
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/701
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Tested-by: build bot (Jenkins)
12 years agoFix dependency problem for uart8250.c as well
Stefan Reinauer [Thu, 11 Aug 2011 21:51:31 +0000 (14:51 -0700)]
Fix dependency problem for uart8250.c as well

If you build in parallel, option_table.h will occasionally not be there yet
and the build will fail.

Change-Id: I828956ab2e05c48d20c2f7c55616cc8fa19e1227
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/698
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
12 years agoFix compilation with CONFIG_USE_OPTION_TABLE enabled
Stefan Reinauer [Fri, 29 Jul 2011 22:34:14 +0000 (15:34 -0700)]
Fix compilation with CONFIG_USE_OPTION_TABLE enabled

Change-Id: I6c5d973442bc1770702180a8964f1bf6ed6062ed
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/696
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
12 years agoAdd helper function to find a Local APIC by ID in the device tree.
Duncan Laurie [Mon, 18 Jul 2011 17:41:36 +0000 (10:41 -0700)]
Add helper function to find a Local APIC by ID in the device tree.

Change-Id: Ie2d7d8e1f647a0c92d2de09e32454fbea688b1e7
Signed-off-by: Duncan Laurie <dlaurie@google.com>
Reviewed-on: http://review.coreboot.org/695
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
12 years agoDon't try to compute I/O for empty sub buses.
Stefan Reinauer [Wed, 11 May 2011 22:57:07 +0000 (15:57 -0700)]
Don't try to compute I/O for empty sub buses.

I am not sure if the sub bus being 0 is a problem, or if the assumption
there has to be at least one non empty link is just wrong. It certainly
does not hurt to add a small consistency check in either case.

Change-Id: I098446deef96a8baae26a7ca1ddd96e626a06dc5
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/693
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
12 years agoOXPCIe: Reinitialize UART after pci_dev_set_resources()
Stefan Reinauer [Tue, 10 May 2011 19:54:56 +0000 (12:54 -0700)]
OXPCIe: Reinitialize UART after pci_dev_set_resources()

... and only pull in early init code if the OXPCIe is used for console.

Change-Id: I01feca3b9e8376a75c17554ba1bd200d523dff8d
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/692
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
12 years agomove console includes to central console/console.h
Stefan Reinauer [Tue, 10 May 2011 17:46:41 +0000 (10:46 -0700)]
move console includes to central console/console.h

Because it's included everywhere anyways.

Change-Id: I99a9e6edac08df57c50ef3a706fdbd395cad0abc
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/691
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
12 years agoAdd support for the Startech PEX1XS1PMINI
Stefan Reinauer [Mon, 9 May 2011 22:19:29 +0000 (15:19 -0700)]
Add support for the Startech PEX1XS1PMINI

It has a smaller footprint than the already supported MPEX2S952

Change-Id: Ie36b67f9628882d516ca34ff164f0e8918955a5b
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Tested-by: Stefan Reinauer <reinauer@google.com>
Reviewed-by: Duncan Laurie <dlaurie@google.com>
Reviewed-on: http://review.coreboot.org/690
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
12 years agoDon't run any Option ROMs stored outside of the system flash
Stefan Reinauer [Thu, 6 Oct 2011 23:47:51 +0000 (16:47 -0700)]
Don't run any Option ROMs stored outside of the system flash

Right now coreboot only executes VGA Option ROMs. However, this is not
good enough. For security reasons we want to execute only Option ROMs
stored in our r/o CBFS.

This patch adds a new option to disable execution of arbitrary Option
ROMs.

Also fix the capitalization of Option ROM in src/devices/Kconfig

Change-Id: I485291c06ec5cd1f875357401831fe32ccfc5f2f
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/730
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Reviewed-by: Mathias Krause <minipli@googlemail.com>
12 years agoAdd an implementation for the memchr library function
Gabe Black [Fri, 16 Sep 2011 09:18:56 +0000 (02:18 -0700)]
Add an implementation for the memchr library function

Change-Id: Icded479d246f7cce8a3d2154c69f75178fa513e1
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://review.coreboot.org/708
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Tested-by: build bot (Jenkins)
Reviewed-by: Mathias Krause <minipli@googlemail.com>
12 years agoFix lint-stable checkin hooks on MacOS X
Stefan Reinauer [Thu, 8 Mar 2012 19:06:25 +0000 (11:06 -0800)]
Fix lint-stable checkin hooks on MacOS X

- wc adds a number of leading spaces which broke cut
- sed can't replace spaces with new lines, so use tr for that.
- make sure directories are created if they're not there.

Change-Id: Ia0db059683abe3d97b0ab6feaece660a1f4e5079
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/774
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Tested-by: build bot (Jenkins)
12 years agoDon't run VGA option ROMs on S3 resume.
Stefan Reinauer [Fri, 23 Sep 2011 17:33:58 +0000 (10:33 -0700)]
Don't run VGA option ROMs on S3 resume.

This will save us a few 100 ms on resume.

Change-Id: Iabf4c8ab88662ba41236162f0a6f5bd80d8c1255
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/715
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>