2015-02-25 11:47:54

by Ezequiel Garcia

[permalink] [raw]
Subject: [PATCH 0/7] New eFuse subsystem

This patchset introduces a new driver subsystem, meant to support eFuse
(alias OTP, one-time-programmable) devices.

The motivation behind this work is to have a common place for drivers
that are currently more or less scattered: the tegra efuses are in
drivers/soc/ and the sunxi efuses in drivers/misc/eeprom.

For now, there's no proposal for a generic efuse API. Instead, we simply
group the drivers together.

This patchset is the result of the initial submission for IMG Pistachio
eFuse support [1]. Our first proposal was to follow the Tegra efuse, and
put the Pistachio efuse in drivers/soc. After some discussion we finally
agreed [2] to first create an efuse directoy, and then put all efuse drivers
in it.

As always, all comments are welcome!

[1] http://www.spinics.net/lists/devicetree/msg59246.html
[2] http://www.spinics.net/lists/arm-kernel/msg389325.html

Ezequiel Garcia (7):
soc: tegra: Add missing include linux/types.h
soc: tegra: Move the fuse header to a separate directory
drivers: Introduce new eFuse subsystem stub
efuse: Move Tegra efuse driver
ARM: tegra: Make sure efuse is always selected
efuse: Move Sunxi fuse driver
ARM: sunxi: Rename EFUSE_SUNXI option in defconfigs

arch/arm/configs/multi_v7_defconfig | 2 +-
arch/arm/configs/sunxi_defconfig | 2 +-
arch/arm/mach-tegra/Kconfig | 1 +
arch/arm/mach-tegra/cpuidle.c | 3 +--
arch/arm/mach-tegra/flowctrl.c | 3 +--
arch/arm/mach-tegra/hotplug.c | 2 +-
arch/arm/mach-tegra/platsmp.c | 2 +-
arch/arm/mach-tegra/pm.c | 2 +-
arch/arm/mach-tegra/reset-handler.S | 3 +--
arch/arm/mach-tegra/reset.c | 3 +--
arch/arm/mach-tegra/sleep-tegra30.S | 3 +--
arch/arm/mach-tegra/tegra.c | 2 +-
drivers/Kconfig | 2 ++
drivers/Makefile | 1 +
drivers/ata/ahci_tegra.c | 2 +-
drivers/clk/tegra/clk-periph-gate.c | 3 +--
drivers/clk/tegra/clk.c | 3 +--
drivers/efuse/Kconfig | 22 ++++++++++++++++++++++
drivers/efuse/Makefile | 2 ++
drivers/{misc/eeprom => efuse}/sunxi_sid.c | 0
drivers/{soc/tegra/fuse => efuse/tegra}/Makefile | 0
.../{soc/tegra/fuse => efuse/tegra}/fuse-tegra.c | 2 +-
.../{soc/tegra/fuse => efuse/tegra}/fuse-tegra20.c | 3 +--
.../{soc/tegra/fuse => efuse/tegra}/fuse-tegra30.c | 3 +--
drivers/{soc/tegra/fuse => efuse/tegra}/fuse.h | 0
.../tegra/fuse => efuse/tegra}/speedo-tegra114.c | 3 +--
.../tegra/fuse => efuse/tegra}/speedo-tegra124.c | 3 +--
.../tegra/fuse => efuse/tegra}/speedo-tegra20.c | 3 +--
.../tegra/fuse => efuse/tegra}/speedo-tegra30.c | 3 +--
.../tegra/fuse => efuse/tegra}/tegra-apbmisc.c | 3 +--
drivers/gpu/drm/nouveau/nouveau_platform.c | 2 +-
drivers/misc/eeprom/Kconfig | 13 -------------
drivers/misc/eeprom/Makefile | 1 -
drivers/soc/tegra/Makefile | 2 --
drivers/soc/tegra/pmc.c | 2 +-
drivers/thermal/tegra_soctherm.c | 3 +--
include/{soc/tegra/fuse.h => linux/efuse/tegra.h} | 2 ++
37 files changed, 55 insertions(+), 56 deletions(-)
create mode 100644 drivers/efuse/Kconfig
create mode 100644 drivers/efuse/Makefile
rename drivers/{misc/eeprom => efuse}/sunxi_sid.c (100%)
rename drivers/{soc/tegra/fuse => efuse/tegra}/Makefile (100%)
rename drivers/{soc/tegra/fuse => efuse/tegra}/fuse-tegra.c (99%)
rename drivers/{soc/tegra/fuse => efuse/tegra}/fuse-tegra20.c (99%)
rename drivers/{soc/tegra/fuse => efuse/tegra}/fuse-tegra30.c (99%)
rename drivers/{soc/tegra/fuse => efuse/tegra}/fuse.h (100%)
rename drivers/{soc/tegra/fuse => efuse/tegra}/speedo-tegra114.c (98%)
rename drivers/{soc/tegra/fuse => efuse/tegra}/speedo-tegra124.c (99%)
rename drivers/{soc/tegra/fuse => efuse/tegra}/speedo-tegra20.c (99%)
rename drivers/{soc/tegra/fuse => efuse/tegra}/speedo-tegra30.c (99%)
rename drivers/{soc/tegra/fuse => efuse/tegra}/tegra-apbmisc.c (98%)
rename include/{soc/tegra/fuse.h => linux/efuse/tegra.h} (98%)

--
2.3.0


2015-02-25 11:47:59

by Ezequiel Garcia

[permalink] [raw]
Subject: [PATCH 1/7] soc: tegra: Add missing include linux/types.h

The soc/tegra/fuse.h header makes use of kernel-specific types (u32, u8) and
therefore it needs a linux/types.h include.

Cc: Thierry Reding <[email protected]>
Cc: Stephen Warren <[email protected]>
Cc: Alexandre Courbot <[email protected]>
Signed-off-by: Ezequiel Garcia <[email protected]>
---
include/soc/tegra/fuse.h | 2 ++
1 file changed, 2 insertions(+)

