http://wiki.freescale.net/display/MADTools/bsp_cscope_gen.py
What's CSCOPE?
If you don't know what's CSCOPE then you may be missing on one of the most productive tools there are for Linux kernel/driver development or U-boot driver development.
HERE is another wiki I wrote where you can learn more about CSCOPE and integration with vim or gvim.
DOWNLOAD:
Benefits of using bsp_cscope_gen.py
Why should I use bsp_cscope_gen.py considering that LTIB already offers an option to build the CSCOPE database?
- LTIB creates a super inefficient and large CSCOPE database file because it simply takes in consideration ALL of the Linux kernel code.
- As you know, Linux has been ported to many platforms and CPUs. If you build a brute force CSCOPE database and want to quickly check the definition of "board_init" function then CSCOPE will show you ALL of the "board_init" implementations: i.MXs, OMAPs, i386s, PowerPCs, etc.
- Wouldn't it be nice if CSCOPE will show me only the "board_init" implementation of the platform you are currently compiling for?
- Then bsp_cscope_gen.py is what you need.
bsp_cscope_gen.py generates the CSCOPE database exclusively from the files that were compiled. If a file is not compiled it will never show up during your code searches.
How to use bsp_cscope_gen.py?
bsp_cscope_gen.py can be used with Linux or U-boot code trees. Redboot is not supported yet.
Explanation for Linux kernel code tree:
Assume the following folder contains a compiled linux kernel tree:
/myfolder/with/linux
Assume the current directory is the same where bsp_cscope_gen.py is located.
$./bsp_cscope_gen.py /myfolder/with/linux
If everything went fine, the following files will be created under "/myfolder/with/linux":
cscope.files
cscope.out
cscope.out.in
cscope.out.po
Change your current working directory to "/myfolder/with/linux" and VOILÁ. Now you execute CSCOPE directly, or better yet, integrate the CSCOPE database with vim.
To learn how to integrate CSCOPE with vim, check this tutorial I wrote.
Explanation for U-boot code tree:
Same as Linux case, but instead of specifying a Linux kernel tree directory you specify a U-boot code tree directory.
Example:
Let's assume you unpacked and compiled U-boot using LTIB, in a case like this your U-boot code tree will be located at something like:
..../ltib/rpm/BUILD/u-boot-2009.08
At the console execute:
$./bsp_cscope_gen.py ..../ltib/rpm/BUILD/u-boot-2009.08
If everything went fine, the following files will be created under "..../ltib/rpm/BUILD/u-boot-2009.08":
cscope.files cscope.out cscope.out.in cscope.out.po
Change your current working directory to "..../ltib/rpm/BUILD/u-boot-2009.08" and VOILÁ. Now you execute CSCOPE directly, or better yet, integrate the CSCOPE database with vim.
To learn how to integrate CSCOPE with vim, check this tutorial I wrote.