diff mbox

ARM: tegra: enable console framebuffer rotation

Message ID 1399432682-677-1-git-send-email-acourbot@nvidia.com (mailing list archive)
State New, archived
Headers show

Commit Message

Alexandre Courbot May 7, 2014, 3:18 a.m. UTC
Console rotation is needed for devices like Tegra Note 7 and NVIDIA
SHIELD to get the boot console in the expected orientation.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
---
 arch/arm/configs/tegra_defconfig | 1 +
 1 file changed, 1 insertion(+)

Comments

Stephen Warren May 7, 2014, 3:57 p.m. UTC | #1
On 05/06/2014 09:18 PM, Alexandre Courbot wrote:
> Console rotation is needed for devices like Tegra Note 7 and NVIDIA
> SHIELD to get the boot console in the expected orientation.

I've squashed this into Tegra's for-3.16/defconfig branch.

Can you please also update multi_v7_defconfig, and send that change to
arm-soc (arm@kernel.org) to be applied. Thanks.
Stephen Warren May 7, 2014, 11:35 p.m. UTC | #2
On 05/07/2014 05:40 PM, Alex Courbot wrote:
> On 05/08/2014 12:57 AM, Stephen Warren wrote:
>> On 05/06/2014 09:18 PM, Alexandre Courbot wrote:
>>> Console rotation is needed for devices like Tegra Note 7 and NVIDIA
>>> SHIELD to get the boot console in the expected orientation.
>>
>> I've squashed this into Tegra's for-3.16/defconfig branch.
>>
>> Can you please also update multi_v7_defconfig, and send that change to
>> arm-soc (arm@kernel.org) to be applied. Thanks.
> 
> I omitted doing this for now because the devices that require this
> option (TN7/SHIELD) need a custom build with appended DTB and/or
> command-line anyway. Therefore they cannot use a multi-mach kernel and
> might as well be built against Tegra's defconfig. Does your remark above
> still apply in spite of this?

Ah right, I guess we don't need it there then.
Alexandre Courbot May 7, 2014, 11:40 p.m. UTC | #3
On 05/08/2014 12:57 AM, Stephen Warren wrote:
> On 05/06/2014 09:18 PM, Alexandre Courbot wrote:
>> Console rotation is needed for devices like Tegra Note 7 and NVIDIA
>> SHIELD to get the boot console in the expected orientation.
>
> I've squashed this into Tegra's for-3.16/defconfig branch.
>
> Can you please also update multi_v7_defconfig, and send that change to
> arm-soc (arm@kernel.org) to be applied. Thanks.

I omitted doing this for now because the devices that require this 
option (TN7/SHIELD) need a custom build with appended DTB and/or 
command-line anyway. Therefore they cannot use a multi-mach kernel and 
might as well be built against Tegra's defconfig. Does your remark above 
still apply in spite of this?

Thanks,
Alex.
Andreas Färber May 9, 2014, 2:20 p.m. UTC | #4
Am 08.05.2014 01:40, schrieb Alex Courbot:
> On 05/08/2014 12:57 AM, Stephen Warren wrote:
>> On 05/06/2014 09:18 PM, Alexandre Courbot wrote:
>>> Console rotation is needed for devices like Tegra Note 7 and NVIDIA
>>> SHIELD to get the boot console in the expected orientation.
>>
>> I've squashed this into Tegra's for-3.16/defconfig branch.
>>
>> Can you please also update multi_v7_defconfig, and send that change to
>> arm-soc (arm@kernel.org) to be applied. Thanks.
> 
> I omitted doing this for now because the devices that require this
> option (TN7/SHIELD) need a custom build with appended DTB and/or
> command-line anyway. Therefore they cannot use a multi-mach kernel

What does appending a .dtb have to do with whether or not to use a
multi-mach kernel? We package zImage/uImage and .dtbs separately, so
surely the multi_v7_defconfig should be kept working with Tegra devices.
Appending a .dtb only comes into play for preparing installation images.

