
Hi Yoshihiro Shimoda, * Strategy 1: I add usb_cpu_init following your tutorial: int usb_cpu_init(void) { *STCBR3 = 0x18; *SRSTR = 0x18; cpu_wait_ms(50); *EXCPGCR = 0x21;//0x28; *PECR = 0x1500; cpu_wait_ms(50); *SRSTR = 0x00; *STCBR3 = 0x00; return 0; } now, I plug the USB2.0(mass storage) into board T-Engine(sh7727) and run command "usb start", the u-boot can't get decription of usb device with the errror following:
New Device 1 usb_control_msg: request: 0x6, requesttype: 0x80, value 0x100 index 0x0 length 0 x8 set address 2 usb_control_msg: request: 0x5, requesttype: 0x0, value 0x2 index 0x0 length 0x0 usb_control_msg: request: 0x6, requesttype: 0x80, value 0x100 index 0x0 length 0 x12 usb_control_msg: request: 0x6, requesttype: 0x80, value 0x200 index 0x0 length 0 x8 usb_control_msg: request: 0x6, requesttype: 0x80, value 0x200 index 0x0 length 0 x20 get_conf_no 0 Result 32, wLength 32 if 0, ep 0 if 0, ep 1 ##EP epmaxpacketin[1] = 64 * Strategy 2: I add usb_cpu_init the same strategy 1, I only add instruction "printf("&ep = %x\n",&ep);" into function usb_set_maxpacket of usb.c int usb_set_maxpacket(struct usb_device *dev) { ................................................. ................................................... ep = &dev->config.if_desc[i].ep_desc[ii]; b=ep->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK; printf("&ep = %x\n",&ep); ..................................................... ...................................................... } in this strategy, when I run command "usb start", now I can get information of USB device: Manufacturer Product USB_DRIVE SerialNumber 000000000000001000006886 2 USB Device(s) found scanning bus for storage devices... usb_control_msg: request: 0xFF, reque sttype: 0x21, value 0x0 index 0x0 length 0x0 usb_control_msg: request: 0x1, requesttype: 0x2, value 0x0 index 0x81 length 0x0 usb_control_msg: request: 0x1, requesttype: 0x2, value 0x0 index 0x2 length 0x0 1 Storage Device(s) found
I don't know what is problem?why when I add instruction "printf("&ep = %x\n",&ep);", u-boot can get description of USB device *Strategy 3: I try replace the insctruction "printf("&ep = %x\n",&ep);" with one of these instructions - instruction 1: wait_ms(10) - instruction 2:void * pointer = &ep; - instruction 3: "printf("ep = %x\n",ep);" But the result when run command "usb start" the same strategy 1, I can't get information of USB2.0(mass storage)
Can you help me to resolve this bug? Thank you very much for your supports!
Yoshihiro Shimoda wrote:
Hi, thaoth.
thaoth wrote:
0x28: 00101000 -> 00 101 000 ->
- 101: Using bus clock
- 000: Dividing Ratio Selection is 1/1
I know
- Internal clock: 96Mhz
- Peripheral Clock: 24Mhz
- CPU Block: 144Mhz
http://www.nabble.com/file/p19449833/a.JPG a.JPG
Please let me know the correct value of EXCPGCR ? Is 0x28 correct initialize value of USB clock?
I think that 0x21 is correct value of EXCPGCR for your board.
0x21: 00101000 -> 00 100 001 ->
- 100: Using Internal Clock
- 001: Dividing Ratio Selection is 1/2
(96MHz / 2 = 48MHz)
And I used my board, I set 0x1500 in PKCR.
I don't understand PKCR - Port control register so I don't know correct initialize value of this register.
0x1500 = 0001 0101 0000 0000 -> PK6 is port output -> PK5 is port output -> PK4 is port output I don't know this value could be set for my board - TEngine/SH7727.
Oh, I am very sorry. This is PECR. This setting enable USB1_pwr_en and USB2_pwr_en pin.
Best regards, Yoshihiro Shimoda _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot