android_kernel_xiaomi_sm8450/drivers/platform/mellanox
David Thompson a657bddfb4 mlxbf-bootctl: correctly identify secure boot with development keys
[ Upstream commit d4eef75279f5e9d594f5785502038c763ce42268 ]

The secure boot state of the BlueField SoC is represented by two bits:
                0 = production state
                1 = secure boot enabled
                2 = non-secure (secure boot disabled)
                3 = RMA state
There is also a single bit to indicate whether production keys or
development keys are being used when secure boot is enabled.
This single bit (specified by MLXBF_BOOTCTL_SB_DEV_MASK) only has
meaning if secure boot state equals 1 (secure boot enabled).

The secure boot states are as follows:
- “GA secured” is when secure boot is enabled with official production keys.
- “Secured (development)” is when secure boot is enabled with development keys.

Without this fix “GA Secured” is displayed on development cards which is
misleading. This patch updates the logic in "lifecycle_state_show()" to
handle the case where the SoC is configured for secure boot and is using
development keys.

Fixes: 79e29cb8fb ("platform/mellanox: Add bootctl driver for Mellanox BlueField Soc")
Reviewed-by: Khalil Blaiech <kblaiech@nvidia.com>
Signed-off-by: David Thompson <davthompson@nvidia.com>
Link: https://lore.kernel.org/r/20231130183515.17214-1-davthompson@nvidia.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-12-13 18:26:59 +01:00
..
Kconfig platform/mellanox: mlxbf-bootctl: add NET dependency into Kconfig 2023-10-10 21:53:32 +02:00
Makefile platform/mellanox: Add bootctl driver for Mellanox BlueField Soc 2019-10-15 10:55:10 +03:00
mlxbf-bootctl.c mlxbf-bootctl: correctly identify secure boot with development keys 2023-12-13 18:26:59 +01:00
mlxbf-bootctl.h platform/mellanox: Add bootctl driver for Mellanox BlueField Soc 2019-10-15 10:55:10 +03:00
mlxbf-tmfifo-regs.h platform/mellanox: Add TmFifo driver for Mellanox BlueField Soc 2019-05-06 17:54:42 +03:00
mlxbf-tmfifo.c platform/mellanox: mlxbf-tmfifo: Fix a warning message 2023-11-08 17:30:49 +01:00
mlxreg-hotplug.c platform/mellanox: mlxreg-hotplug: Add environmental data to uevent 2020-07-15 12:45:07 +03:00
mlxreg-io.c platform/mellanox: mlxreg-io: Fix read access of n-bytes size attributes 2021-10-20 11:45:05 +02:00