This is the old SliTaz forum - Please use the main forum.slitaz.org

[SOLVED] How to add "ti_usb_3410_5052" module in kernel (using the wok)?
  • Hi,
    I would like to add the "ti_usb_3410_5052" module in my kernel. I know it is available for linux kernel, but is not from Slitaz repository (as far as know).

    I have no idea on how to do this on slitaz and, as I understood, Slitaz devs are pretty busy right now with stable 3.

    Could anyone be so kind advising me on how to do this?
    Thank you for your hints.
    Stephane
  • Sorry about the spam but have found this really interesting doc:

    http://community.slitaz.org/fr/node/14

    I'll give a try. ;)
    Thanks
  • Ok I installed the required packages but I am stucked on point 2) (prepare to build). :(


    root@slitaz:/usr# cd /usr/src/linux
    root@slitaz:/usr/src/linux-2.6.30.6-slitaz# make oldconfig && make prepare
    make: *** No rule to make target `oldconfig'. Stop.
    root@slitaz:/usr/src/linux-2.6.30.6-slitaz#


    Moreover, it seems to me that not all the source are in /usr/src. Actually I am looking for a file which should be located at drivers/usb/serial/ . But this folder does not exist...
    Here is the command used to dowload the kernel source:

    root@slitaz:~# tazpkg get-install linux-source


    What am I missing?
    Stephane
  • jozeejozee March 2010
    Yes, the link above is very useful. I think there may be some problem in your installation of linux-source.

    But typically, I find the following the easiest:

     tazwok cook linux 


    I would also add "make menuconfig" to the linux receipt before cooking. This gives a graphical menu. Then, you can select the module you want and compile the kernel.

    EDIT: from kernel configs:
    # CONFIG_USB_SERIAL_TI is not set 

    Yes, you have to compile your kernel
  • @jozee,
    I am not sure if this is right, but I thought that cloning the wok is required before doing a tazwok cook. Correct???

    And as stated here, I can not clone the wok...
    http://forum.slitaz.org/index.php/discussion/676/can-not-clone-the-wok/#Item_1

    Please help.
    Thx
    Stephane
  • Hi,
    Here are the required steps in order to add module ti_usb_3410_5052 to linux kernel:

    1) Go to source directory (as root):

    root@slitaz:/home/sbigler# cd /usr/src/linux-2.6.33.2-slitaz/
    root@slitaz:/usr/src/linux-2.6.33.2-slitaz#


    2) Enable the required module by editing configuration file (.config) with any text editor.
    Look for line # CONFIG_USB_SERIAL_TI is not set and replace it with CONFIG_USB_SERIAL_TI=m:

    root@slitaz:/usr/src/linux-2.6.33.2-slitaz# vi .config
    # CONFIG_USB_SERIAL_TI is not set <== remplace this line<br />CONFIG_USB_SERIAL_TI=m <== with this one<br />


    3) Build needed files and link final module images: [thanks Ernia ;-) ]

    root@slitaz:/usr/src/linux-2.6.33.2-slitaz# make CONFIG_USB_SERIAL_TI=m M=drivers/usb/serial
    LD drivers/usb/serial/built-in.o
    CC [M] drivers/usb/serial/usb-serial.o
    CC [M] drivers/usb/serial/generic.o
    CC [M] drivers/usb/serial/bus.o
    LD [M] drivers/usb/serial/usbserial.o
    CC [M] drivers/usb/serial/ch341.o
    CC [M] drivers/usb/serial/option.o
    CC [M] drivers/usb/serial/pl2303.o
    CC [M] drivers/usb/serial/ti_usb_3410_5052.o
    Building modules, stage 2.
    MODPOST 5 modules
    CC drivers/usb/serial/ch341.mod.o
    LD [M] drivers/usb/serial/ch341.ko
    CC drivers/usb/serial/option.mod.o
    LD [M] drivers/usb/serial/option.ko
    CC drivers/usb/serial/pl2303.mod.o
    LD [M] drivers/usb/serial/pl2303.ko
    CC drivers/usb/serial/ti_usb_3410_5052.mod.o
    LD [M] drivers/usb/serial/ti_usb_3410_5052.ko
    CC drivers/usb/serial/usbserial.mod.o
    LD [M] drivers/usb/serial/usbserial.ko
    root@slitaz:/usr/src/linux-2.6.33.2-slitaz#


    4) Copy the module:

    root@slitaz:/usr/src/linux-2.6.33.2-slitaz# mkdir -p /lib/modules/2.6.33.2-slitaz/kernel/drivers/usb/serial
    root@slitaz:/usr/src/linux-2.6.33.2-slitaz# cp drivers/usb/serial/*.ko /lib/modules/2.6.33.2-slitaz/kerne
    l/drivers/usb/serial/
    root@slitaz:/usr/src/linux-2.6.33.2-slitaz# ls /lib/modules/2.6.33.2-slitaz/kernel/drivers/usb/serial/
    ch341.ko option.ko pl2303.ko ti_usb_3410_5052.ko usbserial.ko
    root@slitaz:/usr/src/linux-2.6.33.2-slitaz#


    5) Install the firmware:

    root@slitaz:~# cd /usr/src/linux-2.6.30.6-slitaz/
    root@slitaz:/usr/src/linux-2.6.30.6-slitaz# make firmware_install
    root@slitaz:/usr/src/linux-2.6.30.6-slitaz# ls /lib/firmware/ti_*
    /lib/firmware/ti_3410.fw /lib/firmware/ti_5052.fw
    root@slitaz:~#


    6) Load the module and check it is loaded : [thanks Ernia ;-) ]

    root@slitaz:~# cd /usr/src/linux-2.6.30.6-slitaz/ depmod -a
    root@slitaz:~# cd /usr/src/linux-2.6.30.6-slitaz/ modprobe ti_usb_3410_5052
    root@slitaz:/usr/src/linux-2.6.33.2-slitaz# lsmod | grep ti_usb
    ti_usb_3410_5052 16567 0
    usbserial 22032 1 ti_usb_3410_5052
    root@slitaz:/usr/src/linux-2.6.33.2-slitaz#


    7) Load automatically the module at boot time:
    Edit /etc/rcS.conf and add ti_usb_3410_5052 to LOAD_MODULES line. Here is the resulting line in /etc/rcS.conf file:

    root@slitaz:/usr/src/linux-2.6.33.2-slitaz# cat /etc/rcS.conf | grep LOAD_MODULES
    LOAD_MODULES="lp parport parport_pc ti_usb_3410_5052"
    root@slitaz:/usr/src/linux-2.6.33.2-slitaz#


    8) Connect the MSP-FET430UIF device from Texas Instrument and make sure the driver mapped the module to the device. The output should be something like:

    root@slitaz:/usr/src/linux-2.6.33.2-slitaz# dmesg | tail
    usb 1-2.2: device firmware changed
    ti_usb_3410_5052: probe of 1-2.2:1.0 failed with error -5
    usb 1-2.2: USB disconnect, address 5
    usbcore: registered new interface driver ti_usb_3410_5052
    ti_usb_3410_5052: v0.9:TI USB 3410/5052 Serial Driver
    usb 1-2.2: new full speed USB device using uhci_hcd and address 6
    ti_usb_3410_5052 1-2.2:1.0: TI USB 3410 1 port adapter converter detected
    ti_usb_3410_5052: probe of 1-2.2:1.0 failed with error -5
    ti_usb_3410_5052 1-2.2:2.0: TI USB 3410 1 port adapter converter detected
    usb 1-2.2: TI USB 3410 1 port adapter converter now attached to ttyUSB0
    root@slitaz:/usr/src/linux-2.6.33.2-slitaz#


    9) Let's finally check that the device really exists:

    root@slitaz:/usr/src/linux-2.6.33.2-slitaz# ls /dev/ttyUSB0
    /dev/ttyUSB0
    root@slitaz:/usr/src/linux-2.6.33.2-slitaz#


    Here you are!
    Now be ready to play with Texas Instrument's MSP430 familly.

    Cheers.
    Stephane
  • Hi,
    Finally I was able to clone the wok. Now I am back with the initial need of adding the "ti_usb_3410_5052" module in my kernel.

    Here are the requested steps for compiling the kernel using the wok. For those interested by a solution without the wok, please check this out: http://forum.slitaz.org/index.php/discussion/817/solved-how-to-make-new-kernel-module-available-without-the-wok/#Item_4.

    Let's start:
    0) Some tools are needed:

    root@slitaz:~# tazpkg get-install slitaz-toolchain
    root@slitaz:~# tazpkg get-install ncurses-dev
    root@slitaz:~# tazpkg get-install perl
    root@slitaz:~# tazpkg get-install zlib-dev
    root@slitaz:~# tazpkg get-install mercurial



    1) Because not enough space on my /home partition, I had to change default directory. I use "/my_wok/slitaz/wok" instead of "/home/slitaz/wok" (do not use /tmp directory as it is cleaned on every reboot....):

    root@slitaz:~# cat /etc/tazwok.conf
    ...
    # Wok directory/tree to find receipts and build packages.
    # By default on SliTaz the directory is /home/slitaz/wok.
    #WOK="/home/slitaz/wok"
    WOK="/my_wok/slitaz/wok"

    # The path to the sources tarballs of the binaries packages.
    #SOURCES_REPOSITORY="/home/slitaz/src"
    SOURCES_REPOSITORY="/my_wok/slitaz/src"

    # This path set the binaries packages repository. It's where all
    # the gen *.tazpkg will be stored when using gen-repository command.
    #PACKAGES_REPOSITORY="/home/slitaz/packages"
    PACKAGES_REPOSITORY="/my_wok/slitaz/packages"
    ...


    => don't forget to create the /my_wok/slitaz/wok directory...

    2) I launched clonning process:

    root@slitaz:~# hg clone http://hg.slitaz.org/wok/ /my_wok/slitaz/wok
    requesting all changes
    adding changesets
    adding manifests
    adding file changes
    added 5203 changesets with 12638 changes to 3838 files
    updating working directory
    3339 files updated, 0 files merged, 0 files removed, 0 files unresolved
    root@slitaz:~#



    3) As suggest by jozee, I changed the receipt and added "make menuconfig &&":

    root@slitaz:~# vi /my_wok/slitaz/wok/linux/receipt

    ...
    EOT
    make mrproper
    cd Documentation/lguest
    make lguest || return 1
    cd ../..
    cp ../stuff/$PACKAGE-$VERSION-slitaz.config .config
    make oldconfig
    ln .config slitaz/config
    make menuconfig &&
    make bzImage &&
    make modules &&
    make INSTALL_MOD_PATH=$PWD/_pkg modules_install &&
    make INSTALL_HDR_PATH=$PWD/_pkg/usr headers_install &&
    [ -s arch/x86/boot/bzImage ]
    }
    ...


    4) Saved the receipt file.

    5) I launched tazwok for linux package:

    root@slitaz:~# tazwok cook linux
    Checking for build dependencies...

    Starting to cook linux...
    =============================================Checking for source tarball...
    ...
    root@slitaz:~#


    6) Unfortunately, we need to make changes in the file drivers/usb/serial/ti_usb_3410_3052.c. There is a little trick to edit the fresh source:
    - Look at terminal.
    - there is line saying: "Untaring linux-2.6.30.6.tar.bz2... tar: warning: skipping header 'g' "
    - wait for this line to disapear (lets the untar process to finish).
    - Then stop the cooking with a ctrl-C.

    7) Let's make the required changes (as suggested here http://www.embeddedrelated.com/groups/msp430/show/31784.php):

    Edit the file:

    root@slitaz:~# vi /my_wok/slitaz/wok/linux/linux-2.6.30.6/drivers/usb/serial/ti_usb_3410_5052.c


    First change (status = 0x01E; ), arround line 420

    /* 3410 must be reset, 5052 resets itself */
    if (tdev->td_is_3410) {
    msleep_interruptible(100);
    usb_reset_device(dev);
    }

    /*here is the required change.*/
    //status = -ENODEV;
    status = 0x01E;
    goto free_tdev;


    Second one (status = 0xA1B), a few line further :

    /* the second configuration must be set */
    if (dev->actconfig->desc.bConfigurationValue == TI_BOOT_CONFIG) {
    status = usb_driver_set_configuration(dev, TI_ACTIVE_CONFIG);
    /*here is the required change.*/
    //status = status ? status : -ENODEV;
    status = 0xA1B;
    goto free_tdev;
    }


    8) save the file

    9) Launch cooking process once again. But this time we gonna let it go to the end:

    root@slitaz:~# tazwok cook linux
    Checking for build dependencies...

    Starting to cook linux...
    =============================================Checking for source tarball...
    ...
    ...


    10) Let's choose the new module we want to add, through the text interface. Go to:
    Device Drivers => USB support => USB Serial Converter Support => and then turn on (with character "m") "USB TI 3410/5052 Serial Driver".

    Then Click "Exit" many times and exit/save the new config. The cooking process will continues compilling the kernel. Be patient, it took more than 4 hours on my P3-500MHz...

    11) rename the actual kernel to vmlinuz-2.6.30.6-slitaz_original:

    root@slitaz:~#mv /boot/vmlinuz-2.6.30.6-slitaz /boot/vmlinuz-2.6.30.6-slitaz_original


    12) Then install the new kernel:

    root@slitaz:~# tazpkg install /my_wok/slitaz/packages/linux-2.6.30.6.tazpkg --forced

    Installation of : linux-2.6.30.6
    =============================================Copying linux-2.6.30.6... [ OK ]
    Extracting linux-2.6.30.6... 6369 blocks
    Extracting the pseudo fs... (lzma) 9148 blocks
    Saving configuration files for linux... [ OK ]
    Installing linux... [ OK ]
    Removing all tmp files... [ OK ]
    Processing post-install commands...
    ----
    GRUB is installed, these tree lines must be in your /boot/grub/menu.lst:

    title SliTaz GNU/Linux (Kernel 2.6.30.6-slitaz)
    root (hd0,1)
    kernel /boot/vmlinuz-2.6.30.6-slitaz root=/dev/hda2
    ----
    =============================================linux (2.6.30.6) is installed.

    root@slitaz:~#


    13) update of /boot/grub/menu.lst


    root@slitaz:~# cat /boot/grub/menu.lst
    default 0
    timeout 8
    color yellow/brown light-green/black

    # For booting SliTaz from : /dev/hda2
    title SliTaz GNU/Linux (Kernel 2.6.30.6-slitaz with driver ti_usb_3410_3052)
    root (hd0,1)
    kernel /boot/vmlinuz-2.6.30.6-slitaz root=/dev/hda2

    title SliTaz GNU/Linux (Kernel 2.6.30.6-slitaz)
    root (hd0,1)
    kernel /boot/vmlinuz-2.6.30.6-slitaz_original root=/dev/hda2
    root@slitaz:~#


    14) reboot and choose the new compiled kernel at grub boot menu

    15) check if the ti_usb_3410_5052 module is available:

    root@slitaz:~# modprobe -l | grep ti_usb


    Cheers
    Stephane

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership

SliTaz Social