diff options
author | Ulf Hansson <ulf.hansson@stericsson.com> | 2010-07-02 13:47:39 +0200 |
---|---|---|
committer | Michael BRANDT <michael.brandt@stericsson.com> | 2010-08-11 10:53:36 +0200 |
commit | 33a2e90bf491f13a4546d09a6105582c0ba7f313 (patch) | |
tree | b986e40cefe66056013a73977976b1fa38b334c4 /board/st/u8500/mmc_utils.h | |
parent | 415211fa4c850467b3e45b7cdb2405ac018dec77 (diff) |
Replace MMC/SD driver to fit new framework.
IR265772: MMC driver does not detect SDHC cards.
IR254201: Restructure MMC/SD driver for U8500 board according to the
block device framework in mainline U-Boot.
Changes to mmc framework:
- Multi Block Read support in mmc framework.
- Wrap Multi Block Write/Read to be able to adopt for large transaction.
- Removed incorrect check in EXT CSD for high capacity MMC.
- Corrected check for high capacity SD cards.
- Set MMC buswidth to 8, prio of using 4.
Known limitations/bugs in mmc framework:
- High capacity MMC, will likely not get the correct density.
- High speed is set, whether or not the host supports it or not.
board/st/u8500/mmc_utils:
IMPORTANT FOR DEVELOPERS:
- Removed unessary U-Boot commands which is already supported in
cmd_fat.
- mmc_read_cmd_file: Read command.txt into bootcmd env from FAT FS in
SD card.
- write_partition_block: Writes the MBR if it is not already written.
board/st/u8500/mmc_host[c.h]:
- Implements the entire MMC/SD host driver for the PL180 block.
- There is still room for optimization:
Increase CLK-speed.
Use high-speed for SD cards.
Is GPIO setup correctly for both cards an eMMC.
EarlyDrop support not fully tested.
Dynamically turn on voltage/clocks to SD, not always.
More...
Note:
- Increased read/write performance for eMMC, to around 5.4 MB/s for
sequential read/write. Earlier measurements was 3.5 MB/s for read and
2.6 MB/s for write.
ST-Ericsson ID: ER265772, CR267996, ER267993
Change-Id: I921102edbde761407ff5ad476d1bb99f5dc7a2ef
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/2288
Reviewed-by: Michael BRANDT <michael.brandt@stericsson.com>
Tested-by: Michael BRANDT <michael.brandt@stericsson.com>
Reviewed-by: Martin LUNDHOLM <martin.xa.lundholm@stericsson.com>
Tested-by: Martin LUNDHOLM <martin.xa.lundholm@stericsson.com>
Reviewed-by: Mikael LARSSON <mikael.xt.larsson@stericsson.com>
Tested-by: Mikael LARSSON <mikael.xt.larsson@stericsson.com>
Diffstat (limited to 'board/st/u8500/mmc_utils.h')
-rwxr-xr-x | board/st/u8500/mmc_utils.h | 107 |
1 files changed, 0 insertions, 107 deletions
diff --git a/board/st/u8500/mmc_utils.h b/board/st/u8500/mmc_utils.h deleted file mode 100755 index c0b997a5e..000000000 --- a/board/st/u8500/mmc_utils.h +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (C) ST-Ericsson SA 2009 - * - * See file CREDITS for list of people who contributed to this - * project. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - */ -#ifndef __MMC_UTILS_H -#define __MMC_UTILS_H - -#include <common.h> - -typedef struct -{ - u8 jump [3]; - u8 OEMname [8]; - u8 BytesPerSector [2]; - u8 SectorsPerCluster [1]; - u8 ReservedSectors [2]; - u8 NumOfFAT [1]; - u8 NumOfRootEntries [2]; - u8 NumOfSectors [2]; - u8 MediaDesc [1]; - u8 SectorsPerFat [2]; - u8 SectorsPerTrack [2]; - u8 NumOfHeads [2]; - u8 NumOfHiddenSectors [4]; - u8 NumOfTotSectors [4]; - u8 DriveNumber [1]; - u8 reserved [1]; - u8 ExtBootSig [1]; - u8 VolumeID [4]; - u8 VolumeLabel [11]; - u8 FSType [8]; - u8 LoadProg [448]; - u8 Signature [2]; -} t_mmc_boot_record; - -typedef struct -{ - u8 filename [8]; - u8 extension [3]; - u8 attrib ; - u8 reserved [10]; - u8 hour [2]; - u8 date [2]; - u8 startCluster [2]; - u8 dimension [4]; -} t_mmc_root_entry; - -typedef struct s_root_elem -{ - char name[8]; - char ext[3]; - char nulll[0xf]; - short offset; - unsigned sizee; -} s_root_elem; - -typedef struct s_root -{ - s_root_elem elem[16]; -} s_root; - -typedef struct s_file_elem -{ - char filename [8] ; -} s_file_elem; - -typedef struct s_file_list -{ - s_file_elem elem [30]; -} s_file_list ; - -typedef enum -{ - MMCPOLLING, - MMCDMA -}t_mmc_transfer_mode; - - -t_mmc_error mmc_readblock (u8 cardno, u32 addr, u32* readbuff, u16 blocksize, t_mmc_transfer_mode transfer_mode); -t_mmc_error mmc_writeblock (u8 cardno, u32 addr, u32* writebuff, u16 blocksize, t_mmc_transfer_mode transfer_mode); -t_mmc_error mmc_enable (void); -t_mmc_error mmc_disable (void); -t_mmc_error mmc_initCard (void); -t_mmc_error mmc_readcsd (u32 *response); -t_mmc_error mmc_readcid (u32 *response) ; -t_mmc_error display_file_list(char *extension); - -#endif /* !defined(__MMC_UTILS_H) */ - - |