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.

Optimization of linux kernel & uboot

Dear TI E2E Community,

I am trying to optimize the linux-3.12.10-ti2013.12.01 which is in ti-sdk-am335x-evm-07.00.00.00

I am trying to remove the unwanted modules except the following onchip controller drivers which is in ti-sdk-am335x-evm-07.00.00.00

Basically I have removed few uwanted client drivers, Could anybody please let me know the following

1) How unwanted core drivers(mainly i want to remove SGX driver & other core drivers as well) can removed in menuconfig

2) After removing few unwanted drivers in menuconfig the .config which am going to get , how this .config can be loaded (resused) for further removing unwanted driver modules (along with already removed  few unwanted drivers) by loading it in menuconfig again

3)Basically I will be using the following controllers in my custom board, could anybody please let me know what is the boot time roughly can be reduced only which these core drivers after removing the unwanted drivers apart from the following

MII

USB
McASP0
UART0
UART1
UART3
UART4
GPIO
ADC 0
ADC 1
ADC 2
ADC 3
ADC 4
ADC 5
PWM 0
MMC 1

4) As am new to this optimization of uboot & kernel boot time & image(uboot + kernel) size, could anybody please let me know how to get started for the same & verified on beaglebone black

Could anybody please do the needful as early as possible as am working on this from past two weeks

Awaiting for your replies

Many Thanks in advance

  • Hi Srini,

    1) How unwanted core drivers(mainly i want to remove SGX driver & other core drivers as well) can removed in menuconfig

    Yes, you can remove the unwanted driver through menuconfig option.

    2) After removing few unwanted drivers in menuconfig the .config which am going to get , how this .config can be loaded (resused) for further removing unwanted driver modules (along with already removed  few unwanted drivers) by loading it in menuconfig again

    It would get update every time when you call menuconfig and you can see ".config saved or updated" like that.

    3)Basically I will be using the following controllers in my custom board, could anybody please let me know what is the boot time roughly can be reduced only which these core drivers after removing the unwanted drivers apart from the following

    Please refer to the following TI wikis.

    http://processors.wiki.ti.com/index.php/Boot_Time_Optimization

    http://processors.wiki.ti.com/index.php/Optimize_Linux_Boot_Time

    http://processors.wiki.ti.com/index.php/All_This_For_1_Second_Boot

  • Thanks a lot for your replies Titus,

    I need some more clarification w.r.t .retaining the .config changes everytime, as am using following commands everytime

    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- mrproper
    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- tisdk_am335x-evm_defconfig
    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- uImage dtbs

    As menuconfig is GUI of tisdk_am335x-evm_defconfig, Now should I use only the following commands inorder to retain the previous .config changes & do some more changes on this .config(along with the previous changes)

    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- uImage dtbs

    Could you please clarify on the same am bit confused on this can you please correct me with correct & detailed steps,

    could you please do the needful as early as poosible

    Many thanks in advance

  • Hi Srini,

    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- mrproper   ---> To Clean the all old configured (.config) files and object files
    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- tisdk_am335x-evm_defconfig ---> To create default configuration for the TI EVM boards (It would update the .config file)

    "mrproper" option is combination of "clean" and "distclean"

    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- distclean (It will clean the configuration file (.config))

    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- clean  (It will clean the object files)

    You have to use the above command only at initial stage (only one time).

    After that, we can use the following commands for configuration as well building kernel and dtbs.

    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig   ----> To select the drivers and linux kernel optons.
    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- uImage dtbs   ---> To build/compile the kernel image and dtb files (dtbs)

    As menuconfig is GUI of tisdk_am335x-evm_defconfig, Now should I use only the following commands inorder to retain the previous .config changes & do some more changes on this .config(along with the previous changes)

    Yes, your understanding is correct.

    It is always to take a backup of ".config" for every good expected boot.

    And you can use the backup .config by just copy & paste the .config in linux kernel source "/' location.

  • Hi Titus,

    Thanks for the replies,

    It is really helpful,

    1)

    Now I have customized enough drivers from menuconfig, now I need to use this .conifg always,

    I have copied it to '/',  now how can I load this .config everytime, is it necessary to create the defconfig from this .config, if so (please let me know how to create this defconfig)

    or

    Is there any options in this kernel menuconfig ie., to load this .confif everytime (because in old kernels in menuconfig we had options of loading alternate configuration file but am unable to find this in this kernel ie.,ti-sdk-am335x-evm-07.00.00.00)

    Could you please let me know how this customized .config can be loaded every time instead of default configuration

    2)

    I am trying to measure the boot time (http://processors.wiki.ti.com/index.php/Measuring_Boot_Time)

    I have cross compiled tstamp.c & I have loaded the timestamp ie., using

     arm-linux-gnueabihf-gcc timestamp.c -o timestamp & I have copied to /rootfs/usr/bin/

    Am trying to run this executable on board as shown below

    root@beaglebone:~# timestamp < /dev/ttyO0

    But am unable to get any bootprints with time stamps inorder to measure boot time , could you please correct me if am I wrong w.r.t this

    Or could you please let me know there any other alternate ways to measure boot time apart from this

    Kindly do the needful as early as possible

    Many Thanks in advance

  • Hi Srini,

    1)

    Now I have customized enough drivers from menuconfig, now I need to use this .conifg always,

    I have copied it to '/',  now how can I load this .config everytime, is it necessary to create the defconfig from this .config, if so (please let me know how to create this defconfig)

    or

    Is there any options in this kernel menuconfig ie., to load this .confif everytime (because in old kernels in menuconfig we had options of loading alternate configuration file but am unable to find this in this kernel ie.,ti-sdk-am335x-evm-07.00.00.00)

    Could you please let me know how this customized .config can be loaded every time instead of default configuration

    Just copy .config and rename into configs folder.

    cp -rf .config arch/arm/configs/titus_am335x_new_defconfig

    2) Regarding measuring the boot time,

    We have to use any serial port software to read the time stamp.

    I have used "timestamp" for reading time for network transfer.

    http://processors.wiki.ti.com/index.php/Optimize_Linux_Boot_Time#Measuring_boot_time

  • Also you can use "grapserial" utility to get a exact time for each print from serial port.

    http://elinux.org/Grabserial

    Ex:

    ti@titus:/home/titus$ cd ti-e2e/
    ti@titus:/home/titus/ti-e2e$ sudo ./grabserial -v -d "/dev/ttyUSB0" -b 115200 -w 8 -p N -s 1 -e 30 -t
    Opening serial port /dev/ttyUSB0
    115200:8N1:xonxoff=0:rtcdtc=0
    Program will end in 30 seconds
    Printing timing information for each line
    Use Control-C to stop...
    [    0.000000]
    [    0.000051] U-Boot SPL 2013.01 (Jul 01 2014 - 16:19:36)
    [    0.004070] SF: Detected N25Q128A with page size 64 KiB, total 16 MiB
    [    0.286003]
    [    0.286057]
    [    0.286076] U-Boot 2013.01 (Jul 01 2014 - 16:19:36)
    [    0.289996]
    [    0.290019] I2C:   ready
    [    0.651948] Detected SO-DIMM [SQR-SD3T-2G1333SED]
    [    0.665890] DRAM:  2 GiB
    [    0.680899] NAND:  512 MiB
    [    1.298963] Net:   TCI6638_EMAC, TCI6638_EMAC1
    [    1.562054] Hit any key to stop autoboot:  2