This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Adding a custom module

Hi,

I have written a custom kernel module to handle PCIe device. The kernel module is tested on fedora 18 with kernel 3.6. Now I want to test that module with Keystone 2. I have installed CCS 6.0 and want to add my custom module in linux build for keystone2. I am new to TI keystone and its environment. So my question is how to add a laodable kernel module in linux build for keyston II?

Regards

Abdul Basit

  • Hi Adbul,

    Welcome to the TI E2E forum. I hope you will find many good answers here and in the TI.com documents and in the TI Wiki Pages (for processor issues). Be sure to search those for helpful information and to browse for the questions others may have asked on similar topics (e2e.ti.com). Please refer all the links below my signature. 

    We recommend you to install the MCSDK 3.x for keystone II devices development and Linaro tool chain for building the modules. Please find the latest MCSDK and user guide link below my signature.

    Please refer below wiki for building and running the linux on keystone II devices,

    processors.wiki.ti.com/.../MCSDK_UG_Chapter_Exploring

    Thank you.

  • Hi Abdul,

    After booted the K2H/K2E board, you have to install your kernel module using "insmod" command.
    PS: You have to disable our PCIe driver in linux to avoid conflict between drivers.

    Revert to us for any clarification.

    Regards,
    Shankari.
  • Thanks Shankari,
    May be I was not clear in my question. I intend to add that module in filesystem of linux that will run EVMK2H. My question is where to add that module so that it may appear as loadable kernel module in filesystem .

    Regards
    Abdul Basit
  • Hi Abdul,
    Where do you want to have your file system in NAND or USB or Network(NFS) etc?
    Thank you.
  • Hi RK,
    I will put my filesystem in nand .

    Regards
    Abdul Basit
  • Please refer mcsdk explore wiki for detailed information on booting using ubifs on NAND . The section "Calculations" has more information to add images to file system, you can follow the same to copy your custom modules.

    processors.wiki.ti.com/.../MCSDK_UG_Chapter_Exploring

    Thank you.
  • Hi Abdul,

    Typically, we use the following command to put the modules in filesystem.

    make modules ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
    make modules_install INSTALL_MOD_PATH=<filesystem location> ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-

    Here, you have to untar the TI's filesystem and use the second command to put your kernel modules to filesystem and flash into NAND with UBIFS or what ever filesystem type.

    BTW, you have your own PCIe driver, and it would be out of the TI kernel tree and you might have build using the following command right ?

    make -C <kernel location> -M `pwd` modules

    So, I think you can copy the kernel module driver (*.ko) directly to your filesystem by copying the *.ko via pendrive.

    And you can install through "insmod" or through scripts.

  • Thanks,
    I will try the first option and will update you guys about it. I have to stick with filesystem option as I am using usb port for other purpose.
  • Hi Abdul,

    Able to put your driver into filesystem successfully and able to run ?

    How did you implement/migrated/Build your PCIe driver to Linux ?
    Did you have you driver out of kernel tree ?

    I mean, did you modify the "Kconfig" and "Makefile" of kernel tree for your PCIe driver ?

    If yes, you can follow the first option, else you might buidl your own driver using following command right ?

    Ex:
    cat Makefile
    obj-m += PCIe.o

    To build:
    make -C <keystone-linux locaton> M=`pwd` modules


    Regards,
    Shankari.
  • Hi shankari ,
    I am trying to do it with second option. but there is a problem that I am facing. In UG they say after cloning from git we have to put this command
    git reset --hard <Release tag> . I tried several tags but, I get error "un recognized tag" . What tag should I put ? I want to use kernel 3.10.10 . Moreover is it necessary to install mcsdk to build linux kernel ( I think we don't need it). Also is it necessary to buil the kernel before building out of tree modules.

    Regards
    Abdul Basit
  • Hi Adbul,
    Please refer the MCSDK release notes for correct tag. We recommend you to use latest MCSDK. Please find the latest MCSDK download and user guide link below my signature.

    Path to release notes: ..\ti\mcsdk_bios_3_0x_0x_0x\docs
  • Hi Raja,

    I tried with this tag mentioned in Release notes K2_LINUX_03.10.10_13.11_01 but still got the error "unknown revision or path not in working tree". 

    Regards

  • Hi Abdul,

    Abdul says said:
    I am trying to do it with second option. but there is a problem that I am facing. In UG they say after cloning from git we have to put this command

    git reset --hard <Release tag> . I tried several tags but, I get error "un recognized tag" . What tag should I put ? I want to use kernel 3.10.10 . Moreover is it necessary to install mcsdk to build linux kernel ( I think we don't need it). Also is it necessary to buil the kernel before building out of tree modules.

    If it says unrecognized tag, you can list the available tags using the "git tag -l" option like below and then you can use the appropriate tag.

    #git tag -l

    and then use "git reset " command.

    #git reset --hard K2_LINUX_03.10.61_15.02

    For more info please refer to

    Regards,

    Shankari

    -------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question.

    --------------------------------------------------------------------------------------------------------

  • thanks guys,
    I am very pleased with your timely responses.