2 * Copyright (C) 2011 Ilya Yanok, Emcraft Systems
4 * Based on ti/evm/evm.c
6 * SPDX-License-Identifier: GPL-2.0+
11 #include <asm/arch/mem.h>
12 #include <asm/arch/mmc_host_def.h>
13 #include <asm/arch/mux.h>
14 #include <asm/arch/sys_proto.h>
15 #include <asm/mach-types.h>
17 #include <asm/omap_gpio.h>
18 #include <asm/arch/dss.h>
19 #include <asm/arch/clock.h>
22 #ifdef CONFIG_USB_EHCI_HCD
24 #include <asm/ehci-omap.h>
28 DECLARE_GLOBAL_DATA_PTR
;
30 #define HOT_WATER_BUTTON 42
33 /* Address of the framebuffer in RAM. */
34 #define FB_START_ADDRESS 0x88000000
36 #ifdef CONFIG_USB_EHCI_HCD
37 static struct omap_usbhs_board_data usbhs_bdata
= {
38 .port_mode
[0] = OMAP_EHCI_PORT_MODE_PHY
,
39 .port_mode
[1] = OMAP_USBHS_PORT_MODE_UNUSED
,
40 .port_mode
[2] = OMAP_USBHS_PORT_MODE_UNUSED
,
43 int ehci_hcd_init(int index
, enum usb_init_type init
,
44 struct ehci_hccr
**hccr
, struct ehci_hcor
**hcor
)
46 return omap_ehci_hcd_init(index
, &usbhs_bdata
, hccr
, hcor
);
49 int ehci_hcd_stop(int index
)
51 return omap_ehci_hcd_stop();
57 * Description: Early hardware init.
61 gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
63 gd
->bd
->bi_boot_params
= (OMAP34XX_SDRC_CS0
+ 0x100);
65 gpio_direction_output(LCD_OUTPUT
, 0);
70 #ifdef CONFIG_BOARD_LATE_INIT
71 int board_late_init(void)
73 if (gpio_request(HOT_WATER_BUTTON
, "hot-water-button") < 0) {
74 puts("Failed to get hot-water-button pin\n");
77 gpio_direction_input(HOT_WATER_BUTTON
);
80 * if hot-water-button is pressed
83 if (gpio_get_value(HOT_WATER_BUTTON
))
86 setenv("bootcmd", "run swupdate");
93 * Routine: set_muxconf_regs
94 * Description: Setting up the configuration Mux registers specific to the
95 * hardware. Many pins need to be moved from protect to primary
98 void set_muxconf_regs(void)
103 #if defined(CONFIG_MMC_OMAP_HS)
104 int board_mmc_init(bd_t
*bis
)
106 return omap_mmc_init(0, 0, 0, -1, -1);
110 #if defined(CONFIG_VIDEO) && !defined(CONFIG_SPL_BUILD)
112 static struct panel_config lcd_cfg
= {
113 .timing_h
= PANEL_TIMING_H(40, 40, 48),
114 .timing_v
= PANEL_TIMING_V(29, 13, 3),
115 .pol_freq
= 0x00003000, /* Pol Freq */
116 .divisor
= 0x0001000E,
117 .panel_type
= 0x01, /* TFT */
118 .data_lines
= 0x03, /* 24 Bit RGB */
119 .load_mode
= 0x02, /* Frame Mode */
121 .lcd_size
= PANEL_LCD_SIZE(800, 480),
122 .gfx_format
= GFXFORMAT_RGB24_UNPACKED
,
125 int board_video_init(void)
127 struct prcm
*prcm_base
= (struct prcm
*)PRCM_BASE
;
130 fb
= (void *)FB_START_ADDRESS
;
132 lcd_cfg
.frame_buffer
= fb
;
134 setbits_le32(&prcm_base
->fclken_dss
, FCK_DSS_ON
);
135 setbits_le32(&prcm_base
->iclken_dss
, ICK_DSS_ON
);
137 omap3_dss_panel_config(&lcd_cfg
);