- e850-96 platform updates
This commit is contained in:
Tom Rini 2025-02-10 08:45:04 -06:00
commit cfdf18b31b
4 changed files with 75 additions and 37 deletions

View file

@ -19,6 +19,11 @@ int dram_init_banksize(void)
int board_init(void)
{
load_ldfw();
int err;
err = load_ldfw();
if (err)
printf("ERROR: LDFW loading failed (%d)\n", err);
return 0;
}

View file

@ -1,26 +1,11 @@
partitions=
uuid_disk=${uuid_gpt_disk};
name=efs,start=512K,size=20M,uuid=${uuid_gpt_efs};
name=env,size=16K,uuid=${uuid_gpt_env};
name=kernel,size=30M,uuid=${uuid_gpt_kernel};
name=ramdisk,size=26M,uuid=${uuid_gpt_ramdisk};
name=dtbo,size=1M,uuid=${uuid_gpt_dtbo};
name=ldfw,size=4016K,uuid=${uuid_gpt_ldfw};
name=keystorage,size=8K,uuid=${uuid_gpt_keystorage};
name=tzsw,size=1M,uuid=${uuid_gpt_tzsw};
name=harx,size=2M,uuid=${uuid_gpt_harx};
name=harx_rkp,size=2M,uuid=${uuid_gpt_harx_rkp};
name=logo,size=40M,uuid=${uuid_gpt_logo};
name=super,size=3600M,uuid=${uuid_gpt_super};
name=cache,size=300M,uuid=${uuid_gpt_cache};
name=modem,size=100M,uuid=${uuid_gpt_modem};
name=boot,size=100M,uuid=${uuid_gpt_boot};
name=persist,size=30M,uuid=${uuid_gpt_persist};
name=recovery,size=40M,uuid=${uuid_gpt_recovery};
name=misc,size=40M,uuid=${uuid_gpt_misc};
name=mnv,size=20M,uuid=${uuid_gpt_mnv};
name=frp,size=512K,uuid=${uuid_gpt_frp};
name=vbmeta,size=64K,uuid=${uuid_gpt_vbmeta};
name=metadata,size=16M,uuid=${uuid_gpt_metadata};
name=dtb,size=1M,uuid=${uuid_gpt_dtb};
name=userdata,size=-,uuid=${uuid_gpt_userdata}
kernel_addr_r=0x80000000
kernel_comp_addr_r=0x88000000
kernel_comp_size=0x4000000
fdt_addr_r=0x8c000000
scriptaddr=0x8c100000
pxefile_addr_r=0x8c200000
ramdisk_addr_r=0x8c300000
fdtfile=CONFIG_DEFAULT_FDT_FILE
partitions=name=esp,start=512K,size=128M,bootable,type=system;
partitions+=name=rootfs,size=-,bootable,type=linux

View file

@ -7,14 +7,16 @@
*/
#include <part.h>
#include <fs.h>
#include <linux/arm-smccc.h>
#include "fw.h"
#define EMMC_IFACE "mmc"
#define EMMC_DEV_NUM 0
#define LDFW_RAW_PART "ldfw"
#define LDFW_FAT_PART "esp"
#define LDFW_FAT_PATH "/EFI/firmware/ldfw.bin"
/* LDFW constants */
#define LDFW_PART_NAME "ldfw"
#define LDFW_NWD_ADDR 0x88000000
#define LDFW_MAGIC 0x10adab1e
#define SMC_CMD_LOAD_LDFW -0x500
@ -36,7 +38,33 @@ struct ldfw_header {
char fw_name[16];
};
static int read_fw(const char *part_name, void *buf)
/* Load LDFW binary as a file from FAT partition */
static int read_fw_from_fat(const char *part_name, const char *path, void *buf)
{
char dev_part_str[8];
loff_t len_read;
int err;
snprintf(dev_part_str, sizeof(dev_part_str), "%d#%s", EMMC_DEV_NUM,
LDFW_FAT_PART);
err = fs_set_blk_dev(EMMC_IFACE, dev_part_str, FS_TYPE_FAT);
if (err) {
debug("%s: Can't set block device\n", __func__);
return -ENODEV;
}
err = fs_read(path, (ulong)buf, 0, 0, &len_read);
if (err) {
debug("%s: Can't read LDFW file\n", __func__);
return -EIO;
}
return 0;
}
/* Load LDFW binary from raw partition on block device into RAM buffer */
static int read_fw_from_raw(const char *part_name, void *buf)
{
struct blk_desc *blk_desc;
struct disk_partition part;
@ -73,10 +101,13 @@ int load_ldfw(void)
u64 size = 0;
int err, i;
/* Load LDFW from the block device partition into RAM buffer */
err = read_fw(LDFW_PART_NAME, buf);
if (err)
return err;
/* First try to read LDFW from EFI partition, then from the raw one */
err = read_fw_from_fat(LDFW_FAT_PART, LDFW_FAT_PATH, buf);
if (err) {
err = read_fw_from_raw(LDFW_RAW_PART, buf);
if (err)
return err;
}
/* Validate LDFW by magic number in its header */
hdr = buf;

View file

@ -8,23 +8,40 @@ CONFIG_SYS_MALLOC_F_LEN=0x4000
CONFIG_ARCH_EXYNOS9=y
CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xf8c00000
CONFIG_ENV_SIZE=0x10000
CONFIG_ENV_OFFSET=0x0
CONFIG_DEFAULT_DEVICE_TREE="exynos/exynos850-e850-96"
CONFIG_SYS_LOAD_ADDR=0x80000000
CONFIG_ENV_OFFSET_REDUND=0x10000
# CONFIG_PSCI_RESET is not set
CONFIG_EFI_SET_TIME=y
CONFIG_ANDROID_BOOT_IMAGE=y
# CONFIG_AUTOBOOT is not set
CONFIG_BOOTSTD_FULL=y
CONFIG_DEFAULT_FDT_FILE="exynos850-e850-96.dtb"
# CONFIG_DISPLAY_CPUINFO is not set
CONFIG_HUSH_PARSER=y
CONFIG_CMD_BOOTEFI_SELFTEST=y
CONFIG_CMD_ABOOTIMG=y
CONFIG_CMD_NVEDIT_EFI=y
CONFIG_CMD_CLK=y
CONFIG_CMD_GPT=y
CONFIG_CMD_MMC=y
CONFIG_CMD_PART=y
CONFIG_CMD_EFIDEBUG=y
# CONFIG_CMD_DATE is not set
CONFIG_CMD_RTC=y
CONFIG_CMD_TIME=y
CONFIG_CMD_RNG=y
CONFIG_PARTITION_TYPE_GUID=y
CONFIG_ENV_OVERWRITE=y
CONFIG_ENV_IS_IN_MMC=y
CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_SYS_MMC_ENV_PART=2
CONFIG_NO_NET=y
CONFIG_CLK_EXYNOS850=y
CONFIG_SUPPORT_EMMC_BOOT=y
CONFIG_MMC_DW=y
CONFIG_DM_RTC=y
CONFIG_RTC_EMULATION=y
CONFIG_SOC_SAMSUNG=y
CONFIG_EXYNOS_PMU=y
CONFIG_EXYNOS_USI=y