Re: [PATCH v4 07/27] rockchip: Enable building a SPI ROM image on bob

2020-11-08 Thread Hugh Cole-Baker
Hi Simon,

> On 3 Nov 2020, at 15:11, Simon Glass  wrote:
> 
> Hi Hugh,
> 
> On Wed, 14 Oct 2020 at 12:37, Hugh Cole-Baker  wrote:
>> 
>> Hello,
>>> On 11 Oct 2020, at 16:39, Emmanuel Vadot  wrote:
>>> 
>>> 
>>> Hi Simon,
>>> 
>>> On Sun, 19 Jul 2020 13:55:58 -0600
>>> Simon Glass  wrote:
>>> 
 Add a simple binman config and enable CONFIG_HAS_ROM so that U-Boot
 produces a ROM for bob.
 
 Signed-off-by: Simon Glass 
 ---
 
 Changes in v4:
 - Use CONFIG_ROCKCHIP_SPI_IMAGE to select the image
 
 arch/arm/dts/rk3399-gru-u-boot.dtsi   |  4 
 arch/arm/dts/rk3399-gru.dtsi  |  2 +-
 arch/arm/dts/rk3399-u-boot.dtsi   | 27 +++
 arch/arm/mach-rockchip/rk3399/Kconfig |  2 ++
 4 files changed, 34 insertions(+), 1 deletion(-)
 
 diff --git a/arch/arm/dts/rk3399-gru-u-boot.dtsi 
 b/arch/arm/dts/rk3399-gru-u-boot.dtsi
 index 7bddc3acdb..390ac2bb5a 100644
 --- a/arch/arm/dts/rk3399-gru-u-boot.dtsi
 +++ b/arch/arm/dts/rk3399-gru-u-boot.dtsi
 @@ -4,3 +4,7 @@
 */
 
 #include "rk3399-u-boot.dtsi"
 +
 +_flash {
 +u-boot,dm-pre-reloc;
 +};
 diff --git a/arch/arm/dts/rk3399-gru.dtsi b/arch/arm/dts/rk3399-gru.dtsi
 index 7ac88392f2..f9c5bb607b 100644
 --- a/arch/arm/dts/rk3399-gru.dtsi
 +++ b/arch/arm/dts/rk3399-gru.dtsi
 @@ -537,7 +537,7 @@ ap_i2c_audio:  {
 pinctrl-names = "default", "sleep";
 pinctrl-1 = <_sleep>;
 
 -spiflash@0 {
 +spi_flash: spiflash@0 {
 compatible = "jedec,spi-nor";
 reg = <0>;
 
 diff --git a/arch/arm/dts/rk3399-u-boot.dtsi 
 b/arch/arm/dts/rk3399-u-boot.dtsi
 index 8237782408..ecd230c720 100644
 --- a/arch/arm/dts/rk3399-u-boot.dtsi
 +++ b/arch/arm/dts/rk3399-u-boot.dtsi
 @@ -4,11 +4,14 @@
 */
 #define USB_CLASS_HUB9
 
 +#include "rockchip-u-boot.dtsi"
 +
 / {
 aliases {
 mmc0 = 
 mmc1 = 
 pci0 = 
 +spi1 = 
>>> 
>>> I don't really understand why but this added alias break spi flash
>>> detection on rockpro64.
>>> Removing it make it work again.
>> 
>> I've noticed the same problem - rockpro64 already had an alias
>> 
>> spi0 = 
>> 
>> so after this change there are spi0 and spi1 aliases pointing to 
>> In U-Boot proper, that seems to cause the SPI flash to appear on bus 1
>> rather than the former bus 0, e.g. sf probe 1:0 works but sf probe 0:0
>> doesn't.
>> 
>> So I tried removing the spi0 alias and setting CONFIG_SF_DEFAULT_BUS=1
>> which fixed the flash detection in U-Boot proper, but now the SPL can't
>> load U-Boot from SPI flash - it fails with an "Invalid bus 1 (err=-19)"
>> It seems like SPL doesn't pay attention to the spi1 alias in the same
>> way that U-boot proper does, I haven't yet figured out why.
>> 
> 
> Could this be CONFIG_SPL_DM_SEQ_ALIAS ?
> 
> Regards,
> Simon

Thanks for the pointer, that was the last missing piece to get SPI boot
working again on my board. I've just submitted a patch with the fix.

Regards,
Hugh



Re: [PATCH v4 07/27] rockchip: Enable building a SPI ROM image on bob

2020-11-08 Thread Emmanuel Vadot


 Hi Simon,

On Tue, 3 Nov 2020 08:11:59 -0700
Simon Glass  wrote:

> Hi Hugh,
> 
> On Wed, 14 Oct 2020 at 12:37, Hugh Cole-Baker  wrote:
> >
> > Hello,
> > > On 11 Oct 2020, at 16:39, Emmanuel Vadot  wrote:
> > >
> > >
> > > Hi Simon,
> > >
> > > On Sun, 19 Jul 2020 13:55:58 -0600
> > > Simon Glass  wrote:
> > >
> > >> Add a simple binman config and enable CONFIG_HAS_ROM so that U-Boot
> > >> produces a ROM for bob.
> > >>
> > >> Signed-off-by: Simon Glass 
> > >> ---
> > >>
> > >> Changes in v4:
> > >> - Use CONFIG_ROCKCHIP_SPI_IMAGE to select the image
> > >>
> > >> arch/arm/dts/rk3399-gru-u-boot.dtsi   |  4 
> > >> arch/arm/dts/rk3399-gru.dtsi  |  2 +-
> > >> arch/arm/dts/rk3399-u-boot.dtsi   | 27 +++
> > >> arch/arm/mach-rockchip/rk3399/Kconfig |  2 ++
> > >> 4 files changed, 34 insertions(+), 1 deletion(-)
> > >>
> > >> diff --git a/arch/arm/dts/rk3399-gru-u-boot.dtsi 
> > >> b/arch/arm/dts/rk3399-gru-u-boot.dtsi
> > >> index 7bddc3acdb..390ac2bb5a 100644
> > >> --- a/arch/arm/dts/rk3399-gru-u-boot.dtsi
> > >> +++ b/arch/arm/dts/rk3399-gru-u-boot.dtsi
> > >> @@ -4,3 +4,7 @@
> > >>  */
> > >>
> > >> #include "rk3399-u-boot.dtsi"
> > >> +
> > >> +_flash {
> > >> +u-boot,dm-pre-reloc;
> > >> +};
> > >> diff --git a/arch/arm/dts/rk3399-gru.dtsi b/arch/arm/dts/rk3399-gru.dtsi
> > >> index 7ac88392f2..f9c5bb607b 100644
> > >> --- a/arch/arm/dts/rk3399-gru.dtsi
> > >> +++ b/arch/arm/dts/rk3399-gru.dtsi
> > >> @@ -537,7 +537,7 @@ ap_i2c_audio:  {
> > >>  pinctrl-names = "default", "sleep";
> > >>  pinctrl-1 = <_sleep>;
> > >>
> > >> -spiflash@0 {
> > >> +spi_flash: spiflash@0 {
> > >>  compatible = "jedec,spi-nor";
> > >>  reg = <0>;
> > >>
> > >> diff --git a/arch/arm/dts/rk3399-u-boot.dtsi 
> > >> b/arch/arm/dts/rk3399-u-boot.dtsi
> > >> index 8237782408..ecd230c720 100644
> > >> --- a/arch/arm/dts/rk3399-u-boot.dtsi
> > >> +++ b/arch/arm/dts/rk3399-u-boot.dtsi
> > >> @@ -4,11 +4,14 @@
> > >>  */
> > >> #define USB_CLASS_HUB9
> > >>
> > >> +#include "rockchip-u-boot.dtsi"
> > >> +
> > >> / {
> > >>  aliases {
> > >>  mmc0 = 
> > >>  mmc1 = 
> > >>  pci0 = 
> > >> +spi1 = 
> > >
> > > I don't really understand why but this added alias break spi flash
> > > detection on rockpro64.
> > > Removing it make it work again.
> >
> > I've noticed the same problem - rockpro64 already had an alias
> >
> > spi0 = 
> >
> > so after this change there are spi0 and spi1 aliases pointing to 
> > In U-Boot proper, that seems to cause the SPI flash to appear on bus 1
> > rather than the former bus 0, e.g. sf probe 1:0 works but sf probe 0:0
> > doesn't.
> >
> > So I tried removing the spi0 alias and setting CONFIG_SF_DEFAULT_BUS=1
> > which fixed the flash detection in U-Boot proper, but now the SPL can't
> > load U-Boot from SPI flash - it fails with an "Invalid bus 1 (err=-19)"
> > It seems like SPL doesn't pay attention to the spi1 alias in the same
> > way that U-boot proper does, I haven't yet figured out why.
> >
> 
> Could this be CONFIG_SPL_DM_SEQ_ALIAS ?
> 
> Regards,
> Simon

 I don't know if you suggested to set CONFIG_SPL_DM_SEQ_ALIAS=y in
configs/rockpro64-rk3399_defconfig but this doesn't help.

 Cheers,

-- 
Emmanuel Vadot  


Re: [PATCH v4 07/27] rockchip: Enable building a SPI ROM image on bob

2020-11-03 Thread Simon Glass
Hi Hugh,

On Wed, 14 Oct 2020 at 12:37, Hugh Cole-Baker  wrote:
>
> Hello,
> > On 11 Oct 2020, at 16:39, Emmanuel Vadot  wrote:
> >
> >
> > Hi Simon,
> >
> > On Sun, 19 Jul 2020 13:55:58 -0600
> > Simon Glass  wrote:
> >
> >> Add a simple binman config and enable CONFIG_HAS_ROM so that U-Boot
> >> produces a ROM for bob.
> >>
> >> Signed-off-by: Simon Glass 
> >> ---
> >>
> >> Changes in v4:
> >> - Use CONFIG_ROCKCHIP_SPI_IMAGE to select the image
> >>
> >> arch/arm/dts/rk3399-gru-u-boot.dtsi   |  4 
> >> arch/arm/dts/rk3399-gru.dtsi  |  2 +-
> >> arch/arm/dts/rk3399-u-boot.dtsi   | 27 +++
> >> arch/arm/mach-rockchip/rk3399/Kconfig |  2 ++
> >> 4 files changed, 34 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/arch/arm/dts/rk3399-gru-u-boot.dtsi 
> >> b/arch/arm/dts/rk3399-gru-u-boot.dtsi
> >> index 7bddc3acdb..390ac2bb5a 100644
> >> --- a/arch/arm/dts/rk3399-gru-u-boot.dtsi
> >> +++ b/arch/arm/dts/rk3399-gru-u-boot.dtsi
> >> @@ -4,3 +4,7 @@
> >>  */
> >>
> >> #include "rk3399-u-boot.dtsi"
> >> +
> >> +_flash {
> >> +u-boot,dm-pre-reloc;
> >> +};
> >> diff --git a/arch/arm/dts/rk3399-gru.dtsi b/arch/arm/dts/rk3399-gru.dtsi
> >> index 7ac88392f2..f9c5bb607b 100644
> >> --- a/arch/arm/dts/rk3399-gru.dtsi
> >> +++ b/arch/arm/dts/rk3399-gru.dtsi
> >> @@ -537,7 +537,7 @@ ap_i2c_audio:  {
> >>  pinctrl-names = "default", "sleep";
> >>  pinctrl-1 = <_sleep>;
> >>
> >> -spiflash@0 {
> >> +spi_flash: spiflash@0 {
> >>  compatible = "jedec,spi-nor";
> >>  reg = <0>;
> >>
> >> diff --git a/arch/arm/dts/rk3399-u-boot.dtsi 
> >> b/arch/arm/dts/rk3399-u-boot.dtsi
> >> index 8237782408..ecd230c720 100644
> >> --- a/arch/arm/dts/rk3399-u-boot.dtsi
> >> +++ b/arch/arm/dts/rk3399-u-boot.dtsi
> >> @@ -4,11 +4,14 @@
> >>  */
> >> #define USB_CLASS_HUB9
> >>
> >> +#include "rockchip-u-boot.dtsi"
> >> +
> >> / {
> >>  aliases {
> >>  mmc0 = 
> >>  mmc1 = 
> >>  pci0 = 
> >> +spi1 = 
> >
> > I don't really understand why but this added alias break spi flash
> > detection on rockpro64.
> > Removing it make it work again.
>
> I've noticed the same problem - rockpro64 already had an alias
>
> spi0 = 
>
> so after this change there are spi0 and spi1 aliases pointing to 
> In U-Boot proper, that seems to cause the SPI flash to appear on bus 1
> rather than the former bus 0, e.g. sf probe 1:0 works but sf probe 0:0
> doesn't.
>
> So I tried removing the spi0 alias and setting CONFIG_SF_DEFAULT_BUS=1
> which fixed the flash detection in U-Boot proper, but now the SPL can't
> load U-Boot from SPI flash - it fails with an "Invalid bus 1 (err=-19)"
> It seems like SPL doesn't pay attention to the spi1 alias in the same
> way that U-boot proper does, I haven't yet figured out why.
>

Could this be CONFIG_SPL_DM_SEQ_ALIAS ?

Regards,
Simon


Re: [PATCH v4 07/27] rockchip: Enable building a SPI ROM image on bob

2020-10-14 Thread Hugh Cole-Baker
Hello,
> On 11 Oct 2020, at 16:39, Emmanuel Vadot  wrote:
> 
> 
> Hi Simon,
> 
> On Sun, 19 Jul 2020 13:55:58 -0600
> Simon Glass  wrote:
> 
>> Add a simple binman config and enable CONFIG_HAS_ROM so that U-Boot
>> produces a ROM for bob.
>> 
>> Signed-off-by: Simon Glass 
>> ---
>> 
>> Changes in v4:
>> - Use CONFIG_ROCKCHIP_SPI_IMAGE to select the image
>> 
>> arch/arm/dts/rk3399-gru-u-boot.dtsi   |  4 
>> arch/arm/dts/rk3399-gru.dtsi  |  2 +-
>> arch/arm/dts/rk3399-u-boot.dtsi   | 27 +++
>> arch/arm/mach-rockchip/rk3399/Kconfig |  2 ++
>> 4 files changed, 34 insertions(+), 1 deletion(-)
>> 
>> diff --git a/arch/arm/dts/rk3399-gru-u-boot.dtsi 
>> b/arch/arm/dts/rk3399-gru-u-boot.dtsi
>> index 7bddc3acdb..390ac2bb5a 100644
>> --- a/arch/arm/dts/rk3399-gru-u-boot.dtsi
>> +++ b/arch/arm/dts/rk3399-gru-u-boot.dtsi
>> @@ -4,3 +4,7 @@
>>  */
>> 
>> #include "rk3399-u-boot.dtsi"
>> +
>> +_flash {
>> +u-boot,dm-pre-reloc;
>> +};
>> diff --git a/arch/arm/dts/rk3399-gru.dtsi b/arch/arm/dts/rk3399-gru.dtsi
>> index 7ac88392f2..f9c5bb607b 100644
>> --- a/arch/arm/dts/rk3399-gru.dtsi
>> +++ b/arch/arm/dts/rk3399-gru.dtsi
>> @@ -537,7 +537,7 @@ ap_i2c_audio:  {
>>  pinctrl-names = "default", "sleep";
>>  pinctrl-1 = <_sleep>;
>> 
>> -spiflash@0 {
>> +spi_flash: spiflash@0 {
>>  compatible = "jedec,spi-nor";
>>  reg = <0>;
>> 
>> diff --git a/arch/arm/dts/rk3399-u-boot.dtsi 
>> b/arch/arm/dts/rk3399-u-boot.dtsi
>> index 8237782408..ecd230c720 100644
>> --- a/arch/arm/dts/rk3399-u-boot.dtsi
>> +++ b/arch/arm/dts/rk3399-u-boot.dtsi
>> @@ -4,11 +4,14 @@
>>  */
>> #define USB_CLASS_HUB9
>> 
>> +#include "rockchip-u-boot.dtsi"
>> +
>> / {
>>  aliases {
>>  mmc0 = 
>>  mmc1 = 
>>  pci0 = 
>> +spi1 = 
> 
> I don't really understand why but this added alias break spi flash
> detection on rockpro64.
> Removing it make it work again.

I've noticed the same problem - rockpro64 already had an alias

spi0 = 

so after this change there are spi0 and spi1 aliases pointing to 
In U-Boot proper, that seems to cause the SPI flash to appear on bus 1
rather than the former bus 0, e.g. sf probe 1:0 works but sf probe 0:0
doesn't.

So I tried removing the spi0 alias and setting CONFIG_SF_DEFAULT_BUS=1
which fixed the flash detection in U-Boot proper, but now the SPL can't
load U-Boot from SPI flash - it fails with an "Invalid bus 1 (err=-19)"
It seems like SPL doesn't pay attention to the spi1 alias in the same
way that U-boot proper does, I haven't yet figured out why.

> 
> Cheers,
> 
>>  };
>> 
>>  cic: syscon@ff62 {
>> @@ -57,6 +60,30 @@
>> 
>> };
>> 
>> +#ifdef CONFIG_ROCKCHIP_SPI_IMAGE
>> + {
>> +rom {
>> +filename = "u-boot.rom";
>> +size = <0x40>;
>> +pad-byte = <0xff>;
>> +
>> +mkimage {
>> +args = "-n rk3399 -T rkspi";
>> +u-boot-spl {
>> +};
>> +};
>> +u-boot-img {
>> +offset = <0x4>;
>> +};
>> +u-boot {
>> +offset = <0x30>;
>> +};
>> +fdtmap {
>> +};
>> +};
>> +};
>> +#endif
>> +
>>  {
>>  u-boot,dm-pre-reloc;
>> };
>> diff --git a/arch/arm/mach-rockchip/rk3399/Kconfig 
>> b/arch/arm/mach-rockchip/rk3399/Kconfig
>> index 254b9c5b4d..17628f9171 100644
>> --- a/arch/arm/mach-rockchip/rk3399/Kconfig
>> +++ b/arch/arm/mach-rockchip/rk3399/Kconfig
>> @@ -5,6 +5,8 @@ choice
>> 
>> config TARGET_CHROMEBOOK_BOB
>>  bool "Asus Flip C101PA Chromebook (RK3399)"
>> +select HAS_ROM
>> +select ROCKCHIP_SPI_IMAGE
>>  help
>>Bob is a small RK3299-based device similar in apperance to Minnie.
>>It has two USB 3.0 type-C ports, 4GB of SDRAM, WiFi and a 10.1",
>> -- 
>> 2.28.0.rc0.105.gf9edc3c819-goog
>> 
> 
> 
> -- 
> Emmanuel Vadot  



Re: [PATCH v4 07/27] rockchip: Enable building a SPI ROM image on bob

2020-10-11 Thread Emmanuel Vadot


 Hi Simon,

On Sun, 19 Jul 2020 13:55:58 -0600
Simon Glass  wrote:

> Add a simple binman config and enable CONFIG_HAS_ROM so that U-Boot
> produces a ROM for bob.
> 
> Signed-off-by: Simon Glass 
> ---
> 
> Changes in v4:
> - Use CONFIG_ROCKCHIP_SPI_IMAGE to select the image
> 
>  arch/arm/dts/rk3399-gru-u-boot.dtsi   |  4 
>  arch/arm/dts/rk3399-gru.dtsi  |  2 +-
>  arch/arm/dts/rk3399-u-boot.dtsi   | 27 +++
>  arch/arm/mach-rockchip/rk3399/Kconfig |  2 ++
>  4 files changed, 34 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/dts/rk3399-gru-u-boot.dtsi 
> b/arch/arm/dts/rk3399-gru-u-boot.dtsi
> index 7bddc3acdb..390ac2bb5a 100644
> --- a/arch/arm/dts/rk3399-gru-u-boot.dtsi
> +++ b/arch/arm/dts/rk3399-gru-u-boot.dtsi
> @@ -4,3 +4,7 @@
>   */
>  
>  #include "rk3399-u-boot.dtsi"
> +
> +_flash {
> + u-boot,dm-pre-reloc;
> +};
> diff --git a/arch/arm/dts/rk3399-gru.dtsi b/arch/arm/dts/rk3399-gru.dtsi
> index 7ac88392f2..f9c5bb607b 100644
> --- a/arch/arm/dts/rk3399-gru.dtsi
> +++ b/arch/arm/dts/rk3399-gru.dtsi
> @@ -537,7 +537,7 @@ ap_i2c_audio:  {
>   pinctrl-names = "default", "sleep";
>   pinctrl-1 = <_sleep>;
>  
> - spiflash@0 {
> + spi_flash: spiflash@0 {
>   compatible = "jedec,spi-nor";
>   reg = <0>;
>  
> diff --git a/arch/arm/dts/rk3399-u-boot.dtsi b/arch/arm/dts/rk3399-u-boot.dtsi
> index 8237782408..ecd230c720 100644
> --- a/arch/arm/dts/rk3399-u-boot.dtsi
> +++ b/arch/arm/dts/rk3399-u-boot.dtsi
> @@ -4,11 +4,14 @@
>   */
>  #define USB_CLASS_HUB9
>  
> +#include "rockchip-u-boot.dtsi"
> +
>  / {
>   aliases {
>   mmc0 = 
>   mmc1 = 
>   pci0 = 
> + spi1 = 

 I don't really understand why but this added alias break spi flash
detection on rockpro64.
 Removing it make it work again.

 Cheers,

>   };
>  
>   cic: syscon@ff62 {
> @@ -57,6 +60,30 @@
>  
>  };
>  
> +#ifdef CONFIG_ROCKCHIP_SPI_IMAGE
> + {
> + rom {
> + filename = "u-boot.rom";
> + size = <0x40>;
> + pad-byte = <0xff>;
> +
> + mkimage {
> + args = "-n rk3399 -T rkspi";
> + u-boot-spl {
> + };
> + };
> + u-boot-img {
> + offset = <0x4>;
> + };
> + u-boot {
> + offset = <0x30>;
> + };
> + fdtmap {
> + };
> + };
> +};
> +#endif
> +
>   {
>   u-boot,dm-pre-reloc;
>  };
> diff --git a/arch/arm/mach-rockchip/rk3399/Kconfig 
> b/arch/arm/mach-rockchip/rk3399/Kconfig
> index 254b9c5b4d..17628f9171 100644
> --- a/arch/arm/mach-rockchip/rk3399/Kconfig
> +++ b/arch/arm/mach-rockchip/rk3399/Kconfig
> @@ -5,6 +5,8 @@ choice
>  
>  config TARGET_CHROMEBOOK_BOB
>   bool "Asus Flip C101PA Chromebook (RK3399)"
> + select HAS_ROM
> + select ROCKCHIP_SPI_IMAGE
>   help
> Bob is a small RK3299-based device similar in apperance to Minnie.
> It has two USB 3.0 type-C ports, 4GB of SDRAM, WiFi and a 10.1",
> -- 
> 2.28.0.rc0.105.gf9edc3c819-goog
> 


-- 
Emmanuel Vadot  


Re: [PATCH v4 07/27] rockchip: Enable building a SPI ROM image on bob

2020-08-12 Thread Simon Glass
Hi Kever,

On Mon, 10 Aug 2020 at 01:47, Kever Yang  wrote:
>
> Hi Simon,
>
> On 2020/8/8 下午9:28, Simon Glass wrote:
>
> +#ifdef CONFIG_ROCKCHIP_SPI_IMAGE
> + {
> + rom {
> + filename = "u-boot.rom";
> + size = <0x40>;
> + pad-byte = <0xff>;
> +
> + mkimage {
> + args = "-n rk3399 -T rkspi";
> + u-boot-spl {
> + };
> + };
> + u-boot-img {
> + offset = <0x4>;
> + };
> + u-boot {
> + offset = <0x30>;
> + };
> + fdtmap {
> + };
>
> There is a output name 'u-boot.rom' including:
>
> - u-boot-spl output with mkimage cmd at offset 0?
>
> Yes
>
> - u-boot-img at offset 0x4, how this is generated and what is
> inside? does binary in bl31.elf included?
>
> It is just the u-boot.img file created by the Makefile. There is no BL31.
>
> - u-boot at offset 0x30, what is this binary and where is it from?
>
> This is u-boot.bin as created by the Makefile.
>
> Why do you need both u-boot.img and u-boot.bin, I don't understand this.

Neither do I. It needs a look.

>
> And if there is no BL31, the system is not possible to boot up.

This was done quite a while ago with the objective of getting a basic
U-Boot going on this board, so it needs more work to finish it off.

Regards,
SImon


Re: [PATCH v4 07/27] rockchip: Enable building a SPI ROM image on bob

2020-08-10 Thread Kever Yang

Hi Simon,

On 2020/8/8 下午9:28, Simon Glass wrote:

+#ifdef CONFIG_ROCKCHIP_SPI_IMAGE
+ {
+ rom {
+ filename = "u-boot.rom";
+ size = <0x40>;
+ pad-byte = <0xff>;
+
+ mkimage {
+ args = "-n rk3399 -T rkspi";
+ u-boot-spl {
+ };
+ };
+ u-boot-img {
+ offset = <0x4>;
+ };
+ u-boot {
+ offset = <0x30>;
+ };
+ fdtmap {
+ };

There is a output name 'u-boot.rom' including:

- u-boot-spl output with mkimage cmd at offset 0?

Yes


- u-boot-img at offset 0x4, how this is generated and what is
inside? does binary in bl31.elf included?

It is just the u-boot.img file created by the Makefile. There is no BL31.


- u-boot at offset 0x30, what is this binary and where is it from?

This is u-boot.bin as created by the Makefile.


Why do you need both u-boot.img and u-boot.bin, I don't understand this.

And if there is no BL31, the system is not possible to boot up.

Thanks,

- Kever



Re: [PATCH v4 07/27] rockchip: Enable building a SPI ROM image on bob

2020-08-08 Thread Simon Glass
Hi Kever,

On Sat, 8 Aug 2020 at 06:40, Kever Yang  wrote:
>
> Hi Simon,
>
> On 2020/7/20 上午3:55, Simon Glass wrote:
> > Add a simple binman config and enable CONFIG_HAS_ROM so that U-Boot
> > produces a ROM for bob.
> >
> > Signed-off-by: Simon Glass 
> > ---
> >
> > Changes in v4:
> > - Use CONFIG_ROCKCHIP_SPI_IMAGE to select the image
> >
> >   arch/arm/dts/rk3399-gru-u-boot.dtsi   |  4 
> >   arch/arm/dts/rk3399-gru.dtsi  |  2 +-
> >   arch/arm/dts/rk3399-u-boot.dtsi   | 27 +++
> >   arch/arm/mach-rockchip/rk3399/Kconfig |  2 ++
> >   4 files changed, 34 insertions(+), 1 deletion(-)
> >
> > diff --git a/arch/arm/dts/rk3399-gru-u-boot.dtsi 
> > b/arch/arm/dts/rk3399-gru-u-boot.dtsi
> > index 7bddc3acdb..390ac2bb5a 100644
> > --- a/arch/arm/dts/rk3399-gru-u-boot.dtsi
> > +++ b/arch/arm/dts/rk3399-gru-u-boot.dtsi
> > @@ -4,3 +4,7 @@
> >*/
> >
> >   #include "rk3399-u-boot.dtsi"
> > +
> > +_flash {
> > + u-boot,dm-pre-reloc;
> > +};
> > diff --git a/arch/arm/dts/rk3399-gru.dtsi b/arch/arm/dts/rk3399-gru.dtsi
> > index 7ac88392f2..f9c5bb607b 100644
> > --- a/arch/arm/dts/rk3399-gru.dtsi
> > +++ b/arch/arm/dts/rk3399-gru.dtsi
> > @@ -537,7 +537,7 @@ ap_i2c_audio:  {
> >   pinctrl-names = "default", "sleep";
> >   pinctrl-1 = <_sleep>;
> >
> > - spiflash@0 {
> > + spi_flash: spiflash@0 {
> >   compatible = "jedec,spi-nor";
> >   reg = <0>;
> >
> > diff --git a/arch/arm/dts/rk3399-u-boot.dtsi 
> > b/arch/arm/dts/rk3399-u-boot.dtsi
> > index 8237782408..ecd230c720 100644
> > --- a/arch/arm/dts/rk3399-u-boot.dtsi
> > +++ b/arch/arm/dts/rk3399-u-boot.dtsi
> > @@ -4,11 +4,14 @@
> >*/
> >   #define USB_CLASS_HUB   9
> >
> > +#include "rockchip-u-boot.dtsi"
> > +
> >   / {
> >   aliases {
> >   mmc0 = 
> >   mmc1 = 
> >   pci0 = 
> > + spi1 = 
> >   };
> >
> >   cic: syscon@ff62 {
> > @@ -57,6 +60,30 @@
> >
> >   };
> >
> > +#ifdef CONFIG_ROCKCHIP_SPI_IMAGE
> > + {
> > + rom {
> > + filename = "u-boot.rom";
> > + size = <0x40>;
> > + pad-byte = <0xff>;
> > +
> > + mkimage {
> > + args = "-n rk3399 -T rkspi";
> > + u-boot-spl {
> > + };
> > + };
> > + u-boot-img {
> > + offset = <0x4>;
> > + };
> > + u-boot {
> > + offset = <0x30>;
> > + };
> > + fdtmap {
> > + };
>
> There is a output name 'u-boot.rom' including:
>
> - u-boot-spl output with mkimage cmd at offset 0?

Yes

>
> - u-boot-img at offset 0x4, how this is generated and what is
> inside? does binary in bl31.elf included?

It is just the u-boot.img file created by the Makefile. There is no BL31.

>
> - u-boot at offset 0x30, what is this binary and where is it from?

This is u-boot.bin as created by the Makefile.

Regards,
Simon


Re: [PATCH v4 07/27] rockchip: Enable building a SPI ROM image on bob

2020-08-08 Thread Kever Yang

Hi Simon,

On 2020/7/20 上午3:55, Simon Glass wrote:

Add a simple binman config and enable CONFIG_HAS_ROM so that U-Boot
produces a ROM for bob.

Signed-off-by: Simon Glass 
---

Changes in v4:
- Use CONFIG_ROCKCHIP_SPI_IMAGE to select the image

  arch/arm/dts/rk3399-gru-u-boot.dtsi   |  4 
  arch/arm/dts/rk3399-gru.dtsi  |  2 +-
  arch/arm/dts/rk3399-u-boot.dtsi   | 27 +++
  arch/arm/mach-rockchip/rk3399/Kconfig |  2 ++
  4 files changed, 34 insertions(+), 1 deletion(-)

diff --git a/arch/arm/dts/rk3399-gru-u-boot.dtsi 
b/arch/arm/dts/rk3399-gru-u-boot.dtsi
index 7bddc3acdb..390ac2bb5a 100644
--- a/arch/arm/dts/rk3399-gru-u-boot.dtsi
+++ b/arch/arm/dts/rk3399-gru-u-boot.dtsi
@@ -4,3 +4,7 @@
   */
  
  #include "rk3399-u-boot.dtsi"

+
+_flash {
+   u-boot,dm-pre-reloc;
+};
diff --git a/arch/arm/dts/rk3399-gru.dtsi b/arch/arm/dts/rk3399-gru.dtsi
index 7ac88392f2..f9c5bb607b 100644
--- a/arch/arm/dts/rk3399-gru.dtsi
+++ b/arch/arm/dts/rk3399-gru.dtsi
@@ -537,7 +537,7 @@ ap_i2c_audio:  {
pinctrl-names = "default", "sleep";
pinctrl-1 = <_sleep>;
  
-	spiflash@0 {

+   spi_flash: spiflash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
  
diff --git a/arch/arm/dts/rk3399-u-boot.dtsi b/arch/arm/dts/rk3399-u-boot.dtsi

index 8237782408..ecd230c720 100644
--- a/arch/arm/dts/rk3399-u-boot.dtsi
+++ b/arch/arm/dts/rk3399-u-boot.dtsi
@@ -4,11 +4,14 @@
   */
  #define USB_CLASS_HUB 9
  
+#include "rockchip-u-boot.dtsi"

+
  / {
aliases {
mmc0 = 
mmc1 = 
pci0 = 
+   spi1 = 
};
  
  	cic: syscon@ff62 {

@@ -57,6 +60,30 @@
  
  };
  
+#ifdef CONFIG_ROCKCHIP_SPI_IMAGE

+ {
+   rom {
+   filename = "u-boot.rom";
+   size = <0x40>;
+   pad-byte = <0xff>;
+
+   mkimage {
+   args = "-n rk3399 -T rkspi";
+   u-boot-spl {
+   };
+   };
+   u-boot-img {
+   offset = <0x4>;
+   };
+   u-boot {
+   offset = <0x30>;
+   };
+   fdtmap {
+   };


There is a output name 'u-boot.rom' including:

- u-boot-spl output with mkimage cmd at offset 0?

- u-boot-img at offset 0x4, how this is generated and what is 
inside? does binary in bl31.elf included?


- u-boot at offset 0x30, what is this binary and where is it from?


Thanks,

- Kever


+   };
+};
+#endif
+
   {
u-boot,dm-pre-reloc;
  };
diff --git a/arch/arm/mach-rockchip/rk3399/Kconfig 
b/arch/arm/mach-rockchip/rk3399/Kconfig
index 254b9c5b4d..17628f9171 100644
--- a/arch/arm/mach-rockchip/rk3399/Kconfig
+++ b/arch/arm/mach-rockchip/rk3399/Kconfig
@@ -5,6 +5,8 @@ choice
  
  config TARGET_CHROMEBOOK_BOB

bool "Asus Flip C101PA Chromebook (RK3399)"
+   select HAS_ROM
+   select ROCKCHIP_SPI_IMAGE
help
  Bob is a small RK3299-based device similar in apperance to Minnie.
  It has two USB 3.0 type-C ports, 4GB of SDRAM, WiFi and a 10.1",





Re: [PATCH v4 07/27] rockchip: Enable building a SPI ROM image on bob

2020-07-28 Thread Simon Glass
Add a simple binman config and enable CONFIG_HAS_ROM so that U-Boot
produces a ROM for bob.

Signed-off-by: Simon Glass 
---

Changes in v4:
- Use CONFIG_ROCKCHIP_SPI_IMAGE to select the image

 arch/arm/dts/rk3399-gru-u-boot.dtsi   |  4 
 arch/arm/dts/rk3399-gru.dtsi  |  2 +-
 arch/arm/dts/rk3399-u-boot.dtsi   | 27 +++
 arch/arm/mach-rockchip/rk3399/Kconfig |  2 ++
 4 files changed, 34 insertions(+), 1 deletion(-)

Applied to u-boot-dm, thanks!


[PATCH v4 07/27] rockchip: Enable building a SPI ROM image on bob

2020-07-19 Thread Simon Glass
Add a simple binman config and enable CONFIG_HAS_ROM so that U-Boot
produces a ROM for bob.

Signed-off-by: Simon Glass 
---

Changes in v4:
- Use CONFIG_ROCKCHIP_SPI_IMAGE to select the image

 arch/arm/dts/rk3399-gru-u-boot.dtsi   |  4 
 arch/arm/dts/rk3399-gru.dtsi  |  2 +-
 arch/arm/dts/rk3399-u-boot.dtsi   | 27 +++
 arch/arm/mach-rockchip/rk3399/Kconfig |  2 ++
 4 files changed, 34 insertions(+), 1 deletion(-)

diff --git a/arch/arm/dts/rk3399-gru-u-boot.dtsi 
b/arch/arm/dts/rk3399-gru-u-boot.dtsi
index 7bddc3acdb..390ac2bb5a 100644
--- a/arch/arm/dts/rk3399-gru-u-boot.dtsi
+++ b/arch/arm/dts/rk3399-gru-u-boot.dtsi
@@ -4,3 +4,7 @@
  */
 
 #include "rk3399-u-boot.dtsi"
+
+_flash {
+   u-boot,dm-pre-reloc;
+};
diff --git a/arch/arm/dts/rk3399-gru.dtsi b/arch/arm/dts/rk3399-gru.dtsi
index 7ac88392f2..f9c5bb607b 100644
--- a/arch/arm/dts/rk3399-gru.dtsi
+++ b/arch/arm/dts/rk3399-gru.dtsi
@@ -537,7 +537,7 @@ ap_i2c_audio:  {
pinctrl-names = "default", "sleep";
pinctrl-1 = <_sleep>;
 
-   spiflash@0 {
+   spi_flash: spiflash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
 
diff --git a/arch/arm/dts/rk3399-u-boot.dtsi b/arch/arm/dts/rk3399-u-boot.dtsi
index 8237782408..ecd230c720 100644
--- a/arch/arm/dts/rk3399-u-boot.dtsi
+++ b/arch/arm/dts/rk3399-u-boot.dtsi
@@ -4,11 +4,14 @@
  */
 #define USB_CLASS_HUB  9
 
+#include "rockchip-u-boot.dtsi"
+
 / {
aliases {
mmc0 = 
mmc1 = 
pci0 = 
+   spi1 = 
};
 
cic: syscon@ff62 {
@@ -57,6 +60,30 @@
 
 };
 
+#ifdef CONFIG_ROCKCHIP_SPI_IMAGE
+ {
+   rom {
+   filename = "u-boot.rom";
+   size = <0x40>;
+   pad-byte = <0xff>;
+
+   mkimage {
+   args = "-n rk3399 -T rkspi";
+   u-boot-spl {
+   };
+   };
+   u-boot-img {
+   offset = <0x4>;
+   };
+   u-boot {
+   offset = <0x30>;
+   };
+   fdtmap {
+   };
+   };
+};
+#endif
+
  {
u-boot,dm-pre-reloc;
 };
diff --git a/arch/arm/mach-rockchip/rk3399/Kconfig 
b/arch/arm/mach-rockchip/rk3399/Kconfig
index 254b9c5b4d..17628f9171 100644
--- a/arch/arm/mach-rockchip/rk3399/Kconfig
+++ b/arch/arm/mach-rockchip/rk3399/Kconfig
@@ -5,6 +5,8 @@ choice
 
 config TARGET_CHROMEBOOK_BOB
bool "Asus Flip C101PA Chromebook (RK3399)"
+   select HAS_ROM
+   select ROCKCHIP_SPI_IMAGE
help
  Bob is a small RK3299-based device similar in apperance to Minnie.
  It has two USB 3.0 type-C ports, 4GB of SDRAM, WiFi and a 10.1",
-- 
2.28.0.rc0.105.gf9edc3c819-goog