All of lore.kernel.org
 help / color / mirror / Atom feed
* how to encrypt fip for GXB P201 and possible bug in docs
@ 2019-07-23 17:57 krecis
  2019-07-24  6:45 ` Neil Armstrong
  0 siblings, 1 reply; 6+ messages in thread
From: krecis @ 2019-07-23 17:57 UTC (permalink / raw)
  To: u-boot-amlogic

Hi,
this is my first approach to both u-boot and this group, I have an S905w based board .
Here is my problem :
in the vanilla u-boot ( version 2019.07 ), there is a txt file ( u-boot-amlogic/board/amlogic/p201/README.p201 ) containing instructions on how to build the bootloader that you need in order to boot from an SD card starting from the p201_defconfig .

The problem is that I think that the original author mixed the two GXB and GXL targets and wrote something about GXL inside a document intended for GXB targets .

According to the description the gxb_p201_v1_defconfig is the target that I'm looking for ( considering the S905W hardware properties ) and it's a GXB target that uses "aml_encrypt_gxb" and not "aml_encrypt_gxl", infact after building the suggested amlogic-openlinux-20170606 Baylibre branch I have a "fip/gxb" populated with all the expected files where the "fip/gxl" content is not enough to build anything.

from this point on I'm unable to build anything since the last instructions in the README.p201 are mentioning files that are simply not generated and an utility like aml_encrypt_gxl which I don't think I should use for my P201 GXB target .

Am I wrong ? what are the final steps to create the right u-boot.bin.sd.bin by "adding together" the vanilla and Baylibre builds ?

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

* Re: how to encrypt fip for GXB P201 and possible bug in docs
  2019-07-23 17:57 how to encrypt fip for GXB P201 and possible bug in docs krecis
@ 2019-07-24  6:45 ` Neil Armstrong
  2019-07-24 21:36   ` krecis
  0 siblings, 1 reply; 6+ messages in thread
From: Neil Armstrong @ 2019-07-24  6:45 UTC (permalink / raw)
  To: u-boot-amlogic, krecis

Hi,

On 23/07/2019 19:57, krecis@gmail.com wrote:
> Hi,
> this is my first approach to both u-boot and this group, I have an S905w based board .

S905w is a derivative from S905X, not S905 (without X), S905 is GXBB and S905W, like S905X, S905L, S805X, S805Y, is from the GXL family.

> Here is my problem :
> in the vanilla u-boot ( version 2019.07 ), there is a txt file ( u-boot-amlogic/board/amlogic/p201/README.p201 ) containing instructions on how to build the bootloader that you need in order to boot from an SD card starting from the p201_defconfig .

So you should start from the P212 instead, which is the reference board for S905X, we don't support reference designs for S905W since this
soc is not sold for SBCs, but only on final products.

> 
> The problem is that I think that the original author mixed the two GXB and GXL targets and wrote something about GXL inside a document intended for GXB targets .
> 
> According to the description the gxb_p201_v1_defconfig is the target that I'm looking for ( considering the S905W hardware properties ) and it's a GXB target that uses "aml_encrypt_gxb" and not "aml_encrypt_gxl", infact after building the suggested amlogic-openlinux-20170606 Baylibre branch I have a "fip/gxb" populated with all the expected files where the "fip/gxl" content is not enough to build anything.

The P201 is really the S905 reference design for GXBB.

> 
> from this point on I'm unable to build anything since the last instructions in the README.p201 are mentioning files that are simply not generated and an utility like aml_encrypt_gxl which I don't think I should use for my P201 GXB target .
> 
> Am I wrong ? what are the final steps to create the right u-boot.bin.sd.bin by "adding together" the vanilla and Baylibre builds ?

Please retry from the P212 target, and tell me your results.

Typos may still occur, and I'll be happy to apply fixes !

Neil

> 
> 
> 


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

* Re: how to encrypt fip for GXB P201 and possible bug in docs
  2019-07-24  6:45 ` Neil Armstrong
@ 2019-07-24 21:36   ` krecis
  2019-07-25  7:30     ` Neil Armstrong
  0 siblings, 1 reply; 6+ messages in thread
From: krecis @ 2019-07-24 21:36 UTC (permalink / raw)
  To: Neil Armstrong, u-boot-amlogic

Thanks for your answer .

I'm trying to expand my know-how about u-boot and I think that the closest description is this one ( I have an A95X F1 ) :
https://github.com/CoreELEC/device-trees-amlogic/blob/master/gxl_p281_2g_a95xr2.dts

At this point I need a guide about how to support this new board starting from already existing config files and sources .

Do you have any pointers ? I know how to build u-boot, but I don't know how and what I have to modify in order to achieve what I want .

PS
It's not clear to me if I can mix and match device tree definitions from the linux kernel and using them for u-boot

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

