Commit graph

17560 commits

Author SHA1 Message Date
Furquan Shaikh
4ac7052c02 UPSTREAM: util/cbfstool: Include commonlib/helpers.h in common.h
This avoids re-declaring common macros like ARRAY_SIZE, MIN, MAX and
ALIGN. Also removes the issues around including both files in any
tool.

Also, fix comparison error in various files by replacing int with
size_t.

Change-Id: I06c763e5dd1bec97e8335499468bbdb016eb28e5
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/14978
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/348210
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Aaron Durbin <adurbin@chromium.org>
2016-05-31 12:07:02 -07:00
Duncan Laurie
7b2886db21 UPSTREAM: acpi_device: Add support for writing ACPI Device Properties
The recent ACPI specification extensions have formally defined a
method for describing device information with a key=value format that
is modeled after the Devicetree/DTS format using a special crafted
object named _DSD with a specific UUID for this format.

There are three defined Device Property types: Integers, Strings, and
References.  It is also possible to have arrays of these properties
under one key=value pair.  Strings and References are both represented
as character arrays but result in different generated ACPI OpCodes.

Various helpers are provided for writing the Device Property header
(to fill in the object name and UUID) and footer (to fill in the
property count and device length values) as well as for writing the
different Device Property types.  A specific helper is provided for
writing the defined GPIO binding Device Property that is used to allow
GPIOs to be referred to by name rather than resource index.

This is all documented in the _DSD Device Properties UUID document:
http://uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf

This will be used by device drivers to provide device properties that
are consumed by the operating system.  Devicetree bindings are often
described in the linux kernel at Documentation/devicetree/bindings/

A sample driver here has an input GPIO that it needs to describe to
the kernel driver:

chip.h:
  struct drivers_generic_sample_config {
    struct acpi_gpio mode_gpio;
  };

sample.c:
  static void acpi_fill_ssdt_generator(struct device *dev) {
    struct drivers_generic_sample_config *config = dev->chip_info;
    const char *path = acpi_device_path(dev);
    ...
    acpi_device_write_gpio(&config->mode_gpio);
    ...
    acpi_dp_write_header();
    acpi_dp_write_gpio("mode-gpio", path, 0, 0, 0);
    acpi_dp_write_footer();
    ...
  }

devicetree.cb:
  device pci 1f.0 on
    chip drivers/generic/sample
      register "mode_gpio" = "ACPI_GPIO_INPUT(GPP_B1)"
      device generic 0 on end
    end
  end

SSDT.dsl:
  Name (_CRS, ResourceTemplate () {
    GpioIo (Exclusive, PullDefault, 0, 0, IoRestrictionInputOnly,
            "\\_SB.PCI0.GPIO", 0, ResourceConsumer) { 25 }
  })
  Name (_DSD, Package () {
    ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
    Package () {
      Package () {"mode-gpio", Package () { \_SB.PCI0.LPCB, 0, 0, 1 }}
    }
  })

Change-Id: I93ffd09e59d05c09e38693e221a87085469be3ad
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://review.coreboot.org/14937
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/348019
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
2016-05-31 12:07:01 -07:00
Duncan Laurie
29c9372f80 UPSTREAM: acpi_device: Add support for writing ACPI SPI descriptors
Add required definitions to describe an ACPI SPI bus and a method to
write the SpiSerialBus() descriptor to the SSDT.

This will be used by device drivers to describe their SPI resources to
the OS.  SPI devices are not currently enumerated in the devicetree but
can be enumerated by device drivers directly.

generic.c:
  void acpi_fill_ssdt_generator(struct device *dev) {
    struct acpi_spi spi = {
      .device_select = dev->path->generic.device.id,
      .device_select_polarity = SPI_POLARITY_LOW,
      .spi_wire_mode = SPI_4_WIRE_MODE,
      .speed = 1000 * 1000; /* 1 mHz */
      .data_bit_length = 8,
      .clock_phase = SPI_CLOCK_PHASE_FIRST,
      .clock_polarity = SPI_POLARITY_LOW,
      .resource = acpi_device_path(dev->bus->dev)
    };
    ...
    acpi_device_write_spi(&spi);
    ...
  }

devicetree.cb:
  device pci 1e.2 on
    chip drivers/spi/generic
      device generic 0 on end
    end
  end

SSDT.dsl:
  SpiSerialBus (0, PolarityLow, FourWireMode, 8, ControllerInitiated,
                1000000, ClockPolarityLow, ClockPhaseFirst,
                "\\_SB.PCI0.SPI0", 0, ResourceConsumer)

Change-Id: I0ef83dc111ac6c19d68872ab64e1e5e3a7756cae
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://review.coreboot.org/14936
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/348018
Commit-Ready: Aaron Durbin <adurbin@chromium.org>
Tested-by: Aaron Durbin <adurbin@chromium.org>
2016-05-30 23:35:10 -07:00
Duncan Laurie
0e395c8f65 UPSTREAM: acpi_device: Add support for writing ACPI I2C descriptors
Add required definitions to describe an ACPI I2C bus and a method to
write the I2cSerialBus() descriptor to the SSDT.

This will be used by device drivers to describe their I2C resources to
the OS.  The devicetree i2c device can supply the address and 7 or 10
bit mode as well as indicate the GPIO controller device, and the bus
speed can be fixed or configured by the driver.

chip.h:
  struct drivers_i2c_generic_config {
    enum i2c_speed bus_speed;
  };

