# HG changeset patch # User Mychaela Falconia # Date 1446485762 0 # Node ID 86ff6d0b0a979ed06fb8c68d81bbf7893f1694e6 # Parent 51f580665110c612f0ccebea92b996f3fc8ec384 loadtools: fc-compalram trivial utility added diff -r 51f580665110 -r 86ff6d0b0a97 .hgignore --- a/.hgignore Sun Nov 01 05:03:35 2015 +0000 +++ b/.hgignore Mon Nov 02 17:36:02 2015 +0000 @@ -19,6 +19,7 @@ ^lcdemu/fc-lcdemu$ +^loadtools/fc-compalram$ ^loadtools/fc-iram$ ^loadtools/fc-loadtool$ ^loadtools/fc-xram$ diff -r 51f580665110 -r 86ff6d0b0a97 loadtools/Makefile --- a/loadtools/Makefile Sun Nov 01 05:03:35 2015 +0000 +++ b/loadtools/Makefile Mon Nov 02 17:36:02 2015 +0000 @@ -1,10 +1,12 @@ CC= gcc CFLAGS= -O2 -PROGS= fc-iram fc-loadtool fc-xram +PROGS= fc-iram fc-loadtool fc-xram fc-compalram INSTBIN=/usr/local/bin EXTRA_OBJ= compalload.o +COMPALRAM_OBJS= compalload.o compalram.o defpath.o sercomm.o ttypassthru.o + IRAM_OBJS= defpath.o hexdecode.o hwparam.o hwparamstubs.o romload.o \ sercomm.o sertool.o srecreader.o ttypassthru.o ${EXTRA_OBJ} @@ -20,6 +22,9 @@ all: ${PROGS} +fc-compalram: ${COMPALRAM_OBJS} + ${CC} ${CFLAGS} -o $@ ${COMPALRAM_OBJS} + fc-iram: ${IRAM_OBJS} ${CC} ${CFLAGS} -o $@ ${IRAM_OBJS} diff -r 51f580665110 -r 86ff6d0b0a97 loadtools/compalram.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/loadtools/compalram.c Mon Nov 02 17:36:02 2015 +0000 @@ -0,0 +1,26 @@ +/* + * This module contains the main() function for fc-compalram, a trivial + * utility that feeds a binary download image to Compal's bootloader + * and then switches into serial tty pass-through. + */ + +#include +#include + +extern char *target_ttydev; + +main(argc, argv) + char **argv; +{ + if (argc != 3) { + fprintf(stderr, "usage: fc-compalram ttyport image.bin\n"); + exit(1); + } + target_ttydev = argv[1]; + set_compalstage_fullpath(argv[2]); + + open_target_serial(); + perform_compal_stage(0); + tty_passthru(); + exit(0); +}