1
0
mirror of git://projects.qi-hardware.com/ben-blinkenlights.git synced 2024-11-23 22:30:37 +02:00

avrdude/patches/nanonote.patch: oops, clock math was old, slightly broken version

This commit is contained in:
Werner Almesberger 2011-03-08 21:23:15 -03:00
parent a8c10a0050
commit ea5b8af399

View File

@ -1,7 +1,7 @@
Index: avrdude/avrdude-5.10/Makefile.am
===================================================================
--- avrdude.orig/avrdude-5.10/Makefile.am 2011-03-07 15:10:10.000000000 -0300
+++ avrdude/avrdude-5.10/Makefile.am 2011-03-07 15:10:12.000000000 -0300
--- avrdude.orig/avrdude-5.10/Makefile.am 2011-03-07 16:50:03.000000000 -0300
+++ avrdude/avrdude-5.10/Makefile.am 2011-03-07 16:50:06.000000000 -0300
@@ -111,6 +111,8 @@
lists.c \
lists.h \
@ -13,8 +13,8 @@ Index: avrdude/avrdude-5.10/Makefile.am
pgm.c \
Index: avrdude/avrdude-5.10/config_gram.y
===================================================================
--- avrdude.orig/avrdude-5.10/config_gram.y 2011-03-07 15:10:10.000000000 -0300
+++ avrdude/avrdude-5.10/config_gram.y 2011-03-07 15:10:12.000000000 -0300
--- avrdude.orig/avrdude-5.10/config_gram.y 2011-03-07 16:50:03.000000000 -0300
+++ avrdude/avrdude-5.10/config_gram.y 2011-03-07 16:50:06.000000000 -0300
@@ -48,6 +48,7 @@
#include "avr.h"
#include "jtagmkI.h"
@ -46,8 +46,8 @@ Index: avrdude/avrdude-5.10/config_gram.y
current_prog->desc[PGM_DESCLEN-1] = 0;
Index: avrdude/avrdude-5.10/lexer.l
===================================================================
--- avrdude.orig/avrdude-5.10/lexer.l 2011-03-07 15:10:10.000000000 -0300
+++ avrdude/avrdude-5.10/lexer.l 2011-03-07 15:10:12.000000000 -0300
--- avrdude.orig/avrdude-5.10/lexer.l 2011-03-07 16:50:03.000000000 -0300
+++ avrdude/avrdude-5.10/lexer.l 2011-03-07 16:50:06.000000000 -0300
@@ -164,6 +164,7 @@
min_write_delay { yylval=NULL; return K_MIN_WRITE_DELAY; }
miso { yylval=NULL; return K_MISO; }
@ -59,8 +59,8 @@ Index: avrdude/avrdude-5.10/lexer.l
Index: avrdude/avrdude-5.10/nanonote.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ avrdude/avrdude-5.10/nanonote.c 2011-03-07 16:41:00.000000000 -0300
@@ -0,0 +1,370 @@
+++ avrdude/avrdude-5.10/nanonote.c 2011-03-07 17:07:16.000000000 -0300
@@ -0,0 +1,374 @@
+/*
+ * avrdude - A Downloader/Uploader for AVR device programmers
+ * Copyright (C) 2000, 2001, 2002, 2003 Brian S. Dean <bsd@bsdhome.com>
@ -110,6 +110,8 @@ Index: avrdude/avrdude-5.10/nanonote.c
+static volatile void *mem;
+
+
+#define PLL_CLK 336 /* PLL runs at 336 MHz */
+
+#define POWER_OFF 3, 2 /* PD02, drive low to enable power */
+#define CMD 3, 8 /* PD08, CMD */
+#define CLK 3, 9 /* PD09, CLK */
@ -297,7 +299,9 @@ Index: avrdude/avrdude-5.10/nanonote.c
+ /*
+ * set the MSC clock divider, dividing the 316 MHz system clock
+ */
+ div = 316/PDATA(pgm)->clk+1;
+ div = PLL_CLK/PDATA(pgm)->clk;
+ if (PLL_CLK % PDATA(pgm)->clk)
+ div++;
+ while (div > 32) {
+ log2++;
+ div = (div+1)/2;
@ -434,7 +438,7 @@ Index: avrdude/avrdude-5.10/nanonote.c
Index: avrdude/avrdude-5.10/nanonote.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ avrdude/avrdude-5.10/nanonote.h 2011-03-07 15:10:12.000000000 -0300
+++ avrdude/avrdude-5.10/nanonote.h 2011-03-07 16:50:06.000000000 -0300
@@ -0,0 +1,6 @@
+#ifndef nanonote_h
+#define nanonote_h