I recently bought a USB OTG cable and a powered USB hub in the hopes of getting USB host mode working on my Glo. I'm just stumbling through this, so I decided to go ahead and post what I've figured out so far, and maybe I can get some advice here and there.
References
My setup is this: USB keyboard > powered USB hub > USB OTG cable > Kobo. I've compiled a kernel from the KoboLabs imx507 source with built-in support for USB Host mode on the OTG port, as described in the Freescale imx507 documentation. I also added support for USB HID devices (I'm assuming this is what I need for keyboard support). The only change I had to make to get the kernel and modules to compile was to add the line "#include <mach/mx51.h>" to arch/arm/plat-mcx/ehci.c.
My kernel config:
The new kernel runs with no problems that I've noticed on my Glo, but trying to insmod the g_hid.ko module gives the error:
Code:
g_hid: Unknown symbol usb_gadget_register_driver (err 0)
g_hid: Unknown symbol usb_gadget_unregister_driver (err 0)
I tried loading arcotg_udc.ko and then running "insmod g_hid.ko", but insmod tells me that it can't insert g_hid.ko because there's "no such device". Something to note: after loading my new compiled arcotg_udc.ko, I cannot load either g_hid or g_ether, but with the arcotg_udc.ko in /drivers/ntx508/usb/gadget/ I can load my new g_ether but still not my g_hid.
Using strace on "insmod g_hid.ko" shows that it fails on init_module.
Code:
uname({sys="Linux", node="(none)", ...}) = 0
open("g_hid.ko", O_RDONLY|O_LARGEFILE) = 3
fstat64(3, {st_mode=S_IFREG|0664, st_size=30541, ...}) = 0
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\1\0(\0\1\0\0\0\0\0\0\0\0\0\0\0"..., 30720) = 30541
read(3, "", 179) = 0
close(3) = 0
init_module(0x95040, 30541, "") = -1 ENODEV (No such device)
write(2, "insmod: can't insert 'g_hid.ko':"..., 48insmod: can't insert 'g_hid.ko': No such device
) = 48
exit_group(1) = ?
Output of dmesg after reboot and trying to load g_ether and g_hid:
Spoiler:
Linux version 2.6.35.3-850-gbc67621+ (gallen@gallen-desktop) (gcc version 4.4.4 (4.4.4_09.06.2010) ) #594 PREEMPT Wed Aug 29 15:44:55 CST 2012
CPU: ARMv7 Processor [412fc085] revision 5 (ARMv7), cr=10c53c7f
CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
Machine: Freescale MX50 Reference Design Platform
Memory policy: ECC disabled, Data cache writeback
On node 0 totalpages: 65024
free_area_init_node: node 0, pgdat 803b6d40, node_mem_map 803d7000
DMA zone: 192 pages used for memmap
DMA zone: 0 pages reserved
DMA zone: 24384 pages, LIFO batch:3
Normal zone: 316 pages used for memmap
Normal zone: 40132 pages, LIFO batch:7
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 64516
Kernel command line: console=ttymxc0,115200 rootwait rw quiet lpj=4997120 root=/dev/mmcblk0p1 rootfstype=ext4 hwcfg_p=0x7ffffe00 hwcfg_sz=512 waveform_p=0x7feed600 waveform_sz=1124352 mem=254M mx50_1GHz
PID hash table entries: 1024 (order: 0, 4096 bytes)
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Memory: 254MB = 254MB total
Memory: 253920k/253920k available, 6176k reserved, 0K highmem
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
DMA : 0xf9e00000 - 0xffe00000 ( 96 MB)
vmalloc : 0x90000000 - 0xf4000000 (1600 MB)
lowmem : 0x80000000 - 0x8fe00000 ( 254 MB)
pkmap : 0x7fe00000 - 0x80000000 ( 2 MB)
modules : 0x7f000000 - 0x7fe00000 ( 14 MB)
.init : 0x80008000 - 0x80024000 ( 112 kB)
.text : 0x80024000 - 0x8036a000 (3352 kB)
.data : 0x8037e000 - 0x803b7aa0 ( 231 kB)
SLUB: Genslabs=11, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Hierarchical RCU implementation.
RCU-based detection of stalled CPUs is disabled.
Verbose stalled-CPUs detection is disabled.
NR_IRQS:368
MXC GPIO hardware
MXC IRQ initialized
MXC_Early serial console at MMIO 0x53fc0000 (options '115200')
bootconsole [ttymxc0] enabled
Console: colour dummy device 80x30
Calibrating delay loop (skipped) preset value.. 999.42 BogoMIPS (lpj=4997120)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
regulator: core version 0.5
NET: Registered protocol family 16
i.MX IRAM pool: 128 KB@0x90040000
hwcfg_size_setup() hwcfg_szie=512
***_MemoryRequest:2348: request memory region! addr=0x7ffffe00, len=512***
hwcfg_p_setup() hwcfg_p=7ffffe00,vaddr=9006ee00,size=512
hwcfg_p_setup() pcba="E606B0" !!
CPU is i.MX50 Revision 1.1
[check_hardware_name-413] PCBA ID is 14
mxc_board_init() Set E606B2 key mapping !!
Using SDMA I.API
MXC DMA API initialized
IMX usb wakeup probe
the wakeup pdata is 0x8038b520
IMX usb wakeup probe
the wakeup pdata is 0x8038b5d4
bio: create slab <bio-0> at 0
regulator: DCDC_3V15: 3150 mV
SCSI subsystem initialized
CSPI: mxc_spi-2 probed
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
PMIC Light driver loading...
mc13892 Rev 0.0 FinVer 0 detected
Initializing regulators for mx50 rdp.
regulator: SW1: 600 <--> 1375 mV at 600 mV
PMIC ADC start probe
PMIC Light successfully loaded
Device spi3.0 probed
Switching to clocksource mxc_timer1
NET: Registered protocol family 2
IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
TCP established hash table entries: 8192 (order: 4, 65536 bytes)
TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
LPMode driver module loaded
Static Power Management for Freescale i.MX5
PM driver module loaded
sdram autogating driver module loaded
busfreq_probe: failed to get lp regulator
Bus freq driver module loaded
mxc_dvfs_core_probe
DVFS driver module loaded
i.MXC CPU frequency driver
DVFS PER driver module loaded
msgmni has been set to 495
alg: No test for stdrng (krng)
cryptodev: driver loaded.
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
drivers/video/mxc/mxc_epdc_fb.c(4169):EPD 1024x758
[mxc_epdc_fb_probe] memory to allocate: 3145728,num_screens=2
waveform_size_setup() wf_size=1124352
***_MemoryRequest:174: request memory region! addr=0x7feed600, len=1124352***
waveform_p_setup() wf_p=7feed600,vaddr=90200600,size=1124352
root_path_setup() rootdev=0,rootpart=1
Console: switching to colour frame buffer device 128x47
[epdc_firmware_func]:fw p=90200600,size=1124352
drivers/video/mxc/mxc_epdc_fb.c(3842):EPD 1024x758
[msp_int-1573] MSP430 interrupt triggered !!!
fake_s1d13522_parse_epd_cmdline : epd cmdline parse already done .
client0 ,addr=0x68,name=tps65185-1
TPS65185 versions : major=0x1,minor=0x2,version=0x5,RevID=0x65
Serial: MXC Internal UART driver
mxcintuart.0: ttymxc0 at MMIO 0x53fc0000 (irq = 32) is a Freescale i.MX
console [ttymxc0] enabled, bootconsole disabled
mxcintuart.1: ttymxc1 at MMIO 0x53fbc000 (irq = 31) is a Freescale i.MX
mxcintuart.2: ttymxc2 at MMIO 0x5000c000 (irq = 33) is a Freescale i.MX
loop: module loaded
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[arch/arm/plat-mxc/usb_common.c-343] usbh1_set_utmi_xcvr()
fsl-ehci fsl-ehci.1: Freescale On-Chip EHCI Host Controller
fsl-ehci fsl-ehci.1: new USB bus registered, assigned bus number 1
fsl-ehci fsl-ehci.1: irq 14, io base 0x53f80200
fsl-ehci fsl-ehci.1: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
MXC keypad loaded
input: mxckpd as /devices/virtual/input/input0
input: zForce-ir-touch as /devices/virtual/input/input1
[zForce_ir_touch_recv_data-174] command BootComplete (0)...
mc13892 rtc probe start
pmic_rtc pmic_rtc.1: rtc core: registered pmic_rtc as rtc0
mc13892 rtc probe succeed
i2c /dev entries driver
APM Battery Driver
MXC WatchDog Driver 2.0
[msp430_probe-579] MSP430 firmware version C851
[drivers/mxc/pmic/mc13892/pmic_battery.c-991] pmic_battery_probe...
[ntx_get_battery_vol-1544] 93,bat=1006
[ntx_get_battery_vol-1544] 93,bat=1006
mxsdhci: MXC Secure Digital Host Controller Interface driver
mxsdhci: MXC SDHCI Controller Driver.
mmc0: SDHCI detect irq 0 irq 1 INTERNAL DMA
mxsdhci: MXC SDHCI Controller Driver.
mmc1: SDHCI detect irq 273 irq 2 INTERNAL DMA
mxsdhci: MXC SDHCI Controller Driver.
mmc2: SDHCI detect irq 0 irq 3 INTERNAL DMA
Registered led device: pmic_ledsr
Registered led device: pmic_ledsg
[zForce_ir_touch_recv_data-191] firmware version 0000 0000 0000 0000
Registered led device: pmic_ledsb
[ntx_get_battery_vol-1544] 93,bat=1006
[ntx_get_battery_vol-1544] 93,bat=1006
TCP cubic registered
NET: Registered protocol family 17
VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 2
pmic_rtc pmic_rtc.1: setting system clock to 2013-10-25 15:51:05 UTC (1382716265)
Waiting for root device /dev/mmcblk0p1...
mmc0: new high speed SDHC card at address e624
mmcblk0: mmc0:e624 SU16G 14.8 GiB
mmcblk0: p1 p2 p3
EXT4-fs (mmcblk0p1): warning: maximal mount count reached, running e2fsck is recommended
EXT4-fs (mmcblk0p1): mounted filesystem with ordered data mode. Opts: (null)
VFS: Mounted root (ext4 filesystem) on device 179:1.
Freeing init memory: 112K
EXT4-fs (mmcblk0p1): re-mounted. Opts: (null)
[PROGRESS_BAR-2857] No progess ...
ehci_fsl_bus_suspend, Host 1
read_alarm: 0 70/0/1 0:0:0
DVFS is started
[ntx_get_battery_vol-1544] 90,bat=999
[ntx_get_battery_vol-1544] 90,bat=999
TPS65185 temprature data = 0x16,22
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
usb unplugged
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
[drivers/input/touchscreen/zforce_i2c.c-410] zforce_i2c_open()
[zForce_ir_touch_recv_data-143] command Activate (0) ...
[zForce_ir_touch_recv_data-152] command Resolution (0) ...
[zForce_ir_touch_recv_data-177] command Frequency (0) ...
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
[ntx_get_battery_vol-1544] 89,bat=998
Waiting arm_podf enabled!
lit_ctl
command exec successfully!
lit_ctl
command exec successfully!
lit_ctl
command exec successfully!
lit_ctl
command exec successfully!
lit_ctl
command exec successfully!
lit_ctl
command exec successfully!
lit_ctl
command exec successfully!
lit_ctl
command exec successfully!
lit_ctl
command exec successfully!
lit_ctl
command exec successfully!
lit_ctl
command exec successfully!
lit_ctl
command exec successfully!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
[ntx_get_battery_vol-1544] 89,bat=998
[msp430_setalarm-789] alarm 840
Waiting arm_podf enabled!
[mxc_rtc_ioctl-112] Micro P MSP430 status 0x4808 ....
PM: Preparing system for mem sleep
Freezing user space processes ... freeze 1!!!!!!!!!!!!!!!!!!!!
(elapsed 0.01 seconds) done.
Freezing remaining freezable tasks ... (elapsed 0.01 seconds) done.
PM: Entering mem sleep
Suspending console(s) (use no_console_suspend to debug)
USB Host suspend begins
ehci_fsl_drv_suspend, pm event
[sdhci_suspend-1804] skip suspend for mmc1
DVFS is stopped
PM: suspend of devices complete after 4.315 msecs
suspend wp cpu=800000000
PM: late suspend of devices complete after 0.193 msecs
PM: early resume of devices complete after 0.127 msecs
DVFS is started
[sdhci_resume-1847] skip resume for mmc1
ehci fsl drv resume begins: Host 1
ehci_fsl_drv_resume,pm event, wait for wakeup irq if needed
ehci_fsl_bus_resume, Host 1
PM: resume of devices complete after 209.345 msecs
PM: Finishing wakeup.
Restarting tasks ... done.
[mxc_rtc_ioctl-112] Micro P MSP430 status 0x4808 ....
[ntx_get_battery_vol-1544] 89,bat=998
read_alarm: 1 70/0/1 0:0:1
TPS65185 temprature data = 0x16,22
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Wifi / BT power control 1
cd_status=0 inserted
Waiting arm_podf enabled!
Waiting arm_podf enabled!
cd_status=0 inserted
cd_status=0 inserted
mmc2: queuing unknown CIS tuple 0x80 (2 bytes)
mmc2: queuing unknown CIS tuple 0x80 (3 bytes)
mmc2: queuing unknown CIS tuple 0x80 (3 bytes)
mmc2: queuing unknown CIS tuple 0x80 (7 bytes)
mmc2: queuing unknown CIS tuple 0x80 (8 bytes)
mmc2: queuing unknown CIS tuple 0x80 (2 bytes)
mmc2: queuing unknown CIS tuple 0x80 (5 bytes)
mmc2: queuing unknown CIS tuple 0x80 (5 bytes)
Waiting arm_podf enabled!
mmc2: new high speed SDIO card at address 0001
si_doattach: CHIPID(sih->chip)=a962, sih->chiprev=1
Dongle Host Driver, version 5.90.113.2
ehci_fsl_bus_suspend, Host 1
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
[ntx_get_battery_vol-1544] 89,bat=998
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
[ntx_get_battery_vol-1544] 85,bat=992
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
[ntx_get_battery_vol-1544] 85,bat=992
[ntx_get_battery_vol-1544] 85,bat=992
[ntx_get_battery_vol-1544] 85,bat=992
[ntx_get_battery_vol-1544] 85,bat=992
TPS65185 temprature data = 0x15,21
[ntx_get_battery_vol-1544] 85,bat=992
ARC USBOTG Device Controller driver (1 August 2005)
Can't find OTG driver!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
[ntx_get_battery_vol-1544] 85,bat=992
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
[ntx_get_battery_vol-1544] 85,bat=992
ARC USBOTG Device Controller driver unregistered
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
[ntx_get_battery_vol-1544] 85,bat=992
Waiting arm_podf enabled!
ARC USBOTG Device Controller driver (1 August 2005)
Waiting arm_podf enabled!
Waiting arm_podf enabled!
[ntx_get_battery_vol-1544] 85,bat=992
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
g_ether gadget: using random self ethernet address
g_ether gadget: using random host ethernet address
Waiting arm_podf enabled!
usb0: MAC 6a:45:01:72:c3:13
usb0: HOST MAC 6e:d7:05:43:b3:51
g_ether gadget: Ethernet Gadget, version: Memorial Day 2008
g_ether gadget: g_ether ready
dr_controller_run: udc enter low power mode
fsl-usb2-udc: bind to driver g_ether
Waiting arm_podf enabled!
Waiting arm_podf enabled!
[ntx_get_battery_vol-1544] 85,bat=992
Waiting arm_podf enabled!
Waiting arm_podf enabled!
Waiting arm_podf enabled!
TPS65185 temprature data = 0x15,21
[ntx_get_battery_vol-1544] 85,bat=992
[ntx_get_battery_vol-1544] 85,bat=992
[ntx_get_battery_vol-1544] 85,bat=992
[ntx_get_battery_vol-1544] 85,bat=992
[ntx_get_battery_vol-1544] 85,bat=992
[ntx_get_battery_vol-1544] 85,bat=992
[ntx_get_battery_vol-1544] 85,bat=992
[ntx_get_battery_vol-1544] 85,bat=992
[ntx_get_battery_vol-1544] 85,bat=992
[ntx_get_battery_vol-1544] 85,bat=992
[ntx_get_battery_vol-1544] 85,bat=992
[ntx_get_battery_vol-1544] 85,bat=992
[ntx_get_battery_vol-1544] 85,bat=992
[ntx_get_battery_vol-1544] 85,bat=992
TPS65185 temprature data = 0x15,21
[ntx_get_battery_vol-1544] 85,bat=992
[ntx_get_battery_vol-1544] 85,bat=992
[ntx_get_battery_vol-1544] 85,bat=992
[ntx_get_battery_vol-1544] 85,bat=992
[ntx_get_battery_vol-1544] 85,bat=992
[ntx_get_battery_vol-1544] 85,bat=992
If anyone has any suggestions I'd love to hear them. Like I said, I don't have any real clear idea what I'm doing, but I figured I'd try to do it anyway.