summaryrefslogtreecommitdiffstats
path: root/board/ti/am335x/mux.c
diff options
context:
space:
mode:
authorTom Rini <trini@ti.com>2012-07-31 10:50:01 -0700
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2012-09-01 14:58:13 +0200
commitdb7dd8109cad3ccdea23d2eebafe588f2ab585d6 (patch)
treefd91465a7ca98875dd631f9e787a1bf63b6a42c2 /board/ti/am335x/mux.c
parent726c05d2cfc0f0062cc7a32c0e06ab775b43c04c (diff)
downloadu-boot-db7dd8109cad3ccdea23d2eebafe588f2ab585d6.tar.gz
u-boot-db7dd8109cad3ccdea23d2eebafe588f2ab585d6.tar.xz
u-boot-db7dd8109cad3ccdea23d2eebafe588f2ab585d6.zip
am33xx: Rework pinmux functions
- Move definition of the EEPROM contents to <asm/arch/sys_proto.h> - Make some defines a little less generic now. - Pinmux must be done by done by SPL now. - Create 3 pinmux functions, uart0, i2c0 and board. - Add pinmux specific to Starter Kit EVM for MMC now. Signed-off-by: Tom Rini <trini@ti.com>
Diffstat (limited to 'board/ti/am335x/mux.c')
-rw-r--r--board/ti/am335x/mux.c58
1 files changed, 33 insertions, 25 deletions
diff --git a/board/ti/am335x/mux.c b/board/ti/am335x/mux.c
index 9907d962d0..c7460eb70b 100644
--- a/board/ti/am335x/mux.c
+++ b/board/ti/am335x/mux.c
@@ -13,8 +13,8 @@
* GNU General Public License for more details.
*/
-#include <config.h>
-#include <asm/arch/common_def.h>
+#include <common.h>
+#include <asm/arch/sys_proto.h>
#include <asm/arch/hardware.h>
#include <asm/io.h>
@@ -258,7 +258,6 @@ static struct module_pin_mux uart0_pin_mux[] = {
{-1},
};
-#ifdef CONFIG_MMC
static struct module_pin_mux mmc0_pin_mux[] = {
{OFFSET(mmc0_dat3), (MODE(0) | RXACTIVE | PULLUP_EN)}, /* MMC0_DAT3 */
{OFFSET(mmc0_dat2), (MODE(0) | RXACTIVE | PULLUP_EN)}, /* MMC0_DAT2 */
@@ -270,7 +269,17 @@ static struct module_pin_mux mmc0_pin_mux[] = {
{OFFSET(spi0_cs1), (MODE(5) | RXACTIVE | PULLUP_EN)}, /* MMC0_CD */
{-1},
};
-#endif
+
+static struct module_pin_mux mmc0_pin_mux_sk_evm[] = {
+ {OFFSET(mmc0_dat3), (MODE(0) | RXACTIVE | PULLUP_EN)}, /* MMC0_DAT3 */
+ {OFFSET(mmc0_dat2), (MODE(0) | RXACTIVE | PULLUP_EN)}, /* MMC0_DAT2 */
+ {OFFSET(mmc0_dat1), (MODE(0) | RXACTIVE | PULLUP_EN)}, /* MMC0_DAT1 */
+ {OFFSET(mmc0_dat0), (MODE(0) | RXACTIVE | PULLUP_EN)}, /* MMC0_DAT0 */
+ {OFFSET(mmc0_clk), (MODE(0) | RXACTIVE | PULLUP_EN)}, /* MMC0_CLK */
+ {OFFSET(mmc0_cmd), (MODE(0) | RXACTIVE | PULLUP_EN)}, /* MMC0_CMD */
+ {OFFSET(spi0_cs1), (MODE(5) | RXACTIVE | PULLUP_EN)}, /* MMC0_CD */
+ {-1},
+};
static struct module_pin_mux i2c0_pin_mux[] = {
{OFFSET(i2c0_sda), (MODE(0) | RXACTIVE |
@@ -349,34 +358,33 @@ void enable_uart0_pin_mux(void)
configure_module_pin_mux(uart0_pin_mux);
}
-#ifdef CONFIG_MMC
-void enable_mmc0_pin_mux(void)
-{
- configure_module_pin_mux(mmc0_pin_mux);
-}
-#endif
void enable_i2c0_pin_mux(void)
{
configure_module_pin_mux(i2c0_pin_mux);
}
-void enable_i2c1_pin_mux(void)
+void enable_board_pin_mux(struct am335x_baseboard_id *header)
{
+ /* Enable pinmux that is common to all TI boards. */
configure_module_pin_mux(i2c1_pin_mux);
-}
-
-void enable_rgmii1_pin_mux(void)
-{
- configure_module_pin_mux(rgmii1_pin_mux);
-}
-void enable_mii1_pin_mux(void)
-{
- configure_module_pin_mux(mii1_pin_mux);
-}
-
-void enable_gpio0_7_pin_mux(void)
-{
- configure_module_pin_mux(gpio0_7_pin_mux);
+ /* Now do board-specific muxes. */
+ if (!strncmp(header->name, "A335BONE", HDR_NAME_LEN)) {
+ /* Beaglebone pinmux */
+ configure_module_pin_mux(mii1_pin_mux);
+ configure_module_pin_mux(mmc0_pin_mux);
+ } else if (!strncmp(header->config, "SKU#01", 6)) {
+ /* General Purpose EVM */
+ configure_module_pin_mux(rgmii1_pin_mux);
+ configure_module_pin_mux(mmc0_pin_mux);
+ } else if (!strncmp(header->name, "A335X_SK", HDR_NAME_LEN)) {
+ /* Starter Kit EVM */
+ configure_module_pin_mux(gpio0_7_pin_mux);
+ configure_module_pin_mux(rgmii1_pin_mux);
+ configure_module_pin_mux(mmc0_pin_mux_sk_evm);
+ } else {
+ puts("Unknown board, cannot configure pinmux.");
+ hang();
+ }
}