Commit Graph

5069 Commits

Author SHA1 Message Date
Duncan Laurie 8de884424c ELOG: Fix reporting of developer/recovery modes
Recent changes in EC/Vboot/U-boot have completely broken
the logging of developer and recovery modes.

Recovery mode may not be in VBNV, so if that is zero and
yet we are in recovery mode then assume it is there because
the button/key was pressed.

Since there may not be any actual developer mode switch
we look if option rom is loaded and the system is not
in recovery mode and consider that as developer mode.

Change-Id: I70104877b24de477217e1ff5b3a019aef22343ec
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: http://review.coreboot.org/1346
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-26 20:34:12 +02:00
Duncan Laurie c1c9435863 Log event for abnormal management engine status
This will log if the ME is disabled or has an error.

1) disable ME via EC console: gpioset PCH_HDA_SDO 1
2) boot the device
3) read eventlog with "mosys eventlog list"
71 | 2012-07-13 10:10:55 | Management Engine | Disabled

Change-Id: I9f6ee452d2aea76e6a5ea2cd50a50ff36245692a
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: http://review.coreboot.org/1345
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-26 20:33:45 +02:00
Duncan Laurie 55864eff92 ACPI: Add support for runtime config TDP down
The required power MSRs are mirrored in MCHBAR so
it is possible to configure TDP at runtime via ASL.

This adds the required fields and a set of methods to
configure "TDP down" and "TDP nominal".  It explicitly
does not support "TDP up" at the moment.

PSSS: method is added to assist in searching the _PSS
table for the appropriate entry that corresponds to the
desired max non-turbo ratio.

STND: Set TDP Down from Nominal.  This will limit CPU to
the TDP down configuration by sequencing the required
changes in the right order.

STDN: Set TDP Nominal from Down.  This will set the CPU
back to nominal configuration by sequencing the required
changes in the correct (reverse) order.

This does not introduce any functional changes and must
be paired with additional changes to be useful.

The current configured TDP can be checked to see that
the transition to/from a desired level is successful.

> mmio_read8 0xfed15f50
0x00  # TDP-Nominal

> mmio_read8 0xfed15f50
0x01  # TDP-Down

Change-Id: I31a2f30cc9d134cc5eee980ae9288ae45e71c6e6
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: http://review.coreboot.org/1344
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-26 20:33:06 +02:00
Duncan Laurie 556321167f CPU: Add option to set TCC activation offset
The default TCC activation offset is 0, which means TCC
activation starts at Tj_max.  For devices with limited
cooling ability it may be desired to lower TCC activation.

This adds an option that can be declared in the devicetree
to set the TCC activation to a non-zero value.

Enable tcc_offset=15 in devicetree.cb and build/boot
the BIOS and check that the value is set in the MSR:

> and $(shr $(rdmsr 0 0x1a2) 24) 0xf
0xf

Change-Id: I88f6857b40fd354f70fa9d5d9c1d8ceaea6dfcd1
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: http://review.coreboot.org/1343
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-26 20:32:45 +02:00
Duncan Laurie d6aca0b7b1 ACPI: Add a method to notify OS to re-read _PPC
Split this behavior out from PNOT() so the OS can
update _PPC limit without re-reading C-state tables.

Change-Id: I81b9111a4866f6b9916f74ac57a3caefaa77c565
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: http://review.coreboot.org/1342
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-26 20:32:10 +02:00
Duncan Laurie 0eefa00503 ACPI: Add function to write _PPC using NVS
The existing NVS variable for PPCM will be used to
select a dynamic max P-state.

By itself this does not change existing behavior because
the NVS PPCM variable is initialized to zero.

PPCM can be tested by building and booting a modified BIOS
that sets gnvs->ppcm to a value greater than 1 and checking
from the OS that the P-state is limited to that value.

Change-Id: Ia7b3bbc6b84c1aa42349bb236abee5cc92486561
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: http://review.coreboot.org/1341
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-26 20:31:52 +02:00
Duncan Laurie 10d31aba76 NVS: Add a temp sensor ID and an ACPI Method to set it
This will allow various teams to select which thermal sensor
will control the thermal zones.

Also add a method to notify the thermalzones of a change
so these threshold/sensor methods take effect.

Needs a modified BIOS that uses the NVS TMPS value in
the thermalzone to read a different sensor.

Then, use a kernel driver that contains the following:

/* Adjust temperature sensor id to 2 */
union acpi_object param;
struct acpi_object_list input;
param.type = ACPI_TYPE_INTEGER
param.integer.value = 2
input.count = 1;
input.pointer = &param;
acpi_evaluate_object(NULL, "\\TMPU", &input, NULL);

And ensure that the temperature sensor that is being
monitored switches to ID 2.

Change-Id: I6319741358ba31eb8a3dc635d64f3f0acf683386
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: http://review.coreboot.org/1340
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-26 20:31:31 +02:00
Duncan Laurie 708f731fd7 ME: Move ME v8 lockdown to finalize step
The ME device was being sent EOP and the PCI device hidden during
coreboot so it was not available in the SMI finalize step.

This also flips the PCI vendor/device dword around for the match.

Boot on Panther Point with serial and SMI debugging enabled and see
that ME EOP message is sent and the device is hidden at end of
U-boot and before the kernel loads.

Finalizing Coreboot

SMI# #0
ME: mkhi_end_of_post
ME: END OF POST message successful (0)
PM1_STS: TMROF
PM1_EN: 120

Starting kernel ...

Change-Id: I230038c62c50db2a1c94078c0a2a67bdc232440e
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: http://review.coreboot.org/1338
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-26 20:31:13 +02:00
Marc Jones a0bec17455 Reserve bd82x6x LPC decode ranges in the resource allocator
The LPC bus normally allocates the range for legacy devices,
0-0x1000. Some devices on LPC are above that range and need to
be accounted for. Check the decode range settings for addresses
> 0x1000 and reserve them.

Change-Id: Idba800d7cee3185296f29dd237ba306f3de8de55
Signed-off-by: Marc Jones <marc.jones@se-eng.com>
Reviewed-on: http://review.coreboot.org/1337
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-26 20:30:52 +02:00
Duncan Laurie 1bb79bcf89 ELOG: Log run-time SMI southbridge events
Events are logged for SMIs that trigger ACPI sleeps state
entry and when the power button press triggers an SMI such
as at the developer/recovery screens.

Generate ACPI sleep state events and power button
events and verify they show up in the log:

153 | 2012-06-23 17:12:59 | ACPI Enter | S5
184 | 2012-06-23 17:15:50 | ACPI Enter | S3
216 | 2012-06-23 17:28:58 | Power Button

Change-Id: Iba134d619780e459bce189d36d57844997ffb009
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: http://review.coreboot.org/1320
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-26 20:29:58 +02:00
Duncan Laurie cfb64bda83 SATA: Add option to configure gen3 transmitter
Unfortunately the drive strength values are very much board
specific and different between mobile and desktop so we don't
try to do any fancy detection here but let it be specified
directly in the devicetree.

Change-Id: I66674bff0de04ecd088fb09afad1cf801a374df2
Signed-off-by: Duncan Laurie <dlaurie@google.com>
Reviewed-on: http://review.coreboot.org/1347
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-26 20:29:16 +02:00
Duncan Laurie 0920915bca ELOG: Support GSMI in CPT/PPT southbridge SMI handler
In order to support the GSMI interface the SMI handler needs
to find and use the state save area from the same CPU that
initiated the SMI.  In this case it is a synchronous SMI
resulting form an IO write to port 0xB2.

To find the right CPU state save area iterate over the region
until the "IO Misc Info" field reports the expected value and
then proceed to use that state save area.

This is needed because the coreboot SMI handler only executes on
one core, and that core is non-deterministic.  It is likely that
the core executing the C SMM handler is not the same one that
actually did the IO write to 0xB2 and generated the SMI.

The GSMI parameter buffer is passed as a pointer to EBX in the
tate save area, and the GSMI command is extracted from EAX before
it is used as the return value.

This interface is tested by enabling CONFIG_GOOGLE_GSMI in the
kernel and generating events and verifying that they end up
in the event log.

159 | 2012-06-23 16:22:45 | Kernl Event | Clean Shutdown
184 | 2012-06-23 17:14:05 | Kernl Event | Oops
185 | 2012-06-23 17:14:05 | Kernl Event | Panic

Change-Id: Ic121ea69e9f50c88467c435e095c3e3629989806
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: http://review.coreboot.org/1317
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-26 20:28:38 +02:00
zbao 38bd80d5a7 Add correct bios callout into read event routine
Read event routine didn't get the correct BIOS callout. So it could not get
the heap address. Then it would creat many warning in serial port.

Change-Id: Ia35601bda1579c7f726ed767d7be78713ac185d2
Signed-off-by: Zheng Bao <zheng.bao@amd.com>
Signed-off-by: zbao <fishbaozi@gmail.com>
Reviewed-on: http://review.coreboot.org/1266
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-07-26 19:10:27 +02:00
Patrick Georgi 035f1d2f14 ibase/mb899: Rename NIC BIOS disable driver and hook up
The board has a marvell NIC, but the driver to disable NIC BIOS was adapted
from a Realtek 8168 driver. Rename to reflect the change.

Also hook up as driver, so coreboot can actually find it.

Change-Id: Ibdfd6074eb28ba537d68552a3346b06493cef2a6
Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com>
Reviewed-on: http://review.coreboot.org/1355
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-07-26 19:03:44 +02:00
Patrick Georgi fce22e80d8 Remove copies of rtl8168.c
One copy was slightly different, but all the differences were commented out

Change-Id: I3cc7b5621c681a1eb286f9b16ef3ebdce03abb6b
Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com>
Reviewed-on: http://review.coreboot.org/1356
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-07-26 19:02:59 +02:00
Sven Schnelle 82704c63b9 USBDEBUG: buffer up to 8 bytes
EHCI debug allows to send message with 8 bytes length, but
we're only sending one byte in each transaction. Buffer up
to 8 bytes to speed up debug output.

Change-Id: I9dbb406833c4966c3afbd610e1b13a8fa3d62f39
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Reviewed-on: http://review.coreboot.org/1357
Tested-by: build bot (Jenkins)
Reviewed-by: Nico Huber <nico.huber@secunet.com>
2012-07-26 15:52:00 +02:00
Stefan Reinauer 0b7b7b6334 Drop CONFIG_CPU_MODEL_NAME and fix CPU name displayed in logs
On SandyBridge systems configured to work with Panther Point the CPU
would wrongly be described as IvyBridge. Fix this issue and drop an
unneeded Kconfig variable at the same time.

Change-Id: I501a4fa00613e589cd315cfee61b2f9561dfcb4d
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1335
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-07-26 11:12:53 +02:00
Stefan Reinauer c65a36eb0f Enable Microcode in CBFS for all SandyBridge/IvyBridge systems
Change-Id: Idee4facc18e0be60906d2a2f0e99bd39de8d7247
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1332
Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-26 00:19:57 +02:00
Duncan Laurie 79bbbd9db3 ELOG: Add support for SMM and kernel GSMI driver
The linux kernel contains an SMI driver that was written by
me (Duncan) and upstreamed a couple years ago called GSMI.
This driver will format a parameter buffer and pass pointers
to this parameter buffer to the SMI handler.  It uses this to
generate events for kernel shutdown reasons:  Clean, Panic, Oops,
etc.

This function expects to be passed pointers into the SMM state
save area that correspond to the prameter buffer and the return
code, which are typically EAX and EBX.

The format of the parameter buffer is defined in the kernel
driver so we implement the same interface here in order to be
compatible.

GSMI_CMD_HANDSHAKE: this is an early call that it does to try
and detect what kind of BIOS is running.

GSMI_CMD_SET_EVENT_LOG: this contains a parameter buffer that
has event type and data.  The kernel-specific events are
translated here and raw events are passed through as well which
allows any run-time event to be added for testing.

GSMI_CMD_CLEAR_EVENT_LOG: this command clears the event log.

First the gsmi driver must be enabled in the kernel with
CONFIG_GOOGLE_GSMI and then events can be added via sysfs
and events are automatically generated for various kernel
shutdown reasons.

These can be seen in the event log as the 'Kernel Event' type:

169 | 2012-06-23 15:03:04 | Kernl Event | Clean Shutdown
181 | 2012-06-23 16:26:32 | Kernl Event | Oops
181 | 2012-06-23 16:26:32 | Kernl Event | Panic

Change-Id: Ic0a3916401f0d9811e4aa8b2c560657dccc920c1
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: http://review.coreboot.org/1316
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-26 00:19:42 +02:00
Stefan Reinauer 62f1ad98c4 SMM: Fix state table for Intel Core2 CPUs
When fixing the SMM state table for SandyBridge/IvyBridge CPUs
the wrong table was used for older 64bit capable CPUs.

Change-Id: Ia7dff21aa3f0e5aa61575634fc839777de6bef10
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1353
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-07-25 23:42:48 +02:00
Duncan Laurie 54cba3b4ad SMM: Skip locking SPI registers in finalize step
This is a temporary workaround so the SPI bus can be accessed
at runtime in SMM code until the SPI opcode menu is used
properly.

Change-Id: I93d188c55b66d8dce49fa91a1de53ee195944b30
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: http://review.coreboot.org/1318
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-25 22:59:43 +02:00
Duncan Laurie 800e950d64 ELOG: Log boot-time events found in southbridge
This is called from the SMI handler install because those
setup functions clear many of these registers.

Ensure that these events show up in the log as appropriate.
Example log output:

159 | 2012-06-23 14:31:54 | SUS Power Fail
160 | 2012-06-23 14:31:54 | System Reset
161 | 2012-06-23 14:31:54 | ACPI Wake | S5

Change-Id: I48c423c10ee7e6c2829bcc95f6cfabb4979c25a9
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: http://review.coreboot.org/1319
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-25 22:25:22 +02:00
Duncan Laurie 27e5aacc52 ELOG: Log events for Chrome OS developer/recovery mode
If a Chrome OS device is in developer mode log an event.
When the device is in recovery mode also log an event
and provide the recovery reason.

Enable developer mode and trigger recovery mode and
verify that the events are logged:

238 | 2012-06-23 17:31:56 | Chrome OS Developer Mode
239 | 2012-06-23 17:31:56 | Chrome OS Recovery Mode | User Requested from Developer Screen

Change-Id: I14d41f44e04fd91340569617c7314da7e35a154f
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: http://review.coreboot.org/1321
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-25 22:24:56 +02:00
Stefan Reinauer c0f2cfb0ac Fix comment to reference IvyBridge, too
On both SandyBridge and IvyBridge BCLK is fixed at 100MHz. Have the
comment reflect that.

Change-Id: Ia81c3501dc3e68cf3143c3bc864dfbf88901f9f9
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1336
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-25 22:24:27 +02:00
Stefan Reinauer 6d29c7352f Include SandyBridge Microcode when IvyBridge is enabled
.. in case the system has pluggable CPUs or might come in different SKUs.

Change-Id: I7a7cd95b4de5dd78370355f448688e8d000434c1
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1333
Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-25 22:23:40 +02:00
zbao dcc17ae370 AMD parmer: Set correct azalia code verb table
Change-Id: I0b10080deb971cdefa4d3916fabd40f5a81b11f4
Signed-off-by: Zheng Bao <zheng.bao@amd.com>
Signed-off-by: zbao <fishbaozi@gmail.com>
Reviewed-on: http://review.coreboot.org/1352
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-25 22:22:32 +02:00
zbao 3726670edf AMD family15tn: Add BIOS callback hook for getting VBIOS Image
This is for GfxInitSview(GnbSview.c). It would create warning message if it
could not get VBIOS image.

Change-Id: I3b2726f612b4b7a237644a4b63b56efad52b7ab5
Signed-off-by: Zheng Bao <zheng.bao@amd.com>
Signed-off-by: zbao <fishbaozi@gmail.com>
Reviewed-on: http://review.coreboot.org/1351
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-25 22:22:09 +02:00
zbao a36d8b38a6 AMD Family 15tn: Set the default return value as AGESA_SUCCESS instead of TRUE
The default return value should be AGESA_SUCCESS, which is zero. If it was set as TRUE,
the AGESA wrapper would think it was AGESA_UNSUPPORTED. That would make no sense. And it
would produce ASSERT warning in AGESA wrapper.

On my parmer board, with Engine sample processor, it can not create the correct DMI table.
Routine initlate will return AGESS_ERROR.
------Serial message---------
ASSERTION FAILED: file 'src/mainboard/amd/parmer/agesawrapper.c',  line 427
DmiTable:100123c3, AcpiPstatein: 10010126, AcpiSrat:0,AcpiSlit:0, Mce:100111ba, Cmc:1001127c,Alib:1001ccd4, AcpiIvrs:0 in agesawrapper_amdinitlate
agesawrapper_amdinitlate failed: 5
-----------------------------
I believe the processor with acceptable name string will create the right DMI.

Change-Id: Ie86955cf9affffc964a7c9f4a2c63077ef2030de
Signed-off-by: Zheng Bao <zheng.bao@amd.com>
Signed-off-by: zbao <fishbaozi@gmail.com>
Reviewed-on: http://review.coreboot.org/1350
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-25 22:21:24 +02:00
zbao 19a185448a AMD Family15tn: Set the mask of MTRR to 0000FFFXX0000800
Remove the warning message from linux dmesg,
mtrr: your BIOS has configured as incorrect mask, fixing it.

Change-Id: I355509db12ab10c33b7c1c23e2c7c4783f30e67e
Signed-off-by: Zheng Bao <zheng.bao@amd.com>
Signed-off-by: zbao <fishbaozi@gmail.com>
Reviewed-on: http://review.coreboot.org/1349
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-25 22:20:56 +02:00
zbao 405cfe219a Change multiply ONE_MB to bit shifting.
2048 * ONE_MB will cause warning,
src/northbridge/amd/agesa/family15tn/northbridge.c:667:50: warning: integer overflow in expression [-Woverflow]
I guess it will change the data type to signed integer.
I think the bit shifting is better.

Change-Id: I823f7ead1f7d622bf653cb3bf2ae2343f5e76805
Signed-off-by: Zheng Bao <zheng.bao@amd.com>
Signed-off-by: zbao <fishbaozi@gmail.com>
Reviewed-on: http://review.coreboot.org/1263
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-07-25 22:15:17 +02:00
Duncan Laurie ace7a6aadd SMM: rename tseg_fixup to tseg_relocate and export
This function is exported so it can be used in other
places that need similar relocation due to TSEG.

Change-Id: I68b78ca32d58d1a414965404e38d71977c3da347
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: http://review.coreboot.org/1310
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-07-25 22:09:19 +02:00
Stefan Reinauer 0aa5b0923a Fix date output in Microcode update
Date and time are mixed up:
microcode: updated to revision 0x12 date=2012-12-04
should be
microcode: updated to revision 0x12 date=2012-04-12

Change-Id: I85f9100f31d88bb831bef07131f361c92c7ef34e
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1334
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Tested-by: build bot (Jenkins)
2012-07-25 19:52:35 +02:00
Kimarie Hoot e6f459ca4b CougarPoint/PantherPoint: Add HM77 device ID to table
Change-Id: Ic5aada423d8e61abbebfcaaf5cb02ede80dfae02
Signed-off-by: Kimarie Hoot <kimarie.hoot@se-eng.com>
Reviewed-on: http://review.coreboot.org/1339
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
Tested-by: build bot (Jenkins)
2012-07-25 19:52:07 +02:00
Christian Gmeiner ac3aa096c9 Extend smbios api to allow runtime change of mainboard serial and version
This patch extends the current smbios api to allow changing mainboard
serial and version during coreboot runtime. This is helpful if you
have an EEPROM etc. to access these informations and want to add
some quirks for broken hardware revision for the linux kernel.
This could be done via DMI_MATCH marco.

