[coreboot] [PATCH] v3: Move default mainboard vendor/subsystem from Kconfig to dts

Carl-Daniel Hailfinger c-d.hailfinger.devel.2006 at gmx.net
Fri Jul 11 03:06:43 CEST 2008


On 10.07.2008 20:48, Carl-Daniel Hailfinger wrote:
> On 10.07.2008 14:01, Peter Stuge wrote:
>   
>> On Sat, Jul 05, 2008 at 04:35:29PM +0200, Carl-Daniel Hailfinger wrote:
>>   
>>     
>>>  	mainboard-vendor = "Emulation";
>>>  	mainboard-name = "QEMU x86";
>>> +	mainboard_pci_subsystem_vendor = "0x15ad";
>>> +	mainboard_pci_subsystem_device = "0x1976";
>>>  	device_operations = "qemuvga_pci_ops_dev";
>>>     
>>>       
>> The dts syntax is somewhat inconsistent, sometimes - sometimes _. Is
>> there a rule?
>>   
>>     
>
> My goal was to have the same name in the dts which is also used as
> variable name in C code. The existing code has a somewhat peculiar
> mapping from organic growth over time:
> mainboard-vendor -> const char *mainboard_vendor
> mainboard-name -> const char *mainboard_part_number
> If we can agree on whether the variable should be called
> "mainboard_name" or "mainboard_part_number", I'd be willing to prepare a
> patch.
>   

OK, here comes a patch which makes mainboard-vendor naming more consistent.
mainboard-name naming has been postponed because it's not clear what the
real name should be.

Generated code is identical to the state before the patch.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>

