diff options
author | Liang Yang <liang.yang@amlogic.com> | 2019-02-22 16:52:24 +0800 |
---|---|---|
committer | Dongjin Kim <tobetter@gmail.com> | 2019-05-16 13:19:38 +0900 |
commit | c9938076dbd4c4ecf8a5c123a82722adbc34d1ed (patch) | |
tree | 87e86addc39e23e5d96533ddd20c12e921f3645e /include | |
parent | b573105a2ddda09b36e877ef6f996a0f95154347 (diff) | |
download | u-boot-odroid-c1-c9938076dbd4c4ecf8a5c123a82722adbc34d1ed.tar.gz |
storage: mmc/nand: support support to read saved ddr parameter [1/1]
PD#SWPL-5550
Problem:
Implement to the function that can read ddr
parameter which saved in reserved area.
Solution:
provide interface.
Verify:
tl1-x301
axg-s400
Change-Id: I68a0a83ac435ad6d4a11e01edc290aedae650941
Signed-off-by: Liang Yang <liang.yang@amlogic.com>
Signed-off-by: Qiang Li <qiang.li@amlogic.com>
Signed-off-by: Liang Yang <liang.yang@amlogic.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/amlogic/aml_mmc.h | 29 | ||||
-rw-r--r-- | include/emmc_partitions.h | 6 |
2 files changed, 31 insertions, 4 deletions
diff --git a/include/amlogic/aml_mmc.h b/include/amlogic/aml_mmc.h index a684866ba5..6edf90bd84 100644 --- a/include/amlogic/aml_mmc.h +++ b/include/amlogic/aml_mmc.h @@ -19,7 +19,6 @@ #include <common.h> - /* bootloader operation */ #define AML_BL_USER (0x1 << 0) #define AML_BL_BOOT0 (0x1 << 1) @@ -27,6 +26,31 @@ #define AML_BL_BOOT (0x6) #define AML_BL_ALL (0x7) +#define VPART_PROPERTY_SIZE sizeof(struct vpart_property) +struct vpart_property { + u32 addr; + u32 size; +}; + +/* + * sizeof(struct storage_emmc_boot_info) is strictly + * smaller than or equal to one sector. we will bind + * it in one sector with u-boot.bin together and + * write into boot loader area. + * @rsv_base_addr : the sector address of reserved area + * @dtb : the sector address and size of dtb property + * @ddr : the sector address and size of ddr property + */ +#define EMMC_BOOT_INFO_SIZE 512 +struct storage_emmc_boot_info { + u32 version; + u32 rsv_base_addr; + struct vpart_property dtb; + struct vpart_property ddr; + u8 reserved[512 - 2 * VPART_PROPERTY_SIZE - 12]; + u32 checksum; +}; + int amlmmc_write_bootloader(int dev, int map, unsigned int size, const void *src); int amlmmc_erase_bootloader(int dev, int map); @@ -56,7 +80,4 @@ int emmc_update_mbr(unsigned char *buffer); /*mmc ext_csd register operation*/ int mmc_get_ext_csd(struct mmc *mmc, u8 *ext_csd); int mmc_set_ext_csd(struct mmc *mmc, u8 index, u8 value); - - - #endif /* __AML_MMC_H__ */ diff --git a/include/emmc_partitions.h b/include/emmc_partitions.h index fe60a3fd5b..72830ebd32 100644 --- a/include/emmc_partitions.h +++ b/include/emmc_partitions.h @@ -99,6 +99,11 @@ #define RANDOM_SIZE (256 * 512) #define RANDOM_BLOCK_SIZE (512) #define RANDOM_PATTERN (0X52414E44) + +#define MMC_DDR_PARAMETER_NAME "ddr-parameter" +#define DDR_PARAMETER_OFFSET (SZ_1M * 8) +#define DDR_PARAMETER_SIZE (4 * 512) + /* * 2 copies dtb were stored in dtb area. * each is 256K. @@ -254,6 +259,7 @@ int mmc_boot_size(char *name, uint64_t* size); struct virtual_partition *aml_get_virtual_partition_by_name(const char *name); bool aml_is_emmc_tsd (struct mmc *mmc); int mmc_device_init (struct mmc *mmc); +ulong _get_inherent_offset(const char *name); #define PARTITION_ELEMENT(na, sz, flags) {.name = na, .size = sz, .mask_flags = flags,} |