Change-Id: I1924a56073084e965a23e47873d9f8542070423c
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-on: http://review.coreboot.org/1232
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-07-25 14:13:04 +02:00
Patrick Georgi 594473d75a Remove useless semicolon
Change-Id: Idc4d5737f5b49108987ca7fe90410d4e80b723f2
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/1354
Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Mathias Krause <minipli@googlemail.com>
Tested-by: build bot (Jenkins)
2012-07-25 12:26:33 +02:00
Stefan Reinauer be1ef2329e chromeos: Pass pointer to ChromeOS ACPI structure instead of VB Shared Data
coreboot used to pass some information to u-boot in the coreboot table
and other information in a modified flat device tree. Since the FDT code
was never upstreamed and removed from our tree, u-boot was changed to
get the information it needs from the coreboot table alone. However,
in the process of this change only the vboot shared data structure was
passed on by coreboot, so when u-boot tried to update the ChromeOS
specific ACPI entries, it would accidently overwrite the vboot data.
This patch passes on the ChromeOS specific ACPI data structure instead
of the vboot shared data. Another change to u-boot will teach it how
to get to the vboot shared data from there.

Change-Id: Ifbb64eafc0d9967887b4cdeebf97d0c4ce019290
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1282
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-07-25 08:31:39 +02:00
zbao d59d62484d sync the northbridge.c with other family.
Change-Id: Ice4d0202590fca0169dcda2770ca6add166b5c13
Signed-off-by: Zheng Bao <zheng.bao@amd.com>
Signed-off-by: zbao <fishbaozi@gmail.com>
Reviewed-on: http://review.coreboot.org/1262
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-25 01:18:03 +02:00
Stefan Reinauer 8d32b89fa4 Fix LAPIC timer on Ivy Bridge systems
The LAPIC timer is running at BCLK (100MHz) on Sandy Bridge and Ivy
Bridge systems. However, the current timer code assumed that the clock
would run at 200MHz instead. This made all delays twice as long as
needed.

Change-Id: I41b1186daee11cfd9a25b3a9d5ebdeeb271293c7
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1330
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
Tested-by: build bot (Jenkins)
2012-07-25 01:17:26 +02:00
Duncan Laurie f4d362339f ELOG: Add support for a monotonic boot counter in CMOS
This maintains a 32bit monotonically increasing boot counter
that is stored in CMOS and logged on every non-S3 boot when
the event log is initialized.

In CMOS the count is prefixed with a 16bit signature and
appended with a 16bit checksum.

This counter is incremented in sandybridge early_init which is
called by romstage.  It is incremented early in order notice
when reboots happen after memory init.

The counter is then logged when ELOG is initialized and will
store the boot count as part of a 'System boot; event.

Reboot a few times and look for 'System boot' events in the
event log and check that they are increasing.  Also verify
that the counter does NOT increase when resuming from S3.

171 | 2012-06-23 16:02:55 | System boot | 285
176 | 2012-06-23 16:26:00 | System boot | 286
182 | 2012-06-23 16:27:04 | System boot | 287
189 | 2012-06-23 16:31:10 | System boot | 288

Change-Id: I23faeafcf155edfd10aa6882598b3883575f8a33
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: http://review.coreboot.org/1315
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-25 00:47:10 +02:00
Duncan Laurie 472ec9cd7e ELOG: Add support for generating SMBIOS type15 table
This standared SMBIOS 0able describes the location and format
of the event log to the OS and applications.  In this case the
pointer is a 32bit physical address pointer to the log in
memory mapped flash.

Look for SMBIOS type15 entry with 'dmidecode -t 15'

Handle 0x0004, DMI type 15, 23 bytes
System Event Log
        Area Length: 4095 bytes
        Header Start Offset: 0x0000
        Header Length: 8 bytes
        Data Start Offset: 0x0008
        Access Method: Memory-mapped physical 32-bit address
        Access Address: 0xFFB6F000
        Status: Valid, Not Full
        Change Token: 0x00000000
        Header Format: OEM-specific
        Supported Log Type Descriptors: 0

Change-Id: I1e7729e604000f197e26e69991a2867e869197a6
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: http://review.coreboot.org/1314
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-25 00:46:56 +02:00
Stefan Reinauer 696262bd99 More descriptive error messages in Sandybridge raminit code
MRC returns specific error codes; print the according error
message if we know what it means.

Change-Id: Iaaf1512b9d577d4291fccfb94d879043ab5b11b5
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1289
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-25 00:35:45 +02:00
Stefan Reinauer 0c32c9795b bd82x6x: Drop unneeded pci_dev_t
This was introduced when porting the SPI driver over from u-boot but it
is not needed. Hence drop the extra typedef and use device_t instead.

Change-Id: I3ab797a8e482d1c9aa1d004e488e99aeaffcdd8b
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1331
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
Tested-by: build bot (Jenkins)
2012-07-25 00:35:10 +02:00
Duncan Laurie 9c4c6ab0c8 ELOG: Fix boot count increment for non-wake case
The count was only incrementing for a wake from S5 and
it was not incrementing in the normal reboot case.

Change-Id: I73bc6db6bd02e6c4677f7e44a5c098c6dcb51747
Signed-off-by: Duncan Laurie <dlaurie@google.com>
Reviewed-on: http://review.coreboot.org/1328
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-24 23:52:30 +02:00
Duncan Laurie fe7b5d2fa6 Ivybridge: fix workaround and enable PAIR
MCHBAR 0x5f10[7:0] should be set to 0x30 for ivybridge
and 0x20 for sandybridge.  Move this code to ramstage
and set it per-chipset.

Power Aware Interrupt Routing is supported in ivybridge,
enable it and set fixed priority.

Boot on ivybridge device and read MCHBAR 0x5f10:

mmio_read8 0xfed15f10
0x30

And verify PAIR is enabled (bit4=1):

mmio_read8 0xfed15418
0x24

Change-Id: If017d5ce2bd5ab5092c86f657434f2b645ee6613
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: http://review.coreboot.org/1303
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-24 23:50:59 +02:00
Duncan Laurie 22935e1f43 CPU: Set flex ratio to nominal TDP ratio in bootblock
CPUs with configurable TDP will run the TSC at the max non-turbo
ratio for the maximum TDP value, which can cause issues if another
TDP is desired.  To deal with this we set the flex ratio to the
nominal TDP ratio early in the boot and then configure the Soft
Reset Data registers so the PCH can tell the CPU what frequency
to run at after a reset.

This is done very early in the bootblock because it is necessary
to reset the system after setting a flex ratio.

The end result is that the TSC will now increment at the max
non-turbo frequency for the nominal TDP.

On some system with 1.8GHz CPU ensure that the kernel
detects the CPU speed as ~1800mhz rather than ~2300mhz:

> dmesg | grep "MHz processor"
[    0.004000] Detected 1795.801 MHz processor.

Change-Id: I8436dced9199003b6423186a2b041e3f7b84ab8c
Signed-off-by: Duncan Laurie <dlaurie@google.com>
Reviewed-on: http://review.coreboot.org/1329
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-24 23:49:47 +02:00
Duncan Laurie 51cb26d92a SMM: Fix state save map for sandybridge and TSEG
There are enough differences that it is worth defining the
proper map for the sandybridge/ivybridge CPUs.  The state
save map was not being addressed properly for TSEG and
needs to use the right offset instead of pointing in ASEG.

To do this properly add a required southbridge export to
return the TSEG base and use that where appropriate.

Change-Id: Idad153ed6c07d2633cb3d53eddd433a3df490834
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: http://review.coreboot.org/1309
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-24 23:49:28 +02:00
Duncan Laurie 181bbdd51c SMM: Add option for SPI driver to be available in SMM
- add Kconfig option for CONFIG_SPI_FLASH_SMM
- compile subsystem and chip drivers for smm if enabled
- change mdelay(1) to udelay(500) since mdelay is not defined
  in SMM and a 1ms delay is worth avoiding
- make flash chip structure non-const so the probe function
  pointers can be relocated for use in TSEG
- Make SMM PCI access possible in southbridge SPI code

Change-Id: Icfcbbe8e4e56658769d46af0b5bf6c79a6432641
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: http://review.coreboot.org/1313
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-24 23:44:40 +02:00
Duncan Laurie f5e9ac48c6 SMM: Add support for malloc in SMM if using TSEG
This is used by the SPI driver and ELOG.

It requires SMM TSEG and a _heap/_eheap region defined in the
linker script.  The first time malloc is called in SMM the
start and end pointers to the heap region will be relocated
for the TSEG region.

Enable SPI flash and ELOG in SMM and successfully
allocate memory.  The allocated addresses are verified
to be sure they are within the TSEG heap region:

smm.elf:00014000 B _eheap
smm.elf:00010000 B _heap
TSEG base is 0xad000000

Memory allocated in ELOG:
ELOG: MEM @0xad018030

Change-Id: I5cca38e4888d597cbbfcd9983cd6a7ae3600c2a3
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: http://review.coreboot.org/1312
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-24 23:44:19 +02:00
Duncan Laurie 7d2b81c18d ELOG: Add support for flash based event log
This is based around the SMBIOS event log specification but
expanded with OEM event types to support more specific and
relevant system events.

It requires flash storage and a minimum 4K block (or flash block
size) that should be allocated in the FMAP.

A copy of the event log is maintained in memory for convenience
and speed and the in-memory copy is written to flash at specific
points.

The log is automatically shunk when it reaches a configurable
full threshold in order to not get stuck with a full log that
needs OS help to clear.

ELOG implements the specification published here:
http://code.google.com/p/firmware-event-log/wiki/FirmwareEventLogDesign

And is similar to what we use in other firmware at Google.
This implementation does not support double-buffered flash
regions.  This is done because speed is valued over the log
reliability and it keeps the code simpler for the first version.

This is a large commit and by itself it just provides a new
driver that is made available to coreboot.  Without additional
patches it is not very useful, but the end result is an event
log that will contain entries like this:

171 | 2012-06-23 16:02:55 | System boot | 285
172 | 2012-06-23 16:02:55 | EC Event | Power Button
173 | 2012-06-23 16:02:55 | SUS Power Fail
174 | 2012-06-23 16:02:55 | System Reset
175 | 2012-06-23 16:02:55 | ACPI Wake | S5

Change-Id: I985524c67f525c8a268eccbd856c1a4c2a426889
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: http://review.coreboot.org/1311
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-24 23:43:39 +02:00
Duncan Laurie d2e00b92ce SMM: Add heap region and move C handler higher in region
In order to support SPI and ELOG drivers the SMM region
needs to be able to be larger than the previous allocation
below 0x7400.  Now that we have support for 4M TSEG we do
not need to live in this region.

This change adds a 16KB heap region abofe the save state area
at TSEG+64KB and moves the C handler above this.

The heap region is then available for malloc and the C handler
can grow to support flash and event log features.

While updating the memory map comment in assembly stub I also
added a pause instruction to the cpu spin lock as this was
added to the C code in latest upstream rebase.

Dump sympbols from smm.elf binary to see the new regions:

00010000 B _heap
00014000 B _eheap
00014000 T _smm_c_handler_start
0001b240 T _smm_c_handler_end

Change-Id: I45f0ab4df1fdef3b626f877094a58587476ac634
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: http://review.coreboot.org/1308
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-24 23:40:54 +02:00
Duncan Laurie 4e4320f524 CPU: Update ivybridge PP1 current limit value
The BWG says ivybridge current limit for PP1 is 50A.

Verify the PP1 current limit value on link device:

> echo $(( ( $(rdmsr 0 0x602) & 0x1fff ) >> 3 ))
50

Change-Id: I946269d21ef605f2525fe03993f569d69128294b
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: http://review.coreboot.org/1305
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-24 23:39:58 +02:00
Duncan Laurie 77dbbac7e7 CPU: Add basic support for Nominal Configurable TDP
Ivybridge B0+ CPUs are capable of supporting multiple TDP levels.
This complicates the default case because now the registers that
were reporting max non-turbo ratio are reporting that value for
the highest possible TDP level.

For now this change just forces everything to use the Nominal TDP
values instead of the higher (or lower) levels.

- When building P-state tables, determine the P[1] (max non turbo)
ratio based on the Nominal ratio if available.
- Set the turbo activation ratio to the Nominal max ratio.
- Mirror the power level settings in new MCHBAR register after
they are written, which happens after BIOS_RESET_CPL is set.
- Set the current ratio to Nominal ratio at boot.

1) Verify that P-state table is generated properly with
P[0]=1801MHz (ratio 0x1C) and P[1]=1800MHz (ratio 0x12)

PSS: 1801MHz power 17000 control 0x1c00 status 0x1c00
PSS: 1800MHz power 17000 control 0x1200 status 0x1200

2) Verify power limits in MCHBAR match PKG_POWER_LIMIT:

> rdmsr 0 0x610
0x800080aa00dc8088
> mmio_read32 0xfed159a4
0x000080aa
> mmio_read32 0xfed159a0
0x00dc8088

3) Verify turbo activation ratio is set to nominal ratio:

> rdmsr 0 0x64c
0x0000000000000012

4) Check that proper ratio was set at boot on one core only:

> grep 'frequency set to' /sys/firmware/log
model_x06ax: frequency set to 1800
model_x06ax: frequency set to 1800
model_x06ax: frequency set to 1800
model_x06ax: frequency set to 1800

Change-Id: I592e60a7740f31b140986a8269dca91b4adbb270
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: http://review.coreboot.org/1304
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-24 23:39:44 +02:00
Stefan Reinauer b91a0f2b83 Rename cache_lbmem() to cache_ramstage()
... and don't require it to specify a cache type.
This function is only used on romcc boards, and should go away
(because all boards should be switched to CAR)

Change-Id: Ic32ca3be1afffc773c72c140e88b338d48a0c8ca
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1288
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-24 23:30:00 +02:00
Ronald G. Minnich 9764d4c690 Implement stack overflow checking for the BSP
Previous patches implemented stack overflow checking for the APs.
This patch builds on the BSP stack poisoning patch to implement
stack overflow checking for the BSP, and also prints out maximum
stack usage. It reveals that our 32K stack is ridiculously oversized,
especially now that the lzma decoder doesn't use a giant 16K on-stack
array.

Break the stack checking out into a separate function, which
we will later use for the APs.

CPU0: stack from 00180000 to 00188000:Lowest stack address 00187ad8

To test failure, change the DEADBEEF stack poison value in c_start.S
to something else. Then we should get an error like this:
Stack overrun on BSP.Increase stack from current 32768 bytes
CPU0: stack from 00180000 to 00188000:Lowest stack address 00180000

Separate the act of loading from the act of starting the payload. This
allows us better error management and reporting of stack use. Now we
see:
CPU0: stack from 00180000 to 00188000:Lowest stack address 00187ad8

Tested for both success and failure on Link. At the same time, feel free
to carefully check my manipulation of _estack.

Change-Id: Ibb09738b15ec6a5510ac81e45dd82756bfa5aac2
Signed-off-by: Ronald G. Minnich <rminnich@chromium.org>
Reviewed-on: http://review.coreboot.org/1286
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-24 23:29:12 +02:00
Stefan Reinauer 9842ad8ac5 Fix automatic ME detection in finalize
The ME needs to be talked to through the PCIe memory mapped config
space.

Change-Id: Ic2c5a572a126722a08a82d95df13d11507586c6b
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1284
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-24 23:28:47 +02:00
Stefan Reinauer a306ad701e ChromeOS: Remove board specific acpi_get_vdat_info()
The function acpi_get_vdat_info() was moved to the ChromeOS
vendor code, and is no longer required to be present for each
board. Hence, remove it.

Change-Id: I3dc8dbb6119ceffa057373bad7c0058ac0d40eb8
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1283
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-24 23:17:56 +02:00
Stefan Reinauer 998f3a27be Cougar/Panther Point: Compile in ME7 and ME8 code at the same time
In the short term there might be devices with Sandy Bridge CPUs
on mainboards with Panther Point PCHes. While this configuration
option is perfectly valid, coreboot currently ties Sandy Bridge to
Cougar Point and Ivy Bridge to Panther Point. One occurence is in
the ME handling code.

To make coreboot most flexible, compile both ME handlers into
coreboot and decide at runtime which one to use.

Change-Id: Icffe2930873f67c99c3f73e37e7a967f4f002b88
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1280
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-24 23:17:17 +02:00
Stefan Reinauer 49058c0adf Fix ME hash functions on Panther Point/Cougar Point
- On Cougar Point there may have been stack corruption during the
  ME hash verification
- On Panther Point the ME firmware hash was not passed on to the
  OS

Change-Id: I73fc10db63ecff939833fb856a6da1e394155043
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1279
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-24 23:16:29 +02:00
Vadim Bendebury 999e94cb7a Config changes to support microcode in CBFS
Nothing is yet enabled, this is just a config skeleton change.

The MICROCODE_INCLUDE_PATH definition is going to be used by the
Makefile building the microcode blob for CBFS inclusion.

Change-Id: I7868db3cfd4b181500e361706e5f4dc08ca1c87d
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: http://review.coreboot.org/1292
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-24 23:15:35 +02:00
Marc Jones 48c6bae1f2 Add BAR address debug information to Oxford PCIe serial driver
The Oxford PCIE Serial card has a hardcoded address at setup,
which may be moved during PCI Init. The driver re-initializes
after PCI init. Add a debug print for the new BAR address.

Initializing Oxford OXPCIe952
OXPCIe952: Class=70002 Revision ID=0
OXPCIe952: 2 UARTs detected.
OXPCIe952: Uart Bar: 0xe0800000

Change-Id: I1858d3eba09749cba3c3869060d00e621dca112a
Signed-off-by: Marc Jones <marc.jones@se-eng.com>
Reviewed-on: http://review.coreboot.org/1327
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-24 22:48:07 +02:00
Vadim Bendebury 39fea6e2a8 Add microcode blob processing
When microcode storage in CBFS is enabled, the make system is supposed
to generate the microcode blob and place it into the generated ROM
image as a CBFS component.

The microcode source representation does not change: it is still an
array of 32 bit constants. This new addition compiles the array into a
separate object file and then strips all sections but data.

The raw data section is then included into CBFS as a file named
'microcode_blob.bin' of type 0x53, which is assigned to microcode
storage.

Change-Id: I84ae040be52f520b106e3471c7e391e64d7847d9
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: http://review.coreboot.org/1295
Tested-by: build bot (Jenkins)
2012-07-24 22:18:04 +02:00
Vadim Bendebury 537b4e09e6 Add code to read Intel microcode from CBFS
When CONFIG_MICROCODE_IN_CBFS is enabled, find the microcode blob in
CBFS and pass it to intel_update_microcode() instead of using the
compiled in array.

CBFS accesses in pre-RAM and 'normal' environments are provided
through different API.

Change-Id: I35c1480edf87e550a7b88c4aadf079cf3ff86b5d
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: http://review.coreboot.org/1296
Tested-by: build bot (Jenkins)
2012-07-24 22:15:19 +02:00
Marc Jones ef6b08cc48 Add PCIe port disable debug message
The PCIe device enable function prints when it disables a device.
The PCIe ports(bridges) use a different routine that didn't print
the message. Add it to be consistent and to provide better debug
output.

Change-Id: I8462c48e7f4930db68703f0bfb710c01c9643a98
Signed-off-by: Marc Jones <marc.jones@se-eng.com>
Reviewed-on: http://review.coreboot.org/1326
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
Tested-by: build bot (Jenkins)
2012-07-24 21:40:44 +02:00
Stefan Reinauer d81744ea86 Make MAX_PHYSICAL_CPUS invisible on non-AMD boards
It's only used on AMD based boards. Hence drop it, so we don't
accidently start using it by mistake instead of MAX_CPUS

Change-Id: Id8f522f24283129874d56e70bd00df92abe9c3cf
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1325
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-24 21:31:28 +02:00
Stefan Reinauer 9d3e832c72 bd82x6x: 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).

Modelled after http://review.coreboot.org/#/c/444

Change-Id: I2b8461dff1ae085c1ea4b4926084268b4da90321
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1323
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-07-24 20:09:46 +02:00
Vadim Bendebury df0c822239 Rename microcode include file to be model agnostic
In preparation to support CBFS hosted microcode blobs, this change
renames the wrapper include file containing the microcode to be
independent of CPU model.

Change-Id: If1a4963a52e5037a3a3495b90708ffc08b23f4c1
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: http://review.coreboot.org/1294
Tested-by: build bot (Jenkins)
2012-07-24 19:54:41 +02:00
Vadim Bendebury 8bdbddfeea Fix function generating GPIO state based vector
The function was too eager shifting stuff around, this change corrects
the problem.

