aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2010-07-26 05:03:58 -0400
committerMatthew Garrett <mjg@redhat.com>2010-08-03 09:50:30 -0400
commit9dd3adeb00b14d4b3d106360e2e33272deab35f3 (patch)
tree4d6f85882d65107c6aa1076d07286eb2bb620774 /drivers/platform
parenta5b74e69e1238eb46a6fcf2b9dc9d0e4efbb4e46 (diff)
intel_scu_ipc: Use the new cpu identification function
This provides an architecture level board identify function to replace the cpuid direct usage Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/intel_scu_ipc.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/drivers/platform/x86/intel_scu_ipc.c b/drivers/platform/x86/intel_scu_ipc.c
index 2245876836ec..5258749138d6 100644
--- a/drivers/platform/x86/intel_scu_ipc.c
+++ b/drivers/platform/x86/intel_scu_ipc.c
@@ -74,8 +74,6 @@ struct intel_scu_ipc_dev {
74 74
75static struct intel_scu_ipc_dev ipcdev; /* Only one for now */ 75static struct intel_scu_ipc_dev ipcdev; /* Only one for now */
76 76
77#define PLATFORM_LANGWELL 1
78#define PLATFORM_PENWELL 2
79static int platform; /* Platform type */ 77static int platform; /* Platform type */
80 78
81/* 79/*
@@ -169,7 +167,7 @@ static int pwr_reg_rdwr(u16 *addr, u8 *data, u32 count, u32 op, u32 id)
169 return -ENODEV; 167 return -ENODEV;
170 } 168 }
171 169
172 if (platform == PLATFORM_LANGWELL) { 170 if (platform != MRST_CPU_CHIP_PENWELL) {
173 /* Entry is 4 bytes for read/write, 5 bytes for read modify */ 171 /* Entry is 4 bytes for read/write, 5 bytes for read modify */
174 for (nc = 0; nc < count; nc++, offset += 3) { 172 for (nc = 0; nc < count; nc++, offset += 3) {
175 cbuf[offset] = addr[nc]; 173 cbuf[offset] = addr[nc];
@@ -217,7 +215,7 @@ static int pwr_reg_rdwr(u16 *addr, u8 *data, u32 count, u32 op, u32 id)
217 if (id == IPC_CMD_PCNTRL_R) { /* Read rbuf */ 215 if (id == IPC_CMD_PCNTRL_R) { /* Read rbuf */
218 /* Workaround: values are read as 0 without memcpy_fromio */ 216 /* Workaround: values are read as 0 without memcpy_fromio */
219 memcpy_fromio(cbuf, ipcdev.ipc_base + 0x90, 16); 217 memcpy_fromio(cbuf, ipcdev.ipc_base + 0x90, 16);
220 if (platform == PLATFORM_LANGWELL) { 218 if (platform != MRST_CPU_CHIP_PENWELL) {
221 for (nc = 0, offset = 2; nc < count; nc++, offset += 3) 219 for (nc = 0, offset = 2; nc < count; nc++, offset += 3)
222 data[nc] = ipc_data_readb(offset); 220 data[nc] = ipc_data_readb(offset);
223 } else { 221 } else {
@@ -741,14 +739,9 @@ static struct pci_driver ipc_driver = {
741 739
742static int __init intel_scu_ipc_init(void) 740static int __init intel_scu_ipc_init(void)
743{ 741{
744 if (boot_cpu_data.x86 == 6 && 742 platform = mrst_identify_cpu();
745 boot_cpu_data.x86_model == 0x27 && 743 if (platform == 0)
746 boot_cpu_data.x86_mask == 1) 744 return -ENODEV;
747 platform = PLATFORM_PENWELL;
748 else if (boot_cpu_data.x86 == 6 &&
749 boot_cpu_data.x86_model == 0x26)
750 platform = PLATFORM_LANGWELL;
751
752 return pci_register_driver(&ipc_driver); 745 return pci_register_driver(&ipc_driver);
753} 746}
754 747