linux-amlogic.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] meson_sm: Extend meson_sm driver to be compatible with gxl chip
@ 2019-06-06 13:24 Krzysztof Michonski
  2019-06-06 13:24 ` [PATCH 2/2] Enable secure monitor on gxl Krzysztof Michonski
  2019-06-07 20:27 ` [PATCH 1/2] meson_sm: Extend meson_sm driver to be compatible with gxl chip Martin Blumenstingl
  0 siblings, 2 replies; 7+ messages in thread
From: Krzysztof Michonski @ 2019-06-06 13:24 UTC (permalink / raw)
  To: khilman, linux-amlogic, devicetree; +Cc: Krzysztof Michonski, afenkart

From: Krzysztof Michonski <michonskikrzysztof@gmail.com>

Extend the meson_sm driver by adding gxl structure and SECURITY_KEY
commands.

Signed-off-by: Krzysztof Michonski <michonskikrzysztof@gmail.com>
---
 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


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-06-17  8:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-06 13:24 [PATCH 1/2] meson_sm: Extend meson_sm driver to be compatible with gxl chip Krzysztof Michonski
2019-06-06 13:24 ` [PATCH 2/2] Enable secure monitor on gxl Krzysztof Michonski
2019-06-06 20:02   ` Martin Blumenstingl
     [not found]     ` <CAOiNxGD2OLwbHhUWuvOV6H0woQEOuk10_t-PTfqvMKNu_tTn4Q@mail.gmail.com>
2019-06-07 20:23       ` Martin Blumenstingl
2019-06-07 20:27 ` [PATCH 1/2] meson_sm: Extend meson_sm driver to be compatible with gxl chip Martin Blumenstingl
2019-06-14  9:23   ` Neil Armstrong
2019-06-17  8:28     ` Krzysztof Michoński

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).