Change-Id: I4c13dbe86cb627835dae05bb74af9867c28e143d
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: http://review.coreboot.org/1291
Tested-by: build bot (Jenkins)
2012-07-24 19:53:28 +02:00
Stefan Reinauer 6097e193fc Make ACPI code detect Sandy/Ivy Bridge dynamically
On systems with socketed CPUs we want to be able to
drop in a Sandy Bridge or Ivy Bridge CPU without recompiling the
firmware. Hence, detect the north bridge dynamically. In order
for this to work, we need Ivy Bridge MRC and coreboot configured
for Ivy Bridge.

Change-Id: I635bef2c61d47d36a3fdd87f8ecb6e69097ba969
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1281
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-07-24 19:53:13 +02:00
Ronald G. Minnich 3a8cad3c14 Shrink the stack sizes we need in coreboot
We accomplish this goal by getting rid of the huge auto array in the
ram stage. This will in turn let us reduce CONFIG_STACK_SIZE.

We have to leave it on the stack in CAR as that's the simple way to
keep it private. It does not matter then as there is only one core
that is active.

Change-Id: Ie37a057ccae088b7f3bb4aab6de2713e64d96df6
Signed-off-by: Ronald G. Minnich <rminnich@chromium.org>
Reviewed-on: http://review.coreboot.org/1271
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-24 19:52:53 +02:00
Duncan Laurie 3f6a4d7164 Add specific power management init code for PantherPoint
There are enough subtle differences in the magic values that
it is easier to make a separate function.

This fixes a reset hang with pantherpoint chipset.

Change-Id: I02b03cb37e5fd5ee2fd62067644f0a62dc2cd26a
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: http://review.coreboot.org/1322
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Tested-by: build bot (Jenkins)
2012-07-24 19:06:17 +02:00
Stefan Reinauer afcaac2db5 Drop (empty) sandybridge_late_initialization()
The function is empty (a left-over from i945) and should be removed.

Change-Id: I91e573b5e37cb9133ea1037aef7e6daf3c292864
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1290
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-07-24 15:54:43 +02:00
Duncan Laurie b405857bef Remove CMOS Extended range enable from romstage
This enable step has been moved to the bd82x6x bootblock.

For Samsung Stumpy and Lumpy mainboards and the
Intel EmeraldLake2 reference board.

Change-Id: I5ce54f57b8e1dd732c8a5ae71d7511703de91a0e
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: http://review.coreboot.org/1307
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
Tested-by: build bot (Jenkins)
2012-07-24 15:00:59 +02:00
Duncan Laurie 8e515d36b4 RTC: Enable extended CMOS in the bootblock
This makes it available early in romstage without having to
worry when the different romstagse enable it.

Check for extended CMOS to be enabled in early romstage.

This is used by a later commit which uses the extended
CMOS region for stoage.

Change-Id: I9e026d48499c63d6503c2b020d4cc3047126fa93
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: http://review.coreboot.org/1306
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-07-24 15:00:54 +02:00
Stefan Reinauer 9a380abaa2 bd82x6x: Convert all PCI ID lists to new scheme
- Convert all PCI ID lists to new scheme
- Unify code (variable names)
- add missing PCI IDs for Panther Point PCIe root ports.

Change-Id: I6357f6ebce7ddffe45a3ec642b0c594147f6134c
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1301
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-07-24 12:26:33 +02:00
Stefan Reinauer baae2d2761 Add support for HM70 and NM70 LPC bridge
This lets the SPI driver and the LPC driver know about HM70 and NM70.

Change-Id: Id2f1e0e5586a2f7200b2d24785df3f2be890da98
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1300
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-07-24 12:26:26 +02:00
Christian Gmeiner b5dfcae097 cs5536: add smbus support in ramstage
With this patch it is possible to use the smbus in ramstage. The
biggest part of the patch is a simple code split into a general
part (smbus.h) and the concrete users (early_smbus.c and cs5536.c).
After the switch from romstage to ramstage the smb base address
has changed, but that is no problem as the new base address is
stored in bar0 of the ISA bridge. It could also be read via msr,
but via PCI it is simpler. I used the following patch as
reference on how to readout the new base address:
http://lists.laptop.org/pipermail/commits-kernel/2006-November/000178.html

Change-Id: I9f86a1e474368c62f9ed3a95edfb3e63117aa156
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-on: http://review.coreboot.org/1243
Tested-by: build bot (Jenkins)
Reviewed-by: Marc Jones <marcj303@gmail.com>
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-07-24 12:18:28 +02:00
Marc Jones fa418e3c66 Add uartmem_init prototype.
The oxpcie ramstage code calls uartmem_init after the PCI memory
allocation, but hte function was static and didn't have a prototype.

Change-Id: Iabc1a3d248aeaed29aaaa22504defac97c572326
Signed-off-by: Marc Jones <marc.jones@se-eng.com>
Reviewed-on: http://review.coreboot.org/1285
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-07-24 12:17:21 +02:00
Duncan Laurie c8c836f58e RTC: Add defines for standard clock offsets
ELOG reads from RTC to build timestamp structure,
the resulting timestamp is decoded when printing events.

Change-Id: If26552074f18de5095b967b875a0ac1d815a5b31
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: http://review.coreboot.org/1302
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
Tested-by: build bot (Jenkins)
2012-07-24 11:42:34 +02:00
Stefan Reinauer 542e9628ae Print PCI ID of PCH during boot up
Right now, if we have an unknown PCH, coreboot will print something like
this:

PCH type: Unknown rev id 4

Instead, it should also print the PCI ID of the device, so we can add it
to the list of known PCHes.

Change-Id: Ib0b96e287c36d2895d1287b1734ca13d75e7985a
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1287
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-07-24 11:34:56 +02:00
Stefan Reinauer c664387082 Drop leading spaces from CPU name string
This is as per Intel's suggestion on how to display their name strings.

Change-Id: Ie82341305e58baa8041e50a61a11b395fa7d9582
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1298
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
Tested-by: build bot (Jenkins)
2012-07-24 10:13:24 +02:00
Duncan Laurie b38e0c3509 Properly identify ACPI C3 states in _CST table.
Dump and disassemble ACPI tables and look in _CST.

In the last entry the state was getting set to 0:

Package (0x04)
{
  ResourceTemplate ()
  {
    Register (FFixedHW,
              0x01,               // Bit Width
              0x02,               // Bit Offset
              0x0000000000000030, // Address
              0x01,               // Access Size
              )
  },
  0x00000000,                     // State
  0x0000005A,                     // Latency
  0x000000C8                      // Power
}

Now it is properly identifed as state 3:

Package (0x04)
{
  ResourceTemplate ()
  {
    Register (FFixedHW,
              0x01,               // Bit Width
              0x02,               // Bit Offset
              0x0000000000000030, // Address
              0x01,               // Access Size
              )
  },
  0x00000003,                     // State
  0x0000005A,                     // Latency
  0x000000C8                      // Power
}

Change-Id: Ie0a68606c5a43ac5fb5ba7bb9a3fef933ad67b64
Signed-off-by: Duncan Laurie <dlaurie@google.com>
Reviewed-on: http://review.coreboot.org/1297
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
Tested-by: build bot (Jenkins)
2012-07-24 10:13:06 +02:00
Stefan Reinauer 52e61183cc Remove unused free() function
Since coreboot is running very short, we don't free memory.
Hence, drop (dummy) free()

Change-Id: I6e2737f07c6b9f73ebfad7d124b97a57cb7454a3
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1274
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-24 08:38:21 +02:00
Vadim Bendebury fe5539c041 Add standard header to prevent multiple inclusion
This include file needs to be prevented from being included multiple
times.

Change-Id: I42e0cbe38d332b919f22e331eaf7a0251929e1dc
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: http://review.coreboot.org/1293
Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Tested-by: build bot (Jenkins)
2012-07-24 08:37:22 +02:00
Stefan Reinauer 2198c583b2 Move GGL0001 ACPI code to generic ChromeOS code
The only difference in this code on all our platforms is the array
describing the GPIOs. Hence, only keep that array in the mainboard
ChromeOS directory and move everything else to generic ChromeOS ACPI
code.

Change-Id: I9fc75842af64530c1255bea1c5f803c5316d6da6
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1278
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-07-24 08:36:03 +02:00
Stefan Reinauer 48214899c3 Fix MRC cache update delays
When no valid MRC cache area is found, the mrc_cache data structure
was used without prior initialization. This sometimes caused a long
delay when booting because compute_ip_checksum would checksum up to
4GB of memory.

Change-Id: I6a0ca1aa618838bbc3d042be425700fc34b427f2
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1277
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-24 06:55:35 +02:00
Ronald G. Minnich 305b19dd7a Remove code that enables/disables VMX in coreboot on chromebooks.
There are several reasons for this:
1. It's a core setting, not a platform setting, which is bizarre. But,
we disable vmx via an SMI, and that only happens on core 0.
Hence, the code did not correctly make the same settings on all cores-
one had them disabled, the others were in an unknown state.
When (e.g.) kvm started on a vmx-enabled core, then moved to a
vmx-disabled core, the processor would reset *very* quickly.
Changing this would be messy.

2. On the CPU on link, there is something about trying to set the lock
bit that is getting a GPF.

3. It's the wrong place and time to set it. Once controlled, they can't
be changed in the kernel. The kernel is what should control this
feature, not the BIOS, as we have learned time and time again. If
somebody is in as root and can start a VM, you have a lot more to
worry about than someone starting a guest virtual machine.

Change-Id: I4f36093f1b68207251584066ccb9a6bcfeec767e
Signed-off-by: Ronald G. Minnich <rminnich@chromium.org>
Reviewed-on: http://review.coreboot.org/1276
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-24 06:54:59 +02:00
Stefan Reinauer 28190ce4de malloc/memalign: Remove unneeded linker check
This check got in the code when some Linux distros shipped broken linkers
around 1999.
Since then, the code around that check was changed, and it does not make
sense anymore to have this check.

Change-Id: I37c6b690d72f55c18ba4c34e8541a6a441e5e67a
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1275
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-24 02:39:20 +02:00
Stefan Reinauer 5f3aca39d3 SPI flash layer: remove unused function spi_flash_free()
We don't ever free memory in coreboot, hence drop spi_flash_free() and
spi_free_slave()

Change-Id: I0ca3f78574ceb4516e7d33c06ab1a58abfb3b0ec
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1273
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-24 02:37:39 +02:00
Stefan Reinauer 0067188739 MTRR: drop repetetive debug message
It's not really useful anymore I guess, and it makes the log files
harder to read. Hence dropping it.

Change-Id: If4c3e8b40ae491ca527ef62f8145206960f6579d
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1272
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-24 02:37:06 +02:00
Ronald G. Minnich 79431f5f09 Make memalign print useful messages on failure
Brevity is the soul of wit, except for error messages;
then it's a sign of witlessness. I can say this because
this error message may be my fault, although it is lost
in the 20th century code base so who knows.

Anyway, when memalign dies, it's not a bad idea to have
a lot of information about what went wrong. So instead
of the terse single bit of "something failed" this patch
changes things to be a bit more useful.

Change-Id: I8851502297e0ae9773912839ebfdf4f9574c8087
Signed-off-by: Ronald G. Minnich <rminnich@chromium.org>
Reviewed-on: http://review.coreboot.org/1270
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Tested-by: build bot (Jenkins)
2012-07-24 00:43:38 +02:00
Walter Murphy 496f4a0c83 SandyBridge: Add another PCI device ID for northbridge
Change-Id: I153579561f7eed6d4befd74ff39e1a5e778d0e46
Signed-off-by: Walter Murphy <wmurphy@google.com>
Reviewed-on: http://review.coreboot.org/1269
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Tested-by: build bot (Jenkins)
2012-07-24 00:14:23 +02:00
Duncan Laurie da83a5f18e Fixes to enable RC6 on IvyBridge
- The unneeded poll on non-MT force-wake bit was timing out
and causing the gma_pm_init_pre_vbios() function to exit
early so it was not preparing PM registers properly.
I changed the gtt_poll() calls to not return on timeout
unless it can't proceed so we don't see half-initialized
registers.

- RC6+ (Deep Render Standby) is not working reliably so we
can just enable RC6 in the BIOS and let the kernel decide
if it wants to enable RC6+ later.

This Kernel message is new in kernel 3.4:
[drm] Enabling RC6 states: RC6 on, RC6p off, RC6pp off

Change-Id: I69d005ba56be8c7684a4ea1133a1d761f7c07acc
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: http://review.coreboot.org/1268
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-24 00:02:55 +02:00
Stefan Reinauer ac2ec34fd2 Re-initialize Local APIC timer on APs
In order to be able to use udelay in code running on AP cores
the timer has to be initialized on the according local APICs
or the system will just hang when udelay is used.

Change-Id: I776bc96aa6d876ff2582d0c05cbc9c7611cb06b5
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1267
Tested-by: build bot (Jenkins)
Reviewed-by: Sven Schnelle <svens@stackframe.org>
2012-07-23 20:58:29 +02:00
Kyösti Mälkki 505414a6cf AMD and GFXUMA: drop redundant use of lb_add_memory_range()
Use of uma_resource() in AMD northbridge code created a memory
resource marked as reserved. Such resources are removed
from system memory in write_coreboot_table().

Change-Id: Ib5e49e851d6622d8ece9d6d612e245b3962b9167
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/1233
Tested-by: build bot (Jenkins)
Reviewed-by: Rudolf Marek <r.marek@assembler.cz>
2012-07-23 17:44:13 +02:00
Patrick Georgi ce6e9fed2e i945: Disable IGD if plugin VGA is preferred
It's shut down, but UMA memory is not reclaimed. A later extension
could optionally do the magic register dance that allows initialization
of IGD as secondary graphics device.

Change-Id: I2a92bb71755005b886a8e1825325c678a9991bf2
Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com>
Reviewed-on: http://review.coreboot.org/1252
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-07-22 17:01:29 +02:00
Jukka Rantala a555e55d15 AMD CPUs: Updated CPU list in powernow_acpi.c
Updated P state table to make frequency scaling work.
Added these CPUs: http://support.amd.com/us/Processor_TechDocs/30430.pdf
Also wrote a Python script for parsing AMD docs,
but not sure where to put it: http://pastebin.com/1dSvkXwc

Change-Id: I8f08111b73b9be551f3f59d2acb15051ccf36c1e
Signed-off-by: Jukka Rantala <jukka.rantala@gmail.com>
Reviewed-on: http://review.coreboot.org/1244
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-22 17:01:13 +02:00
Patrick Georgi 557ecf2d31 Simplify VGA card discovery
We were handling vga, vga_first, vga_last, vga_onboard just to determine
an onboard chip and the first plugin card.
We were also traversing the devices manually instead of using the utility
functions we have, for the chance that there are non-VGA cards we need to
cope with (but why would they require VGA-style handling?)

Change-Id: I8aa73aefa102725a64287f78a59de3d5dda1c7f2
Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com>
Reviewed-on: http://review.coreboot.org/1255
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-07-22 13:10:44 +02:00
zbao 323a923695 Mainboard Parmer based on Trinity
Parmer has.
1. Trinity, Socket FS1R2.
2. Hudson A75.
Ubuntu has been validated on Parmer. S3 is supported.

Change-Id: I1a6932d0ca9f7abe78dc24d3bc238a4b5a48281b
Signed-off-by: Zheng Bao <zheng.bao@amd.com>
Signed-off-by: zbao <fishbaozi@gmail.com>
Reviewed-on: http://review.coreboot.org/1158
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-22 13:10:02 +02:00
zbao 6db7f348ea Trinity wrapper code improvement.
Set the default location of hudson firmware to 3rdparty.
Move UMA code from mainboard to northbridge.

Change-Id: I11afea0c7fd04aa84a629dc762704c42baf002df
Signed-off-by: Zheng Bao <zheng.bao@amd.com>
Signed-off-by: zbao <fishbaozi@gmail.com>
Reviewed-on: http://review.coreboot.org/1241
Tested-by: build bot (Jenkins)
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-22 13:09:41 +02:00
Nico Huber 8bacc40fc7 Fix udelay() implementation for i945 romstage
Work around 32-bit overflow with 64-bit multiplication. Calculate
correct CPU frequency.

Change-Id: I86d78f2d70b9f9c62fd4e1e0d765e92e4de83f67
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: http://review.coreboot.org/1254
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-07-20 23:41:38 +02:00
Patrick Georgi 5869fa2e63 Allow shutting down internal graphics if plugin graphics are preferred
VGA is this part-legacy thing that can cause trouble...

For this, introduce device_t->disable(dev) method, in which a driver
can take care to deregister the device if necessary.

Change-Id: I3fecec07f402e530458b79eda30b2c274101fefa
Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com>
Reviewed-on: http://review.coreboot.org/1251
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-07-20 23:38:51 +02:00
Patrick Georgi c4b2a1b6de Allow YABEL to fake write accesses to config space
A new Kconfig option tells YABEL to succeed on write accesses
on other devices' config space without performing the actual
write.
This is enough for some basic bus modification done by some
Option ROMs.

Change-Id: Iab04f3a5c350b96654da4ba26858037f4c4b5c0a
Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com>
Reviewed-on: http://review.coreboot.org/1249
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-07-20 23:37:55 +02:00
Patrick Georgi bcdbe90296 Drop VGA_BRIDGE_SETUP config option
It defaults to true, and isn't disabled anywhere in the tree.
I also couldn't think of a case where it's actually useful.

Change-Id: I126a47625d5294f3cfff225629f2a948a83c9b7e
Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com>
Reviewed-on: http://review.coreboot.org/1250
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-07-20 23:36:22 +02:00
Kyösti Mälkki cda9f93965 Intel SCH northbridge: fix resource index
Change-Id: If131ac9df89080faccd8ed952d6fc019483b5b2e
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/1237
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-07-20 01:53:06 +02:00
zbao 7a6bdd213a Add missing quote.
Remove the menuconfig warning which comes up every time.
src/mainboard/asus/Kconfig:85:warning: multi-line strings not supported

Change-Id: I0ec0a0b625a33edd1d9b250a26aa3e0f42142eca
Signed-off-by: Zheng Bao <zheng.bao@amd.com>
Signed-off-by: zbao <fishbaozi@gmail.com>
Reviewed-on: http://review.coreboot.org/1240
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-07-19 08:01:01 +02:00
Kyösti Mälkki 07284633d8 AMD northbridges: drop dead code
Change-Id: I03949722ac3a127319a0ad3f812d77ba7b8f139f
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/1187
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-07-18 10:31:08 +02:00
Kyösti Mälkki 1171986627 Drop invalid device ops on Agesa northbridge
One could not pass a device of type APIC to PCI resource functions.
The correct CPU model specific cpu->ops is set at later time in
cpu_initialize().

Change-Id: Ifa274185e4db3080433c1f07e3a48f2b55c0514f
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/1180
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-07-16 20:33:59 +02:00
Kyösti Mälkki de3dde46fd AMD: Fix GFXUMA with 4GB or more RAM
Northbridge code incorrectly adjusted the last cacheable memory
resource to accomodate room for UMA framebuffer. If system had
4GB or more memory that last resource is not below 4GB and not
the one where UMA is located.

There are three consequences:

The last entry in coreboot memory table is reduced by uma_memory_size.

Due the incorrect code in northbridge code state.tomk,
end of last resource below 4GB, had not been adjusted.
Incrementing that by uma_memory_size diverts a region
possibly claimed for MMIO to RAM, as TOP_MEM is written.

Since the UMA framebuffer did not have IORESOURCE_CACHEABLE,
it was ignored from the MTRR setup and not set uncacheable.

The setting of TOP_MEM and TOP_MEM2, as well as all the MTRRs,
should be copied from BSP to all APs instead of deriving the data
separately for each Logical CPU.

Change-Id: I8e69fc8854b776fe9e4fe6ddfb101eba14888939
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/1217
Tested-by: build bot (Jenkins)
Reviewed-by: Denis Carikli <GNUtoo@no-log.org>
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-07-16 18:57:43 +02:00
Kyösti Mälkki 2354515f2e AMD MTRR: fix rounding and renames
Use state.tomk to refer TOP_MEM, largest RAM address below 4GB.
Use state.tom2k to refer TOP_MEM2, largest RAM address above 4GB.

