r1915 - trunk/src/target/u-boot/patches
laforge at sita.openmoko.org
laforge at sita.openmoko.org
Sun May 6 11:25:28 CEST 2007
Author: laforge
Date: 2007-05-06 11:25:24 +0200 (Sun, 06 May 2007)
New Revision: 1915
Modified:
trunk/src/target/u-boot/patches/uboot-s3c2440.patch
Log:
* Fix S3C2440 support in the MMC/SD driver
* This also fixes 2410 SD card support problems (http://bugzilla.openmoko.org/cgi-bin/bugzilla/show_bug.cgi?id=164) caused by MMC style clocking rather than SD style clocking
Modified: trunk/src/target/u-boot/patches/uboot-s3c2440.patch
===================================================================
--- trunk/src/target/u-boot/patches/uboot-s3c2440.patch 2007-05-05 23:51:17 UTC (rev 1914)
+++ trunk/src/target/u-boot/patches/uboot-s3c2440.patch 2007-05-06 09:25:24 UTC (rev 1915)
@@ -147,6 +147,20 @@
} /*__attribute__((__packed__))*/ S3C24X0_GPIO;
+@@ -637,8 +711,13 @@
+ S3C24X0_REG32 SDIDCNT;
+ S3C24X0_REG32 SDIDSTA;
+ S3C24X0_REG32 SDIFSTA;
++#if defined(CONFIG_S3C2410)
+ S3C24X0_REG32 SDIDAT;
+ S3C24X0_REG32 SDIIMSK;
++#elif defined(CONFIG_S3C2440)
++ S3C24X0_REG32 SDIIMSK;
++ S3C24X0_REG32 SDIDAT;
++#endif
+ } /*__attribute__((__packed__))*/ S3C2410_SDI;
+
+
Index: u-boot/rtc/s3c24x0_rtc.c
===================================================================
--- u-boot.orig/rtc/s3c24x0_rtc.c
@@ -1229,3 +1243,39 @@
+ #error "U-Boot legacy NAND support not available for S3C24xx"
#endif
#endif
+Index: u-boot/cpu/arm920t/s3c24x0/mmc.c
+===================================================================
+--- u-boot.orig/cpu/arm920t/s3c24x0/mmc.c
++++ u-boot/cpu/arm920t/s3c24x0/mmc.c
+@@ -137,6 +137,9 @@
+ dcon |= S3C2410_SDIDCON_RXAFTERCMD|S3C2410_SDIDCON_XFER_RXSTART;
+ if (wide)
+ dcon |= S3C2410_SDIDCON_WIDEBUS;
++#if defined(CONFIG_S3C2440)
++ dcon |= S3C2440_SDIDCON_DS_WORD | S3C2440_SDIDCON_DATSTART;
++#endif
+ sdi->SDIDCON = dcon;
+
+ /* send read command */
+@@ -394,13 +397,18 @@
+
+ clk_power->CLKCON |= (1 << 9);
+
++ sdi->SDIBSIZE = 512;
++#if defined(CONFIG_S3C2410)
+ /* S3C2410 has some bug that prevents reliable operation at higher speed */
+ //sdi->SDIPRE = 0x3e; /* SDCLK = PCLK/2 / (SDIPRE+1) = 396kHz */
+- sdi->SDIPRE = 0x02; /* SDCLK = PCLK/2 / (SDIPRE+1) = 396kHz */
+- sdi->SDIBSIZE = 512;
++ sdi->SDIPRE = 0x02; /* 2410: SDCLK = PCLK/2 / (SDIPRE+1) = 11MHz */
+ sdi->SDIDTIMER = 0xffff;
++#elif defined(CONFIG_S3C2440)
++ sdi->SDIPRE = 0x05; /* 2410: SDCLK = PCLK / (SDIPRE+1) = 11MHz */
++ sdi->SDIDTIMER = 0x7fffff;
++#endif
+ sdi->SDIIMSK = 0x0;
+- sdi->SDICON = S3C2410_SDICON_FIFORESET|S3C2440_SDICON_MMCCLOCK;
++ sdi->SDICON = S3C2410_SDICON_FIFORESET|S3C2410_SDICON_CLOCKTYPE;
+ udelay(125000); /* FIXME: 74 SDCLK cycles */
+
+ mmc_csd.c_size = 0;
More information about the commitlog
mailing list