Commit Graph

1791 Commits

Author SHA1 Message Date
Paul Menzel d778b3bc90 drivers/i2c/at24rf08c: Format according to coding style
1.  Move opening bracket to line above
2.  Remove space after `printk` statements

Change-Id: Ia12a4ed6ab2fb2c9848a2688b41fcfa70ab001b0
Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38392
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
2020-03-02 11:46:29 +00:00
Paul Menzel 2a6140ea85 drivers/i2c/at24rf08c: Correctly format short multi-line comments
Change-Id: I84e09706aceae69671ce429d77e7874128468307
Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38391
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Idwer Vollering <vidwer@gmail.com>
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
2020-03-02 11:46:24 +00:00
Rajat Jain 7ef06b0234 drivers/gfx/generic: Add support for gpio based EPS
Add support to control EPS via a PCH gpio

Change-Id: I6f570fd43e1649fb23255b0890e01086e34f844a
Signed-off-by: Rajat Jain <rajatja@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/39154
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Mathew King <mathewk@chromium.org>
2020-03-02 11:42:06 +00:00
Elyes HAOUAS 44f558ec26 treewide: capitalize 'USB'
Change-Id: I7650786ea50465a4c2d11de948fdb81f4e509772
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/39100
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2020-02-26 17:06:40 +00:00
Elyes HAOUAS 2119d0ba43 treewide: Capitalize 'CMOS'
Change-Id: I1d36e554618498d70f33f6c425b0abc91d4fb952
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38928
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-by: Peter Lemenkov <lemenkov@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2020-02-24 14:10:00 +00:00
Elyes HAOUAS ef90609cbb src: capitalize 'RAM'
Change-Id: Ia05cb2de1b9f2a36fc9ecc22fb82f0c14da00a76
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/39029
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2020-02-24 12:56:03 +00:00
Furquan Shaikh a0b0d42d69 gfx: Move drivers/generic/gfx to drivers/gfx/generic
This change creates gfx directory under drivers/ so that all drivers
handling gfx devices can be located in the same place. In follow-up
CLs, we will be adding another driver that handles gfx devices.

This change also updates the names used within the driver from
*generic_gfx* to *gfx_generic*. In addition to that, mainboard
drallion using this driver is updated to match the correct path and
Kconfig name.

TEST=Verified that drallion still builds.

Change-Id: I377743e0f6d770eed143c7b6041dab2a101e6252
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/39047
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Mathew King <mathewk@chromium.org>
2020-02-24 12:52:49 +00:00
Elyes HAOUAS 6dc9d0352e treewide: capitalize 'BIOS'
Also replace 'BIOS' by coreboot when the image is 'coreboot.rom'.

Change-Id: I8303b7baa9671f19a036a59775026ffd63c85273
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38932
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2020-02-17 20:11:24 +00:00
Paul Menzel 75c5eadaf6 drivers/intel/gma: Print EDID with leading instead of trailing space
This way, the block is a little indented below `EDID:` making it a
little more structured for the eye.

Change-Id: I12066efefb23c5ffa8ba6b8c486cd54e142d4dc1
Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38915
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
2020-02-17 15:43:58 +00:00
Paul Menzel 6f6be5afbd drivers/intel/gma: Remove space between `printf ()`
Fix the warning below.

    WARNING: space prohibited between function name and open parenthesis '('

Change-Id: I28d9ba64c790c659040cd34eda37125e191dab39
Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38914
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
2020-02-17 15:43:39 +00:00
Jitao Shi f68cc81513 soc/mediatek: dsi: reduce the hbp and hfp for phy timing
The extra data transfer in DSI, namely, lpx, hs_prepare, hs_zero,
hs_exit and the sof/eof of DSI packets, will enlarge the line time,
which causes the real frame on dsi bus to be lower than the one
calculated by video timing. Therefore, hfp_byte is reduced by d_phy to
compensate the increase in time by the extra data transfer. However, if
hfp_byte is not large enough, the hsync period will be increased on DSI
data, leading to display scrolling in firmware screen.

To avoid this situation, this patch changes the DSI Tx driver to reduce
both hfp_byte and hbp_byte, with the amount proportional to hfp and hbp,
respectively. Refer to kernel's change in CL:1915442.

Also rename 'phy_timing' to 'timing' to sync with kernel upstream.

Since the phy timing initialization sequence has been corrected, the m
value adjustment in the analogix driver can be removed.

BUG=b:144824303
BRANCH=kukui
TEST=emerge-jacuzzi coreboot
TEST=Boots and sees firmware screen on krane and juniper
TEST=No scrolling issue on juniper AUO and InnoLux panels

Change-Id: I10a4d8a4fb41c309fa1917cf1cdf19dabed98227
Signed-off-by: Yu-Ping Wu <yupingso@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38400
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
2020-02-17 15:38:39 +00:00
Johanna Schander f538d74e9c vendorcode/intel: Remove Ice Lake FSP Bindings
By updating the FSP submodule we now got all FSP headers from within
that repo. This commit changes the default paths to use these and
fixes some include paths to allow the usage of
vendorcode/intel/edk2/UDK2017 together with the official Intel
distribution.

We are also adding back the CHANNEL_PRESENT enum, that is
missing in the official headers.

This was tested on the Razer Blade Stealth (late 2019).

Change-Id: I7d5520dcd30f4a68af325125052e16e867e91ec9
Signed-off-by: Johanna Schander <coreboot@mimoja.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37579
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Christoph Pomaska <github@slrie.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2020-02-11 09:09:39 +00:00
Jacob Garber 4519277ca2 drivers/generic/gfx: Add null pointer error check
acpi_device_scope() will return NULL if it is unable to find the path
of the parent device. Return early if this is the case to prevent a null
pointer dereference.

Change-Id: I3eff1c1e3477c75c7130b52898de7d59692ba412
Signed-off-by: Jacob Garber <jgarber1@ualberta.ca>
Found-by: Coverity CID 1409672
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38669
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2020-02-03 16:44:57 +00:00
Edward O'Callaghan b765fa6e47 drivers/net/r8168: Add SSDT Power Resource Methods
Turns out when going into S0ix we want the kernel to toggle de-assert to 0 for
the ISOLATE# pin on the NIC for S0ix not to be woken by PCIe traffic on PCH.
Upon resume the ISOLATE# pin on the NIC is then re-asserted for it to become
lively again.

V.2: Ensure reset_gpio && enable_gpio are optional.

BUG=b:147026979
BRANCH=none
TEST=Boot puff and do 100 cycles of S0ix.

Change-Id: I3ae8dc30f45f55eec23f45e7b5fbc67a4542f87d
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38494
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
2020-01-30 11:46:23 +00:00
Aaron Durbin fc7b953366 drivers/spi/spi_flash: remove spi flash names
The names of each spi flash cause quite a bit of bloat in the text
size of each stage/program. Remove the name entirely from spi flash
in order to reduce overhead. In order to pack space as closely as
possible the previous 32-bit id and mask were split into 2 16-bit
ids and masks.

On Chrome OS build of Aleena there's a savings of >2.21KiB in each
of verstage, romstage, and ramstage.

Change-Id: Ie98f7e1c7d116c5d7b4bf78605f62fee89dee0a5
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38380
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2020-01-28 14:44:37 +00:00
Marshall Dawson 80556ec247 drivers/smmstore: Clarify Kconfig cbfs wording
Signed-off-by: Marshall Dawson <marshalldawson3rd@gmail.com>
Change-Id: Ibb37c2d99c1a95b1d37bec784c98e636da4836d9
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38470
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2020-01-20 17:40:26 +00:00
Aaron Durbin 5abeb06a73 drivers/spi/spi_flash: organize spi flash by sector topology
By grouping the spi flash parts by their {vendor, sector topology}
tuple one can use a common probe function for looking up the part
instead of having per-vendor probe functions. Additionally, by
grouping by the command set one can save more space as well. SST
is the exception that requires after_probe() function to unlock the
parts.

2KiB of savings in each of verstage, romstage, and ramstage
on Aleena Chrome OS Build.

Change-Id: I9cc20ca0f3d0a1b97154b000c95ff2e7e87f3375
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38379
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2020-01-17 05:49:09 +00:00
Aaron Durbin a6c73c8987 drivers/spi/spi_flash: introduce common spi_flash_part_id object
To further drive to a common approach for describing the spi flash
parts in the drivers add spi_flash_part_id object. All the drivers
are updated to utilize the new object. Additionally, the driver_private
is also not needed in the spi_flash object.

A Chrome OS build of Aleena provides 960 byte saving of text. A subsequent
patch will save more memory.