generic.c:
  void acpi_fill_ssdt_generator(struct device *dev) {
    struct drivers_i2c_generic_config *config = dev->chip_info;
    struct acpi_i2c i2c = {
      .address = dev->path->i2c.device,
      .mode_10bit = dev->path.i2c.mode_10bit,
      .speed = config->bus_speed ? : I2C_SPEED_FAST,
      .resource = acpi_device_path(dev->bus->dev)
    };
    ...
    acpi_device_write_i2c(&i2c);
    ...
  }

devicetree.cb:
  device pci 15.0 on
    chip drivers/i2c/generic
      device i2c 10.0 on end
    end
  end

SSDT.dsl:
  I2cSerialBus (0x10, ControllerInitiated, 400000, AddressingMode7Bit,
                "\\_SB.PCI0.I2C0", 0, ResourceConsumer)

Change-Id: I598401ac81a92c72f19da0271af1e218580a6c49
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://review.coreboot.org/14935
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/348017
Commit-Ready: Aaron Durbin <adurbin@chromium.org>
Tested-by: Aaron Durbin <adurbin@chromium.org>
2016-05-30 23:35:09 -07:00
Duncan Laurie
5de86b9d42 UPSTREAM: acpi_device: Add support for writing ACPI GPIO descriptors
Add definitions to describe GPIOs in generated ACPI objects and a
method to write a GpioIo() or GpioInt() descriptor to the SSDT.

ACPI GPIOs have many possible configuration options and a structure
is created to describe it accurately in ACPI terms.  There are many
shared descriptor fields between GpioIo() and GpioInt() so the same
function can write both types.

GpioInt shares many properties with ACPI Interrupts and the same types
are re-used here where possible.  One addition is that GpioInt can be
configured to trigger on both low and high edge transitions.

One descriptor can describe multiple GPIO pins (limited to 8 in this
implementation) that all share configuration and controller and are
used by the same device scope.

Accurately referring to the GPIO controller that this pin is connected
to requires the SoC/board to implement a function handler for
acpi_gpio_path(), or for the caller to provide this directly as a
string in the acpi_gpio->reference variable.

This will get used by device drivers to describe their resources in
the SSDT.  Here is a sample for a Maxim 98357A I2S codec which has a
GPIO for power and channel selection called "sdmode".

chip.h:
  struct drivers_generic_max98357a_config {
    struct acpi_gpio sdmode_gpio;
  };

max98357a.c:
  void acpi_fill_ssdt_generator(struct device *dev) {
    struct drivers_generic_max98357a_config *config = dev->chip_info;
    ...
    acpi_device_write_gpio(&config->sdmode_gpio);
    ...
  }

devicetree.cb:
  device pci 1f.3 on
    chip drivers/generic/max98357a
      register "sdmode_gpio" = "ACPI_GPIO_OUTPUT(GPP_C5)"
      device generic 0 on end
    end
  end

SSDT.dsl:
  GpioIo (Exclusive, PullDefault, 0, 0, IoRestrictionOutputOnly,
          "\\_SB.PCI0.GPIO", 0, ResourceConsumer, ,) { 53 }

Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Change-Id: Ibf5bab9c4bf6f21252373fb013e78f872550b167
Reviewed-on: https://review.coreboot.org/14934
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/348016
Commit-Ready: Aaron Durbin <adurbin@chromium.org>
Tested-by: Aaron Durbin <adurbin@chromium.org>
2016-05-30 23:35:08 -07:00
Duncan Laurie
e33df029ee UPSTREAM: acpi_device: Add support for writing ACPI Interrupt descriptors
Add definitions for ACPI device extended interrupts and a method to
write an Interrupt() descriptor to the SSDT output stream.

Interrupts are often tied together with other resources and some
configuration items are shared (though not always compatibly) with
other constructs like GPIOs and GPEs.

These will get used by device drivers to write _CRS sections for
devices into the SSDT.  One usage is to include a "struct acpi_irq"
inside a config struct for a device so it can be initialized based
on settings in devicetree.

Example usage:

chip.h:
  struct drivers_i2c_generic_config {
    struct acpi_irq irq;
  };

generic.c:
  void acpi_fill_ssdt_generator(struct device *dev) {
    struct drivers_i2c_generic_config *config = dev->chip_info;
    ...
    acpi_device_write_interrupt(&config->irq);
    ...
  }

devicetree.cb:
  device pci 15.0 on
    chip drivers/i2c/generic
      register "irq" = "IRQ_EDGE_LOW(GPP_E7_IRQ)"
      device i2c 10 on end
    end
  end

SSDT.dsl:
  Interrupt (ResourceConsumer, Edge, ActiveLow, Exclusive,,,) { 31 }

Change-Id: I3b64170cc2ebac178e7a17df479eda7670a42703
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://review.coreboot.org/14933
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/348015
Commit-Ready: Aaron Durbin <adurbin@chromium.org>
Tested-by: Aaron Durbin <adurbin@chromium.org>
2016-05-30 23:35:07 -07:00
Julius Werner
e558f59e2e libpayload: Reintroduce CONFIG_LP_CHROMEOS to set suitable defaults
Chrome OS builds always have some inherent differences to "standard"
libpayload configurations: they don't want to use curses or things like
storage drivers, they always use the coreboot framebuffer and USB, etc.
This patch reintroduces CONFIG_LP_CHROMEOS as an option that only
affects Kconfig defaults. This allows Chrome OS builds to select most of
what they need in one go and reduces board-specific .config files to
only the options that are really specific to that board.

