"Das U-Boot" Source Tree

Merge https://source.denx.de/u-boot/custodians/u-boot-samsung

- e850-96 platform updates

+75 -37
+6 -1
board/samsung/e850-96/e850-96.c
··· 19 19 20 20 int board_init(void) 21 21 { 22 - load_ldfw(); 22 + int err; 23 + 24 + err = load_ldfw(); 25 + if (err) 26 + printf("ERROR: LDFW loading failed (%d)\n", err); 27 + 23 28 return 0; 24 29 }
+11 -26
board/samsung/e850-96/e850-96.env
··· 1 - partitions= 2 - uuid_disk=${uuid_gpt_disk}; 3 - name=efs,start=512K,size=20M,uuid=${uuid_gpt_efs}; 4 - name=env,size=16K,uuid=${uuid_gpt_env}; 5 - name=kernel,size=30M,uuid=${uuid_gpt_kernel}; 6 - name=ramdisk,size=26M,uuid=${uuid_gpt_ramdisk}; 7 - name=dtbo,size=1M,uuid=${uuid_gpt_dtbo}; 8 - name=ldfw,size=4016K,uuid=${uuid_gpt_ldfw}; 9 - name=keystorage,size=8K,uuid=${uuid_gpt_keystorage}; 10 - name=tzsw,size=1M,uuid=${uuid_gpt_tzsw}; 11 - name=harx,size=2M,uuid=${uuid_gpt_harx}; 12 - name=harx_rkp,size=2M,uuid=${uuid_gpt_harx_rkp}; 13 - name=logo,size=40M,uuid=${uuid_gpt_logo}; 14 - name=super,size=3600M,uuid=${uuid_gpt_super}; 15 - name=cache,size=300M,uuid=${uuid_gpt_cache}; 16 - name=modem,size=100M,uuid=${uuid_gpt_modem}; 17 - name=boot,size=100M,uuid=${uuid_gpt_boot}; 18 - name=persist,size=30M,uuid=${uuid_gpt_persist}; 19 - name=recovery,size=40M,uuid=${uuid_gpt_recovery}; 20 - name=misc,size=40M,uuid=${uuid_gpt_misc}; 21 - name=mnv,size=20M,uuid=${uuid_gpt_mnv}; 22 - name=frp,size=512K,uuid=${uuid_gpt_frp}; 23 - name=vbmeta,size=64K,uuid=${uuid_gpt_vbmeta}; 24 - name=metadata,size=16M,uuid=${uuid_gpt_metadata}; 25 - name=dtb,size=1M,uuid=${uuid_gpt_dtb}; 26 - name=userdata,size=-,uuid=${uuid_gpt_userdata} 1 + kernel_addr_r=0x80000000 2 + kernel_comp_addr_r=0x88000000 3 + kernel_comp_size=0x4000000 4 + fdt_addr_r=0x8c000000 5 + scriptaddr=0x8c100000 6 + pxefile_addr_r=0x8c200000 7 + ramdisk_addr_r=0x8c300000 8 + fdtfile=CONFIG_DEFAULT_FDT_FILE 9 + 10 + partitions=name=esp,start=512K,size=128M,bootable,type=system; 11 + partitions+=name=rootfs,size=-,bootable,type=linux
+38 -7
board/samsung/e850-96/fw.c
··· 7 7 */ 8 8 9 9 #include <part.h> 10 + #include <fs.h> 10 11 #include <linux/arm-smccc.h> 11 12 #include "fw.h" 12 13 13 14 #define EMMC_IFACE "mmc" 14 15 #define EMMC_DEV_NUM 0 16 + #define LDFW_RAW_PART "ldfw" 17 + #define LDFW_FAT_PART "esp" 18 + #define LDFW_FAT_PATH "/EFI/firmware/ldfw.bin" 15 19 16 - /* LDFW constants */ 17 - #define LDFW_PART_NAME "ldfw" 18 20 #define LDFW_NWD_ADDR 0x88000000 19 21 #define LDFW_MAGIC 0x10adab1e 20 22 #define SMC_CMD_LOAD_LDFW -0x500 ··· 36 38 char fw_name[16]; 37 39 }; 38 40 39 - static int read_fw(const char *part_name, void *buf) 41 + /* Load LDFW binary as a file from FAT partition */ 42 + static int read_fw_from_fat(const char *part_name, const char *path, void *buf) 43 + { 44 + char dev_part_str[8]; 45 + loff_t len_read; 46 + int err; 47 + 48 + snprintf(dev_part_str, sizeof(dev_part_str), "%d#%s", EMMC_DEV_NUM, 49 + LDFW_FAT_PART); 50 + 51 + err = fs_set_blk_dev(EMMC_IFACE, dev_part_str, FS_TYPE_FAT); 52 + if (err) { 53 + debug("%s: Can't set block device\n", __func__); 54 + return -ENODEV; 55 + } 56 + 57 + err = fs_read(path, (ulong)buf, 0, 0, &len_read); 58 + if (err) { 59 + debug("%s: Can't read LDFW file\n", __func__); 60 + return -EIO; 61 + } 62 + 63 + return 0; 64 + } 65 + 66 + /* Load LDFW binary from raw partition on block device into RAM buffer */ 67 + static int read_fw_from_raw(const char *part_name, void *buf) 40 68 { 41 69 struct blk_desc *blk_desc; 42 70 struct disk_partition part; ··· 73 101 u64 size = 0; 74 102 int err, i; 75 103 76 - /* Load LDFW from the block device partition into RAM buffer */ 77 - err = read_fw(LDFW_PART_NAME, buf); 78 - if (err) 79 - return err; 104 + /* First try to read LDFW from EFI partition, then from the raw one */ 105 + err = read_fw_from_fat(LDFW_FAT_PART, LDFW_FAT_PATH, buf); 106 + if (err) { 107 + err = read_fw_from_raw(LDFW_RAW_PART, buf); 108 + if (err) 109 + return err; 110 + } 80 111 81 112 /* Validate LDFW by magic number in its header */ 82 113 hdr = buf;
+20 -3
configs/e850-96_defconfig
··· 8 8 CONFIG_ARCH_EXYNOS9=y 9 9 CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y 10 10 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xf8c00000 11 + CONFIG_ENV_SIZE=0x10000 12 + CONFIG_ENV_OFFSET=0x0 11 13 CONFIG_DEFAULT_DEVICE_TREE="exynos/exynos850-e850-96" 12 14 CONFIG_SYS_LOAD_ADDR=0x80000000 15 + CONFIG_ENV_OFFSET_REDUND=0x10000 13 16 # CONFIG_PSCI_RESET is not set 17 + CONFIG_EFI_SET_TIME=y 14 18 CONFIG_ANDROID_BOOT_IMAGE=y 15 - # CONFIG_AUTOBOOT is not set 19 + CONFIG_BOOTSTD_FULL=y 20 + CONFIG_DEFAULT_FDT_FILE="exynos850-e850-96.dtb" 16 21 # CONFIG_DISPLAY_CPUINFO is not set 17 - CONFIG_HUSH_PARSER=y 22 + CONFIG_CMD_BOOTEFI_SELFTEST=y 18 23 CONFIG_CMD_ABOOTIMG=y 24 + CONFIG_CMD_NVEDIT_EFI=y 19 25 CONFIG_CMD_CLK=y 20 26 CONFIG_CMD_GPT=y 21 27 CONFIG_CMD_MMC=y 22 - CONFIG_CMD_PART=y 28 + CONFIG_CMD_EFIDEBUG=y 29 + # CONFIG_CMD_DATE is not set 30 + CONFIG_CMD_RTC=y 23 31 CONFIG_CMD_TIME=y 24 32 CONFIG_CMD_RNG=y 33 + CONFIG_PARTITION_TYPE_GUID=y 34 + CONFIG_ENV_OVERWRITE=y 35 + CONFIG_ENV_IS_IN_MMC=y 36 + CONFIG_SYS_REDUNDAND_ENVIRONMENT=y 37 + CONFIG_SYS_RELOC_GD_ENV_ADDR=y 38 + CONFIG_SYS_MMC_ENV_PART=2 25 39 CONFIG_NO_NET=y 26 40 CONFIG_CLK_EXYNOS850=y 41 + CONFIG_SUPPORT_EMMC_BOOT=y 27 42 CONFIG_MMC_DW=y 43 + CONFIG_DM_RTC=y 44 + CONFIG_RTC_EMULATION=y 28 45 CONFIG_SOC_SAMSUNG=y 29 46 CONFIG_EXYNOS_PMU=y 30 47 CONFIG_EXYNOS_USI=y