compiling 2.6.37 kernel in THUMB2 mode
vb at vsbe.com
vb at vsbe.com
Fri Mar 11 17:44:06 EST 2011
Hello Dave,
I had to stop working on trying to run my Tegra2 platform in Thumb-2
mode, but I am back to it.
Basically, I got it compilable, it starts up and goes through
initialization all the way to mounting the file system of the USB
stick. And this is where it gets stuck. The kernel build from the same
set of sources less my thumb related compilation fixes does not stop
there and continues to the login prompt.
I see that interrupts work (by adding some print statements showing
incrementing jiffies and basic interrupt counts), which shows that
normal<->thumb mode transitions happen just fine.
The last thing the thumb kernel prints is
Waiting for root device /dev/sda3...
but the normal kernel proceeds to mount the FS after that.
One thing which seems really weird is that the two versions (thumb and
normal) report different USB serial numbers:
boot.ok:usb 3-1.4: SerialNumber: 07A80C01174E078E
boot.th:usb 3-1.4: SerialNumber: 07AA08011D51D473
I wonder if this is an indication of some USB problems (which would
explain why the file system fails to mount), but find it hard to come
up with a theory.
I wonder if this rings a bell with anyone,
thank you in advance,
Vadim
On Fri, Feb 18, 2011 at 1:26 AM, Dave Martin <dave.martin at linaro.org> wrote:
> On Thu, Feb 17, 2011 at 5:30 PM, <vb at vsbe.com> wrote:
>
> [...]
>
>>
>> Hi Dave,
>>
>> thank you again for the hints.
>>
>> I am trying to build an image for a Tegra2 based platform, it s a
>> 2.6.37 based tree with a fair amount of private additions (to be
>> upstreamed at some point), which does now come up and run in ARM mode.
>> I am trying to see if it can run in Thumb mode.
>>
>> It looks like certain files need to be compiled in ARM mode even when
>> THUMB2_KERNEL is enabled, but I don't see this happening in 2.6.37, I
>> was wondering how this is done in your tree.
>
> Generally, this can be kept to a minimum.
>
> On OMAP, the low-level PM code calls into firmware which cannot cope
> with interworking between ARM and Thumb. The PM code on the ARM side
> could be made to work with this even if it is mostly built in Thumb,
> but that would be complex and not really worth the pain.
>
> You may have this problem if you're trying to communicate with
> firmware, but it's best if you port everything else to be buildable in
> Thumb-2: the primary reason is that for backwards compatibility
> reasons, much of the assembler code in the kernel doesn't support
> ARM/Thumb interworking either. This means that mixing ARM and Thumb
> code in the kernel will lead to problems unless you're careful.
>
>>
>> I tried building an OMAP image, but it does not build in Thumb mode,
>> and Thumb can't even be enabled for it because CPU_V6 configured in.
>> So I was wondering if this tree has some other working config which
>> does use Thumb mode. I'll look at the config files you mentioned, but
>> any suggestions/warnings about converting a kernel to work in Thumb
>> mode are welcome,
>
> Assuming you started with omap2plus_defconfig, you need to remove
> CONFIG_ARCH_OMAP2 from the config. It's not possible to incorporate
> support for omap2 with CONFIG_THUMB2_KERNEL enabled because ARMv6
> doesn't support Thumb-2.
>
> Here's the config I was using:
> http://people.linaro.org/~dmart/arm_omap-thumb2+v2_config (based on
> the linaro config-- note: you don't need to build all the modules!
> Just make zImage or uImage)
>
> Hope that helps!
> ---Dave
>
More information about the linux-arm-kernel
mailing list