* Re: how to encrypt fip for GXB P201 and possible bug in docs
  2019-07-24 21:36   ` krecis
@ 2019-07-25  7:30     ` Neil Armstrong
  2019-07-26 18:03       ` krecis
  0 siblings, 1 reply; 6+ messages in thread
From: Neil Armstrong @ 2019-07-25  7:30 UTC (permalink / raw)
  To: u-boot-amlogic, krecis

Hi,

Le 24/07/2019 à 23:36, krecis@gmail.com a écrit :
> Thanks for your answer .
> 
> I'm trying to expand my know-how about u-boot and I think that the closest description is this one ( I have an A95X F1 ) :
> https://github.com/CoreELEC/device-trees-amlogic/blob/master/gxl_p281_2g_a95xr2.dts
> 
> At this point I need a guide about how to support this new board starting from already existing config files and sources .

We always avoided replacing the bootloader of a closed device, because we don't have the source of
the FIP components (DDR setup, Power Pins & PWM, DVFS table), and usually these boxes has custom
setups that could diverge from the reference designs.

If you feel confident enough, you'll need to dump the eMMC content to save the original
bootloader (in the first 4MiB) and use the p281 amlogic u-boot config to generate the FIP
binaries as explained in the mainline README file of P212.
If not, simply chainload the mainline u-boot.bin binary (not packaged with FIP stuff) from the
original u-boot on the device, it should work well.

Then simply use the P212 mainline u-boot defconfig as a start.

> Do you have any pointers ? I know how to build u-boot, but I don't know how and what I have to modify in order to achieve what I want .
> 
> PS
> It's not clear to me if I can mix and match device tree definitions from the linux kernel and using them for u-boot

The mainline u-boot syncs the mainline Linux device tree, which was entirely rewritten to match
the standard rules and requirements of upstream development, so you can't use the amlogic linux
device tree files.

The following https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/amlogic/meson-gxl-s905w-p281.dts
should work on your device.

Neil

> 
> 

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

* Re: how to encrypt fip for GXB P201 and possible bug in docs
  2019-07-25  7:30     ` Neil Armstrong
@ 2019-07-26 18:03       ` krecis
  2019-07-27 10:35         ` Neil Armstrong
  0 siblings, 1 reply; 6+ messages in thread
From: krecis @ 2019-07-26 18:03 UTC (permalink / raw)
  To: Neil Armstrong, u-boot-amlogic

I'm interested in re-using already existing binaries but for now I'm more interested in closing down on how to build u-boot from sources and get it to work . I'll reserve this for another topic .

I have successfully compiled the "plain" p212 target ( meaning without any p281 specific step ) and I don't get the very last step inside the readme :

 > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1
and this basically means : copy uboot but skip the first 512 bytes so you can leave the partition table alone

 > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444
what are we doing here ? and most importantly : why just 444 bytes ? my fip/u-boot.bin.sd.bin is 803328 bytes .

Also, do you have any suggestions about how to create a complete sd image with kernel and rootfs ? I don't want a complete rootfs but really the bare minimum .

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

* Re: how to encrypt fip for GXB P201 and possible bug in docs
  2019-07-26 18:03       ` krecis
@ 2019-07-27 10:35         ` Neil Armstrong
  0 siblings, 0 replies; 6+ messages in thread
From: Neil Armstrong @ 2019-07-27 10:35 UTC (permalink / raw)
  To: u-boot-amlogic, krecis

Hi,

Le 26/07/2019 à 20:03, krecis@gmail.com a écrit :
> I'm interested in re-using already existing binaries but for now I'm more interested in closing down on how to build u-boot from sources and get it to work . I'll reserve this for another topic .
> 
> I have successfully compiled the "plain" p212 target ( meaning without any p281 specific step ) and I don't get the very last step inside the readme :
> 
>  > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1
> and this basically means : copy uboot but skip the first 512 bytes so you can leave the partition table alone

Exact,

> 
>  > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444
> what are we doing here ? and most importantly : why just 444 bytes ? my fip/u-boot.bin.sd.bin is 803328 bytes .

The first 444bytes are necessary for booting over sdcard, so we need to copy them at the
start of the sdcard. It's a vendor specificity, at some point we stop trying to understand ;-)

> 
> Also, do you have any suggestions about how to create a complete sd image with kernel and rootfs ? I don't want a complete rootfs but really the bare minimum .

Buildroot, or meta-meson with Yocto or OpenEmbedded

With meta-meson, you can generate a full sdcard image, including u-boot :
https://github.com/superna9999/meta-meson

It contains a profile for amlogic-p281, but without u-boot, only with rootfs and a minimal
fat partition containing a script to boot from vendor u-boot.

With buildroot, it should be able to generate you an ext4 image containing the kernel
and the p281 dtb, since it's all upstream, but you'll need to partition and flash the rootfs
manually.

Neil
 
> 
> 

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

end of thread, other threads:[~2019-07-27 10:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-23 17:57 how to encrypt fip for GXB P201 and possible bug in docs krecis
2019-07-24  6:45 ` Neil Armstrong
2019-07-24 21:36   ` krecis
2019-07-25  7:30     ` Neil Armstrong
2019-07-26 18:03       ` krecis
2019-07-27 10:35         ` Neil Armstrong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.