]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
Merge git://git.denx.de/u-boot-dm
authorTom Rini <trini@konsulko.com>
Tue, 10 Oct 2017 00:19:39 +0000 (20:19 -0400)
committerTom Rini <trini@konsulko.com>
Tue, 10 Oct 2017 00:19:39 +0000 (20:19 -0400)
67 files changed:
Kconfig
arch/arm/dts/at91-sama5d2_xplained.dts
arch/arm/dts/at91-sama5d4_xplained.dts
arch/arm/dts/at91-sama5d4ek.dts
arch/arm/dts/sama5d2.dtsi
arch/arm/dts/sama5d36ek_cmp.dts
arch/arm/dts/sama5d3_lcd.dtsi
arch/arm/dts/sama5d3xdm.dtsi
arch/arm/dts/sama5d4.dtsi
arch/arm/dts/stm32h743-pinctrl.dtsi
arch/arm/dts/stm32h743.dtsi
arch/arm/dts/stm32h743i-disco.dts
arch/arm/dts/stm32h743i-eval.dts
arch/arm/include/asm/macro.h
arch/arm/lib/crt0_64.S
arch/arm/lib/relocate_64.S
arch/arm/mach-at91/Kconfig
arch/arm/mach-stm32/stm32f7/timer.c
board/atmel/at91sam9x5ek/at91sam9x5ek.c
board/atmel/common/video_display.c
board/atmel/sama5d2_xplained/sama5d2_xplained.c
board/atmel/sama5d3xek/sama5d3xek.c
board/atmel/sama5d4_xplained/sama5d4_xplained.c
board/atmel/sama5d4ek/sama5d4ek.c
cmd/Kconfig
configs/at91sam9x5ek_dataflash_defconfig
configs/at91sam9x5ek_mmc_defconfig
configs/at91sam9x5ek_nandflash_defconfig
configs/at91sam9x5ek_spiflash_defconfig
configs/sama5d2_xplained_mmc_defconfig
configs/sama5d2_xplained_spiflash_defconfig
configs/sama5d36ek_cmp_mmc_defconfig
configs/sama5d36ek_cmp_nandflash_defconfig
configs/sama5d36ek_cmp_spiflash_defconfig
configs/sama5d3xek_mmc_defconfig
configs/sama5d3xek_nandflash_defconfig
configs/sama5d3xek_spiflash_defconfig
configs/sama5d4_xplained_mmc_defconfig
configs/sama5d4_xplained_nandflash_defconfig
configs/sama5d4_xplained_spiflash_defconfig
configs/sama5d4ek_mmc_defconfig
configs/sama5d4ek_nandflash_defconfig
configs/sama5d4ek_spiflash_defconfig
configs/stih410-b2260_defconfig
configs/stm32h743-disco_defconfig
configs/stm32h743-eval_defconfig
drivers/mmc/Kconfig
drivers/serial/Kconfig
drivers/serial/serial_stm32x7.c
drivers/serial/serial_stm32x7.h
drivers/video/Kconfig
drivers/video/vidconsole-uclass.c
drivers/video/video-uclass.c
fs/fat/fat.c
include/configs/at91sam9x5ek.h
include/configs/sama5d2_xplained.h
include/configs/sama5d3xek.h
include/configs/sama5d4_xplained.h
include/configs/sama5d4ek.h
include/configs/stih410-b2260.h
include/configs/stm32h743-disco.h
include/configs/stm32h743-eval.h
include/video.h
include/video_console.h
lib/asm-offsets.c
scripts/Kconfig [deleted file]
test/dm/video.c

diff --git a/Kconfig b/Kconfig
index 238fa3e1ed46caa14002bd8cb80dfceadea33d89..d951e9f8049203cf5c2cd7af0f30aa615e2da4d5 100644 (file)
--- a/Kconfig
+++ b/Kconfig
@@ -398,5 +398,3 @@ source "fs/Kconfig"
 source "lib/Kconfig"
 
 source "test/Kconfig"
-
-source "scripts/Kconfig"
index b00aaa2c79209eed3fd0ac313c4f9793a20b108c..01326a1ee03472250d4e2367e974b9064b362f4c 100644 (file)
                };
 
                apb {
+                       hlcdc: hlcdc@f0000000 {
+                               atmel,vl-bpix = <4>;
+                               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;
+                                       480x272 {
+                                               clock-frequency = <9000000>;
+                                               hactive = <480>;
+                                               vactive = <272>;
+                                               hsync-len = <41>;
+                                               hfront-porch = <2>;
+                                               hback-porch = <2>;
+                                               vfront-porch = <2>;
+                                               vback-porch = <2>;
+                                               vsync-len = <11>;
+                                               u-boot,dm-pre-reloc;
+                                       };
+                               };
+                       };
+
                        qspi0: spi@f0020000 {
                                status = "okay";
 
                                                bias-disable;
                                        };
 
