All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] Booting on RK3399
@ 2019-01-03  1:15 Simon Glass
  2019-01-03  1:50 ` Mark Kettenis
  2019-01-03  7:01 ` [U-Boot] Booting on RK3399[Please note, mail behalf by sjg@google.com] Kever Yang
  0 siblings, 2 replies; 23+ messages in thread
From: Simon Glass @ 2019-01-03  1:15 UTC (permalink / raw)
  To: u-boot

Hi Kever,

I have a firefly-rk3399 and would like to boot it into U-Boot (as a start)
from an uSD card.

Are there instructions somewhere on how to do this? I gather that I need
OP-TEE but not how to build it or how to put the image together. I would
like to have instructions in README.rockchip if possible.

I'm planning to add U-Boot support for bob and maybe kevin (both
Chromebooks) but am not sure where to start. I thought the firefly might be
best since it is pretty common.

Thanks for any help you can provide.

Regards,
Simon

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

* [U-Boot] Booting on RK3399
  2019-01-03  1:15 [U-Boot] Booting on RK3399 Simon Glass
@ 2019-01-03  1:50 ` Mark Kettenis
  2019-01-03  3:37   ` Simon Glass
  2019-01-03 15:23   ` [U-Boot] Booting on RK3399 Jagan Teki
  2019-01-03  7:01 ` [U-Boot] Booting on RK3399[Please note, mail behalf by sjg@google.com] Kever Yang
  1 sibling, 2 replies; 23+ messages in thread
From: Mark Kettenis @ 2019-01-03  1:50 UTC (permalink / raw)
  To: u-boot

> From: Simon Glass <sjg@chromium.org>
> Date: Wed, 2 Jan 2019 18:15:31 -0700
> 
> Hi Kever,
> 
> I have a firefly-rk3399 and would like to boot it into U-Boot (as a start)
> from an uSD card.
> 
> Are there instructions somewhere on how to do this? I gather that I need
> OP-TEE but not how to build it or how to put the image together. I would
> like to have instructions in README.rockchip if possible.
> 
> I'm planning to add U-Boot support for bob and maybe kevin (both
> Chromebooks) but am not sure where to start. I thought the firefly might be
> best since it is pretty common.

Hi Simon,

The instructions in board/u-boot/rockchip/evb_rk3399/README apply to
the firefly-rk3399 as well.  I've successfully built working firmware
for my board using the TF-A (ATF) 2.0 release and U-Boot SPL in the
past that way.

One complication with the firefly board is that by default it boots
from eMMC, so you can't easily test new firmware by putting it on uSD
card unless you make the eMMC unbootable somehow (e.g. by overwriting
the start of the eMMC storage with zeroes).  In that case you can boot
from uSD card if you write U-Boot SPL and U-Boot proper at the right
offsets:

# dd if=idbspl.img of=/dev/sd1c seek=64
# dd if=u-boot.itb of=/dev/sd1c seek=16384