When setting either TOP_MEM or TOP_MEM2, any RAM resource found
must fit below the set value. Thus, round register value upwards,
not downwards.

Change-Id: I436c1b3234c911680ce8b095052f8d71f40113e2
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/1216
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-07-16 18:55:34 +02:00
Kyösti Mälkki 2d42b34003 Check for IORESOURCE_UMA_FB in MTRR setup
If northbridge called uma_resource() a resource of this type
should be found when walking the resources list.

For now, be rude and don't even try to combine it with
neighboring regions. As the type is un-cacheable it is
dominant over other MTRR setups claiming the same region.

Change-Id: I57805e7e7da0709f8ed78d8df62c2abf22172a06
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/1215
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-07-16 18:54:34 +02:00
Kyösti Mälkki 0b08515c2b Change uma_resource() to use new type IORESOURCE_UMA_FB.
MTRR setup code can detect this and mark it as UC/WT/WC as suitable
for the specific hardware.

Change-Id: Ib7a3d450fc7c19e3ca72767dfb350412dd35c971
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/1214
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-07-16 18:51:30 +02:00
Kyösti Mälkki ba589e3630 Move setup_uma_memory() to K8 northbridge
These boards had identical UMA code:
  amd/dbm690t
  amd/pistachio
  technexion/tim5690
  technexion/tim8690

The ones below had whitespace or debug level change
compared to the one above:
  kontron/kt690
  siemens/sitemp_g1p1

These boards use AMDFAM10 guidelines in code:
  asrock/939a785gmh
  amd/mahogany

Change-Id: Id7c3f48035727f5847f2d7c3a6e87a3d15582003
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/1210
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-07-16 18:46:33 +02:00
Kyösti Mälkki 231f261402 Move setup_uma_memory() to AMDFAM10 northbridge
Following boards had identical code:
  advansus/a785e-i
  amd/bimini_fam10
  amd/mahogany_fam10
  asus/m5a88-v
  avalue/eax-785e
  gigabyte/ma78gm
  iei/kino-780am2-fam10
  jetway/pa78vm5

Following boards had identical code:
  amd/tilapia_fam10
  asus/m4a78-em
  asus/m4a785-m
  gigabyte/ma785gm
  gigabyte/ma785gmt

In between the two, only whitespace difference.

Change-Id: Iaa48cc7b0038ebcc81be49219b4fc87670aa9941
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/1209
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-07-16 18:45:37 +02:00
Kyösti Mälkki 55fff930ce Move setup_uma_memory() to Agesa Family14 northbridge
Following boards had identical code:
  amd/inagua
  amd/persimmon

The following had only whitespace or debug level changes
compared to ones above.
  amd/union_station
  amd/south_station
  asrock/e350m1

Change-Id: I11ee46e06e1dd510cba551166189ebcaa144464b
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/1208
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-07-16 18:45:09 +02:00
Kyösti Mälkki d4821fc702 Move setup_uma_memory() to Agesa Family12 northbridge
Change-Id: Ieaf284c207f0cd4b2f6b804c52f949c16435d823
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/1207
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-07-16 18:44:29 +02:00
Kyösti Mälkki 03548aa6b8 Move setup_uma_memory() to Agesa Family15 northbridge
Change-Id: I5705623f5067823fae5986b3bcde58504a463508
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/1206
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-07-16 18:43:35 +02:00
Kyösti Mälkki cc55b9b919 Define global uma_memory variables
Use of the uma_memory_base and _size variables is very scattered.
Implementation of setup_uma_memory() will appear in each northbridge.

It should be possible to do this setup entirely in northbridge
code and get rid of the globals in a follow-up.

Change-Id: I07ccd98c55a6bcaa8294ad9704b88d7afb341456
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/1204
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-07-16 18:41:46 +02:00
Kyösti Mälkki 63f8c08830 Add global uma_resource()
Like ram_resource(), but reserved and not cacheable.

Switch all AMD northbridges to use this one.

Change-Id: I88515c6a0f59f80fd8607c390d0d4a2a35d805f2
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/1203
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-07-16 18:38:46 +02:00
Sven Schnelle d4220691c5 i5000: Fix resource allocation
The current code didn't reserve static resource the right way.
Also reduce TOLM to 0xd0000000, because those boards have so many PCI
devices that 0xe0000000 isn't sufficient.

Change-Id: Ia75a81905eea1a096aed464b63ac154e044bc99c
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Reviewed-on: http://review.coreboot.org/1220
Tested-by: build bot (Jenkins)
2012-07-16 08:40:48 +02:00
Ronald G. Minnich f8878845f9 Poison the stack to uncover programming errors
Code can easily make the mistake of using uninitialized
values or, in assembly, mistakenly dereferencing stack pointers
when an address is desired.

Set the stack to a non-zero value which is also (by testing)
a pointer which will crash coreboot if used. This poisoning
has uncovered at least one bug.

Change-Id: I4affb9a14b96611e8bf83cb82636e47913025a5d
Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Reviewed-on: http://review.coreboot.org/1221
Reviewed-by: Marc Jones <marcj303@gmail.com>
Tested-by: build bot (Jenkins)
Reviewed-by: Sven Schnelle <svens@stackframe.org>
2012-07-15 11:01:01 +02:00
Sven Schnelle 2d0d83c3dd Add ASUS DSBF mainboard
Change-Id: Iad38b92ca3a582e5aec07b92c994bfbe78b09855
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Reviewed-on: http://review.coreboot.org/1223
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-07-14 17:34:57 +02:00
Sven Schnelle 6fa1d3a218 Supermicro X7DB8: Use autogeneration of mptable
And fix the wrong indenting of devicetree.cb while at it.

Change-Id: Idbb19fb5d7155f44675098e79920caf65191c239
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Reviewed-on: http://review.coreboot.org/1222
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-07-14 17:31:13 +02:00
zbao 246e84bc0d AGESA F15 wrapper for Hudson.
Hudson code has been integrated from CIMx to AGESA. This patch is about the wrapper.

Change-Id: I63d951982140b82a3a77a97eb3d55fc75fc0caa3
Signed-off-by: Zheng Bao <zheng.bao@amd.com>
Signed-off-by: zbao <fishbaozi@gmail.com>
Reviewed-on: http://review.coreboot.org/1157
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-07-14 16:29:52 +02:00
zbao 22b7a55a4d Remove useless file from building.
Change-Id: I09c695347c04d7db9add2cbb687d59c829175cfc
Signed-off-by: Zheng Bao <zheng.bao@amd.com>
Signed-off-by: zbao <fishbaozi@gmail.com>
Reviewed-on: http://review.coreboot.org/1224
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-07-14 16:28:10 +02:00
Christian Gmeiner 86f992c38a Add preliminary support for Bachmann electronic OT200
Linux boots fine :)

Change-Id: Ifda06e5220666534b87f528deae16d8b956c32b3
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-on: http://review.coreboot.org/1225
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-07-13 14:34:31 +02:00
Sven Schnelle 0fa50a1990 MPTAPLE: generate from devicetree.cb
This patch adds support for autogenerating the MPTABLE from
devicetree.cb. This is done by a write_smp_table() declared
weak in mpspec.c. If the mainboard doesn't provide it's own
function, this generic implementation is called.

Syntax in devicetree.cb:

ioapic_irq <APICID> <INTA|INTB|INTC|INTD> <INTPIN>

The ioapic_irq directive can be used in pci and pci_domain
devices. If there's no directive, the autogen code traverses
the tree back to the pci_domain and stops at the first device
which such a directive, and use that information to generate the
entry according to PCI IRQ routing rules.

Change-Id: I4df5b198e8430f939d477c14c798414e398a2027
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Reviewed-on: http://review.coreboot.org/1138
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-07-13 08:38:13 +02:00
Sven Schnelle 6591470ae0 IOAPIC: hook up driver in Kconfig
Missed to add the driver to Kconfig and Makefile.inc.

Change-Id: I64b02abc5de2f6483f610436ebb38a7ca433f9b6
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Reviewed-on: http://review.coreboot.org/1219
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-07-13 08:38:08 +02:00
Kyösti Mälkki ffc1fb35aa Drop Kconfig VAR_MTRR_HOLE option
All but one board use the default value of enabled. Disabling
this can only increase the number of MTRR registers used.

Change-Id: I7d28adc31b9fae2301e4ff78fcb96486f81d5ec2
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/1213
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-12 20:28:35 +02:00
Jonathan A. Kollasch 25962837ba Lenovo X60: correct SDHCI write protect polarity
Change-Id: I916deffe2c692042f7e54c936902e77770ee69df
Signed-off-by: Jonathan A. Kollasch <jakllsch@kollasch.net>
Reviewed-on: http://review.coreboot.org/1205
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-07-12 08:16:17 +02:00
Sven Schnelle 6f73a5bf70 Fix stack assignment during CPU initialization
There are two errors in the code. The first one is a missing
$ sign in mov _stack, %esp. Thanks to Ronald G Minnich for
catching that bug.

The second bug is the 'incl %eax', which shouldn't be there, as
there's no secondary CPU with index 0. CPU0 uses always the stack
below _estack.

Change-Id: Id267a654ba95b0e898eeaaafb2403b438250a563
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Reviewed-on: http://review.coreboot.org/1212
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
2012-07-12 07:11:57 +02:00
Kyösti Mälkki bc8c996608 Fix APIC cpu_index
If a CPU was pre-allocated, cpu_path is not copied and thus
index would not be updated. This breaks cpu_index() and AMD
model_fxx is possibly broken without this patch.

Change-Id: I77483181cf0bca31423c655942c022bffab3c7ea
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/1199
Tested-by: build bot (Jenkins)
Reviewed-by: Sven Schnelle <svens@stackframe.org>
2012-07-10 19:53:43 +02:00
Kyösti Mälkki a5650a4b4a Use dev_lock for alloc_find_dev()
If threads called alloc_find_dev() with same device_path
simultaneously, two device nodes could be allocated.
This bug is not triggered by current code.

Change-Id: Ifc87021c8d6f422901c5de5dd17392e3e2309afa
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/1188
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Reviewed-by: Sven Schnelle <svens@stackframe.org>
2012-07-10 19:52:24 +02:00
Kyösti Mälkki da09be6328 Drop start_cpu_lock
Function alloc_find_dev() is serialized.

Change-Id: I40d27d1adca629f1f7ce2f09c1cb2fd04b76eb9a
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/1198
Tested-by: build bot (Jenkins)
Reviewed-by: Sven Schnelle <svens@stackframe.org>
2012-07-10 19:51:47 +02:00
Sven Schnelle 356a600907 servengines/pilot superio: add attribute unused
Not all users use both functions, so add __attribute__((unused))
to prevent compiler errors.

Change-Id: I8485bb9150b04d1f9fdc231152a43bcd6fc713a7
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Reviewed-on: http://review.coreboot.org/1193
Tested-by: build bot (Jenkins)
2012-07-09 12:36:02 +02:00
Sven Schnelle 6d03876aff SMBIOS: Add Type 38 (IPMI) data structure
Change-Id: I9b9a1c7b1cc4aaba7a4791f898653b6fe41d4fcb
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Reviewed-on: http://review.coreboot.org/1192
Reviewed-by: Peter Stuge <peter@stuge.se>
Tested-by: build bot (Jenkins)
2012-07-09 11:51:30 +02:00
Sven Schnelle 34d86f0c61 i5000: reset system if raminit fails
Don't stop if RAM init fails at first try. It's better to restart
and try again instead of failing on the first try if the second
try would have worked.

Change-Id: Ib5660265d5b10a01588f2e4022dac2ee34f2c6d0
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Reviewed-on: http://review.coreboot.org/1191
Reviewed-by: Peter Stuge <peter@stuge.se>
Tested-by: build bot (Jenkins)
2012-07-09 11:34:37 +02:00
Sven Schnelle 7435baa5c5 Add basic ipmi support
Implements support code for talking to IPMI hardware that uses
a KCS style interface.

Change-Id: I9895cc1bf29676115b167081b63b8a430e23eee5
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Reviewed-on: http://review.coreboot.org/1190
Tested-by: build bot (Jenkins)
2012-07-09 10:41:05 +02:00
Ricardo Martins f5062437dc IEI PM-LX-800-R11: Removed bogus Kconfig option
The Kconfig file for this board contains a bogus option called
CORE_GLIU, this change removes it.

Change-Id: I4ea069bdd76be53085ebc9c0fb3dd71ffb2a12e1
Signed-off-by: Ricardo Martins <rasmartins@gmail.com>
Reviewed-on: http://review.coreboot.org/1179
Reviewed-by: Peter Stuge <peter@stuge.se>
Tested-by: build bot (Jenkins)
2012-07-07 11:47:34 +02:00
Sven Schnelle 7b48379575 i5000: Add PCI ids for all i5000 flavours
Change-Id: I48be647e3f38038830200bcc64429cbf86990ad7
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Reviewed-on: http://review.coreboot.org/1174
Tested-by: build bot (Jenkins)
2012-07-06 16:40:30 +02:00
Ricardo Martins 0ca02553e1 IEI PM-LX-800-R11: Added preliminary mainboard support
Details for this board are available at
http://www.ieiworld.com/product_groups/industrial/content.aspx?gid=00001000010000000001&cid=09050665574743104681&id=08142307826854456110

Most of the functionality provided by the original BIOS is
implemented.

Change-Id: Id9eb10a2f9e49377ea587bddadbba7d76223a715
Signed-off-by: Ricardo Martins <rasmartins@gmail.com>
Reviewed-on: http://review.coreboot.org/1168
Tested-by: build bot (Jenkins)
Reviewed-by: Sven Schnelle <svens@stackframe.org>
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-07-06 14:26:38 +02:00
Patrick Georgi 6444bd4547 i945: Reset IGD on boot
This is mostly necessary for reboot, but it doesn't hurt the boot process.
On reboot explicitely reset the integrated graphics, otherwise the VGABIOS
might not be able to reinitialize it properly, and you either have a still
of the last pre-reboot image, garbage or an empty screen, but no text-mode.

Change-Id: Ic3d6932fbaf720d88daaac7e4b09c3c0b9f0b0e2
Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com>
Reviewed-on: http://review.coreboot.org/1178
Tested-by: build bot (Jenkins)
Reviewed-by: Peter Stuge <peter@stuge.se>
2012-07-06 11:53:49 +02:00
Ronald G. Minnich 97de28da8a PCI Type2 config must die
PCI Type 2 config was a strange and never-used config mechanism.
It is unlikely that in the 13 years of coreboot's existence that
type 2 was ever used; it just made life complicated for everyone.
It lived long enough in coreboot to be replaced by mmioconf.
Prior to making the device tree visible in romstage we want to
get rid of type2.

Delete two files we don't need any more (yay!).
Replace two functions with one: pci_config_default, which returns
a pointer to the default config method. At some future time this
may change to mmio but for now it is old type1 style.

Change-Id: Icc4ccf379a89bfca8be43f305b68ab45d88bf0ab
Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Reviewed-on: http://review.coreboot.org/1159
Tested-by: build bot (Jenkins)
Reviewed-by: Sven Schnelle <svens@stackframe.org>
2012-07-05 23:01:42 +02:00
Kyösti Mälkki 63539bb9d7 Only copy real-mode section of SIPI vector
The SIPI vector copy can use a static location below 1MB, aligned
to 4kB. Jump out of the copy once in protected mode.

Change-Id: I6299aa3448270663941cf2c4113efee74bcc7993
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/1165
Tested-by: build bot (Jenkins)
Reviewed-by: Sven Schnelle <svens@stackframe.org>
2012-07-05 22:49:31 +02:00
Kyösti Mälkki 9a663f3e97 Fix the CPU index parameter passed to secondary_cpu_init().
Count 0,1,2,3,... instead of 0,2,3,4,...

Change-Id: I3c6b85e5e71b32deac5470809e1618d28f19c00f
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/1173
Tested-by: build bot (Jenkins)
Reviewed-by: Sven Schnelle <svens@stackframe.org>
2012-07-05 22:47:43 +02:00
Kyösti Mälkki 5458b9d90a Intel cpus: Extend cache to cover complete Flash Device
CACHE_ROM_SIZE default is ROM_SIZE, the Flash device size set
in menuconfig. This fixes a case where 8 MB SPI flash MTRR setup
would not cover the bottom 4 MB when ramstage is decompressed.

Verify CACHE_ROM_SIZE is power of two.
One may set CACHE_ROM_SIZE==0 to disable this cache.

Change-Id: Ib2b4ea528a092b96ff954894e60406d64f250783
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/1146
Tested-by: build bot (Jenkins)
Reviewed-by: Sven Schnelle <svens@stackframe.org>
2012-07-04 14:47:53 +02:00
Kyösti Mälkki ae7d6ef8b7 Intel model_106cx: change CAR to model_6ex
Diff between model_106cx and model_6ex CAR codes suggests currently
used model_106cx CAR is not optimal - destination RAM and source ROM
of ramstage copy_and_run are only partly set cacheable.

It appears variable MTRR setting for XIP cache is left enabled on
model_106cx code, where it should have extended to cover all of Flash.

Introduces untested functional change on boards:
  intel/d945gclf
  iwave/iWRainbowG6

Deletes file:
  model_106cx/cache_as_ram.inc

Change-Id: I35229f8433927e83821e72e9d9a9fc8fb09c3f1d
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/642
Tested-by: build bot (Jenkins)
Reviewed-by: Sven Schnelle <svens@stackframe.org>
2012-07-04 14:45:39 +02:00
Kyösti Mälkki 4dcc5737cd Intel cpus: delete dead CAR code and whitespace fixes
A diff from model_6fx to model_106cx suggests there is little
CORE2 specific code that was once considered useful to have.
In its current status however, sockets supporting model_6fx use
model_6ex CAR init, so that specific code is actually
never used.

Deletes file:
    model_6fx/cache_as_ram.inc

Change-Id: I6c0204446fa98207e31f91895e1cf30fde42382c
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/640
Tested-by: build bot (Jenkins)
Reviewed-by: Sven Schnelle <svens@stackframe.org>
2012-07-04 14:44:29 +02:00
Sven Schnelle aa03af74f1 Add generic IOAPIC driver
Used for automatic generation of IOAPIC interrupt entries.

Change-Id: Ia746f01906c840800956ce551306f864e440b6ec
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Reviewed-on: http://review.coreboot.org/1137
Tested-by: build bot (Jenkins)
2012-07-04 14:43:23 +02:00
Kyösti Mälkki c7fb2ae67b Intel cpus: use CPU_ADDR_BITS from Kconfig during CAR
Default CPU_ADDR_BITS is 36.

For Atom (model_106cx) use 32. This model is known to
fail execution-in-place (XIP) with the default 36.

Pentium M should use 32, but doesn't even with this patch.
Some Xeon and CORE(2) models should use 38 or 40.

Change-Id: If604badcdc578c4f4bc7d30da2f61397ec0d754c
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/639
Tested-by: build bot (Jenkins)
Reviewed-by: Sven Schnelle <svens@stackframe.org>
2012-07-04 14:42:01 +02:00
Sven Schnelle 89f04a6d68 Supermicro X7DB8: add w83793 Hardware monitor
used for fan control and thermal management on that board.

Change-Id: I4e5c986ab6174b7a356d682e21732c46181af211
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Reviewed-on: http://review.coreboot.org/1167
Tested-by: build bot (Jenkins)
2012-07-04 07:23:03 +02:00
Sven Schnelle ca68297cda Add Nuvoton W83793 hardware monitor driver
Change-Id: I3ecb5c8666eea247bf4c31aaf9426bd9ef66bf68
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Reviewed-on: http://review.coreboot.org/1166
Tested-by: build bot (Jenkins)
2012-07-04 07:22:48 +02:00
Patrick Georgi 87ed6173e2 Fix AMD S3 block generator on Cygwin
awk on Cygwin created the UTF-8 value for the 0xff code point,
which makes it two bytes wide. This broke the build.

Change-Id: I4937ae7ce1136ba7a76d05b42f9dd2771203175d
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/1164
Tested-by: build bot (Jenkins)
Reviewed-by: Dave Frodin <dave.frodin@se-eng.com>
Reviewed-by: Peter Stuge <peter@stuge.se>
2012-07-03 21:02:13 +02:00
Christian Gmeiner a645abbf54 SMBIOS: move serial number and version out to Kconf
With this change it is possible to define serial number
and version of the mainboard. These informations are used
in SMBIOS tables.

