diff --git a/arch/arm/cpu/arm926ejs/cpu.c b/arch/arm/cpu/arm926ejs/cpu.c index 93d7a02ed..76c54fb22 100755 --- a/arch/arm/cpu/arm926ejs/cpu.c +++ b/arch/arm/cpu/arm926ejs/cpu.c @@ -16,8 +16,11 @@ #include #include #include +#include #include #include +#include +#include static void cache_flush(void); @@ -41,6 +44,12 @@ int cleanup_before_linux (void) /* flush I/D-cache */ cache_flush(); + /* turn off video backend */ + mdelay(50); + struct sunxi_lcdc_reg * const lcdc = + (struct sunxi_lcdc_reg *)SUNXI_LCD0_BASE; + writel(0, &lcdc->tcon0_cpu_intf); + return 0; } diff --git a/arch/arm/dts/suniv-f1c100s.dtsi b/arch/arm/dts/suniv-f1c100s.dtsi index 8091191d6..53982cdf1 100755 --- a/arch/arm/dts/suniv-f1c100s.dtsi +++ b/arch/arm/dts/suniv-f1c100s.dtsi @@ -107,6 +107,35 @@ interrupt-controller; #interrupt-cells = <3>; #gpio-cells = <3>; + pa: pa { + gpio-controller; + #gpio-cells = <2>; + }; + + pb: pb { + gpio-controller; + #gpio-cells = <2>; + }; + + pc: pc { + gpio-controller; + #gpio-cells = <2>; + }; + + pd: pd { + gpio-controller; + #gpio-cells = <2>; + }; + + pe: pe { + gpio-controller; + #gpio-cells = <2>; + }; + + pf: pf { + gpio-controller; + #gpio-cells = <2>; + }; spi0_pins_a: spi0-pins-pc { pins = "PC0", "PC1", "PC2", "PC3"; diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c index 2df98d3e0..a1a4ab2e6 100755 --- a/arch/arm/lib/bootm.c +++ b/arch/arm/lib/bootm.c @@ -111,8 +111,14 @@ static void announce_and_cleanup(int fake) #endif board_quiesce_devices(); - - printf("\nStarting kernel ...%s\n\n", fake ? + char *console_variant = env_get("CONSOLE_VARIANT"); + if (console_variant) + printf("Console variant: %s\n", console_variant); + char *console_video = env_get("CONSOLE_VIDEO"); + if (console_variant) { + printf("Console video: %s", console_video); + } + printf("\nStarting kernel ...%s", fake ? "(fake run for tracing)" : ""); /* * Call remove function of all devices with a removal flag set. diff --git a/common/splash.c b/common/splash.c index 2b9313e03..3cf015173 100755 --- a/common/splash.c +++ b/common/splash.c @@ -82,11 +82,9 @@ static inline int splash_video_logo_load(void) { return -ENOSYS; } __weak int splash_screen_prepare(void) { - if (CONFIG_IS_ENABLED(SPLASH_SOURCE)) - return splash_source_load(default_splash_locations, - ARRAY_SIZE(default_splash_locations)); + return splash_source_load(default_splash_locations, + ARRAY_SIZE(default_splash_locations)); - return splash_video_logo_load(); } #ifdef CONFIG_SPLASH_SCREEN_ALIGN diff --git a/configs/miyoo_defconfig b/configs/miyoo_defconfig index c90e94f74..8f2f5a419 100644 --- a/configs/miyoo_defconfig +++ b/configs/miyoo_defconfig @@ -2,22 +2,29 @@ CONFIG_ARM=y CONFIG_ARCH_SUNXI=y CONFIG_SYS_TEXT_BASE=0x81700000 CONFIG_SPL=y +CONFIG_IDENT_STRING=" Miyoo CFW 2.0" CONFIG_MACH_SUNIV=y CONFIG_DRAM_CLK=174 CONFIG_DRAM_ZQ=0 CONFIG_MMC_SUNXI_SLOT_EXTRA=1 -CONFIG_VIDEO_LCD_MODE="x:480,y:272,depth:18,pclk_khz:9000,le:39,ri:8,up:2,lo:4,hs:4,vs:10,sync:3,vmode:0" +CONFIG_VIDEO_LCD_MODE="x:320,y:240,depth:18,pclk_khz:9000,le:39,ri:8,up:2,lo:4,hs:4,vs:10,sync:3,vmode:0" CONFIG_SPL_SPI_SUNXI=y CONFIG_BOOTDELAY=0 CONFIG_USE_BOOTARGS=y CONFIG_BOOTARGS="console=tty0 console=ttyS1,115200 panic=5 rootwait quiet lpj=1015808 root=/dev/mmcblk0p2 ro" -CONFIG_BOOTCOMMAND="setenv lcd_bl_pin 134; run distro_bootcmd;" +CONFIG_BOOTCOMMAND="env export -t 0x81000000; fatwrite mmc 0:1 0x81000000 uEnv.txt ${filesize}; run distro_bootcmd;" +CONFIG_DISABLE_CONSOLE=y +CONFIG_SILENT_CONSOLE=y +# CONFIG_DISPLAY_CPUINFO is not set +# CONFIG_DISPLAY_BOARDINFO is not set CONFIG_CMD_DFU=y CONFIG_CMD_MTD=y CONFIG_CMD_USB_MASS_STORAGE=y +CONFIG_CMD_BMP=y CONFIG_CMD_MTDPARTS=y CONFIG_DEFAULT_DEVICE_TREE="suniv-f1c100s-generic" # CONFIG_ENV_IS_IN_FAT is not set +CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y # CONFIG_NET is not set CONFIG_DFU_TIMEOUT=y CONFIG_DFU_MMC=y @@ -36,3 +43,5 @@ CONFIG_DM_SPI=y CONFIG_USB_MUSB_GADGET=y CONFIG_USB_GADGET_VBUS_DRAW=250 CONFIG_USB_GADGET_DOWNLOAD=y +# CONFIG_VIDEO_SW_CURSOR is not set +# CONFIG_VIDEO_DT_SIMPLEFB is not set diff --git a/drivers/video/sunxi/lcdc.c b/drivers/video/sunxi/lcdc.c index 73033c3b8..3bc1f29c5 100755 --- a/drivers/video/sunxi/lcdc.c +++ b/drivers/video/sunxi/lcdc.c @@ -46,6 +46,7 @@ void lcdc_init(struct sunxi_lcdc_reg * const lcdc) void lcdc_enable(struct sunxi_lcdc_reg * const lcdc, int depth) { setbits_le32(&lcdc->ctrl, SUNXI_LCDC_CTRL_TCON_ENABLE); + setbits_le32(&lcdc->tcon0_cpu_intf, (1 << 28)); #ifdef CONFIG_VIDEO_LCD_IF_LVDS setbits_le32(&lcdc->tcon0_lvds_intf, SUNXI_LCDC_TCON0_LVDS_INTF_ENABLE); setbits_le32(&lcdc->lvds_ana0, SUNXI_LCDC_LVDS_ANA0); @@ -84,7 +85,7 @@ void lcdc_tcon0_mode_set(struct sunxi_lcdc_reg * const lcdc, clk_delay = lcdc_get_clk_delay(mode, 0); writel(SUNXI_LCDC_TCON0_CTRL_ENABLE | - SUNXI_LCDC_TCON0_CTRL_CLK_DELAY(clk_delay), &lcdc->tcon0_ctrl); + SUNXI_LCDC_TCON0_CTRL_CLK_DELAY(clk_delay) | (1 << 24), &lcdc->tcon0_ctrl); writel(SUNXI_LCDC_TCON0_DCLK_ENABLE | SUNXI_LCDC_TCON0_DCLK_DIV(clk_div), &lcdc->tcon0_dclk); @@ -107,7 +108,7 @@ void lcdc_tcon0_mode_set(struct sunxi_lcdc_reg * const lcdc, SUNXI_LCDC_Y(mode->vsync_len.typ), &lcdc->tcon0_timing_sync); writel(0, &lcdc->tcon0_hv_intf); - writel(0, &lcdc->tcon0_cpu_intf); + writel((4 << 29) | (1 << 26), &lcdc->tcon0_cpu_intf); #endif #ifdef CONFIG_VIDEO_LCD_IF_LVDS val = (depth == 18) ? 1 : 0; diff --git a/drivers/video/sunxi/sunxi_display.c b/drivers/video/sunxi/sunxi_display.c index 1b10eb445..2bb3e5a88 100755 --- a/drivers/video/sunxi/sunxi_display.c +++ b/drivers/video/sunxi/sunxi_display.c @@ -464,9 +464,6 @@ static void lcd_init(void) //Read device panel version miyoo_ver = readID(); - // write detected panel to SD to uEnv.txt file - run_command("env export -t 0x81000000", 0); - run_command("fatwrite mmc 0:1 0x81000000 uEnv.txt ${filesize}", 0); switch (miyoo_ver) { case 1: @@ -1744,6 +1741,7 @@ static void sunxi_lcdc_panel_enable(void) if (reset_pin >= 0) gpio_direction_output(reset_pin, 1); /* De-assert reset */ + sunxi_gpio_set_cfgpin(SUNXI_GPE(6), SUNXI_GPIO_OUTPUT); } static void sunxi_lcdc_backlight_enable(void) @@ -2128,6 +2126,8 @@ static void sunxi_mode_set(const struct ctfb_res_modes *mode, i2c_reg_write(0x5c, 0x04, 0x42); /* Turn on the LCD */ i2c_set_bus_num(orig_i2c_bus); } + sunxi_lcdc_gpio_config(); + lcd_init(); sunxi_composer_mode_set(mode, address); sunxi_lcdc_tcon0_mode_set(mode, false); sunxi_composer_enable(); @@ -2500,46 +2500,6 @@ void *video_hw_init(void) graphic_device->winSizeX = mode->xres - 2 * overscan_x; graphic_device->winSizeY = mode->yres - 2 * overscan_y; graphic_device->plnSizeX = mode->xres * graphic_device->gdfBytesPP; - - sunxi_lcdc_gpio_config(); - lcd_init(); - - uint16_t bug=3; - bmp_logo = run_command("load mmc 0:1 0x80000000 miyoo-boot.bmp", 0); - if (bmp_logo == 0) { - load_bmp_logo(); - } - - while (bug--) { - uint16_t x, y; - if (bmp_logo == 0) - cnt = image_size; - else - cnt = 0; - if (miyoo_ver != 3) - lcd_wr_cmd(writeScreenReg); - for (y=0; y<240; y++) { - for (x=0; x<320; x++) { - if (bmp_logo == 0) { - cnt--; - lcd_wr_dat(p[cnt - 2 * (cnt % width) + width + data_offset - 1]); - if (cnt == 0) - cnt = image_size; - } else { - lcd_wr_dat(p[cnt++]); - } - } - } - } - console_variant = env_get("DETECTED_VERSION"); - if (console_variant && miyoo_ver <= 4) { // panel ver 5 and 6 have different row/col registers - lcd_set_font(&t_8x12_full); - lcd_print("Detected device: "); - lcd_print(console_variant); - } - - if (miyoo_ver != 3) - lcd_wr_cmd(writeScreenReg); return graphic_device; } diff --git a/include/configs/suniv.h b/include/configs/suniv.h index e7cbaf9ed..92ce4e986 100755 --- a/include/configs/suniv.h +++ b/include/configs/suniv.h @@ -15,10 +15,14 @@ #define CONFIG_SYS_DFU_DATA_BUF_SIZE (512*1024) #ifdef CONFIG_VIDEO +#define CONFIG_VIDEO_LOGO #define CONFIG_BMP_16BPP #define CONFIG_BMP_24BPP #define CONFIG_BMP_32BPP -#undef CONFIG_VIDEO_LOGO +#define CONFIG_VIDEO_BMP_LOGO +#define CONFIG_SPLASH_SCREEN +#define CONFIG_SPLASH_SOURCE + #endif #endif /* __CONFIG_H */ diff --git a/include/env_default.h b/include/env_default.h index a657927e0..c2837a10d 100755 --- a/include/env_default.h +++ b/include/env_default.h @@ -104,6 +104,10 @@ const uchar default_environment[] = { #ifdef CONFIG_SYS_SOC "soc=" CONFIG_SYS_SOC "\0" #endif + "splashfile=" "miyoo-splash.bmp" "\0" + "splashsource=" "mmc_fs" "\0" + "splashimage=" "0x80000000" "\0" + "silent=" "1" "\0" #endif #if defined(CONFIG_BOOTCOUNT_BOOTLIMIT) && (CONFIG_BOOTCOUNT_BOOTLIMIT > 0) "bootlimit=" __stringify(CONFIG_BOOTCOUNT_BOOTLIMIT)"\0" diff --git a/tools/Makefile b/tools/Makefile index 879c3fd4a..85e5e5dbb 100755 --- a/tools/Makefile +++ b/tools/Makefile @@ -246,7 +246,7 @@ LOGO-$(CONFIG_VIDEO_LOGO) += $(LOGO_DATA_H) # Generic logo ifeq ($(LOGO_BMP),) -LOGO_BMP= $(srctree)/$(src)/logos/denx.bmp +LOGO_BMP= $(srctree)/$(src)/logos/miyoo.bmp # Use board logo and fallback to vendor ifneq ($(wildcard $(srctree)/$(src)/logos/$(BOARD).bmp),) diff --git a/tools/logos/miyoo.bmp b/tools/logos/miyoo.bmp new file mode 100644 index 000000000..7b9312fc4 Binary files /dev/null and b/tools/logos/miyoo.bmp differ