(that's on OpenBSD, on Linux the device names will be different)

Haven't tested flashing eMMC with rkdeveloptool myself, but that
should work on the firefly as well.

Another complication as that the serial console speed defaults to
1500000 which isn't supported by all serial-to-USB chips and frankly
too sensitive to wire noise.  Also be aware that TF-A built from the
official ARM sources at

  https://github.com/ARM-software/arm-trusted-firmware.git

defaults to 115200 (which is more reasonable IMHO).  So I have the
following diff in my U-Boot tree.  The device tree change comes in
handy if you want to boot from uSD card, otherwise U-Boot SPL will
attempt to load the full U-Boot from eMMC.  Perhaps that bit should be
committed at some point.

Having support for bob would be great.  I have one, and would like to
make OpenBSD run on it.

Cheers,

Mark


diff --git a/arch/arm/dts/rk3399-firefly.dts b/arch/arm/dts/rk3399-firefly.dts
index be350866a7..f90e7e88db 100644
--- a/arch/arm/dts/rk3399-firefly.dts
+++ b/arch/arm/dts/rk3399-firefly.dts
@@ -15,7 +15,7 @@
 
 	chosen {
 		stdout-path = &uart2;
-		u-boot,spl-boot-order = &sdhci, &sdmmc;
+		u-boot,spl-boot-order = "same-as-spl", &sdhci, &sdmmc;
 	};
 
 	backlight: backlight {
diff --git a/configs/firefly-rk3399_defconfig b/configs/firefly-rk3399_defconfig
index 7ac4064a8b..01b3a0771f 100644
--- a/configs/firefly-rk3399_defconfig
+++ b/configs/firefly-rk3399_defconfig
@@ -58,7 +58,7 @@ CONFIG_REGULATOR_RK8XX=y
 CONFIG_PWM_ROCKCHIP=y
 CONFIG_RAM=y
 CONFIG_SPL_RAM=y
-CONFIG_BAUDRATE=1500000
+CONFIG_BAUDRATE=115200
 CONFIG_DEBUG_UART_SHIFT=2
 CONFIG_SYSRESET=y
 CONFIG_USB=y

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

* [U-Boot] Booting on RK3399
  2019-01-03  1:50 ` Mark Kettenis
@ 2019-01-03  3:37   ` Simon Glass
  2019-01-03 11:23     ` Mark Kettenis
  2019-01-03 15:23   ` [U-Boot] Booting on RK3399 Jagan Teki
  1 sibling, 1 reply; 23+ messages in thread
From: Simon Glass @ 2019-01-03  3:37 UTC (permalink / raw)
  To: u-boot

HI Mark,

On Wed, 2 Jan 2019 at 18:50, Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
>
> > From: Simon Glass <sjg@chromium.org>
> > Date: Wed, 2 Jan 2019 18:15:31 -0700
> >
> > Hi Kever,
> >
> > I have a firefly-rk3399 and would like to boot it into U-Boot (as a start)
> > from an uSD card.
> >
> > Are there instructions somewhere on how to do this? I gather that I need
> > OP-TEE but not how to build it or how to put the image together. I would
> > like to have instructions in README.rockchip if possible.
> >
> > I'm planning to add U-Boot support for bob and maybe kevin (both
> > Chromebooks) but am not sure where to start. I thought the firefly might be
> > best since it is pretty common.
>
> Hi Simon,
>
> The instructions in board/u-boot/rockchip/evb_rk3399/README apply to
> the firefly-rk3399 as well.  I've successfully built working firmware
> for my board using the TF-A (ATF) 2.0 release and U-Boot SPL in the
> past that way.

Thanks for the pointer. That was the file I was looking for and I
didn't think to look at the evb.

>
> One complication with the firefly board is that by default it boots
> from eMMC, so you can't easily test new firmware by putting it on uSD
> card unless you make the eMMC unbootable somehow (e.g. by overwriting
> the start of the eMMC storage with zeroes).  In that case you can boot
> from uSD card if you write U-Boot SPL and U-Boot proper at the right
> offsets:
>
> # dd if=idbspl.img of=/dev/sd1c seek=64
> # dd if=u-boot.itb of=/dev/sd1c seek=16384
>
> (that's on OpenBSD, on Linux the device names will be different)

Yes I did that with my board, so it already boots from uSD.

>
> Haven't tested flashing eMMC with rkdeveloptool myself, but that
> should work on the firefly as well.
>
> Another complication as that the serial console speed defaults to
> 1500000 which isn't supported by all serial-to-USB chips and frankly

Yes I seem to have one that supports this, so this is fine.

> too sensitive to wire noise.  Also be aware that TF-A built from the
> official ARM sources at
>
>   https://github.com/ARM-software/arm-trusted-firmware.git
>
> defaults to 115200 (which is more reasonable IMHO).  So I have the
> following diff in my U-Boot tree.  The device tree change comes in
> handy if you want to boot from uSD card, otherwise U-Boot SPL will
> attempt to load the full U-Boot from eMMC.  Perhaps that bit should be
> committed at some point.
>
> Having support for bob would be great.  I have one, and would like to
> make OpenBSD run on it.

OK well I think I'll start with an existing board and then see what is needed.

Regards,
Simon

>
> Cheers,
>
> Mark
>
>
> diff --git a/arch/arm/dts/rk3399-firefly.dts b/arch/arm/dts/rk3399-firefly.dts
> index be350866a7..f90e7e88db 100644
> --- a/arch/arm/dts/rk3399-firefly.dts
> +++ b/arch/arm/dts/rk3399-firefly.dts
> @@ -15,7 +15,7 @@
>
>         chosen {
>                 stdout-path = &uart2;
> -               u-boot,spl-boot-order = &sdhci, &sdmmc;
> +               u-boot,spl-boot-order = "same-as-spl", &sdhci, &sdmmc;
>         };
>
>         backlight: backlight {
> diff --git a/configs/firefly-rk3399_defconfig b/configs/firefly-rk3399_defconfig
> index 7ac4064a8b..01b3a0771f 100644
> --- a/configs/firefly-rk3399_defconfig
> +++ b/configs/firefly-rk3399_defconfig
> @@ -58,7 +58,7 @@ CONFIG_REGULATOR_RK8XX=y
>  CONFIG_PWM_ROCKCHIP=y
>  CONFIG_RAM=y
>  CONFIG_SPL_RAM=y
> -CONFIG_BAUDRATE=1500000
> +CONFIG_BAUDRATE=115200
>  CONFIG_DEBUG_UART_SHIFT=2
>  CONFIG_SYSRESET=y
>  CONFIG_USB=y

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

* [U-Boot] Booting on RK3399[Please note, mail behalf by sjg@google.com]
  2019-01-03  1:15 [U-Boot] Booting on RK3399 Simon Glass
  2019-01-03  1:50 ` Mark Kettenis
@ 2019-01-03  7:01 ` Kever Yang
  1 sibling, 0 replies; 23+ messages in thread
From: Kever Yang @ 2019-01-03  7:01 UTC (permalink / raw)
  To: u-boot

Hi Simon,

    It's great to know you would like to support kevin.

What we need is ATF instead of OP-TEE, which should be the same one used
by Chrome OS support by coreboot,

The guide is here and firefly-rk3399 re-use most of evb-rk3399 follow
with defconfig use firefly-rk3399_defconfig:

board/rockchip/evb_rk3399/README


BTW: I would like to enable TPL for RK3399, and also for other SoCs like
rk3288, so that we can have a common boot flow, I have done in my local
branch.


Thanks,
- Kever
On 01/03/2019 09:15 AM, Simon Glass wrote:
> Hi Kever,
>
> I have a firefly-rk3399 and would like to boot it into U-Boot (as a
> start) from an uSD card.
>
> Are there instructions somewhere on how to do this? I gather that I
> need OP-TEE but not how to build it or how to put the image together.
> I would like to have instructions in README.rockchip if possible.
>
> I'm planning to add U-Boot support for bob and maybe kevin (both
> Chromebooks) but am not sure where to start. I thought the firefly
> might be best since it is pretty common.
>
> Thanks for any help you can provide.
>
> Regards,
> Simon
>

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

* [U-Boot] Booting on RK3399
  2019-01-03  3:37   ` Simon Glass
@ 2019-01-03 11:23     ` Mark Kettenis
  2019-01-03 23:25       ` Simon Glass
  0 siblings, 1 reply; 23+ messages in thread
From: Mark Kettenis @ 2019-01-03 11:23 UTC (permalink / raw)
  To: u-boot

> From: Simon Glass <sjg@chromium.org>
> Date: Wed, 2 Jan 2019 20:37:45 -0700
> 
> > Haven't tested flashing eMMC with rkdeveloptool myself, but that
> > should work on the firefly as well.
> >
> > Another complication as that the serial console speed defaults to
> > 1500000 which isn't supported by all serial-to-USB chips and frankly
> 
> Yes I seem to have one that supports this, so this is fine.

Just be aware that you'll need to patch TF-A to configure the serial
port to 1500000 as well.  Probably just a matter of changing
RK3399_BAUDRATE in plat/rockchip/rk3399/rk3399_def.h.

Cheers,

Mark

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

* [U-Boot] Booting on RK3399
  2019-01-03  1:50 ` Mark Kettenis
  2019-01-03  3:37   ` Simon Glass
@ 2019-01-03 15:23   ` Jagan Teki
  2019-01-03 15:40     ` Mark Kettenis
  1 sibling, 1 reply; 23+ messages in thread
From: Jagan Teki @ 2019-01-03 15:23 UTC (permalink / raw)
  To: u-boot

On Thu, Jan 3, 2019 at 7:20 AM Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
>
> > From: Simon Glass <sjg@chromium.org>
> > Date: Wed, 2 Jan 2019 18:15:31 -0700
> >
> > Hi Kever,
> >
> > I have a firefly-rk3399 and would like to boot it into U-Boot (as a start)
> > from an uSD card.
> >
> > Are there instructions somewhere on how to do this? I gather that I need
> > OP-TEE but not how to build it or how to put the image together. I would
> > like to have instructions in README.rockchip if possible.
> >
> > I'm planning to add U-Boot support for bob and maybe kevin (both
> > Chromebooks) but am not sure where to start. I thought the firefly might be
> > best since it is pretty common.
>
> Hi Simon,
>
> The instructions in board/u-boot/rockchip/evb_rk3399/README apply to
> the firefly-rk3399 as well.  I've successfully built working firmware
> for my board using the TF-A (ATF) 2.0 release and U-Boot SPL in the
> past that way.

What is TF-A here, I'm trying to build master, but it's failed to build

$ make CROSS_COMPILE=aarch64-linux-gnu- PLAT=rk3399 bl31
make -C plat/rockchip/rk3399/drivers/m0
BUILD=/root/arm-trusted-firmware/build/rk3399/release/m0
make[1]: Entering directory
'/root/arm-trusted-firmware/plat/rockchip/rk3399/drivers/m0'
  CC      src/dram.c
arm-none-eabi-gcc -g -mcpu=cortex-m0 -mthumb -Wall -O3 -nostdlib
-mfloat-abi=soft -ffunction-sections -fdata-sections
-fomit-frame-pointer -fno-common -Iinclude/ -I../../include/shared/
-MMD -MT /root/arm-trusted-firmware/build/rk3399/release/m0/dram.o -c
src/dram.c -o /root/arm-trusted-firmware/build/rk3399/release/m0/dram.o
make[1]: arm-none-eabi-gcc: Command not found

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

* [U-Boot] Booting on RK3399
  2019-01-03 15:23   ` [U-Boot] Booting on RK3399 Jagan Teki
@ 2019-01-03 15:40     ` Mark Kettenis
  2019-01-03 15:49       ` Philipp Tomsich
  2019-01-03 16:02       ` Jagan Teki
  0 siblings, 2 replies; 23+ messages in thread
From: Mark Kettenis @ 2019-01-03 15:40 UTC (permalink / raw)
  To: u-boot

> From: Jagan Teki <jagan@amarulasolutions.com>
> Date: Thu, 3 Jan 2019 20:53:43 +0530
> 
> On Thu, Jan 3, 2019 at 7:20 AM Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
> >
> > > From: Simon Glass <sjg@chromium.org>
> > > Date: Wed, 2 Jan 2019 18:15:31 -0700
> > >
> > > Hi Kever,
> > >
> > > I have a firefly-rk3399 and would like to boot it into U-Boot (as a start)
> > > from an uSD card.
> > >
> > > Are there instructions somewhere on how to do this? I gather that I need
> > > OP-TEE but not how to build it or how to put the image together. I would
> > > like to have instructions in README.rockchip if possible.
> > >
> > > I'm planning to add U-Boot support for bob and maybe kevin (both
> > > Chromebooks) but am not sure where to start. I thought the firefly might be
> > > best since it is pretty common.
> >
> > Hi Simon,
> >
> > The instructions in board/u-boot/rockchip/evb_rk3399/README apply to
> > the firefly-rk3399 as well.  I've successfully built working firmware
> > for my board using the TF-A (ATF) 2.0 release and U-Boot SPL in the
> > past that way.
> 
> What is TF-A here, I'm trying to build master, but it's failed to build

TF-A (Trusted Firmware-A) == ATF (Arm Trusted Firmware)

For seam reasom ARM, eh I mean arm, decided to rebrand it.


> $ make CROSS_COMPILE=aarch64-linux-gnu- PLAT=rk3399 bl31
> make -C plat/rockchip/rk3399/drivers/m0
> BUILD=/root/arm-trusted-firmware/build/rk3399/release/m0
> make[1]: Entering directory
> '/root/arm-trusted-firmware/plat/rockchip/rk3399/drivers/m0'
>   CC      src/dram.c
> arm-none-eabi-gcc -g -mcpu=cortex-m0 -mthumb -Wall -O3 -nostdlib
> -mfloat-abi=soft -ffunction-sections -fdata-sections
> -fomit-frame-pointer -fno-common -Iinclude/ -I../../include/shared/
> -MMD -MT /root/arm-trusted-firmware/build/rk3399/release/m0/dram.o -c
> src/dram.c -o /root/arm-trusted-firmware/build/rk3399/release/m0/dram.o
> make[1]: arm-none-eabi-gcc: Command not found

The RK3399 has a Cortex-M0 MCU built into it, and TF-A includes a
firmware for that.  I think it is supposed to assist the SoC with
suspend/resume.

You'll need to install an arm-none-eabi- cross compiler as well to
build it.

Cheers,

Mark

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

* [U-Boot] Booting on RK3399
  2019-01-03 15:40     ` Mark Kettenis
@ 2019-01-03 15:49       ` Philipp Tomsich
  2019-01-03 16:02       ` Jagan Teki
  1 sibling, 0 replies; 23+ messages in thread
From: Philipp Tomsich @ 2019-01-03 15:49 UTC (permalink / raw)
  To: u-boot



> On 03.01.2019, at 16:40, Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
> 
>> From: Jagan Teki <jagan@amarulasolutions.com>
>> Date: Thu, 3 Jan 2019 20:53:43 +0530
>> 
>> On Thu, Jan 3, 2019 at 7:20 AM Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
>>> 
>>>> From: Simon Glass <sjg@chromium.org>
>>>> Date: Wed, 2 Jan 2019 18:15:31 -0700
>>>> 
>>>> Hi Kever,
>>>> 
>>>> I have a firefly-rk3399 and would like to boot it into U-Boot (as a start)
>>>> from an uSD card.
>>>> 
>>>> Are there instructions somewhere on how to do this? I gather that I need
>>>> OP-TEE but not how to build it or how to put the image together. I would
>>>> like to have instructions in README.rockchip if possible.
>>>> 
>>>> I'm planning to add U-Boot support for bob and maybe kevin (both
>>>> Chromebooks) but am not sure where to start. I thought the firefly might be
>>>> best since it is pretty common.
>>> 
>>> Hi Simon,
>>> 
>>> The instructions in board/u-boot/rockchip/evb_rk3399/README apply to
>>> the firefly-rk3399 as well.  I've successfully built working firmware
>>> for my board using the TF-A (ATF) 2.0 release and U-Boot SPL in the
>>> past that way.
>> 
>> What is TF-A here, I'm trying to build master, but it's failed to build
> 
> TF-A (Trusted Firmware-A) == ATF (Arm Trusted Firmware)
> 
> For seam reasom ARM, eh I mean arm, decided to rebrand it.
> 
> 
>> $ make CROSS_COMPILE=aarch64-linux-gnu- PLAT=rk3399 bl31
>> make -C plat/rockchip/rk3399/drivers/m0
>> BUILD=/root/arm-trusted-firmware/build/rk3399/release/m0
>> make[1]: Entering directory
>> '/root/arm-trusted-firmware/plat/rockchip/rk3399/drivers/m0'
>>  CC      src/dram.c
>> arm-none-eabi-gcc -g -mcpu=cortex-m0 -mthumb -Wall -O3 -nostdlib
>> -mfloat-abi=soft -ffunction-sections -fdata-sections
>> -fomit-frame-pointer -fno-common -Iinclude/ -I../../include/shared/
>> -MMD -MT /root/arm-trusted-firmware/build/rk3399/release/m0/dram.o -c
>> src/dram.c -o /root/arm-trusted-firmware/build/rk3399/release/m0/dram.o
>> make[1]: arm-none-eabi-gcc: Command not found
> 
> The RK3399 has a Cortex-M0 MCU built into it, and TF-A includes a
> firmware for that.  I think it is supposed to assist the SoC with
> suspend/resume.

In fact there’s two M0s: one in the PMU power domain and the other in
the PERI power domain. The ATF uses the one in the PMU domain for
suspend/resume and during DFS on DRAM.

I am working (it’s not my highest priority, though) on getting these booted
before entering ATF from SPL, so the PMU M0 is no longer being started
from ATF but actually running on ATF entry.

> You'll need to install an arm-none-eabi- cross compiler as well to
> build it.
> 
> Cheers,
> 
> Mark
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de <mailto:U-Boot@lists.denx.de>
> https://lists.denx.de/listinfo/u-boot <https://lists.denx.de/listinfo/u-boot>

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

* [U-Boot] Booting on RK3399
  2019-01-03 15:40     ` Mark Kettenis
  2019-01-03 15:49       ` Philipp Tomsich
@ 2019-01-03 16:02       ` Jagan Teki
  1 sibling, 0 replies; 23+ messages in thread
From: Jagan Teki @ 2019-01-03 16:02 UTC (permalink / raw)
  To: u-boot

On Thu, Jan 3, 2019 at 9:10 PM Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
>
> > From: Jagan Teki <jagan@amarulasolutions.com>
> > Date: Thu, 3 Jan 2019 20:53:43 +0530
> >
> > On Thu, Jan 3, 2019 at 7:20 AM Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
> > >
> > > > From: Simon Glass <sjg@chromium.org>
> > > > Date: Wed, 2 Jan 2019 18:15:31 -0700
> > > >
> > > > Hi Kever,
> > > >
> > > > I have a firefly-rk3399 and would like to boot it into U-Boot (as a start)
> > > > from an uSD card.
> > > >
> > > > Are there instructions somewhere on how to do this? I gather that I need
> > > > OP-TEE but not how to build it or how to put the image together. I would
> > > > like to have instructions in README.rockchip if possible.
> > > >
> > > > I'm planning to add U-Boot support for bob and maybe kevin (both
> > > > Chromebooks) but am not sure where to start. I thought the firefly might be
> > > > best since it is pretty common.
> > >
> > > Hi Simon,
> > >
> > > The instructions in board/u-boot/rockchip/evb_rk3399/README apply to
> > > the firefly-rk3399 as well.  I've successfully built working firmware
> > > for my board using the TF-A (ATF) 2.0 release and U-Boot SPL in the
> > > past that way.
> >
> > What is TF-A here, I'm trying to build master, but it's failed to build
>
> TF-A (Trusted Firmware-A) == ATF (Arm Trusted Firmware)
>
> For seam reasom ARM, eh I mean arm, decided to rebrand it.
>
>
> > $ make CROSS_COMPILE=aarch64-linux-gnu- PLAT=rk3399 bl31
> > make -C plat/rockchip/rk3399/drivers/m0
> > BUILD=/root/arm-trusted-firmware/build/rk3399/release/m0
> > make[1]: Entering directory
> > '/root/arm-trusted-firmware/plat/rockchip/rk3399/drivers/m0'
> >   CC      src/dram.c
> > arm-none-eabi-gcc -g -mcpu=cortex-m0 -mthumb -Wall -O3 -nostdlib
> > -mfloat-abi=soft -ffunction-sections -fdata-sections
> > -fomit-frame-pointer -fno-common -Iinclude/ -I../../include/shared/
> > -MMD -MT /root/arm-trusted-firmware/build/rk3399/release/m0/dram.o -c
> > src/dram.c -o /root/arm-trusted-firmware/build/rk3399/release/m0/dram.o
> > make[1]: arm-none-eabi-gcc: Command not found
>
> The RK3399 has a Cortex-M0 MCU built into it, and TF-A includes a
> firmware for that.  I think it is supposed to assist the SoC with
> suspend/resume.
>
> You'll need to install an arm-none-eabi- cross compiler as well to
> build it.

Thanks.

Burn the images on SD as below, but the board boot from eMMC.  So it
will boot from SD only eMMC has bad image or any jumper to make SD
boot?
$ ./tools/mkimage -n rk3399 -T rksd -d spl/u-boot-spl.bin idbspl.img
$ sudo dd if=idbspl.img of=/dev/sda seek=64
$ sudo dd if=u-boot.itb of=/dev/sda seek=16384

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

* [U-Boot] Booting on RK3399
  2019-01-03 11:23     ` Mark Kettenis
@ 2019-01-03 23:25       ` Simon Glass
  2019-01-04 19:43         ` Mark Kettenis
  0 siblings, 1 reply; 23+ messages in thread
From: Simon Glass @ 2019-01-03 23:25 UTC (permalink / raw)
  To: u-boot

Hi Mark,

On Thu, 3 Jan 2019 at 04:23, Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
>
> > From: Simon Glass <sjg@chromium.org>
> > Date: Wed, 2 Jan 2019 20:37:45 -0700
> >
> > > Haven't tested flashing eMMC with rkdeveloptool myself, but that
> > > should work on the firefly as well.
> > >
> > > Another complication as that the serial console speed defaults to
> > > 1500000 which isn't supported by all serial-to-USB chips and frankly
> >
> > Yes I seem to have one that supports this, so this is fine.
>
> Just be aware that you'll need to patch TF-A to configure the serial
> port to 1500000 as well.  Probably just a matter of changing
> RK3399_BAUDRATE in plat/rockchip/rk3399/rk3399_def.h.

OK, did that.
Here are the results:

v2018.01
U-Boot SPL board init"Synchronous Abort" handler, esr 0x00070000
ELR:     e2030000a891a6e4
"Synchronous Abort" handler, esr 0x

v2018.03
U-Boot SPL board init"Synchronous Abort" handler, esr 0xffff0000
elr: 00000000ff8ca6fc lr : ffff0000ffffa7bc
"Synchronous Abort" handler, esr 0x

v2018.05
U-Boot SPL board init"Synchronous Abort" handler, esr 0x00070000
elr: 00000000ff8ca7a4 lr : 00000000ff8ca864
"Synchronous Abort" handler, esr 0x

v2018.07
U-Boot SPL board init"Synchronous Abort" handler, esr 0xff000000
elr: 00000000ff8ca8f0 lr : 00000000ff8ca9b0
"Synchronous Abort" handler, esr 0x

v2018.09
U-Boot SPL board init
(no more output)

mainline:
U-Boot SPL board init
(no more output)


It died when I call printf() at the start of board_init_r(). If I put
printf() anywhere inside spl_relocate_stack_gd() it is happy. Also
putc() works OK. So perhaps the code that calls that function is doing
something wrong? Some sort of stack problem?

Regards,
Simon

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

* [U-Boot] Booting on RK3399
  2019-01-03 23:25       ` Simon Glass
@ 2019-01-04 19:43         ` Mark Kettenis
  2019-01-04 20:12           ` Simon Glass
  0 siblings, 1 reply; 23+ messages in thread
From: Mark Kettenis @ 2019-01-04 19:43 UTC (permalink / raw)
  To: u-boot

> From: Simon Glass <sjg@chromium.org>
> Date: Thu, 3 Jan 2019 16:25:36 -0700
> 
> Hi Mark,
> 
> On Thu, 3 Jan 2019 at 04:23, Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
> >
> > > From: Simon Glass <sjg@chromium.org>
> > > Date: Wed, 2 Jan 2019 20:37:45 -0700
> > >
> > > > Haven't tested flashing eMMC with rkdeveloptool myself, but that
> > > > should work on the firefly as well.
> > > >
> > > > Another complication as that the serial console speed defaults to
> > > > 1500000 which isn't supported by all serial-to-USB chips and frankly
> > >
> > > Yes I seem to have one that supports this, so this is fine.
> >
> > Just be aware that you'll need to patch TF-A to configure the serial
> > port to 1500000 as well.  Probably just a matter of changing
> > RK3399_BAUDRATE in plat/rockchip/rk3399/rk3399_def.h.
> 
> OK, did that.
> Here are the results:
> 
> v2018.01
> U-Boot SPL board init"Synchronous Abort" handler, esr 0x00070000
> ELR:     e2030000a891a6e4
> "Synchronous Abort" handler, esr 0x
> 
> v2018.03
> U-Boot SPL board init"Synchronous Abort" handler, esr 0xffff0000
> elr: 00000000ff8ca6fc lr : ffff0000ffffa7bc
> "Synchronous Abort" handler, esr 0x
> 
> v2018.05
> U-Boot SPL board init"Synchronous Abort" handler, esr 0x00070000
> elr: 00000000ff8ca7a4 lr : 00000000ff8ca864
> "Synchronous Abort" handler, esr 0x
> 
> v2018.07
> U-Boot SPL board init"Synchronous Abort" handler, esr 0xff000000
> elr: 00000000ff8ca8f0 lr : 00000000ff8ca9b0
> "Synchronous Abort" handler, esr 0x
> 
> v2018.09
> U-Boot SPL board init
> (no more output)
> 
> mainline:
> U-Boot SPL board init
> (no more output)
> 
> 
> It died when I call printf() at the start of board_init_r(). If I put
> printf() anywhere inside spl_relocate_stack_gd() it is happy. Also
> putc() works OK. So perhaps the code that calls that function is doing
> something wrong? Some sort of stack problem?

Strange.  This is what I get

U-Boot SPL board init
Trying to boot from MMC1
NOTICE:  BL31: v2.0(debug):2.0
NOTICE:  BL31: Built : 12:46:24, Oct 21 2018
INFO:    GICv3 with legacy support detected. ARM GICV3 driver initialized in EL3
INFO:    plat_rockchip_pmu_init(1593): pd status 3e
INFO:    BL31: Initializing runtime services
INFO:    BL31: cortex_a53: CPU workaround for 855873 was applied
INFO:    BL31: Preparing for EL3 exit to normal world
INFO:    Entry point address = 0x200000
INFO:    SPSR = 0x3c9


U-Boot 2019.01-rc2-00127-g08337cd648-dirty (Jan 04 2019 - 19:31:14 +0100)

Model: Firefly-RK3399 Board
...


That is *with* the dts diff (see below) though.  Without that diff, it
hangs after:

U-Boot SPL board init
Trying to boot from MMC2


So obviously that diff is needed to boot properly from uSD.  I'll send
out a git patch with a proper commit messages in a bit.

Cheers,

Mark


diff --git a/arch/arm/dts/rk3399-firefly.dts b/arch/arm/dts/rk3399-firefly.dts
index be350866a7..f90e7e88db 100644
--- a/arch/arm/dts/rk3399-firefly.dts
+++ b/arch/arm/dts/rk3399-firefly.dts
@@ -15,7 +15,7 @@
 
 	chosen {
 		stdout-path = &uart2;
-		u-boot,spl-boot-order = &sdhci, &sdmmc;
+		u-boot,spl-boot-order = "same-as-spl", &sdhci, &sdmmc;
 	};
 
 	backlight: backlight {

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

* [U-Boot] Booting on RK3399
  2019-01-04 19:43         ` Mark Kettenis
@ 2019-01-04 20:12           ` Simon Glass
  2019-01-04 20:29             ` Mark Kettenis
  0 siblings, 1 reply; 23+ messages in thread
From: Simon Glass @ 2019-01-04 20:12 UTC (permalink / raw)
  To: u-boot

Hi Mark,

On Fri, 4 Jan 2019 at 12:43, Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
>
> > From: Simon Glass <sjg@chromium.org>
> > Date: Thu, 3 Jan 2019 16:25:36 -0700
> >
> > Hi Mark,
> >
> > On Thu, 3 Jan 2019 at 04:23, Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
> > >
> > > > From: Simon Glass <sjg@chromium.org>
> > > > Date: Wed, 2 Jan 2019 20:37:45 -0700
> > > >
> > > > > Haven't tested flashing eMMC with rkdeveloptool myself, but that
> > > > > should work on the firefly as well.
> > > > >
> > > > > Another complication as that the serial console speed defaults to
> > > > > 1500000 which isn't supported by all serial-to-USB chips and frankly
> > > >
> > > > Yes I seem to have one that supports this, so this is fine.
> > >
> > > Just be aware that you'll need to patch TF-A to configure the serial
> > > port to 1500000 as well.  Probably just a matter of changing
> > > RK3399_BAUDRATE in plat/rockchip/rk3399/rk3399_def.h.
> >
> > OK, did that.
> > Here are the results:
> >
> > v2018.01
> > U-Boot SPL board init"Synchronous Abort" handler, esr 0x00070000
> > ELR:     e2030000a891a6e4
> > "Synchronous Abort" handler, esr 0x
> >
> > v2018.03
> > U-Boot SPL board init"Synchronous Abort" handler, esr 0xffff0000
> > elr: 00000000ff8ca6fc lr : ffff0000ffffa7bc
> > "Synchronous Abort" handler, esr 0x
> >
> > v2018.05
> > U-Boot SPL board init"Synchronous Abort" handler, esr 0x00070000
> > elr: 00000000ff8ca7a4 lr : 00000000ff8ca864
> > "Synchronous Abort" handler, esr 0x
> >
> > v2018.07
> > U-Boot SPL board init"Synchronous Abort" handler, esr 0xff000000
> > elr: 00000000ff8ca8f0 lr : 00000000ff8ca9b0
> > "Synchronous Abort" handler, esr 0x
> >
> > v2018.09
> > U-Boot SPL board init
> > (no more output)
> >
> > mainline:
> > U-Boot SPL board init
> > (no more output)
> >
> >
> > It died when I call printf() at the start of board_init_r(). If I put
> > printf() anywhere inside spl_relocate_stack_gd() it is happy. Also
> > putc() works OK. So perhaps the code that calls that function is doing
> > something wrong? Some sort of stack problem?
>
> Strange.  This is what I get
>
> U-Boot SPL board init
> Trying to boot from MMC1
> NOTICE:  BL31: v2.0(debug):2.0
> NOTICE:  BL31: Built : 12:46:24, Oct 21 2018
> INFO:    GICv3 with legacy support detected. ARM GICV3 driver initialized in EL3
> INFO:    plat_rockchip_pmu_init(1593): pd status 3e
> INFO:    BL31: Initializing runtime services
> INFO:    BL31: cortex_a53: CPU workaround for 855873 was applied
> INFO:    BL31: Preparing for EL3 exit to normal world
> INFO:    Entry point address = 0x200000
> INFO:    SPSR = 0x3c9
>
>
> U-Boot 2019.01-rc2-00127-g08337cd648-dirty (Jan 04 2019 - 19:31:14 +0100)
>
> Model: Firefly-RK3399 Board
> ...
>
>
> That is *with* the dts diff (see below) though.  Without that diff, it
> hangs after:
>
> U-Boot SPL board init
> Trying to boot from MMC2
>
>
> So obviously that diff is needed to boot properly from uSD.  I'll send
> out a git patch with a proper commit messages in a bit.

Yes I have the diff. What toolchain version are you using?

Regards,
Simon

>
> Cheers,
>
> Mark
>
>
> diff --git a/arch/arm/dts/rk3399-firefly.dts b/arch/arm/dts/rk3399-firefly.dts
> index be350866a7..f90e7e88db 100644
> --- a/arch/arm/dts/rk3399-firefly.dts
> +++ b/arch/arm/dts/rk3399-firefly.dts
> @@ -15,7 +15,7 @@
>
>         chosen {
>                 stdout-path = &uart2;
> -               u-boot,spl-boot-order = &sdhci, &sdmmc;
> +               u-boot,spl-boot-order = "same-as-spl", &sdhci, &sdmmc;
>         };
>
>         backlight: backlight {

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

* [U-Boot] Booting on RK3399
  2019-01-04 20:12           ` Simon Glass
@ 2019-01-04 20:29             ` Mark Kettenis
  2019-01-04 20:43               ` Simon Glass
  0 siblings, 1 reply; 23+ messages in thread
From: Mark Kettenis @ 2019-01-04 20:29 UTC (permalink / raw)
  To: u-boot

> From: Simon Glass <sjg@chromium.org>
> Date: Fri, 4 Jan 2019 13:12:58 -0700
> 
> Hi Mark,
> 
> On Fri, 4 Jan 2019 at 12:43, Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
> > So obviously that diff is needed to boot properly from uSD.  I'll send
> > out a git patch with a proper commit messages in a bit.
> 
> Yes I have the diff. What toolchain version are you using?

I'm using the following OpenBSD packages:

aarch64-none-elf-binutils-2.27p0
aarch64-none-elf-gcc-linaro-6.3.2017.02p3

which is binutils 2.27 and the Linaro GCC 6.3.2017.02 with minimal
patches to get them to build on OpenBSD.

Cheers,

Mark

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

* [U-Boot] Booting on RK3399
  2019-01-04 20:29             ` Mark Kettenis
@ 2019-01-04 20:43               ` Simon Glass
  2019-01-05  3:35                 ` Simon Glass
  0 siblings, 1 reply; 23+ messages in thread
From: Simon Glass @ 2019-01-04 20:43 UTC (permalink / raw)
  To: u-boot

Hi Mark,

On Fri, 4 Jan 2019 at 13:29, Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
>
> > From: Simon Glass <sjg@chromium.org>
> > Date: Fri, 4 Jan 2019 13:12:58 -0700
> >
> > Hi Mark,
> >
> > On Fri, 4 Jan 2019 at 12:43, Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
> > > So obviously that diff is needed to boot properly from uSD.  I'll send
> > > out a git patch with a proper commit messages in a bit.
> >
> > Yes I have the diff. What toolchain version are you using?
>
> I'm using the following OpenBSD packages:
>
> aarch64-none-elf-binutils-2.27p0
> aarch64-none-elf-gcc-linaro-6.3.2017.02p3
>
> which is binutils 2.27 and the Linaro GCC 6.3.2017.02 with minimal
> patches to get them to build on OpenBSD.

OK thank you. I'll try again when I get back. Something funny is going on.

Regards,
Simon

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

* [U-Boot] Booting on RK3399
  2019-01-04 20:43               ` Simon Glass
@ 2019-01-05  3:35                 ` Simon Glass
  2019-01-05 15:56                   ` Simon Glass
  0 siblings, 1 reply; 23+ messages in thread
From: Simon Glass @ 2019-01-05  3:35 UTC (permalink / raw)
  To: u-boot

Hi Mark,

On Fri, 4 Jan 2019 at 13:43, Simon Glass <sjg@chromium.org> wrote:
>
> Hi Mark,
>
> On Fri, 4 Jan 2019 at 13:29, Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
> >
> > > From: Simon Glass <sjg@chromium.org>
> > > Date: Fri, 4 Jan 2019 13:12:58 -0700
> > >
> > > Hi Mark,
> > >
> > > On Fri, 4 Jan 2019 at 12:43, Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
> > > > So obviously that diff is needed to boot properly from uSD.  I'll send
> > > > out a git patch with a proper commit messages in a bit.
> > >
> > > Yes I have the diff. What toolchain version are you using?
> >
> > I'm using the following OpenBSD packages:
> >
> > aarch64-none-elf-binutils-2.27p0
> > aarch64-none-elf-gcc-linaro-6.3.2017.02p3
> >
> > which is binutils 2.27 and the Linaro GCC 6.3.2017.02 with minimal
> > patches to get them to build on OpenBSD.
>
> OK thank you. I'll try again when I get back. Something funny is going on.

I pushed my tree to u-boot-dm/rk-working

export ARCH=arm
CROSS_COMPILE=/opt/linaro/gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
O=/tmp/b/firefly-rk3399

/tmp/b/firefly-rk3399> ln -s
~/cosarm/arm-trusted-firmware/build/rk3399/release/bl31/bl31.elf

make -s firefly-rk3399_defconfig && make -s -j16 && make -s u-boot.itb
&& /tmp/b/firefly-rk3399/tools/mkimage -n rk3399 -T rksd -d
/tmp/b/firefly-rk3399/spl/u-boot-spl.bin idbspl.img && sudo dd
if=idbspl.img of=/dev/sdb seek=64 && sudo dd
if=/tmp/b/firefly-rk3399/u-boot.itb of=/dev/sdb seek=16384 && sync

Output is

U-Boot SPL board init
abc.d123456 7fe90

at which point it hangs.

Hopefully I've done something silly in the setup. Any chance you could
share your image?

Thanks for your help. I am sure I had the board running at one point.

Regards,
Simon

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

* [U-Boot] Booting on RK3399
  2019-01-05  3:35                 ` Simon Glass
@ 2019-01-05 15:56                   ` Simon Glass
  2019-01-05 16:05                     ` Mark Kettenis
  0 siblings, 1 reply; 23+ messages in thread
From: Simon Glass @ 2019-01-05 15:56 UTC (permalink / raw)
  To: u-boot

Hi Mark,

On Fri, 4 Jan 2019 at 20:35, Simon Glass <sjg@chromium.org> wrote:
>
> Hi Mark,
>
> On Fri, 4 Jan 2019 at 13:43, Simon Glass <sjg@chromium.org> wrote:
> >
> > Hi Mark,
> >
> > On Fri, 4 Jan 2019 at 13:29, Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
> > >
> > > > From: Simon Glass <sjg@chromium.org>
> > > > Date: Fri, 4 Jan 2019 13:12:58 -0700
> > > >
> > > > Hi Mark,
> > > >
> > > > On Fri, 4 Jan 2019 at 12:43, Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
> > > > > So obviously that diff is needed to boot properly from uSD.  I'll send
> > > > > out a git patch with a proper commit messages in a bit.
> > > >
> > > > Yes I have the diff. What toolchain version are you using?
> > >
> > > I'm using the following OpenBSD packages:
> > >
> > > aarch64-none-elf-binutils-2.27p0
> > > aarch64-none-elf-gcc-linaro-6.3.2017.02p3
> > >
> > > which is binutils 2.27 and the Linaro GCC 6.3.2017.02 with minimal
> > > patches to get them to build on OpenBSD.
> >
> > OK thank you. I'll try again when I get back. Something funny is going on.
>
> I pushed my tree to u-boot-dm/rk-working
>
> export ARCH=arm
> CROSS_COMPILE=/opt/linaro/gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
> O=/tmp/b/firefly-rk3399
>
> /tmp/b/firefly-rk3399> ln -s
> ~/cosarm/arm-trusted-firmware/build/rk3399/release/bl31/bl31.elf
>
> make -s firefly-rk3399_defconfig && make -s -j16 && make -s u-boot.itb
> && /tmp/b/firefly-rk3399/tools/mkimage -n rk3399 -T rksd -d
> /tmp/b/firefly-rk3399/spl/u-boot-spl.bin idbspl.img && sudo dd
> if=idbspl.img of=/dev/sdb seek=64 && sudo dd
> if=/tmp/b/firefly-rk3399/u-boot.itb of=/dev/sdb seek=16384 && sync
>
> Output is
>
> U-Boot SPL board init
> abc.d123456 7fe90
>
> at which point it hangs.
>
> Hopefully I've done something silly in the setup. Any chance you could
> share your image?
>
> Thanks for your help. I am sure I had the board running at one point.

Thanks for the image - I tried it with the same result. I think my
board is 4GB - perhaps there is a memory init problem still?

Regards,
Simon

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

* [U-Boot] Booting on RK3399
  2019-01-05 15:56                   ` Simon Glass
@ 2019-01-05 16:05                     ` Mark Kettenis
  2019-01-08  0:38                       ` Simon Glass
  0 siblings, 1 reply; 23+ messages in thread
From: Mark Kettenis @ 2019-01-05 16:05 UTC (permalink / raw)
  To: u-boot

> From: Simon Glass <sjg@chromium.org>
> Date: Sat, 5 Jan 2019 08:56:07 -0700
> 
> Hi Mark,
> 
> On Fri, 4 Jan 2019 at 20:35, Simon Glass <sjg@chromium.org> wrote:
> >
> > Hi Mark,
> >
> > On Fri, 4 Jan 2019 at 13:43, Simon Glass <sjg@chromium.org> wrote:
> > >
> > > Hi Mark,
> > >
> > > On Fri, 4 Jan 2019 at 13:29, Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
> > > >
> > > > > From: Simon Glass <sjg@chromium.org>
> > > > > Date: Fri, 4 Jan 2019 13:12:58 -0700
> > > > >
> > > > > Hi Mark,
> > > > >
> > > > > On Fri, 4 Jan 2019 at 12:43, Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
> > > > > > So obviously that diff is needed to boot properly from uSD.  I'll send
> > > > > > out a git patch with a proper commit messages in a bit.
> > > > >
> > > > > Yes I have the diff. What toolchain version are you using?
> > > >
> > > > I'm using the following OpenBSD packages:
> > > >
> > > > aarch64-none-elf-binutils-2.27p0
> > > > aarch64-none-elf-gcc-linaro-6.3.2017.02p3
> > > >
> > > > which is binutils 2.27 and the Linaro GCC 6.3.2017.02 with minimal
> > > > patches to get them to build on OpenBSD.
> > >
> > > OK thank you. I'll try again when I get back. Something funny is going on.
> >
> > I pushed my tree to u-boot-dm/rk-working
> >
> > export ARCH=arm
> > CROSS_COMPILE=/opt/linaro/gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
> > O=/tmp/b/firefly-rk3399
> >
> > /tmp/b/firefly-rk3399> ln -s
> > ~/cosarm/arm-trusted-firmware/build/rk3399/release/bl31/bl31.elf
> >
> > make -s firefly-rk3399_defconfig && make -s -j16 && make -s u-boot.itb
> > && /tmp/b/firefly-rk3399/tools/mkimage -n rk3399 -T rksd -d
> > /tmp/b/firefly-rk3399/spl/u-boot-spl.bin idbspl.img && sudo dd
> > if=idbspl.img of=/dev/sdb seek=64 && sudo dd
> > if=/tmp/b/firefly-rk3399/u-boot.itb of=/dev/sdb seek=16384 && sync
> >
> > Output is
> >
> > U-Boot SPL board init
> > abc.d123456 7fe90
> >
> > at which point it hangs.
> >
> > Hopefully I've done something silly in the setup. Any chance you could
> > share your image?
> >
> > Thanks for your help. I am sure I had the board running at one point.
> 
> Thanks for the image - I tried it with the same result. I think my
> board is 4GB - perhaps there is a memory init problem still?

Not inconceivable.  My board indeed only has 2GB.

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

* [U-Boot] Booting on RK3399
  2019-01-05 16:05                     ` Mark Kettenis
@ 2019-01-08  0:38                       ` Simon Glass
  2019-01-08  6:38                         ` [U-Boot] Booting on RK3399[Please note, mail behalf by sjg@google.com] Kever Yang
  0 siblings, 1 reply; 23+ messages in thread
From: Simon Glass @ 2019-01-08  0:38 UTC (permalink / raw)
  To: u-boot

Hi Mark,

On Sat, 5 Jan 2019 at 09:05, Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
>
> > From: Simon Glass <sjg@chromium.org>
> > Date: Sat, 5 Jan 2019 08:56:07 -0700
> >
> > Hi Mark,
> >
> > On Fri, 4 Jan 2019 at 20:35, Simon Glass <sjg@chromium.org> wrote:
> > >
> > > Hi Mark,
> > >
> > > On Fri, 4 Jan 2019 at 13:43, Simon Glass <sjg@chromium.org> wrote:
> > > >
> > > > Hi Mark,
> > > >
> > > > On Fri, 4 Jan 2019 at 13:29, Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
> > > > >
> > > > > > From: Simon Glass <sjg@chromium.org>
> > > > > > Date: Fri, 4 Jan 2019 13:12:58 -0700
> > > > > >
> > > > > > Hi Mark,
> > > > > >
> > > > > > On Fri, 4 Jan 2019 at 12:43, Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
> > > > > > > So obviously that diff is needed to boot properly from uSD.  I'll send
> > > > > > > out a git patch with a proper commit messages in a bit.
> > > > > >
> > > > > > Yes I have the diff. What toolchain version are you using?
> > > > >
> > > > > I'm using the following OpenBSD packages:
> > > > >
> > > > > aarch64-none-elf-binutils-2.27p0
> > > > > aarch64-none-elf-gcc-linaro-6.3.2017.02p3
> > > > >
> > > > > which is binutils 2.27 and the Linaro GCC 6.3.2017.02 with minimal
> > > > > patches to get them to build on OpenBSD.
> > > >
> > > > OK thank you. I'll try again when I get back. Something funny is going on.
> > >
> > > I pushed my tree to u-boot-dm/rk-working
> > >
> > > export ARCH=arm
> > > CROSS_COMPILE=/opt/linaro/gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
> > > O=/tmp/b/firefly-rk3399
> > >
> > > /tmp/b/firefly-rk3399> ln -s
> > > ~/cosarm/arm-trusted-firmware/build/rk3399/release/bl31/bl31.elf
> > >
> > > make -s firefly-rk3399_defconfig && make -s -j16 && make -s u-boot.itb
> > > && /tmp/b/firefly-rk3399/tools/mkimage -n rk3399 -T rksd -d
> > > /tmp/b/firefly-rk3399/spl/u-boot-spl.bin idbspl.img && sudo dd
> > > if=idbspl.img of=/dev/sdb seek=64 && sudo dd
> > > if=/tmp/b/firefly-rk3399/u-boot.itb of=/dev/sdb seek=16384 && sync
> > >
> > > Output is
> > >
> > > U-Boot SPL board init
> > > abc.d123456 7fe90
> > >
> > > at which point it hangs.
> > >
> > > Hopefully I've done something silly in the setup. Any chance you could
> > > share your image?
> > >
> > > Thanks for your help. I am sure I had the board running at one point.
> >
> > Thanks for the image - I tried it with the same result. I think my
> > board is 4GB - perhaps there is a memory init problem still?
>
> Not inconceivable.  My board indeed only has 2GB.

OK thanks. Oddly I got this running on Bob which also has 4GB and did
not have this problem.

Regards,
Simon

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

* [U-Boot] Booting on RK3399[Please note, mail behalf by sjg@google.com]
  2019-01-08  0:38                       ` Simon Glass
@ 2019-01-08  6:38                         ` Kever Yang
  2019-01-10 12:56                           ` Simon Glass
  0 siblings, 1 reply; 23+ messages in thread
From: Kever Yang @ 2019-01-08  6:38 UTC (permalink / raw)
  To: u-boot

Hi Simon,


On 01/08/2019 08:38 AM, Simon Glass wrote:
> Hi Mark,
>
> On Sat, 5 Jan 2019 at 09:05, Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
>>> From: Simon Glass <sjg@chromium.org>
>>> Date: Sat, 5 Jan 2019 08:56:07 -0700
>>>
>>> Hi Mark,
>>>
>>> On Fri, 4 Jan 2019 at 20:35, Simon Glass <sjg@chromium.org> wrote:
>>>> Hi Mark,
>>>>
>>>> On Fri, 4 Jan 2019 at 13:43, Simon Glass <sjg@chromium.org> wrote:
>>>>> Hi Mark,
>>>>>
>>>>> On Fri, 4 Jan 2019 at 13:29, Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
>>>>>>> From: Simon Glass <sjg@chromium.org>
>>>>>>> Date: Fri, 4 Jan 2019 13:12:58 -0700
>>>>>>>
>>>>>>> Hi Mark,
>>>>>>>
>>>>>>> On Fri, 4 Jan 2019 at 12:43, Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
>>>>>>>> So obviously that diff is needed to boot properly from uSD.  I'll send
>>>>>>>> out a git patch with a proper commit messages in a bit.
>>>>>>> Yes I have the diff. What toolchain version are you using?
>>>>>> I'm using the following OpenBSD packages:
>>>>>>
>>>>>> aarch64-none-elf-binutils-2.27p0
>>>>>> aarch64-none-elf-gcc-linaro-6.3.2017.02p3
>>>>>>
>>>>>> which is binutils 2.27 and the Linaro GCC 6.3.2017.02 with minimal
>>>>>> patches to get them to build on OpenBSD.
>>>>> OK thank you. I'll try again when I get back. Something funny is going on.
>>>> I pushed my tree to u-boot-dm/rk-working
>>>>
>>>> export ARCH=arm
>>>> CROSS_COMPILE=/opt/linaro/gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
>>>> O=/tmp/b/firefly-rk3399
>>>>
>>>> /tmp/b/firefly-rk3399> ln -s
>>>> ~/cosarm/arm-trusted-firmware/build/rk3399/release/bl31/bl31.elf
>>>>
>>>> make -s firefly-rk3399_defconfig && make -s -j16 && make -s u-boot.itb
>>>> && /tmp/b/firefly-rk3399/tools/mkimage -n rk3399 -T rksd -d
>>>> /tmp/b/firefly-rk3399/spl/u-boot-spl.bin idbspl.img && sudo dd
>>>> if=idbspl.img of=/dev/sdb seek=64 && sudo dd
>>>> if=/tmp/b/firefly-rk3399/u-boot.itb of=/dev/sdb seek=16384 && sync
>>>>
>>>> Output is
>>>>
>>>> U-Boot SPL board init
>>>> abc.d123456 7fe90
>>>>
>>>> at which point it hangs.
>>>>
>>>> Hopefully I've done something silly in the setup. Any chance you could
>>>> share your image?
>>>>
>>>> Thanks for your help. I am sure I had the board running at one point.
>>> Thanks for the image - I tried it with the same result. I think my
>>> board is 4GB - perhaps there is a memory init problem still?
>> Not inconceivable.  My board indeed only has 2GB.
> OK thanks. Oddly I got this running on Bob which also has 4GB and did
> not have this problem.

For 4GB ddr3, maybe you need to use
arch/arm/dts/rk3399-sdram-ddr3-4G-1600.dtsi,
and you can turn on DEBUG so that we can confirm if hang in dram init
driver.

Thanks,
- Kever
> Regards,
> Simon
>

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

* [U-Boot] Booting on RK3399[Please note, mail behalf by sjg@google.com]
  2019-01-08  6:38                         ` [U-Boot] Booting on RK3399[Please note, mail behalf by sjg@google.com] Kever Yang
@ 2019-01-10 12:56                           ` Simon Glass
  2020-11-16 14:55                             ` Piotr Lobacz
  0 siblings, 1 reply; 23+ messages in thread
From: Simon Glass @ 2019-01-10 12:56 UTC (permalink / raw)
  To: u-boot

Hi Kever,

On Mon, 7 Jan 2019 at 23:38, Kever Yang <kever.yang@rock-chips.com> wrote:
>
> Hi Simon,
>
>
> On 01/08/2019 08:38 AM, Simon Glass wrote:
> > Hi Mark,
> >
> > On Sat, 5 Jan 2019 at 09:05, Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
> >>> From: Simon Glass <sjg@chromium.org>
> >>> Date: Sat, 5 Jan 2019 08:56:07 -0700
> >>>
> >>> Hi Mark,
> >>>
> >>> On Fri, 4 Jan 2019 at 20:35, Simon Glass <sjg@chromium.org> wrote:
> >>>> Hi Mark,
> >>>>
> >>>> On Fri, 4 Jan 2019 at 13:43, Simon Glass <sjg@chromium.org> wrote:
> >>>>> Hi Mark,
> >>>>>
> >>>>> On Fri, 4 Jan 2019 at 13:29, Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
> >>>>>>> From: Simon Glass <sjg@chromium.org>
> >>>>>>> Date: Fri, 4 Jan 2019 13:12:58 -0700
> >>>>>>>
> >>>>>>> Hi Mark,
> >>>>>>>
> >>>>>>> On Fri, 4 Jan 2019 at 12:43, Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
> >>>>>>>> So obviously that diff is needed to boot properly from uSD.  I'll send
> >>>>>>>> out a git patch with a proper commit messages in a bit.
> >>>>>>> Yes I have the diff. What toolchain version are you using?
> >>>>>> I'm using the following OpenBSD packages:
> >>>>>>
> >>>>>> aarch64-none-elf-binutils-2.27p0
> >>>>>> aarch64-none-elf-gcc-linaro-6.3.2017.02p3
> >>>>>>
> >>>>>> which is binutils 2.27 and the Linaro GCC 6.3.2017.02 with minimal
> >>>>>> patches to get them to build on OpenBSD.
> >>>>> OK thank you. I'll try again when I get back. Something funny is going on.
> >>>> I pushed my tree to u-boot-dm/rk-working
> >>>>
> >>>> export ARCH=arm
> >>>> CROSS_COMPILE=/opt/linaro/gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
> >>>> O=/tmp/b/firefly-rk3399
> >>>>
> >>>> /tmp/b/firefly-rk3399> ln -s
> >>>> ~/cosarm/arm-trusted-firmware/build/rk3399/release/bl31/bl31.elf
> >>>>
> >>>> make -s firefly-rk3399_defconfig && make -s -j16 && make -s u-boot.itb
> >>>> && /tmp/b/firefly-rk3399/tools/mkimage -n rk3399 -T rksd -d
> >>>> /tmp/b/firefly-rk3399/spl/u-boot-spl.bin idbspl.img && sudo dd
> >>>> if=idbspl.img of=/dev/sdb seek=64 && sudo dd
> >>>> if=/tmp/b/firefly-rk3399/u-boot.itb of=/dev/sdb seek=16384 && sync
> >>>>
> >>>> Output is
> >>>>
> >>>> U-Boot SPL board init
> >>>> abc.d123456 7fe90
> >>>>
> >>>> at which point it hangs.
> >>>>
> >>>> Hopefully I've done something silly in the setup. Any chance you could
> >>>> share your image?
> >>>>
> >>>> Thanks for your help. I am sure I had the board running at one point.
> >>> Thanks for the image - I tried it with the same result. I think my
> >>> board is 4GB - perhaps there is a memory init problem still?
> >> Not inconceivable.  My board indeed only has 2GB.
> > OK thanks. Oddly I got this running on Bob which also has 4GB and did
> > not have this problem.
>
> For 4GB ddr3, maybe you need to use
> arch/arm/dts/rk3399-sdram-ddr3-4G-1600.dtsi,
> and you can turn on DEBUG so that we can confirm if hang in dram init
> driver.

OK thank you, will try. It really should select the correct one automatically.

BTW your email came through as a new one, not a reply to the original.
Is there something wrong with you config?

Regards,
Simon

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

* Booting on RK3399[Please note, mail behalf by sjg@google.com]
  2019-01-10 12:56                           ` Simon Glass
@ 2020-11-16 14:55                             ` Piotr Lobacz
  2020-11-19  8:07                               ` Kever Yang
  0 siblings, 1 reply; 23+ messages in thread
From: Piotr Lobacz @ 2020-11-16 14:55 UTC (permalink / raw)
  To: u-boot

Hi all,
i also have a firefly-rk3399 and got problems booting atf >= 1.4 with
whatever optee i use. Only rockchip blob is working for me. I know that i'm
doing something wrong but dunno what. The command for building atf is:
 
# make CROSS_COMPILE=aarch64-linux-gnu- PLAT=rk3399 LOG_LEVEL=40 DEBUG=0
CRASH_REPORTING=1 SPD=opteed bl31

and i only generate uboot.img and trust.img using rockchip build.sh script
with command

# ./buid.sh uboot

Rockchip has added this trust_merger app to their u-boot source code. The
build.sh script builds u-boot and executes make.sh script from u-boot which
runs trust_merger. But for some reason it does not work atf >= 1.4. I don't
know what exectly but what i can tell, i do not see any logs from bl31. For
atf 1.3 with rockchip bl32 blob i can see logs:

No find bl30.bin
Load uboot, ReadLba = 4000
Load OK, addr=0x200000, size=0xda214
RunBL31 0x10000 @ 105506 us
NOTICE:  BL31: v1.3(release):d43a527de
NOTICE:  BL31: Built : 15:41:07, Nov 16 2020
INFO:    GICv3 with legacy support detected. ARM GICV3 driver initialized in
EL3
INFO:    plat_rockchip_pmu_init(1331): pd status 3e
INFO:    BL31: Initializing runtime services
INFO:    BL31: Initializing BL32
INF [0x0] TEE-CORE:init_primary_helper:337: Initializing
(1.1.0-266-gee81607c #1 Mon Aug 17 09:23:30 UTC 2020 aarch64)

INF [0x0] TEE-CORE:init_primary_helper:338: Release version: 1.2

INF [0x0] TEE-CORE:init_teecore:83: teecore inits done
INFO:    BL31: Preparing for EL3 exit to normal world
INFO:    Entry point address = 0x200000
INFO:    SPSR = 0x3c9


U-Boot 2017.09 (Nov 11 2020 - 10:27:07 +0100)

And this is what i get for 2.3 atf version:

find part:trust OK. first_lba:0x6000.
Trust Addr:0x6000, 0x58334c42
No find bl30.bin
Load uboot, ReadLba = 4000
Load OK, addr=0x200000, size=0xda214
RunBL31 0x40000 @ 105604 us


U-Boot 2017.09 (Nov 11 2020 - 10:27:07 +0100)

Model: Firefly-RK3399 Board
PreSerial: 2
DRAM:  3.8 GiB
Sysmem: init
Relocation Offset is: f5beb000
Using default environment

There is no NOTICE or INFO log. The bl32 blob is the same so i suspect for
99% that bl31 was not initialized.

Can anybody help me solving this issue? Because currently i'm with no more
ideas and this is really frustrating...

Best Regards
Piotr ?obacz





--
Sent from: http://u-boot.10912.n7.nabble.com/

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

* Booting on RK3399[Please note, mail behalf by sjg@google.com]
  2020-11-16 14:55                             ` Piotr Lobacz
@ 2020-11-19  8:07                               ` Kever Yang
  2020-11-19  8:25                                 ` Piotr Lobacz
  0 siblings, 1 reply; 23+ messages in thread
From: Kever Yang @ 2020-11-19  8:07 UTC (permalink / raw)
  To: u-boot

Hi Piotr,

On 2020/11/16 ??10:55, Piotr Lobacz wrote:
> Hi all,
> i also have a firefly-rk3399 and got problems booting atf >= 1.4 with
> whatever optee i use. Only rockchip blob is working for me. I know that i'm
> doing something wrong but dunno what. The command for building atf is:
>   
> # make CROSS_COMPILE=aarch64-linux-gnu- PLAT=rk3399 LOG_LEVEL=40 DEBUG=0
> CRASH_REPORTING=1 SPD=opteed bl31
>
> and i only generate uboot.img and trust.img using rockchip build.sh script
> with command
>
> # ./buid.sh uboot
>
> Rockchip has added this trust_merger app to their u-boot source code. The
> build.sh script builds u-boot and executes make.sh script from u-boot which
> runs trust_merger. But for some reason it does not work atf >= 1.4. I don't
> know what exectly but what i can tell, i do not see any logs from bl31. For
> atf 1.3 with rockchip bl32 blob i can see logs:
>
> No find bl30.bin
> Load uboot, ReadLba = 4000
> Load OK, addr=0x200000, size=0xda214
> RunBL31 0x10000 @ 105506 us
> NOTICE:  BL31: v1.3(release):d43a527de
> NOTICE:  BL31: Built : 15:41:07, Nov 16 2020
> INFO:    GICv3 with legacy support detected. ARM GICV3 driver initialized in
> EL3
> INFO:    plat_rockchip_pmu_init(1331): pd status 3e
> INFO:    BL31: Initializing runtime services
> INFO:    BL31: Initializing BL32
> INF [0x0] TEE-CORE:init_primary_helper:337: Initializing
> (1.1.0-266-gee81607c #1 Mon Aug 17 09:23:30 UTC 2020 aarch64)
>
> INF [0x0] TEE-CORE:init_primary_helper:338: Release version: 1.2
>
> INF [0x0] TEE-CORE:init_teecore:83: teecore inits done
> INFO:    BL31: Preparing for EL3 exit to normal world
> INFO:    Entry point address = 0x200000
> INFO:    SPSR = 0x3c9
>
>
> U-Boot 2017.09 (Nov 11 2020 - 10:27:07 +0100)
>
> And this is what i get for 2.3 atf version:
>
> find part:trust OK. first_lba:0x6000.
> Trust Addr:0x6000, 0x58334c42
> No find bl30.bin
> Load uboot, ReadLba = 4000
> Load OK, addr=0x200000, size=0xda214
> RunBL31 0x40000 @ 105604 us
>
>
> U-Boot 2017.09 (Nov 11 2020 - 10:27:07 +0100)
>
> Model: Firefly-RK3399 Board
> PreSerial: 2
> DRAM:  3.8 GiB
> Sysmem: init
> Relocation Offset is: f5beb000
> Using default environment
>
> There is no NOTICE or INFO log. The bl32 blob is the same so i suspect for
> 99% that bl31 was not initialized.

This log shows everything is going well, there is no log from bl31 
because the serial setting

is different in U-Boot and ATF, eg. ATF may use a different baud rate so 
you can't see the serial output.


Thanks,

- Kever

>
> Can anybody help me solving this issue? Because currently i'm with no more
> ideas and this is really frustrating...
>
> Best Regards
> Piotr ?obacz
>
>
>
>
>
> --
> Sent from: http://u-boot.10912.n7.nabble.com/
>
>

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

* Booting on RK3399[Please note, mail behalf by sjg@google.com]
  2020-11-19  8:07                               ` Kever Yang
@ 2020-11-19  8:25                                 ` Piotr Lobacz
  0 siblings, 0 replies; 23+ messages in thread
From: Piotr Lobacz @ 2020-11-19  8:25 UTC (permalink / raw)
  To: u-boot

Hi Kever,
thanks for your reply, so i should change baud rate in bl31 to see it? how
can i handle it?

Best Regards
Piotr



--
Sent from: http://u-boot.10912.n7.nabble.com/

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

end of thread, other threads:[~2020-11-19  8:25 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-03  1:15 [U-Boot] Booting on RK3399 Simon Glass
2019-01-03  1:50 ` Mark Kettenis
2019-01-03  3:37   ` Simon Glass
2019-01-03 11:23     ` Mark Kettenis
2019-01-03 23:25       ` Simon Glass
2019-01-04 19:43         ` Mark Kettenis
2019-01-04 20:12           ` Simon Glass
2019-01-04 20:29             ` Mark Kettenis
2019-01-04 20:43               ` Simon Glass
2019-01-05  3:35                 ` Simon Glass
2019-01-05 15:56                   ` Simon Glass
2019-01-05 16:05                     ` Mark Kettenis
2019-01-08  0:38                       ` Simon Glass
2019-01-08  6:38                         ` [U-Boot] Booting on RK3399[Please note, mail behalf by sjg@google.com] Kever Yang
2019-01-10 12:56                           ` Simon Glass
2020-11-16 14:55                             ` Piotr Lobacz
2020-11-19  8:07                               ` Kever Yang
2020-11-19  8:25                                 ` Piotr Lobacz
2019-01-03 15:23   ` [U-Boot] Booting on RK3399 Jagan Teki
2019-01-03 15:40     ` Mark Kettenis
2019-01-03 15:49       ` Philipp Tomsich
2019-01-03 16:02       ` Jagan Teki
2019-01-03  7:01 ` [U-Boot] Booting on RK3399[Please note, mail behalf by sjg@google.com] Kever Yang

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.