[aboot] pass partition table through atags
diff --git a/app/aboot/aboot.c b/app/aboot/aboot.c
index d4c559a..12b2be2 100644
--- a/app/aboot/aboot.c
+++ b/app/aboot/aboot.c
@@ -57,8 +57,28 @@
.product = "Android",
};
+struct atag_ptbl_entry
+{
+ char name[16];
+ unsigned offset;
+ unsigned size;
+ unsigned flags;
+};
+
void platform_uninit_timer(void);
+static void ptentry_to_tag(unsigned **ptr, struct ptentry *ptn)
+{
+ struct atag_ptbl_entry atag_ptn;
+
+ memcpy(atag_ptn.name, ptn->name, 16);
+ atag_ptn.name[15] = '\0';
+ atag_ptn.offset = ptn->start;
+ atag_ptn.size = ptn->length;
+ atag_ptn.flags = ptn->flags;
+ memcpy(*ptr, &atag_ptn, sizeof(struct atag_ptbl_entry));
+ *ptr += sizeof(struct atag_ptbl_entry) / sizeof(unsigned);
+}
void boot_linux(void *kernel, unsigned *tags,
const char *cmdline, unsigned machtype,
@@ -66,6 +86,7 @@
{
unsigned *ptr = tags;
void (*entry)(unsigned,unsigned,unsigned*) = kernel;
+ struct ptable *ptable;
/* CORE */
*ptr++ = 2;
@@ -78,6 +99,15 @@
*ptr++ = ramdisk_size;
}
+ if ((ptable = flash_get_ptable()) && (ptable->count != 0)) {
+ int i;
+ *ptr++ = 2 + (ptable->count * (sizeof(struct atag_ptbl_entry) /
+ sizeof(unsigned)));
+ *ptr++ = 0x4d534d70;
+ for (i = 0; i < ptable->count; ++i)
+ ptentry_to_tag(&ptr, ptable_get(ptable, i));
+ }
+
if (cmdline && cmdline[0]) {
unsigned n;
/* include terminating 0 and round up to a word multiple */