diff options
author | Pooja Prajod <a0132412@ti.com> | 2016-08-31 20:23:34 +0530 |
---|---|---|
committer | Buddy Liong <a0270631@ti.com> | 2017-03-03 11:37:49 -0600 |
commit | 0066921435c6d7c1183d7301de8bd5e065d80d1b (patch) | |
tree | ea2aa066f26f800b5859fa23ea0529e72909208f | |
parent | c98472cd4bf87b94f8e578c964bc176bf878ebb9 (diff) | |
download | jacinto6evm-0066921435c6d7c1183d7301de8bd5e065d80d1b.tar.gz |
uboot: Changes for early video usecase
Change-Id: Ib2c51575ec9acf540edacb767d5d6b063ff99ae8
Signed-off-by: Pooja Prajod <a0132412@ti.com>
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
-rw-r--r-- | board/ti/dra7xx/Kconfig | 13 | ||||
-rw-r--r-- | board/ti/dra7xx/lateattach.c | 7 | ||||
-rwxr-xr-x | common/spl/spl.c | 27 | ||||
-rw-r--r-- | common/spl/spl_mmc.c | 27 | ||||
-rw-r--r-- | configs/dra7xx_evm_defconfig | 1 | ||||
-rw-r--r-- | include/configs/dra7xx_evm.h | 2 | ||||
-rw-r--r-- | include/spl.h | 1 |
7 files changed, 78 insertions, 0 deletions
diff --git a/board/ti/dra7xx/Kconfig b/board/ti/dra7xx/Kconfig index 4b6269c8dd..db29c9adb5 100644 --- a/board/ti/dra7xx/Kconfig +++ b/board/ti/dra7xx/Kconfig @@ -58,6 +58,19 @@ config LATE_ATTACH_DMA_POOL endmenu +menu "Early Video" +config EARLY_VIDEO + bool "Enable early video" + depends on LATE_ATTACH + depends on LATE_ATTACH_GPT_PART + default n + help + Enable this flag if you want to load a video and video data from eMMC + to DDR to be used in the early video usecase. This also enables IVAHD + dpll configs from the late attach peripheral config. +endmenu + + source "board/ti/common/Kconfig" endif diff --git a/board/ti/dra7xx/lateattach.c b/board/ti/dra7xx/lateattach.c index 95687668fc..988152aa65 100644 --- a/board/ti/dra7xx/lateattach.c +++ b/board/ti/dra7xx/lateattach.c @@ -1091,6 +1091,13 @@ u32 ipu2_config_peripherals(u32 core_id, struct rproc *cfg) /* enable power domain transitions (sw_wkup mode) */ __raw_writel(0x2, CM_VPE_CLKSTCTRL); +#ifdef CONFIG_EARLY_VIDEO + /* register configuration for locking IVAHD DPLL */ + __raw_writel(0x0000E903, 0x4A0051AC); + __raw_writel(0x00000203, 0x4A0051B0); + __raw_writel(0x00000007, 0x4A0051A0); +#endif + /* Enable IPU module peripherals */ reg = __raw_readl(CM_CAM_VIP1_CLKCTRL); __raw_writel((reg & ~0x00000003)|0x1, CM_CAM_VIP1_CLKCTRL); diff --git a/common/spl/spl.c b/common/spl/spl.c index 7ceb78edfc..2cdb00d380 100755 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -436,6 +436,13 @@ u32 cores_to_boot[] = { IPU2, DSP2 }; static int spl_load_image(u32 boot_device) { +#ifdef CONFIG_EARLY_VIDEO + u32 load_size1 = 0; + char *part1 = "video"; + u32 load_size2 = 0; + char *part2 = "videodata"; +#endif + switch (boot_device) { #ifdef CONFIG_SPL_RAM_DEVICE case BOOT_DEVICE_RAM: @@ -446,6 +453,16 @@ static int spl_load_image(u32 boot_device) case BOOT_DEVICE_MMC2: case BOOT_DEVICE_MMC2_2: #ifdef CONFIG_LATE_ATTACH +#ifdef CONFIG_EARLY_VIDEO + spl_mmc_load_part(part1 , (u32 *)0xA2400000, &load_size1, boot_device); + if (load_size1) { + debug ("Loaded %d of %s partition \n", load_size1, part1); + } + spl_mmc_load_part(part2 , (u32 *)0xA3000000, &load_size2, boot_device); + if (load_size2) { + debug ("Loaded %d of %s partition \n", load_size2, part2); + } +#endif spl_load_cores(boot_device, cores_to_boot, sizeof(cores_to_boot)/sizeof(u32)); #endif @@ -471,6 +488,16 @@ static int spl_load_image(u32 boot_device) case BOOT_DEVICE_SPI: spl_setup_display(); #ifdef CONFIG_LATE_ATTACH +#ifdef CONFIG_EARLY_VIDEO + spl_mmc_load_part(part1 , (u32 *)0xA2400000, &load_size1, boot_device); + if (load_size1) { + debug ("Loaded %d of %s partition \n", load_size1, part1); + } + spl_mmc_load_part(part2 , (u32 *)0xA3000000, &load_size2, boot_device); + if (load_size2) { + debug ("Loaded %d of %s partition \n", load_size2, part2); + } +#endif spl_load_cores(boot_device, cores_to_boot, sizeof(cores_to_boot)/sizeof(u32)); #endif diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c index c6bd1b5893..990ac6bd1a 100644 --- a/common/spl/spl_mmc.c +++ b/common/spl/spl_mmc.c @@ -533,6 +533,33 @@ int spl_mmc_load_image(u32 boot_device) return err; } +u32 spl_mmc_load_part(char *part_name, u32 *load_addr, u32 *load_size, u32 boot_device) +{ + struct mmc *mmc; + s32 err; + disk_partition_t info; + + spl_mmc_init(&mmc, boot_device); + err = part_get_info_efi_by_name(&mmc->block_dev, + part_name, &info); + if (err) { +#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT + printf("cannot find partition: '%s'\n", part_name); +#endif + return 1; + } else { + if (!mmc->block_dev.block_read(&mmc->block_dev, + info.start, + info.size, + (void *)load_addr)) { + printf("error reading from mmc\n"); + return 1; + } + *load_size = info.size*mmc->read_bl_len; + } + return 0; +} + u32 spl_mmc_load_core(u32 core_id, u32 boot_device) { struct rproc *cfg = NULL; diff --git a/configs/dra7xx_evm_defconfig b/configs/dra7xx_evm_defconfig index 128e7b2e76..b0d577df32 100644 --- a/configs/dra7xx_evm_defconfig +++ b/configs/dra7xx_evm_defconfig @@ -72,6 +72,7 @@ CONFIG_DM_I2C=y CONFIG_DM_REGULATOR=y CONFIG_DM_REGULATOR_FIXED=y CONFIG_LATE_ATTACH=y +CONFIG_EARLY_VIDEO=y CONFIG_LATE_ATTACH_GPT_PART=y CONFIG_DM_REGULATOR_GPIO=y CONFIG_DM_REGULATOR_PALMAS=y diff --git a/include/configs/dra7xx_evm.h b/include/configs/dra7xx_evm.h index f68333e812..a4fadd26e6 100644 --- a/include/configs/dra7xx_evm.h +++ b/include/configs/dra7xx_evm.h @@ -69,6 +69,8 @@ "name=ipu2,size=7M,uuid=${uuid_gpt_ipu2};" \ "name=dsp1,size=8M,uuid=${uuid_gpt_dsp1};" \ "name=dsp2,size=1M,uuid=${uuid_gpt_dsp2};" \ + "name=video,size=1M,uuid=${uuid_gpt_video};" \ + "name=videodata,size=5K,uuid=${uuid_gpt_videodata};" \ "name=userdata,size=-,uuid=${uuid_gpt_userdata}" #define DFU_ALT_INFO_MMC \ diff --git a/include/spl.h b/include/spl.h index 0843c83d71..bbea703eb8 100644 --- a/include/spl.h +++ b/include/spl.h @@ -159,6 +159,7 @@ bool spl_was_boot_source(void); */ int spl_dfu_cmd(int usbctrl, char *dfu_alt_info, char *interface, char *devstr); +u32 spl_mmc_load_part(char *part_name, u32 *load_addr, u32 *load_size, u32 boot_device); u32 spl_mmc_load_core(u32 core_id, u32 boot_device); u32 spl_boot_core(u32 core_id); |