From: Simon Glass <sjg@chromium.org>
To: U-Boot Mailing List <u-boot@lists.denx.de>
Cc: Anatolij Gustschin <agust@denx.de>, Simon Glass <sjg@chromium.org>
Subject: [PATCH 16/39] video: atmel: Drop pre-DM parts of video driver
Date: Wed, 19 Oct 2022 05:23:33 -0600 [thread overview]
Message-ID: <20221019112356.1042065-17-sjg@chromium.org> (raw)
In-Reply-To: <20221019112356.1042065-1-sjg@chromium.org>
This relies on the old LCD implementation which is to be removed. Drop it.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
drivers/video/Kconfig | 3 +-
drivers/video/atmel_hlcdfb.c | 213 -----------------------------------
drivers/video/atmel_lcdfb.c | 75 ------------
3 files changed, 2 insertions(+), 289 deletions(-)
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 033e6e94280..5379b75affd 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -423,7 +423,7 @@ config VIDEO_LCD_ANX9804
config ATMEL_LCD
bool "Atmel LCD panel support"
- depends on LCD && ARCH_AT91
+ depends on DM_VIDEO && ARCH_AT91
config ATMEL_LCD_BGR555
bool "Display in BGR555 mode"
@@ -578,6 +578,7 @@ config NXP_TDA19988
config ATMEL_HLCD
bool "Enable ATMEL video support using HLCDC"
+ depends on DM_VIDEO
help
HLCDC supports video output to an attached LCD panel.
diff --git a/drivers/video/atmel_hlcdfb.c b/drivers/video/atmel_hlcdfb.c
index caf65741f2e..6e6704c141e 100644
--- a/drivers/video/atmel_hlcdfb.c
+++ b/drivers/video/atmel_hlcdfb.c
@@ -25,217 +25,6 @@
DECLARE_GLOBAL_DATA_PTR;
-#ifndef CONFIG_DM_VIDEO
-
-/* configurable parameters */
-#define ATMEL_LCDC_CVAL_DEFAULT 0xc8
-#define ATMEL_LCDC_DMA_BURST_LEN 8
-#ifndef ATMEL_LCDC_GUARD_TIME
-#define ATMEL_LCDC_GUARD_TIME 1
-#endif
-
-#define ATMEL_LCDC_FIFO_SIZE 512
-
-/*
- * the CLUT register map as following
- * RCLUT(24 ~ 16), GCLUT(15 ~ 8), BCLUT(7 ~ 0)
- */
-void lcd_setcolreg(ushort regno, ushort red, ushort green, ushort blue)
-{
- writel(panel_info.mmio + ATMEL_LCDC_LUT(regno),
- ((red << LCDC_BASECLUT_RCLUT_Pos) & LCDC_BASECLUT_RCLUT_Msk)
- | ((green << LCDC_BASECLUT_GCLUT_Pos) & LCDC_BASECLUT_GCLUT_Msk)
- | ((blue << LCDC_BASECLUT_BCLUT_Pos) & LCDC_BASECLUT_BCLUT_Msk));
-}
-
-void lcd_ctrl_init(void *lcdbase)
-{
- unsigned long value;
- struct lcd_dma_desc *desc;
- struct atmel_hlcd_regs *regs;
- int ret;
-
- if (!has_lcdc())
- return; /* No lcdc */
-
- regs = (struct atmel_hlcd_regs *)panel_info.mmio;
-
- /* Disable DISP signal */
- writel(LCDC_LCDDIS_DISPDIS, ®s->lcdc_lcddis);
- ret = wait_for_bit_le32(®s->lcdc_lcdsr, LCDC_LCDSR_DISPSTS,
- false, 1000, false);
- if (ret)
- printf("%s: %d: Timeout!\n", __func__, __LINE__);
- /* Disable synchronization */
- writel(LCDC_LCDDIS_SYNCDIS, ®s->lcdc_lcddis);
- ret = wait_for_bit_le32(®s->lcdc_lcdsr, LCDC_LCDSR_LCDSTS,
- false, 1000, false);
- if (ret)
- printf("%s: %d: Timeout!\n", __func__, __LINE__);
- /* Disable pixel clock */
- writel(LCDC_LCDDIS_CLKDIS, ®s->lcdc_lcddis);
- ret = wait_for_bit_le32(®s->lcdc_lcdsr, LCDC_LCDSR_CLKSTS,
- false, 1000, false);
- if (ret)
- printf("%s: %d: Timeout!\n", __func__, __LINE__);
- /* Disable PWM */
- writel(LCDC_LCDDIS_PWMDIS, ®s->lcdc_lcddis);
- ret = wait_for_bit_le32(®s->lcdc_lcdsr, LCDC_LCDSR_PWMSTS,
- false, 1000, false);
- if (ret)
- printf("%s: %d: Timeout!\n", __func__, __LINE__);
-
- /* Set pixel clock */
- value = get_lcdc_clk_rate(0) / panel_info.vl_clk;
- if (get_lcdc_clk_rate(0) % panel_info.vl_clk)
- value++;
-
- if (value < 1) {
- /* Using system clock as pixel clock */
- writel(LCDC_LCDCFG0_CLKDIV(0)
- | LCDC_LCDCFG0_CGDISHCR
- | LCDC_LCDCFG0_CGDISHEO
- | LCDC_LCDCFG0_CGDISOVR1
- | LCDC_LCDCFG0_CGDISBASE
- | panel_info.vl_clk_pol
- | LCDC_LCDCFG0_CLKSEL,
- ®s->lcdc_lcdcfg0);
-
- } else {
- writel(LCDC_LCDCFG0_CLKDIV(value - 2)
- | LCDC_LCDCFG0_CGDISHCR
- | LCDC_LCDCFG0_CGDISHEO
- | LCDC_LCDCFG0_CGDISOVR1
- | LCDC_LCDCFG0_CGDISBASE
- | panel_info.vl_clk_pol,
- ®s->lcdc_lcdcfg0);
- }
-
- /* Initialize control register 5 */
- value = 0;
-
- value |= panel_info.vl_sync;
-
-#ifndef LCD_OUTPUT_BPP
- /* Output is 24bpp */
- value |= LCDC_LCDCFG5_MODE_OUTPUT_24BPP;
-#else
- switch (LCD_OUTPUT_BPP) {
- case 12:
- value |= LCDC_LCDCFG5_MODE_OUTPUT_12BPP;
- break;
- case 16:
- value |= LCDC_LCDCFG5_MODE_OUTPUT_16BPP;
- break;
- case 18:
- value |= LCDC_LCDCFG5_MODE_OUTPUT_18BPP;
- break;
- case 24:
- value |= LCDC_LCDCFG5_MODE_OUTPUT_24BPP;
- break;
- default:
- BUG();
- break;
- }
-#endif
-
- value |= LCDC_LCDCFG5_GUARDTIME(ATMEL_LCDC_GUARD_TIME);
- value |= (LCDC_LCDCFG5_DISPDLY | LCDC_LCDCFG5_VSPDLYS);
- writel(value, ®s->lcdc_lcdcfg5);
-
- /* Vertical & Horizontal Timing */
- value = LCDC_LCDCFG1_VSPW(panel_info.vl_vsync_len - 1);
- value |= LCDC_LCDCFG1_HSPW(panel_info.vl_hsync_len - 1);
- writel(value, ®s->lcdc_lcdcfg1);
-
- value = LCDC_LCDCFG2_VBPW(panel_info.vl_upper_margin);
- value |= LCDC_LCDCFG2_VFPW(panel_info.vl_lower_margin - 1);
- writel(value, ®s->lcdc_lcdcfg2);
-
- value = LCDC_LCDCFG3_HBPW(panel_info.vl_left_margin - 1);
- value |= LCDC_LCDCFG3_HFPW(panel_info.vl_right_margin - 1);
- writel(value, ®s->lcdc_lcdcfg3);
-
- /* Display size */
- value = LCDC_LCDCFG4_RPF(panel_info.vl_row - 1);
- value |= LCDC_LCDCFG4_PPL(panel_info.vl_col - 1);
- writel(value, ®s->lcdc_lcdcfg4);
-
- writel(LCDC_BASECFG0_BLEN_AHB_INCR4 | LCDC_BASECFG0_DLBO,
- ®s->lcdc_basecfg0);
-
- switch (NBITS(panel_info.vl_bpix)) {
- case 16:
- writel(LCDC_BASECFG1_RGBMODE_16BPP_RGB_565,
- ®s->lcdc_basecfg1);
- break;
- case 32:
- writel(LCDC_BASECFG1_RGBMODE_24BPP_RGB_888,
- ®s->lcdc_basecfg1);
- break;
- default:
- BUG();
- break;
- }
-
- writel(LCDC_BASECFG2_XSTRIDE(0), ®s->lcdc_basecfg2);
- writel(0, ®s->lcdc_basecfg3);
- writel(LCDC_BASECFG4_DMA, ®s->lcdc_basecfg4);
-
- /* Disable all interrupts */
- writel(~0UL, ®s->lcdc_lcdidr);
- writel(~0UL, ®s->lcdc_baseidr);
-
- /* Setup the DMA descriptor, this descriptor will loop to itself */
- desc = (struct lcd_dma_desc *)(lcdbase - 16);
-
- desc->address = (u32)lcdbase;
- /* Disable DMA transfer interrupt & descriptor loaded interrupt. */
- desc->control = LCDC_BASECTRL_ADDIEN | LCDC_BASECTRL_DSCRIEN
- | LCDC_BASECTRL_DMAIEN | LCDC_BASECTRL_DFETCH;
- desc->next = (u32)desc;
-
- /* Flush the DMA descriptor if we enabled dcache */
- flush_dcache_range((u32)desc, (u32)desc + sizeof(*desc));
-
- writel(desc->address, ®s->lcdc_baseaddr);
- writel(desc->control, ®s->lcdc_basectrl);
- writel(desc->next, ®s->lcdc_basenext);
- writel(LCDC_BASECHER_CHEN | LCDC_BASECHER_UPDATEEN,
- ®s->lcdc_basecher);
-
- /* Enable LCD */
- value = readl(®s->lcdc_lcden);
- writel(value | LCDC_LCDEN_CLKEN, ®s->lcdc_lcden);
- ret = wait_for_bit_le32(®s->lcdc_lcdsr, LCDC_LCDSR_CLKSTS,
- true, 1000, false);
- if (ret)
- printf("%s: %d: Timeout!\n", __func__, __LINE__);
- value = readl(®s->lcdc_lcden);
- writel(value | LCDC_LCDEN_SYNCEN, ®s->lcdc_lcden);
- ret = wait_for_bit_le32(®s->lcdc_lcdsr, LCDC_LCDSR_LCDSTS,
- true, 1000, false);
- if (ret)
- printf("%s: %d: Timeout!\n", __func__, __LINE__);
- value = readl(®s->lcdc_lcden);
- writel(value | LCDC_LCDEN_DISPEN, ®s->lcdc_lcden);
- ret = wait_for_bit_le32(®s->lcdc_lcdsr, LCDC_LCDSR_DISPSTS,
- true, 1000, false);
- if (ret)
- printf("%s: %d: Timeout!\n", __func__, __LINE__);
- value = readl(®s->lcdc_lcden);
- writel(value | LCDC_LCDEN_PWMEN, ®s->lcdc_lcden);
- ret = wait_for_bit_le32(®s->lcdc_lcdsr, LCDC_LCDSR_PWMSTS,
- true, 1000, false);
- if (ret)
- printf("%s: %d: Timeout!\n", __func__, __LINE__);
-
- /* Enable flushing if we enabled dcache */
- lcd_set_flush_dcache(1);
-}
-
-#else
-
enum {
LCD_MAX_WIDTH = 1024,
LCD_MAX_HEIGHT = 768,
@@ -552,5 +341,3 @@ U_BOOT_DRIVER(atmel_hlcdfb) = {
.of_to_plat = atmel_hlcdc_of_to_plat,
.priv_auto = sizeof(struct atmel_hlcdc_priv),
};
-
-#endif
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index 7ac3c7cff4a..f0db193ede7 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -23,14 +23,12 @@
DECLARE_GLOBAL_DATA_PTR;
-#ifdef CONFIG_DM_VIDEO
enum {
/* Maximum LCD size we support */
LCD_MAX_WIDTH = 1366,
LCD_MAX_HEIGHT = 768,
LCD_MAX_LOG2_BPP = VIDEO_BPP16,
};
-#endif
struct atmel_fb_priv {
struct display_timing timing;
@@ -52,43 +50,6 @@ struct atmel_fb_priv {
#define lcdc_readl(mmio, reg) __raw_readl((mmio)+(reg))
#define lcdc_writel(mmio, reg, val) __raw_writel((val), (mmio)+(reg))
-#ifndef CONFIG_DM_VIDEO
-ushort *configuration_get_cmap(void)
-{
- return (ushort *)(panel_info.mmio + ATMEL_LCDC_LUT(0));
-}
-
-#if defined(CONFIG_BMP_16BPP) && defined(CONFIG_ATMEL_LCD_BGR555)
-void fb_put_word(uchar **fb, uchar **from)
-{
- *(*fb)++ = (((*from)[0] & 0x1f) << 2) | ((*from)[1] & 0x03);
- *(*fb)++ = ((*from)[0] & 0xe0) | (((*from)[1] & 0x7c) >> 2);
- *from += 2;
-}
-#endif
-
-void lcd_setcolreg(ushort regno, ushort red, ushort green, ushort blue)
-{
-#if defined(CONFIG_ATMEL_LCD_BGR555)
- lcdc_writel(panel_info.mmio, ATMEL_LCDC_LUT(regno),
- (red >> 3) | ((green & 0xf8) << 2) | ((blue & 0xf8) << 7));
-#else
- lcdc_writel(panel_info.mmio, ATMEL_LCDC_LUT(regno),
- (blue >> 3) | ((green & 0xfc) << 3) | ((red & 0xf8) << 8));
-#endif
-}
-
-void lcd_set_cmap(struct bmp_image *bmp, unsigned colors)
-{
- int i;
-
- for (i = 0; i < colors; ++i) {
- struct bmp_color_table_entry cte = bmp->color_table[i];
- lcd_setcolreg(i, cte.red, cte.green, cte.blue);
- }
-}
-#endif
-
static void atmel_fb_init(ulong addr, struct display_timing *timing, int bpix,
bool tft, bool cont_pol_low, ulong lcdbase)
{
@@ -183,41 +144,6 @@ static void atmel_fb_init(ulong addr, struct display_timing *timing, int bpix,
(ATMEL_LCDC_GUARD_TIME << ATMEL_LCDC_GUARDT_OFFSET) | ATMEL_LCDC_PWR);
}
-#ifndef CONFIG_DM_VIDEO
-void lcd_ctrl_init(void *lcdbase)
-{
- struct display_timing timing;
-
- timing.flags = 0;
- if (!(panel_info.vl_sync & ATMEL_LCDC_INVLINE_INVERTED))
- timing.flags |= DISPLAY_FLAGS_HSYNC_HIGH;
- if (!(panel_info.vl_sync & ATMEL_LCDC_INVFRAME_INVERTED))
- timing.flags |= DISPLAY_FLAGS_VSYNC_LOW;
- timing.pixelclock.typ = panel_info.vl_clk;
-
- timing.hactive.typ = panel_info.vl_col;
- timing.hfront_porch.typ = panel_info.vl_right_margin;
- timing.hback_porch.typ = panel_info.vl_left_margin;
- timing.hsync_len.typ = panel_info.vl_hsync_len;
-
- timing.vactive.typ = panel_info.vl_row;
- timing.vfront_porch.typ = panel_info.vl_clk;
- timing.vback_porch.typ = panel_info.vl_clk;
- timing.vsync_len.typ = panel_info.vl_clk;
-
- atmel_fb_init(panel_info.mmio, &timing, panel_info.vl_bpix,
- panel_info.vl_tft, panel_info.vl_cont_pol_low,
- (ulong)lcdbase);
-}
-
-ulong calc_fbsize(void)
-{
- return ((panel_info.vl_col * panel_info.vl_row *
- NBITS(panel_info.vl_bpix)) / 8) + PAGE_SIZE;
-}
-#endif
-
-#ifdef CONFIG_DM_VIDEO
static int atmel_fb_lcd_probe(struct udevice *dev)
{
struct video_uc_plat *uc_plat = dev_get_uclass_plat(dev);
@@ -284,4 +210,3 @@ U_BOOT_DRIVER(atmel_fb) = {
.plat_auto = sizeof(struct atmel_lcd_plat),
.priv_auto = sizeof(struct atmel_fb_priv),
};
-#endif
--
2.38.0.413.g74048e4d9e-goog
next prev parent reply other threads:[~2022-10-19 11:29 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-19 11:23 [PATCH 00/39] lcd: Drop old LCD support Simon Glass
2022-10-19 11:23 ` [PATCH 01/39] video: Split SPLASH_SCREEN_ALIGN from bmp command Simon Glass
2022-10-19 11:23 ` [PATCH 02/39] Convert CONFIG_HIDE_LOGO_VERSION to Kconfig Simon Glass
2022-10-19 11:23 ` [PATCH 03/39] video: Rename CONFIG_SYS_VIDEO_LOGO_MAX_SIZE Simon Glass
2022-10-19 11:23 ` [PATCH 04/39] Convert CONFIG_VIDEO_LOGO_MAX_SIZE to Kconfig Simon Glass
2022-10-19 11:23 ` [PATCH 05/39] video: lcd: Drop console rotation Simon Glass
2022-10-19 11:23 ` [PATCH 06/39] video: Drop CONFIG_LCD_ALIGNMENT Simon Glass
2022-10-19 11:23 ` [PATCH 07/39] video: Drop CONFIG_LCD_MENU Simon Glass
2022-10-19 11:23 ` [PATCH 08/39] video: Drop CONFIG_LCD_INFO_BELOW_LOGO Simon Glass
2022-10-19 11:23 ` [PATCH 09/39] video: Drop CONFIG_LCD_INFO Simon Glass
2022-10-19 11:23 ` [PATCH 10/39] video: Move bmp_display() prototype to video.h Simon Glass
2022-10-19 11:23 ` [PATCH 11/39] api: Drop LCD implementation Simon Glass
2022-10-19 11:23 ` [PATCH 13/39] video: Drop VCXK video controller Simon Glass
2022-10-19 11:23 ` [PATCH 14/39] BuR: Drop old LCD code Simon Glass
2022-10-19 11:23 ` Simon Glass [this message]
2022-10-19 11:23 ` [PATCH 17/39] video: Drop ld9040 driver Simon Glass
2022-10-19 11:23 ` [PATCH 19/39] treewide: Stop enabling CONFIG_LCD Simon Glass
2022-10-19 11:23 ` [PATCH 20/39] video: Drop atmel LCD code Simon Glass
2022-10-19 11:23 ` [PATCH 21/39] video: samsung: Drop old " Simon Glass
2022-10-19 11:23 ` [PATCH 23/39] compulab: " Simon Glass
2022-10-19 11:23 ` [PATCH 24/39] tegra: " Simon Glass
2022-10-19 11:23 ` [PATCH 25/39] BuR: ronetix: siemens: " Simon Glass
2022-10-19 11:23 ` [PATCH 26/39] video: cmd: " Simon Glass
2022-10-19 11:23 ` [PATCH 27/39] efi: " Simon Glass
2022-10-19 11:23 ` [PATCH 28/39] video: Drop remaining references to CONFIG_LCD Simon Glass
2022-10-19 11:23 ` [PATCH 29/39] fdt: Drop support for LCD fixup in simplefb Simon Glass
2022-10-19 11:23 ` [PATCH 30/39] video: Drop LCD_BPP Simon Glass
2022-10-19 11:23 ` [PATCH 31/39] video: Drop CONFIG_VIDEO Simon Glass
2022-10-19 11:23 ` [PATCH 32/39] " Simon Glass
2022-10-19 11:23 ` [PATCH 33/39] video: Drop CONFIG_LCD Simon Glass
2022-10-19 11:23 ` [PATCH 34/39] video: Drop use of the lcd header file Simon Glass
2022-10-19 11:23 ` [PATCH 35/39] video: Drop common LCD implementation Simon Glass
2022-10-19 11:23 ` [PATCH 36/39] video: Drop SPLASHIMAGE_CALLBACK Simon Glass
2022-10-19 11:23 ` [PATCH 37/39] video: Make all video options depend on DM_VIDEO Simon Glass
2022-10-19 11:23 ` [PATCH 38/39] pci: Drop test for DM_VIDEO Simon Glass
2022-10-19 11:23 ` [PATCH 39/39] video: Rename CONFIG_DM_VIDEO to CONFIG_VIDEO Simon Glass
2022-10-19 17:06 ` [PATCH 00/39] lcd: Drop old LCD support Tim Harvey
2022-10-19 17:52 ` Simon Glass
2022-10-25 21:48 ` Tim Harvey
2022-10-31 13:47 ` Anatolij Gustschin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221019112356.1042065-17-sjg@chromium.org \
--to=sjg@chromium.org \
--cc=agust@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.