linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* ARCH_MULTIPLATFORM + ARM_APPENDED_DTB + custom boot-loader
@ 2015-11-26 16:53 Mason
  2015-11-26 17:10 ` Mason
  0 siblings, 1 reply; 5+ messages in thread
From: Mason @ 2015-11-26 16:53 UTC (permalink / raw)
  To: linux-arm-kernel

Hello,

I'm using an ARCH_MULTIPLATFORM kernel with an appended DTB.
I make a uImage out of this zImage+DTB.
On my board, U-Boot passes control to Linux, which boots correctly.

But when I replace U-Boot with a custom boot-loader, Linux tries
to boot some kind of "Generic DT based system" rather than the DT
I appended.

In fact, my setup code is:

static const char *const tango_dt_compat[] = { "sigma,tango4", NULL };
DT_MACHINE_START(TANGO_DT, "Sigma Tango DT")
	.dt_compat	= tango_dt_compat,
	.l2c_aux_mask	= ~0,
	.l2c_write_sec	= tango_l2c_write,
MACHINE_END


When I boot with U-Boot, in the early stage, the kernel prints
[    0.000000] Machine model: Sigma Designs SMP8758 Vantage-1172 Rev E1
(that's my model property)

But when I boot with the custom boot-loader, it just prints
[    0.000000] Machine: Sigma Tango DT
(and fails quickly since there are no clocks)


Does someone know what's going on? I thought the ARM_APPENDED_DTB
option was supposed to make DT handling transparent to boot-loaders?

This discussion may be relevant:
https://github.com/raspberrypi/linux/issues/381

Regards.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* ARCH_MULTIPLATFORM + ARM_APPENDED_DTB + custom boot-loader
  2015-11-26 16:53 ARCH_MULTIPLATFORM + ARM_APPENDED_DTB + custom boot-loader Mason
@ 2015-11-26 17:10 ` Mason
  2015-11-26 17:14   ` Russell King - ARM Linux
  2015-11-26 17:18   ` Nicolas Pitre
  0 siblings, 2 replies; 5+ messages in thread
From: Mason @ 2015-11-26 17:10 UTC (permalink / raw)
  To: linux-arm-kernel

On 26/11/2015 17:53, Mason wrote:

> I'm using an ARCH_MULTIPLATFORM kernel with an appended DTB.
> I make a uImage out of this zImage+DTB.
> On my board, U-Boot passes control to Linux, which boots correctly.
> 
> But when I replace U-Boot with a custom boot-loader, Linux tries
> to boot some kind of "Generic DT based system" rather than the DT
> I appended.
> 
> In fact, my setup code is:
> 
> static const char *const tango_dt_compat[] = { "sigma,tango4", NULL };
> DT_MACHINE_START(TANGO_DT, "Sigma Tango DT")
> 	.dt_compat	= tango_dt_compat,
> 	.l2c_aux_mask	= ~0,
> 	.l2c_write_sec	= tango_l2c_write,
> MACHINE_END
> 
> 
> When I boot with U-Boot, in the early stage, the kernel prints
> [    0.000000] Machine model: Sigma Designs SMP8758 Vantage-1172 Rev E1
> (that's my model property)
> 
> But when I boot with the custom boot-loader, it just prints
> [    0.000000] Machine: Sigma Tango DT
> (and fails quickly since there are no clocks)

I was working off incorrect assumptions.
The custom boot-loader was given an Image (not a uImage) and the DT
was probably not appended to the Image.

Question: can a DT be appended to an Image, or does it have to be
appended to a zImage? Can a zImage be uncompressed or compressed
with a null compressor?

Regards.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* ARCH_MULTIPLATFORM + ARM_APPENDED_DTB + custom boot-loader
  2015-11-26 17:10 ` Mason
@ 2015-11-26 17:14   ` Russell King - ARM Linux
  2015-11-26 17:34     ` Mason
  2015-11-26 17:18   ` Nicolas Pitre
  1 sibling, 1 reply; 5+ messages in thread
From: Russell King - ARM Linux @ 2015-11-26 17:14 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Nov 26, 2015 at 06:10:06PM +0100, Mason wrote:
> Question: can a DT be appended to an Image, or does it have to be
> appended to a zImage?

The code to deal with it is part of the zImage.

> Can a zImage be uncompressed or compressed with a null compressor?

Why?

The format of both Image and zImage are mostly identical - you should
be able to use either with a boot loader wanting a binary image -
provided things are setup how the kernel wants.  However, as you
need the appended DT support, you must use zImage.

-- 
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* ARCH_MULTIPLATFORM + ARM_APPENDED_DTB + custom boot-loader
  2015-11-26 17:10 ` Mason
  2015-11-26 17:14   ` Russell King - ARM Linux
@ 2015-11-26 17:18   ` Nicolas Pitre
  1 sibling, 0 replies; 5+ messages in thread
From: Nicolas Pitre @ 2015-11-26 17:18 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, 26 Nov 2015, Mason wrote:

> On 26/11/2015 17:53, Mason wrote:
> 
> > I'm using an ARCH_MULTIPLATFORM kernel with an appended DTB.
> > I make a uImage out of this zImage+DTB.
> > On my board, U-Boot passes control to Linux, which boots correctly.
> > 
> > But when I replace U-Boot with a custom boot-loader, Linux tries
> > to boot some kind of "Generic DT based system" rather than the DT
> > I appended.

If you have a custom bootloader, why are you using an appended DTB?

The appended DTB feature should be a last resort solution only when 
there  is no way to make the bootloader behave correctly.

> The custom boot-loader was given an Image (not a uImage) and the DT
> was probably not appended to the Image.
> 
> Question: can a DT be appended to an Image, or does it have to be
> appended to a zImage? 

It works with zImage only.

> Can a zImage be uncompressed or compressed with a null compressor?


Please consider fixing your bootloader to provide a DT to the kernel the 
official way.  Then you'll have the freedom to use a uImage, zImage or 
Image as you see fit without contraptions such as a null compressor.


Nicolas

^ permalink raw reply	[flat|nested] 5+ messages in thread

* ARCH_MULTIPLATFORM + ARM_APPENDED_DTB + custom boot-loader
  2015-11-26 17:14   ` Russell King - ARM Linux
@ 2015-11-26 17:34     ` Mason
  0 siblings, 0 replies; 5+ messages in thread
From: Mason @ 2015-11-26 17:34 UTC (permalink / raw)
  To: linux-arm-kernel

On 26/11/2015 18:14, Russell King - ARM Linux wrote:

> On Thu, Nov 26, 2015 at 06:10:06PM +0100, Mason wrote:
>
>> Question: can a DT be appended to an Image, or does it have to be
>> appended to a zImage?
> 
> The code to deal with it is part of the zImage.
> 
>> Can a zImage be uncompressed or compressed with a null compressor?
> 
> Why?

To minimize the time required to boot on a slow emulator? :-)

> The format of both Image and zImage are mostly identical - you should
> be able to use either with a boot loader wanting a binary image -
> provided things are setup how the kernel wants.  However, as you
> need the appended DT support, you must use zImage.

Thanks. LZ4 is the fastest decompressor, right?

Regards.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-11-26 17:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-26 16:53 ARCH_MULTIPLATFORM + ARM_APPENDED_DTB + custom boot-loader Mason
2015-11-26 17:10 ` Mason
2015-11-26 17:14   ` Russell King - ARM Linux
2015-11-26 17:34     ` Mason
2015-11-26 17:18   ` Nicolas Pitre

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).