fpga: m10bmc-sec: Add support for N6000
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Mon, 16 Jan 2023 10:08:45 +0000 (12:08 +0200)
committerLee Jones <lee@kernel.org>
Mon, 30 Jan 2023 08:14:02 +0000 (08:14 +0000)
commitacf63c458b55ecfb2015b33dd6ba3cc8fbc1c5d3
tree9e6856de76c85b84434e86df06696ef5f55a39b4
parent869b9eddf0b38a22c27a400e2fa849d2ff2aa7e1
fpga: m10bmc-sec: Add support for N6000

Add support for PMCI-based flash access path and N6000 sec update
support. Access to flash staging area is different for N6000 from that
of the SPI interfaced counterparts.

Introduce intel_m10bmc_flash_bulk_ops to allow interface specific
differentiations for the flash access path for sec update and make
m10bmc_sec_read/write() in sec update driver to use the new operations.
The .flash_mutex serializes read/read. Flash update (erase+write) must
use ->lock/unlock_write() to prevent reads during update (reads would
timeout on setting flash MUX as BMC will prevent it).

Create a type specific RSU status reg handler for N6000 because the
field has moved from doorbell to auth result register.

If a failure is detected while altering the flash MUX, it seems safer
to try to set it back and doesn't seem harmful. Likely there are enough
troubles in that case anyway so setting it back fails too (which is
harmless sans the small extra delay) or just confirms that the value
wasn't changed.

Co-developed-by: Tianfei zhang <tianfei.zhang@intel.com>
Signed-off-by: Tianfei zhang <tianfei.zhang@intel.com>
Co-developed-by: Russ Weight <russell.h.weight@intel.com>
Signed-off-by: Russ Weight <russell.h.weight@intel.com>
Acked-by: Xu Yilun <yilun.xu@intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Lee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/20230116100845.6153-12-ilpo.jarvinen@linux.intel.com
drivers/fpga/intel-m10-bmc-sec-update.c
drivers/mfd/intel-m10-bmc-pmci.c
include/linux/mfd/intel-m10-bmc.h