diff options
author | Dave Chapman <dave@dchapman.com> | 2007-02-23 23:22:03 +0000 |
---|---|---|
committer | Dave Chapman <dave@dchapman.com> | 2007-02-23 23:22:03 +0000 |
commit | fda1498696258d91d950ca4260daa76e536dcce0 (patch) | |
tree | 4cc50527b5a79bd69427a8ba3e25dfc4587685f5 | |
parent | 87865a52278d71333011794b09ad3791ca20a791 (diff) | |
download | rockbox-fda1498696258d91d950ca4260daa76e536dcce0.tar.gz rockbox-fda1498696258d91d950ca4260daa76e536dcce0.zip |
Remap flash ROM to 0x20000000 on the ipods and H10s, and implement dbg_save_roms() in the debug menu for those targets to dump the content to a file.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12467 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/debug_menu.c | 21 | ||||
-rw-r--r-- | firmware/export/config-h10.h | 3 | ||||
-rw-r--r-- | firmware/export/config-h10_5gb.h | 3 | ||||
-rw-r--r-- | firmware/export/config-ipod3g.h | 3 | ||||
-rw-r--r-- | firmware/export/config-ipod4g.h | 3 | ||||
-rw-r--r-- | firmware/export/config-ipodcolor.h | 3 | ||||
-rw-r--r-- | firmware/export/config-ipodmini.h | 3 | ||||
-rw-r--r-- | firmware/export/config-ipodmini2g.h | 3 | ||||
-rw-r--r-- | firmware/export/config-ipodnano.h | 3 | ||||
-rw-r--r-- | firmware/export/config-ipodvideo.h | 3 | ||||
-rw-r--r-- | firmware/export/pp5002.h | 9 | ||||
-rw-r--r-- | firmware/export/pp5020.h | 9 | ||||
-rw-r--r-- | firmware/system.c | 8 |
13 files changed, 73 insertions, 1 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index a27ea50fad..e25abca454 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c | |||
@@ -1983,6 +1983,24 @@ static bool dbg_save_roms(void) | |||
1983 | 1983 | ||
1984 | return false; | 1984 | return false; |
1985 | } | 1985 | } |
1986 | #elif defined(IPOD_ARCH) || defined(IRIVER_H10) || defined(IRIVER_H10_5GB) | ||
1987 | static bool dbg_save_roms(void) | ||
1988 | { | ||
1989 | int fd; | ||
1990 | |||
1991 | #if defined(IPOD_ARCH) | ||
1992 | fd = creat("/internal_rom_000000-0FFFFF.bin"); | ||
1993 | #elif defined(IRIVER_H10) | ||
1994 | fd = creat("/internal_rom_000000-3FFFFF.bin"); | ||
1995 | #endif | ||
1996 | if(fd >= 0) | ||
1997 | { | ||
1998 | write(fd, (void *)0x20000000, FLASH_SIZE); | ||
1999 | close(fd); | ||
2000 | } | ||
2001 | |||
2002 | return false; | ||
2003 | } | ||
1986 | #endif /* CPU */ | 2004 | #endif /* CPU */ |
1987 | 2005 | ||
1988 | #ifndef SIMULATOR | 2006 | #ifndef SIMULATOR |
@@ -2305,7 +2323,8 @@ bool debug_menu(void) | |||
2305 | { "Button Light modes", dbg_buttonlights }, | 2323 | { "Button Light modes", dbg_buttonlights }, |
2306 | 2324 | ||
2307 | #endif | 2325 | #endif |
2308 | #if CONFIG_CPU == SH7034 || defined(CPU_COLDFIRE) | 2326 | #if CONFIG_CPU == SH7034 || defined(CPU_COLDFIRE) || \ |
2327 | defined(IPOD_ARCH) || defined(IRIVER_H10) || defined(IRIVER_H10_5GB) | ||
2309 | { "Dump ROM contents", dbg_save_roms }, | 2328 | { "Dump ROM contents", dbg_save_roms }, |
2310 | #endif | 2329 | #endif |
2311 | #if CONFIG_CPU == SH7034 || defined(CPU_COLDFIRE) || defined(CPU_PP) | 2330 | #if CONFIG_CPU == SH7034 || defined(CPU_COLDFIRE) || defined(CPU_PP) |
diff --git a/firmware/export/config-h10.h b/firmware/export/config-h10.h index 94de2167ff..08497ad52d 100644 --- a/firmware/export/config-h10.h +++ b/firmware/export/config-h10.h | |||
@@ -107,6 +107,9 @@ | |||
107 | /* The start address index for ROM builds */ | 107 | /* The start address index for ROM builds */ |
108 | #define ROM_START 0x00000000 | 108 | #define ROM_START 0x00000000 |
109 | 109 | ||
110 | /* The size of the flash ROM */ | ||
111 | #define FLASH_SIZE 0x100000 | ||
112 | |||
110 | /* Define this to the CPU frequency */ | 113 | /* Define this to the CPU frequency */ |
111 | #define CPU_FREQ 75000000 | 114 | #define CPU_FREQ 75000000 |
112 | 115 | ||
diff --git a/firmware/export/config-h10_5gb.h b/firmware/export/config-h10_5gb.h index 2053cc53f0..9fd3edfdb6 100644 --- a/firmware/export/config-h10_5gb.h +++ b/firmware/export/config-h10_5gb.h | |||
@@ -101,6 +101,9 @@ | |||
101 | /* The start address index for ROM builds */ | 101 | /* The start address index for ROM builds */ |
102 | #define ROM_START 0x00000000 | 102 | #define ROM_START 0x00000000 |
103 | 103 | ||
104 | /* The size of the flash ROM */ | ||
105 | #define FLASH_SIZE 0x100000 | ||
106 | |||
104 | /* Define this to the CPU frequency */ | 107 | /* Define this to the CPU frequency */ |
105 | /* TODO: this is probably wrong */ | 108 | /* TODO: this is probably wrong */ |
106 | #define CPU_FREQ 75000000 | 109 | #define CPU_FREQ 75000000 |
diff --git a/firmware/export/config-ipod3g.h b/firmware/export/config-ipod3g.h index 0b13a52dcd..b893e5c30c 100644 --- a/firmware/export/config-ipod3g.h +++ b/firmware/export/config-ipod3g.h | |||
@@ -95,6 +95,9 @@ | |||
95 | /* The start address index for ROM builds */ | 95 | /* The start address index for ROM builds */ |
96 | #define ROM_START 0x00000000 | 96 | #define ROM_START 0x00000000 |
97 | 97 | ||
98 | /* The size of the flash ROM */ | ||
99 | #define FLASH_SIZE 0x100000 | ||
100 | |||
98 | /* Define this to the CPU frequency */ | 101 | /* Define this to the CPU frequency */ |
99 | #define CPU_FREQ 11289600 | 102 | #define CPU_FREQ 11289600 |
100 | 103 | ||
diff --git a/firmware/export/config-ipod4g.h b/firmware/export/config-ipod4g.h index 8a70ca0f56..504de0f471 100644 --- a/firmware/export/config-ipod4g.h +++ b/firmware/export/config-ipod4g.h | |||
@@ -101,6 +101,9 @@ | |||
101 | /* The start address index for ROM builds */ | 101 | /* The start address index for ROM builds */ |
102 | #define ROM_START 0x00000000 | 102 | #define ROM_START 0x00000000 |
103 | 103 | ||
104 | /* The size of the flash ROM */ | ||
105 | #define FLASH_SIZE 0x100000 | ||
106 | |||
104 | /* Define this to the CPU frequency */ | 107 | /* Define this to the CPU frequency */ |
105 | #define CPU_FREQ 11289600 | 108 | #define CPU_FREQ 11289600 |
106 | 109 | ||
diff --git a/firmware/export/config-ipodcolor.h b/firmware/export/config-ipodcolor.h index 6b338f462e..97b4301ce6 100644 --- a/firmware/export/config-ipodcolor.h +++ b/firmware/export/config-ipodcolor.h | |||
@@ -92,6 +92,9 @@ | |||
92 | /* The start address index for ROM builds */ | 92 | /* The start address index for ROM builds */ |
93 | #define ROM_START 0x00000000 | 93 | #define ROM_START 0x00000000 |
94 | 94 | ||
95 | /* The size of the flash ROM */ | ||
96 | #define FLASH_SIZE 0x100000 | ||
97 | |||
95 | /* Define this to the CPU frequency */ | 98 | /* Define this to the CPU frequency */ |
96 | #define CPU_FREQ 11289600 | 99 | #define CPU_FREQ 11289600 |
97 | 100 | ||
diff --git a/firmware/export/config-ipodmini.h b/firmware/export/config-ipodmini.h index 6fa31d9e19..687c55e3b0 100644 --- a/firmware/export/config-ipodmini.h +++ b/firmware/export/config-ipodmini.h | |||
@@ -95,6 +95,9 @@ | |||
95 | /* The start address index for ROM builds */ | 95 | /* The start address index for ROM builds */ |
96 | #define ROM_START 0x00000000 | 96 | #define ROM_START 0x00000000 |
97 | 97 | ||
98 | /* The size of the flash ROM */ | ||
99 | #define FLASH_SIZE 0x100000 | ||
100 | |||
98 | /* Define this to the CPU frequency */ | 101 | /* Define this to the CPU frequency */ |
99 | #define CPU_FREQ 11289600 | 102 | #define CPU_FREQ 11289600 |
100 | 103 | ||
diff --git a/firmware/export/config-ipodmini2g.h b/firmware/export/config-ipodmini2g.h index e9e5ff01b8..105d1d78ed 100644 --- a/firmware/export/config-ipodmini2g.h +++ b/firmware/export/config-ipodmini2g.h | |||
@@ -98,6 +98,9 @@ | |||
98 | /* The start address index for ROM builds */ | 98 | /* The start address index for ROM builds */ |
99 | #define ROM_START 0x00000000 | 99 | #define ROM_START 0x00000000 |
100 | 100 | ||
101 | /* The size of the flash ROM */ | ||
102 | #define FLASH_SIZE 0x100000 | ||
103 | |||
101 | /* Define this to the CPU frequency */ | 104 | /* Define this to the CPU frequency */ |
102 | #define CPU_FREQ 11289600 | 105 | #define CPU_FREQ 11289600 |
103 | 106 | ||
diff --git a/firmware/export/config-ipodnano.h b/firmware/export/config-ipodnano.h index fa12d12746..52bdbe2890 100644 --- a/firmware/export/config-ipodnano.h +++ b/firmware/export/config-ipodnano.h | |||
@@ -97,6 +97,9 @@ | |||
97 | /* The start address index for ROM builds */ | 97 | /* The start address index for ROM builds */ |
98 | #define ROM_START 0x00000000 | 98 | #define ROM_START 0x00000000 |
99 | 99 | ||
100 | /* The size of the flash ROM */ | ||
101 | #define FLASH_SIZE 0x100000 | ||
102 | |||
100 | /* Define this to the CPU frequency */ | 103 | /* Define this to the CPU frequency */ |
101 | #define CPU_FREQ 24000000 | 104 | #define CPU_FREQ 24000000 |
102 | 105 | ||
diff --git a/firmware/export/config-ipodvideo.h b/firmware/export/config-ipodvideo.h index a77ca5ef45..6f68f1e756 100644 --- a/firmware/export/config-ipodvideo.h +++ b/firmware/export/config-ipodvideo.h | |||
@@ -97,6 +97,9 @@ | |||
97 | /* The start address index for ROM builds */ | 97 | /* The start address index for ROM builds */ |
98 | #define ROM_START 0x00000000 | 98 | #define ROM_START 0x00000000 |
99 | 99 | ||
100 | /* The size of the flash ROM */ | ||
101 | #define FLASH_SIZE 0x100000 | ||
102 | |||
100 | /* Define this to the CPU frequency */ | 103 | /* Define this to the CPU frequency */ |
101 | #define CPU_FREQ 11289600 | 104 | #define CPU_FREQ 11289600 |
102 | 105 | ||
diff --git a/firmware/export/pp5002.h b/firmware/export/pp5002.h index 52de8c4cca..ef131fe6d6 100644 --- a/firmware/export/pp5002.h +++ b/firmware/export/pp5002.h | |||
@@ -113,6 +113,15 @@ | |||
113 | #define SER1_MASK (1 << SER1_IRQ) | 113 | #define SER1_MASK (1 << SER1_IRQ) |
114 | #define DMA_OUT_MASK (1 << DMA_OUT_IRQ) | 114 | #define DMA_OUT_MASK (1 << DMA_OUT_IRQ) |
115 | 115 | ||
116 | #define MMAP0_LOGICAL (*(volatile unsigned long*)(0xf000f000)) | ||
117 | #define MMAP0_PHYSICAL (*(volatile unsigned long*)(0xf000f004)) | ||
118 | #define MMAP1_LOGICAL (*(volatile unsigned long*)(0xf000f008)) | ||
119 | #define MMAP1_PHYSICAL (*(volatile unsigned long*)(0xf000f00c)) | ||
120 | #define MMAP2_LOGICAL (*(volatile unsigned long*)(0xf000f010)) | ||
121 | #define MMAP2_PHYSICAL (*(volatile unsigned long*)(0xf000f014)) | ||
122 | #define MMAP3_LOGICAL (*(volatile unsigned long*)(0xf000f018)) | ||
123 | #define MMAP3_PHYSICAL (*(volatile unsigned long*)(0xf000f01c)) | ||
124 | |||
116 | /* The PortalPlayer USB controller uses base address 0xc5000000 */ | 125 | /* The PortalPlayer USB controller uses base address 0xc5000000 */ |
117 | #define USB_BASE 0xc5000000 | 126 | #define USB_BASE 0xc5000000 |
118 | 127 | ||
diff --git a/firmware/export/pp5020.h b/firmware/export/pp5020.h index d30489526a..60d14491e0 100644 --- a/firmware/export/pp5020.h +++ b/firmware/export/pp5020.h | |||
@@ -174,6 +174,15 @@ | |||
174 | #define IISFIFO_WR (*(volatile unsigned long*)(0x70002840)) | 174 | #define IISFIFO_WR (*(volatile unsigned long*)(0x70002840)) |
175 | #define IISFIFO_RD (*(volatile unsigned long*)(0x70002880)) | 175 | #define IISFIFO_RD (*(volatile unsigned long*)(0x70002880)) |
176 | 176 | ||
177 | #define MMAP0_LOGICAL (*(volatile unsigned long*)(0xf000f000)) | ||
178 | #define MMAP0_PHYSICAL (*(volatile unsigned long*)(0xf000f004)) | ||
179 | #define MMAP1_LOGICAL (*(volatile unsigned long*)(0xf000f008)) | ||
180 | #define MMAP1_PHYSICAL (*(volatile unsigned long*)(0xf000f00c)) | ||
181 | #define MMAP2_LOGICAL (*(volatile unsigned long*)(0xf000f010)) | ||
182 | #define MMAP2_PHYSICAL (*(volatile unsigned long*)(0xf000f014)) | ||
183 | #define MMAP3_LOGICAL (*(volatile unsigned long*)(0xf000f018)) | ||
184 | #define MMAP3_PHYSICAL (*(volatile unsigned long*)(0xf000f01c)) | ||
185 | |||
177 | /* The PortalPlayer USB controller uses base address 0xc5000000 */ | 186 | /* The PortalPlayer USB controller uses base address 0xc5000000 */ |
178 | #define USB_BASE 0xc5000000 | 187 | #define USB_BASE 0xc5000000 |
179 | 188 | ||
diff --git a/firmware/system.c b/firmware/system.c index 49f01df0cd..463eec5053 100644 --- a/firmware/system.c +++ b/firmware/system.c | |||
@@ -754,6 +754,10 @@ void ipod_set_cpu_frequency(void) | |||
754 | void system_init(void) | 754 | void system_init(void) |
755 | { | 755 | { |
756 | #ifndef BOOTLOADER | 756 | #ifndef BOOTLOADER |
757 | /* Remap the flash ROM from 0x00000000 to 0x20000000. */ | ||
758 | MMAP3_LOGICAL = 0x20000000 | 0x3a00; | ||
759 | MMAP3_PHYSICAL = 0x00000000 | 0x3f84; | ||
760 | |||
757 | /* The hw revision is written to the last 4 bytes of SDRAM by the | 761 | /* The hw revision is written to the last 4 bytes of SDRAM by the |
758 | bootloader - we save it before Rockbox overwrites it. */ | 762 | bootloader - we save it before Rockbox overwrites it. */ |
759 | ipod_hw_rev = (*((volatile unsigned long*)(0x01fffffc))); | 763 | ipod_hw_rev = (*((volatile unsigned long*)(0x01fffffc))); |
@@ -897,6 +901,10 @@ static void ipod_set_cpu_speed(void) | |||
897 | void system_init(void) | 901 | void system_init(void) |
898 | { | 902 | { |
899 | #ifndef BOOTLOADER | 903 | #ifndef BOOTLOADER |
904 | /* Remap the flash ROM from 0x00000000 to 0x20000000. */ | ||
905 | MMAP3_LOGICAL = 0x20000000 | 0x3a00; | ||
906 | MMAP3_PHYSICAL = 0x00000000 | 0x3f84; | ||
907 | |||
900 | ipod_hw_rev = (*((volatile unsigned long*)(0x01fffffc))); | 908 | ipod_hw_rev = (*((volatile unsigned long*)(0x01fffffc))); |
901 | outl(-1, 0xcf00101c); | 909 | outl(-1, 0xcf00101c); |
902 | outl(-1, 0xcf001028); | 910 | outl(-1, 0xcf001028); |