Change-Id: I1634882270f6cb94e00aceb7832e7fd14adc186b
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-on: http://review.coreboot.org/1163
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-07-03 13:36:27 +02:00
Ronald G. Minnich 9b4c92ad80 Fix the error message for romstage when .bss or .data are non-zero
The error message from romstage is annoying and misleading:
"Do not use global variables in romstage"

Because it can occur even when global variables are not used
in some circumstances, but also because it gives you only a rough
idea where to look. This change sucks but sucks less. We still don't
know which file the problem is in but at least we know if it is data
or bss.

Replace the error message with something that provides more information
and less guessing on the part of the script:
".bss is non-zero size in romstage which is not allowed -- global variable?"
or
".data is non-zero size in romstage which is not allowed -- global variable?"

To test: build coreboot as normal. It builds.
Add
char d[32];
to romstage.c and get the first error message; add
int x = 32;
to romstage.c and get the second.

Change-Id: I300ec05bdb4b30d7ef3f5112e6cc09b1fafe8263
Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Reviewed-on: http://review.coreboot.org/1160
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-07-03 09:43:38 +02:00
zbao 2c08f6ade4 AGESA F15 wrapper for Trinity
The wrapper for Trinity. Support S3. Parme is a example board.

Change-Id: Ib4f653b7562694177683e1e1ffdb27ea176aeaab
Signed-off-by: Zheng Bao <zheng.bao@amd.com>
Signed-off-by: zbao <fishbaozi@gmail.com>
Reviewed-on: http://review.coreboot.org/1156
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-07-03 09:38:55 +02:00
zbao 7d94cf93ee AGESA F15tn: AMD family15 AGESA code for Trinity
AMD AGESA code for trinity.

Change-Id: I847a54b15e8ce03ad5dbc17b95ee6771a9da0592
Signed-off-by: Zheng Bao <zheng.bao@amd.com>
Signed-off-by: zbao <fishbaozi@gmail.com>
Reviewed-on: http://review.coreboot.org/1155
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-07-03 09:36:35 +02:00
Sven Schnelle 78efc4c36c remove CONFIG_SERIAL_CPU_INIT
The new broadcast code doesn't support serial init - if a CPU
needs serial init, this should be handled in the model specific CPU
init code.

Change-Id: I7cafb0af10d712366819ad0849f9b93558e9d46a
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Reviewed-on: http://review.coreboot.org/1140
Tested-by: build bot (Jenkins)
2012-07-02 21:44:36 +02:00
Sven Schnelle 042c1461fb Use broadcast SIPI to startup siblings
The current code for initializing AP cpus has several shortcomings:

- it assumes APIC IDs are sequential
- it uses only the BSP for determining the AP count, which is bad if
  there's more than one physical CPU, and CPUs are of different type

Note that the new code call cpu->ops->init() in parallel, and therefore
some CPU code needs to be changed to address that. One example are old
Intel HT enabled CPUs which can't do microcode update in parallel.

Change-Id: Ic48a1ebab6a7c52aa76765f497268af09fa38c25
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Reviewed-on: http://review.coreboot.org/1139
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-02 19:39:08 +02:00
Kyösti Mälkki 9ed1456eff Intel CPUs: execute microcode update only once per core
Early HT-enabled CPUs do not serialize microcode updates within a core.
Solve this by running microcode updates on the thread with the smallest
lapic ID of a core only.

Also set MTRRs once per core only.

Change-Id: I6a3cc9ecec2d8e0caed29605a9b19ec35a817620
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/1142
Tested-by: build bot (Jenkins)
Reviewed-by: Sven Schnelle <svens@stackframe.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-07-02 15:49:07 +02:00
Sven Schnelle f03dff7ab1 X60/T60: fix mptable LINT entries
They used MP_IRQ_TRIGGER_LEVEL, but it should be MP_IRQ_TRIGGER_EDGE.
While at it, uses mptable_lintsrc() instead.

Change-Id: Ie71311b8bf865889cf0d8808467df98af4b0132d
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Reviewed-on: http://review.coreboot.org/1136
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-06-24 13:03:52 +02:00
Sven Schnelle 72f35a62be Add Supermicro X7DB8 motherboard
This adds basic supported for the Supermicro X7DB8. Basic means that
almost all onboard peripherals are working. Known problems are:

- mptable needs to be written dynamically. If you plan to use Add on
cards, modify mptable.c according to your needs. A patch to add generic
mptable autogeneration based on devicetree is coming up.

Change-Id: I5eaac32a8bafa69a05929cf08d869127b9464661
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Reviewed-on: http://review.coreboot.org/493
Tested-by: build bot (Jenkins)
2012-06-23 17:45:04 +02:00
Sven Schnelle 1f20da7c33 i3100: add smbus_write_byte()
Required for Supermicro X7DB8, which needs the FBDIMM clock generator
setup during romstage.

Change-Id: I30ca8354087e851487aee0614595782131d4d9bc
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Reviewed-on: http://review.coreboot.org/1116
Tested-by: build bot (Jenkins)
2012-06-23 10:05:01 +02:00
Denis 'GNUtoo' Carikli e4cece0d6f Add an option for Waiting for gdb connection if the gdb stub configuration is chosen.
Here's a quick demonstration on how to use it(tested on M4A785T-M).
  (gdb) file ./build/cbfs/fallback/coreboot_ram.debug
  Reading symbols from [...]/build/cbfs/fallback/coreboot_ram.debug...done.
  (gdb) set remotebaud 115200
  (gdb) target remote /dev/ttyUSB0
  Remote debugging using /dev/ttyUSB0
  _text () at src/arch/x86/lib/c_start.S:85
  85		call	hardwaremain

Change-Id: Ia49cbecc41deb061433bc39f5b81715da49edc98
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@no-log.org>
Reviewed-on: http://review.coreboot.org/1134
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-06-23 07:50:07 +02:00
Sven Schnelle dab6bfe97d i3100: Enable second IOAPIC for PCI-X
i3100/i5000 have a second IOAPIC which handles IRQs for PCI-X.
Add code to enable it.

Change-Id: Ib447628f501b152c8adc9c7c89bd09b5615b9e5a
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Reviewed-on: http://review.coreboot.org/1118
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-06-21 08:47:42 +02:00
Nico Huber 904a0ec9d0 Don't use 64-bit constant 0x100000000 in linker scripts
The constant value 0x100000000 is used in linker scripts to calculate
offsets from the end of 32-bit-addressed memory. There is nothing
wrong with it, but 32-bit versions of ld do the calculation wrong.

Change-Id: I4e27c6fd0c864b4d98f686588bf78c7aa48bcba8
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: http://review.coreboot.org/1129
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: build bot (Jenkins)
2012-06-21 08:05:31 +02:00
Sven Schnelle 1454685327 i5000: fix another typo
As Mathias Krause pointed out, using movw/outw on %al is clearly invalid.
Let's do another typo fix...

Change-Id: Ib95832a11097f599a236ab30c64c26ef429a1699
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Reviewed-on: http://review.coreboot.org/1119
Tested-by: build bot (Jenkins)
Reviewed-by: Mathias Krause <minipli@googlemail.com>
2012-06-20 20:24:29 +02:00
Sven Schnelle 39b47d2b03 i5000: fix typos
Peter and Ron pointed out two typos. They have no side effects, but
it's still worth to fix them.

Change-Id: I9aecccdbc72beb2623fbe558a06e4f1b050f6e74
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Reviewed-on: http://review.coreboot.org/1117
Tested-by: build bot (Jenkins)
2012-06-20 16:37:18 +02:00
Sven Schnelle edac28ce65 Enable Intel PECI on Model 6fx CPUs
Those CPUs support the PECI (Platform Environment Control
Interface), so enable it. This interface is commonly used
for tasks like fan control.

Change-Id: Id2dadc4821de8cc0b579e77235aa36892e57fd02
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Reviewed-on: http://review.coreboot.org/1104
Reviewed-by: Peter Stuge <peter@stuge.se>
Tested-by: build bot (Jenkins)
2012-06-19 18:31:58 +02:00
Sven Schnelle 1a7a7e610e i5000: enforce hard reset
Not doing a hard reset leaves the BOFL0 register cleared, which
prevents the BSP selection from working. To make sure we start
with known values, use the SPAD0 register for soft reset detection.
If there's a value other than 0, do a hard reset.

Change-Id: I390e3208084cfd32d73cce439ddf2bc9d4436a62
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Reviewed-on: http://review.coreboot.org/1103
Tested-by: build bot (Jenkins)
2012-06-18 09:03:35 +02:00
Denis 'GNUtoo' Carikli ec6f043c25 llshell: fix build without romcc
Without that fix we have:
      LINK       cbfs/fallback/romstage_null.debug
  build/generated/crt0.romstage.o: In function `ramtest':
  romstage.c:(.rom.text+0x53f): undefined reference to `.Lhlt'
  collect2: ld returned 1 exit status
  make: *** [build/cbfs/"fallback"/romstage_null.debug] Error 1
On the M4A785T-M which doesn't have CONFIG_ROMCC.

Change-Id: I49eded1d18e996afe9441b85dae04ae30c760dd6
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@no-log.org>
Reviewed-on: http://review.coreboot.org/1101
Tested-by: build bot (Jenkins)
Reviewed-by: Peter Stuge <peter@stuge.se>
2012-06-14 21:21:06 +02:00
Martin Roth 9aa43892e6 Update SB800 CIMX FADT
- Add #define to allow the FADT PM Profile to be overridden.
 - Change the location of the PMA_CNT_BLOCK_ADDRESS to match
   current documentation.
 - cst_cnt should be 0 if smi_cmd == 0
 - add a couple of default access sizes.
 - Add a couple of #define values for unsupported C2 & C3 entries.
 - Add PM Profile override value into amd/persimmon platform.
   This does not use the #defines in acpi.h so that the files that
   include this don't all need to start including acpi.h.

