[PATCH v2 19/35] acpi: Support writing Device Properties objects via _DSD

Wolfgang Wallner wolfgang.wallner at br-automation.com
Thu May 28 15:36:37 CEST 2020


Hi Simon,

-----"Simon Glass" <sjg at chromium.org> schrieb: -----
> Betreff: [PATCH v2 19/35] acpi: Support writing Device Properties objects via _DSD
> 
> More complex device properties can be provided to drivers via a
> device-specific data (_DSD) object.
> 
> To create this we need to build it up in a separate data structure and
> then generate the ACPI code, due to its recursive nature.
> 
> Add an implementation of this.
> 
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
> 
> Changes in v2: None
> Changes in v1: None
> 
>  include/acpi/acpi_dp.h | 215 ++++++++++++++++++++++
>  include/acpi/acpigen.h |   1 +
>  lib/acpi/Makefile      |   1 +
>  lib/acpi/acpi_dp.c     | 324 +++++++++++++++++++++++++++++++++
>  lib/acpi/acpigen.c     |   3 +
>  test/dm/Makefile       |   1 +
>  test/dm/acpi_dp.c      | 405 +++++++++++++++++++++++++++++++++++++++++
>  7 files changed, 950 insertions(+)
>  create mode 100644 include/acpi/acpi_dp.h
>  create mode 100644 lib/acpi/acpi_dp.c
>  create mode 100644 test/dm/acpi_dp.c
> 

[snip]

> diff --git a/lib/acpi/acpi_dp.c b/lib/acpi/acpi_dp.c
> new file mode 100644
> index 0000000000..479cb6743c
> --- /dev/null
> +++ b/lib/acpi/acpi_dp.c
> @@ -0,0 +1,324 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Generation of tables for particular device types
> + *
> + * Copyright 2019 Google LLC
> + * Mostly taken from coreboot file acpi_device.v

Typo: acpi_device.c

> + */
> +
> +#include <common.h>
> +#include <dm.h>
> +#include <log.h>
> +#include <malloc.h>
> +#include <uuid.h>
> +#include <acpi/acpigen.h>
> +#include <acpi/acpi_dp.h>
> +#include <dm/acpi.h>
> +
> +static void acpi_dp_write_array(struct acpi_ctx *ctx,
> +				const struct acpi_dp *array);
> +

[snip]

> diff --git a/lib/acpi/acpigen.c b/lib/acpi/acpigen.c
> index f781ad4d87..7321a98c0f 100644
> --- a/lib/acpi/acpigen.c
> +++ b/lib/acpi/acpigen.c
> @@ -15,6 +15,9 @@
>  #include <acpi/acpigen.h>
>  #include <dm/acpi.h>
>  
> +/* CPU path format */
> +#define ACPI_CPU_STRING "\\_PR.CP%02d"

Nit: This change seems unrelated to the rest of the patch,
is it here on purpose?

> +
>  u8 *acpigen_get_current(struct acpi_ctx *ctx)
>  {
>  	return ctx->current;

[snip]

Reviewed-by: Wolfgang Wallner <wolfgang.wallner at br-automation.com>


More information about the U-Boot mailing list