summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/bootblock_common.h8
-rw-r--r--src/include/memlayout.h20
-rw-r--r--src/include/program_loading.h1
-rw-r--r--src/include/rules.h23
-rw-r--r--src/include/symbols.h4
5 files changed, 55 insertions, 1 deletions
diff --git a/src/include/bootblock_common.h b/src/include/bootblock_common.h
index fa67098111aa..0f6c5e467fde 100644
--- a/src/include/bootblock_common.h
+++ b/src/include/bootblock_common.h
@@ -26,6 +26,7 @@
* The 'early' variants are called prior to console initialization. Also, the
* SoC functions are called prior to the mainboard fucntions.
*/
+void decompressor_soc_init(void);
void bootblock_mainboard_early_init(void);
void bootblock_mainboard_init(void);
void bootblock_soc_early_init(void);
@@ -47,4 +48,11 @@ asmlinkage void bootblock_c_entry(uint64_t base_timestamp);
asmlinkage void bootblock_main_with_timestamp(uint64_t base_timestamp,
struct timestamp_entry *timestamps, size_t num_timestamps);
+/* This is the argument structure passed from decompressor to bootblock. */
+struct bootblock_arg {
+ uint64_t base_timestamp;
+ uint32_t num_timestamps;
+ struct timestamp_entry timestamps[];
+};
+
#endif /* __BOOTBLOCK_COMMON_H */
diff --git a/src/include/memlayout.h b/src/include/memlayout.h
index c9c77cfa5c9d..5de2370e4be9 100644
--- a/src/include/memlayout.h
+++ b/src/include/memlayout.h
@@ -102,6 +102,26 @@
#endif
/* Careful: 'INCLUDE <filename>' must always be at the end of the output line */
+#if ENV_DECOMPRESSOR
+ #define DECOMPRESSOR(addr, sz) \
+ SYMBOL(decompressor, addr) \
+ _edecompressor = _decompressor + sz; \
+ _ = ASSERT(_eprogram - _program <= sz, \
+ STR(decompressor exceeded its allotted size! (sz))); \
+ INCLUDE "decompressor/lib/program.ld"
+
+ #define OVERLAP_DECOMPRESSOR_ROMSTAGE(addr, sz) DECOMPRESSOR(addr, sz)
+ #define OVERLAP_DECOMPRESSOR_VERSTAGE_ROMSTAGE(addr, sz) \
+ DECOMPRESSOR(addr, sz)
+#else
+ #define DECOMPRESSOR(addr, sz) \
+ REGION(decompressor, addr, sz, 1)
+
+ #define OVERLAP_DECOMPRESSOR_ROMSTAGE(addr, sz) ROMSTAGE(addr, sz)
+ #define OVERLAP_DECOMPRESSOR_VERSTAGE_ROMSTAGE(addr, sz) \
+ OVERLAP_VERSTAGE_ROMSTAGE(addr, sz)
+#endif
+
#if ENV_BOOTBLOCK
#define BOOTBLOCK(addr, sz) \
SYMBOL(bootblock, addr) \
diff --git a/src/include/program_loading.h b/src/include/program_loading.h
index 5eeef530d20e..e5d26e1d42b6 100644
--- a/src/include/program_loading.h
+++ b/src/include/program_loading.h
@@ -28,6 +28,7 @@ enum {
enum prog_type {
PROG_UNKNOWN,
+ PROG_BOOTBLOCK,
PROG_VERSTAGE,
PROG_ROMSTAGE,
PROG_RAMSTAGE,
diff --git a/src/include/rules.h b/src/include/rules.h
index 4017d37ff5de..deea50b977fd 100644
--- a/src/include/rules.h
+++ b/src/include/rules.h
@@ -19,7 +19,20 @@
* romstage, ramstage or SMM.
*/
-#if defined(__BOOTBLOCK__)
+#if defined(__DECOMPRESSOR__)
+#define ENV_DECOMPRESSOR 1
+#define ENV_BOOTBLOCK 0
+#define ENV_ROMSTAGE 0
+#define ENV_RAMSTAGE 0
+#define ENV_SMM 0
+#define ENV_VERSTAGE 0
+#define ENV_RMODULE 0
+#define ENV_POSTCAR 0
+#define ENV_LIBAGESA 0
+#define ENV_STRING "decompressor"
+
+#elif defined(__BOOTBLOCK__)
+#define ENV_DECOMPRESSOR 0
#define ENV_BOOTBLOCK 1
#define ENV_ROMSTAGE 0
#define ENV_RAMSTAGE 0
@@ -31,6 +44,7 @@
#define ENV_STRING "bootblock"
#elif defined(__ROMSTAGE__)
+#define ENV_DECOMPRESSOR 0
#define ENV_BOOTBLOCK 0
#define ENV_ROMSTAGE 1
#define ENV_RAMSTAGE 0
@@ -42,6 +56,7 @@
#define ENV_STRING "romstage"
#elif defined(__SMM__)
+#define ENV_DECOMPRESSOR 0
#define ENV_BOOTBLOCK 0
#define ENV_ROMSTAGE 0
#define ENV_RAMSTAGE 0
@@ -53,6 +68,7 @@
#define ENV_STRING "smm"
#elif defined(__VERSTAGE__)
+#define ENV_DECOMPRESSOR 0
#define ENV_BOOTBLOCK 0
#define ENV_ROMSTAGE 0
#define ENV_RAMSTAGE 0
@@ -64,6 +80,7 @@
#define ENV_STRING "verstage"
#elif defined(__RAMSTAGE__)
+#define ENV_DECOMPRESSOR 0
#define ENV_BOOTBLOCK 0
#define ENV_ROMSTAGE 0
#define ENV_RAMSTAGE 1
@@ -75,6 +92,7 @@
#define ENV_STRING "ramstage"
#elif defined(__RMODULE__)
+#define ENV_DECOMPRESSOR 0
#define ENV_BOOTBLOCK 0
#define ENV_ROMSTAGE 0
#define ENV_RAMSTAGE 0
@@ -86,6 +104,7 @@
#define ENV_STRING "rmodule"
#elif defined(__POSTCAR__)
+#define ENV_DECOMPRESSOR 0
#define ENV_BOOTBLOCK 0
#define ENV_ROMSTAGE 0
#define ENV_RAMSTAGE 0
@@ -97,6 +116,7 @@
#define ENV_STRING "postcar"
#elif defined(__LIBAGESA__)
+#define ENV_DECOMPRESSOR 0
#define ENV_BOOTBLOCK 0
#define ENV_ROMSTAGE 0
#define ENV_RAMSTAGE 0
@@ -112,6 +132,7 @@
* Default case of nothing set for random blob generation using
* create_class_compiler that isn't bound to a stage.
*/
+#define ENV_DECOMPRESSOR 0
#define ENV_BOOTBLOCK 0
#define ENV_ROMSTAGE 0
#define ENV_RAMSTAGE 0
diff --git a/src/include/symbols.h b/src/include/symbols.h
index 5b92899cee2e..fc9ef21ecf5f 100644
--- a/src/include/symbols.h
+++ b/src/include/symbols.h
@@ -68,6 +68,10 @@ extern u8 _eprogram[];
/* _<stage>_size is always the maximum amount allocated in memlayout, whereas
* _program_size gives the actual memory footprint *used* by current stage. */
+extern u8 _decompressor[];
+extern u8 _edecompressor[];
+#define _decompressor_size (_edecompressor - _decompressor)
+
extern u8 _bootblock[];
extern u8 _ebootblock[];
#define _bootblock_size (_ebootblock - _bootblock)