From 38e8f8fd88dae07ef8ada9d6baa41b06a4d9ac9f Mon Sep 17 00:00:00 2001 From: Michael Neuling Date: Wed, 31 May 2006 08:31:51 +1000 Subject: dtc: add setting of physical boot cpu dtc always sets the physical boot CPU to 0xfeedbeef. Add a -b option to set this. Also add warnings when using the wrong property with the wrong blob version. Signed-off-by: Michael Neuling --- flattree.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'flattree.c') diff --git a/flattree.c b/flattree.c index 439fbbb..56c1b38 100644 --- a/flattree.c +++ b/flattree.c @@ -301,7 +301,8 @@ static struct data flatten_reserve_list(struct reserve_info *reservelist, } static void make_bph(struct boot_param_header *bph, struct version_info *vi, - int reservesize, int dtsize, int strsize) + int reservesize, int dtsize, int strsize, + int boot_cpuid_phys) { int reserve_off; @@ -324,12 +325,13 @@ static void make_bph(struct boot_param_header *bph, + dtsize + strsize); if (vi->flags & FTF_BOOTCPUID) - bph->boot_cpuid_phys = 0xfeedbeef; + bph->boot_cpuid_phys = cpu_to_be32(boot_cpuid_phys); if (vi->flags & FTF_STRTABSIZE) bph->size_dt_strings = cpu_to_be32(strsize); } -void dt_to_blob(FILE *f, struct boot_info *bi, int version) +void dt_to_blob(FILE *f, struct boot_info *bi, int version, + int boot_cpuid_phys) { struct version_info *vi = NULL; int i; @@ -355,7 +357,8 @@ void dt_to_blob(FILE *f, struct boot_info *bi, int version) reservebuf = flatten_reserve_list(bi->reservelist, vi); /* Make header */ - make_bph(&bph, vi, reservebuf.len, dtbuf.len, strbuf.len); + make_bph(&bph, vi, reservebuf.len, dtbuf.len, strbuf.len, + boot_cpuid_phys); fwrite(&bph, vi->hdr_size, 1, f); @@ -395,7 +398,7 @@ static void dump_stringtable_asm(FILE *f, struct data strbuf) } } -void dt_to_asm(FILE *f, struct boot_info *bi, int version) +void dt_to_asm(FILE *f, struct boot_info *bi, int version, int boot_cpuid_phys) { struct version_info *vi = NULL; int i; @@ -434,7 +437,8 @@ void dt_to_asm(FILE *f, struct boot_info *bi, int version) vi->last_comp_version); if (vi->flags & FTF_BOOTCPUID) - fprintf(f, "\t.long\t0xdeadbeef\t/*boot_cpuid_phys*/\n"); + fprintf(f, "\t.long\t%i\t/*boot_cpuid_phys*/\n", + boot_cpuid_phys); if (vi->flags & FTF_STRTABSIZE) fprintf(f, "\t.long\t_%s_strings_end - _%s_strings_start\t/* size_dt_strings */\n", -- cgit v1.2.1