Hi, Mike,
I make some progress, and new problem appears.
After re-checking the source tree (
http://android.git.kernel.org/?p=kernel/msm.git;a=snapshot;h=refs/heads/android-msm-htc-2.6.25;sf=tgz),
I built a new kernel, using the default kernel config (retrieved from
a
running g1 RC29).
Following the steps of building new boot image, flash it to g1, and
reboot,
I find g1 can boot normally. After modifying the kernel config
slightly and
repeating the steps, g1 can also boot normally (except tiwlan.ko can
not be
loaded). So, the
split_bootimg.pl and mkbootimage run quite well,
and the
whole process is ok.
After getting files msm72k_udc.[ch], gadget_chips.h from 2.6.27 tree
and do
some small changes to Makefile & Kconfig, I can finally get follwoing
modules:
g_ether.ko
g_file_storage.ko
msm72k_udc.ko
My objective is to link g1 and my PC through USB ethernet link.
On g1 side, I do following things in sequence:
# insmod ./msm72k_udc.ko # this command succede
# echo $?
0
# dmesg
init: untracked pid 236 exited
msm72k_udc: msm72k_probe
msm72k_udc: msm72k_probe() io=c6808000, irq=47, dma=ffc03000
(49e60000)
# insmod ./g_ether.ko
# echo $?
0
# dmesg
msm72k_udc: msm72k_udc:registered gadget driver 'ether'
msm72k_udc:IDLE -> ONLINE
msm72k_udc: msm72k_udc: reset controller
msm72k_udc: ulpi: write 0x40 to 0x31
msm72k_udc: ulpi: write 0x1d to 0x0d
msm72k_udc: ulpi: write 0x1d to 0x10
msm72k_udc: ept #0 out max:64 head:ffc03000 bit:0
msm72k_udc: ept #1 out max 512 head:ffc03080 bit:1
...(ept #2 -- #15)...
msm72k_udc: ept #0 in max:64 head:ffc03040 bit:16
msm72k_udc: ept #1 in max:512 head:ffc030c0 bit:17
... (ept #2 -- #15)...
usb: notify offline
msm72k_udc: ONLINE -> OFFLINE
usb: notify offline
#
then I can see the device in file /proc/net/dev.
# ifconfig usb0 192.168.1.9 up
On PC (ubuntu) side:
$ sudo dmesg -c
$ sudo modprobe usbnet
$ ehco $?
0
Connect g1 and PC with USB cable:
$ ifconfig
eth0 .....
lo .....
NO usb0 found!
NO usb0 found!
NO usb0 found!
I tried other PCs running Linux and XP, the problem persists and it
seems that neither side can detect the USB connection.
What is wrong?
It is worth noting that the driver files (msm72k_udc.[ch] and
gadget_chips.h
are from 2.6.27) are from tree
http://android.git.kernel.org/?p=kernel/msm.git;a=tree;f=drivers;hb=android-msm-2.6.27
> might try the
g1-hack...@telesphoreo.org mailing list.
>
> Mike
>
>
>
> On Fri, Jan 9, 2009 at 6:24 AM, Xiangfeng ZHANG <
mailof...@gmail.com> wrote:
> > Hi, Mike,
>
> > thank you.
>
> > I re-download the 2.6.25 kernel
> > (
http://android.git.kernel.org/?p=kernel/msm.git;a=snapshot;h=refs/hea...)
> > and repeat my work, and things get much better. I can compile the kernel and
> > modules. the new source tree contains clk_*() function for mach-msm, but
> > __msm_ioremap stll missing (I copied one).
>
> > Now I want to put my new kernel to g1, and I meet new problems.
>
> > According to
> >
http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack%2C_Edit%2C_...,
> > two .pl scripts are available to help unpack/pack boot images. I packed my
> > new kernel and the original ramdisk image into a new a boot.img. but after
> > unpacking the new image, I found my kernel size changed (300bytes longer
> > than it should be)
>
> > see below:
>
> > zxf@zxfpc-desktop:~/tmp$ ls -l boot-new/
> > -rw-r--r-- 1 zxf zxf 2504704 2009-01-09 19:19 mtd2.img
> > -rwxr-xr-x 1 zxf zxf 1273556 2009-01-09 13:57 mtd2.img-kernel.gz
> > (^^^^^^^^^)
> > drwxr-xr-x 2 zxf zxf 4096 2009-01-09 16:39 mtd2.img-ramdisk
> > -rw-r--r-- 1 zxf zxf 1228800 2009-01-09 14:01 mtd2.img-ramdisk.cpio.gz
> > -rwxr-xr-x 1 zxf zxf 442 2009-01-09 18:56 new-boot.sh
>
> > zxf@zxfpc-desktop:~/tmp$ ls -l boot-unpack/
> > -rw-r--r-- 1 zxf zxf 2504704 2009-01-09 19:19 mtd2.img
> > -rw-r--r-- 1 zxf zxf 1273856 2009-01-09 19:19 mtd2.img-kernel.gz
> > (^^^^^^^^^)
> > drwxr-xr-x 8 zxf zxf 4096 2009-01-09 19:19 mtd2.img-ramdisk
> > -rw-r--r-- 1 zxf zxf 1228800 2009-01-09 19:19 mtd2.img-ramdisk.cpio.gz
> > zxf@zxfpc-desktop:~/tmp$
>
> > Originally I did not notice this. After flash the new kernel, G1 can not
> > boot normally. after almost two hours' check, I found the difference in
> > size.
>
> > Could you help me find what is wrong?
>
> > On Fri, Jan 9, 2009 at 12:41 AM, Mike Lockwood <
lockw...@android.com> wrote:
>
> >> Right, the clk_* calls changed a bit between 2.6.25 and 2.6.27. To
> >> see what changes you will need to backport msm72k_udc to 2.6.25, try
> >> looking at drivers/usb/function/msm_hsusb.c and comparing the 2.6.25
> >> and 2.6.27 versions of this file.
>
> >> Mike
>