programmer_table: move each entry to the associated programmer source
Change-Id: I3d02bd789f0299e936eb86819b3b15b5ea2bb921
Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.de>
Original-Reviewed-on: https://review.coreboot.org/c/flashrom/+/52946
Original-Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Original-Reviewed-by: Nico Huber <nico.h@gmx.de>
diff --git a/serprog.c b/serprog.c
index 8adf541..fdcc194 100644
--- a/serprog.c
+++ b/serprog.c
@@ -329,7 +329,7 @@
static enum chipbustype serprog_buses_supported = BUS_NONE;
-int serprog_init(void)
+static int serprog_init(void)
{
uint16_t iface;
unsigned char pgmname[17];
@@ -877,7 +877,7 @@
sp_do_read_n(&(buf[addrm-addr]), addrm, lenm); // FIXME: return error
}
-void serprog_delay(unsigned int usecs)
+static void serprog_delay(unsigned int usecs)
{
unsigned char buf[4];
msg_pspew("%s usecs=%d\n", __func__, usecs);
@@ -931,7 +931,7 @@
return ret;
}
-void *serprog_map(const char *descr, uintptr_t phys_addr, size_t len)
+static void *serprog_map(const char *descr, uintptr_t phys_addr, size_t len)
{
/* Serprog transmits 24 bits only and assumes the underlying implementation handles any remaining bits
* correctly (usually setting them to one either in software (for FWH/LPC) or relying on the fact that
@@ -945,3 +945,14 @@
descr, len, PRIxPTR_WIDTH, phys_addr);
return NULL;
}
+
+const struct programmer_entry programmer_serprog = {
+ .name = "serprog",
+ .type = OTHER,
+ /* FIXME */
+ .devs.note = "All programmer devices speaking the serprog protocol\n",
+ .init = serprog_init,
+ .map_flash_region = serprog_map,
+ .unmap_flash_region = fallback_unmap,
+ .delay = serprog_delay,
+};