Also restricts the 8250_SERIAL_CONSOLE Kconfig to only default to yes on
x86 boards, which probably makes sense for all of libpayload (some but
far from all ARM boards use 8250-compatible UARTs, and we should
probably not default a platform option unless it's going to be correct
with very high probability).

BRANCH=None
BUG=None
TEST=Built and booted Jerry and Oak.

Change-Id: I609637cd2ea7dfb4558aa3c04c90b64038c9ab57
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/347970
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-05-27 18:08:50 -07:00
Julius Werner
a036af62a9 libpayload: Replace majority of timer drivers with a generic one
Currently every non-x86 platform supported by libpayload needs to
provide its own timer driver. Most of the ones we have accumulated there
look almost identical: For the frequency, return a preset constant. For
the value, read a 32-bit register, possibly read another 32-bit register
and shift+OR it with the previous one, then return that.

Let's replace this with a single .c file that can easily handle all of
those cases. Menuconfig convenience can still be maintained by providing
several presets that select different defaults for the driver's
configuration options (register address(es) and frequency).

Removes an "enabled" check from Samsung MCT driver since coreboot always
unconditionally enables that timer anyway.

CQ-DEPEND=CL:344809
BRANCH=None
BUG=None
TEST=Booted Oak and Veyron, observed how dev-mode delay was still ~30s

Change-Id: I9784e7c6aa5abd6d92478ea7ec1cf42c9a437546
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/347749
2016-05-27 18:08:49 -07:00
Aaron Durbin
6ba8c06c45 UPSTREAM: soc/intel/apollolake: provide SMM dependency requirements
Depending on which options are selected there needs to be certain
functions supplied. However, the spi, mmap_boot, and tsc_freq modules
were not included in the SMM builds. Fix the omission.

BUG=None
BRANCH=None
TEST=None

Change-Id: I25ab42886cfd46770ce0f4beee65f2f4d15649f3
Original-Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-on: https://review.coreboot.org/14977
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Furquan Shaikh <furquan@google.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/347985
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-05-27 18:08:47 -07:00
Aaron Durbin
f101ba418c UPSTREAM: mainboard/google/reef: increase BIOS region size
An updated descriptor expands the BIOS region while descreasing
the 'device expansion region' utilized by the CSE. Update the
end region marker to reflect this new size as well as the
chromeos.fmd file which needs to be adjusted for logical boot
parition 2 requirement which resides halfway through the BIOS
region. The GBB was moved and shunk to accommodate the change.

BUG=None
BRANCH=None
TEST=None

Change-Id: I7baa5282d7c608af648b5773c4dfa123060a6e45
Original-Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-on: https://review.coreboot.org/14974
Original-Reviewed-by: Furquan Shaikh <furquan@google.com>
Original-Tested-by: build bot (Jenkins)
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/347984
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-05-27 18:08:46 -07:00
Aaron Durbin
fc9b9e43df UPSTREAM: mainboard/google/reef: support verstage
The chromeos.c suport needs to be linked into verstage so it will
link.

BUG=None
BRANCH=None
TEST=None

Change-Id: If85e232a3721443edfbbd278b32f72302f13f3a8
Original-Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-on: https://review.coreboot.org/14973
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Furquan Shaikh <furquan@google.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/347983
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-05-27 18:08:46 -07:00
Aaron Durbin
b9056c9eed UPSTREAM: soc/intel/apollolake: add support for verstage
There previously was no support for building verstage on apollolake.
Add that suport by linking in the appropriate modules as well as
providing vboot_platform_is_resuming(). The link address for verstage
is the same as FSP-M because they would never be in CAR along side
each other. Additionally, program the ACPI I/O BAR and enable decoding
so sleep state can be determined for early firmware verification.

BUG=None
BRANCH=None
TEST=None

Change-Id: I1a0baab342ac55fd82dbed476abe0063787e3491
Original-Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-on: https://review.coreboot.org/14972
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Furquan Shaikh <furquan@google.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/347982
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-05-27 18:08:45 -07:00
Aaron Durbin
eea5e1aa83 UPSTREAM: arch/x86: provide verstage support for CONFIG_C_ENVIRONMENT_BOOTBLOCK
When CONFIG_C_ENVIRONMENT_BOOTBLOCK is employed there's no need for
a chipset specific verstage entry point because cache-as-ram has
already been initialized. Therefore, provide a default entry point
for verstage in that environment.

BUG=None
BRANCH=None
TEST=None

Change-Id: Idd8f45bd58d3e5b251d1e38cca7ae794b8b77a28
Original-Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-on: https://review.coreboot.org/14971
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Furquan Shaikh <furquan@google.com>
Original-Reviewed-by: Andrey Petrov <andrey.petrov@intel.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/347981
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-05-27 18:08:44 -07:00
Xing Zheng
9c58fa774f rockchip: rk3399: Add support i2s
This patch enable and configure the clocks and IOMUX for i2s audio path,
and the i2s0 clock is from CPLL.

Please refer to TRM V0.3 Part 1 Chapter 3 CRU, P126/P128/P144/P154/P155
for the i2s clock div and gate setting.

BRANCH=none
BUG=chrome-os-partner:52172
TEST=boot kevin rev1, press ctrl+u and hear the beep voice.