Regards,
Andreas
Alexandre Courbot May 9, 2014, 2:47 p.m. UTC | #5
On Fri, May 9, 2014 at 11:20 PM, Andreas Färber <afaerber@suse.de> wrote:
> Am 08.05.2014 01:40, schrieb Alex Courbot:
>> On 05/08/2014 12:57 AM, Stephen Warren wrote:
>>> On 05/06/2014 09:18 PM, Alexandre Courbot wrote:
>>>> Console rotation is needed for devices like Tegra Note 7 and NVIDIA
>>>> SHIELD to get the boot console in the expected orientation.
>>>
>>> I've squashed this into Tegra's for-3.16/defconfig branch.
>>>
>>> Can you please also update multi_v7_defconfig, and send that change to
>>> arm-soc (arm@kernel.org) to be applied. Thanks.
>>
>> I omitted doing this for now because the devices that require this
>> option (TN7/SHIELD) need a custom build with appended DTB and/or
>> command-line anyway. Therefore they cannot use a multi-mach kernel
>
> What does appending a .dtb have to do with whether or not to use a
> multi-mach kernel? We package zImage/uImage and .dtbs separately, so
> surely the multi_v7_defconfig should be kept working with Tegra devices.
> Appending a .dtb only comes into play for preparing installation images.

When appending a dtb the kernel image must also be built with
CONFIG_ARM_APPENDED_DTB, which I guess is not an option we want to add
by default to Tegra and probably even less to multi_v7. So since the
kernel config needs to be changed anyway, I thought we would always
want to use tegra_defconfig as a basis for these devices.

Not that adding CONFIG_FRAMEBUFFER_CONSOLE_ROTATION to multi_v7 would
inflate the resulting kernel much, though.
Stephen Warren May 9, 2014, 3:24 p.m. UTC | #6
On 05/09/2014 08:20 AM, Andreas Färber wrote:
> Am 08.05.2014 01:40, schrieb Alex Courbot:
>> On 05/08/2014 12:57 AM, Stephen Warren wrote:
>>> On 05/06/2014 09:18 PM, Alexandre Courbot wrote:
>>>> Console rotation is needed for devices like Tegra Note 7 and NVIDIA
>>>> SHIELD to get the boot console in the expected orientation.
>>>
>>> I've squashed this into Tegra's for-3.16/defconfig branch.
>>>
>>> Can you please also update multi_v7_defconfig, and send that change to
>>> arm-soc (arm@kernel.org) to be applied. Thanks.
>>
>> I omitted doing this for now because the devices that require this
>> option (TN7/SHIELD) need a custom build with appended DTB and/or
>> command-line anyway. Therefore they cannot use a multi-mach kernel
> 
> What does appending a .dtb have to do with whether or not to use a
> multi-mach kernel? We package zImage/uImage and .dtbs separately, so
> surely the multi_v7_defconfig should be kept working with Tegra devices.
> Appending a .dtb only comes into play for preparing installation images.

That would be a reasonable argument if generic distro installers or
kernel packages were likely to support the TN7 and SHIELD. However,
given the bootloader situation there and the need for a custom kernel
anyway for APPENDED_DTB, I assume that's not the case on this particular
device?

