r1762
dslinux_amadeus at dslinux.in-berlin.de
dslinux_amadeus at dslinux.in-berlin.de
Mon May 14 19:42:18 CEST 2007
Author: amadeus
Date: 2007-05-14 19:42:12 +0200 (Mon, 14 May 2007)
New Revision: 1762
Log:
Try to improve EZ4 RAM detection
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-13 16:30:27 UTC (rev 1761)
+++ trunk/linux-2.6.x/arch/arm/mach-nds/gbaram.c 2007-05-14 17:42:12 UTC (rev 1762)
@@ -167,11 +167,43 @@
writew(0x1500, 0x9fc0000);
}
+/* This is from the EZ-4 driver.
+ Obviously, this is the combination of
+ OpenNorWrite() and NandControl(1).
+*/
+static inline void ez_SD_Enable(void)
+{
+ writew(0xd200, 0x9fe0000);
+ writew(0x1500, 0x8000000);
+ writew(0xd200, 0x8020000);
+ writew(0x1500, 0x8040000);
+ writew(0x0001, 0x9400000);
+ writew(0x1500, 0x9C40000);
+ writew(0x1500, 0x9fc0000);
+}
+
+/* This is from the EZ-4 driver.
+ Obviously, this is the combination of
+ CloseNorWrite() and NandControl(0).
+*/
+static inline void ez_SD_Disable(void)
+{
+ writew(0xd200, 0x9fe0000);
+ writew(0x1500, 0x8000000);
+ writew(0xd200, 0x8020000);
+ writew(0x1500, 0x8040000);
+ writew(0x0000, 0x9400000);
+ writew(0xd200, 0x9C40000);
+ writew(0x1500, 0x9fc0000);
+}
+
/* Set the mode of EZ to I/O */
static void ez_set_io(void)
{
ez_OpenNorWrite();
ez_SetNandControl(1);
+ /* again for EZ-4 */
+ ez_SD_Enable();
}
/* Set the mode of EZ to PSRAM */
@@ -179,6 +211,8 @@
{
ez_CloseNorWrite();
ez_SetNandControl(0);
+ /* again for EZ-4 */
+ ez_SD_Disable();
/* Map EZ PSRAM at 0x08400000. This is the "natural" address of the EZ.
All IO addresses are outside this area. */
ez_SetRompage(352);
@@ -288,7 +322,7 @@
int gba_activate_ram(void)
{
/* Disable RAM extensions which are R/W at startup time */
- ez_CloseNorWrite();
+ ez_set_io();
/* test supercard CF/SD */
if (gba_testcard(sc_set_ram, sc_set_io, 0x08000000, 0x02000000)) goto activated;
More information about the dslinux-commit
mailing list