Re: rtems-boot-image tool: Raspberry Pi

2020-04-05 Thread Chris Johns



On 2020-04-05 16:34, G. S. Niteesh wrote:

Hii,
It has been quite a few days since the last mail.
Chris, can you please take a look at this when you are free?


I am sorry for not tracking this thread. I would like to work on this 
but currently it is not high on my list as I work on getting a release 
done. I am pleased to see the tool getting attention and I think it is 
an important tool for RTEMS to have so please do not take my lack of 
attention as an indication I do not think it is important.


Thanks
Chris



Thanks,
Niteesh

On Mon, Mar 23, 2020 at 1:23 AM Christian Mauderer > wrote:


Hello Niteesh,

thanks for the (private) remainder. This thread really stopped quite
some time ago. A lot of us are quite busy right now but that shouldn't
happen. If you don't get a response for some question: Please give it
about a week of time and then just ping the thread.

On 05/03/2020 11:06, G. S. Niteesh wrote:
 > On Wed, Feb 26, 2020 at 8:39 AM Chris Johns mailto:chr...@rtems.org>
 > >> wrote:
 >
 >     On 22/2/20 1:45 am, G. S. Niteesh wrote:
 >     > Hi,
 >     >
 >     > This is regarding adding RPi support to the boot image
generation
 >     tool.
 >     >
 >     > The boot process for Raspberry Pi is very unconventional.
The GPU
 >     starts
 >     > first, initializes RAM, other hardware, loads the
bootloaders and
 >     then starts
 >     > the ARM CPU.
 >     >
 >     > The minimum files that are required to boot an RPi are
 >     > bootcode.bin, startx.elf, fixup.dat, kernel.img, config.txt
 >     > There are also other variants of startx.elf and fixup.dat.
 >     > Please have a look
 >     >
 >     at
https://www.raspberrypi.org/documentation/configuration/config-txt/boot.md
 >     > for information on the variants.
 >     >
 >     > From what I have tried on my Rpi3 model b v1.2 the minimum
files
 >     that are
 >     > required are start_x.elf, fixup_x.dat, bootcode.bin,
kernel.img,
 >     config.txt
 >     > But for this to work, we must add start_x=1 to config.txt
because
 >     by default
 >     > start.elf is loaded.
 >
 > Hello Chris,
 >
 >
 >     I would have look at how the tool maps to RPi to know if it needs
 >     more work :)
 >
 >
 > Did you take a look at it?

Chris is most likely too busy with the release right now.

 >
 > In my opinion, there are two ways to do it.
 > The first would be to modify the U-Boot bootloader object to have a
 > files field
 > to make sure the user provides all the necessary files(fixup.dat,
 > startx.elf, config.txt).
 > So after this change the rtems-boot.ini for RPI should look something
 > like this
 > [u-boot-raspberrypi]
 > uses = u-boot-arm-raspberrypi
 > ..
 > ..
 > first_stage = %{ubootdir}/bootcode.bin
 > boot_device = mmc 0
 > second_stage = uboot or startx
 > files = [config.txt, fixup.dat etc]
 > But also please keep in mind that if we want to support RPi4 then the
 > first_stage
 > will start4x.elf since bootcode.bin is now replaced by code in the
 > EEPROM in RPi4 SOC.

As far as I understand that approach it more or less tells: To start a
raspberry you need U-Boot. U-Boot needs the fixup.dat, startx.elf and
config.txt to boot. But that sounds a bit wrong. On Raspberry U-Boot is
purely optional, isn't it? So from a high-level view it would be more a

- Raspberry needs fixup.dat, startx.elf and config.txt
- That can start either:
   - an application or
   - an U-Boot which can then start an application (or do other things)

 >
 > Another approach will be to create the default Raspberry Pi
bootloader
 > object. But having
 > support for U-Boot is important since it will allow for automatic
testing.

