Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3d0b16a6 authored by Maxime Ripard's avatar Maxime Ripard Committed by Greg Kroah-Hartman
Browse files

nvmem: sunxi: Move the SID driver to the nvmem framework



Now that we have the nvmem framework, we can consolidate the common
driver code. Move the driver to the framework, and hopefully, it will
fix the sysfs file creation race.

Signed-off-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
[srinivas.kandagatla: Moved to regmap based EEPROM framework]
Signed-off-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Tested-by: default avatarRajendra Nayak <rnayak@codeaurora.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b470d6d7
Loading
Loading
Loading
Loading
+0 −22
Original line number Diff line number Diff line
What:		/sys/devices/*/<our-device>/eeprom
Date:		August 2013
Contact:	Oliver Schinagl <oliver@schinagl.nl>
Description:	read-only access to the SID (Security-ID) on current
		A-series SoC's from Allwinner. Currently supports A10, A10s, A13
		and A20 CPU's. The earlier A1x series of SoCs exports 16 bytes,
		whereas the newer A20 SoC exposes 512 bytes split into sections.
		Besides the 16 bytes of SID, there's also an SJTAG area,
		HDMI-HDCP key and some custom keys. Below a quick overview, for
		details see the user manual:
		0x000  128 bit root-key (sun[457]i)
		0x010  128 bit boot-key (sun7i)
		0x020   64 bit security-jtag-key (sun7i)
		0x028   16 bit key configuration (sun7i)
		0x02b   16 bit custom-vendor-key (sun7i)
		0x02c  320 bit low general key (sun7i)
		0x040   32 bit read-control access (sun7i)
		0x064  224 bit low general key (sun7i)
		0x080 2304 bit HDCP-key (sun7i)
		0x1a0  768 bit high general key (sun7i)
Users:		any user space application which wants to read the SID on
		Allwinner's A-series of CPU's.
+4 −0
Original line number Diff line number Diff line
@@ -4,6 +4,10 @@ Required properties:
- compatible: "allwinner,sun4i-a10-sid" or "allwinner,sun7i-a20-sid"
- reg: Should contain registers location and length

= Data cells =
Are child nodes of qfprom, bindings of which as described in
bindings/nvmem/nvmem.txt

Example for sun4i:
	sid@01c23800 {
		compatible = "allwinner,sun4i-a10-sid";
+0 −13
Original line number Diff line number Diff line
@@ -96,17 +96,4 @@ config EEPROM_DIGSY_MTC_CFG

	  If unsure, say N.

config EEPROM_SUNXI_SID
	tristate "Allwinner sunxi security ID support"
	depends on ARCH_SUNXI && SYSFS
	help
	  This is a driver for the 'security ID' available on various Allwinner
	  devices.

	  Due to the potential risks involved with changing e-fuses,
	  this driver is read-only.

	  This driver can also be built as a module. If so, the module
	  will be called sunxi_sid.

endmenu
+0 −1
Original line number Diff line number Diff line
@@ -4,5 +4,4 @@ obj-$(CONFIG_EEPROM_LEGACY) += eeprom.o
obj-$(CONFIG_EEPROM_MAX6875)	+= max6875.o
obj-$(CONFIG_EEPROM_93CX6)	+= eeprom_93cx6.o
obj-$(CONFIG_EEPROM_93XX46)	+= eeprom_93xx46.o
obj-$(CONFIG_EEPROM_SUNXI_SID)	+= sunxi_sid.o
obj-$(CONFIG_EEPROM_DIGSY_MTC_CFG) += digsy_mtc_eeprom.o
+11 −0
Original line number Diff line number Diff line
@@ -25,4 +25,15 @@ config QCOM_QFPROM
	  This driver can also be built as a module. If so, the module
	  will be called nvmem_qfprom.

config NVMEM_SUNXI_SID
	tristate "Allwinner SoCs SID support"
	depends on ARCH_SUNXI
	select REGMAP_MMIO
	help
	  This is a driver for the 'security ID' available on various Allwinner
	  devices.

	  This driver can also be built as a module. If so, the module
	  will be called nvmem_sunxi_sid.

endif
Loading