Change-Id: I9c0cc75f188ac004ab647805b9551bf06a0c646b
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38378
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2020-01-17 05:48:52 +00:00
Aaron Durbin ae43f32458 drivers/spi/spi_flash: remove continuation byte support
There was code to handle the case of continuation bytes for identifying
the manufacturer id to a jedec rdid command. However, all the parts that
currently supported have this defined to be 0. Remove the unused
continuation byte support.

Change-Id: Ia7c63162e4ef9dc46ef916ca8c31ebd721cbeca7
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38361
Reviewed-by: Julius Werner <jwerner@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2020-01-17 05:48:24 +00:00
Aaron Durbin 937931ea04 drivers/spi/spi_flash: add missing status() command callbacks
The adesto, amic, atmel, and stmicro spi flash drivers didn't have
the status() call back. These parts do support the status command
retrieval. Fill them in accordingly.

Change-Id: Ie0e63bec844b8e01e292ef8c4df707494df02e69
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38377
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
2020-01-16 15:21:35 +00:00
Aaron Durbin f584f19efc drivers/spi/spi_flash: separate out protection ops
Put the write protection into its own object. This allows
for easier future reuse of objects in future consolidation
patches. It's also possible to eliminate the code implmementing
these in the future if the platform doesn't require it. For now
leave current behavior as-is.

The names of the callbacks were shortened as they are now in
the spi_flash_protection_ops object which is a new field in the
spi_flash object.

Change-Id: I2fec4e4430709fcf3e08a55dd36583211c035c08
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38376
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
2020-01-16 15:21:08 +00:00
Aaron Durbin cb01aa586f drivers/spi/spi_flash: assume spi_flash read callback exists
spi_flash_erase() and spi_flash_write() already assume their
respective callbacks are supplied in the spi_flash_ops object.
Make the same assumption in spi_flash_read(). In order to do this
the spi_flash_ops objects from the drivers need to reference the
the previously used fallback read command, spi_flash_read_chunked().
This function is made global and renamed to spi_flash_cmd_read() for
consistency.

By doing this further dead code elimination can be achieved when the
spi flash drivers aren't included in the build.

A Hatch Chrome OS build achieves a further text segment reduction of
0.5KiB in verstage, romstage, and ramstage.

Change-Id: I7fee55e6ffc1983657c3adde025a0e8c9d12ca23
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38366
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
2020-01-16 15:20:49 +00:00
Aaron Durbin 3e7f006280 drives/spi/spi_flash: add option to not select all drivers
Add a new Kconfig option, SPI_FLASH_DONT_INCLUDE_ALL_DRIVERS,
to make it easier for other parts of the code base to indicate that
all spi flash drivers should not be included.

Change-Id: Ibf2c4f1d2b8a73cff14bb627ddf759d7970920ea
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38362
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
2020-01-15 16:34:13 +00:00
Kyösti Mälkki a28ee1b186 drivers/pc80/rtc: Clean up some POST_CODE_EXTRA use
Change-Id: I5ecfa0860a28547f76a72592a8d07bca67822217
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38188
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2020-01-14 18:09:30 +00:00
Kyösti Mälkki 0e557aba4e console/post: Move cmos_post_code() under pc80/rtc
We should keep console/ somewhat arch-agnostic.

Change-Id: I4465888023ba5ae0706b5e98e541c40f975d11e3
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38186
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2020-01-10 15:30:34 +00:00
Kyösti Mälkki 94aaf5b471 drivers/pc80/rtc: Enable normal/fallback without USE_OPTION_TABLE
Due the !USE_OPTION_TABLE it always booted to fallback.

Change-Id: I44eb50df4389d1ac9e4c746f53654aff1055d400
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38184
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2020-01-10 15:29:51 +00:00
Kyösti Mälkki b2680a12e4 drivers/pc80/rtc: Move sanitize_cmos()
Implementation depends on USE_OPTION_TABLE.

Change-Id: If7f8f478db3214842b6cc60cd77b4ea81cab6e3a
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38195
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2020-01-10 15:28:41 +00:00
Nico Huber f394fbefba fsp1_1: Drop unused weak function
All FSP 1.1 platforms override the weak soc_load_logo().

Change-Id: Ib2eae166e02771311c50ea7e4f294790dfa2b99e
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38138
Reviewed-by: Subrata Banik <subrata.banik@intel.com>
Reviewed-by: Wim Vervoorn <wvervoorn@eltan.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2020-01-10 14:56:23 +00:00
Wim Vervoorn 9f363fc85a drivers/intel/fsp2_0/logo.c: Correct check for logo_size
The check to validate if the logo file was loaded correctly was
incorrect.

Now check the actual logo size.

BUG=N/A
TEST=build

Change-Id: Ib3a808dd831986e8347512892ee88983d376d34c
Signed-off-by: Wim Vervoorn <wvervoorn@eltan.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38124
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Frans Hendriks <fhendriks@eltan.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2020-01-10 14:48:22 +00:00
Wim Vervoorn 90a9db537b drivers/intel/fsp1_1/logo.c: Correct check for logo_size
The check to validate if the logo file was loaded correctly was
incorrect.

Now check the actual logo size.

BUG=N/A
TEST=build

Change-Id: I4df2076b2f0cc371848a912c622268dfec24e2ef
Signed-off-by: Wim Vervoorn <wvervoorn@eltan.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38123
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Frans Hendriks <fhendriks@eltan.com>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2020-01-10 14:48:16 +00:00
Aaron Durbin 1c3086a603 drivers/spi/spi_flash: explicitly handle STMicro deep power state
In order to provide more consistent probing in future refactorings, pull out
the release from deep sleep path in STMicro's SPI flash probing function.
Call that function explicitly when RDID doesn't return anything at all.
The old STMicro parts, even if supporting RDID, won't decode that
instruction while in a deep power down state. Instead of re-issuing RDID after
the successful wake assume the id fixup is valid.

Change-Id: I46c47abcfb1376c1c3ce772f6f232857b8c54202
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38167
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
2020-01-10 04:55:09 +00:00
Michał Żygowski 506b9c102c amd/agesa/state_machine: Add BeforeInitLate hooks
Add missing BeforeInitLate hooks in order to bring back certain options
that were lost on postcar migration. This will also allow to disable
CDIT again that caused AmdInitLate error on 00730F01.

Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Change-Id: I1226e9c0c8a92920f2569ec0f85d0be0adcc9e30
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37998
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
2020-01-09 15:40:15 +00:00
Kyösti Mälkki 034cf6390f drivers/pc80/rtc: Separate {get|set}_option() support
Move things depending on option_table.h to a separate file.

Change-Id: Ib23fcd89bf4efef9072fcaea1d8699145c1f2983
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38193
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2020-01-09 14:38:47 +00:00
Kyösti Mälkki cbf9571588 drivers/pc80/rtc: Separate {get|set}_option() prototypes
Long-term plan is to support loading runtime configuration
from SPI flash as an alternative, so move these prototypes
outside pc80/.

Change-Id: Iad7b03dc985550da903d56b3deb5bd736013f8f1
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38192
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2020-01-09 14:37:33 +00:00
Kyösti Mälkki 2a0e3b25ea drivers/pc80/rtc: Remove duplicate cmos_chksum_valid()
Change-Id: I5a4b86921876c24cd1d310b674119b960c3d2fd6
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38194
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2020-01-09 14:37:06 +00:00
Patrick Rudolph c83bab62b3 acpi: Be more ACPI compliant when generating _UID
* Add function to generate unique _UID using CRC32
* Add function to write the _UID based on a device's ACPI path

ACPI devices that have the same _HID must use different _UID.
Linux doesn't care about _UID if it's not used.
Windows 10 verifies the ACPI code on boot and BSODs if two devices
with the same _HID share the same _UID.

Fixes BSOD seen on Windows 10.

Change-Id: I47cd5396060d325f9ce338afced6af021e7ff2b4
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37695
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
2020-01-09 14:22:51 +00:00
Aaron Durbin a8280e4cc0 drivers/spi: remove SPI_FLASH_FAST_READ_DUAL_OUTPUT_3B option
The SPI_FLASH_FAST_READ_DUAL_OUTPUT_3B option is no longer
being used in the code. There's a runtime check for supporting
fast read dual output mode of the spi flash. Remove the references
to SPI_FLASH_FAST_READ_DUAL_OUTPUT_3B.