That approach sounds more correct. But I don't really know the
rtems-boot-image tool. That makes it a lot harder for me to tell whether
that approach works well. From that ignorant position I would say that
it would be nice to have a boot-image command that can be called with or
without a option (like --with-u-boot). Alternatively maybe two targets
would be possible. One raspiboot-u-boot-pi1 and one raspiboot-raw-pi1.

But your best bet might is to wait for Chris to get free again and
answer that question. He knows the boot image tool and can tell you a
lot better which concept works best.

Best regards

Christian

 >
 > Which one do you think is a better approach?
 >
 > Thank you.
 >
 >
 >     >
 >     > So, what should be the values for the first and second
stages in
 >     rtems-boot.ini
 >     > for Rpi?
 >
 >     Would this 

Re: rtems-boot-image tool: Raspberry Pi

2020-04-05 Thread G. S. Niteesh
Hii,
It has been quite a few days since the last mail.
Chris, can you please take a look at this when you are free?

Thanks,
Niteesh

On Mon, Mar 23, 2020 at 1:23 AM Christian Mauderer 
wrote:

> Hello Niteesh,
>
> thanks for the (private) remainder. This thread really stopped quite
> some time ago. A lot of us are quite busy right now but that shouldn't
> happen. If you don't get a response for some question: Please give it
> about a week of time and then just ping the thread.
>
> On 05/03/2020 11:06, G. S. Niteesh wrote:
> > On Wed, Feb 26, 2020 at 8:39 AM Chris Johns  > > wrote:
> >
> > On 22/2/20 1:45 am, G. S. Niteesh wrote:
> > > Hi,
> > >
> > > This is regarding adding RPi support to the boot image generation
> > tool.
> > >
> > > The boot process for Raspberry Pi is very unconventional. The GPU
> > starts
> > > first, initializes RAM, other hardware, loads the bootloaders and
> > then starts
> > > the ARM CPU.
> > >
> > > The minimum files that are required to boot an RPi are
> > > bootcode.bin, startx.elf, fixup.dat, kernel.img, config.txt
> > > There are also other variants of startx.elf and fixup.dat.
> > > Please have a look
> > >
> > at
> https://www.raspberrypi.org/documentation/configuration/config-txt/boot.md
> > > for information on the variants.
> > >
> > > From what I have tried on my Rpi3 model b v1.2 the minimum files
> > that are
> > > required are start_x.elf, fixup_x.dat, bootcode.bin, kernel.img,
> > config.txt
> > > But for this to work, we must add start_x=1 to config.txt because
> > by default
> > > start.elf is loaded.
> >
> > Hello Chris,
> >
> >
> > I would have look at how the tool maps to RPi to know if it needs
> > more work :)
> >
> >
> > Did you take a look at it?
>
> Chris is most likely too busy with the release right now.
>
> >
> > In my opinion, there are two ways to do it.
> > The first would be to modify the U-Boot bootloader object to have a
> > files field
> > to make sure the user provides all the necessary files(fixup.dat,
> > startx.elf, config.txt).
> > So after this change the rtems-boot.ini for RPI should look something
> > like this
> > [u-boot-raspberrypi]
> > uses = u-boot-arm-raspberrypi
> > ..
> > ..
> > first_stage = %{ubootdir}/bootcode.bin
> > boot_device = mmc 0
> > second_stage = uboot or startx
> > files = [config.txt, fixup.dat etc]
> > But also please keep in mind that if we want to support RPi4 then the
> > first_stage
> > will start4x.elf since bootcode.bin is now replaced by code in the
> > EEPROM in RPi4 SOC.
>
> As far as I understand that approach it more or less tells: To start a
> raspberry you need U-Boot. U-Boot needs the fixup.dat, startx.elf and
> config.txt to boot. But that sounds a bit wrong. On Raspberry U-Boot is
> purely optional, isn't it? So from a high-level view it would be more a
>
> - Raspberry needs fixup.dat, startx.elf and config.txt
> - That can start either:
>   - an application or
>   - an U-Boot which can then start an application (or do other things)
>
> >
> > Another approach will be to create the default Raspberry Pi bootloader
> > object. But having
> > support for U-Boot is important since it will allow for automatic
> testing.
>
> That approach sounds more correct. But I don't really know the
> rtems-boot-image tool. That makes it a lot harder for me to tell whether
> that approach works well. From that ignorant position I would say that
> it would be nice to have a boot-image command that can be called with or
> without a option (like --with-u-boot). Alternatively maybe two targets
> would be possible. One raspiboot-u-boot-pi1 and one raspiboot-raw-pi1.
>
> But your best bet might is to wait for Chris to get free again and
> answer that question. He knows the boot image tool and can tell you a
> lot better which concept works best.
>
> Best regards
>
> Christian
>
> >
> > Which one do you think is a better approach?
> >
> > Thank you.
> >
> >
> > >
> > > So, what should be the values for the first and second stages in
> > rtems-boot.ini
> > > for Rpi?
> >
> > Would this be bootcode.bin?
> >
> > > And also wouldn't it be nice if we could add a files field, which
> > will copy the
> > > specified files to the image? This would save a lot of typing in
> > case of RPi
> >
> > Do you have an example?
> >
> > Chris
> >
> >
> > ___
> > devel mailing list
> > devel@rtems.org
> > http://lists.rtems.org/mailman/listinfo/devel
> >
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: rtems-boot-image tool: Raspberry Pi

