From af7c33c103450e06aecf8adba8cbc8c522295be1 Mon Sep 17 00:00:00 2001 From: Bryan Brattlof Date: Mon, 17 Jul 2023 17:15:26 -0500 Subject: ram: k3-ddrss: do not touch ctrl regs during training During LPDDR initialization we will loop through a series of frequency changes in order to train at the various operating frequencies. During this training, accessing the DRAM_CLASS bitfield could happen during a frequency change and cause the read to hang. Store the DRAM type into the main structure to avoid multiple readings while the independent phy is training. Signed-off-by: Bryan Brattlof --- drivers/ram/k3-ddrss/k3-ddrss.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'drivers') diff --git a/drivers/ram/k3-ddrss/k3-ddrss.c b/drivers/ram/k3-ddrss/k3-ddrss.c index 7e445d2b737..b54557f02cc 100644 --- a/drivers/ram/k3-ddrss/k3-ddrss.c +++ b/drivers/ram/k3-ddrss/k3-ddrss.c @@ -138,6 +138,7 @@ struct k3_ddrss_desc { u32 ddr_freq1; u32 ddr_freq2; u32 ddr_fhs_cnt; + u32 dram_class; struct udevice *vtt_supply; u32 instance; lpddr4_obj *driverdt; @@ -243,14 +244,11 @@ static void k3_lpddr4_freq_update(struct k3_ddrss_desc *ddrss) static void k3_lpddr4_ack_freq_upd_req(const lpddr4_privatedata *pd) { - u32 dram_class; struct k3_ddrss_desc *ddrss = (struct k3_ddrss_desc *)pd->ddr_instance; debug("--->>> LPDDR4 Initialization is in progress ... <<<---\n"); - dram_class = k3_lpddr4_read_ddr_type(pd); - - switch (dram_class) { + switch (ddrss->dram_class) { case DENALI_CTL_0_DRAM_CLASS_DDR4: break; case DENALI_CTL_0_DRAM_CLASS_LPDDR4: @@ -263,13 +261,12 @@ static void k3_lpddr4_ack_freq_upd_req(const lpddr4_privatedata *pd) static int k3_ddrss_init_freq(struct k3_ddrss_desc *ddrss) { - u32 dram_class; int ret; lpddr4_privatedata *pd = &ddrss->pd; - dram_class = k3_lpddr4_read_ddr_type(pd); + ddrss->dram_class = k3_lpddr4_read_ddr_type(pd); - switch (dram_class) { + switch (ddrss->dram_class) { case DENALI_CTL_0_DRAM_CLASS_DDR4: /* Set to ddr_freq1 from DT for DDR4 */ ret = clk_set_rate(&ddrss->ddr_clk, ddrss->ddr_freq1); -- cgit v1.2.3 From ccd21ee50e41305ec3d35d5dc2b40277102cfd85 Mon Sep 17 00:00:00 2001 From: Nikhil M Jain Date: Tue, 18 Jul 2023 14:27:30 +0530 Subject: include: video: Reserve video using blob Add method to reserve video framebuffer information using blob, received from previous stage. Signed-off-by: Nikhil M Jain Reviewed-by: Simon Glass --- drivers/video/video-uclass.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'drivers') diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c index 95e874b770b..435dab1f195 100644 --- a/drivers/video/video-uclass.c +++ b/drivers/video/video-uclass.c @@ -194,6 +194,17 @@ int video_fill_part(struct udevice *dev, int xstart, int ystart, int xend, return 0; } +int video_reserve_from_bloblist(struct video_handoff *ho) +{ + gd->video_bottom = ho->fb; + gd->fb_base = ho->fb; + gd->video_top = ho->fb + ho->size; + debug("Reserving %luk for video using blob at: %08x\n", + ((unsigned long)ho->size) >> 10, (u32)ho->fb); + + return 0; +} + int video_fill(struct udevice *dev, u32 colour) { struct video_priv *priv = dev_get_uclass_priv(dev); -- cgit v1.2.3 From 5bc610a7d9d1ea1b83aaab7ca54ef847087d7167 Mon Sep 17 00:00:00 2001 From: Nikhil M Jain Date: Tue, 18 Jul 2023 14:27:31 +0530 Subject: common: board_f: Pass frame buffer info from SPL to u-boot U-boot proper can use frame buffer address passed from SPL to reserve the memory area used by framebuffer set in SPL so that splash image set in SPL continues to get displayed while u-boot proper is running. Put the framebuffer address and size in a bloblist to make them available at u-boot proper, if in u-boot proper CONFIG_VIDEO is defined. Signed-off-by: Nikhil M Jain Reviewed-by: Devarsh Thakkar Reviewed-by: Simon Glass --- drivers/video/video-uclass.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'drivers') diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c index 435dab1f195..949595f1bc6 100644 --- a/drivers/video/video-uclass.c +++ b/drivers/video/video-uclass.c @@ -6,12 +6,14 @@ #define LOG_CATEGORY UCLASS_VIDEO #include +#include #include #include #include #include #include #include +#include #include #include #include @@ -139,6 +141,16 @@ int video_reserve(ulong *addrp) debug("Video frame buffers from %lx to %lx\n", gd->video_bottom, gd->video_top); + if (spl_phase() == PHASE_SPL && CONFIG_IS_ENABLED(BLOBLIST)) { + struct video_handoff *ho; + + ho = bloblist_add(BLOBLISTT_U_BOOT_VIDEO, sizeof(*ho), 0); + if (!ho) + return log_msg_ret("blf", -ENOENT); + ho->fb = *addrp; + ho->size = size; + } + return 0; } -- cgit v1.2.3 From 63e73a13e994e5aa960418f02b148d023719021e Mon Sep 17 00:00:00 2001 From: Nikhil M Jain Date: Tue, 18 Jul 2023 14:27:32 +0530 Subject: drivers: video: Kconfig: Add config remove video This is required since user may want to either call the remove method of video driver and reset the display or not call the remove method to continue displaying until next stage. Signed-off-by: Nikhil M Jain Reviewed-by: Devarsh Thakkar Reviewed-by: Tom Rini --- drivers/video/Kconfig | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'drivers') diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index b8147f280c1..b41dc60cec5 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -871,6 +871,12 @@ config IHS_VIDEO_OUT out On-screen Display (OSD) used on gdsys FPGAs to control dynamic textual overlays of the display outputs. +config VIDEO_REMOVE + bool "Remove video driver" + help + Use this option to specify if user wants to call remove method of + video driver in u-boot proper stage. + config SPLASH_SCREEN bool "Show a splash-screen image" help @@ -1094,6 +1100,12 @@ config SPL_SYS_WHITE_ON_BLACK This can be better in low-light situations or to reduce eye strain in some cases. +config SPL_VIDEO_REMOVE + bool "Remove video driver after SPL stage" + help + if this option is enabled video driver will be removed at the end of + SPL stage, beforeloading the next stage. + if SPL_SPLASH_SCREEN config SPL_SPLASH_SCREEN_ALIGN -- cgit v1.2.3