Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add a new config for Fuze V2

  • Loading branch information...
commit 3c3e32fa0ca15152f1993de45508a35937fc2d9a 1 parent 8a9030b
authored June 07, 2009
2  bootloader/sansa_as3525.c
@@ -61,7 +61,7 @@ void main(void)
61 61
     _backlight_on();
62 62
 
63 63
     button_init_device();
64  
-#ifndef SANSA_CLIPV2
  64
+#if !(defined(SANSA_CLIPV2) || defined(SANSA_FUZEV2))
65 65
     int btn = button_read_device();
66 66
 
67 67
 #if !defined(SANSA_FUZE) && !defined(SANSA_CLIP)
4  firmware/SOURCES
@@ -366,7 +366,7 @@ target/arm/pnx0101/system-pnx0101.c
366 366
 #if CONFIG_CPU == AS3525
367 367
 target/arm/as3525/system-as3525.c
368 368
 target/arm/as3525/kernel-as3525.c
369  
-#ifndef SANSA_CLIPV2
  369
+#if !(defined(SANSA_CLIPV2) || defined(SANSA_FUZEV2))
370 370
 target/arm/as3525/ata_sd_as3525.c
371 371
 #endif
372 372
 target/arm/as3525/power-as3525.c
@@ -1165,7 +1165,7 @@ target/arm/as3525/sansa-m200v4/powermgmt-m200v4.c
1165 1165
 #endif /* !SIMULATOR */
1166 1166
 #endif /* SANSA_M200V4 */
1167 1167
 
1168  
-#ifdef SANSA_FUZE
  1168
+#if defined(SANSA_FUZE) || defined(SANSA_FUZEV2)
1169 1169
 #ifndef SIMULATOR
1170 1170
 target/arm/as3525/sansa-fuze/button-fuze.c
1171 1171
 target/arm/as3525/sansa-fuze/lcd-fuze.c
210  firmware/export/config-fuzev2.h
... ...
@@ -0,0 +1,210 @@
  1
+/*
  2
+ * This config file is for the Sandisk Sansa Fuze
  3
+ */
  4
+#define TARGET_TREE /* this target is using the target tree system */
  5
+
  6
+/* For Rolo and boot loader */
  7
+#define MODEL_NUMBER 67
  8
+#define MODEL_NAME   "Sandisk Sansa Fuze V2"
  9
+
  10
+#define HW_SAMPR_CAPS       (SAMPR_CAP_44)
  11
+
  12
+#if 0
  13
+/* define this if you have recording possibility */
  14
+#define HAVE_RECORDING
  15
+
  16
+#define REC_SAMPR_CAPS      (SAMPR_CAP_22)
  17
+#define REC_FREQ_DEFAULT    REC_FREQ_22 /* Default is not 44.1kHz */
  18
+#define REC_SAMPR_DEFAULT   SAMPR_22
  19
+
  20
+/* Default recording levels */
  21
+#define DEFAULT_REC_MIC_GAIN    23
  22
+#define DEFAULT_REC_LEFT_GAIN   23
  23
+#define DEFAULT_REC_RIGHT_GAIN  23
  24
+
  25
+/* Define bitmask of input sources - recordable bitmask can be defined
  26
+   explicitly if different */
  27
+#endif
  28
+#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_FMRADIO)
  29
+
  30
+/* define this if you have a bitmap LCD display */
  31
+#define HAVE_LCD_BITMAP
  32
+/* define this if you have a colour LCD */
  33
+#define HAVE_LCD_COLOR
  34
+
  35
+#ifndef BOOTLOADER/* define this if you want album art for this target */
  36
+#define HAVE_ALBUMART
  37
+
  38
+/* define this to enable bitmap scaling */
  39
+#define HAVE_BMP_SCALING
  40
+
  41
+/* define this to enable JPEG decoding */
  42
+#define HAVE_JPEG
  43
+
  44
