Paul Barker 4e65545f7a board: rzg2l: Add RZ/G2L SMARC EVK board
The Renesas RZ/G2L SMARC Evaluation Board Kit consists of the RZ/G2L
System-on-Module (SOM) based on the R9A07G044L2 SoC, and a common SMARC
carrier board.

The ARM TrustedFirmware code for the Renesas RZ/G2L SoC family passes a
devicetree blob to the bootloader as an argument in the same was
previous R-Car gen3/gen4 SoCs. This blob contains a compatible string
which can be used to identify the particular SoC we are running on and
this is used to select the appropriate device tree to load.

The configuration renesas_rzg2l_smarc_defconfig is added to support
building for this target. In the future this defconfig will be extended
to support other SoCs and evaluation boards from the RZ/G2L family.

Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-10-17 03:27:42 +02:00

68 lines
1.3 KiB
C

// SPDX-License-Identifier: GPL-2.0+
/*
* RZ/G2L board support.
* Copyright (C) 2023 Renesas Electronics Corporation
*/
#include <common.h>
#include <fdtdec.h>
#include <linux/libfdt.h>
#if IS_ENABLED(CONFIG_MULTI_DTB_FIT)
/* If the firmware passed a device tree, use it for board identification. */
extern u64 rcar_atf_boot_args[];
static bool is_rzg2l_board(const char *board_name)
{
void *atf_fdt_blob = (void *)(rcar_atf_boot_args[1]);
return fdt_node_check_compatible(atf_fdt_blob, 0, board_name) == 0;
}
int board_fit_config_name_match(const char *name)
{
void *atf_fdt_blob = (void *)(rcar_atf_boot_args[1]);
if (fdt_magic(atf_fdt_blob) != FDT_MAGIC)
return -1;
if (is_rzg2l_board("renesas,r9a07g044l2"))
return strcmp(name, "r9a07g044l2-smarc");
return -1;
}
#endif
static void apply_atf_overlay(void *fdt_blob)
{
void *atf_fdt_blob = (void *)(rcar_atf_boot_args[1]);
if (fdt_magic(atf_fdt_blob) == FDT_MAGIC)
fdt_overlay_apply_node(fdt_blob, 0, atf_fdt_blob, 0);
}
int fdtdec_board_setup(const void *fdt_blob)
{
apply_atf_overlay((void *)fdt_blob);
return 0;
}
int ft_board_setup(void *blob, struct bd_info *bd)
{
return 0;
}
int board_init(void)
{
return 0;
}
void reset_cpu(void)
{
/*
* TODO: Implement reset support once TrustedFirmware supports
* the appropriate call.
*/
}