Signed-off-by: Ronald G. Minnich <rminnich@gmail.com
Acked-by: Stefan Reinauer <stepan@coresystems.de
This patch adds artec dbe61 support, removes all mainboard.c, and
adds
the code to dtc so that it takes these properties from the top level
dts:
/{
.
.
.
mainboard-vendor = "AMD";
mainboard-part-number = "Norwich";
}
statictree.h will have:
extern const char *mainboard_vendor, *mainboard_part_number;
and statictree.c will have:
const char *mainboard_vendor = "AMD";
const char *mainboard_part_number = "Norwich";
It is an error to NOT have the vendor and part number in the top
level dts.
thanks
ron
Get rid of mainboard.c in all mainboard directories.
Modify dtc so that it creates declarations (in statictree.h) and
generates the char *
for mainboard name and part # (in statictree.c).
Failure to set up a mainboard-vendor
OR mainboard-part-number property in the mainboard dts will get a
helpful and descriptive error message (tested).
This may be a first for the linuxbios config
tools.
Add Georgi's patch for the bug in flattree.c; assign *cp = 0.
git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@394 f3766cd6-281f-0410-b1cd-43a5c92072e9
This commit is contained in:
parent
bb554c234a
commit
79351866e4
15 changed files with 569 additions and 73 deletions
|
|
@ -112,6 +112,7 @@ char *toname(char *path, char *suffix){
|
|||
else
|
||||
*cp = *src;
|
||||
}
|
||||
*cp = 0;
|
||||
cp = ret;
|
||||
if (suffix)
|
||||
strcat(cp, suffix);
|
||||
|
|
@ -1254,6 +1255,7 @@ void fix_next(struct node *root){
|
|||
|
||||
void dt_to_linuxbios(FILE *f, struct boot_info *bi, int version, int boot_cpuid_phys)
|
||||
{
|
||||
struct property *prop;
|
||||
struct version_info *vi = NULL;
|
||||
int i;
|
||||
struct data strbuf = empty_data;
|
||||
|
|
@ -1261,6 +1263,7 @@ void dt_to_linuxbios(FILE *f, struct boot_info *bi, int version, int boot_cpuid_
|
|||
extern char *code;
|
||||
struct node *next;
|
||||
extern struct node *first_node;
|
||||
int found_mainboard_vendor = 0, found_mainboard_partnumber = 0;
|
||||
|
||||
labeltree(bi->dt);
|
||||
|
||||
|
|
@ -1283,6 +1286,30 @@ void dt_to_linuxbios(FILE *f, struct boot_info *bi, int version, int boot_cpuid_
|
|||
for(next = first_node; next; next = next->next)
|
||||
fprintf(f, "struct device dev_%s;\n", next->label);
|
||||
|
||||
/* special for the root. Emit the names for the mainboard vendor and part # */
|
||||
for_each_property(bi->dt, prop) {
|
||||
if (streq(prop->name, "mainboard-vendor")){
|
||||
found_mainboard_vendor = 1;
|
||||
fprintf(f, "const char *mainboard_vendor = \"%s\";\n", prop->val.val);
|
||||
}
|
||||
if (streq(prop->name, "mainboard-part-number")){
|
||||
found_mainboard_partnumber = 1;
|
||||
fprintf(f, "const char *mainboard_part_number = \"%s\";\n", prop->val.val);
|
||||
}
|
||||
}
|
||||
|
||||
if (! found_mainboard_vendor){
|
||||
die("There is no mainboard-vendor property in the root. Please add one."
|
||||
"(and make sure there is a mainboard-part-number property too");
|
||||
}
|
||||
|
||||
if (! found_mainboard_partnumber){
|
||||
die("There is no mainboard-part-number property in the root. "
|
||||
"Please add one."
|
||||
"(and make sure there is a mainboard-vendor property too");
|
||||
}
|
||||
|
||||
|
||||
/* emit the code, if any */
|
||||
if (code)
|
||||
fprintf(f, "%s\n", code);
|
||||
|
|
@ -1323,6 +1350,7 @@ void dt_to_linuxbiosh(FILE *f, struct boot_info *bi, int version, int boot_cpuid
|
|||
fix_next(bi->dt);
|
||||
/* emit any includes that we need -- TODO: ONLY ONCE PER TYPE*/
|
||||
fprintf(f, "#include <device/device.h>\n#include <device/pci.h>\n");
|
||||
fprintf(f, "extern const char *mainboard_vendor, *mainboard_part_number;\n");
|
||||
flatten_tree_emit_includes(bi->dt, &linuxbios_emitter, f, &strbuf, vi);
|
||||
|
||||
flatten_tree_emit_structdecls(bi->dt, &linuxbios_emitter, f, &strbuf, vi);
|
||||
|
|
|
|||
Loading…
Reference in a new issue