aboutsummaryrefslogtreecommitdiff
path: root/src/arch/x86/include
diff options
context:
space:
mode:
authorDuncan Laurie <dlaurie@google.com>2017-08-29 08:26:50 -0700
committerDuncan Laurie <dlaurie@chromium.org>2017-08-30 15:36:50 +0000
commitb3023b697adb3d7049a6d9ed98a313c356739d91 (patch)
tree99b9e625998a889edbf7e98c27ca1b82909d3983 /src/arch/x86/include
parentd533b16669a3bacb19b2824e6b4bc76a2a18c92a (diff)
acpi_device: Provide a new function to add a list of properties
Provide a new function that will allow adding arbitrary properties to devicetree entries without needing a custom driver for the device. This will allow the 'generic i2c' driver to support kernel drivers that need additional device properties exposed and have those board specific properties set with values from devicetree. BUG=b:63413023 TEST=not used yet, compiles cleanly Change-Id: Id272256639a8525406635e168a3db5ab1ba4df6b Signed-off-by: Duncan Laurie <dlaurie@google.com> Reviewed-on: https://review.coreboot.org/21269 Reviewed-by: Furquan Shaikh <furquan@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/arch/x86/include')
-rw-r--r--src/arch/x86/include/arch/acpi_device.h31
1 files changed, 29 insertions, 2 deletions
diff --git a/src/arch/x86/include/arch/acpi_device.h b/src/arch/x86/include/arch/acpi_device.h
index f904cc6107..483fa477d7 100644
--- a/src/arch/x86/include/arch/acpi_device.h
+++ b/src/arch/x86/include/arch/acpi_device.h
@@ -20,6 +20,30 @@
#include <stdint.h>
#include <spi-generic.h>
+enum acpi_dp_type {
+ ACPI_DP_TYPE_UNKNOWN,
+ ACPI_DP_TYPE_INTEGER,
+ ACPI_DP_TYPE_STRING,
+ ACPI_DP_TYPE_REFERENCE,
+ ACPI_DP_TYPE_TABLE,
+ ACPI_DP_TYPE_ARRAY,
+ ACPI_DP_TYPE_CHILD,
+};
+
+struct acpi_dp {
+ enum acpi_dp_type type;
+ const char *name;
+ struct acpi_dp *next;
+ union {
+ struct acpi_dp *child;
+ struct acpi_dp *array;
+ };
+ union {
+ uint64_t integer;
+ const char *string;
+ };
+};
+
#define ACPI_DESCRIPTOR_LARGE (1 << 7)
#define ACPI_DESCRIPTOR_INTERRUPT (ACPI_DESCRIPTOR_LARGE | 9)
#define ACPI_DESCRIPTOR_GPIO (ACPI_DESCRIPTOR_LARGE | 12)
@@ -337,8 +361,6 @@ void acpi_device_add_power_res(
* }
*/
-struct acpi_dp;
-
/* Start a new Device Property table with provided ACPI reference */
struct acpi_dp *acpi_dp_new_table(const char *ref);
@@ -370,6 +392,11 @@ struct acpi_dp *acpi_dp_add_gpio(struct acpi_dp *dp, const char *name,
struct acpi_dp *acpi_dp_add_child(struct acpi_dp *dp, const char *name,
struct acpi_dp *child);
+/* Add a list of Device Properties, returns the number of properties added */
+size_t acpi_dp_add_property_list(struct acpi_dp *dp,
+ const struct acpi_dp *property_list,
+ size_t property_count);
+
/* Write Device Property hierarchy and clean up resources */
void acpi_dp_write(struct acpi_dp *table);