+/* define this if you have a light associated with the buttons */
  45
+#define HAVE_BUTTON_LIGHT
  46
+
  47
+/* define this if you have access to the quickscreen */
  48
+#define HAVE_QUICKSCREEN
  49
+
  50
+/* define this if you have access to the pitchscreen */
  51
+#define HAVE_PITCHSCREEN
  52
+
  53
+/* define this if you would like tagcache to build on this target */
  54
+#define HAVE_TAGCACHE
  55
+
  56
+/* define this if you have LCD enable function */
  57
+#define HAVE_LCD_ENABLE
  58
+
  59
+/* Define this if your LCD can be put to sleep. HAVE_LCD_ENABLE
  60
+   should be defined as well.
  61
+#define HAVE_LCD_SLEEP
  62
+#define HAVE_LCD_SLEEP_SETTING
  63
+*/
  64
+
  65
+/* define this if you can flip your LCD */
  66
+//#define HAVE_LCD_FLIP
  67
+
  68
+/* define this if you can invert the colours on your LCD */
  69
+//#define HAVE_LCD_INVERT
  70
+
  71
+
  72
+/* define this if you have a real-time clock */
  73
+#define CONFIG_RTC RTC_AS3514
  74
+
  75
+/* There is no hardware tone control */
  76
+#define HAVE_SW_TONE_CONTROLS
  77
+
  78
+#endif /* !BOOTLOADER */
  79
+
  80
+/* put the lcd frame buffer in IRAM */
  81
+#define IRAM_LCDFRAMEBUFFER IBSS_ATTR
  82
+
  83
+#define CONFIG_KEYPAD SANSA_FUZE_PAD
  84
+
  85
+/* Define this if you do software codec */
  86
+#define CONFIG_CODEC SWCODEC
  87
+
  88
+
  89
+/* LCD dimensions */
  90
+#define LCD_WIDTH  220
  91
+#define LCD_HEIGHT 176
  92
+#define LCD_DEPTH  16   /* 65536 colours */
  93
+#define LCD_PIXELFORMAT RGB565 /* rgb565 */
  94
+
  95
+
  96
+/* We're working on the assumption that the AS3525 has something
  97
+   similar to the AS3514 for audio codec etc */
  98
+#define HAVE_AS3514
  99
+
  100
+/* Define this if you have a software controlled poweroff */
  101
+#define HAVE_SW_POWEROFF
  102
+
  103
+/* Some Sansa Fuzes seem to be FAT16 formatted */
  104
+#define HAVE_FAT16SUPPORT
  105
+
  106
+/* The number of bytes reserved for loadable codecs */
  107
+#define CODEC_SIZE 0x100000
  108
+
  109
+/* The number of bytes reserved for loadable plugins */
  110
+#define PLUGIN_BUFFER_SIZE 0x80000
  111
+
  112
+#define AB_REPEAT_ENABLE 1
  113
+
  114
+/* FM Tuner - suspected to be the SI4702 */
  115
+#define CONFIG_TUNER SI4700
  116
+/* #define HAVE_TUNER_PWR_CTRL */
  117
+
  118
+/* Define this for LCD backlight available */
  119
+#define HAVE_BACKLIGHT
  120
+#define HAVE_BACKLIGHT_BRIGHTNESS
  121
+
  122
+/* Main LCD backlight brightness range and defaults */
  123
+#define MIN_BRIGHTNESS_SETTING      1
  124
+#define MAX_BRIGHTNESS_SETTING     12
  125
+#define DEFAULT_BRIGHTNESS_SETTING  6
  126
+
  127
+/* Which backlight fading type? */
  128
+#define CONFIG_BACKLIGHT_FADING BACKLIGHT_FADING_SW_SETTING
  129
+
  130
+/* define this if the unit uses a scrollwheel for navigation */
  131
+#define HAVE_SCROLLWHEEL
  132
