diff options
author | dsainty <dsainty@pkgsrc.org> | 2005-09-24 09:30:54 +0000 |
---|---|---|
committer | dsainty <dsainty@pkgsrc.org> | 2005-09-24 09:30:54 +0000 |
commit | 6ce8f3de3b8cfafeed63bc1692b958998e2edf37 (patch) | |
tree | 83ffabf85e3f3f229fa7d96c917ff2bac2a1ae17 /devel | |
parent | a74040cb70339ae672ea65f8e15daec6028ba50d (diff) | |
download | pkgsrc-6ce8f3de3b8cfafeed63bc1692b958998e2edf37.tar.gz |
Picprg is a PIC programmer for a common design of programmer attached to a PC
parallel port. This package is for Byron Jeff's adapted version for Brian
Lane's original software, and supports the Trivial Low Voltage Programmer
(TLVP).
Diffstat (limited to 'devel')
-rw-r--r-- | devel/picprg/DESCR | 4 | ||||
-rw-r--r-- | devel/picprg/Makefile | 24 | ||||
-rw-r--r-- | devel/picprg/PLIST | 5 | ||||
-rw-r--r-- | devel/picprg/distinfo | 11 | ||||
-rw-r--r-- | devel/picprg/patches/patch-aa | 33 | ||||
-rw-r--r-- | devel/picprg/patches/patch-ab | 33 | ||||
-rw-r--r-- | devel/picprg/patches/patch-ac | 123 | ||||
-rw-r--r-- | devel/picprg/patches/patch-ad | 19 | ||||
-rw-r--r-- | devel/picprg/patches/patch-ae | 16 | ||||
-rw-r--r-- | devel/picprg/patches/patch-af | 17 |
10 files changed, 285 insertions, 0 deletions
diff --git a/devel/picprg/DESCR b/devel/picprg/DESCR new file mode 100644 index 00000000000..8755d97ed8d --- /dev/null +++ b/devel/picprg/DESCR @@ -0,0 +1,4 @@ +Picprg is a PIC programmer for a common design of programmer attached to a PC +parallel port. This package is for Byron Jeff's adapted version for Brian +Lane's original software, and supports the Trivial Low Voltage Programmer +(TLVP). diff --git a/devel/picprg/Makefile b/devel/picprg/Makefile new file mode 100644 index 00000000000..89b6adfcd24 --- /dev/null +++ b/devel/picprg/Makefile @@ -0,0 +1,24 @@ +# $NetBSD: Makefile,v 1.1.1.1 2005/09/24 09:30:54 dsainty Exp $ +# + +PKGNAME= picprg-2.3d +DISTNAME= ${PKGNAME:S/-//} +CATEGORIES= devel +MASTER_SITES= http://www.finitesite.com/d3jsys/ + +MAINTAINER= dsainty@NetBSD.org +HOMEPAGE= http://www.finitesite.com/d3jsys/ +COMMENT= Parallel port PIC programmer + +ONLY_FOR_PLATFORM= NetBSD-*-i386 + +USE_TOOLS+= gmake + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/picprg ${PREFIX}/bin + ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/picprg + ${INSTALL_DATA} ${WRKSRC}/README ${PREFIX}/share/doc/picprg + ${INSTALL_DATA} ${WRKSRC}/README.BAJ ${PREFIX}/share/doc/picprg + +.include "../../mk/curses.buildlink3.mk" +.include "../../mk/bsd.pkg.mk" diff --git a/devel/picprg/PLIST b/devel/picprg/PLIST new file mode 100644 index 00000000000..b17a7bdec91 --- /dev/null +++ b/devel/picprg/PLIST @@ -0,0 +1,5 @@ +@comment $NetBSD: PLIST,v 1.1.1.1 2005/09/24 09:30:54 dsainty Exp $ +bin/picprg +share/doc/picprg/README +share/doc/picprg/README.BAJ +@dirrm share/doc/picprg diff --git a/devel/picprg/distinfo b/devel/picprg/distinfo new file mode 100644 index 00000000000..8cbfbd2ceca --- /dev/null +++ b/devel/picprg/distinfo @@ -0,0 +1,11 @@ +$NetBSD: distinfo,v 1.1.1.1 2005/09/24 09:30:54 dsainty Exp $ + +SHA1 (picprg2.3d.tar.gz) = 950c6647f3d54439ad695a58f03ad91d658e4113 +RMD160 (picprg2.3d.tar.gz) = b88072bbd9a319078c3f0d3a78d2f3e687bdead5 +Size (picprg2.3d.tar.gz) = 24549 bytes +SHA1 (patch-aa) = f424612828ea9176c3504c47b6b2cbe65661003e +SHA1 (patch-ab) = 470458291bf40ef6d3990245e6e37de6e3b361db +SHA1 (patch-ac) = c7a9bef6026f8295b9873a0b517d6758827cb806 +SHA1 (patch-ad) = 2be694f0a33efa7ed732aaa75191419d9d2d9250 +SHA1 (patch-ae) = df0bf8d812a3419b252bdb9d291328b11743a017 +SHA1 (patch-af) = aa7ffa416b82e84facffb49126b2f2c328e72905 diff --git a/devel/picprg/patches/patch-aa b/devel/picprg/patches/patch-aa new file mode 100644 index 00000000000..a6f3f1d9eac --- /dev/null +++ b/devel/picprg/patches/patch-aa @@ -0,0 +1,33 @@ +$NetBSD: patch-aa,v 1.1.1.1 2005/09/24 09:30:54 dsainty Exp $ + +Add support for the PIC16F628A. Same as the PIC16F628, but the device ID and +mask have changed, and the screen template needed to be adjusted for the +longer device name. + +--- picprg.c 2002-05-21 03:20:02.000000000 +1200 ++++ picprg.c 2005-09-13 01:45:06.000000000 +1200 +@@ -154,10 +154,24 @@ + NULL + }; + ++char *pic16F628a_config_strings[] = { ++"CLOCK,0x0013,14,8,0x00:LP,0x01:XT,0x02:HS,0x03:EXTCLK,0x10:INTRCIO," //cont... ++"0x11:INTRCCLK,0x12:EXTRCIO,0x13:EXTRCCLK", ++"CP,0x3c00,30,4,0x0000:ALL,0x3c00:OFF,0x2800:HALF,0x1400:3/4", ++"WD,0x0004,39,3,0x0004:ON,0x0000:OFF", ++"PU,0x0008,47,3,0x0008:OFF,0x0000:ON", ++"CPD,0x0100,55,3,0x0100:OFF,0x0000:ON", ++"LVP,0x0080,64,3,0x0080:ON,0x0000:OFF", ++"BOD,0x0040,110,3,0x0040:ON,0x0000:OFF", ++"MCLR,0x0020,119,3,0x0020:EXT,0x0000:INT", ++NULL ++}; ++ + dev_id_t pic_dev[] = + {{0x07c0,0x0fc0,0x0800,0x0080,0x10,"PIC16F628",pic16F628_config_strings}, + {0x09a0,0x0fe0,0x2000,0x0100,0x10,"PIC16F877",pic16F877_config_strings}, + {0x0560,0x0fe0,0x0400,0x0040,0x00,"PIC16F84A",pic16F84_config_strings}, ++ {0x1060,0x3fe0,0x0800,0x0080,0x10,"PIC16F628A",pic16F628a_config_strings}, + {0x0000,0x0000,0x0000,0x0000,0x00,NULL} + }; + diff --git a/devel/picprg/patches/patch-ab b/devel/picprg/patches/patch-ab new file mode 100644 index 00000000000..60ea1e52348 --- /dev/null +++ b/devel/picprg/patches/patch-ab @@ -0,0 +1,33 @@ +$NetBSD: patch-ab,v 1.1.1.1 2005/09/24 09:30:54 dsainty Exp $ + +Reset defaults for the "Trivial LVP programmer", as featured on the home page +of this variant of the programmer software. + +--- picprg.c 2002-05-21 03:20:02.000000000 +1200 ++++ picprg.c 2005-09-13 01:45:06.000000000 +1200 +@@ -325,12 +339,12 @@ + + /* Defaults: */ + if (do_defaults) { +- pconfig.port = 0; /* /dev/lp port */ +- pconfig.VPP_pin = 5; /* VPP on pin 5 */ ++ pconfig.port = 0x378; /* /dev/lp port */ ++ pconfig.VPP_pin = 4; /* VPP on pin 4 */ + pconfig.VPP_pol = 1; /* Normal by default */ +- pconfig.VDD_pin = 4; /* Vdd on pin 4 */ ++ pconfig.VDD_pin = 6; /* Vdd on pin 6 */ + pconfig.VDD_pol = 1; /* Normal by default */ +- pconfig.PGM_pin = 6; /* PGM on pin 6 */ ++ pconfig.PGM_pin = 5; /* PGM on pin 5 */ + pconfig.PGM_pol = 1; /* Normal by default */ + pconfig.CLK_pin = 3; /* Clock on pin 3 */ + pconfig.alt = 0; /* Aisha 4/2/00 */ +@@ -338,7 +352,7 @@ + pconfig.DATAO_pin = 2; /* Data to PIC on pin 2 */ + pconfig.DATAO_pol = 1; /* Normal by default */ + pconfig.DATAI_pin = 10; /* Data from pic on p10 */ +- pconfig.DATAI_pol = 0; /* Inverted by default */ ++ pconfig.DATAI_pol = 1; /* Normal by default */ + pconfig.IDaddr = 0x2000; /* Default ID locaiton */ + pconfig.EEaddr = 0x2100; /* Default EE location */ + pconfig.CFaddr = 0x2007; /* Config Fuses */ diff --git a/devel/picprg/patches/patch-ac b/devel/picprg/patches/patch-ac new file mode 100644 index 00000000000..a6a53b59ae6 --- /dev/null +++ b/devel/picprg/patches/patch-ac @@ -0,0 +1,123 @@ +$NetBSD: patch-ac,v 1.1.1.1 2005/09/24 09:30:54 dsainty Exp $ + +The programmer makes direct I/O bus accesses via the i386 in/out instructions. +Port this to work via the NetBSD i386_set_ioperm() interface. + +--- lowlvl.c 2002-05-29 00:54:00.000000000 +1200 ++++ lowlvl.c 2005-09-12 23:41:56.000000000 +1200 +@@ -42,15 +42,17 @@ + + ------------------------------------------------------------------------ */ + #include "picprg.h" +-#include <fcntl.h> +-#include <linux/lp.h> ++ + #include <sys/ioctl.h> + #include <sys/time.h> +-#include <asm/system.h> ++#include <sys/types.h> ++ ++#include <machine/sysarch.h> ++ ++#include <fcntl.h> ++#include <string.h> + +-/* Aisha changed because address will be stored, 3-21-00 */ +-uint portaddr; +-#define LP_B(x) (portaddr) ++#define LP_B(x) (x) + + extern int debug; /* Deug level */ + extern dev_id_p pic_device; /* PIC device info */ +@@ -122,15 +124,12 @@ + }; + + +-extern int ioperm(unsigned long port,unsigned long length,int state); +- + /* ----------------------------------------------------------------------- + Port control routines -- easier than asm/io.h's routines + ----------------------------------------------------------------------- */ + static inline void + outb ( char val, short port) + { +- ioperm(port, 1, 1); + __asm__ volatile ("out%B0 %0,%1" : :"a" (val), "d" (port)); + } + +@@ -138,8 +137,7 @@ + inb (short port) + { + unsigned int ret; +- +- ioperm(port, 1, 1); ++ + __asm__ volatile ("in%B0 %1,%0" : "=a" (ret) : "d" (port)); + + return ret; +@@ -366,53 +364,23 @@ + ----------------------------------------------------------------------- */ + int init_port() + { +- char printer[128]; +- FILE *parport; +- int fd,linux24=0; +- +- sprintf(printer,"/dev/lp%d", pconfig.port ); ++ if (debug) ++ printf( "I/O base address is 0x%x\n", LP_B( pconfig.port ) ); + +- fd=open(printer,O_WRONLY); +- +- /* Aisha changed, 3/21/00 +- ... and BAJ rechanged 5/16/02 to get port address from /proc/parport... */ +- if ( fd<0 ) +- { +- perror(NULL); +- return 0; +- } +- +- /* BAJ Add. If the printer port is cool then set portaddr to the base value +- listed in /proc/parport/<port>/hardware */ ++ { ++ unsigned long iomap[32]; ++ unsigned int portoffset; + +- close(fd); +- sprintf(printer,"/proc/parport/%d/hardware",pconfig.port); +- parport=fopen(printer,"r"); +- if (!parport) { +- // BAJ Add 5/28/02. Check for Linux 2.4 kernel parport parameters +- +- sprintf(printer,"/proc/sys/dev/parport/parport%d/base-addr",pconfig.port); +- parport=fopen(printer,"r"); +- if (!parport) { +- fprintf(stderr,"Cannot open parport info file %s.\n\n",printer); +- return 0; +- } +- else +- linux24=1; ++ memset(iomap, '\0xff', sizeof(iomap)); ++ for (portoffset = 0; portoffset < 3; portoffset++) { ++ unsigned int portnumber = LP_B(pconfig.port) + portoffset; ++ iomap[portnumber / 32] &= ~(unsigned long)(1 << (portnumber % 32)); + } +- +- if ((fscanf(parport,linux24?"%d":"base: %x",&portaddr)) != 1) { +- fprintf(stderr,"Cannot read base address from parport info file %s.\n\n",printer); ++ ++ if (i386_set_ioperm(iomap) == -1) { ++ perror("i386_set_ioperm failed"); + return 0; + } +- if ( debug ) +- printf( "I/O base address for %s is 0x%x\n", printer, LP_B( pconfig.port ) ); +- +- /* Get permission to access the config register */ +- if ( ioperm( LP_B( pconfig.port )+1, 1L, 1) <0 ) +- { +- printf("access to port 0x%x denied\n", LP_B( pconfig.port )+1 ); +- return 0; + } + + /* Get the initial states of data and command lines */ diff --git a/devel/picprg/patches/patch-ad b/devel/picprg/patches/patch-ad new file mode 100644 index 00000000000..35200ff9778 --- /dev/null +++ b/devel/picprg/patches/patch-ad @@ -0,0 +1,19 @@ +$NetBSD: patch-ad,v 1.1.1.1 2005/09/24 09:30:54 dsainty Exp $ + +Standard NetBSD curses is acceptable. We also need libi386 for the direct I/O +access. + +--- Makefile 2002-05-21 03:20:02.000000000 +1200 ++++ Makefile 2005-09-13 02:41:17.000000000 +1200 +@@ -10,9 +10,8 @@ + CC:=${CC} + endif + +-CFLAGS = -I/usr/include/ncurses -O2 -Wall -pipe -g +-LDFLAGS = -lmenu -lncurses +-LIBS = -lncurses ++CFLAGS = -O2 -Wall -pipe -g ++LIBS = -lcurses -li386 + + PICOBJS = picprg.o lowlvl.o pichex.o + diff --git a/devel/picprg/patches/patch-ae b/devel/picprg/patches/patch-ae new file mode 100644 index 00000000000..ba30077a6ea --- /dev/null +++ b/devel/picprg/patches/patch-ae @@ -0,0 +1,16 @@ +$NetBSD: patch-ae,v 1.1.1.1 2005/09/24 09:30:54 dsainty Exp $ + +This program has been severely patched, and is now a "NetBSD PIC programmer". +Make the title reflect this. Correct the incorrect version number too. + +--- picprg.h 2005-09-13 03:09:58.000000000 +1200 ++++ picprg.h 2005-09-13 03:08:21.000000000 +1200 +@@ -11,7 +11,7 @@ + #define flushall() fflush(NULL) + + +-#define VERSION " Linux PIC programmer v2.3c Copyright 1994-1998 by Brian C. Lane " ++#define VERSION " NetBSD PIC programmer v2.3d Copyright 1994-1998 by Brian C. Lane " + + #define PIC16C84 0 + diff --git a/devel/picprg/patches/patch-af b/devel/picprg/patches/patch-af new file mode 100644 index 00000000000..97483d9a794 --- /dev/null +++ b/devel/picprg/patches/patch-af @@ -0,0 +1,17 @@ +$NetBSD: patch-af,v 1.1.1.1 2005/09/24 09:30:54 dsainty Exp $ + +Since the programmer knows which algorithm should be used to program the +device, make use of this and select the new style programming process if +required. This appears to be essential on the 16F628A. + +--- lowlvl.c.orig 2005-09-18 19:19:52.000000000 +1200 ++++ lowlvl.c 2005-09-18 19:21:42.000000000 +1200 +@@ -674,7 +674,7 @@ + + waitus( 5000 ); + +- if (pconfig.alt) { // modified 4/4/00 ++ if (pconfig.alt || pic_device->algorithm) { + send_cmnd( 0x02 ); + waitus( 1 ); + send_data ( 0x3FFF ); |