r1760 - trunk/src/target/u-boot/patches
laforge at sita.openmoko.org
laforge at sita.openmoko.org
Sun Apr 15 08:33:37 CEST 2007
Author: laforge
Date: 2007-04-15 08:33:34 +0200 (Sun, 15 Apr 2007)
New Revision: 1760
Removed:
trunk/src/target/u-boot/patches/mmc-fixes.patch
Modified:
trunk/src/target/u-boot/patches/series
trunk/src/target/u-boot/patches/uboot-s3c2410-mmc.patch
Log:
merge mmc-fixes.patch into s3c2410-mmc.patch
Deleted: trunk/src/target/u-boot/patches/mmc-fixes.patch
===================================================================
--- trunk/src/target/u-boot/patches/mmc-fixes.patch 2007-04-14 23:26:52 UTC (rev 1759)
+++ trunk/src/target/u-boot/patches/mmc-fixes.patch 2007-04-15 06:33:34 UTC (rev 1760)
@@ -1,199 +0,0 @@
-Index: u-boot/cpu/arm920t/s3c24x0/mmc.c
-===================================================================
---- u-boot.orig/cpu/arm920t/s3c24x0/mmc.c
-+++ u-boot/cpu/arm920t/s3c24x0/mmc.c
-@@ -60,8 +60,6 @@ static int wide = 0;
- static u_int32_t *mmc_cmd(ushort cmd, ulong arg, ushort flags)
- {
- static u_int32_t resp[5];
-- ulong status;
-- int i;
-
- u_int32_t ccon, csta;
- u_int32_t csta_rdy_bit = S3C2410_SDICMDSTAT_CMDSENT;
-@@ -134,7 +132,7 @@ static int mmc_block_read(uchar *dst, ul
- //sdi->SDIPRE = 0xff;
-
- /* setup data */
-- dcon = (len >> 9) & S3C2410_SDIDCON_BLKNUM_MASK;
-+ dcon = (len >> 9) & S3C2410_SDIDCON_BLKNUM;
- dcon |= S3C2410_SDIDCON_BLOCKMODE;
- dcon |= S3C2410_SDIDCON_RXAFTERCMD|S3C2410_SDIDCON_XFER_RXSTART;
- if (wide)
-@@ -309,16 +307,18 @@ int mmc_write(uchar *src, ulong dst, int
- return 0;
- }
-
--ulong mmc_bread(int dev_num, ulong blknr, ulong blkcnt, ulong *dst)
-+ulong mmc_bread(int dev_num, ulong blknr, ulong blkcnt, void *dst)
- {
- int mmc_block_size = MMC_BLOCK_SIZE;
- ulong src = blknr * mmc_block_size + CFG_MMC_BASE;
-
-- mmc_read(src, (uchar *)dst, blkcnt*mmc_block_size);
-+ mmc_read(src, dst, blkcnt*mmc_block_size);
- return blkcnt;
- }
-
--static u_int16_t rca = MMC_DEFAULT_RCA;
-+/* MMC_DEFAULT_RCA should probably be just 1, but this may break other code
-+ that expects it to be shifted. */
-+static u_int16_t rca = MMC_DEFAULT_RCA >> 16;
-
- static u_int32_t mmc_size(const struct mmc_csd *csd)
- {
-@@ -331,6 +331,56 @@ static u_int32_t mmc_size(const struct m
- return blocknr * block_len;
- }
-
-+struct sd_cid {
-+ char pnm_0; /* product name */
-+ char oid_1; /* OEM/application ID */
-+ char oid_0;
-+ uint8_t mid; /* manufacturer ID */
-+ char pnm_4;
-+ char pnm_3;
-+ char pnm_2;
-+ char pnm_1;
-+ uint8_t psn_2; /* product serial number */
-+ uint8_t psn_1;
-+ uint8_t psn_0; /* MSB */
-+ uint8_t prv; /* product revision */
-+ uint8_t crc; /* CRC7 checksum, b0 is unused and set to 1 */
-+ uint8_t mdt_1; /* manufacturing date, LSB, RRRRyyyy yyyymmmm */
-+ uint8_t mdt_0; /* MSB */
-+ uint8_t psn_3; /* LSB */
-+};
-+
-+static void print_mmc_cid(mmc_cid_t *cid)
-+{
-+ printf("MMC found. Card desciption is:\n");
-+ printf("Manufacturer ID = %02x%02x%02x\n",
-+ cid->id[0], cid->id[1], cid->id[2]);
-+ printf("HW/FW Revision = %x %x\n",cid->hwrev, cid->fwrev);
-+ cid->hwrev = cid->fwrev = 0; /* null terminate string */
-+ printf("Product Name = %s\n",cid->name);
-+ printf("Serial Number = %02x%02x%02x\n",
-+ cid->sn[0], cid->sn[1], cid->sn[2]);
-+ printf("Month = %d\n",cid->month);
-+ printf("Year = %d\n",1997 + cid->year);
-+}
-+
-+static void print_sd_cid(const struct sd_cid *cid)
-+{
-+ printf("Manufacturer: 0x%02x, OEM \"%c%c\"\n",
-+ cid->mid, cid->oid_0, cid->oid_1);
-+ printf("Product name: \"%c%c%c%c%c\", revision %d.%d\n",
-+ cid->pnm_0, cid->pnm_1, cid->pnm_2, cid->pnm_3, cid->pnm_4,
-+ cid->prv >> 4, cid->prv & 15);
-+ printf("Serial number: %u\n",
-+ cid->psn_0 << 24 | cid->psn_1 << 16 | cid->psn_2 << 8 |
-+ cid->psn_3);
-+ printf("Manufacturing date: %d/%d\n",
-+ cid->mdt_1 & 15,
-+ 2000+((cid->mdt_0 & 15) << 4)+((cid->mdt_1 & 0xf0) >> 4));
-+ printf("CRC: 0x%02x, b0 = %d\n",
-+ cid->crc >> 1, cid->crc & 1);
-+}
-+
- int mmc_init(int verbose)
- {
- int retries, rc = -ENODEV;
-@@ -361,7 +411,6 @@ int mmc_init(int verbose)
-
- printf("trying to detect SD Card...\n");
- while (retries--) {
-- int i;
- udelay(100000);
- resp = mmc_cmd(55, 0x00000000, CMD_F_RESP);
- resp = mmc_cmd(41, 0x00300000, CMD_F_RESP);
-@@ -386,20 +435,38 @@ int mmc_init(int verbose)
- /* try to get card id */
- resp = mmc_cmd(MMC_CMD_ALL_SEND_CID, 0, CMD_F_RESP|CMD_F_RESP_LONG);
- if (resp) {
-- /* TODO configure mmc driver depending on card attributes */
-- mmc_cid_t *cid = (mmc_cid_t *)resp;
-- if (verbose) {
-- printf("MMC found. Card desciption is:\n");
-- printf("Manufacturer ID = %02x%02x%02x\n",
-- cid->id[0], cid->id[1], cid->id[2]);
-- printf("HW/FW Revision = %x %x\n",cid->hwrev, cid->fwrev);
-- cid->hwrev = cid->fwrev = 0; /* null terminate string */
-- printf("Product Name = %s\n",cid->name);
-- printf("Serial Number = %02x%02x%02x\n",
-- cid->sn[0], cid->sn[1], cid->sn[2]);
-- printf("Month = %d\n",cid->month);
-- printf("Year = %d\n",1997 + cid->year);
-+ if (!is_sd) {
-+ /* TODO configure mmc driver depending on card
-+ attributes */
-+ mmc_cid_t *cid = (mmc_cid_t *)resp;
-+
-+ if (verbose)
-+ print_mmc_cid(cid);
-+ sprintf((char *) mmc_dev.vendor,
-+ "Man %02x%02x%02x Snr %02x%02x%02x",
-+ cid->id[0], cid->id[1], cid->id[2],
-+ cid->sn[0], cid->sn[1], cid->sn[2]);
-+ sprintf((char *) mmc_dev.product,"%s",cid->name);
-+ sprintf((char *) mmc_dev.revision,"%x %x",
-+ cid->hwrev, cid->fwrev);
-+ }
-+ else {
-+ struct sd_cid *cid = (struct sd_cid *) resp;
-+
-+ if (verbose)
-+ print_sd_cid(cid);
-+ sprintf((char *) mmc_dev.vendor,
-+ "Man %02 OEM %c%c \"%c%c%c%c%c\"",
-+ cid->mid, cid->oid_0, cid->oid_1,
-+ cid->pnm_0, cid->pnm_1, cid->pnm_2, cid->pnm_3,
-+ cid->pnm_4);
-+ sprintf((char *) mmc_dev.product, "%d",
-+ cid->psn_0 << 24 | cid->psn_1 << 16 |
-+ cid->psn_2 << 8 | cid->psn_3);
-+ sprintf((char *) mmc_dev.revision, "%d.%d",
-+ cid->prv >> 4, cid->prv & 15);
- }
-+
- /* fill in device description */
- mmc_dev.if_type = IF_TYPE_MMC;
- mmc_dev.part_type = PART_TYPE_DOS;
-@@ -409,11 +476,6 @@ int mmc_init(int verbose)
- /* FIXME fill in the correct size (is set to 32MByte) */
- mmc_dev.blksz = 512;
- mmc_dev.lba = 0x10000;
-- sprintf(mmc_dev.vendor,"Man %02x%02x%02x Snr %02x%02x%02x",
-- cid->id[0], cid->id[1], cid->id[2],
-- cid->sn[0], cid->sn[1], cid->sn[2]);
-- sprintf(mmc_dev.product,"%s",cid->name);
-- sprintf(mmc_dev.revision,"%x %x",cid->hwrev, cid->fwrev);
- mmc_dev.removable = 0;
- mmc_dev.block_read = mmc_bread;
-
-Index: u-boot/include/asm-arm/arch-s3c24x0/regs-sdi.h
-===================================================================
---- u-boot.orig/include/asm-arm/arch-s3c24x0/regs-sdi.h
-+++ u-boot/include/asm-arm/arch-s3c24x0/regs-sdi.h
-@@ -62,7 +62,7 @@
- #define S3C2410_SDIDCON_XFER_RXSTART (2<<12)
- #define S3C2410_SDIDCON_XFER_TXSTART (3<<12)
-
--#define S3C2410_SDIDCON_BLKNUM_MASK (0xFFF)
-+#define S3C2410_SDIDCNT_BLKNUM_MASK (0xFFF)
- #define S3C2410_SDIDCNT_BLKNUM_SHIFT (12)
-
- #define S3C2410_SDIDSTA_RDYWAITREQ (1<<10)
-Index: u-boot/include/configs/neo1973.h
-===================================================================
---- u-boot.orig/include/configs/neo1973.h
-+++ u-boot/include/configs/neo1973.h
-@@ -227,7 +227,7 @@
- #define CONFIG_EXT2 1
-
- #define CONFIG_FAT 1
--#define CONFIG_SUPPORT_VFAT 1
-+#define CONFIG_SUPPORT_VFAT
-
- #if 1
- /* JFFS2 driver */
Modified: trunk/src/target/u-boot/patches/series
===================================================================
--- trunk/src/target/u-boot/patches/series 2007-04-14 23:26:52 UTC (rev 1759)
+++ trunk/src/target/u-boot/patches/series 2007-04-15 06:33:34 UTC (rev 1760)
@@ -64,7 +64,6 @@
uboot-dfu.patch
uboot-neo1973-defaultenv.patch
uboot-nand-markbad-reallybad.patch
-mmc-fixes.patch
usbdcore-multiple_configs.patch
neo1973-chargefast.patch
uboot-s3c2440.patch
Modified: trunk/src/target/u-boot/patches/uboot-s3c2410-mmc.patch
===================================================================
--- trunk/src/target/u-boot/patches/uboot-s3c2410-mmc.patch 2007-04-14 23:26:52 UTC (rev 1759)
+++ trunk/src/target/u-boot/patches/uboot-s3c2410-mmc.patch 2007-04-15 06:33:34 UTC (rev 1760)
@@ -5,8 +5,8 @@
Index: u-boot/cpu/arm920t/s3c24x0/Makefile
===================================================================
---- u-boot.orig/cpu/arm920t/s3c24x0/Makefile 2007-02-17 11:55:28.000000000 +0100
-+++ u-boot/cpu/arm920t/s3c24x0/Makefile 2007-02-17 11:55:31.000000000 +0100
+--- u-boot.orig/cpu/arm920t/s3c24x0/Makefile
++++ u-boot/cpu/arm920t/s3c24x0/Makefile
@@ -26,7 +26,7 @@
LIB = $(obj)lib$(SOC).a
@@ -18,9 +18,9 @@
OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
Index: u-boot/cpu/arm920t/s3c24x0/mmc.c
===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ u-boot/cpu/arm920t/s3c24x0/mmc.c 2007-02-17 12:13:10.000000000 +0100
-@@ -0,0 +1,469 @@
+--- /dev/null
++++ u-boot/cpu/arm920t/s3c24x0/mmc.c
+@@ -0,0 +1,531 @@
+/*
+ * u-boot S3C2410 MMC/SD card driver
+ * (C) Copyright 2006 by OpenMoko, Inc.
@@ -83,8 +83,6 @@
+static u_int32_t *mmc_cmd(ushort cmd, ulong arg, ushort flags)
+{
+ static u_int32_t resp[5];
-+ ulong status;
-+ int i;
+
+ u_int32_t ccon, csta;
+ u_int32_t csta_rdy_bit = S3C2410_SDICMDSTAT_CMDSENT;
@@ -157,7 +155,7 @@
+ //sdi->SDIPRE = 0xff;
+
+ /* setup data */
-+ dcon = (len >> 9) & S3C2410_SDIDCON_BLKNUM_MASK;
++ dcon = (len >> 9) & S3C2410_SDIDCON_BLKNUM;
+ dcon |= S3C2410_SDIDCON_BLOCKMODE;
+ dcon |= S3C2410_SDIDCON_RXAFTERCMD|S3C2410_SDIDCON_XFER_RXSTART;
+ if (wide)
@@ -332,16 +330,18 @@
+ return 0;
+}
+
-+ulong mmc_bread(int dev_num, ulong blknr, ulong blkcnt, ulong *dst)
++ulong mmc_bread(int dev_num, ulong blknr, ulong blkcnt, void *dst)
+{
+ int mmc_block_size = MMC_BLOCK_SIZE;
+ ulong src = blknr * mmc_block_size + CFG_MMC_BASE;
+
-+ mmc_read(src, (uchar *)dst, blkcnt*mmc_block_size);
++ mmc_read(src, dst, blkcnt*mmc_block_size);
+ return blkcnt;
+}
+
-+static u_int16_t rca = MMC_DEFAULT_RCA;
++/* MMC_DEFAULT_RCA should probably be just 1, but this may break other code
++ that expects it to be shifted. */
++static u_int16_t rca = MMC_DEFAULT_RCA >> 16;
+
+static u_int32_t mmc_size(const struct mmc_csd *csd)
+{
@@ -354,6 +354,56 @@
+ return blocknr * block_len;
+}
+
++struct sd_cid {
++ char pnm_0; /* product name */
++ char oid_1; /* OEM/application ID */
++ char oid_0;
++ uint8_t mid; /* manufacturer ID */
++ char pnm_4;
++ char pnm_3;
++ char pnm_2;
++ char pnm_1;
++ uint8_t psn_2; /* product serial number */
++ uint8_t psn_1;
++ uint8_t psn_0; /* MSB */
++ uint8_t prv; /* product revision */
++ uint8_t crc; /* CRC7 checksum, b0 is unused and set to 1 */
++ uint8_t mdt_1; /* manufacturing date, LSB, RRRRyyyy yyyymmmm */
++ uint8_t mdt_0; /* MSB */
++ uint8_t psn_3; /* LSB */
++};
++
++static void print_mmc_cid(mmc_cid_t *cid)
++{
++ printf("MMC found. Card desciption is:\n");
++ printf("Manufacturer ID = %02x%02x%02x\n",
++ cid->id[0], cid->id[1], cid->id[2]);
++ printf("HW/FW Revision = %x %x\n",cid->hwrev, cid->fwrev);
++ cid->hwrev = cid->fwrev = 0; /* null terminate string */
++ printf("Product Name = %s\n",cid->name);
++ printf("Serial Number = %02x%02x%02x\n",
++ cid->sn[0], cid->sn[1], cid->sn[2]);
++ printf("Month = %d\n",cid->month);
++ printf("Year = %d\n",1997 + cid->year);
++}
++
++static void print_sd_cid(const struct sd_cid *cid)
++{
++ printf("Manufacturer: 0x%02x, OEM \"%c%c\"\n",
++ cid->mid, cid->oid_0, cid->oid_1);
++ printf("Product name: \"%c%c%c%c%c\", revision %d.%d\n",
++ cid->pnm_0, cid->pnm_1, cid->pnm_2, cid->pnm_3, cid->pnm_4,
++ cid->prv >> 4, cid->prv & 15);
++ printf("Serial number: %u\n",
++ cid->psn_0 << 24 | cid->psn_1 << 16 | cid->psn_2 << 8 |
++ cid->psn_3);
++ printf("Manufacturing date: %d/%d\n",
++ cid->mdt_1 & 15,
++ 2000+((cid->mdt_0 & 15) << 4)+((cid->mdt_1 & 0xf0) >> 4));
++ printf("CRC: 0x%02x, b0 = %d\n",
++ cid->crc >> 1, cid->crc & 1);
++}
++
+int mmc_init(int verbose)
+{
+ int retries, rc = -ENODEV;
@@ -384,7 +434,6 @@
+
+ printf("trying to detect SD Card...\n");
+ while (retries--) {
-+ int i;
+ udelay(100000);
+ resp = mmc_cmd(55, 0x00000000, CMD_F_RESP);
+ resp = mmc_cmd(41, 0x00300000, CMD_F_RESP);
@@ -409,20 +458,38 @@
+ /* try to get card id */
+ resp = mmc_cmd(MMC_CMD_ALL_SEND_CID, 0, CMD_F_RESP|CMD_F_RESP_LONG);
+ if (resp) {
-+ /* TODO configure mmc driver depending on card attributes */
-+ mmc_cid_t *cid = (mmc_cid_t *)resp;
-+ if (verbose) {
-+ printf("MMC found. Card desciption is:\n");
-+ printf("Manufacturer ID = %02x%02x%02x\n",
-+ cid->id[0], cid->id[1], cid->id[2]);
-+ printf("HW/FW Revision = %x %x\n",cid->hwrev, cid->fwrev);
-+ cid->hwrev = cid->fwrev = 0; /* null terminate string */
-+ printf("Product Name = %s\n",cid->name);
-+ printf("Serial Number = %02x%02x%02x\n",
-+ cid->sn[0], cid->sn[1], cid->sn[2]);
-+ printf("Month = %d\n",cid->month);
-+ printf("Year = %d\n",1997 + cid->year);
++ if (!is_sd) {
++ /* TODO configure mmc driver depending on card
++ attributes */
++ mmc_cid_t *cid = (mmc_cid_t *)resp;
++
++ if (verbose)
++ print_mmc_cid(cid);
++ sprintf((char *) mmc_dev.vendor,
++ "Man %02x%02x%02x Snr %02x%02x%02x",
++ cid->id[0], cid->id[1], cid->id[2],
++ cid->sn[0], cid->sn[1], cid->sn[2]);
++ sprintf((char *) mmc_dev.product,"%s",cid->name);
++ sprintf((char *) mmc_dev.revision,"%x %x",
++ cid->hwrev, cid->fwrev);
+ }
++ else {
++ struct sd_cid *cid = (struct sd_cid *) resp;
++
++ if (verbose)
++ print_sd_cid(cid);
++ sprintf((char *) mmc_dev.vendor,
++ "Man %02 OEM %c%c \"%c%c%c%c%c\"",
++ cid->mid, cid->oid_0, cid->oid_1,
++ cid->pnm_0, cid->pnm_1, cid->pnm_2, cid->pnm_3,
++ cid->pnm_4);
++ sprintf((char *) mmc_dev.product, "%d",
++ cid->psn_0 << 24 | cid->psn_1 << 16 |
++ cid->psn_2 << 8 | cid->psn_3);
++ sprintf((char *) mmc_dev.revision, "%d.%d",
++ cid->prv >> 4, cid->prv & 15);
++ }
++
+ /* fill in device description */
+ mmc_dev.if_type = IF_TYPE_MMC;
+ mmc_dev.part_type = PART_TYPE_DOS;
@@ -432,11 +499,6 @@
+ /* FIXME fill in the correct size (is set to 32MByte) */
+ mmc_dev.blksz = 512;
+ mmc_dev.lba = 0x10000;
-+ sprintf(mmc_dev.vendor,"Man %02x%02x%02x Snr %02x%02x%02x",
-+ cid->id[0], cid->id[1], cid->id[2],
-+ cid->sn[0], cid->sn[1], cid->sn[2]);
-+ sprintf(mmc_dev.product,"%s",cid->name);
-+ sprintf(mmc_dev.revision,"%x %x",cid->hwrev, cid->fwrev);
+ mmc_dev.removable = 0;
+ mmc_dev.block_read = mmc_bread;
+
@@ -492,8 +554,8 @@
+#endif /* CONFIG_MMC */
Index: u-boot/include/asm-arm/arch-s3c24x0/mmc.h
===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ u-boot/include/asm-arm/arch-s3c24x0/mmc.h 2007-02-17 12:16:41.000000000 +0100
+--- /dev/null
++++ u-boot/include/asm-arm/arch-s3c24x0/mmc.h
@@ -0,0 +1,112 @@
+/*
+ * linux/drivers/mmc/mmc_pxa.h
@@ -609,8 +671,8 @@
+#endif /* __MMC_PXA_P_H__ */
Index: u-boot/include/asm-arm/arch-s3c24x0/regs-sdi.h
===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ u-boot/include/asm-arm/arch-s3c24x0/regs-sdi.h 2007-02-17 11:55:31.000000000 +0100
+--- /dev/null
++++ u-boot/include/asm-arm/arch-s3c24x0/regs-sdi.h
@@ -0,0 +1,110 @@
+/* linux/include/asm/arch-s3c2410/regs-sdi.h
+ *
@@ -676,7 +738,7 @@
+#define S3C2410_SDIDCON_XFER_RXSTART (2<<12)
+#define S3C2410_SDIDCON_XFER_TXSTART (3<<12)
+
-+#define S3C2410_SDIDCON_BLKNUM_MASK (0xFFF)
++#define S3C2410_SDIDCNT_BLKNUM_MASK (0xFFF)
+#define S3C2410_SDIDCNT_BLKNUM_SHIFT (12)
+
+#define S3C2410_SDIDSTA_RDYWAITREQ (1<<10)
@@ -724,8 +786,8 @@
+#endif /* __ASM_ARM_REGS_SDI */
Index: u-boot/include/s3c24x0.h
===================================================================
---- u-boot.orig/include/s3c24x0.h 2007-02-17 11:46:25.000000000 +0100
-+++ u-boot/include/s3c24x0.h 2007-02-17 11:55:31.000000000 +0100
+--- u-boot.orig/include/s3c24x0.h
++++ u-boot/include/s3c24x0.h
@@ -637,13 +637,7 @@
S3C24X0_REG32 SDIDCNT;
S3C24X0_REG32 SDIDSTA;
More information about the commitlog
mailing list