24 #include <asm/byteorder.h>
39 #define COMM_ACK 0x0FED
40 #define COMM_NAK 0xDEAD
42 #define COMM_RESET 0xFA50
43 #define COMM_EXEC_INT 0xCE01
44 #define COMM_INT_NUM 0x01C2
47 #define COMM_R(x) (0x01C4 + 2 * (x))
49 #define HUSB_SIE_pCurrentTDPtr(x) ((x) ? 0x01B2 : 0x01B0)
50 #define HUSB_SIE_pTDListDone_Sem(x) ((x) ? 0x01B8 : 0x01B6)
51 #define HUSB_pEOT 0x01B4
55 #define HUSB_SIE_INIT_INT(x) ((x) ? 0x0073 : 0x0072)
56 #define HUSB_RESET_INT 0x0074
58 #define SUSB_INIT_INT 0x0071
59 #define SUSB_INIT_INT_LOC (SUSB_INIT_INT * 2)
98 value = hpi_read_word_nolock(dev, reg);
99 spin_unlock_irqrestore(&dev->
hpi.lock, flags);
107 hpi_write_reg(dev,
HPI_DATA, value);
115 hpi_write_word_nolock(dev, reg, value);
116 spin_unlock_irqrestore(&dev->
hpi.lock, flags);
131 for (i = 0; i <
count; i++)
134 spin_unlock_irqrestore(&dev->
hpi.lock, flags);
148 for (i = 0; i <
count; i++)
151 spin_unlock_irqrestore(&dev->
hpi.lock, flags);
160 value = hpi_read_word_nolock(dev, reg);
161 hpi_write_word_nolock(dev, reg, value | mask);
162 spin_unlock_irqrestore(&dev->
hpi.lock, flags);
171 value = hpi_read_word_nolock(dev, reg);
172 hpi_write_word_nolock(dev, reg, value & ~mask);
173 spin_unlock_irqrestore(&dev->
hpi.lock, flags);
183 spin_unlock_irqrestore(&dev->
hpi.lock, flags);
194 spin_unlock_irqrestore(&dev->
hpi.lock, flags);
206 spin_unlock_irqrestore(&dev->
hpi.lock, flags);
247 return (res == 0) ? -
EIO : 0;
257 val = hpi_read_word(dev,
SIEMSG_REG(sie_num));
292 hpi_write_word(dev,
COMM_R(i), data->
regs[i]);
294 rc = ll_recv_msg(dev);
310 static inline void c67x00_ll_husb_sie_init(
struct c67x00_sie *sie)
351 c67x00_ll_husb_sie_init(sie);
357 "SIE %d not set to host mode\n", sie->
sie_num);
382 dev->
hpi.lcp.last_msg = hpi_recv_mbox(dev);
394 rc = ll_recv_msg(dev);
412 if (addr + len > 0xffff) {
414 "Trying to write beyond writable region!\n");
421 tmp = hpi_read_word(dev, addr - 1);
422 tmp = (tmp & 0x00ff) | (*buf++ << 8);
423 hpi_write_word(dev, addr - 1, tmp);
428 hpi_write_words_le16(dev, addr, (
__le16 *)buf, len / 2);
435 tmp = hpi_read_word(dev, addr);
436 tmp = (tmp & 0xff00) | *buf;
437 hpi_write_word(dev, addr, tmp);
453 tmp = hpi_read_word(dev, addr - 1);
454 *buf++ = (tmp >> 8) & 0x00ff;
459 hpi_read_words_le16(dev, addr, (
__le16 *)buf, len / 2);
466 tmp = hpi_read_word(dev, addr);
476 init_completion(&dev->
hpi.lcp.msg_received);