2 * Copyright (C) 2011 Ilya Yanok, Emcraft Systems
4 * Based on ti/evm/evm.c
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
23 #include <asm/arch/mem.h>
24 #include <asm/arch/mmc_host_def.h>
25 #include <asm/arch/mux.h>
26 #include <asm/arch/sys_proto.h>
27 #include <asm/mach-types.h>
29 #include <asm/omap_gpio.h>
30 #include <asm/arch/dss.h>
31 #include <asm/arch/clocks.h>
34 #ifdef CONFIG_USB_EHCI
36 #include <asm/ehci-omap.h>
40 DECLARE_GLOBAL_DATA_PTR
;
42 #define HOT_WATER_BUTTON 42
45 /* Address of the framebuffer in RAM. */
46 #define FB_START_ADDRESS 0x88000000
48 #ifdef CONFIG_USB_EHCI
49 static struct omap_usbhs_board_data usbhs_bdata
= {
50 .port_mode
[0] = OMAP_EHCI_PORT_MODE_PHY
,
51 .port_mode
[1] = OMAP_USBHS_PORT_MODE_UNUSED
,
52 .port_mode
[2] = OMAP_USBHS_PORT_MODE_UNUSED
,
55 int ehci_hcd_init(int index
, struct ehci_hccr
**hccr
, struct ehci_hcor
**hcor
)
57 return omap_ehci_hcd_init(&usbhs_bdata
, hccr
, hcor
);
60 int ehci_hcd_stop(int index
)
62 return omap_ehci_hcd_stop();
68 * Description: Early hardware init.
72 gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
74 gd
->bd
->bi_boot_params
= (OMAP34XX_SDRC_CS0
+ 0x100);
76 gpio_direction_output(LCD_OUTPUT
, 0);
81 #ifdef CONFIG_BOARD_LATE_INIT
82 int board_late_init(void)
84 if (gpio_request(HOT_WATER_BUTTON
, "hot-water-button") < 0) {
85 puts("Failed to get hot-water-button pin\n");
88 gpio_direction_input(HOT_WATER_BUTTON
);
91 * if hot-water-button is pressed
94 if (gpio_get_value(HOT_WATER_BUTTON
))
97 setenv("bootcmd", "run swupdate");
104 * Routine: set_muxconf_regs
105 * Description: Setting up the configuration Mux registers specific to the
106 * hardware. Many pins need to be moved from protect to primary
109 void set_muxconf_regs(void)
114 #if defined(CONFIG_OMAP_HSMMC) && !defined(CONFIG_SPL_BUILD)
115 int board_mmc_init(bd_t
*bis
)
117 return omap_mmc_init(0, 0, 0);
121 #if defined(CONFIG_VIDEO) && !defined(CONFIG_SPL_BUILD)
123 static struct panel_config lcd_cfg
= {
124 .timing_h
= PANEL_TIMING_H(40, 40, 48),
125 .timing_v
= PANEL_TIMING_V(29, 13, 3),
126 .pol_freq
= 0x00003000, /* Pol Freq */
127 .divisor
= 0x0001000E,
128 .panel_type
= 0x01, /* TFT */
129 .data_lines
= 0x03, /* 24 Bit RGB */
130 .load_mode
= 0x02, /* Frame Mode */
132 .lcd_size
= PANEL_LCD_SIZE(800, 480),
135 int board_video_init(void)
137 struct prcm
*prcm_base
= (struct prcm
*)PRCM_BASE
;
140 fb
= (void *)FB_START_ADDRESS
;
142 lcd_cfg
.frame_buffer
= fb
;
144 setbits_le32(&prcm_base
->fclken_dss
, FCK_DSS_ON
);
145 setbits_le32(&prcm_base
->iclken_dss
, ICK_DSS_ON
);
147 omap3_dss_panel_config(&lcd_cfg
);