aboutsummaryrefslogtreecommitdiffstats
path: root/serprog.c
diff options
context:
space:
mode:
authorThomas Heijligen <thomas.heijligen@secunet.de>2021-05-04 15:32:17 +0200
committerNico Huber <nico.h@gmx.de>2021-06-10 12:49:16 +0000
commit4f5169df5ff2b63a40d654ab133b8a3108b6a599 (patch)
treed345dd5f3068a2325298234e302988b0c82a62e3 /serprog.c
parent085db626fbf609704136aa3cc51c70325d0b40e2 (diff)
downloadflashrom-4f5169df5ff2b63a40d654ab133b8a3108b6a599.tar.gz
flashrom-4f5169df5ff2b63a40d654ab133b8a3108b6a599.tar.bz2
flashrom-4f5169df5ff2b63a40d654ab133b8a3108b6a599.zip
programmer_table: move each entry to the associated programmer source
Change-Id: I3d02bd789f0299e936eb86819b3b15b5ea2bb921 Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.de> Reviewed-on: https://review.coreboot.org/c/flashrom/+/52946 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
Diffstat (limited to 'serprog.c')
-rw-r--r--serprog.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/serprog.c b/serprog.c
index e8c0d75a..e8d1f52f 100644
--- a/serprog.c
+++ b/serprog.c
@@ -539,7 +539,7 @@ static int serprog_shutdown(void *data)
static enum chipbustype serprog_buses_supported = BUS_NONE;
-int serprog_init(void)
+static int serprog_init(void)
{
uint16_t iface;
unsigned char pgmname[17];
@@ -898,7 +898,7 @@ init_err_cleanup_exit:
return 1;
}
-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);
@@ -919,7 +919,7 @@ void serprog_delay(unsigned int usecs)
sp_prev_was_write = 0;
}
-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
@@ -933,3 +933,14 @@ void *serprog_map(const char *descr, uintptr_t phys_addr, size_t len)
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,
+};