avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Bug in attiny2313 support ?


From: Frederik Rouleau
Subject: Re: [avr-gcc-list] Bug in attiny2313 support ?
Date: Wed, 22 Dec 2004 19:32:06 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.3) Gecko/20040910

Here is a quick patch to move attiny13 and attiny2313 to avr2 architecture in gcc. I have successfully rebuilt gcc-4.0-20041205 (the latest snapshot that can be built for avr).

But this move might need some change in avr-libc also...

Please be carreful, I did not fully test it yet and I am new to gcc internal.

Frederik

Marek Michalkiewicz wrote:

Oops.  Libraries built for avr4 also can't be used on attiny2313
and the like.  Until this "half-enhanced" ;) AVR core (with MOVW,
without MUL) is supported properly, these devices will have to be
moved from avr4 to avr2.  This is sub-optimal (MOVW not used),
but GCC 4.0 release is too close for more significant changes...

Marek
Index: gcc/config/avr/avr.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/config/avr/avr.c,v
retrieving revision 1.124
diff -u -r1.124 avr.c
--- gcc/config/avr/avr.c        28 Nov 2004 23:15:59 -0000      1.124
+++ gcc/config/avr/avr.c        22 Dec 2004 18:18:24 -0000
@@ -176,6 +176,8 @@
   { "at90c8534", 2, "__AVR_AT90C8534__" },
   { "at90s8535", 2, "__AVR_AT90S8535__" },
   { "at86rf401", 2, "__AVR_AT86RF401__" },
+  { "attiny13",  2, "__AVR_ATtiny13__" },
+  { "attiny2313",  2, "__AVR_ATtiny2313__" },
     /* Classic, > 8K.  */
   { "avr3",      3, NULL },
   { "atmega103", 3, "__AVR_ATmega103__" },
@@ -190,8 +192,6 @@
   { "atmega88",   4, "__AVR_ATmega88__" },
   { "atmega8515", 4, "__AVR_ATmega8515__" },
   { "atmega8535", 4, "__AVR_ATmega8535__" },
-  { "attiny13",  4, "__AVR_ATtiny13__" },
-  { "attiny2313",  4, "__AVR_ATtiny2313__" },
     /* Enhanced, > 8K.  */
   { "avr5",      5, NULL },
   { "atmega16",  5, "__AVR_ATmega16__" },
Index: gcc/config/avr/t-avr
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/config/avr/t-avr,v
retrieving revision 1.13
diff -u -r1.13 t-avr
--- gcc/config/avr/t-avr        28 Nov 2004 23:10:28 -0000      1.13
+++ gcc/config/avr/t-avr        22 Dec 2004 18:18:24 -0000
@@ -50,7 +50,6 @@
        mmcu?avr3=mmcu?at43usb320 mmcu?avr3=mmcu?at43usb355 \
        mmcu?avr3=mmcu?at76c711 \
        mmcu?avr4=mmcu?atmega8515 mmcu?avr4=mmcu?atmega8535 \
-       mmcu?avr4=mmcu?attiny13 mmcu?avr4=mmcu?attiny2313 \
        mmcu?avr4=mmcu?atmega8 mmcu?avr4=mmcu?atmega48 \
        mmcu?avr4=mmcu?atmega88 \
        mmcu?avr5=mmcu?atmega161 mmcu?avr5=mmcu?atmega162 \
Index: gcc/config/avr/avr.h
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/config/avr/avr.h,v
retrieving revision 1.109
diff -u -r1.109 avr.h
--- gcc/config/avr/avr.h        28 Nov 2004 23:10:28 -0000      1.109
+++ gcc/config/avr/avr.h        22 Dec 2004 18:18:25 -0000
@@ -812,9 +812,9 @@
 
 #define LINK_SPEC " %{!mmcu*:-m avr2}\
 %{mmcu=at90s1200|mmcu=attiny11|mmcu=attiny12|mmcu=attiny15|mmcu=attiny28:-m 
avr1} \
-%{mmcu=attiny22|mmcu=attiny26|mmcu=at90s2*|mmcu=at90s4*|mmcu=at90s8*|mmcu=at90c8*|mmcu=at86rf401:-m
 avr2}\
+%{mmcu=attiny22|mmcu=attiny26|mmcu=at90s2*|mmcu=at90s4*|mmcu=at90s8*|mmcu=at90c8*|mmcu=at86rf401|mmcu=attiny13|mmcu=attiny2313:-m
 avr2}\
 %{mmcu=atmega103|mmcu=atmega603|mmcu=at43*|mmcu=at76*:-m avr3}\
-%{mmcu=atmega8*|mmcu=atmega48|mmcu=attiny13|mmcu=attiny2313:-m avr4}\
+%{mmcu=atmega8*|mmcu=atmega48:-m avr4}\
 
%{mmcu=atmega16*|mmcu=atmega32*|mmcu=atmega64*|mmcu=atmega128|mmcu=at90can128|mmcu=at94k:-m
 avr5}\
 
%{mmcu=atmega325|mmcu=atmega3250|mmcu=atmega48|mmcu=atmega88|mmcu=atmega64|mmcu=atmega645|mmcu=atmega6450|mmcu=atmega128|mmcu=at90can128|mmcu=at90can128|mmcu=atmega162|mmcu=atmega165|mmcu=atmega168|mmcu=atmega169:
 -Tdata 0x800100} "
 
@@ -850,6 +850,8 @@
 %{mmcu=at90c8534:crtc8534.o%s} \
 %{mmcu=at90s8535:crts8535.o%s} \
 %{mmcu=at86rf401:crt86401.o%s} \
+%{mmcu=attiny13:crttn13.o%s} \
+%{mmcu=attiny2313:crttn2313.o%s} \
 %{mmcu=atmega103|mmcu=avr3:crtm103.o%s} \
 %{mmcu=atmega603:crtm603.o%s} \
 %{mmcu=at43usb320:crt43320.o%s} \
@@ -860,8 +862,6 @@
 %{mmcu=atmega88:crtm88.o%s} \
 %{mmcu=atmega8515:crtm8515.o%s} \
 %{mmcu=atmega8535:crtm8535.o%s} \
-%{mmcu=attiny13:crttn13.o%s} \
-%{mmcu=attiny2313:crttn2313.o%s} \
 %{mmcu=atmega16:crtm16.o%s} \
 %{mmcu=atmega161|mmcu=avr5:crtm161.o%s} \
 %{mmcu=atmega162:crtm162.o%s} \

reply via email to

[Prev in Thread] Current Thread [Next in Thread]