[coreboot-gerrit] Change in coreboot[master]: device_t struct: Introduce device specific data field

Pratikkumar V Prajapati (Code Review) gerrit at coreboot.org
Mon Aug 14 23:34:07 CEST 2017


Pratikkumar V Prajapati has uploaded this change for review. ( https://review.coreboot.org/21008


Change subject: device_t struct: Introduce device specific data field
......................................................................

device_t struct: Introduce device specific data field

Let device store anything it needs. For CPU, data pointer would
store microcode patch address (MP init code sets it now). This would be
efficient as, device_t can be located easily and its data can be accessed.

e.g. to get microcode patch address for CPU device

device_t dev = dev_find_path(NULL, DEVICE_PATH_CPU_CLUSTER);
and then dev->data can be used, rather than loading microcode each
time from boot media.

Change-Id: I7e377621dd9c00388c4e148c451f9e01cb7fe4fa
Signed-off-by: Pratik Prajapati <pratikkumar.v.prajapati at intel.com>
---
M src/include/device/device.h
M src/soc/intel/common/block/cpu/mp_init.c
2 files changed, 3 insertions(+), 1 deletion(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/08/21008/1

diff --git a/src/include/device/device.h b/src/include/device/device.h
index 54d4ec3..04962dd 100644
--- a/src/include/device/device.h
+++ b/src/include/device/device.h
@@ -146,6 +146,7 @@
 	const char *name;
 #endif
 	DEVTREE_CONST void *chip_info;
+	const void *data; /* device specific data. Store anything you want */
 };
 
 /**
diff --git a/src/soc/intel/common/block/cpu/mp_init.c b/src/soc/intel/common/block/cpu/mp_init.c
index fd8b5db..7e57b79 100644
--- a/src/soc/intel/common/block/cpu/mp_init.c
+++ b/src/soc/intel/common/block/cpu/mp_init.c
@@ -102,7 +102,7 @@
  */
 void get_microcode_info(const void **microcode, int *parallel)
 {
-	*microcode =microcode_patch;
+	*microcode = microcode_patch;
 	*parallel = 1;
 }
 
@@ -114,6 +114,7 @@
 	microcode_patch = intel_microcode_find();
 	intel_microcode_load_unlocked(microcode_patch);
 
+	dev->data = microcode_patch;
 	/*
 	 * TODO: This parameter "microcode_patch" should be removed
 	 * in this function call once the following two cases are resolved -

-- 
To view, visit https://review.coreboot.org/21008
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7e377621dd9c00388c4e148c451f9e01cb7fe4fa
Gerrit-Change-Number: 21008
Gerrit-PatchSet: 1
Gerrit-Owner: Pratikkumar V Prajapati <pratikkumar.v.prajapati at intel.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20170814/aa60c690/attachment-0001.html>


More information about the coreboot-gerrit mailing list