All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wenyou Yang <wenyou.yang@microchip.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 5/5] board: at91sam9x5ek: Convert to CONFIG_DM_VIDEO
Date: Fri, 15 Sep 2017 13:15:19 +0800	[thread overview]
Message-ID: <20170915051519.25327-6-wenyou.yang@microchip.com> (raw)
In-Reply-To: <20170915051519.25327-1-wenyou.yang@microchip.com>

Convert the board to support the video driver model, add the device
tree node, and remove the unnecessary code.

Signed-off-by: Wenyou Yang <wenyou.yang@microchip.com>
---

Changes in v2:
 - Rebase the u-boot/master (5541543f686).
 - Drop the applied patches.
 - Improve the commit log.

 arch/arm/mach-at91/Kconfig               |   1 +
 board/atmel/at91sam9x5ek/at91sam9x5ek.c  | 111 ++-----------------------------
 configs/at91sam9x5ek_dataflash_defconfig |   3 +-
 configs/at91sam9x5ek_mmc_defconfig       |   3 +-
 configs/at91sam9x5ek_nandflash_defconfig |   3 +-
 configs/at91sam9x5ek_spiflash_defconfig  |   3 +-
 include/configs/at91sam9x5ek.h           |  10 ---
 7 files changed, 16 insertions(+), 118 deletions(-)

diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index ebd865ab5b..7e85b69679 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -141,6 +141,7 @@ config TARGET_AT91SAM9X5EK
 	select AT91SAM9X5
 	select SUPPORT_SPL
 	select BOARD_EARLY_INIT_F
+	select BOARD_LATE_INIT
 
 config TARGET_SAMA5D2_PTC
 	bool "SAMA5D2 PTC board"
diff --git a/board/atmel/at91sam9x5ek/at91sam9x5ek.c b/board/atmel/at91sam9x5ek/at91sam9x5ek.c
index be6dd4a6d3..d69831ad15 100644
--- a/board/atmel/at91sam9x5ek/at91sam9x5ek.c
+++ b/board/atmel/at91sam9x5ek/at91sam9x5ek.c
@@ -13,12 +13,6 @@
 #include <asm/arch/clk.h>
 #include <asm/arch/gpio.h>
 #include <debug_uart.h>
-#include <lcd.h>
-#include <atmel_hlcdc.h>
-#ifdef CONFIG_LCD_INFO
-#include <nand.h>
-#include <version.h>
-#endif
 #include <asm/mach-types.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -86,103 +80,15 @@ static void at91sam9x5ek_nand_hw_init(void)
 }
 #endif
 