Index: corebootv3-mainboard_vendor/mainboard/adl/msm800sev/dts
===================================================================
--- corebootv3-mainboard_vendor/mainboard/adl/msm800sev/dts	(Revision 693)
+++ corebootv3-mainboard_vendor/mainboard/adl/msm800sev/dts	(Arbeitskopie)
@@ -21,7 +21,7 @@
  */
 
 /{
-	mainboard-vendor = "Advanced Digital Logic";
+	mainboard_vendor = "Advanced Digital Logic";
 	mainboard-name = "MSM800SEV";
 	mainboard_pci_subsystem_vendor = "0x1022";
 	mainboard_pci_subsystem_device = "0x2323";
Index: corebootv3-mainboard_vendor/mainboard/amd/norwich/dts
===================================================================
--- corebootv3-mainboard_vendor/mainboard/amd/norwich/dts	(Revision 693)
+++ corebootv3-mainboard_vendor/mainboard/amd/norwich/dts	(Arbeitskopie)
@@ -19,7 +19,7 @@
  */
 
 /{
-	mainboard-vendor = "AMD";
+	mainboard_vendor = "AMD";
 	mainboard-name = "NORWICH";
 	mainboard_pci_subsystem_vendor = "0x1022";
 	mainboard_pci_subsystem_device = "0x2323";
Index: corebootv3-mainboard_vendor/mainboard/amd/db800/dts
===================================================================
--- corebootv3-mainboard_vendor/mainboard/amd/db800/dts	(Revision 693)
+++ corebootv3-mainboard_vendor/mainboard/amd/db800/dts	(Arbeitskopie)
@@ -19,7 +19,7 @@
  */
 
 /{
-	mainboard-vendor = "AMD";
+	mainboard_vendor = "AMD";
 	mainboard-name = "DB800";
 	mainboard_pci_subsystem_vendor = "0x1022";
 	mainboard_pci_subsystem_device = "0x2323";
Index: corebootv3-mainboard_vendor/mainboard/artecgroup/dbe61/dts
===================================================================
--- corebootv3-mainboard_vendor/mainboard/artecgroup/dbe61/dts	(Revision 693)
+++ corebootv3-mainboard_vendor/mainboard/artecgroup/dbe61/dts	(Arbeitskopie)
@@ -73,7 +73,7 @@
 */
 
 /{
-	mainboard-vendor = "Artec Group";
+	mainboard_vendor = "Artec Group";
 	mainboard-name = "DBE61";
 	mainboard_pci_subsystem_vendor = "0x1022";
 	mainboard_pci_subsystem_device = "0x2323";
Index: corebootv3-mainboard_vendor/mainboard/artecgroup/dbe62/dts
===================================================================
--- corebootv3-mainboard_vendor/mainboard/artecgroup/dbe62/dts	(Revision 693)
+++ corebootv3-mainboard_vendor/mainboard/artecgroup/dbe62/dts	(Arbeitskopie)
@@ -19,7 +19,7 @@
  */
 
 /{
-	mainboard-vendor = "Artec";
+	mainboard_vendor = "Artec";
 	mainboard-name = "DBE62";
 	cpus { };
 	apic at 0 {
Index: corebootv3-mainboard_vendor/mainboard/pcengines/alix1c/dts
===================================================================
--- corebootv3-mainboard_vendor/mainboard/pcengines/alix1c/dts	(Revision 693)
+++ corebootv3-mainboard_vendor/mainboard/pcengines/alix1c/dts	(Arbeitskopie)
@@ -19,7 +19,7 @@
  */
 
 /{
-	mainboard-vendor = "PC Engines";
+	mainboard_vendor = "PC Engines";
 	mainboard-name = "ALIX1.C";
 	cpus { };
 	apic at 0 {
Index: corebootv3-mainboard_vendor/mainboard/pcengines/alix2c3/dts
===================================================================
--- corebootv3-mainboard_vendor/mainboard/pcengines/alix2c3/dts	(Revision 693)
+++ corebootv3-mainboard_vendor/mainboard/pcengines/alix2c3/dts	(Arbeitskopie)
@@ -19,7 +19,7 @@
  */
 
 /{
-	mainboard-vendor = "PC Engines";
+	mainboard_vendor = "PC Engines";
 	mainboard-name = "ALIX.2C3";
 	cpus { };
 	apic at 0 {
Index: corebootv3-mainboard_vendor/mainboard/emulation/qemu-x86/dts
===================================================================
--- corebootv3-mainboard_vendor/mainboard/emulation/qemu-x86/dts	(Revision 693)
+++ corebootv3-mainboard_vendor/mainboard/emulation/qemu-x86/dts	(Arbeitskopie)
@@ -19,7 +19,7 @@
  */
 
 /{
-	mainboard-vendor = "Emulation";
+	mainboard_vendor = "Emulation";
 	mainboard-name = "QEMU x86";
 	mainboard_pci_subsystem_vendor = "0x15ad";
 	mainboard_pci_subsystem_device = "0x1976";
Index: corebootv3-mainboard_vendor/util/dtc/flattree.c
===================================================================
--- corebootv3-mainboard_vendor/util/dtc/flattree.c	(Revision 693)
+++ corebootv3-mainboard_vendor/util/dtc/flattree.c	(Arbeitskopie)
@@ -1353,7 +1353,7 @@
 
 	/* 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")){
+		if (streq(prop->name, "mainboard_vendor")){
 			found_mainboard_vendor = 1;
 			fprintf(f, "const char *mainboard_vendor = \"%s\";\n", prop->val.val);
 		}
@@ -1372,14 +1372,14 @@
 	}
 
 	if (! 	found_mainboard_vendor){
-		die("There is no mainboard-vendor property in the root. Please add one."
+		die("There is no mainboard_vendor property in the root. Please add one."
 			"(and make sure there is a mainboard-name property too");
 	}
 
 	if (! 	found_mainboard_partnumber){
 		die("There is no mainboard-name property in the root. "
 			"Please add one."
-			"(and make sure there is a mainboard-vendor property too");
+			"(and make sure there is a mainboard_vendor property too");
 	}
 
 	switch (found_mainboard_subsys) {



-- 
http://www.hailfinger.org/





More information about the coreboot mailing list