}
sep_set_time(sep);
- /* Only Medfield has caller id */
- if (sep->mrst == 0)
- sep_set_current_caller_id(sep);
+ sep_set_current_caller_id(sep);
sep_dump_message(sep);
error = sep_end_transaction_handler(sep);
break;
case SEP_IOCREALLOCEXTCACHE:
- if (sep->mrst)
- error = -ENODEV;
if (sep->pdev->revision == 0) /* Only for old chip */
error = sep_realloc_ext_cache_handler(sep, arg);
else
return int_error;
}
-/**
- * sep_callback - RAR callback
- * @sep_context_pointer: pointer to struct sep_device
- *
- * Function that is called by rar_register when it is ready with
- * a region (only for Moorestown)
- */
-static int sep_callback(unsigned long sep_context_pointer)
-{
- int error;
- struct sep_device *sep = (struct sep_device *)sep_context_pointer;
- dma_addr_t rar_end_address;
-
- dev_dbg(&sep->pdev->dev, "callback start\n");
-
- error = rar_get_address(RAR_TYPE_IMAGE, &sep->rar_bus,
- &rar_end_address);
-
- if (error) {
- dev_warn(&sep->pdev->dev, "mrst can't get rar region\n");
- goto end_function;
- }
-
- sep->rar_size = (size_t)(rar_end_address - sep->rar_bus + 1);
-
- if (!request_mem_region(sep->rar_bus, sep->rar_size,
- "sep_sec_driver")) {
- dev_warn(&sep->pdev->dev,
- "request mem region for mrst failed\n");
- error = -1;
- goto end_function;
- }
-
- sep->rar_addr = ioremap_nocache(sep->rar_bus, sep->rar_size);
- if (!sep->rar_addr) {
- dev_warn(&sep->pdev->dev,
- "ioremap nocache for mrst rar failed\n");
- error = -ENOMEM;
- goto end_function;
- }
- dev_dbg(&sep->pdev->dev, "rar start is %p, phy is %llx, size is %zx\n",
- sep->rar_addr, (unsigned long long)sep->rar_bus,
- sep->rar_size);
-
-end_function:
- dev_dbg(&sep->pdev->dev, "callback end\n");
- return error;
-}
-
/**
* sep_reconfig_shared_area - reconfigure shared area
* @sep: pointer to struct sep_device
return ret_val;
}
- if (!sep->mrst) {
- ret_val = misc_register(&sep->miscdev_daemon);
- if (ret_val) {
- dev_warn(&sep->pdev->dev, "misc reg fails for dmn %x\n",
- ret_val);
- misc_deregister(&sep->miscdev_sep);
- misc_deregister(&sep->miscdev_singleton);
+ ret_val = misc_register(&sep->miscdev_daemon);
+ if (ret_val) {
+ dev_warn(&sep->pdev->dev, "misc reg fails for dmn %x\n",
+ ret_val);
+ misc_deregister(&sep->miscdev_sep);
+ misc_deregister(&sep->miscdev_singleton);
- return ret_val;
- }
+ return ret_val;
}
return ret_val;
}
mutex_init(&sep->sep_mutex);
mutex_init(&sep->ioctl_mutex);
- if (pdev->device == MRST_PCI_DEVICE_ID)
- sep->mrst = 1;
-
dev_dbg(&sep->pdev->dev, "PCI obtained, device being prepared\n");
dev_dbg(&sep->pdev->dev, "revision is %d\n", sep->pdev->revision);
goto end_function_error;
}
- /* The next section depends on type of unit */
- if (sep->mrst) {
- error = register_rar(RAR_TYPE_IMAGE, &sep_callback,
- (unsigned long)sep);
- if (error) {
- dev_dbg(&sep->pdev->dev,
- "error register_rar\n");
- goto end_function_deallocate_sep_shared_area;
- }
- } else {
- sep->rar_size = FAKE_RAR_SIZE;
- sep->rar_addr = dma_alloc_coherent(NULL,
- sep->rar_size, &sep->rar_bus, GFP_KERNEL);
- if (sep->rar_addr == NULL) {
- dev_warn(&sep->pdev->dev, "can't allocate mfld rar\n");
- error = -ENOMEM;
- goto end_function_deallocate_sep_shared_area;
- }
-
- dev_dbg(&sep->pdev->dev, "rar start is %p, phy is %llx,"
- " size is %zx\n", sep->rar_addr,
- (unsigned long long)sep->rar_bus,
- sep->rar_size);
+ sep->rar_size = FAKE_RAR_SIZE;
+ sep->rar_addr = dma_alloc_coherent(NULL,
+ sep->rar_size, &sep->rar_bus, GFP_KERNEL);
+ if (sep->rar_addr == NULL) {
+ dev_warn(&sep->pdev->dev, "can't allocate mfld rar\n");
+ error = -ENOMEM;
+ goto end_function_deallocate_sep_shared_area;
}
+ dev_dbg(&sep->pdev->dev, "rar start is %p, phy is %llx,"
+ " size is %zx\n", sep->rar_addr,
+ (unsigned long long)sep->rar_bus,
+ sep->rar_size);
+
dev_dbg(&sep->pdev->dev, "about to write IMR and ICR REG_ADDR\n");
/* Clear ICR register */
}
static DEFINE_PCI_DEVICE_TABLE(sep_pci_id_tbl) = {
- {PCI_DEVICE(PCI_VENDOR_ID_INTEL, MRST_PCI_DEVICE_ID)},
{PCI_DEVICE(PCI_VENDOR_ID_INTEL, MFLD_PCI_DEVICE_ID)},
{0}
};