-#ifdef CONFIG_LCD
-vidinfo_t panel_info = {
-	.vl_col	= 800,
-	.vl_row = 480,
-	.vl_clk = 24000000,
-	.vl_sync = LCDC_LCDCFG5_HSPOL | LCDC_LCDCFG5_VSPOL,
-	.vl_bpix = LCD_BPP,
-	.vl_tft = 1,
-	.vl_clk_pol = 1,
-	.vl_hsync_len = 128,
-	.vl_left_margin = 64,
-	.vl_right_margin = 64,
-	.vl_vsync_len = 2,
-	.vl_upper_margin = 22,
-	.vl_lower_margin = 21,
-	.mmio = ATMEL_BASE_LCDC,
-};
-
-void lcd_enable(void)
-{
-	if (has_lcdc())
-		at91_pio3_set_a_periph(AT91_PIO_PORTC, 29, 1);	/* power up */
-}
-
-void lcd_disable(void)
-{
-	if (has_lcdc())
-		at91_pio3_set_a_periph(AT91_PIO_PORTC, 29, 0);	/* power down */
-}
-
-static void at91sam9x5ek_lcd_hw_init(void)
-{
-	if (has_lcdc()) {
-		at91_pio3_set_a_periph(AT91_PIO_PORTC, 26, 0);	/* LCDPWM */
-		at91_pio3_set_a_periph(AT91_PIO_PORTC, 27, 0);	/* LCDVSYNC */
-		at91_pio3_set_a_periph(AT91_PIO_PORTC, 28, 0);	/* LCDHSYNC */
-		at91_pio3_set_a_periph(AT91_PIO_PORTC, 24, 0);	/* LCDDISP */
-		at91_pio3_set_a_periph(AT91_PIO_PORTC, 29, 0);	/* LCDDEN */
-		at91_pio3_set_a_periph(AT91_PIO_PORTC, 30, 0);	/* LCDPCK */
-
-		at91_pio3_set_a_periph(AT91_PIO_PORTC, 0, 0);	/* LCDD0 */
-		at91_pio3_set_a_periph(AT91_PIO_PORTC, 1, 0);	/* LCDD1 */
-		at91_pio3_set_a_periph(AT91_PIO_PORTC, 2, 0);	/* LCDD2 */
-		at91_pio3_set_a_periph(AT91_PIO_PORTC, 3, 0);	/* LCDD3 */
-		at91_pio3_set_a_periph(AT91_PIO_PORTC, 4, 0);	/* LCDD4 */
-		at91_pio3_set_a_periph(AT91_PIO_PORTC, 5, 0);	/* LCDD5 */
-		at91_pio3_set_a_periph(AT91_PIO_PORTC, 6, 0);	/* LCDD6 */
-		at91_pio3_set_a_periph(AT91_PIO_PORTC, 7, 0);	/* LCDD7 */
-		at91_pio3_set_a_periph(AT91_PIO_PORTC, 8, 0);	/* LCDD8 */
-		at91_pio3_set_a_periph(AT91_PIO_PORTC, 9, 0);	/* LCDD9 */
-		at91_pio3_set_a_periph(AT91_PIO_PORTC, 10, 0);	/* LCDD10 */
-		at91_pio3_set_a_periph(AT91_PIO_PORTC, 11, 0);	/* LCDD11 */
-		at91_pio3_set_a_periph(AT91_PIO_PORTC, 12, 0);	/* LCDD12 */
-		at91_pio3_set_a_periph(AT91_PIO_PORTC, 13, 0);	/* LCDD13 */
-		at91_pio3_set_a_periph(AT91_PIO_PORTC, 14, 0);	/* LCDD14 */
-		at91_pio3_set_a_periph(AT91_PIO_PORTC, 15, 0);	/* LCDD15 */
-		at91_pio3_set_a_periph(AT91_PIO_PORTC, 16, 0);	/* LCDD16 */
-		at91_pio3_set_a_periph(AT91_PIO_PORTC, 17, 0);	/* LCDD17 */
-		at91_pio3_set_a_periph(AT91_PIO_PORTC, 18, 0);	/* LCDD18 */
-		at91_pio3_set_a_periph(AT91_PIO_PORTC, 19, 0);	/* LCDD19 */
-		at91_pio3_set_a_periph(AT91_PIO_PORTC, 20, 0);	/* LCDD20 */
-		at91_pio3_set_a_periph(AT91_PIO_PORTC, 21, 0);	/* LCDD21 */
-		at91_pio3_set_a_periph(AT91_PIO_PORTC, 22, 0);	/* LCDD22 */
-		at91_pio3_set_a_periph(AT91_PIO_PORTC, 23, 0);	/* LCDD23 */
-
-		at91_periph_clk_enable(ATMEL_ID_LCDC);
-	}
-}
-
-#ifdef CONFIG_LCD_INFO
-void lcd_show_board_info(void)
+#ifdef CONFIG_BOARD_LATE_INIT
+int board_late_init(void)
 {
-	ulong dram_size, nand_size;
-	int i;
-	char temp[32];
-
-	if (has_lcdc()) {
-		lcd_printf("%s\n", U_BOOT_VERSION);
-		lcd_printf("(C) 2012 ATMEL Corp\n");
-		lcd_printf("at91support at atmel.com\n");
-		lcd_printf("%s CPU at %s MHz\n",
-			get_cpu_name(),
-			strmhz(temp, get_cpu_clk_rate()));
-
-		dram_size = 0;
-		for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++)
-			dram_size += gd->bd->bi_dram[i].size;
-		nand_size = 0;
-		for (i = 0; i < CONFIG_SYS_MAX_NAND_DEVICE; i++)
-			nand_size += get_nand_dev_by_index(i)->size;
-		lcd_printf("  %ld MB SDRAM, %ld MB NAND\n",
-			dram_size >> 20,
-			nand_size >> 20);
-	}
+#ifdef CONFIG_DM_VIDEO
+	at91_video_show_board_info();
+#endif
+	return 0;
 }
-#endif /* CONFIG_LCD_INFO */
-#endif /* CONFIG_LCD */
+#endif
 
 #ifdef CONFIG_DEBUG_UART_BOARD_INIT
 void board_debug_uart_init(void)