+/* define to activate advanced wheel acceleration code */
  133
+#define HAVE_WHEEL_ACCELERATION
  134
+/* define from which rotation speed [degree/sec] on the acceleration starts */
  135
+#define WHEEL_ACCEL_START 540
  136
+/* define type of acceleration (1 = ^2, 2 = ^3, 3 = ^4) */
  137
+#define WHEEL_ACCELERATION 1
  138
+
  139
+/* define this if you have a flash memory storage */
  140
+#define HAVE_FLASH_STORAGE
  141
+
  142
+/* define this if the flash memory uses the SecureDigital Memory Card protocol */
  143
+#define CONFIG_STORAGE STORAGE_SD
  144
+
  145
+#define BATTERY_CAPACITY_DEFAULT 550    /* default battery capacity */
  146
+#define BATTERY_CAPACITY_MIN 550        /* min. capacity selectable */
  147
+#define BATTERY_CAPACITY_MAX 550        /* max. capacity selectable */
  148
+#define BATTERY_CAPACITY_INC 0          /* capacity increment */
  149
+#define BATTERY_TYPES_COUNT  1          /* only one type */
  150
+
  151
+/* Hardware controlled charging? FIXME */
  152
+#define CONFIG_CHARGING CHARGING_SIMPLE
  153
+
  154
+/* define this if the unit can be powered or charged via USB */
  155
+#define HAVE_USB_POWER
  156
+
  157
+/** Non-simulator section **/
  158
+#ifndef SIMULATOR
  159
+
  160
+/* Define this if you have an AMS AS3525*/
  161
+#define CONFIG_CPU AS3525
  162
+
  163
+/* Define how much SD sectors are reserved for OF */
  164
+#define AMS_OF_SIZE 0xF000
  165
+
  166
+/* Define this if you want to use the AS2525 i2c interface */
  167
+#define CONFIG_I2C I2C_AS3525
  168
+
  169
+/* Define this to the CPU frequency */
  170
+#define CPU_FREQ      250000000
  171
+
  172
+/* Type of LCD */
  173
+#define CONFIG_LCD LCD_FUZE
  174
+
  175
+/* Offset ( in the firmware file's header ) to the file CRC and data. These are
  176
+   only used when loading the old format rockbox.e200 file */
  177
+#define FIRMWARE_OFFSET_FILE_CRC    0x0
  178
+#define FIRMWARE_OFFSET_FILE_DATA   0x8
  179
+
  180
+#ifndef BOOTLOADER
  181
+#define HAVE_MULTIVOLUME
  182
+#define HAVE_HOTSWAP
  183
+#endif
  184
+
  185
+#define USB_HANDLED_BY_OF
  186
+
  187
+/* USB On-the-go */
  188
+#define CONFIG_USBOTG USBOTG_AS3525
  189
+
  190
+/* enable these for the experimental usb stack */
  191
+//#define HAVE_USBSTACK
  192
+#define USB_VENDOR_ID 0x0781
  193
+#define USB_PRODUCT_ID 0x7423
  194
+
  195
+/* Virtual LED (icon) */
  196
+#define CONFIG_LED LED_VIRTUAL
  197
+
  198
+/* Define this if you have adjustable CPU frequency */
  199
+#define HAVE_ADJUSTABLE_CPU_FREQ
  200
+
  201
+#define BOOTFILE_EXT    "sansa"
  202
+#define BOOTFILE        "rockbox." BOOTFILE_EXT
  203
+#define BOOTDIR "/.rockbox"
  204
+
  205
+#define ICODE_ATTR_TREMOR_NOT_MDCT
  206
+
  207
+#define INCLUDE_TIMEOUT_API
  208
+
  209
+#endif /* SIMULATOR */
  210
+
2  firmware/export/config.h
@@ -364,6 +364,8 @@ Lyre prototype 1*/
364 364
 #include "config-m200v4.h"
