r1766
dslinux_amadeus at dslinux.in-berlin.de
dslinux_amadeus at dslinux.in-berlin.de
Mon May 21 22:10:50 CEST 2007
Author: amadeus
Date: 2007-05-21 22:10:45 +0200 (Mon, 21 May 2007)
New Revision: 1766
Log:
try to detect EZ5 3in1 and EZ4
Modified: trunk/linux-2.6.x/arch/arm/mach-nds/gbaram.c
===================================================================
--- trunk/linux-2.6.x/arch/arm/mach-nds/gbaram.c 2007-05-21 04:30:54 UTC (rev 1765)
+++ trunk/linux-2.6.x/arch/arm/mach-nds/gbaram.c 2007-05-21 20:10:45 UTC (rev 1766)
@@ -315,18 +315,30 @@
{
u32 len;
- // switch to OS mode
+ // EZ4:switch to OS mode
ez_SetRompage(0x8000);
// enable writing
ez_OpenNorWrite();
- // first step: below 0x08400000, there must be no RAM
- if (gba_testram(0x08000000, 256))
- return 0;
- // second: at 0x08400000, there must be RAM
- if (!gba_testram(0x08400000, 256))
- return 0;
- // test for end address (129MB PSRAM or only 64 MB?)
+ // detect PSRAM starting at 0x08400000
+ if (!gba_testram(0x08000000, 256) && gba_testram(0x08400000, 256))
+ goto ez_ok;
+
+ // EZ5 3in1 has no OS mode
+ ez_CloseNorWrite();
+ // EZ5:switch PSRAM start to 0x08400000
+ ez_SetRompage(352);
+ // enable writing
+ ez_OpenNorWrite();
+
+ // detect PSRAM starting at 0x08400000
+ if (!gba_testram(0x08000000, 256) && gba_testram(0x08400000, 256))
+ goto ez_ok;
+
+ // nothing found
+ return 0;
+
+ez_ok: // test for end address (129MB PSRAM or only 64 MB?)
len = 0x00800000;
if (gba_testram(0x08400000+len, 256))
len = 0x01000000;
More information about the dslinux-commit
mailing list