If you do intend to support this device with SuSe installer and kernel
packages, could you give an outline of how you do so?
Andreas Färber May 13, 2014, 8:16 p.m. UTC | #7
Am 09.05.2014 17:24, schrieb Stephen Warren:
> On 05/09/2014 08:20 AM, Andreas Färber wrote:
>> Am 08.05.2014 01:40, schrieb Alex Courbot:
>>> On 05/08/2014 12:57 AM, Stephen Warren wrote:
>>>> On 05/06/2014 09:18 PM, Alexandre Courbot wrote:
>>>>> Console rotation is needed for devices like Tegra Note 7 and NVIDIA
>>>>> SHIELD to get the boot console in the expected orientation.
>>>>
>>>> I've squashed this into Tegra's for-3.16/defconfig branch.
>>>>
>>>> Can you please also update multi_v7_defconfig, and send that change to
>>>> arm-soc (arm@kernel.org) to be applied. Thanks.
>>>
>>> I omitted doing this for now because the devices that require this
>>> option (TN7/SHIELD) need a custom build with appended DTB and/or
>>> command-line anyway. Therefore they cannot use a multi-mach kernel
>>
>> What does appending a .dtb have to do with whether or not to use a
>> multi-mach kernel? We package zImage/uImage and .dtbs separately, so
>> surely the multi_v7_defconfig should be kept working with Tegra devices.
>> Appending a .dtb only comes into play for preparing installation images.
> 
> That would be a reasonable argument if generic distro installers or
> kernel packages were likely to support the TN7 and SHIELD. However,
> given the bootloader situation there and the need for a custom kernel
> anyway for APPENDED_DTB, I assume that's not the case on this particular
> device?

The Shield we probably don't, the TN7 I don't know. I was more concerned
about the shortened justification.

> If you do intend to support this device with SuSe installer and kernel
> packages, could you give an outline of how you do so?

I gave a presentation at embedded world Conference 2014 on how standard
distributions work on ARM/AArch64, but I fear the slides are not online.

As far as possible, we use a single kernel source and a "default" or
"lpae" v7 multi-platform config with lots of modules enabled.

http://kernel.opensuse.org/cgit/kernel-source/tree/config/armv7hl [*]

I just double-checked, and we do have CONFIG_ARM_APPENDED_DTB=y enabled.
It does not restrict supplying the .dtb the "normal" way AIUI.

Our Open Build Service instance then builds a kernel-default .rpm
package containing zImage and modules. The .dts files are separately
compiled and packaged as, e.g., dtb-tegra2 for /boot/dtb/tegra20-*.dtb.

For building initrd, U-Boot boot.scr (including kernel command line) and
installation image, we use Kiwi.

Anyway, we don't rely on the defconfigs for our distro, so do as you see
fit; just gently reminding that it's not feasible for everyone to build
kernels per device, as the above comment seemed to suggest.

Best regards,

Andreas


[*] Yes, some Tegra options are clearly missing; working on syncing them
based on my tegra_defconfig.
Alexandre Courbot May 14, 2014, 2 a.m. UTC | #8
On 05/14/2014 05:16 AM, Andreas Färber wrote:
> Am 09.05.2014 17:24, schrieb Stephen Warren:
>> On 05/09/2014 08:20 AM, Andreas Färber wrote:
>>> Am 08.05.2014 01:40, schrieb Alex Courbot:
>>>> On 05/08/2014 12:57 AM, Stephen Warren wrote:
>>>>> On 05/06/2014 09:18 PM, Alexandre Courbot wrote:
>>>>>> Console rotation is needed for devices like Tegra Note 7 and NVIDIA
>>>>>> SHIELD to get the boot console in the expected orientation.
>>>>>
>>>>> I've squashed this into Tegra's for-3.16/defconfig branch.
>>>>>
>>>>> Can you please also update multi_v7_defconfig, and send that change to
>>>>> arm-soc (arm@kernel.org) to be applied. Thanks.
>>>>
>>>> I omitted doing this for now because the devices that require this
>>>> option (TN7/SHIELD) need a custom build with appended DTB and/or
>>>> command-line anyway. Therefore they cannot use a multi-mach kernel
>>>
>>> What does appending a .dtb have to do with whether or not to use a
>>> multi-mach kernel? We package zImage/uImage and .dtbs separately, so
>>> surely the multi_v7_defconfig should be kept working with Tegra devices.
>>> Appending a .dtb only comes into play for preparing installation images.
>>
>> That would be a reasonable argument if generic distro installers or
>> kernel packages were likely to support the TN7 and SHIELD. However,
>> given the bootloader situation there and the need for a custom kernel
>> anyway for APPENDED_DTB, I assume that's not the case on this particular
>> device?
>
> The Shield we probably don't, the TN7 I don't know. I was more concerned
> about the shortened justification.
>
>> If you do intend to support this device with SuSe installer and kernel
>> packages, could you give an outline of how you do so?
>
> I gave a presentation at embedded world Conference 2014 on how standard
> distributions work on ARM/AArch64, but I fear the slides are not online.
>
> As far as possible, we use a single kernel source and a "default" or
> "lpae" v7 multi-platform config with lots of modules enabled.
>
> http://kernel.opensuse.org/cgit/kernel-source/tree/config/armv7hl [*]
>
> I just double-checked, and we do have CONFIG_ARM_APPENDED_DTB=y enabled.
> It does not restrict supplying the .dtb the "normal" way AIUI.
>
> Our Open Build Service instance then builds a kernel-default .rpm
> package containing zImage and modules. The .dts files are separately
> compiled and packaged as, e.g., dtb-tegra2 for /boot/dtb/tegra20-*.dtb.
>
> For building initrd, U-Boot boot.scr (including kernel command line) and
> installation image, we use Kiwi.
>
> Anyway, we don't rely on the defconfigs for our distro, so do as you see
> fit; just gently reminding that it's not feasible for everyone to build
> kernels per device, as the above comment seemed to suggest.