Change-Id: I130a874a0400712317e5e7a8b3b10a6f04586f68
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Reviewed-on: https://chromium-review.googlesource.com/347526
Commit-Ready: Wonjoon Lee <woojoo.lee@samsung.com>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-05-27 05:22:01 -07:00
Jagadish Krishnamoorthy
48327e79eb UPSTREAM: soc/intel/apollolake: Provide No Connect macro for unused Pad
BUG=None
BRANCH=None
TEST=None

Change-Id: Iba506054a3d631c8e538d44e1ca6877dd02c2ca9
Original-Signed-off-by: Jagadish Krishnamoorthy <jagadish.krishnamoorthy@intel.com>
Original-Reviewed-on: https://review.coreboot.org/14956
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/347753
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-05-26 20:37:17 -07:00
Andrey Petrov
74d7bf1fd1 UPSTREAM: MAINTAINERS: Add myself for Apollolake SoC, FSP2.0, and Amenia mb
BUG=None
BRANCH=None
TEST=None

Change-Id: I9931263f0f51d6c726bd7c72042fae1155affb6e
Original-Signed-off-by: Andrey Petrov <andrey.petrov@intel.com>
Original-Reviewed-on: https://review.coreboot.org/14963
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/347752
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-05-26 20:37:16 -07:00
Jagadish Krishnamoorthy
016c448739 UPSTREAM: soc/intel/apollolake: enable RTC
BUG=none
TEST=Boot to OS and verfiy if rtc0 device is created
under /sys/class/rtc/

BUG=None
BRANCH=None
TEST=None

Change-Id: Idec569255859816fda467bb42a215c00f7c0e16e
Original-Signed-off-by: Jagadish Krishnamoorthy <jagadish.krishnamoorthy@intel.com>
Original-Reviewed-on: https://review.coreboot.org/14883
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/347751
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-05-26 20:37:15 -07:00
Furquan Shaikh
e451becb6b UPSTREAM: cbfstool: Move cbfs_file_get_header to fit.c
Since fit.c is the only caller of this function move it out of common.c
and into fit.c.

BUG=None
BRANCH=None
TEST=None

Change-Id: I64cc31a6d89ee425c5b07745ea5ca9437e2f3fcf
Original-Signed-off-by: Furquan Shaikh <furquan@google.com>
Original-Reviewed-on: https://review.coreboot.org/14949
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/347750
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-05-26 20:37:15 -07:00
Alexandru Gagniuc
72937c39e2 UPSTREAM: drivers/intel/fsp2_0: Send post codes around calls to the blobs
By design, FSP will send POST codes to port 80. In this case we have
both coreboot and FSP pushing post codes, which may make debugging
harder. In order to get a clear picture of where FSP execution begins
and ends, send post codes before and after any call to the FSP blobs.

Note that sending a post code both before and after is mostly useful
on chromeec enabled boards, where the EC console will provide a
historic list of post codes.

BUG=None
BRANCH=None
TEST=None

Change-Id: Icfd22b4f6d9e91b01138f97efd711d9204028eb1
Original-Signed-off-by: Alexandru Gagniuc <alexandrux.gagniuc@intel.com>
Original-Reviewed-on: https://review.coreboot.org/14951
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/347589
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-05-26 20:37:14 -07:00
zbao
c011ab2301 UPSTREAM: splash: Put the suffix of splash file to CBFS name
The previous code harded the suffix of splash file as
"jpg". Actually, SeaBIOS supports both jpg and bmp.

BUG=None
BRANCH=None
TEST=None

Change-Id: I06c4b14aae7f75be3406652a94612b5f30ce91c2
Original-Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Original-Reviewed-on: https://review.coreboot.org/14932
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/347588
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-05-26 20:37:13 -07:00
Alexandru Gagniuc
016716542f UPSTREAM: soc/apollolake: Use simpler macros for the northbridge PCI device
The NB_DEV_ROOT macro, is almost unreadable, as it depends on other
stringified macros, and acts differently depending on the coreboot
stage. For ramstage, it also hides a function call.
Rewrite the macro in terms of more basic and readable macros.

BUG=None
BRANCH=None
TEST=None

Change-Id: I9b7071d67c8d58926e9b01fadaa239db1120448c
Original-Signed-off-by: Alexandru Gagniuc <alexandrux.gagniuc@intel.com>
Original-Reviewed-on: https://review.coreboot.org/14890
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/347587
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-05-26 20:37:12 -07:00
Alexandru Gagniuc
6051fff969 UPSTREAM: soc/apollolake/memmap: Switch to SIMPLE_DEVICE API
memmap.c functionality is designed to be used in more than ramstage.
Therefore, it cannot use ramstage-specific APIs. In this case, the
SIMPLE_DEVICE API offers a more consistent behavior across stages.

BUG=None
BRANCH=None
TEST=None

Change-Id: Ic381fe1eb773fb0a5fb5887eb67d2228d2f0817d
Original-Signed-off-by: Alexandru Gagniuc <alexandrux.gagniuc@intel.com>
Original-Reviewed-on: https://review.coreboot.org/14953
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/347586
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-05-26 20:37:11 -07:00
Abhay Kumar
f53f3c6a33 UPSTREAM: mainboard/intel/amenia: Configure DDI0, DDI1 HPD GPIO lines.
1. Configure GPIO_199 and GPIO_200 as NF2 to work as HPD.
2. Make 20k Pullup and remove duplicate code.

BUG=None
BRANCH=None
TEST=None