365 365
 #elif defined(SANSA_FUZE)
366 366
 #include "config-fuze.h"
  367
+#elif defined(SANSA_FUZEV2)
  368
+#include "config-fuzev2.h"
367 369
 #elif defined(SANSA_C200V2)
368 370
 #include "config-c200v2.h"
369 371
 #elif defined(LYRE_PROTO1)
2  firmware/target/arm/as3525/boot.lds
@@ -11,7 +11,7 @@ No need for DRAM in our bootloader
11 11
 #define DRAMSIZE (MEMORYSIZE * 0x100000) - TTB_SIZE
12 12
 #define DRAMORIG 0x30000000
13 13
 */
14  
-#ifdef SANSA_CLIPV2
  14
+#if defined(SANSA_CLIPV2) || defined(SANSA_FUZE)
15 15
 #define IRAMORIG 0              /* in fact DRAM, but we don't care */
16 16
 #define IRAMSIZE (MEM*0x100000)
17 17
 #else
4  firmware/target/arm/as3525/clock-target.h
@@ -53,7 +53,7 @@
53 53
 
54 54
 /* PLL  frequencies and settings*/
55 55
 
56  
-#ifdef SANSA_CLIPV2
  56
+#if defined(SANSA_CLIPV2) || defined(SANSA_FUZEV2)
57 57
 #define AS3525_PLLA_FREQ        240000000   /*124,82.7,62,49.6,41.3,35.4 */
58 58
 #else
59 59
 #define AS3525_PLLA_FREQ        248000000   /*124,82.7,62,49.6,41.3,35.4 */
@@ -115,7 +115,7 @@
115 115
 
116 116
 #define AS3525_IDE_SEL           AS3525_CLK_PLLA           /* Input Source   */
117 117
 #define AS3525_IDE_DIV           (CLK_DIV(AS3525_PLLA_FREQ, AS3525_IDE_FREQ) - 1)/*div=1/(n+1)*/
118  
-#ifdef SANSA_CLIPV2
  118
+#if defined(SANSA_CLIPV2) || defined(SANSA_FUZEV2)
119 119
  #define AS3525_MS_FREQ          120000000
120 120
 #define AS3525_IDE_FREQ          80000000
121 121
 #else
2  firmware/target/arm/as3525/fmradio-i2c-as3525.c
@@ -49,7 +49,7 @@
49 49
 #define I2C_SCL_PIN 7
50 50
 #define I2C_SDA_PIN 6
51 51
 
52  
-#elif   defined(SANSA_FUZE) || defined(SANSA_E200V2)
  52
+#elif   defined(SANSA_FUZE) || defined(SANSA_E200V2) || defined(SANSA_FUZEV2)
53 53
 #define I2C_GPIO(x) GPIOA_PIN(x)
54 54
 #define I2C_GPIO_DIR GPIOA_DIR
55 55
 #define I2C_SCL_PIN 6
6  firmware/target/arm/as3525/system-as3525.c
@@ -189,7 +189,7 @@ static void sdram_init(void)
189 189
 /* 16 bits external bus, low power SDRAM, 16 Mbits = 2 Mbytes */
190 190
 #define MEMORY_MODEL 0x21
191 191
 
192  
-#elif defined(SANSA_E200V2) || defined(SANSA_FUZE) || defined(SANSA_CLIPV2)
  192
+#elif defined(SANSA_E200V2) || defined(SANSA_FUZE) || defined(SANSA_CLIPV2) || defined(SANSA_FUZEV2)
193 193
 /* 16 bits external bus, high performance SDRAM, 64 Mbits = 8 Mbytes */
194 194
 #define MEMORY_MODEL 0x5
195 195
 
@@ -218,7 +218,7 @@ static void sdram_init(void)
218 218
 
219 219
 void system_init(void)