2020-03-22 Thread Christian Mauderer
Hello Niteesh,

thanks for the (private) remainder. This thread really stopped quite
some time ago. A lot of us are quite busy right now but that shouldn't
happen. If you don't get a response for some question: Please give it
about a week of time and then just ping the thread.

On 05/03/2020 11:06, G. S. Niteesh wrote:
> On Wed, Feb 26, 2020 at 8:39 AM Chris Johns  > wrote:
> 
> On 22/2/20 1:45 am, G. S. Niteesh wrote:
> > Hi,
> >
> > This is regarding adding RPi support to the boot image generation
> tool.
> >
> > The boot process for Raspberry Pi is very unconventional. The GPU
> starts
> > first, initializes RAM, other hardware, loads the bootloaders and
> then starts
> > the ARM CPU.
> >
> > The minimum files that are required to boot an RPi are
> > bootcode.bin, startx.elf, fixup.dat, kernel.img, config.txt
> > There are also other variants of startx.elf and fixup.dat.
> > Please have a look
> >
> at 
> https://www.raspberrypi.org/documentation/configuration/config-txt/boot.md
> > for information on the variants.
> >
> > From what I have tried on my Rpi3 model b v1.2 the minimum files
> that are
> > required are start_x.elf, fixup_x.dat, bootcode.bin, kernel.img,
> config.txt
> > But for this to work, we must add start_x=1 to config.txt because
> by default
> > start.elf is loaded.
> 
> Hello Chris,
>  
> 
> I would have look at how the tool maps to RPi to know if it needs
> more work :)
> 
> 
> Did you take a look at it?

Chris is most likely too busy with the release right now.

> 
> In my opinion, there are two ways to do it.
> The first would be to modify the U-Boot bootloader object to have a
> files field
> to make sure the user provides all the necessary files(fixup.dat,
> startx.elf, config.txt).
> So after this change the rtems-boot.ini for RPI should look something
> like this
> [u-boot-raspberrypi]
> uses = u-boot-arm-raspberrypi
> ..
> ..
> first_stage = %{ubootdir}/bootcode.bin
> boot_device = mmc 0
> second_stage = uboot or startx
> files = [config.txt, fixup.dat etc]
> But also please keep in mind that if we want to support RPi4 then the
> first_stage
> will start4x.elf since bootcode.bin is now replaced by code in the
> EEPROM in RPi4 SOC.

As far as I understand that approach it more or less tells: To start a
raspberry you need U-Boot. U-Boot needs the fixup.dat, startx.elf and
config.txt to boot. But that sounds a bit wrong. On Raspberry U-Boot is
purely optional, isn't it? So from a high-level view it would be more a

- Raspberry needs fixup.dat, startx.elf and config.txt
- That can start either:
  - an application or
  - an U-Boot which can then start an application (or do other things)