Change-Id: I8c78d867b03d5f2a6f02165c20777ae25e352ce7
Original-Signed-off-by: Abhay Kumar <abhay.kumar@intel.com>
Original-Reviewed-on: https://review.coreboot.org/14899
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/347457
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-05-26 14:34:21 -07:00
Hannah Williams
04effd8ce5 UPSTREAM: mainboard/intel/amenia: Disable Integrated Sensor Hub
Providing an option to enable or disable ISH interface. Leaving it
disabled for now.

BUG=None
BRANCH=None
TEST=None

Change-Id: Id4e71d60a6c2da6c6c070d41f66f6c161de38595
Original-Signed-off-by: Hannah Williams <hannah.williams@intel.com>
Original-Reviewed-on: https://review.coreboot.org/14895
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/347456
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-05-26 14:34:20 -07:00
Hannah Williams
ec164cf54f UPSTREAM: soc/apollolake: Add ish_enable in soc_intel_apollolake_config
Also initialize IshEnable in Silicon Init UPD with the value from
devicetree.cb

BUG=None
BRANCH=None
TEST=None

Original-Signed-off-by: Hannah Williams <hannah.williams@intel.com>
Change-Id: I8f57a7353471cc3efa21c7011cdd0b369d25275d
Original-Reviewed-on: https://review.coreboot.org/14894
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/347455
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-05-26 14:34:20 -07:00
Roberto Muñoz Gómez
fbf45a9467 UPSTREAM: superiotool: Add support for chip NCT6102D / NCT6106D
Add support for chip NCT6102D / NCT6106D in superiotool

BUG=None
BRANCH=None
TEST=None

Change-Id: I689ff8e796f43a5aac144e9898df750407588b1f
Original-Signed-off-by: Roberto Muoz Gmez <munoz.roberto@gmail.com>
Original-Reviewed-on: https://review.coreboot.org/14206
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Original-Reviewed-by: Nico Huber <nico.h@gmx.de>
Original-Tested-by: build bot (Jenkins)
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/347454
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-05-26 14:34:19 -07:00
Bora Guvendik
cbcb5ce111 UPSTREAM: intel/amenia: Extend IFD size by 512 KB
Increase BIOS region size by 512KB since device extension size
is reduced from 1MB to 512KB

BUG=chrome-os-partner:52589
TEST=Build Coreboot and boots
CQ-DEPEND=CL:*259448,CL:345642,CL:*259445

BUG=None
BRANCH=None
TEST=None

Change-Id: Ib81b117a3afe730aafa54b4ef31b1e9ab1f67111
Original-Signed-off-by: Bora Guvendik <bora.guvendik@intel.com>
Original-Reviewed-on: https://review.coreboot.org/14929
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/347453
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-05-26 14:34:18 -07:00
Hannah Williams
ed2a63b393 UPSTREAM: soc/apollolake: Enable Wake from USB devices
BUG=None
BRANCH=None
TEST=None

Change-Id: Ib0b30a5779681488e80000a2570fc2fd4c69e908
Original-Signed-off-by: Hannah Williams <hannah.williams@intel.com>
Original-Reviewed-on: https://review.coreboot.org/14893
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/347392
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-05-26 08:26:17 -07:00
Furquan Shaikh
c517e9b218 google/reef: Sync chromeos.fmd with fmap.dts and fix offsets
CQ-DEPEND=CL:347460
BUG=chrome-os-partner:53689
BRANCH=None
TEST="emerge-reef chromeos-bootimage" completes without error

Change-Id: Ic954e29628423937604772a8d2d0414954e6ba3e
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://chromium-review.googlesource.com/347441
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-05-26 06:29:11 -07:00
Hannah Williams
0fc5e1c580 UPSTREAM: soc/apollolake: SOC specific SMM code
Add SMI handlers that map to SOC specific SMI events
Update relocation_handler in mp_ops

BUG=None
BRANCH=None
TEST=None

Change-Id: Idefddaf41cf28240f5f8172b00462a7f893889e7
Original-Signed-off-by: Hannah Williams <hannah.williams@intel.com>
Original-Reviewed-on: https://review.coreboot.org/14808
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/347391
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-05-26 03:22:00 -07:00
Hannah Williams
e9544ce319 UPSTREAM: soc/intel/common: Add common smihandler code
Provide default handler for some SMI events. Provide the framework for
extracting data from SMM Save State area for processors with SMM revision
30100 and 30101.
The SOC specific code should initialize southbridge_smi with event
handlers. For SMM Save state handling, SOC code should implement
get_smm_save_state_ops which initializes the SOC specific ops for SMM Save
State handling.

BUG=None
BRANCH=None
TEST=None

Change-Id: I0aefb6dbb2b1cac5961f9e43f4752b5929235df3
Original-Signed-off-by: Hannah Williams <hannah.williams@intel.com>
Original-Reviewed-on: https://review.coreboot.org/14615
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/347390
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-05-26 03:21:59 -07:00
Aaron Durbin
e482cebcb6 UPSTREAM: vendorcode/google/chromeos/vboot2: use cbmem for postcar region selection
When the vboot cbfs selection runs in postcar stage it should be
utilizing cbmem to locate the vboot selected region.

BUG=None
BRANCH=None
TEST=None