220 220
 {
221  
-#ifndef SANSA_CLIPV2
  221
+#if !(defined(SANSA_CLIPV2) || defined(SANSA_FUZEV2))
222 222
     unsigned int reset_loops = 640;
223 223
 
224 224
     CCU_SRC = 0x1fffff0
@@ -266,7 +266,7 @@ void system_init(void)
266 266
     CGU_PERI &= ~0x7f;      /* pclk 24 MHz */
267 267
     CGU_PERI |= ((CLK_DIV(AS3525_PLLA_FREQ, AS3525_PCLK_FREQ) - 1) << 2)
268 268
                 | 1; /* clk_in = PLLA */
269  
-#endif /* SANSA_CLIPV2 */
  269
+#endif /* SANSA_CLIPV2 || SANSA_FUZEV2 */
270 270
 
271 271
 #if 0 /* the GPIO clock is already enabled by the dualboot function */
272 272
     CGU_PERI |= CGU_GPIO_CLOCK_ENABLE;
2  firmware/target/arm/as3525/usb-as3525.c
@@ -29,7 +29,7 @@
29 29
 #if defined(SANSA_CLIP)
30 30
 #define USB_DETECT_PIN 6
31 31
 
32  
-#elif defined(SANSA_FUZE) || defined(SANSA_E200V2)
  32
+#elif defined(SANSA_FUZE) || defined(SANSA_E200V2) || defined(SANSA_FUZEV2)
33 33
 #define USB_DETECT_PIN 3
34 34
 
35 35
 #elif defined(SANSA_C200V2)
2  firmware/target/arm/crt0.S
@@ -59,7 +59,7 @@ newstart:
59 59
 
60 60
 #if CONFIG_CPU==AS3525 && !defined(BOOTLOADER)
61 61
 
62  
-#ifndef SANSA_CLIPV2
  62
+#if !(defined(SANSA_CLIPV2) || defined(SANSA_FUZEV2))
63 63
     /* relocate vectors */
64 64
     mov     r1, #0              @ destination
65 65
     ldr     r2, =_vectorscopy   @ source
18  rbutil/mkamsboot/dualboot.S
@@ -136,23 +136,7 @@ uclcopy:
136 136
 
137 137
         cmp   r1, #0
138 138
         beq   boot_of
139  
-#elif defined(SANSA_FUZEV2)
140  
-        ldr   r0, =GPIOC
141  
-
142  
-	mov r1, #0
143  
-	str r1, [r0, #0x400]
144  
-
145  
-	ldr   r0, [r0, #0x20]
146  
-        cmp   r0, #0
147  
-        beq   boot_of   @ if the pin is unset, boot immediately
148  
-                        @ else, boot after a noticeable delay
149  
-
150  
-delay:  mov   r0, #0x3000000
151  
-1:      subs  r0, r0, #1
152  
-        bne   1b
153  
-
154  
-        b     boot_of
155  
-#elif defined(SANSA_E200V2) || defined(SANSA_FUZE)
  139
+#elif defined(SANSA_E200V2) || defined(SANSA_FUZE) || defined(SANSA_FUZEV2)
156 140
         /* LEFT button */
157 141
         ldr   r0, =GPIOC
158 142
         mov   r1, #0
7  rbutil/mkamsboot/mkamsboot.c
@@ -175,8 +175,7 @@ static const int rb_model_num[] =
175 175
     41,
176 176
     42,
177 177
     44,
178  
-    67,
179  
-    0 // Unknown
  178
+    67
180 179
 };
181 180
 
182 181
 struct md5sums {
@@ -393,7 +392,7 @@ static unsigned char* load_rockbox_file(char* filename, int model, off_t* bufsiz
393 392
     if (memcmp(rb_model_names[model],header + 4,4)!=0) {
394 393
         fprintf(stderr,"[ERR]  Model name \"%s\" not found in %s\n",
395 394
                        rb_model_names[model],filename);
396  
-        //return NULL;
  395
+        return NULL;
397 396
     }
398 397
 
399 398
     *bufsize = filesize(fd) - sizeof(header);
@@ -421,7 +420,7 @@ static unsigned char* load_rockbox_file(char* filename, int model, off_t* bufsiz
421 420
     if (sum != get_uint32be(header)) {
422 421
         fprintf(stderr,"[ERR]  Checksum mismatch in %s\n",filename);
423 422
         fprintf(stderr, "%x %x\n", sum, get_uint32be(header));
424  
-        //return NULL;
  423
+        return NULL;
425 424
     }
426 425
     return buf;
427 426
 }
20  tools/configure
@@ -760,6 +760,7 @@ cat <<EOF
760 760
 
761 761
  ==Sansa AMS v2==
762 762
  150) Clipv2
  763
+ 151) Fuzev2
763 764
 EOF
764 765
 
765 766
   buildfor=`input`;
@@ -1822,6 +1823,25 @@ fi
1822 1823
     t_model="sansa-fuze"
1823 1824
     ;;
1824 1825
 
  1826
+   151|fuzev2)
  1827
+    target_id=67
  1828
+    modelname="fuzev2"
  1829
+    target="-DSANSA_FUZEV2"
  1830
+    memory=8
  1831
+    arm926ejscc
  1832
+    bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
  1833
+    bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
  1834
+    tool="$rootdir/tools/scramble -add=fuz2"
  1835
+    output="rockbox.sansa"
  1836
+    bootoutput="bootloader-fuzev2.sansa"
  1837
+    appextra="recorder:gui"
  1838
+    plugins="yes"
  1839
+    swcodec="yes"
  1840
+    toolset=$scramblebitmaptools
  1841
+    t_cpu="arm"
  1842
+    t_manufacturer="as3525"
  1843
+    t_model="sansa-fuzev2"
  1844
+    ;;
1825 1845
 
1826 1846
    59|c200v2)
