The first thing is to remember the symbol for that driver feature, as listed in the existing “/proc/config.gz”, is:
# CONFIG_USB_RENESAS_USBHS is not set
You will want to copy your running system’s “/proc/config.gz” somewhere, and then make a copy of that for actually working with…don’t worry about the copy yet, but do save this file with some safe name for future use. I named my copy “config_3.10.40-gb271e8f.gz” because “uname -r” is “3.10.40-gb271e8f”. You will want to remember this because it implies this kernel finds its modules in “/lib/modules/3.10.40-gb271e8f/”. The “3.10.40” is from the kernel source. Whoever compiled it had the CONFIG_LOCALVERSION option set to “-gb271e8f”.
You could cross compile as per the docs, but I’m only going to give information as if you are compiling directly on the JTK1. The tool you are going to use is actually a make target in the kernel source, but you’ll need to make sure you have this package installed:
sudo apt-get install libncurses5-dev
You top level directory is apparently “/usr/src/kernel/”. When I write “$SRC” or “${SRC}” pretend it is that directory location. You could, for just one terminal:
export SRC="/usr/src/kernel/"
Then:
cd $SRC
make mrproper
cp /where/ever/it/is/config_3.10.40-gb271e8f.gz ${SRC}
gunzip config_3.10.40-gb271e8f.gz
mv config_3.10.40-gb271e8f.gz .config
# ...you could hand edit CONFIG_LOCALVERSION, but showing from "make nconfig"...there
# are many cases where hand editing will bite back, but CONFIG_LOCALVERSION is safe to edit.
# There are many variations of this tool, the $SRC/README mentions them.
make nconfig
# Look at the help menu...one is for searching for symbols. Search for LOCALVERSION
# (or CONFIG_LOCALVERSION). Navigate to this, then set it to "<b>-gb271e8f</b>"
# Now search for "CONFIG_USB_RENESAS_USBHS". Use the "y" key to integrate this into the kernel,
# or instead use the "m" key to build as a module and build a module instead. Not all code
# can be built as a module, I suspect this driver can. So I'm assuming "m".
#
# You don't necessarily have to build the whole kernel, but it is a sanity check...it's a waste
# of time to build only a module and put it in place when something else is wrong. To build the
# kernel using 4 CPU cores:
make -j4 Image
# If you skip this previous step you instead need this:
make modules_prepare
# To now build modules:
make -j4 modules
# Your driver should now exist in its directory.
If you read the official docs it will mention things you can set to have the compile output go somewhere else and leave your original directory pristine. If you export the given variables, then this builds the Image and intermediate files in “$TEGRA_KERNEL_OUT”:
make -j4 O=$TEGRA_KERNEL_OUT Image
…this would place the modules in “$TEGRA_MODULES_OUT”:
make modules_install INSTALL_MOD_PATH=$TEGRA_MODULES_OUT
One trick of building with output in a different directory is that you need your “.config” in that different directory and the original source pristine (“make mrproper” cleans source completely).
So alternate commands run as a non-root user:
mkdir ~/build
mkdir ~/modules
export TEGRA_KERNEL_OUT="~/build"
export TEGRA_MODULES_OUT="~/modules"
export SRC="/usr/src/kernel/"
cp /where/ever/it/is/config_3.10.40-gb271e8f.gz $TEGRA_KERNEL_OUT
<b>cd $SRC</b>
sudo make mrproper
make O=$TEGRA_KERNEL_OUT nconfig
# ...do your config stuff...
make -j4 O=$TEGRA_KERNEL_OUT Image
make -j4 O=$TEGRA_KERNEL_OUT modules
make O=$TEGRA_KERNEL_OUT modules_install INSTALL_MOD_PATH=$TEGRA_MODULES_OUT
cd $TEGRA_MODULES_OUT
find . -type f -name "whatever_it_is.ko"
# Put this in the correct place.
The available documentation is just a variation on this for cross compile. This adds for example variables to say it is for a different architecture while building from a host PC.