View Single Post
Old 02-02-2013, 08:19 AM   #13
lisper
Junior Member
lisper has learned how to read e-bookslisper has learned how to read e-bookslisper has learned how to read e-bookslisper has learned how to read e-bookslisper has learned how to read e-bookslisper has learned how to read e-bookslisper has learned how to read e-bookslisper has learned how to read e-books
 
Posts: 8
Karma: 962
Join Date: Jun 2011
Device: Sony PRS-T1
No OTG support in stock firmware

; tldr: there is no support for external usb keyboards in the original sony firmware


I obtained a USB OTG adapter, so that I can physically connect a keyboard to the Sony prst1. Unfortunately, this did not just work.

The linux kernel of the original prst1 firmware does not support the OTG feature of its Freescale MX50 ARM SOC.

I rooted the device, installed a chroot gentoo environment, set up the AR6000 wifi as access point and logged in using ssh. Here are some things I observed:

the kernel version of the original firmware:

lisper@localhost /proc $ cat version
Linux version 2.6.35.3 (hudson@devuntu5) (gcc version 4.4.0 (GCC) ) #74 PREEMPT Wed Dec 21 14:50:19 JST 2011

the list of interrupts gave me a clue, which device driver is responsible for usb (it is fsl-usb2-udc)

martin@localhost /proc $ cat interrupts
CPU0
1: 13530 MXC_TZIC mxsdhci
2: 0 MXC_TZIC mxsdhci
3: 11160 MXC_TZIC mxsdhci
4: 38095 MXC_TZIC mxsdhci
6: 3 MXC_TZIC mxc_sdma
14: 0 MXC_TZIC usb_wakeup, ehci_hcd:usb1
18: 91 MXC_TZIC usb_wakeup, fsl-usb2-udc


I downloaded the linux kernel from the sony support section and found this comment in the source:

lisper@intel:~/sony/linux-2.6.35.3/drivers/usb/gadget$ less fsl_udc_core.c
#define DRIVER_DESC "Freescale High-Speed USB SOC Device Controller driver"
#define DRIVER_AUTHOR "Li Yang/Jiang Bo"
#define DRIVER_VERSION "Apr 20, 2007"

#define DMA_ADDR_INVALID (~(dma_addr_t)0)

static const char driver_name[] = "fsl-usb2-udc";


} else if ((setup->bRequestType & (USB_RECIP_MASK
| USB_TYPE_MASK)) == (USB_RECIP_DEVICE
| USB_TYPE_STANDARD)) {
/* Note: The driver has not include OTG support yet.
* This will be set when OTG support is added */
if (!gadget_is_otg(&udc->gadget))
break;


No support for USB on-the-go means that an external keyboard will not work with the original firmware.

I looked into the fsl_udc_core.c file in a more recent 3.4.9 kernel and this seems to implement OTG, you would have to enable CONFIG_USB_OTG in the kernel configuration.

Currently I try to compile the 3.4.9 kernel on my device using the gentoo's gcc (version 4.5) -- Currently, I'm too lazy to install a cross compiler on my laptop. However, even if this succeeds I have no idea how I could boot it.
lisper is offline   Reply With Quote