LS1021A USB Serial support for MCP2200

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LS1021A USB Serial support for MCP2200

Jump to solution
2,810 Views
ramkrishnan
Contributor III

We have a LS1021A board based on the TWR board. Our board has a MCP2200 USB to Serial Coverted connected to USB1_D lines. I was trying to figure out how to get the linux kernel to create a tty device to communicate to an external serial port from the arm. 

I tried enabling the ftdi_sio drivers using the CONFIG_USB_SERIAL_FTDI_SIO as well as enabling CONFIG_USB_SERIAL, and setting them to y so that they built in. 

I also tried adding the following to the dtb. But no luck there either. 

usb@8600000 {
compatible = "fsl-usb2-dr-v2.5", "fsl-usb2-dr";
reg = <0x0 0x8600000 0x0 0x1000>;
interrupts = <0x0 0xab 0x4>;
dr_mode = "host";
phy_type = "serial";
};

Any help would be appreciated. 

Thank you,

Ram Krishnan

Labels (1)
0 Kudos
1 Solution
2,651 Views
ramkrishnan
Contributor III

Finally works now. Two changes were needed.

RCW[SDHC] needs to be set to 1 (or anything but 3) because the PWR FAULT and DRV BUS has to be ignored since this chip has its own power.

RCW[USB3_CLK_FSEL] has to be set to 57 to enable clocks for USB3.

Thanks,

Ram

View solution in original post

0 Kudos
9 Replies
2,652 Views
ramkrishnan
Contributor III

Finally works now. Two changes were needed.

RCW[SDHC] needs to be set to 1 (or anything but 3) because the PWR FAULT and DRV BUS has to be ignored since this chip has its own power.

RCW[USB3_CLK_FSEL] has to be set to 57 to enable clocks for USB3.

Thanks,

Ram

0 Kudos
2,651 Views
ramkrishnan
Contributor III

In the schematic should the USB1_VBUS be connected for the application above ? It appears to be connected on the TWR eval board. But that use case is different from this one. 

Thank you,

Ram Krishnan

0 Kudos
2,651 Views
ramkrishnan
Contributor III

I added CONFIG_USB_ACM and still no luck. It is not recognizing the device. We checked the power to the chip as well as RST lines and they all seem to be good. I also removed the CONFIG_USB_SERIAL_FTDI_SIO definition and still nothing. Should I do anything different in the dts files ? 

In the uboot I do the following to detect the usb device

=> usb start
starting USB...
USB0: Register 200017f NbrPorts 2
Starting the controller
USB XHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
=> usb info
1: Hub, USB Revision 3.0
- U-Boot XHCI Host Controller
- Class: Hub
- PacketSize: 512 Configurations: 1
- Vendor: 0x0000 Product 0x0000 Version 1.0
Configuration: 1
- Interfaces: 1 Self Powered 0mA
Interface: 0
- Alternate Setting 0, Endpoints: 1
- Class Hub
- Endpoint 1 In Interrupt MaxPacket 8 Interval 255ms

It does not look like it detects the usb device. Is there anything to be enabled in uboot to detect the MCP2200 ? Please let me know if you need any more information. 

Thank you,

Ram Krishnan

0 Kudos
2,651 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please verify whether there is information with the following command.

dmesg | grep ttyACM
0 Kudos
2,651 Views
ramkrishnan
Contributor III

We found one issue in which the RCW[SDHC] should be set to anything non-usb1 since this device will have its own power. So we set that to 1 to make it all GPIO4 and now we see activity when we probe the D_M and D_P lines but the ttyACM0 is still not coming up. 

On the uboot if we do start usb we get the following message

USB device not accepting new address (error=80000000)

I have enabled debug on common/usb.c