Change-Id: Ie7d9d3f91f29a700f07ab33feaf427a872bbf7df
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38166
Reviewed-by: Furquan Shaikh <furquan@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2020-01-08 17:18:20 +00:00
Johanna Schander 1c9746ceaf drivers/spi/flashconsole: Fix shadowing local variable
Commit c9b13594eb removed the g_ prefix from
global variables, leaving the local "offset" variable shadowing the
global one. This commit partially reverts this by renaming one of the
occations and converting the flushing logic to work on the
global object.

Change-Id: I246ebdcfd3b973e6a4aa3c15fc5f32497dcf8398
Signed-off-by: Johanna Schander <coreboot@mimoja.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38171
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
2020-01-07 20:50:03 +00:00
Kyösti Mälkki 23063305dc drivers/pc80/rtc: Refactor some USE_OPTION_TABLE
Change-Id: I3a5004db021af6127de2f058bec9d84a985bae67
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38183
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2020-01-07 18:41:26 +00:00
Kyösti Mälkki fd15c0b8fa drivers/pc80/rtc: Refactor clear_cmos variable
After refactoring it is more a status variable rather than
a request.

Change-Id: I50b8099a08b556129416cea50f0ce6fafe6c14cc
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38185
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2020-01-07 18:41:12 +00:00
Kyösti Mälkki 1a9b7b50c7 drivers/pc80/rtc: Clean up some inlined functions
Change-Id: Ie73797b4e9a09605a0685f0b03cb85e9a3be93ad
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38179
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2020-01-07 18:39:35 +00:00
Patrick Rudolph 389c827943 acpigen: Add function to generate unicode names
The ACPI spec 6.3 chapter 6.1.10 states that _STR has to return a buffer
containing UTF-16 characters.

Add function to generate Unicode names and use it for _STR. It will
replace non-ASCII characters with '?'.

Use the introduced function in IPMI driver.

Fixes ACPI warning shown in fwts.

Change-Id: I16992bd449e3a51f6a8875731cd45a9f43de5c8c
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37789
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2020-01-07 08:16:20 +00:00
Aaron Durbin d701ef7475 drives/spi_flash: add spi_flash_cmd_write_page_program()
The SPI flashes that support page programming mode had duplicated
the logic for writing in every driver. Add
spi_flash_cmd_write_page_program() and use the common implementation
to reduce code size that comes from duplication. The savings is
~2.5KiB per stage where the spi flash drivers are utilized.

Change-Id: Ie6db03fa8ad33789f1d07a718a769e4ca8bffe1d
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37963
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
2020-01-06 15:00:50 +00:00
Kyösti Mälkki 6118cda858 drivers/i2c/i2cmux2: Drop unused i2c multiplex
There is no documentation what hardware this was compatible
with.

Change-Id: I9bfada83388373962929f35794bca56132ee3d9e
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38160
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2020-01-04 22:08:24 +00:00
Kyösti Mälkki 3f56ad9f72 drivers/i2c/i2cmux: Drop unused i2c multiplex
There is no documentation what hardware this was compatible
with.

Change-Id: Ie8832f1d7f4ca2bc8121f84b1ee564403cc69026
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38159
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2020-01-04 22:08:08 +00:00
Kyösti Mälkki 8a20edc861 drivers/i2c/lm63: Drop unused hardware monitor support
Change-Id: Ie72f66a8fc93e4994df5463b8ff19ba118c88389
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38158
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2020-01-04 22:07:52 +00:00
Kyösti Mälkki 14b81bb461 drivers/i2c/adm1027: Drop unused hardware monitor support
Change-Id: I8e0dbff67709841c6ae3ec6f6130805ac935f2ee
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38157
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2020-01-04 22:07:37 +00:00
Kyösti Mälkki 658c3fec91 drivers/i2c/adm1026: Drop unused hardware monitor support
Change-Id: I4e2ebe4f2a90cc27f9a4de907b873df44718234d
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38156
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2020-01-04 22:07:25 +00:00
Kyösti Mälkki c1604d0bff drivers/i2c/w83795: Drop unused hardware monitor support
Change-Id: I254f62c9a94838f70d624dadf32cb42c2370123d
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38152
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2020-01-04 22:06:56 +00:00
Aaron Durbin 8b1cdd55a9 drivers/spi/sst: remove unnecessary byte programming
The SST25VF064C supports page programming mode like other spi flash
parts in that there isn't an offset requirement. Remove this
check and single byte program because CMD_SST_BP (0x2) is the
same as page programming command. Lastly, for clariy purposes provide
a CMD_SST_PP to explicitly indicate page programming despite the
values (0x2) being the same as byte programming for the other parts.

Change-Id: I84eea0b044ccac6c6f26ea4cb42f4c13cf8f5173
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37959
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2020-01-03 23:06:41 +00:00
Kyösti Mälkki 3480457285 usbdebug: Fix printk conversion
Change-Id: I0dba96004de264fe1faf5485fb677a6b05123bba
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38006
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2020-01-03 13:10:12 +00:00
Kyösti Mälkki a04dee6895 drivers/pc80/mc146818rtc: Remove read_option_lowlevel()
This was a workaround for romcc.

Change-Id: I34f41390afbd88f3ace7003fd18c2edd56712a67
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37954
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2020-01-02 12:37:08 +00:00
Kyösti Mälkki d60e9ab74e cpu/intel/microcode: Apply more strict guard for assembly files
Change-Id: I8243be7c9a57402b2ac1cfa1c0552990d4a4ba74
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37891
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2019-12-27 09:01:50 +00:00
Kyösti Mälkki 405812209d arch/x86: Remove <arch/cbfs.h>
There are no symmetrical headerfiles for other arch/ and
after ROMCC_BOOTBLOCK and walkcbfs() removal this file
ended up empty.

Change-Id: Ice3047630ced1f1471775411b93be6383f53e8bb
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37886
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
2019-12-27 09:01:12 +00:00
Elyes HAOUAS f07d7dc2fd drivers/ipmi/ipmi_fru: Add missing <stdlib.h>
malloc() needs <stdlib.h>

Change-Id: I0cf6a5b76543cb6dac584de6628cfc459d5a60a8
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37884
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-12-27 08:58:15 +00:00
Matt DeVillier 92b0e8dcae drivers/generic/cbfs-serial: Add driver to read serial from CBFS
Add a new driver to support reading a board serial number from
a text file in CBFS and injecting into the SMBIOS tables.
Allow driver to be selected at the .config level and not require
inclusion at the board level.

Signed-off-by: Matt DeVillier <matt.devillier@puri.sm>
Change-Id: Ieae39f39ab36e5b1f240383b7cf47681d9a311af
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37917
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin Roth <martinroth@google.com>
2019-12-26 10:49:03 +00:00
Elyes HAOUAS 4200a52263 src: Remove unused include <string.h>
Change-Id: Ic6b66dd8fa387e67bb0ce609fb7e2553eeb66b3c
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37888
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2019-12-26 10:45:37 +00:00
Kyösti Mälkki 520717dff1 AGESA,binaryPI: Drop remains of ROMCC_BOOTBLOCK
Change-Id: I507ac6d483d9854852d6d01f10544c450b8d33cc
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37440
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-12-20 18:14:34 +00:00
Wim Vervoorn 67117c3971 {drivers,soc}/intel/fsp1_1: Move chipset specific logo handling to SoC
FSP logo handling used PcdLogoPtr and PcdLogoSize which are elements of
the chipset specific FSP structures.

Create soc_load_logo() which will pass the logo pointer and size.
This function will call fsp_load_logo which will load the logo.

BUG=NA
TEST= Build and verified logo is displayed on Facebook FBG1701

Change-Id: I86943e64ca1ddd05e7e88fc6b882cfd33b98272e
Signed-off-by: Wim Vervoorn <wvervoorn@eltan.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37791
Reviewed-by: Frans Hendriks <fhendriks@eltan.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-12-20 17:50:28 +00:00
Elyes HAOUAS 361a935332 {drivers,southbridge}: Replace min() with MIN()
This is to remove min/max() from <stdlib.h>.

Change-Id: Ica03d9aec8a81f57709abcac655dfb0ebce3f8c6
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37818
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-12-20 17:48:00 +00:00
Kyösti Mälkki 836b8d2e45 drivers/pc80: Move normal/fallback mechanism outside __ROMCC__
Change-Id: I840885ca543375c77b7406434fd8bb4085e26938
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37759
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
2019-12-20 17:44:43 +00:00
Kyösti Mälkki fedaac84da AGESA,binaryPI: Enable lapic early for udelay()
Change-Id: I7200ac0256748d9372fc39be27b86d1c93b38321
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37756
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
2019-12-20 15:47:39 +00:00
Kyösti Mälkki 4f14cd8a39 arch/x86,soc/intel: Drop RESET_ON_INVALID_RAMSTAGE_CACHE
If stage cache is enabled, we should not allow S3 resume
to load firmware from non-volatile memory.

