File indexing completed on 2025-05-11 08:23:52
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef __PCMCIA_IDE_h
0018 #define __PCMCIA_IDE_h
0019
0020 #include <bsp.h>
0021
0022 #define GPIOPCR_ATA_CS_4_5 (1 << 24)
0023
0024
0025 #define GET_UP_BYTE_OF_MPC5200_ATA_DRIVE_REG(val32) ((uint16_t)((val32) >> 24))
0026 #define SET_UP_BYTE_OF_MPC5200_ATA_DRIVE_REG(val8) ((uint32_t)((val8) << 24))
0027 #define GET_UP_WORD_OF_MPC5200_ATA_DRIVE_REG(val32) ((uint16_t)((val32) >> 16))
0028 #define SET_UP_WORD_OF_MPC5200_ATA_DRIVE_REG(val16) ((uint32_t)((val16) << 16))
0029
0030 #define ATA_HCFG_SMR (1 << 31)
0031 #define ATA_HCFG_FR (1 << 30)
0032 #define ATA_HCFG_IORDY (1 << 24)
0033 #define ATA_HCFG_IE (1 << 25)
0034
0035 #define COUNT_VAL(nsec) (((nsec) * (IPB_CLOCK / 1000000) + 999) / 1000)
0036
0037 #define PIO_3 0
0038 #define PIO_4 1
0039
0040 #define T0 0
0041 #define T2_8 1
0042 #define T2_16 2
0043 #define T4 3
0044 #define T1 4
0045 #define TA 5
0046
0047 #define ATA_PIO_TIMING_1(t0,t2_8,t2_16) (((COUNT_VAL(t0)) << 24) | ((COUNT_VAL(t2_8)) << 16) | ((COUNT_VAL(t2_16)) << 8))
0048 #define ATA_PIO_TIMING_2(t4,t1,ta) (((COUNT_VAL(t4)) << 24) | ((COUNT_VAL(t1)) << 16) | ((COUNT_VAL(ta)) << 8))
0049
0050 #endif