lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAFyOScp-gskCBxAsha2tsN83tfTrUtLBnARNpEQ18_ENO+aE6g@mail.gmail.com>
Date: Sat, 24 Aug 2024 11:48:07 -0700
From: Moritz Fischer <moritzf@...gle.com>
To: Patrick Rudolph <patrick.rudolph@...ements.com>
Cc: u-boot@...ts.denx.de, linux-kernel@...r.kernel.org, mbrugger@...e.com, 
	pbrobinson@...il.com, trini@...sulko.com, sjg@...omium.org, 
	bmeng.cn@...il.com
Subject: Re: [PATCH 07/17] arm: acpi: Add generic ACPI methods

Patrick,

On Sat, Jul 27, 2024 at 12:21 AM Patrick Rudolph
<patrick.rudolph@...ements.com> wrote:
>
> Add generic ACPI code to generate
> - MADT GICC
> - MADT GICD
>
> as commonly used on arm platforms.
>
> Signed-off-by: Patrick Rudolph <patrick.rudolph@...ements.com>
> Cc: Tom Rini <trini@...sulko.com>
> Cc: Simon Glass <sjg@...omium.org>
> ---
>  arch/arm/include/asm/acpi_table.h | 18 +++++++++++++
>  arch/arm/lib/Makefile             |  1 +
>  arch/arm/lib/acpi_table.c         | 44 +++++++++++++++++++++++++++++++
>  3 files changed, 63 insertions(+)
>  create mode 100644 arch/arm/lib/acpi_table.c
>
> diff --git a/arch/arm/include/asm/acpi_table.h b/arch/arm/include/asm/acpi_table.h
> index e69de29bb2..8a25e93847 100644
> --- a/arch/arm/include/asm/acpi_table.h
> +++ b/arch/arm/include/asm/acpi_table.h
> @@ -0,0 +1,18 @@
> +/* SPDX-License-Identifier: GPL-2.0-or-later */
> +
> +#ifndef __ASM_ACPI_TABLE_H__
> +#define __ASM_ACPI_TABLE_H__
> +
> +#ifndef __ACPI__
> +
> +void acpi_write_madt_gicc(struct acpi_madt_gicc *gicc, uint cpu_num,
> +                         uint perf_gsiv, ulong phys_base, ulong gicv,
> +                         ulong gich, uint vgic_maint_irq, ulong mpidr,
> +                         uint efficiency);
> +
> +void acpi_write_madt_gicd(struct acpi_madt_gicd *gicd, uint gic_id,
> +                         ulong phys_base, uint gic_version);
> +
> +#endif /* !__ACPI__ */
> +
> +#endif /* __ASM_ACPI_TABLE_H__ */
> diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
> index 67275fba61..a7efed6771 100644
> --- a/arch/arm/lib/Makefile
> +++ b/arch/arm/lib/Makefile
> @@ -86,6 +86,7 @@ obj-y += psci-dt.o
>  obj-$(CONFIG_DEBUG_LL) += debug.o
>
>  obj-$(CONFIG_BLOBLIST)  += xferlist.o
> +obj-$(CONFIG_GENERATE_ACPI_TABLE) += acpi_table.o
>
>  # For EABI conformant tool chains, provide eabi_compat()
>  ifneq (,$(findstring -mabi=aapcs-linux,$(PLATFORM_CPPFLAGS)))
> diff --git a/arch/arm/lib/acpi_table.c b/arch/arm/lib/acpi_table.c
> new file mode 100644
> index 0000000000..ea3a6343c9
> --- /dev/null
> +++ b/arch/arm/lib/acpi_table.c
> @@ -0,0 +1,44 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * Based on acpi.c from coreboot
> + *
> + * Copyright (C) 2024 9elements GmbH
> + */
> +
> +#define LOG_CATEGORY LOGC_ACPI
> +
> +#include <acpi/acpigen.h>
> +#include <acpi/acpi_device.h>
> +#include <acpi/acpi_table.h>
> +#include <string.h>
> +
> +void acpi_write_madt_gicc(struct acpi_madt_gicc *gicc, uint cpu_num,
> +                         uint perf_gsiv, ulong phys_base, ulong gicv,
> +                         ulong gich, uint vgic_maint_irq, ulong mpidr,
> +                         uint efficiency)
> +{
> +       memset(gicc, '\0', sizeof(struct acpi_madt_gicc));
> +       gicc->type = ACPI_APIC_GICC;
> +       gicc->length = sizeof(struct acpi_madt_gicc);
> +       gicc->cpu_if_num = cpu_num;
> +       gicc->processor_id = cpu_num;
> +       gicc->flags = ACPI_MADTF_ENABLED;
> +       gicc->perf_gsiv = perf_gsiv;
> +       gicc->phys_base = phys_base;
> +       gicc->gicv = gicv;
> +       gicc->gich = gich;
> +       gicc->vgic_maint_irq = vgic_maint_irq;

I think you're lacking the rdists here?

> +       gicc->mpidr = mpidr;
> +       gicc->efficiency = efficiency;
> +}
> +
> +void acpi_write_madt_gicd(struct acpi_madt_gicd *gicd, uint gic_id,
> +                         ulong phys_base, uint gic_version)
> +{
> +       memset(gicd, '\0', sizeof(struct acpi_madt_gicd));
> +       gicd->type = ACPI_APIC_GICD;
> +       gicd->length = sizeof(struct acpi_madt_gicd);
> +       gicd->gic_id = gic_id;
> +       gicd->phys_base = phys_base;
> +       gicd->gic_version = gic_version;
> +}
> --
> 2.45.2
>

Cheers,
Moritz

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