mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* barebox - rk3568
@ 2022-01-04  8:39 Frank Wunderlich
  2022-01-04 10:51 ` Sascha Hauer
  2022-01-05 12:08 ` Ahmad Fatoum
  0 siblings, 2 replies; 7+ messages in thread
From: Frank Wunderlich @ 2022-01-04  8:39 UTC (permalink / raw)
  To: barebox

Hi,

i have a prototype rk3568 board (bpi-r2-pro).

is it possible to flash only barebox instead of uboot? in documentation i found only "creating SD-card", but i dont want to break existing partitions.

https://www.barebox.org/doc/latest/boards/rockchip.html#rockchip-rk3568

says it starts from sector 32, my first block for uboot (idblock.bin=spl+raminit) starts at 64, full uboot in partition at 8M.

As it differs a bit from evb can i add new dts like in uboot?

regards Frank

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


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

* Re: barebox - rk3568
  2022-01-04  8:39 barebox - rk3568 Frank Wunderlich
@ 2022-01-04 10:51 ` Sascha Hauer
  2022-01-04 11:20   ` Aw: " Frank Wunderlich
  2022-01-05 12:08 ` Ahmad Fatoum
  1 sibling, 1 reply; 7+ messages in thread
From: Sascha Hauer @ 2022-01-04 10:51 UTC (permalink / raw)
  To: Frank Wunderlich; +Cc: barebox

Hi Frank,

On Tue, Jan 04, 2022 at 09:39:05AM +0100, Frank Wunderlich wrote:
> Hi,
> 
> i have a prototype rk3568 board (bpi-r2-pro).
> 
> is it possible to flash only barebox instead of uboot? in documentation i found only "creating SD-card", but i dont want to break existing partitions.

The rk3568 has a fixed boot order of eMMC, SD, USB. The EVB board has a
pushbutton to shortcircuit a pin of the eMMC. When pushed, the eMMC
becomes invalid and the board boots from SD card. I could imagine it's
the same on your board, so you could create an SD card and boot from
that. Other than that an image that starts from SD card can also start
from eMMC, the images are the same.
You could also start from USB, the barebox tree has a rk3568 USB loader
tool.

> 
> https://www.barebox.org/doc/latest/boards/rockchip.html#rockchip-rk3568
> 
> says it starts from sector 32, my first block for uboot (idblock.bin=spl+raminit) starts at 64, full uboot in partition at 8M.
> 
> As it differs a bit from evb can i add new dts like in uboot?

Yes, you can. See
https://www.barebox.org/doc/latest/devel/porting.html?highlight=new%20board
for more information how. Also have a look at commit b9f1bb8563ba
which adds the EVB board support. You'll have to do the same for your
board.
One thing you'll need is a sdram-init.bin file. You can extract it from
your BSP.

Regards,
  Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


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

* Aw: Re: barebox - rk3568
  2022-01-04 10:51 ` Sascha Hauer
@ 2022-01-04 11:20   ` Frank Wunderlich
  2022-01-04 14:16     ` Sascha Hauer
  0 siblings, 1 reply; 7+ messages in thread
From: Frank Wunderlich @ 2022-01-04 11:20 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

Hi,

thanks, got it compiled and booting...currently looking around how to do things ;)
have successful booted linux+dtb+initrd manually and pinged my router as network test.

now i looks how to include scripts that i don't need to write all again and again...

documentation says that a direktory will be used in boards directory, but this seems not working

so i used the config-approach

DEFAULT_ENVIRONMENT_PATH=arch/arm/boards/rockchip-rk3568-evb/defaultenv

i'm not sure how the saveenv works (where the environment is stored...i have no /dev/env0). in uboot i can define a device (mmc), partition (1:1), filename (uboot.env) for storing environment onto a fat-partition. i guess you have something similar too

regards Frank