This also adds board reset for failing to load postcar
from stage cache.

Change-Id: Ib6cc7ad0fe9dcdf05b814d324b680968a2870f23
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37682
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2019-12-19 19:31:08 +00:00
Wim Vervoorn d1371508f5 {drivers,soc}/intel/fsp2_0: Move chipset specific logo handling to SoC
FSP logo handling used FspsConfig.LogoPtr and FspsConfig.LogoSize which
are chipset specific.

Create soc_load_logo() which will pass the logo pointer and size.
This function will call fsp_load_logo which will load the logo.

BUG=NA
TEST= Build and verified logo is displayed on Facebook Monolith

Change-Id: I30c7bdc0532ff8823e06f4136f210b542385d5ce
Signed-off-by: Wim Vervoorn <wvervoorn@eltan.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37792
Reviewed-by: Frans Hendriks <fhendriks@eltan.com>
Reviewed-by: Aamir Bohra <aamir.bohra@intel.com>
Reviewed-by: Subrata Banik <subrata.banik@intel.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-12-19 17:49:38 +00:00
Johnny Lin b9e8448384 drivers/ipmi: Add IPMI Read FRU function
Implemented according to IPMI "Platform Management
FRU Information Storage Definition" specification
v1.0 for reading FRU data Product Info Area and
Board Info Area.
SMBIOS data can be updated with the FRU data.

Tested on OCP Mono Lake.

Change-Id: Id6353f5ce3f7ddd3bb161b91364b3cf276d020b8
Signed-off-by: Johnny Lin <johnny_lin@wiwynn.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37444
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
(cherry picked from commit 8ac46b937c)
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37095
2019-12-19 17:48:30 +00:00
Elyes HAOUAS 88f5c7178e src: Remove unused 'include <arch/cpu.h>'
Change-Id: Iaa236f07aed52ccb8c4839047894a14a9446a109
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36080
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
2019-12-19 05:58:50 +00:00
Elyes HAOUAS b12c2761f4 src/{drivers,device,ec}: Remove unused <stdlib.h>
Change-Id: I05422ee4b0aa5c02525ef0b4eccb4dc3ecf871e8
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/32822
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-12-19 05:25:56 +00:00
Elyes HAOUAS 4f66cb9b28 src: Add missing include <types.h>
Change-Id: Iabe55bfbc8e047c0791c21d162767081a181b6c5
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37411
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-12-19 03:19:05 +00:00
Jitao Shi 542919f370 drivers/analogix: Add anx7625 MIPI DSI/DPI to DP bridge driver
The ANX7625 is an ultra-low power 4K Mobile HD Transmitter designed for
portable devices. It converts MIPI DSI/DPI to DisplayPort 1.3 4K.

BRANCH=none
BUG=b:140132295
TEST=emerge-jacuzzi coreboot

Change-Id: I02ef29798b0257632e0750f09a4390b3d0226367
Signed-off-by: Jitao Shi <jitao.shi@mediatek.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/35623
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
2019-12-17 13:15:47 +00:00
Arthur Heymans 80759b0dbd drivers/intel/fsp1_1: Drop unused function
Change-Id: Ide336fb900360c446bffcc5ca31bf51e7746cae1
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36370
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2019-12-16 09:40:43 +00:00
Marshall Dawson d912df22a8 drivers/mrc_cache: Redo indenting
Indent continuation lines of an if test farther than its "true"
expression to be executed.

Change-Id: I3dfa4049761095dcbb6797f1533d6a513e3b503c
Signed-off-by: Marshall Dawson <marshalldawson3rd@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37720
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2019-12-15 16:47:36 +00:00
Kyösti Mälkki 3d5e1e5d52 sb/amd/cimx/sb800: Postpone Sb_Poweron_Init() call
With LPC decode enables explicitly set in C env bootblock,
this call can be delayed to happen before AMD_INIT_RESET.

Change-Id: I3a28eaa2cf70b770b022760a2380ded0f43e9a6f
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37449
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2019-12-13 08:58:12 +00:00
Patrick Rudolph 9fe3d692c7 drivers/aspeed: Add AST2500 support
Tested on AST2500.
Code for AST2400 still works.

Copy code from GNU/Linux kernel to coreboot to add AST2500 support.

Change-Id: I25bd34dd52a0acd3e04fc5818e011215ef907fad
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/34793
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
2019-12-12 13:00:25 +00:00
Patrick Rudolph f1a4ae0a48 drivers/aspeed/common: Add support for high resolution framebuffer
* Implement reading EDID over software I2C.
* Fall back to VGA if no monitor connected for BMC KVM
* Copy the linux kernel code and add a bunch of wrapper structs to make it
  compile.
* Convert the EDID to a drm_display_mode, which is understood by the
  driver.
* Properly select HAVE_LINEAR_FRAMEBUFFER and HAVE_VGA_TEXT_FRAMEBUFFER

Tested on Supermicro X11SSH-TF using FullHD VGA monitor.
Initializes the graphics in about 1 second, which is twice as fast as the
VGA Option ROM.

The framebuffer is advertised and working in tianocore.

Change-Id: I7803566b64158405efc04a39f80a0ec98b44e646
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/35726
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-12-12 12:49:01 +00:00
Michał Żygowski 1b12b64dab AGESA, binaryPI: implement C bootblock
Modify CAR setup to work in bootblock. Provide bootblock C file with
necessary C bootblock functions. Additionally chache the ROM and set
the MMCONF base before jumping to bootblock main.

Change-Id: I29916a96f490ff717c69dc7cd565d74a83dbfb0d
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36914
Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-12-11 22:47:10 +00:00
Matt DeVillier ba8d8f2583 drivers/i2c/rt5663/: fix missing header include
'struct acpi_gpio' and 'struct acpi_irq' require the inclusion
of acpi_device.h. The only reason this wasn't caught previously
is due to the header being included with another driver compiled
first on the one board using it (google/eve).

Change-Id: I987f0ec6f769e550f3421629e0ef0c579a3d12f9
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37539
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-12-11 11:39:36 +00:00
Julius Werner 540a98001d printf: Automatically prefix %p with 0x
According to the POSIX standard, %p is supposed to print a pointer "as
if by %#x", meaning the "0x" prefix should automatically be prepended.
All other implementations out there (glibc, Linux, even libpayload) do
this, so we should make coreboot match. This patch changes vtxprintf()
accordingly and removes any explicit instances of "0x%p" from existing
format strings.

How to handle zero padding is less clear: the official POSIX definition
above technically says there should be no automatic zero padding, but in
practice most other implementations seem to do it and I assume most
programmers would prefer it. The way chosen here is to always zero-pad
to 32 bits, even on a 64-bit system. The rationale for this is that even
on 64-bit systems, coreboot always avoids using any memory above 4GB for
itself, so in practice all pointers should fit in that range and padding
everything to 64 bits would just hurt readability. Padding it this way
also helps pointers that do exceed 4GB (e.g. prints from MMU config on
some arm64 systems) stand out better from the others.

Change-Id: I0171b52f7288abb40e3fc3c8b874aee14b9bdcd6
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37626
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-by: David Guckian
2019-12-11 11:38:59 +00:00
Johanna Schander 808f5c3849 drivers/intel/fsp2_0: Allow to add FSP binaries from repo for IceLake
This commit is adding a dependency check for the FSP_USE_REPO
config option which so far was not able to deal with IceLake
systems.

Change-Id: I29faa8d3acff5680b611951fc193d33f514dc0d3
Signed-off-by: Johanna Schander <coreboot@mimoja.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37561
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-12-09 09:44:30 +00:00
Wim Vervoorn cbc878d2a2 drivers/intel/fsp2_0: Add logo support
Add support for the FSP feature to display the logo.

BUG=N/A
TEST=tested on facebook monolith

Change-Id: Iaaffd2be567861371bbe908c1ef9d7dde483a945
Signed-off-by: Wim Vervoorn <wvervoorn@eltan.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37515
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Reviewed-by: Frans Hendriks <fhendriks@eltan.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2019-12-06 15:14:27 +00:00
Julius Werner 55009af42c Change all clrsetbits_leXX() to clrsetbitsXX()
This patch changes all existing instances of clrsetbits_leXX() to the
new endian-independent clrsetbitsXX(), after double-checking that
they're all in SoC-specific code operating on CPU registers and not
actually trying to make an endian conversion.

This patch was created by running

 sed -i -e 's/\([cs][le][rt]bits\)_le\([136][624]\)/\1\2/g'