+                                       pinctrl_lcd_base: pinctrl_lcd_base {
+                                               pinmux = <PIN_PC30__LCDVSYNC>,
+                                                       <PIN_PC31__LCDHSYNC>,
+                                                       <PIN_PD1__LCDDEN>,
+                                                       <PIN_PD0__LCDPCK>;
+                                               bias-disable;
+                                       };
+
+                                       pinctrl_lcd_pwm: pinctrl_lcd_pwm {
+                                               pinmux = <PIN_PC28__LCDPWM>;
+                                               bias-disable;
+                                       };
+
+                                       pinctrl_lcd_rgb666: pinctrl_lcd_rgb666 {
+                                               pinmux = <PIN_PC10__LCDDAT2>,
+                                                       <PIN_PC11__LCDDAT3>,
+                                                       <PIN_PC12__LCDDAT4>,
+                                                       <PIN_PC13__LCDDAT5>,
+                                                       <PIN_PC14__LCDDAT6>,
+                                                       <PIN_PC15__LCDDAT7>,
+                                                       <PIN_PC16__LCDDAT10>,
+                                                       <PIN_PC17__LCDDAT11>,
+                                                       <PIN_PC18__LCDDAT12>,
+                                                       <PIN_PC19__LCDDAT13>,
+                                                       <PIN_PC20__LCDDAT14>,
+                                                       <PIN_PC21__LCDDAT15>,
+                                                       <PIN_PC22__LCDDAT18>,
+                                                       <PIN_PC23__LCDDAT19>,
+                                                       <PIN_PC24__LCDDAT20>,
+                                                       <PIN_PC25__LCDDAT21>,
+                                                       <PIN_PC26__LCDDAT22>,
+                                                       <PIN_PC27__LCDDAT23>;
+                                               bias-disable;
+                                       };
+
                                        pinctrl_macb0_phy_irq: macb0_phy_irq {
                                                pinmux = <PIN_PC9__GPIO>;
                                                bias-disable;
index 0592b31b91733ef846dacdebc083175dd395b2e0..ea35dc21b6fe61e692302de7465b84c525d2ff35 100644 (file)
 
        ahb {
                apb {
+                       hlcdc: hlcdc@f0000000 {
+                               atmel,vl-bpix = <4>;
+                               atmel,guard-time = <1>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&pinctrl_lcd_base &pinctrl_lcd_pwm &pinctrl_lcd_rgb888>;
+                               status = "okay";
+                               u-boot,dm-pre-reloc;
+
+                               display-timings {
+                                       u-boot,dm-pre-reloc;
+                                       480x272 {
+                                               clock-frequency = <9000000>;
+                                               hactive = <480>;
+                                               vactive = <272>;
+                                               hsync-len = <41>;
+                                               hfront-porch = <2>;
+                                               hback-porch = <2>;
+                                               vfront-porch = <2>;
+                                               vback-porch = <2>;
+                                               vsync-len = <11>;
+                                               u-boot,dm-pre-reloc;
+                                       };
+                               };
+                       };
+
                        spi0: spi@f8010000 {
                                u-boot,dm-pre-reloc;
                                cs-gpios = <&pioC 3 0>, <0>, <0>, <0>;
index b965f5b39dc67437b103cc1695b06580548edc1f..a5d75452cf3e8fff1c845e672cf1009f3c27f3a4 100644 (file)
 
        ahb {
                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 {
                                pinctrl-names = "default";
                                pinctrl-0 = <
index b02a602378ee81304f0ca2e1f269173ef8b9342f..7520446dc1a5f79c9cc46c744c9dd7844e793715 100644 (file)
                        #size-cells = <1>;
                        u-boot,dm-pre-reloc;
 
+                       hlcdc: hlcdc@f0000000 {
+                               compatible = "atmel,at91sam9x5-hlcdc";
+                               reg = <0xf0000000 0x2000>;
+                               clocks = <&lcdc_clk>;
+                               status = "disabled";
+                       };
+
                        pmc: pmc@f0014000 {
                                compatible = "atmel,sama5d2-pmc", "syscon";
                                reg = <0xf0014000 0x160>;
index be41490f63fb0e7fa78e05ddb22d5d95ecc02301..c17bc9f0dce66ab0c714c45444e99aee69f89326 100644 (file)
@@ -8,6 +8,7 @@
 /dts-v1/;
 #include "sama5d36.dtsi"
 #include "sama5d3xmb_cmp.dtsi"
+#include "sama5d3xdm.dtsi"
 
 / {
        model = "Atmel SAMA5D36-EK";
index 14d7c2bc75ca8a5308b425c81ea7517d3e78219a..10fb3a97ea499f5cf0cbbe017856ac63d852aa26 100644 (file)
        ahb {
                apb {
                        hlcdc: hlcdc@f0030000 {
-                               compatible = "atmel,sama5d3-hlcdc";
+                               compatible = "atmel,at91sam9x5-hlcdc";
                                reg = <0xf0030000 0x2000>;
                                interrupts = <36 IRQ_TYPE_LEVEL_HIGH 0>;
                                clocks = <&lcdc_clk>, <&lcdck>, <&clk32k>;
                                clock-names = "periph_clk","sys_clk", "slow_clk";
                                status = "disabled";
-
-                               hlcdc-display-controller {
-                                       compatible = "atmel,hlcdc-display-controller";
-                                       #address-cells = <1>;
-                                       #size-cells = <0>;
-
-                                       port@0 {
-                                               #address-cells = <1>;
-                                               #size-cells = <0>;
-                                               reg = <0>;
-                                       };
-                               };
-
-                               hlcdc_pwm: hlcdc-pwm {
-                                       compatible = "atmel,hlcdc-pwm";
-                                       pinctrl-names = "default";
-                                       pinctrl-0 = <&pinctrl_lcd_pwm>;
-                                       #pwm-cells = <3>;
-                               };
                        };
 
                        pinctrl@fffff200 {
index 035ab72b39903c474aeb60c80a44ee0f9207d489..b3df9af2b42da3b566d258bc2b91f4578cd773d5 100644 (file)
 / {
        ahb {
                apb {
+                       hlcdc: hlcdc@f0030000 {
+                               atmel,vl-bpix = <4>;
+                               atmel,output-mode = <24>;
+                               atmel,guard-time = <1>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&pinctrl_lcd_base &pinctrl_lcd_pwm &pinctrl_lcd_rgb888_alt>;
+                               status = "okay";
+                               u-boot,dm-pre-reloc;
+
+                               display-timings {
+                                       u-boot,dm-pre-reloc;
+                                       800x480 {
+                                               clock-frequency = <24000000>;
+                                               hactive = <800>;
+                                               vactive = <480>;
+                                               hsync-len = <5>;
+                                               hfront-porch = <64>;
+                                               hback-porch = <64>;
+                                               vfront-porch = <22>;
+                                               vback-porch = <21>;
+                                               vsync-len = <5>;
+                                               u-boot,dm-pre-reloc;
+                                       };
+                               };
+                       };
+
                        i2c1: i2c@f0018000 {
                                qt1070: keyboard@1b {
                                        compatible = "qt1070";
index c6512ae437c6062e7be05b5c4e15060a890a5d7b..8072b8a4f23a037169abc32803eb178d9df65815 100644 (file)
                        u-boot,dm-pre-reloc;
 
                        hlcdc: hlcdc@f0000000 {
-                               compatible = "atmel,sama5d4-hlcdc";
+                               compatible = "atmel,at91sam9x5-hlcdc";
                                reg = <0xf0000000 0x4000>;
                                interrupts = <51 IRQ_TYPE_LEVEL_HIGH 0>;
                                clocks = <&lcdc_clk>, <&lcdck>, <&clk32k>;
                                clock-names = "periph_clk","sys_clk", "slow_clk";
                                status = "disabled";
-
-                               hlcdc-display-controller {
-                                       compatible = "atmel,hlcdc-display-controller";
-                                       #address-cells = <1>;
-                                       #size-cells = <0>;
-
-                                       port@0 {
-                                               #address-cells = <1>;
-                                               #size-cells = <0>;
-                                               reg = <0>;
-                                       };
-                               };
-
-                               hlcdc_pwm: hlcdc-pwm {
-                                       compatible = "atmel,hlcdc-pwm";
-                                       pinctrl-names = "default";
-                                       pinctrl-0 = <&pinctrl_lcd_pwm>;
-                                       #pwm-cells = <3>;
-                               };
                        };
 
                        dma1: dma-controller@f0004000 {
index d3e11d53ab40e438ce58702da47f721a6379ce05..e4f4aa579bd46ce808f6dcd76bff9247ece0dbf7 100644 (file)
                                          slew-rate = <3>;
                                };
                        };
+
+                       sdmmc1_pins: sdmmc@0 {
+                               pins {
+                                       pinmux = <STM32H7_PC8_FUNC_SDMMC1_D0>,
+                                                <STM32H7_PC9_FUNC_SDMMC1_D1>,
+                                                <STM32H7_PC10_FUNC_SDMMC1_D2>,
+                                                <STM32H7_PC11_FUNC_SDMMC1_D3>,
+                                                <STM32H7_PC12_FUNC_SDMMC1_CK>,
+                                                <STM32H7_PD2_FUNC_SDMMC1_CMD>;
+
+                                       slew-rate = <3>;
+                                       drive-push-pull;
+                                       bias-disable;
+                               };
+                       };
+
+                       pinctrl_sdmmc1_level_shifter: sdmmc0_ls@0 {
+                               pins {
+                                       pinmux = <STM32H7_PB8_FUNC_SDMMC1_CKIN>,
+                                                <STM32H7_PB9_FUNC_SDMMC1_CDIR>,
+                                                <STM32H7_PC6_FUNC_SDMMC1_D0DIR>,
+                                                <STM32H7_PC7_FUNC_SDMMC1_D123DIR>;
+                                       drive-push-pull;
+                                       slew-rate = <3>;
+                               };
+                       };
                };
        };
 };
index 16e93089d72666a1075b503366fd4327a53c1bee..d5b8d879ee2ac112705504ac8032b411995aa9d4 100644 (file)
@@ -43,6 +43,7 @@
 #include "skeleton.dtsi"
 #include "armv7-m.dtsi"
 #include <dt-bindings/clock/stm32h7-clks.h>
+#include <dt-bindings/mfd/stm32h7-rcc.h>
 
 / {
        clocks {
@@ -76,7 +77,7 @@
                };
 
                usart1: serial@40011000 {
-                       compatible = "st,stm32h7-usart", "st,stm32h7-uart";
+                       compatible = "st,stm32h7-uart";
                        reg = <0x40011000 0x400>;
                        interrupts = <37>;
                        status = "disabled";
@@ -84,7 +85,7 @@
                };
 
                usart2: serial@40004400 {
-                       compatible = "st,stm32h7-usart", "st,stm32h7-uart";
+                       compatible = "st,stm32h7-uart";
                        reg = <0x40004400 0x400>;
                        interrupts = <38>;
                        status = "disabled";
                        compatible = "fixed-clock";
                        clock-frequency = <4000000>;
                };
+
+               sdmmc1: sdmmc@52007000 {
+                       compatible = "st,stm32-sdmmc2";
+                       reg = <0x52007000 0x1000>;
+                       interrupts = <49>;
+                       clocks = <&rcc SDMMC1_CK>;
+                       resets = <&rcc STM32H7_AHB3_RESET(SDMMC1)>;
+                       st,idma = <1>;
+                       cap-sd-highspeed;
+                       cap-mmc-highspeed;
+                       status = "disabled";
+               };
        };
 };
 
index bef7e90f20683702b6e128727d5e4c40e17d709c..917a859a09f0fc7341c7d0fe4867f044b550c33a 100644 (file)
@@ -60,6 +60,7 @@
 
        aliases {
                serial0 = &usart2;
+               mmc0 = &sdmmc1;
                gpio0 = &gpioa;
                gpio1 = &gpiob;
                gpio2 = &gpioc;
                st,sdram-refcount = <1539>;
        };
 };
+
+&sdmmc1 {
+       status = "okay";
+       pinctrl-0 = <&sdmmc1_pins>;
+       pinctrl-names = "default";
+       bus-width = <4>;
+       cd-gpios = <&gpioi 8 1>;
+};
index 0e01ce51ab3338d1cd7de2798d7e6e6925999be7..28c876be27fc695da51644284f39589131073fd9 100644 (file)
                st,sdram-refcount = <1539>;
        };
 };
+
+&sdmmc1 {
+       status = "okay";
+       pinctrl-0 = <&sdmmc1_pins>,
+                   <&pinctrl_sdmmc1_level_shifter>;
+       pinctrl-names = "default";
+       bus-width = <4>;
+       st,dirpol;
+};
index e1916f7705d1c4a8ef830520b084356b83bd08ec..0c8652a675fa98ba399a98cfc7489c992ae33ef4 100644 (file)
@@ -131,6 +131,7 @@ lr  .req    x30
        /* NOTE: MPIDR handling will be erroneous on multi-cluster machines */
        mrs     \xreg1, mpidr_el1
        lsr     \xreg2, \xreg1, #32
+       lsl     \xreg2, \xreg2, #32
        lsl     \xreg1, \xreg1, #40
        lsr     \xreg1, \xreg1, #40
        orr     \xreg1, \xreg1, \xreg2
index 62fad452b2127b0f07c416ab085005246f18c424..9c46c93ca4c5857b9b62d431a7d214ee96754717 100644 (file)
@@ -95,8 +95,7 @@ ENTRY(_main)
  */
        ldr     x0, [x18, #GD_START_ADDR_SP]    /* x0 <- gd->start_addr_sp */
        bic     sp, x0, #0xf    /* 16-byte alignment for ABI compliance */
-       ldr     x18, [x18, #GD_BD]              /* x18 <- gd->bd */
-       sub     x18, x18, #GD_SIZE              /* new GD is below bd */
+       ldr     x18, [x18, #GD_NEW_GD]          /* x18 <- gd->new_gd */
 
        adr     lr, relocation_return
        ldr     x9, [x18, #GD_RELOC_OFF]        /* x9 <- gd->reloc_off */
index c7600537063f86b3297bc8a8a34af6db88e0bdca..fdba004363af38de84ad7d8cd33db556aa6de4d7 100644 (file)
@@ -73,6 +73,6 @@ relocate_done:
        isb     sy
 4:     ldp     x0, x1, [sp, #16]
        bl      __asm_flush_dcache_range
-5:     ldp     x29, x30, [sp],#16
+5:     ldp     x29, x30, [sp],#32
        ret
 ENDPROC(relocate_code)
index 0e71b69a1965b55c445d97f9628a708809f2c7ac..7e85b69679d2b4eb3bdcd005776042300ae5a3fc 100644 (file)
@@ -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"
@@ -153,6 +154,7 @@ config TARGET_SAMA5D2_XPLAINED
        select SAMA5D2
        select SUPPORT_SPL
        select BOARD_EARLY_INIT_F
+       select BOARD_LATE_INIT
 
 config TARGET_SAMA5D27_SOM1_EK
        bool "SAMA5D27 SOM1 EK board"
@@ -185,12 +187,14 @@ config TARGET_SAMA5D4_XPLAINED
        select SAMA5D4
        select SUPPORT_SPL
        select BOARD_EARLY_INIT_F
+       select BOARD_LATE_INIT
 
 config TARGET_SAMA5D4EK
        bool "SAMA5D4 Evaluation Kit"
        select SAMA5D4
        select SUPPORT_SPL
        select BOARD_EARLY_INIT_F
+       select BOARD_LATE_INIT
 
 config TARGET_MA5D4EVK
        bool "Aries MA5D4EVK Evaluation Kit"
index c15f8bbe32da69cd2f004d185ebe45c40a50a5b8..b04c1013e9ce4cf23d4ed0cfe3faf924d3c15661 100644 (file)
@@ -26,7 +26,7 @@ int timer_init(void)
        /* Stop the timer */
        writel(readl(&gpt1_regs_ptr->cr1) & ~GPT_CR1_CEN, &gpt1_regs_ptr->cr1);
 
-       writel((CONFIG_SYS_CLK_FREQ/CONFIG_SYS_HZ_CLOCK) - 1,
+       writel((CONFIG_SYS_CLK_FREQ / 2 / CONFIG_SYS_HZ_CLOCK) - 1,
                                                &gpt1_regs_ptr->psc);
 
        /* Configure timer for auto-reload */
index be6dd4a6d39223143af71bfd3778fa3f5358ea2d..d69831ad152edf7c16940903d61c1736c54f0def 100644 (file)
 #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@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)
@@ -215,9 +121,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;
 }
index 39ad6198192c507a7e3a8eeb0f48319114fc4768..b20abc738674a0d2cfa7e61d0ee4f8d309b467be 100644 (file)
@@ -43,7 +43,7 @@ int at91_video_show_board_info(void)
        nand_size = 0;
 #ifdef CONFIG_NAND_ATMEL
        for (i = 0; i < CONFIG_SYS_MAX_NAND_DEVICE; i++)
-               nand_size += nand_info[i]->size;
+               nand_size += get_nand_dev_by_index(i)->size;
 #endif
 
        len += sprintf(&buf[len], "%ld MB SDRAM, %ld MB NAND\n",
index 57586530304531880c6a6f7b702b6d1b9d09c048..778142ac7161c2da494f101a31272daafb7e6464 100644 (file)
@@ -6,10 +6,7 @@
  */
 
 #include <common.h>
-#include <atmel_hlcdc.h>
 #include <debug_uart.h>
-#include <lcd.h>
-#include <version.h>
 #include <asm/io.h>
 #include <asm/arch/at91_common.h>
 #include <asm/arch/atmel_pio4.h>
@@ -26,90 +23,15 @@ static void board_usb_hw_init(void)
        atmel_pio4_set_pio_output(AT91_PIO_PORTB, 10, 1);
 }
 
-#ifdef CONFIG_LCD
-vidinfo_t panel_info = {
-       .vl_col = 480,
-       .vl_row = 272,
-       .vl_clk = 9000000,
-       .vl_bpix = LCD_BPP,
-       .vl_tft = 1,
-       .vl_hsync_len = 41,
-       .vl_left_margin = 2,
-       .vl_right_margin = 2,
-       .vl_vsync_len = 11,
-       .vl_upper_margin = 2,
-       .vl_lower_margin = 2,
-       .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)
+#ifdef CONFIG_BOARD_LATE_INIT
+int board_late_init(void)
 {
-       return 1;
-}
-
-static void board_lcd_hw_init(void)
-{
-       atmel_pio4_set_a_periph(AT91_PIO_PORTC, 28, 0); /* LCDPWM */
-       atmel_pio4_set_a_periph(AT91_PIO_PORTC, 29, 0); /* LCDDISP */
-       atmel_pio4_set_a_periph(AT91_PIO_PORTC, 30, 0); /* LCDVSYNC */
-       atmel_pio4_set_a_periph(AT91_PIO_PORTC, 31, 0); /* LCDHSYNC */
-       atmel_pio4_set_a_periph(AT91_PIO_PORTD,  0, 0); /* LCDPCK */
-       atmel_pio4_set_a_periph(AT91_PIO_PORTD,  1, 0); /* LCDDEN */
-
-       /* LCDDAT0 */
-       /* LCDDAT1 */
-       atmel_pio4_set_a_periph(AT91_PIO_PORTC, 10, 0); /* LCDDAT2 */
-       atmel_pio4_set_a_periph(AT91_PIO_PORTC, 11, 0); /* LCDDAT3 */
-       atmel_pio4_set_a_periph(AT91_PIO_PORTC, 12, 0); /* LCDDAT4 */
-       atmel_pio4_set_a_periph(AT91_PIO_PORTC, 13, 0); /* LCDDAT5 */
-       atmel_pio4_set_a_periph(AT91_PIO_PORTC, 14, 0); /* LCDDAT6 */
-       atmel_pio4_set_a_periph(AT91_PIO_PORTC, 15, 0); /* LCDDAT7 */
-
-       /* LCDDAT8 */
-       /* LCDDAT9 */
-       atmel_pio4_set_a_periph(AT91_PIO_PORTC, 16, 0); /* LCDDAT10 */
-       atmel_pio4_set_a_periph(AT91_PIO_PORTC, 17, 0); /* LCDDAT11 */
-       atmel_pio4_set_a_periph(AT91_PIO_PORTC, 18, 0); /* LCDDAT12 */
-       atmel_pio4_set_a_periph(AT91_PIO_PORTC, 19, 0); /* LCDDAT13 */
-       atmel_pio4_set_a_periph(AT91_PIO_PORTC, 20, 0); /* LCDDAT14 */
-       atmel_pio4_set_a_periph(AT91_PIO_PORTC, 21, 0); /* LCDDAT15 */
-
-       /* LCDD16 */
-       /* LCDD17 */
-       atmel_pio4_set_a_periph(AT91_PIO_PORTC, 22, 0); /* LCDDAT18 */
-       atmel_pio4_set_a_periph(AT91_PIO_PORTC, 23, 0); /* LCDDAT19 */
-       atmel_pio4_set_a_periph(AT91_PIO_PORTC, 24, 0); /* LCDDAT20 */
-       atmel_pio4_set_a_periph(AT91_PIO_PORTC, 25, 0); /* LCDDAT21 */
-       atmel_pio4_set_a_periph(AT91_PIO_PORTC, 26, 0); /* LCDDAT22 */
-       atmel_pio4_set_a_periph(AT91_PIO_PORTC, 27, 0); /* LCDDAT23 */
-
-       at91_periph_clk_enable(ATMEL_ID_LCDC);
-}
-
-#ifdef CONFIG_LCD_INFO
-void lcd_show_board_info(void)
-{
-       ulong dram_size;
-       int i;
-       char temp[32];
-
-       lcd_printf("%s\n", U_BOOT_VERSION);
-       lcd_printf("2015 ATMEL Corp\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;
-
-       lcd_printf("%ld MB SDRAM\n", dram_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
 static void board_uart1_hw_init(void)
@@ -142,9 +64,6 @@ int board_init(void)
        /* address of boot parameters */
        gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
 
-#ifdef CONFIG_LCD
-       board_lcd_hw_init();
-#endif
 #ifdef CONFIG_CMD_USB
        board_usb_hw_init();
 #endif
index 6d473fc06dbd94e67cc64796d55d0a642c300939..98d846fd79e250e3169f492674ebcfcec7d66865 100644 (file)
@@ -13,9 +13,7 @@
 #include <asm/arch/gpio.h>
 #include <asm/arch/clk.h>
 #include <debug_uart.h>
-#include <lcd.h>
 #include <linux/ctype.h>
-#include <atmel_hlcdc.h>
 #include <phy.h>
 #include <micrel.h>
 #include <spl.h>
@@ -132,80 +130,6 @@ static void sama5d3xek_mci_hw_init(void)
 }
 #endif
 
-#ifdef CONFIG_LCD
-vidinfo_t panel_info = {
-       .vl_col = 800,
-       .vl_row = 480,
-       .vl_clk = 24000000,
-       .vl_bpix = LCD_BPP,
-       .vl_tft = 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)
-{
-}
-
-void lcd_disable(void)
-{
-}
-
-static void sama5d3xek_lcd_hw_init(void)
-{
-       gd->fb_base = CONFIG_SAMA5D3_LCD_BASE;
-
-       /* The higher 8 bit of LCD is board related */
-       at91_pio3_set_c_periph(AT91_PIO_PORTC, 14, 0);  /* LCDD16 */
-       at91_pio3_set_c_periph(AT91_PIO_PORTC, 13, 0);  /* LCDD17 */
-       at91_pio3_set_c_periph(AT91_PIO_PORTC, 12, 0);  /* LCDD18 */
-       at91_pio3_set_c_periph(AT91_PIO_PORTC, 11, 0);  /* LCDD19 */
-       at91_pio3_set_c_periph(AT91_PIO_PORTC, 10, 0);  /* LCDD20 */
-       at91_pio3_set_c_periph(AT91_PIO_PORTC, 15, 0);  /* LCDD21 */
-       at91_pio3_set_c_periph(AT91_PIO_PORTE, 27, 0);  /* LCDD22 */
-       at91_pio3_set_c_periph(AT91_PIO_PORTE, 28, 0);  /* LCDD23 */
-
-       /* Configure lower 16 bit of LCD and enable clock */
-       at91_lcd_hw_init();
-}
-
-#ifdef CONFIG_LCD_INFO
-#include <nand.h>
-#include <version.h>
-
-void lcd_show_board_info(void)
-{
-       ulong dram_size;
-       uint64_t nand_size;
-       int i;
-       char temp[32];
-
-       lcd_printf("%s\n", U_BOOT_VERSION);
-       lcd_printf("(C) 2013 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
-       lcd_printf("%ld MB SDRAM, %lld MB NAND\n",
-                  dram_size >> 20, nand_size >> 20);
-}
-#endif /* CONFIG_LCD_INFO */
-#endif /* CONFIG_LCD */
-
 #ifdef CONFIG_DEBUG_UART_BOARD_INIT
 void board_debug_uart_init(void)
 {
@@ -239,10 +163,6 @@ int board_init(void)
 #endif
 #ifdef CONFIG_GENERIC_ATMEL_MCI
        sama5d3xek_mci_hw_init();
-#endif
-#ifdef CONFIG_LCD
-       if (has_lcdc())
-               sama5d3xek_lcd_hw_init();
 #endif
        return 0;
 }
@@ -268,6 +188,9 @@ int board_late_init(void)
 
        strcat(name, "ek.dtb");
        env_set("dtb_name", name);
+#endif
+#ifdef CONFIG_DM_VIDEO
+       at91_video_show_board_info();
 #endif
        return 0;
 }
index 9236a285492105224d3d40203f1e9f9eb3520410..78eddb8beb01f749829a20493c764ab2cb83e340 100644 (file)
 #include <asm/arch/clk.h>
 #include <asm/arch/sama5d3_smc.h>
 #include <asm/arch/sama5d4.h>
-#include <atmel_hlcdc.h>
 #include <debug_uart.h>
-#include <lcd.h>
-#include <nand.h>
-#include <version.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -73,98 +69,15 @@ static void sama5d4_xplained_usb_hw_init(void)
 }
 #endif
 
-#ifdef CONFIG_LCD
-vidinfo_t panel_info = {
-       .vl_col = 480,
-       .vl_row = 272,
-       .vl_clk = 9000000,
-       .vl_bpix = LCD_BPP,
-       .vl_tft = 1,
-       .vl_hsync_len = 41,
-       .vl_left_margin = 2,
-       .vl_right_margin = 2,
-       .vl_vsync_len = 11,
-       .vl_upper_margin = 2,
-       .vl_lower_margin = 2,
-       .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)
+#ifdef CONFIG_BOARD_LATE_INIT
+int board_late_init(void)
 {
-       return 1;
-}
-
-static void sama5d4_xplained_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,  0, 0);  /* LCDD0 */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA,  1, 0);  /* LCDD1 */
-       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,  8, 0);  /* LCDD9 */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA,  9, 0);  /* LCDD8 */
-       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, 16, 0);  /* LCDD16 */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA, 17, 0);  /* LCDD17 */
-       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("%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;
+#ifdef CONFIG_DM_VIDEO
+       at91_video_show_board_info();
 #endif
-       lcd_printf("%ld MB SDRAM, %ld MB NAND\n",
-                  dram_size >> 20, nand_size >> 20);
+       return 0;
 }
-#endif /* CONFIG_LCD_INFO */
-
-#endif /* CONFIG_LCD */
+#endif
 
 #ifdef CONFIG_DEBUG_UART_BOARD_INIT
 static void sama5d4_xplained_serial3_hw_init(void)
@@ -212,9 +125,6 @@ int board_init(void)
 #ifdef CONFIG_NAND_ATMEL
        sama5d4_xplained_nand_hw_init();
 #endif
-#ifdef CONFIG_LCD
-       sama5d4_xplained_lcd_hw_init();
-#endif
 #ifdef CONFIG_CMD_USB
        sama5d4_xplained_usb_hw_init();
 #endif
index ee07038e2e4f9e2270a94351297495bae6c6dc0b..48c43f01630a25c46fd72b4079c5777984ef34d6 100644 (file)
 #include <asm/arch/clk.h>
 #include <asm/arch/sama5d3_smc.h>
 #include <asm/arch/sama5d4.h>
-#include <atmel_hlcdc.h>
 #include <debug_uart.h>
-#include <lcd.h>
-#include <nand.h>
-#include <version.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -74,93 +70,15 @@ static void sama5d4ek_usb_hw_init(void)
 }
 #endif
 
-#ifdef CONFIG_LCD
-vidinfo_t panel_info = {
-       .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)
+#ifdef CONFIG_BOARD_LATE_INIT
+int board_late_init(void)
 {
-       return 1;
-}
-
-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;
+#ifdef CONFIG_DM_VIDEO
+       at91_video_show_board_info();
 #endif
-       lcd_printf("%ld MB SDRAM, %ld MB NAND\n",
-                  dram_size >> 20, nand_size >> 20);
+       return 0;
 }
-#endif /* CONFIG_LCD_INFO */
-
-#endif /* CONFIG_LCD */
+#endif
 
 #ifdef CONFIG_DEBUG_UART_BOARD_INIT
 static void sama5d4ek_serial3_hw_init(void)
@@ -196,9 +114,6 @@ int board_init(void)
 #ifdef CONFIG_NAND_ATMEL
        sama5d4ek_nand_hw_init();
 #endif
-#ifdef CONFIG_LCD
-       sama5d4ek_lcd_hw_init();
-#endif
 #ifdef CONFIG_CMD_USB
        sama5d4ek_usb_hw_init();
 #endif
index 28c91ca181f47c0341b4dffd72c94ed391a80371..681c81ab0d9c728552f0c9596ecb8a62450bb844 100644 (file)
@@ -116,6 +116,9 @@ endmenu
 
 source "cmd/fastboot/Kconfig"
 
+config BUILD_BIN2C
+       bool
+
 comment "Commands"
 
 menu "Info commands"
@@ -528,6 +531,7 @@ menu "Compression commands"
 
 config CMD_LZMADEC
        bool "lzmadec"
+       default y if CMD_BOOTI
        select LZMA
        help
          Support decompressing an LZMA (Lempel-Ziv-Markov chain algorithm)
@@ -535,6 +539,7 @@ config CMD_LZMADEC
 
 config CMD_UNZIP
        bool "unzip"
+       default y if CMD_BOOTI
        help
          Uncompress a zip-compressed memory region.
 
index 9d61dd8de0007d70a6f475ddfbaec4e0f2d1becf..c417eb8c10b679a3718f5c2fa4cc1a9d11a057af 100644 (file)
@@ -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
index 9fa4801480b92186b2c5b09d8ba12933997e60bb..e0a24a5b48164217f57cc1653ac012eeb9505d21 100644 (file)
@@ -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
index b28bec7f0bf7ac719058596ca66a0fa3ab11ac2c..0e8c07f6095498bc3d01ab0f34c84a3617c0a369 100644 (file)
@@ -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
index 838d8a0ad7007133515195e14fa0e8d5eaf7718e..70e96ecc2fa2601f48db0007d20bea4d06b44b22 100644 (file)
@@ -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
index 215961a65c0deb882cc496f9e7b51ff4fb70b19a..87fc049b6d53af0ba6999a16ef750e64ed5356be 100644 (file)
@@ -82,3 +82,5 @@ CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
+CONFIG_DM_VIDEO=y
+CONFIG_ATMEL_HLCD=y
index 869d405838e55e5dedbdb0ae5d7464a6eaef6829..37572489e2e08707b66e7e407276579358cf67fa 100644 (file)
@@ -79,3 +79,5 @@ CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
+CONFIG_DM_VIDEO=y
+CONFIG_ATMEL_HLCD=y
index b6c60cbcae69340b229ad3c51710882e3a1b0e40..7c27812c3ffeec95be906a94610018cd736c06e6 100644 (file)
@@ -55,4 +55,5 @@ CONFIG_DM_SPI=y
 CONFIG_ATMEL_SPI=y
 CONFIG_TIMER=y
 CONFIG_ATMEL_PIT_TIMER=y
-CONFIG_LCD=y
+CONFIG_DM_VIDEO=y
+CONFIG_ATMEL_HLCD=y
index 01b57efe03da530de16229930de6ed167bb4ac08..09508dafa4995733912bb4f7958bed251bb480e4 100644 (file)
@@ -55,5 +55,6 @@ CONFIG_DM_SPI=y
 CONFIG_ATMEL_SPI=y
 CONFIG_TIMER=y
 CONFIG_ATMEL_PIT_TIMER=y
-CONFIG_LCD=y
 CONFIG_FAT_WRITE=y
+CONFIG_DM_VIDEO=y
+CONFIG_ATMEL_HLCD=y
index e29e3a809811fc1d8108d234d52ea2c06afb5ca1..1c004ef2ac6ea76449f69b566385858dcb75e115 100644 (file)
@@ -55,5 +55,6 @@ CONFIG_DM_SPI=y
 CONFIG_ATMEL_SPI=y
 CONFIG_TIMER=y
 CONFIG_ATMEL_PIT_TIMER=y
-CONFIG_LCD=y
+CONFIG_DM_VIDEO=y
+CONFIG_ATMEL_HLCD=y
 CONFIG_FAT_WRITE=y
index f45449fd93f6514fb3ac4f564245b29083939b2e..8b4c37a12530084256dd1b0a1285e9040675f5c8 100644 (file)
@@ -81,4 +81,5 @@ CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
-CONFIG_LCD=y
+CONFIG_DM_VIDEO=y
+CONFIG_ATMEL_HLCD=y
index 6217600f01d2941513d9de23c1945554b1f738b6..f9d4b8db3a81fb3e95e88c50a1c5e25b39668979 100644 (file)
@@ -76,5 +76,6 @@ CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
-CONFIG_LCD=y
+CONFIG_DM_VIDEO=y
+CONFIG_ATMEL_HLCD=y
 CONFIG_FAT_WRITE=y
index 2fe08e4e59a30f07b67b9ac86a1313a27beb1ebc..7399b3e51f074896216f6b583c507496ba623fe6 100644 (file)
@@ -77,5 +77,6 @@ CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
-CONFIG_LCD=y
+CONFIG_DM_VIDEO=y
+CONFIG_ATMEL_HLCD=y
 CONFIG_FAT_WRITE=y
index dabbf605c5a928b5bb01ecd9e30cd8d1cf12de48..8ecba5b7d4fd533ae6d116754863f190ffcfd78b 100644 (file)
@@ -78,3 +78,5 @@ CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
+CONFIG_DM_VIDEO=y
+CONFIG_ATMEL_HLCD=y
index 85157878cdab5962b236d1f3bac5569cb71bdd66..bd3131f4cc09bf63c397a41f9434348da64edfab 100644 (file)
@@ -75,3 +75,5 @@ CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
+CONFIG_DM_VIDEO=y
+CONFIG_ATMEL_HLCD=y
index 4061720b3a835a43696c7db9819f67e17f7d65ae..d37be67eb664cf3280e440f3ac9b29b2f92fd300 100644 (file)
@@ -77,3 +77,5 @@ CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
+CONFIG_DM_VIDEO=y
+CONFIG_ATMEL_HLCD=y
index aaa5855b220617e9dc6d55787ebaecedb352949b..7367b6cb7a01b10a83355484804f3b5fa611ddef 100644 (file)
@@ -78,4 +78,5 @@ CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
-CONFIG_LCD=y
+CONFIG_DM_VIDEO=y
+CONFIG_ATMEL_HLCD=y
index 901d17bfa337f50c1a40491cb866fe7d8d7bebd1..94970c6e7fd530d6f0c512523f02126caeabc550 100644 (file)
@@ -75,4 +75,5 @@ CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
-CONFIG_LCD=y
+CONFIG_DM_VIDEO=y
+CONFIG_ATMEL_HLCD=y
index 535031024b31f3ddc2afac67d764ef1cc42113db..160ed127bdfa74adefc61fee48dedc271e3574b4 100644 (file)
@@ -74,4 +74,5 @@ CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
-CONFIG_LCD=y
+CONFIG_DM_VIDEO=y
+CONFIG_ATMEL_HLCD=y
index 4b41b6bcf1151753286b42222bb93a3ce9627395..d4aa4f3ab6f0b77cadffa60342b8e827e96f7869 100644 (file)
@@ -6,7 +6,7 @@ CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_USE_BOOTARGS=y
-CONFIG_BOOTARGS="console=ttyS0,115200 earlyprintk consoleblank=0 ignore_loglevel"
+CONFIG_BOOTARGS="console=ttyAS1,115200 CONSOLE=/dev/ttyAS1 consoleblank=0 root=/dev/mmcblk0p2 rootfstype=ext4 rw rootwait mem=992M@0x40000000 vmalloc=256m"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_SYS_PROMPT="stih410-b2260 => "
 CONFIG_FASTBOOT=y
index eed921d24b6c88599a6caf717e2e4d754f383478..171633386d8a748bff689b8775f087761b4c6095 100644 (file)
@@ -16,12 +16,21 @@ CONFIG_AUTOBOOT_STOP_STR=" "
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FPGA is not set
+CONFIG_CMD_GPT=y
+CONFIG_CMD_MMC=y
 # CONFIG_CMD_SETEXPR is not set
 # CONFIG_CMD_NET is not set
 # CONFIG_CMD_NFS is not set
 CONFIG_CMD_TIMER=y
+CONFIG_CMD_EXT2=y
+CONFIG_CMD_EXT4=y
+CONFIG_CMD_EXT4_WRITE=y
+CONFIG_CMD_FAT=y
+CONFIG_CMD_FS_GENERIC=y
 CONFIG_OF_CONTROL=y
 CONFIG_OF_EMBED=y
+CONFIG_DM_MMC=y
+CONFIG_STM32_SDMMC2=y
 # CONFIG_PINCTRL_FULL is not set
 # CONFIG_SPL_SERIAL_PRESENT is not set
 CONFIG_REGEX=y
index 61e702e0013dbd9c82c4932956bc5bd195874796..4714ff2df190fd443fa4e1acce41761563d99a72 100644 (file)
@@ -16,12 +16,21 @@ CONFIG_AUTOBOOT_STOP_STR=" "
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FPGA is not set
+CONFIG_CMD_GPT=y
+CONFIG_CMD_MMC=y
 # CONFIG_CMD_SETEXPR is not set
 # CONFIG_CMD_NET is not set
 # CONFIG_CMD_NFS is not set
 CONFIG_CMD_TIMER=y
+CONFIG_CMD_EXT2=y
+CONFIG_CMD_EXT4=y
+CONFIG_CMD_EXT4_WRITE=y
+CONFIG_CMD_FAT=y
+CONFIG_CMD_FS_GENERIC=y
 CONFIG_OF_CONTROL=y
 CONFIG_OF_EMBED=y
+CONFIG_DM_MMC=y
+CONFIG_STM32_SDMMC2=y
 # CONFIG_PINCTRL_FULL is not set
 # CONFIG_SPL_SERIAL_PRESENT is not set
 CONFIG_REGEX=y
index 24b4eadd2abe1f3f7489b95591d2bd4531cec42b..940508364a51c1296504d5012f303aaf9b31fd87 100644 (file)
@@ -386,7 +386,7 @@ config GENERIC_ATMEL_MCI
 
 config STM32_SDMMC2
        bool "STMicroelectronics STM32H7 SD/MMC Host Controller support"
-       depends on DM_MMC && BLK && OF_CONTROL && DM_MMC_OPS
+       depends on DM_MMC && BLK && OF_CONTROL
        help
          This selects support for the SD/MMC controller on STM32H7 SoCs.
          If you have a board based on such a SoC and with a SD/MMC slot,
index 9bf2e26e9d11e96cda926c2ee1616d0340d1a498..7c54a49bb32ec050a0dfd1968f7a1d55527e7d1a 100644 (file)
@@ -531,9 +531,9 @@ config STI_ASC_SERIAL
 
 config STM32X7_SERIAL
        bool "STMicroelectronics STM32 SoCs on-chip UART"
-       depends on DM_SERIAL && (STM32F7 || STM32H7)
+       depends on DM_SERIAL && (STM32F4 || STM32F7 || STM32H7)
        help
-         If you have a machine based on a STM32 F7 or H7 SoC you can
+         If you have a machine based on a STM32 F4, F7 or H7 SoC you can
          enable its onboard serial ports, say Y to this option.
          If unsure, say N.
 
index 2f4eafa885ac9c281c6f3e78c565c0506747d7d3..a5d529cab28d65fbc1d92a6c8cac5edaf8075b54 100644 (file)
@@ -17,71 +17,81 @@ DECLARE_GLOBAL_DATA_PTR;
 
 static int stm32_serial_setbrg(struct udevice *dev, int baudrate)
 {
-       struct stm32x7_serial_platdata *plat = dev->platdata;
-       struct stm32_usart *const usart = plat->base;
+       struct stm32x7_serial_platdata *plat = dev_get_platdata(dev);
+       bool stm32f4 = plat->uart_info->stm32f4;
+       fdt_addr_t base = plat->base;
        u32 int_div, mantissa, fraction, oversampling;
 
        int_div = DIV_ROUND_CLOSEST(plat->clock_rate, baudrate);
 
        if (int_div < 16) {
                oversampling = 8;
-               setbits_le32(&usart->cr1, USART_CR1_OVER8);
+               setbits_le32(base + CR1_OFFSET(stm32f4), USART_CR1_OVER8);
        } else {
                oversampling = 16;
-               clrbits_le32(&usart->cr1, USART_CR1_OVER8);
+               clrbits_le32(base + CR1_OFFSET(stm32f4), USART_CR1_OVER8);
        }
 
        mantissa = (int_div / oversampling) << USART_BRR_M_SHIFT;
        fraction = int_div % oversampling;
 
-       writel(mantissa | fraction, &usart->brr);
+       writel(mantissa | fraction, base + BRR_OFFSET(stm32f4));
 
        return 0;
 }
 
 static int stm32_serial_getc(struct udevice *dev)
 {
-       struct stm32x7_serial_platdata *plat = dev->platdata;
-       struct stm32_usart *const usart = plat->base;
+       struct stm32x7_serial_platdata *plat = dev_get_platdata(dev);
+       bool stm32f4 = plat->uart_info->stm32f4;
+       fdt_addr_t base = plat->base;
 
-       if ((readl(&usart->sr) & USART_SR_FLAG_RXNE) == 0)
+       if ((readl(base + ISR_OFFSET(stm32f4)) & USART_SR_FLAG_RXNE) == 0)
                return -EAGAIN;
 
-       return readl(&usart->rd_dr);
+       return readl(base + RDR_OFFSET(stm32f4));
 }
 
 static int stm32_serial_putc(struct udevice *dev, const char c)
 {
-       struct stm32x7_serial_platdata *plat = dev->platdata;
-       struct stm32_usart *const usart = plat->base;
+       struct stm32x7_serial_platdata *plat = dev_get_platdata(dev);
+       bool stm32f4 = plat->uart_info->stm32f4;
+       fdt_addr_t base = plat->base;
 
-       if ((readl(&usart->sr) & USART_SR_FLAG_TXE) == 0)
+       if ((readl(base + ISR_OFFSET(stm32f4)) & USART_SR_FLAG_TXE) == 0)
                return -EAGAIN;
 
-       writel(c, &usart->tx_dr);
+       writel(c, base + TDR_OFFSET(stm32f4));
 
        return 0;
 }
 
 static int stm32_serial_pending(struct udevice *dev, bool input)
 {
-       struct stm32x7_serial_platdata *plat = dev->platdata;
-       struct stm32_usart *const usart = plat->base;
+       struct stm32x7_serial_platdata *plat = dev_get_platdata(dev);
+       bool stm32f4 = plat->uart_info->stm32f4;
+       fdt_addr_t base = plat->base;
 
        if (input)
-               return readl(&usart->sr) & USART_SR_FLAG_RXNE ? 1 : 0;
+               return readl(base + ISR_OFFSET(stm32f4)) &
+                       USART_SR_FLAG_RXNE ? 1 : 0;
        else
-               return readl(&usart->sr) & USART_SR_FLAG_TXE ? 0 : 1;
+               return readl(base + ISR_OFFSET(stm32f4)) &
+                       USART_SR_FLAG_TXE ? 0 : 1;
 }
 
 static int stm32_serial_probe(struct udevice *dev)
 {
-       struct stm32x7_serial_platdata *plat = dev->platdata;
-       struct stm32_usart *const usart = plat->base;
-
-#ifdef CONFIG_CLK
-       int ret;
+       struct stm32x7_serial_platdata *plat = dev_get_platdata(dev);
        struct clk clk;
+       fdt_addr_t base = plat->base;
+       int ret;
+       bool stm32f4;
+       u8 uart_enable_bit;
+
+       plat->uart_info = (struct stm32_uart_info *)dev_get_driver_data(dev);
+       stm32f4 = plat->uart_info->stm32f4;
+       uart_enable_bit = plat->uart_info->uart_enable_bit;
 
        ret = clk_get_by_index(dev, 0, &clk);
        if (ret < 0)
@@ -92,7 +102,6 @@ static int stm32_serial_probe(struct udevice *dev)
                dev_err(dev, "failed to enable clock\n");
                return ret;
        }
-#endif
 
        plat->clock_rate = clk_get_rate(&clk);
        if (plat->clock_rate < 0) {
@@ -100,37 +109,36 @@ static int stm32_serial_probe(struct udevice *dev)
                return plat->clock_rate;
        };
 
-       /* Disable usart-> disable overrun-> enable usart */
-       clrbits_le32(&usart->cr1, USART_CR1_RE | USART_CR1_TE | USART_CR1_UE);
-       setbits_le32(&usart->cr3, USART_CR3_OVRDIS);
-       setbits_le32(&usart->cr1, USART_CR1_RE | USART_CR1_TE | USART_CR1_UE);
+       /* Disable uart-> disable overrun-> enable uart */
+       clrbits_le32(base + CR1_OFFSET(stm32f4), USART_CR1_RE | USART_CR1_TE |
+                    BIT(uart_enable_bit));
+       if (plat->uart_info->has_overrun_disable)
+               setbits_le32(base + CR3_OFFSET(stm32f4), USART_CR3_OVRDIS);
+       if (plat->uart_info->has_fifo)
+               setbits_le32(base + CR1_OFFSET(stm32f4), USART_CR1_FIFOEN);
+       setbits_le32(base + CR1_OFFSET(stm32f4), USART_CR1_RE | USART_CR1_TE |
+                    BIT(uart_enable_bit));
 
        return 0;
 }
 
-#if CONFIG_IS_ENABLED(OF_CONTROL)
 static const struct udevice_id stm32_serial_id[] = {
-       {.compatible = "st,stm32f7-usart"},
-       {.compatible = "st,stm32f7-uart"},
-       {.compatible = "st,stm32h7-usart"},
-       {.compatible = "st,stm32h7-uart"},
+       { .compatible = "st,stm32-uart", .data = (ulong)&stm32f4_info},
+       { .compatible = "st,stm32f7-uart", .data = (ulong)&stm32f7_info},
+       { .compatible = "st,stm32h7-uart", .data = (ulong)&stm32h7_info},
        {}
 };
 
 static int stm32_serial_ofdata_to_platdata(struct udevice *dev)
 {
        struct stm32x7_serial_platdata *plat = dev_get_platdata(dev);
-       fdt_addr_t addr;
 
-       addr = devfdt_get_addr(dev);
-       if (addr == FDT_ADDR_T_NONE)
+       plat->base = devfdt_get_addr(dev);
+       if (plat->base == FDT_ADDR_T_NONE)
                return -EINVAL;
 
-       plat->base = (struct stm32_usart *)addr;
-
        return 0;
 }
-#endif
 
 static const struct dm_serial_ops stm32_serial_ops = {
        .putc = stm32_serial_putc,
index 9fe37af5cc998db1d3bb563fefe679a3a5364ca7..b914edf28a11905399c236a4312da671474bd797 100644 (file)
@@ -8,38 +8,65 @@
 #ifndef _SERIAL_STM32_X7_
 #define _SERIAL_STM32_X7_
 
-struct stm32_usart {
-       u32 cr1;
-       u32 cr2;
-       u32 cr3;
-       u32 brr;
-       u32 gtpr;
-       u32 rtor;
-       u32 rqr;
-       u32 sr;
-       u32 icr;
-       u32 rd_dr;
-       u32 tx_dr;
+#define CR1_OFFSET(x)  (x ? 0x0c : 0x00)
+#define CR3_OFFSET(x)  (x ? 0x14 : 0x08)
+#define BRR_OFFSET(x)  (x ? 0x08 : 0x0c)
+#define ISR_OFFSET(x)  (x ? 0x00 : 0x1c)
+/*
+ * STM32F4 has one Data Register (DR) for received or transmitted
+ * data, so map Receive Data Register (RDR) and Transmit Data
+ * Register (TDR) at the same offset
+ */
+#define RDR_OFFSET(x)  (x ? 0x04 : 0x24)
+#define TDR_OFFSET(x)  (x ? 0x04 : 0x28)
+
+struct stm32_uart_info {
+       u8 uart_enable_bit;     /* UART_CR1_UE */
+       bool stm32f4;           /* true for STM32F4, false otherwise */
+       bool has_overrun_disable;
+       bool has_fifo;
+};
+
+struct stm32_uart_info stm32f4_info = {
+       .stm32f4 = true,
+       .uart_enable_bit = 13,
+       .has_overrun_disable = false,
+       .has_fifo = false,
+};
+
+struct stm32_uart_info stm32f7_info = {
+       .uart_enable_bit = 0,
+       .stm32f4 = false,
+       .has_overrun_disable = true,
+       .has_fifo = false,
+};
+
+struct stm32_uart_info stm32h7_info = {
+       .uart_enable_bit = 0,
+       .stm32f4 = false,
+       .has_overrun_disable = true,
+       .has_fifo = true,
 };
 
 /* Information about a serial port */
 struct stm32x7_serial_platdata {
-       struct stm32_usart *base;  /* address of registers in physical memory */
+       fdt_addr_t base;  /* address of registers in physical memory */
+       struct stm32_uart_info *uart_info;
        unsigned long int clock_rate;
 };
 
-#define USART_CR1_OVER8                        (1 << 15)
-#define USART_CR1_TE                   (1 << 3)
-#define USART_CR1_RE                   (1 << 2)
-#define USART_CR1_UE                   (1 << 0)
+#define USART_CR1_FIFOEN               BIT(29)
+#define USART_CR1_OVER8                        BIT(15)
+#define USART_CR1_TE                   BIT(3)
+#define USART_CR1_RE                   BIT(2)
 
-#define USART_CR3_OVRDIS               (1 << 12)
+#define USART_CR3_OVRDIS               BIT(12)
 
-#define USART_SR_FLAG_RXNE             (1 << 5)
-#define USART_SR_FLAG_TXE              (1 << 7)
+#define USART_SR_FLAG_RXNE             BIT(5)
+#define USART_SR_FLAG_TXE              BIT(7)
 
-#define USART_BRR_F_MASK               0xFF
+#define USART_BRR_F_MASK               GENMASK(7, 0)
 #define USART_BRR_M_SHIFT              4
-#define USART_BRR_M_MASK               0xFFF0
+#define USART_BRR_M_MASK               GENMASK(15, 4)
 
 #endif
index 7ba7b580db1158f5ee4acaa8b004f603e7519efe..e6b7f11dc9d33401a3fefdfd49a59b0e4066d2b6 100644 (file)
@@ -65,6 +65,14 @@ config VIDEO_BPP32
          this option, such displays will not be supported and console output
          will be empty.
 
+config VIDEO_ANSI
+       bool "Support ANSI escape sequences in video console"
+       depends on DM_VIDEO
+       default y if DM_VIDEO
+       help
+         Enable ANSI escape sequence decoding for a more fully functional
+         console.
+
 config CONSOLE_NORMAL
        bool "Support a simple text console"
        depends on DM_VIDEO
index b5afd72227c7a6460cc5c5c0a268d93f84d990b0..5f63c12d6c5924bf19c72234abb06f57fcecb8ab 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <linux/ctype.h>
 #include <dm.h>
 #include <video.h>
 #include <video_console.h>
@@ -107,12 +108,213 @@ static void vidconsole_newline(struct udevice *dev)
        video_sync(dev->parent);
 }
 
+static const struct {
+       unsigned r;
+       unsigned g;
+       unsigned b;
+} colors[] = {
+       { 0x00, 0x00, 0x00 },  /* black */
+       { 0xff, 0x00, 0x00 },  /* red */
+       { 0x00, 0xff, 0x00 },  /* green */
+       { 0xff, 0xff, 0x00 },  /* yellow */
+       { 0x00, 0x00, 0xff },  /* blue */
+       { 0xff, 0x00, 0xff },  /* magenta */
+       { 0x00, 0xff, 0xff },  /* cyan */
+       { 0xff, 0xff, 0xff },  /* white */
+};
+
+static void set_color(struct video_priv *priv, unsigned idx, unsigned *c)
+{
+       switch (priv->bpix) {
+       case VIDEO_BPP16:
+               *c = ((colors[idx].r >> 3) << 0) |
+                    ((colors[idx].g >> 2) << 5) |
+                    ((colors[idx].b >> 3) << 11);
+               break;
+       case VIDEO_BPP32:
+               *c = 0xff000000 |
+                    (colors[idx].r << 0) |
+                    (colors[idx].g << 8) |
+                    (colors[idx].b << 16);
+               break;
+       default:
+               /* unsupported, leave current color in place */
+               break;
+       }
+}
+
+static char *parsenum(char *s, int *num)
+{
+       char *end;
+       *num = simple_strtol(s, &end, 10);
+       return end;
+}
+
+/*
+ * Process a character while accumulating an escape string.  Chars are
+ * accumulated into escape_buf until the end of escape sequence is
+ * found, at which point the sequence is parsed and processed.
+ */
+static void vidconsole_escape_char(struct udevice *dev, char ch)
+{
+       struct vidconsole_priv *priv = dev_get_uclass_priv(dev);
+
+       if (!IS_ENABLED(CONFIG_VIDEO_ANSI))
+               goto error;
+
+       /* Sanity checking for bogus ESC sequences: */
+       if (priv->escape_len >= sizeof(priv->escape_buf))
+               goto error;
+       if (priv->escape_len == 0 && ch != '[')
+               goto error;
+
+       priv->escape_buf[priv->escape_len++] = ch;
+
+       /*
+        * Escape sequences are terminated by a letter, so keep
+        * accumulating until we get one:
+        */
+       if (!isalpha(ch))
+               return;
+
+       /*
+        * clear escape mode first, otherwise things will get highly
+        * surprising if you hit any debug prints that come back to
+        * this console.
+        */
+       priv->escape = 0;
+
+       switch (ch) {
+       case 'H':
+       case 'f': {
+               int row, col;
+               char *s = priv->escape_buf;
+
+               /*
+                * Set cursor position: [%d;%df or [%d;%dH
+                */
+               s++;    /* [ */
+               s = parsenum(s, &row);
+               s++;    /* ; */
+               s = parsenum(s, &col);
+
+               priv->ycur = row * priv->y_charsize;
+               priv->xcur_frac = priv->xstart_frac +
+                       VID_TO_POS(col * priv->x_charsize);
+
+               break;
+       }
+       case 'J': {
+               int mode;
+
+               /*
+                * Clear part/all screen:
+                *   [J or [0J - clear screen from cursor down
+                *   [1J       - clear screen from cursor up
+                *   [2J       - clear entire screen
+                *
+                * TODO we really only handle entire-screen case, others
+                * probably require some additions to video-uclass (and
+                * are not really needed yet by efi_console)
+                */
+               parsenum(priv->escape_buf + 1, &mode);
+
+               if (mode == 2) {
+                       video_clear(dev->parent);
+                       video_sync(dev->parent);
+                       priv->ycur = 0;
+                       priv->xcur_frac = priv->xstart_frac;
+               } else {
+                       debug("unsupported clear mode: %d\n", mode);
+               }
+               break;
+       }
+       case 'm': {
+               struct video_priv *vid_priv = dev_get_uclass_priv(dev->parent);
+               char *s = priv->escape_buf;
+               char *end = &priv->escape_buf[priv->escape_len];
+
+               /*
+                * Set graphics mode: [%d;...;%dm
+                *
+                * Currently only supports the color attributes:
+                *
+                * Foreground Colors:
+                *
+                *   30 Black
+                *   31 Red
+                *   32 Green
+                *   33 Yellow
+                *   34 Blue
+                *   35 Magenta
+                *   36 Cyan
+                *   37 White
+                *
+                * Background Colors:
+                *
+                *   40 Black
+                *   41 Red
+                *   42 Green
+                *   43 Yellow
+                *   44 Blue
+                *   45 Magenta
+                *   46 Cyan
+                *   47 White
+                */
+
+               s++;    /* [ */
+               while (s < end) {
+                       int val;
+
+                       s = parsenum(s, &val);
+                       s++;
+
+                       switch (val) {
+                       case 30 ... 37:
+                               /* fg color */
+                               set_color(vid_priv, val - 30,
+                                         (unsigned *)&vid_priv->colour_fg);
+                               break;
+                       case 40 ... 47:
+                               /* bg color */
+                               set_color(vid_priv, val - 40,
+                                         (unsigned *)&vid_priv->colour_bg);
+                               break;
+                       default:
+                               /* unknown/unsupported */
+                               break;
+                       }
+               }
+
+               break;
+       }
+       default:
+               debug("unrecognized escape sequence: %*s\n",
+                     priv->escape_len, priv->escape_buf);
+       }
+
+       return;
+
+error:
+       /* something went wrong, just revert to normal mode: */
+       priv->escape = 0;
+}
+
 int vidconsole_put_char(struct udevice *dev, char ch)
 {
        struct vidconsole_priv *priv = dev_get_uclass_priv(dev);
        int ret;
 
+       if (priv->escape) {
+               vidconsole_escape_char(dev, ch);
+               return 0;
+       }
+
        switch (ch) {
+       case '\x1b':
+               priv->escape_len = 0;
+               priv->escape = 1;
+               break;
        case '\a':
                /* beep */
                break;
@@ -163,6 +365,7 @@ static void vidconsole_putc(struct stdio_dev *sdev, const char ch)
        struct udevice *dev = sdev->priv;
 
        vidconsole_put_char(dev, ch);
+       video_sync(dev->parent);
 }
 
 static void vidconsole_puts(struct stdio_dev *sdev, const char *s)
@@ -260,6 +463,8 @@ static int do_video_puts(cmd_tbl_t *cmdtp, int flag, int argc,
        for (s = argv[1]; *s; s++)
                vidconsole_put_char(dev, *s);
 
+       video_sync(dev->parent);
+
        return 0;
 }
 
index dfa39b0d1b893ad774e0fa35bb57760b34bf8973..dcaceed42c4e66821133fad83136c9aaf1b78b69 100644 (file)
@@ -87,7 +87,7 @@ int video_reserve(ulong *addrp)
        return 0;
 }
 
-static int video_clear(struct udevice *dev)
+void video_clear(struct udevice *dev)
 {
        struct video_priv *priv = dev_get_uclass_priv(dev);
 
@@ -100,8 +100,6 @@ static int video_clear(struct udevice *dev)
        } else {
                memset(priv->fb, priv->colour_bg, priv->fb_size);
        }
-
-       return 0;
 }
 
 /* Flush video activity to the caches */
index 3d3e17e8facc839fe120fe0536d6ded6ad9bdbe2..7fe78439cf162bb264751cac0bb569521406c610 100644 (file)
@@ -495,7 +495,7 @@ read_bootsectandvi(boot_sector *bs, volume_info *volinfo, int *fatsize)
                return -1;
        }
 
-       block = memalign(ARCH_DMA_MINALIGN, cur_dev->blksz);
+       block = malloc_cache_aligned(cur_dev->blksz);
        if (block == NULL) {
                debug("Error: allocating block\n");
                return -1;
@@ -599,7 +599,7 @@ static int get_fs_info(fsdata *mydata)
 
        mydata->fatbufnum = -1;
        mydata->fat_dirty = 0;
-       mydata->fatbuf = memalign(ARCH_DMA_MINALIGN, FATBUFSIZE);
+       mydata->fatbuf = malloc_cache_aligned(FATBUFSIZE);
        if (mydata->fatbuf == NULL) {
                debug("Error: allocating memory\n");
                return -1;
@@ -1038,13 +1038,16 @@ int fat_exists(const char *filename)
        fat_itr *itr;
        int ret;
 
-       itr = malloc(sizeof(fat_itr));
+       itr = malloc_cache_aligned(sizeof(fat_itr));
+       if (!itr)
+               return 0;
        ret = fat_itr_root(itr, &fsdata);
        if (ret)
-               return 0;
+               goto out;
 
        ret = fat_itr_resolve(itr, filename, TYPE_ANY);
        free(fsdata.fatbuf);
+out:
        free(itr);
        return ret == 0;
 }
@@ -1055,10 +1058,12 @@ int fat_size(const char *filename, loff_t *size)
        fat_itr *itr;
        int ret;
 
-       itr = malloc(sizeof(fat_itr));
+       itr = malloc_cache_aligned(sizeof(fat_itr));
+       if (!itr)
+               return -ENOMEM;
        ret = fat_itr_root(itr, &fsdata);
        if (ret)
-               return ret;
+               goto out_free_itr;
 
        ret = fat_itr_resolve(itr, filename, TYPE_FILE);
        if (ret) {
@@ -1072,12 +1077,13 @@ int fat_size(const char *filename, loff_t *size)
                        *size = 0;
                        ret = 0;
                }
-               goto out;
+               goto out_free_both;
        }
 
        *size = FAT2CPU32(itr->dent->size);
+out_free_both:
        free(fsdata.fatbuf);
-out:
+out_free_itr:
        free(itr);
        return ret;
 }
@@ -1089,20 +1095,23 @@ int file_fat_read_at(const char *filename, loff_t pos, void *buffer,
        fat_itr *itr;
        int ret;
 
-       itr = malloc(sizeof(fat_itr));
+       itr = malloc_cache_aligned(sizeof(fat_itr));
+       if (!itr)
+               return -ENOMEM;
        ret = fat_itr_root(itr, &fsdata);
        if (ret)
-               return ret;
+               goto out_free_itr;
 
        ret = fat_itr_resolve(itr, filename, TYPE_FILE);
        if (ret)
-               goto out;
+               goto out_free_both;
 
        printf("reading %s\n", filename);
        ret = get_contents(&fsdata, itr->dent, pos, buffer, maxsize, actread);
 
-out:
+out_free_both:
        free(fsdata.fatbuf);
+out_free_itr:
        free(itr);
        return ret;
 }
@@ -1148,17 +1157,18 @@ int fat_opendir(const char *filename, struct fs_dir_stream **dirsp)
 
        ret = fat_itr_root(&dir->itr, &dir->fsdata);
        if (ret)
-               goto fail;
+               goto fail_free_dir;
 
        ret = fat_itr_resolve(&dir->itr, filename, TYPE_DIR);
        if (ret)
-               goto fail;
+               goto fail_free_both;
 
        *dirsp = (struct fs_dir_stream *)dir;
        return 0;
 
-fail:
+fail_free_both:
        free(dir->fsdata.fatbuf);
+fail_free_dir:
        free(dir);
        return ret;
 }
index 1d4971c59f9da21436e1e1992546d1b646700b89..9450784521dd05e57ca88bcaee775cc5eaf93103 100644 (file)
 /* 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
  */
index 4f24a56899a982caed671cf5d656ada8a3fa4cee..545ba1740de8a5a7efa7e4fb778b45d53ad931b7 100644 (file)
 #define CONFIG_SF_DEFAULT_SPEED                30000000
 #endif
 
-/* LCD */
-
-#ifdef CONFIG_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
-#endif
-
 #ifdef CONFIG_SD_BOOT
 
 /* bootstrap + u-boot + env in sd card */
index bd93a1e84c37aaff8eabf9e2877ac9b7eef9490c..9ec1e76052685855713fc27d0b0b1ec7fd57a11e 100644 (file)
  */
 #define ATMEL_PMC_UHP                  (1 <<  6)
 
-/* 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
-
 /* board specific (not enough SRAM) */
 #define CONFIG_SAMA5D3_LCD_BASE                0x23E00000
 
index 5dc5e7dd0c575415ff9e7bc835a8d6a39fc77dd2..6aa4bcc5c55e10b5fbab0343915b99a74cc019f1 100644 (file)
 #define CONFIG_ATMEL_NAND_HW_PMECC
 #endif
 
-/* LCD */
-#ifdef CONFIG_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
-#endif
-
 /* SPL */
 #define CONFIG_SPL_FRAMEWORK
 #define CONFIG_SPL_TEXT_BASE           0x200000
index 94e8e893c0619782f8700a74f59dffc3b9ebcf3a..a46e3508bf5a1ec690a946fc390711d91204633c 100644 (file)
 #define CONFIG_ATMEL_NAND_HW_PMECC
 #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 */
 #define CONFIG_SPL_FRAMEWORK
 #define CONFIG_SPL_TEXT_BASE           0x200000
index 372c08360122b59b0b7f6323dfba5df49bab8afc..958d5cc54c84ea1a0f27f8960c3d33c5debb0685 100644 (file)
 #define CONFIG_NR_DRAM_BANKS           1
 #define PHYS_SDRAM_1                   0x40000000
 #define CONFIG_SYS_SDRAM_BASE          PHYS_SDRAM_1
-#define PHYS_SDRAM_1_SIZE              0x3FE00000
+#define PHYS_SDRAM_1_SIZE              0x3E000000
 #define CONFIG_SYS_TEXT_BASE           0x7D600000
 #define CONFIG_SYS_LOAD_ADDR           PHYS_SDRAM_1    /* default load addr */
 
 #define CONFIG_SYS_HZ_CLOCK            1000000000      /* 1 GHz */
 
+#include <config_distro_defaults.h>
 /* Environment */
-#define CONFIG_EXTRA_ENV_SETTINGS \
-       "board= B2260" \
-       "load_addr= #CONFIG_SYS_LOAD_ADDR \0"
+
+#define CONFIG_LOADADDR                        CONFIG_SYS_LOAD_ADDR
+
+#define CONFIG_ENV_VARS_UBOOT_CONFIG
+
+#define BOOT_TARGET_DEVICES(func) \
+       func(MMC, mmc, 0) \
+       func(USB, usb, 0) \
+       func(DHCP, dhcp, na)
+#include <config_distro_bootcmd.h>
+#define CONFIG_BOOTFILE                        "uImage"
+#define CONFIG_EXTRA_ENV_SETTINGS                              \
+                       "kernel_addr_r=0x40000000\0"            \
+                       "fdtfile=stih410-b2260.dtb\0"           \
+                       "fdt_addr_r=0x47000000\0"               \
+                       "scriptaddr=0x50000000\0"               \
+                       "fdt_high=0xffffffffffffffff\0"         \
+                       "initrd_high=0xffffffffffffffff\0"      \
+                       "ramdisk_addr_r=0x48000000\0"           \
+                       BOOTENV
+
 
 #define CONFIG_ENV_SIZE 0x4000
 
index b0061cd0de1f8efd360856d1ac5010d2b81990a5..967c5e570210dfa4cfe6233da9d21f97f32c63ff 100644 (file)
@@ -11,7 +11,7 @@
 #include <config.h>
 
 #define CONFIG_SYS_FLASH_BASE          0x08000000
-#define CONFIG_SYS_INIT_SP_ADDR                0x30020000
+#define CONFIG_SYS_INIT_SP_ADDR                0x24040000
 #define CONFIG_SYS_TEXT_BASE           0x08000000
 
 /*
index b0061cd0de1f8efd360856d1ac5010d2b81990a5..967c5e570210dfa4cfe6233da9d21f97f32c63ff 100644 (file)
@@ -11,7 +11,7 @@
 #include <config.h>
 
 #define CONFIG_SYS_FLASH_BASE          0x08000000
-#define CONFIG_SYS_INIT_SP_ADDR                0x30020000
+#define CONFIG_SYS_INIT_SP_ADDR                0x24040000
 #define CONFIG_SYS_TEXT_BASE           0x08000000
 
 /*
index 5b4e78b18257b40805ff3e84ddb3fec52ac14186..61ff6531215aca9b083431f1c800f4ce222ea830 100644 (file)
@@ -114,6 +114,13 @@ struct video_ops {
  */
 int video_reserve(ulong *addrp);
 
+/**
+ * video_clear() - Clear a device's frame buffer to background color.
+ *
+ * @dev:       Device to clear
+ */
+void video_clear(struct udevice *dev);
+
 /**
  * video_sync() - Sync a device's frame buffer with its hardware
  *
index 26047934da8c59b4646caa6cb9f8a631d1ce0561..9dce234bd928cf24372532c0923f868f44b1a326 100644 (file)
@@ -29,6 +29,9 @@
  * @xsize_frac:        Width of the display in fractional units
  * @xstart_frac:       Left margin for the text console in fractional units
  * @last_ch:   Last character written to the text console on this line
+ * @escape:    TRUE if currently accumulating an ANSI escape sequence
+ * @escape_len:        Length of accumulated escape sequence so far
+ * @escape_buf:        Buffer to accumulate escape sequence
  */
 struct vidconsole_priv {
        struct stdio_dev sdev;
@@ -42,6 +45,14 @@ struct vidconsole_priv {
        int xsize_frac;
        int xstart_frac;
        int last_ch;
+       /*
+        * ANSI escape sequences are accumulated character by character,
+        * starting after the ESC char (0x1b) until the entire sequence
+        * is consumed at which point it is acted upon.
+        */
+       int escape;
+       int escape_len;
+       char escape_buf[32];
 };
 
 /**
index b04f7c6297598b51372eeb586a112b1db83cfae5..f4f1bb8ffd5a54fe102a281e718888f6ea6c62d9 100644 (file)
@@ -38,5 +38,7 @@ int main(void)
 
        DEFINE(GD_START_ADDR_SP, offsetof(struct global_data, start_addr_sp));
 
+       DEFINE(GD_NEW_GD, offsetof(struct global_data, new_gd));
+
        return 0;
 }
diff --git a/scripts/Kconfig b/scripts/Kconfig
deleted file mode 100644 (file)
index 2a2c18e..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-config BUILD_BIN2C
-       bool
index 4d000fa1bea5b41681b763b0dd318dd52d6f4afd..29917d0c2d831beaf2387db1cfd9d5651f999af2 100644 (file)
@@ -100,6 +100,14 @@ static int select_vidconsole(struct unit_test_state *uts, const char *drv_name)
        return 0;
 }
 
+static void vidconsole_put_string(struct udevice *dev, const char *str)
+{
+       const char *s;
+
+       for (s = str; *s; s++)
+               vidconsole_put_char(dev, *s);
+}
+
 /* Test text output works on the video console */
 static int dm_test_video_text(struct unit_test_state *uts)
 {
@@ -140,19 +148,51 @@ static int dm_test_video_chars(struct unit_test_state *uts)
 {
        struct udevice *dev, *con;
        const char *test_string = "Well\b\b\b\bxhe is\r \n\ta very \amodest  \bman\n\t\tand Has much to\b\bto be modest about.";
-       const char *s;
 
        ut_assertok(select_vidconsole(uts, "vidconsole0"));
        ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev));
        ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
-       for (s = test_string; *s; s++)
-               vidconsole_put_char(con, *s);
+       vidconsole_put_string(con, test_string);
        ut_asserteq(466, compress_frame_buffer(dev));
 
        return 0;
 }
 DM_TEST(dm_test_video_chars, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
 
+#ifdef CONFIG_VIDEO_ANSI
+#define ANSI_ESC "\x1b"
+/* Test handling of ANSI escape sequences */
+static int dm_test_video_ansi(struct unit_test_state *uts)
+{
+       struct udevice *dev, *con;
+
+       ut_assertok(select_vidconsole(uts, "vidconsole0"));
+       ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev));
+       ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
+
+       /* reference clear: */
+       video_clear(con->parent);
+       video_sync(con->parent);
+       ut_asserteq(46, compress_frame_buffer(dev));
+
+       /* test clear escape sequence: [2J */
+       vidconsole_put_string(con, "A\tB\tC"ANSI_ESC"[2J");
+       ut_asserteq(46, compress_frame_buffer(dev));
+
+       /* test set-cursor: [%d;%df */
+       vidconsole_put_string(con, "abc"ANSI_ESC"[2;2fab"ANSI_ESC"[4;4fcd");
+       ut_asserteq(142, compress_frame_buffer(dev));
+
+       /* test colors (30-37 fg color, 40-47 bg color) */
+       vidconsole_put_string(con, ANSI_ESC"[30;41mfoo"); /* black on red */
+       vidconsole_put_string(con, ANSI_ESC"[33;44mbar"); /* yellow on blue */
+       ut_asserteq(268, compress_frame_buffer(dev));
+
+       return 0;
+}
+DM_TEST(dm_test_video_ansi, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
+#endif
+
 /**
  * check_vidconsole_output() - Run a text console test
  *
@@ -294,12 +334,10 @@ static int dm_test_video_truetype(struct unit_test_state *uts)
 {
        struct udevice *dev, *con;
        const char *test_string = "Criticism may not be agreeable, but it is necessary. It fulfils the same function as pain in the human body. It calls attention to an unhealthy state of things. Some see private enterprise as a predatory target to be shot, others as a cow to be milked, but few are those who see it as a sturdy horse pulling the wagon. The \aprice OF\b\bof greatness\n\tis responsibility.\n\nBye";
-       const char *s;
 
        ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev));
        ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
-       for (s = test_string; *s; s++)
-               vidconsole_put_char(con, *s);
+       vidconsole_put_string(con, test_string);
        ut_asserteq(12619, compress_frame_buffer(dev));
 
        return 0;
@@ -312,7 +350,6 @@ static int dm_test_video_truetype_scroll(struct unit_test_state *uts)
        struct sandbox_sdl_plat *plat;
        struct udevice *dev, *con;
        const char *test_string = "Criticism may not be agreeable, but it is necessary. It fulfils the same function as pain in the human body. It calls attention to an unhealthy state of things. Some see private enterprise as a predatory target to be shot, others as a cow to be milked, but few are those who see it as a sturdy horse pulling the wagon. The \aprice OF\b\bof greatness\n\tis responsibility.\n\nBye";
-       const char *s;
 
        ut_assertok(uclass_find_device(UCLASS_VIDEO, 0, &dev));
        ut_assert(!device_active(dev));
@@ -321,8 +358,7 @@ static int dm_test_video_truetype_scroll(struct unit_test_state *uts)
 
        ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev));
        ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
-       for (s = test_string; *s; s++)
-               vidconsole_put_char(con, *s);
+       vidconsole_put_string(con, test_string);
        ut_asserteq(33849, compress_frame_buffer(dev));
 
        return 0;
@@ -335,7 +371,6 @@ static int dm_test_video_truetype_bs(struct unit_test_state *uts)
        struct sandbox_sdl_plat *plat;
        struct udevice *dev, *con;
        const char *test_string = "...Criticism may or may\b\b\b\b\b\bnot be agreeable, but seldom it is necessary\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\bit is necessary. It fulfils the same function as pain in the human body. It calls attention to an unhealthy state of things.";
-       const char *s;
 
        ut_assertok(uclass_find_device(UCLASS_VIDEO, 0, &dev));
        ut_assert(!device_active(dev));
@@ -344,8 +379,7 @@ static int dm_test_video_truetype_bs(struct unit_test_state *uts)
 
        ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev));
        ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
-       for (s = test_string; *s; s++)
-               vidconsole_put_char(con, *s);
+       vidconsole_put_string(con, test_string);
        ut_asserteq(34871, compress_frame_buffer(dev));
 
        return 0;