=> usb start
starting USB...
USB0: Register 200017f NbrPorts 2
Starting the controller
USB XHCI 1.00
scanning bus 0 for devices...
set address 1
usb_control_msg: request: 0x5, requesttype: 0x0, value 0x1 index 0x0 length 0x0
usb_control_msg: request: 0x6, requesttype: 0x80, value 0x100 index 0x0 length 0x12
usb_control_msg: request: 0x6, requesttype: 0x80, value 0x200 index 0x0 length 0x9
usb_control_msg: request: 0x6, requesttype: 0x80, value 0x200 index 0x0 length 0x1F
get_conf_no 0 Result 25, wLength 31
if 0, ep 0
##EP epmaxpacketin[1] = 8
set configuration 1
usb_control_msg: request: 0x9, requesttype: 0x0, value 0x1 index 0x0 length 0x0
new device strings: Mfr=1, Product=2, SerialNumber=0
usb_control_msg: request: 0x6, requesttype: 0x80, value 0x300 index 0x0 length 0xFF
USB device number 1 default language ID 0x409
usb_control_msg: request: 0x6, requesttype: 0x80, value 0x301 index 0x409 length 0xFF
usb_control_msg: request: 0x6, requesttype: 0x80, value 0x302 index 0x409 length 0xFF
Manufacturer U-Boot
Product XHCI Host Controller
SerialNumber
usb_control_msg: request: 0x6, requesttype: 0xA0, value 0x2A00 index 0x0 length 0x4
usb_control_msg: request: 0x6, requesttype: 0xA0, value 0x2A00 index 0x0 length 0xC
usb_control_msg: request: 0x0, requesttype: 0xA0, value 0x0 index 0x0 length 0x4
usb_control_msg: request: 0x3, requesttype: 0x23, value 0x8 index 0x1 length 0x0
usb_control_msg: request: 0x3, requesttype: 0x23, value 0x8 index 0x2 length 0x0
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x1 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x1 length 0x4
usb_control_msg: request: 0x1, requesttype: 0x23, value 0x10 index 0x1 length 0x0
usb_control_msg: request: 0x3, requesttype: 0x23, value 0x4 index 0x1 length 0x0
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x1 length 0x4
usb_control_msg: request: 0x1, requesttype: 0x23, value 0x14 index 0x1 length 0x0
set address 2
usb_control_msg: request: 0x5, requesttype: 0x0, value 0x2 index 0x0 length 0x0
Device not responding to set address.

USB device not accepting new address (error=80000000)
usb_control_msg: request: 0x1, requesttype: 0x23, value 0x1 index 0x1 length 0x0
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2 length 0x4
1 USB Device(s) found

scanning usb for storage devices... 0 Storage Device(s) found

0 Kudos
2,651 Views
ramkrishnan
Contributor III

Output pasted below. There is no device ttyACM and I also grepped for usb and I see the cdc_acm driver registered. Does the schematic as far as the connection to LS1021A look correct ? Is there a way to detect the usb device from the uboot ? 

Thanks,

Ram Krishann

root@WBADS:~# dmesg | grep ttyACM
root@WBADS:~# dmesg | grep -i usb
[ 0.034406] usbcore: registered new interface driver usbfs
[ 0.034448] usbcore: registered new interface driver hub
[ 0.034494] usbcore: registered new device driver usb
[ 1.326517] pegasus: v0.9.3 (2013/04/25), Pegasus/Pegasus II USB Ethernet driver
[ 1.333934] usbcore: registered new interface driver pegasus
[ 1.339599] usbcore: registered new interface driver asix
[ 1.344987] usbcore: registered new interface driver ax88179_178a
[ 1.351090] usbcore: registered new interface driver cdc_ether
[ 1.356918] usbcore: registered new interface driver smsc75xx
[ 1.362670] usbcore: registered new interface driver smsc95xx
[ 1.368414] usbcore: registered new interface driver net1080
[ 1.374060] usbcore: registered new interface driver cdc_subset
[ 1.379974] usbcore: registered new interface driver zaurus
[ 1.385553] usbcore: registered new interface driver cdc_ncm
[ 1.392055] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 1.433646] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 1.462809] usbcore: registered new interface driver cdc_acm
[ 1.468444] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[ 1.476438] usbcore: registered new interface driver usb-storage
[ 1.482502] usbcore: registered new interface driver usbserial
[ 1.673722] usbcore: registered new interface driver usbhid
[ 1.679310] usbhid: USB HID core driver

0 Kudos
2,651 Views
ramkrishnan
Contributor III

One more datapoint.

We replaced Y1 i.e the oscillator with a different oscillator with 12M clock and scoped it and it was all good. But nothing in that scenario either. 

Is there something I might be missing in the software. If I do a usb start and usb info on the uboot I see only the HUB and no device. 

If I do the same thing on the TWR board I see 3 devices. 1 HUB and 2 more Port HUBS. 

If you could see any issues please let us know. We are a wit's end as to wether the device is not setup correctly in hardware or if the software is not detecting it. 

Thanks,

Ram

0 Kudos
2,651 Views
yipingwang
NXP TechSupport
NXP TechSupport
In order to be able to use the MCP2200 with Linux, the kernel must have support for USB CDC class drivers. The cdc_acm driver is used for MCP2200 CDC interface.
Please refer to http://ww1.microchip.com/downloads/en/DeviceDoc/mcp2200_linux_driver_readme.txt

Please enable CONFIG_USB_ACM in Linux Kernel configuration file.
0 Kudos
2,651 Views
ramkrishnan
Contributor III

Attached are the schematics for that chip 

pastedImage_1.png

0 Kudos