[Galaxy Y GT-S5360 Android Development] harish2704:
Hi,

I am now working on the usb OTG driver for galaxy-y

I almost sure that this device is a OTG capable device, (I found this from its service manual http://xdaforums.com/showthread.php?t=1489767)

After some work I compiled otg supported usb driver as loadable module (dwc_otg.ko).

In the original firm ware this driver is 'in-built' and host support is diabled

and I could load the module

The dmesg is ...

[hari]#
[hari]# insmod /sdcard/otgg/j/dwc_otg.ko
<6>[ 2688.406677] dwc_otg: version 2.60a 22-NOV-2006
<6>[ 2688.406829] lm_driver_register()
<6>[ 2688.406890] lm_match()
<6>[ 2688.406951] lm_bus_probe()
<3>[ 2688.406982] Debug level= 17
<3>[ 2688.407012] dwc_otg lm-2: dwc_otg_driver_probe, version 020-10-01-09
<6>[ 2688.407318] It is Ok to create charging current work queue...
<4>[ 2688.407592] DWC_otg: 1
<4>[ 2688.407623] DWC_otg: 2
<4>[ 2688.407653] DWC_otg: dwc_otg_core_reset() GRSTCTL=80000000
<4>[ 2688.407684] DWC_otg: dwc_otg_core_reset() value to set=80000001
<4>[ 2688.517852] DWC_otg: b
<4>[ 2688.517913] DWC_otg: dwc_otg_core_reset() HANG! Soft Reset GRSTCTL=80000001
<6>[ 2688.517944] DWC_otg: Core Global Registers
<6>[ 2688.517974] DWC_otg: GOTGCTL @0xD8400000 : 0x00110000
<6>[ 2688.518005] DWC_otg: GOTGINT @0xD8400004 : 0x00000000
<6>[ 2688.518035] DWC_otg: GAHBCFG @0xD8400008 : 0x00000000
<6>[ 2688.518066] DWC_otg: GUSBCFG @0xD840000C : 0x00001400
<6>[ 2688.518096] DWC_otg: GRSTCTL @0xD8400010 : 0x80000001
<6>[ 2688.518127] DWC_otg: GINTSTS @0xD8400014 : 0x04000021
<6>[ 2688.518157] DWC_otg: GINTMSK @0xD8400018 : 0x00000000
<6>[ 2688.518188] DWC_otg: GRXSTSR @0xD840001C : 0xFFFFFFFF
<6>[ 2688.518188] DWC_otg: GRXFSIZ @0xD8400024 : 0x00001000
<6>[ 2688.518218] DWC_otg: GNPTXFSIZ @0xD8400028 : 0x10001000
<6>[ 2688.518615] DWC_otg: GNPTXSTS @0xD840002C : 0x00081000
<6>[ 2688.518646] DWC_otg: GI2CCTL @0xD8400030 : 0x00000000
<6>[ 2688.518676] DWC_otg: GPVNDCTL @0xD8400034 : 0x00000000
<6>[ 2688.518707] DWC_otg: GGPIO @0xD8400038 : 0x00000000
<6>[ 2688.518737] DWC_otg: GUID @0xD840003C : 0x00000000
<6>[ 2688.518768] DWC_otg: GSNPSID @0xD8400040 : 0x4F54281A
<6>[ 2688.518798] DWC_otg: GHWCFG1 @0xD8400044 : 0x00000000
<6>[ 2688.518829] DWC_otg: GHWCFG2 @0xD8400048 : 0x229FFDD0
<6>[ 2688.518859] DWC_otg: GHWCFG3 @0xD840004C : 0x0F8007E8
<6>[ 2688.518859] DWC_otg: GHWCFG4 @0xD8400050 : 0xFFF08030
<6>[ 2688.518890] DWC_otg: HPTXFSIZ @0xD8400100 : 0x02001020
<4>[ 2688.518920] DWC_otg: 3
<4>[ 2688.627838] DWC_otg: 1
<4>[ 2688.627899] DWC_otg: 2
<4>[ 2688.627929] DWC_otg: dwc_otg_core_reset() GRSTCTL=80000001
<4>[ 2688.627960] DWC_otg: dwc_otg_core_reset() value to set=80000001
<4>[ 2688.737762] DWC_otg: b
<4>[ 2688.737823] DWC_otg: dwc_otg_core_reset() HANG! Soft Reset GRSTCTL=80000001
<4>[ 2688.737854] DWC_otg: 3
<4>[ 2688.846557] dwc_otg_pcd_init(d2a03460)
<4>[ 2688.846618] Dedicated Tx FIFOs mode
<4>[ 2688.846740] registering handler for irq21
<6>[ 2688.846832] DWC_otg: pcd->setup_pkt=0xff6b3000, pcd->setup_pkt_dma_handle=0x92985000
<6>[ 2688.846893] DWC_otg: pcd->status_buf=0xff6b4000, pcd->status_buf_dma_handle=0x92984000
<4>[ 2688.846923] pcd->setup_pkt=0xff6b3000, pcd->setup_pkt_dma_handle=0x92985000
<4>[ 2688.846954] pcd->status_buf=0xff6b4000, pcd->status_buf_dma_handle=0x92984000
<6>[ 2688.846984] DWC_otg: Using DMA mode
<6>[ 2688.847015] dwc_otg lm-2: DWC OTG Controller
<6>[ 2688.847076] dwc_otg lm-2: new USB bus registered, assigned bus number 1
<6>[ 2688.847137] dwc_otg lm-2: irq 21, io mem 0x00000000
<6>[ 2688.847198] DWC_otg: Init: Port Power? op_state=1
<6>[ 2688.847229] DWC_otg: Init: Power Port (0)
<7>[ 2688.847351] usb usb1: default language 0x0409
<7>[ 2688.847412] usb usb1: udev 1, busnum 1, minor = 0
<6>[ 2688.847442] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
<6>[ 2688.847473] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
<6>[ 2688.847503] usb usb1: Product: DWC OTG Controller
<6>[ 2688.847534] usb usb1: Manufacturer: Linux 2.6.35.7 dwc_otg_hcd
<6>[ 2688.847564] usb usb1: SerialNumber: lm-2
<7>[ 2688.849395] usb usb1: usb_probe_device
<7>[ 2688.849456] usb usb1: configuration #1 chosen from 1 choice
<7>[ 2688.849517] usb usb1: adding 1-0:1.0 (config #1, interface 0)
<7>[ 2688.850860] hub 1-0:1.0: usb_probe_interface
<7>[ 2688.850891] hub 1-0:1.0: usb_probe_interface - got id
<6>[ 2688.850921] hub 1-0:1.0: USB hub found
<6>[ 2688.850952] hub 1-0:1.0: 1 port detected
<7>[ 2688.850982] hub 1-0:1.0: standalone hub
<7>[ 2688.850982] hub 1-0:1.0: ganged power switching
<7>[ 2688.851013] hub 1-0:1.0: individual port over-current protection
<7>[ 2688.851043] hub 1-0:1.0: power on to power good time: 2ms
<7>[ 2688.851074] hub 1-0:1.0: local power source is good
<7>[ 2688.851074] hub 1-0:1.0: enabling power on all ports
[hari]# <7>[ 2688.948211] hub 1-0:1.0: state 7 ports 1 chg 0000 evt 0000

[hari]# cat /sys/devices/lm-2/mode
<1>[ 2760.955230] Unable to handle kernel paging request at virtual address 73656300
<1>[ 2760.955291] pgd = c7640000
<1>[ 2760.955322] [73656300] *pgd=00000000
Connection closed by foreign host.

The problem is that when i tried to view or change the the mode , here (cat /sys/devices/lm-2/mode ), the phone reboots!!!!!!!!

I am a beginner in kernel development and this is my first experiment with kernel modules.

In the current situation I cant get (I dont know how to get) any log or something from the kernel. I dont know how to bug this kernel module

So any one has experience in kernel debugging please help me

In the kernel configuration I found a feature 'KGDB seial debugger' but... I dont know how to get a 'seial port' on my galaxy-y

Any one please help me