aboutsummaryrefslogtreecommitdiffstats
path: root/hw/xtensa_bootparam.h
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2011-10-30 21:24:26 +0400
committerMax Filippov <jcmvbkbc@gmail.com>2011-11-02 05:05:52 +0400
commit292627bb5e45007eb99d1a7915075eb16dea14ff (patch)
tree8257975b8a49364643e2db0bf7b9f410809281b9 /hw/xtensa_bootparam.h
parent82b25dc8b04766fde3982fec448ebfd48233f4d4 (diff)
xtensa_lx60: pass kernel arguments from -append
Create boot parameters in the end of SRAM region, insert kernel arguments specified in -append there. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'hw/xtensa_bootparam.h')
-rw-r--r--hw/xtensa_bootparam.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/hw/xtensa_bootparam.h b/hw/xtensa_bootparam.h
new file mode 100644
index 000000000..38ef32bdb
--- /dev/null
+++ b/hw/xtensa_bootparam.h
@@ -0,0 +1,25 @@
+#ifndef HW_XTENSA_BOOTPARAM
+#define HW_XTENSA_BOOTPARAM
+
+typedef struct BpTag {
+ uint16_t tag;
+ uint16_t size;
+} BpTag;
+
+static inline ram_addr_t put_tag(ram_addr_t addr, uint16_t tag,
+ size_t size, const void *data)
+{
+ BpTag bp_tag = {
+ .tag = tswap16(tag),
+ .size = tswap16((size + 3) & ~3),
+ };
+
+ cpu_physical_memory_write(addr, &bp_tag, sizeof(bp_tag));
+ addr += sizeof(bp_tag);
+ cpu_physical_memory_write(addr, data, size);
+ addr += (size + 3) & ~3;
+
+ return addr;
+}
+
+#endif