Merge branch 'next-dev' into thunder-boot

This commit is contained in:
Joseph Chen 2020-04-27 16:54:06 +08:00
commit e9e0746f31
12 changed files with 43 additions and 34 deletions

View File

@ -16,12 +16,6 @@
chosen {
stdout-path = &uart2;
};
ramdisk-ro {
u-boot,dm-pre-reloc;
compatible = "ramdisk-ro";
status = "okay";
};
};
&dmc {

View File

@ -122,18 +122,6 @@ static int get_partition_unique_uuid(char *partition,
return 0;
}
static void reset_cpu_if_android_ab(void)
{
printf("Reset in AB system.\n");
flushc();
/*
* Since we use the retry-count in ab system, then can
* try reboot if verify fail until the retry-count is
* equal to zero.
*/
reset_cpu(0);
}
static void update_root_uuid_if_android_ab(void)
{
/*
@ -226,11 +214,26 @@ static int decrease_tries_if_android_ab(char *slot_suffix)
return 0;
}
#else
static inline void reset_cpu_if_android_ab(void) {}
static inline void update_root_uuid_if_android_ab(void) {}
static inline int decrease_tries_if_android_ab(char *slot_suffix) { return 0; }
#endif
#if defined(CONFIG_ANDROID_AB) && defined(CONFIG_ANDROID_AVB)
static void reset_cpu_if_android_ab(void)
{
printf("Reset in AB system.\n");
flushc();
/*
* Since we use the retry-count in ab system, then can
* try reboot if verify fail until the retry-count is
* equal to zero.
*/
reset_cpu(0);
}
#else
static inline void reset_cpu_if_android_ab(void) {}
#endif
int android_bootloader_message_load(
struct blk_desc *dev_desc,
const disk_partition_t *part_info,

View File

@ -800,7 +800,7 @@ config SPL_OPTEE
config SPL_AB
bool "Support AB system boot"
depends on SPL
depends on SPL && SPL_EFI_PARTITION
help
Enable this config to support AB system boot.

View File

@ -688,11 +688,11 @@ int part_get_info_by_name(struct blk_desc *dev_desc, const char *name,
part_drv = part_driver_lookup_type(dev_desc);
if (!part_drv)
return -1;
#ifndef CONFIG_SPL_BUILD
/* 1. Query partition with A/B slot suffix */
if (rk_avb_append_part_slot(name, name_slot))
return -1;
#endif
retry:
debug("## Query partition(%d): %s\n", none_slot_try, name_slot);

View File

@ -29,7 +29,8 @@ int nanddev_bbt_init(struct nand_device *nand)
unsigned int nwords = DIV_ROUND_UP(nblocks * bits_per_block,
BITS_PER_LONG);
nand->bbt.cache = kzalloc(nwords, GFP_KERNEL);
nand->bbt.cache = kcalloc(nwords, sizeof(*nand->bbt.cache),
GFP_KERNEL);
if (!nand->bbt.cache)
return -ENOMEM;

View File

@ -43,7 +43,7 @@ config DM_RAMDISK
config RAMDISK_RO
bool "Enable read only ramdisk support"
depends on DM_RAMDISK
depends on DM_RAMDISK && RKPARM_PARTITION
help
This enables the read only ramdisk support.

View File

@ -10,5 +10,8 @@ obj-$(CONFIG_STM32_SDRAM) += stm32_sdram.o
obj-$(CONFIG_ARCH_BMIPS) += bmips_ram.o
obj-$(CONFIG_ARCH_ROCKCHIP) += rockchip/
ifndef CONFIG_SPL_BUILD
obj-$(CONFIG_DM_RAMDISK) += ramdisk-uclass.o
obj-$(CONFIG_RAMDISK_RO) += ramdisk_ro.o
endif

View File

@ -63,3 +63,7 @@ U_BOOT_DRIVER(ramdisk_ro) = {
.of_match = ramdisk_ro_ids,
.bind = ramdisk_ro_bind,
};
U_BOOT_DEVICE(ramdisk_ro) = {
.name = "ramdisk-ro",
};

View File

@ -127,6 +127,7 @@ struct rockchip_sfc {
u32 cmd;
u32 addr;
u8 addr_bits;
u8 addr_xbits_ext;
u8 dummy_bits;
u8 rw;
u32 trb;
@ -264,6 +265,9 @@ static void rockchip_sfc_setup_xfer(struct rockchip_sfc *sfc, u32 trb)
sfc->addr_bits == SFC_ADDR_32BITS)
data_width = rockchip_sfc_get_if_type(sfc);
if (sfc->addr_bits & SFC_ADDR_XBITS)
writel(sfc->addr_xbits_ext - 1, &regs->abit);
val |= (data_width << SFC_DATA_WIDTH_SHIFT);
rockchip_sfc_wait_idle(sfc, 10);
@ -524,11 +528,13 @@ static int rockchip_sfc_xfer(struct udevice *dev, unsigned int bitlen,
break;
case 3: /* Nand prog, */
sfc->addr_bits = SFC_ADDR_XBITS;
sfc->addr_xbits_ext = 16;
sfc->dummy_bits = 0;
sfc->addr = pcmd[2] | pcmd[1] << 8;
break;
case 2: /* Nand read/write feature */
sfc->addr_bits = SFC_ADDR_XBITS;
sfc->addr_xbits_ext = 8;
sfc->dummy_bits = 0;
sfc->addr = pcmd[1];
break;

View File

@ -54,13 +54,6 @@
#include <config_distro_bootcmd.h>
#ifdef CONFIG_DM_RAMDISK
#undef RKIMG_DET_BOOTDEV
#define RKIMG_DET_BOOTDEV \
"rkimg_bootdev=" \
"setenv devtype ramdisk; setenv devnum 0; \0"
#endif
#define CONFIG_EXTRA_ENV_SETTINGS \
ENV_MEM_LAYOUT_SETTINGS \
"partitions=" PARTS_DEFAULT \

View File

@ -113,6 +113,11 @@
"name=security,size=2M,uuid=${uuid_gpt_security};" \
"name=userdata,size=-,uuid=${uuid_gpt_userdata};\0"
#ifdef CONFIG_DM_RAMDISK
#define RKIMG_DET_BOOTDEV \
"rkimg_bootdev=" \
"setenv devtype ramdisk; setenv devnum 0; \0"
#else
#define RKIMG_DET_BOOTDEV \
"rkimg_bootdev=" \
"if mmc dev 1 && rkimgtest mmc 1; then " \
@ -132,6 +137,7 @@
"elif rksfc dev 1; then " \
"setenv devtype spinor; setenv devnum 1;" \
"fi; \0"
#endif
#if defined(CONFIG_AVB_VBMETA_PUBLIC_KEY_VALIDATE)
#define RKIMG_BOOTCOMMAND \

View File

@ -324,9 +324,8 @@ static inline unsigned int nanddev_ntargets(const struct nand_device *nand)
*/
static inline unsigned int nanddev_neraseblocks(const struct nand_device *nand)
{
return (u64)nand->memorg.luns_per_target *
nand->memorg.eraseblocks_per_lun *
nand->memorg.pages_per_eraseblock;
return nand->memorg.ntargets * nand->memorg.luns_per_target *
nand->memorg.eraseblocks_per_lun;
}
/**