Cougar/Panther Point: Compile in ME7 and ME8 code at the same time

In the short term there might be devices with Sandy Bridge CPUs
on mainboards with Panther Point PCHes. While this configuration
option is perfectly valid, coreboot currently ties Sandy Bridge to
Cougar Point and Ivy Bridge to Panther Point. One occurence is in
the ME handling code.

To make coreboot most flexible, compile both ME handlers into
coreboot and decide at runtime which one to use.

Change-Id: Icffe2930873f67c99c3f73e37e7a967f4f002b88
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1280
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
This commit is contained in:
Stefan Reinauer 2012-06-11 15:15:46 -07:00 committed by Ronald G. Minnich
parent 49058c0adf
commit 998f3a27be
4 changed files with 29 additions and 15 deletions

View File

@ -17,9 +17,6 @@
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
## ##
me-src-$(CONFIG_NORTHBRIDGE_INTEL_SANDYBRIDGE) += me.c
me-src-$(CONFIG_NORTHBRIDGE_INTEL_IVYBRIDGE) += me_8.x.c
driver-y += pch.c driver-y += pch.c
driver-y += azalia.c driver-y += azalia.c
driver-y += lpc.c driver-y += lpc.c
@ -27,7 +24,8 @@ driver-y += pci.c
driver-y += pcie.c driver-y += pcie.c
driver-y += sata.c driver-y += sata.c
driver-y += usb_ehci.c driver-y += usb_ehci.c
driver-y += $(me-src-y) driver-y += me.c
driver-y += me_8.x.c
driver-y += smbus.c driver-y += smbus.c
ramstage-y += me_status.c ramstage-y += me_status.c
@ -37,7 +35,7 @@ ramstage-y += watchdog.c
ramstage-y += spi.c ramstage-y += spi.c
ramstage-$(CONFIG_HAVE_SMI_HANDLER) += smi.c ramstage-$(CONFIG_HAVE_SMI_HANDLER) += smi.c
smm-$(CONFIG_HAVE_SMI_HANDLER) += smihandler.c $(me-src-y) finalize.c smm-$(CONFIG_HAVE_SMI_HANDLER) += smihandler.c me.c me_8.x.c finalize.c
romstage-y += early_usb.c early_smbus.c early_me.c me_status.c gpio.c romstage-y += early_usb.c early_smbus.c early_me.c me_status.c gpio.c
romstage-$(CONFIG_USBDEBUG) += usb_debug.c romstage-$(CONFIG_USBDEBUG) += usb_debug.c

View File

@ -353,8 +353,9 @@ static inline int mei_sendrecv(struct mei_header *mei, struct mkhi_header *mkhi,
return 0; return 0;
} }
#ifdef __SMM__
/* Send END OF POST message to the ME */ /* Send END OF POST message to the ME */
int mkhi_end_of_post(void) static int mkhi_end_of_post(void)
{ {
struct mkhi_header mkhi = { struct mkhi_header mkhi = {
.group_id = MKHI_GROUP_ID_GEN, .group_id = MKHI_GROUP_ID_GEN,
@ -376,6 +377,7 @@ int mkhi_end_of_post(void)
printk(BIOS_INFO, "ME: END OF POST message successful\n"); printk(BIOS_INFO, "ME: END OF POST message successful\n");
return 0; return 0;
} }
#endif
#if (CONFIG_DEFAULT_CONSOLE_LOGLEVEL >= BIOS_DEBUG) && !defined(__SMM__) #if (CONFIG_DEFAULT_CONSOLE_LOGLEVEL >= BIOS_DEBUG) && !defined(__SMM__)
/* Get ME firmware version */ /* Get ME firmware version */
@ -460,6 +462,7 @@ static int mkhi_get_fwcaps(void)
} }
#endif #endif
#if CONFIG_CHROMEOS && 0 /* DISABLED */
/* Tell ME to issue a global reset */ /* Tell ME to issue a global reset */
int mkhi_global_reset(void) int mkhi_global_reset(void)
{ {
@ -490,10 +493,10 @@ int mkhi_global_reset(void)
printk(BIOS_ERR, "ME: Global Reset failed\n"); printk(BIOS_ERR, "ME: Global Reset failed\n");
return -1; return -1;
} }
#endif
#ifdef __SMM__ #ifdef __SMM__
static void intel_me7_finalize_smm(void)
void intel_me_finalize_smm(void)
{ {
struct me_hfs hfs; struct me_hfs hfs;
u32 reg32; u32 reg32;
@ -528,6 +531,20 @@ void intel_me_finalize_smm(void)
RCBA32_OR(FD2, PCH_DISABLE_MEI1); RCBA32_OR(FD2, PCH_DISABLE_MEI1);
} }
void intel_me_finalize_smm(void)
{
u32 did = pci_read_config32(PCH_ME_DEV, PCI_VENDOR_ID);
switch (did) {
case 0x80861c3a:
intel_me7_finalize_smm();
break;
case 0x80861e3a:
intel_me8_finalize_smm();
break;
default:
printk(BIOS_ERR, "No finalize handler for ME %08x.\n", did);
}
}
#else /* !__SMM__ */ #else /* !__SMM__ */
/* Determine the path that we should take based on ME status */ /* Determine the path that we should take based on ME status */

View File

@ -248,14 +248,11 @@ void intel_early_me_status(void);
int intel_early_me_init(void); int intel_early_me_init(void);
int intel_early_me_uma_size(void); int intel_early_me_uma_size(void);
int intel_early_me_init_done(u8 status); int intel_early_me_init_done(u8 status);
#else
/* ME Kernel Host Interface Messages */
int mkhi_end_of_post(void);
int mkhi_global_reset(void);
#endif #endif
#ifdef __SMM__ #ifdef __SMM__
void intel_me_finalize_smm(void); void intel_me_finalize_smm(void);
void intel_me8_finalize_smm(void);
#endif #endif
typedef struct { typedef struct {
u32 major_version : 16; u32 major_version : 16;

View File

@ -357,7 +357,7 @@ static inline int mei_sendrecv(struct mei_header *mei, struct mkhi_header *mkhi,
} }
/* Send END OF POST message to the ME */ /* Send END OF POST message to the ME */
int mkhi_end_of_post(void) static int mkhi_end_of_post(void)
{ {
struct mkhi_header mkhi = { struct mkhi_header mkhi = {
.group_id = MKHI_GROUP_ID_GEN, .group_id = MKHI_GROUP_ID_GEN,
@ -457,8 +457,9 @@ static void me_print_fwcaps(mbp_fw_caps *caps_section)
} }
#endif #endif
#if CONFIG_CHROMEOS && 0 /* DISABLED */
/* Tell ME to issue a global reset */ /* Tell ME to issue a global reset */
int mkhi_global_reset(void) static int mkhi_global_reset(void)
{ {
struct me_global_reset reset = { struct me_global_reset reset = {
.request_origin = GLOBAL_RESET_BIOS_POST, .request_origin = GLOBAL_RESET_BIOS_POST,
@ -486,10 +487,11 @@ int mkhi_global_reset(void)
printk(BIOS_ERR, "ME: Global Reset failed\n"); printk(BIOS_ERR, "ME: Global Reset failed\n");
return -1; return -1;
} }
#endif
#ifdef __SMM__ #ifdef __SMM__
void intel_me_finalize_smm(void) void intel_me8_finalize_smm(void)
{ {
struct me_hfs hfs; struct me_hfs hfs;
u32 reg32; u32 reg32;