summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJörg Hohensohn <hohensoh@rockbox.org>2004-11-19 23:04:40 +0000
committerJörg Hohensohn <hohensoh@rockbox.org>2004-11-19 23:04:40 +0000
commit0044a04c22b65b4ac9e9f6e941c2296ce2f7a2e8 (patch)
treecae9032df93f6d37ee868d4d9edfe04ab0690d46
parent50d363f32f7ff121bfbea8f0f024880605803f3f (diff)
downloadrockbox-0044a04c22b65b4ac9e9f6e941c2296ce2f7a2e8.tar.gz
rockbox-0044a04c22b65b4ac9e9f6e941c2296ce2f7a2e8.zip
the -t test option now does no memory test, but enables 38400 baud on players
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5441 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--flash/uart_boot/uart_boot.c120
1 files changed, 10 insertions, 110 deletions
diff --git a/flash/uart_boot/uart_boot.c b/flash/uart_boot/uart_boot.c
index 914937305c..f2047d8987 100644
--- a/flash/uart_boot/uart_boot.c
+++ b/flash/uart_boot/uart_boot.c
@@ -173,7 +173,13 @@ int main(int argc, char* argv[])
if (gCmd.bNoDownload)
{ // just set our speed
- if (!UartConfig(serial_handle, gCmd.bRecorder ? 115200 : 38400, eNOPARITY, eONESTOPBIT, 8))
+ int baudrate = gCmd.bRecorder ? 115200 : 14400;
+ if (!gCmd.bRecorder && gCmd.bTest)
+ { // experimental Player speedup to 38400 baud
+ baudrate = 38400;
+ }
+
+ if (!UartConfig(serial_handle, baudrate, eNOPARITY, eONESTOPBIT, 8))
{
printf("Error setting up COM params\n");
exit(1);
@@ -198,9 +204,9 @@ int main(int argc, char* argv[])
{ // we can be faster
SetTargetBaudrate(serial_handle, 11059200, 115200); // set to 115200
}
- else
- {
- SetTargetBaudrate(serial_handle, 12000000, 38400); // set to 38400
+ else if (gCmd.bTest) // experimental Player speedup to 38400 baud
+ {
+ SetTargetBaudrate(serial_handle, 12000000, 38400); // set to 38400
}
}
}
@@ -345,112 +351,6 @@ int main(int argc, char* argv[])
}
- if (gCmd.bTest) // DRAM test
- {
- static UINT8 abRam[2*1024*1024]; // DRAM copy, not on stack
- int i;
- int fails;
-
- // init the DRAM controller like the flash boot does
- reg = ReadHalfword(serial_handle, 0x05FFFFCA); // PACR2
- reg &= 0xFFFB; // PA1 config: /RAS
- reg |= 0x0008;
- WriteHalfword(serial_handle, 0x05FFFFCA, reg); // PACR2
- reg = 0xAFFF; // CS1, CS3 config: /CASH. /CASL
- WriteHalfword(serial_handle, 0x05FFFFEE, reg); // CASCR
- reg = ReadHalfword(serial_handle, 0x05FFFFA0); // BCR
- reg |= 0x8000; // DRAM enable, default bus
- WriteHalfword(serial_handle, 0x05FFFFA0, reg); // BCR
- reg = ReadHalfword(serial_handle, 0x05FFFFA2); // WCR1
- reg &= 0xFDFD; // 1-cycle CAS
- WriteHalfword(serial_handle, 0x05FFFFA2, reg); // WCR1
- reg = 0x0E00; // CAS 35%, multiplexed, 10 bit row addr.
- WriteHalfword(serial_handle, 0x05FFFFA8, reg); // DCR
- reg = 0x5AB0; // refresh, 4 cycle waitstate
- WriteHalfword(serial_handle, 0x05FFFFAC, reg); // RCR
- reg = 0x9605; // refresh constant
- WriteHalfword(serial_handle, 0x05FFFFB2, reg); // RTCOR
- reg = 0xA518; // phi/32
- WriteHalfword(serial_handle, 0x05FFFFAE, reg); // RTCSR
-
- fails = 0;
- memset(abRam, 0xFF, sizeof(abRam));
- printf("writing 0xFF pattern\n");
- WriteByteMultiple(serial_handle, 0x09000000, sizeof(abRam), abRam);
- printf("testing marching 0x00\n");
- for (i=0; i<sizeof(abRam); i++)
- {
- UINT8 byte;
- WriteByte(serial_handle, 0x09000000 + i, 0x00);
- byte = ReadByte(serial_handle, 0x09000000 + i);
- WriteByte(serial_handle, 0x09000000 + i, 0xFF);
-
- if (byte != 0x00)
- {
- printf("RAM at offset 0x%06X is 0x%02X instead of 0x%02X\n", i, byte, 0x00);
- fails++;
- }
-
- }
- printf("%d failures\n", fails);
-
- fails = 0;
- memset(abRam, 0x00, sizeof(abRam));
- printf("writing 0x00 pattern\n");
- WriteByteMultiple(serial_handle, 0x09000000, sizeof(abRam), abRam);
- printf("testing marching 0xFF\n");
- for (i=0; i<sizeof(abRam); i++)
- {
- UINT8 byte;
- WriteByte(serial_handle, 0x09000000 + i, 0xFF);
- byte = ReadByte(serial_handle, 0x09000000 + i);
- WriteByte(serial_handle, 0x09000000 + i, 0x00);
-
- if (byte != 0xFF)
- {
- printf("RAM at offset 0x%06X is 0x%02X instead of 0x%02X\n", i, byte, 0xFF);
- fails++;
- }
-
- }
- printf("%d failures\n", fails);
-
- fails = 0;
- memset(abRam, 0xAA, sizeof(abRam));
- printf("writing 0xAA pattern\n");
- WriteByteMultiple(serial_handle, 0x09000000, sizeof(abRam), abRam);
- printf("reading back\n");
- ReadByteMultiple(serial_handle, 0x09000000, sizeof(abRam), abRam);
- for (i=0; i<sizeof(abRam); i++)
- {
- if (abRam[i] != 0xAA)
- {
- printf("RAM at offset 0x%06X is 0x%02X instead of 0x%02X\n", i, abRam[i], 0xAA);
- fails++;
- }
-
- }
- printf("%d failures\n", fails);
-
- fails = 0;
- memset(abRam, 0x55, sizeof(abRam));
- printf("writing 0x55 pattern\n");
- WriteByteMultiple(serial_handle, 0x09000000, sizeof(abRam), abRam);
- printf("reading back\n");
- ReadByteMultiple(serial_handle, 0x09000000, sizeof(abRam), abRam);
- for (i=0; i<sizeof(abRam); i++)
- {
- if (abRam[i] != 0x55)
- {
- printf("RAM at offset 0x%06X is 0x%02X instead of 0x%02X\n", i, abRam[i], 0x55);
- fails++;
- }
-
- }
- printf("%d failures\n", fails);
- }
-
-
if (gCmd.bBlink)
{
// blinking LED