From patchwork Wed Jul 8 03:32:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 240962 List-Id: U-Boot discussion From: sjg at chromium.org (Simon Glass) Date: Tue, 7 Jul 2020 21:32:01 -0600 Subject: [PATCH v2 00/44] x86: Programmatic generation of ACPI tables (Part C) Message-ID: <20200708033246.2626378-1-sjg@chromium.org> This series is split off from the original ACPI series and renumbered to version 1. It includes functions for generating more ACPI constructs as well as I2C, GPIO and sound support. There are also quite a few patches related to getting coral to work correctly with ACPI. Changes in v2: - Rename binman_entry_find_() - Fix 'Gailed' typo - Rename parameter from 'name' to 'scope' - Add a comment pointing to the PCI spec - Move this patch before the audio-codec drivers - Use BIT() for the SPEAKER enum Add a comment about only x86 boards supporting NHLT Add a comment about only x86 boards supporting NHLT - Fix comment for intel_pinctrl_get_config_reg_addr() - Add help for CONFIG_INTEL_PINCTRL_MULTI_ACPI_DEVICES - Fix the commit subject to mention dropping acpi_path, not acpi_name - Add a few blank lines - Drop dead code behind if (0) - Move .ops change from the next patch - Add mention of why log_msg_ret() is dropped - Add a new commit to handle the boot_mode fix - Split out the boot_mode change into a separate patch - Remove the function from zimage.c also - Use ACPI_MADT_REV_ACPI_3_0 instead of the open-coded value - Don't enable this for qemu Changes in v1: - Add a way to set the binman ROM offset - Add linux/err.h header - Capitalise ACPI_OPS_PTR - Add a new patch to support building up an NHLT structure - Use acpi,ddn instead of acpi,desc - Add a check for invalid node - Add NHLT support - Capitalise ACPI_OPS_PTR - Rebase to master - Use acpi,ddn instead of acpi,desc - Drop the unwanted acpi_device_write_gpio_desc() - Rename max97357a to max98357a - Add NHLT support - Capitalise ACPI_OPS_PTR - Rebase to master - Add new patch to add error checking for csrt table generation - Use acpi_get_path() to get device path - Add new patch to improve designware_i2c debugging - Capitalise ACPI_OPS_PTR Simon Glass (44): binman: Allow setting the ROM offset binman: Refactor binman_entry_find() to allow other nodes binman: Add way to locate an entry in memory acpi: Allow creating the GNVS to fail dtoc: Support ACPI paths in of-platdata dm: core: Add a way of overriding the ACPI device path dm: acpi: Add support for the NHLT table acpi: Export functions to write sized values acpi: Support generation of a scope acpi: Support generation of a generic register acpi: mmc: Generate ACPI info for the PCI SD Card x86: Add bindings for NHLT acpi: Support generation of a device acpi: Support writing named values x86: Add support for building up an NHLT structure sound: Add an ACPI driver for Dialog Semicondutor da7219 sound: Add an ACPI driver for Maxim MAX98357ac x86: pinctrl: Add a way to get the pinctrl reg address x86: pinctrl: Update comment for intel_pinctrl_get_pad() x86: pinctrl: Add multi-ACPI control x86: pinctrl: Set up itss in the probe() method x86: pinctrl: Drop the acpi_path member x86: Add error checking for csrt table generation x86: apl: Use memory-mapped access for VBT x86: gpio: Add support for obtaining ACPI info for a GPIO i2c: designware_i2c: Add a little more debugging i2c: Add log_ret() on error i2c: designware_i2c: Support ACPI table generation p2sb: Add a method to hide the bus x86: apl: Support set_hide() in p2sb driver x86: apl: Hide the p2sb on exit from U-Boot pmc: Move common registers to the header file x86: irq: Support flags for acpi_gpe x86: apl: Fix save/restore of ITSS priorities x86: Add debugging to table writing x86: apl: Set the correct boot mode in the FSP-M code x86: apl: Adjust FSP-M code to avoid hard-coded address x86: Store the coreboot table address in global_data x86: mp: Allow use of mp_run_on_cpus() without MP x86: Update the comment about booting for FSP2 x86: Drop setup_pcat_compatibility() x86: acpi: Correct the version of the MADT x86: Rename board_final_cleanup() to board_final_init() acpi: Enable ACPI table generation by default on x86 arch/Kconfig | 1 + arch/x86/cpu/acpi_gpe.c | 26 + arch/x86/cpu/apollolake/fsp_m.c | 6 +- arch/x86/cpu/apollolake/fsp_s.c | 56 +- arch/x86/cpu/baytrail/acpi.c | 4 +- arch/x86/cpu/coreboot/coreboot.c | 4 +- arch/x86/cpu/coreboot/tables.c | 8 +- arch/x86/cpu/cpu.c | 21 +- arch/x86/cpu/efi/app.c | 2 +- arch/x86/cpu/i386/cpu.c | 7 +- arch/x86/cpu/intel_common/itss.c | 25 +- arch/x86/cpu/intel_common/p2sb.c | 44 ++ arch/x86/cpu/mp_init.c | 12 +- arch/x86/cpu/quark/acpi.c | 4 +- arch/x86/cpu/quark/quark.c | 2 +- arch/x86/cpu/start.S | 1 + arch/x86/cpu/tangier/acpi.c | 4 +- arch/x86/include/asm/acpi_nhlt.h | 314 ++++++++++++ arch/x86/include/asm/acpi_table.h | 10 +- arch/x86/include/asm/global_data.h | 2 + arch/x86/include/asm/intel_pinctrl.h | 19 +- arch/x86/include/asm/itss.h | 2 +- arch/x86/include/asm/u-boot-x86.h | 2 - arch/x86/lib/Makefile | 1 + arch/x86/lib/acpi_nhlt.c | 482 ++++++++++++++++++ arch/x86/lib/acpi_table.c | 32 +- arch/x86/lib/fsp/fsp_common.c | 2 +- arch/x86/lib/fsp2/fsp_silicon_init.c | 1 + arch/x86/lib/tables.c | 38 +- arch/x86/lib/zimage.c | 10 - configs/sandbox_defconfig | 4 + doc/device-tree-bindings/device.txt | 23 + doc/device-tree-bindings/sound/da7219.txt | 113 ++++ doc/device-tree-bindings/sound/max98357a.txt | 22 + drivers/core/Kconfig | 2 +- drivers/core/acpi.c | 34 ++ drivers/gpio/intel_gpio.c | 49 +- drivers/i2c/designware_i2c.c | 36 +- drivers/i2c/designware_i2c.h | 15 + drivers/i2c/designware_i2c_pci.c | 96 +++- drivers/i2c/i2c-uclass.c | 4 +- drivers/misc/irq-uclass.c | 2 +- drivers/misc/p2sb-uclass.c | 26 +- drivers/mmc/pci_mmc.c | 78 ++- drivers/pinctrl/intel/Kconfig | 12 + drivers/pinctrl/intel/pinctrl.c | 21 +- drivers/pinctrl/intel/pinctrl_apl.c | 4 - drivers/power/acpi_pmc/acpi-pmc-uclass.c | 9 - drivers/sound/Kconfig | 18 + drivers/sound/Makefile | 2 + drivers/sound/da7219.c | 190 +++++++ drivers/sound/max98357a.c | 161 ++++++ include/acpi/acpi_device.h | 1 + include/acpi/acpigen.h | 164 ++++++ include/binman.h | 30 ++ include/dm/acpi.h | 39 ++ .../interrupt-controller/x86-irq.h | 14 + include/dt-bindings/sound/nhlt.h | 24 + include/p2sb.h | 34 +- include/power/acpi_pmc.h | 14 + lib/acpi/acpigen.c | 134 +++++ lib/binman.c | 59 ++- test/dm/acpi.c | 3 +- test/dm/acpigen.c | 226 +++++++- tools/dtoc/dtb_platdata.py | 4 +- tools/dtoc/dtoc_test_simple.dts | 1 + tools/dtoc/test_dtoc.py | 3 + 67 files changed, 2666 insertions(+), 147 deletions(-) create mode 100644 arch/x86/include/asm/acpi_nhlt.h create mode 100644 arch/x86/lib/acpi_nhlt.c create mode 100644 doc/device-tree-bindings/sound/da7219.txt create mode 100644 doc/device-tree-bindings/sound/max98357a.txt create mode 100644 drivers/sound/da7219.c create mode 100644 drivers/sound/max98357a.c create mode 100644 include/dt-bindings/interrupt-controller/x86-irq.h create mode 100644 include/dt-bindings/sound/nhlt.h