coreboot-kgpe-d16/src/arch/x86
Duncan Laurie 70c86d9b26 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>
2016-05-28 03:48:06 +02:00
..
acpi tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
include acpi_device: Add support for writing ACPI SPI descriptors 2016-05-28 03:48:06 +02:00
acpi.c src/arch/x86/acpi.c: Use correct host address width in DMAR ACPI table 2016-03-18 19:15:25 +01:00
acpi_device.c acpi_device: Add support for writing ACPI SPI descriptors 2016-05-28 03:48:06 +02:00
acpigen.c acpigen: Add function to generate ToUUID() from a string 2016-05-21 05:59:01 +02:00
assembly_entry.S arch/x86/assembly_entry: allow early post CAR stages to use common code 2016-05-02 20:06:23 +02:00
boot.c die() when attempting to use bounce buffer on non-i386. 2016-02-22 18:38:48 +01:00
bootblock.ld tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
bootblock_crt0.S bootblock_crt0: Use CR* macros from cpu/x86/cr.h 2016-04-15 01:31:16 +02:00
bootblock_normal.c arch/x86/include: Rename bootblock_common to bootblock_romcc.h 2016-01-21 05:37:19 +01:00
bootblock_romcc.S arch/x86: Rename bootblock.S to bootblock_romcc.S 2016-01-30 03:11:12 +01:00
bootblock_simple.c arch/x86/include: Rename bootblock_common to bootblock_romcc.h 2016-01-21 05:37:19 +01:00
c_start.S arch/x86: move SetCodeSelector to .text segment 2016-01-26 04:40:44 +01:00
car.ld arch/x86: document CAR symbols and expose them in symbols.h 2016-03-05 16:00:42 +01:00
cbfs_and_run.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
cbmem.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
cpu.c x86: add coreboot table entry for TSC info 2016-02-19 19:50:10 +01:00
cpu_common.c arch/x86: add missing license headers 2016-01-14 23:37:06 +01:00
crt0_romcc_epilogue.inc src/arch: Update license headers missing paragraph 2 2016-01-26 04:44:20 +01:00
ebda.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
exception.c arch/x86: add missing license headers 2016-01-14 23:37:06 +01:00
exit_car.S arch/x86: introduce postcar stage/phase 2016-03-23 14:24:30 +01:00
failover.ld arch/x86: rename reset_vector -> _start 2016-03-04 01:16:05 +01:00
gdt.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
id.ld arch/x86: add missing license headers 2016-01-14 23:37:06 +01:00
id.S arch/x86: add missing license headers 2016-01-14 23:37:06 +01:00
ioapic.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
Kconfig arch/x86: introduce postcar stage/phase 2016-03-23 14:24:30 +01:00
Makefile.inc arch/x86: provide verstage support for CONFIG_C_ENVIRONMENT_BOOTBLOCK 2016-05-27 19:53:16 +02:00
memcpy.c arch/x86: add missing license headers 2016-01-14 23:37:06 +01:00
memlayout.ld arch/x86: introduce postcar stage/phase 2016-03-23 14:24:30 +01:00
memmove.c arch/x86: add missing license headers 2016-01-14 23:37:06 +01:00
memset.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
mmap_boot.c Revert "x86: Align CBFS on top of ROM" 2016-01-06 17:44:54 +01:00
mpspec.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
pci_ops_conf1.c arch/x86: Drop arch/pciconf.h 2016-01-26 20:22:44 +01:00
pci_ops_mmconf.c arch/x86: Drop arch/pciconf.h 2016-01-26 20:22:44 +01:00
pirq_routing.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
postcar_loader.c lib/prog_loading: introduce prog_segment_loaded() 2016-04-02 03:56:37 +02:00
prologue.inc tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
romcc_console.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
smbios.c smbios: Add SuperTalent SPD ID 2016-05-09 20:43:50 +02:00
stages.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
tables.c lib: add common write_tables() implementation 2016-04-21 20:49:05 +02:00
thread.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
thread_switch.S tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
timestamp.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
verstage.c arch/x86: provide verstage support for CONFIG_C_ENVIRONMENT_BOOTBLOCK 2016-05-27 19:53:16 +02:00
wakeup.S arch/x86: remove .intel_syntax 2016-01-23 17:01:44 +01:00
walkcbfs.S arch/x86: add missing license headers 2016-01-14 23:37:06 +01:00