Change-Id: I027ba19438468bd690d74ae55007393f051fde42
Original-Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-on: https://review.coreboot.org/14959
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Furquan Shaikh <furquan@google.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/347380
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-05-26 03:21:58 -07:00
Aaron Durbin
c1b8cbffa8 UPSTREAM: console/post: be explicit about conditional cmos_post_log() compiling
The current code was using !__PRE_RAM__ as a proxy for ramstage
conditional compilation. In the face of postcar stage not defining
__PRE_RAM__ (because it's after RAM is up) these code paths
can fail to compile with a __SIMPLE_DEVICE__ defined for the entire
stage. Remedy the current situation by just compiling explicity for
ramstage because that was the original intent. In the future,
the __SIMPLE_DEVICE__ selection for postcar can also be re-evaluated.

BUG=None
BRANCH=None
TEST=None

Change-Id: I0f887f1e45f0cf5c235ae5144eaa227921e7119b
Original-Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-on: https://review.coreboot.org/14958
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Furquan Shaikh <furquan@google.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/347169
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-05-26 03:21:57 -07:00
Lee Leahy
914065950e UPSTREAM: mainboard/intel/galileo: Enable USB device support
Turn on the USB device port.

TEST=Build and run on Galileo Gen2

BUG=None
BRANCH=None
TEST=None

Change-Id: Ic1fbb2cd51414ce927f2b408ccd27c7edf978744
Original-Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Original-Reviewed-on: https://review.coreboot.org/14943
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Martin Roth <martinroth@google.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/347168
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-05-26 03:21:56 -07:00
Lee Leahy
950bc61055 UPSTREAM: soc/intel/quark: Add USB device port support
Add initialization for the USB device port.

TEST=Build and run on Galileo Gen2

BUG=None
BRANCH=None
TEST=None

Change-Id: Icf83747f778f6e1ac976cd448a94311030e79e4f
Original-Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Original-Reviewed-on: https://review.coreboot.org/14941
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Martin Roth <martinroth@google.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/347167
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-05-26 03:21:55 -07:00
Julius Werner
edacf7d191 UPSTREAM: arm64: Add stack dump to exception handler
Some exceptions (like from calling a NULL function pointer) are easier
to narrow down with a dump of the call stack. Let's take a page out of
ARM32's book and add that feature to ARM64 as well. Also change the
output format to two register columns, to make it easier to fit a whole
exception dump on one screen.

Applying to both coreboot and libpayload and syncing the output format
between both back up.

BUG=None
BRANCH=None
TEST=None

Change-Id: I19768d13d8fa8adb84f0edda2af12f20508eb2db
Original-Signed-off-by: Julius Werner <jwerner@chromium.org>
Original-Reviewed-on: https://review.coreboot.org/14931
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/347166
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-05-26 03:21:55 -07:00
Jagadish Krishnamoorthy
085a6246f6 UPSTREAM: intel/amenia: Configure Trackpad IC_SDA_HOLD time
Elan trackpad needs greater sda hold time.
Configure IC_SDA_HOLD register to increase
the i2c sda hold time by 0.3us.

BUG=None
BRANCH=None
TEST=None

Change-Id: I3d966eed62a059ecb6a0a88e9f4e6b4ba7a925e4
Original-Signed-off-by: Jagadish Krishnamoorthy <jagadish.krishnamoorthy@intel.com>
Original-Reviewed-on: https://review.coreboot.org/14922
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/347165
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-05-26 03:21:54 -07:00
Jagadish Krishnamoorthy
8610557368 UPSTREAM: vendorcode/chromeos/vbnv: Add CMOS init function
Add cmos init helper function.
This function saves the Vboot NV data, calls cmos init
and restores the Vboot NV data.

BUG=None
BRANCH=None
TEST=None

Change-Id: I8475f23d849fb5b5a2d16738b4d5e99f112883da
Original-Signed-off-by: Jagadish Krishnamoorthy <jagadish.krishnamoorthy@intel.com>
Original-Reviewed-on: https://review.coreboot.org/14898
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/347164
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-05-26 03:21:53 -07:00
Lee Leahy
c0a6c5196a UPSTREAM: soc/intel/quark: Add EHCI errata
Move the EHCI errata from QuarkFSP into coreboot.

TEST=Build and run on Galileo Gen2

BUG=None
BRANCH=None
TEST=None

Change-Id: I424ffd81643fbba9c820b5a8a6809b9412965f8d
Original-Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Original-Reviewed-on: https://review.coreboot.org/14940
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Duncan Laurie <dlaurie@google.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/347163
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-05-26 03:21:52 -07:00
Lee Leahy
b67b1e00e9 UPSTREAM: soc/intel/quark: Rename usb.c to ehci.c
Rename usb.c to ehci.c since it contains EHCI specific content.

TEST=Build and run on Galileo Gen2

BUG=None
BRANCH=None
TEST=None

Change-Id: Ifdb7cd937b1dffda1959b76e1c911ffd93f53cb6
Original-Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Original-Reviewed-on: https://review.coreboot.org/14939
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Duncan Laurie <dlaurie@google.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/347162
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-05-26 03:21:51 -07:00
Lee Leahy
63d2476aa4 UPSTREAM: soc/intel/quark: Switch reference from uart_dev to uart_bdf
Switch from using uart_dev to uart_bdf to better describe the value
in use.

TEST=Build and run on Galileo Gen2

BUG=None
BRANCH=None
TEST=None

Change-Id: If5066b93ea8ccce4a5b89ee3984c7413d5358e71
Original-Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Original-Reviewed-on: https://review.coreboot.org/14938
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Duncan Laurie <dlaurie@google.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/347161
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-05-26 03:21:50 -07:00
Aaron Durbin
ff27178d69 UPSTREAM: soc/intel/apollolake: add support for writing logical boot partition 2
On apollolake the boot media layout is different in that the
traditional "BIOS" region contains another data structure with
the boot assets such as CSE firmware, PMC microcode,
CPU microcode, and boot firmware to name a few. There's also a
sort of recovery mechanism where there is a second data structure
with similar contents halfway through the "BIOS" region. This
second structure is referred as the logical boot partition 2 (LBP2),
and it's optionally employed.

Add support for writing the LBP2 to a specified FMAP region to
accommodate platforms which require it.

BUG=None
BRANCH=None
TEST=None

Change-Id: I1959a790f763b409238dea6b62408b42122e590e
Original-Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-on: https://review.coreboot.org/14924
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Furquan Shaikh <furquan@google.com>
Original-Reviewed-by: Andrey Petrov <andrey.petrov@intel.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/346994
Commit-Ready: Martin Roth <martinroth@chromium.org>
Tested-by: Martin Roth <martinroth@chromium.org>
Reviewed-by: Martin Roth <martinroth@chromium.org>
2016-05-26 03:21:49 -07:00
Duncan Laurie
11a0f18dd6 UPSTREAM: apollolake: Add handler for finding ACPI path for GPIO
Add a handler for soc/intel/apollolake to return the ACPI path for
GPIOs. There are 4 GPIO "communities" on apollolake that each have a
different ACPI device so return the appropriate name for the different
communities.

BUG=None
BRANCH=None
TEST=None

Change-Id: I596c178b7813ac6aaeb4f2685bb916f5b78e049b
Original-Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Original-Reviewed-on: https://review.coreboot.org/14859
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/346993
Commit-Ready: Martin Roth <martinroth@chromium.org>
Tested-by: Martin Roth <martinroth@chromium.org>
Reviewed-by: Martin Roth <martinroth@chromium.org>
2016-05-26 03:21:49 -07:00
Duncan Laurie
aeb50ed7d2 UPSTREAM: skylake: Add handler for finding ACPI path for GPIO
Add a handler for the Intel Skylake SOC to return the ACPI path for
GPIOs. Since all GPIOs are handled by the same controller they all
have the same ACPI path and this is a simple handler that just returns
a pointer to the GPIO device that is defined in the DSDT.

BUG=None
BRANCH=None
TEST=None

Change-Id: I24ff3a6f2479d9e7eeace65d49e2f6c2e070f3e9
Original-Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Original-Reviewed-on: https://review.coreboot.org/14843
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Original-Tested-by: build bot (Jenkins)
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/346992
Commit-Ready: Martin Roth <martinroth@chromium.org>
Tested-by: Martin Roth <martinroth@chromium.org>
Reviewed-by: Martin Roth <martinroth@chromium.org>
2016-05-26 03:21:48 -07:00
Duncan Laurie
c97c8904b7 UPSTREAM: gpio: Add a function to map GPIO to ACPI path
Add a new function "gpio_acpi_path()" that can be implemented by
SoC/board code to provide a mapping from a "gpio_t" pin to a
controller by returning the ACPI path for the controller that owns
this particular GPIO.

This is implemented separately from the "acpi_name" handler as many
SOCs do not have a specific device that handles GPIOs (or may have
many devices and the only way to know which is the opaque gpio_t)
and the current GPIO library does not have any association with the
device tree.

If not implemented (many SoCs do not implement the GPIO library
abstraction at all in coreboot) then the default handler will return
NULL and the caller knows it cannot determine this reliably.

BUG=None
BRANCH=None
TEST=None

Change-Id: Iaa0ff6c8c058f00cddf0909c4b7405a0660d4cfb
Original-Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Original-Reviewed-on: https://review.coreboot.org/14842
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Original-Tested-by: build bot (Jenkins)
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/346991
Commit-Ready: Martin Roth <martinroth@chromium.org>
Tested-by: Martin Roth <martinroth@chromium.org>
Reviewed-by: Martin Roth <martinroth@chromium.org>
2016-05-26 03:21:47 -07:00
Duncan Laurie
7e435c8dee UPSTREAM: skylake: Add ACPI device name handler
Add a global ACPI device name handler for the Skylake SOC that will
translate skylake device paths into an ACPI path that matches the
device objects delcared in the DSDT at soc/intel/skylake/acpi/*.

The skylake implementation uses a global acpi_name handler for the
SOC and it is not necessary to add a function to every device.

This function is used by device drivers calling acpi_device_name()
and acpi_device_path() to generate ACPI AML in the SSDT.

BUG=None
BRANCH=None
TEST=None

Change-Id: I31cecf7905a51224e7bfc40c6c4ad2487f039097
Original-Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Original-Reviewed-on: https://review.coreboot.org/14841
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Original-Tested-by: build bot (Jenkins)
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/346990
Commit-Ready: Martin Roth <martinroth@chromium.org>
Tested-by: Martin Roth <martinroth@chromium.org>
Reviewed-by: Martin Roth <martinroth@chromium.org>
2016-05-26 03:21:46 -07:00
Duncan Laurie
7163a1cdbf UPSTREAM: device: Add an ACPI device name and path concept to devices
Add a function to "struct device_operations" to return the ACPI name
for the device, and helper functions to find this name (either from
the device or its parent) and to build a fully qualified ACPI path
from the root device.

This addition will allow device drivers to generate their ACPI AML in
the SSDT at boot, with customization supplied by devicetree.cb,
instead of needing custom DSDT ASL for every mainboard.

The root device acpi_name is defined as "\_SB" and is used to start
the path when building a fully qualified name.

This requires SOC support to provide handlers for returning the ACPI
name for devices that it owns, and those names must match the objects
declared in the DSDT. The handler can be done either in each device
driver or with a global handler for the entire SOC.

Simplified example of how this can be used for an i2c device declared
in devicetree.cb with:

chip soc/intel/skylake # "_SB" (from root device)
device domain 0 on # "PCI0"
device pci 19.2 on # "I2C4"
chip drivers/i2c/test0
device i2c 1a.0 on end # "TST0"
end
end
end
end

And basic SSDT generating code in the device driver:

acpigen_write_scope(acpi_device_scope(dev));
acpigen_write_device(acpi_device_name(dev));
acpigen_write_string("_HID", "TEST0000");
acpigen_write_byte("_UID", 0);
acpigen_pop_len(); /bin /boot /cdrom /dev /etc /home /initrd.img /initrd.img.old /lib /lib32 /lib64 /libx32 /lost+found /media /mnt /opt /proc /root /run /sbin /srv /sys /tmp /usr /var /vmlinuz /vmlinuz.old device */
acpigen_pop_len(); /bin /boot /cdrom /dev /etc /home /initrd.img /initrd.img.old /lib /lib32 /lib64 /libx32 /lost+found /media /mnt /opt /proc /root /run /sbin /srv /sys /tmp /usr /var /vmlinuz /vmlinuz.old scope */

Will produce this ACPI code:

Scope (_SB.PCI0.I2C4) {
Device (TST0) {
Name (_HID, "TEST0000")
Name (_UID, 0)
}
}

BUG=None
BRANCH=None
TEST=None

Change-Id: Ie149595aeab96266fa5f006e7934339f0119ac54
Original-Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Original-Reviewed-on: https://review.coreboot.org/14840
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/346989
Commit-Ready: Martin Roth <martinroth@chromium.org>
Tested-by: Martin Roth <martinroth@chromium.org>
Reviewed-by: Martin Roth <martinroth@chromium.org>
2016-05-26 03:21:45 -07:00
Duncan Laurie
ec4f32ee9a UPSTREAM: acpigen: Add function to generate ToUUID() from a string
acpigen_write_uuid() will generate a ToUUID() 128-bit buffer object for a
common universally unique identifier that is passed as a string. The
resulting buffer is the UUID in byte format with a specific order of the
bytes as described in the ACPI specification:

ToUUID (uuid)

Compiles to:

Buffer (16) { uuid[3], uuid[2], uuid[1], uuid[0], uuid[5], uuid[4],
uuid[7], uuid[6], uuid[8], uuid[9], uuid[10], uuid[11],
uuid[12], uuid[13], uuid[14], uuid[15] }

BUG=None
BRANCH=None
TEST=None

Change-Id: Ibbeff926883532dd78477aaa2d26ffffb6ef30c0
Original-Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Original-Reviewed-on: https://review.coreboot.org/14838
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/346988
Commit-Ready: Martin Roth <martinroth@chromium.org>
Tested-by: Martin Roth <martinroth@chromium.org>
Reviewed-by: Martin Roth <martinroth@chromium.org>
2016-05-26 03:21:44 -07:00
Duncan Laurie
5f9d247b66 UPSTREAM: hexstrtobin: Add a library function to decode ASCII hex into binary
This function will turn a string of ASCII hex characters into an array
of bytes. It will ignore any non-ASCII-hex characters in the input
string and decode up to len bytes of data from it.

This can be used for turning MAC addresses or UUID strings into binary
for storage or further processing.

Sample usage:
uint8_t buf[6];
hexstrtobin("00:0e:c6:81:72:01", buf, sizeof(buf));
acpigen_emit_stream(buf, sizeof(buf));

BUG=None
BRANCH=None
TEST=None

Change-Id: I2de9bd28ae8c42cdca09eec11a3bba497a52988c
Original-Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Original-Reviewed-on: https://review.coreboot.org/14837
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/346987
Commit-Ready: Martin Roth <martinroth@chromium.org>
Tested-by: Martin Roth <martinroth@chromium.org>
Reviewed-by: Martin Roth <martinroth@chromium.org>
2016-05-26 03:21:43 -07:00
Timothy Pearson
be5b71df6f UPSTREAM: sio/winbond: Expose enter/exit configuration state functions
Certain mainboards, e.g. the ASUS KGPE-D16/KCMA-D8, require
board-specific configuration changes to the SuperIO. Expose
the functions needed to enter and exit configuration mode
on Winbond devices.

BUG=None
BRANCH=None
TEST=None

Change-Id: Ic86651872ecafcfe1398201be2b0768bbe460975
Original-Signed-off-by: Timothy Pearson <tpearson@raptorengineeringinc.com>
Original-Reviewed-on: https://review.coreboot.org/14891
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Martin Roth <martinroth@google.com>
Original-Tested-by: Raptor Engineering Automated Test Stand <noreply@raptorengineeringinc.com>
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/346986
Commit-Ready: Martin Roth <martinroth@chromium.org>
Tested-by: Martin Roth <martinroth@chromium.org>
Reviewed-by: Martin Roth <martinroth@chromium.org>
2016-05-26 03:21:42 -07:00