mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-18 18:59:44 +00:00
30edf40fa8
Engicam EDIMM2.2 Starter Kit is an EDIMM 2.2 Form Factor Capacitive Evaluation Board. Genaral features: - LCD 7" C.Touch - microSD slot - Ethernet 1Gb - Wifi/BT - 2x LVDS Full HD interfaces - 3x USB 2.0 - 1x USB 3.0 - HDMI Out - Mini PCIe - MIPI CSI - 2x CAN - Audio Out i.Core STM32MP1 is an EDIMM SoM based on STM32MP157A from Engicam. i.Core STM32MP1 needs to mount on top of this Evaluation board for creating complete i.Core STM32MP1 EDIMM2.2 Starter Kit. Linux dts commit details: commit <adc0496104b6> ("ARM: dts: stm32: Add Engicam i.Core STM32MP1 EDIMM2.2 Starter Kit") Add support for it. Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
125 lines
2.4 KiB
C
125 lines
2.4 KiB
C
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
|
|
/*
|
|
* Copyright (C) 2018, STMicroelectronics - All Rights Reserved
|
|
* Copyright (C) 2020 Engicam S.r.l.
|
|
* Copyright (C) 2020 Amarula Solutions(India)
|
|
* Author: Jagan Teki <jagan@amarulasolutions.com>
|
|
*/
|
|
|
|
#include <common.h>
|
|
#include <env.h>
|
|
#include <env_internal.h>
|
|
#include <syscon.h>
|
|
#include <asm/io.h>
|
|
#include <asm/arch/sys_proto.h>
|
|
#include <power/regulator.h>
|
|
|
|
DECLARE_GLOBAL_DATA_PTR;
|
|
|
|
int checkboard(void)
|
|
{
|
|
char *mode;
|
|
const char *fdt_compat;
|
|
int fdt_compat_len;
|
|
|
|
if (IS_ENABLED(CONFIG_TFABOOT))
|
|
mode = "trusted";
|
|
else
|
|
mode = "basic";
|
|
|
|
printf("Board: stm32mp1 in %s mode", mode);
|
|
fdt_compat = fdt_getprop(gd->fdt_blob, 0, "compatible",
|
|
&fdt_compat_len);
|
|
if (fdt_compat && fdt_compat_len)
|
|
printf(" (%s)", fdt_compat);
|
|
puts("\n");
|
|
|
|
return 0;
|
|
}
|
|
|
|
/* board dependent setup after realloc */
|
|
int board_init(void)
|
|
{
|
|
/* address of boot parameters */
|
|
gd->bd->bi_boot_params = STM32_DDR_BASE + 0x100;
|
|
|
|
if (IS_ENABLED(CONFIG_DM_REGULATOR))
|
|
regulators_enable_boot_on(_DEBUG);
|
|
|
|
return 0;
|
|
}
|
|
|
|
int board_late_init(void)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
enum env_location env_get_location(enum env_operation op, int prio)
|
|
{
|
|
u32 bootmode = get_bootmode();
|
|
|
|
if (prio)
|
|
return ENVL_UNKNOWN;
|
|
|
|
switch (bootmode & TAMP_BOOT_DEVICE_MASK) {
|
|
case BOOT_FLASH_SD:
|
|
case BOOT_FLASH_EMMC:
|
|
if (CONFIG_IS_ENABLED(ENV_IS_IN_MMC))
|
|
return ENVL_MMC;
|
|
else if (CONFIG_IS_ENABLED(ENV_IS_IN_EXT4))
|
|
return ENVL_EXT4;
|
|
else
|
|
return ENVL_NOWHERE;
|
|
|
|
case BOOT_FLASH_NAND:
|
|
case BOOT_FLASH_SPINAND:
|
|
if (CONFIG_IS_ENABLED(ENV_IS_IN_UBI))
|
|
return ENVL_UBI;
|
|
else
|
|
return ENVL_NOWHERE;
|
|
|
|
case BOOT_FLASH_NOR:
|
|
if (CONFIG_IS_ENABLED(ENV_IS_IN_SPI_FLASH))
|
|
return ENVL_SPI_FLASH;
|
|
else
|
|
return ENVL_NOWHERE;
|
|
|
|
default:
|
|
return ENVL_NOWHERE;
|
|
}
|
|
}
|
|
|
|
const char *env_ext4_get_intf(void)
|
|
{
|
|
u32 bootmode = get_bootmode();
|
|
|
|
switch (bootmode & TAMP_BOOT_DEVICE_MASK) {
|
|
case BOOT_FLASH_SD:
|
|
case BOOT_FLASH_EMMC:
|
|
return "mmc";
|
|
default:
|
|
return "";
|
|
}
|
|
}
|
|
|
|
const char *env_ext4_get_dev_part(void)
|
|
{
|
|
static char *const dev_part[] = {"0:auto", "1:auto", "2:auto"};
|
|
u32 bootmode = get_bootmode();
|
|
|
|
return dev_part[(bootmode & TAMP_BOOT_INSTANCE_MASK) - 1];
|
|
}
|
|
|
|
int mmc_get_env_dev(void)
|
|
{
|
|
u32 bootmode = get_bootmode();
|
|
|
|
return (bootmode & TAMP_BOOT_INSTANCE_MASK) - 1;
|
|
}
|
|
|
|
#if defined(CONFIG_OF_BOARD_SETUP)
|
|
int ft_board_setup(void *blob, struct bd_info *bd)
|
|
{
|
|
return 0;
|
|
}
|
|
#endif
|