To be completely clear, we didn't expect these devices to be of interest 
to distros, due to the limitation of their bootloaders.

Both SHIELD and TN7 come with a locked bootloader and cannot use U-boot. 
The bootloader can only boot a kernel from a dedicated, raw boot 
partition (Android style), can only pass a device tree from another raw 
"dtb" partition, and will fill it with plenty of dirty command-line 
options that make mainline unusable. That seems to be a lot for distros 
to handle, so at this stage we'd rather advise users to use a root FS 
image of their favorite distro along with a self-compiled kernel.

That being said I only have a short-range view of the issue, so if you 
know of a way a distro installer could handle this and think it is worth 
doing, I'll be happy to cooperate here.

Thanks,
Alex.
Stephen Warren May 14, 2014, 3:45 a.m. UTC | #9
On 05/13/2014 08:00 PM, Alexandre Courbot wrote:
...
> Both SHIELD and TN7 come with a locked bootloader and cannot use U-boot.
> The bootloader can only boot a kernel from a dedicated, raw boot
> partition (Android style), can only pass a device tree from another raw
> "dtb" partition, and will fill it with plenty of dirty command-line
> options that make mainline unusable. That seems to be a lot for distros
> to handle, so at this stage we'd rather advise users to use a root FS
> image of their favorite distro along with a self-compiled kernel.

I don't know how much effort it's worth putting into this, but it
/might/ be possible to port U-Boot to the devices, and use that as the
"kernel" image that the binary bootloader boots, and then have U-Boot
boot a kernel from a filesystem in the "normal" way. That's kind what I
did by porting U-Boot to the Raspberry Pi. It would certainly increase
the possibility of a distro supporting these devices in a generic way,
as well as avoiding the need for hard-coded command-lines, memory
layout, etc. in the DT files. We'd have to make sure that any installer
didn't change the GPT layout, since then it'd get out of sync with the
tegrapt partitions, which could cause the bootloader to fail.
diff mbox

Patch

diff --git a/arch/arm/configs/tegra_defconfig b/arch/arm/configs/tegra_defconfig
index c706d399557b..e2441e286822 100644
--- a/arch/arm/configs/tegra_defconfig
+++ b/arch/arm/configs/tegra_defconfig
@@ -183,6 +183,7 @@  CONFIG_BACKLIGHT_CLASS_DEVICE=y
 # CONFIG_BACKLIGHT_GENERIC is not set
 CONFIG_BACKLIGHT_PWM=y
 CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
 CONFIG_LOGO=y
 CONFIG_SOUND=y
 CONFIG_SND=y