All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/40] RFC: rpi: Enable ACPI booting on ARM with Raspberry Pi 4
@ 2021-12-01 16:02 Simon Glass
  2021-12-01 16:02 ` [PATCH 01/40] Makefile: Allow LTO to be disabled for a build Simon Glass
                   ` (70 more replies)
  0 siblings, 71 replies; 95+ messages in thread
From: Simon Glass @ 2021-12-01 16:02 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Tom Rini, Heinrich Schuchardt, Bin Meng, Marek Behún,
	Simon Glass, Aiden Park, Albert Aribaud, Alexander Graf,
	Alexandru Gagniuc, Alistair Delva, Andy Shevchenko,
	Asherah Connor, Dario Binacchi, Harm Berntsen, Joel Stanley,
	Masahiro Yamada, Masahisa Kojima, Matthias Brugger, Michal Simek,
	Pali Rohár, Patrick Delaunay, Priyanka Jain,
	Rasmus Villemoes, Roger Pau Monne, Siew Chin Lim,
	Steffen Jaeckel, Stephen Warren, Stephen Warren, Tero Kristo,
	Wasim Khan, Ye Li

At present in U-Boot ACPI tables are only generated for x86 devices. It is
possible to build them for ARM as well. That is the subject of this
series.

The goal is to allow a rpi4 boot into Linux on ARM using ACPI rather than
devicetree. This is not due to any feeling that ACPI offers advantages to
the boot flow, merely because it can be done.

This goal is not yet achieved. Mostly all that is achieved is some
refactoring of the ACPI code, but that is enough to get things at least
building on ARM. The rpi-4 the tables are installed and the board boots
to grub, where it is then unable to find the OS on the USB stick that is
inserted. Further work is needed to complete things, but the ACPI changes
can be applied as is.

In terms of review, please ignore the RFC/WIP patches as they need to be
reworked. I am sending this series in this state to avoid sitting on
patches for too long and risking duplicate effort.

The following tables are emitted with this series:

   - GTDT - Generic Timer Description Table
   - APIC - Multiple Advanced Programmable Interrupt Controller
            Description Table (some new records for ARM)
   - DSDT - Differentiated System Description Table
   - DBG2 - Debug Port Table 2
   - FACP - Firmware ACPI Control Structure
   - CSRT - Core System Resource Table
   - PPTT - Processor Properties Topology Table

Missing still are:
   - SSDR - Secondary System Description Table
   - BGRT - Boot Graphics Resource Table

Future work is needed to:
- Finish the remaining two tables
- Get things booting nicely on rpi4
- Find a nice way to select between ACPI and devicetree at runtime
- Obtain the ACPI information from the devicetree instead of #defines
- Use the U-Boot bcm headers instead of importing new ones
- Drop the unused files
- Add some documentation

To test it, boot U-Boot on a rpi_4 with a suitable distribution.

This series is available at u-boot-dm/acpi-working


