mirror of
https://xff.cz/git/u-boot/
synced 2025-10-01 15:31:27 +02:00
Add support for different RAM sizes and speed grades on the phyCORE-i.MX8MP. Add support for 1GB 1.5GHz, 1GB 2GHz, 4GB 1.5GHz, 4GB 2GHz and 8GB 2GHz RAM. The RAM size and speed grade is detected by the information stored in the EEPROM on the SoM. Co-developed-by: Benjamin Hahn <B.Hahn@phytec.de> Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de> Co-developed-by: Yannic Moog <y.moog@phytec.de> Signed-off-by: Yannic Moog <y.moog@phytec.de> Co-developed-by: Yashwanth Varakala <y.varakala@phytec.de> Signed-off-by: Yashwanth Varakala <y.varakala@phytec.de> Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
69 lines
1.2 KiB
C
69 lines
1.2 KiB
C
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
/*
|
|
* Copyright (C) 2020 PHYTEC Messtechnik GmbH
|
|
* Author: Teresa Remmet <t.remmet@phytec.de>
|
|
*/
|
|
|
|
#include <asm/arch/sys_proto.h>
|
|
#include <asm/global_data.h>
|
|
#include <asm/io.h>
|
|
#include <asm/mach-imx/boot_mode.h>
|
|
#include <env.h>
|
|
#include <init.h>
|
|
#include <miiphy.h>
|
|
|
|
DECLARE_GLOBAL_DATA_PTR;
|
|
|
|
static int setup_fec(void)
|
|
{
|
|
struct iomuxc_gpr_base_regs *gpr =
|
|
(struct iomuxc_gpr_base_regs *)IOMUXC_GPR_BASE_ADDR;
|
|
|
|
/* Use 125M anatop REF_CLK1 for ENET1, not from external */
|
|
clrsetbits_le32(&gpr->gpr[1], 0x2000, 0);
|
|
|
|
return 0;
|
|
}
|
|
|
|
int board_init(void)
|
|
{
|
|
setup_fec();
|
|
|
|
return 0;
|
|
}
|
|
|
|
int board_mmc_get_env_dev(int devno)
|
|
{
|
|
return devno;
|
|
}
|
|
|
|
int board_late_init(void)
|
|
{
|
|
switch (get_boot_device()) {
|
|
case SD2_BOOT:
|
|
env_set_ulong("mmcdev", 1);
|
|
break;
|
|
case MMC3_BOOT:
|
|
env_set_ulong("mmcdev", 2);
|
|
break;
|
|
case USB_BOOT:
|
|
printf("Detect USB boot. Will enter fastboot mode!\n");
|
|
env_set_ulong("dofastboot", 1);
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|
|
int board_phys_sdram_size(phys_size_t *size)
|
|
{
|
|
if (!size)
|
|
return -EINVAL;
|
|
|
|
*size = get_ram_size((void *)PHYS_SDRAM, PHYS_SDRAM_SIZE + PHYS_SDRAM_2_SIZE);
|
|
|
|
return 0;
|
|
}
|