From: Krzysztof Michonski <michonskikrzysztof@xxxxxxxxx> Extend the meson_sm driver by adding gxl structure and SECURITY_KEY commands. Signed-off-by: Krzysztof Michonski <michonskikrzysztof@xxxxxxxxx> --- drivers/firmware/meson/meson_sm.c | 14 ++++++++++++++ include/linux/firmware/meson/meson_sm.h | 3 +++ 2 files changed, 17 insertions(+) diff --git a/drivers/firmware/meson/meson_sm.c b/drivers/firmware/meson/meson_sm.c index 29fbc818a573..b19489f759fc 100644 --- a/drivers/firmware/meson/meson_sm.c +++ b/drivers/firmware/meson/meson_sm.c @@ -54,6 +54,19 @@ struct meson_sm_chip gxbb_chip = { }, }; +struct meson_sm_chip gxl_chip = { + .shmem_size = SZ_4K, + .cmd_shmem_in_base = 0x82000023, + .cmd_shmem_out_base = 0x82000024, + .cmd = { + CMD(SM_SECURITY_KEY_READ, 0x82000061), + CMD(SM_SECURITY_KEY_WRITE, 0x82000062), + CMD(SM_SECURITY_KEY_TELL, 0x82000063), + CMD(SM_GET_CHIP_ID, 0x82000044), + { /* sentinel */ }, + }, +}; + struct meson_sm_firmware { const struct meson_sm_chip *chip; void __iomem *sm_shmem_in_base; @@ -269,6 +282,7 @@ static const struct attribute_group meson_sm_sysfs_attr_group = { static const struct of_device_id meson_sm_ids[] = { { .compatible = "amlogic,meson-gxbb-sm", .data = &gxbb_chip }, + { .compatible = "amlogic,meson-gxl-sm", .data = &gxl_chip }, { /* sentinel */ }, }; diff --git a/include/linux/firmware/meson/meson_sm.h b/include/linux/firmware/meson/meson_sm.h index f98c20dd266e..9352d35c6e96 100644 --- a/include/linux/firmware/meson/meson_sm.h +++ b/include/linux/firmware/meson/meson_sm.h @@ -18,6 +18,9 @@ enum { SM_EFUSE_WRITE, SM_EFUSE_USER_MAX, SM_GET_CHIP_ID, + SM_SECURITY_KEY_READ, + SM_SECURITY_KEY_WRITE, + SM_SECURITY_KEY_TELL, }; struct meson_sm_firmware; -- 2.21.0