Tim Chu has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/42242 )
Change subject: drivers/ocp/ipmi: Add ipmi set processor information ......................................................................
drivers/ocp/ipmi: Add ipmi set processor information
Implement setting processor information to BMC.
TEST=Use get command in OpenBMC to check. Command and information are shown as below:
root@bmc-oob:~# ipmi-util 1 0xd8 0x11 0x4c 0x1c 0x00 0 1 DC 11 00 47 65 6E 75 69 6E 65 20 49 6E 74 65 6C 28 52 29 20 43 50 55 20 30 30 30 30 25 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 root@bmc-oob:~# ipmi-util 1 0xd8 0x11 0x4c 0x1c 0x00 0 2 DC 11 00 1A 34 00 DC 05 58 58 root@bmc-oob:~#
Signed-off-by: TimChu Tim.Chu@quantatw.com Change-Id: I3d53ac241a11ca962572816283a0c653fcde9f9e --- M src/drivers/ocp/ipmi/Kconfig M src/drivers/ocp/ipmi/ipmi_ocp.c M src/drivers/ocp/ipmi/ipmi_ocp.h 3 files changed, 138 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/42/42242/1
diff --git a/src/drivers/ocp/ipmi/Kconfig b/src/drivers/ocp/ipmi/Kconfig index 95c51c0..d4ebafe 100644 --- a/src/drivers/ocp/ipmi/Kconfig +++ b/src/drivers/ocp/ipmi/Kconfig @@ -1,3 +1,8 @@ config IPMI_OCP bool default n + +config MANU_ID + hex + default 0 + depends on IPMI_OCP diff --git a/src/drivers/ocp/ipmi/ipmi_ocp.c b/src/drivers/ocp/ipmi/ipmi_ocp.c index c1766d9..4ad710d 100644 --- a/src/drivers/ocp/ipmi/ipmi_ocp.c +++ b/src/drivers/ocp/ipmi/ipmi_ocp.c @@ -54,6 +54,108 @@ return 0; }
+static int ipmi_set_processor_information_param1(struct device *dev) +{ + int ret; + struct ipmi_processor_info_param1_req req1 = {0}; + struct ipmi_rsp rsp; + + for (int index = 0; index < sizeof(req1.data.manufacturer_id); index++) { + req1.data.manufacturer_id[index] = (mfid >> (index * 8)) & 0xff; + } + printk(BIOS_DEBUG, "IPMI BMC manufacturer id: %02x%02x%02x\n", + req1.data.manufacturer_id[2], req1.data.manufacturer_id[1], + req1.data.manufacturer_id[0]); + + req1.data.index = 0; + req1.data.parameter_selector = 1; + + /* Get processor name. */ + fill_processor_name(req1.product_name); + printk(BIOS_DEBUG, "IPMI CPU NAME: %s.\n", req1.product_name); + + ret = ipmi_kcs_message(dev->path.pnp.port, IPMI_NETFN_OEM_COMMON, 0, + IPMI_BMC_SET_PROCESSOR_INFORMATION, (u8 *) &req1, + sizeof(req1), (u8 *) &rsp, sizeof(rsp)); + + if (ret < sizeof(struct ipmi_rsp) || rsp.completion_code) { + printk(BIOS_ERR, "IPMI BMC: %s command failed (ret=%d rsp=0x%x)\n", + __func__, ret, rsp.completion_code); + return CB_ERR; + } + return CB_SUCCESS; +} + +static int ipmi_set_processor_information_param2(struct device *dev) +{ + int ret; + struct ipmi_processor_info_param2_req req2 = {0}; + struct ipmi_rsp rsp; + struct cpuid_result regs; + msr_t msr; + uint8_t stepping_id; + + for (int index = 0; index < sizeof(req2.data.manufacturer_id); index++) { + req2.data.manufacturer_id[index] = (mfid >> (index * 8)) & 0xff; + } + printk(BIOS_DEBUG, "IPMI BMC manufacturer id: %02x%02x%02x\n", + req2.data.manufacturer_id[2], req2.data.manufacturer_id[1], + req2.data.manufacturer_id[0]); + + req2.data.index = 0; + req2.data.parameter_selector = 2; + + /* Get core number and thread number. */ + msr = rdmsr(MSR_CORE_THREAD_COUNT); + req2.thread_number = (msr.lo >> 0) & 0xffff; + req2.core_number = (msr.lo >> 16) & 0xffff; + printk(BIOS_DEBUG, "IPMI CPU has %u cores, %u threads enabled.\n", + req2.core_number, req2.thread_number); + + /* Get processor frequency. */ + msr = rdmsr(MSR_PLATFORM_INFO); + req2.processor_freq = 100 * ((msr.lo >> 8) & 0xff); + printk(BIOS_DEBUG, "IPMI CPU frequency is %u MHz.\n", + req2.processor_freq); + + /* Get revision. */ + regs = cpuid(0x01); + stepping_id = (regs.eax & 0xf); + printk(BIOS_DEBUG, "IPMI CPU stepping id is %x.\n", stepping_id); + switch (stepping_id) { + /* TBD */ + case 0xa: + req2.revision[0] = 'X'; + req2.revision[1] = 'X'; + break; + default: + req2.revision[0] = 'X'; + req2.revision[1] = 'X'; + } + + ret = ipmi_kcs_message(dev->path.pnp.port, IPMI_NETFN_OEM_COMMON, 0, + IPMI_BMC_SET_PROCESSOR_INFORMATION, (u8 *) &req2, + sizeof(req2), (u8 *) &rsp, sizeof(rsp)); + + if (ret < sizeof(struct ipmi_rsp) || rsp.completion_code) { + printk(BIOS_ERR, "IPMI: %s command failed (ret=%d rsp=0x%x)\n", + __func__, ret, rsp.completion_code); + return CB_ERR; + } + return CB_SUCCESS; +} + +static void ipmi_set_processor_information(struct device *dev) +{ + if (ipmi_set_processor_information_param1(dev)) { + printk(BIOS_ERR, "IPMI BMC set param 1 processor info failed\n"); + } + + if (ipmi_set_processor_information_param2(dev)) { + printk(BIOS_ERR, "IPMI BMC set param 2 processor info failed\n"); + } +} + static void ipmi_ocp_init(struct device *dev) { struct ipmi_rsp postrsp; @@ -67,6 +169,9 @@ { struct ipmi_rsp postrsp;
+ /* Send processor information */ + ipmi_set_processor_information(dev); + /* Send POST end to BMC. */ if (!ipmi_set_post_end(dev, &postrsp)) printk(BIOS_DEBUG, "IPMI BMC POST is ended\n"); diff --git a/src/drivers/ocp/ipmi/ipmi_ocp.h b/src/drivers/ocp/ipmi/ipmi_ocp.h index 1cdea2f..f04b5ba 100644 --- a/src/drivers/ocp/ipmi/ipmi_ocp.h +++ b/src/drivers/ocp/ipmi/ipmi_ocp.h @@ -3,8 +3,36 @@ #ifndef __IPMI_OCP_H #define __IPMI_OCP_H
+#include <soc/msr.h> +#include <cpu/x86/msr.h> +#include <cpu/x86/name.h> +#include "drivers/ipmi/ipmi_kcs.h" #define IPMI_NETFN_OEM 0x30 #define IPMI_BMC_SET_POST_START 0x73 #define IPMI_BMC_SET_POST_END 0x74 +#define IPMI_NETFN_OEM_COMMON 0x36 +#define IPMI_BMC_SET_PROCESSOR_INFORMATION 0x10 +#define IPMI_BMC_GET_PROCESSOR_INFORMATION 0x11 + +#define mfid CONFIG_MANU_ID + +struct ipmi_processor_info_req { + uint8_t manufacturer_id[3]; + uint8_t index; + uint8_t parameter_selector; +} __packed; + +struct ipmi_processor_info_param1_req { + struct ipmi_processor_info_req data; + char product_name[48]; +} __packed; + +struct ipmi_processor_info_param2_req { + struct ipmi_processor_info_req data; + uint8_t core_number; + uint16_t thread_number; + uint16_t processor_freq; + char revision[2]; +} __packed;
#endif
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42242 )
Change subject: drivers/ocp/ipmi: Add ipmi set processor information ......................................................................
Patch Set 1:
(3 comments)
https://review.coreboot.org/c/coreboot/+/42242/1/src/drivers/ocp/ipmi/ipmi_o... File src/drivers/ocp/ipmi/ipmi_ocp.c:
https://review.coreboot.org/c/coreboot/+/42242/1/src/drivers/ocp/ipmi/ipmi_o... PS1, Line 63: for (int index = 0; index < sizeof(req1.data.manufacturer_id); index++) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/42242/1/src/drivers/ocp/ipmi/ipmi_o... PS1, Line 98: for (int index = 0; index < sizeof(req2.data.manufacturer_id); index++) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/42242/1/src/drivers/ocp/ipmi/ipmi_o... PS1, Line 150: if (ipmi_set_processor_information_param1(dev)) { braces {} are not necessary for single statement blocks
Hello build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42242
to look at the new patch set (#2).
Change subject: drivers/ocp/ipmi: Add ipmi set processor information ......................................................................
drivers/ocp/ipmi: Add ipmi set processor information
Implement setting processor information to BMC.
TEST=Use get command in OpenBMC to check. Command and information are shown as below:
root@bmc-oob:~# ipmi-util 1 0xd8 0x11 0x4c 0x1c 0x00 0 1 DC 11 00 47 65 6E 75 69 6E 65 20 49 6E 74 65 6C 28 52 29 20 43 50 55 20 30 30 30 30 25 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 root@bmc-oob:~# ipmi-util 1 0xd8 0x11 0x4c 0x1c 0x00 0 2 DC 11 00 1A 34 00 DC 05 58 58 root@bmc-oob:~#
Signed-off-by: TimChu Tim.Chu@quantatw.com Change-Id: I3d53ac241a11ca962572816283a0c653fcde9f9e --- M src/drivers/ocp/ipmi/Kconfig M src/drivers/ocp/ipmi/ipmi_ocp.c M src/drivers/ocp/ipmi/ipmi_ocp.h 3 files changed, 133 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/42/42242/2
Tim Chu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42242 )
Change subject: drivers/ocp/ipmi: Add ipmi set processor information ......................................................................
Patch Set 2:
(3 comments)
https://review.coreboot.org/c/coreboot/+/42242/1/src/drivers/ocp/ipmi/ipmi_o... File src/drivers/ocp/ipmi/ipmi_ocp.c:
https://review.coreboot.org/c/coreboot/+/42242/1/src/drivers/ocp/ipmi/ipmi_o... PS1, Line 63: for (int index = 0; index < sizeof(req1.data.manufacturer_id); index++) {
braces {} are not necessary for single statement blocks
Done
https://review.coreboot.org/c/coreboot/+/42242/1/src/drivers/ocp/ipmi/ipmi_o... PS1, Line 98: for (int index = 0; index < sizeof(req2.data.manufacturer_id); index++) {
braces {} are not necessary for single statement blocks
Done
https://review.coreboot.org/c/coreboot/+/42242/1/src/drivers/ocp/ipmi/ipmi_o... PS1, Line 150: if (ipmi_set_processor_information_param1(dev)) {
braces {} are not necessary for single statement blocks
Done
Hello build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42242
to look at the new patch set (#3).
Change subject: drivers/ocp/ipmi: Add ipmi set processor information ......................................................................
drivers/ocp/ipmi: Add ipmi set processor information
Implement setting processor information to BMC.
TEST=Use get command in OpenBMC to check. Command and information are shown as below:
root@bmc-oob:~# ipmi-util 1 0xd8 0x11 0x4c 0x1c 0x00 0 1 DC 11 00 47 65 6E 75 69 6E 65 20 49 6E 74 65 6C 28 52 29 20 43 50 55 20 30 30 30 30 25 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 root@bmc-oob:~# ipmi-util 1 0xd8 0x11 0x4c 0x1c 0x00 0 2 DC 11 00 1A 34 00 DC 05 58 58 root@bmc-oob:~#
Signed-off-by: TimChu Tim.Chu@quantatw.com Change-Id: I3d53ac241a11ca962572816283a0c653fcde9f9e --- M src/drivers/ocp/ipmi/Kconfig M src/drivers/ocp/ipmi/ipmi_ocp.c M src/drivers/ocp/ipmi/ipmi_ocp.h 3 files changed, 133 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/42/42242/3
Jonathan Zhang has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42242 )
Change subject: drivers/ocp/ipmi: Add ipmi set processor information ......................................................................
Patch Set 3:
(4 comments)
Thanks!
https://review.coreboot.org/c/coreboot/+/42242/3//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/42242/3//COMMIT_MSG@9 PS3, Line 9: Implement setting processor information to BMC. If this IPMI OEM command is defined in a public doc (such as OCP doc), please include the link.
https://review.coreboot.org/c/coreboot/+/42242/3/src/drivers/ocp/ipmi/ipmi_o... File src/drivers/ocp/ipmi/ipmi_ocp.h:
https://review.coreboot.org/c/coreboot/+/42242/3/src/drivers/ocp/ipmi/ipmi_o... PS3, Line 7: #include <cpu/x86/msr.h> Please only keep header files needed for this header file.
https://review.coreboot.org/c/coreboot/+/42242/3/src/drivers/ocp/ipmi/ipmi_o... File src/drivers/ocp/ipmi/ipmi_ocp.c:
https://review.coreboot.org/c/coreboot/+/42242/3/src/drivers/ocp/ipmi/ipmi_o... PS3, Line 65: memcpy(&req1.data.manufacturer_id, &mfid, 3); what if CONFIG_MANU_ID is not defined?
https://review.coreboot.org/c/coreboot/+/42242/3/src/drivers/ocp/ipmi/ipmi_o... PS3, Line 125: /* TBD */ What does the spec say about this? Why TBD? Should we just put stepping_id in req2.revision[0]?
Hello build bot (Jenkins), Jonathan Zhang, Ryback Hung, Rocky Phagura, Bryant Ou,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42242
to look at the new patch set (#4).
Change subject: drivers/ocp/ipmi: Add ipmi set processor information ......................................................................
drivers/ocp/ipmi: Add ipmi set processor information
Implement setting processor information to BMC based on document YosemiteV3_BMC_Feature_Spec_v1.3.
TEST=Use get command in OpenBMC to check. Command and information are shown as below:
root@bmc-oob:~# ipmi-util 1 0xd8 0x11 0x4c 0x1c 0x00 0 1 DC 11 00 47 65 6E 75 69 6E 65 20 49 6E 74 65 6C 28 52 29 20 43 50 55 20 30 30 30 30 25 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 root@bmc-oob:~# ipmi-util 1 0xd8 0x11 0x4c 0x1c 0x00 0 2 DC 11 00 1A 34 00 DC 05 58 58 root@bmc-oob:~#
Signed-off-by: TimChu Tim.Chu@quantatw.com Change-Id: I3d53ac241a11ca962572816283a0c653fcde9f9e --- M src/drivers/ocp/ipmi/Kconfig M src/drivers/ocp/ipmi/ipmi_ocp.c M src/drivers/ocp/ipmi/ipmi_ocp.h 3 files changed, 135 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/42/42242/4
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42242 )
Change subject: drivers/ocp/ipmi: Add ipmi set processor information ......................................................................
Patch Set 4:
(2 comments)
https://review.coreboot.org/c/coreboot/+/42242/4/src/drivers/ocp/ipmi/ipmi_o... File src/drivers/ocp/ipmi/ipmi_ocp.h:
https://review.coreboot.org/c/coreboot/+/42242/4/src/drivers/ocp/ipmi/ipmi_o... PS4, Line 12: #define IPMI_NETFN_OEM_COMMON 0x36 please, no space before tabs
https://review.coreboot.org/c/coreboot/+/42242/4/src/drivers/ocp/ipmi/ipmi_o... PS4, Line 16: #define MSR_CORE_THREAD_COUNT 0x35 please, no space before tabs
Hello build bot (Jenkins), Jonathan Zhang, Ryback Hung, Rocky Phagura, Bryant Ou,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42242
to look at the new patch set (#5).
Change subject: drivers/ocp/ipmi: Add ipmi set processor information ......................................................................
drivers/ocp/ipmi: Add ipmi set processor information
Implement setting processor information to BMC based on document YosemiteV3_BMC_Feature_Spec_v1.3.
TEST=Use get command in OpenBMC to check. Command and information are shown as below:
root@bmc-oob:~# ipmi-util 1 0xd8 0x11 0x4c 0x1c 0x00 0 1 DC 11 00 47 65 6E 75 69 6E 65 20 49 6E 74 65 6C 28 52 29 20 43 50 55 20 30 30 30 30 25 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 root@bmc-oob:~# ipmi-util 1 0xd8 0x11 0x4c 0x1c 0x00 0 2 DC 11 00 1A 34 00 DC 05 58 58 root@bmc-oob:~#
Signed-off-by: TimChu Tim.Chu@quantatw.com Change-Id: I3d53ac241a11ca962572816283a0c653fcde9f9e --- M src/drivers/ocp/ipmi/Kconfig M src/drivers/ocp/ipmi/ipmi_ocp.c M src/drivers/ocp/ipmi/ipmi_ocp.h 3 files changed, 135 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/42/42242/5
Tim Chu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42242 )
Change subject: drivers/ocp/ipmi: Add ipmi set processor information ......................................................................
Patch Set 5:
(2 comments)
https://review.coreboot.org/c/coreboot/+/42242/4/src/drivers/ocp/ipmi/ipmi_o... File src/drivers/ocp/ipmi/ipmi_ocp.h:
https://review.coreboot.org/c/coreboot/+/42242/4/src/drivers/ocp/ipmi/ipmi_o... PS4, Line 12: #define IPMI_NETFN_OEM_COMMON 0x36
please, no space before tabs
Done
https://review.coreboot.org/c/coreboot/+/42242/4/src/drivers/ocp/ipmi/ipmi_o... PS4, Line 16: #define MSR_CORE_THREAD_COUNT 0x35
please, no space before tabs
Done
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42242 )
Change subject: drivers/ocp/ipmi: Add ipmi set processor information ......................................................................
Patch Set 5: Code-Review+1
(2 comments)
Has populating this a noticeable impact on the boot time?
https://review.coreboot.org/c/coreboot/+/42242/5//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/42242/5//COMMIT_MSG@2 PS5, Line 2: TimChu Could you please add a space: Tim Chu.
$ git config --global user.name "Tim Chu" $ git commit --amend --author="Tim Chu Tim.Chu@quantatw.com"
https://review.coreboot.org/c/coreboot/+/42242/5//COMMIT_MSG@23 PS5, Line 23: TimChu Tim Chu
Hello build bot (Jenkins), Jonathan Zhang, Ryback Hung, Paul Menzel, Rocky Phagura, Bryant Ou,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42242
to look at the new patch set (#6).
Change subject: drivers/ocp/ipmi: Add ipmi set processor information ......................................................................
drivers/ocp/ipmi: Add ipmi set processor information
Implement setting processor information to BMC based on document YosemiteV3_BMC_Feature_Spec_v1.3.
TEST=Use get command in OpenBMC to check. Command and information are shown as below:
root@bmc-oob:~# ipmi-util 1 0xd8 0x11 0x4c 0x1c 0x00 0 1 DC 11 00 47 65 6E 75 69 6E 65 20 49 6E 74 65 6C 28 52 29 20 43 50 55 20 30 30 30 30 25 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 root@bmc-oob:~# ipmi-util 1 0xd8 0x11 0x4c 0x1c 0x00 0 2 DC 11 00 1A 34 00 DC 05 58 58 root@bmc-oob:~#
Signed-off-by: Tim Chu Tim.Chu@quantatw.com Change-Id: I3d53ac241a11ca962572816283a0c653fcde9f9e --- M src/drivers/ocp/ipmi/Kconfig M src/drivers/ocp/ipmi/ipmi_ocp.c M src/drivers/ocp/ipmi/ipmi_ocp.h 3 files changed, 135 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/42/42242/6
Hello build bot (Jenkins), Jonathan Zhang, Ryback Hung, Paul Menzel, Rocky Phagura, Bryant Ou,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42242
to look at the new patch set (#7).
Change subject: drivers/ocp/ipmi: Add ipmi set processor information ......................................................................
drivers/ocp/ipmi: Add ipmi set processor information
Implement setting processor information to BMC based on document YosemiteV3_BMC_Feature_Spec_v1.7.
TEST=Use get command in OpenBMC to check. Command and information are shown as below:
root@bmc-oob:~# ipmi-util 1 0xd8 0x11 0x4c 0x1c 0x00 0 1 DC 11 00 47 65 6E 75 69 6E 65 20 49 6E 74 65 6C 28 52 29 20 43 50 55 20 30 30 30 30 25 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 root@bmc-oob:~# ipmi-util 1 0xd8 0x11 0x4c 0x1c 0x00 0 2 DC 11 00 1A 34 00 DC 05 58 58 root@bmc-oob:~#
Signed-off-by: Tim Chu Tim.Chu@quantatw.com Change-Id: I3d53ac241a11ca962572816283a0c653fcde9f9e --- M src/drivers/ocp/ipmi/Kconfig M src/drivers/ocp/ipmi/ipmi_ocp.c M src/drivers/ocp/ipmi/ipmi_ocp.h 3 files changed, 135 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/42/42242/7
Tim Chu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42242 )
Change subject: drivers/ocp/ipmi: Add ipmi set processor information ......................................................................
Patch Set 7:
(2 comments)
https://review.coreboot.org/c/coreboot/+/42242/5//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/42242/5//COMMIT_MSG@2 PS5, Line 2: TimChu
Could you please add a space: Tim Chu. […]
Done
https://review.coreboot.org/c/coreboot/+/42242/5//COMMIT_MSG@23 PS5, Line 23: TimChu
Tim Chu
Done
Tim Chu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42242 )
Change subject: drivers/ocp/ipmi: Add ipmi set processor information ......................................................................
Patch Set 7:
(4 comments)
https://review.coreboot.org/c/coreboot/+/42242/3//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/42242/3//COMMIT_MSG@9 PS3, Line 9: Implement setting processor information to BMC.
If this IPMI OEM command is defined in a public doc (such as OCP doc), please include the link.
It is defined in document YosemiteV3_BMC_Feature_Spec_v1.7 on dropbox.
https://review.coreboot.org/c/coreboot/+/42242/3/src/drivers/ocp/ipmi/ipmi_o... File src/drivers/ocp/ipmi/ipmi_ocp.h:
https://review.coreboot.org/c/coreboot/+/42242/3/src/drivers/ocp/ipmi/ipmi_o... PS3, Line 7: #include <cpu/x86/msr.h>
Please only keep header files needed for this header file.
Done
https://review.coreboot.org/c/coreboot/+/42242/3/src/drivers/ocp/ipmi/ipmi_o... File src/drivers/ocp/ipmi/ipmi_ocp.c:
https://review.coreboot.org/c/coreboot/+/42242/3/src/drivers/ocp/ipmi/ipmi_o... PS3, Line 65: memcpy(&req1.data.manufacturer_id, &mfid, 3);
what if CONFIG_MANU_ID is not defined?
If CONFIG_MANU_ID is not defined, the default value 0x0 may be used and other information may still be send to BMC.
https://review.coreboot.org/c/coreboot/+/42242/3/src/drivers/ocp/ipmi/ipmi_o... PS3, Line 125: /* TBD */
What does the spec say about this? Why TBD? Should we just put stepping_id in req2. […]
There should be a CPU identification table such as in chapter 2.7 of #607480 which shows the corresponding CPUID, Stepping ID and revision. Because the table I have now only shows one kind of CPUID, I think it should be TBD here.
Jonathan Zhang has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42242 )
Change subject: drivers/ocp/ipmi: Add ipmi set processor information ......................................................................
Patch Set 7:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42242/7/src/drivers/ocp/ipmi/ipmi_o... File src/drivers/ocp/ipmi/ipmi_ocp.c:
https://review.coreboot.org/c/coreboot/+/42242/7/src/drivers/ocp/ipmi/ipmi_o... PS7, Line 107: /* Get core number and thread number. */ The details of how to get core/thread number, processor freq. and revision are architecture/SoC specific, it is better to call generic function to get them, instead of having the implementation here in.
Hello Philipp Deppenwiese, build bot (Jenkins), Jonathan Zhang, Ryback Hung, Paul Menzel, Rocky Phagura, Bryant Ou, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42242
to look at the new patch set (#8).
Change subject: drivers/ocp/ipmi: Add ipmi set processor information ......................................................................
drivers/ocp/ipmi: Add ipmi set processor information
Implement setting processor information to BMC based on document YosemiteV3_BMC_Feature_Spec_v1.7.
TEST=Use get command in OpenBMC to check. Command and information are shown as below:
root@bmc-oob:~# ipmi-util 1 0xd8 0x11 0x4c 0x1c 0x00 0 1 DC 11 00 47 65 6E 75 69 6E 65 20 49 6E 74 65 6C 28 52 29 20 43 50 55 20 30 30 30 30 25 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 root@bmc-oob:~# ipmi-util 1 0xd8 0x11 0x4c 0x1c 0x00 0 2 DC 11 00 1A 34 00 DC 05 41 30 root@bmc-oob:~#
Signed-off-by: Tim Chu Tim.Chu@quantatw.com Change-Id: I3d53ac241a11ca962572816283a0c653fcde9f9e --- M src/drivers/ocp/ipmi/Kconfig M src/drivers/ocp/ipmi/ipmi_ocp.c M src/drivers/ocp/ipmi/ipmi_ocp.h 3 files changed, 136 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/42/42242/8
Tim Chu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42242 )
Change subject: drivers/ocp/ipmi: Add ipmi set processor information ......................................................................
Patch Set 8:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42242/7/src/drivers/ocp/ipmi/ipmi_o... File src/drivers/ocp/ipmi/ipmi_ocp.c:
https://review.coreboot.org/c/coreboot/+/42242/7/src/drivers/ocp/ipmi/ipmi_o... PS7, Line 107: /* Get core number and thread number. */
The details of how to get core/thread number, processor freq. […]
Done
Jonathan Zhang has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42242 )
Change subject: drivers/ocp/ipmi: Add ipmi set processor information ......................................................................
Patch Set 8: Code-Review+1
(3 comments)
LGTM
https://review.coreboot.org/c/coreboot/+/42242/3//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/42242/3//COMMIT_MSG@9 PS3, Line 9: Implement setting processor information to BMC.
It is defined in document YosemiteV3_BMC_Feature_Spec_v1.7 on dropbox.
Done
https://review.coreboot.org/c/coreboot/+/42242/3/src/drivers/ocp/ipmi/ipmi_o... File src/drivers/ocp/ipmi/ipmi_ocp.c:
https://review.coreboot.org/c/coreboot/+/42242/3/src/drivers/ocp/ipmi/ipmi_o... PS3, Line 65: memcpy(&req1.data.manufacturer_id, &mfid, 3);
If CONFIG_MANU_ID is not defined, the default value 0x0 may be used and other information may still […]
Done
https://review.coreboot.org/c/coreboot/+/42242/3/src/drivers/ocp/ipmi/ipmi_o... PS3, Line 125: /* TBD */
There should be a CPU identification table such as in chapter 2. […]
Done
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42242 )
Change subject: drivers/ocp/ipmi: Add ipmi set processor information ......................................................................
Patch Set 8: Code-Review+1
(3 comments)
https://review.coreboot.org/c/coreboot/+/42242/8/src/drivers/ocp/ipmi/Kconfi... File src/drivers/ocp/ipmi/Kconfig:
https://review.coreboot.org/c/coreboot/+/42242/8/src/drivers/ocp/ipmi/Kconfi... PS8, Line 5: MANU_ID IPMI_OCP_MANU_ID maybe?
https://review.coreboot.org/c/coreboot/+/42242/8/src/drivers/ocp/ipmi/ipmi_o... File src/drivers/ocp/ipmi/ipmi_ocp.h:
https://review.coreboot.org/c/coreboot/+/42242/8/src/drivers/ocp/ipmi/ipmi_o... PS8, Line 8: #include "drivers/ipmi/ipmi_kcs.h" Add an empty line between the #include and the #define
https://review.coreboot.org/c/coreboot/+/42242/8/src/drivers/ocp/ipmi/ipmi_o... File src/drivers/ocp/ipmi/ipmi_ocp.c:
https://review.coreboot.org/c/coreboot/+/42242/8/src/drivers/ocp/ipmi/ipmi_o... PS8, Line 127: 0xa nit: 0x0a
Hello Philipp Deppenwiese, build bot (Jenkins), Jonathan Zhang, Ryback Hung, Christian Walter, Paul Menzel, Angel Pons, Rocky Phagura, Bryant Ou, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42242
to look at the new patch set (#9).
Change subject: drivers/ocp/ipmi: Add ipmi set processor information ......................................................................
drivers/ocp/ipmi: Add ipmi set processor information
Implement setting processor information to BMC based on document YosemiteV3_BMC_Feature_Spec_v1.7.
TEST=Use get command in OpenBMC to check. Command and information are shown as below:
root@bmc-oob:~# ipmi-util 1 0xd8 0x11 0x4c 0x1c 0x00 0 1 DC 11 00 47 65 6E 75 69 6E 65 20 49 6E 74 65 6C 28 52 29 20 43 50 55 20 30 30 30 30 25 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 root@bmc-oob:~# ipmi-util 1 0xd8 0x11 0x4c 0x1c 0x00 0 2 DC 11 00 1A 34 00 DC 05 41 30 root@bmc-oob:~#
Signed-off-by: Tim Chu Tim.Chu@quantatw.com Change-Id: I3d53ac241a11ca962572816283a0c653fcde9f9e --- M src/drivers/ocp/ipmi/Kconfig M src/drivers/ocp/ipmi/ipmi_ocp.c M src/drivers/ocp/ipmi/ipmi_ocp.h 3 files changed, 137 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/42/42242/9
Tim Chu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42242 )
Change subject: drivers/ocp/ipmi: Add ipmi set processor information ......................................................................
Patch Set 9:
(3 comments)
https://review.coreboot.org/c/coreboot/+/42242/8/src/drivers/ocp/ipmi/Kconfi... File src/drivers/ocp/ipmi/Kconfig:
https://review.coreboot.org/c/coreboot/+/42242/8/src/drivers/ocp/ipmi/Kconfi... PS8, Line 5: MANU_ID
IPMI_OCP_MANU_ID maybe?
May be better. Thanks. Done
https://review.coreboot.org/c/coreboot/+/42242/8/src/drivers/ocp/ipmi/ipmi_o... File src/drivers/ocp/ipmi/ipmi_ocp.h:
https://review.coreboot.org/c/coreboot/+/42242/8/src/drivers/ocp/ipmi/ipmi_o... PS8, Line 8: #include "drivers/ipmi/ipmi_kcs.h"
Add an empty line between the #include and the #define
Done
https://review.coreboot.org/c/coreboot/+/42242/8/src/drivers/ocp/ipmi/ipmi_o... File src/drivers/ocp/ipmi/ipmi_ocp.c:
https://review.coreboot.org/c/coreboot/+/42242/8/src/drivers/ocp/ipmi/ipmi_o... PS8, Line 127: 0xa
nit: 0x0a
Done
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42242 )
Change subject: drivers/ocp/ipmi: Add ipmi set processor information ......................................................................
Patch Set 9: Code-Review+1
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42242 )
Change subject: drivers/ocp/ipmi: Add ipmi set processor information ......................................................................
Patch Set 9:
This change needs a rebase. There isn't any drivers/ocp/ipmi in master at the moment, and while CB:41605 patchset 2 added something, the current patchset is completely different.
Jonathan Zhang has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42242 )
Change subject: drivers/ocp/ipmi: Add ipmi set processor information ......................................................................
Patch Set 9:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42242/9//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/42242/9//COMMIT_MSG@7 PS9, Line 7: drivers/ocp/ipmi: Add ipmi set processor information Instead of drivers/ocp/ipmi, I would perfer drivers/ipmi/ocp instead.
Tim Chu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42242 )
Change subject: drivers/ocp/ipmi: Add ipmi set processor information ......................................................................
Patch Set 9:
(1 comment)
This change is ready for review.
https://review.coreboot.org/c/coreboot/+/42242/9//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/42242/9//COMMIT_MSG@7 PS9, Line 7: drivers/ocp/ipmi: Add ipmi set processor information
Instead of drivers/ocp/ipmi, I would perfer drivers/ipmi/ocp instead.
Because there are other ocp functions such as dmi(CB:40308), maybe drivers/ocp/ipmi is better?
Jonathan Zhang has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42242 )
Change subject: drivers/ocp/ipmi: Add ipmi set processor information ......................................................................
Patch Set 9:
(1 comment)
This change is ready for review.
https://review.coreboot.org/c/coreboot/+/42242/9//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/42242/9//COMMIT_MSG@7 PS9, Line 7: drivers/ocp/ipmi: Add ipmi set processor information
Because there are other ocp functions such as dmi(CB:40308), maybe drivers/ocp/ipmi is better?
no. drivers/ipmi/ocp is better. The first level directory under drivers is better to be technology (eg. ipmi).
Tim Chu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42242 )
Change subject: drivers/ipmi/ocp: Add ipmi set processor information ......................................................................
Set Ready For Review
Tim Chu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42242 )
Change subject: drivers/ipmi/ocp: Add ipmi set processor information ......................................................................
Patch Set 11:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42242/9//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/42242/9//COMMIT_MSG@7 PS9, Line 7: drivers/ocp/ipmi: Add ipmi set processor information
I'd prefer `drivers/ipmi/ocp` too.
Done
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42242 )
Change subject: drivers/ipmi/ocp: Add ipmi set processor information ......................................................................
Patch Set 11: Code-Review+2
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42242 )
Change subject: drivers/ipmi/ocp: Add ipmi set processor information ......................................................................
Patch Set 11:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42242/11/src/drivers/ipmi/ocp/ipmi_... File src/drivers/ipmi/ocp/ipmi_ocp.h:
https://review.coreboot.org/c/coreboot/+/42242/11/src/drivers/ipmi/ocp/ipmi_... PS11, Line 6: double blank line
Hello Philipp Deppenwiese, build bot (Jenkins), Jonathan Zhang, Ryback Hung, Christian Walter, Paul Menzel, Angel Pons, Rocky Phagura, Bryant Ou, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42242
to look at the new patch set (#12).
Change subject: drivers/ipmi/ocp: Add ipmi set processor information ......................................................................
drivers/ipmi/ocp: Add ipmi set processor information
Implement setting processor information to BMC based on document YosemiteV3_BMC_Feature_Spec_v1.7.
TEST=Use get command in OpenBMC to check. Command and information are shown as below:
root@bmc-oob:~# ipmi-util 1 0xd8 0x11 0x4c 0x1c 0x00 0 1 DC 11 00 47 65 6E 75 69 6E 65 20 49 6E 74 65 6C 28 52 29 20 43 50 55 20 30 30 30 30 25 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 root@bmc-oob:~# ipmi-util 1 0xd8 0x11 0x4c 0x1c 0x00 0 2 DC 11 00 1A 34 00 DC 05 41 30 root@bmc-oob:~#
Signed-off-by: Tim Chu Tim.Chu@quantatw.com Change-Id: I3d53ac241a11ca962572816283a0c653fcde9f9e --- M src/drivers/ipmi/ocp/Kconfig M src/drivers/ipmi/ocp/ipmi_ocp.c M src/drivers/ipmi/ocp/ipmi_ocp.h 3 files changed, 138 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/42/42242/12
Tim Chu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42242 )
Change subject: drivers/ipmi/ocp: Add ipmi set processor information ......................................................................
Patch Set 12:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42242/11/src/drivers/ipmi/ocp/ipmi_... File src/drivers/ipmi/ocp/ipmi_ocp.h:
https://review.coreboot.org/c/coreboot/+/42242/11/src/drivers/ipmi/ocp/ipmi_... PS11, Line 6:
double blank line
Done
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42242 )
Change subject: drivers/ipmi/ocp: Add ipmi set processor information ......................................................................
Patch Set 12: Code-Review+2
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/42242 )
Change subject: drivers/ipmi/ocp: Add ipmi set processor information ......................................................................
drivers/ipmi/ocp: Add ipmi set processor information
Implement setting processor information to BMC based on document YosemiteV3_BMC_Feature_Spec_v1.7.
TEST=Use get command in OpenBMC to check. Command and information are shown as below:
root@bmc-oob:~# ipmi-util 1 0xd8 0x11 0x4c 0x1c 0x00 0 1 DC 11 00 47 65 6E 75 69 6E 65 20 49 6E 74 65 6C 28 52 29 20 43 50 55 20 30 30 30 30 25 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 root@bmc-oob:~# ipmi-util 1 0xd8 0x11 0x4c 0x1c 0x00 0 2 DC 11 00 1A 34 00 DC 05 41 30 root@bmc-oob:~#
Signed-off-by: Tim Chu Tim.Chu@quantatw.com Change-Id: I3d53ac241a11ca962572816283a0c653fcde9f9e Reviewed-on: https://review.coreboot.org/c/coreboot/+/42242 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Angel Pons th3fanbus@gmail.com --- M src/drivers/ipmi/ocp/Kconfig M src/drivers/ipmi/ocp/ipmi_ocp.c M src/drivers/ipmi/ocp/ipmi_ocp.h 3 files changed, 138 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Angel Pons: Looks good to me, approved
diff --git a/src/drivers/ipmi/ocp/Kconfig b/src/drivers/ipmi/ocp/Kconfig index 7899e69..26503ef 100644 --- a/src/drivers/ipmi/ocp/Kconfig +++ b/src/drivers/ipmi/ocp/Kconfig @@ -3,3 +3,8 @@ default n help This implements OCP specific IPMI command + +config IPMI_OCP_MANU_ID + hex + default 0x0 + depends on IPMI_OCP diff --git a/src/drivers/ipmi/ocp/ipmi_ocp.c b/src/drivers/ipmi/ocp/ipmi_ocp.c index 1866708..f96ce24 100644 --- a/src/drivers/ipmi/ocp/ipmi_ocp.c +++ b/src/drivers/ipmi/ocp/ipmi_ocp.c @@ -10,10 +10,110 @@ #include <console/console.h> #include <device/device.h> #include <device/pnp.h> +#include <string.h> +#include <intelblocks/cpulib.h> +#include <arch/cpu.h> #include "chip.h" #include "drivers/ipmi/ipmi_kcs.h" #include "ipmi_ocp.h"
+static int ipmi_set_processor_information_param1(struct device *dev) +{ + int ret; + struct ipmi_processor_info_param1_req req1 = {0}; + struct ipmi_rsp rsp; + int mfid = CONFIG_IPMI_OCP_MANU_ID; + + memcpy(&req1.data.manufacturer_id, &mfid, 3); + printk(BIOS_DEBUG, "IPMI BMC manufacturer id: %02x%02x%02x\n", + req1.data.manufacturer_id[2], req1.data.manufacturer_id[1], + req1.data.manufacturer_id[0]); + + req1.data.index = 0; + req1.data.parameter_selector = 1; + + /* Get processor name. */ + fill_processor_name(req1.product_name); + printk(BIOS_DEBUG, "IPMI BMC CPU NAME: %s.\n", req1.product_name); + + ret = ipmi_kcs_message(dev->path.pnp.port, IPMI_NETFN_OEM_COMMON, 0, + IPMI_BMC_SET_PROCESSOR_INFORMATION, (u8 *) &req1, + sizeof(req1), (u8 *) &rsp, sizeof(rsp)); + + if (ret < sizeof(struct ipmi_rsp) || rsp.completion_code) { + printk(BIOS_ERR, "IPMI BMC: %s command failed (ret=%d rsp=0x%x)\n", + __func__, ret, rsp.completion_code); + return CB_ERR; + } + return CB_SUCCESS; +} + +static int ipmi_set_processor_information_param2(struct device *dev) +{ + int ret; + struct ipmi_processor_info_param2_req req2 = {0}; + struct ipmi_rsp rsp; + uint8_t stepping_id; + int mfid = CONFIG_IPMI_OCP_MANU_ID; + unsigned int core_count, thread_count; + struct cpuinfo_x86 c; + + memcpy(&req2.data.manufacturer_id, &mfid, 3); + printk(BIOS_DEBUG, "IPMI BMC manufacturer id: %02x%02x%02x\n", + req2.data.manufacturer_id[2], req2.data.manufacturer_id[1], + req2.data.manufacturer_id[0]); + + req2.data.index = 0; + req2.data.parameter_selector = 2; + + /* Get core number and thread number. */ + cpu_read_topology(&core_count, &thread_count); + req2.core_number = core_count; + req2.thread_number = thread_count; + printk(BIOS_DEBUG, "IPMI BMC CPU has %u cores, %u threads enabled.\n", + req2.core_number, req2.thread_number); + + /* Get processor frequency. */ + req2.processor_freq = 100 * cpu_get_max_ratio(); + printk(BIOS_DEBUG, "IPMI BMC CPU frequency is %u MHz.\n", + req2.processor_freq); + + /* Get revision. */ + get_fms(&c, cpuid_eax(1)); + stepping_id = c.x86_mask; + printk(BIOS_DEBUG, "IPMI BMC CPU stepping id is %x.\n", stepping_id); + switch (stepping_id) { + /* TBD */ + case 0x0a: + req2.revision[0] = 'A'; + req2.revision[1] = '0'; + break; + default: + req2.revision[0] = 'X'; + req2.revision[1] = 'X'; + } + + ret = ipmi_kcs_message(dev->path.pnp.port, IPMI_NETFN_OEM_COMMON, 0, + IPMI_BMC_SET_PROCESSOR_INFORMATION, (u8 *) &req2, + sizeof(req2), (u8 *) &rsp, sizeof(rsp)); + + if (ret < sizeof(struct ipmi_rsp) || rsp.completion_code) { + printk(BIOS_ERR, "IPMI: %s command failed (ret=%d rsp=0x%x)\n", + __func__, ret, rsp.completion_code); + return CB_ERR; + } + return CB_SUCCESS; +} + +static void ipmi_set_processor_information(struct device *dev) +{ + if (ipmi_set_processor_information_param1(dev)) + printk(BIOS_ERR, "IPMI BMC set param 1 processor info failed\n"); + + if (ipmi_set_processor_information_param2(dev)) + printk(BIOS_ERR, "IPMI BMC set param 2 processor info failed\n"); +} + static void ipmi_ocp_init(struct device *dev) { /* Add OCP specific IPMI command */ @@ -22,6 +122,9 @@ static void ipmi_ocp_final(struct device *dev) { /* Add OCP specific IPMI command */ + + /* Send processor information */ + ipmi_set_processor_information(dev); }
static void ipmi_set_resources(struct device *dev) diff --git a/src/drivers/ipmi/ocp/ipmi_ocp.h b/src/drivers/ipmi/ocp/ipmi_ocp.h index 9aebbe9..96b0086 100644 --- a/src/drivers/ipmi/ocp/ipmi_ocp.h +++ b/src/drivers/ipmi/ocp/ipmi_ocp.h @@ -3,4 +3,34 @@ #ifndef __IPMI_OCP_H #define __IPMI_OCP_H
+#include <cpu/x86/msr.h> +#include <cpu/x86/name.h> +#include "drivers/ipmi/ipmi_kcs.h" + +#define IPMI_NETFN_OEM_COMMON 0x36 +#define IPMI_BMC_SET_PROCESSOR_INFORMATION 0x10 +#define IPMI_BMC_GET_PROCESSOR_INFORMATION 0x11 + +#define MSR_CORE_THREAD_COUNT 0x35 +#define MSR_PLATFORM_INFO 0xce + +struct ipmi_processor_info_req { + uint8_t manufacturer_id[3]; + uint8_t index; + uint8_t parameter_selector; +} __packed; + +struct ipmi_processor_info_param1_req { + struct ipmi_processor_info_req data; + char product_name[48]; +} __packed; + +struct ipmi_processor_info_param2_req { + struct ipmi_processor_info_req data; + uint8_t core_number; + uint16_t thread_number; + uint16_t processor_freq; + char revision[2]; +} __packed; + #endif