across the codebase and cleaning up formatting a bit.

Change-Id: I7fc3e736e5fe927da8960fdcd2aae607b62b5ff4
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37433
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
2019-12-04 14:11:17 +00:00
Julius Werner 1c37157218 mmio: Add clrsetbitsXX() API in place of updateX()
This patch removes the recently added update8/16/32/64() API and
replaces it with clrsetbits8/16/32/64(). This is more in line with the
existing endian-specific clrsetbits_le16/32/64() functions that have
been used for this task on some platforms already. Rename clrsetbits_8()
to clrsetbits8() to be in line with the new naming.

Keep this stuff in <device/mmio.h> and get rid of <mmio.h> again because
having both is confusing and we seem to have been standardizing on
<device/mmio.h> as the standard arch-independent header that all
platforms should include already.

Also sync libpayload back up with what we have in coreboot. (I'm the
original author of the clrsetbits_le32-definitions so I'm relicensing
them to BSD here.)

Change-Id: Ie4f7b9fdbdf9e8c0174427b4288f79006d56978b
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37432
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Furquan Shaikh <furquan@google.com>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-12-04 14:10:37 +00:00
Mathew King c135b829e7 drivers/gfx: Add generic graphics with SSDT generator
Adds a generic graphics driver that can be added to a devicetree which
populates graphics-related ACPI table. It will write the _DOD method
(Enumerate All Devices Attached to the Display Adapter) and a device
object for each device defined. The device may optionally have a
connected privacy screen which can be controlled with a _DSM.

Example:
chip drivers/generic/gfx
  register "device_count" = "1"
  register "device[0].name" = ""LCD""
  register "device[0].addr" = "0x0400"
  register "device[0].privacy.enabled" = "1"
  register "device[0].privacy.detect_function" = ""\\_SB.PCI0.PVSC.GPVD""
  register "device[0].privacy.status_function" = ""\\_SB.PCI0.PVSC.GPVX""
  register "device[0].privacy.enable_function" = ""\\_SB.PCI0.PVSC.EPVX""
  register "device[0].privacy.disable_function" = ""\\_SB.PCI0.PVSC.DPVX""
  device generic 0 on end
end

ASL
Scope (\_SB.PCI0.GFX0)
{
    Method (_DOD, 0, NotSerialized)  // _DOD: Display Output Devices
    {
        Return (Package (0x01)
        {
            0x00000400
        })
    }

    Device (LCD)
    {
        Name (_ADR, 0x0400)  // _ADR: Address
        Name (_STA, 0x0F)  // _STA: Status
        Method (_DSM, 4, Serialized)  // _DSM: Device-Specific Method
        {
            ToBuffer (Arg0, Local0)
            If ((Local0 == ToUUID ("c7033113-8720-4ceb-9090-9d52b3e52d73")))
            {
                ToInteger (Arg2, Local1)
                If ((Local1 == Zero))
                {
                    Local2 = \_SB.PCI0.PVSC.GPVD ()
                    If ((Local2 == One))
                    {
                        Return (Buffer (One)
                        {
                                0x0F
                        })
                    }
                }

                If ((Local1 == One))
                {
                    ToBuffer (\_SB.PCI0.PVSC.GPVX (), Local2)
                    Return (Local2)
                }

                If ((Local1 == 0x02))
                {
                    \_SB.PCI0.PVSC.EPVX ()
                }

                If ((Local1 == 0x03))
                {
                    \_SB.PCI0.PVSC.DPVX ()
                }

                Return (Buffer (One)
                {
                        0x00
                })
            }

            Return (Buffer (One)
            {
                    0x00
            })
        }
    }
}

BUG=b:142237145
TEST=Added gfx to devicetree on sarien_cml and correct ASL in SSDT

Change-Id: Ida520dd7aad81ee7c1e5f2d0d3f5cc1a766d78a0
Signed-off-by: Mathew King <mathewk@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36041
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-12-02 23:23:38 +00:00
Patrick Georgi c9b13594eb src/: Remove g_ prefixes and _g suffixes from variables
These were often used to distinguish CAR_GLOBAL variables that weren't
directly usable. Since we're getting rid of this special case, also get
rid of the marker.

This change was created using coccinelle and the following script:
	@match@
	type T;
	identifier old =~ "^(g_.*|.*_g)$";
	@@
	old

	@script:python global_marker@
	old << match.old;
	new;
	@@
	new = old
	if old[0:2] == "g_":
	  new = new[2:]

	if new[-2:] == "_g":
	  new = new[:-2]

	coccinelle.new = new

	@@
	identifier match.old, global_marker.new;
	@@
	- old
	+ new

	@@
	type T;
	identifier match.old, global_marker.new;
	@@
	- T old;
	+ T new;

	@@
	type T;
	identifier match.old, global_marker.new;
	@@
	- T old
	+ T new
	 = ...;

There were some manual fixups: Some code still uses the global/local
variable naming scheme, so keep g_* there, and some variable names
weren't completely rewritten.

Change-Id: I4936ff9780a0d3ed9b8b539772bc48887f8d5eed
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37358
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
2019-12-02 10:44:38 +00:00
Patrick Rudolph ae64f22e8d drivers/usb/ehci_debug: Add x86_64 support
Use proper int to pointer conversions.

Tested on Lenovo T410 with x86_64 enabled. Still works.

Change-Id: I4ed62297fb47d7d83d4b28e80f3770de99ce70f7
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37393
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-12-02 07:45:38 +00:00
Arthur Heymans 6ea3a13a17 drivers/spi/flashconsole.c: Drop CAR_GLOBAL_MIGRATION support
Change-Id: I81a610a6d119745f2fc637629b8ba7ade76503bc
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37043
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2019-11-30 16:09:57 +00:00
Patrick Georgi 2c2df5b6dd src/drivers: Fix two issues discovered by checkpatch
Change-Id: I46e318333e68b999b2889f51fa2fbf140a27a54e
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37357
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2019-11-30 09:42:03 +00:00
Kyösti Mälkki 33d0fb8d34 AGESA,binaryPI: Add compatibility wrapper for romstage entry
This simplifies transition and reviews towards C environment
bootblock by allowing single cache_as_ram.S file to be used.

Change-Id: I231972982e5ca6d0c08437693edf926b0eaf9ee1
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37352
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-11-30 08:15:30 +00:00
Michał Żygowski 3aa17f7604 AGESA,binaryPI: Fix stack location on entry to romstage
For BSP CPU, set up stack location to match the symbol from car.ld.
For AP CPUs the stack is located outside _car_region and is currently
not accounted for in the linker scripts.

Change-Id: I0ec84ae4e73ecca5034f799cdc2a5c1056ad8b74
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37351
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2019-11-30 08:13:33 +00:00
Michał Żygowski 2fa1cb15de AGESA,binaryPI: Remove __x86_64__ long mode in CAR
Change-Id: I83a8b2325b751feeb046ce74fabd37aeb27c28dc
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37350
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-11-30 06:02:12 +00:00
Michał Żygowski c574947223 AGESA,binaryPI: Remove redundant SSE enable
Change-Id: Ib3bf731b74cb20e886d3ecd483b37b1e3fc64ebf
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37349
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-11-30 06:01:52 +00:00
Kyösti Mälkki 9b71804e4f AGESA,binaryPI: Remove BIST reporting in romstage
For easier C environment bootblock transition by using
already existing prototypes, BIST will not be passed
to romstage. It is expected that bootblock will have
equivalent code.

Change-Id: I0f8e3657ac79277cd77c397d1b3e931e33a6f5db
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37348
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-11-30 06:01:25 +00:00
Kyösti Mälkki dc34a9d6de AGESA,binaryPI: Split romstage_main() to BSP and AP parts
BSP and AP have two distinct execution paths for romstage.

Change-Id: Id013b165f1345509fe6b74cef2bf8c3b420f84a4
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37326
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-11-30 06:00:57 +00:00
Arthur Heymans d20b0a842b drivers/spi/boot_device_rw_nommap.c: Drop CAR_GLOBAL_MIGRATION support
Change-Id: I613c28a2d06f5f0216deb75960ab660941ef8057
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37044
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-11-29 11:01:23 +00:00
Arthur Heymans 2d33c3e6c3 drivers/elog/elog.c: Drop CAR_GLOBAL_MIGRATION support
Change-Id: I7dcc8d08b40560f105c22454bda1282afaa617da
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37046
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-11-29 09:33:55 +00:00
Arthur Heymans ff168e9e63 drivers/amd/agesa/def_callouts.c: Drop CAR_GLOBAL_MIGRATION support
Drop stale comment.

