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: 1324885 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=cWKCShOF; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4B1lLm3nXTz9s1x for ; Wed, 8 Jul 2020 13:35:28 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B3A7D8223B; Wed, 8 Jul 2020 05:33:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="cWKCShOF"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5E58E8223C; Wed, 8 Jul 2020 05:33:44 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x144.google.com (mail-il1-x144.google.com [IPv6:2607:f8b0:4864:20::144]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E45AF8223B for ; Wed, 8 Jul 2020 05:33:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x144.google.com with SMTP id e18so27162740ilr.7 for ; Tue, 07 Jul 2020 20:33:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=HojU+YpDj47OR9OTvVK3KMwbGPPwlRGG/8mE1cR2wOQ=; b=cWKCShOFTXsEKD3wXBRJIvjOW4kMlb8aeIeJvwVojWCQEmIB0zyqes4vzMtvSY1qi/ ECW/JRf5saewI2h+wPBO2yUDyvoDX/ZSVwNzijyaYY4Px4r9fxdfuXglb9ZutGPE46T1 q13ANe5BGxB08mHm687Wz/9c1cLomT2/kx2BA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=HojU+YpDj47OR9OTvVK3KMwbGPPwlRGG/8mE1cR2wOQ=; b=MioDKzegpPzm8Wegnc/rvWwiNb7SS9Jj+NURm0E7uMMLZPThnQJGVcP8C2MUEg7hq3 +efp7IMLmsjbQyR1Rnx4jLg8DV5D3eVPYLT4b5ohZ4t+Hmb8BmxBn7kf6eRfzKaqp2rd YNsuyOyuOBNw9vxYbXrf43aBYIieAd/szWpG0IZsZkwnM7rvV43nlnQchdUEerJQEhMv BWCP9tBsac9gt5jZC4DfgPFi+cqdwUtiM5BBjgrU47hMY3UWxlasnOP1zBX+5oP/w+Ni 0MQCIVIIma3KczMFXjWSXKOJu687a3zOhh2j8dlpmc3mg5kng3jsG2bmthHxdva0qSQt OvAw== X-Gm-Message-State: AOAM533QlEgZr6s5Gjikr/Rw3OAsG5sZD0ohCBfZdsmksjumWy8krTAU H9fOeXc+YRPw1CYA803FCK/4kcEg9Nm4Dg== X-Google-Smtp-Source: ABdhPJwdREYqgEk3/q8lThJzYeg+n+Q0PIH5ece1EsxuzeYisD97ayGmInPI595P+zn0+r+oXwPzMw== X-Received: by 2002:a92:2010:: with SMTP id j16mr11026090ile.200.1594179219479; Tue, 07 Jul 2020 20:33:39 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id k1sm13970230ilr.35.2020.07.07.20.33.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jul 2020 20:33:39 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Bin Meng , Wolfgang Wallner , Simon Glass , Heiko Schocher , Marek Vasut , Pavel Herrmann , Peng Fan Subject: [PATCH v2 00/44] x86: Programmatic generation of ACPI tables (Part C) Date: Tue, 7 Jul 2020 21:32:01 -0600 Message-Id: <20200708033246.2626378-1-sjg@chromium.org> X-Mailer: git-send-email 2.27.0.383.g050319c2ae-goog MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean 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