diff --git a/include/soc/tegra/fuse.h b/include/soc/tegra/fuse.h
index b5f7b5f..8459008 100644
--- a/include/soc/tegra/fuse.h
+++ b/include/soc/tegra/fuse.h
@@ -28,6 +28,8 @@

#ifndef __ASSEMBLY__

+#include <linux/types.h>
+
u32 tegra_read_chipid(void);
u8 tegra_get_chip_id(void);

--
2.3.0

2015-02-25 11:48:09

by Ezequiel Garcia

[permalink] [raw]
Subject: [PATCH 2/7] soc: tegra: Move the fuse header to a separate directory

As preparation work for the introduction of an eFuse subsystem,
this commit moves Tegra's fuse header and fixes the includes
where needed.

Cc: Thierry Reding <[email protected]>
Cc: Stephen Warren <[email protected]>
Cc: Alexandre Courbot <[email protected]>
Signed-off-by: Ezequiel Garcia <[email protected]>
---
arch/arm/mach-tegra/cpuidle.c | 3 +--
arch/arm/mach-tegra/flowctrl.c | 3 +--
arch/arm/mach-tegra/hotplug.c | 2 +-
arch/arm/mach-tegra/platsmp.c | 2 +-
arch/arm/mach-tegra/pm.c | 2 +-
arch/arm/mach-tegra/reset-handler.S | 3 +--
arch/arm/mach-tegra/reset.c | 3 +--
arch/arm/mach-tegra/sleep-tegra30.S | 3 +--
arch/arm/mach-tegra/tegra.c | 2 +-
drivers/ata/ahci_tegra.c | 2 +-
drivers/clk/tegra/clk-periph-gate.c | 3 +--
drivers/clk/tegra/clk.c | 3 +--
drivers/gpu/drm/nouveau/nouveau_platform.c | 2 +-
drivers/soc/tegra/fuse/fuse-tegra.c | 2 +-
drivers/soc/tegra/fuse/fuse-tegra20.c | 3 +--
drivers/soc/tegra/fuse/fuse-tegra30.c | 3 +--
drivers/soc/tegra/fuse/speedo-tegra114.c | 3 +--
drivers/soc/tegra/fuse/speedo-tegra124.c | 3 +--
drivers/soc/tegra/fuse/speedo-tegra20.c | 3 +--
drivers/soc/tegra/fuse/speedo-tegra30.c | 3 +--
drivers/soc/tegra/fuse/tegra-apbmisc.c | 3 +--
drivers/soc/tegra/pmc.c | 2 +-
drivers/thermal/tegra_soctherm.c | 3 +--
include/{soc/tegra/fuse.h => linux/efuse/tegra.h} | 0
24 files changed, 23 insertions(+), 38 deletions(-)
rename include/{soc/tegra/fuse.h => linux/efuse/tegra.h} (100%)

diff --git a/arch/arm/mach-tegra/cpuidle.c b/arch/arm/mach-tegra/cpuidle.c
index 3165631..62b8086 100644
--- a/arch/arm/mach-tegra/cpuidle.c
+++ b/arch/arm/mach-tegra/cpuidle.c
@@ -21,11 +21,10 @@
* more details.
*/

+#include <linux/efuse/tegra.h>
#include <linux/kernel.h>
#include <linux/module.h>

-#include <soc/tegra/fuse.h>
-
#include "cpuidle.h"

void __init tegra_cpuidle_init(void)
diff --git a/arch/arm/mach-tegra/flowctrl.c b/arch/arm/mach-tegra/flowctrl.c
index 475e783..623c820 100644
--- a/arch/arm/mach-tegra/flowctrl.c
+++ b/arch/arm/mach-tegra/flowctrl.c
@@ -19,14 +19,13 @@
*/

#include <linux/cpumask.h>
+#include <linux/efuse/tegra.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/of.h>
#include <linux/of_address.h>

-#include <soc/tegra/fuse.h>
-
#include "flowctrl.h"

