--- gcc-m68hc1x-3.3.5+3.0.1.orig/debian/compat +++ gcc-m68hc1x-3.3.5+3.0.1/debian/compat @@ -0,0 +1 @@ +4 --- gcc-m68hc1x-3.3.5+3.0.1.orig/debian/rules +++ gcc-m68hc1x-3.3.5+3.0.1/debian/rules @@ -0,0 +1,129 @@ +#!/usr/bin/make -f +# Sample debian/rules that uses debhelper. +# GNU copyright 1997 to 1999 by Joey Hess. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# These are used for cross-compiling and for saving the configure script +# from having to guess our platform (since we know it already) +DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) +DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) + +unpack: unpack-stamp +unpack-stamp: + tar xjf gcc-3.3.5.tar.bz2 + for i in *.diff* ; do \ + cat $$i | patch -p0 ; \ + done + mv gcc-3.3.5 src + mkdir build + touch unpack-stamp + + +configure: configure-stamp +configure-stamp: unpack-stamp + dh_testdir + + cd $(CURDIR)/build && \ + ../src/configure --prefix=/usr \ + --infodir=/usr/share/info \ + --mandir=/usr/share/man \ + --with-gnu-as \ + --with-gnu-ld \ + --enable-nls \ + --without-included-gettext \ + --disable-checking \ + --enable-languages=c \ + --build=$(DEB_BUILD_GNU_TYPE) \ + --host=$(DEB_HOST_GNU_TYPE) \ + --target=m68hc11 \ + --without-headers + touch configure-stamp + +build: configure-stamp build-stamp +build-stamp: + dh_testdir + cd build && $(MAKE) all-gcc + tar cfz $(CURDIR)/example.tar.gz example + touch build-stamp + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/gcc-m68hc1x + cd build && $(MAKE) install-gcc prefix=$(CURDIR)/debian/gcc-m68hc1x/usr \ + infodir=$(CURDIR)/debian/gcc-m68hc1x/usr/share/info \ + mandir=$(CURDIR)/debian/gcc-m68hc1x/usr/share/man + + # Rename manpages and create symlinks + mv $(CURDIR)/debian/gcc-m68hc1x/usr/share/man/man1/cpp.1 $(CURDIR)/debian/gcc-m68hc1x/usr/share/man/man1/m68hc11-cpp.1 + mv $(CURDIR)/debian/gcc-m68hc1x/usr/share/man/man1/gcov.1 $(CURDIR)/debian/gcc-m68hc1x/usr/share/man/man1/m68hc11-gcov.1 + + # Also create m68hc12-* + install -o root -g root -m 755 debian/m68hc12-gcc $(CURDIR)/debian/gcc-m68hc1x/usr/bin + ln -s m68hc11-gcc.1 $(CURDIR)/debian/gcc-m68hc1x/usr/share/man/man1/m68hc12-gcc.1 + + for i in gccbug gcov cpp ; do \ + ln -s m68hc11-$$i $(CURDIR)/debian/gcc-m68hc1x/usr/bin/m68hc12-$$i ; \ + ln -s m68hc11-$$i.1 $(CURDIR)/debian/gcc-m68hc1x/usr/share/man/man1/m68hc12-$$i.1 ; \ + done + + + # Remove non-needed files + rm -rf $(CURDIR)/debian/gcc-m68hc1x/usr/bin/m68hc11-gcc-* + rm -rf $(CURDIR)/debian/gcc-m68hc1x/usr/share/locale + rm -rf $(CURDIR)/debian/gcc-m68hc1x/usr/share/info + rm -rf $(CURDIR)/debian/gcc-m68hc1x/usr/share/man/man7 + rm -rf $(CURDIR)/debian/gcc-m68hc1x/usr/include + rm -rf $(CURDIR)/debian/gcc-m68hc1x/usr/m68hc11/ + +clean: + dh_testdir + dh_testroot + rm -f $(CURDIR)/example.tar.gz + rm -rf build + rm -rf src + rm -f build-stamp configure-stamp unpack-stamp + + dh_clean + + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot +# dh_installdebconf + dh_installdocs +# dh_installexamples +# dh_installmenu +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_installinit +# dh_installcron + dh_installman +# dh_installinfo + dh_installchangelogs + dh_link + dh_strip --exclude=.o --exclude=.a + dh_compress + dh_fixperms +# dh_makeshlibs + dh_installdeb +# dh_perl + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure --- gcc-m68hc1x-3.3.5+3.0.1.orig/debian/m68hc12-gccbug.1 +++ gcc-m68hc1x-3.3.5+3.0.1/debian/m68hc12-gccbug.1 @@ -0,0 +1,37 @@ +.TH m68hc12-gccbug 1 "07 February 2003" +.SH "NAME" +m68hc12-gccbug \- Report a bug to the GCC developers +.SH "SYNOPSIS" +.B m68hc12-gccbug +.SH "DESCRIPTION" +.B m68hc12-gccbug +is a tool for reporting bugs to the GCC maintainers. +It automatically starts an editor where the user can enter details +of the bug. On completion, the bug is sent to the appropriate +address. +The User should replace the comments (text surrounded by +, and fill in the Subject: and From: lines with +a summary and e-mail address. + +If the user believes the bug is related to Debian rather than to the +m68hc1x-gcc package, then the +.B reportbug +command should be used instead. +.SH "ENVIRONMENT" +.B m68hc12-gccbug +will utilize the following enviromntal variables if they exist: +.TP +.B EDITOR +and +.B VISUAL +Specifies the preferred editor. If +neither are set, +.B m68hc12-gccbug +will default to +.B /usr/bin/sensible-editor +to determine a working editor. +.TP +.B HOME +Directory in which the failed bug report is saved if the mail fails. +.SH "SEE ALSO" +reportbug(1) --- gcc-m68hc1x-3.3.5+3.0.1.orig/debian/manpages +++ gcc-m68hc1x-3.3.5+3.0.1/debian/manpages @@ -0,0 +1,2 @@ +debian/m68hc11-gccbug.1 +debian/m68hc12-gccbug.1 --- gcc-m68hc1x-3.3.5+3.0.1.orig/debian/m68hc11-gccbug.1 +++ gcc-m68hc1x-3.3.5+3.0.1/debian/m68hc11-gccbug.1 @@ -0,0 +1,37 @@ +.TH m68hc11-gccbug 1 "07 February 2003" +.SH "NAME" +m68hc11-gccbug \- Report a bug to the GCC developers +.SH "SYNOPSIS" +.B m68hc11-gccbug +.SH "DESCRIPTION" +.B m68hc11-gccbug +is a tool for reporting bugs to the GCC maintainers. +It automatically starts an editor where the user can enter details +of the bug. On completion, the bug is sent to the appropriate +address. +The User should replace the comments (text surrounded by +, and fill in the Subject: and From: lines with +a summary and e-mail address. + +If the user believes the bug is related to Debian rather than to the +m68hc1x-gcc package, then the +.B reportbug +command should be used instead. +.SH "ENVIRONMENT" +.B m68hc11-gccbug +will utilize the following enviromntal variables if they exist: +.TP +.B EDITOR +and +.B VISUAL +Specifies the preferred editor. If +neither are set, +.B m68hc11-gccbug +will default to +.B /usr/bin/sensible-editor +to determine a working editor. +.TP +.B HOME +Directory in which the failed bug report is saved if the mail fails. +.SH "SEE ALSO" +reportbug(1) --- gcc-m68hc1x-3.3.5+3.0.1.orig/debian/m68hc12-gcc +++ gcc-m68hc1x-3.3.5+3.0.1/debian/m68hc12-gcc @@ -0,0 +1,2 @@ +#!/bin/sh +/usr/bin/m68hc11-gcc -m68hc12 "$@" --- gcc-m68hc1x-3.3.5+3.0.1.orig/debian/copyright +++ gcc-m68hc1x-3.3.5+3.0.1/debian/copyright @@ -0,0 +1,36 @@ +This package was debianized by Aurelien Jarno on +Wed, 23 Oct 2002 00:48:17 +0200. + +It is a debian package of the GNU gcc compiler compiled as an 68HC11/12 +cross-compiler. + +The source can be obtained from: + + http://www.gnu-m68hc11.org/ + http://ftp.gnu.org/pub/gnu/gcc/gcc-3.3.4/gcc-3.3.4.tar.bz2 + +Copyright: + + GCC is Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, + 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 + Free Software Foundation, Inc. + +License: + 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, 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, 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. + +You are free to distribute this software under the terms of the GNU General +Public License. On Debian systems, the complete text of the GNU General Public +License can be found in /usr/share/common-licenses/GPL file. --- gcc-m68hc1x-3.3.5+3.0.1.orig/debian/control +++ gcc-m68hc1x-3.3.5+3.0.1/debian/control @@ -0,0 +1,18 @@ +Source: gcc-m68hc1x +Section: devel +Priority: extra +Maintainer: Aurelien Jarno +Standards-Version: 3.6.1 +Build-Depends: debhelper (>= 4.0), binutils-m68hc1x (>= 1:2.15+2.92-1), autoconf2.13, libtool, gawk | awk, bison, flex, gettext, texinfo, zlib1g-dev, bzip2 + +Package: gcc-m68hc1x +Architecture: any +Section: devel +Priority: extra +Depends: ${shlibs:Depends}, ${misc:Depends}, binutils-m68hc1x (>= 1:2.15+2.92-1) +Suggests: task-c-devel, newlib-m68hc1x +Provides: c-compiler-m68hc11, c-compiler-m68hc12 +Description: GNU C compiler for the Motorola 68HC11/12 processors + This is the GNU C compiler, a fairly portable optimizing compiler which + supports multiple languages. This package includes support for C for + cross-compiling to a Motorola 68HC11/12 microcontroller-based target. --- gcc-m68hc1x-3.3.5+3.0.1.orig/debian/changelog +++ gcc-m68hc1x-3.3.5+3.0.1/debian/changelog @@ -0,0 +1,141 @@ +gcc-m68hc1x (1:3.3.5+3.0.1-1) unstable; urgency=low + + * New upstream version. + + -- Aurelien Jarno Sun, 12 Jun 2005 17:52:19 +0200 + +gcc-m68hc1x (1:3.3.5+3.0-2) unstable; urgency=low + + * Added a patch to fix build on 64-bit arches. + + -- Aurelien Jarno Mon, 31 Jan 2005 11:49:14 +0100 + +gcc-m68hc1x (1:3.3.5+3.0-1) unstable; urgency=low + + * New upstream version based on gcc-3.3.5. + + -- Aurelien Jarno Mon, 31 Jan 2005 07:27:29 +0100 + +gcc-m68hc1x (1:3.3.4+2.92-2) unstable; urgency=low + + * Disable g++ as libstdc++ could not be built for this target (closes: + bug#275592). + + -- Aurelien Jarno Sat, 9 Oct 2004 23:57:20 +0200 + +gcc-m68hc1x (1:3.3.4+2.92-1) unstable; urgency=high + + * Switched to 2.92 pre-release, ie gcc-3.3.4 + some patches. + * Added a patch to fix FTBFS on 64-bit arches (PRL 16925) (closes: + bug#257330). + * Urgency set to high as it is an RC bug. + + -- Aurelien Jarno Sat, 11 Sep 2004 16:31:11 +0200 + +gcc-m68hc1x (1:3.0.4-1) unstable; urgency=medium + + * toolchain-source is not really suitable for embedded targets. Moreover + such targets does not need to follow the main toolchain. + * Using gcc version 3.04 + m68hc1x maintainer patches, which is the + recommended version for this target. + * Should build on 64-bit architectures (closes: bug#257330). + + -- Aurelien Jarno Mon, 9 Aug 2004 16:32:13 +0200 + +gcc-m68hc1x (3.3.3-4) unstable; urgency=low + + * Added some patches from upstream. Hope it would now build on all arches. + + -- Aurelien Jarno Thu, 22 Apr 2004 15:20:57 +0200 + +gcc-m68hc1x (3.3.3-3) unstable; urgency=low + + * Removed newlib from this package. It seems to cause some problems + on some architectures whereas it build correctly as a separate + package. + + -- Aurelien Jarno Sun, 18 Apr 2004 04:36:57 +0200 + +gcc-m68hc1x (3.3.3-2) unstable; urgency=medium + + * Updated example program. + * Newlib is now included in this package. + + -- Aurelien Jarno Mon, 12 Apr 2004 19:14:20 +0200 + +gcc-m68hc1x (3.3.3-1) unstable; urgency=low + + * gcc updated to 3.3.3 (closes: bug#241836). + + -- Aurelien Jarno Sun, 11 Apr 2004 11:20:15 +0200 + +gcc-m68hc1x (3.2-10) unstable; urgency=low + + * Let gcc-m68hc1x provide its own manpages, instead of gcc-3.2's ones. + * Removed the dependency on gcc-3.2. + * Bumped standards-version to 3.6.1 (no changes). + + -- Aurelien Jarno Fri, 17 Oct 2003 00:43:57 +0200 + +gcc-m68hc1x (3.2-9) unstable; urgency=low + + * Suggests gcc-3.2-doc instead of the non-existant package gcc-doc. + + -- Aurelien Jarno Sun, 27 Apr 2003 15:46:39 +0200 + +gcc-m68hc1x (3.2-8) unstable; urgency=low + + * Depends on ${misc:Depends}. + * Uses debian/compat instead of DH_COMPAT. + * Removed call to dh_undocumented. + * Bumped standards-version to 3.5.9. + + -- Aurelien Jarno Mon, 7 Apr 2003 20:23:35 +0200 + +gcc-m68hc1x (3.2-7) unstable; urgency=low + + * Added m68hc11-gccbug and m68hc12-gccbug man pages. + + -- Aurelien Jarno Fri, 7 Feb 2003 14:45:29 +0100 + +gcc-m68hc1x (3.2-6) unstable; urgency=low + + * More fixes in example code. + + -- Aurelien Jarno Wed, 8 Jan 2003 14:34:28 +0100 + +gcc-m68hc1x (3.2-5) unstable; urgency=low + + * Small fixes in example code. + + -- Aurelien Jarno Wed, 8 Jan 2003 09:15:36 +0100 + +gcc-m68hc1x (3.2-4) unstable; urgency=low + + * Fixed description. + * Added some examples to /usr/share/doc/gcc-m68hc1x/examples + * Standards-Version bumped to 3.5.8 + + -- Aurelien Jarno Tue, 7 Jan 2003 10:27:15 +0100 + +gcc-m68hc1x (3.2-3) unstable; urgency=low + + * Added newlib-m68hc1x to the "Suggests:" field. + + -- Aurelien Jarno Tue, 17 Dec 2002 00:21:43 +0100 + +gcc-m68hc1x (3.2-2) unstable; urgency=low + + * Strip libraries. + + -- Aurelien Jarno Fri, 25 Oct 2002 16:51:28 +0200 + +gcc-m68hc1x (3.2-1) unstable; urgency=low + + * Initial Release. (closes: bug#166106) + + -- Aurelien Jarno Thu, 24 Oct 2002 07:51:05 +0200 + +Local variables: +mode: debian-changelog +End: --- gcc-m68hc1x-3.3.5+3.0.1.orig/debian/docs +++ gcc-m68hc1x-3.3.5+3.0.1/debian/docs @@ -0,0 +1 @@ +example.tar.gz --- gcc-m68hc1x-3.3.5+3.0.1.orig/example/vectors.s +++ gcc-m68hc1x-3.3.5+3.0.1/example/vectors.s @@ -0,0 +1,89 @@ +/* M68HC11 Interrupt vectors table + Copyright (C) 1999 Free Software Foundation, Inc. + Written by Stephane Carrez (stcarrez@worldnet.fr) + +This file 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, or (at your option) any +later version. + +In addition to the permissions in the GNU General Public License, the +Free Software Foundation gives you unlimited permission to link the +compiled version of this file with other programs, and to distribute +those programs without any restriction coming from the use of this +file. (The General Public License restrictions do apply in other +respects; for example, they cover modification of the file, and +distribution when not linked into another program.) + +This file 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; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + + .sect .text + .globl _start + +;; Default interrupt handler. + .sect .text +def: + rti + + .globl _debug_user_vectors +_debug_user_vectors = 0 + +;; +;; Interrupt vectors are in a specific section that is +;; mapped at 0xffc0. For the example program, the reset handler +;; points to the generic crt0 entry point. +;; + .sect .vectors + .globl vectors +vectors: + .word def ; ffc0 + .word def ; ffc2 + .word def ; ffc4 + .word def ; ffc6 + .word def ; ffc8 + .word def ; ffca + .word def ; ffcc + .word def ; ffce + .word def ; ffd0 + .word def ; ffd2 + .word def ; ffd4 + + ;; SCI + .word def ; ffd6 + + ;; SPI + .word def ; ffd8 + .word def ; ffda (PAII) + .word def ; ffdc (PAOVI) + .word def ; ffde (TOI) + + ;; Timer Output Compare + .word def ; ffe0 + .word def ; ffe2 + .word def ; ffe4 + .word def ; ffe6 + .word def ; ffe8 + + ;; Timer Input compare + .word def ; ffea + .word def ; ffec + .word def ; ffee + + ;; Misc + .word def ; fff0 (RTII) + .word IRQ_interrupt ; fff2 (IRQ) + .word def ; fff4 (XIRQ) + .word def ; fff6 (SWI) + .word def ; fff8 (ILL) + .word def ; fffa (COP Failure) + .word def ; fffc (COP Clock monitor) + .word _start ; fffe (reset) + --- gcc-m68hc1x-3.3.5+3.0.1.orig/example/ports.h +++ gcc-m68hc1x-3.3.5+3.0.1/example/ports.h @@ -0,0 +1,504 @@ +/* ports.h + Copyright (C) 1999 Free Software Foundation, Inc. + (C) 2000 Stephane Carrez (stcarrez@worldnet.fr) + + 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _M68HC11_PORTS_H +#define _M68HC11_PORTS_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Flags for the definition of the 68HC11 CCR. */ +#define M6811_S_BIT 0x80 /* Stop disable */ +#define M6811_X_BIT 0x40 /* X-interrupt mask */ +#define M6811_H_BIT 0x20 /* Half carry flag */ +#define M6811_I_BIT 0x10 /* I-interrupt mask */ +#define M6811_N_BIT 0x08 /* Negative */ +#define M6811_Z_BIT 0x04 /* Zero */ +#define M6811_V_BIT 0x02 /* Overflow */ +#define M6811_C_BIT 0x01 /* Carry */ + +/* 68HC11 register address offsets (range 0..0x3F or 0..64). + The absolute address of the I/O register depends on the setting + of the M6811_INIT register. At init time, the I/O registers are + mapped at 0x1000. Address of registers is then: + 0x1000 + M6811_xxx +*/ + +#define M6811_PORTA 0x00 /* Port A register */ +#define M6811_DDRA 0x01 /* Data direction register for port A */ +#define M6811_PORTG 0x02 /* Port G register */ +#define M6811_DDRG 0x03 /* Data direction register for port G */ +#define M6811_PORTB 0x04 /* Port B register */ +#define M6811_PORTF 0x05 /* Port F register */ +#define M6811_PORTC 0x06 /* Port C register */ +#define M6811_DDRC 0x07 /* Data direction register for port C */ +#define M6811_PORTD 0x08 /* Port D register */ +#define M6811_DDRD 0x09 /* Data direction register for port D */ +#define M6811_PORTE 0x0A /* Port E input register */ +#define M6811_CFORC 0x0B /* Compare Force Register */ +#define M6811_OC1M 0x0C /* OC1 Action Mask register */ +#define M6811_OC1D 0x0D /* OC1 Action Data register */ +#define M6811_TCTN 0x0E /* Timer Counter Register */ +#define M6811_TCTN_H 0x0E /* " " " High part */ +#define M6811_TCTN_L 0x0F /* " " " Low part */ +#define M6811_TIC1 0x10 /* Input capture 1 register */ +#define M6811_TIC1_H 0x10 /* " " " High part */ +#define M6811_TIC1_L 0x11 /* " " " Low part */ +#define M6811_TIC2 0x12 /* Input capture 2 register */ +#define M6811_TIC2_H 0x12 /* " " " High part */ +#define M6811_TIC2_L 0x13 /* " " " Low part */ +#define M6811_TIC3 0x14 /* Input capture 3 register */ +#define M6811_TIC3_H 0x14 /* " " " High part */ +#define M6811_TIC3_L 0x15 /* " " " Low part */ +#define M6811_TOC1 0x16 /* Output Compare 1 register */ +#define M6811_TOC1_H 0x16 /* " " " High part */ +#define M6811_TOC1_L 0x17 /* " " " Low part */ +#define M6811_TOC2 0x18 /* Output Compare 2 register */ +#define M6811_TOC2_H 0x18 /* " " " High part */ +#define M6811_TOC2_L 0x19 /* " " " Low part */ +#define M6811_TOC3 0x1A /* Output Compare 3 register */ +#define M6811_TOC3_H 0x1A /* " " " High part */ +#define M6811_TOC3_L 0x1B /* " " " Low part */ +#define M6811_TOC4 0x1C /* Output Compare 4 register */ +#define M6811_TOC4_H 0x1C /* " " " High part */ +#define M6811_TOC4_L 0x1D /* " " " Low part */ +#define M6811_TOC5 0x1E /* Output Compare 5 register */ +#define M6811_TOC5_H 0x1E /* " " " High part */ +#define M6811_TOC5_L 0x1F /* " " " Low part */ +#define M6811_TCTL1 0x20 /* Timer Control register 1 */ +#define M6811_TCTL2 0x21 /* Timer Control register 2 */ +#define M6811_TMSK1 0x22 /* Timer Interrupt Mask Register 1 */ +#define M6811_TFLG1 0x23 /* Timer Interrupt Flag Register 1 */ +#define M6811_TMSK2 0x24 /* Timer Interrupt Mask Register 2 */ +#define M6811_TFLG2 0x25 /* Timer Interrupt Flag Register 2 */ +#define M6811_PACTL 0x26 /* Pulse Accumulator Control Register */ +#define M6811_PACNT 0x27 /* Pulse Accumulator Count Register */ +#define M6811_SPCR 0x28 /* SPI Control register */ +#define M6811_SPSR 0x29 /* SPI Status register */ +#define M6811_SPDR 0x2A /* SPI Data register */ +#define M6811_BAUD 0x2B /* SCI Baud register */ +#define M6811_SCCR1 0x2C /* SCI Control register 1 */ +#define M6811_SCCR2 0x2D /* SCI Control register 2 */ +#define M6811_SCSR 0x2E /* SCI Status register */ +#define M6811_SCDR 0x2F /* SCI Data (Read => RDR, Write => TDR) */ +#define M6811_ADCTL 0x30 /* A/D Control register */ +#define M6811_ADR1 0x31 /* A/D, Analog Result register 1 */ +#define M6811_ADR2 0x32 /* A/D, Analog Result register 2 */ +#define M6811_ADR3 0x33 /* A/D, Analog Result register 3 */ +#define M6811_ADR4 0x34 /* A/D, Analog Result register 4 */ +#define M6811__RES35 0x35 +#define M6811__RES36 0x36 +#define M6811__RES37 0x37 +#define M6811__RES38 0x38 +#define M6811_OPTION 0x39 /* System Configuration Options */ +#define M6811_COPRST 0x3A /* Arm/Reset COP Timer Circuitry */ +#define M6811_PPROG 0x3B /* EEPROM Programming Control Register */ +#define M6811_HPRIO 0x3C /* Highest priority I-Bit int and misc */ +#define M6811_INIT 0x3D /* Ram and I/O mapping register */ +#define M6811_TEST1 0x3E /* Factory test control register */ +#define M6811_CONFIG 0x3F /* COP, ROM and EEPROM enables */ + +/* Flags of the CONFIG register (in EEPROM). */ +#define M6811_NOSEC 0x08 /* Security mode disable */ +#define M6811_NOCOP 0x04 /* COP system disable */ +#define M6811_ROMON 0x02 /* Enable on-chip rom */ +#define M6811_EEON 0x01 /* Enable on-chip eeprom */ + +/* Flags of the PPROG register. */ +#define M6811_BYTE 0x10 /* Byte mode */ +#define M6811_ROW 0x08 /* Row mode */ +#define M6811_ERASE 0x04 /* Erase mode select (1 = erase, 0 = read) */ +#define M6811_EELAT 0x02 /* EEPROM Latch Control */ +#define M6811_EEPGM 0x01 /* EEPROM Programming Voltage Enable */ + +/* Flags of the PIOC register. */ +#define M6811_STAF 0x80 /* Strobe A Interrupt Status Flag */ +#define M6811_STAI 0x40 /* Strobe A Interrupt Enable Mask */ +#define M6811_CWOM 0x20 /* Port C Wire OR mode */ +#define M6811_HNDS 0x10 /* Handshake mode */ +#define M6811_OIN 0x08 /* Output or Input handshaking */ +#define M6811_PLS 0x04 /* Pulse/Interlocked Handshake Operation */ +#define M6811_EGA 0x02 /* Active Edge for Strobe A */ +#define M6811_INVB 0x01 /* Invert Strobe B */ + +/* Flags of the SCCR1 register. */ +#define M6811_R8 0x80 /* Receive Data bit 8 */ +#define M6811_T8 0x40 /* Transmit data bit 8 */ +#define M6811__SCCR1_5 0x20 /* Unused */ +#define M6811_M 0x10 /* SCI Character length */ +#define M6811_WAKE 0x08 /* Wake up method select (0=idle, 1=addr mark) */ + +/* Flags of the SCCR2 register. */ +#define M6811_TIE 0x80 /* Transmit Interrupt enable */ +#define M6811_TCIE 0x40 /* Transmit Complete Interrupt Enable */ +#define M6811_RIE 0x20 /* Receive Interrupt Enable */ +#define M6811_ILIE 0x10 /* Idle Line Interrupt Enable */ +#define M6811_TE 0x08 /* Transmit Enable */ +#define M6811_RE 0x04 /* Receive Enable */ +#define M6811_RWU 0x02 /* Receiver Wake Up */ +#define M6811_SBK 0x01 /* Send Break */ + +/* Flags of the SCSR register. */ +#define M6811_TDRE 0x80 /* Transmit Data Register Empty */ +#define M6811_TC 0x40 /* Transmit Complete */ +#define M6811_RDRF 0x20 /* Receive Data Register Full */ +#define M6811_IDLE 0x10 /* Idle Line Detect */ +#define M6811_OR 0x08 /* Overrun Error */ +#define M6811_NF 0x04 /* Noise Flag */ +#define M6811_FE 0x02 /* Framing Error */ +#define M6811__SCSR_0 0x01 /* Unused */ + +/* Flags of the BAUD register. */ +#define M6811_TCLR 0x80 /* Clear Baud Rate (TEST mode) */ +#define M6811__BAUD_6 0x40 /* Not used */ +#define M6811_SCP1 0x20 /* SCI Baud rate prescaler select */ +#define M6811_SCP0 0x10 +#define M6811_RCKB 0x08 /* Baud Rate Clock Check (TEST mode) */ +#define M6811_SCR2 0x04 /* SCI Baud rate select */ +#define M6811_SCR1 0x02 +#define M6811_SCR0 0x01 + +#define M6811_BAUD_DIV_1 (0) +#define M6811_BAUD_DIV_3 (M6811_SCP0) +#define M6811_BAUD_DIV_4 (M6811_SCP1) +#define M6811_BAUD_DIV_13 (M6811_SCP1|M6811_SCP0) + +/* Flags of the SPCR register. */ +#define M6811_SPIE 0x80 /* Serial Peripheral Interrupt Enable */ +#define M6811_SPE 0x40 /* Serial Peripheral System Enable */ +#define M6811_DWOM 0x20 /* Port D Wire-OR mode option */ +#define M6811_MSTR 0x10 /* Master Mode Select */ +#define M6811_CPOL 0x08 /* Clock Polarity */ +#define M6811_CPHA 0x04 /* Clock Phase */ +#define M6811_SPR1 0x02 /* SPI Clock Rate Select */ +#define M6811_SPR0 0x01 + +/* Flags of the SPSR register. */ +#define M6811_SPIF 0x80 /* SPI Transfer Complete flag */ +#define M6811_WCOL 0x40 /* Write Collision */ +#define M6811_MODF 0x10 /* Mode Fault */ + +/* Flags of the ADCTL register. */ +#define M6811_CCF 0x80 /* Conversions Complete Flag */ +#define M6811_SCAN 0x20 /* Continuous Scan Control */ +#define M6811_MULT 0x10 /* Multiple Channel/Single Channel Control */ +#define M6811_CD 0x08 /* Channel Select D */ +#define M6811_CC 0x04 /* C */ +#define M6811_CB 0x02 /* B */ +#define M6811_CA 0x01 /* A */ + +/* Flags of the CFORC register. */ +#define M6811_FOC1 0x80 /* Force Output Compare 1 */ +#define M6811_FOC2 0x40 /* 2 */ +#define M6811_FOC3 0x20 /* 3 */ +#define M6811_FOC4 0x10 /* 4 */ +#define M6811_FOC5 0x08 /* 5 */ + +/* Flags of the OC1M register. */ +#define M6811_OC1M7 0x80 /* Output Compare 7 */ +#define M6811_OC1M6 0x40 /* 6 */ +#define M6811_OC1M5 0x20 /* 5 */ +#define M6811_OC1M4 0x10 /* 4 */ +#define M6811_OC1M3 0x08 /* 3 */ + +/* Flags of the OC1D register. */ +#define M6811_OC1D7 0x80 +#define M6811_OC1D6 0x40 +#define M6811_OC1D5 0x20 +#define M6811_OC1D4 0x10 +#define M6811_OC1D3 0x08 + +/* Flags of the TCTL1 register. */ +#define M6811_OM2 0x80 /* Output Mode 2 */ +#define M6811_OL2 0x40 /* Output Level 2 */ +#define M6811_OM3 0x20 +#define M6811_OL3 0x10 +#define M6811_OM4 0x08 +#define M6811_OL4 0x04 +#define M6811_OM5 0x02 +#define M6811_OL5 0x01 + +/* Flags of the TCTL2 register. */ +#define M6811_EDG1B 0x20 /* Input Edge Capture Control 1 */ +#define M6811_EDG1A 0x10 +#define M6811_EDG2B 0x08 /* Input 2 */ +#define M6811_EDG2A 0x04 +#define M6811_EDG3B 0x02 /* Input 3 */ +#define M6811_EDG3A 0x01 + +/* Flags of the TMSK1 register. */ +#define M6811_OC1I 0x80 /* Output Compare 1 Interrupt */ +#define M6811_OC2I 0x40 /* 2 */ +#define M6811_OC3I 0x20 /* 3 */ +#define M6811_OC4I 0x10 /* 4 */ +#define M6811_OC5I 0x08 /* 5 */ +#define M6811_IC1I 0x04 /* Input Capture 1 Interrupt */ +#define M6811_IC2I 0x02 /* 2 */ +#define M6811_IC3I 0x01 /* 3 */ + +/* Flags of the TFLG1 register. */ +#define M6811_OC1F 0x80 /* Output Compare 1 Flag */ +#define M6811_OC2F 0x40 /* 2 */ +#define M6811_OC3F 0x20 /* 3 */ +#define M6811_OC4F 0x10 /* 4 */ +#define M6811_OC5F 0x08 /* 5 */ +#define M6811_IC1F 0x04 /* Input Capture 1 Flag */ +#define M6811_IC2F 0x02 /* 2 */ +#define M6811_IC3F 0x01 /* 3 */ + +/* Flags of Timer Interrupt Mask Register 2 (TMSK2). */ +#define M6811_TOI 0x80 /* Timer Overflow Interrupt Enable */ +#define M6811_RTII 0x40 /* RTI Interrupt Enable */ +#define M6811_PAOVI 0x20 /* Pulse Accumulator Overflow Interrupt En. */ +#define M6811_PAII 0x10 /* Pulse Accumulator Interrupt Enable */ +#define M6811_PR1 0x02 /* Timer prescaler */ +#define M6811_PR0 0x01 /* Timer prescaler */ +#define M6811_TPR_1 0x00 /* " " prescale div 1 */ +#define M6811_TPR_4 0x01 /* " " prescale div 4 */ +#define M6811_TPR_8 0x02 /* " " prescale div 8 */ +#define M6811_TPR_16 0x03 /* " " prescale div 16 */ + +/* Flags of Timer Interrupt Flag Register 2 (M6811_TFLG2). */ +#define M6811_TOF 0x80 /* Timer overflow bit */ +#define M6811_RTIF 0x40 /* Read time interrupt flag */ +#define M6811_PAOVF 0x20 /* Pulse accumulator overflow Interrupt flag */ +#define M6811_PAIF 0x10 /* Pulse accumulator Input Edge " " " */ + +/* Flags of Pulse Accumulator Control Register (PACTL). */ +#define M6811_DDRA7 0x80 /* Data direction for port A bit 7 */ +#define M6811_PAEN 0x40 /* Pulse accumulator system enable */ +#define M6811_PAMOD 0x20 /* Pulse accumulator mode */ +#define M6811_PEDGE 0x10 /* Pulse accumulator edge control */ +#define M6811_RTR1 0x02 /* RTI Interrupt rates select */ +#define M6811_RTR0 0x01 /* " " " " */ + +/* Flags of the Options register. */ +#define M6811_ADPU 0x80 /* A/D Powerup */ +#define M6811_CSEL 0x40 /* A/D/EE Charge pump clock source select */ +#define M6811_IRQE 0x20 /* IRQ Edge/Level sensitive */ +#define M6811_DLY 0x10 /* Stop exit turn on delay */ +#define M6811_CME 0x08 /* Clock Monitor enable */ +#define M6811_CR1 0x02 /* COP timer rate select */ +#define M6811_CR0 0x01 /* COP timer rate select */ + +/* Flags of the HPRIO register. */ +#define M6811_RBOOT 0x80 /* Read Bootstrap ROM */ +#define M6811_SMOD 0x40 /* Special Mode */ +#define M6811_MDA 0x20 /* Mode Select A */ +#define M6811_IRV 0x10 /* Internal Read Visibility */ +#define M6811_PSEL3 0x08 /* Priority Select */ +#define M6811_PSEL2 0x04 +#define M6811_PSEL1 0x02 +#define M6811_PSEL0 0x01 + +#define M6811_IO_SIZE (0x40) + +/* The I/O registers are represented by a volatile array. + Address if fixed at link time. */ +extern volatile unsigned char _io_ports[]; + + +extern unsigned short get_timer_counter (void); +extern void set_timer_counter (unsigned short); +extern unsigned short get_input_capture_1 (void); +extern void set_input_capture_1 (unsigned short); +extern unsigned short get_input_capture_2 (void); +extern void set_input_capture_2 (unsigned short); +extern unsigned short get_input_capture_3 (void); +extern void set_input_capture_3 (unsigned short); +extern unsigned short get_output_compare_1 (void); +extern void set_output_compare_1 (unsigned short); +extern unsigned short get_output_compare_2 (void); +extern void set_output_compare_2 (unsigned short); +extern unsigned short get_output_compare_3 (void); +extern void set_output_compare_3 (unsigned short); +extern unsigned short get_output_compare_4 (void); +extern void set_output_compare_4 (unsigned short); +extern unsigned short get_output_compare_5 (void); +extern void set_output_compare_5 (unsigned short); +extern void set_bus_expanded (void); +extern void set_bus_single_chip (void); +extern void cop_reset (void); +extern void cop_optional_reset (void); +extern void timer_acknowledge (void); +extern void timer_initialize_rate (unsigned char); + + +extern inline unsigned short +get_timer_counter (void) +{ + return ((unsigned volatile short*) &_io_ports[M6811_TCTN_H])[0]; +} + +extern inline void +set_timer_counter (unsigned short value) +{ + ((unsigned volatile short*) &_io_ports[M6811_TCTN_H])[0] = value; +} + +extern inline unsigned short +get_input_capture_1 (void) +{ + return ((unsigned volatile short*) &_io_ports[M6811_TIC1_H])[0]; +} + +extern inline void +set_input_capture_1 (unsigned short value) +{ + ((unsigned volatile short*) &_io_ports[M6811_TIC1_H])[0] = value; +} + +extern inline unsigned short +get_input_capture_2 (void) +{ + return ((unsigned volatile short*) &_io_ports[M6811_TIC2_H])[0]; +} + +extern inline void +set_input_capture_2 (unsigned short value) +{ + ((unsigned volatile short*) &_io_ports[M6811_TIC2_H])[0] = value; +} + +extern inline unsigned short +get_input_capture_3 (void) +{ + return ((unsigned volatile short*) &_io_ports[M6811_TIC3_H])[0]; +} + +extern inline void +set_input_capture_3 (unsigned short value) +{ + ((unsigned volatile short*) &_io_ports[M6811_TIC3_H])[0] = value; +} + +/* Get output compare 16-bit register. */ +extern inline unsigned short +get_output_compare_1 (void) +{ + return ((unsigned volatile short*) &_io_ports[M6811_TOC1_H])[0]; +} + +extern inline void +set_output_compare_1 (unsigned short value) +{ + ((unsigned volatile short*) &_io_ports[M6811_TOC1_H])[0] = value; +} + +extern inline unsigned short +get_output_compare_2 (void) +{ + return ((unsigned volatile short*) &_io_ports[M6811_TOC2_H])[0]; +} + +extern inline void +set_output_compare_2 (unsigned short value) +{ + ((unsigned volatile short*) &_io_ports[M6811_TOC2_H])[0] = value; +} + +extern inline unsigned short +get_output_compare_3 (void) +{ + return ((unsigned volatile short*) &_io_ports[M6811_TOC3_H])[0]; +} + +extern inline void +set_output_compare_3 (unsigned short value) +{ + ((unsigned volatile short*) &_io_ports[M6811_TOC3_H])[0] = value; +} + +extern inline unsigned short +get_output_compare_4 (void) +{ + return ((unsigned volatile short*) &_io_ports[M6811_TOC4_H])[0]; +} + +extern inline void +set_output_compare_4 (unsigned short value) +{ + ((unsigned volatile short*) &_io_ports[M6811_TOC4_H])[0] = value; +} + +extern inline unsigned short +get_output_compare_5 (void) +{ + return ((unsigned volatile short*) &_io_ports[M6811_TOC5_H])[0]; +} + +extern inline void +set_output_compare_5 (unsigned short value) +{ + ((unsigned volatile short*) &_io_ports[M6811_TOC5_H])[0] = value; +} + + +/* Set the board in the expanded mode to get access to external bus. */ +extern inline void +set_bus_expanded (void) +{ + _io_ports[M6811_HPRIO] |= M6811_MDA; +} + + +/* Set the board in single chip mode. */ +extern inline void +set_bus_single_chip (void) +{ + _io_ports[M6811_HPRIO] &= ~M6811_MDA; +} + +/* Reset the COP. */ +extern inline void +cop_reset (void) +{ + _io_ports[M6811_COPRST] = 0x55; + _io_ports[M6811_COPRST] = 0xAA; +} + +extern inline void +cop_optional_reset (void) +{ +#if defined(M6811_USE_COP) && M6811_USE_COP == 1 + cop_reset (); +#endif +} + +/* Acknowledge the timer interrupt. */ +extern inline void +timer_acknowledge (void) +{ + _io_ports[M6811_TFLG2] = M6811_RTIF; +} + +/* Initialize the timer. */ +extern inline void +timer_initialize_rate (unsigned char divisor) +{ + _io_ports[M6811_TMSK2] = M6811_RTII | divisor; +} + + +#ifdef __cplusplus +}; +#endif + +#endif /* _M68HC11_PORTS_H */ --- gcc-m68hc1x-3.3.5+3.0.1.orig/example/memory.x +++ gcc-m68hc1x-3.3.5+3.0.1/example/memory.x @@ -0,0 +1,11 @@ +/* Memory definition for a 68HC11 program in EEPROM (1024 bytes) */ +MEMORY +{ + page0 (rwx) : ORIGIN = 0x0000, LENGTH = 0x03ff + eeprom (rx) : ORIGIN = 0xfe00, LENGTH = 0x01ff + text (rx) : ORIGIN = 0xfe00, LENGTH = 0x01ff + data : ORIGIN = 0x0000, LENGTH = 0x03ff +} + +/* Setup the stack on the top of the data internal ram (not used). */ +PROVIDE (_stack = 0x0400-1); --- gcc-m68hc1x-3.3.5+3.0.1.orig/example/main.h +++ gcc-m68hc1x-3.3.5+3.0.1/example/main.h @@ -0,0 +1,27 @@ +/* + ----- main.h ----- + (C) 2002-2003 Aurelien Jarno + + 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef MAIN_H +#define MAIN_H + +int __attribute__((noreturn)) main (void); + +void __attribute__((interrupt)) IRQ_interrupt(void); + +#endif /* MAIN_H */ --- gcc-m68hc1x-3.3.5+3.0.1.orig/example/Makefile +++ gcc-m68hc1x-3.3.5+3.0.1/example/Makefile @@ -0,0 +1,86 @@ +#!/usr/bin/make -f + +################################################################## +# Makefile for 68HC11 projects # +# GNU copyright 2002-2003 by Aurelien Jarno # +################################################################## + +# +# Project files +# +PROG = test +ASMS = vectors.s +SRCS = main.c +INCLUDES = main.h ports.h +OBJS = $(SRCS:.c=.o) $(ASMS:.s=.o) + + +# +# C flags used by default to compile a program +# +CFLAGS = -m68hc11 -mshort -Wall -Wmissing-prototypes -Os -g0 -msoft-reg-count=0 -fomit-frame-pointer -ffixed-z -fshort-enums + +LDFLAGS = -m68hc11 -mshort -Wl,-m,m68hc11elfb \ + -Wl,-defsym,_io_ports=0x1000 + + +# +# Options to creates the .s19 or .b files from the elf +# +OBJCOPY_FLAGS = --remove-section=page0 \ + --remove-section=.page0 + + +#################################### +# This part should not be modified # +#################################### +# +# Programs location +# +DEVC_PREFIX=m68hc11- +CC=$(DEVC_PREFIX)gcc +CXX=$(DEVC_PREFIX)gcc +AS=$(DEVC_PREFIX)as +AR=$(DEVC_PREFIX)ar +SIZE=$(DEVC_PREFIX)size +OBJCOPY=$(DEVC_PREFIX)objcopy +OBJDUMP=$(DEVC_PREFIX)objdump +LD=$(DEVC_PREFIX)ld + +# +# Main rules +# +all: $(PROG).elf $(PROG).s19 $(PROG).b + +$(PROG).elf: $(OBJS) $(INCLUDES) memory.x + $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBADD) + +clean: + rm -f *.o *.elf *.s19 *.b *.a + +# +# Some useful rules +# +dump: $(PROG).elf + $(OBJDUMP) -d $(PROG).elf + +size: $(PROG).s19 + $(SIZE) $(PROG).s19 + + +# +# Implicit rules +# +# .elf is for the simulator and gdb +# .s19 is for some downloader and the simulator +# .b is a binary dump +# +.SUFFIXES: .elf .s19 .b + +.elf.s19: + $(OBJCOPY) --output-target=srec $(OBJCOPY_FLAGS) $< $*.s19 + +.elf.b: + $(OBJCOPY) --output-target=binary --gap-fill=255 \ + $(OBJCOPY_FLAGS) $< $*.b + --- gcc-m68hc1x-3.3.5+3.0.1.orig/example/main.c +++ gcc-m68hc1x-3.3.5+3.0.1/example/main.c @@ -0,0 +1,36 @@ +/* + ----- main.c ----- + (C) 2002-2003 Aurelien Jarno + + 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include "ports.h" +#include "main.h" + +void IRQ_interrupt() +{ + /* Do some stuff */ +} + +int main() +{ + + while (1) + { + /* Do some stuff */ + _io_ports[M6811_PORTF] = (_io_ports[M6811_PORTE] & 0x01)?0x01:0x00; + } +}