xref: /openbmc/u-boot/board/compulab/cm_t54/mux.c (revision 699c4e59)
1 /*
2  * Pinmux configuration for Compulab CM-T54 board
3  *
4  * Copyright (C) 2014, Compulab Ltd - http://compulab.co.il/
5  *
6  * Author: Dmitry Lifshitz <lifshitz@compulab.co.il>
7  *
8  * SPDX-License-Identifier:	GPL-2.0+
9  */
10 
11 #ifndef _CM_T54_MUX_DATA_H
12 #define _CM_T54_MUX_DATA_H
13 
14 #include <asm/arch/mux_omap5.h>
15 #include <asm/arch/sys_proto.h>
16 
17 const struct pad_conf_entry core_padconf_array_essential[] = {
18 	/* MMC1 - SD CARD */
19 	{SDCARD_CLK, (PTU | IEN | M0)},			/* SDCARD_CLK */
20 	{SDCARD_CMD, (PTU | IEN | M0)},			/* SDCARD_CMD */
21 	{SDCARD_DATA0, (PTU | IEN | M0)},		/* SDCARD_DATA0 */
22 	{SDCARD_DATA1, (PTU | IEN | M0)},		/* SDCARD_DATA1 */
23 	{SDCARD_DATA2, (PTU | IEN | M0)},		/* SDCARD_DATA2 */
24 	{SDCARD_DATA3, (PTU | IEN | M0)},		/* SDCARD_DATA3 */
25 
26 	/* SD CARD CD and WP GPIOs*/
27 	{TIMER5_PWM_EVT, (PTU | IEN | M6)},		/* GPIO8_228 */
28 	{TIMER6_PWM_EVT, (PTU | IEN | M6)},		/* GPIO8_229 */
29 
30 	/* MMC2 - eMMC */
31 	{EMMC_CLK, (PTU | IEN | M0)},			/* EMMC_CLK */
32 	{EMMC_CMD, (PTU | IEN | M0)},			/* EMMC_CMD */
33 	{EMMC_DATA0, (PTU | IEN | M0)},			/* EMMC_DATA0 */
34 	{EMMC_DATA1, (PTU | IEN | M0)},			/* EMMC_DATA1 */
35 	{EMMC_DATA2, (PTU | IEN | M0)},			/* EMMC_DATA2 */
36 	{EMMC_DATA3, (PTU | IEN | M0)},			/* EMMC_DATA3 */
37 	{EMMC_DATA4, (PTU | IEN | M0)},			/* EMMC_DATA4 */
38 	{EMMC_DATA5, (PTU | IEN | M0)},			/* EMMC_DATA5 */
39 	{EMMC_DATA6, (PTU | IEN | M0)},			/* EMMC_DATA6 */
40 	{EMMC_DATA7, (PTU | IEN | M0)},			/* EMMC_DATA7 */
41 
42 	/* UART4 */
43 	{I2C5_SCL, (PTU | IEN | M2)},			/* UART4_RX */
44 	{I2C5_SDA, (M2)},				/* UART4_TX */
45 
46 	/* Led */
47 	{HSI2_CAFLAG, (PTU | M6)},			/* GPIO3_80 */
48 
49 	/* I2C1 */
50 	{I2C1_PMIC_SCL, (PTU | IEN | M0)},		/* I2C1_PMIC_SCL */
51 	{I2C1_PMIC_SDA, (PTU | IEN | M0)},		/* I2C1_PMIC_SDA */
52 
53 	/* USBB2, USBB3 */
54 	{USBB2_HSIC_STROBE, (PTU | IEN | M0)},		/* USBB2_HSIC_STROBE */
55 	{USBB2_HSIC_DATA, (PTU | IEN | M0)},		/* USBB2_HSIC_DATA */
56 	{USBB3_HSIC_STROBE, (PTU | IEN | M0)},		/* USBB3_HSIC_STROBE */
57 	{USBB3_HSIC_DATA, (PTU | IEN | M0)},		/* USBB3_HSIC_DATA */
58 
59 	/* USB Hub and USB Eth reset GPIOs */
60 	{HSI2_CAREADY, (PTD | M6)},			/* GPIO3_76 */
61 	{HSI2_ACDATA, (PTD | M6)},			/* GPIO3_83 */
62 
63 	/* I2C4 */
64 	{I2C4_SCL, (PTU | IEN | M0)},			/* I2C4_SCL  */
65 	{I2C4_SDA, (PTU | IEN | M0)},			/* I2C4_SDA  */
66 };
67 
68 const struct pad_conf_entry wkup_padconf_array_essential[] = {
69 	{SR_PMIC_SCL, (PTU | IEN | M0)},		/* SR_PMIC_SCL */
70 	{SR_PMIC_SDA, (PTU | IEN | M0)},		/* SR_PMIC_SDA */
71 	{SYS_32K, (IEN | M0)},				/* SYS_32K */
72 
73 	/* USB Hub clock */
74 	{FREF_CLK1_OUT, (PTD | IEN | M0)},		/* FREF_CLK1_OUT  */
75 };
76 
77 /*
78  * Routine: set_muxconf_regs
79  * Description: setup board pinmux configuration.
80  */
81 void set_muxconf_regs(void)
82 {
83 	do_set_mux((*ctrl)->control_padconf_core_base,
84 		   core_padconf_array_essential,
85 		   sizeof(core_padconf_array_essential) /
86 		   sizeof(struct pad_conf_entry));
87 
88 	do_set_mux((*ctrl)->control_padconf_wkup_base,
89 		   wkup_padconf_array_essential,
90 		   sizeof(wkup_padconf_array_essential) /
91 		   sizeof(struct pad_conf_entry));
92 }
93 
94 #endif /* _CM_T54_MUX_DATA_H */
95