summaryrefslogtreecommitdiff
path: root/serprog.c
diff options
context:
space:
mode:
authorhailfinger <hailfinger@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2009-06-23 11:33:43 +0000
committerhailfinger <hailfinger@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2009-06-23 11:33:43 +0000
commit89070e2e7b35f769e04e462d65cf5c161ad7c7e3 (patch)
tree6cecd997684ef18bc32a64cf1c16812f1ad6f6d2 /serprog.c
parente8b7293a4728b4e8d0c57fd9b41df9c4aa6764ab (diff)
downloadflashrom-89070e2e7b35f769e04e462d65cf5c161ad7c7e3.tar.gz
Initial commit of an external serial flasher protocol.
Supports RS-232, USB serial converters (untested) and TCP streams. All functionality is stubbed out to allow multiplatform compile testing of the headers we use. The real serial flasher protocol driver will be committed next. Signed-off-by: Urja Rannikko <urjaman@gmail.com> Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@625 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'serprog.c')
-rw-r--r--serprog.c80
1 files changed, 80 insertions, 0 deletions
diff --git a/serprog.c b/serprog.c
new file mode 100644
index 0000000..3a105c8
--- /dev/null
+++ b/serprog.c
@@ -0,0 +1,80 @@
+/*
+ * This file is part of the flashrom project.
+ *
+ * Copyright (C) 2009 Urja Rannikko <urjaman@gmail.com>
+ * Copyright (C) 2009 Carl-Daniel Hailfinger
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <string.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <arpa/inet.h>
+#include <netinet/in.h>
+#include <netinet/tcp.h>
+#include <netdb.h>
+#include <sys/stat.h>
+#include <errno.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <inttypes.h>
+#include <termios.h>
+#include "flash.h"
+
+char *serprog_param = NULL;
+
+#define SERPROG_SUPPORT 0
+#if SERPROG_SUPPORT == 1
+#else
+int serprog_init(void)
+{
+ fprintf(stderr, "Serial programmer support was not compiled in\n");
+ exit(1);
+}
+
+int serprog_shutdown(void)
+{
+ fprintf(stderr, "Serial programmer support was not compiled in\n");
+ exit(1);
+}
+
+void serprog_chip_writeb(uint8_t val, chipaddr addr)
+{
+ fprintf(stderr, "Serial programmer support was not compiled in\n");
+ exit(1);
+}
+
+uint8_t serprog_chip_readb(const chipaddr addr)
+{
+ fprintf(stderr, "Serial programmer support was not compiled in\n");
+ exit(1);
+}
+
+void serprog_chip_readn(uint8_t *buf, const chipaddr addr, size_t len)
+{
+ fprintf(stderr, "Serial programmer support was not compiled in\n");
+ exit(1);
+}
+
+void serprog_delay(int delay)
+{
+ fprintf(stderr, "Serial programmer support was not compiled in\n");
+ exit(1);
+}
+#endif