summaryrefslogtreecommitdiff
path: root/drivers/eeprom
diff options
context:
space:
mode:
authorNick Brassel <nick@tzarc.org>2022-06-30 07:42:23 +1000
committerGitHub <noreply@github.com>2022-06-30 07:42:23 +1000
commit34e244cecf62afb30ee5a4362867f24b03675691 (patch)
tree5e349edd1e2749a2f158011f6cbf3fed3c054203 /drivers/eeprom
parent1204cbb7ea53ff1e4e2aeb45e2cd0f371d30dcec (diff)
Wear-leveling EEPROM drivers: `embedded_flash`, `spi_flash`, `legacy` (#17376)
Diffstat (limited to 'drivers/eeprom')
-rw-r--r--drivers/eeprom/eeprom_wear_leveling.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/eeprom/eeprom_wear_leveling.c b/drivers/eeprom/eeprom_wear_leveling.c
new file mode 100644
index 0000000000..bd77eef35c
--- /dev/null
+++ b/drivers/eeprom/eeprom_wear_leveling.c
@@ -0,0 +1,23 @@
+// Copyright 2022 Nick Brassel (@tzarc)
+// SPDX-License-Identifier: GPL-2.0-or-later
+#include <stdint.h>
+#include <string.h>
+
+#include "eeprom_driver.h"
+#include "wear_leveling.h"
+
+void eeprom_driver_init(void) {
+ wear_leveling_init();
+}
+
+void eeprom_driver_erase(void) {
+ wear_leveling_erase();
+}
+
+void eeprom_read_block(void *buf, const void *addr, size_t len) {
+ wear_leveling_read((uint32_t)addr, buf, len);
+}
+
+void eeprom_write_block(const void *buf, void *addr, size_t len) {
+ wear_leveling_write((uint32_t)addr, buf, len);
+}