> 
> Another approach will be to create the default Raspberry Pi bootloader
> object. But having
> support for U-Boot is important since it will allow for automatic testing.

That approach sounds more correct. But I don't really know the
rtems-boot-image tool. That makes it a lot harder for me to tell whether
that approach works well. From that ignorant position I would say that
it would be nice to have a boot-image command that can be called with or
without a option (like --with-u-boot). Alternatively maybe two targets
would be possible. One raspiboot-u-boot-pi1 and one raspiboot-raw-pi1.

But your best bet might is to wait for Chris to get free again and
answer that question. He knows the boot image tool and can tell you a
lot better which concept works best.

Best regards

Christian

> 
> Which one do you think is a better approach?
> 
> Thank you.
> 
> 
> >
> > So, what should be the values for the first and second stages in
> rtems-boot.ini
> > for Rpi?
> 
> Would this be bootcode.bin?
> 
> > And also wouldn't it be nice if we could add a files field, which
> will copy the
> > specified files to the image? This would save a lot of typing in
> case of RPi
> 
> Do you have an example?
> 
> Chris
> 
> 
> ___
> devel mailing list
> devel@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
> 
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: rtems-boot-image tool: Raspberry Pi

2020-03-05 Thread G. S. Niteesh
On Wed, Feb 26, 2020 at 8:39 AM Chris Johns  wrote:

> On 22/2/20 1:45 am, G. S. Niteesh wrote:
> > Hi,
> >
> > This is regarding adding RPi support to the boot image generation tool.
> >
> > The boot process for Raspberry Pi is very unconventional. The GPU starts
> > first, initializes RAM, other hardware, loads the bootloaders and then
> starts
> > the ARM CPU.
> >
> > The minimum files that are required to boot an RPi are
> > bootcode.bin, startx.elf, fixup.dat, kernel.img, config.txt
> > There are also other variants of startx.elf and fixup.dat.
> > Please have a look
> > at
> https://www.raspberrypi.org/documentation/configuration/config-txt/boot.md
> > for information on the variants.
> >
> > From what I have tried on my Rpi3 model b v1.2 the minimum files that are
> > required are start_x.elf, fixup_x.dat, bootcode.bin, kernel.img,
> config.txt
> > But for this to work, we must add start_x=1 to config.txt because by
> default
> > start.elf is loaded.

Hello Chris,


> I would have look at how the tool maps to RPi to know if it needs more
> work :)
>

Did you take a look at it?

In my opinion, there are two ways to do it.
The first would be to modify the U-Boot bootloader object to have a files
field
to make sure the user provides all the necessary files(fixup.dat,
startx.elf, config.txt).
So after this change the rtems-boot.ini for RPI should look something like
this
[u-boot-raspberrypi]
uses = u-boot-arm-raspberrypi
..
..
first_stage = %{ubootdir}/bootcode.bin
boot_device = mmc 0
second_stage = uboot or startx
files = [config.txt, fixup.dat etc]
But also please keep in mind that if we want to support RPi4 then the
first_stage
will start4x.elf since bootcode.bin is now replaced by code in the EEPROM
in RPi4 SOC.

Another approach will be to create the default Raspberry Pi bootloader
object. But having
support for U-Boot is important since it will allow for automatic testing.

Which one do you think is a better approach?

Thank you.

>
> >
> > So, what should be the values for the first and second stages in
> rtems-boot.ini
> > for Rpi?
>
> Would this be bootcode.bin?
>
> > And also wouldn't it be nice if we could add a files field, which will
> copy the
> > specified files to the image? This would save a lot of typing in case of
> RPi
>
> Do you have an example?
>
> Chris
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: rtems-boot-image tool: Raspberry Pi

2020-02-25 Thread G. S. Niteesh
On Wed, Feb 26, 2020 at 8:39 AM Chris Johns  wrote:

