summaryrefslogtreecommitdiff
path: root/board/siemens/rut/board.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/siemens/rut/board.c')
-rw-r--r--board/siemens/rut/board.c51
1 files changed, 45 insertions, 6 deletions
diff --git a/board/siemens/rut/board.c b/board/siemens/rut/board.c
index 5de8fc6..0cf17ef 100644
--- a/board/siemens/rut/board.c
+++ b/board/siemens/rut/board.c
@@ -83,9 +83,48 @@ struct cmd_control rut_ddr3_cmd_ctrl_data = {
&rut_ddr3_cmd_ctrl_data, &rut_ddr3_emif_reg_data, 0);
}
+static int request_and_pulse_reset(int gpio, const char *name)
+{
+ int ret;
+ const int delay_us = 2000; /* 2ms */
+
+ ret = gpio_request(gpio, name);
+ if (ret < 0) {
+ printf("%s: Unable to request %s\n", __func__, name);
+ goto err;
+ }
+
+ ret = gpio_direction_output(gpio, 0);
+ if (ret < 0) {
+ printf("%s: Unable to set %s as output\n", __func__, name);
+ goto err_free_gpio;
+ }
+
+ udelay(delay_us);
+
+ gpio_set_value(gpio, 1);
+
+ return 0;
+
+err_free_gpio:
+ gpio_free(gpio);
+err:
+ return ret;
+}
+
+#define GPIO_TO_PIN(bank, gpio) (32 * (bank) + (gpio))
+#define ETH_PHY_RESET_GPIO GPIO_TO_PIN(2, 18)
+#define MAXTOUCH_RESET_GPIO GPIO_TO_PIN(3, 18)
+#define DISPLAY_RESET_GPIO GPIO_TO_PIN(3, 19)
+
+#define REQUEST_AND_PULSE_RESET(N) \
+ request_and_pulse_reset(N, #N);
+
static void spl_siemens_board_init(void)
{
- return;
+ REQUEST_AND_PULSE_RESET(ETH_PHY_RESET_GPIO);
+ REQUEST_AND_PULSE_RESET(MAXTOUCH_RESET_GPIO);
+ REQUEST_AND_PULSE_RESET(DISPLAY_RESET_GPIO);
}
#endif /* if def CONFIG_SPL_BUILD */
@@ -336,7 +375,6 @@ int clk_get(int clk)
static int conf_disp_pll(int m, int n)
{
struct cm_perpll *cmper = (struct cm_perpll *)CM_PER;
- struct cm_dpll *cmdpll = (struct cm_dpll *)CM_DPLL;
struct dpll_params dpll_lcd = {m, n, -1, -1, -1, -1, -1};
#if defined(DISPL_PLL_SPREAD_SPECTRUM)
struct cm_wkuppll *cmwkup = (struct cm_wkuppll *)CM_WKUP;
@@ -353,8 +391,6 @@ static int conf_disp_pll(int m, int n)
0
};
do_enable_clocks(clk_domains, clk_modules_explicit_en, 1);
- /* 0x44e0_0500 write lcdc pixel clock mux Linux hat hier 0 */
- writel(0x0, &cmdpll->clklcdcpixelclk);
do_setup_dpll(&dpll_lcd_regs, &dpll_lcd);
@@ -380,10 +416,13 @@ static int enable_lcd(void)
{
unsigned char buf[1];
+ set_gpio(BOARD_LCD_RESET, 0);
+ mdelay(1);
set_gpio(BOARD_LCD_RESET, 1);
+ mdelay(1);
/* spi lcd init */
- kwh043st20_f01_spi_startup(1, 0, 5000000, SPI_MODE_3);
+ kwh043st20_f01_spi_startup(1, 0, 5000000, SPI_MODE_0);
/* backlight on */
buf[0] = 0xf;
@@ -418,7 +457,7 @@ static int board_video_init(void)
printf("%s: %s not found, using default %s\n", __func__,
factory_dat.disp_name, lcd_panels[i].name);
}
- conf_disp_pll(25, 2);
+ conf_disp_pll(24, 1);
da8xx_video_init(&lcd_panels[display], &lcd_cfgs[display],
lcd_cfgs[display].bpp);