| 87 | |
| 88 | /* AVR Size specific stuff */ |
| 89 | |
| 90 | #define AVR64 64UL |
| 91 | #define AVR128 128UL |
| 92 | #define AVR256 256UL |
| 93 | #define AVR512 512UL |
| 94 | #define AVR1K 1024UL |
| 95 | #define AVR2K 2048UL |
| 96 | #define AVR4K 4096UL |
| 97 | #define AVR8K 8192UL |
| 98 | #define AVR16K 16384UL |
| 99 | #define AVR20K 20480UL |
| 100 | #define AVR24K 24576UL |
| 101 | #define AVR32K 32768UL |
| 102 | #define AVR36K 36864UL |
| 103 | #define AVR40K 40960UL |
| 104 | #define AVR64K 65536UL |
| 105 | #define AVR68K 69632UL |
| 106 | #define AVR128K 131072UL |
| 107 | #define AVR136K 139264UL |
| 108 | #define AVR200K 204800UL |
| 109 | #define AVR256K 262144UL |
| 110 | #define AVR264K 270336UL |
| 111 | |
| 112 | typedef struct |
| 113 | { |
| 114 | char *name; |
| 115 | long flash; |
| 116 | long ram; |
| 117 | long eeprom; |
| 118 | } avr_device_t; |
| 119 | |
| 120 | avr_device_t avr[] = |
| 121 | { |
| 122 | {"atxmega256a3", AVR264K, AVR16K, AVR4K}, |
| 123 | {"atxmega256a3b", AVR264K, AVR16K, AVR4K}, |
| 124 | {"atxmega256d3", AVR264K, AVR16K, AVR4K}, |
| 125 | |
| 126 | {"atmega2560", AVR256K, AVR8K, AVR4K}, |
| 127 | {"atmega2561", AVR256K, AVR8K, AVR4K}, |
| 128 | |
| 129 | {"atxmega192a3", AVR200K, AVR16K, AVR2K}, |
| 130 | {"atxmega192d3", AVR200K, AVR16K, AVR2K}, |
| 131 | |
| 132 | {"atxmega128a1", AVR136K, AVR8K, AVR2K}, |
| 133 | {"atxmega128a1u", AVR136K, AVR8K, AVR2K}, |
| 134 | {"atxmega128a3", AVR136K, AVR8K, AVR2K}, |
| 135 | {"atxmega128d3", AVR136K, AVR8K, AVR2K}, |
| 136 | |
| 137 | {"at43usb320", AVR128K, 608UL, 0UL}, |
| 138 | {"at90can128", AVR128K, AVR4K, AVR4K}, |
| 139 | {"at90usb1286", AVR128K, AVR8K, AVR4K}, |
| 140 | {"at90usb1287", AVR128K, AVR8K, AVR4K}, |
| 141 | {"atmega128", AVR128K, AVR4K, AVR4K}, |
| 142 | {"atmega1280", AVR128K, AVR8K, AVR4K}, |
| 143 | {"atmega1281", AVR128K, AVR8K, AVR4K}, |
| 144 | {"atmega1284p", AVR128K, AVR16K, AVR4K}, |
| 145 | {"atmega128rfa1", AVR128K, AVR16K, AVR4K}, |
| 146 | {"atmega103", AVR128K, 4000UL, AVR4K}, |
| 147 | |
| 148 | {"atxmega64a1", AVR68K, AVR4K, AVR2K}, |
| 149 | {"atxmega64a1u", AVR68K, AVR4K, AVR2K}, |
| 150 | {"atxmega64a3", AVR68K, AVR4K, AVR2K}, |
| 151 | {"atxmega64d3", AVR68K, AVR4K, AVR2K}, |
| 152 | |
| 153 | {"at90can64", AVR64K, AVR4K, AVR2K}, |
| 154 | {"at90scr100", AVR64K, AVR4K, AVR2K}, |
| 155 | {"at90usb646", AVR64K, AVR4K, AVR2K}, |
| 156 | {"at90usb647", AVR64K, AVR4K, AVR2K}, |
| 157 | {"atmega64", AVR64K, AVR4K, AVR2K}, |
| 158 | {"atmega640", AVR64K, AVR8K, AVR4K}, |
| 159 | {"atmega644", AVR64K, AVR4K, AVR2K}, |
| 160 | {"atmega644a", AVR64K, AVR4K, AVR2K}, |
| 161 | {"atmega644p", AVR64K, AVR4K, AVR2K}, |
| 162 | {"atmega644pa", AVR64K, AVR4K, AVR2K}, |
| 163 | {"atmega645", AVR64K, AVR4K, AVR2K}, |
| 164 | {"atmega645a", AVR64K, AVR4K, AVR2K}, |
| 165 | {"atmega645p", AVR64K, AVR4K, AVR2K}, |
| 166 | {"atmega6450", AVR64K, AVR4K, AVR2K}, |
| 167 | {"atmega6450a", AVR64K, AVR4K, AVR2K}, |
| 168 | {"atmega6450p", AVR64K, AVR4K, AVR2K}, |
| 169 | {"atmega649", AVR64K, AVR4K, AVR2K}, |
| 170 | {"atmega649a", AVR64K, AVR4K, AVR2K}, |
| 171 | {"atmega649p", AVR64K, AVR4K, AVR2K}, |
| 172 | {"atmega6490", AVR64K, AVR4K, AVR2K}, |
| 173 | {"atmega6490a", AVR64K, AVR4K, AVR2K}, |
| 174 | {"atmega6490p", AVR64K, AVR4K, AVR2K}, |
| 175 | {"atmega64c1", AVR64K, AVR4K, AVR2K}, |
| 176 | {"atmega64hve", AVR64K, AVR4K, AVR1K}, |
| 177 | {"atmega64m1", AVR64K, AVR4K, AVR2K}, |
| 178 | {"m3000", AVR64K, AVR4K, 0UL}, |
| 179 | |
| 180 | {"atmega406", AVR40K, AVR2K, AVR512}, |
| 181 | |
| 182 | {"atxmega32a4", AVR36K, AVR4K, AVR1K}, |
| 183 | {"atxmega32d4", AVR36K, AVR4K, AVR1K}, |
| 184 | |
| 185 | {"at90can32", AVR32K, AVR2K, AVR1K}, |
| 186 | {"at94k", AVR32K, AVR4K, 0UL}, |
| 187 | {"atmega32", AVR32K, AVR2K, AVR1K}, |
| 188 | {"atmega323", AVR32K, AVR2K, AVR1K}, |
| 189 | {"atmega324a", AVR32K, AVR2K, AVR1K}, |
| 190 | {"atmega324p", AVR32K, AVR2K, AVR1K}, |
| 191 | {"atmega324pa", AVR32K, AVR2K, AVR1K}, |
| 192 | {"atmega325", AVR32K, AVR2K, AVR1K}, |
| 193 | {"atmega325a", AVR32K, AVR2K, AVR1K}, |
| 194 | {"atmega325p", AVR32K, AVR2K, AVR1K}, |
| 195 | {"atmega3250", AVR32K, AVR2K, AVR1K}, |
| 196 | {"atmega3250a", AVR32K, AVR2K, AVR1K}, |
| 197 | {"atmega3250p", AVR32K, AVR2K, AVR1K}, |
| 198 | {"atmega328", AVR32K, AVR2K, AVR1K}, |
| 199 | {"atmega328p", AVR32K, AVR2K, AVR1K}, |
| 200 | {"atmega329", AVR32K, AVR2K, AVR1K}, |
| 201 | {"atmega329a", AVR32K, AVR2K, AVR1K}, |
| 202 | {"atmega329p", AVR32K, AVR2K, AVR1K}, |
| 203 | {"atmega329pa", AVR32K, AVR2K, AVR1K}, |
| 204 | {"atmega3290", AVR32K, AVR2K, AVR1K}, |
| 205 | {"atmega3290a", AVR32K, AVR2K, AVR1K}, |
| 206 | {"atmega3290p", AVR32K, AVR2K, AVR1K}, |
| 207 | {"atmega32hvb", AVR32K, AVR2K, AVR1K}, |
| 208 | {"atmega32c1", AVR32K, AVR2K, AVR1K}, |
| 209 | {"atmega32hvb", AVR32K, AVR2K, AVR1K}, |
| 210 | {"atmega32m1", AVR32K, AVR2K, AVR1K}, |
| 211 | {"atmega32u2", AVR32K, AVR1K, AVR1K}, |
| 212 | {"atmega32u4", AVR32K, 2560UL, AVR1K}, |
| 213 | {"atmega32u6", AVR32K, 2560UL, AVR1K}, |
| 214 | |
| 215 | {"at43usb355", AVR24K, 1120UL, 0UL}, |
| 216 | |
| 217 | {"atxmega16a4", AVR20K, AVR2K, AVR1K}, |
| 218 | {"atxmega16d4", AVR20K, AVR2K, AVR1K}, |
| 219 | |
| 220 | {"at76c711", AVR16K, AVR2K, 0UL}, |
| 221 | {"at90pwm216", AVR16K, AVR1K, AVR512}, |
| 222 | {"at90pwm316", AVR16K, AVR1K, AVR512}, |
| 223 | {"at90usb162", AVR16K, AVR512, AVR512}, |
| 224 | {"atmega16", AVR16K, AVR1K, AVR512}, |
| 225 | {"atmega16a", AVR16K, AVR1K, AVR512}, |
| 226 | {"atmega161", AVR16K, AVR1K, AVR512}, |
| 227 | {"atmega162", AVR16K, AVR1K, AVR512}, |
| 228 | {"atmega163", AVR16K, AVR1K, AVR512}, |
| 229 | {"atmega164", AVR16K, AVR1K, AVR512}, |
| 230 | {"atmega164a", AVR16K, AVR1K, AVR512}, |
| 231 | {"atmega164p", AVR16K, AVR1K, AVR512}, |
| 232 | {"atmega165a", AVR16K, AVR1K, AVR512}, |
| 233 | {"atmega165", AVR16K, AVR1K, AVR512}, |
| 234 | {"atmega165p", AVR16K, AVR1K, AVR512}, |
| 235 | {"atmega168", AVR16K, AVR1K, AVR512}, |
| 236 | {"atmega168a", AVR16K, AVR1K, AVR512}, |
| 237 | {"atmega168p", AVR16K, AVR1K, AVR512}, |
| 238 | {"atmega169", AVR16K, AVR1K, AVR512}, |
| 239 | {"atmega169a", AVR16K, AVR1K, AVR512}, |
| 240 | {"atmega169p", AVR16K, AVR1K, AVR512}, |
| 241 | {"atmega169pa", AVR16K, AVR1K, AVR512}, |
| 242 | {"atmega16hva", AVR16K, 768UL, AVR256}, |
| 243 | {"atmega16hva2", AVR16K, AVR1K, AVR256}, |
| 244 | {"atmega16hvb", AVR16K, AVR1K, AVR512}, |
| 245 | {"atmega16m1", AVR16K, AVR1K, AVR512}, |
| 246 | {"atmega16u2", AVR16K, AVR512, AVR512}, |
| 247 | {"atmega16u4", AVR16K, 1280UL, AVR512}, |
| 248 | {"attiny167", AVR16K, AVR512, AVR512}, |
| 249 | |
| 250 | {"at90c8534", AVR8K, 352UL, AVR512}, |
| 251 | {"at90pwm1", AVR8K, AVR512, AVR512}, |
| 252 | {"at90pwm2", AVR8K, AVR512, AVR512}, |
| 253 | {"at90pwm2b", AVR8K, AVR512, AVR512}, |
| 254 | {"at90pwm3", AVR8K, AVR512, AVR512}, |
| 255 | {"at90pwm3b", AVR8K, AVR512, AVR512}, |
| 256 | {"at90pwm81", AVR8K, AVR256, AVR512}, |
| 257 | {"at90s8515", AVR8K, AVR512, AVR512}, |
| 258 | {"at90s8535", AVR8K, AVR512, AVR512}, |
| 259 | {"at90usb82", AVR8K, AVR512, AVR512}, |
| 260 | {"ata6289", AVR8K, AVR512, 320UL}, |
| 261 | {"atmega8", AVR8K, AVR1K, AVR512}, |
| 262 | {"atmega8515", AVR8K, AVR512, AVR512}, |
| 263 | {"atmega8535", AVR8K, AVR512, AVR512}, |
| 264 | {"atmega88", AVR8K, AVR1K, AVR512}, |
| 265 | {"atmega88a", AVR8K, AVR1K, AVR512}, |
| 266 | {"atmega88p", AVR8K, AVR1K, AVR512}, |
| 267 | {"atmega88pa", AVR8K, AVR1K, AVR512}, |
| 268 | {"atmega8hva", AVR8K, 768UL, AVR256}, |
| 269 | {"atmega8u2", AVR8K, AVR512, AVR512}, |
| 270 | {"attiny84", AVR8K, AVR512, AVR512}, |
| 271 | {"attiny84a", AVR8K, AVR512, AVR512}, |
| 272 | {"attiny85", AVR8K, AVR512, AVR512}, |
| 273 | {"attiny861", AVR8K, AVR512, AVR512}, |
| 274 | {"attiny861a", AVR8K, AVR512, AVR512}, |
| 275 | {"attiny87", AVR8K, AVR512, AVR512}, |
| 276 | {"attiny88", AVR8K, AVR512, AVR64}, |
| 277 | |
| 278 | {"at90s4414", AVR4K, 352UL, AVR256}, |
| 279 | {"at90s4433", AVR4K, AVR128, AVR256}, |
| 280 | {"at90s4434", AVR4K, 352UL, AVR256}, |
| 281 | {"atmega48", AVR4K, AVR512, AVR256}, |
| 282 | {"atmega48a", AVR4K, AVR512, AVR256}, |
| 283 | {"atmega48p", AVR4K, AVR512, AVR256}, |
| 284 | {"attiny4313", AVR4K, AVR256, AVR256}, |
| 285 | {"attiny43u", AVR4K, AVR256, AVR64}, |
| 286 | {"attiny44", AVR4K, AVR256, AVR256}, |
| 287 | {"attiny44a", AVR4K, AVR256, AVR256}, |
| 288 | {"attiny45", AVR4K, AVR256, AVR256}, |
| 289 | {"attiny461", AVR4K, AVR256, AVR256}, |
| 290 | {"attiny461a", AVR4K, AVR256, AVR256}, |
| 291 | {"attiny48", AVR4K, AVR256, AVR64}, |
| 292 | |
| 293 | {"at86rf401", AVR2K, 224UL, AVR128}, |
| 294 | {"at90s2313", AVR2K, AVR128, AVR128}, |
| 295 | {"at90s2323", AVR2K, AVR128, AVR128}, |
| 296 | {"at90s2333", AVR2K, 224UL, AVR128}, |
| 297 | {"at90s2343", AVR2K, AVR128, AVR128}, |
| 298 | {"attiny20", AVR2K, AVR128, 0UL}, |
| 299 | {"attiny22", AVR2K, 224UL, AVR128}, |
| 300 | {"attiny2313", AVR2K, AVR128, AVR128}, |
| 301 | {"attiny2313a", AVR2K, AVR128, AVR128}, |
| 302 | {"attiny24", AVR2K, AVR128, AVR128}, |
| 303 | {"attiny24a", AVR2K, AVR128, AVR128}, |
| 304 | {"attiny25", AVR2K, AVR128, AVR128}, |
| 305 | {"attiny26", AVR2K, AVR128, AVR128}, |
| 306 | {"attiny261", AVR2K, AVR128, AVR128}, |
| 307 | {"attiny261a", AVR2K, AVR128, AVR128}, |
| 308 | {"attiny28", AVR2K, 0UL, 0UL}, |
| 309 | {"attiny40", AVR2K, AVR256, 0UL}, |
| 310 | |
| 311 | {"at90s1200", AVR1K, 0UL, AVR64}, |
| 312 | {"attiny9", AVR1K, 32UL, 0UL}, |
| 313 | {"attiny10", AVR1K, 32UL, 0UL}, |
| 314 | {"attiny11", AVR1K, 0UL, AVR64}, |
| 315 | {"attiny12", AVR1K, 0UL, AVR64}, |
| 316 | {"attiny13", AVR1K, AVR64, AVR64}, |
| 317 | {"attiny13a", AVR1K, AVR64, AVR64}, |
| 318 | {"attiny15", AVR1K, 0UL, AVR64}, |
| 319 | |
| 320 | {"attiny4", AVR512, 32UL, 0UL}, |
| 321 | {"attiny5", AVR512, 32UL, 0UL}, |
| 322 | }; |
| 323 | |
| 324 | static char *avrmcu = NULL; |
| 325 | |
| 326 | |