@@ -216,9 +122,6 @@ int board_init(void)
 #if defined(CONFIG_USB_OHCI_NEW) || defined(CONFIG_USB_EHCI_HCD)
 	at91_uhp_hw_init();
 #endif
-#ifdef CONFIG_LCD
-	at91sam9x5ek_lcd_hw_init();
-#endif
 	return 0;
 }
 
diff --git a/configs/at91sam9x5ek_dataflash_defconfig b/configs/at91sam9x5ek_dataflash_defconfig
index 9d61dd8de0..c417eb8c10 100644
--- a/configs/at91sam9x5ek_dataflash_defconfig
+++ b/configs/at91sam9x5ek_dataflash_defconfig
@@ -60,4 +60,5 @@ CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
-CONFIG_LCD=y
+CONFIG_DM_VIDEO=y
+CONFIG_ATMEL_HLCD=y
diff --git a/configs/at91sam9x5ek_mmc_defconfig b/configs/at91sam9x5ek_mmc_defconfig
index 9fa4801480..e0a24a5b48 100644
--- a/configs/at91sam9x5ek_mmc_defconfig
+++ b/configs/at91sam9x5ek_mmc_defconfig
@@ -60,4 +60,5 @@ CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
-CONFIG_LCD=y
+CONFIG_DM_VIDEO=y
+CONFIG_ATMEL_HLCD=y
diff --git a/configs/at91sam9x5ek_nandflash_defconfig b/configs/at91sam9x5ek_nandflash_defconfig
index b28bec7f0b..0e8c07f609 100644
--- a/configs/at91sam9x5ek_nandflash_defconfig
+++ b/configs/at91sam9x5ek_nandflash_defconfig
@@ -60,4 +60,5 @@ CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
-CONFIG_LCD=y
+CONFIG_DM_VIDEO=y
+CONFIG_ATMEL_HLCD=y
diff --git a/configs/at91sam9x5ek_spiflash_defconfig b/configs/at91sam9x5ek_spiflash_defconfig
index 838d8a0ad7..70e96ecc2f 100644
--- a/configs/at91sam9x5ek_spiflash_defconfig
+++ b/configs/at91sam9x5ek_spiflash_defconfig
@@ -60,4 +60,5 @@ CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
-CONFIG_LCD=y
+CONFIG_DM_VIDEO=y
+CONFIG_ATMEL_HLCD=y
diff --git a/include/configs/at91sam9x5ek.h b/include/configs/at91sam9x5ek.h
index 1d4971c59f..9450784521 100644
--- a/include/configs/at91sam9x5ek.h
+++ b/include/configs/at91sam9x5ek.h
@@ -23,16 +23,6 @@
 /* general purpose I/O */
 #define CONFIG_ATMEL_LEGACY		/* required until (g)pio is fixed */
 
-/* LCD */
-#define LCD_BPP			LCD_COLOR16
-#define LCD_OUTPUT_BPP		24
-#define CONFIG_LCD_LOGO
-#define CONFIG_LCD_INFO
-#define CONFIG_LCD_INFO_BELOW_LOGO
-#define CONFIG_ATMEL_HLCD
-#define CONFIG_ATMEL_LCD_RGB565
-
-
 /*
  * BOOTP options
  */
-- 
2.13.0

  parent reply	other threads:[~2017-09-15  5:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-15  5:15 [U-Boot] [PATCH v2 0/5] board: atmel: Convert to support video driver model Wenyou Yang
2017-09-15  5:15 ` [U-Boot] [PATCH v2 1/5] board: sama5d2_xplained: Convert to CONFIG_DM_VIDEO Wenyou Yang
2017-09-17 17:55   ` Simon Glass
2017-09-15  5:15 ` [U-Boot] [PATCH v2 2/5] board: sama5d3xek: " Wenyou Yang
2017-09-17 17:55   ` Simon Glass
2017-09-15  5:15 ` [U-Boot] [PATCH v2 3/5] board: sama5d4ek: " Wenyou Yang
2017-09-17 17:55   ` Simon Glass
2017-09-15  5:15 ` [U-Boot] [PATCH v2 4/5] board: sama5d4_xplained: " Wenyou Yang
2017-09-17 17:55   ` Simon Glass
2017-09-15  5:15 ` Wenyou Yang [this message]
2017-09-17 17:55   ` [U-Boot] [PATCH v2 5/5] board: at91sam9x5ek: " Simon Glass

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=20170915051519.25327-6-wenyou.yang@microchip.com \
    --to=wenyou.yang@microchip.com \
    --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.