Commit graph

3 commits

Author SHA1 Message Date
Henrik Brix Andersen bda6455234 drivers: eeprom: Update drivers to use devicetree Kconfig symbol
Update EEPROM drivers to use DT_HAS_<compat>_ENABLED Kconfig symbol
to expose the driver and enable it by default based on devicetree.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-07-21 06:03:04 -05:00
Maureen Helm 32b4950c61 drivers: eeprom: Refactor drivers to use shared init priority
Refactors all of the EEPROM drivers to use a shared driver class
initialization priority configuration, CONFIG_EEPROM_INIT_PRIORITY, to
allow configuring EEPROM drivers separately from other devices. This is
similar to other driver classes like I2C and SPI.

The default is set to CONFIG_KERNEL_INIT_PRIORITY_DEVICE to preserve the
existing default initialization priority for most drivers. The
exceptions are at2x and emul drivers which have dependencies on SPI,
I2C, or flash drivers and must therefore initialize later than the
default device priority.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2021-11-04 07:33:01 -04:00
Laczen JMS 232272cff8 drivers: eeprom: EEPROM emulation in flash memory
This driver emulates a EEPROM device in flash.

Reworked implementation with modified flash layout.

The emulation represents the EEPROM in flash as a region that is a
direct map of the eeprom data followed by a region where changes to
the eeprom data is stored. Changes are written as address-data
combinations. The size of such a combination is determined by the
flash write block size and the size of the eeprom (required address
space), with a minimum of 4 byte.
The eeprom page needs to be a multiple of the flash page. Multiple
eeprom pages is also so supported and increases the number of writes
that can be performed.

The eeprom size, pagesize and the flash partition used for the eeprom
are defined in the dts. The flash partition should allow at least two
eeprom pages. For fast read access a rambuffer can be enabled for the
eeprom (by setting the option rambuf in the dts).

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2021-02-19 14:06:15 +01:00