Change-Id: Ib11ef8f9346d42fcf653fae6e2752d62a40a3094
Signed-off-by: Martin L Roth <martin@se-eng.com>
Reviewed-on: http://review.coreboot.org/1055
Tested-by: build bot (Jenkins)
Reviewed-by: Dave Frodin <dave.frodin@se-eng.com>
Reviewed-by: Marc Jones <marcj303@gmail.com>
2012-06-12 23:35:16 +02:00
Sven Schnelle 0860e723cb udelay: add missing bus frequency
commit 5b6404e419 ("Fix timer frequency
detection on Sandybridge") reworked the udelay code, but didn't add
the 333MHz FSB entry used on Model 15 Xeons.

Change-Id: Ie34f9ae3703b64672625e7bf1b943654a7a5eaa6
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Reviewed-on: http://review.coreboot.org/1099
Tested-by: build bot (Jenkins)
2012-06-12 10:01:16 +02:00
Nico Huber 7250f0365d Enable CONFIG_GFXUMA for roda/rk886ex
Without GFXUMA beeing set, MTRR initialization runs out of variable MTRRs.

Change-Id: I5d1aa0d5fa2d72f17a0d88cae3fad880b489828c
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: http://review.coreboot.org/1086
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-06-01 12:25:16 +02:00
zbao ee8a9f6c55 Initializer of a static member in union.
It is just me or does anybody have the same build error without
this patch?
------
src/arch/x86/boot/acpigen.c: In function 'acpigen_write_empty_PTC':
src/arch/x86/boot/acpigen.c:347:3: error: unknown field 'resv'
specified in initializer
src/arch/x86/boot/acpigen.c:347:3: warning: missing braces around
 initializer
src/arch/x86/boot/acpigen.c:347:3⚠️ (near initialization
 for 'addr.<anonymous>')
-------

Anyway, I believe at least this will cause warnings.
"resv" is a member of a union, not of acpi_addr_t. So it should be
wrapped by a brace in the initializer.

Change-Id: I72624386816c987d5bb2d3a3a64c7c58eb9af389
Signed-off-by: Zheng Bao <zheng.bao@amd.com>
Signed-off-by: zbao <fishbaozi@gmail.com>
Reviewed-on: http://review.coreboot.org/1056
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: Marc Jones <marcj303@gmail.com>
2012-05-30 23:01:23 +02:00
Denis 'GNUtoo' Carikli 7c2d058d61 Fix the location of "Setting variable MTRR" printk.
Without that fix the debugging is harder because the person debugging
  coreboot will see the following twice(note the repeated MTRR number):
    Setting variable MTRR 0, base:    0MB, range: 4096MB, type WB
    [...]
    Setting variable MTRR 1, base: 4096MB, range:  512MB, type WB
    Setting variable MTRR 1, base: 4608MB, range:  256MB, type WB
    Setting variable MTRR 1, base: 3072MB, range: 1024MB, type UC
  instead of the following twice:
    Setting variable MTRR 0, base:    0MB, range: 4096MB, type WB
    [...]
    Setting variable MTRR 1, base: 3072MB, range: 1024MB, type UC

Thanks to kmalkki on #coreboot's Freenode IRC channel for the idea:
  May 25 23:57:17 <kmalkki>	I would add (move) that "Setting variable MTRR..." debug at the end of set_var_mtrrs()

Change-Id: I9f4b7110ba34d017a58d8cc5fb06a7b1c3d0c8aa
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@no-log.org>
Reviewed-on: http://review.coreboot.org/1058
Tested-by: build bot (Jenkins)
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2012-05-30 08:32:38 +02:00
Vadim Bendebury 3b3a1a1ee6 Provide functions to access arbitrary GPIO pins and vectors
This change adds utility functions which allow to read any GPIO pin,
as well as a vector of GPIO pin values.

As presented, these functions will be available to Sandy Bridge and
Ivy Bridge systems only.

There is no error checking: trying to read GPIO pin number which
exceeds actual number of pins will return zero, trying to read GPIO
which is not actually configured as such will return unpredictable
value.

When reading a GPIO pin vector, the pin numbers are passed in an
array, terminated by -1. For instance, to read GPIO pins 4, 2, 15 as a
three bit number GPIO4 * 4 + GPIO2 * 2 + GPIO15 * 1, one should pass
pointer to array of {4, 2, 15, -1}.

Change-Id: I042c12dbcb3c46d14ed864a48fc37d54355ced7d
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: http://review.coreboot.org/1049
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-05-30 00:53:19 +02:00
Stefan Reinauer 691c9f0dab Add support for Panther Point to SPI driver
Change-Id: I98b05d9e639eda880b6e8dc6398413d1f4f5e9c3
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1048
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-05-30 00:53:11 +02:00
Patrick Georgi 68b5da0e68 Use ld manually when compiling with clang
clang does its own linking, incompatible to our
binutils-centric linker magic.

Change-Id: I243597adcb6bc3f7343c3431d7473610c327353d
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/785
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-05-29 22:54:13 +02:00
Stefan Reinauer bb31f3a24a Drop config variable CPU_MODEL_INDEX
It's only used in the ACPI generator for Sandybridge/Ivybridge CPUs
and the code can easily be changed to not rely on any Kconfig magic.

Change-Id: Ie2f92edfe8908f7eb2fda3088f77ad22f491ddcf
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1047
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-05-29 19:55:42 +02:00
Stefan Reinauer 14b23a6ca6 Fix compilation with CONFIG_DEBUG_SPI_FLASH enabled
Right now coreboot compilation fails when SPI flash debugging is
enabled. Fix it by using the right set of memory functions.

Change-Id: I5e372c4a5df53b4d46aaed9e251e5205ff68cb5b
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1044
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-05-29 11:29:54 +02:00
Vadim Bendebury 71695d8a28 Fix full reset for Ivy Bridge platforms
Experiments have shown that writing plain value of 6 at byte io
address of 0xcf9 causes the systems to reset and reboot reliably.

Change-Id: Ie900e4b4014cded868647372b027918b7ff72578
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: http://review.coreboot.org/1050
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-05-29 11:29:24 +02:00
Stefan Reinauer 984f9540c0 ChromeOS: Remove remnants of FDT support
Originally, on ChromeBooks, coreboot would provide a modified
u-boot device tree (FDT) to u-boot in CBMEM. However, u-boot
can now create all the information it needs from the coreboot
table and add it to its device tree itself. This means we can
drop this (anyways unused) code.

Change-Id: I4ab20bbb8525e7349b18764aa202bbe81958d06a
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1052
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-05-29 11:28:43 +02:00
Stefan Reinauer 88fc0b9e8d Sandybridge: Remove remnants of FDT support from MRC cache code
Originally, ChromeBooks would get the offset of the MRC cache
from an entry in the u-boot device tree. Not everyone wants to
use u-boot on Sandybridge systems, however.
Since the new code (based on Kconfig) is now fully working, we
can drop the u-boot device tree remnants.

Change-Id: I4e012ea981f16dce9a4d155254facd29874b28ef
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1051
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-05-29 11:27:42 +02:00
Stefan Reinauer 6e901fd3d2 Sandybridge: Fix MRC cache calculation
The MRC region is described by Kconfig variables, no further math
or parsing is required at this point.

Change-Id: I290d8788b69ef007e9ea2317ce55aefa2d791883
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1046
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-05-29 11:26:31 +02:00
Motiejus Jakštys 206c890f6a Enable USE_OPTION_TABLE for ThinkPad X60
Without this option bluetooth configuration value in nvram is not
consulted properly.

It also enables built-in volume control (read-only).

Tested on: ThinkPad X60s, 1702.

Change-Id: I2fc6bb527c6e086a083e63922d1253eda7d4a36d
Signed-off-by: Motiejus Jakštys <desired.mta@gmail.com>
Reviewed-on: http://review.coreboot.org/985
Tested-by: build bot (Jenkins)
Reviewed-by: Sven Schnelle <svens@stackframe.org>
2012-05-28 21:14:20 +02:00
Stefan Reinauer bfff6dea2b Implement %zu / %zd in printk
The SPI drivers from u-boot make heavy use of %zu/%zd (size_t/ssize_t).
Implement this in our printk implementation so we get useful output.

Change-Id: I91798ff4f28b9c3cd4db204c7ec503596d247dcd
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1043
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-05-26 07:16:40 +02:00
Stefan Reinauer 56c7dc7972 Move subsystem IDs to devicetree.cb
A while back coreboot was changed to read the subsystem IDs from
devicetree.cb to allow each onboard PCI device to have its own
subsystem id. When we originally branched, this was not the case,
and the sandybridge/ivybridge mainboards have not been updated yet.
Also, drop the subsystem ID from Emerald Lake 2, since it's not a
Google device.

Change-Id: Ie96fd67cd2ff65ad6ff725914e3bad843e78712e
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1042
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-05-26 07:16:00 +02:00
Stefan Reinauer 5649b08e20 Reduce default verbosity of SPI flash drivers
Only print PP: lines if CONFIG_DEBUG_SPI_FLASH is enabled.

Change-Id: If25e916ecb585f37c90d42980e933a6cd1a3d956
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1045
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-05-26 00:37:37 +02:00
Stefan Reinauer 8ea5a34833 Fix printk types in SPI flash drivers
- use %zu instead of %zd for size_t (%zd is for ssize_t)
- use %x instead of %lx for u32
- break some long lines to avoid commit hook trouble

Change-Id: Idfad716523dbcd2a595d26317240e972b5253e8b
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1041
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-05-26 00:37:15 +02:00
Marc Jones 872e74dda2 Fix typo on Persimmon #if CONFIG_HAVE_ACPI_RESUME
Stupid typo: APCI instead of ACPI in Persimmon.

Change-Id: I6fd7f091cf1f5c4c0e1b57c21553dab93b545eab
Signed-off-by: Marc Jones <marc.jones@se-eng.com>
Reviewed-on: http://review.coreboot.org/1054
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Tested-by: build bot (Jenkins)
2012-05-25 21:24:19 +02:00
Stefan Reinauer 0e740d3952 Fix size_t for certain versions of GCC
When compiling coreboot with the latest ChromeOS toolchain, GCC
complains that some printk calls use %zu in connection with size_t
types since it resolves the typedefs to long unsigned int.

The problem is solved by using the GCC built-in __SIZE_TYPE__ if it
exists and define __SIZE_TYPE__ to long unsigned int otherwise.

Change-Id: I449c3d385b5633a05e57204704e981de6e017b86
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1040
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-05-25 08:00:44 +02:00
Steve Goodrich f026912776 Converted the FRAMEBUFFER_VESA_MODE to a choice.
Being a diligent soul, I changed the "enter a numeric value for the
mode you want" option to a choice of common modes.  New modes can be
added quite easily.

Change-Id: I8cf4572c2d36ced6549541ec173c0c02d8eaca4a
Signed-off-by: Steve Goodrich <steve.goodrich@se-eng.com>
Reviewed-on: http://review.coreboot.org/1036
Tested-by: build bot (Jenkins)
Reviewed-by: Marc Jones <marcj303@gmail.com>
2012-05-24 21:54:08 +02:00
Vikram Narayanan 2f00ce3d96 cbtypes.h: Unify cbtypes.h used in AMD board's code
Remove all the repeated sections of code in cbtypes.h and place it
in a common location. Add include dir in vendor code's Makefile.

Change-Id: Ida92c2a7a88e9520b84b0dcbbf37cd5c9f63f798
Signed-off-by: Vikram Narayanan <vikram186@gmail.com>
Reviewed-on: http://review.coreboot.org/912
Tested-by: build bot (Jenkins)
Reviewed-by: Marc Jones <marcj303@gmail.com>
2012-05-24 17:38:42 +02:00
Marc Jones ad422c0a7a Fix Persimmon build without S3.
In the heap function, only check for S3 check when it is built in
with CONFIG_HAVE_ACPI_RESUME.

Change-Id: I439275a4e1b7b446b499bcf90c925785a14b980d
Signed-off-by: Marc Jones <marc.jones@se-eng.com>
Reviewed-on: http://review.coreboot.org/1034
Tested-by: build bot (Jenkins)
Reviewed-by: Steve Goodrich <steve.goodrich@se-eng.com>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-05-21 19:07:49 +02:00
Marc Jones ba3711cc24 Fix fadt legacy free setting.
The fadt legacy free logic was backwards.

Change-Id: Ieb21ef335f7514ced70248d0bf8668ddb73cf59f
Signed-off-by: Marc Jones <marc.jones@se-eng.com>
Reviewed-on: http://review.coreboot.org/1030
Reviewed-by: Peter Stuge <peter@stuge.se>
Tested-by: build bot (Jenkins)
2012-05-15 19:18:05 +02:00
Marc Jones 762aa3e199 Change the name of the romstage bootblock.ld
The bootblock.ld linkerscript is used by romstage. Name it
accordingly to avoid confusion.

Change-Id: I7ca9147bb821fe6f83224d170f5fe25654ef250f
Signed-off-by: Marc Jones <marc.jones@se-eng.com>
Reviewed-on: http://review.coreboot.org/1031
Reviewed-by: Peter Stuge <peter@stuge.se>
Tested-by: build bot (Jenkins)
2012-05-15 07:39:50 +02:00
Marc Jones 49fe74bd69 Fix Cygwin bootblock generation
Cygwin is case insensitive, so bootblock.s and bootblock.S in the
same directory cause a build failure. This changes bootblock.S
to bootblock_inc.S, as it is generated from bootblock_inc.
crt0.S and crt0.S also had this problem. This changes crt0.S to
crt0.romstage.S.

Change-Id: I29d230a93b0743e34f11228f9034880ceaf7ab7b
Signed-off-by: Marc Jones <marc.jones@se-eng.com>
Reviewed-on: http://review.coreboot.org/1032
Reviewed-by: Peter Stuge <peter@stuge.se>
Tested-by: build bot (Jenkins)
2012-05-15 07:14:07 +02:00
Marc Jones c2dff7fd44 Pass IASL to SeaBIOS
Use the coreboot IASL for building SeaBIOS.

Change-Id: Ia6c802b090d53b7fbbc8ddb6edad3de6b822ff41
Signed-off-by: Marc Jones <marc.jones@se-eng.com>
Reviewed-on: http://review.coreboot.org/1033
Tested-by: build bot (Jenkins)
Reviewed-by: Peter Stuge <peter@stuge.se>
2012-05-15 07:00:59 +02:00
Patrick Georgi 20959ba21b SPI driver: style fix
lint tests for labels to start at BOL, no spaces before them.

Change-Id: Icf6ce533f26998a81b4be46d17e2d0b6b868904d
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/1029
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-05-14 20:59:22 +02:00
Marc Jones 7c9ef4f52c Add legacy free setting and override to fadt.c
The FADT iapc_boot_arch indicates the available information
for accessing legacy devices. By default, the setting supports
legacy. LEGACY_FREE and/or the iapc_boot_arch field may be
customized.

Change-Id: I5679741e1f8db923d3c00b57f6a5d813550f3a5e
Signed-off-by: Marc Jones <marc.jones@se-eng.com>
Reviewed-on: http://review.coreboot.org/1024
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: Peter Stuge <peter@stuge.se>
2012-05-12 04:30:34 +02:00
Marc Jones b547c4fc99 Merge sb800 fadt fixes from South Station mainboard to southbridge fadt.
The South Station recieved updates that fix a number of fadt problems.
South Station now uses the southbridge fadt.

Change-Id: Ib990a69a359a4b7eae3431bb4323acd537acda1d
Signed-off-by: Marc Jones <marc.jones@se-eng.com>
Reviewed-on: http://review.coreboot.org/1021
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: Peter Stuge <peter@stuge.se>
2012-05-12 04:29:55 +02:00
Stefan Reinauer bb11e60cb2 Hook up MRC cache update
Requirements:
  - must be in ramstage (locking flash while executing code from there
    might not work)
  - must be after cbmem is reinitialized (so the mrc cache copy of the
    current run can be found)

Change-Id: I8028fb073349ce2b027ef5f8397dc1a1b8b31c02
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/1002
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-05-11 00:30:03 +02:00
Stefan Reinauer 1244f4b52f Rework Sandybridge MRC cache handling
- Separate Sandybridge from ChromeOS a bit
  The Sandybridge code depends on chromeos features a whole lot.
  As a first step, provide a code path to look up the MRC cache
  without depending on u-boot.

- Move mrc cache handling to separate file
  This enables us to handle the MRC cache from ramstage,
  where we can write the flash safely (eg. to update the
  cache).
  Also teach it to lookup the current MRC cache from CBMEM,
  as the original data block isn't available anymore.

After all the preparations, finally write to the SPI
as necessary. It's a simple round robin wear levelling
that erases the entire MRC cache region when it's full
and starts from the beginning.

Change-Id: I4751385574cf709b03d5c9d153b7481ffc90ce12
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/1001
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-05-11 00:29:44 +02:00
Stefan Reinauer 1c56d9b102 Add SPI flash driver
This driver is taken from u-boot and adapted to match
coreboot. It still contains some hacks and is ICH specific
at places.

Change-Id: I97dd8096f7db3b62f8f4f4e4d08bdee10d88f689
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/997
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-05-10 23:52:44 +02:00
Martin Roth a495335de4 CIMx: Allow #define LEGACY_FREE overrides
For legacy free AMD systems, the #define LEGACY_FREE cannot
currently be overridden.  This patch allows the platform_cfg.h
to override that.  (I know we want to get away from that, but
for now...)

Also allow BIOS_SIZE to be overridden on SB700 cimx based
platforms.

Change-Id: I570115248bcbc686062bfb66acb56208240b847a
Signed-off-by: Martin L Roth <martin@se-eng.com>
Reviewed-on: http://review.coreboot.org/1018
Tested-by: build bot (Jenkins)
Reviewed-by: Marc Jones <marcj303@gmail.com>
2012-05-10 21:17:36 +02:00
Alec Ari 923d200d16 Unmark source files as executables
Change source file modes from 755 to 644

The following files have been grepped for changes:

*.c
*.h
*Kconfig*
*Makefile*

Change-Id: I275f42ac7c4df894380d0492bca65c16a057376c
Signed-off-by: Alec Ari <neotheuser@ymail.com>
Reviewed-on: http://review.coreboot.org/1023
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-05-10 08:44:08 +02:00
Alec Ari 5db1f4666e Integrate MA785GM-US2H to Kconfig
MA785GM-US2H was left out of Kconfig. This
allows the option to select the board.

Change-Id: I9efea96c21dcd0754ab51824b410435b0b5300c2
Signed-off-by: Alec Ari <neotheuser@ymail.com>
Reviewed-on: http://review.coreboot.org/1022
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-05-10 08:43:35 +02:00
Marc Jones 76cfcbc312 Move fadt.c to the cimx sb800 southbridge directory to be shared.
The fadt.c is the same across all the platforms using the sb800
cimx southbridge wrapper.

Change-Id: Ifbbfc238732aa46aef96297eaa188b77d27151f3
Signed-off-by: Marc Jones <marc.jones@se-eng.com>
Reviewed-on: http://review.coreboot.org/1019
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-05-09 11:13:32 +02:00
Martin Roth 7b860ed45e Add simple PMIO & PMIO2 read/write routines to CIMX wrapper
These are the PMIO & PMIO2 read & write routines from
src/southbridge/amd/sb800/sb800.c & sb800.h for use in the cimx
tree.  Currently most platforms using CIMX are calling WritePMIO()
directly from the src/vendorcode/amd/cimx/sbX00 directories
instead of using a wrapper function.
These functions only do byte reads & writes.

Change-Id: I881a6e2d4ddbba3dbdf4dd33e06313fe88b3682a
Signed-off-by: Martin L Roth <martin@se-eng.com>
Reviewed-on: http://review.coreboot.org/981
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-05-09 08:41:43 +02:00
Stefan Reinauer 4781800a66 Don't loop infinitely long on serial comm failures
If serial uart (8250/16x50) takes abnormally long to respond, give
up on logging to serial console and instead let the system boot.

Also reference bit in LSR register with correct name.

Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>

Ported from 9dd3ef165a to
uart8250mem.c:
Signed-off-by: Stefan Reinauer <reinauer@google.com>

Change-Id: Iaca4f57389c887110e6406d45053935891c96838
Reviewed-on: http://review.coreboot.org/826
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Tested-by: build bot (Jenkins)
Reviewed-by: Peter Stuge <peter@stuge.se>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
2012-05-08 04:34:26 +02:00
Patrick Georgi f8f00629e3 Some more #if cleanup
Replace #elif (CONFIG_FOO==1) with #elif CONFIG_FOO
find src -type f -exec sed -i "s,\(#.*\)(\(CONFIG_[A-Z0-9_]*\)[[:space:]]*==[[:space:]]1),\1\2,g" {} +
(manual tweak since it hit a false positive)

Replace #elif (CONFIG_FOO==0) with #elif !CONFIG_FOO
find src -type f -exec sed -i "s,\(#.*\)(\(CONFIG_[A-Z0-9_]*\)[[:space:]]*==[[:space:]]0),\1\!\2,g" {} +

Change-Id: I8f4ebf609740dfc53e79d5f1e60f9446364bb07d
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/1006
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Reviewed-by: Martin Roth <martin@se-eng.com>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-05-08 00:38:11 +02:00
Patrick Georgi c0e16e7024 Add config_enabled() from Linux
This change is taken from Linux. It allows to check for Kconfig
definitions in the preprocessor and source code using the same
idiom.

Long term plan is to remove our Kconfig hack to #define values to 0,
and this helps.

This includes a tiny modification to the macros to fix romcc support.

Change-Id: I0fddbea8c8ca215cf226acf39cb329b0ba0445a5
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/1005
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-05-08 00:36:09 +02:00
Patrick Georgi e166782f39 Clean up #ifs
Replace #if CONFIG_FOO==1 with #if CONFIG_FOO:
find src -name \*.[ch] -exec sed -i "s,#if[[:space:]]*\(CONFIG_[A-Z0-9_]*\)[[:space:]]*==[[:space:]]*1[[:space:]]*\$,#if \1," {} +

Replace #if (CONFIG_FOO==1) with #if CONFIG_FOO:
find src -name \*.[ch] -exec sed -i "s,#if[[:space:]]*(\(CONFIG_[A-Z0-9_]*\)[[:space:]]*==[[:space:]]*1)[[:space:]]*\$,#if \1," {} +

Replace #if CONFIG_FOO==0 with #if !CONFIG_FOO:
find src -name \*.[ch] -exec sed -i "s,#if[[:space:]]*\(CONFIG_[A-Z0-9_]*\)[[:space:]]*==[[:space:]]*0[[:space:]]*\$,#if \!\1," {} +

Replace #if (CONFIG_FOO==0) with #if !CONFIG_FOO:
find src -name \*.[ch] -exec sed -i "s,#if[[:space:]]*(\(CONFIG_[A-Z0-9_]*\)[[:space:]]*==[[:space:]]*0)[[:space:]]*\$,#if \!\1," {} +

(and some manual changes to fix false positives)

Change-Id: Iac6ca7605a5f99885258cf1a9a2473a92de27c42
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/1004
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Reviewed-by: Martin Roth <martin@se-eng.com>
2012-05-08 00:34:34 +02:00
Stefan Reinauer fe4221848f Make CBFS output more consistent
- Prefix all CBFS output messages with CBFS:
- Add an option DEBUG_CBFS that is off by default. Without DEBUG_CBFS
  enabled, the code will no longer print all the files it walks for
  every file lookup.
- Add DEBUG() macro next to LOG() and ERROR() to specify which messages
  should only be visible with DEBUG_CBFS printed.
- Actually print a message when the file we're looking for was found. :)

old:
Searching for fallback/coreboot_ram
Check cmos_layout.bin
Check pci8086,0106.rom
Check fallback/romstage
Check fallback/coreboot_ram

Change-Id: I2d731fae17a5f6ca51d435cfb7a58d6e017efa24
Stage: loading fallback/coreboot_ram @ 0x100000 (540672 bytes), entry @ 0x100000
Stage: done loading.
new:
CBFS: Looking for 'fallback/coreboot_ram'
CBFS: found.
CBFS: loading stage fallback/coreboot_ram @ 0x100000 (507904 bytes), entry @ 0x100000
CBFS: stage loaded.
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/993
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-05-04 08:11:28 +02:00
Patrick Georgi 872eb79393 siemens/sitemp_g1p1: Drop debug code
Change-Id: I40a4201b468131ba67e48ab68d62ca5413f2e2e8
Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com>
Reviewed-on: http://review.coreboot.org/1000
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-05-04 01:54:16 +02:00
Patrick Georgi 2e2a68bbc8 roda/rk886ex: Expose VGA devices in devicetree
Otherwise set_subsystem isn't called for these (as they're not
marked on_mainboard)

Change-Id: I08e781735c59e4aa61009d2afa165d782f5a849e
Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com>
Reviewed-on: http://review.coreboot.org/998
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-05-04 01:54:08 +02:00
Stefan Reinauer 8a36634388 Don't pre-enable SATA AHCI in romstage.c
In a recent commit the SATA code of Panther Point / Cougar Point was
changed to enable AHCI mode depending on the device tree settings rather
than a hard code hidden in romstage.c. However, Emerald Lake 2 was not
fixed up accordingly.

Change-Id: I6c93f386509361e1ab5565b0e4d0e84f0ba282a2
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/995
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-05-03 20:34:44 +02:00
Stefan Reinauer d4bacf962c Print some useful debugging information in PSS table creation
Change-Id: I1ec7a7e54513671331ac12f08d5f59161b72b0fd
Example:
PSS: 1900MHz power 35000 control 0x1300 status 0x1300
PSS: 1600MHz power 28468 control 0x1000 status 0x1000
PSS: 1400MHz power 24291 control 0xe00 status 0xe00
PSS: 1200MHz power 20340 control 0xc00 status 0xc00
PSS: 1000MHz power 16569 control 0xa00 status 0xa00
PSS: 800MHz power 12937 control 0x800 status 0x800
PSS: 1900MHz power 35000 control 0x1300 status 0x1300
PSS: 1600MHz power 28468 control 0x1000 status 0x1000
PSS: 1400MHz power 24291 control 0xe00 status 0xe00
PSS: 1200MHz power 20340 control 0xc00 status 0xc00
PSS: 1000MHz power 16569 control 0xa00 status 0xa00
PSS: 800MHz power 12937 control 0x800 status 0x800
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/994
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-05-03 20:34:05 +02:00
Stefan Reinauer 6870f0cc29 Make creation of CBMEM_ID_RESUME_SCRATCH depending on Agesa
The CBMEM_ID_RESUME_SCRATCH area is only used by Agesa code, on one
particular board (AMD Persimmon). Make the creation of that section
depending on Agesa so it does consume space on non-Agesa systems.

Change-Id: I2a1a4f76991ef936ea68cf75928b20b7ed132b84
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/992
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-05-03 20:33:42 +02:00
Stefan Reinauer f125d80135 Add missing newline to printk in Sandybridge init code
Change-Id: I9217a75ec1a0abb898c45752d990231ce98e5fb2
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/991
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-05-03 20:33:22 +02:00
Stefan Reinauer cabc8042a2 Tell CBMEM pretty printer about MRC cache
Sandybridge memory initialization produces some amount of training data
that has to be kept around in CBMEM. Add a descriptive name to the CBMEM
pretty printer to prevent it from just printing the hex value.

Change-Id: I587c0bc3dfcf389ba298d445d2594eef73bc69a8
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/990
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-05-03 20:33:13 +02:00
Stefan Reinauer 3b5a9edcb2 Fix register corruption during Intel Microcode update
Another bug in the Intel microcode update code that existed since we switched
to LinuxBIOSv2 in 2004:

The inline assembly code that reads the CPU revision from an MSR after running
cpuid(1) trashes registers EBX and ECX. Only ECX was mentioned in the clobber
list. C code running after this function could silently access completely wrong
data, which resulted in the wrong date being printed on microcode updates (and
potentially other issues happening until the C code writes to EBX again)

Change-Id: Ida733fa1747565ec9824d3a37d08b1a73cd8355f
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/996
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-05-03 19:49:21 +02:00
Stefan Reinauer 8bec7fbc0f ChromeOS: drop unused debug header description
No part of ChromeOS seems to use the debug header description, so drop
it to make sure it does not get copied around wrongly.

Change-Id: Icb0baedbf6112f11289b2ddd9618a955a424ddf7
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/989
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-05-02 22:28:56 +02:00
Stefan Reinauer adc05c14c7 Make Intel i5000 specific options only appear on i5000 systems
Change-Id: If183611b0b62d9321a5a12311c4cb3b344b04b36
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/986
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-05-02 21:06:56 +02:00
Stefan Reinauer 252111d433 Don't include console.h in microcode.c when compiling with ROMCC
If microcode.c is built by romcc, this indicates that we are running
microcode updates in the bootblock (e.g. before enabling cache as ram).
In this case we did not enable any consoles yet, so we don't output
anything.

This patch removes inclusion of the unnecessary console/console.h for
that case, which was breaking with certain configurations.

Change-Id: Iebb57794d7b1e84cac253d249d47b88de4dd28a3
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/988
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-05-02 21:06:31 +02:00
Stefan Reinauer cafedcf5c8 Strip quotes from Sandybridge MRC blob
This fixes my build when specifying an absolute path to the binary.

Change-Id: I95fb3960be70f78146c6afeb9cc777dccdca6b5b
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/987
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-05-02 20:00:27 +02:00
Vadim Bendebury 7a3f36a228 Sandybridge: Display platform information early
It is important to have the system configuration reported as early as
possible to have a better idea what exact chipset the platform is
running with.

This change adds code to have an early coreboot module report the CPU
and PCH information. CPU info includes the 32 bit feature information
word, the symbolic processor brand string, and information about some
features support, as obtained through CPUID instructions.

The PCH information includes the symbolic device name and PCI device
version.

Change-Id: If6c21ad5ffb76d7d57d89f4f87d04bdd7192480a
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: http://review.coreboot.org/975
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-05-02 19:52:37 +02:00
Duncan Laurie 4aca5d7e66 Fix issue with PCIe power management setup
The current early PM setup that attempts to configure dynamic clock
gating relies on PCIe functions to be enabled that may not be.
Instead of reading port 0 or 4 directly to determine the link width
use the register that refelects the soft strapping options as this
will always be available.

