* [PATCH 0/9] AT24 EEPROM MTD Support
@ 2024-07-01 13:53 Marco Felsch
2024-07-01 13:53 ` [PATCH 1/9] mtd: core: add nvmem_write support Marco Felsch
` (9 more replies)
0 siblings, 10 replies; 32+ messages in thread
From: Marco Felsch @ 2024-07-01 13:53 UTC (permalink / raw)
To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
Arnd Bergmann, Greg Kroah-Hartman, Bartosz Golaszewski,
Russell King, Joel Stanley, Andrew Jeffery, Nicolas Ferre,
Alexandre Belloni, Claudiu Beznea, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Vladimir Zapolskiy,
Andrew Lunn, Gregory Clement, Sebastian Hesselbarth,
Tony Lindgren, Geert Uytterhoeven, Magnus Damm, Dinh Nguyen,
Thierry Reding, Jonathan Hunter, Jonathan Neuschäfer,
Michael Ellerman, Nicholas Piggin, Christophe Leroy,
Naveen N. Rao, Thomas Bogendoerfer, Huacai Chen, WANG Xuerui
Cc: Marco Felsch, imx, linux-aspeed, openbmc, linux-kernel,
linux-mips, linux-renesas-soc, linux-mtd, linux-i2c, loongarch,
linux-tegra, linux-omap, linuxppc-dev, linux-arm-kernel
This series adds the intial support to handle EEPROMs via the MTD layer
as well. This allow the user-space to have separate paritions since
EEPROMs can become quite large nowadays.
With this patchset applied EEPROMs can be accessed via:
- legacy 'eeprom' device
- nvmem device
- mtd device(s)
The patchset targets only the AT24 (I2C) EEPROMs since I have no access
to AT25 (SPI) EEPROMs nor to one of the other misc/eeprom/* devices.
Note: I'm not familiar with Kconfig symbol migration so I don't know if
the last patch is required at the moment. Please be notified that the
list of recipients is quite large due to the defconfig changes.
Regards,
Marco
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
Marco Felsch (9):
mtd: core: add nvmem_write support
mtd: add mtd_is_master helper
mtd: add support to handle EEPROM devices
mtd: devices: add AT24 eeprom support
ARM: defconfig: convert to MTD_EEPROM_AT24
powerpc: convert to MTD_EEPROM_AT24
MIPS: configs: convert to MTD_EEPROM_AT24
LoongArch: convert to MTD_EEPROM_AT24
eeprom: at24: remove deprecated Kconfig symbol
MAINTAINERS | 2 +-
arch/arm/configs/aspeed_g4_defconfig | 2 +-
arch/arm/configs/aspeed_g5_defconfig | 2 +-
arch/arm/configs/at91_dt_defconfig | 2 +-
arch/arm/configs/axm55xx_defconfig | 2 +-
arch/arm/configs/davinci_all_defconfig | 2 +-
arch/arm/configs/imx_v4_v5_defconfig | 2 +-
arch/arm/configs/imx_v6_v7_defconfig | 2 +-
arch/arm/configs/ixp4xx_defconfig | 2 +-
arch/arm/configs/keystone_defconfig | 2 +-
arch/arm/configs/lpc18xx_defconfig | 2 +-
arch/arm/configs/lpc32xx_defconfig | 2 +-
arch/arm/configs/multi_v5_defconfig | 2 +-
arch/arm/configs/multi_v7_defconfig | 2 +-
arch/arm/configs/mvebu_v5_defconfig | 2 +-
arch/arm/configs/mvebu_v7_defconfig | 2 +-
arch/arm/configs/mxs_defconfig | 2 +-
arch/arm/configs/omap2plus_defconfig | 2 +-
arch/arm/configs/pxa_defconfig | 2 +-
arch/arm/configs/s3c6400_defconfig | 2 +-
arch/arm/configs/sama5_defconfig | 2 +-
arch/arm/configs/sama7_defconfig | 2 +-
arch/arm/configs/shmobile_defconfig | 2 +-
arch/arm/configs/socfpga_defconfig | 2 +-
arch/arm/configs/tegra_defconfig | 2 +-
arch/arm/configs/wpcm450_defconfig | 2 +-
arch/loongarch/configs/loongson3_defconfig | 2 +-
arch/mips/configs/cavium_octeon_defconfig | 2 +-
arch/mips/configs/db1xxx_defconfig | 2 +-
arch/powerpc/configs/44x/warp_defconfig | 2 +-
arch/powerpc/configs/mpc512x_defconfig | 2 +-
arch/powerpc/configs/mpc5200_defconfig | 2 +-
arch/powerpc/configs/ppc6xx_defconfig | 2 +-
arch/powerpc/configs/skiroot_defconfig | 2 +-
drivers/misc/eeprom/Kconfig | 31 -------
drivers/misc/eeprom/Makefile | 1 -
drivers/mtd/devices/Kconfig | 31 +++++++
drivers/mtd/devices/Makefile | 1 +
drivers/{misc/eeprom => mtd/devices}/at24.c | 122 +++++++++++++++-------------
drivers/mtd/mtdcore.c | 49 ++++++++++-
include/linux/mtd/mtd.h | 5 ++
include/uapi/mtd/mtd-abi.h | 2 +
42 files changed, 187 insertions(+), 123 deletions(-)
---
base-commit: 1613e604df0cd359cf2a7fbd9be7a0bcfacfabd0
change-id: 20240701-b4-v6-10-topic-usbc-tcpci-c4bc9bcce604
Best regards,
--
Marco Felsch <m.felsch@pengutronix.de>
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 1/9] mtd: core: add nvmem_write support
2024-07-01 13:53 [PATCH 0/9] AT24 EEPROM MTD Support Marco Felsch
@ 2024-07-01 13:53 ` Marco Felsch
2024-07-01 13:53 ` [PATCH 2/9] mtd: add mtd_is_master helper Marco Felsch
` (8 subsequent siblings)
9 siblings, 0 replies; 32+ messages in thread
From: Marco Felsch @ 2024-07-01 13:53 UTC (permalink / raw)
To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
Arnd Bergmann, Greg Kroah-Hartman, Bartosz Golaszewski,
Russell King, Joel Stanley, Andrew Jeffery, Nicolas Ferre,
Alexandre Belloni, Claudiu Beznea, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Vladimir Zapolskiy,
Andrew Lunn, Gregory Clement, Sebastian Hesselbarth,
Tony Lindgren, Geert Uytterhoeven, Magnus Damm, Dinh Nguyen,
Thierry Reding, Jonathan Hunter, Jonathan Neuschäfer,
Michael Ellerman, Nicholas Piggin, Christophe Leroy,
Naveen N. Rao, Thomas Bogendoerfer, Huacai Chen, WANG Xuerui
Cc: Marco Felsch, imx, linux-aspeed, openbmc, linux-kernel,
linux-mips, linux-renesas-soc, linux-mtd, linux-i2c, loongarch,
linux-tegra, linux-omap, linuxppc-dev, linux-arm-kernel
The MTD framework does support the NVMEM framework already but only the
read support was implemented. This commit adds the write support if the
MTD device supports writing (MTD_WRITEABLE is set).
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
drivers/mtd/mtdcore.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
index 724f917f91ba..dcd97e59425e 100644
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -544,6 +544,20 @@ static int mtd_nvmem_reg_read(void *priv, unsigned int offset,
return retlen == bytes ? 0 : -EIO;
}
+static int mtd_nvmem_reg_write(void *priv, unsigned int offset,
+ void *val, size_t bytes)
+{
+ struct mtd_info *mtd = priv;
+ size_t retlen;
+ int err;
+
+ err = mtd_write(mtd, offset, bytes, &retlen, val);
+ if (err && err != -EUCLEAN)
+ return err;
+
+ return retlen == bytes ? 0 : -EIO;
+}
+
static int mtd_nvmem_add(struct mtd_info *mtd)
{
struct device_node *node = mtd_get_of_node(mtd);
@@ -555,10 +569,11 @@ static int mtd_nvmem_add(struct mtd_info *mtd)
config.owner = THIS_MODULE;
config.add_legacy_fixed_of_cells = of_device_is_compatible(node, "nvmem-cells");
config.reg_read = mtd_nvmem_reg_read;
+ config.reg_write = mtd_nvmem_reg_write;
config.size = mtd->size;
config.word_size = 1;
config.stride = 1;
- config.read_only = true;
+ config.read_only = !(mtd->flags & MTD_WRITEABLE);
config.root_only = true;
config.ignore_wp = true;
config.priv = mtd;
--
2.39.2
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 2/9] mtd: add mtd_is_master helper
2024-07-01 13:53 [PATCH 0/9] AT24 EEPROM MTD Support Marco Felsch
2024-07-01 13:53 ` [PATCH 1/9] mtd: core: add nvmem_write support Marco Felsch
@ 2024-07-01 13:53 ` Marco Felsch
2024-07-01 16:14 ` Sergei Shtylyov
2024-07-01 13:53 ` [PATCH 3/9] mtd: add support to handle EEPROM devices Marco Felsch
` (7 subsequent siblings)
9 siblings, 1 reply; 32+ messages in thread
From: Marco Felsch @ 2024-07-01 13:53 UTC (permalink / raw)
To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
Arnd Bergmann, Greg Kroah-Hartman, Bartosz Golaszewski,
Russell King, Joel Stanley, Andrew Jeffery, Nicolas Ferre,
Alexandre Belloni, Claudiu Beznea, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Vladimir Zapolskiy,
Andrew Lunn, Gregory Clement, Sebastian Hesselbarth,
Tony Lindgren, Geert Uytterhoeven, Magnus Damm, Dinh Nguyen,
Thierry Reding, Jonathan Hunter, Jonathan Neuschäfer,
Michael Ellerman, Nicholas Piggin, Christophe Leroy,
Naveen N. Rao, Thomas Bogendoerfer, Huacai Chen, WANG Xuerui
Cc: Marco Felsch, imx, linux-aspeed, openbmc, linux-kernel,
linux-mips, linux-renesas-soc, linux-mtd, linux-i2c, loongarch,
linux-tegra, linux-omap, linuxppc-dev, linux-arm-kernel
Provide a simple helper to make it easy to detect an master mtd device.
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
include/linux/mtd/mtd.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index 8d10d9d2e830..bf3fc2ea7230 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -408,6 +408,11 @@ static inline struct mtd_info *mtd_get_master(struct mtd_info *mtd)
return mtd;
}
+static inline bool mtd_is_master(struct mtd_info *mtd)
+{
+ return mtd->parent ? false : true;
+}
+
static inline u64 mtd_get_master_ofs(struct mtd_info *mtd, u64 ofs)
{
while (mtd->parent) {
--
2.39.2
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 3/9] mtd: add support to handle EEPROM devices
2024-07-01 13:53 [PATCH 0/9] AT24 EEPROM MTD Support Marco Felsch
2024-07-01 13:53 ` [PATCH 1/9] mtd: core: add nvmem_write support Marco Felsch
2024-07-01 13:53 ` [PATCH 2/9] mtd: add mtd_is_master helper Marco Felsch
@ 2024-07-01 13:53 ` Marco Felsch
2024-07-01 13:53 ` [PATCH 4/9] mtd: devices: add AT24 eeprom support Marco Felsch
` (6 subsequent siblings)
9 siblings, 0 replies; 32+ messages in thread
From: Marco Felsch @ 2024-07-01 13:53 UTC (permalink / raw)
To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
Arnd Bergmann, Greg Kroah-Hartman, Bartosz Golaszewski,
Russell King, Joel Stanley, Andrew Jeffery, Nicolas Ferre,
Alexandre Belloni, Claudiu Beznea, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Vladimir Zapolskiy,
Andrew Lunn, Gregory Clement, Sebastian Hesselbarth,
Tony Lindgren, Geert Uytterhoeven, Magnus Damm, Dinh Nguyen,
Thierry Reding, Jonathan Hunter, Jonathan Neuschäfer,
Michael Ellerman, Nicholas Piggin, Christophe Leroy,
Naveen N. Rao, Thomas Bogendoerfer, Huacai Chen, WANG Xuerui
Cc: Marco Felsch, imx, linux-aspeed, openbmc, linux-kernel,
linux-mips, linux-renesas-soc, linux-mtd, linux-i2c, loongarch,
linux-tegra, linux-omap, linuxppc-dev, linux-arm-kernel
At the moment EEPROMs are covered by misc/driver/eeprom/* drivers. This
commit prepares the MTD framework to handle EEPROM devices within the
MTD layer.
To keep the backward compatibility with the current misc drivers the
master device must be exposed always. Furthermore the NVMEM device
parent must be set to the I2C device instead of the MTD device and the
name must be either the I2C device name or the name specified via the
label.
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
drivers/mtd/mtdcore.c | 32 +++++++++++++++++++++++++++++++-
include/uapi/mtd/mtd-abi.h | 2 ++
2 files changed, 33 insertions(+), 1 deletion(-)
diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
index dcd97e59425e..e2a996ccd17e 100644
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -149,6 +149,9 @@ static ssize_t mtd_type_show(struct device *dev,
case MTD_ROM:
type = "rom";
break;
+ case MTD_EEPROM:
+ type = "eeprom";
+ break;
case MTD_NORFLASH:
type = "nor";
break;
@@ -578,6 +581,33 @@ static int mtd_nvmem_add(struct mtd_info *mtd)
config.ignore_wp = true;
config.priv = mtd;
+ switch (mtd->type) {
+ case MTD_EEPROM:
+ config.type = NVMEM_TYPE_EEPROM;
+ /*
+ * The master device must be backward compatible with the
+ * predecessor (misc/eeprom/at24.c) driver. Therefore we need to
+ * adapt the naming scheme.
+ *
+ * Initialize config.id to NVMEM_DEVID_AUTO even if the
+ * mtd->name is provided via an label as some platform can have
+ * multiple eeproms with same label and we can not register each
+ * of those with same label. Failing to register those eeproms
+ * trigger cascade failure on such platform.
+ */
+ if (mtd_is_master(mtd)) {
+ config.id = NVMEM_DEVID_AUTO;
+ config.compat = true;
+ config.name = mtd->name;
+ config.dev = mtd->dev.parent;
+ config.base_dev = mtd->dev.parent;
+ }
+ break;
+ default:
+ config.type = NVMEM_TYPE_UNKNOWN;
+ break;
+ }
+
mtd->nvmem = nvmem_register(&config);
if (IS_ERR(mtd->nvmem)) {
/* Just ignore if there is no NVMEM support in the kernel */
@@ -1076,7 +1106,7 @@ int mtd_device_parse_register(struct mtd_info *mtd, const char * const *types,
if (ret)
goto out;
- if (IS_ENABLED(CONFIG_MTD_PARTITIONED_MASTER)) {
+ if (IS_ENABLED(CONFIG_MTD_PARTITIONED_MASTER) || mtd->type == MTD_EEPROM) {
ret = add_mtd_device(mtd);
if (ret)
goto out;
diff --git a/include/uapi/mtd/mtd-abi.h b/include/uapi/mtd/mtd-abi.h
index 714d55b49d2a..59bf43d58ddb 100644
--- a/include/uapi/mtd/mtd-abi.h
+++ b/include/uapi/mtd/mtd-abi.h
@@ -146,6 +146,7 @@ struct mtd_read_req {
#define MTD_DATAFLASH 6
#define MTD_UBIVOLUME 7
#define MTD_MLCNANDFLASH 8 /* MLC NAND (including TLC) */
+#define MTD_EEPROM 9
#define MTD_WRITEABLE 0x400 /* Device is writeable */
#define MTD_BIT_WRITEABLE 0x800 /* Single bits can be flipped */
@@ -159,6 +160,7 @@ struct mtd_read_req {
#define MTD_CAP_NORFLASH (MTD_WRITEABLE | MTD_BIT_WRITEABLE)
#define MTD_CAP_NANDFLASH (MTD_WRITEABLE)
#define MTD_CAP_NVRAM (MTD_WRITEABLE | MTD_BIT_WRITEABLE | MTD_NO_ERASE)
+#define MTD_CAP_EEPROM (MTD_WRITEABLE | MTD_BIT_WRITEABLE | MTD_NO_ERASE)
/* Obsolete ECC byte placement modes (used with obsolete MEMGETOOBSEL) */
#define MTD_NANDECC_OFF 0 /* Switch off ECC (Not recommended) */
--
2.39.2
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 4/9] mtd: devices: add AT24 eeprom support
2024-07-01 13:53 [PATCH 0/9] AT24 EEPROM MTD Support Marco Felsch
` (2 preceding siblings ...)
2024-07-01 13:53 ` [PATCH 3/9] mtd: add support to handle EEPROM devices Marco Felsch
@ 2024-07-01 13:53 ` Marco Felsch
2024-07-01 16:14 ` Tudor Ambarus
2024-07-01 13:53 ` [PATCH 5/9] ARM: defconfig: convert to MTD_EEPROM_AT24 Marco Felsch
` (5 subsequent siblings)
9 siblings, 1 reply; 32+ messages in thread
From: Marco Felsch @ 2024-07-01 13:53 UTC (permalink / raw)
To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
Arnd Bergmann, Greg Kroah-Hartman, Bartosz Golaszewski,
Russell King, Joel Stanley, Andrew Jeffery, Nicolas Ferre,
Alexandre Belloni, Claudiu Beznea, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Vladimir Zapolskiy,
Andrew Lunn, Gregory Clement, Sebastian Hesselbarth,
Tony Lindgren, Geert Uytterhoeven, Magnus Damm, Dinh Nguyen,
Thierry Reding, Jonathan Hunter, Jonathan Neuschäfer,
Michael Ellerman, Nicholas Piggin, Christophe Leroy,
Naveen N. Rao, Thomas Bogendoerfer, Huacai Chen, WANG Xuerui
Cc: Marco Felsch, imx, linux-aspeed, openbmc, linux-kernel,
linux-mips, linux-renesas-soc, linux-mtd, linux-i2c, loongarch,
linux-tegra, linux-omap, linuxppc-dev, linux-arm-kernel
At the moment there are three ways to access EEPROM content from
user-space:
1st) via the single nvmem device (rw)
2nd) via the single 'eeprom' device (rw)
3th) via nvmem-cells (r)
EEPROMs can become quite large nowadays (>=64K). Exposing such devices
as single device isn't always sufficient. There may be partitions which
require different access permissions. Also write access always need to
to verify the offset.
Port the current misc/eeprom/at24.c driver to the MTD framework since
EEPROMs are memory-technology devices and the framework already supports
partitioning. This allow using of-paritions like we do for SPI-NOR
devices already:
&eeprom {
compatible = "atmel,24c02";
reg = <0x52>;
pagesize = <16>;
#address-cells = <1>;
#size-cells = <0>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
label = "board-eeprom";
otp@0 {
compatible = "nvmem-cells";
label = "manufaturing";
reg = <0x0 0xe0>;
nvmem-layout {
compatible = "fixed-layout";
#address-cells = <1>;
#size-cells = <1>;
/* MACs stored in ASCII */
ethmac1: mac-address@0 {
reg = <0x0 0xc>;
};
ethmac2: mac-address@c {
reg = <0xc 0xc>;
};
test@d8 {
reg = <0xd8 0x8>;
};
};
j};
user@e0 {
reg = <0xe0 0x100>;
};
};
};
The porting was straight forward:
- at24_read/write funcs are adapted to be MTD compatible
- (re-)adding the write-protection gpio handling since the devices can
now be accessed via NVMEM and MTD API
- Replace the NVMEM with MTD registration. The mtdcore is taking care
of exposing the NVMEM and eeprom device correctly ensure backward
compatibility.
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Changelog:
v2:
- resync misc/eeprom/at24.c with mtd/at24.c driver
- add backward compatibility
- drop misc/eeprom/at24.c driver
- adapt Kconfig EEPROM_AT24 Kconfig entry
- shift infrastructure support into separate patch
- adapt commit message
---
MAINTAINERS | 2 +-
drivers/misc/eeprom/Kconfig | 30 +------
drivers/misc/eeprom/Makefile | 1 -
drivers/mtd/devices/Kconfig | 31 +++++++
drivers/mtd/devices/Makefile | 1 +
drivers/{misc/eeprom => mtd/devices}/at24.c | 122 +++++++++++++++-------------
6 files changed, 103 insertions(+), 84 deletions(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index d6c90161c7bf..a3a56f34d754 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3355,7 +3355,7 @@ L: linux-i2c@vger.kernel.org
S: Maintained
T: git git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git
F: Documentation/devicetree/bindings/eeprom/at24.yaml
-F: drivers/misc/eeprom/at24.c
+F: drivers/mtd/devices/at24.c
ATA OVER ETHERNET (AOE) DRIVER
M: "Justin Sanders" <justin@coraid.com>
diff --git a/drivers/misc/eeprom/Kconfig b/drivers/misc/eeprom/Kconfig
index 4e61ac18cc96..3a9aaec2f2c7 100644
--- a/drivers/misc/eeprom/Kconfig
+++ b/drivers/misc/eeprom/Kconfig
@@ -3,34 +3,10 @@ menu "EEPROM support"
config EEPROM_AT24
tristate "I2C EEPROMs / RAMs / ROMs from most vendors"
- depends on I2C && SYSFS
- select NVMEM
- select NVMEM_SYSFS
- select REGMAP
- select REGMAP_I2C
+ select MTD_EEPROM_AT24
help
- Enable this driver to get read/write support to most I2C EEPROMs
- and compatible devices like FRAMs, SRAMs, ROMs etc. After you
- configure the driver to know about each chip on your target
- board. Use these generic chip names, instead of vendor-specific
- ones like at24c64, 24lc02 or fm24c04:
-
- 24c00, 24c01, 24c02, spd (readonly 24c02), 24c04, 24c08,
- 24c16, 24c32, 24c64, 24c128, 24c256, 24c512, 24c1024, 24c2048
-
- Unless you like data loss puzzles, always be sure that any chip
- you configure as a 24c32 (32 kbit) or larger is NOT really a
- 24c16 (16 kbit) or smaller, and vice versa. Marking the chip
- as read-only won't help recover from this. Also, if your chip
- has any software write-protect mechanism you may want to review the
- code to make sure this driver won't turn it on by accident.
-
- If you use this with an SMBus adapter instead of an I2C adapter,
- full functionality is not available. Only smaller devices are
- supported (24c16 and below, max 4 kByte).
-
- This driver can also be built as a module. If so, the module
- will be called at24.
+ Deprecated config option to get read/write support to most I2C
+ EEPROMs. Please use MTD_EEPROM_AT24 instead.
config EEPROM_AT25
tristate "SPI EEPROMs (FRAMs) from most vendors"
diff --git a/drivers/misc/eeprom/Makefile b/drivers/misc/eeprom/Makefile
index 65794e526d5d..2ace4f09d0f0 100644
--- a/drivers/misc/eeprom/Makefile
+++ b/drivers/misc/eeprom/Makefile
@@ -1,5 +1,4 @@
# SPDX-License-Identifier: GPL-2.0
-obj-$(CONFIG_EEPROM_AT24) += at24.o
obj-$(CONFIG_EEPROM_AT25) += at25.o
obj-$(CONFIG_EEPROM_MAX6875) += max6875.o
obj-$(CONFIG_EEPROM_93CX6) += eeprom_93cx6.o
diff --git a/drivers/mtd/devices/Kconfig b/drivers/mtd/devices/Kconfig
index ff2f9e55ef28..8c6720ea84e7 100644
--- a/drivers/mtd/devices/Kconfig
+++ b/drivers/mtd/devices/Kconfig
@@ -3,6 +3,37 @@ menu "Self-contained MTD device drivers"
depends on MTD!=n
depends on HAS_IOMEM
+config MTD_EEPROM_AT24
+ tristate "MTD I2C EEPROMs / RAMs / ROMs from most vendors"
+ depends on I2C && SYSFS
+ select NVMEM
+ select NVMEM_SYSFS
+ select REGMAP
+ select REGMAP_I2C
+ help
+ Enable this driver to get read/write support to most I2C EEPROMs
+ and compatible devices like FRAMs, SRAMs, ROMs etc. After you
+ configure the driver to know about each chip on your target
+ board. Use these generic chip names, instead of vendor-specific
+ ones like at24c64, 24lc02 or fm24c04:
+
+ 24c00, 24c01, 24c02, spd (readonly 24c02), 24c04, 24c08,
+ 24c16, 24c32, 24c64, 24c128, 24c256, 24c512, 24c1024, 24c2048
+
+ Unless you like data loss puzzles, always be sure that any chip
+ you configure as a 24c32 (32 kbit) or larger is NOT really a
+ 24c16 (16 kbit) or smaller, and vice versa. Marking the chip
+ as read-only won't help recover from this. Also, if your chip
+ has any software write-protect mechanism you may want to review the
+ code to make sure this driver won't turn it on by accident.
+
+ If you use this with an SMBus adapter instead of an I2C adapter,
+ full functionality is not available. Only smaller devices are
+ supported (24c16 and below, max 4 kByte).
+
+ This driver can also be built as a module. If so, the module
+ will be called at24.
+
config MTD_PMC551
tristate "Ramix PMC551 PCI Mezzanine RAM card support"
depends on PCI
diff --git a/drivers/mtd/devices/Makefile b/drivers/mtd/devices/Makefile
index d11eb2b8b6f8..00ef5d87a957 100644
--- a/drivers/mtd/devices/Makefile
+++ b/drivers/mtd/devices/Makefile
@@ -4,6 +4,7 @@
#
obj-$(CONFIG_MTD_DOCG3) += docg3.o
+obj-$(CONFIG_MTD_EEPROM_AT24) += at24.o
obj-$(CONFIG_MTD_SLRAM) += slram.o
obj-$(CONFIG_MTD_PHRAM) += phram.o
obj-$(CONFIG_MTD_PMC551) += pmc551.o
diff --git a/drivers/misc/eeprom/at24.c b/drivers/mtd/devices/at24.c
similarity index 92%
rename from drivers/misc/eeprom/at24.c
rename to drivers/mtd/devices/at24.c
index 4bd4f32bcdab..713f40a1d95c 100644
--- a/drivers/misc/eeprom/at24.c
+++ b/drivers/mtd/devices/at24.c
@@ -4,6 +4,7 @@
*
* Copyright (C) 2005-2007 David Brownell
* Copyright (C) 2008 Wolfram Sang, Pengutronix
+ * Copyright (C) 2024 Pengutronix, Marco Felsch <kernel@pengutronix.de>
*/
#include <linux/acpi.h>
@@ -16,8 +17,8 @@
#include <linux/kernel.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
+#include <linux/mtd/mtd.h>
#include <linux/mutex.h>
-#include <linux/nvmem-provider.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/pm_runtime.h>
@@ -84,8 +85,9 @@ struct at24_data {
u16 page_size;
u8 flags;
- struct nvmem_device *nvmem;
+ struct mtd_info mtd;
struct regulator *vcc_reg;
+ struct gpio_desc *wp_gpio;
void (*read_post)(unsigned int off, char *buf, size_t count);
/*
@@ -96,6 +98,11 @@ struct at24_data {
struct regmap *client_regmaps[] __counted_by(num_addresses);
};
+static struct at24_data *mtd_to_at24(struct mtd_info *mtd)
+{
+ return container_of(mtd, struct at24_data, mtd);
+}
+
/*
* This parameter is to help this driver avoid blocking other drivers out
* of I2C for potentially troublesome amounts of time. With a 100 kHz I2C
@@ -424,20 +431,19 @@ static ssize_t at24_regmap_write(struct at24_data *at24, const char *buf,
return -ETIMEDOUT;
}
-static int at24_read(void *priv, unsigned int off, void *val, size_t count)
+static int at24_read(struct mtd_info *mtd, loff_t from, size_t len,
+ size_t *retlen, u_char *buf)
{
- struct at24_data *at24;
+ struct at24_data *at24 = mtd_to_at24(mtd);
struct device *dev;
- char *buf = val;
int i, ret;
- at24 = priv;
dev = at24_base_client_dev(at24);
- if (unlikely(!count))
- return count;
+ if (unlikely(!len))
+ return len;
- if (off + count > at24->byte_len)
+ if (from + len > at24->byte_len)
return -EINVAL;
ret = pm_runtime_resume_and_get(dev);
@@ -449,13 +455,14 @@ static int at24_read(void *priv, unsigned int off, void *val, size_t count)
*/
mutex_lock(&at24->lock);
- for (i = 0; count; i += ret, count -= ret) {
- ret = at24_regmap_read(at24, buf + i, off + i, count);
+ for (i = 0; len; i += ret, len -= ret) {
+ ret = at24_regmap_read(at24, buf + i, from + i, len);
if (ret < 0) {
mutex_unlock(&at24->lock);
pm_runtime_put(dev);
return ret;
}
+ *retlen += ret;
}
mutex_unlock(&at24->lock);
@@ -463,25 +470,24 @@ static int at24_read(void *priv, unsigned int off, void *val, size_t count)
pm_runtime_put(dev);
if (unlikely(at24->read_post))
- at24->read_post(off, buf, i);
+ at24->read_post(from, buf, i);
return 0;
}
-static int at24_write(void *priv, unsigned int off, void *val, size_t count)
+static int at24_write(struct mtd_info *mtd, loff_t to, size_t len,
+ size_t *retlen, const u_char *buf)
{
- struct at24_data *at24;
+ struct at24_data *at24 = mtd_to_at24(mtd);
struct device *dev;
- char *buf = val;
int ret;
- at24 = priv;
dev = at24_base_client_dev(at24);
- if (unlikely(!count))
+ if (unlikely(!len))
return -EINVAL;
- if (off + count > at24->byte_len)
+ if (to + len > at24->byte_len)
return -EINVAL;
ret = pm_runtime_resume_and_get(dev);
@@ -493,18 +499,23 @@ static int at24_write(void *priv, unsigned int off, void *val, size_t count)
*/
mutex_lock(&at24->lock);
- while (count) {
- ret = at24_regmap_write(at24, buf, off, count);
+ gpiod_set_value_cansleep(at24->wp_gpio, 0);
+
+ while (len) {
+ ret = at24_regmap_write(at24, buf, to, len);
if (ret < 0) {
mutex_unlock(&at24->lock);
pm_runtime_put(dev);
return ret;
}
buf += ret;
- off += ret;
- count -= ret;
+ to += ret;
+ len -= ret;
+ *retlen += ret;
}
+ gpiod_set_value_cansleep(at24->wp_gpio, 1);
+
mutex_unlock(&at24->lock);
pm_runtime_put(dev);
@@ -562,6 +573,8 @@ static void at24_probe_temp_sensor(struct i2c_client *client)
{
struct at24_data *at24 = i2c_get_clientdata(client);
struct i2c_board_info info = { .type = "jc42" };
+ struct mtd_info *mtd = &at24->mtd;
+ size_t len;
int ret;
u8 val;
@@ -569,12 +582,12 @@ static void at24_probe_temp_sensor(struct i2c_client *client)
* Byte 2 has value 11 for DDR3, earlier versions don't
* support the thermal sensor present flag
*/
- ret = at24_read(at24, 2, &val, 1);
+ ret = at24_read(mtd, 2, 1, &len, &val);
if (ret || val != 11)
return;
/* Byte 32, bit 7 is set if temp sensor is present */
- ret = at24_read(at24, 32, &val, 1);
+ ret = at24_read(mtd, 32, 1, &len, &val);
if (ret || !(val & BIT(7)))
return;
@@ -586,17 +599,19 @@ static void at24_probe_temp_sensor(struct i2c_client *client)
static int at24_probe(struct i2c_client *client)
{
struct regmap_config regmap_config = { };
- struct nvmem_config nvmem_config = { };
u32 byte_len, page_size, flags, addrw;
const struct at24_chip_data *cdata;
struct device *dev = &client->dev;
bool i2c_fn_i2c, i2c_fn_block;
unsigned int i, num_addresses;
struct at24_data *at24;
+ struct device_node *np;
+ struct mtd_info *mtd;
bool full_power;
struct regmap *regmap;
bool writable;
u8 test_byte;
+ size_t len;
int err;
i2c_fn_i2c = i2c_check_functionality(client->adapter, I2C_FUNC_I2C);
@@ -703,6 +718,10 @@ static int at24_probe(struct i2c_client *client)
page_size, at24_io_limit);
if (!i2c_fn_i2c && at24->write_max > I2C_SMBUS_BLOCK_MAX)
at24->write_max = I2C_SMBUS_BLOCK_MAX;
+
+ at24->wp_gpio = gpiod_get_optional(dev, "wp", GPIOD_OUT_HIGH);
+ if (IS_ERR(at24->wp_gpio))
+ return PTR_ERR(at24->wp_gpio);
}
/* use dummy devices for multiple-address chips */
@@ -712,37 +731,31 @@ static int at24_probe(struct i2c_client *client)
return err;
}
- /*
- * We initialize nvmem_config.id to NVMEM_DEVID_AUTO even if the
- * label property is set as some platform can have multiple eeproms
- * with same label and we can not register each of those with same
- * label. Failing to register those eeproms trigger cascade failure
- * on such platform.
- */
- nvmem_config.id = NVMEM_DEVID_AUTO;
-
+ mtd = &at24->mtd;
if (device_property_present(dev, "label")) {
err = device_property_read_string(dev, "label",
- &nvmem_config.name);
+ &mtd->name);
if (err)
return err;
} else {
- nvmem_config.name = dev_name(dev);
+ mtd->name = dev_name(dev);
}
-
- nvmem_config.type = NVMEM_TYPE_EEPROM;
- nvmem_config.dev = dev;
- nvmem_config.read_only = !writable;
- nvmem_config.root_only = !(flags & AT24_FLAG_IRUGO);
- nvmem_config.owner = THIS_MODULE;
- nvmem_config.compat = true;
- nvmem_config.base_dev = dev;
- nvmem_config.reg_read = at24_read;
- nvmem_config.reg_write = at24_write;
- nvmem_config.priv = at24;
- nvmem_config.stride = 1;
- nvmem_config.word_size = 1;
- nvmem_config.size = byte_len;
+ mtd->dev.parent = dev;
+ mtd->type = MTD_EEPROM;
+ mtd->flags = MTD_CAP_EEPROM;
+ if (!writable)
+ mtd->flags = MTD_CAP_ROM;
+
+ mtd->writesize = 1;
+ mtd->writebufsize = 1;
+ mtd->size = byte_len;
+ mtd->_read = at24_read;
+ mtd->_write = at24_write;
+
+ /* Fixed partitions are only supported on OF plaforms */
+ np = to_of_node(dev_fwnode(dev));
+ if (np)
+ mtd_set_of_node(mtd, np);
i2c_set_clientdata(client, at24);
@@ -764,7 +777,7 @@ static int at24_probe(struct i2c_client *client)
* it's powered off right now).
*/
if (full_power) {
- err = at24_read(at24, 0, &test_byte, 1);
+ err = at24_read(mtd, 0, 1, &len, &test_byte);
if (err) {
pm_runtime_disable(dev);
if (!pm_runtime_status_suspended(dev))
@@ -773,13 +786,12 @@ static int at24_probe(struct i2c_client *client)
}
}
- at24->nvmem = devm_nvmem_register(dev, &nvmem_config);
- if (IS_ERR(at24->nvmem)) {
+ err = mtd_device_register(mtd, NULL, 0);
+ if (err) {
pm_runtime_disable(dev);
if (!pm_runtime_status_suspended(dev))
regulator_disable(at24->vcc_reg);
- return dev_err_probe(dev, PTR_ERR(at24->nvmem),
- "failed to register nvmem\n");
+ return dev_err_probe(dev, err, "failed to register mtd\n");
}
/* If this a SPD EEPROM, probe for DDR3 thermal sensor */
--
2.39.2
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 5/9] ARM: defconfig: convert to MTD_EEPROM_AT24
2024-07-01 13:53 [PATCH 0/9] AT24 EEPROM MTD Support Marco Felsch
` (3 preceding siblings ...)
2024-07-01 13:53 ` [PATCH 4/9] mtd: devices: add AT24 eeprom support Marco Felsch
@ 2024-07-01 13:53 ` Marco Felsch
2024-07-10 12:48 ` Arnd Bergmann
2024-07-01 13:53 ` [PATCH 6/9] powerpc: " Marco Felsch
` (4 subsequent siblings)
9 siblings, 1 reply; 32+ messages in thread
From: Marco Felsch @ 2024-07-01 13:53 UTC (permalink / raw)
To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
Arnd Bergmann, Greg Kroah-Hartman, Bartosz Golaszewski,
Russell King, Joel Stanley, Andrew Jeffery, Nicolas Ferre,
Alexandre Belloni, Claudiu Beznea, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Vladimir Zapolskiy,
Andrew Lunn, Gregory Clement, Sebastian Hesselbarth,
Tony Lindgren, Geert Uytterhoeven, Magnus Damm, Dinh Nguyen,
Thierry Reding, Jonathan Hunter, Jonathan Neuschäfer,
Michael Ellerman, Nicholas Piggin, Christophe Leroy,
Naveen N. Rao, Thomas Bogendoerfer, Huacai Chen, WANG Xuerui
Cc: Marco Felsch, imx, linux-aspeed, openbmc, linux-kernel,
linux-mips, linux-renesas-soc, linux-mtd, linux-i2c, loongarch,
linux-tegra, linux-omap, linuxppc-dev, linux-arm-kernel
The EEPROM_AT24 Kconfig symbol is marked as deprecated. Make use of the
new Kconfig symbol to select the I2C EEPROM driver support.
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
arch/arm/configs/aspeed_g4_defconfig | 2 +-
arch/arm/configs/aspeed_g5_defconfig | 2 +-
arch/arm/configs/at91_dt_defconfig | 2 +-
arch/arm/configs/axm55xx_defconfig | 2 +-
arch/arm/configs/davinci_all_defconfig | 2 +-
arch/arm/configs/imx_v4_v5_defconfig | 2 +-
arch/arm/configs/imx_v6_v7_defconfig | 2 +-
arch/arm/configs/ixp4xx_defconfig | 2 +-
arch/arm/configs/keystone_defconfig | 2 +-
arch/arm/configs/lpc18xx_defconfig | 2 +-
arch/arm/configs/lpc32xx_defconfig | 2 +-
arch/arm/configs/multi_v5_defconfig | 2 +-
arch/arm/configs/multi_v7_defconfig | 2 +-
arch/arm/configs/mvebu_v5_defconfig | 2 +-
arch/arm/configs/mvebu_v7_defconfig | 2 +-
arch/arm/configs/mxs_defconfig | 2 +-
arch/arm/configs/omap2plus_defconfig | 2 +-
arch/arm/configs/pxa_defconfig | 2 +-
arch/arm/configs/s3c6400_defconfig | 2 +-
arch/arm/configs/sama5_defconfig | 2 +-
arch/arm/configs/sama7_defconfig | 2 +-
arch/arm/configs/shmobile_defconfig | 2 +-
arch/arm/configs/socfpga_defconfig | 2 +-
arch/arm/configs/tegra_defconfig | 2 +-
arch/arm/configs/wpcm450_defconfig | 2 +-
25 files changed, 25 insertions(+), 25 deletions(-)
diff --git a/arch/arm/configs/aspeed_g4_defconfig b/arch/arm/configs/aspeed_g4_defconfig
index 28b724d59e7e..341f7ca4ff8c 100644
--- a/arch/arm/configs/aspeed_g4_defconfig
+++ b/arch/arm/configs/aspeed_g4_defconfig
@@ -68,7 +68,7 @@ CONFIG_MTD_UBI_FASTMAP=y
CONFIG_MTD_UBI_BLOCK=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_NBD=y
-CONFIG_EEPROM_AT24=y
+CONFIG_MTD_EEPROM_AT24=y
CONFIG_NETDEVICES=y
CONFIG_NETCONSOLE=y
# CONFIG_NET_VENDOR_ALACRITECH is not set
diff --git a/arch/arm/configs/aspeed_g5_defconfig b/arch/arm/configs/aspeed_g5_defconfig
index 61cee1e7ebea..9c180658341f 100644
--- a/arch/arm/configs/aspeed_g5_defconfig
+++ b/arch/arm/configs/aspeed_g5_defconfig
@@ -82,7 +82,7 @@ CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_NBD=y
CONFIG_SMPRO_ERRMON=y
CONFIG_SMPRO_MISC=y
-CONFIG_EEPROM_AT24=y
+CONFIG_MTD_EEPROM_AT24=y
CONFIG_EEPROM_AT25=y
CONFIG_SCSI=y
CONFIG_BLK_DEV_SD=y
diff --git a/arch/arm/configs/at91_dt_defconfig b/arch/arm/configs/at91_dt_defconfig
index 1d53aec4c836..fb40790fc730 100644
--- a/arch/arm/configs/at91_dt_defconfig
+++ b/arch/arm/configs/at91_dt_defconfig
@@ -60,7 +60,7 @@ CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_COUNT=4
CONFIG_BLK_DEV_RAM_SIZE=8192
CONFIG_ATMEL_SSC=y
-CONFIG_EEPROM_AT24=m
+CONFIG_MTD_EEPROM_AT24=m
CONFIG_SCSI=y
CONFIG_BLK_DEV_SD=y
# CONFIG_BLK_DEV_BSG is not set
diff --git a/arch/arm/configs/axm55xx_defconfig b/arch/arm/configs/axm55xx_defconfig
index 516689dc6cf1..473404f468f9 100644
--- a/arch/arm/configs/axm55xx_defconfig
+++ b/arch/arm/configs/axm55xx_defconfig
@@ -89,7 +89,7 @@ CONFIG_MTD_M25P80=y
CONFIG_PROC_DEVICETREE=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_RAM=y
-CONFIG_EEPROM_AT24=y
+CONFIG_MTD_EEPROM_AT24=y
CONFIG_EEPROM_AT25=y
CONFIG_BLK_DEV_SD=y
CONFIG_CHR_DEV_SG=y
diff --git a/arch/arm/configs/davinci_all_defconfig b/arch/arm/configs/davinci_all_defconfig
index 3474e475373a..46701916c82d 100644
--- a/arch/arm/configs/davinci_all_defconfig
+++ b/arch/arm/configs/davinci_all_defconfig
@@ -73,7 +73,7 @@ CONFIG_BLK_DEV_LOOP=m
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_COUNT=1
CONFIG_BLK_DEV_RAM_SIZE=32768
-CONFIG_EEPROM_AT24=y
+CONFIG_MTD_EEPROM_AT24=y
CONFIG_BLK_DEV_SD=m
CONFIG_ATA=m
CONFIG_AHCI_DA850=m
diff --git a/arch/arm/configs/imx_v4_v5_defconfig b/arch/arm/configs/imx_v4_v5_defconfig
index 875c8cdbada7..685e685baa21 100644
--- a/arch/arm/configs/imx_v4_v5_defconfig
+++ b/arch/arm/configs/imx_v4_v5_defconfig
@@ -51,7 +51,7 @@ CONFIG_MTD_PHYSMAP=y
CONFIG_MTD_RAW_NAND=y
CONFIG_MTD_NAND_MXC=y
CONFIG_MTD_UBI=y
-CONFIG_EEPROM_AT24=y
+CONFIG_MTD_EEPROM_AT24=y
CONFIG_EEPROM_AT25=y
CONFIG_BLK_DEV_SD=y
# CONFIG_BLK_DEV_BSG is not set
diff --git a/arch/arm/configs/imx_v6_v7_defconfig b/arch/arm/configs/imx_v6_v7_defconfig
index cf2480dce285..03d71abf587e 100644
--- a/arch/arm/configs/imx_v6_v7_defconfig
+++ b/arch/arm/configs/imx_v6_v7_defconfig
@@ -104,7 +104,7 @@ CONFIG_MTD_UBI_BLOCK=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_SIZE=65536
-CONFIG_EEPROM_AT24=y
+CONFIG_MTD_EEPROM_AT24=y
CONFIG_EEPROM_AT25=y
# CONFIG_SCSI_PROC_FS is not set
CONFIG_BLK_DEV_SD=y
diff --git a/arch/arm/configs/ixp4xx_defconfig b/arch/arm/configs/ixp4xx_defconfig
index 3cb995b9616a..af36c0a7c8ae 100644
--- a/arch/arm/configs/ixp4xx_defconfig
+++ b/arch/arm/configs/ixp4xx_defconfig
@@ -98,7 +98,7 @@ CONFIG_MTD_RAW_NAND=m
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_SIZE=8192
-CONFIG_EEPROM_AT24=y
+CONFIG_MTD_EEPROM_AT24=y
# CONFIG_EEPROM_LEGACY is not set
# CONFIG_SCSI_PROC_FS is not set
CONFIG_BLK_DEV_SD=y
diff --git a/arch/arm/configs/keystone_defconfig b/arch/arm/configs/keystone_defconfig
index c1291ca290b2..c8ea405f11ab 100644
--- a/arch/arm/configs/keystone_defconfig
+++ b/arch/arm/configs/keystone_defconfig
@@ -124,7 +124,7 @@ CONFIG_MTD_SPI_NOR=y
CONFIG_MTD_UBI=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_SRAM=y
-CONFIG_EEPROM_AT24=y
+CONFIG_MTD_EEPROM_AT24=y
CONFIG_SCSI=y
CONFIG_BLK_DEV_SD=y
CONFIG_NETDEVICES=y
diff --git a/arch/arm/configs/lpc18xx_defconfig b/arch/arm/configs/lpc18xx_defconfig
index f55c231e0870..da6a41364a0d 100644
--- a/arch/arm/configs/lpc18xx_defconfig
+++ b/arch/arm/configs/lpc18xx_defconfig
@@ -53,7 +53,7 @@ CONFIG_MTD_SPI_NOR=y
CONFIG_SPI_NXP_SPIFI=y
CONFIG_BLK_DEV_RAM=y
CONFIG_SRAM=y
-CONFIG_EEPROM_AT24=y
+CONFIG_MTD_EEPROM_AT24=y
CONFIG_SCSI=y
CONFIG_BLK_DEV_SD=y
# CONFIG_BLK_DEV_BSG is not set
diff --git a/arch/arm/configs/lpc32xx_defconfig b/arch/arm/configs/lpc32xx_defconfig
index 98e267213b21..fdaa3cc28886 100644
--- a/arch/arm/configs/lpc32xx_defconfig
+++ b/arch/arm/configs/lpc32xx_defconfig
@@ -50,7 +50,7 @@ CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_COUNT=1
CONFIG_BLK_DEV_RAM_SIZE=16384
CONFIG_SRAM=y
-CONFIG_EEPROM_AT24=y
+CONFIG_MTD_EEPROM_AT24=y
CONFIG_EEPROM_AT25=y
CONFIG_SCSI=y
CONFIG_BLK_DEV_SD=y
diff --git a/arch/arm/configs/multi_v5_defconfig b/arch/arm/configs/multi_v5_defconfig
index 3f4ddcf49ec7..82d720538f11 100644
--- a/arch/arm/configs/multi_v5_defconfig
+++ b/arch/arm/configs/multi_v5_defconfig
@@ -86,7 +86,7 @@ CONFIG_MTD_UBI=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_VIRTIO_BLK=y
CONFIG_ATMEL_SSC=m
-CONFIG_EEPROM_AT24=y
+CONFIG_MTD_EEPROM_AT24=y
# CONFIG_SCSI_PROC_FS is not set
CONFIG_BLK_DEV_SD=y
CONFIG_BLK_DEV_SR=m
diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig
index 86bf057ac366..c8e77d34ac10 100644
--- a/arch/arm/configs/multi_v7_defconfig
+++ b/arch/arm/configs/multi_v7_defconfig
@@ -231,7 +231,7 @@ CONFIG_QCOM_FASTRPC=m
CONFIG_APDS9802ALS=y
CONFIG_ISL29003=y
CONFIG_PCI_ENDPOINT_TEST=m
-CONFIG_EEPROM_AT24=y
+CONFIG_MTD_EEPROM_AT24=y
CONFIG_BLK_DEV_SD=y
CONFIG_BLK_DEV_SR=y
CONFIG_ATA=y
diff --git a/arch/arm/configs/mvebu_v5_defconfig b/arch/arm/configs/mvebu_v5_defconfig
index 2467afd32146..13039167401c 100644
--- a/arch/arm/configs/mvebu_v5_defconfig
+++ b/arch/arm/configs/mvebu_v5_defconfig
@@ -68,7 +68,7 @@ CONFIG_MTD_RAW_NAND=y
CONFIG_MTD_NAND_ORION=y
CONFIG_MTD_SPI_NOR=y
CONFIG_BLK_DEV_LOOP=y
-CONFIG_EEPROM_AT24=y
+CONFIG_MTD_EEPROM_AT24=y
# CONFIG_SCSI_PROC_FS is not set
CONFIG_BLK_DEV_SD=y
CONFIG_BLK_DEV_SR=m
diff --git a/arch/arm/configs/mvebu_v7_defconfig b/arch/arm/configs/mvebu_v7_defconfig
index 2d2a4dc8f379..81fa4514457c 100644
--- a/arch/arm/configs/mvebu_v7_defconfig
+++ b/arch/arm/configs/mvebu_v7_defconfig
@@ -52,7 +52,7 @@ CONFIG_MTD_RAW_NAND=y
CONFIG_MTD_NAND_MARVELL=y
CONFIG_MTD_SPI_NOR=y
CONFIG_MTD_UBI=y
-CONFIG_EEPROM_AT24=y
+CONFIG_MTD_EEPROM_AT24=y
CONFIG_BLK_DEV_SD=y
CONFIG_ATA=y
CONFIG_SATA_AHCI=y
diff --git a/arch/arm/configs/mxs_defconfig b/arch/arm/configs/mxs_defconfig
index 43bc1255a5db..6a71f5fc6a23 100644
--- a/arch/arm/configs/mxs_defconfig
+++ b/arch/arm/configs/mxs_defconfig
@@ -52,7 +52,7 @@ CONFIG_MTD_NAND_GPMI_NAND=y
CONFIG_MTD_SPI_NOR=y
CONFIG_MTD_UBI=y
# CONFIG_BLK_DEV is not set
-CONFIG_EEPROM_AT24=y
+CONFIG_MTD_EEPROM_AT24=y
CONFIG_SCSI=y
CONFIG_BLK_DEV_SD=y
CONFIG_NETDEVICES=y
diff --git a/arch/arm/configs/omap2plus_defconfig b/arch/arm/configs/omap2plus_defconfig
index 3a166c2f02bd..84e2ebcec41a 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -294,7 +294,7 @@ CONFIG_BLK_DEV_RAM_SIZE=16384
CONFIG_SENSORS_TSL2550=m
CONFIG_SRAM=y
CONFIG_PCI_ENDPOINT_TEST=m
-CONFIG_EEPROM_AT24=m
+CONFIG_MTD_EEPROM_AT24=m
CONFIG_EEPROM_AT25=m
CONFIG_BLK_DEV_SD=y
# CONFIG_BLK_DEV_BSG is not set
diff --git a/arch/arm/configs/pxa_defconfig b/arch/arm/configs/pxa_defconfig
index f2ca5c9131b5..a5361194977a 100644
--- a/arch/arm/configs/pxa_defconfig
+++ b/arch/arm/configs/pxa_defconfig
@@ -155,7 +155,7 @@ CONFIG_AD525X_DPOT_I2C=m
CONFIG_ICS932S401=m
CONFIG_APDS9802ALS=m
CONFIG_ISL29003=m
-CONFIG_EEPROM_AT24=m
+CONFIG_MTD_EEPROM_AT24=m
CONFIG_SENSORS_LIS3_SPI=m
CONFIG_SCSI=y
CONFIG_BLK_DEV_SD=m
diff --git a/arch/arm/configs/s3c6400_defconfig b/arch/arm/configs/s3c6400_defconfig
index a37e6ac40825..3d36bcc337fc 100644
--- a/arch/arm/configs/s3c6400_defconfig
+++ b/arch/arm/configs/s3c6400_defconfig
@@ -14,7 +14,7 @@ CONFIG_MTD_RAW_NAND=y
CONFIG_MTD_NAND_S3C2410=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_RAM=y
-CONFIG_EEPROM_AT24=y
+CONFIG_MTD_EEPROM_AT24=y
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_SAMSUNG=y
CONFIG_SERIAL_SAMSUNG_CONSOLE=y
diff --git a/arch/arm/configs/sama5_defconfig b/arch/arm/configs/sama5_defconfig
index 9096a99b5abd..f92783f9515e 100644
--- a/arch/arm/configs/sama5_defconfig
+++ b/arch/arm/configs/sama5_defconfig
@@ -64,7 +64,7 @@ CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_COUNT=4
CONFIG_BLK_DEV_RAM_SIZE=8192
CONFIG_ATMEL_SSC=y
-CONFIG_EEPROM_AT24=y
+CONFIG_MTD_EEPROM_AT24=y
CONFIG_SCSI=y
CONFIG_BLK_DEV_SD=y
# CONFIG_BLK_DEV_BSG is not set
diff --git a/arch/arm/configs/sama7_defconfig b/arch/arm/configs/sama7_defconfig
index 7fa5d251ced2..8998b9cb1fd1 100644
--- a/arch/arm/configs/sama7_defconfig
+++ b/arch/arm/configs/sama7_defconfig
@@ -95,7 +95,7 @@ CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_COUNT=1
CONFIG_BLK_DEV_RAM_SIZE=8192
-CONFIG_EEPROM_AT24=y
+CONFIG_MTD_EEPROM_AT24=y
CONFIG_SCSI=y
CONFIG_BLK_DEV_SD=y
# CONFIG_BLK_DEV_BSG is not set
diff --git a/arch/arm/configs/shmobile_defconfig b/arch/arm/configs/shmobile_defconfig
index 56925adfe842..4a8360d7ae60 100644
--- a/arch/arm/configs/shmobile_defconfig
+++ b/arch/arm/configs/shmobile_defconfig
@@ -46,7 +46,7 @@ CONFIG_MTD_CFI_INTELEXT=y
CONFIG_MTD_PHYSMAP=y
CONFIG_MTD_PHYSMAP_OF=y
CONFIG_MTD_SPI_NOR=y
-CONFIG_EEPROM_AT24=y
+CONFIG_MTD_EEPROM_AT24=y
CONFIG_BLK_DEV_SD=y
CONFIG_ATA=y
CONFIG_SATA_RCAR=y
diff --git a/arch/arm/configs/socfpga_defconfig b/arch/arm/configs/socfpga_defconfig
index e82c3866b810..3c847568fffa 100644
--- a/arch/arm/configs/socfpga_defconfig
+++ b/arch/arm/configs/socfpga_defconfig
@@ -53,7 +53,7 @@ CONFIG_BLK_DEV_RAM_COUNT=2
CONFIG_BLK_DEV_RAM_SIZE=8192
CONFIG_BLK_DEV_NVME=m
CONFIG_SRAM=y
-CONFIG_EEPROM_AT24=y
+CONFIG_MTD_EEPROM_AT24=y
CONFIG_SCSI=y
# CONFIG_SCSI_PROC_FS is not set
CONFIG_BLK_DEV_SD=y
diff --git a/arch/arm/configs/tegra_defconfig b/arch/arm/configs/tegra_defconfig
index d2a094ad360c..c6eab1768591 100644
--- a/arch/arm/configs/tegra_defconfig
+++ b/arch/arm/configs/tegra_defconfig
@@ -85,7 +85,7 @@ CONFIG_AD525X_DPOT_I2C=y
CONFIG_ICS932S401=y
CONFIG_APDS9802ALS=y
CONFIG_ISL29003=y
-CONFIG_EEPROM_AT24=y
+CONFIG_MTD_EEPROM_AT24=y
CONFIG_BLK_DEV_SD=y
CONFIG_BLK_DEV_SR=y
# CONFIG_BLK_DEV_BSG is not set
diff --git a/arch/arm/configs/wpcm450_defconfig b/arch/arm/configs/wpcm450_defconfig
index 45483deab034..c72257276067 100644
--- a/arch/arm/configs/wpcm450_defconfig
+++ b/arch/arm/configs/wpcm450_defconfig
@@ -50,7 +50,7 @@ CONFIG_MTD_UBI_FASTMAP=y
CONFIG_MTD_UBI_BLOCK=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_SRAM=y
-CONFIG_EEPROM_AT24=y
+CONFIG_MTD_EEPROM_AT24=y
CONFIG_SCSI=y
# CONFIG_SCSI_PROC_FS is not set
# CONFIG_SCSI_LOWLEVEL is not set
--
2.39.2
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 6/9] powerpc: convert to MTD_EEPROM_AT24
2024-07-01 13:53 [PATCH 0/9] AT24 EEPROM MTD Support Marco Felsch
` (4 preceding siblings ...)
2024-07-01 13:53 ` [PATCH 5/9] ARM: defconfig: convert to MTD_EEPROM_AT24 Marco Felsch
@ 2024-07-01 13:53 ` Marco Felsch
2024-07-01 13:53 ` [PATCH 7/9] MIPS: configs: " Marco Felsch
` (3 subsequent siblings)
9 siblings, 0 replies; 32+ messages in thread
From: Marco Felsch @ 2024-07-01 13:53 UTC (permalink / raw)
To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
Arnd Bergmann, Greg Kroah-Hartman, Bartosz Golaszewski,
Russell King, Joel Stanley, Andrew Jeffery, Nicolas Ferre,
Alexandre Belloni, Claudiu Beznea, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Vladimir Zapolskiy,
Andrew Lunn, Gregory Clement, Sebastian Hesselbarth,
Tony Lindgren, Geert Uytterhoeven, Magnus Damm, Dinh Nguyen,
Thierry Reding, Jonathan Hunter, Jonathan Neuschäfer,
Michael Ellerman, Nicholas Piggin, Christophe Leroy,
Naveen N. Rao, Thomas Bogendoerfer, Huacai Chen, WANG Xuerui
Cc: Marco Felsch, imx, linux-aspeed, openbmc, linux-kernel,
linux-mips, linux-renesas-soc, linux-mtd, linux-i2c, loongarch,
linux-tegra, linux-omap, linuxppc-dev, linux-arm-kernel
The EEPROM_AT24 Kconfig symbol is marked as deprecated. Make use of the
new Kconfig symbol to select the I2C EEPROM driver support.
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
arch/powerpc/configs/44x/warp_defconfig | 2 +-
arch/powerpc/configs/mpc512x_defconfig | 2 +-
arch/powerpc/configs/mpc5200_defconfig | 2 +-
arch/powerpc/configs/ppc6xx_defconfig | 2 +-
arch/powerpc/configs/skiroot_defconfig | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/configs/44x/warp_defconfig b/arch/powerpc/configs/44x/warp_defconfig
index 20891c413149..d8cab860c9d9 100644
--- a/arch/powerpc/configs/44x/warp_defconfig
+++ b/arch/powerpc/configs/44x/warp_defconfig
@@ -36,7 +36,7 @@ CONFIG_MTD_RAW_NAND=y
CONFIG_MTD_NAND_NDFC=y
CONFIG_MTD_UBI=y
CONFIG_BLK_DEV_RAM=y
-CONFIG_EEPROM_AT24=y
+CONFIG_MTD_EEPROM_AT24=y
CONFIG_SCSI=y
CONFIG_BLK_DEV_SD=y
CONFIG_SCSI_SPI_ATTRS=y
diff --git a/arch/powerpc/configs/mpc512x_defconfig b/arch/powerpc/configs/mpc512x_defconfig
index d24457bc5791..0a919a76cfb8 100644
--- a/arch/powerpc/configs/mpc512x_defconfig
+++ b/arch/powerpc/configs/mpc512x_defconfig
@@ -46,7 +46,7 @@ CONFIG_MTD_UBI=y
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_COUNT=1
CONFIG_BLK_DEV_RAM_SIZE=8192
-CONFIG_EEPROM_AT24=y
+CONFIG_MTD_EEPROM_AT24=y
CONFIG_EEPROM_AT25=y
CONFIG_SCSI=y
# CONFIG_SCSI_PROC_FS is not set
diff --git a/arch/powerpc/configs/mpc5200_defconfig b/arch/powerpc/configs/mpc5200_defconfig
index c0fe5e76604a..8142836ef61a 100644
--- a/arch/powerpc/configs/mpc5200_defconfig
+++ b/arch/powerpc/configs/mpc5200_defconfig
@@ -38,7 +38,7 @@ CONFIG_MTD_UBI=m
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_SIZE=32768
-CONFIG_EEPROM_AT24=y
+CONFIG_MTD_EEPROM_AT24=y
CONFIG_BLK_DEV_SD=y
CONFIG_CHR_DEV_SG=y
CONFIG_ATA=y
diff --git a/arch/powerpc/configs/ppc6xx_defconfig b/arch/powerpc/configs/ppc6xx_defconfig
index 66c7b28d7450..5bca729a57c2 100644
--- a/arch/powerpc/configs/ppc6xx_defconfig
+++ b/arch/powerpc/configs/ppc6xx_defconfig
@@ -318,7 +318,7 @@ CONFIG_CDROM_PKTCDVD=m
CONFIG_VIRTIO_BLK=m
CONFIG_ENCLOSURE_SERVICES=m
CONFIG_SENSORS_TSL2550=m
-CONFIG_EEPROM_AT24=m
+CONFIG_MTD_EEPROM_AT24=m
CONFIG_EEPROM_LEGACY=m
CONFIG_EEPROM_MAX6875=m
CONFIG_EEPROM_93CX6=m
diff --git a/arch/powerpc/configs/skiroot_defconfig b/arch/powerpc/configs/skiroot_defconfig
index 9d44e6630908..e9be7f217cea 100644
--- a/arch/powerpc/configs/skiroot_defconfig
+++ b/arch/powerpc/configs/skiroot_defconfig
@@ -77,7 +77,7 @@ CONFIG_BLK_DEV_RAM_SIZE=65536
CONFIG_VIRTIO_BLK=m
CONFIG_BLK_DEV_NVME=m
CONFIG_NVME_MULTIPATH=y
-CONFIG_EEPROM_AT24=m
+CONFIG_MTD_EEPROM_AT24=m
# CONFIG_CXL is not set
# CONFIG_OCXL is not set
CONFIG_BLK_DEV_SD=m
--
2.39.2
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 7/9] MIPS: configs: convert to MTD_EEPROM_AT24
2024-07-01 13:53 [PATCH 0/9] AT24 EEPROM MTD Support Marco Felsch
` (5 preceding siblings ...)
2024-07-01 13:53 ` [PATCH 6/9] powerpc: " Marco Felsch
@ 2024-07-01 13:53 ` Marco Felsch
2024-07-01 13:53 ` [PATCH 8/9] LoongArch: " Marco Felsch
` (2 subsequent siblings)
9 siblings, 0 replies; 32+ messages in thread
From: Marco Felsch @ 2024-07-01 13:53 UTC (permalink / raw)
To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
Arnd Bergmann, Greg Kroah-Hartman, Bartosz Golaszewski,
Russell King, Joel Stanley, Andrew Jeffery, Nicolas Ferre,
Alexandre Belloni, Claudiu Beznea, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Vladimir Zapolskiy,
Andrew Lunn, Gregory Clement, Sebastian Hesselbarth,
Tony Lindgren, Geert Uytterhoeven, Magnus Damm, Dinh Nguyen,
Thierry Reding, Jonathan Hunter, Jonathan Neuschäfer,
Michael Ellerman, Nicholas Piggin, Christophe Leroy,
Naveen N. Rao, Thomas Bogendoerfer, Huacai Chen, WANG Xuerui
Cc: Marco Felsch, imx, linux-aspeed, openbmc, linux-kernel,
linux-mips, linux-renesas-soc, linux-mtd, linux-i2c, loongarch,
linux-tegra, linux-omap, linuxppc-dev, linux-arm-kernel
The EEPROM_AT24 Kconfig symbol is marked as deprecated. Make use of the
new Kconfig symbol to select the I2C EEPROM driver support.
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
arch/mips/configs/cavium_octeon_defconfig | 2 +-
arch/mips/configs/db1xxx_defconfig | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/mips/configs/cavium_octeon_defconfig b/arch/mips/configs/cavium_octeon_defconfig
index f523ee6f25bf..a5bb80a59c6e 100644
--- a/arch/mips/configs/cavium_octeon_defconfig
+++ b/arch/mips/configs/cavium_octeon_defconfig
@@ -50,7 +50,7 @@ CONFIG_MTD_CFI=y
CONFIG_MTD_CFI_AMDSTD=y
CONFIG_MTD_SLRAM=y
CONFIG_BLK_DEV_LOOP=y
-CONFIG_EEPROM_AT24=y
+CONFIG_MTD_EEPROM_AT24=y
CONFIG_EEPROM_AT25=y
CONFIG_BLK_DEV_SD=y
CONFIG_ATA=y
diff --git a/arch/mips/configs/db1xxx_defconfig b/arch/mips/configs/db1xxx_defconfig
index b2d9253ff786..b1c1777df16c 100644
--- a/arch/mips/configs/db1xxx_defconfig
+++ b/arch/mips/configs/db1xxx_defconfig
@@ -95,7 +95,7 @@ CONFIG_MTD_NAND_ECC_SW_BCH=y
CONFIG_MTD_NAND_AU1550=y
CONFIG_MTD_NAND_PLATFORM=y
CONFIG_MTD_SPI_NOR=y
-CONFIG_EEPROM_AT24=y
+CONFIG_MTD_EEPROM_AT24=y
CONFIG_EEPROM_AT25=y
CONFIG_BLK_DEV_SD=y
CONFIG_CHR_DEV_SG=y
--
2.39.2
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 8/9] LoongArch: convert to MTD_EEPROM_AT24
2024-07-01 13:53 [PATCH 0/9] AT24 EEPROM MTD Support Marco Felsch
` (6 preceding siblings ...)
2024-07-01 13:53 ` [PATCH 7/9] MIPS: configs: " Marco Felsch
@ 2024-07-01 13:53 ` Marco Felsch
2024-07-01 13:53 ` [PATCH 9/9] eeprom: at24: remove deprecated Kconfig symbol Marco Felsch
2024-08-23 16:24 ` [PATCH 0/9] AT24 EEPROM MTD Support Andy Shevchenko
9 siblings, 0 replies; 32+ messages in thread
From: Marco Felsch @ 2024-07-01 13:53 UTC (permalink / raw)
To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
Arnd Bergmann, Greg Kroah-Hartman, Bartosz Golaszewski,
Russell King, Joel Stanley, Andrew Jeffery, Nicolas Ferre,
Alexandre Belloni, Claudiu Beznea, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Vladimir Zapolskiy,
Andrew Lunn, Gregory Clement, Sebastian Hesselbarth,
Tony Lindgren, Geert Uytterhoeven, Magnus Damm, Dinh Nguyen,
Thierry Reding, Jonathan Hunter, Jonathan Neuschäfer,
Michael Ellerman, Nicholas Piggin, Christophe Leroy,
Naveen N. Rao, Thomas Bogendoerfer, Huacai Chen, WANG Xuerui
Cc: Marco Felsch, imx, linux-aspeed, openbmc, linux-kernel,
linux-mips, linux-renesas-soc, linux-mtd, linux-i2c, loongarch,
linux-tegra, linux-omap, linuxppc-dev, linux-arm-kernel
The EEPROM_AT24 Kconfig symbol is marked as deprecated. Make use of the
new Kconfig symbol to select the I2C EEPROM driver support.
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
arch/loongarch/configs/loongson3_defconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/loongarch/configs/loongson3_defconfig b/arch/loongarch/configs/loongson3_defconfig
index b4252c357c8e..31daff75a01a 100644
--- a/arch/loongarch/configs/loongson3_defconfig
+++ b/arch/loongarch/configs/loongson3_defconfig
@@ -433,7 +433,7 @@ CONFIG_NVME_TARGET_LOOP=m
CONFIG_NVME_TARGET_RDMA=m
CONFIG_NVME_TARGET_FC=m
CONFIG_NVME_TARGET_TCP=m
-CONFIG_EEPROM_AT24=m
+CONFIG_MTD_EEPROM_AT24=m
CONFIG_BLK_DEV_SD=y
CONFIG_BLK_DEV_SR=y
CONFIG_CHR_DEV_SG=y
--
2.39.2
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 9/9] eeprom: at24: remove deprecated Kconfig symbol
2024-07-01 13:53 [PATCH 0/9] AT24 EEPROM MTD Support Marco Felsch
` (7 preceding siblings ...)
2024-07-01 13:53 ` [PATCH 8/9] LoongArch: " Marco Felsch
@ 2024-07-01 13:53 ` Marco Felsch
2024-07-02 8:57 ` Bartosz Golaszewski
2024-08-23 16:24 ` [PATCH 0/9] AT24 EEPROM MTD Support Andy Shevchenko
9 siblings, 1 reply; 32+ messages in thread
From: Marco Felsch @ 2024-07-01 13:53 UTC (permalink / raw)
To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
Arnd Bergmann, Greg Kroah-Hartman, Bartosz Golaszewski,
Russell King, Joel Stanley, Andrew Jeffery, Nicolas Ferre,
Alexandre Belloni, Claudiu Beznea, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Vladimir Zapolskiy,
Andrew Lunn, Gregory Clement, Sebastian Hesselbarth,
Tony Lindgren, Geert Uytterhoeven, Magnus Damm, Dinh Nguyen,
Thierry Reding, Jonathan Hunter, Jonathan Neuschäfer,
Michael Ellerman, Nicholas Piggin, Christophe Leroy,
Naveen N. Rao, Thomas Bogendoerfer, Huacai Chen, WANG Xuerui
Cc: Marco Felsch, imx, linux-aspeed, openbmc, linux-kernel,
linux-mips, linux-renesas-soc, linux-mtd, linux-i2c, loongarch,
linux-tegra, linux-omap, linuxppc-dev, linux-arm-kernel
All kernel users are shifted to the new MTD_EEPROM_AT24 Kconfig symbol
so we can drop the old one.
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
drivers/misc/eeprom/Kconfig | 7 -------
1 file changed, 7 deletions(-)
diff --git a/drivers/misc/eeprom/Kconfig b/drivers/misc/eeprom/Kconfig
index 3a9aaec2f2c7..9e071cfdc6c6 100644
--- a/drivers/misc/eeprom/Kconfig
+++ b/drivers/misc/eeprom/Kconfig
@@ -1,13 +1,6 @@
# SPDX-License-Identifier: GPL-2.0-only
menu "EEPROM support"
-config EEPROM_AT24
- tristate "I2C EEPROMs / RAMs / ROMs from most vendors"
- select MTD_EEPROM_AT24
- help
- Deprecated config option to get read/write support to most I2C
- EEPROMs. Please use MTD_EEPROM_AT24 instead.
-
config EEPROM_AT25
tristate "SPI EEPROMs (FRAMs) from most vendors"
depends on SPI && SYSFS
--
2.39.2
^ permalink raw reply related [flat|nested] 32+ messages in thread
* Re: [PATCH 2/9] mtd: add mtd_is_master helper
2024-07-01 13:53 ` [PATCH 2/9] mtd: add mtd_is_master helper Marco Felsch
@ 2024-07-01 16:14 ` Sergei Shtylyov
2024-07-02 8:22 ` Marco Felsch
0 siblings, 1 reply; 32+ messages in thread
From: Sergei Shtylyov @ 2024-07-01 16:14 UTC (permalink / raw)
To: Marco Felsch, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra, Arnd Bergmann, Greg Kroah-Hartman,
Bartosz Golaszewski, Russell King, Joel Stanley, Andrew Jeffery,
Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Vladimir Zapolskiy, Andrew Lunn, Gregory Clement,
Sebastian Hesselbarth, Tony Lindgren, Geert Uytterhoeven,
Magnus Damm, Dinh Nguyen, Thierry Reding, Jonathan Hunter,
Jonathan Neuschäfer, Michael Ellerman, Nicholas Piggin,
Christophe Leroy, Naveen N. Rao, Thomas Bogendoerfer, Huacai Chen,
WANG Xuerui
Cc: imx, linux-aspeed, openbmc, linux-kernel, linux-mips,
linux-renesas-soc, linux-mtd, linux-i2c, loongarch, linux-tegra,
linux-omap, linuxppc-dev, linux-arm-kernel
On 7/1/24 4:53 PM, Marco Felsch wrote:
> Provide a simple helper to make it easy to detect an master mtd device.
>
> Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
> ---
> include/linux/mtd/mtd.h | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
> index 8d10d9d2e830..bf3fc2ea7230 100644
> --- a/include/linux/mtd/mtd.h
> +++ b/include/linux/mtd/mtd.h
> @@ -408,6 +408,11 @@ static inline struct mtd_info *mtd_get_master(struct mtd_info *mtd)
> return mtd;
> }
>
> +static inline bool mtd_is_master(struct mtd_info *mtd)
> +{
> + return mtd->parent ? false : true;
Perhaps:
return !mtd->parent;
[...]
MBR, Sergey
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 4/9] mtd: devices: add AT24 eeprom support
2024-07-01 13:53 ` [PATCH 4/9] mtd: devices: add AT24 eeprom support Marco Felsch
@ 2024-07-01 16:14 ` Tudor Ambarus
2024-07-02 13:41 ` Pratyush Yadav
0 siblings, 1 reply; 32+ messages in thread
From: Tudor Ambarus @ 2024-07-01 16:14 UTC (permalink / raw)
To: Marco Felsch, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra, Arnd Bergmann, Greg Kroah-Hartman,
Bartosz Golaszewski, Russell King, Joel Stanley, Andrew Jeffery,
Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Vladimir Zapolskiy, Andrew Lunn, Gregory Clement,
Sebastian Hesselbarth, Tony Lindgren, Geert Uytterhoeven,
Magnus Damm, Dinh Nguyen, Thierry Reding, Jonathan Hunter,
Jonathan Neuschäfer, Michael Ellerman, Nicholas Piggin,
Christophe Leroy, Naveen N. Rao, Thomas Bogendoerfer, Huacai Chen,
WANG Xuerui
Cc: imx, linux-aspeed, openbmc, linux-kernel, linux-mips,
linux-renesas-soc, linux-mtd, linux-i2c, loongarch, linux-tegra,
linux-omap, linuxppc-dev, linux-arm-kernel
On 7/1/24 2:53 PM, Marco Felsch wrote:
> EEPROMs can become quite large nowadays (>=64K). Exposing such devices
> as single device isn't always sufficient. There may be partitions which
> require different access permissions. Also write access always need to
> to verify the offset.
>
> Port the current misc/eeprom/at24.c driver to the MTD framework since
> EEPROMs are memory-technology devices and the framework already supports
I was under the impression that MTD devices are tightly coupled by erase
blocks. But then we see MTD_NO_ERASE, so what are MTD devices after all?
> partitioning. This allow using of-paritions like we do for SPI-NOR
> devices already:
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 2/9] mtd: add mtd_is_master helper
2024-07-01 16:14 ` Sergei Shtylyov
@ 2024-07-02 8:22 ` Marco Felsch
0 siblings, 0 replies; 32+ messages in thread
From: Marco Felsch @ 2024-07-02 8:22 UTC (permalink / raw)
To: Sergei Shtylyov
Cc: Andrew Lunn, Alexandre Belloni, Vignesh Raghavendra,
Geert Uytterhoeven, imx, Tony Lindgren, Claudiu Beznea,
Thierry Reding, linux-mtd, linux-i2c, Miquel Raynal, WANG Xuerui,
Fabio Estevam, linux-aspeed, Richard Weinberger, Gregory Clement,
Huacai Chen, Russell King, Christophe Leroy, Jonathan Hunter,
Joel Stanley, Naveen N. Rao, Andrew Jeffery,
Sebastian Hesselbarth, Arnd Bergmann, openbmc, Sascha Hauer,
Jonathan Neuschäfer, Nicholas Piggin, Vladimir Zapolskiy,
loongarch, linux-tegra, linux-omap, linux-arm-kernel,
Thomas Bogendoerfer, linux-mips, Greg Kroah-Hartman, linuxppc-dev,
Nicolas Ferre, linux-kernel, linux-renesas-soc, Dinh Nguyen,
Pengutronix Kernel Team, Shawn Guo, Bartosz Golaszewski
On 24-07-01, Sergei Shtylyov wrote:
> On 7/1/24 4:53 PM, Marco Felsch wrote:
>
> > Provide a simple helper to make it easy to detect an master mtd device.
> >
> > Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
> > ---
> > include/linux/mtd/mtd.h | 5 +++++
> > 1 file changed, 5 insertions(+)
> >
> > diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
> > index 8d10d9d2e830..bf3fc2ea7230 100644
> > --- a/include/linux/mtd/mtd.h
> > +++ b/include/linux/mtd/mtd.h
> > @@ -408,6 +408,11 @@ static inline struct mtd_info *mtd_get_master(struct mtd_info *mtd)
> > return mtd;
> > }
> >
> > +static inline bool mtd_is_master(struct mtd_info *mtd)
> > +{
> > + return mtd->parent ? false : true;
>
> Perhaps:
>
> return !mtd->parent;
Sure, if you prefer this style rather I will change it.
Regards,
Marco
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 9/9] eeprom: at24: remove deprecated Kconfig symbol
2024-07-01 13:53 ` [PATCH 9/9] eeprom: at24: remove deprecated Kconfig symbol Marco Felsch
@ 2024-07-02 8:57 ` Bartosz Golaszewski
2024-07-02 9:15 ` Marco Felsch
0 siblings, 1 reply; 32+ messages in thread
From: Bartosz Golaszewski @ 2024-07-02 8:57 UTC (permalink / raw)
To: Marco Felsch
Cc: Andrew Lunn, Alexandre Belloni, Vignesh Raghavendra,
Geert Uytterhoeven, imx, Tony Lindgren, Claudiu Beznea,
Thierry Reding, linux-mtd, linux-i2c, Miquel Raynal, WANG Xuerui,
Fabio Estevam, linux-aspeed, Richard Weinberger, Gregory Clement,
Huacai Chen, Russell King, Christophe Leroy, Jonathan Hunter,
Joel Stanley, Naveen N. Rao, Andrew Jeffery,
Sebastian Hesselbarth, Arnd Bergmann, Sascha Hauer,
Jonathan Neuschäfer, Nicholas Piggin, Vladimir Zapolskiy,
loongarch, linux-tegra, linux-omap, linux-arm-kernel,
Thomas Bogendoerfer, linux-mips, Greg Kroah-Hartman, linuxppc-dev,
Nicolas Ferre, linux-kernel, linux-renesas-soc, Dinh Nguyen,
Pengutronix Kernel Team, Shawn Guo, openbmc
On Mon, Jul 1, 2024 at 3:54 PM Marco Felsch <m.felsch@pengutronix.de> wrote:
>
> All kernel users are shifted to the new MTD_EEPROM_AT24 Kconfig symbol
> so we can drop the old one.
>
Nope, with this series arm64 still selects the old symbol.
Bart
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 9/9] eeprom: at24: remove deprecated Kconfig symbol
2024-07-02 8:57 ` Bartosz Golaszewski
@ 2024-07-02 9:15 ` Marco Felsch
0 siblings, 0 replies; 32+ messages in thread
From: Marco Felsch @ 2024-07-02 9:15 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: Andrew Lunn, Alexandre Belloni, Vignesh Raghavendra,
Geert Uytterhoeven, imx, Tony Lindgren, Claudiu Beznea,
Thierry Reding, linux-mtd, linux-i2c, Miquel Raynal, WANG Xuerui,
Fabio Estevam, linux-aspeed, Richard Weinberger, Gregory Clement,
Huacai Chen, Russell King, Christophe Leroy, Jonathan Hunter,
Joel Stanley, Naveen N. Rao, Andrew Jeffery,
Sebastian Hesselbarth, Arnd Bergmann, Sascha Hauer,
Jonathan Neuschäfer, Nicholas Piggin, Vladimir Zapolskiy,
loongarch, linux-tegra, linux-omap, linux-arm-kernel,
Thomas Bogendoerfer, linux-mips, Greg Kroah-Hartman, linuxppc-dev,
Nicolas Ferre, linux-kernel, linux-renesas-soc, Dinh Nguyen,
Pengutronix Kernel Team, Shawn Guo, openbmc
Hi,
On 24-07-02, Bartosz Golaszewski wrote:
> On Mon, Jul 1, 2024 at 3:54 PM Marco Felsch <m.felsch@pengutronix.de> wrote:
> >
> > All kernel users are shifted to the new MTD_EEPROM_AT24 Kconfig symbol
> > so we can drop the old one.
> >
>
> Nope, with this series arm64 still selects the old symbol.
sry. I must have forgotten to add the arm64 hunk :/ I also noticed one
powerpc config which still select the old symbol. I will fix this in v2.
Thank you,
Marco
>
> Bart
>
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 4/9] mtd: devices: add AT24 eeprom support
2024-07-01 16:14 ` Tudor Ambarus
@ 2024-07-02 13:41 ` Pratyush Yadav
2024-07-02 13:56 ` Maxime Ripard
0 siblings, 1 reply; 32+ messages in thread
From: Pratyush Yadav @ 2024-07-02 13:41 UTC (permalink / raw)
To: Tudor Ambarus
Cc: Andrew Lunn, Alexandre Belloni, Vignesh Raghavendra,
Geert Uytterhoeven, imx, Tony Lindgren, Marco Felsch,
Nicolas Ferre, Thierry Reding, linux-mtd, linux-i2c,
Miquel Raynal, WANG Xuerui, Fabio Estevam, linux-aspeed,
Richard Weinberger, Gregory Clement, Huacai Chen, Russell King,
Christophe Leroy, Jonathan Hunter, Joel Stanley, Naveen N. Rao,
Andrew Jeffery, Sebastian Hesselbarth, Arnd Bergmann, openbmc,
Sascha Hauer, Jonathan Neuschäfer, Nicholas Piggin,
Vladimir Zapolskiy, Maxime Ripard, loongarch, linux-tegra,
linux-omap, linux-arm-kernel, Thomas Bogendoerfer, linux-mips,
Greg Kroah-Hartman, linuxppc-dev, Claudiu Beznea, linux-kernel,
linux-renesas-soc, Dinh Nguyen, Pengutronix Kernel Team,
Shawn Guo, Bartosz Golaszewski
On Mon, Jul 01 2024, Tudor Ambarus wrote:
> On 7/1/24 2:53 PM, Marco Felsch wrote:
>> EEPROMs can become quite large nowadays (>=64K). Exposing such devices
>> as single device isn't always sufficient. There may be partitions which
>> require different access permissions. Also write access always need to
>> to verify the offset.
>>
>> Port the current misc/eeprom/at24.c driver to the MTD framework since
>> EEPROMs are memory-technology devices and the framework already supports
>
> I was under the impression that MTD devices are tightly coupled by erase
> blocks. But then we see MTD_NO_ERASE, so what are MTD devices after all?
I was curious as well so I did some digging.
The Kconfig help says:
Memory Technology Devices are flash, RAM and similar chips, often
used for solid state file systems on embedded devices [...]
The FAQ on the MTD documentation [0] says:
Unix traditionally only knew block devices and character devices.
Character devices were things like keyboards or mice, that you could
read current data from, but couldn't be seek-ed and didn't have a size.
Block devices had a fixed size and could be seek-ed. They also happened
to be organized in blocks of multiple bytes, usually 512.
Flash doesn't match the description of either block or character
devices. They behave similar to block device, but have differences. For
example, block devices don't distinguish between write and erase
operations. Therefore, a special device type to match flash
characteristics was created: MTD.
So MTD is neither a block nor a char device. There are translations to
use them, as if they were. But those translations are nowhere near the
original, just like translated Chinese poems.
And in the section below, it lists some properties of an MTD device:
- Consists of eraseblocks.
- Eraseblocks are larger (typically 128KiB).
- Maintains 3 main operations: read from eraseblock, write to
eraseblock, and erase eraseblock.
- Bad eraseblocks are not hidden and should be dealt with in
software.
- Eraseblocks wear-out and become bad and unusable after about 10^3
(for MLC NAND) - 10^5 (NOR, SLC NAND) erase cycles.
This does support the assumption you had about MTD devices being tightly
coupled with erase block. It also makes it quite clear that an EEPROM is
not MTD -- since EEPROMs are byte-erasable.
Of course, the existence of MTD_NO_ERASE nullifies a lot of
these points. So it seems the subsystem has evolved. MTD_NO_ERASE was
added by 92cbfdcc3661d ("[MTD] replace MTD_RAM with MTD_GENERIC_TYPE")
in 2006, but this commit only adds the flag. The functionality of "not
requiring an explicit erase" for RAM devices has existed since the start
of the git history at least.
I also found a thread from 2013 by Maxime Ripard (+Cc) suggesting adding
EEPROMs to MTD [1]. The main purpose would have been unifying the EEPROM
drivers under a single interface. I am not sure what came of it though,
since I can't find any patches that followed up with the proposal.
Overall, I'd say that while originally MTD was written with flash
devices with erase blocks in mind, the subsystem seems to have evolved
with time to include other types of devices.
I don't see anything obviously wrong with adding EEPROMs to the type of
devices in MTD as well. It doesn't seem to be too invasive to the
subsystem (I do see some dubious code when skimming through the patches,
but nothing unfixable). And the EEPROM drivers can get a common
interface. The other option would be to create a separate subsystem for
EEPROMs, but perhaps that would just lead to a bunch of code being
duplicated.
I'd like to hear if somebody thinks otherwise, and sees reasons to _not_
do this.
[0] http://www.linux-mtd.infradead.org/faq/general.html
[1] https://lore.kernel.org/linux-mtd/20130705201118.GM2959@lukather/
--
Regards,
Pratyush Yadav
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 4/9] mtd: devices: add AT24 eeprom support
2024-07-02 13:41 ` Pratyush Yadav
@ 2024-07-02 13:56 ` Maxime Ripard
2024-07-02 14:15 ` Pratyush Yadav
0 siblings, 1 reply; 32+ messages in thread
From: Maxime Ripard @ 2024-07-02 13:56 UTC (permalink / raw)
To: Pratyush Yadav
Cc: Andrew Lunn, Alexandre Belloni, Vignesh Raghavendra,
Geert Uytterhoeven, imx, Tony Lindgren, Marco Felsch,
Nicolas Ferre, Thierry Reding, linux-mtd, linux-i2c,
Miquel Raynal, WANG Xuerui, Fabio Estevam, linux-aspeed,
Richard Weinberger, Bartosz Golaszewski, Huacai Chen,
Russell King, Christophe Leroy, Jonathan Hunter, Tudor Ambarus,
Joel Stanley, Naveen N. Rao, Andrew Jeffery,
Sebastian Hesselbarth, Arnd Bergmann, openbmc, Sascha Hauer,
Jonathan Neuschäfer, Nicholas Piggin, Vladimir Zapolskiy,
loongarch, linux-tegra, linux-omap, linux-arm-kernel,
Thomas Bogendoerfer, linux-mips, Greg Kroah-Hartman, linuxppc-dev,
Claudiu Beznea, linux-kernel, linux-renesas-soc, Dinh Nguyen,
Pengutronix Kernel Team, Shawn Guo, Gregory Clement
[-- Attachment #1: Type: text/plain, Size: 3474 bytes --]
On Tue, Jul 02, 2024 at 03:41:52PM GMT, Pratyush Yadav wrote:
> On Mon, Jul 01 2024, Tudor Ambarus wrote:
>
> > On 7/1/24 2:53 PM, Marco Felsch wrote:
> >> EEPROMs can become quite large nowadays (>=64K). Exposing such devices
> >> as single device isn't always sufficient. There may be partitions which
> >> require different access permissions. Also write access always need to
> >> to verify the offset.
> >>
> >> Port the current misc/eeprom/at24.c driver to the MTD framework since
> >> EEPROMs are memory-technology devices and the framework already supports
> >
> > I was under the impression that MTD devices are tightly coupled by erase
> > blocks. But then we see MTD_NO_ERASE, so what are MTD devices after all?
>
> I was curious as well so I did some digging.
>
> The Kconfig help says:
>
> Memory Technology Devices are flash, RAM and similar chips, often
> used for solid state file systems on embedded devices [...]
>
> The FAQ on the MTD documentation [0] says:
>
> Unix traditionally only knew block devices and character devices.
> Character devices were things like keyboards or mice, that you could
> read current data from, but couldn't be seek-ed and didn't have a size.
> Block devices had a fixed size and could be seek-ed. They also happened
> to be organized in blocks of multiple bytes, usually 512.
>
> Flash doesn't match the description of either block or character
> devices. They behave similar to block device, but have differences. For
> example, block devices don't distinguish between write and erase
> operations. Therefore, a special device type to match flash
> characteristics was created: MTD.
>
> So MTD is neither a block nor a char device. There are translations to
> use them, as if they were. But those translations are nowhere near the
> original, just like translated Chinese poems.
>
> And in the section below, it lists some properties of an MTD device:
>
> - Consists of eraseblocks.
> - Eraseblocks are larger (typically 128KiB).
> - Maintains 3 main operations: read from eraseblock, write to
> eraseblock, and erase eraseblock.
> - Bad eraseblocks are not hidden and should be dealt with in
> software.
> - Eraseblocks wear-out and become bad and unusable after about 10^3
> (for MLC NAND) - 10^5 (NOR, SLC NAND) erase cycles.
>
> This does support the assumption you had about MTD devices being tightly
> coupled with erase block. It also makes it quite clear that an EEPROM is
> not MTD -- since EEPROMs are byte-erasable.
>
> Of course, the existence of MTD_NO_ERASE nullifies a lot of
> these points. So it seems the subsystem has evolved. MTD_NO_ERASE was
> added by 92cbfdcc3661d ("[MTD] replace MTD_RAM with MTD_GENERIC_TYPE")
> in 2006, but this commit only adds the flag. The functionality of "not
> requiring an explicit erase" for RAM devices has existed since the start
> of the git history at least.
>
> I also found a thread from 2013 by Maxime Ripard (+Cc) suggesting adding
> EEPROMs to MTD [1]. The main purpose would have been unifying the EEPROM
> drivers under a single interface. I am not sure what came of it though,
> since I can't find any patches that followed up with the proposal.
That discussion led to drivers/nvmem after I started to work on
some early prototype, and Srinivas took over that work.
Maxime
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 4/9] mtd: devices: add AT24 eeprom support
2024-07-02 13:56 ` Maxime Ripard
@ 2024-07-02 14:15 ` Pratyush Yadav
2024-07-02 14:34 ` Maxime Ripard
0 siblings, 1 reply; 32+ messages in thread
From: Pratyush Yadav @ 2024-07-02 14:15 UTC (permalink / raw)
To: Maxime Ripard
Cc: Andrew Lunn, Alexandre Belloni, Vignesh Raghavendra,
Geert Uytterhoeven, imx, Tony Lindgren, Marco Felsch,
Nicolas Ferre, Thierry Reding, linux-mtd, linux-i2c,
Miquel Raynal, WANG Xuerui, Fabio Estevam, linux-aspeed,
Richard Weinberger, Bartosz Golaszewski, Huacai Chen,
Russell King, Christophe Leroy, Jonathan Hunter, Tudor Ambarus,
Joel Stanley, Naveen N. Rao, Andrew Jeffery,
Sebastian Hesselbarth, Arnd Bergmann, openbmc, Sascha Hauer,
Jonathan Neuschäfer, Nicholas Piggin, Vladimir Zapolskiy,
loongarch, linux-tegra, linux-omap, linux-arm-kernel,
Thomas Bogendoerfer, linux-mips, Greg Kroah-Hartman, linuxppc-dev,
Claudiu Beznea, linux-kernel, linux-renesas-soc, Dinh Nguyen,
Pengutronix Kernel Team, Shawn Guo, Gregory Clement,
Pratyush Yadav
On Tue, Jul 02 2024, Maxime Ripard wrote:
> On Tue, Jul 02, 2024 at 03:41:52PM GMT, Pratyush Yadav wrote:
>> On Mon, Jul 01 2024, Tudor Ambarus wrote:
>>
>> > On 7/1/24 2:53 PM, Marco Felsch wrote:
>> >> EEPROMs can become quite large nowadays (>=64K). Exposing such devices
>> >> as single device isn't always sufficient. There may be partitions which
>> >> require different access permissions. Also write access always need to
>> >> to verify the offset.
>> >>
>> >> Port the current misc/eeprom/at24.c driver to the MTD framework since
>> >> EEPROMs are memory-technology devices and the framework already supports
>> >
>> > I was under the impression that MTD devices are tightly coupled by erase
>> > blocks. But then we see MTD_NO_ERASE, so what are MTD devices after all?
>>
>> I was curious as well so I did some digging.
>>
[...]
>>
>> I also found a thread from 2013 by Maxime Ripard (+Cc) suggesting adding
>> EEPROMs to MTD [1]. The main purpose would have been unifying the EEPROM
>> drivers under a single interface. I am not sure what came of it though,
>> since I can't find any patches that followed up with the proposal.
>
> That discussion led to drivers/nvmem after I started to work on
> some early prototype, and Srinivas took over that work.
So would you say it is better for EEPROM drivers to use nvmem instead of
moving under MTD?
--
Regards,
Pratyush Yadav
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 4/9] mtd: devices: add AT24 eeprom support
2024-07-02 14:15 ` Pratyush Yadav
@ 2024-07-02 14:34 ` Maxime Ripard
2024-07-08 6:44 ` Miquel Raynal
0 siblings, 1 reply; 32+ messages in thread
From: Maxime Ripard @ 2024-07-02 14:34 UTC (permalink / raw)
To: Pratyush Yadav
Cc: Andrew Lunn, Alexandre Belloni, Vignesh Raghavendra,
Geert Uytterhoeven, imx, Tony Lindgren, Marco Felsch,
Nicolas Ferre, Thierry Reding, linux-mtd, linux-i2c,
Miquel Raynal, WANG Xuerui, Fabio Estevam, linux-aspeed,
Richard Weinberger, Bartosz Golaszewski, Huacai Chen,
Russell King, Christophe Leroy, Jonathan Hunter, Tudor Ambarus,
Joel Stanley, Naveen N. Rao, Andrew Jeffery,
Sebastian Hesselbarth, Arnd Bergmann, openbmc, Sascha Hauer,
Jonathan Neuschäfer, Nicholas Piggin, Vladimir Zapolskiy,
loongarch, linux-tegra, linux-omap, linux-arm-kernel,
Thomas Bogendoerfer, linux-mips, Greg Kroah-Hartman, linuxppc-dev,
Claudiu Beznea, linux-kernel, linux-renesas-soc, Dinh Nguyen,
Pengutronix Kernel Team, Shawn Guo, Gregory Clement
[-- Attachment #1: Type: text/plain, Size: 2039 bytes --]
On Tue, Jul 02, 2024 at 04:15:20PM GMT, Pratyush Yadav wrote:
> On Tue, Jul 02 2024, Maxime Ripard wrote:
>
> > On Tue, Jul 02, 2024 at 03:41:52PM GMT, Pratyush Yadav wrote:
> >> On Mon, Jul 01 2024, Tudor Ambarus wrote:
> >>
> >> > On 7/1/24 2:53 PM, Marco Felsch wrote:
> >> >> EEPROMs can become quite large nowadays (>=64K). Exposing such devices
> >> >> as single device isn't always sufficient. There may be partitions which
> >> >> require different access permissions. Also write access always need to
> >> >> to verify the offset.
> >> >>
> >> >> Port the current misc/eeprom/at24.c driver to the MTD framework since
> >> >> EEPROMs are memory-technology devices and the framework already supports
> >> >
> >> > I was under the impression that MTD devices are tightly coupled by erase
> >> > blocks. But then we see MTD_NO_ERASE, so what are MTD devices after all?
> >>
> >> I was curious as well so I did some digging.
> >>
> [...]
> >>
> >> I also found a thread from 2013 by Maxime Ripard (+Cc) suggesting adding
> >> EEPROMs to MTD [1]. The main purpose would have been unifying the EEPROM
> >> drivers under a single interface. I am not sure what came of it though,
> >> since I can't find any patches that followed up with the proposal.
> >
> > That discussion led to drivers/nvmem after I started to work on
> > some early prototype, and Srinivas took over that work.
>
> So would you say it is better for EEPROM drivers to use nvmem instead of
> moving under MTD?
I thought so at the time, but that was more than 10y ago, and I have
followed neither nvmem nor MTD since so I don't really have an opinion
there.
It looks like drivers/misc/eeprom/at24.c has support for nvmem though,
and MTD can be used as an nvmem provider too, so it's not clear to me
why we would want to create yet another variant.
But again, you shouldn't really ask me in the first place :)
I'm sure Miquel, Srinivas, and surely others, are much more relevant to
answer that question.
Maxime
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 4/9] mtd: devices: add AT24 eeprom support
2024-07-02 14:34 ` Maxime Ripard
@ 2024-07-08 6:44 ` Miquel Raynal
2024-07-09 9:22 ` Marco Felsch
0 siblings, 1 reply; 32+ messages in thread
From: Miquel Raynal @ 2024-07-08 6:44 UTC (permalink / raw)
To: Maxime Ripard
Cc: Andrew Lunn, Alexandre Belloni, Vignesh Raghavendra,
Geert Uytterhoeven, imx, Tony Lindgren, Marco Felsch,
Nicolas Ferre, Thierry Reding, linux-mtd, linux-i2c, WANG Xuerui,
Fabio Estevam, linux-aspeed, Richard Weinberger, Gregory Clement,
Huacai Chen, Russell King, Christophe Leroy, Jonathan Hunter,
Tudor Ambarus, Joel Stanley, Naveen N. Rao, Andrew Jeffery,
Sebastian Hesselbarth, Arnd Bergmann, openbmc, Sascha Hauer,
Jonathan Neuschäfer, Nicholas Piggin, Vladimir Zapolskiy,
loongarch, linux-tegra, linux-omap, linux-arm-kernel,
Thomas Bogendoerfer, linux-mips, Greg Kroah-Hartman, linuxppc-dev,
Claudiu Beznea, linux-kernel, linux-renesas-soc, Dinh Nguyen,
Pengutronix Kernel Team, Shawn Guo, Bartosz Golaszewski,
Pratyush Yadav
Hi,
> > >> >> Port the current misc/eeprom/at24.c driver to the MTD framework since
> > >> >> EEPROMs are memory-technology devices and the framework already supports
> > >> >
> > >> > I was under the impression that MTD devices are tightly coupled by erase
> > >> > blocks. But then we see MTD_NO_ERASE, so what are MTD devices after all?
> > >>
> > >> I was curious as well so I did some digging.
> > >>
> > [...]
> > >>
> > >> I also found a thread from 2013 by Maxime Ripard (+Cc) suggesting adding
> > >> EEPROMs to MTD [1]. The main purpose would have been unifying the EEPROM
> > >> drivers under a single interface. I am not sure what came of it though,
> > >> since I can't find any patches that followed up with the proposal.
> > >
> > > That discussion led to drivers/nvmem after I started to work on
> > > some early prototype, and Srinivas took over that work.
> >
> > So would you say it is better for EEPROM drivers to use nvmem instead of
> > moving under MTD?
>
> I thought so at the time, but that was more than 10y ago, and I have
> followed neither nvmem nor MTD since so I don't really have an opinion
> there.
>
> It looks like drivers/misc/eeprom/at24.c has support for nvmem though,
> and MTD can be used as an nvmem provider too, so it's not clear to me
> why we would want to create yet another variant.
>
> But again, you shouldn't really ask me in the first place :)
>
> I'm sure Miquel, Srinivas, and surely others, are much more relevant to
> answer that question.
More relevant, I doubt, but just a feeling: EEPROMs have their own
subsystem now, NVMEM, which, as Maxime said, was initially written for
that very specific case. EEPROMs don't have the complexity of MTD
devices, and thus pulling the whole MTD subsystem just for getting
partitions seems counter intuitive to me. You can definitely "split"
EEPROM devices with NVMEM as well anyway.
Overall I think the idea of getting rid of these misc/ drivers is goes
into the right direction, but registering directly into NVMEM makes
more sense IMO.
Thanks,
Miquèl
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 4/9] mtd: devices: add AT24 eeprom support
2024-07-08 6:44 ` Miquel Raynal
@ 2024-07-09 9:22 ` Marco Felsch
2024-07-09 9:43 ` Miquel Raynal
0 siblings, 1 reply; 32+ messages in thread
From: Marco Felsch @ 2024-07-09 9:22 UTC (permalink / raw)
To: Miquel Raynal
Cc: Andrew Lunn, Alexandre Belloni, Vignesh Raghavendra,
Geert Uytterhoeven, imx, Tony Lindgren, Nicolas Ferre,
Thierry Reding, linux-mtd, linux-i2c, WANG Xuerui, Fabio Estevam,
linux-aspeed, Richard Weinberger, Gregory Clement, Huacai Chen,
Russell King, Christophe Leroy, Jonathan Hunter, Tudor Ambarus,
Joel Stanley, Naveen N. Rao, Andrew Jeffery,
Sebastian Hesselbarth, Arnd Bergmann, openbmc, Sascha Hauer,
Jonathan Neuschäfer, Maxime Ripard, Vladimir Zapolskiy,
Nicholas Piggin, loongarch, linux-tegra, linux-omap,
linux-arm-kernel, Thomas Bogendoerfer, linux-mips,
Greg Kroah-Hartman, linuxppc-dev, Claudiu Beznea, linux-kernel,
linux-renesas-soc, Dinh Nguyen, Pengutronix Kernel Team,
Shawn Guo, Bartosz Golaszewski, Pratyush Yadav
Hi Miquel,
On 24-07-08, Miquel Raynal wrote:
> Hi,
>
> > > >> >> Port the current misc/eeprom/at24.c driver to the MTD framework since
> > > >> >> EEPROMs are memory-technology devices and the framework already supports
> > > >> >
> > > >> > I was under the impression that MTD devices are tightly coupled by erase
> > > >> > blocks. But then we see MTD_NO_ERASE, so what are MTD devices after all?
> > > >>
> > > >> I was curious as well so I did some digging.
> > > >>
> > > [...]
> > > >>
> > > >> I also found a thread from 2013 by Maxime Ripard (+Cc) suggesting adding
> > > >> EEPROMs to MTD [1]. The main purpose would have been unifying the EEPROM
> > > >> drivers under a single interface. I am not sure what came of it though,
> > > >> since I can't find any patches that followed up with the proposal.
> > > >
> > > > That discussion led to drivers/nvmem after I started to work on
> > > > some early prototype, and Srinivas took over that work.
> > >
> > > So would you say it is better for EEPROM drivers to use nvmem instead of
> > > moving under MTD?
> >
> > I thought so at the time, but that was more than 10y ago, and I have
> > followed neither nvmem nor MTD since so I don't really have an opinion
> > there.
> >
> > It looks like drivers/misc/eeprom/at24.c has support for nvmem though,
> > and MTD can be used as an nvmem provider too, so it's not clear to me
> > why we would want to create yet another variant.
> >
> > But again, you shouldn't really ask me in the first place :)
> >
> > I'm sure Miquel, Srinivas, and surely others, are much more relevant to
> > answer that question.
>
> More relevant, I doubt, but just a feeling: EEPROMs have their own
> subsystem now, NVMEM, which, as Maxime said, was initially written for
> that very specific case. EEPROMs don't have the complexity of MTD
> devices, and thus pulling the whole MTD subsystem just for getting
> partitions seems counter intuitive to me. You can definitely "split"
> EEPROM devices with NVMEM as well anyway.
I asked for feedback on my RFC [1] and all I got was to merge both
drivers into one and make the driver backward compatible, which I did by
this commit.
> Overall I think the idea of getting rid of these misc/ drivers is goes
> into the right direction, but registering directly into NVMEM makes
> more sense IMO.
So you propose to have two places for the partition handling (one for
MTD and one for NVMEM) instead of one and moving the code into NVMEM
directly? That doesn't sound right to me either. Also I don't get the
point why EEPROMs can't be handled by the MTD layer? The layer already
supports devices of type MTD_RAM which are very simple and don't require
an erase-op at least I don't see one.
[1] https://lore.kernel.org/all/20231127164623.1008176-1-m.felsch@pengutronix.de
Regards,
Marco
>
> Thanks,
> Miquèl
>
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 4/9] mtd: devices: add AT24 eeprom support
2024-07-09 9:22 ` Marco Felsch
@ 2024-07-09 9:43 ` Miquel Raynal
2024-07-09 10:38 ` Marco Felsch
0 siblings, 1 reply; 32+ messages in thread
From: Miquel Raynal @ 2024-07-09 9:43 UTC (permalink / raw)
To: Marco Felsch
Cc: Andrew Lunn, Alexandre Belloni, Vignesh Raghavendra,
Geert Uytterhoeven, imx, Tony Lindgren, Nicolas Ferre,
Thierry Reding, linux-mtd, linux-i2c, WANG Xuerui, Fabio Estevam,
linux-aspeed, Richard Weinberger, Gregory Clement, Huacai Chen,
Russell King, Christophe Leroy, Jonathan Hunter, Tudor Ambarus,
Joel Stanley, Naveen N. Rao, Andrew Jeffery,
Sebastian Hesselbarth, Arnd Bergmann, openbmc, Sascha Hauer,
Jonathan Neuschäfer, Maxime Ripard, Vladimir Zapolskiy,
Nicholas Piggin, loongarch, linux-tegra, linux-omap,
linux-arm-kernel, Thomas Bogendoerfer, linux-mips,
Greg Kroah-Hartman, linuxppc-dev, Claudiu Beznea, linux-kernel,
linux-renesas-soc, Dinh Nguyen, Pengutronix Kernel Team,
Shawn Guo, Bartosz Golaszewski, Pratyush Yadav
Hi Marco,
> > > > >> I also found a thread from 2013 by Maxime Ripard (+Cc) suggesting adding
> > > > >> EEPROMs to MTD [1]. The main purpose would have been unifying the EEPROM
> > > > >> drivers under a single interface. I am not sure what came of it though,
> > > > >> since I can't find any patches that followed up with the proposal.
> > > > >
> > > > > That discussion led to drivers/nvmem after I started to work on
> > > > > some early prototype, and Srinivas took over that work.
> > > >
> > > > So would you say it is better for EEPROM drivers to use nvmem instead of
> > > > moving under MTD?
> > >
> > > I thought so at the time, but that was more than 10y ago, and I have
> > > followed neither nvmem nor MTD since so I don't really have an opinion
> > > there.
> > >
> > > It looks like drivers/misc/eeprom/at24.c has support for nvmem though,
> > > and MTD can be used as an nvmem provider too, so it's not clear to me
> > > why we would want to create yet another variant.
> > >
> > > But again, you shouldn't really ask me in the first place :)
> > >
> > > I'm sure Miquel, Srinivas, and surely others, are much more relevant to
> > > answer that question.
> >
> > More relevant, I doubt, but just a feeling: EEPROMs have their own
> > subsystem now, NVMEM, which, as Maxime said, was initially written for
> > that very specific case. EEPROMs don't have the complexity of MTD
> > devices, and thus pulling the whole MTD subsystem just for getting
> > partitions seems counter intuitive to me. You can definitely "split"
> > EEPROM devices with NVMEM as well anyway.
>
> I asked for feedback on my RFC [1] and all I got was to merge both
> drivers into one and make the driver backward compatible, which I did by
> this commit.
I'm sorry for not bringing this earlier.
> > Overall I think the idea of getting rid of these misc/ drivers is goes
> > into the right direction, but registering directly into NVMEM makes
> > more sense IMO.
>
> So you propose to have two places for the partition handling (one for
> MTD and one for NVMEM) instead of one and moving the code into NVMEM
> directly?
Why two places for the partitions handling? Just one, in NVMEM. Also
usually EEPROMs don't require very advanced partitioning schemes,
unlike flashes (which are the most common MTD devices today).
> That doesn't sound right to me either. Also I don't get the
> point why EEPROMs can't be handled by the MTD layer?
They can, but should they? Just compile the two layers and observe
the size difference. MTD is complex and old, carries a lot of history,
and the user interface is also not straightforward because you need to
handle pages, blocks, erases, bitflips, ECC stats, OOB bytes and
positions, two OTP areas... None of that exists in the EEPROM world. So
why would you want to register into MTD and pull a huge subsystem while
there is a much more recent, simpler and way lighter subsystem fitting
much better your device?
> The layer already
> supports devices of type MTD_RAM which are very simple and don't require
> an erase-op at least I don't see one.
MTD_RAM has been there forever, probably for "bad" reasons. BTW there
has been an attempt at removing it which was reverted in _2006_ and then
felt into the cracks:
21c8db9eff95 ("[MTD] Restore MTD_ROM and MTD_RAM types")
Thanks,
Miquèl
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 4/9] mtd: devices: add AT24 eeprom support
2024-07-09 9:43 ` Miquel Raynal
@ 2024-07-09 10:38 ` Marco Felsch
2024-07-17 8:19 ` Miquel Raynal
0 siblings, 1 reply; 32+ messages in thread
From: Marco Felsch @ 2024-07-09 10:38 UTC (permalink / raw)
To: Miquel Raynal
Cc: Andrew Lunn, Alexandre Belloni, Vignesh Raghavendra,
Geert Uytterhoeven, imx, Tony Lindgren, Nicolas Ferre,
Thierry Reding, linux-mtd, linux-i2c, WANG Xuerui, Fabio Estevam,
linux-aspeed, Richard Weinberger, Gregory Clement, Huacai Chen,
Russell King, Christophe Leroy, Jonathan Hunter, Tudor Ambarus,
Joel Stanley, Naveen N. Rao, Andrew Jeffery,
Sebastian Hesselbarth, Arnd Bergmann, openbmc, Sascha Hauer,
Jonathan Neuschäfer, Maxime Ripard, Vladimir Zapolskiy,
Nicholas Piggin, loongarch, linux-tegra, linux-omap,
linux-arm-kernel, Thomas Bogendoerfer, linux-mips,
Greg Kroah-Hartman, linuxppc-dev, Claudiu Beznea, linux-kernel,
linux-renesas-soc, Dinh Nguyen, Pengutronix Kernel Team,
Shawn Guo, Bartosz Golaszewski, Pratyush Yadav
On 24-07-09, Miquel Raynal wrote:
> Hi Marco,
>
> > > > > >> I also found a thread from 2013 by Maxime Ripard (+Cc) suggesting adding
> > > > > >> EEPROMs to MTD [1]. The main purpose would have been unifying the EEPROM
> > > > > >> drivers under a single interface. I am not sure what came of it though,
> > > > > >> since I can't find any patches that followed up with the proposal.
> > > > > >
> > > > > > That discussion led to drivers/nvmem after I started to work on
> > > > > > some early prototype, and Srinivas took over that work.
> > > > >
> > > > > So would you say it is better for EEPROM drivers to use nvmem instead of
> > > > > moving under MTD?
> > > >
> > > > I thought so at the time, but that was more than 10y ago, and I have
> > > > followed neither nvmem nor MTD since so I don't really have an opinion
> > > > there.
> > > >
> > > > It looks like drivers/misc/eeprom/at24.c has support for nvmem though,
> > > > and MTD can be used as an nvmem provider too, so it's not clear to me
> > > > why we would want to create yet another variant.
> > > >
> > > > But again, you shouldn't really ask me in the first place :)
> > > >
> > > > I'm sure Miquel, Srinivas, and surely others, are much more relevant to
> > > > answer that question.
> > >
> > > More relevant, I doubt, but just a feeling: EEPROMs have their own
> > > subsystem now, NVMEM, which, as Maxime said, was initially written for
> > > that very specific case. EEPROMs don't have the complexity of MTD
> > > devices, and thus pulling the whole MTD subsystem just for getting
> > > partitions seems counter intuitive to me. You can definitely "split"
> > > EEPROM devices with NVMEM as well anyway.
> >
> > I asked for feedback on my RFC [1] and all I got was to merge both
> > drivers into one and make the driver backward compatible, which I did by
> > this commit.
>
> I'm sorry for not bringing this earlier.
The purpose of the RFC was exactly to figure out the way to go therefore
I'm a bit surprised now :/
> > > Overall I think the idea of getting rid of these misc/ drivers is goes
> > > into the right direction, but registering directly into NVMEM makes
> > > more sense IMO.
> >
> > So you propose to have two places for the partition handling (one for
> > MTD and one for NVMEM) instead of one and moving the code into NVMEM
> > directly?
>
> Why two places for the partitions handling? Just one, in NVMEM. Also
Without checking the details I think that converting the MTD
partitioning code into NVMEM partitioning code is a bigger task. As you
said below there are many legacy code paths you need to consider so they
still work afterwards as well.
> usually EEPROMs don't require very advanced partitioning schemes,
> unlike flashes (which are the most common MTD devices today).
As said in my cover letter EEPROMs can become quite large and MTD
supports partitioning storage devices which is very handy for large
EEPROMs as well.
> > That doesn't sound right to me either. Also I don't get the
> > point why EEPROMs can't be handled by the MTD layer?
>
> They can, but should they? Just compile the two layers and observe
> the size difference. MTD is complex and old, carries a lot of history,
> and the user interface is also not straightforward because you need to
> handle pages, blocks, erases, bitflips, ECC stats, OOB bytes and
> positions, two OTP areas... None of that exists in the EEPROM world. So
> why would you want to register into MTD and pull a huge subsystem while
> there is a much more recent, simpler and way lighter subsystem fitting
> much better your device?
Didn't checked the size but the honest, MTD provides many Kconfig
switches to trim the size down. As of now the mtd.o is made of up to 5
(6 if chipreg.o is counted -> should be an opt) files which is of course
larger than the pure misc/eeprom/at24.c driver but not that large.
Regards,
Marco
> > The layer already
> > supports devices of type MTD_RAM which are very simple and don't require
> > an erase-op at least I don't see one.
>
> MTD_RAM has been there forever, probably for "bad" reasons. BTW there
> has been an attempt at removing it which was reverted in _2006_ and then
> felt into the cracks:
> 21c8db9eff95 ("[MTD] Restore MTD_ROM and MTD_RAM types")
>
> Thanks,
> Miquèl
>
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 5/9] ARM: defconfig: convert to MTD_EEPROM_AT24
2024-07-01 13:53 ` [PATCH 5/9] ARM: defconfig: convert to MTD_EEPROM_AT24 Marco Felsch
@ 2024-07-10 12:48 ` Arnd Bergmann
2024-07-10 12:59 ` Bartosz Golaszewski
0 siblings, 1 reply; 32+ messages in thread
From: Arnd Bergmann @ 2024-07-10 12:48 UTC (permalink / raw)
To: Marco Felsch, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra, Greg Kroah-Hartman, Bartosz Golaszewski,
Russell King, Joel Stanley, Andrew Jeffery, Nicolas Ferre,
Alexandre Belloni, Claudiu Beznea, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Vladimir Zapolskiy,
Andrew Lunn, Gregory Clement, Sebastian Hesselbarth,
Tony Lindgren, Geert Uytterhoeven, Magnus Damm, Dinh Nguyen,
Thierry Reding, Jon Hunter, Jonathan Neuschäfer,
Michael Ellerman, Nicholas Piggin, Christophe Leroy,
Naveen N. Rao, Thomas Bogendoerfer, Huacai Chen, WANG Xuerui
Cc: imx, linux-aspeed, openbmc, linux-kernel, linux-mips,
Linux-Renesas, linux-mtd, linux-i2c, loongarch, linux-tegra,
Linux-OMAP, linuxppc-dev, linux-arm-kernel
On Mon, Jul 1, 2024, at 15:53, Marco Felsch wrote:
> The EEPROM_AT24 Kconfig symbol is marked as deprecated. Make use of the
> new Kconfig symbol to select the I2C EEPROM driver support.
>
> Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
> ---
> arch/arm/configs/aspeed_g4_defconfig | 2 +-
> arch/arm/configs/aspeed_g5_defconfig | 2 +-
> arch/arm/configs/at91_dt_defconfig | 2 +-
> arch/arm/configs/axm55xx_defconfig | 2 +-
> arch/arm/configs/davinci_all_defconfig | 2 +-
> arch/arm/configs/imx_v4_v5_defconfig | 2 +-
> arch/arm/configs/imx_v6_v7_defconfig | 2 +-
> arch/arm/configs/ixp4xx_defconfig | 2 +-
> arch/arm/configs/keystone_defconfig | 2 +-
> arch/arm/configs/lpc18xx_defconfig | 2 +-
Applied to soc/defconfig, thanks
Arnd
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 5/9] ARM: defconfig: convert to MTD_EEPROM_AT24
2024-07-10 12:48 ` Arnd Bergmann
@ 2024-07-10 12:59 ` Bartosz Golaszewski
2024-07-10 14:06 ` Arnd Bergmann
0 siblings, 1 reply; 32+ messages in thread
From: Bartosz Golaszewski @ 2024-07-10 12:59 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Andrew Lunn, Alexandre Belloni, Vignesh Raghavendra,
Geert Uytterhoeven, imx, Tony Lindgren, Marco Felsch,
Nicolas Ferre, Thierry Reding, linux-mtd, linux-i2c,
Miquel Raynal, WANG Xuerui, Fabio Estevam, linux-aspeed,
Richard Weinberger, Gregory Clement, Huacai Chen, Russell King,
Christophe Leroy, Jon Hunter, Joel Stanley, Naveen N. Rao,
Andrew Jeffery, Sebastian Hesselbarth, Sascha Hauer,
Jonathan Neuschäfer, Nicholas Piggin, Vladimir Zapolskiy,
loongarch, linux-tegra, Linux-OMAP, linux-arm-kernel,
Thomas Bogendoerfer, linux-mips, Greg Kroah-Hartman, linuxppc-dev,
Claudiu Beznea, linux-kernel, Linux-Renesas, Dinh Nguyen,
Pengutronix Kernel Team, Shawn Guo, openbmc
On Wed, Jul 10, 2024 at 2:49 PM Arnd Bergmann <arnd@arndb.de> wrote:
>
> On Mon, Jul 1, 2024, at 15:53, Marco Felsch wrote:
> > The EEPROM_AT24 Kconfig symbol is marked as deprecated. Make use of the
> > new Kconfig symbol to select the I2C EEPROM driver support.
> >
> > Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
> > ---
> > arch/arm/configs/aspeed_g4_defconfig | 2 +-
> > arch/arm/configs/aspeed_g5_defconfig | 2 +-
> > arch/arm/configs/at91_dt_defconfig | 2 +-
> > arch/arm/configs/axm55xx_defconfig | 2 +-
> > arch/arm/configs/davinci_all_defconfig | 2 +-
> > arch/arm/configs/imx_v4_v5_defconfig | 2 +-
> > arch/arm/configs/imx_v6_v7_defconfig | 2 +-
> > arch/arm/configs/ixp4xx_defconfig | 2 +-
> > arch/arm/configs/keystone_defconfig | 2 +-
> > arch/arm/configs/lpc18xx_defconfig | 2 +-
>
> Applied to soc/defconfig, thanks
>
> Arnd
No! Why? This is still being discussed and it's not clear it will even
make it upstream.
Bart
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 5/9] ARM: defconfig: convert to MTD_EEPROM_AT24
2024-07-10 12:59 ` Bartosz Golaszewski
@ 2024-07-10 14:06 ` Arnd Bergmann
0 siblings, 0 replies; 32+ messages in thread
From: Arnd Bergmann @ 2024-07-10 14:06 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: Andrew Lunn, Alexandre Belloni, Vignesh Raghavendra,
Geert Uytterhoeven, imx, Tony Lindgren, Marco Felsch,
Claudiu Beznea, Thierry Reding, linux-mtd, linux-i2c,
Miquel Raynal, Shawn Guo, WANG Xuerui, Fabio Estevam,
linux-aspeed, Richard Weinberger, Gregory Clement, Huacai Chen,
Russell King, Christophe Leroy, Jon Hunter, Joel Stanley,
Naveen N. Rao, Andrew Jeffery, Sebastian Hesselbarth,
Sascha Hauer, Jonathan Neuschäfer, Nicholas Piggin,
Vladimir Zapolskiy, loongarch, linux-tegra, Linux-OMAP,
linux-arm-kernel, Thomas Bogendoerfer, Greg Kroah-Hartman,
linux-mips, linux-kernel, Linux-Renesas, Dinh Nguyen,
Pengutronix Kernel Team, linuxppc-dev, openbmc
On Wed, Jul 10, 2024, at 14:59, Bartosz Golaszewski wrote:
> On Wed, Jul 10, 2024 at 2:49 PM Arnd Bergmann <arnd@arndb.de> wrote:
>>
>> On Mon, Jul 1, 2024, at 15:53, Marco Felsch wrote:
>> > The EEPROM_AT24 Kconfig symbol is marked as deprecated. Make use of the
>> > new Kconfig symbol to select the I2C EEPROM driver support.
>> >
>> > Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
>> > ---
>> > arch/arm/configs/aspeed_g4_defconfig | 2 +-
>> > arch/arm/configs/aspeed_g5_defconfig | 2 +-
>> > arch/arm/configs/at91_dt_defconfig | 2 +-
>> > arch/arm/configs/axm55xx_defconfig | 2 +-
>> > arch/arm/configs/davinci_all_defconfig | 2 +-
>> > arch/arm/configs/imx_v4_v5_defconfig | 2 +-
>> > arch/arm/configs/imx_v6_v7_defconfig | 2 +-
>> > arch/arm/configs/ixp4xx_defconfig | 2 +-
>> > arch/arm/configs/keystone_defconfig | 2 +-
>> > arch/arm/configs/lpc18xx_defconfig | 2 +-
>>
>> Applied to soc/defconfig, thanks
>
> No! Why? This is still being discussed and it's not clear it will even
> make it upstream.
Ok, dropped again, thanks for catching this.
Arnd
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 4/9] mtd: devices: add AT24 eeprom support
2024-07-09 10:38 ` Marco Felsch
@ 2024-07-17 8:19 ` Miquel Raynal
2024-07-18 9:17 ` Marco Felsch
0 siblings, 1 reply; 32+ messages in thread
From: Miquel Raynal @ 2024-07-17 8:19 UTC (permalink / raw)
To: Marco Felsch
Cc: Andrew Lunn, Alexandre Belloni, Vignesh Raghavendra,
Geert Uytterhoeven, imx, Tony Lindgren, Nicolas Ferre,
Thierry Reding, linux-mtd, linux-i2c, WANG Xuerui, Fabio Estevam,
linux-aspeed, Richard Weinberger, Gregory Clement, Huacai Chen,
Russell King, Christophe Leroy, Jonathan Hunter, Tudor Ambarus,
Joel Stanley, Naveen N. Rao, Andrew Jeffery,
Sebastian Hesselbarth, Arnd Bergmann, openbmc, Sascha Hauer,
Jonathan Neuschäfer, Maxime Ripard, Vladimir Zapolskiy,
Nicholas Piggin, loongarch, linux-tegra, linux-omap,
linux-arm-kernel, Thomas Bogendoerfer, linux-mips,
Greg Kroah-Hartman, linuxppc-dev, Claudiu Beznea, linux-kernel,
linux-renesas-soc, Dinh Nguyen, Pengutronix Kernel Team,
Shawn Guo, Bartosz Golaszewski, Pratyush Yadav
Hi Marco,
> > > > Overall I think the idea of getting rid of these misc/ drivers is goes
> > > > into the right direction, but registering directly into NVMEM makes
> > > > more sense IMO.
> > >
> > > So you propose to have two places for the partition handling (one for
> > > MTD and one for NVMEM) instead of one and moving the code into NVMEM
> > > directly?
> >
> > Why two places for the partitions handling? Just one, in NVMEM. Also
>
> Without checking the details I think that converting the MTD
> partitioning code into NVMEM partitioning code is a bigger task. As you
> said below there are many legacy code paths you need to consider so they
> still work afterwards as well.
>
> > usually EEPROMs don't require very advanced partitioning schemes,
> > unlike flashes (which are the most common MTD devices today).
>
> As said in my cover letter EEPROMs can become quite large and MTD
> supports partitioning storage devices which is very handy for large
> EEPROMs as well.
Did you had a look at nvmem-layouts ? In particular the fixed-layout.
Is there anything you would like to achieve already that is not
possible with nvmem but is with mtd?
Thanks,
Miquèl
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 4/9] mtd: devices: add AT24 eeprom support
2024-07-17 8:19 ` Miquel Raynal
@ 2024-07-18 9:17 ` Marco Felsch
2024-08-23 15:37 ` Miquel Raynal
0 siblings, 1 reply; 32+ messages in thread
From: Marco Felsch @ 2024-07-18 9:17 UTC (permalink / raw)
To: Miquel Raynal
Cc: Andrew Lunn, Alexandre Belloni, Vignesh Raghavendra,
Geert Uytterhoeven, imx, Tony Lindgren, Nicolas Ferre,
Thierry Reding, linux-mtd, linux-i2c, WANG Xuerui, Fabio Estevam,
linux-aspeed, Richard Weinberger, Gregory Clement, Huacai Chen,
Russell King, Christophe Leroy, Jonathan Hunter, Tudor Ambarus,
Joel Stanley, Naveen N. Rao, Andrew Jeffery,
Sebastian Hesselbarth, Arnd Bergmann, openbmc, Sascha Hauer,
Jonathan Neuschäfer, Maxime Ripard, Vladimir Zapolskiy,
Nicholas Piggin, loongarch, linux-tegra, linux-omap,
linux-arm-kernel, Thomas Bogendoerfer, linux-mips,
Greg Kroah-Hartman, linuxppc-dev, Claudiu Beznea, linux-kernel,
linux-renesas-soc, Dinh Nguyen, Pengutronix Kernel Team,
Shawn Guo, Bartosz Golaszewski, Pratyush Yadav
Hi Miquel,
On 24-07-17, Miquel Raynal wrote:
> Hi Marco,
>
> > > > > Overall I think the idea of getting rid of these misc/ drivers is goes
> > > > > into the right direction, but registering directly into NVMEM makes
> > > > > more sense IMO.
> > > >
> > > > So you propose to have two places for the partition handling (one for
> > > > MTD and one for NVMEM) instead of one and moving the code into NVMEM
> > > > directly?
> > >
> > > Why two places for the partitions handling? Just one, in NVMEM. Also
> >
> > Without checking the details I think that converting the MTD
> > partitioning code into NVMEM partitioning code is a bigger task. As you
> > said below there are many legacy code paths you need to consider so they
> > still work afterwards as well.
> >
> > > usually EEPROMs don't require very advanced partitioning schemes,
> > > unlike flashes (which are the most common MTD devices today).
> >
> > As said in my cover letter EEPROMs can become quite large and MTD
> > supports partitioning storage devices which is very handy for large
> > EEPROMs as well.
>
> Did you had a look at nvmem-layouts ? In particular the fixed-layout.
Yes I had a look at nvmem-layouts and we use them within a
mtd-partition. Using them instead of a mtd-partition is not sufficient
since they:
1) don't support user-space write (I send a patch for it but it doesn't
seem to be accepted soon).
2) If write would be supported the user-space need to write the
complete cell e.g. no partial writes.
> Is there anything you would like to achieve already that is not
> possible with nvmem but is with mtd?
Please see above.
Regards,
Marco
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 4/9] mtd: devices: add AT24 eeprom support
2024-07-18 9:17 ` Marco Felsch
@ 2024-08-23 15:37 ` Miquel Raynal
0 siblings, 0 replies; 32+ messages in thread
From: Miquel Raynal @ 2024-08-23 15:37 UTC (permalink / raw)
To: Marco Felsch
Cc: Maxime Ripard, Pratyush Yadav, Tudor Ambarus, Richard Weinberger,
Vignesh Raghavendra, Arnd Bergmann, Greg Kroah-Hartman,
Bartosz Golaszewski, Russell King, Joel Stanley, Andrew Jeffery,
Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Vladimir Zapolskiy, Andrew Lunn, Gregory Clement,
Sebastian Hesselbarth, Tony Lindgren, Geert Uytterhoeven,
Magnus Damm, Dinh Nguyen, Thierry Reding, Jonathan Hunter,
Jonathan Neuschäfer, Michael Ellerman, Nicholas Piggin,
Christophe Leroy, Naveen N. Rao, Thomas Bogendoerfer, Huacai Chen,
WANG Xuerui, linux-mtd, linux-kernel, linux-i2c, linux-arm-kernel,
linux-aspeed, imx, linux-omap, linux-renesas-soc, linux-tegra,
openbmc, linuxppc-dev, linux-mips, loongarch, Michael Walle
Hi Marco,
m.felsch@pengutronix.de wrote on Thu, 18 Jul 2024 11:17:53 +0200:
> Hi Miquel,
>
> On 24-07-17, Miquel Raynal wrote:
> > Hi Marco,
> >
> > > > > > Overall I think the idea of getting rid of these misc/ drivers is goes
> > > > > > into the right direction, but registering directly into NVMEM makes
> > > > > > more sense IMO.
> > > > >
> > > > > So you propose to have two places for the partition handling (one for
> > > > > MTD and one for NVMEM) instead of one and moving the code into NVMEM
> > > > > directly?
> > > >
> > > > Why two places for the partitions handling? Just one, in NVMEM. Also
> > >
> > > Without checking the details I think that converting the MTD
> > > partitioning code into NVMEM partitioning code is a bigger task. As you
> > > said below there are many legacy code paths you need to consider so they
> > > still work afterwards as well.
> > >
> > > > usually EEPROMs don't require very advanced partitioning schemes,
> > > > unlike flashes (which are the most common MTD devices today).
> > >
> > > As said in my cover letter EEPROMs can become quite large and MTD
> > > supports partitioning storage devices which is very handy for large
> > > EEPROMs as well.
> >
> > Did you had a look at nvmem-layouts ? In particular the fixed-layout.
>
> Yes I had a look at nvmem-layouts and we use them within a
> mtd-partition. Using them instead of a mtd-partition is not sufficient
> since they:
> 1) don't support user-space write (I send a patch for it but it doesn't
> seem to be accepted soon).
Yes, this needed improvements maybe but was not refused either.
> 2) If write would be supported the user-space need to write the
> complete cell e.g. no partial writes.
Maybe that can also be brought to nvmem. Again, nvmem was introduced
for handling EEPROMs in the first place.
Anyway, if other people in Cc: want to share some thoughts, they are
also welcomed, I don't want to block this series for bad reasons. I'm
also adding Michael Walle in Cc: who might have an opinion on that.
Link: https://lore.kernel.org/linux-mtd/20240701-b4-v6-10-topic-usbc-tcpci-v1-4-3fd5f4a193cc@pengutronix.de/
Thanks,
Miquèl
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 0/9] AT24 EEPROM MTD Support
2024-07-01 13:53 [PATCH 0/9] AT24 EEPROM MTD Support Marco Felsch
` (8 preceding siblings ...)
2024-07-01 13:53 ` [PATCH 9/9] eeprom: at24: remove deprecated Kconfig symbol Marco Felsch
@ 2024-08-23 16:24 ` Andy Shevchenko
2024-08-26 7:51 ` Marco Felsch
9 siblings, 1 reply; 32+ messages in thread
From: Andy Shevchenko @ 2024-08-23 16:24 UTC (permalink / raw)
To: Marco Felsch
Cc: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
Arnd Bergmann, Greg Kroah-Hartman, Bartosz Golaszewski,
Russell King, Joel Stanley, Andrew Jeffery, Nicolas Ferre,
Alexandre Belloni, Claudiu Beznea, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Vladimir Zapolskiy,
Andrew Lunn, Gregory Clement, Sebastian Hesselbarth,
Tony Lindgren, Geert Uytterhoeven, Magnus Damm, Dinh Nguyen,
Thierry Reding, Jonathan Hunter, Jonathan Neuschäfer,
Michael Ellerman, Nicholas Piggin, Christophe Leroy,
Naveen N. Rao, Thomas Bogendoerfer, Huacai Chen, WANG Xuerui,
linux-mtd, linux-kernel, linux-i2c, linux-arm-kernel,
linux-aspeed, imx, linux-omap, linux-renesas-soc, linux-tegra,
openbmc, linuxppc-dev, linux-mips, loongarch
On Mon, Jul 01, 2024 at 03:53:39PM +0200, Marco Felsch wrote:
> This series adds the intial support to handle EEPROMs via the MTD layer
> as well. This allow the user-space to have separate paritions since
> EEPROMs can become quite large nowadays.
>
> With this patchset applied EEPROMs can be accessed via:
> - legacy 'eeprom' device
> - nvmem device
> - mtd device(s)
>
> The patchset targets only the AT24 (I2C) EEPROMs since I have no access
> to AT25 (SPI) EEPROMs nor to one of the other misc/eeprom/* devices.
>
> Note: I'm not familiar with Kconfig symbol migration so I don't know if
> the last patch is required at the moment. Please be notified that the
> list of recipients is quite large due to the defconfig changes.
FWIW, I think that MTD is *not* the place for EEPROMs.
Yeah, we have the driver spread over the kernel for EEPROMs (mostly due to
historical reasons and absence an umbrella subsystem for them), but it's not
the reason to hack them into something which is not quite suitable.
If NVMEM needs to be updated and may cover these cases after all (and do not
forget about *small* size EEPROMs that most likely appear on the devices with
limited amount of resources!) in a reasonable size and performance, why not?
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 0/9] AT24 EEPROM MTD Support
2024-08-23 16:24 ` [PATCH 0/9] AT24 EEPROM MTD Support Andy Shevchenko
@ 2024-08-26 7:51 ` Marco Felsch
2024-08-26 10:32 ` Andy Shevchenko
0 siblings, 1 reply; 32+ messages in thread
From: Marco Felsch @ 2024-08-26 7:51 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
Arnd Bergmann, Greg Kroah-Hartman, Bartosz Golaszewski,
Russell King, Joel Stanley, Andrew Jeffery, Nicolas Ferre,
Alexandre Belloni, Claudiu Beznea, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Vladimir Zapolskiy,
Andrew Lunn, Gregory Clement, Sebastian Hesselbarth,
Tony Lindgren, Geert Uytterhoeven, Magnus Damm, Dinh Nguyen,
Thierry Reding, Jonathan Hunter, Jonathan Neuschäfer,
Michael Ellerman, Nicholas Piggin, Christophe Leroy,
Naveen N. Rao, Thomas Bogendoerfer, Huacai Chen, WANG Xuerui,
linux-mtd, linux-kernel, linux-i2c, linux-arm-kernel,
linux-aspeed, imx, linux-omap, linux-renesas-soc, linux-tegra,
openbmc, linuxppc-dev, linux-mips, loongarch
Hi Andy,
On 24-08-23, Andy Shevchenko wrote:
> On Mon, Jul 01, 2024 at 03:53:39PM +0200, Marco Felsch wrote:
> > This series adds the intial support to handle EEPROMs via the MTD layer
> > as well. This allow the user-space to have separate paritions since
> > EEPROMs can become quite large nowadays.
> >
> > With this patchset applied EEPROMs can be accessed via:
> > - legacy 'eeprom' device
> > - nvmem device
> > - mtd device(s)
> >
> > The patchset targets only the AT24 (I2C) EEPROMs since I have no access
> > to AT25 (SPI) EEPROMs nor to one of the other misc/eeprom/* devices.
> >
> > Note: I'm not familiar with Kconfig symbol migration so I don't know if
> > the last patch is required at the moment. Please be notified that the
> > list of recipients is quite large due to the defconfig changes.
>
> FWIW, I think that MTD is *not* the place for EEPROMs.
>
> Yeah, we have the driver spread over the kernel for EEPROMs (mostly due to
> historical reasons and absence an umbrella subsystem for them), but it's not
> the reason to hack them into something which is not quite suitable.
Thank you for you input. There are two things to mention:
1st) I send a RFC patch and asked for feedback and all I got was: looks
okay, please send a proper patch [1] which I did.
2nd) I don't see the hacky part in this patchset.
Anyway the customer doesn't need the nvmem-partitions anymore and
therefore this patchset can be seen as obsolote.
Regards,
Marco
[1] https://lore.kernel.org/lkml/20231201144441.imk7rrjnv2dugo7p@pengutronix.de/T/#m1e0e5778448971b50a883f62bd95622f6422b9a2
>
> If NVMEM needs to be updated and may cover these cases after all (and do not
> forget about *small* size EEPROMs that most likely appear on the devices with
> limited amount of resources!) in a reasonable size and performance, why not?
>
> --
> With Best Regards,
> Andy Shevchenko
>
>
>
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 0/9] AT24 EEPROM MTD Support
2024-08-26 7:51 ` Marco Felsch
@ 2024-08-26 10:32 ` Andy Shevchenko
0 siblings, 0 replies; 32+ messages in thread
From: Andy Shevchenko @ 2024-08-26 10:32 UTC (permalink / raw)
To: Marco Felsch
Cc: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
Arnd Bergmann, Greg Kroah-Hartman, Bartosz Golaszewski,
Russell King, Joel Stanley, Andrew Jeffery, Nicolas Ferre,
Alexandre Belloni, Claudiu Beznea, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Vladimir Zapolskiy,
Andrew Lunn, Gregory Clement, Sebastian Hesselbarth,
Tony Lindgren, Geert Uytterhoeven, Magnus Damm, Dinh Nguyen,
Thierry Reding, Jonathan Hunter, Jonathan Neuschäfer,
Michael Ellerman, Nicholas Piggin, Christophe Leroy,
Naveen N. Rao, Thomas Bogendoerfer, Huacai Chen, WANG Xuerui,
linux-mtd, linux-kernel, linux-i2c, linux-arm-kernel,
linux-aspeed, imx, linux-omap, linux-renesas-soc, linux-tegra,
openbmc, linuxppc-dev, linux-mips, loongarch
On Mon, Aug 26, 2024 at 09:51:10AM +0200, Marco Felsch wrote:
> On 24-08-23, Andy Shevchenko wrote:
> > On Mon, Jul 01, 2024 at 03:53:39PM +0200, Marco Felsch wrote:
> > > This series adds the intial support to handle EEPROMs via the MTD layer
> > > as well. This allow the user-space to have separate paritions since
> > > EEPROMs can become quite large nowadays.
> > >
> > > With this patchset applied EEPROMs can be accessed via:
> > > - legacy 'eeprom' device
> > > - nvmem device
> > > - mtd device(s)
> > >
> > > The patchset targets only the AT24 (I2C) EEPROMs since I have no access
> > > to AT25 (SPI) EEPROMs nor to one of the other misc/eeprom/* devices.
> > >
> > > Note: I'm not familiar with Kconfig symbol migration so I don't know if
> > > the last patch is required at the moment. Please be notified that the
> > > list of recipients is quite large due to the defconfig changes.
> >
> > FWIW, I think that MTD is *not* the place for EEPROMs.
> >
> > Yeah, we have the driver spread over the kernel for EEPROMs (mostly due to
> > historical reasons and absence an umbrella subsystem for them), but it's not
> > the reason to hack them into something which is not quite suitable.
>
> Thank you for you input. There are two things to mention:
> 1st) I send a RFC patch and asked for feedback and all I got was: looks
> okay, please send a proper patch [1] which I did.
I was on a long vacation, I haven't had time or even wishes to look at the
patches or patch series. Sorry for that.
Second point, RFC means "request for comments", here is mine. It's up to the
maintainers and you on how to proceed it.
> 2nd) I don't see the hacky part in this patchset.
I haven't talked about patchset, I have talked about architectural / design
point of view. I read the discussion and to me it seems like it solves the
issue with a quite big hammer. If you can prove that on embedded systems with
limited resources it is not a problem, just mention that in the cover letter.
> Anyway the customer doesn't need the nvmem-partitions anymore and
> therefore this patchset can be seen as obsolote.
>
> [1] https://lore.kernel.org/lkml/20231201144441.imk7rrjnv2dugo7p@pengutronix.de/T/#m1e0e5778448971b50a883f62bd95622f6422b9a2
>
> > If NVMEM needs to be updated and may cover these cases after all (and do not
> > forget about *small* size EEPROMs that most likely appear on the devices with
> > limited amount of resources!) in a reasonable size and performance, why not?
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 32+ messages in thread
end of thread, other threads:[~2024-08-26 10:33 UTC | newest]
Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-01 13:53 [PATCH 0/9] AT24 EEPROM MTD Support Marco Felsch
2024-07-01 13:53 ` [PATCH 1/9] mtd: core: add nvmem_write support Marco Felsch
2024-07-01 13:53 ` [PATCH 2/9] mtd: add mtd_is_master helper Marco Felsch
2024-07-01 16:14 ` Sergei Shtylyov
2024-07-02 8:22 ` Marco Felsch
2024-07-01 13:53 ` [PATCH 3/9] mtd: add support to handle EEPROM devices Marco Felsch
2024-07-01 13:53 ` [PATCH 4/9] mtd: devices: add AT24 eeprom support Marco Felsch
2024-07-01 16:14 ` Tudor Ambarus
2024-07-02 13:41 ` Pratyush Yadav
2024-07-02 13:56 ` Maxime Ripard
2024-07-02 14:15 ` Pratyush Yadav
2024-07-02 14:34 ` Maxime Ripard
2024-07-08 6:44 ` Miquel Raynal
2024-07-09 9:22 ` Marco Felsch
2024-07-09 9:43 ` Miquel Raynal
2024-07-09 10:38 ` Marco Felsch
2024-07-17 8:19 ` Miquel Raynal
2024-07-18 9:17 ` Marco Felsch
2024-08-23 15:37 ` Miquel Raynal
2024-07-01 13:53 ` [PATCH 5/9] ARM: defconfig: convert to MTD_EEPROM_AT24 Marco Felsch
2024-07-10 12:48 ` Arnd Bergmann
2024-07-10 12:59 ` Bartosz Golaszewski
2024-07-10 14:06 ` Arnd Bergmann
2024-07-01 13:53 ` [PATCH 6/9] powerpc: " Marco Felsch
2024-07-01 13:53 ` [PATCH 7/9] MIPS: configs: " Marco Felsch
2024-07-01 13:53 ` [PATCH 8/9] LoongArch: " Marco Felsch
2024-07-01 13:53 ` [PATCH 9/9] eeprom: at24: remove deprecated Kconfig symbol Marco Felsch
2024-07-02 8:57 ` Bartosz Golaszewski
2024-07-02 9:15 ` Marco Felsch
2024-08-23 16:24 ` [PATCH 0/9] AT24 EEPROM MTD Support Andy Shevchenko
2024-08-26 7:51 ` Marco Felsch
2024-08-26 10:32 ` Andy Shevchenko
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).