static u8 flowctrl_offset_halt_cpu[] = {
diff --git a/arch/arm/mach-tegra/hotplug.c b/arch/arm/mach-tegra/hotplug.c
index 6fc71f1..0d55820 100644
--- a/arch/arm/mach-tegra/hotplug.c
+++ b/arch/arm/mach-tegra/hotplug.c
@@ -9,11 +9,11 @@
*/

#include <linux/clk/tegra.h>
+#include <linux/efuse/tegra.h>
#include <linux/kernel.h>
#include <linux/smp.h>

#include <soc/tegra/common.h>
-#include <soc/tegra/fuse.h>

#include <asm/smp_plat.h>

diff --git a/arch/arm/mach-tegra/platsmp.c b/arch/arm/mach-tegra/platsmp.c
index b450866..2c65404 100644
--- a/arch/arm/mach-tegra/platsmp.c
+++ b/arch/arm/mach-tegra/platsmp.c
@@ -15,13 +15,13 @@
#include <linux/clk/tegra.h>
#include <linux/delay.h>
#include <linux/device.h>
+#include <linux/efuse/tegra.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/jiffies.h>
#include <linux/smp.h>

-#include <soc/tegra/fuse.h>
#include <soc/tegra/pmc.h>

#include <asm/cacheflush.h>
diff --git a/arch/arm/mach-tegra/pm.c b/arch/arm/mach-tegra/pm.c
index b0f48a3..7089444 100644
--- a/arch/arm/mach-tegra/pm.c
+++ b/arch/arm/mach-tegra/pm.c
@@ -20,6 +20,7 @@
#include <linux/cpumask.h>
#include <linux/cpu_pm.h>
#include <linux/delay.h>
+#include <linux/efuse/tegra.h>
#include <linux/err.h>
#include <linux/io.h>
#include <linux/kernel.h>
@@ -27,7 +28,6 @@
#include <linux/spinlock.h>
#include <linux/suspend.h>

-#include <soc/tegra/fuse.h>
#include <soc/tegra/pm.h>
#include <soc/tegra/pmc.h>

diff --git a/arch/arm/mach-tegra/reset-handler.S b/arch/arm/mach-tegra/reset-handler.S
index 71be4af..318fbcc 100644
--- a/arch/arm/mach-tegra/reset-handler.S
+++ b/arch/arm/mach-tegra/reset-handler.S
@@ -14,11 +14,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

+#include <linux/efuse/tegra.h>
#include <linux/init.h>
#include <linux/linkage.h>

-#include <soc/tegra/fuse.h>
-
#include <asm/asm-offsets.h>
#include <asm/cache.h>

diff --git a/arch/arm/mach-tegra/reset.c b/arch/arm/mach-tegra/reset.c
index 894c5c4..7fb3030 100644
--- a/arch/arm/mach-tegra/reset.c
+++ b/arch/arm/mach-tegra/reset.c
@@ -16,11 +16,10 @@

#include <linux/bitops.h>
#include <linux/cpumask.h>
+#include <linux/efuse/tegra.h>
#include <linux/init.h>
#include <linux/io.h>

-#include <soc/tegra/fuse.h>
-
#include <asm/cacheflush.h>
#include <asm/firmware.h>
#include <asm/hardware/cache-l2x0.h>
diff --git a/arch/arm/mach-tegra/sleep-tegra30.S b/arch/arm/mach-tegra/sleep-tegra30.S
index 5d8d13a..e8c8946 100644
--- a/arch/arm/mach-tegra/sleep-tegra30.S
+++ b/arch/arm/mach-tegra/sleep-tegra30.S
@@ -14,10 +14,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

+#include <linux/efuse/tegra.h>
#include <linux/linkage.h>

-#include <soc/tegra/fuse.h>
-
#include <asm/asm-offsets.h>
#include <asm/assembler.h>
#include <asm/cache.h>
diff --git a/arch/arm/mach-tegra/tegra.c b/arch/arm/mach-tegra/tegra.c
index 914341b..b216403 100644
--- a/arch/arm/mach-tegra/tegra.c
+++ b/arch/arm/mach-tegra/tegra.c
@@ -19,6 +19,7 @@
#include <linux/clk.h>
#include <linux/clk/tegra.h>
#include <linux/dma-mapping.h>
+#include <linux/efuse/tegra.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/irqchip.h>
@@ -35,7 +36,6 @@
#include <linux/sys_soc.h>
#include <linux/usb/tegra_usb_phy.h>

-#include <soc/tegra/fuse.h>
#include <soc/tegra/pmc.h>

#include <asm/hardware/cache-l2x0.h>
diff --git a/drivers/ata/ahci_tegra.c b/drivers/ata/ahci_tegra.c
index 3a62eb2..cbd4b43 100644
--- a/drivers/ata/ahci_tegra.c
+++ b/drivers/ata/ahci_tegra.c
@@ -19,6 +19,7 @@

#include <linux/ahci_platform.h>
#include <linux/errno.h>
+#include <linux/efuse/tegra.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of_device.h>
@@ -26,7 +27,6 @@
#include <linux/regulator/consumer.h>
#include <linux/reset.h>

-#include <soc/tegra/fuse.h>
#include <soc/tegra/pmc.h>

#include "ahci.h"
diff --git a/drivers/clk/tegra/clk-periph-gate.c b/drivers/clk/tegra/clk-periph-gate.c
index 0aa8830..8df474c 100644
--- a/drivers/clk/tegra/clk-periph-gate.c
+++ b/drivers/clk/tegra/clk-periph-gate.c
@@ -20,8 +20,7 @@
#include <linux/io.h>
#include <linux/delay.h>
#include <linux/err.h>
-
-#include <soc/tegra/fuse.h>
+#include <linux/efuse/tegra.h>

#include "clk.h"

diff --git a/drivers/clk/tegra/clk.c b/drivers/clk/tegra/clk.c
index 9ddb754..02b2694 100644
--- a/drivers/clk/tegra/clk.c
+++ b/drivers/clk/tegra/clk.c
@@ -14,14 +14,13 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

+#include <linux/efuse/tegra.h>
#include <linux/clk.h>
#include <linux/clk-provider.h>
#include <linux/of.h>
#include <linux/clk/tegra.h>
#include <linux/reset-controller.h>

-#include <soc/tegra/fuse.h>
-
#include "clk.h"

#define CLK_OUT_ENB_L 0x010
diff --git a/drivers/gpu/drm/nouveau/nouveau_platform.c b/drivers/gpu/drm/nouveau/nouveau_platform.c
index dc5900b..719f8a6 100644
--- a/drivers/gpu/drm/nouveau/nouveau_platform.c
+++ b/drivers/gpu/drm/nouveau/nouveau_platform.c
@@ -20,6 +20,7 @@
* DEALINGS IN THE SOFTWARE.
*/

+#include <linux/efuse/tegra.h>
#include <linux/clk.h>
#include <linux/io.h>
#include <linux/module.h>
@@ -27,7 +28,6 @@
#include <linux/of.h>
#include <linux/reset.h>
#include <linux/regulator/consumer.h>
-#include <soc/tegra/fuse.h>
#include <soc/tegra/pmc.h>

#include "nouveau_drm.h"
diff --git a/drivers/soc/tegra/fuse/fuse-tegra.c b/drivers/soc/tegra/fuse/fuse-tegra.c
index c0d660f..5e6656d 100644
--- a/drivers/soc/tegra/fuse/fuse-tegra.c
+++ b/drivers/soc/tegra/fuse/fuse-tegra.c
@@ -16,6 +16,7 @@
*/

#include <linux/device.h>
+#include <linux/efuse/tegra.h>
#include <linux/kobject.h>
#include <linux/kernel.h>
#include <linux/platform_device.h>
@@ -24,7 +25,6 @@
#include <linux/io.h>

#include <soc/tegra/common.h>
-#include <soc/tegra/fuse.h>

#include "fuse.h"

diff --git a/drivers/soc/tegra/fuse/fuse-tegra20.c b/drivers/soc/tegra/fuse/fuse-tegra20.c
index 5eff6f0..08ce2fb 100644
--- a/drivers/soc/tegra/fuse/fuse-tegra20.c
+++ b/drivers/soc/tegra/fuse/fuse-tegra20.c
@@ -17,6 +17,7 @@
*/

#include <linux/device.h>
+#include <linux/efuse/tegra.h>
#include <linux/clk.h>
#include <linux/completion.h>
#include <linux/dmaengine.h>
@@ -29,8 +30,6 @@
#include <linux/platform_device.h>
#include <linux/random.h>

-#include <soc/tegra/fuse.h>
-
#include "fuse.h"

#define FUSE_BEGIN 0x100
diff --git a/drivers/soc/tegra/fuse/fuse-tegra30.c b/drivers/soc/tegra/fuse/fuse-tegra30.c
index 4d2f71b..574d7a9 100644
--- a/drivers/soc/tegra/fuse/fuse-tegra30.c
+++ b/drivers/soc/tegra/fuse/fuse-tegra30.c
@@ -16,6 +16,7 @@
*/

#include <linux/device.h>
+#include <linux/efuse/tegra.h>
#include <linux/clk.h>
#include <linux/err.h>
#include <linux/io.h>
@@ -25,8 +26,6 @@
#include <linux/platform_device.h>
#include <linux/random.h>

-#include <soc/tegra/fuse.h>
-
#include "fuse.h"

#define FUSE_BEGIN 0x100
diff --git a/drivers/soc/tegra/fuse/speedo-tegra114.c b/drivers/soc/tegra/fuse/speedo-tegra114.c
index 2a6ca03..8a4c9f1 100644
--- a/drivers/soc/tegra/fuse/speedo-tegra114.c
+++ b/drivers/soc/tegra/fuse/speedo-tegra114.c
@@ -16,10 +16,9 @@

#include <linux/bug.h>
#include <linux/device.h>
+#include <linux/efuse/tegra.h>
#include <linux/kernel.h>

-#include <soc/tegra/fuse.h>
-
#include "fuse.h"

#define CORE_PROCESS_CORNERS 2
diff --git a/drivers/soc/tegra/fuse/speedo-tegra124.c b/drivers/soc/tegra/fuse/speedo-tegra124.c
index 4636238..0dd8c04 100644
--- a/drivers/soc/tegra/fuse/speedo-tegra124.c
+++ b/drivers/soc/tegra/fuse/speedo-tegra124.c
@@ -15,11 +15,10 @@
*/

#include <linux/device.h>
+#include <linux/efuse/tegra.h>
#include <linux/kernel.h>
#include <linux/bug.h>

-#include <soc/tegra/fuse.h>
-
#include "fuse.h"

#define CPU_PROCESS_CORNERS 2
diff --git a/drivers/soc/tegra/fuse/speedo-tegra20.c b/drivers/soc/tegra/fuse/speedo-tegra20.c
index eff1b63..09b40ab 100644
--- a/drivers/soc/tegra/fuse/speedo-tegra20.c
+++ b/drivers/soc/tegra/fuse/speedo-tegra20.c
@@ -16,10 +16,9 @@

#include <linux/bug.h>
#include <linux/device.h>
+#include <linux/efuse/tegra.h>
#include <linux/kernel.h>

-#include <soc/tegra/fuse.h>
-
#include "fuse.h"

#define CPU_SPEEDO_LSBIT 20
diff --git a/drivers/soc/tegra/fuse/speedo-tegra30.c b/drivers/soc/tegra/fuse/speedo-tegra30.c
index b17f0dc..65331d0 100644
--- a/drivers/soc/tegra/fuse/speedo-tegra30.c
+++ b/drivers/soc/tegra/fuse/speedo-tegra30.c
@@ -16,10 +16,9 @@

#include <linux/bug.h>
#include <linux/device.h>
+#include <linux/efuse/tegra.h>
#include <linux/kernel.h>

-#include <soc/tegra/fuse.h>
-
#include "fuse.h"

#define CORE_PROCESS_CORNERS 1
diff --git a/drivers/soc/tegra/fuse/tegra-apbmisc.c b/drivers/soc/tegra/fuse/tegra-apbmisc.c
index 3bf5aba..31de5f8 100644
--- a/drivers/soc/tegra/fuse/tegra-apbmisc.c
+++ b/drivers/soc/tegra/fuse/tegra-apbmisc.c
@@ -15,13 +15,12 @@
*
*/

+#include <linux/efuse/tegra.h>
#include <linux/kernel.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/io.h>

-#include <soc/tegra/fuse.h>
-
#include "fuse.h"

#define APBMISC_BASE 0x70000800
diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c
index c956395..d901e4e 100644
--- a/drivers/soc/tegra/pmc.c
+++ b/drivers/soc/tegra/pmc.c
@@ -33,9 +33,9 @@
#include <linux/reset.h>
#include <linux/seq_file.h>
#include <linux/spinlock.h>
+#include <linux/efuse/tegra.h>

#include <soc/tegra/common.h>
-#include <soc/tegra/fuse.h>
#include <soc/tegra/pmc.h>

#define PMC_CNTRL 0x0
diff --git a/drivers/thermal/tegra_soctherm.c b/drivers/thermal/tegra_soctherm.c
index 9197fc0..daec2e7 100644
--- a/drivers/thermal/tegra_soctherm.c
+++ b/drivers/thermal/tegra_soctherm.c
@@ -19,6 +19,7 @@
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/err.h>
+#include <linux/efuse/tegra.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/module.h>
@@ -27,8 +28,6 @@
#include <linux/reset.h>
#include <linux/thermal.h>

-#include <soc/tegra/fuse.h>
-
#define SENSOR_CONFIG0 0
#define SENSOR_CONFIG0_STOP BIT(0)
#define SENSOR_CONFIG0_TALL_SHIFT 8
diff --git a/include/soc/tegra/fuse.h b/include/linux/efuse/tegra.h
similarity index 100%
rename from include/soc/tegra/fuse.h
rename to include/linux/efuse/tegra.h
--
2.3.0

2015-02-25 11:48:41

by Ezequiel Garcia

[permalink] [raw]
Subject: [PATCH 3/7] drivers: Introduce new eFuse subsystem stub

This commit introduces a new eFuse subsystem stub to hold all the eFuse-like
device drivers. This will be used to host the currently supported Tegra
eFuse driver, and will allow to add support for other platforms as well.

Cc: Thierry Reding <[email protected]>
Cc: Stephen Warren <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: Stefan Wahren <[email protected]>
Signed-off-by: Ezequiel Garcia <[email protected]>
---
drivers/Kconfig | 2 ++
drivers/Makefile | 1 +
drivers/efuse/Kconfig | 3 +++
drivers/efuse/Makefile | 0
4 files changed, 6 insertions(+)
create mode 100644 drivers/efuse/Kconfig
create mode 100644 drivers/efuse/Makefile

diff --git a/drivers/Kconfig b/drivers/Kconfig
index c0cc96b..9c0d93d 100644
--- a/drivers/Kconfig
+++ b/drivers/Kconfig
@@ -146,6 +146,8 @@ source "drivers/remoteproc/Kconfig"

source "drivers/rpmsg/Kconfig"

+source "drivers/efuse/Kconfig"
+
source "drivers/soc/Kconfig"

source "drivers/devfreq/Kconfig"
diff --git a/drivers/Makefile b/drivers/Makefile
index 527a6da..5572728 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -34,6 +34,7 @@ obj-y += amba/
obj-$(CONFIG_DMADEVICES) += dma/

# SOC specific infrastructure drivers.
+obj-y += efuse/
obj-y += soc/

obj-$(CONFIG_VIRTIO) += virtio/
diff --git a/drivers/efuse/Kconfig b/drivers/efuse/Kconfig
new file mode 100644
index 0000000..617476f
--- /dev/null
+++ b/drivers/efuse/Kconfig
@@ -0,0 +1,3 @@
+menu "eFuse drivers"
+
+endmenu
diff --git a/drivers/efuse/Makefile b/drivers/efuse/Makefile
new file mode 100644
index 0000000..e69de29
--
2.3.0

2015-02-25 11:48:17

by Ezequiel Garcia

[permalink] [raw]
Subject: [PATCH 4/7] efuse: Move Tegra efuse driver

Now that the efuse subsystem has been introduced, move the Tegra efuse driver
from drivers/soc/tegra/fuse/ to drivers/efuse/tegra. For now, there's no
generic efuse API. However, by having the drivers in a unified location it is
expected that such API will arise easier once support for more devices is added.

Cc: Stephen Warren <[email protected]>
Cc: Thierry Reding <[email protected]>
Cc: Alexandre Courbot <[email protected]>
Signed-off-by: Ezequiel Garcia <[email protected]>
---
drivers/efuse/Kconfig | 7 +++++++
drivers/efuse/Makefile | 1 +
drivers/{soc/tegra/fuse => efuse/tegra}/Makefile | 0
drivers/{soc/tegra/fuse => efuse/tegra}/fuse-tegra.c | 0
drivers/{soc/tegra/fuse => efuse/tegra}/fuse-tegra20.c | 0
drivers/{soc/tegra/fuse => efuse/tegra}/fuse-tegra30.c | 0
drivers/{soc/tegra/fuse => efuse/tegra}/fuse.h | 0
drivers/{soc/tegra/fuse => efuse/tegra}/speedo-tegra114.c | 0
drivers/{soc/tegra/fuse => efuse/tegra}/speedo-tegra124.c | 0
drivers/{soc/tegra/fuse => efuse/tegra}/speedo-tegra20.c | 0
drivers/{soc/tegra/fuse => efuse/tegra}/speedo-tegra30.c | 0
drivers/{soc/tegra/fuse => efuse/tegra}/tegra-apbmisc.c | 0
drivers/soc/tegra/Makefile | 2 --
13 files changed, 8 insertions(+), 2 deletions(-)
rename drivers/{soc/tegra/fuse => efuse/tegra}/Makefile (100%)
rename drivers/{soc/tegra/fuse => efuse/tegra}/fuse-tegra.c (100%)
rename drivers/{soc/tegra/fuse => efuse/tegra}/fuse-tegra20.c (100%)
rename drivers/{soc/tegra/fuse => efuse/tegra}/fuse-tegra30.c (100%)
rename drivers/{soc/tegra/fuse => efuse/tegra}/fuse.h (100%)
rename drivers/{soc/tegra/fuse => efuse/tegra}/speedo-tegra114.c (100%)
rename drivers/{soc/tegra/fuse => efuse/tegra}/speedo-tegra124.c (100%)
rename drivers/{soc/tegra/fuse => efuse/tegra}/speedo-tegra20.c (100%)
rename drivers/{soc/tegra/fuse => efuse/tegra}/speedo-tegra30.c (100%)
rename drivers/{soc/tegra/fuse => efuse/tegra}/tegra-apbmisc.c (100%)

diff --git a/drivers/efuse/Kconfig b/drivers/efuse/Kconfig
index 617476f..b84e06b 100644
--- a/drivers/efuse/Kconfig
+++ b/drivers/efuse/Kconfig
@@ -1,3 +1,10 @@
menu "eFuse drivers"

+config EFUSE_TEGRA
+ bool
+ depends on ARCH_TEGRA
+ help
+ Support for the eFuses available on Tegra SoCs
+
+
endmenu
diff --git a/drivers/efuse/Makefile b/drivers/efuse/Makefile
index e69de29..b69a0d6 100644
--- a/drivers/efuse/Makefile
+++ b/drivers/efuse/Makefile
@@ -0,0 +1 @@
+obj-$(CONFIG_EFUSE_TEGRA) += tegra/
diff --git a/drivers/soc/tegra/fuse/Makefile b/drivers/efuse/tegra/Makefile
similarity index 100%
rename from drivers/soc/tegra/fuse/Makefile
rename to drivers/efuse/tegra/Makefile
diff --git a/drivers/soc/tegra/fuse/fuse-tegra.c b/drivers/efuse/tegra/fuse-tegra.c
similarity index 100%
rename from drivers/soc/tegra/fuse/fuse-tegra.c
rename to drivers/efuse/tegra/fuse-tegra.c
diff --git a/drivers/soc/tegra/fuse/fuse-tegra20.c b/drivers/efuse/tegra/fuse-tegra20.c
similarity index 100%
rename from drivers/soc/tegra/fuse/fuse-tegra20.c
rename to drivers/efuse/tegra/fuse-tegra20.c
diff --git a/drivers/soc/tegra/fuse/fuse-tegra30.c b/drivers/efuse/tegra/fuse-tegra30.c
similarity index 100%
rename from drivers/soc/tegra/fuse/fuse-tegra30.c
rename to drivers/efuse/tegra/fuse-tegra30.c
diff --git a/drivers/soc/tegra/fuse/fuse.h b/drivers/efuse/tegra/fuse.h
similarity index 100%
rename from drivers/soc/tegra/fuse/fuse.h
rename to drivers/efuse/tegra/fuse.h
diff --git a/drivers/soc/tegra/fuse/speedo-tegra114.c b/drivers/efuse/tegra/speedo-tegra114.c
similarity index 100%
rename from drivers/soc/tegra/fuse/speedo-tegra114.c
rename to drivers/efuse/tegra/speedo-tegra114.c
diff --git a/drivers/soc/tegra/fuse/speedo-tegra124.c b/drivers/efuse/tegra/speedo-tegra124.c
similarity index 100%
rename from drivers/soc/tegra/fuse/speedo-tegra124.c
rename to drivers/efuse/tegra/speedo-tegra124.c
diff --git a/drivers/soc/tegra/fuse/speedo-tegra20.c b/drivers/efuse/tegra/speedo-tegra20.c
similarity index 100%
rename from drivers/soc/tegra/fuse/speedo-tegra20.c
rename to drivers/efuse/tegra/speedo-tegra20.c
diff --git a/drivers/soc/tegra/fuse/speedo-tegra30.c b/drivers/efuse/tegra/speedo-tegra30.c
similarity index 100%
rename from drivers/soc/tegra/fuse/speedo-tegra30.c
rename to drivers/efuse/tegra/speedo-tegra30.c
diff --git a/drivers/soc/tegra/fuse/tegra-apbmisc.c b/drivers/efuse/tegra/tegra-apbmisc.c
similarity index 100%
rename from drivers/soc/tegra/fuse/tegra-apbmisc.c
rename to drivers/efuse/tegra/tegra-apbmisc.c
diff --git a/drivers/soc/tegra/Makefile b/drivers/soc/tegra/Makefile
index cdaad9d..23a0f64 100644
--- a/drivers/soc/tegra/Makefile
+++ b/drivers/soc/tegra/Makefile
@@ -1,4 +1,2 @@
-obj-$(CONFIG_ARCH_TEGRA) += fuse/
-
obj-$(CONFIG_ARCH_TEGRA) += common.o
obj-$(CONFIG_ARCH_TEGRA) += pmc.o
--
2.3.0

2015-02-25 12:05:06

by Maxime Ripard

[permalink] [raw]
Subject: Re: [PATCH 0/7] New eFuse subsystem

Hi Ezequiel,

On Wed, Feb 25, 2015 at 08:45:12AM -0300, Ezequiel Garcia wrote:
> This patchset introduces a new driver subsystem, meant to support eFuse
> (alias OTP, one-time-programmable) devices.
>
> The motivation behind this work is to have a common place for drivers
> that are currently more or less scattered: the tegra efuses are in
> drivers/soc/ and the sunxi efuses in drivers/misc/eeprom.
>
> For now, there's no proposal for a generic efuse API. Instead, we simply
> group the drivers together.
>
> This patchset is the result of the initial submission for IMG Pistachio
> eFuse support [1]. Our first proposal was to follow the Tegra efuse, and
> put the Pistachio efuse in drivers/soc. After some discussion we finally
> agreed [2] to first create an efuse directoy, and then put all efuse drivers
> in it.
>
> As always, all comments are welcome!
>
> [1] http://www.spinics.net/lists/devicetree/msg59246.html
> [2] http://www.spinics.net/lists/arm-kernel/msg389325.html

Have you looked at the EEPROM framework currently in discussions? The
two seems to be covering pretty much the same use cases.

Maxime

--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com


Attachments:
(No filename) (1.21 kB)
signature.asc (819.00 B)
Digital signature
Download all attachments

2015-02-25 12:30:01

by Stefan Wahren

[permalink] [raw]
Subject: Re: [PATCH 3/7] drivers: Introduce new eFuse subsystem stub

Hi,

[adding devicetree list]

Am 25.02.2015 um 12:45 schrieb Ezequiel Garcia:
> This commit introduces a new eFuse subsystem stub to hold all the eFuse-like
> device drivers. This will be used to host the currently supported Tegra
> eFuse driver, and will allow to add support for other platforms as well.

as i mentioned in the old discussion it would be nice to keep drivers
and devicetree binding documentation consistent.

So how about renaming?

Documentation/devicetree/bindings/fuse/ ->
Documentation/devicetree/bindings/efuse/

Best regards
Stefan



2015-02-25 12:32:38

by Ezequiel Garcia

[permalink] [raw]
Subject: Re: [PATCH 0/7] New eFuse subsystem



On 02/25/2015 09:02 AM, Maxime Ripard wrote:
> Hi Ezequiel,
>
> On Wed, Feb 25, 2015 at 08:45:12AM -0300, Ezequiel Garcia wrote:
>> This patchset introduces a new driver subsystem, meant to support eFuse
>> (alias OTP, one-time-programmable) devices.
>>
>> The motivation behind this work is to have a common place for drivers
>> that are currently more or less scattered: the tegra efuses are in
>> drivers/soc/ and the sunxi efuses in drivers/misc/eeprom.
>>
>> For now, there's no proposal for a generic efuse API. Instead, we simply
>> group the drivers together.
>>
>> This patchset is the result of the initial submission for IMG Pistachio
>> eFuse support [1]. Our first proposal was to follow the Tegra efuse, and
>> put the Pistachio efuse in drivers/soc. After some discussion we finally
>> agreed [2] to first create an efuse directoy, and then put all efuse drivers
>> in it.
>>
>> As always, all comments are welcome!
>>
>> [1] http://www.spinics.net/lists/devicetree/msg59246.html
>> [2] http://www.spinics.net/lists/arm-kernel/msg389325.html
>
> Have you looked at the EEPROM framework currently in discussions? The
> two seems to be covering pretty much the same use cases.
>

Nope, I was obviously unaware of that. Guess we'll wait until the
discussion is settled and use that framework.

Thanks!
--
Ezequiel

2015-02-25 13:12:06

by James Hartley

[permalink] [raw]
Subject: RE: [PATCH 0/7] New eFuse subsystem

Hi Maxime,

> -----Original Message-----
> From: Ezequiel Garcia
> Sent: 25 February 2015 12:30
> To: Maxime Ripard
> Cc: Thierry Reding; Stephen Warren; Arnd Bergmann; Andrew Bresticker;
> James Hartley; [email protected]; linux-
> [email protected]
> Subject: Re: [PATCH 0/7] New eFuse subsystem
>
>
>
> On 02/25/2015 09:02 AM, Maxime Ripard wrote:
> > Hi Ezequiel,
> >
> > On Wed, Feb 25, 2015 at 08:45:12AM -0300, Ezequiel Garcia wrote:
> >> This patchset introduces a new driver subsystem, meant to support
> >> eFuse (alias OTP, one-time-programmable) devices.
> >>
> >> The motivation behind this work is to have a common place for drivers
> >> that are currently more or less scattered: the tegra efuses are in
> >> drivers/soc/ and the sunxi efuses in drivers/misc/eeprom.
> >>
> >> For now, there's no proposal for a generic efuse API. Instead, we
> >> simply group the drivers together.
> >>
> >> This patchset is the result of the initial submission for IMG
> >> Pistachio eFuse support [1]. Our first proposal was to follow the
> >> Tegra efuse, and put the Pistachio efuse in drivers/soc. After some
> >> discussion we finally agreed [2] to first create an efuse directoy,
> >> and then put all efuse drivers in it.
> >>
> >> As always, all comments are welcome!
> >>
> >> [1] http://www.spinics.net/lists/devicetree/msg59246.html
> >> [2] http://www.spinics.net/lists/arm-kernel/msg389325.html
> >
> > Have you looked at the EEPROM framework currently in discussions? The
> > two seems to be covering pretty much the same use cases.
> >

Shouldn't this be a PROM framework if it is going to support both EEPROM and EFUSE/QFPROM, or am I missing something here (since an eFuse is not eraseable)?

>
> Nope, I was obviously unaware of that. Guess we'll wait until the discussion is
> settled and use that framework.
>
> Thanks!
> --
> Ezequiel

Thanks,
James.

2015-02-25 15:26:08

by Maxime Ripard

[permalink] [raw]
Subject: Re: [PATCH 0/7] New eFuse subsystem

Hi,

On Wed, Feb 25, 2015 at 01:12:01PM +0000, James Hartley wrote:
> Hi Maxime,
>
> > -----Original Message-----
> > From: Ezequiel Garcia
> > Sent: 25 February 2015 12:30
> > To: Maxime Ripard
> > Cc: Thierry Reding; Stephen Warren; Arnd Bergmann; Andrew Bresticker;
> > James Hartley; [email protected]; linux-
> > [email protected]
> > Subject: Re: [PATCH 0/7] New eFuse subsystem
> >
> >
> >
> > On 02/25/2015 09:02 AM, Maxime Ripard wrote:
> > > Hi Ezequiel,
> > >
> > > On Wed, Feb 25, 2015 at 08:45:12AM -0300, Ezequiel Garcia wrote:
> > >> This patchset introduces a new driver subsystem, meant to support
> > >> eFuse (alias OTP, one-time-programmable) devices.
> > >>
> > >> The motivation behind this work is to have a common place for drivers
> > >> that are currently more or less scattered: the tegra efuses are in
> > >> drivers/soc/ and the sunxi efuses in drivers/misc/eeprom.
> > >>
> > >> For now, there's no proposal for a generic efuse API. Instead, we
> > >> simply group the drivers together.
> > >>
> > >> This patchset is the result of the initial submission for IMG
> > >> Pistachio eFuse support [1]. Our first proposal was to follow the
> > >> Tegra efuse, and put the Pistachio efuse in drivers/soc. After some
> > >> discussion we finally agreed [2] to first create an efuse directoy,
> > >> and then put all efuse drivers in it.
> > >>
> > >> As always, all comments are welcome!
> > >>
> > >> [1] http://www.spinics.net/lists/devicetree/msg59246.html
> > >> [2] http://www.spinics.net/lists/arm-kernel/msg389325.html
> > >
> > > Have you looked at the EEPROM framework currently in discussions? The
> > > two seems to be covering pretty much the same use cases.
> > >
>
> Shouldn't this be a PROM framework if it is going to support both
> EEPROM and EFUSE/QFPROM, or am I missing something here (since an
> eFuse is not eraseable)?

Does it really matter? I mean, it's just a name after all.

But feel free to suggest alternatives on the main thread.

Maxime

--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com


Attachments:
(No filename) (2.08 kB)
signature.asc (819.00 B)
Digital signature
Download all attachments

2015-02-28 15:45:32

by Paul Bolle

[permalink] [raw]
Subject: Re: [PATCH 3/7] drivers: Introduce new eFuse subsystem stub

On Wed, 2015-02-25 at 08:45 -0300, Ezequiel Garcia wrote:
> This commit introduces a new eFuse subsystem stub to hold all the eFuse-like
> device drivers. This will be used to host the currently supported Tegra
> eFuse driver, and will allow to add support for other platforms as well.
>
> Cc: Thierry Reding <[email protected]>
> Cc: Stephen Warren <[email protected]>
> Cc: Maxime Ripard <[email protected]>
> Cc: Arnd Bergmann <[email protected]>
> Cc: Stefan Wahren <[email protected]>
> Signed-off-by: Ezequiel Garcia <[email protected]>
> ---
> drivers/Kconfig | 2 ++
> drivers/Makefile | 1 +
> drivers/efuse/Kconfig | 3 +++
> drivers/efuse/Makefile | 0
> 4 files changed, 6 insertions(+)
> create mode 100644 drivers/efuse/Kconfig
> create mode 100644 drivers/efuse/Makefile
>
> diff --git a/drivers/Kconfig b/drivers/Kconfig
> index c0cc96b..9c0d93d 100644
> --- a/drivers/Kconfig
> +++ b/drivers/Kconfig
> @@ -146,6 +146,8 @@ source "drivers/remoteproc/Kconfig"
>
> source "drivers/rpmsg/Kconfig"
>
> +source "drivers/efuse/Kconfig"
> +
> source "drivers/soc/Kconfig"
>
> source "drivers/devfreq/Kconfig"
> diff --git a/drivers/Makefile b/drivers/Makefile
> index 527a6da..5572728 100644
> --- a/drivers/Makefile
> +++ b/drivers/Makefile
> @@ -34,6 +34,7 @@ obj-y += amba/
> obj-$(CONFIG_DMADEVICES) += dma/
>
> # SOC specific infrastructure drivers.
> +obj-y += efuse/
> obj-y += soc/
>
> obj-$(CONFIG_VIRTIO) += virtio/
> diff --git a/drivers/efuse/Kconfig b/drivers/efuse/Kconfig
> new file mode 100644
> index 0000000..617476f
> --- /dev/null
> +++ b/drivers/efuse/Kconfig
> @@ -0,0 +1,3 @@
> +menu "eFuse drivers"
> +
> +endmenu

This adds an empty entry.

> diff --git a/drivers/efuse/Makefile b/drivers/efuse/Makefile
> new file mode 100644
> index 0000000..e69de29

And this adds an empty file. Odd.

Is there a reason why this can't be merged into 4/7?


Paul Bolle

2015-02-28 15:51:34

by Paul Bolle

[permalink] [raw]
Subject: Re: [PATCH 4/7] efuse: Move Tegra efuse driver

On Wed, 2015-02-25 at 08:45 -0300, Ezequiel Garcia wrote:
> Now that the efuse subsystem has been introduced, move the Tegra efuse driver
> from drivers/soc/tegra/fuse/ to drivers/efuse/tegra. For now, there's no
> generic efuse API. However, by having the drivers in a unified location it is
> expected that such API will arise easier once support for more devices is added.
>
> Cc: Stephen Warren <[email protected]>
> Cc: Thierry Reding <[email protected]>
> Cc: Alexandre Courbot <[email protected]>
> Signed-off-by: Ezequiel Garcia <[email protected]>
> ---
> drivers/efuse/Kconfig | 7 +++++++
> drivers/efuse/Makefile | 1 +
> drivers/{soc/tegra/fuse => efuse/tegra}/Makefile | 0
> drivers/{soc/tegra/fuse => efuse/tegra}/fuse-tegra.c | 0
> drivers/{soc/tegra/fuse => efuse/tegra}/fuse-tegra20.c | 0
> drivers/{soc/tegra/fuse => efuse/tegra}/fuse-tegra30.c | 0
> drivers/{soc/tegra/fuse => efuse/tegra}/fuse.h | 0
> drivers/{soc/tegra/fuse => efuse/tegra}/speedo-tegra114.c | 0
> drivers/{soc/tegra/fuse => efuse/tegra}/speedo-tegra124.c | 0
> drivers/{soc/tegra/fuse => efuse/tegra}/speedo-tegra20.c | 0
> drivers/{soc/tegra/fuse => efuse/tegra}/speedo-tegra30.c | 0
> drivers/{soc/tegra/fuse => efuse/tegra}/tegra-apbmisc.c | 0
> drivers/soc/tegra/Makefile | 2 --
> 13 files changed, 8 insertions(+), 2 deletions(-)
> rename drivers/{soc/tegra/fuse => efuse/tegra}/Makefile (100%)
> rename drivers/{soc/tegra/fuse => efuse/tegra}/fuse-tegra.c (100%)
> rename drivers/{soc/tegra/fuse => efuse/tegra}/fuse-tegra20.c (100%)
> rename drivers/{soc/tegra/fuse => efuse/tegra}/fuse-tegra30.c (100%)
> rename drivers/{soc/tegra/fuse => efuse/tegra}/fuse.h (100%)
> rename drivers/{soc/tegra/fuse => efuse/tegra}/speedo-tegra114.c (100%)
> rename drivers/{soc/tegra/fuse => efuse/tegra}/speedo-tegra124.c (100%)
> rename drivers/{soc/tegra/fuse => efuse/tegra}/speedo-tegra20.c (100%)
> rename drivers/{soc/tegra/fuse => efuse/tegra}/speedo-tegra30.c (100%)
> rename drivers/{soc/tegra/fuse => efuse/tegra}/tegra-apbmisc.c (100%)
>
> diff --git a/drivers/efuse/Kconfig b/drivers/efuse/Kconfig
> index 617476f..b84e06b 100644
> --- a/drivers/efuse/Kconfig
> +++ b/drivers/efuse/Kconfig
> @@ -1,3 +1,10 @@
> menu "eFuse drivers"
>
> +config EFUSE_TEGRA
> + bool
> + depends on ARCH_TEGRA
> + help
> + Support for the eFuses available on Tegra SoCs

This is a select only symbol. Patch 5/7 confirms this. So, as far as I
know, no one is ever going to see this help text when running make
*config. Is the help text needed?

> +
> +
> endmenu


Paul Bolle