diff options
-rwxr-xr-x | board/lge/sniper/hub_dispc.c | 14 | ||||
-rwxr-xr-x | board/lge/sniper/hub_dsi.c | 2 | ||||
-rwxr-xr-x | board/lge/sniper/panel-hub.c | 23 | ||||
-rw-r--r-- | board/lge/sniper/sniper.c | 61 | ||||
-rw-r--r-- | board/lge/sniper/sniper.h | 3 | ||||
-rw-r--r-- | include/configs/sniper.h | 32 |
6 files changed, 96 insertions, 39 deletions
diff --git a/board/lge/sniper/hub_dispc.c b/board/lge/sniper/hub_dispc.c index 23e645ee145..653b437cef4 100755 --- a/board/lge/sniper/hub_dispc.c +++ b/board/lge/sniper/hub_dispc.c @@ -2459,7 +2459,7 @@ static int _omap_dss_wait_reset(void) return 0; } -static int _omap_dss_reset(void) +int _omap_dss_reset(void) { /* Soft reset */ DSS_REG_FLD_MOD(DSS_SYSCONFIG, 1, 1, 1); @@ -2631,3 +2631,15 @@ void dispc_configure_image(u32 image) configure_dispc(); } + +void dispc_control_show(void) +{ + u32 l; + l = dispc_read_reg(DISPC_CONTROL); + printf("DISPC_CONTROL=0x%x (stallmode=%d)\n", l, l & (1 << 11)); +/* + l &= ~(1 << 11); + dispc_write_reg(DISPC_CONTROL, l); + printf("NO STALL DISPC_CONTROL=0x%x (stallmode=%d)\n", l, l & (1 << 11)); +*/ +} diff --git a/board/lge/sniper/hub_dsi.c b/board/lge/sniper/hub_dsi.c index 0ed2781899f..77f3c174b57 100755 --- a/board/lge/sniper/hub_dsi.c +++ b/board/lge/sniper/hub_dsi.c @@ -1491,7 +1491,7 @@ static int _dsi_wait_reset(void) return 0; } -static int _dsi_reset(void) +int _dsi_reset(void) { //printf("dsi_reset\n"); diff --git a/board/lge/sniper/panel-hub.c b/board/lge/sniper/panel-hub.c index eef3e690c85..2b861c16882 100755 --- a/board/lge/sniper/panel-hub.c +++ b/board/lge/sniper/panel-hub.c @@ -344,26 +344,6 @@ static int hub_panel_enable_te(bool enable) return r; } -void hub_panel_reset_lcd(void) -{ - printf("[LCD]%s\n", __func__); - - extern void aat2862_ldo_enabled(int enable); - -/* - omap_set_gpio_direction(HUB_PANEL_LCD_RESET_N, 0); - mdelay(2); - omap_set_gpio_dataout(HUB_PANEL_LCD_RESET_N, 0); - aat2862_ldo_enabled(1); - mdelay(50); - omap_set_gpio_dataout(HUB_PANEL_LCD_RESET_N, 1); - mdelay(10); -*/ - - return; - -} - static int lcd_present(void) { u8 data = 0; @@ -375,12 +355,11 @@ static int lcd_present(void) return 0; } +/* GPIO toggle reset is done beforehand */ int hub_panel_enable(void) { int i, r; - hub_panel_reset_lcd(); - /* it seems we have to wait a bit until hub_panel is ready */ mdelay(20); diff --git a/board/lge/sniper/sniper.c b/board/lge/sniper/sniper.c index e0102d134f6..147e1a47410 100644 --- a/board/lge/sniper/sniper.c +++ b/board/lge/sniper/sniper.c @@ -17,7 +17,11 @@ * * SPDX-License-Identifier: GPL-2.0+ */ +#include <config.h> #include <common.h> +#ifdef CONFIG_SPL_BUILD +#include <spl.h> +#endif #include <twl4030.h> #include <lp8720.h> #include <asm/io.h> @@ -44,6 +48,10 @@ const omap3_sysinfo sysinfo = { }; /* + * Cleanup rules: copyright headers, no useless descriptions, ifdef when not || + */ + +/* * Routine: board_init * Description: Early hardware init. */ @@ -59,6 +67,41 @@ int board_init(void) } #if defined(CONFIG_SPL_BUILD) +void board_init_f(ulong dummy) +{ + unsigned char value; + + /* Clear the BSS. */ + memset(__bss_start, 0, __bss_end - __bss_start); + + /* TODO: Remove settings of the global data pointer here */ + gd = &gdata; + + /* DP3T UART switch: OMAP enable, IFX disable */ + + gpio_request(SNIPER_GPIO_OMAP_UART_SW, "omap_uart_sw"); + gpio_direction_output(SNIPER_GPIO_OMAP_UART_SW, 1); + + gpio_request(SNIPER_GPIO_IFX_UART_SW, "ifx_uart_sw"); + gpio_direction_output(SNIPER_GPIO_IFX_UART_SW, 0); + + /* MAX14526 MUIC: mux to UART */ + /* FIXME: proper functions for all this, shoudl detect ID resistor too */ + /* TODO: don't forget to mux to USB if not to UART */ + +// i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE); +/* + i2c_set_bus_num(1); + + value = 0x09; + i2c_write(0x44, 0x03, 1, &value, 1); + + i2c_set_bus_num(0); +*/ + + board_init_r(NULL, 0); +} + /* * Routine: get_board_mem_timings * Description: If we use SPL then there is no x-loader nor config header @@ -389,17 +432,10 @@ void video_init(void) hub_panel_init_lcd(); - dsi_init(); //20100906 kyungtae.oh@lge.com for Factory test at LCD off - dsi_display_update(0, 0, 480, 800); // PAULK: that's totally useless - - configure_dispc(); dispc_configure_image(NULL); // use fbaddress hub_load_rle565_image(peace, CONFIG_FB_ADDRESS, 480*800); - dispc_enable_lcd_out(1); dsi_update_screen_dispc(0,0,480,800); - printf("VIDEO INIT END\n"); - i2c_set_bus_num(1); aat2862_write_reg(0x0,0xff); /* LCD channel enable */ aat2862_write_reg(0x03,0xF4); /* LED main group, LED enabled, 22.26 */ @@ -408,6 +444,17 @@ void video_init(void) aat2862_write_reg(0x06,0x74); /* LED main group, LED enabled, 30 */ i2c_set_bus_num(0); + mdelay(2000); + + _dsi_reset(); + _omap_dss_reset(); + + dispc_control_show(); + + printf("VIDEO INIT END\n"); + + + } /* diff --git a/board/lge/sniper/sniper.h b/board/lge/sniper/sniper.h index 9f9cd06ec96..9354917cb2f 100644 --- a/board/lge/sniper/sniper.h +++ b/board/lge/sniper/sniper.h @@ -12,7 +12,10 @@ #define SNIPER_GPIO_CAM_SUBPM_EN 37 #define SNIPER_GPIO_LCD_CS 54 #define SNIPER_GPIO_LCD_CP_EN 62 +#define SNIPER_GPIO_IFX_USB_VBUS_EN 101 #define SNIPER_GPIO_KEY_LED_RESET 128 +#define SNIPER_GPIO_OMAP_UART_SW 161 +#define SNIPER_GPIO_IFX_UART_SW 162 /* * IEN - Input Enable diff --git a/include/configs/sniper.h b/include/configs/sniper.h index 57a72787de7..93743315cf4 100644 --- a/include/configs/sniper.h +++ b/include/configs/sniper.h @@ -17,7 +17,7 @@ #include <asm/arch/cpu.h> #include <asm/arch/omap.h> -/* needed before */ +/* needed before, actually those includes shouldn't go that early */ #define CONFIG_SYS_NO_FLASH #include <config_cmd_default.h> @@ -62,7 +62,7 @@ #define CONFIG_ARM_ERRATA_621766 /* - * Cache + * CPU */ #define CONFIG_SYS_CACHELINE_SIZE 64 @@ -169,7 +169,10 @@ #define CONFIG_OMAP_GPIO #define CONFIG_OMAP3_GPIO_2 +#define CONFIG_OMAP3_GPIO_3 +#define CONFIG_OMAP3_GPIO_4 #define CONFIG_OMAP3_GPIO_5 +#define CONFIG_OMAP3_GPIO_6 /* * I2C @@ -185,12 +188,16 @@ * MMC */ -#define CONFIG_GENERIC_MMC 1 -#define CONFIG_MMC 1 -#define CONFIG_OMAP_HSMMC 1 +#define CONFIG_GENERIC_MMC +#define CONFIG_MMC +#define CONFIG_OMAP_HSMMC -#define CONFIG_DOS_PARTITION 1 -#define CONFIG_EFI_PARTITION 1 +/* + * Partitions + */ + +#define CONFIG_DOS_PARTITION +#define CONFIG_EFI_PARTITION /* * Video @@ -230,6 +237,9 @@ #define CONFIG_USB_FASTBOOT_BUF_ADDR CONFIG_SYS_LOAD_ADDR #define CONFIG_USB_FASTBOOT_BUF_SIZE 0x7000000 +#define CONFIG_FASTBOOT_FLASH +#define CONFIG_FASTBOOT_FLASH_MMC_DEV 0 + /* * Commands */ @@ -270,9 +280,15 @@ #define CONFIG_BOOTCOMMAND \ "i2c dev 1; i2c md 0x44 0x00 0x10; i2c mw 0x44 0x03 0x00; i2c md 0x44 0x00 0x10; i2c dev 0;" \ "bdinfo;" \ + "load mmc 0 0x82000000 recovery.img;" \ + "bootm 0x82000000;" +/* + "fastboot; fastboot; fastboot;" +*/ +/* "load mmc 0 0x82000000 boot.img;" \ "bootm 0x82000000;" - +*/ /* "i2c dev 1; i2c md 0x44 0x00 0x10; i2c mw 0x44 0x03 0x00; i2c md 0x44 0x00 0x10; i2c dev 0; fastboot;" \ "load mmc 0 0x82000000 recovery.img;" \ |