Change-Id: Ie9f5271074ac4876f08fa8470dbc35daf5b694b2
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37053
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-11-29 09:23:46 +00:00
Arthur Heymans 22be29e23b drivers/pc80/pc/i8254.c: Drop CAR_GLOBAL_MIGRATION support
Change-Id: Ibe9b353ce050b4718e07bccb958dbe3d2312e741
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37045
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-11-29 09:19:54 +00:00
Arthur Heymans c2a9c42670 drivers/spi/spi_flash.c: Drop CAR_GLOBAL_MIGRATION support
Change-Id: Ie1d01f589289239c453c2cc38cc1e25f903399ea
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37042
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-11-29 09:16:46 +00:00
Arthur Heymans 5fadb46b36 drivers/uart/oxpcie_early.c: Drop CAR_GLOBAL_MIGRATION support
Change-Id: Ibea14a4cfb7285af42a7493742636c8dc8fe0a33
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37041
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-11-29 09:15:41 +00:00
Arthur Heymans 2b77881564 drivers/usb/ehci_debug.c: Drop CAR_GLOBAL_MIGRATION support
Change-Id: Ib0cd32893ad9540ae55e61e85fb03d194ee55894
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37040
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-11-29 09:15:02 +00:00
Arthur Heymans 7c2fd97c05 drivers/vpd/vpd.c: Drop CAR_GLOBAL_MIGRATION support
Change-Id: Idf522a822ddd54ee8b48312bed762c29783a2e45
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37039
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-11-29 09:13:28 +00:00
Arthur Heymans 0ca944b16f security/tpm: Drop CAR_GLOBAL_MIGRATION support
Change-Id: I1c09eda6164efb390de4626f52aafba59962f9c4
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37029
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-11-29 09:08:33 +00:00
Arthur Heymans ed50d85576 drivers/smmstore: Fix some issues
This fixes the following:
- Fix smmstore_read_region to actually read stuff
- Clean up the code a little
- Change the loglevel for non error messages to BIOS_DEBUG
- Use an incoherent rdev to potentially speed up reading access

TESTED on google/wolf with out of tree patch to hook up smmstore to
sb/intel/lynxpoint.

Change-Id: I629be25d2a9b65796ae8f7a700b6bdab57b91b22
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/30432
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2019-11-29 08:56:43 +00:00
Vadim Bendebury c7fc199f40 cr50 i2c: add error message reporting TPM IRQ timeout
Various recent x86 SOCs have trouble registering short pulses
generated by the H1 to indicate that it is ready for the next
transaction.

This patch adds an error message to report this condition, which would
greatly reduce the amount of guesswork when troubleshooting new
platforms.

BUG=b:144002424

TEST=tried this code on the Drallion device exhibiting the problem,
     observed error messages in the coreboot log;

  $ grep IRQ ap.log
  Cr50 i2c TPM IRQ timeout!
  Cr50 i2c TPM IRQ timeout!
  Cr50 i2c TPM IRQ timeout!
  Cr50 i2c TPM IRQ timeout!
  ...

Change-Id: I5f6ee3986bed58e12fd0ec8cecbf35f46c9263c2
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37255
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Mathew King <mathewk@chromium.org>
2019-11-27 17:29:31 +00:00
Kyösti Mälkki 9266ce90c6 AGESA,binaryPI: Remove early_all_cores()
This was implemented to make sure it gets called before
attempting any PCI MMIO access. Now that we have one
central romstage_main() implementation this extra precaution
is no longer useful.

Change-Id: I09b24da827e00d7a9ba0a51d5eef36f174b893a6
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37203
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2019-11-27 10:41:39 +00:00
Kyösti Mälkki 56397364c9 binaryPI: Drop CAR teardown without POSTCAR_STAGE
The remaining (active) binaryPI boards moved away from
BINARYPI_LEGACY_WRAPPER and have POSTCAR_STAGE now.

As the cache_as_ram.S is also used with AGESA, this slightly
reduces the codesize there for romstage and postcar as well.

This commit is actually a revert for the vendorcode parts,
AMD originally shipped the codes using 'invd' for the CAR
teardown, but these were changed for coreboot due the
convoluted teardown that used to happen with non-empty stack.

Change-Id: I693c104c3aab3be537c00695cbd764a48bd603b0
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/18526
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-11-27 10:39:20 +00:00
Kyösti Mälkki 46f04cbb49 binaryPI: Drop BINARYPI_LEGACY_WRAPPER support
Drop all the sources that were guarded with this.

Change-Id: I6c6fd19875cb57f0caf42a1a94f59efed83bfe0d
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/19275
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2019-11-27 10:37:50 +00:00
Subrata Banik 24ab1c5db6 soc/intel/{apl,cnl,dnv,skl}: Skip ucode loading by FSP-T
It is a requirement for Firmware to have Firmware Interface Table (FIT),
which contains pointers to each microcode update.
The microcode update is loaded for all logical processors before reset vector.

FSPT_UPD.MicrocodeRegionBase and FSPT_UPD.MicrocodeRegionLength are
input parameters to TempRamInit API.
If these values are 0, FSP will not attempt to update microcode.

Since Gen-4 all IA-SoC has FIT loading ucode even before cpu reset in place
hence skipping FSP-T loading ucode after CPU reset options.

Also removed unused kconfig CONFIG_CPU_MICROCODE_CBFS_LOC and
CONFIG_CPU_MICROCODE_CBFS_LEN

Change-Id: I3a406fa0e2e62e3363c2960e173dc5f5f5ca0455
Signed-off-by: Subrata Banik <subrata.banik@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37187
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: David Guckian
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-11-26 11:55:10 +00:00
Patrick Georgi 0bb83469ed Kconfig: comply to Linux 5.3's Kconfig language rules
Kconfig became stricter on what it accepts, so accomodate before
updating to a new release.

Change-Id: I92a9e9bf0d557a7532ba533cd7776c48f2488f91
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37156
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2019-11-23 20:09:56 +00:00
Johnny Lin 53509cf15a drivers/ipmi: Add IPMI get system GUID support
Tested on OCP Mono Lake.

Change-Id: I541a23341ccce3d45239babb3f0a8a8c8542b226
Signed-off-by: Johnny Lin <johnny_lin@wiwynn.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36842
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
2019-11-22 10:43:42 +00:00
Morgan Jang 5015502414 src/drivers/ipmi: Implement BMC Get Self Test Result function
According to IPMI SPEC, it is recommended that BIOS includes provisions
for checking and reporting on the basic health of BMC by executing
the Get Self Test Results command and checking the result.

TEST=Check the result in response data to confirm the BMC status is fine
or not.

Change-Id: I20349cec2e8e9420d177d725de2a5560d354fe47
Signed-off-by: Morgan Jang <Morgan_Jang@wiwynn.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36638
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
2019-11-22 10:39:05 +00:00
Kyösti Mälkki 9bb16cd9c5 drivers/pc80/rtc: Remove CMOS spinlock
This was only used with amdfam10h-15h, and only in romstage
while commentary elsewhere says concurrent CMOS and CBFS
access caused issues.

We would want a cleaner approach on this, if re-implemented.

Change-Id: I8512196cb55ff2b4542b1421a1bbae540450115a
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37074
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2019-11-22 06:24:28 +00:00
Kyösti Mälkki 35a047c4e5 drivers/crb: Replace __RAMSTAGE_ guards
Change-Id: Ie2e6cdddc1edb95c442a4240267fe1fd6a11d37e
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36698
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-11-21 19:39:05 +00:00
Kyösti Mälkki baa16e9c25 drivers/pc80/tpm: Replace __RAMSTAGE_ guards
Change-Id: Ia6e161c3b4fc44292cdac692a2918c522680d60d
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36631
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-11-21 19:38:17 +00:00
Arthur Heymans 15c012181d drivers/intel/fsp1_0: Drop support
No platform is using this.

Change-Id: I3ea6df4d9ce9043755f319f699adc189d754df1f
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36985
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
2019-11-21 06:47:43 +00:00
Julius Werner f96d9051c2 Remove MIPS architecture
The MIPS architecture port has been added 5+ years ago in order to
support a Chrome OS project that ended up going nowhere. No other board
has used it since and nobody is still willing or has the expertise and
hardware to maintain it. We have decided that it has become too much of
a mainenance burden and the chance of anyone ever reviving it seems too
slim at this point. This patch eliminates all MIPS code and
MIPS-specific hacks.

