summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2007-02-23 23:22:03 +0000
committerDave Chapman <dave@dchapman.com>2007-02-23 23:22:03 +0000
commitfda1498696258d91d950ca4260daa76e536dcce0 (patch)
tree4cc50527b5a79bd69427a8ba3e25dfc4587685f5
parent87865a52278d71333011794b09ad3791ca20a791 (diff)
downloadrockbox-fda1498696258d91d950ca4260daa76e536dcce0.zip
rockbox-fda1498696258d91d950ca4260daa76e536dcce0.tar.gz
rockbox-fda1498696258d91d950ca4260daa76e536dcce0.tar.bz2
rockbox-fda1498696258d91d950ca4260daa76e536dcce0.tar.xz
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.c21
-rw-r--r--firmware/export/config-h10.h3
-rw-r--r--firmware/export/config-h10_5gb.h3
-rw-r--r--firmware/export/config-ipod3g.h3
-rw-r--r--firmware/export/config-ipod4g.h3
-rw-r--r--firmware/export/config-ipodcolor.h3
-rw-r--r--firmware/export/config-ipodmini.h3
-rw-r--r--firmware/export/config-ipodmini2g.h3
-rw-r--r--firmware/export/config-ipodnano.h3
-rw-r--r--firmware/export/config-ipodvideo.h3
-rw-r--r--firmware/export/pp5002.h9
-rw-r--r--firmware/export/pp5020.h9
-rw-r--r--firmware/system.c8
13 files changed, 73 insertions, 1 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index a27ea50..e25abca 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -1983,6 +1983,24 @@ static bool dbg_save_roms(void)
return false;
}
+#elif defined(IPOD_ARCH) || defined(IRIVER_H10) || defined(IRIVER_H10_5GB)
+static bool dbg_save_roms(void)
+{
+ int fd;
+
+#if defined(IPOD_ARCH)
+ fd = creat("/internal_rom_000000-0FFFFF.bin");
+#elif defined(IRIVER_H10)
+ fd = creat("/internal_rom_000000-3FFFFF.bin");
+#endif
+ if(fd >= 0)
+ {
+ write(fd, (void *)0x20000000, FLASH_SIZE);
+ close(fd);
+ }
+
+ return false;
+}
#endif /* CPU */
#ifndef SIMULATOR
@@ -2305,7 +2323,8 @@ bool debug_menu(void)
{ "Button Light modes", dbg_buttonlights },
#endif
-#if CONFIG_CPU == SH7034 || defined(CPU_COLDFIRE)
+#if CONFIG_CPU == SH7034 || defined(CPU_COLDFIRE) || \
+ defined(IPOD_ARCH) || defined(IRIVER_H10) || defined(IRIVER_H10_5GB)
{ "Dump ROM contents", dbg_save_roms },
#endif
#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 94de216..08497ad 100644
--- a/firmware/export/config-h10.h
+++ b/firmware/export/config-h10.h
@@ -107,6 +107,9 @@
/* The start address index for ROM builds */
#define ROM_START 0x00000000
+/* The size of the flash ROM */
+#define FLASH_SIZE 0x100000
+
/* Define this to the CPU frequency */
#define CPU_FREQ 75000000
diff --git a/firmware/export/config-h10_5gb.h b/firmware/export/config-h10_5gb.h
index 2053cc5..9fd3edf 100644
--- a/firmware/export/config-h10_5gb.h
+++ b/firmware/export/config-h10_5gb.h
@@ -101,6 +101,9 @@
/* The start address index for ROM builds */
#define ROM_START 0x00000000
+/* The size of the flash ROM */
+#define FLASH_SIZE 0x100000
+
/* Define this to the CPU frequency */
/* TODO: this is probably wrong */
#define CPU_FREQ 75000000
diff --git a/firmware/export/config-ipod3g.h b/firmware/export/config-ipod3g.h
index 0b13a52..b893e5c 100644
--- a/firmware/export/config-ipod3g.h
+++ b/firmware/export/config-ipod3g.h
@@ -95,6 +95,9 @@
/* The start address index for ROM builds */
#define ROM_START 0x00000000
+/* The size of the flash ROM */
+#define FLASH_SIZE 0x100000
+
/* Define this to the CPU frequency */
#define CPU_FREQ 11289600
diff --git a/firmware/export/config-ipod4g.h b/firmware/export/config-ipod4g.h
index 8a70ca0..504de0f 100644
--- a/firmware/export/config-ipod4g.h
+++ b/firmware/export/config-ipod4g.h
@@ -101,6 +101,9 @@
/* The start address index for ROM builds */
#define ROM_START 0x00000000
+/* The size of the flash ROM */
+#define FLASH_SIZE 0x100000
+
/* Define this to the CPU frequency */
#define CPU_FREQ 11289600
diff --git a/firmware/export/config-ipodcolor.h b/firmware/export/config-ipodcolor.h
index 6b338f4..97b4301 100644
--- a/firmware/export/config-ipodcolor.h
+++ b/firmware/export/config-ipodcolor.h
@@ -92,6 +92,9 @@
/* The start address index for ROM builds */
#define ROM_START 0x00000000
+/* The size of the flash ROM */
+#define FLASH_SIZE 0x100000
+
/* Define this to the CPU frequency */
#define CPU_FREQ 11289600
diff --git a/firmware/export/config-ipodmini.h b/firmware/export/config-ipodmini.h
index 6fa31d9..687c55e 100644
--- a/firmware/export/config-ipodmini.h
+++ b/firmware/export/config-ipodmini.h
@@ -95,6 +95,9 @@
/* The start address index for ROM builds */
#define ROM_START 0x00000000
+/* The size of the flash ROM */
+#define FLASH_SIZE 0x100000
+
/* Define this to the CPU frequency */
#define CPU_FREQ 11289600
diff --git a/firmware/export/config-ipodmini2g.h b/firmware/export/config-ipodmini2g.h
index e9e5ff0..105d1d7 100644
--- a/firmware/export/config-ipodmini2g.h
+++ b/firmware/export/config-ipodmini2g.h
@@ -98,6 +98,9 @@
/* The start address index for ROM builds */
#define ROM_START 0x00000000
+/* The size of the flash ROM */
+#define FLASH_SIZE 0x100000
+
/* Define this to the CPU frequency */
#define CPU_FREQ 11289600
diff --git a/firmware/export/config-ipodnano.h b/firmware/export/config-ipodnano.h
index fa12d12..52bdbe2 100644
--- a/firmware/export/config-ipodnano.h
+++ b/firmware/export/config-ipodnano.h
@@ -97,6 +97,9 @@
/* The start address index for ROM builds */
#define ROM_START 0x00000000
+/* The size of the flash ROM */
+#define FLASH_SIZE 0x100000
+
/* Define this to the CPU frequency */
#define CPU_FREQ 24000000
diff --git a/firmware/export/config-ipodvideo.h b/firmware/export/config-ipodvideo.h
index a77ca5e..6f68f1e 100644
--- a/firmware/export/config-ipodvideo.h
+++ b/firmware/export/config-ipodvideo.h
@@ -97,6 +97,9 @@
/* The start address index for ROM builds */
#define ROM_START 0x00000000
+/* The size of the flash ROM */
+#define FLASH_SIZE 0x100000
+
/* Define this to the CPU frequency */
#define CPU_FREQ 11289600
diff --git a/firmware/export/pp5002.h b/firmware/export/pp5002.h
index 52de8c4..ef131fe 100644
--- a/firmware/export/pp5002.h
+++ b/firmware/export/pp5002.h
@@ -113,6 +113,15 @@
#define SER1_MASK (1 << SER1_IRQ)
#define DMA_OUT_MASK (1 << DMA_OUT_IRQ)
+#define MMAP0_LOGICAL (*(volatile unsigned long*)(0xf000f000))
+#define MMAP0_PHYSICAL (*(volatile unsigned long*)(0xf000f004))
+#define MMAP1_LOGICAL (*(volatile unsigned long*)(0xf000f008))
+#define MMAP1_PHYSICAL (*(volatile unsigned long*)(0xf000f00c))
+#define MMAP2_LOGICAL (*(volatile unsigned long*)(0xf000f010))
+#define MMAP2_PHYSICAL (*(volatile unsigned long*)(0xf000f014))
+#define MMAP3_LOGICAL (*(volatile unsigned long*)(0xf000f018))
+#define MMAP3_PHYSICAL (*(volatile unsigned long*)(0xf000f01c))
+
/* The PortalPlayer USB controller uses base address 0xc5000000 */
#define USB_BASE 0xc5000000
diff --git a/firmware/export/pp5020.h b/firmware/export/pp5020.h
index d304895..60d1449 100644
--- a/firmware/export/pp5020.h
+++ b/firmware/export/pp5020.h
@@ -174,6 +174,15 @@
#define IISFIFO_WR (*(volatile unsigned long*)(0x70002840))
#define IISFIFO_RD (*(volatile unsigned long*)(0x70002880))
+#define MMAP0_LOGICAL (*(volatile unsigned long*)(0xf000f000))
+#define MMAP0_PHYSICAL (*(volatile unsigned long*)(0xf000f004))
+#define MMAP1_LOGICAL (*(volatile unsigned long*)(0xf000f008))
+#define MMAP1_PHYSICAL (*(volatile unsigned long*)(0xf000f00c))
+#define MMAP2_LOGICAL (*(volatile unsigned long*)(0xf000f010))
+#define MMAP2_PHYSICAL (*(volatile unsigned long*)(0xf000f014))
+#define MMAP3_LOGICAL (*(volatile unsigned long*)(0xf000f018))
+#define MMAP3_PHYSICAL (*(volatile unsigned long*)(0xf000f01c))
+
/* The PortalPlayer USB controller uses base address 0xc5000000 */
#define USB_BASE 0xc5000000
diff --git a/firmware/system.c b/firmware/system.c
index 49f01df..463eec5 100644
--- a/firmware/system.c
+++ b/firmware/system.c
@@ -754,6 +754,10 @@ void ipod_set_cpu_frequency(void)
void system_init(void)
{
#ifndef BOOTLOADER
+ /* Remap the flash ROM from 0x00000000 to 0x20000000. */
+ MMAP3_LOGICAL = 0x20000000 | 0x3a00;
+ MMAP3_PHYSICAL = 0x00000000 | 0x3f84;
+
/* The hw revision is written to the last 4 bytes of SDRAM by the
bootloader - we save it before Rockbox overwrites it. */
ipod_hw_rev = (*((volatile unsigned long*)(0x01fffffc)));
@@ -897,6 +901,10 @@ static void ipod_set_cpu_speed(void)
void system_init(void)
{
#ifndef BOOTLOADER
+ /* Remap the flash ROM from 0x00000000 to 0x20000000. */
+ MMAP3_LOGICAL = 0x20000000 | 0x3a00;
+ MMAP3_PHYSICAL = 0x00000000 | 0x3f84;
+
ipod_hw_rev = (*((volatile unsigned long*)(0x01fffffc)));
outl(-1, 0xcf00101c);
outl(-1, 0xcf001028);