if (!dev_priv->sgx_reg)
goto out_err;
+ /*WA in PO: Program SGX544MP master clk gating earlier, or CPU stuck later
+ *before loading SGX driver, root cause is still unkown
+ */
+#if defined(SGX_FEATURE_MP)
+ if (IS_CTP_NEED_WA(dev)) {
+ if (SGX_FEATURE_MP_CORE_COUNT == 2) {
+ iowrite32(0x1, dev_priv->sgx_reg + 0x4000);
+ iowrite32(0xa, dev_priv->sgx_reg + 0x4004);
+ } else if (SGX_FEATURE_MP_CORE_COUNT == 1) {
+ iowrite32(0x0, dev_priv->sgx_reg + 0x4000);
+ iowrite32(0x2, dev_priv->sgx_reg + 0x4004);
+ }
+ iowrite32(0x2aa, dev_priv->sgx_reg + 0x4020);
+ }
+#endif
+
if (IS_MID(dev)) {
mrst_get_fuse_settings(dev);
mrst_get_vbt_data(dev_priv);
#define IS_CTP(dev) (((dev->pci_device & 0xffff) == 0x08c0) || \
((dev->pci_device & 0xffff) == 0x08c7) || \
((dev->pci_device & 0xffff) == 0x08c8))
+
+#define IS_CTP_NEED_WA(dev) ((dev->pci_device & 0xffff) == 0x08c8)
+
#define IS_MDFLD(dev) (IS_CTP(dev) || IS_MDFLD_OLD(dev))
#define IS_MID(dev) (IS_MRST(dev) || IS_MDFLD(dev))