/* * Check for a access to the registers. If this read returns * 0xffffffff, it's likely that the system is running a broken * BIOS which disallows access to the device. Stop here and * fail the PSP initialization (but not the load, as the CCP * could get properly initialized).
*/ if (val == 0xffffffff) {
dev_notice(psp->dev, "psp: unable to access the device: you might be running a broken BIOS.\n"); return -ENODEV;
}
psp->capability.raw = val;
return 0;
}
staticint psp_check_sev_support(struct psp_device *psp)
{ /* Check if device supports SEV feature */ if (!psp->capability.sev) {
dev_dbg(psp->dev, "psp does not support SEV\n"); return -ENODEV;
}
return 0;
}
staticint psp_check_tee_support(struct psp_device *psp)
{ /* Check if device supports TEE feature */ if (!psp->capability.tee) {
dev_dbg(psp->dev, "psp does not support TEE\n"); return -ENODEV;
}
return 0;
}
staticint psp_init(struct psp_device *psp)
{ int ret;
if (!psp_check_sev_support(psp)) {
ret = sev_dev_init(psp); if (ret) return ret;
}
if (!psp_check_tee_support(psp)) {
ret = tee_dev_init(psp); if (ret) return ret;
}
if (psp->vdata->platform_access) {
ret = platform_access_dev_init(psp); if (ret) return ret;
}
/* dbc must come after platform access as it tests the feature */ if (PSP_FEATURE(psp, DBC) ||
psp->capability.dbc_thru_ext) {
ret = dbc_dev_init(psp); if (ret) return ret;
}
/* HSTI uses platform access on some systems. */
ret = psp_init_hsti(psp); if (ret) return ret;
return 0;
}
int psp_dev_init(struct sp_device *sp)
{ struct device *dev = sp->dev; struct psp_device *psp; int ret;
ret = -ENOMEM;
psp = psp_alloc_struct(sp); if (!psp) goto e_err;
sp->psp_data = psp;
psp->vdata = (struct psp_vdata *)sp->dev_vdata->psp_vdata; if (!psp->vdata) {
ret = -ENODEV;
dev_err(dev, "missing driver data\n"); goto e_err;
}
ret = psp_get_capability(psp); if (ret) goto e_disable;
/* Disable and clear interrupts until ready */
iowrite32(0, psp->io_regs + psp->vdata->inten_reg);
iowrite32(-1, psp->io_regs + psp->vdata->intsts_reg);
/* Request an irq */
ret = sp_request_psp_irq(psp->sp, psp_irq_handler, psp->name, psp); if (ret) {
dev_err(dev, "psp: unable to allocate an IRQ\n"); goto e_err;
}
/* master device must be set for platform access */ if (psp->sp->set_psp_master_device)
psp->sp->set_psp_master_device(psp->sp);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.