summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Purchase <shotofadds@rockbox.org>2008-04-15 20:02:24 +0000
committerRob Purchase <shotofadds@rockbox.org>2008-04-15 20:02:24 +0000
commitd88c5667d9bef918259b2e1719315a4e948be30a (patch)
treef800d212d7d5ddcfd363eef856fa3c2c625806fa
parentb36d3c0be228fbf7ad1b193d11d8a3365a045a43 (diff)
downloadrockbox-d88c5667d9bef918259b2e1719315a4e948be30a.tar.gz
rockbox-d88c5667d9bef918259b2e1719315a4e948be30a.zip
Kill some D2 yellows with a simplistic Rolo implementation and NAND driver cleanup. Correct some comments in crt0.s and remove two erroneous null words from rockbox.bin
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17127 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/rolo.c12
-rw-r--r--firmware/target/arm/tcc780x/ata-nand-tcc780x.c9
-rw-r--r--firmware/target/arm/tcc780x/crt0.S8
3 files changed, 19 insertions, 10 deletions
diff --git a/firmware/rolo.c b/firmware/rolo.c
index eb49a18c01..848b35b056 100644
--- a/firmware/rolo.c
+++ b/firmware/rolo.c
@@ -167,6 +167,15 @@ void rolo_restart(const unsigned char* source, unsigned char* dest,
167 "mov r0, #0x10000000 \n" 167 "mov r0, #0x10000000 \n"
168 "mov pc, r0 \n" 168 "mov pc, r0 \n"
169 ); 169 );
170
171#elif defined(CPU_TCC780X)
172 /* Flush cache */
173 flush_icache();
174
175 asm volatile(
176 "mov pc, %0 \n"
177 : : "r"(dest)
178 );
170#endif 179#endif
171} 180}
172#endif 181#endif
@@ -216,7 +225,8 @@ int rolo_load(const char* filename)
216 225
217 length = filesize(fd) - FIRMWARE_OFFSET_FILE_DATA; 226 length = filesize(fd) - FIRMWARE_OFFSET_FILE_DATA;
218 227
219#if defined(CPU_COLDFIRE) || defined(CPU_PP) || (CONFIG_CPU==DM320) 228#if defined(CPU_COLDFIRE) || defined(CPU_PP) || (CONFIG_CPU==DM320) \
229 || defined(CPU_TCC780X)
220 /* Read and save checksum */ 230 /* Read and save checksum */
221 lseek(fd, FIRMWARE_OFFSET_FILE_CRC, SEEK_SET); 231 lseek(fd, FIRMWARE_OFFSET_FILE_CRC, SEEK_SET);
222 if (read(fd, &file_checksum, 4) != 4) { 232 if (read(fd, &file_checksum, 4) != 4) {
diff --git a/firmware/target/arm/tcc780x/ata-nand-tcc780x.c b/firmware/target/arm/tcc780x/ata-nand-tcc780x.c
index b47444f3a8..4cf55c0c3c 100644
--- a/firmware/target/arm/tcc780x/ata-nand-tcc780x.c
+++ b/firmware/target/arm/tcc780x/ata-nand-tcc780x.c
@@ -39,9 +39,6 @@ long last_disk_activity = -1;
39/** static, private data **/ 39/** static, private data **/
40static bool initialized = false; 40static bool initialized = false;
41 41
42static long next_yield = 0;
43#define MIN_YIELD_PERIOD 2000
44
45static struct mutex ata_mtx SHAREDBSS_ATTR; 42static struct mutex ata_mtx SHAREDBSS_ATTR;
46 43
47#define SECTOR_SIZE 512 44#define SECTOR_SIZE 512
@@ -740,7 +737,11 @@ int ata_read_sectors(IF_MV2(int drive,) unsigned long start, int incount,
740int ata_write_sectors(IF_MV2(int drive,) unsigned long start, int count, 737int ata_write_sectors(IF_MV2(int drive,) unsigned long start, int count,
741 const void* outbuf) 738 const void* outbuf)
742{ 739{
743 #warning function not implemented 740#ifdef HAVE_MULTIVOLUME
741 (void)drive; /* unused for now */
742#endif
743
744 /* TODO: Learn more about TNFTL and implement this one day... */
744 (void)start; 745 (void)start;
745 (void)count; 746 (void)count;
746 (void)outbuf; 747 (void)outbuf;
diff --git a/firmware/target/arm/tcc780x/crt0.S b/firmware/target/arm/tcc780x/crt0.S
index d328291a26..af5bd44192 100644
--- a/firmware/target/arm/tcc780x/crt0.S
+++ b/firmware/target/arm/tcc780x/crt0.S
@@ -35,18 +35,16 @@
35 35
36start: 36start:
37#ifdef TCCBOOT 37#ifdef TCCBOOT
38#ifdef BOOTLOADER
38 /* Add -DTCCBOOT to EXTRA_DEFINES in the bootloader Makefile to 39 /* Add -DTCCBOOT to EXTRA_DEFINES in the bootloader Makefile to
39 enable building the bootloader to be appended to the end of the 40 enable building the bootloader to be appended to the end of the
40 original firmware, dual-booting based on a key-press. 41 original firmware, dual-booting based on a key-press.
41 42
42 NB: On the D2 TCCBOOT currently only works in USB boot mode (via tcctool)
43 When flashed to the device, the OF will boot as normal - but holding a
44 key to boot Rockbox results in a blank screen and crashed player.
45
46 The following two values are filled in by mktccboot. 43 The following two values are filled in by mktccboot.
47 */ 44 */
48 .word 0 /* Saved entrypoint of original firmware*/ 45 .word 0 /* Saved entrypoint of original firmware*/
49 .word 0 /* Location in RAM of the start of our bootloader */ 46 .word 0 /* Location in RAM of the start of our bootloader */
47#endif
50#else 48#else
51 ldr pc, =start_loc /* jump to the main entry point */ 49 ldr pc, =start_loc /* jump to the main entry point */
52 50
@@ -79,7 +77,7 @@ start_loc:
79 #error No bootup key detection implemented for this target 77 #error No bootup key detection implemented for this target
80#endif 78#endif
81 79
82 /* Copy bootloader to safe area - 0x21000000 (DRAM) */ 80 /* Copy bootloader to safe area - 0x21F00000 (end of DRAM) */
83 /* TODO: Adjust this for other targets - DRAM + DRAMSIZE - 0x100000 */ 81 /* TODO: Adjust this for other targets - DRAM + DRAMSIZE - 0x100000 */
84 ldr r0, [pc, #-28] 82 ldr r0, [pc, #-28]
85 mov r1, #0x22000000 83 mov r1, #0x22000000