> On 22/2/20 1:45 am, G. S. Niteesh wrote:
> > Hi,
> >
> > This is regarding adding RPi support to the boot image generation tool.
> >
> > The boot process for Raspberry Pi is very unconventional. The GPU starts
> > first, initializes RAM, other hardware, loads the bootloaders and then
> starts
> > the ARM CPU.
> >
> > The minimum files that are required to boot an RPi are
> > bootcode.bin, startx.elf, fixup.dat, kernel.img, config.txt
> > There are also other variants of startx.elf and fixup.dat.
> > Please have a look
> > at
> https://www.raspberrypi.org/documentation/configuration/config-txt/boot.md
> > for information on the variants.
> >
> > From what I have tried on my Rpi3 model b v1.2 the minimum files that are
> > required are start_x.elf, fixup_x.dat, bootcode.bin, kernel.img,
> config.txt
> > But for this to work, we must add start_x=1 to config.txt because by
> default
> > start.elf is loaded.
>
> I would have look at how the tool maps to RPi to know if it needs more
> work :)
>
> >
> > So, what should be the values for the first and second stages in
> rtems-boot.ini
> > for Rpi?
>
> Would this be bootcode.bin?

For all models of RPi except RPi4 use bootcode.bin as the first stage. But
for RPi4 the bootcode.bin
is replaced by boot code in EEPROM.
Then the second stage would be start*.elf. And we might have an extra stage
depending on whether
U-Boot is used or not.

Please note that I have mentioned start*.elf. There are variants of
start.elf, I have mentioned them
below. But I guess start_x.elf could be used as the default firmware since
it has everything that a
user needs.
start.elf: The basic firmware for the GPU
start_x.elf:  Basic firmware with camera driver and extra video codecs
start_db.elf: Debug version of the firmware (but not sure whether start.elf
or start_x,elf)
start_cd.elf: is a cut-down version with no support hardware blocks like
codecs and 3D.
And there are variants of start.elf for RPi4 ( start4.elf, start4x.elf,
start4db.elf and start4cd.elf)

There is also an additional file fixup*.dat which is required for booting.
And also it is necessary
to make sure that they are matched pairs with start*.elf.

This below site has all this mentioned very clearly.
https://www.raspberrypi.org/documentation/configuration/boot_folder.md

> And also wouldn't it be nice if we could add a files field, which will
> copy the
> > specified files to the image? This would save a lot of typing in case of
> RPi
>
> Do you have an example?

Incase of RPi we have to provide additional files like config.txt and
fixup*.dat and maybe in
the user like to provide other additional files then it would nice to make
the "file" field to support
folders instead of repeating the field again and again for every additional
file.

Thank you,
Niteesh.

>
> Chris
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: rtems-boot-image tool: Raspberry Pi

2020-02-25 Thread Chris Johns
On 22/2/20 1:45 am, G. S. Niteesh wrote:
> Hi,
> 
> This is regarding adding RPi support to the boot image generation tool.
> 
> The boot process for Raspberry Pi is very unconventional. The GPU starts
> first, initializes RAM, other hardware, loads the bootloaders and then starts
> the ARM CPU.
> 
> The minimum files that are required to boot an RPi are
> bootcode.bin, startx.elf, fixup.dat, kernel.img, config.txt
> There are also other variants of startx.elf and fixup.dat.
> Please have a look
> at https://www.raspberrypi.org/documentation/configuration/config-txt/boot.md
> for information on the variants.
> 
> From what I have tried on my Rpi3 model b v1.2 the minimum files that are
> required are start_x.elf, fixup_x.dat, bootcode.bin, kernel.img, config.txt
> But for this to work, we must add start_x=1 to config.txt because by default
> start.elf is loaded.

I would have look at how the tool maps to RPi to know if it needs more work :)

> 
> So, what should be the values for the first and second stages in 
> rtems-boot.ini
> for Rpi?

Would this be bootcode.bin?

> And also wouldn't it be nice if we could add a files field, which will copy 
> the
> specified files to the image? This would save a lot of typing in case of RPi

Do you have an example?

Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: rtems-boot-image tool: Raspberry Pi

