3 * Texas Instruments Incorporated, <www.ti.com>
4 * Steve Sakoman <steve@sakoman.com>
6 * See file CREDITS for list of people who contributed to this
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of
12 * the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
25 #include <asm/arch/sys_proto.h>
26 #include <asm/arch/mmc_host_def.h>
27 #include <asm/arch/clocks.h>
28 #include <asm/arch/gpio.h>
30 #include "panda_mux_data.h"
32 #define PANDA_ULPI_PHY_TYPE_GPIO 182
34 DECLARE_GLOBAL_DATA_PTR
;
36 const struct omap_sysinfo sysinfo
= {
37 "Board: OMAP4 Panda\n"
40 struct omap4_scrm_regs
*const scrm
= (struct omap4_scrm_regs
*)0x4a30a000;
51 gd
->bd
->bi_arch_number
= MACH_TYPE_OMAP4_PANDA
;
52 gd
->bd
->bi_boot_params
= (0x80000000 + 0x100); /* boot param addr */
57 int board_eth_init(bd_t
*bis
)
63 * @brief misc_init_r - Configure Panda board specific configurations
64 * such as power configurations, ethernet initialization as phase2 of
72 u32 auxclk
, altclksrc
;
74 /* EHCI is not supported on ES1.0 */
75 if (omap_revision() == OMAP4430_ES1_0
)
78 gpio_direction_input(PANDA_ULPI_PHY_TYPE_GPIO
);
79 phy_type
= gpio_get_value(PANDA_ULPI_PHY_TYPE_GPIO
);
82 /* ULPI PHY supplied by auxclk3 derived from sys_clk */
83 debug("ULPI PHY supplied by auxclk3\n");
85 auxclk
= readl(&scrm
->auxclk3
);
87 auxclk
&= ~AUXCLK_SRCSELECT_MASK
;
88 auxclk
|= AUXCLK_SRCSELECT_SYS_CLK
<< AUXCLK_SRCSELECT_SHIFT
;
89 /* Set the divisor to 2 */
90 auxclk
&= ~AUXCLK_CLKDIV_MASK
;
91 auxclk
|= AUXCLK_CLKDIV_2
<< AUXCLK_CLKDIV_SHIFT
;
92 /* Request auxilary clock #3 */
93 auxclk
|= AUXCLK_ENABLE_MASK
;
95 writel(auxclk
, &scrm
->auxclk3
);
97 /* ULPI PHY supplied by auxclk1 derived from PER dpll */
98 debug("ULPI PHY supplied by auxclk1\n");
100 auxclk
= readl(&scrm
->auxclk1
);
101 /* Select per DPLL */
102 auxclk
&= ~AUXCLK_SRCSELECT_MASK
;
103 auxclk
|= AUXCLK_SRCSELECT_PER_DPLL
<< AUXCLK_SRCSELECT_SHIFT
;
104 /* Set the divisor to 16 */
105 auxclk
&= ~AUXCLK_CLKDIV_MASK
;
106 auxclk
|= AUXCLK_CLKDIV_16
<< AUXCLK_CLKDIV_SHIFT
;
107 /* Request auxilary clock #3 */
108 auxclk
|= AUXCLK_ENABLE_MASK
;
110 writel(auxclk
, &scrm
->auxclk1
);
113 altclksrc
= readl(&scrm
->altclksrc
);
115 /* Activate alternate system clock supplier */
116 altclksrc
&= ~ALTCLKSRC_MODE_MASK
;
117 altclksrc
|= ALTCLKSRC_MODE_ACTIVE
;
120 altclksrc
|= ALTCLKSRC_ENABLE_INT_MASK
| ALTCLKSRC_ENABLE_EXT_MASK
;
122 writel(altclksrc
, &scrm
->altclksrc
);
127 void set_muxconf_regs_essential(void)
129 do_set_mux(CONTROL_PADCONF_CORE
, core_padconf_array_essential
,
130 sizeof(core_padconf_array_essential
) /
131 sizeof(struct pad_conf_entry
));
133 do_set_mux(CONTROL_PADCONF_WKUP
, wkup_padconf_array_essential
,
134 sizeof(wkup_padconf_array_essential
) /
135 sizeof(struct pad_conf_entry
));
137 if (omap_revision() >= OMAP4460_ES1_0
)
138 do_set_mux(CONTROL_PADCONF_WKUP
,
139 wkup_padconf_array_essential_4460
,
140 sizeof(wkup_padconf_array_essential_4460
) /
141 sizeof(struct pad_conf_entry
));
144 void set_muxconf_regs_non_essential(void)
146 do_set_mux(CONTROL_PADCONF_CORE
, core_padconf_array_non_essential
,
147 sizeof(core_padconf_array_non_essential
) /
148 sizeof(struct pad_conf_entry
));
150 if (omap_revision() < OMAP4460_ES1_0
)
151 do_set_mux(CONTROL_PADCONF_CORE
,
152 core_padconf_array_non_essential_4430
,
153 sizeof(core_padconf_array_non_essential_4430
) /
154 sizeof(struct pad_conf_entry
));
156 do_set_mux(CONTROL_PADCONF_CORE
,
157 core_padconf_array_non_essential_4460
,
158 sizeof(core_padconf_array_non_essential_4460
) /
159 sizeof(struct pad_conf_entry
));
161 do_set_mux(CONTROL_PADCONF_WKUP
, wkup_padconf_array_non_essential
,
162 sizeof(wkup_padconf_array_non_essential
) /
163 sizeof(struct pad_conf_entry
));
165 if (omap_revision() < OMAP4460_ES1_0
)
166 do_set_mux(CONTROL_PADCONF_WKUP
,
167 wkup_padconf_array_non_essential_4430
,
168 sizeof(wkup_padconf_array_non_essential_4430
) /
169 sizeof(struct pad_conf_entry
));
172 #if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_GENERIC_MMC)
173 int board_mmc_init(bd_t
*bis
)
181 * get_board_rev() - get board revision
183 u32
get_board_rev(void)