mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-28 01:51:33 +00:00
board: sama5d4ek: Convert to CONFIG_DM_VIDEO
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> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
fe32c6d159
commit
4b0467db53
7 changed files with 39 additions and 103 deletions
|
@ -75,6 +75,32 @@
|
||||||
|
|
||||||
ahb {
|
ahb {
|
||||||
apb {
|
apb {
|
||||||
|
hlcdc: hlcdc@f0000000 {
|
||||||
|
atmel,vl-bpix = <4>;
|
||||||
|
atmel,output-mode = <18>;
|
||||||
|
atmel,guard-time = <1>;
|
||||||
|
pinctrl-names = "default";
|
||||||
|
pinctrl-0 = <&pinctrl_lcd_base &pinctrl_lcd_pwm &pinctrl_lcd_rgb666>;
|
||||||
|
status = "okay";
|
||||||
|
u-boot,dm-pre-reloc;
|
||||||
|
|
||||||
|
display-timings {
|
||||||
|
u-boot,dm-pre-reloc;
|
||||||
|
800x480 {
|
||||||
|
clock-frequency = <33260000>;
|
||||||
|
hactive = <800>;
|
||||||
|
vactive = <480>;
|
||||||
|
hsync-len = <5>;
|
||||||
|
hfront-porch = <128>;
|
||||||
|
hback-porch = <0>;
|
||||||
|
vfront-porch = <23>;
|
||||||
|
vback-porch = <22>;
|
||||||
|
vsync-len = <5>;
|
||||||
|
u-boot,dm-pre-reloc;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
adc0: adc@fc034000 {
|
adc0: adc@fc034000 {
|
||||||
pinctrl-names = "default";
|
pinctrl-names = "default";
|
||||||
pinctrl-0 = <
|
pinctrl-0 = <
|
||||||
|
|
|
@ -192,6 +192,7 @@ config TARGET_SAMA5D4EK
|
||||||
select SAMA5D4
|
select SAMA5D4
|
||||||
select SUPPORT_SPL
|
select SUPPORT_SPL
|
||||||
select BOARD_EARLY_INIT_F
|
select BOARD_EARLY_INIT_F
|
||||||
|
select BOARD_LATE_INIT
|
||||||
|
|
||||||
config TARGET_MA5D4EVK
|
config TARGET_MA5D4EVK
|
||||||
bool "Aries MA5D4EVK Evaluation Kit"
|
bool "Aries MA5D4EVK Evaluation Kit"
|
||||||
|
|
|
@ -14,11 +14,7 @@
|
||||||
#include <asm/arch/clk.h>
|
#include <asm/arch/clk.h>
|
||||||
#include <asm/arch/sama5d3_smc.h>
|
#include <asm/arch/sama5d3_smc.h>
|
||||||
#include <asm/arch/sama5d4.h>
|
#include <asm/arch/sama5d4.h>
|
||||||
#include <atmel_hlcdc.h>
|
|
||||||
#include <debug_uart.h>
|
#include <debug_uart.h>
|
||||||
#include <lcd.h>
|
|
||||||
#include <nand.h>
|
|
||||||
#include <version.h>
|
|
||||||
|
|
||||||
DECLARE_GLOBAL_DATA_PTR;
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
|
@ -74,93 +70,15 @@ static void sama5d4ek_usb_hw_init(void)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_LCD
|
#ifdef CONFIG_BOARD_LATE_INIT
|
||||||
vidinfo_t panel_info = {
|
int board_late_init(void)
|
||||||
.vl_col = 800,
|
|
||||||
.vl_row = 480,
|
|
||||||
.vl_clk = 33260000,
|
|
||||||
.vl_bpix = LCD_BPP,
|
|
||||||
.vl_tft = 1,
|
|
||||||
.vl_hsync_len = 5,
|
|
||||||
.vl_left_margin = 128,
|
|
||||||
.vl_right_margin = 0,
|
|
||||||
.vl_vsync_len = 5,
|
|
||||||
.vl_upper_margin = 23,
|
|
||||||
.vl_lower_margin = 22,
|
|
||||||
.mmio = ATMEL_BASE_LCDC,
|
|
||||||
};
|
|
||||||
|
|
||||||
/* No power up/down pin for the LCD pannel */
|
|
||||||
void lcd_enable(void) { /* Empty! */ }
|
|
||||||
void lcd_disable(void) { /* Empty! */ }
|
|
||||||
|
|
||||||
unsigned int has_lcdc(void)
|
|
||||||
{
|
{
|
||||||
return 1;
|
#ifdef CONFIG_DM_VIDEO
|
||||||
}
|
at91_video_show_board_info();
|
||||||
|
|
||||||
static void sama5d4ek_lcd_hw_init(void)
|
|
||||||
{
|
|
||||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 24, 0); /* LCDPWM */
|
|
||||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 25, 0); /* LCDDISP */
|
|
||||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 26, 0); /* LCDVSYNC */
|
|
||||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 27, 0); /* LCDHSYNC */
|
|
||||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 28, 0); /* LCDDOTCK */
|
|
||||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 29, 0); /* LCDDEN */
|
|
||||||
|
|
||||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 2, 0); /* LCDD2 */
|
|
||||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 3, 0); /* LCDD3 */
|
|
||||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 4, 0); /* LCDD4 */
|
|
||||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 5, 0); /* LCDD5 */
|
|
||||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 6, 0); /* LCDD6 */
|
|
||||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 7, 0); /* LCDD7 */
|
|
||||||
|
|
||||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 10, 0); /* LCDD10 */
|
|
||||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 11, 0); /* LCDD11 */
|
|
||||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 12, 0); /* LCDD12 */
|
|
||||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 13, 0); /* LCDD13 */
|
|
||||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 14, 0); /* LCDD14 */
|
|
||||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 15, 0); /* LCDD15 */
|
|
||||||
|
|
||||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 18, 0); /* LCDD18 */
|
|
||||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 19, 0); /* LCDD19 */
|
|
||||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 20, 0); /* LCDD20 */
|
|
||||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 21, 0); /* LCDD21 */
|
|
||||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 22, 0); /* LCDD22 */
|
|
||||||
at91_pio3_set_a_periph(AT91_PIO_PORTA, 23, 0); /* LCDD23 */
|
|
||||||
|
|
||||||
/* Enable clock */
|
|
||||||
at91_periph_clk_enable(ATMEL_ID_LCDC);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef CONFIG_LCD_INFO
|
|
||||||
void lcd_show_board_info(void)
|
|
||||||
{
|
|
||||||
ulong dram_size, nand_size;
|
|
||||||
int i;
|
|
||||||
char temp[32];
|
|
||||||
|
|
||||||
lcd_printf("%s\n", U_BOOT_VERSION);
|
|
||||||
lcd_printf("2014 ATMEL Corp\n");
|
|
||||||
lcd_printf("at91@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;
|
|
||||||
#ifdef CONFIG_NAND_ATMEL
|
|
||||||
for (i = 0; i < CONFIG_SYS_MAX_NAND_DEVICE; i++)
|
|
||||||
nand_size += get_nand_dev_by_index(i)->size;
|
|
||||||
#endif
|
#endif
|
||||||
lcd_printf("%ld MB SDRAM, %ld MB NAND\n",
|
return 0;
|
||||||
dram_size >> 20, nand_size >> 20);
|
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_LCD_INFO */
|
#endif
|
||||||
|
|
||||||
#endif /* CONFIG_LCD */
|
|
||||||
|
|
||||||
#ifdef CONFIG_DEBUG_UART_BOARD_INIT
|
#ifdef CONFIG_DEBUG_UART_BOARD_INIT
|
||||||
static void sama5d4ek_serial3_hw_init(void)
|
static void sama5d4ek_serial3_hw_init(void)
|
||||||
|
@ -196,9 +114,6 @@ int board_init(void)
|
||||||
#ifdef CONFIG_NAND_ATMEL
|
#ifdef CONFIG_NAND_ATMEL
|
||||||
sama5d4ek_nand_hw_init();
|
sama5d4ek_nand_hw_init();
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_LCD
|
|
||||||
sama5d4ek_lcd_hw_init();
|
|
||||||
#endif
|
|
||||||
#ifdef CONFIG_CMD_USB
|
#ifdef CONFIG_CMD_USB
|
||||||
sama5d4ek_usb_hw_init();
|
sama5d4ek_usb_hw_init();
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -78,4 +78,5 @@ CONFIG_USB_EHCI_HCD=y
|
||||||
CONFIG_USB_STORAGE=y
|
CONFIG_USB_STORAGE=y
|
||||||
CONFIG_USB_GADGET=y
|
CONFIG_USB_GADGET=y
|
||||||
CONFIG_USB_GADGET_ATMEL_USBA=y
|
CONFIG_USB_GADGET_ATMEL_USBA=y
|
||||||
CONFIG_LCD=y
|
CONFIG_DM_VIDEO=y
|
||||||
|
CONFIG_ATMEL_HLCD=y
|
||||||
|
|
|
@ -75,4 +75,5 @@ CONFIG_USB_EHCI_HCD=y
|
||||||
CONFIG_USB_STORAGE=y
|
CONFIG_USB_STORAGE=y
|
||||||
CONFIG_USB_GADGET=y
|
CONFIG_USB_GADGET=y
|
||||||
CONFIG_USB_GADGET_ATMEL_USBA=y
|
CONFIG_USB_GADGET_ATMEL_USBA=y
|
||||||
CONFIG_LCD=y
|
CONFIG_DM_VIDEO=y
|
||||||
|
CONFIG_ATMEL_HLCD=y
|
||||||
|
|
|
@ -74,4 +74,5 @@ CONFIG_USB_EHCI_HCD=y
|
||||||
CONFIG_USB_STORAGE=y
|
CONFIG_USB_STORAGE=y
|
||||||
CONFIG_USB_GADGET=y
|
CONFIG_USB_GADGET=y
|
||||||
CONFIG_USB_GADGET_ATMEL_USBA=y
|
CONFIG_USB_GADGET_ATMEL_USBA=y
|
||||||
CONFIG_LCD=y
|
CONFIG_DM_VIDEO=y
|
||||||
|
CONFIG_ATMEL_HLCD=y
|
||||||
|
|
|
@ -45,15 +45,6 @@
|
||||||
#define CONFIG_ATMEL_NAND_HW_PMECC
|
#define CONFIG_ATMEL_NAND_HW_PMECC
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* LCD */
|
|
||||||
#define LCD_BPP LCD_COLOR16
|
|
||||||
#define LCD_OUTPUT_BPP 18
|
|
||||||
#define CONFIG_LCD_LOGO
|
|
||||||
#define CONFIG_LCD_INFO
|
|
||||||
#define CONFIG_LCD_INFO_BELOW_LOGO
|
|
||||||
#define CONFIG_ATMEL_HLCD
|
|
||||||
#define CONFIG_ATMEL_LCD_RGB565
|
|
||||||
|
|
||||||
/* SPL */
|
/* SPL */
|
||||||
#define CONFIG_SPL_FRAMEWORK
|
#define CONFIG_SPL_FRAMEWORK
|
||||||
#define CONFIG_SPL_TEXT_BASE 0x200000
|
#define CONFIG_SPL_TEXT_BASE 0x200000
|
||||||
|
|
Loading…
Add table
Reference in a new issue