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
17 #define R8A66597_DPRINT printf
19 #define R8A66597_DPRINT(...)
22 static const char hcd_name[] = "r8a66597_hcd";
23 static struct r8a66597 gr8a66597;
25 static void get_hub_data(struct usb_device *dev, u16 *hub_devnum, u16 *hubport)
32 /* check a device connected to root_hub */
33 if ((dev->parent && dev->parent->devnum == 1) ||
37 for (i = 0; i < USB_MAXCHILDREN; i++) {
38 if (dev->parent->children[i] == dev) {
39 *hub_devnum = (u8)dev->parent->devnum;
45 printf("get_hub_data error.\n");
48 static void set_devadd(struct r8a66597 *r8a66597, u8 r8a66597_address,
49 struct usb_device *dev, int port)
51 u16 val, usbspd, upphub, hubport;
52 unsigned long devadd_reg = get_devadd_addr(r8a66597_address);
54 get_hub_data(dev, &upphub, &hubport);
55 usbspd = r8a66597->speed;
56 val = (upphub << 11) | (hubport << 8) | (usbspd << 6) | (port & 0x0001);
57 r8a66597_write(r8a66597, val, devadd_reg);
60 static int r8a66597_clock_enable(struct r8a66597 *r8a66597)
65 #if defined(CONFIG_SUPERH_ON_CHIP_R8A66597)
67 r8a66597_write(r8a66597, SCKE, SYSCFG0);
68 tmp = r8a66597_read(r8a66597, SYSCFG0);
70 printf("register access fail.\n");
73 } while ((tmp & SCKE) != SCKE);
74 r8a66597_write(r8a66597, 0x04, 0x02);
77 r8a66597_write(r8a66597, USBE, SYSCFG0);
78 tmp = r8a66597_read(r8a66597, SYSCFG0);
80 printf("register access fail.\n");
83 } while ((tmp & USBE) != USBE);
84 r8a66597_bclr(r8a66597, USBE, SYSCFG0);
85 r8a66597_mdfy(r8a66597, CONFIG_R8A66597_XTAL, XTAL, SYSCFG0);
88 r8a66597_bset(r8a66597, XCKE, SYSCFG0);
91 tmp = r8a66597_read(r8a66597, SYSCFG0);
93 printf("register access fail.\n");
96 } while ((tmp & SCKE) != SCKE);
97 #endif /* #if defined(CONFIG_SUPERH_ON_CHIP_R8A66597) */
102 static void r8a66597_clock_disable(struct r8a66597 *r8a66597)
104 r8a66597_bclr(r8a66597, SCKE, SYSCFG0);
106 #if !defined(CONFIG_SUPERH_ON_CHIP_R8A66597)
107 r8a66597_bclr(r8a66597, PLLC, SYSCFG0);
108 r8a66597_bclr(r8a66597, XCKE, SYSCFG0);
109 r8a66597_bclr(r8a66597, USBE, SYSCFG0);
113 static void r8a66597_enable_port(struct r8a66597 *r8a66597, int port)
117 val = port ? DRPD : DCFM | DRPD;
118 r8a66597_bset(r8a66597, val, get_syscfg_reg(port));
119 r8a66597_bset(r8a66597, HSE, get_syscfg_reg(port));
121 r8a66597_write(r8a66597, BURST | CPU_ADR_RD_WR, get_dmacfg_reg(port));
124 static void r8a66597_disable_port(struct r8a66597 *r8a66597, int port)
128 r8a66597_write(r8a66597, 0, get_intenb_reg(port));
129 r8a66597_write(r8a66597, 0, get_intsts_reg(port));
131 r8a66597_port_power(r8a66597, port, 0);
134 tmp = r8a66597_read(r8a66597, SOFCFG) & EDGESTS;
136 } while (tmp == EDGESTS);
138 val = port ? DRPD : DCFM | DRPD;
139 r8a66597_bclr(r8a66597, val, get_syscfg_reg(port));
140 r8a66597_bclr(r8a66597, HSE, get_syscfg_reg(port));
143 static int enable_controller(struct r8a66597 *r8a66597)
147 ret = r8a66597_clock_enable(r8a66597);
151 r8a66597_bset(r8a66597, CONFIG_R8A66597_LDRV & LDRV, PINCFG);
152 r8a66597_bset(r8a66597, USBE, SYSCFG0);
154 r8a66597_bset(r8a66597, INTL, SOFCFG);
155 r8a66597_write(r8a66597, 0, INTENB0);
156 for (port = 0; port < R8A66597_MAX_ROOT_HUB; port++)
157 r8a66597_write(r8a66597, 0, get_intenb_reg(port));
159 r8a66597_bset(r8a66597, CONFIG_R8A66597_ENDIAN & BIGEND, CFIFOSEL);
160 r8a66597_bset(r8a66597, CONFIG_R8A66597_ENDIAN & BIGEND, D0FIFOSEL);
161 r8a66597_bset(r8a66597, CONFIG_R8A66597_ENDIAN & BIGEND, D1FIFOSEL);
162 r8a66597_bset(r8a66597, TRNENSEL, SOFCFG);
164 for (port = 0; port < R8A66597_MAX_ROOT_HUB; port++)
165 r8a66597_enable_port(r8a66597, port);
170 static void disable_controller(struct r8a66597 *r8a66597)
174 if (!(r8a66597_read(r8a66597, SYSCFG0) & USBE))
177 r8a66597_write(r8a66597, 0, INTENB0);
178 r8a66597_write(r8a66597, 0, INTSTS0);
180 r8a66597_write(r8a66597, 0, D0FIFOSEL);
181 r8a66597_write(r8a66597, 0, D1FIFOSEL);
182 r8a66597_write(r8a66597, 0, DCPCFG);
183 r8a66597_write(r8a66597, 0x40, DCPMAXP);
184 r8a66597_write(r8a66597, 0, DCPCTR);
186 for (i = 0; i <= 10; i++)
187 r8a66597_write(r8a66597, 0, get_devadd_addr(i));
188 for (i = 1; i <= 5; i++) {
189 r8a66597_write(r8a66597, 0, get_pipetre_addr(i));
190 r8a66597_write(r8a66597, 0, get_pipetrn_addr(i));
192 for (i = 1; i < R8A66597_MAX_NUM_PIPE; i++) {
193 r8a66597_write(r8a66597, 0, get_pipectr_addr(i));
194 r8a66597_write(r8a66597, i, PIPESEL);
195 r8a66597_write(r8a66597, 0, PIPECFG);
196 r8a66597_write(r8a66597, 0, PIPEBUF);
197 r8a66597_write(r8a66597, 0, PIPEMAXP);
198 r8a66597_write(r8a66597, 0, PIPEPERI);
201 for (i = 0; i < R8A66597_MAX_ROOT_HUB; i++)
202 r8a66597_disable_port(r8a66597, i);
204 r8a66597_clock_disable(r8a66597);
207 static void r8a66597_reg_wait(struct r8a66597 *r8a66597, unsigned long reg,
214 tmp = r8a66597_read(r8a66597, reg);
216 printf("register%lx, loop %x is timeout\n", reg, loop);
219 } while ((tmp & mask) != loop);
222 static void pipe_buffer_setting(struct r8a66597 *r8a66597,
223 struct usb_device *dev, unsigned long pipe)
226 u16 pipenum, bufnum, maxpacket;
228 if (usb_pipein(pipe)) {
229 pipenum = BULK_IN_PIPENUM;
230 bufnum = BULK_IN_BUFNUM;
231 maxpacket = dev->epmaxpacketin[usb_pipeendpoint(pipe)];
233 pipenum = BULK_OUT_PIPENUM;
234 bufnum = BULK_OUT_BUFNUM;
235 maxpacket = dev->epmaxpacketout[usb_pipeendpoint(pipe)];
238 if (r8a66597->pipe_config & (1 << pipenum))
240 r8a66597->pipe_config |= (1 << pipenum);
242 r8a66597_bset(r8a66597, ACLRM, get_pipectr_addr(pipenum));
243 r8a66597_bclr(r8a66597, ACLRM, get_pipectr_addr(pipenum));
244 r8a66597_write(r8a66597, pipenum, PIPESEL);
246 /* FIXME: This driver support bulk transfer only. */
247 if (!usb_pipein(pipe))
250 val |= R8A66597_SHTNAK;
251 val |= R8A66597_BULK | R8A66597_DBLB | usb_pipeendpoint(pipe);
252 r8a66597_write(r8a66597, val, PIPECFG);
254 r8a66597_write(r8a66597, (8 << 10) | bufnum, PIPEBUF);
255 r8a66597_write(r8a66597, make_devsel(usb_pipedevice(pipe)) |
256 maxpacket, PIPEMAXP);
257 r8a66597_write(r8a66597, 0, PIPEPERI);
258 r8a66597_write(r8a66597, SQCLR, get_pipectr_addr(pipenum));
261 static int send_setup_packet(struct r8a66597 *r8a66597, struct usb_device *dev,
262 struct devrequest *setup)
265 unsigned short *p = (unsigned short *)setup;
266 unsigned long setup_addr = USBREQ;
269 u16 devsel = setup->request == USB_REQ_SET_ADDRESS ? 0 : dev->devnum;
271 r8a66597_write(r8a66597, make_devsel(devsel) |
272 (8 << dev->maxpacketsize), DCPMAXP);
273 r8a66597_write(r8a66597, ~(SIGN | SACK), INTSTS1);
275 for (i = 0; i < 4; i++) {
276 r8a66597_write(r8a66597, le16_to_cpu(p[i]), setup_addr);
279 r8a66597_write(r8a66597, ~0x0001, BRDYSTS);
280 r8a66597_write(r8a66597, SUREQ, DCPCTR);
283 intsts1 = r8a66597_read(r8a66597, INTSTS1);
286 if (intsts1 & SIGN) {
287 printf("setup packet send error\n");
291 printf("setup packet timeout\n");
300 static int send_bulk_packet(struct r8a66597 *r8a66597, struct usb_device *dev,
301 unsigned long pipe, void *buffer, int transfer_len)
307 R8A66597_DPRINT("%s\n", __func__);
309 r8a66597_mdfy(r8a66597, MBW | BULK_OUT_PIPENUM,
310 MBW | CURPIPE, CFIFOSEL);
311 r8a66597_reg_wait(r8a66597, CFIFOSEL, CURPIPE, BULK_OUT_PIPENUM);
312 tmp = r8a66597_read(r8a66597, CFIFOCTR);
313 if ((tmp & FRDY) == 0) {
314 printf("%s FRDY is not set (%x)\n", __func__, tmp);
318 /* prepare parameters */
319 bufsize = dev->epmaxpacketout[usb_pipeendpoint(pipe)];
320 buf = (u16 *)(buffer + dev->act_len);
321 size = min((int)bufsize, transfer_len - dev->act_len);
324 r8a66597_write(r8a66597, ~(1 << BULK_OUT_PIPENUM), BEMPSTS);
326 r8a66597_write_fifo(r8a66597, CFIFO, buf, size);
327 r8a66597_write(r8a66597, BVAL, CFIFOCTR);
330 /* update parameters */
331 dev->act_len += size;
333 r8a66597_mdfy(r8a66597, PID_BUF, PID,
334 get_pipectr_addr(BULK_OUT_PIPENUM));
336 while (!(r8a66597_read(r8a66597, BEMPSTS) & (1 << BULK_OUT_PIPENUM)))
339 r8a66597_write(r8a66597, ~(1 << BULK_OUT_PIPENUM), BEMPSTS);
341 if (dev->act_len >= transfer_len)
342 r8a66597_mdfy(r8a66597, PID_NAK, PID,
343 get_pipectr_addr(BULK_OUT_PIPENUM));
348 static int receive_bulk_packet(struct r8a66597 *r8a66597,
349 struct usb_device *dev,
351 void *buffer, int transfer_len)
355 const u16 pipenum = BULK_IN_PIPENUM;
357 int maxpacket = dev->epmaxpacketin[usb_pipeendpoint(pipe)];
359 R8A66597_DPRINT("%s\n", __func__);
362 if (dev->act_len == 0) {
363 r8a66597_mdfy(r8a66597, PID_NAK, PID,
364 get_pipectr_addr(pipenum));
365 r8a66597_write(r8a66597, ~(1 << pipenum), BRDYSTS);
367 r8a66597_write(r8a66597, TRCLR, get_pipetre_addr(pipenum));
368 r8a66597_write(r8a66597,
369 (transfer_len + maxpacket - 1) / maxpacket,
370 get_pipetrn_addr(pipenum));
371 r8a66597_bset(r8a66597, TRENB, get_pipetre_addr(pipenum));
373 r8a66597_mdfy(r8a66597, PID_BUF, PID,
374 get_pipectr_addr(pipenum));
377 r8a66597_mdfy(r8a66597, MBW | pipenum, MBW | CURPIPE, CFIFOSEL);
378 r8a66597_reg_wait(r8a66597, CFIFOSEL, CURPIPE, pipenum);
380 while (!(r8a66597_read(r8a66597, BRDYSTS) & (1 << pipenum)))
383 r8a66597_write(r8a66597, ~(1 << pipenum), BRDYSTS);
385 tmp = r8a66597_read(r8a66597, CFIFOCTR);
386 if ((tmp & FRDY) == 0) {
387 printf("%s FRDY is not set. (%x)\n", __func__, tmp);
391 buf = (u16 *)(buffer + dev->act_len);
392 rcv_len = tmp & DTLN;
393 dev->act_len += rcv_len;
397 r8a66597_write(r8a66597, BCLR, CFIFOCTR);
399 r8a66597_read_fifo(r8a66597, CFIFO, buf, rcv_len);
405 static int receive_control_packet(struct r8a66597 *r8a66597,
406 struct usb_device *dev,
407 void *buffer, int transfer_len)
412 /* FIXME: limit transfer size : 64byte or less */
414 r8a66597_bclr(r8a66597, R8A66597_DIR, DCPCFG);
415 r8a66597_mdfy(r8a66597, 0, ISEL | CURPIPE, CFIFOSEL);
416 r8a66597_reg_wait(r8a66597, CFIFOSEL, CURPIPE, 0);
417 r8a66597_bset(r8a66597, SQSET, DCPCTR);
418 r8a66597_write(r8a66597, BCLR, CFIFOCTR);
419 r8a66597_mdfy(r8a66597, PID_BUF, PID, DCPCTR);
421 while (!(r8a66597_read(r8a66597, BRDYSTS) & 0x0001))
424 r8a66597_write(r8a66597, ~0x0001, BRDYSTS);
426 r8a66597_mdfy(r8a66597, MBW, MBW | CURPIPE, CFIFOSEL);
427 r8a66597_reg_wait(r8a66597, CFIFOSEL, CURPIPE, 0);
429 tmp = r8a66597_read(r8a66597, CFIFOCTR);
430 if ((tmp & FRDY) == 0) {
431 printf("%s FRDY is not set. (%x)\n", __func__, tmp);
435 rcv_len = tmp & DTLN;
436 dev->act_len += rcv_len;
438 r8a66597_mdfy(r8a66597, PID_NAK, PID, DCPCTR);
442 r8a66597_write(r8a66597, BCLR, DCPCTR);
444 r8a66597_read_fifo(r8a66597, CFIFO, buffer, rcv_len);
450 static int send_status_packet(struct r8a66597 *r8a66597,
453 r8a66597_bset(r8a66597, SQSET, DCPCTR);
454 r8a66597_mdfy(r8a66597, PID_NAK, PID, DCPCTR);
456 if (usb_pipein(pipe)) {
457 r8a66597_bset(r8a66597, R8A66597_DIR, DCPCFG);
458 r8a66597_mdfy(r8a66597, ISEL, ISEL | CURPIPE, CFIFOSEL);
459 r8a66597_reg_wait(r8a66597, CFIFOSEL, CURPIPE, 0);
460 r8a66597_write(r8a66597, ~BEMP0, BEMPSTS);
461 r8a66597_write(r8a66597, BCLR | BVAL, CFIFOCTR);
463 r8a66597_bclr(r8a66597, R8A66597_DIR, DCPCFG);
464 r8a66597_mdfy(r8a66597, 0, ISEL | CURPIPE, CFIFOSEL);
465 r8a66597_reg_wait(r8a66597, CFIFOSEL, CURPIPE, 0);
466 r8a66597_write(r8a66597, BCLR, CFIFOCTR);
468 r8a66597_mdfy(r8a66597, PID_BUF, PID, DCPCTR);
470 while (!(r8a66597_read(r8a66597, BEMPSTS) & 0x0001))
477 static void r8a66597_check_syssts(struct r8a66597 *r8a66597, int port)
479 int count = R8A66597_MAX_SAMPLING;
480 unsigned short syssts, old_syssts;
482 R8A66597_DPRINT("%s\n", __func__);
484 old_syssts = r8a66597_read(r8a66597, get_syssts_reg(port) & LNST);
486 mdelay(R8A66597_RH_POLL_TIME);
488 syssts = r8a66597_read(r8a66597, get_syssts_reg(port) & LNST);
489 if (syssts == old_syssts) {
492 count = R8A66597_MAX_SAMPLING;
498 static void r8a66597_bus_reset(struct r8a66597 *r8a66597, int port)
501 r8a66597_mdfy(r8a66597, USBRST, USBRST | UACT, get_dvstctr_reg(port));
503 r8a66597_mdfy(r8a66597, UACT, USBRST | UACT, get_dvstctr_reg(port));
507 static int check_usb_device_connecting(struct r8a66597 *r8a66597)
509 int timeout = 10000; /* 100usec * 10000 = 1sec */
512 for (i = 0; i < 5; i++) {
513 /* check a usb cable connect */
514 while (!(r8a66597_read(r8a66597, INTSTS1) & ATTCH)) {
516 printf("%s timeout.\n", __func__);
522 /* check a data line */
523 r8a66597_check_syssts(r8a66597, 0);
525 r8a66597_bus_reset(r8a66597, 0);
526 r8a66597->speed = get_rh_usb_speed(r8a66597, 0);
528 if (!(r8a66597_read(r8a66597, INTSTS1) & DTCH)) {
529 r8a66597->port_change = USB_PORT_STAT_C_CONNECTION;
530 r8a66597->port_status = USB_PORT_STAT_CONNECTION |
531 USB_PORT_STAT_ENABLE;
532 return 0; /* success */
535 R8A66597_DPRINT("USB device has detached. retry = %d\n", i);
536 r8a66597_write(r8a66597, ~DTCH, INTSTS1);
539 return -1; /* fail */
542 /*-------------------------------------------------------------------------*
544 *-------------------------------------------------------------------------*/
546 #include <usbroothubdes.h>
548 static int r8a66597_submit_rh_msg(struct usb_device *dev, unsigned long pipe,
549 void *buffer, int transfer_len, struct devrequest *cmd)
551 struct r8a66597 *r8a66597 = &gr8a66597;
552 int leni = transfer_len;
558 unsigned char data[32];
560 R8A66597_DPRINT("%s\n", __func__);
562 if (usb_pipeint(pipe)) {
563 printf("Root-Hub submit IRQ: NOT implemented");
567 bmRType_bReq = cmd->requesttype | (cmd->request << 8);
568 wValue = cpu_to_le16 (cmd->value);
569 wLength = cpu_to_le16 (cmd->length);
571 switch (bmRType_bReq) {
573 *(__u16 *)buffer = cpu_to_le16(1);
576 case RH_GET_STATUS | RH_INTERFACE:
577 *(__u16 *)buffer = cpu_to_le16(0);
580 case RH_GET_STATUS | RH_ENDPOINT:
581 *(__u16 *)buffer = cpu_to_le16(0);
584 case RH_GET_STATUS | RH_CLASS:
585 *(__u32 *)buffer = cpu_to_le32(0);
588 case RH_GET_STATUS | RH_OTHER | RH_CLASS:
589 *(__u32 *)buffer = cpu_to_le32(r8a66597->port_status |
590 (r8a66597->port_change << 16));
593 case RH_CLEAR_FEATURE | RH_ENDPOINT:
594 case RH_CLEAR_FEATURE | RH_CLASS:
597 case RH_CLEAR_FEATURE | RH_OTHER | RH_CLASS:
599 case RH_C_PORT_CONNECTION:
600 r8a66597->port_change &= ~USB_PORT_STAT_C_CONNECTION;
605 case RH_SET_FEATURE | RH_OTHER | RH_CLASS:
607 case (RH_PORT_SUSPEND):
609 case (RH_PORT_RESET):
610 r8a66597_bus_reset(r8a66597, 0);
612 case (RH_PORT_POWER):
614 case (RH_PORT_ENABLE):
619 gr8a66597.rh_devnum = wValue;
621 case RH_GET_DESCRIPTOR:
622 switch ((wValue & 0xff00) >> 8) {
623 case (0x01): /* device descriptor */
624 len = min_t(unsigned int,
627 sizeof(root_hub_dev_des),
629 memcpy(buffer, root_hub_dev_des, len);
631 case (0x02): /* configuration descriptor */
632 len = min_t(unsigned int,
635 sizeof(root_hub_config_des),
637 memcpy(buffer, root_hub_config_des, len);
639 case (0x03): /* string descriptors */
640 if (wValue == 0x0300) {
641 len = min_t(unsigned int,
644 sizeof(root_hub_str_index0),
646 memcpy(buffer, root_hub_str_index0, len);
648 if (wValue == 0x0301) {
649 len = min_t(unsigned int,
652 sizeof(root_hub_str_index1),
654 memcpy(buffer, root_hub_str_index1, len);
658 stat = USB_ST_STALLED;
662 case RH_GET_DESCRIPTOR | RH_CLASS:
664 __u32 temp = 0x00000001;
666 data[0] = 9; /* min length; */
668 data[2] = temp & RH_A_NDP;
672 if (temp & RH_A_NOCP)
674 else if (temp & RH_A_OCPM)
677 /* corresponds to data[4-7] */
678 data[5] = (temp & RH_A_POTPGT) >> 24;
679 data[7] = temp & RH_B_DR;
684 data[8] = (temp & RH_B_DR) >> 8;
685 data[10] = data[9] = 0xff;
688 len = min_t(unsigned int, leni,
689 min_t(unsigned int, data[0], wLength));
690 memcpy(buffer, data, len);
694 case RH_GET_CONFIGURATION:
695 *(__u8 *) buffer = 0x01;
698 case RH_SET_CONFIGURATION:
701 R8A66597_DPRINT("unsupported root hub command");
702 stat = USB_ST_STALLED;
707 len = min_t(int, len, leni);
715 int submit_bulk_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
718 struct r8a66597 *r8a66597 = &gr8a66597;
721 R8A66597_DPRINT("%s\n", __func__);
722 R8A66597_DPRINT("pipe = %08x, buffer = %p, len = %d, devnum = %d\n",
723 pipe, buffer, transfer_len, dev->devnum);
725 set_devadd(r8a66597, dev->devnum, dev, 0);
727 pipe_buffer_setting(r8a66597, dev, pipe);
730 while (dev->act_len < transfer_len && ret == 0) {
734 if (usb_pipein(pipe))
735 ret = receive_bulk_packet(r8a66597, dev, pipe, buffer,
738 ret = send_bulk_packet(r8a66597, dev, pipe, buffer,
748 int submit_control_msg(struct usb_device *dev, unsigned long pipe,
749 void *buffer, int transfer_len, struct devrequest *setup)
751 struct r8a66597 *r8a66597 = &gr8a66597;
752 u16 r8a66597_address = setup->request == USB_REQ_SET_ADDRESS ?
755 R8A66597_DPRINT("%s\n", __func__);
756 if (usb_pipedevice(pipe) == r8a66597->rh_devnum)
757 return r8a66597_submit_rh_msg(dev, pipe, buffer, transfer_len,
760 R8A66597_DPRINT("%s: setup\n", __func__);
761 set_devadd(r8a66597, r8a66597_address, dev, 0);
763 if (send_setup_packet(r8a66597, dev, setup) < 0) {
764 printf("setup packet send error\n");
769 if (usb_pipein(pipe))
770 if (receive_control_packet(r8a66597, dev, buffer,
774 if (send_status_packet(r8a66597, pipe) < 0)
782 int submit_int_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
783 int transfer_len, int interval)
786 R8A66597_DPRINT("%s\n", __func__);
790 int usb_lowlevel_init(int index, enum usb_init_type init, void **controller)
792 struct r8a66597 *r8a66597 = &gr8a66597;
794 R8A66597_DPRINT("%s\n", __func__);
796 memset(r8a66597, 0, sizeof(*r8a66597));
797 r8a66597->reg = CONFIG_R8A66597_BASE_ADDR;
799 disable_controller(r8a66597);
802 enable_controller(r8a66597);
803 r8a66597_port_power(r8a66597, 0 , 1);
805 /* check usb device */
806 check_usb_device_connecting(r8a66597);
813 int usb_lowlevel_stop(int index)
815 disable_controller(&gr8a66597);