2 * R8A66597 HCD (Host Controller Driver) for u-boot
4 * Copyright (C) 2008 Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
6 * SPDX-License-Identifier: GPL-2.0
16 #define R8A66597_DPRINT printf
18 #define R8A66597_DPRINT(...)
21 static const char hcd_name[] = "r8a66597_hcd";
22 static struct r8a66597 gr8a66597;
24 static void get_hub_data(struct usb_device *dev, u16 *hub_devnum, u16 *hubport)
31 /* check a device connected to root_hub */
32 if ((dev->parent && dev->parent->devnum == 1) ||
36 for (i = 0; i < USB_MAXCHILDREN; i++) {
37 if (dev->parent->children[i] == dev) {
38 *hub_devnum = (u8)dev->parent->devnum;
44 printf("get_hub_data error.\n");
47 static void set_devadd(struct r8a66597 *r8a66597, u8 r8a66597_address,
48 struct usb_device *dev, int port)
50 u16 val, usbspd, upphub, hubport;
51 unsigned long devadd_reg = get_devadd_addr(r8a66597_address);
53 get_hub_data(dev, &upphub, &hubport);
54 usbspd = r8a66597->speed;
55 val = (upphub << 11) | (hubport << 8) | (usbspd << 6) | (port & 0x0001);
56 r8a66597_write(r8a66597, val, devadd_reg);
59 static int r8a66597_clock_enable(struct r8a66597 *r8a66597)
64 #if defined(CONFIG_SUPERH_ON_CHIP_R8A66597)
66 r8a66597_write(r8a66597, SCKE, SYSCFG0);
67 tmp = r8a66597_read(r8a66597, SYSCFG0);
69 printf("register access fail.\n");
72 } while ((tmp & SCKE) != SCKE);
73 r8a66597_write(r8a66597, 0x04, 0x02);
76 r8a66597_write(r8a66597, USBE, SYSCFG0);
77 tmp = r8a66597_read(r8a66597, SYSCFG0);
79 printf("register access fail.\n");
82 } while ((tmp & USBE) != USBE);
83 r8a66597_bclr(r8a66597, USBE, SYSCFG0);
84 r8a66597_mdfy(r8a66597, CONFIG_R8A66597_XTAL, XTAL, SYSCFG0);
87 r8a66597_bset(r8a66597, XCKE, SYSCFG0);
90 tmp = r8a66597_read(r8a66597, SYSCFG0);
92 printf("register access fail.\n");
95 } while ((tmp & SCKE) != SCKE);
96 #endif /* #if defined(CONFIG_SUPERH_ON_CHIP_R8A66597) */
101 static void r8a66597_clock_disable(struct r8a66597 *r8a66597)
103 r8a66597_bclr(r8a66597, SCKE, SYSCFG0);
105 #if !defined(CONFIG_SUPERH_ON_CHIP_R8A66597)
106 r8a66597_bclr(r8a66597, PLLC, SYSCFG0);
107 r8a66597_bclr(r8a66597, XCKE, SYSCFG0);
108 r8a66597_bclr(r8a66597, USBE, SYSCFG0);
112 static void r8a66597_enable_port(struct r8a66597 *r8a66597, int port)
116 val = port ? DRPD : DCFM | DRPD;
117 r8a66597_bset(r8a66597, val, get_syscfg_reg(port));
118 r8a66597_bset(r8a66597, HSE, get_syscfg_reg(port));
120 r8a66597_write(r8a66597, BURST | CPU_ADR_RD_WR, get_dmacfg_reg(port));
123 static void r8a66597_disable_port(struct r8a66597 *r8a66597, int port)
127 r8a66597_write(r8a66597, 0, get_intenb_reg(port));
128 r8a66597_write(r8a66597, 0, get_intsts_reg(port));
130 r8a66597_port_power(r8a66597, port, 0);
133 tmp = r8a66597_read(r8a66597, SOFCFG) & EDGESTS;
135 } while (tmp == EDGESTS);
137 val = port ? DRPD : DCFM | DRPD;
138 r8a66597_bclr(r8a66597, val, get_syscfg_reg(port));
139 r8a66597_bclr(r8a66597, HSE, get_syscfg_reg(port));
142 static int enable_controller(struct r8a66597 *r8a66597)
146 ret = r8a66597_clock_enable(r8a66597);
150 r8a66597_bset(r8a66597, CONFIG_R8A66597_LDRV & LDRV, PINCFG);
151 r8a66597_bset(r8a66597, USBE, SYSCFG0);
153 r8a66597_bset(r8a66597, INTL, SOFCFG);
154 r8a66597_write(r8a66597, 0, INTENB0);
155 for (port = 0; port < R8A66597_MAX_ROOT_HUB; port++)
156 r8a66597_write(r8a66597, 0, get_intenb_reg(port));
158 r8a66597_bset(r8a66597, CONFIG_R8A66597_ENDIAN & BIGEND, CFIFOSEL);
159 r8a66597_bset(r8a66597, CONFIG_R8A66597_ENDIAN & BIGEND, D0FIFOSEL);
160 r8a66597_bset(r8a66597, CONFIG_R8A66597_ENDIAN & BIGEND, D1FIFOSEL);
161 r8a66597_bset(r8a66597, TRNENSEL, SOFCFG);
163 for (port = 0; port < R8A66597_MAX_ROOT_HUB; port++)
164 r8a66597_enable_port(r8a66597, port);
169 static void disable_controller(struct r8a66597 *r8a66597)
173 if (!(r8a66597_read(r8a66597, SYSCFG0) & USBE))
176 r8a66597_write(r8a66597, 0, INTENB0);
177 r8a66597_write(r8a66597, 0, INTSTS0);
179 r8a66597_write(r8a66597, 0, D0FIFOSEL);
180 r8a66597_write(r8a66597, 0, D1FIFOSEL);
181 r8a66597_write(r8a66597, 0, DCPCFG);
182 r8a66597_write(r8a66597, 0x40, DCPMAXP);
183 r8a66597_write(r8a66597, 0, DCPCTR);
185 for (i = 0; i <= 10; i++)
186 r8a66597_write(r8a66597, 0, get_devadd_addr(i));
187 for (i = 1; i <= 5; i++) {
188 r8a66597_write(r8a66597, 0, get_pipetre_addr(i));
189 r8a66597_write(r8a66597, 0, get_pipetrn_addr(i));
191 for (i = 1; i < R8A66597_MAX_NUM_PIPE; i++) {
192 r8a66597_write(r8a66597, 0, get_pipectr_addr(i));
193 r8a66597_write(r8a66597, i, PIPESEL);
194 r8a66597_write(r8a66597, 0, PIPECFG);
195 r8a66597_write(r8a66597, 0, PIPEBUF);
196 r8a66597_write(r8a66597, 0, PIPEMAXP);
197 r8a66597_write(r8a66597, 0, PIPEPERI);
200 for (i = 0; i < R8A66597_MAX_ROOT_HUB; i++)
201 r8a66597_disable_port(r8a66597, i);
203 r8a66597_clock_disable(r8a66597);
206 static void r8a66597_reg_wait(struct r8a66597 *r8a66597, unsigned long reg,
213 tmp = r8a66597_read(r8a66597, reg);
215 printf("register%lx, loop %x is timeout\n", reg, loop);
218 } while ((tmp & mask) != loop);
221 static void pipe_buffer_setting(struct r8a66597 *r8a66597,
222 struct usb_device *dev, unsigned long pipe)
225 u16 pipenum, bufnum, maxpacket;
227 if (usb_pipein(pipe)) {
228 pipenum = BULK_IN_PIPENUM;
229 bufnum = BULK_IN_BUFNUM;
230 maxpacket = dev->epmaxpacketin[usb_pipeendpoint(pipe)];
232 pipenum = BULK_OUT_PIPENUM;
233 bufnum = BULK_OUT_BUFNUM;
234 maxpacket = dev->epmaxpacketout[usb_pipeendpoint(pipe)];
237 if (r8a66597->pipe_config & (1 << pipenum))
239 r8a66597->pipe_config |= (1 << pipenum);
241 r8a66597_bset(r8a66597, ACLRM, get_pipectr_addr(pipenum));
242 r8a66597_bclr(r8a66597, ACLRM, get_pipectr_addr(pipenum));
243 r8a66597_write(r8a66597, pipenum, PIPESEL);
245 /* FIXME: This driver support bulk transfer only. */
246 if (!usb_pipein(pipe))
249 val |= R8A66597_SHTNAK;
250 val |= R8A66597_BULK | R8A66597_DBLB | usb_pipeendpoint(pipe);
251 r8a66597_write(r8a66597, val, PIPECFG);
253 r8a66597_write(r8a66597, (8 << 10) | bufnum, PIPEBUF);
254 r8a66597_write(r8a66597, make_devsel(usb_pipedevice(pipe)) |
255 maxpacket, PIPEMAXP);
256 r8a66597_write(r8a66597, 0, PIPEPERI);
257 r8a66597_write(r8a66597, SQCLR, get_pipectr_addr(pipenum));
260 static int send_setup_packet(struct r8a66597 *r8a66597, struct usb_device *dev,
261 struct devrequest *setup)
264 unsigned short *p = (unsigned short *)setup;
265 unsigned long setup_addr = USBREQ;
268 u16 devsel = setup->request == USB_REQ_SET_ADDRESS ? 0 : dev->devnum;
270 r8a66597_write(r8a66597, make_devsel(devsel) |
271 (8 << dev->maxpacketsize), DCPMAXP);
272 r8a66597_write(r8a66597, ~(SIGN | SACK), INTSTS1);
274 for (i = 0; i < 4; i++) {
275 r8a66597_write(r8a66597, le16_to_cpu(p[i]), setup_addr);
278 r8a66597_write(r8a66597, ~0x0001, BRDYSTS);
279 r8a66597_write(r8a66597, SUREQ, DCPCTR);
282 intsts1 = r8a66597_read(r8a66597, INTSTS1);
285 if (intsts1 & SIGN) {
286 printf("setup packet send error\n");
290 printf("setup packet timeout\n");
299 static int send_bulk_packet(struct r8a66597 *r8a66597, struct usb_device *dev,
300 unsigned long pipe, void *buffer, int transfer_len)
306 R8A66597_DPRINT("%s\n", __func__);
308 r8a66597_mdfy(r8a66597, MBW | BULK_OUT_PIPENUM,
309 MBW | CURPIPE, CFIFOSEL);
310 r8a66597_reg_wait(r8a66597, CFIFOSEL, CURPIPE, BULK_OUT_PIPENUM);
311 tmp = r8a66597_read(r8a66597, CFIFOCTR);
312 if ((tmp & FRDY) == 0) {
313 printf("%s FRDY is not set (%x)\n", __func__, tmp);
317 /* prepare parameters */
318 bufsize = dev->epmaxpacketout[usb_pipeendpoint(pipe)];
319 buf = (u16 *)(buffer + dev->act_len);
320 size = min((int)bufsize, transfer_len - dev->act_len);
323 r8a66597_write(r8a66597, ~(1 << BULK_OUT_PIPENUM), BEMPSTS);
325 r8a66597_write_fifo(r8a66597, CFIFO, buf, size);
326 r8a66597_write(r8a66597, BVAL, CFIFOCTR);
329 /* update parameters */
330 dev->act_len += size;
332 r8a66597_mdfy(r8a66597, PID_BUF, PID,
333 get_pipectr_addr(BULK_OUT_PIPENUM));
335 while (!(r8a66597_read(r8a66597, BEMPSTS) & (1 << BULK_OUT_PIPENUM)))
338 r8a66597_write(r8a66597, ~(1 << BULK_OUT_PIPENUM), BEMPSTS);
340 if (dev->act_len >= transfer_len)
341 r8a66597_mdfy(r8a66597, PID_NAK, PID,
342 get_pipectr_addr(BULK_OUT_PIPENUM));
347 static int receive_bulk_packet(struct r8a66597 *r8a66597,
348 struct usb_device *dev,
350 void *buffer, int transfer_len)
354 const u16 pipenum = BULK_IN_PIPENUM;
356 int maxpacket = dev->epmaxpacketin[usb_pipeendpoint(pipe)];
358 R8A66597_DPRINT("%s\n", __func__);
361 if (dev->act_len == 0) {
362 r8a66597_mdfy(r8a66597, PID_NAK, PID,
363 get_pipectr_addr(pipenum));
364 r8a66597_write(r8a66597, ~(1 << pipenum), BRDYSTS);
366 r8a66597_write(r8a66597, TRCLR, get_pipetre_addr(pipenum));
367 r8a66597_write(r8a66597,
368 (transfer_len + maxpacket - 1) / maxpacket,
369 get_pipetrn_addr(pipenum));
370 r8a66597_bset(r8a66597, TRENB, get_pipetre_addr(pipenum));
372 r8a66597_mdfy(r8a66597, PID_BUF, PID,
373 get_pipectr_addr(pipenum));
376 r8a66597_mdfy(r8a66597, MBW | pipenum, MBW | CURPIPE, CFIFOSEL);
377 r8a66597_reg_wait(r8a66597, CFIFOSEL, CURPIPE, pipenum);
379 while (!(r8a66597_read(r8a66597, BRDYSTS) & (1 << pipenum)))
382 r8a66597_write(r8a66597, ~(1 << pipenum), BRDYSTS);
384 tmp = r8a66597_read(r8a66597, CFIFOCTR);
385 if ((tmp & FRDY) == 0) {
386 printf("%s FRDY is not set. (%x)\n", __func__, tmp);
390 buf = (u16 *)(buffer + dev->act_len);
391 rcv_len = tmp & DTLN;
392 dev->act_len += rcv_len;
396 r8a66597_write(r8a66597, BCLR, CFIFOCTR);
398 r8a66597_read_fifo(r8a66597, CFIFO, buf, rcv_len);
404 static int receive_control_packet(struct r8a66597 *r8a66597,
405 struct usb_device *dev,
406 void *buffer, int transfer_len)
411 /* FIXME: limit transfer size : 64byte or less */
413 r8a66597_bclr(r8a66597, R8A66597_DIR, DCPCFG);
414 r8a66597_mdfy(r8a66597, 0, ISEL | CURPIPE, CFIFOSEL);
415 r8a66597_reg_wait(r8a66597, CFIFOSEL, CURPIPE, 0);
416 r8a66597_bset(r8a66597, SQSET, DCPCTR);
417 r8a66597_write(r8a66597, BCLR, CFIFOCTR);
418 r8a66597_mdfy(r8a66597, PID_BUF, PID, DCPCTR);
420 while (!(r8a66597_read(r8a66597, BRDYSTS) & 0x0001))
423 r8a66597_write(r8a66597, ~0x0001, BRDYSTS);
425 r8a66597_mdfy(r8a66597, MBW, MBW | CURPIPE, CFIFOSEL);
426 r8a66597_reg_wait(r8a66597, CFIFOSEL, CURPIPE, 0);
428 tmp = r8a66597_read(r8a66597, CFIFOCTR);
429 if ((tmp & FRDY) == 0) {
430 printf("%s FRDY is not set. (%x)\n", __func__, tmp);
434 rcv_len = tmp & DTLN;
435 dev->act_len += rcv_len;
437 r8a66597_mdfy(r8a66597, PID_NAK, PID, DCPCTR);
441 r8a66597_write(r8a66597, BCLR, DCPCTR);
443 r8a66597_read_fifo(r8a66597, CFIFO, buffer, rcv_len);
449 static int send_status_packet(struct r8a66597 *r8a66597,
452 r8a66597_bset(r8a66597, SQSET, DCPCTR);
453 r8a66597_mdfy(r8a66597, PID_NAK, PID, DCPCTR);
455 if (usb_pipein(pipe)) {
456 r8a66597_bset(r8a66597, R8A66597_DIR, DCPCFG);
457 r8a66597_mdfy(r8a66597, ISEL, ISEL | CURPIPE, CFIFOSEL);
458 r8a66597_reg_wait(r8a66597, CFIFOSEL, CURPIPE, 0);
459 r8a66597_write(r8a66597, ~BEMP0, BEMPSTS);
460 r8a66597_write(r8a66597, BCLR | BVAL, CFIFOCTR);
462 r8a66597_bclr(r8a66597, R8A66597_DIR, DCPCFG);
463 r8a66597_mdfy(r8a66597, 0, ISEL | CURPIPE, CFIFOSEL);
464 r8a66597_reg_wait(r8a66597, CFIFOSEL, CURPIPE, 0);
465 r8a66597_write(r8a66597, BCLR, CFIFOCTR);
467 r8a66597_mdfy(r8a66597, PID_BUF, PID, DCPCTR);
469 while (!(r8a66597_read(r8a66597, BEMPSTS) & 0x0001))
476 static void r8a66597_check_syssts(struct r8a66597 *r8a66597, int port)
478 int count = R8A66597_MAX_SAMPLING;
479 unsigned short syssts, old_syssts;
481 R8A66597_DPRINT("%s\n", __func__);
483 old_syssts = r8a66597_read(r8a66597, get_syssts_reg(port) & LNST);
485 mdelay(R8A66597_RH_POLL_TIME);
487 syssts = r8a66597_read(r8a66597, get_syssts_reg(port) & LNST);
488 if (syssts == old_syssts) {
491 count = R8A66597_MAX_SAMPLING;
497 static void r8a66597_bus_reset(struct r8a66597 *r8a66597, int port)
500 r8a66597_mdfy(r8a66597, USBRST, USBRST | UACT, get_dvstctr_reg(port));
502 r8a66597_mdfy(r8a66597, UACT, USBRST | UACT, get_dvstctr_reg(port));
506 static int check_usb_device_connecting(struct r8a66597 *r8a66597)
508 int timeout = 10000; /* 100usec * 10000 = 1sec */
511 for (i = 0; i < 5; i++) {
512 /* check a usb cable connect */
513 while (!(r8a66597_read(r8a66597, INTSTS1) & ATTCH)) {
515 printf("%s timeout.\n", __func__);
521 /* check a data line */
522 r8a66597_check_syssts(r8a66597, 0);
524 r8a66597_bus_reset(r8a66597, 0);
525 r8a66597->speed = get_rh_usb_speed(r8a66597, 0);
527 if (!(r8a66597_read(r8a66597, INTSTS1) & DTCH)) {
528 r8a66597->port_change = USB_PORT_STAT_C_CONNECTION;
529 r8a66597->port_status = USB_PORT_STAT_CONNECTION |
530 USB_PORT_STAT_ENABLE;
531 return 0; /* success */
534 R8A66597_DPRINT("USB device has detached. retry = %d\n", i);
535 r8a66597_write(r8a66597, ~DTCH, INTSTS1);
538 return -1; /* fail */
541 /*-------------------------------------------------------------------------*
543 *-------------------------------------------------------------------------*/
545 #include <usbroothubdes.h>
547 static int r8a66597_submit_rh_msg(struct usb_device *dev, unsigned long pipe,
548 void *buffer, int transfer_len, struct devrequest *cmd)
550 struct r8a66597 *r8a66597 = &gr8a66597;
551 int leni = transfer_len;
557 unsigned char data[32];
559 R8A66597_DPRINT("%s\n", __func__);
561 if (usb_pipeint(pipe)) {
562 printf("Root-Hub submit IRQ: NOT implemented");
566 bmRType_bReq = cmd->requesttype | (cmd->request << 8);
567 wValue = cpu_to_le16 (cmd->value);
568 wLength = cpu_to_le16 (cmd->length);
570 switch (bmRType_bReq) {
572 *(__u16 *)buffer = cpu_to_le16(1);
575 case RH_GET_STATUS | RH_INTERFACE:
576 *(__u16 *)buffer = cpu_to_le16(0);
579 case RH_GET_STATUS | RH_ENDPOINT:
580 *(__u16 *)buffer = cpu_to_le16(0);
583 case RH_GET_STATUS | RH_CLASS:
584 *(__u32 *)buffer = cpu_to_le32(0);
587 case RH_GET_STATUS | RH_OTHER | RH_CLASS:
588 *(__u32 *)buffer = cpu_to_le32(r8a66597->port_status |
589 (r8a66597->port_change << 16));
592 case RH_CLEAR_FEATURE | RH_ENDPOINT:
593 case RH_CLEAR_FEATURE | RH_CLASS:
596 case RH_CLEAR_FEATURE | RH_OTHER | RH_CLASS:
598 case RH_C_PORT_CONNECTION:
599 r8a66597->port_change &= ~USB_PORT_STAT_C_CONNECTION;
604 case RH_SET_FEATURE | RH_OTHER | RH_CLASS:
606 case (RH_PORT_SUSPEND):
608 case (RH_PORT_RESET):
609 r8a66597_bus_reset(r8a66597, 0);
611 case (RH_PORT_POWER):
613 case (RH_PORT_ENABLE):
618 gr8a66597.rh_devnum = wValue;
620 case RH_GET_DESCRIPTOR:
621 switch ((wValue & 0xff00) >> 8) {
622 case (0x01): /* device descriptor */
623 len = min_t(unsigned int,
626 sizeof(root_hub_dev_des),
628 memcpy(buffer, root_hub_dev_des, len);
630 case (0x02): /* configuration descriptor */
631 len = min_t(unsigned int,
634 sizeof(root_hub_config_des),
636 memcpy(buffer, root_hub_config_des, len);
638 case (0x03): /* string descriptors */
639 if (wValue == 0x0300) {
640 len = min_t(unsigned int,
643 sizeof(root_hub_str_index0),
645 memcpy(buffer, root_hub_str_index0, len);
647 if (wValue == 0x0301) {
648 len = min_t(unsigned int,
651 sizeof(root_hub_str_index1),
653 memcpy(buffer, root_hub_str_index1, len);
657 stat = USB_ST_STALLED;
661 case RH_GET_DESCRIPTOR | RH_CLASS:
663 __u32 temp = 0x00000001;
665 data[0] = 9; /* min length; */
667 data[2] = temp & RH_A_NDP;
671 if (temp & RH_A_NOCP)
673 else if (temp & RH_A_OCPM)
676 /* corresponds to data[4-7] */
677 data[5] = (temp & RH_A_POTPGT) >> 24;
678 data[7] = temp & RH_B_DR;
683 data[8] = (temp & RH_B_DR) >> 8;
684 data[10] = data[9] = 0xff;
687 len = min_t(unsigned int, leni,
688 min_t(unsigned int, data[0], wLength));
689 memcpy(buffer, data, len);
693 case RH_GET_CONFIGURATION:
694 *(__u8 *) buffer = 0x01;
697 case RH_SET_CONFIGURATION:
700 R8A66597_DPRINT("unsupported root hub command");
701 stat = USB_ST_STALLED;
706 len = min_t(int, len, leni);
714 int submit_bulk_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
717 struct r8a66597 *r8a66597 = &gr8a66597;
720 R8A66597_DPRINT("%s\n", __func__);
721 R8A66597_DPRINT("pipe = %08x, buffer = %p, len = %d, devnum = %d\n",
722 pipe, buffer, transfer_len, dev->devnum);
724 set_devadd(r8a66597, dev->devnum, dev, 0);
726 pipe_buffer_setting(r8a66597, dev, pipe);
729 while (dev->act_len < transfer_len && ret == 0) {
733 if (usb_pipein(pipe))
734 ret = receive_bulk_packet(r8a66597, dev, pipe, buffer,
737 ret = send_bulk_packet(r8a66597, dev, pipe, buffer,
747 int submit_control_msg(struct usb_device *dev, unsigned long pipe,
748 void *buffer, int transfer_len, struct devrequest *setup)
750 struct r8a66597 *r8a66597 = &gr8a66597;
751 u16 r8a66597_address = setup->request == USB_REQ_SET_ADDRESS ?
754 R8A66597_DPRINT("%s\n", __func__);
755 if (usb_pipedevice(pipe) == r8a66597->rh_devnum)
756 return r8a66597_submit_rh_msg(dev, pipe, buffer, transfer_len,
759 R8A66597_DPRINT("%s: setup\n", __func__);
760 set_devadd(r8a66597, r8a66597_address, dev, 0);
762 if (send_setup_packet(r8a66597, dev, setup) < 0) {
763 printf("setup packet send error\n");
768 if (usb_pipein(pipe))
769 if (receive_control_packet(r8a66597, dev, buffer,
773 if (send_status_packet(r8a66597, pipe) < 0)
781 int submit_int_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
782 int transfer_len, int interval)
785 R8A66597_DPRINT("%s\n", __func__);
789 int usb_lowlevel_init(int index, enum usb_init_type init, void **controller)
791 struct r8a66597 *r8a66597 = &gr8a66597;
793 R8A66597_DPRINT("%s\n", __func__);
795 memset(r8a66597, 0, sizeof(*r8a66597));
796 r8a66597->reg = CONFIG_R8A66597_BASE_ADDR;
798 disable_controller(r8a66597);
801 enable_controller(r8a66597);
802 r8a66597_port_power(r8a66597, 0 , 1);
804 /* check usb device */
805 check_usb_device_connecting(r8a66597);
812 int usb_lowlevel_stop(int index)
814 disable_controller(&gr8a66597);