Change-Id: I5e49451cd055bbab0a15dcae5f53e0172e6e2ebe
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/34919
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-11-20 10:10:48 +00:00
Julius Werner 7fc928656e lib/fmap: Disable pre-RAM cache for FSP 1.0
Due to the way CAR teardown is handled in FSP 1.0, the results of
car_get_var_ptr() aren't always reliable, which can break things when
running with FMAP cache. It might be possible to fix this but would make
the code rather complicated, so let's just disable the feature on these
platforms and hope they die out soon.

Also allow this option to be used by platforms that don't have space for
the cache and want to save a little more code.

Change-Id: I7ffb1b8b08a7ca3fe8d53dc827e2c8521da064c7
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36937
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2019-11-19 11:26:21 +00:00
Julius Werner a2148377b5 include: Make stdbool.h a separate file
This patch moves the traditional POSIX stdbool.h definitions out from
stdint.h into their own file. This helps for using these definitions in
commonlib code which may be compiled in different environments. For
coreboot everything should chain-include this stuff via types.h anyway
so nothing should change.

Change-Id: Ic8d52be80b64d8e9564f3aee8975cb25e4c187f5
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36837
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2019-11-18 22:47:13 +00:00
Xiang Wang b134945ec1 drivers/spi: add drivers for sdcard mounted on the spi bus
Currently supports initialization, read, write, and erase operations.
Tested on HiFive Uneashed

implementation follows SD association's SPI access protocol, found
as doc http://t.cn/AiB8quFZ

Change-Id: I464d2334b8227e448c1c7e324c0455023cffb72a
Signed-off-by: Xiang Wang <merle@hardenedlinux.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/35118
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2019-11-14 11:38:38 +00:00
Frans Hendriks 50b999feb8 {drivers,mainboard}: Move FSP logo support to fsp1_1
Support to display a logo using FSP 1.1 currently resides in facebook fbg1701
mainboard.

The related support is moved to drivers/intel/fsp1_1 and used by the
Facebook fbg1701 mainboard. The storage for the uncompressed logo
is changed. We don't use .bss any longer as the logo doesn't need to be
available at runtime.

BUG=N/A
TEST=booting Facebook fbg1701

Change-Id: I276e6e14fc87d0b95fe5fdf7b617afd26769de79
Signed-off-by: Wim Vervoorn <wvervoorn@eltan.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36679
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Frans Hendriks <fhendriks@eltan.com>
2019-11-14 11:33:46 +00:00
Peichao Wang 0d92271d2c spi: Add Winbond W25Q128JW_DTR SPI ROM support
BUG=b:144297264
TEST=Boot with W25Q128JW_DTR and check MRC data save/restore works.

Signed-off-by: Peichao Wang <peichao.wang@bitland.corp-partner.google.com>
Change-Id: Ica6344556e5de94555b95dd7c6df5600614811e2
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36762
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
2019-11-13 09:13:25 +00:00
Arthur Heymans df9cdcfc38 arch/x86/car.ld: Rename suffix _start/_end
This is more in line with how linker symbol for regions are defined.

Change-Id: I0bd7ae59a27909ed0fd38e6f7193816cb57e76af
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36695
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2019-11-12 18:25:42 +00:00
Uwe Poeche 11a34ec4c2 drivers/i2c/ptn3460: Provide chip driver for PTN3460
This patch provides a chip driver for the DP-2-LVDS bridge PTN3460.
The bridge is configured via I2C. As the mainboard has all the
information regarding the attached LCD type, there are three hooks into
mainboard code to get the information like EDID data and PTN config.

TEST=Display is working on Siemens mainboards (e.g. mc_tcu3, mc_apl1, ...).

Change-Id: Ie4c8176cd16836fa5b8fd2f72faf7a55723b82f6
Signed-off-by: Uwe Poeche <uwe.poeche@siemens.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36642
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
2019-11-12 18:24:19 +00:00
Michael Niewöhner b8cd4b0049 drivers/intel/fsp2_0: move common cbmem_top_chipset to fsp driver
The common cbmem_top_chipset implementation uses the FSP bootloader HOB,
thus move it to the fsp driver which is a more appropriate place.

Change-Id: I914df51a7414eb72416f816ff8375a13d5716925
Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36620
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: David Guckian
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-11-11 13:22:39 +00:00
Aaron Durbin 56aeae0400 region: publicize region_end() and add region_device_end()
Provide region_device_end() and make region_end() publically available
for use to match a pattern of open coding the offset + size calculation
for both struct region and struct region_device. Apply the use of the
helpers where the usage matches in the code.

Change-Id: Iaef5d007eef9a77f7f33b0e89298abef0197352d
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36689
Reviewed-by: Julius Werner <jwerner@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-11-11 10:28:09 +00:00
Arthur Heymans 12440ce63e drivers/intel/fsp1_1: Fake microcode update to make FSP happy
The FSP loops through microcode updates and at the end checks if
the microcode revision is not zero. Since we update the microcode
before loading FSP, this is the case and a fake microcode can be
passed to the FSP.

The advantage is that the Kconfig symbols to specify the location and
the size of the microcode blob can be dropped.

Change-Id: I63cfb7b19e9795da85566733fb4c1ff989e85d03
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36255
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-11-10 22:57:55 +00:00
Arthur Heymans 8256ca0e14 soc/intel/braswell: Update microcode before FSP
The google FSP Braswell version has broken microcode update code and
FSP checks at some point if the installed microcode version is non
zero, so coreboot has to update it before calling FSP-T.

This is fixed with newer FSP releases by Intel, but doing updates in
coreboot won't hurt.

Tested with both Intel FSP and google FSP.

Change-Id: I3e81329854e823dc66fec191adbed617bb37d649
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36198
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-11-10 22:57:29 +00:00
Arthur Heymans 585786b696 drivers/intel/fsp2_0: Hide the Kconfig option to run FSP-M XIP
This is a property of the FSP, not something the user can decide.

Change-Id: I2086e67d39e88215ee0f124583b810f7df072f80
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36170
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Michael Niewöhner
Reviewed-by: Nico Huber <nico.h@gmx.de>
2019-11-06 14:05:34 +00:00
Arthur Heymans 71bd7e439f drivers/intel/fsp2_0: Move Debug options to "Debugging"
Change-Id: I8e07c8186baf3d8e91b77c5afb731d26a1abfbaf
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36165
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2019-11-06 14:01:48 +00:00
Wim Vervoorn 8fc523e313 drivers/intel/fsp2_0: Use strip_quotes for cbfs filenames
The quotes were not stripped for the cbfs filenames of the FSP
components. This is causing problems when the regions-for-file macro is
executed (when VBOOT is enabled and the files should be filtered).

BUG=N/A
TEST=build

Change-Id: I14267502cfab5308d3874a0c0fd18a71b08bb9f8
Signed-off-by: Wim Vervoorn <wvervoorn@eltan.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36548
Reviewed-by: Frans Hendriks <fhendriks@eltan.com>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-11-05 15:04:54 +00:00
Kyösti Mälkki 00f0de3e14 drivers/pc80: Remove UDELAY_TIMER2
Change-Id: Ibc0a5f6e7be78be15f56b252be45a288b925183a
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36534
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-11-05 14:38:52 +00:00
Kyösti Mälkki 385ea8219d drivers/pc80: Remove UDELAY_IO
Change-Id: I3ab62d9b1caa23305ad3b859e3c1949784ae0464
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36533
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
2019-11-05 14:38:35 +00:00
Arthur Heymans acc88f8e66 drivers/intel/fsp2_0: Hide CONFIG_FSP_CAR
CONFIG_FSP_CAR should not be a user visible option, but depends on the
choice presented in the soc Kconfig.

This also removes the dependencies on ADD_FSP_BINARIES. You need to
included those for other stages too so there is no need to make this
requirement explicit for FSP-T.

Change-Id: Ida32e9c4f5839aef4d4deb7a1c7fabe6335a5d2a
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36169
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2019-11-05 09:49:08 +00:00
Michael Niewöhner 68da45479f soc/intel: skl,cnl,icl: rely on TOLUM as cbmem_top returned by FSP
Instead of doing our own calculations, rely on TOLUM returned by FSP
for cbmem_top. This (hopefully) saves us from making mistakes in weird
calculations of offsets and alignments.

Further this makes it easier to implement e.g. SGX PRMRR size selection
via Kconfig as we do not have to make any assumptions about alignments
but can simply pass (valid) values to FSP.

Tested successfully on X11SSM-F

Change-Id: If66a00d1320917bc68afb32c19db0e24c6732812
Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36136
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-11-04 19:10:08 +00:00
Kyösti Mälkki 0d6ddf8da7 cpu/x86/tsc: Flip and rename TSC_CONSTANT_RATE to UNKNOWN_TSC_RATE
The x86 timers are a bit of a mess. Cases where different stages use
different counters and timestamps use different counters from udelays.

