mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Rouven Czerwinski <r.czerwinski@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>,
	Barebox List <barebox@lists.infradead.org>
Subject: Re: [PATCH 3/5] ARM: Rockchip: Add rk3568 specific barebox entry function
Date: Sun, 26 Mar 2023 10:36:19 +0200	[thread overview]
Message-ID: <d4d11e6d1eaff10c305a8219b2a42882f11d86f7.camel@pengutronix.de> (raw)
In-Reply-To: <20230324140327.2154039-4-s.hauer@pengutronix.de>

Hi,

On Fri, 2023-03-24 at 15:03 +0100, Sascha Hauer wrote:
> Add a rk3568 specific barebox entry function to simplify board
> code.
> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
>  arch/arm/mach-rockchip/atf.c | 22 ++++++++++++++++++++++
>  include/mach/rockchip/atf.h  |  2 ++
>  2 files changed, 24 insertions(+)
> 
> diff --git a/arch/arm/mach-rockchip/atf.c b/arch/arm/mach-
> rockchip/atf.c
> index 93025faf68..a7d626226e 100644
> --- a/arch/arm/mach-rockchip/atf.c
> +++ b/arch/arm/mach-rockchip/atf.c
> @@ -5,6 +5,9 @@
>  #include <mach/rockchip/atf.h>
>  #include <elf.h>
>  #include <asm/atf_common.h>
> +#include <asm/barebox-arm.h>
> +#include <mach/rockchip/dmc.h>
> +#include <mach/rockchip/rockchip.h>
>  
>  static unsigned long load_elf64_image_phdr(const void *elf)
>  {
> @@ -69,3 +72,22 @@ void rk3568_atf_load_bl31(void *fdt)
>  {
>         rockchip_atf_load_bl31(RK3568, rk3568_bl31_bin,
> rk3568_op_tee_bin, fdt);
>  }
> +
> +void __noreturn rk3568_barebox_entry(void *fdt)
> +{
> +       unsigned long membase, memsize;
> +
> +       membase = RK3568_DRAM_BOTTOM;
> +       memsize = rk3568_ram0_size() - RK3568_DRAM_BOTTOM;
> +
> +       if (current_el() == 3) {
> +               relocate_to_adr_full(RK3568_BAREBOX_LOAD_ADDRESS);
> +               setup_c();
> +
> +               rk3568_lowlevel_init();
> +               rk3568_atf_load_bl31(fdt);

At least on my board I have to replace the fdt with a NULL pointer to
get the downstream TF-A to work. What is the intention for barebox
here? Do we want to support both upstream and downstream? Or do we need
an fdt size check in the PBL to decide whether we want to pass the
pointer?

> +               /* not reached when CONFIG_ARCH_ROCKCHIP_ATF */
> +       }
> +
> +       barebox_arm_entry(membase, memsize, fdt);
> +}
> diff --git a/include/mach/rockchip/atf.h
> b/include/mach/rockchip/atf.h
> index e5d55af3d7..e1e68825d1 100644
> --- a/include/mach/rockchip/atf.h
> +++ b/include/mach/rockchip/atf.h
> @@ -28,4 +28,6 @@ static inline void rk3568_atf_load_bl31(void *fdt)
> { }
>  #endif
>  #endif
>  
> +void __noreturn rk3568_barebox_entry(void *fdt);
> +
>  #endif /* __MACH_ATF_H */

Best regards,
Rouven Czerwinski



  reply	other threads:[~2023-03-26  8:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-24 14:03 [PATCH 0/5] ARM: Rockchip: Read amount of memory from DDR controller Sascha Hauer
2023-03-24 14:03 ` [PATCH 1/5] ARM: dts: rk356x: Add DMC controller node Sascha Hauer
2023-03-24 14:03 ` [PATCH 2/5] ARM: Rockchip: implement memory read out from controller Sascha Hauer
2023-03-26  8:34   ` Rouven Czerwinski
2023-03-27  7:32     ` Sascha Hauer
2023-03-24 14:03 ` [PATCH 3/5] ARM: Rockchip: Add rk3568 specific barebox entry function Sascha Hauer
2023-03-26  8:36   ` Rouven Czerwinski [this message]
2023-03-27  8:31     ` Sascha Hauer
2023-03-24 14:03 ` [PATCH 4/5] ARM: Rockchip: rk3568: use rk3568_barebox_entry() Sascha Hauer
2023-03-24 14:03 ` [PATCH 5/5] ARM: Rockchip: make bootsource logic generic to all SoCs Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d4d11e6d1eaff10c305a8219b2a42882f11d86f7.camel@pengutronix.de \
    --to=r.czerwinski@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox