aboutsummaryrefslogtreecommitdiff
path: root/hdata
diff options
context:
space:
mode:
authorOliver O'Halloran <oohall@gmail.com>2017-05-26 16:28:39 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-06-06 17:59:45 +1000
commitcc7b746192f04df04cce5737771d2e7703006142 (patch)
tree66ab18687ca8b7b30d2ccf4a746afc9bfc40e17a /hdata
parent23ca5d4fe40fea454b0a1c120d4a4a33aa3f2476 (diff)
downloadskiboot-cc7b746192f04df04cce5737771d2e7703006142.zip
skiboot-cc7b746192f04df04cce5737771d2e7703006142.tar.gz
skiboot-cc7b746192f04df04cce5737771d2e7703006142.tar.bz2
hdata/test: Add memory reservations to hdata_to_dt
Currently memory reservations are parsed, but since they are not processed until mem_region_init() they don't appear in the output device tree blob. Several bugs have been found with memory reservations so we want them to be part of the test output. Add them and clean up several usages of printf() since we want only the dtb to appear in standard out. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Reviewed-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hdata')
-rw-r--r--hdata/test/hdata_to_dt.c10
-rw-r--r--hdata/test/stubs.c20
2 files changed, 24 insertions, 6 deletions
diff --git a/hdata/test/hdata_to_dt.c b/hdata/test/hdata_to_dt.c
index e8b7ed6..3568eb6 100644
--- a/hdata/test/hdata_to_dt.c
+++ b/hdata/test/hdata_to_dt.c
@@ -67,6 +67,7 @@ unsigned long tb_hz = 512000000;
#define __CPU_H
struct cpu_thread {
uint32_t pir;
+ uint32_t chip_id;
};
struct cpu_thread __boot_cpu, *boot_cpu = &__boot_cpu;
@@ -94,6 +95,11 @@ struct dt_node *add_ics_node(void)
static bool spira_check_ptr(const void *ptr, const char *file, unsigned int line);
+/* should probably check this */
+#define BITS_PER_LONG 64
+/* not used, just needs to exist */
+#define cpu_max_pir 0x7
+
#include "../cpu-common.c"
#include "../fsp.c"
#include "../hdif.c"
@@ -113,6 +119,7 @@ static bool spira_check_ptr(const void *ptr, const char *file, unsigned int line
#include "../../test/dt_common.c"
#include "../../core/fdt.c"
#include "../../hw/phys-map.c"
+#include "../../core/mem_region.c"
#include <err.h>
@@ -335,6 +342,9 @@ int main(int argc, char *argv[])
exit(EXIT_FAILURE);
}
+ mem_region_init();
+ mem_region_release_unused();
+
if (!blobs)
squash_blobs(dt_root);
diff --git a/hdata/test/stubs.c b/hdata/test/stubs.c
index aaecddb..b53703f 100644
--- a/hdata/test/stubs.c
+++ b/hdata/test/stubs.c
@@ -23,8 +23,6 @@
#include "../../ccan/list/list.c"
-unsigned long top_of_ram = 16ULL * 1024 * 1024 * 1024;
-
void _prlog(int log_level __attribute__((unused)), const char* fmt, ...) __attribute__((format (printf, 2, 3)));
#ifndef pr_fmt
@@ -102,10 +100,20 @@ STUB(fsp_adjust_lid_side);
STUB(backtrace);
/* Add HW specific stubs here */
-static void noop_function(void) {}
-#define NOOP_STUB(fnname) \
- void fnname(void) __attribute__((weak, alias ("noop_function")))
-
+static bool true_stub(void) { return true; }
+static bool false_stub(void) { return false; }
+
+#define TRUE_STUB(fnname) \
+ void fnname(void) __attribute__((weak, alias ("true_stub")))
+#define FALSE_STUB(fnname) \
+ void fnname(void) __attribute__((weak, alias ("false_stub")))
+#define NOOP_STUB FALSE_STUB
+
+TRUE_STUB(lock_held_by_me);
+NOOP_STUB(lock);
+NOOP_STUB(unlock);
NOOP_STUB(early_uart_init);
NOOP_STUB(mem_reserve_fw);
NOOP_STUB(mem_reserve_hwbuf);
+NOOP_STUB(add_chip_dev_associativity);
+