mci_device.h (163533) | mci_device.h (164137) |
---|---|
1/*- 2 * Copyright (c) 2006 M. Warner Losh. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 10 unchanged lines hidden (view full) --- 19 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 20 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * 24 * This software is derived from software provide by Kwikbyte who specifically 25 * disclaimed copyright on the code. 26 * | 1/*- 2 * Copyright (c) 2006 M. Warner Losh. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 10 unchanged lines hidden (view full) --- 19 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 20 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * 24 * This software is derived from software provide by Kwikbyte who specifically 25 * disclaimed copyright on the code. 26 * |
27 * $FreeBSD: head/sys/boot/arm/at91/libat91/mci_device.h 163533 2006-10-20 09:12:05Z imp $ | 27 * $FreeBSD: head/sys/boot/arm/at91/libat91/mci_device.h 164137 2006-11-09 20:32:36Z imp $ |
28 */ 29 30//*--------------------------------------------------------------------------- 31//* ATMEL Microcontroller Software Support - ROUSSET - 32//*--------------------------------------------------------------------------- 33//* The software is delivered "AS IS" without warranty or condition of any 34//* kind, either express, implied or statutory. This includes without 35//* limitation any warranty or condition with respect to merchantability or --- 42 unchanged lines hidden (view full) --- 78#define AT91C_TIMEOUT_CMDRDY 30 79 80 81 82/////////////////////////////////////////////////////////////////////////////// 83// MMC & SDCard Structures 84/////////////////////////////////////////////////////////////////////////////// 85 | 28 */ 29 30//*--------------------------------------------------------------------------- 31//* ATMEL Microcontroller Software Support - ROUSSET - 32//*--------------------------------------------------------------------------- 33//* The software is delivered "AS IS" without warranty or condition of any 34//* kind, either express, implied or statutory. This includes without 35//* limitation any warranty or condition with respect to merchantability or --- 42 unchanged lines hidden (view full) --- 78#define AT91C_TIMEOUT_CMDRDY 30 79 80 81 82/////////////////////////////////////////////////////////////////////////////// 83// MMC & SDCard Structures 84/////////////////////////////////////////////////////////////////////////////// 85 |
86/*-----------------------------------------------*/ 87/* SDCard Device Descriptor Structure Definition */ 88/*-----------------------------------------------*/ 89typedef struct _AT91S_MciDeviceDesc 90{ 91 volatile unsigned char state; 92 unsigned char SDCard_bus_width; 93 94} AT91S_MciDeviceDesc, *AT91PS_MciDeviceDesc; 95 | |
96/*---------------------------------------------*/ | 86/*---------------------------------------------*/ |
97/* MMC & SDCard Structure Device Features */ 98/*---------------------------------------------*/ 99typedef struct _AT91S_MciDeviceFeatures 100{ 101 unsigned char Card_Inserted; // (0=AT91C_CARD_REMOVED) (1=AT91C_MMC_CARD_INSERTED) (2=AT91C_SD_CARD_INSERTED) 102 unsigned int Relative_Card_Address; // RCA 103 unsigned int READ_BL_LEN; 104 unsigned int WRITE_BL_LEN; 105 unsigned char Read_Partial; // READ_BL_PARTIAL 106 unsigned char Write_Partial; // WRITE_BL_PARTIAL 107 unsigned char Erase_Block_Enable; // ERASE_BLK_EN 108 unsigned char Read_Block_Misalignment; // READ_BLK_MISALIGN 109 unsigned char Write_Block_Misalignment; // WRITE_BLK_MISALIGN 110 unsigned char Sector_Size; // SECTOR_SIZE 111 unsigned int Memory_Capacity; // Size in bits of the device 112 113} AT91S_MciDeviceFeatures, *AT91PS_MciDeviceFeatures ; 114 115/*---------------------------------------------*/ | |
116/* MCI Device Structure Definition */ 117/*---------------------------------------------*/ 118typedef struct _AT91S_MciDevice 119{ | 87/* MCI Device Structure Definition */ 88/*---------------------------------------------*/ 89typedef struct _AT91S_MciDevice 90{ |
120 AT91PS_MciDeviceDesc pMCI_DeviceDesc; // MCI device descriptor 121 AT91PS_MciDeviceFeatures pMCI_DeviceFeatures;// Pointer on a MCI device features array 122} AT91S_MciDevice, *AT91PS_MciDevice; | 91 volatile unsigned char state; 92 unsigned char SDCard_bus_width; 93 unsigned int RCA; // RCA 94 unsigned int READ_BL_LEN; 95#ifdef REPORT_SIZE 96 unsigned int Memory_Capacity; 97#endif 98} AT91S_MciDevice; |
123 124#include <dev/mmc/mmcreg.h> 125 126/////////////////////////////////////////////////////////////////////////////// 127// Functions returnals 128/////////////////////////////////////////////////////////////////////////////// 129#define AT91C_CMD_SEND_OK 0 // Command ok 130#define AT91C_CMD_SEND_ERROR -1 // Command failed --- 314 unchanged lines hidden (view full) --- 445// reserved 24 // [121:120] 446// reserved 0x03 447#define CSD_0_MMC_SPEC_VERS_S 26 // [125:122] reserved for MMC compatibility 448#define CSD_0_MMC_SPEC_VERS_M 0x0F 449#define CSD_0_STRUCT_S 30 // [127:126] 450#define CSD_0_STRUCT_M 0x03 451 452/////////////////////////////////////////////////////////////////////////////// | 99 100#include <dev/mmc/mmcreg.h> 101 102/////////////////////////////////////////////////////////////////////////////// 103// Functions returnals 104/////////////////////////////////////////////////////////////////////////////// 105#define AT91C_CMD_SEND_OK 0 // Command ok 106#define AT91C_CMD_SEND_ERROR -1 // Command failed --- 314 unchanged lines hidden (view full) --- 421// reserved 24 // [121:120] 422// reserved 0x03 423#define CSD_0_MMC_SPEC_VERS_S 26 // [125:122] reserved for MMC compatibility 424#define CSD_0_MMC_SPEC_VERS_M 0x0F 425#define CSD_0_STRUCT_S 30 // [127:126] 426#define CSD_0_STRUCT_M 0x03 427 428/////////////////////////////////////////////////////////////////////////////// |
453 454void AT91F_MCI_Device_Handler(AT91PS_MciDevice,unsigned int); 455AT91S_MCIDeviceStatus AT91F_MCI_SDCard_Init (AT91PS_MciDevice); 456AT91S_MCIDeviceStatus AT91F_MCI_SetBlocklength(unsigned int); 457AT91S_MCIDeviceStatus AT91F_MCI_ReadBlock(AT91PS_MciDevice,int,unsigned int *,int); 458AT91S_MCIDeviceStatus AT91F_MCI_WriteBlock(AT91PS_MciDevice,int,unsigned int *,int); 459#if 0 460AT91S_MCIDeviceStatus AT91F_MCI_MMC_Init (AT91PS_MciDevice pMCI_Device); 461AT91S_MCIDeviceStatus AT91F_MCI_MMC_SelectCard(AT91PS_MciDevice pMCI_Device, unsigned int relative_card_address); | |
462#endif | 429#endif |
463 464#endif | |