> Gesendet: Dienstag, 04. Januar 2022 um 11:51 Uhr
> Von: "Sascha Hauer" <sha@pengutronix.de>
> An: "Frank Wunderlich" <frank-w@public-files.de>
> Cc: barebox@lists.infradead.org
> Betreff: Re: barebox - rk3568
>
> Hi Frank,
>
> On Tue, Jan 04, 2022 at 09:39:05AM +0100, Frank Wunderlich wrote:
> > Hi,
> >
> > i have a prototype rk3568 board (bpi-r2-pro).
> >
> > is it possible to flash only barebox instead of uboot? in documentation i found only "creating SD-card", but i dont want to break existing partitions.
>
> The rk3568 has a fixed boot order of eMMC, SD, USB. The EVB board has a
> pushbutton to shortcircuit a pin of the eMMC. When pushed, the eMMC
> becomes invalid and the board boots from SD card. I could imagine it's
> the same on your board, so you could create an SD card and boot from
> that. Other than that an image that starts from SD card can also start
> from eMMC, the images are the same.
> You could also start from USB, the barebox tree has a rk3568 USB loader
> tool.
>
> >
> > https://www.barebox.org/doc/latest/boards/rockchip.html#rockchip-rk3568
> >
> > says it starts from sector 32, my first block for uboot (idblock.bin=spl+raminit) starts at 64, full uboot in partition at 8M.
> >
> > As it differs a bit from evb can i add new dts like in uboot?
>
> Yes, you can. See
> https://www.barebox.org/doc/latest/devel/porting.html?highlight=new%20board
> for more information how. Also have a look at commit b9f1bb8563ba
> which adds the EVB board support. You'll have to do the same for your
> board.
> One thing you'll need is a sdram-init.bin file. You can extract it from
> your BSP.
>
> Regards,
>   Sascha
>
> --
> Pengutronix e.K.                           |                             |
> Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
> 31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
>

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


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

* Re: Re: barebox - rk3568
  2022-01-04 11:20   ` Aw: " Frank Wunderlich
@ 2022-01-04 14:16     ` Sascha Hauer
  0 siblings, 0 replies; 7+ messages in thread
From: Sascha Hauer @ 2022-01-04 14:16 UTC (permalink / raw)
  To: Frank Wunderlich; +Cc: barebox

On Tue, Jan 04, 2022 at 12:20:51PM +0100, Frank Wunderlich wrote:
> Hi,
> 
> thanks, got it compiled and booting...currently looking around how to do things ;)
> have successful booted linux+dtb+initrd manually and pinged my router as network test.
> 
> now i looks how to include scripts that i don't need to write all again and again...
> 
> documentation says that a direktory will be used in boards directory, but this seems not working
> 
> so i used the config-approach
> 
> DEFAULT_ENVIRONMENT_PATH=arch/arm/boards/rockchip-rk3568-evb/defaultenv
> 
> i'm not sure how the saveenv works (where the environment is
> stored...i have no /dev/env0). in uboot i can define a device (mmc),
> partition (1:1), filename (uboot.env) for storing environment onto a
> fat-partition. i guess you have something similar too

You don't need a /dev/env0. The EVB device tree has:

               environment-sd {
                       compatible = "barebox,environment";
                       device-path = &environment_sd;
                       status = "disabled";
               };

               environment-emmc {
                       compatible = "barebox,environment";
                       device-path = &environment_emmc;
                       status = "disabled";
               };

One of these nodes will be enabled based on the current bootsource:

       if (bootsource == BOOTSOURCE_MMC && instance == 1)
               of_device_enable_path("/chosen/environment-sd");
       else
               of_device_enable_path("/chosen/environment-emmc");

As you have exchanged the device tree you either don't have the nodes
in your device tree or the device tree doesn't match the board code:

The EVB board code has:

static const struct of_device_id rk3568_evb_of_match[] = {
       { .compatible = "rockchip,rk3568-evb1-v10" },
       { /* Sentinel */},
};

Which matches the EVB device tree:

       compatible = "rockchip,rk3568-evb1-v10", "rockchip,rk3568";

I don't know exactly what you have changed and what not, but I think your
problem is somewhere here.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


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

* Re: barebox - rk3568
  2022-01-04  8:39 barebox - rk3568 Frank Wunderlich
  2022-01-04 10:51 ` Sascha Hauer
@ 2022-01-05 12:08 ` Ahmad Fatoum
  2022-01-05 15:42   ` Aw: " Frank Wunderlich
  1 sibling, 1 reply; 7+ messages in thread
From: Ahmad Fatoum @ 2022-01-05 12:08 UTC (permalink / raw)
  To: Frank Wunderlich, barebox

Hello Frank,

On 04.01.22 09:39, Frank Wunderlich wrote:
> Hi,
> 
> i have a prototype rk3568 board (bpi-r2-pro).
> 
> is it possible to flash only barebox instead of uboot? in documentation i found only "creating SD-card", but i dont want to break existing partitions.
> 
> https://www.barebox.org/doc/latest/boards/rockchip.html#rockchip-rk3568
> 
> says it starts from sector 32, my first block for uboot (idblock.bin=spl+raminit) starts at 64, full uboot in partition at 8M.

You probably figured it out by now, but the discrepancy is likely due to differing
block sizes. barebox documentation has `dd bs=1024`, while the default is 512.
boot firmware is a single chunk with barebox, so no separate second stage bootloader
partition.

> As it differs a bit from evb can i add new dts like in uboot?

You can check out the commit adding the EVB or the Pine64 Quartz64:
8d14f8e898b4 ("arm: rockchip: add support for the quartz64 board")

Feel free to send patches for your board along the same lines. :)

Cheers,
Ahmad

> 
> regards Frank
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


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

* Aw: Re: barebox - rk3568
  2022-01-05 12:08 ` Ahmad Fatoum