Simon Glass (40):
  Makefile: Allow LTO to be disabled for a build
  x86: Allow any arch to generate ACPI tables
  x86: Move the acpi table to generic global_data
  arm: Allow supporting ACPI-table generation
  x86: Tidy up use of CONFIG_ACPIGEN
  sandbox: Allow building with GENERATE_ACPI_TABLE
  efi: Correct call to write_acpi_tables()
  efi: Correct address handling with ACPI tables
  acpi: Use finer-grained control of ACPI-table generation
  acpi: Allow include files within the board directory
  acpi: Move acpi_fill_header() to the generic header
  acpi: Add a table start
  acpi: Add a linker list for ACPI tables
  x86: acpi: Split out context creation from base tables
  x86: Use the ACPI table writer
  x86: Move base tables to a writer function
  x86: Move FACS table to a writer function
  x86: Move DSDT table to a writer function
  x86: Move GNVS table to a writer function
  x86: Move FADT table to a writer function
  x86: Move FACP table into separate functions
  x86: Move SSDT table to a writer function
  x86: Move TPM2 table to a writer function
  x86: Move MADT table to a writer function
  x86: Move TCPA table to a writer function
  x86: Move CSRT table to a writer function
  x86: acpi: Update acpi_fill_csrt() to use acpi_ctx
  x86: Move device-specific ACPI tables to a writer function
  x86: Move acpi_get_rsdp_addr() ACPI tables to the writer
  acpi: Collect tables in the acpi_item list
  acpi: Tidy up the item list
  acpi: Tidy up the table list
  doc: Add usage information for the acpi command
  acpi: Add some tables needed by ARM devices
  acpi: Add myself as maintainer
  WIP: Add debugging for ACPI emission
  RFC: Allow passing ACPI tables to bootefi
  WIP: Add ASL files from tianocore
  WIP: Bring in some header files from tianocore
  RFC: rpi: Enable booting with ACPI tables

 MAINTAINERS                                   |   6 +
 Makefile                                      |  18 +-
 arch/Kconfig                                  |   6 +-
 arch/arm/config.mk                            |   4 +-
 arch/arm/include/asm/acpi_table.h             |  15 +
 arch/arm/include/asm/global_data.h            |   2 +-
 .../mach-bcm283x/include/mach/acpi/bcm2711.h  |  93 +++
 .../mach-bcm283x/include/mach/acpi/bcm2836.h  | 124 +++
 .../include/mach/acpi/bcm2836_gpio.h          |  85 ++
 .../include/mach/acpi/bcm2836_gpu.h           |  48 ++
 .../include/mach/acpi/bcm2836_pwm.h           |  34 +
 .../include/mach/acpi/bcm2836_sdhost.h        |  90 ++
 .../include/mach/acpi/bcm2836_sdio.h          | 203 +++++
 arch/sandbox/include/asm/acpi_table.h         |   2 +
 arch/sandbox/include/asm/global_data.h        |   1 -
 arch/sandbox/include/asm/tables.h             |   0
 arch/x86/Kconfig                              |   9 -
 arch/x86/cpu/apollolake/acpi.c                |  17 +-
 arch/x86/cpu/baytrail/acpi.c                  |  27 +-
 arch/x86/cpu/quark/acpi.c                     |  27 +-
 arch/x86/cpu/tangier/acpi.c                   |  34 +-
 arch/x86/include/asm/acpi_table.h             |   4 -
 arch/x86/include/asm/global_data.h            |   1 -
 arch/x86/lib/Makefile                         |   2 +-
 arch/x86/lib/acpi_table.c                     | 374 +++------
 board/raspberrypi/rpi/Makefile                |   2 +
 board/raspberrypi/rpi/acpitables.h            | 189 +++++
 board/raspberrypi/rpi/acpitables.inf          |  79 ++
 board/raspberrypi/rpi/csrt.aslc               | 330 ++++++++
 board/raspberrypi/rpi/dbg2miniuart.aslc       |  81 ++
 board/raspberrypi/rpi/dbg2pl011.aslc          |  81 ++
 board/raspberrypi/rpi/dsdt.asl                | 285 +++++++
 board/raspberrypi/rpi/emmc.asl                | 166 ++++
 board/raspberrypi/rpi/fadt.aslc               |  96 +++
 board/raspberrypi/rpi/gpudevs.asl             | 397 +++++++++
 board/raspberrypi/rpi/gtdt.aslc               |  55 ++
 board/raspberrypi/rpi/iort.aslc               | 100 +++
 board/raspberrypi/rpi/madt.aslc               |  78 ++
 board/raspberrypi/rpi/pci.asl                 | 168 ++++
 board/raspberrypi/rpi/pep.asl                 |  90 ++
 board/raspberrypi/rpi/pep.c                   |  79 ++
 board/raspberrypi/rpi/pep.h                   | 121 +++
 board/raspberrypi/rpi/pptt.aslc               | 191 +++++
 board/raspberrypi/rpi/rhpx.asl                | 195 +++++
 board/raspberrypi/rpi/rpi.c                   | 460 +++++++++-
 board/raspberrypi/rpi/rpi4.dsc                | 790 ++++++++++++++++++
 board/raspberrypi/rpi/sdhc.asl                | 119 +++
 board/raspberrypi/rpi/spcrminiuart.aslc       |  91 ++
 board/raspberrypi/rpi/spcrpl011.aslc          |  91 ++
 board/raspberrypi/rpi/ssdtthermal.asl         |  77 ++
 board/raspberrypi/rpi/uart.asl                | 202 +++++
 board/raspberrypi/rpi/xhci.asl                | 165 ++++
 cmd/acpi.c                                    |  13 +-
 cmd/bootefi.c                                 |  44 +-
 configs/cherryhill_defconfig                  |   1 +
 configs/chromebook_link64_defconfig           |   1 +
 configs/chromebook_link_defconfig             |   1 +
 configs/chromebook_samus_tpl_defconfig        |   1 +
 configs/coreboot64_defconfig                  |   1 +
 configs/coreboot_defconfig                    |   1 +
 configs/crownbay_defconfig                    |   1 +
 configs/efi-x86_payload32_defconfig           |   1 +
 configs/efi-x86_payload64_defconfig           |   1 +
 configs/rpi_4_defconfig                       |   2 +
 configs/slimbootloader_defconfig              |   1 +
 configs/tools-only_defconfig                  |   1 +
 doc/build/gcc.rst                             |  17 +
 doc/usage/acpi.rst                            | 235 ++++++
 doc/usage/index.rst                           |   1 +
 drivers/core/acpi.c                           |  70 +-
 drivers/misc/qfw.c                            |   3 +-
 include/acpi/acpi_table.h                     | 235 +++++-
 include/asm-generic/global_data.h             |   8 +
 include/dm/acpi.h                             | 110 +++
 lib/Kconfig                                   |  18 +
 lib/Makefile                                  |   2 +-
 lib/acpi/Makefile                             |  23 +-
 lib/acpi/acpi_table.c                         |  82 --
 lib/acpi/acpi_writer.c                        | 132 +++
 lib/acpi/base.c                               |  94 +++
 lib/acpi/csrt.c                               |  49 ++
 lib/acpi/dsdt.c                               |  55 ++
 lib/acpi/facs.c                               |  35 +
 lib/acpi/ssdt.c                               |  49 ++
 lib/efi_loader/Makefile                       |   2 -
 lib/efi_loader/efi_acpi.c                     |   5 +-
 scripts/Makefile.lib                          |   3 +-
 test/dm/acpi.c                                |  79 +-
 88 files changed, 6875 insertions(+), 506 deletions(-)
 create mode 100644 arch/arm/mach-bcm283x/include/mach/acpi/bcm2711.h
 create mode 100644 arch/arm/mach-bcm283x/include/mach/acpi/bcm2836.h
 create mode 100644 arch/arm/mach-bcm283x/include/mach/acpi/bcm2836_gpio.h
 create mode 100644 arch/arm/mach-bcm283x/include/mach/acpi/bcm2836_gpu.h
 create mode 100644 arch/arm/mach-bcm283x/include/mach/acpi/bcm2836_pwm.h
 create mode 100644 arch/arm/mach-bcm283x/include/mach/acpi/bcm2836_sdhost.h
 create mode 100644 arch/arm/mach-bcm283x/include/mach/acpi/bcm2836_sdio.h
 create mode 100644 arch/sandbox/include/asm/tables.h
 create mode 100644 board/raspberrypi/rpi/acpitables.h
 create mode 100644 board/raspberrypi/rpi/acpitables.inf
 create mode 100644 board/raspberrypi/rpi/csrt.aslc
 create mode 100644 board/raspberrypi/rpi/dbg2miniuart.aslc
 create mode 100644 board/raspberrypi/rpi/dbg2pl011.aslc
 create mode 100644 board/raspberrypi/rpi/dsdt.asl
 create mode 100644 board/raspberrypi/rpi/emmc.asl
 create mode 100644 board/raspberrypi/rpi/fadt.aslc
 create mode 100644 board/raspberrypi/rpi/gpudevs.asl
 create mode 100644 board/raspberrypi/rpi/gtdt.aslc
 create mode 100644 board/raspberrypi/rpi/iort.aslc
 create mode 100644 board/raspberrypi/rpi/madt.aslc
 create mode 100644 board/raspberrypi/rpi/pci.asl
 create mode 100644 board/raspberrypi/rpi/pep.asl
 create mode 100644 board/raspberrypi/rpi/pep.c
 create mode 100644 board/raspberrypi/rpi/pep.h
 create mode 100644 board/raspberrypi/rpi/pptt.aslc
 create mode 100644 board/raspberrypi/rpi/rhpx.asl
 create mode 100644 board/raspberrypi/rpi/rpi4.dsc
 create mode 100644 board/raspberrypi/rpi/sdhc.asl
 create mode 100644 board/raspberrypi/rpi/spcrminiuart.aslc
 create mode 100644 board/raspberrypi/rpi/spcrpl011.aslc
 create mode 100644 board/raspberrypi/rpi/ssdtthermal.asl
 create mode 100644 board/raspberrypi/rpi/uart.asl
 create mode 100644 board/raspberrypi/rpi/xhci.asl
 create mode 100644 doc/usage/acpi.rst
 create mode 100644 lib/acpi/acpi_writer.c
 create mode 100644 lib/acpi/base.c
 create mode 100644 lib/acpi/csrt.c
 create mode 100644 lib/acpi/dsdt.c
 create mode 100644 lib/acpi/facs.c
 create mode 100644 lib/acpi/ssdt.c

