1 /**************************************************************************
2 * FILE PURPOSE: Target specific definitions
3 **************************************************************************
4 * FILE NAME: target.h
5 *
6 * DESCRIPTION: This file defines target specific values used by low level
7 * drivers.
8 *
9 * @file target.h
10 *
11 * @brief
12 * Low level target specific values are defined
13 *
14 ***************************************************************************/
17 /**
18 * @brief
19 * Device EMAC definitions
20 */
21 #define TARGET_DEVICE_CPMAC
23 #define TARGET_EMAC_N_PORTS 2
25 #define TARGET_EMAC_BASE_ADDRESSES { 0x02c80000u, 0x02cc0000u }
26 #define TARGET_EMAC_DSC_BASE_ADDR { 0x02c82000u, 0x02cc2000u }
28 /* Leave mdio disabled */
29 #define dev_mdio_open() 1
31 /* No chip level reset required for ethernet, the function call is made a void statment */
32 #define deviceSetEthResetState(x,y)
34 /* The mac control register values used */
35 #define TARGET_MAC_CONTROL CPMAC_MACCONTROL_RXOWNERSHIP | \
36 CPMAC_MACCONTROL_RXOFFLENBLOCK | \
37 CPMAC_MACCONTROL_MIIEN
39 /* There is no sgmii on the 6472, so the sgmii config is defined to a void statement */
40 #define hwSgmiiConfig(x,y)
44 /**
45 * @brief
46 * Device Timer definitions
47 */
48 #define TIMER0_BASE 0x025e0000u
50 #define TIMER_INPUT_DIVIDER 6 /* Timer driven from cpu clock / 6 */
53 /**
54 * @def MAIN_PLL
55 */
56 #define MAIN_PLL 0 /**< The index to the main PLL */
58 /**
59 * @def NET_PLL
60 */
61 #define NET_PLL 1 /**< The index to the network PLL */
63 /**
64 * @def DDR_PLL
65 */
66 #define DDR_PLL 2 /**< The index to the DDR PLL */
69 /**
70 * @brief
71 * Device PLL definitions
72 */
73 #define DEVICE_PLL_BASE(x) ((x) == MAIN_PLL ? 0x29a0000 : ((x) == NET_PLL ? 0x29c0000 : 0x29c0400))
76 /**
77 * @brief
78 * Device PSC definitions
79 */
80 #define DEVICE_PSC_BASE 0x02ae0000u
82 /**
83 * @brief
84 * The PSC number for ethernet port 0 is 7, and for port 1 it is 8 */
85 #define TARGET_PWR_ETH(x) ((x) == 0 ? 7 : 8)
87 /**
88 * @brief
89 * The nand is done through gpio, which is always powered up.
90 * A value < 0 tells the low level psc driver to simply return success
91 */
92 #define TARGET_PWR_NAND -1
94 /**
95 * @brief
96 * Flag to indicate timer 0 power up requested. The time is always on in the 6472
97 */
98 #define TARGET_PWR_TIMER_0 -1
100 /**
101 * @brief
102 * Device DDR controller definitions
103 */
104 #define DEVICE_DDR_BASE 0x78000000
106 /**
107 * @brief
108 * The highest module number
109 */
110 #define TARGET_PWR_MAX_MOD 13
113 /**
114 * @brief
115 * The base address of MDIO
116 */
117 #define TARGET_MDIO_BASE 0x2c81800
119 /**
120 * @brief
121 * GPIO address
122 */
123 #define GPIO_GPIOPID_REG 0x02B00000
124 #define GPIO_GPIOEMU_REG 0x02B00004
125 #define GPIO_BINTEN_REG 0x02B00008
126 #define GPIO_DIR_REG 0x02B00010
127 #define GPIO_OUT_DATA_REG 0x02B00014
128 #define GPIO_SET_DATA_REG 0x02B00018
129 #define GPIO_CLEAR_DATA_REG 0x02B0001C
130 #define GPIO_IN_DATA_REG 0x02B00020
131 #define GPIO_SET_RIS_TRIG_REG 0x02B00024
132 #define GPIO_CLR_RIS_TRIG_REG 0x02B00028
133 #define GPIO_SET_FAL_TRIG_REG 0x02B0002C
134 #define GPIO_CLR_FAL_TRIG_REG 0x02B00030
136 /**
137 * @brief
138 * GPIO pin mapping
139 */
140 #define NAND_CLE_GPIO_PIN GPIO_8 // High: Command Cycle occuring
141 #define NAND_ALE_GPIO_PIN GPIO_9 // High: Address input cycle oddcuring
142 #define NAND_NWE_GPIO_PIN GPIO_10
143 #define NAND_NRE_GPIO_PIN GPIO_12
144 #define NAND_NCE_GPIO_PIN GPIO_13
145 #define NAND_MODE_GPIO GPIO_14
147 /**
148 * @brief
149 * The standard NAND delay must be big enough to handle the highest possible
150 * operating frequency of the device */
151 #define TARGET_NAND_STD_DELAY 25 // In cpu cycles
153 /**
154 * @brief
155 * The base address of the I2C peripheral, and the module divisor of the cpu clock
156 */
157 #define DEVICE_I2C_BASE 0x02b04000
158 #define DEVICE_I2C_MODULE_DIVISOR 6