From 20787e23b8501f11c83599d1a2e38bb1204ac961 Mon Sep 17 00:00:00 2001 From: wdenk Date: Wed, 6 Apr 2005 00:04:16 +0000 Subject: * Patches by Robert Whaley, 29 Nov 2004: - update the pxa-regs.h file for PXA27x chips - add PXA27x based ADSVIX board - add support for MMC on PXA27x processors * Patch by Andrew E. Mileski, 28 Nov 2004: Fix PPC4xx SPD SDRAM detection bug * Patch by Hiroshi Ito, 26 Nov 2004: Fix logic of "test -z" and "test -n" commands --- cpu/ppc4xx/spd_sdram.c | 2 +- cpu/pxa/mmc.c | 141 ++++++++++++++++++++++--------------------------- 2 files changed, 63 insertions(+), 80 deletions(-) (limited to 'cpu') diff --git a/cpu/ppc4xx/spd_sdram.c b/cpu/ppc4xx/spd_sdram.c index 44e826f..794a72c 100644 --- a/cpu/ppc4xx/spd_sdram.c +++ b/cpu/ppc4xx/spd_sdram.c @@ -1082,7 +1082,7 @@ void program_rtr (unsigned long* dimm_populated, case 0x00: refresh_rate = 15625; break; - case 0x011: + case 0x01: refresh_rate = 15625/4; break; case 0x02: diff --git a/cpu/pxa/mmc.c b/cpu/pxa/mmc.c index 4495962..f7020ee 100644 --- a/cpu/pxa/mmc.c +++ b/cpu/pxa/mmc.c @@ -72,13 +72,11 @@ mmc_cmd(ushort cmd, ushort argh, ushort argl, ushort cmdat) status = MMC_STAT; debug("MMC status %x\n", status); - if (status & MMC_STAT_TIME_OUT_RESPONSE) - { + if (status & MMC_STAT_TIME_OUT_RESPONSE) { return 0; } - switch (cmdat & 0x3) - { + switch (cmdat & 0x3) { case MMC_CMDAT_R1: case MMC_CMDAT_R3: words = 3; @@ -91,8 +89,7 @@ mmc_cmd(ushort cmd, ushort argh, ushort argl, ushort cmdat) default: return 0; } - for (i = words-1; i >= 0; i--) - { + for (i = words-1; i >= 0; i--) { ulong res_fifo = MMC_RES; int offset = i << 1; @@ -100,8 +97,7 @@ mmc_cmd(ushort cmd, ushort argh, ushort argl, ushort cmdat) resp[offset+1] = ((uchar *)&res_fifo)[1]; } #ifdef MMC_DEBUG - for (i=0; iid[0], cid->id[1], cid->id[2]); @@ -451,6 +431,7 @@ mmc_init(int verbose) } /* fill in device description */ mmc_dev.if_type = IF_TYPE_MMC; + mmc_dev.part_type = PART_TYPE_DOS; mmc_dev.dev = 0; mmc_dev.lun = 0; mmc_dev.type = 0; @@ -468,8 +449,7 @@ mmc_init(int verbose) /* MMC exists, get CSD too */ resp = mmc_cmd(MMC_CMD_SET_RCA, MMC_DEFAULT_RCA, 0, MMC_CMDAT_R1); resp = mmc_cmd(MMC_CMD_SEND_CSD, MMC_DEFAULT_RCA, 0, MMC_CMDAT_R2); - if (resp) - { + if (resp) { mmc_csd_t *csd = (mmc_csd_t *)resp; memcpy(&mmc_csd, csd, sizeof(csd)); rc = 0; @@ -478,7 +458,11 @@ mmc_init(int verbose) } } +#ifdef CONFIG_PXA27X + MMC_CLKRT = 1; /* 10 MHz - see Intel errata */ +#else MMC_CLKRT = 0; /* 20 MHz */ +#endif resp = mmc_cmd(7, MMC_DEFAULT_RCA, 0, MMC_CMDAT_R1); fat_register_device(&mmc_dev,1); /* partitions start counting with 1 */ @@ -496,11 +480,10 @@ int mmc2info(ulong addr) { /* FIXME hard codes to 32 MB device */ - if (addr >= CFG_MMC_BASE && addr < CFG_MMC_BASE + 0x02000000) - { + if (addr >= CFG_MMC_BASE && addr < CFG_MMC_BASE + 0x02000000) { return 1; } return 0; } -#endif +#endif /* CONFIG_MMC */ -- cgit v1.1