blob: df649ba971b3415842d116a2084bc13af2f21ecc [file] [log] [blame]
Peter Pearsedcbfd2e2007-08-14 10:14:05 +01001#ifndef _AT45_H_
2#define _AT45_H_
Jean-Christophe PLAGNIOL-VILLARD90a92a72009-03-27 23:26:42 +01003#ifdef CONFIG_DATAFLASH_MMC_SELECT
Peter Pearsedcbfd2e2007-08-14 10:14:05 +01004extern void AT91F_SelectMMC(void);
5extern void AT91F_SelectSPI(void);
6extern int AT91F_GetMuxStatus(void);
7#endif
8extern void AT91F_SpiInit(void);
9extern void AT91F_SpiEnable(int cs);
10extern unsigned int AT91F_SpiWrite ( AT91PS_DataflashDesc pDesc );
11extern AT91S_DataFlashStatus AT91F_DataFlashSendCommand(
12 AT91PS_DataFlash pDataFlash,
13 unsigned char OpCode,
14 unsigned int CmdSize,
15 unsigned int DataflashAddress);
16extern AT91S_DataFlashStatus AT91F_DataFlashGetStatus (
17 AT91PS_DataflashDesc pDesc);
18extern AT91S_DataFlashStatus AT91F_DataFlashWaitReady (
Wolfgang Denkf01dbb52007-08-14 18:42:36 +020019 AT91PS_DataflashDesc pDataFlashDesc,
Peter Pearsedcbfd2e2007-08-14 10:14:05 +010020 unsigned int timeout);
21extern AT91S_DataFlashStatus AT91F_DataFlashContinuousRead (
22 AT91PS_DataFlash pDataFlash,
23 int src,
24 unsigned char *dataBuffer,
25 int sizeToRead );
26extern AT91S_DataFlashStatus AT91F_DataFlashPagePgmBuf(
27 AT91PS_DataFlash pDataFlash,
28 unsigned char *src,
29 unsigned int dest,
30 unsigned int SizeToWrite);
31extern AT91S_DataFlashStatus AT91F_MainMemoryToBufferTransfert(
32 AT91PS_DataFlash pDataFlash,
33 unsigned char BufferCommand,
34 unsigned int page);
35extern AT91S_DataFlashStatus AT91F_DataFlashWriteBuffer (
36 AT91PS_DataFlash pDataFlash,
37 unsigned char BufferCommand,
38 unsigned char *dataBuffer,
39 unsigned int bufferAddress,
40 int SizeToWrite );
41extern AT91S_DataFlashStatus AT91F_PageErase(
42 AT91PS_DataFlash pDataFlash,
43 unsigned int page);
44extern AT91S_DataFlashStatus AT91F_BlockErase(
45 AT91PS_DataFlash pDataFlash,
46 unsigned int block);
47extern AT91S_DataFlashStatus AT91F_WriteBufferToMain (
48 AT91PS_DataFlash pDataFlash,
49 unsigned char BufferCommand,
50 unsigned int dest );
51extern AT91S_DataFlashStatus AT91F_PartialPageWrite (
52 AT91PS_DataFlash pDataFlash,
53 unsigned char *src,
54 unsigned int dest,
55 unsigned int size);
56extern AT91S_DataFlashStatus AT91F_DataFlashWrite(
57 AT91PS_DataFlash pDataFlash,
58 unsigned char *src,
59 int dest,
60 int size );
61extern int AT91F_DataFlashRead(
62 AT91PS_DataFlash pDataFlash,
63 unsigned long addr,
64 unsigned long size,
65 char *buffer);
66extern int AT91F_DataflashProbe(int cs, AT91PS_DataflashDesc pDesc);
67
68#endif