1827 1847
     target_id=55
4  tools/scramble.c
@@ -123,7 +123,7 @@ void usage(void)
123 123
            "\t                   ip3g, ip4g, mini, iax5, iam5, iam3, h10, h10_5gb,\n"
124 124
            "\t                   tpj2, c200, e200, giga, gigs, m100, m500, d2,\n");
125 125
     printf("\t                   9200, 1630, ldax, m200, clip, e2v2, m2v4, fuze,\n"
126  
-           "\t                   y820, y920, y925, clv2)\n");
  126
+           "\t                   y820, y920, y925, clv2, fuz2)\n");
127 127
     printf("\nNo option results in Archos standard player/recorder format.\n");
128 128
 
129 129
     exit(1);
@@ -306,6 +306,8 @@ int main (int argc, char** argv)
306 306
             modelnum = 59;
307 307
         else if (!strcmp(&argv[1][5], "clv2")) /* Sansa Clip v2 */
308 308
             modelnum = 66;
  309
+        else if (!strcmp(&argv[1][5], "fuz2")) /* Sansa Fuze v2 */
  310
+            modelnum = 67;
309 311
         else {
310 312
             fprintf(stderr, "unsupported model: %s\n", &argv[1][5]);
311 313
             return 2;
2  uisimulator/sdl/uisdl.h
@@ -263,7 +263,7 @@
263 263
 #define UI_LCD_POSX                 39 /* x position of lcd */
264 264
 #define UI_LCD_POSY                 38 /* y position of lcd */
265 265
 
266  
-#elif defined(SANSA_FUZE)
  266
+#elif defined(SANSA_FUZE) || defined(SANSA_FUZEV2)
267 267
 #define UI_TITLE                    "Sansa Fuze"
268 268
 #define UI_WIDTH                    279 /* width of GUI window */
269 269
 #define UI_HEIGHT                   449 /* height of GUI window */

0 notes on commit 3c3e32f

Please sign in to comment.
Something went wrong with that request. Please try again.