summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorLee Leahy <leroy.p.leahy@intel.com>2016-04-29 17:26:36 -0700
committerLeroy P Leahy <leroy.p.leahy@intel.com>2016-04-30 20:44:58 +0200
commitefcee9fadd496945c55828c79dff8e0b19ae0053 (patch)
treea81656fa16c258bf001acc9b1c70966f53704492 /src/include
parent6bcbe5749b9f1a82004299bb63fba7e99b8ed358 (diff)
lib/reg_script: Allow multiple independent handlers
Remove the platform_bus_table routine and replace it with a link time table. This allows the handlers to be spread across multiple modules without any one module knowing about all of the handlers. Establish number ranges for both the SOC and mainboard. TEST=Build and run on Galileo Gen2 Change-Id: I0823d443d3352f31ba7fa20845bbf550b585c86f Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com> Reviewed-on: https://review.coreboot.org/14554 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins)
Diffstat (limited to 'src/include')
-rw-r--r--src/include/reg_script.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/include/reg_script.h b/src/include/reg_script.h
index 741641a42c..da01481c3f 100644
--- a/src/include/reg_script.h
+++ b/src/include/reg_script.h
@@ -60,7 +60,9 @@ enum {
/* Insert other platform independent values above this comment */
- REG_SCRIPT_TYPE_PLATFORM_BASE = 0x10000
+ REG_SCRIPT_TYPE_PLATFORM_BASE = 0x10000,
+ REG_SCRIPT_TYPE_SOC_BASE = REG_SCRIPT_TYPE_PLATFORM_BASE,
+ REG_SCRIPT_TYPE_MAINBOARD_BASE = 0x20000
};
enum {
@@ -92,17 +94,17 @@ struct reg_script_context {
const struct reg_script *step;
};
-#ifndef __PRE_RAM__
struct reg_script_bus_entry {
- int type;
+ uint32_t type;
uint64_t (*reg_script_read)(struct reg_script_context *ctx);
void (*reg_script_write)(struct reg_script_context *ctx);
};
-/* Get the address and length of the platform bus table */
-const struct reg_script_bus_entry *platform_bus_table(size_t *table_entries);
+#define REG_SCRIPT_TABLE_ATTRIBUTE __attribute__ ((used,section (".rsbe_init")))
-#endif /* __PRE_RAM */
+#define REG_SCRIPT_BUS_ENTRY(bus_entry_) \
+ const struct reg_script_bus_entry *rsbe_ ## bus_entry_ \
+ REG_SCRIPT_TABLE_ATTRIBUTE = &bus_entry_;
/* Internal helper Macros. */