-- 
2.34.0.rc2.393.gf8c9666880-goog


^ permalink raw reply	[flat|nested] 95+ messages in thread

end of thread, other threads:[~2022-01-23 21:58 UTC | newest]

Thread overview: 95+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-01 16:02 [PATCH 00/40] RFC: rpi: Enable ACPI booting on ARM with Raspberry Pi 4 Simon Glass
2021-12-01 16:02 ` [PATCH 01/40] Makefile: Allow LTO to be disabled for a build Simon Glass
2021-12-01 16:02 ` [PATCH 02/40] x86: Allow any arch to generate ACPI tables Simon Glass
2021-12-01 16:02 ` [PATCH 03/40] x86: Move the acpi table to generic global_data Simon Glass
2021-12-01 16:02 ` [PATCH 04/40] arm: Allow supporting ACPI-table generation Simon Glass
2021-12-01 16:49   ` Mark Kettenis
2021-12-01 17:10     ` Tom Rini
2021-12-01 17:45       ` François Ozog
2021-12-01 18:02         ` Simon Glass
2022-01-23 21:54         ` Simon Glass
2021-12-01 16:02 ` [PATCH 05/40] x86: Tidy up use of CONFIG_ACPIGEN Simon Glass
2021-12-01 16:02 ` [PATCH 06/40] sandbox: Allow building with GENERATE_ACPI_TABLE Simon Glass
2021-12-01 18:14   ` Heinrich Schuchardt
2021-12-01 19:32     ` Simon Glass
2022-01-23 21:54     ` Simon Glass
2021-12-01 16:02 ` [PATCH 07/40] efi: Correct call to write_acpi_tables() Simon Glass
2021-12-01 17:59   ` Heinrich Schuchardt
2021-12-01 19:32     ` Simon Glass
2021-12-01 19:57       ` Heinrich Schuchardt
2021-12-01 21:12         ` Simon Glass
2021-12-02  5:00           ` Heinrich Schuchardt
2021-12-02 13:42             ` Simon Glass
2022-01-23 21:54             ` Simon Glass
2021-12-01 16:02 ` [PATCH 08/40] efi: Correct address handling with ACPI tables Simon Glass
2021-12-01 18:12   ` Heinrich Schuchardt
2021-12-01 19:32     ` Simon Glass
2022-01-23 21:53     ` Simon Glass
2021-12-01 16:02 ` [PATCH 09/40] acpi: Use finer-grained control of ACPI-table generation Simon Glass
2021-12-01 16:02 ` [PATCH 10/40] acpi: Allow include files within the board directory Simon Glass
2021-12-01 16:02 ` [PATCH 11/40] acpi: Move acpi_fill_header() to the generic header Simon Glass
2021-12-01 16:02 ` [PATCH 12/40] acpi: Add a table start Simon Glass
2021-12-01 16:02 ` [PATCH 13/40] acpi: Add a linker list for ACPI tables Simon Glass
2021-12-01 16:02 ` [PATCH 14/40] x86: acpi: Split out context creation from base tables Simon Glass
2021-12-01 16:02 ` [PATCH 15/40] x86: Use the ACPI table writer Simon Glass
2021-12-01 16:02 ` [PATCH 16/40] x86: Move base tables to a writer function Simon Glass
2021-12-01 16:02 ` [PATCH 17/40] x86: Move FACS table " Simon Glass
2021-12-01 16:02 ` [PATCH 18/40] x86: Move DSDT " Simon Glass
2021-12-01 16:02 ` [PATCH 19/40] x86: Move GNVS " Simon Glass
2021-12-01 16:02 ` [PATCH 20/40] x86: Move FADT " Simon Glass
2021-12-01 16:02 ` [PATCH 21/40] x86: Move FACP table into separate functions Simon Glass
2021-12-01 16:02 ` [PATCH 22/40] x86: Move SSDT table to a writer function Simon Glass
2021-12-01 16:02 ` [PATCH 23/40] x86: Move TPM2 " Simon Glass
2021-12-01 16:02 ` [PATCH 24/40] x86: Move MADT " Simon Glass
2021-12-01 16:02 ` [PATCH 25/40] x86: Move TCPA " Simon Glass
2021-12-01 16:03 ` [PATCH 26/40] x86: Move CSRT " Simon Glass
2021-12-01 16:03 ` [PATCH 27/40] x86: acpi: Update acpi_fill_csrt() to use acpi_ctx Simon Glass
2021-12-01 16:03 ` [PATCH 28/40] x86: Move device-specific ACPI tables to a writer function Simon Glass
2021-12-01 16:03 ` [PATCH 29/40] x86: Move acpi_get_rsdp_addr() ACPI tables to the writer Simon Glass
2021-12-01 16:03 ` [PATCH 30/40] acpi: Collect tables in the acpi_item list Simon Glass
2021-12-01 16:03 ` [PATCH 31/40] acpi: Tidy up the item list Simon Glass
2021-12-01 16:03 ` [PATCH 32/40] acpi: Tidy up the table list Simon Glass
2021-12-01 16:03 ` [PATCH 33/40] doc: Add usage information for the acpi command Simon Glass
2021-12-01 16:03 ` [PATCH 34/40] acpi: Add some tables needed by ARM devices Simon Glass
2021-12-01 16:03 ` [PATCH 35/40] acpi: Add myself as maintainer Simon Glass
2021-12-01 16:03 ` [PATCH 36/40] WIP: Add debugging for ACPI emission Simon Glass
2021-12-01 16:03 ` [PATCH 37/40] RFC: Allow passing ACPI tables to bootefi Simon Glass
2021-12-01 16:03 ` [PATCH 38/40] WIP: Add ASL files from tianocore Simon Glass
2021-12-01 16:03 ` [PATCH 39/40] WIP: Bring in some header " Simon Glass
2021-12-01 16:03 ` [PATCH 40/40] RFC: rpi: Enable booting with ACPI tables Simon Glass
2021-12-01 16:24   ` Andy Shevchenko
2021-12-01 19:30     ` Simon Glass
2021-12-01 17:09 ` [PATCH 00/40] RFC: rpi: Enable ACPI booting on ARM with Raspberry Pi 4 Andy Shevchenko
2021-12-01 17:50   ` François Ozog
2021-12-01 18:23     ` Tom Rini
2021-12-15  3:28 ` Simon Glass
2022-01-22 22:48   ` Simon Glass
2022-01-23 21:53 ` [PATCH 35/40] acpi: Add myself as maintainer Simon Glass
2022-01-23 21:53 ` [PATCH 33/40] doc: Add usage information for the acpi command Simon Glass
2022-01-23 21:53 ` [PATCH 34/40] acpi: Add some tables needed by ARM devices Simon Glass
2022-01-23 21:53 ` [PATCH 32/40] acpi: Tidy up the table list Simon Glass
2022-01-23 21:53 ` [PATCH 31/40] acpi: Tidy up the item list Simon Glass
2022-01-23 21:53 ` [PATCH 29/40] x86: Move acpi_get_rsdp_addr() ACPI tables to the writer Simon Glass
2022-01-23 21:53 ` [PATCH 30/40] acpi: Collect tables in the acpi_item list Simon Glass
2022-01-23 21:53 ` [PATCH 28/40] x86: Move device-specific ACPI tables to a writer function Simon Glass
2022-01-23 21:53 ` [PATCH 27/40] x86: acpi: Update acpi_fill_csrt() to use acpi_ctx Simon Glass
2022-01-23 21:53 ` [PATCH 26/40] x86: Move CSRT table to a writer function Simon Glass
2022-01-23 21:53 ` [PATCH 24/40] x86: Move MADT " Simon Glass
2022-01-23 21:53 ` [PATCH 25/40] x86: Move TCPA " Simon Glass
2022-01-23 21:53 ` [PATCH 22/40] x86: Move SSDT " Simon Glass
2022-01-23 21:53 ` [PATCH 23/40] x86: Move TPM2 " Simon Glass
2022-01-23 21:53 ` [PATCH 21/40] x86: Move FACP table into separate functions Simon Glass
2022-01-23 21:53 ` [PATCH 20/40] x86: Move FADT table to a writer function Simon Glass
2022-01-23 21:53 ` [PATCH 19/40] x86: Move GNVS " Simon Glass
2022-01-23 21:53 ` [PATCH 17/40] x86: Move FACS " Simon Glass
2022-01-23 21:53 ` [PATCH 18/40] x86: Move DSDT " Simon Glass
2022-01-23 21:53 ` [PATCH 16/40] x86: Move base tables " Simon Glass
2022-01-23 21:53 ` [PATCH 15/40] x86: Use the ACPI table writer Simon Glass
2022-01-23 21:53 ` [PATCH 13/40] acpi: Add a linker list for ACPI tables Simon Glass
2022-01-23 21:53 ` [PATCH 14/40] x86: acpi: Split out context creation from base tables Simon Glass
2022-01-23 21:53 ` [PATCH 12/40] acpi: Add a table start Simon Glass
2022-01-23 21:53 ` [PATCH 10/40] acpi: Allow include files within the board directory Simon Glass
2022-01-23 21:53 ` [PATCH 11/40] acpi: Move acpi_fill_header() to the generic header Simon Glass
2022-01-23 21:54 ` [PATCH 05/40] x86: Tidy up use of CONFIG_ACPIGEN Simon Glass
2022-01-23 21:54 ` [PATCH 02/40] x86: Allow any arch to generate ACPI tables Simon Glass
2022-01-23 21:54 ` [PATCH 03/40] x86: Move the acpi table to generic global_data Simon Glass

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.