The original intention was to only flip TSC_CONSTANT_RATE Kconfig
to NOT_CONSTANT_TSC_RATE. The name would be incorrect though, those
counters do run with a constant rate but we just lack tsc_freq_mhz()
implementation for three platforms.

Note that for boards with UNKNOWN_TSC_RATE=y, each stage will have a
slow run of calibrate_tsc_with_pit(). This is easy enough to fix with
followup implementation of tsc_freq_mhz() for the platforms.

Implementations with LAPIC_MONOTONIC_TIMER typically will not have
tsc_freq_mhz() implemented and default to UNKNOWN_TSC_RATE. However,
as they don't use TSC for udelay() the slow calibrate_tsc_with_pit()
is avoided.

Because x86/tsc_delay.tsc was using two different guards and nb/via/vx900
claimed UDELAY_TSC, but pulled UDELAY_IO implementation, we also switch
that romstage to use UDELAY_TSC.

Change-Id: I1690cb80295d6b006b75ed69edea28899b674b68
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/33928
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2019-11-03 06:15:35 +00:00
Kyösti Mälkki 432516586e cpu/x86: Move calibrate_tsc_with_pit() to drivers/pc80
Change-Id: Ia8d8dc23ee0b51d62c83f5ba640b3a9aea4e744b
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36507
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
2019-11-02 06:28:28 +00:00
Elyes HAOUAS 34715df801 src: Remove unused '#include <cpu/cpu.h>'
Change-Id: Ibcb1cafe36c255b4c5bd0a4faeedb95e91048709
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36372
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin Roth <martinroth@google.com>
2019-10-28 11:56:38 +00:00
Martin Roth 38ddbfb325 src/[arch-lib]: change "unsigned" to "unsigned int"
Signed-off-by: Martin Roth <martin@coreboot.org>
Change-Id: Ibb7b48a7a144421aff29acbb7ac30968ae5fe5ab
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36329
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
2019-10-27 21:08:39 +00:00
Elyes HAOUAS ede8dd0b9c src/{device,drivers}: Use 'include <stdlib.h>' when appropriate
Also, including <types.h>, is supposed to provide stdint and stddef.

Change-Id: I99918a5a77e759bc7d4192d2c3fd6ad493c70248
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/33681
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin Roth <martinroth@google.com>
2019-10-27 17:52:05 +00:00
Elyes HAOUAS 0edf6a59f8 src: Use 'include <boot/coreboot_tables.h>' when appropriate
Change-Id: I3d90e46ed391ce323436750c866a0afc3879e2e6
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36359
Reviewed-by: Martin Roth <martinroth@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-10-27 17:48:30 +00:00
Michael Niewöhner bc1dbb3cc3 drivers/intel/fsp2_0: move die() calls to the functions
Since there are no calls where we wouldn't die(), move die() calls into
the fsp_find_* functions.

Change-Id: I750a225999688137421bbc560d9d1f5fdf68fd01
Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36314
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Michael Niewöhner
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2019-10-26 15:49:18 +00:00
Michael Niewöhner fa62e01b90 drivers/intel/fsp1_1: remove orphaned functionality
Remove orphaned functionality from the FSP1.1 driver that only has been
used by skylake, which is now FSP2.0-only.

Change-Id: I732f2d6846788d5c03647c6fb620e45b3b66de5f
Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36266
Reviewed-by: Michael Niewöhner
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-10-26 15:39:49 +00:00
Johnny Lin f4abe51b74 drivers/ipmi: Add IPMI BMC FRB2 watchdog timer support
Add a function for initializing and starting FRB2 timer with the
provided countdown and action values, and a stop function for
stopping the timer.

Tested on OCP Monolake.

Change-Id: Ic91905e5f01b962473b6b3a9616266d2d95b1d6b
Signed-off-by: Johnny Lin <johnny_lin@wiwynn.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36179
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
2019-10-24 15:47:40 +00:00
Cheng-Yi Chiang c761f28171 drivers/i2c/rt1011: Add a driver for RT1011
RT1011 is a smart amplifier. It needs to know speaker related parameters
including speaker resistor value and temperature when the calibration is
done in order to run Dynamic Speaker Management (DSM) algorithm on chip.
The purpose of DSM is to protect speaker when the volume is large.

The calibration data of speaker is stored in VPD in factory.
This driver is needed to read data from VPD and write to ACPI _DSD when
config CHROMEOS_DSM_CALIB is turned on.

Kernel rt1011 codec driver will read these device properties to set up
codec accordingly on boot.

The reason to prepare these parameters in coreboot is because kernel
codec driver expects to read per-device parameters directly from device
properties. Another benefit is that other OS can also take these
parameters through ACPI _DSD table and take benefit of DSM on RT1011.

The kernel driver device properties of RT1011 are documented at
linux/Documentation/devicetree/bindings/sound/rt1011.txt
It is currently in ASoC maintainer's tree at
https://kernel.googlesource.com/pub/scm/linux/kernel/git/broonie/sound/+/for-next/
and hopefully should be merged to mainline kernel in the next merge window.

BUG=b:140397934
BRANCH=none
TEST=On Helios, with patch series, check realtek,r0_calib and
realtek,temperature_calib are available to rt1011 codec driver.

Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org>
Change-Id: I9550b9890ce2cae787f4f17779a5ade77f619171
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36029
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
2019-10-24 15:45:53 +00:00
Arthur Heymans 88e9c5af57 drivers/pc80/rtc: Avoid searching for cmos_layout.bin on each get/set_option
Avoid searching for cmos_layout.bin each time get/set_option is called
on platforms with NO_CAR_GLOBAL_MIGRATION.

Change-Id: Ie541017d2f8c8e9d4b592b71f44a08fd9670dd09
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/35848
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2019-10-23 14:23:29 +00:00
Martin Roth effaf8fcb8 AUTHORS: Move src/drivers/[l*-v*] copyrights into AUTHORS file
As discussed on the mailing list and voted upon, the coreboot project
is going to move the majority of copyrights out of the headers and into
an AUTHORS file.  This will happen a bit at a time, as we'll be unifying
license headers at the same time.

Updated Authors file is in a separate commit.

Signed-off-by: Martin Roth <martin@coreboot.org>
Change-Id: Ia0a07df6ca1fdaa2837ce8839057057cbd44d157
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36181
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2019-10-22 12:55:19 +00:00
Martin Roth cddd6008f9 AUTHORS: Move src/drivers/[a*-i*] copyrights into AUTHORS file
As discussed on the mailing list and voted upon, the coreboot project
is going to move the majority of copyrights out of the headers and into
an AUTHORS file.  This will happen a bit at a time, as we'll be unifying
license headers at the same time.

Updated Authors file is in a separate commit.

Signed-off-by: Martin Roth <martin@coreboot.org>
Change-Id: I1acea8c975d14904b7e486dc57a1a67480a6ee6e
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36178
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2019-10-22 12:55:10 +00:00
Marshall Dawson e3aa424a4f drivers/intel/fsp2_0: Add ENV_CACHE_AS_RAM check for consumed ranges
Rename the freeranges array to better match what they represent, i.e.
ranges that are used by the current running program and CAR region that
is not unallocated.

Skip adding the CAR region if cache-as-RAM is not active.

Change-Id: I78ee5536d890f30450a5ad2a753c948b02634d6d
Signed-off-by: Marshall Dawson <marshalldawson3rd@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36110
Reviewed-by: Martin Roth <martinroth@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-10-21 21:41:01 +00:00
Elyes HAOUAS bec78e32d6 src/{device,drivers,mb,nb,soc,sb}: Remove unused 'include <console/console.h>'
Change-Id: I0c965e598e260ff8129aa07fb9fc5bf6e784e1d8
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36057
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2019-10-21 14:21:09 +00:00
Elyes HAOUAS 749c395f93 src/{drivers/vpd,include/device/dram}: Add missing 'include <stdint.h>'
Change-Id: Ida74a55b105282d86368f529cfce3523e0e97b02
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36174
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2019-10-21 14:21:00 +00:00
Marshall Dawson 7a9e894550 drivers/intel/fsp2_0: Make vbt_get() conditional
Skip calling vbt_get() if FSP is not supposed to run GOP.

Change-Id: I6b8cd3646ffcd6df39229d4e36b315dfb7a8c859
Signed-off-by: Marshall Dawson <marshalldawson3rd@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36111
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin Roth <martinroth@google.com>
2019-10-20 21:49:33 +00:00