2020-02-24 Thread G. S. Niteesh
I am sorry. I'll make sure it doesn't happen again.

On Mon, Feb 24, 2020 at 9:18 PM Gedare Bloom  wrote:

> Hi Niteesh,
>
> On Sun, Feb 23, 2020 at 11:34 PM G. S. Niteesh  wrote:
> >
> > Hii,
> >
> > This is a follow-up message since this thread has been unnoticed for a
> while.
> >
> 2 days over a weekend is not a while. It is typical that you would not
> receive responses over a weekend, or that if your response relies on a
> small number of experts that it might take even longer to get an
> answer. Usually it is good to wait about a week before you ping your
> own email.
>
> Gedare
>
> > Thank you,
> > Niteesh
> >
> > On Fri, Feb 21, 2020 at 8:15 PM G. S. Niteesh  wrote:
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: rtems-boot-image tool: Raspberry Pi

2020-02-24 Thread Gedare Bloom
Hi Niteesh,

On Sun, Feb 23, 2020 at 11:34 PM G. S. Niteesh  wrote:
>
> Hii,
>
> This is a follow-up message since this thread has been unnoticed for a while.
>
2 days over a weekend is not a while. It is typical that you would not
receive responses over a weekend, or that if your response relies on a
small number of experts that it might take even longer to get an
answer. Usually it is good to wait about a week before you ping your
own email.

Gedare

> Thank you,
> Niteesh
>
> On Fri, Feb 21, 2020 at 8:15 PM G. S. Niteesh  wrote:
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: rtems-boot-image tool: Raspberry Pi

2020-02-23 Thread G. S. Niteesh
Hii,

This is a follow-up message since this thread has been unnoticed for a
while.

Thank you,
Niteesh

On Fri, Feb 21, 2020 at 8:15 PM G. S. Niteesh  wrote:

> Hi,
>
> This is regarding adding RPi support to the boot image generation tool.
>
> The boot process for Raspberry Pi is very unconventional. The GPU starts
> first, initializes RAM, other hardware, loads the bootloaders and then
> starts
> the ARM CPU.
>
> The minimum files that are required to boot an RPi are
> bootcode.bin, startx.elf, fixup.dat, kernel.img, config.txt
> There are also other variants of startx.elf and fixup.dat.
> Please have a look at
> https://www.raspberrypi.org/documentation/configuration/config-txt/boot.md
> for information on the variants.
>
> From what I have tried on my Rpi3 model b v1.2 the minimum files that are
> required are start_x.elf, fixup_x.dat, bootcode.bin, kernel.img, config.txt
> But for this to work, we must add start_x=1 to config.txt because by
> default
> start.elf is loaded.
>
> So, what should be the values for the first and second stages in
> rtems-boot.ini for Rpi?
> And also wouldn't it be nice if we could add a files field, which will
> copy the specified files
> to the image? This would save a lot of typing in case of RPi
>
> Thank you,
> Niteesh.
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

rtems-boot-image tool: Raspberry Pi

2020-02-21 Thread G. S. Niteesh
Hi,

This is regarding adding RPi support to the boot image generation tool.

The boot process for Raspberry Pi is very unconventional. The GPU starts
first, initializes RAM, other hardware, loads the bootloaders and then
starts
the ARM CPU.

The minimum files that are required to boot an RPi are
bootcode.bin, startx.elf, fixup.dat, kernel.img, config.txt
There are also other variants of startx.elf and fixup.dat.
Please have a look at
https://www.raspberrypi.org/documentation/configuration/config-txt/boot.md
for information on the variants.

>From what I have tried on my Rpi3 model b v1.2 the minimum files that are
required are start_x.elf, fixup_x.dat, bootcode.bin, kernel.img, config.txt
But for this to work, we must add start_x=1 to config.txt because by default
start.elf is loaded.

So, what should be the values for the first and second stages in
rtems-boot.ini for Rpi?
And also wouldn't it be nice if we could add a files field, which will copy
the specified files
to the image? This would save a lot of typing in case of RPi

Thank you,
Niteesh.
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel