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>
18 lines
543 B
Plaintext
18 lines
543 B
Plaintext
# Copyright (c) 2020 Laczen
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
config EEPROM_EMULATOR
|
|
bool "Emulated EEPROM driver"
|
|
select FLASH
|
|
help
|
|
Enable emulated (on flash) EEPROM support. This mimics an external
|
|
EEPROM on a flash partition. The number of writes that can be
|
|
performed to the EEPROM is maximized by using a flash area that is
|
|
larger than the EEPROM area and by storing only changes to the EEPROM
|
|
data.
|
|
|
|
config EEPROM_EMULATOR_INIT_PRIORITY
|
|
int "EEPROM emulator init priority"
|
|
default 75
|
|
depends on EEPROM_EMULATOR
|