On Thu, Oct 20, 2011 at 11:30 PM, Amit Kucheria <amit.kucheria@linaro.org> wrote:
On 11 Oct 20, Deepti Kalakeri wrote:
> Hello All,
>
> I have a need to enable thumb2 kernel option for kernel built using
> omap2plus_defconfig.
> Hence I am trying to find a mechanism to automatically enable the thumb2
> kernel config option.
> I have tried adding the CONFIG_THUMB2_KERNEL=y option to the .config file by
>
> 1) Appending it to the end of the .config using the echo
> CONFIG_THUMB2_KERNEL=y >> output_dir/.config
> 2) By replacing the CONFIG_ARM_THUMB=y with CONFIG_THUMB2_KERNEL=y  option
> using the sed -ie 's/CONFIG_ARM_THUMB=y/CONFIG_THUMB2_KERNEL=y/g'
> output_dir/.config
>
> I follow this with the make oldconfig for ex:
>
> yes "" | make ARCH=arm O=output_dir
> KERNELVERSION=3.0.5-758-g051c523-omap2plus-linaro-omap
> KERNELRELEASE=3.0.5-758-g051c523-omap2plus-linaro-omap
> CROSS_COMPILE=arm-linux-gnueabi- oldconfig
>
> Both the above mechanisms work, but once I run oldconfig the .config is
> getting overwritten and it gets back to the old state.

You can't just enable THUMB2 when other config options that prevent THUMB2
(such as CPU_V6) are enabled.

I tried this with the make omap2plus_defconfig, followed by make menuconfig
to do interactive selection of THUMB2. For this, I first had to disable
CPU_V6 (by disabling OMAP2 support), for the THUMB2 to be selectable.

The diff between the resulting .config and omap2plus_defconfig is at
http://paste.ubuntu.com/714378/

See below on how to achieve this non-interactively.

> I am sure there is something which I am missing. Can you let me know the
> exact steps to overwrite the .config file.
>
> 1) I want to be able to overwrite the THUMB option with THUMB2 or add the
> THUMB2 option ( if existence of both THUMB and THUMB2 in the .config is
> permissible)
> 2) What would happen if both the CONFIG_ARM_THUMB=y and
> CONFIG_THUMB2_KERNEL=y options are present in the .config.
>     Would the kernel be built with CONFIG_ARM_THUMB=y or
> CONFIG_THUMB2_KERNEL=y  ?
>
> Do you have any suggestions to enable the THUMB2 option in a non-interactive
> way ?

Try the following:

make ARCH=arm omap2plus_defconfig
yes "" | make ARCH=arm oldconfig
cp .config /tmp/config
echo "CONFIG_ARCH_OMAP2=n" >> .config
echo "CONFIG_THUMB2_KERNEL=y" >> .config
yes "" | make ARCH=arm oldconfig
grep THUMB2 .config


Thanks Amit. These steps worked for me.
/Amit




--
Thanks and Regards,
Deepti  
Infrastructure Team Member, Linaro Platform Teams
Linaro.org | Open source software for ARM SoCs
Follow Linaro: http://www.facebook.com/pages/Linaro
http://twitter.com/#!/linaroorg - http://www.linaro.org/linaro-blog