e0e24cbf0a
Put specific members under #ifdef (CONFIG_STORAGE & STORAGE_xx) (2 members for SD and 1 for MMC) Fix a typo: tsac doesn't exist and must be read taac Move card_get_info functions declaration inside hotswap.h to remove mutual inclusion of ata_mmc.h and hotswap.h Move static const data structures from SD drivers into sd.h (sd_exponent and sd_mantissa) Fix sd_command prototypes in SD drivers (card registers are unsigned long) Fix speed calculation in Sansa AMS driver (PP SD driver needs to be checked) Move ata-sd-target.h to sd-pp-target.h to reflect the PP specifity. Now it only contains declaration of microsd_int() Remove unused ata-sd-target.h for injenic TODO: - check if CSD register bits are extracted correctly in PP driver - correctly define read_timeout and write_timeout unit for MMC & SD, and use timeouts in Sansa AMS driver git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21586 a1c6a512-1295-4272-9138-f99709370657
47 lines
1.7 KiB
C
47 lines
1.7 KiB
C
/***************************************************************************
|
|
* __________ __ ___.
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
* \/ \/ \/ \/ \/
|
|
* $Id$
|
|
*
|
|
* Copyright (C) 2008 by Maurus Cuelenaere
|
|
*
|
|
* 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 software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
* KIND, either express or implied.
|
|
*
|
|
****************************************************************************/
|
|
|
|
#ifndef ATA_SD_TARGET_H
|
|
#define ATA_SD_TARGET_H
|
|
|
|
#include "inttypes.h"
|
|
#include "hotswap.h"
|
|
#include "jz4740.h"
|
|
|
|
int _sd_read_sectors(unsigned long start, int count, void* buf);
|
|
int _sd_write_sectors(unsigned long start, int count, const void* buf);
|
|
int _sd_init(void);
|
|
|
|
#define MMC_CD_PIN (29 + 1 * 32) /* Pin to check card insertion */
|
|
//#define MMC_POWER_PIN (30 + 1 * 32) /* Pin to enable/disable card power */
|
|
//#define MMC_PW_PIN (14 + 3 * 32) /* Pin to check protect card */
|
|
|
|
static inline void mmc_init_gpio(void)
|
|
{
|
|
__gpio_as_msc();
|
|
__gpio_as_input(MMC_CD_PIN);
|
|
__gpio_enable_pull(32*3+29);
|
|
__gpio_enable_pull(32*3+10);
|
|
__gpio_enable_pull(32*3+11);
|
|
__gpio_enable_pull(32*3+12);
|
|
}
|
|
|
|
#endif
|