Also add a clear register assignment and break for port 0 in the
switch statement instead of falling through to port 4 as that could
end up setting the slot power limit based on port 4 values instead
of based on port 0.
register 0xE1=0x3f and all other root ports should have 0xE1=0x03.

When port 0 and 4 are disabled they will have 0xE1=0x3C before
being disabled by the pch enable handler.

LUMPY default:

  00:1c.0 PCI bridge: Intel Corporation Device 1c10 (rev b5)
  00:1c.3 PCI bridge: Intel Corporation Device 1c16 (rev b5)

  pci_read8 0 0x1c 0 0xe1
  0x3f

  pci_read8 0 0x1c 3 0xe1
  0x03

LUMPY with PCIe port coalesce enabled:
  00:1c.0 PCI bridge: Intel Corporation Device 1c10 (rev b5)
  00:1c.1 PCI bridge: Intel Corporation Device 1c16 (rev b5)

  pci_read8 0 0x1c 0 0xe1
  0x3f

  pci_read8 0 0x1c 1 0xe1
  0x03

Change-Id: I33a37b0ec0c8e570cf5d9dda2c06e0225fee135c
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: http://review.coreboot.org/980
Tested-by: build bot (Jenkins)
2012-05-01 21:23:32 +02:00
Duncan Laurie b9fe01c881 Add an option to enable PCIe root port coalescing
Background: The PCI spec (3.0-3.2.2.3.4) requires that PCI devices
implement function 0.  The Linux Kernel therefore will not enumerate
a PCI device if it does not present a valid config space at function 0.

If a board does not have anything connected to root port 0 and it is
desired to disable the unused ports in order to save power then this
will cause the other downstream PCIe devices to go missing as they
will not be enumerated.

Intel chipsets provide a way to map root port numbers to different PCI
function numbers, thereby avoiding this issue and allowing root port 0
to be turned off.

This change adds a new chip config option 'pcie_port_coalesce' that
will collapse the enabled root ports into a linear map starting at
zero.  This option defaults to disabled as it can have a confusing
effect on the system as the declared static devicetree may not match
what is seen at runtime.  This option is also forced on if the static
devicetree disables port 0.

When each root port is processed in the early enable stage it looks
for a lower numbered root port that has been disabled and then swaps
the two assigned function numbers.

However the mapping register is write-once so it has to keep track of
the proposed mapping changes until all ports have been processed
before writing out the final map value.  At this point it also updates
the function numbers in the static device tree so they are consistent
with the new layout.

There are a few other closely related fixes in this change:

1) There is a power savings opportunity if an entire bank of ports
(0-3 or 4-7) are disabled.  This was checking the chipset revision to
look for CougarPoint B1+ stepping and that was not passing on
PantherPoint where this should always be applied.  To fix this I added
a function to determine the chipset type based on comparing the upper
byte of the device ID.

2) Apply the same chipset type check fix to the IOBP programming.

3) There is another power savings opportunity to enable dynamic clock
gating on shared PCIe resources which only applies to ports 0 and 4.
However if 0 or 4 is disabled then the later check to enable this
would fail as that device is already hidden.

LUMPY current:

  00:1c.0 PCI bridge: Intel Corporation Device 1c10 (rev b5)
  00:1c.3 PCI bridge: Intel Corporation Device 1c16 (rev b5)
  01:00.0 Network controller: Atheros Communications Inc. Device 0030 (rev 01)
  02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B

LUMPY with PCIe port coalesce enabled:

  00:1c.0 PCI bridge: Intel Corporation Device 1c10 (rev b5)
  00:1c.1 PCI bridge: Intel Corporation Device 1c16 (rev b5)
  01:00.0 Network controller: Atheros Communications Inc. Device 0030 (rev 01)
  02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B

Change-Id: I828aa407fdc9c156c1c42eda8e2d893c0aa66eef
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: http://review.coreboot.org/979
Tested-by: build bot (Jenkins)
2012-05-01 21:21:45 +02:00
Duncan Laurie c323036884 Update PCIe Root Port _PRT to handle re-mapped functions
The chipset enforces static-defined interrupt swizzling on PCIe root
ports so if a port is remapped to a different function it needs to
still report the proper interrupt map to the OS instead of assuming
that function number is equivalent to root port number.

This change also includes an update to the PCH function disable
register which was incorrect for CPT/PPT and would cause unpredictable
behavior if used.

The kernel command line was changed to add 'nomsi' in order to force
PCIe devices to use IO-APIC assigned interrupts and not MSI to ensure
that the mapping is correct.

LUMPY current:

  00:1c.0 PCI bridge: Intel Corporation Device 1c10 (rev b5)
  00:1c.3 PCI bridge: Intel Corporation Device 1c16 (rev b5)

  16:   41518   0   0   0   IO-APIC-fasteoi   i915, ahci, ath9k
  19:     720   0   0   0   IO-APIC-fasteoi   ehci_hcd:usb2, eth0

LUMPY with PCIe port coalesce enabled:

  00:1c.0 PCI bridge: Intel Corporation Device 1c10 (rev b5)
  00:1c.1 PCI bridge: Intel Corporation Device 1c16 (rev b5)

  16:   38988   0   0   0   IO-APIC-fasteoi   i915, ahci, ath9k
  19:     347   0   0   0   IO-APIC-fasteoi   ehci_hcd:usb2, eth0

Change-Id: Ia5f6bb8888b5c38a5dbc88bb25ecdf1fca41ee3e
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: http://review.coreboot.org/978
Tested-by: build bot (Jenkins)
2012-05-01 21:21:19 +02:00
Stefan Reinauer 2c41c4027f Drop CONFIG_MAX_PHYSICAL_CPUS on non-AMD boards
CONFIG_MAX_PHYSICAL_CPUS is defined by quite a number of
mainboards whithout any code actually using the variable.
Hence, drop MAX_PHYSICAL_CPUS from Kconfig for those boards.

In the long run we should drop CONFIG_MAX_PHYSICAL_CPUS use
completely and make the code dynamic or depend on CONFIG_MAX_CPUS
instead.

Change-Id: I37dcc74d245ddba5186b96bd82220dacb6f4d323
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/984
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-05-01 21:20:21 +02:00
Stefan Reinauer 816d081760 Fix SATA port map to only enable port 0
The sata controller comes up in legacy/normal mode and
is currently put into AHCI mode in romstage.

If that is removed and the controller is left alone until the
ramstage driver (like we do on Stumpy/Lumpy) then the resource
allocator will have configured the device for IDE mode with an
IO address in BAR5.  Then when the ramstage driver puts the
controller into AHCI mode it will not have the correct resources
to do the rest of the AHCI setup.

So the controller mode needs to be changed in the enable stage
rather than in the init phase.  This same register contains
the port map and it is a R/WO (write once) field so the configured
port map must be written at the same time.  For non-AHCI mode
the devicetree map was ignored before but it is used now.

Since the port map register is now written at enable step it
does not need to be written again during init.

With this change the sata port map can be reduced to just port 0
and then U-boot does not have to probe all available ports.

Change-Id: I977952cd88797ab4cea79202e832ecbb5c37e0bd
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: http://review.coreboot.org/977
Tested-by: build bot (Jenkins)
2012-05-01 20:08:00 +02:00
Duncan Laurie 8508cff035 Update Ivybridge GT power meter tables
- New table for GT1
- Updates to GT2 17W table
- New table for GT2 35W SKU
- New table for GT2 Other

This also includes a workaround to poll on a different register
when deasserting force wake.  On some SKUs the kernel is hanging
when bringing up graphics unless this register is also polled.

Change-Id: I2badf62b464e901cfb0eaf4fc196f59111c71564
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: http://review.coreboot.org/974
Tested-by: build bot (Jenkins)
2012-05-01 20:07:02 +02:00
Duncan Laurie dd585b8825 Update ivybridge graphics initialization
- Add config options to set backlight registers
- Update powermeter weight tables for IvyBridge GT1 and
add a new table for GT2 SKU
- Fix a few registers used during GPU PM init sequence

Change-Id: I1500bc07e3ba1bc10c77e7856089e716489dc07a
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: http://review.coreboot.org/973
Tested-by: build bot (Jenkins)
2012-05-01 20:06:47 +02:00
Stefan Reinauer c908fc762c Fix TPM driver to work with multiple vendor TPMs
Port u-boot patch for low-level driver:
- Fix bug in traversal of vendor name list.
- Sending "command ready" needs additional logic to handle
TPMs that need that bit set twice: once to empty the read
FIFOs and once to actualy set command ready.

Change-Id: I57c280266b2e966c5b90e4f9e968426a33b93cf1
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: http://review.coreboot.org/972
Tested-by: build bot (Jenkins)
2012-05-01 20:06:32 +02:00
Duncan Laurie 95be1d6f46 Don't disable ACPI in the S3 resume path
The OS does not re-execute the APMC 'enable ACPI' SMI
on resume so this has the potential to leave things
in an unknown state.

Change-Id: Iaf0fcb99f699e9e0ecacaab3f529026782a95151
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: http://review.coreboot.org/971
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-05-01 20:06:13 +02:00
Duncan Laurie 7b508ddecb Only send ME Dram Init Done message on Sandybridge
This is done inside the SystemAgent binary on Ivybridge.

Change-Id: I8fb0f593a65a4803e160b284c21b9d5021e2e4a0
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: http://review.coreboot.org/970
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-05-01 20:04:41 +02:00
Vincent Palatin 0ff99b70f5 Modify DMI init for IvyBridge
The ASPM setting for the Direct Media Interface should no longer be done on
Ivybridge/PantherPoint based systems.

Change-Id: Id30de1beb1b162564048e76712736ccf7049dc7c
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-on: http://review.coreboot.org/969
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-05-01 20:04:24 +02:00
Vadim Bendebury 459b7777fe add new LPC controller device ID value
This adds the PCI device id of the LPC controller identifying the
QPRJ/QS stepping of the Panther Point southbridge.

Change-Id: Idcaa7dbd30224e3690ea469c6cb74f75de287631
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: http://review.coreboot.org/968
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-05-01 20:03:31 +02:00
Vadim Bendebury 8049fc91de Allow device ID arrays in the PCI driver structure
Many PCI devices share the very same driver despite having different
PCI device IDs, which causes a lot of copy and paste of driver
definitions.

This change introduces a way to specify the array of acceptable
device IDs in a single driver entry. As an example the Intel
{Sandy|Ivy} Bridge SATA driver is being modified to use a single
driver structure for all different SATA controller flavors, a few
more Ivy Bridge IDs are being added as well.

BUG=none
TEST=manual
  . modified coreboot brought up an Ivy Bridge platform all the
    way to Linux login screen.

Change-Id: I761c5611b93ef946053783f7a755e6c456dd6991
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: http://review.coreboot.org/982
Tested-by: build bot (Jenkins)
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-05-01 20:02:21 +02:00
Gabe Black 599e204efc Clean up Emerald Lake 2 mainboard directory
Change-Id: I4a64a56dda22050a31232807096e15565a665377
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://review.coreboot.org/967
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-05-01 20:01:18 +02:00
Stefan Reinauer 8172d0be97 Allow more CPU cores on Emerald Lake 2 CRB
The Emerald Lake 2 CRB can potentially have more
than 8 CPU cores, so update the number of max cores
accordingly.

Change-Id: Ia42ed8a84916f66dfbfdf2a72cbbed5cea61899b
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/966
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-05-01 19:53:53 +02:00
Gabe Black f40a2590ac Set up ChromeOS dev mode, recovery, and write protect GPIOs on Emerald Lake 2.
The Emerald Lake 2 CRB wasn't designed with ChromeOS in mind, so there aren't
any actual developer mode, recovery mode, or write protect switches, let alone
GPIOs to read them from. Instead, I've commandeered signals connected to GPIOs
which are for other things but which aren't used by hardware or, for instance,
the EC to do something Coreboot doesn't control.

The recovery mode switch is connected to GPIO 22 and is called BIOS_REC on the
schematic. The name is at least very reminiscent of the right thing even if
it's supposed to be used for something else. There's a jumper on the board
labelled J8G1 which can force the line to ground, and if not, there's a switch
on the front of the case which toggles its value. "RECOVER" is for recovery
mode and "KEEP" is for normal mode.

The developer mode switch is connected to GPIO 57 and is called SV_DET on the
schematic. It's connected to a jumper labelled J8E2 on the board and, as far as
I can tell, can't be controlled in any other way. When the jumper is in place
and the pins are shorted, developer mode is selected. When the jumper is
removed, normal mode is selected.

The write protect is connected to GPIO 48 which is called BIOS_RESP on the
schematic. It's connected to a jumper labelled J8E3 which, like j8E2, seems to
be the only way to control the line it's on. When the jumper is in place,
write protect is "disabled", and when it's in place it's "enabled" even though
there's no functional difference.

The input for the recovery mode switch was chosen because of the name it
already had on the CRB, BIOS recovery, and because there's a switch to control
it on the front of the case which makes it easy to get at. The jumpers for
developer mode and recovery mode were chosen because there weren't very many
options available, and of those these were next to each other which should
make them easier to find and work with. It might be a good idea to wire toggle
switches up to the pins of those jumpers so they'll be easy to identify, can
be labelled, and would be easier to work with than little jumpers in the
middle of the motherboard.

Change-Id: Ib2c3dc05077dacfbede596dae143ed81a99dbebd
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://review.coreboot.org/965
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-05-01 19:33:58 +02:00
Stefan Reinauer e6063fee5c Fix Sandybridge/Ivybridge mainboards according to code review
This fixes a few cosmetics with the following three boards:

 - Intel Emerald Lake 2
 - Samsung ChromeBook
 - Samsung ChromeBox

The following issues were fixed:

 - rely on include path in ASL code instead of specifying relative
   paths
 - use updated ALIGN_CURRENT in acpi_tables.c
 - use preprocessor defines instead of hard coded values where possible

Change-Id: Ia5941be3873aa84c30c13ff2f0428d1c52daa563
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/963
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Tested-by: build bot (Jenkins)
2012-05-01 19:27:34 +02:00
Patrick Georgi a1155b47ca Move VSA support from x86 to Geode
Instead of the special case in the generic Makefile.inc,
use cbfs-files in the CPU directories.

Change-Id: I71d9c8dff906c9a516ac0dd09a315f8956075592
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/962
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: build bot (Jenkins)
2012-05-01 11:35:40 +02:00
Patrick Georgi 0909d86760 Support adding stages with cbfs-files
stages have special cbfstool syntax, which we need to support.

Change-Id: I119255246af818f010acfc7ec2091a6184e74eb3
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/961
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: build bot (Jenkins)
2012-05-01 11:35:34 +02:00
Patrick Georgi 943ddcee53 Make geode_lx use the vsa from blobs repository
... or fail if repository is not enabled.

Change-Id: I0a1e6d6fed852ec7edf96ace8346ae6b23838a56
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/959
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: build bot (Jenkins)
2012-05-01 11:35:22 +02:00
Gabe Black 5fe7a209f5 Set up the Emerald Lake 2 SMI and SCI sources based on the schematic.
This sets up the SMI and SCI inputs on the PCH for Emerald Lake 2 based on my
best interpretation of the schematic. It may not be correct, but it doesn't
seem to cause any problems either.

Change-Id: I21238b3853a92893ec7f08baa2a3ebd35c49dd97
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://review.coreboot.org/964
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-05-01 07:24:16 +02:00
Patrick Georgi 7e9b9d893c Add Kconfig options to handle the blobs repository
One option to allow using the repo (defaults to no),
one to let boards state that they require it in the
current configuration.

The build system checks out the repo if allowed, and
fails if the repo is requested by the configuration
but not desired by the user.

Change-Id: If71d80b329cf528aa467fcb0b4d9d7c7434aab27
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/957
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: build bot (Jenkins)
2012-05-01 00:09:27 +02:00
Stefan Reinauer e1ae4b212f Add support for Sandybridge base Samsung ChromeBox
Change-Id: Ic93ad2749834c8f7a2ca1651d343561f2a496312
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/953
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-04-30 23:09:26 +02:00
Stefan Reinauer 155e9b5533 Add support for Sandybridge based Samsung ChromeBook
Change-Id: I8bf439bc903c1ec105016866753c7cb9ccfe5974
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/952
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-04-30 23:09:10 +02:00
Stefan Reinauer 6651da3bcd Add support for Intel Emerald Lake 2 CRB
This adds support for Intel's Emerald Lake 2 board.

Change-Id: Ifaeeac9d52fe655324ee29df5f7187b89b35f73a
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/951
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-04-30 23:08:06 +02:00
Stefan Reinauer c31384e62c Fix up Sandybridge C state generation code
This code fixes the sandybridge C state generation code to work with
the current version of the ACPI code generator.

Change-Id: I56ae1185dc0694c06976236523fdcbe5c1795b01
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/950
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-04-30 23:07:55 +02:00
Stefan Reinauer f69b46805c acpigen: make acpigen_write_CST_package_entry non-static
It's used by Sandybridge specific C state generation code.

Change-Id: Ia6f1e14e748841a9646fd93d0a18f9e8f2a55e29
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/949
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-04-30 23:07:44 +02:00
Stefan Reinauer 6ea86b19f3 Sandybridge: Temporarily disable MRC cache finding code
This code is still using libfdt which was denied for inclusion
in coreboot, so it won't compile as is.
Without MRC cache, waking from suspend won't work, and cold boots are
significantly slower (adds around 300-400ms per channel IIRC).
A rework of this code is currently in the works, but will take a little bit
more time (and should not hold back the mainboards being merged)

Change-Id: Ifb9e7d7b86c1f52378803a748810da0d51b58384
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/948
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-04-30 23:07:31 +02:00
Stefan Reinauer 35555167c2 acpi: Add defines for functional fixed hardware
Change-Id: I9c5148eb315e2f478cb753d9918144a19e417379
Signed-off-by: Duncan Laurie <dlaurie@google.com>
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/945
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2012-04-30 23:06:42 +02:00
Stefan Reinauer 39205c6702 acpigen: Add support for generating T state tables
Change-Id: I58050591198bb06de5f0ca58ca3a02f1cfa95069
Signed-off-by: Duncan Laurie <dlaurie@google.com>
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/944
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2012-04-30 23:06:08 +02:00
Stefan Reinauer 4cc8c70c32 Rework ACPI CST table generation
... in order to unify the Sandybridge and Lenovo implementations
currently used in the tree.

- use acpi_addr_t in acpigen_write_register()
- use acpi_cstate_t for cstate tables (and fix up
  the x60 and t60)
- drop cst_entry from acpigen.h

Change-Id: Icb87418d44d355f607c4a67300107b40f40b3b3f
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/943
Tested-by: build bot (Jenkins)
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2012-04-30 23:05:40 +02:00
Martin Roth a403c687b1 Add default map_oprom_vendev() for AMD Family 14h processors.
AMD supplies their video bios for the Family 14h processor line
with Vendor ID: 1002, Device ID: 9802.  This rom should work for
Device IDs 9802-9809.  This patch maps all those device IDs to
0x9802 so coreboot will be able to load the vbios.  If a vbios
rom using the ACTUAL Device ID is loaded, this function will not
be called.
This file should contain of all Family 14h Graphics PCI IDs so
that they don't need to be overridden on a per mainboard basis.

Change-Id: If3d4a744b3c400dea9444a61f05382af2b2d0237
Signed-off-by: Martin L Roth <martin@se-eng.com>
Reviewed-on: http://review.coreboot.org/955
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Reviewed-by: Marc Jones <marcj303@gmail.com>
2012-04-30 17:20:32 +02:00
Martin Roth 40aa9bce7d Update amd/south_station/fadt.c with various fixes
This is a model fadt.c that I would like to use for updating
several other AMD platforms with after acceptance.

- Updated to match ACPI 3.0b specification and added comments
  to reflect that.
- Since smi_cmd is 0, remove commands that rely on it:
  acpi_enable, acpi_disable, & pstate_cnt
  Add comments to that effect.
- Changed preferred_pm_profile to SOHO Server (platform
  specific)
- The southstation platform is legacy free - Updated
  iapc_boot_arch and flags to reflect that.
- Added reset_register flag so that operating systems
  will actually use the reset_reg.  This is important
  on legacy free systems.