@ 2022-01-05 15:42   ` Frank Wunderlich
  2022-01-05 16:08     ` Ahmad Fatoum
  0 siblings, 1 reply; 7+ messages in thread
From: Frank Wunderlich @ 2022-01-05 15:42 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

> Gesendet: Mittwoch, 05. Januar 2022 um 13:08 Uhr
> Von: "Ahmad Fatoum" <a.fatoum@pengutronix.de>
> An: "Frank Wunderlich" <frank-w@public-files.de>, barebox@lists.infradead.org
> Betreff: Re: barebox - rk3568

> > https://www.barebox.org/doc/latest/boards/rockchip.html#rockchip-rk3568
> >
> > says it starts from sector 32, my first block for uboot (idblock.bin=spl+raminit) starts at 64, full uboot in partition at 8M.
>
> You probably figured it out by now, but the discrepancy is likely due to differing
> block sizes. barebox documentation has `dd bs=1024`, while the default is 512.
> boot firmware is a single chunk with barebox, so no separate second stage bootloader
> partition.

thanks, this indeed explain the different offset, which is same after resolving the double blocksize

> > As it differs a bit from evb can i add new dts like in uboot?
>
> You can check out the commit adding the EVB or the Pine64 Quartz64:
> 8d14f8e898b4 ("arm: rockchip: add support for the quartz64 board")
>
> Feel free to send patches for your board along the same lines. :)

currently evb is working well, so i try to add bootscripts and maybe an menu (if i found out how) :)

regards Frank

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


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

* Re: Aw: Re: barebox - rk3568
  2022-01-05 15:42   ` Aw: " Frank Wunderlich
@ 2022-01-05 16:08     ` Ahmad Fatoum
  0 siblings, 0 replies; 7+ messages in thread
From: Ahmad Fatoum @ 2022-01-05 16:08 UTC (permalink / raw)
  To: Frank Wunderlich; +Cc: barebox

On 05.01.22 16:42, Frank Wunderlich wrote:
>> Gesendet: Mittwoch, 05. Januar 2022 um 13:08 Uhr
>> Von: "Ahmad Fatoum" <a.fatoum@pengutronix.de>
>> An: "Frank Wunderlich" <frank-w@public-files.de>, barebox@lists.infradead.org
>> Betreff: Re: barebox - rk3568
> 
>>> https://www.barebox.org/doc/latest/boards/rockchip.html#rockchip-rk3568
>>>
>>> says it starts from sector 32, my first block for uboot (idblock.bin=spl+raminit) starts at 64, full uboot in partition at 8M.
>>
>> You probably figured it out by now, but the discrepancy is likely due to differing
>> block sizes. barebox documentation has `dd bs=1024`, while the default is 512.
>> boot firmware is a single chunk with barebox, so no separate second stage bootloader
>> partition.
> 
> thanks, this indeed explain the different offset, which is same after resolving the double blocksize
> 
>>> As it differs a bit from evb can i add new dts like in uboot?
>>
>> You can check out the commit adding the EVB or the Pine64 Quartz64:
>> 8d14f8e898b4 ("arm: rockchip: add support for the quartz64 board")
>>
>> Feel free to send patches for your board along the same lines. :)
> 
> currently evb is working well, so i try to add bootscripts and maybe an menu (if i found out how) :)

It's not EVB anymore though, if you replace the device tree and skip the board code. ;)

> 
> regards Frank
> 


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


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

end of thread, other threads:[~2022-01-05 16:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-04  8:39 barebox - rk3568 Frank Wunderlich
2022-01-04 10:51 ` Sascha Hauer
2022-01-04 11:20   ` Aw: " Frank Wunderlich
2022-01-04 14:16     ` Sascha Hauer
2022-01-05 12:08 ` Ahmad Fatoum
2022-01-05 15:42   ` Aw: " Frank Wunderlich
2022-01-05 16:08     ` Ahmad Fatoum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox