27 #undef DWMAC_DMA_DEBUG
28 #ifdef DWMAC_DMA_DEBUG
29 #define DWMAC_LIB_DBG(fmt, args...) printk(fmt, ## args)
31 #define DWMAC_LIB_DBG(fmt, args...) do { } while (0)
34 #define GMAC_HI_REG_AE 0x80000000
80 #ifdef DWMAC_DMA_DEBUG
81 static void show_tx_process_state(
unsigned int status)
88 pr_info(
"- TX (Stopped): Reset or Stop command\n");
91 pr_info(
"- TX (Running):Fetching the Tx desc\n");
94 pr_info(
"- TX (Running): Waiting for end of tx\n");
97 pr_info(
"- TX (Running): Reading the data "
98 "and queuing the data into the Tx buf\n");
101 pr_info(
"- TX (Suspended): Tx Buff Underflow "
102 "or an unavailable Transmit descriptor\n");
105 pr_info(
"- TX (Running): Closing Tx descriptor\n");
112 static void show_rx_process_state(
unsigned int status)
119 pr_info(
"- RX (Stopped): Reset or Stop command\n");
122 pr_info(
"- RX (Running): Fetching the Rx desc\n");
125 pr_info(
"- RX (Running):Checking for end of pkt\n");
128 pr_info(
"- RX (Running): Waiting for Rx pkt\n");
131 pr_info(
"- RX (Suspended): Unavailable Rx buf\n");
134 pr_info(
"- RX (Running): Closing Rx descriptor\n");
137 pr_info(
"- RX(Running): Flushing the current frame"
138 " from the Rx buf\n");
141 pr_info(
"- RX (Running): Queuing the Rx frame"
142 " from the Rx buf into memory\n");
158 #ifdef DWMAC_DMA_DEBUG
160 show_tx_process_state(intr_status);
161 show_rx_process_state(intr_status);
216 pr_info(
"%s: unexpected status %08x\n", __func__, intr_status);
233 unsigned int high,
unsigned int low)
237 data = (addr[5] << 8) | addr[4];
243 data = (addr[3] << 24) | (addr[2] << 16) | (addr[1] << 8) | addr[0];
244 writel(data, ioaddr + low);
261 unsigned int high,
unsigned int low)
263 unsigned int hi_addr, lo_addr;
266 hi_addr =
readl(ioaddr + high);
267 lo_addr =
readl(ioaddr + low);
270 addr[0] = lo_addr & 0xff;
271 addr[1] = (lo_addr >> 8) & 0xff;
272 addr[2] = (lo_addr >> 16) & 0xff;
273 addr[3] = (lo_addr >> 24) & 0xff;
274 addr[4] = hi_addr & 0xff;
275 addr[5] = (hi_addr >> 8) & 0xff;