- Updated Generic Address Structures to use access_size
  name in the updated acpi.h.  Added access sizes to
  the structures where reasonable.
- Removed 64-bit x_firmware_ctl pointer to facs.  This was
  causing a fwts failure and windows-64 BSOD.
- Added bit width for pm2_cnt_blk and modified gpe0_blk bit
  to match the hardware.

Change-Id: Icf1a982aa122636d1088c8b80f53d04732b54c49
Signed-off-by: Martin L Roth <martin@se-eng.com>
Reviewed-on: http://review.coreboot.org/942
Tested-by: build bot (Jenkins)
Reviewed-by: Marc Jones <marcj303@gmail.com>
2012-04-29 18:34:08 +02:00
Stefan Reinauer 61e7c289d4 ChromeOS: Add missing prototype for acpi_get_vdat_info()
Change-Id: I4bd9b52cfc24a8ff73be05ee535b9e16c0d9bd79
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/946
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Tested-by: build bot (Jenkins)
2012-04-28 18:39:12 +02:00
Stefan Reinauer 5b73d4d1bb acpigen: make acpigen_write_len_f() non static
since it is used in CPU specific ACPI generation code

Change-Id: I2559658f43c89dc5b4dc8230dea8847d2802990c
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/947
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-04-28 09:03:40 +02:00
Martin Roth e9dfdd9dbd Reverse Vendor ID & Device ID for map_oprom_vendev()
- When calling map_oprom_vendev() the vendor ID and device ID
  are joined into a 32 bit value.  They were reversed from the
  order that I would have expected - Device ID as the high 16 bits
  and the Vendor ID as the low 16.  This patch reverses them so
  so that the the dword comparison in map_oprom_vendev() matches
  what's entered into Kconfig for vendor,device.
- Change files calling map_oprom_vendev()

Change-Id: I5b84db3cb1a359a7533409fde7d05fbc6ba3fcc4
Signed-off-by: Martin L Roth <martin@se-eng.com>
Reviewed-on: http://review.coreboot.org/938
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-04-28 02:45:22 +02:00
Stefan Reinauer 0e672b52d4 coreboot_table.c: Add missing include files
If compiling coreboot with ChromeOS support, two
more include files are required.

Change-Id: I7e042e250e4a89e7dd4bab58443824d503c3f709
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/931
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-04-27 20:16:47 +02:00
Stefan Reinauer 16401b8f6d SMM: Add udelay on Sandybridge systems
Cougar Point southbridge does udelay in SMM, hence add it on Sandybridge
systems.

Change-Id: I6e5520ca27e7c6eaae632992fb68612067bc1e30
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/937
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-04-27 19:24:19 +02:00
Stefan Reinauer 80529abdfb Cougar Point southbridge: Add includes and drop post_code()
post_code() was added in our internal tree by duplicating code. It's not of
much use at this point, since the code is quite well tested, so avoid bloating
the bootblock (since compiled with ROMCC).
Also add some missing include files that didn't seem to be needed with an
older version of coreboot.

Change-Id: Id62b838728a247e8bcadb4f1db17269be0d4f3f4
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/936
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-04-27 19:24:13 +02:00
Stefan Reinauer adc7bb06cd ChromeOS: add missing string.h in gnvs.c
string.h is required to build with the reference toolchain.

Change-Id: I9fd8d2ea8fc676d3502989cbcc7aefe3b2d738b6
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/935
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-04-27 19:24:04 +02:00
Stefan Reinauer b5866f2fb6 SMSC MEC1308: Fix ACPI code to work with newer IASL versions
Newer versions of IASL didn't like our IO constructs. Use
FixedIO instead, it's also shorter.

Change-Id: I9364d993ecb71ffd84c0313ca1e2f870af59eb24
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/934
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-04-27 19:23:58 +02:00
Stefan Reinauer bf34e94095 SMM: unify mainboard APM command handlers
rename from mainboard_apm_cnt to mainboard_smi_apmc to match the function
naming scheme of the other handlers. Add prototype for mainboard_smi_sleep
(mainboard specific S3 sleep handlers in SMM) that is required by Sandybridge.

Change-Id: Ib479397e460e33772d90d9d41dba267e4e7e3008
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/933
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-04-27 19:23:50 +02:00
Stefan Reinauer ac8209a4b3 cpu/cpu.h: add ROMCC guards
In order to use the generic microcode update code in the bootblock, cpu/cpu.h
needs ROMCC guards. Also, delete the unused struct device declaration and move
the struct bus declaration to where it's used.

Change-Id: I0cc731c555593946e931a680ec93994932530599
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/932
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-04-27 19:23:41 +02:00
Stefan Reinauer ae5e11d7cd Move top level pc80 directory to drivers/
There is no reason for this to be a top level directory.
Some stuff from lib/ should also be moved to drivers/

Change-Id: I3c2d2e127f7215eadead029cfc7442c22b26814a
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/939
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-04-27 19:23:16 +02:00
Martin Roth aee1869fcf Updates to x86/include/arch/acpi.h for use in fadt.c
- Added a union to identify the byte that was reserved in the
  Generic Address Structure from ACPI 2.0 to ACPI 2.0b as the
  Access Size byte for ACPI 2.0c to ACPI 5.0
- Added various #defines for use in the FADT
- Added a couple of comments for the #endifs

Change-Id: I294ddfd89fcb0ad88bb6e52d911f807d84671e82
Signed-off-by: Martin L Roth <martin@se-eng.com>
Reviewed-on: http://review.coreboot.org/930
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: build bot (Jenkins)
2012-04-27 01:36:30 +02:00
Stefan Reinauer 31109452c2 microcode: print date of microcode and unify output
Most subsystems print their name with a colon, and then the
message. Do the same thing for the microcode update code.

Also, each microcode update has a date header. Print the
date from that header to make it easier to determine whether
you're running the latest microcode.

Change-Id: Ic22947c4b9f0502d4091d975e1f1ab42f70aa1aa
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/929
Reviewed-by: Peter Stuge <peter@stuge.se>
Tested-by: build bot (Jenkins)
2012-04-26 02:32:04 +02:00
Stefan Reinauer 3f8989ebbc Revamp Intel microcode update code
- add GPLv2 + copyright header after talking to Ron
- "bits" in struct microcode served no real purpose but
  getting its address taken. Hence drop it
- use asm volatile instead of __asm__ volatile
- drop superfluous wrmsr (that seems to be harmless but
  is still wrong) in read_microcode_rev
- use u32 instead of unsigned int where appropriate
- make code usable both in bootblock and in ramstage
- drop ROMCC style print_debug statements
- drop microcode update copy in Sandybridge bootblock

Change-Id: Iec4d5c7bfac210194caf577e8d72446e6dfb4b86
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/928
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-04-26 00:46:35 +02:00
Patrick Georgi 05e740fc40 Replace cache control magic numbers with symbols
Instead of opaque numbers like (1<<29), use
symbols like CR0_NoWriteThrough.

Change-Id: Id845e087fb472cfaf5f71beaf37fbf0d407880b5
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/833
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-04-25 16:27:07 +02:00
Denis 'GNUtoo' Carikli 8919729307 ASUS M4A785T-M mainboard: fix screen flickering issues
Without that fix the screen flickered with resolutions superior
  to 832x624 because the cpu_ht_freq was 0 (so it ran at 200Mhz).

Change-Id: I1056d76b1d77f6177594ed9d03ecc5ae7b3c2c13
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@no-log.org>
Reviewed-on: http://review.coreboot.org/900
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-04-25 12:07:07 +02:00
Kyösti Mälkki 1e9c1b3e1d Makefile: rename romstage linking filenames
Move final build results under $(objcbfs).
Move intermediate files under $(objgenerated).
Remove use of sed -i.

Change-Id: Ie035a1544848b26514a197c340f470201065b8d5
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/859
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-04-24 23:25:31 +02:00
Kyösti Mälkki 38f2e9cfe3 Makefile: rename coreboot_ap linking filenames
$(obj)/coreboot_ap -> $(objcbfs)/coreboot_ap.elf

It is really a ramstage for AP CPU and not a romstage, it is not
enabled for any mainboard by default, and it doesn't compile
even if enabled.

Change-Id: Ifb9c5cb6df65309660b000876cf6a9a3da9b6839
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/840
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-04-24 23:22:15 +02:00
Kyösti Mälkki 6b07b8df92 Makefile: rename ramstage linking filenames
Move final build results under $(objcbfs).
Move intermediate files under $(objgenerated).

Change-Id: I0046f68938be81b8efa525aa50b39328ca02ecb6
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/839
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-04-24 23:13:00 +02:00
Kyösti Mälkki f775b8c8df Makefile: rename bootblock linking filenames
Move final build results under $(objcbfs).
Move intermediate files under $(objgenerated).

Change-Id: I0365304e1b0ed02a5a3ec720b0cf3e303eaefa7c
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/838
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-04-24 23:12:19 +02:00
Patrick Georgi f526889e8b rk886: Add ACPI support for LID switch
Change-Id: Ib5a34491531228db9a9232322bd573fded27ee67
Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com>
Reviewed-on: http://review.coreboot.org/924
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-04-24 23:09:24 +02:00
Rudolf Marek 3294a0f1ca Make timestamp collection conditional in hardwaremain.c
Otherwise it breaks 486 boards without RDTSC, ending with
exception 6.

It ends like this on bifferboard:

Jumping to image.
Unexpected Exception: 6 @ 10:001007e3 - Halting
Code: 0 eflags: 00000016
eax: 001001fe ebx: 00100118 ecx: 00000000 edx: 00108e00
edi: 0010aaf8 esi: 00000000 ebp: 00117ff4 esp: 00117fd8

Please keep in mind 486, dont use rdtsc/cpuid in generic code, or if you do make sure make it non-default option.

Change that broke it: http://review.coreboot.org/#/c/749/7/src/boot/hardwaremain.c

Change-Id: I974b25377c20a11430b35b24dcc275d8cbfd2b9a
Signed-off-by: Rudolf Marek <r.marek@assembler.cz>
Reviewed-on: http://review.coreboot.org/925
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-04-24 18:19:54 +02:00
Alec Ari 02c204706f Fix whitespace for ma785gm
Fix tabs and whitespace for
ma785gm mainboard.c file.

Change-Id: I8c94bf428bc4e78871da8c64f89221af4151e16d
Signed-off-by: Alec Ari <neotheuser@ymail.com>
Reviewed-on: http://review.coreboot.org/923
Tested-by: build bot (Jenkins)
Reviewed-by: Peter Stuge <peter@stuge.se>
2012-04-24 03:58:17 +02:00
Alec Ari 8a527cfb49 Update MA785GM code
This commit adds the following to MA785GM:

Refactor some alignment handling
Unify Local APIC address definitions
ACPI: More ../../.. removal
Remove old AMD fam10 fixme comment
amd/sb700: Move HAVE_HARD_RESET to southbridge

Change-Id: I85a95bb641375dd61d1f58a2f2f972771d1d9ad9
Signed-off-by: Alec Ari <neotheuser@ymail.com>
Reviewed-on: http://review.coreboot.org/922
Tested-by: build bot (Jenkins)
Reviewed-by: Peter Stuge <peter@stuge.se>
2012-04-24 03:57:45 +02:00
Kyösti Mälkki 1d89f14355 Intel 82801dx: compile early_smbus as separate object
Add early_smbus.c for romstage-y list and remove respective
include on mainboard romstage.c files.

Tested on AOpen board.

Change-Id: I1c7e6cb32e3a9d7cc9b6037dc27e59149d492001
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/909
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-04-24 00:02:12 +02:00
Alec Ari 0a19ddc36d Add support for MA785GM-US2H
This patch adds coreboot support for the
GIGABYTE MA785GM-US2H board.

This port now removes all dead code in
the previous patch set, and also boots Fedora 16
on x86_64 (Phenom II X4 955 BE)

On-board audio causes spurious interrupts and
the kernel gets stuck in an infinite loop.

AtomBIOS on RadeonHD video cards does not function
and causes another infinite loop. radeon.modeset=0
must be set. acpi=off must also be set.

With those kernel command line options set,
Fedora 16 makes it to the login screen. USB
mouse and keyboard don't work though. several
USB error codes on boot-up. PS/2 should.

Change-Id: I58a7083a023ebf7373b6ded2e9f0adda7ab76dea
Signed-off-by: Alec Ari <neotheuser@ymail.com>
Reviewed-on: http://review.coreboot.org/476
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-04-23 22:27:05 +02:00
Philip Prindeville c02cbf1064 alix2: add support for alix6
The Alix6 is very similar to the alix2, differing in having 1 mini-PCIe
slot (USB 2.0 only), an RFKILL GPIO line going to that slot, and 1 or 2
SIM sockets.

Change-Id: I19e4e756966e60bb0310c19286654d3d579b8850
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
Reviewed-on: http://review.coreboot.org/521
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-04-23 22:24:46 +02:00
Rudolf Marek eeb8a06b03 Unbreak boards where chipset can select between FSB and serial APIC bus
Commit d4d5e4d3e1 contains #ifdef instead
of #if, making the FSB/serial bus selection for APIC always select serial
bus. The bug is harmless on most chipsets because the bit is often RO,
but it breaks at least on VIA K8T890.

Change-Id: I89c4855922199eca7f921c3e4eb500656544c8e5
Signed-off-by: Rudolf Marek <r.marek@assembler.cz>
Reviewed-on: http://review.coreboot.org/921
Tested-by: build bot (Jenkins)
Reviewed-by: Peter Stuge <peter@stuge.se>
2012-04-23 00:48:22 +02:00
Vikram Narayanan 1e6bf092ac amd: Fix unused variable warning
Comment out the id variable which is used in a commented code
block.

Change-Id: Ib002d57e5314971f0589d04b7e451ab7d7079f53
Signed-off-by: Vikram Narayanan <vikram186@gmail.com>
Reviewed-on: http://review.coreboot.org/913
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-04-22 08:53:38 +02:00
Kyösti Mälkki 0db2ae3ac4 Makefile: define build result directories
Final build results (.elf, .debug, .map) are to be placed under
directory $(objcbfs), the default is:
   $(obj)/cbfs/$(CONFIG_CBFS_PREFIX)/

Intermediate build results (.o, .s, .S, .inc, .ld) that do not have
a clear one-to-one relation to a file under src/ are to be placed
under directory $(objgenerated), the default is:
   $(obj)/generated

Also defines implicit rules for final build results:

  .debug -> .elf and .map
  .elf -> .bin

Change-Id: I448c6b7c9a952e54170df42091d7db438025a795
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/858
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-04-21 09:43:32 +02:00
Kyösti Mälkki 93b4ed91f6 Intel e7505: build as separate object file
No longer include northbridge files directly in the source for
mainboard romstage.c and fix includes.

Also make required adjustments to function declarations.

Change-Id: Iafdcc0766ed44c64cc628e5935eef2c6372f5f22
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/906
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-04-21 09:39:27 +02:00
Kyösti Mälkki 97c064f034 Intel e7505: enable ECC scrubbing
It takes about 3 seconds to scrub 8GiB DDR266 RAM.

After ECC scrub XIP cache is disabled for system stability. There is
very little to do in romstage after ECC scrub, especially when RAM
debug messages are turned off. So the delay caused by this is hardly
noticeable.

Cache for complete ROM is re-enabled before ramstage is decompressed,
and it has no unstability issues. So the code required to re-enable
cache for ROM currently already exists in cache-as-ram_ht.inc.

A Kconfig option HW_SCRUBBER enables the scrub to be run on hard
reboots and power-ons.

Change-Id: Icf27acf73240c06b58091f1229efc0f01cca3f85
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/905
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-04-21 09:37:04 +02:00
Vikram Narayanan a8111cf980 nvramtool: Unify nvramtool and build_opt_tbl
As cmos.layout parsing capabilities are already there in nvramtool,
use those than using build_opt_tbl.c. Add binary and header file
generation in nvramtool. Make appropriate changes to Makefile.inc.

Change-Id: Iaf3f5d4f51451aeb33c92800a0c895045f2388cf
Signed-off-by: Vikram Narayanan <vikram186@gmail.com>
Reviewed-on: http://review.coreboot.org/898
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-04-21 09:36:24 +02:00
Patrick Georgi 26b00e6d39 Refactor some alignment handling
Made using coccinelle:
  @@
  expression E;
  @@
  -(E + 7) & -8
  +ALIGN(E, 8)

  @@
  expression E;
  @@
  -(E + 15) & -16
  +ALIGN(E, 16)

Change-Id: I071d2c98cd95580d7de21d256c31b6368a3dc70b
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/910
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-04-20 21:18:02 +02:00
Marc Jones d6e4d518b1 Revert wbind added to the reset_vector
This change reverts :
Change Id I4fdb281b2b684ab5fea999aae28ca08dce24da4d

The wbinvd (or invd) should not be needed at the reset vector. It
causes problems with some CPUs AP init. If there is a problem with
a specific CPU and it must be done at this location, it should be
added conditionally.

Change-Id: I85b71b0a07f039359a4fb889aaa05c75fff619be
Signed-off-by: Marc Jones <marc.jones@se-eng.com>
Reviewed-on: http://review.coreboot.org/908
Tested-by: build bot (Jenkins)
Reviewed-by: Peter Stuge <peter@stuge.se>
2012-04-20 09:09:42 +02:00
Kyösti Mälkki 77e4f7ddda Intel e7505: refactor only
Drop comments (from e7501 era) which no longer seem to apply with
e7505. Write the semi-constant D0:F0 table as code. Some register
settings seem to be in different order compared with vendor BIOS,
and will be handled by follow-up patches.

Split RCOMP register copy function in two parts.
Drop some uses of inline and local_mdelay().

Change-Id: I8739d3b2bbad5861118e8b16ccea1dd86991204f
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/896
Tested-by: build bot (Jenkins)
Reviewed-by: Peter Stuge <peter@stuge.se>
2012-04-19 20:40:53 +02:00
zbao d1edb177e8 Fix the blank in acpi_tables.c
Hope no more blank issue is got from future copy-paste.

Change-Id: I5eb50e8232e339e7039a15054606aaff6b7ebc52
Signed-off-by: Zheng Bao <zheng.bao@amd.com>
Signed-off-by: zbao <fishbaozi@gmail.com>
Reviewed-on: http://review.coreboot.org/907
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-04-19 08:49:00 +02:00
zbao a20132b0b2 Do not produce temp s3.rom if the board doesn't need it.
S3.rom is useless for all the other boards which don't use flash to
save sleep/wakeup settings. AGESA-based boards other than persimmon
haven't been validated the S3 resume. They don't need S3.rom yet.

Change-Id: I12693e9556ca6f8e0d80b2ab2dca5c85bdb97685
Signed-off-by: Zheng Bao <zheng.bao@amd.com>
Signed-off-by: zbao <fishbaozi@gmail.com>
Reviewed-on: http://review.coreboot.org/902
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-04-19 08:46:14 +02:00
zbao 2132005b20 Fix messy code in ALIB creation
Fix the copy-paste typo in ALIB table creation. ssdt is useless here.

Change-Id: I250066eb5f755275f75c37789ce8760de35b046b
Signed-off-by: Zheng Bao <zheng.bao@amd.com>
Signed-off-by: zbao <fishbaozi@gmail.com>
Reviewed-on: http://review.coreboot.org/885
Tested-by: build bot (Jenkins)
Reviewed-by: Marc Jones <marcj303@gmail.com>
2012-04-19 04:53:32 +02:00
zbao 585a400697 Leverage the Pstate table created by AGESA.
The name of processor created by AGESA is P00n, whose P is
BLDCFG_PROCESSOR_SCOPE_NAME(is 'C' if it is undefined.) and n starts
from 0. The dsdt should be aligned with that.
This feature has only been tested on persimmon. The changes on all the
other boards were propagated.

Change-Id: I8c3fa4b94406d530d2bed8e9a1f42b433bbec3ec
Signed-off-by: Zheng Bao <zheng.bao@amd.com>
Signed-off-by: zbao <fishbaozi@gmail.com>
Reviewed-on: http://review.coreboot.org/884
Tested-by: build bot (Jenkins)
Reviewed-by: Marc Jones <marcj303@gmail.com>
2012-04-19 01:04:45 +02:00