omap4: splitting padconfs into common, 4430 and 4460
authorRicardo Salveti de Araujo <ricardo.salveti@linaro.org>
Wed, 21 Sep 2011 10:17:31 +0000 (10:17 +0000)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Thu, 27 Oct 2011 19:56:34 +0000 (21:56 +0200)
Not all padconfs are the same between 4430 and 4460, so instead of
working around this with an if, we should have an specific padconf
structure for both chips (like handling the differences between the LEDs
GPIOs and TPS).

Signed-off-by: Ricardo Salveti de Araujo <ricardo.salveti@linaro.org>
Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
arch/arm/cpu/armv7/omap4/board.c
arch/arm/cpu/armv7/omap4/omap4_mux_data.h
board/ti/panda/panda.c
board/ti/panda/panda_mux_data.h

index 6d8811f4847cf097f74aed9b36b77af3ffd0ed09..2497e3e729374dd1cda847b5488f88328836b936 100644 (file)
@@ -152,9 +152,11 @@ static void set_muxconf_regs_essential(void)
                   sizeof(wkup_padconf_array_essential) /
                   sizeof(struct pad_conf_entry));
 
-       /* gpio_wk7 is used for controlling TPS on 4460 */
        if (omap_revision() >= OMAP4460_ES1_0)
-               writew(M3, CONTROL_WKUP_PAD1_FREF_CLK4_REQ);
+               do_set_mux(CONTROL_PADCONF_WKUP,
+                                wkup_padconf_array_essential_4460,
+                                sizeof(wkup_padconf_array_essential_4460) /
+                                sizeof(struct pad_conf_entry));
 }
 
 static void set_mux_conf_regs(void)
index 00c52f835f2fa3facdb18f3b08b42cc6add00b55..b9403910c99a18d155a8edce5d8ae1abf2d75655 100644 (file)
@@ -73,4 +73,11 @@ const struct pad_conf_entry wkup_padconf_array_essential[] = {
 
 };
 
+const struct pad_conf_entry wkup_padconf_array_essential_4460[] = {
+
+{PAD1_FREF_CLK4_REQ, (M3)},     /* gpio_wk7, TPS */
+
+};
+
+
 #endif  /* _OMAP4_MUX_DATA_H_ */
index 9afed807b08d7bb725e2804b08f8f74eb532e9eb..97320cb278abc754c3dd7eded7a9f8425db35d77 100644 (file)
@@ -71,9 +71,26 @@ void set_muxconf_regs_non_essential(void)
                   sizeof(core_padconf_array_non_essential) /
                   sizeof(struct pad_conf_entry));
 
+       if (omap_revision() < OMAP4460_ES1_0)
+               do_set_mux(CONTROL_PADCONF_CORE,
+                               core_padconf_array_non_essential_4430,
+                               sizeof(core_padconf_array_non_essential_4430) /
+                               sizeof(struct pad_conf_entry));
+       else
+               do_set_mux(CONTROL_PADCONF_CORE,
+                               core_padconf_array_non_essential_4460,
+                               sizeof(core_padconf_array_non_essential_4460) /
+                               sizeof(struct pad_conf_entry));
+
        do_set_mux(CONTROL_PADCONF_WKUP, wkup_padconf_array_non_essential,
                   sizeof(wkup_padconf_array_non_essential) /
                   sizeof(struct pad_conf_entry));
+
+       if (omap_revision() < OMAP4460_ES1_0)
+               do_set_mux(CONTROL_PADCONF_WKUP,
+                               wkup_padconf_array_non_essential_4430,
+                               sizeof(wkup_padconf_array_non_essential_4430) /
+                               sizeof(struct pad_conf_entry));
 }
 
 #ifdef CONFIG_GENERIC_MMC
index 63448b64b6d8a19259abbbd380d447f833f4a191..83d0c3fd81167da8799cfd223e1974a24404088b 100644 (file)
@@ -100,7 +100,6 @@ const struct pad_conf_entry core_padconf_array_non_essential[] = {
        {USBB1_HSIC_STROBE, (IEN | OFF_EN | OFF_PD | OFF_IN | M0)},     /* usbb1_hsic_strobe */
        {USBC1_ICUSB_DP, (IEN | M0)},                                   /* usbc1_icusb_dp */
        {USBC1_ICUSB_DM, (IEN | M0)},                                   /* usbc1_icusb_dm */
-       {ABE_MCBSP2_CLKX, (IEN | OFF_EN | OFF_PD | OFF_IN | M0)},       /* abe_mcbsp2_clkx */
        {ABE_MCBSP2_DR, (IEN | OFF_EN | OFF_OUT_PTD | M0)},             /* abe_mcbsp2_dr */
        {ABE_MCBSP2_DX, (OFF_EN | OFF_OUT_PTD | M0)},                   /* abe_mcbsp2_dx */
        {ABE_MCBSP2_FSX, (IEN | OFF_EN | OFF_PD | OFF_IN | M0)},        /* abe_mcbsp2_fsx */
@@ -202,6 +201,14 @@ const struct pad_conf_entry core_padconf_array_non_essential[] = {
        {DPM_EMU19, (IEN | M5)},                                        /* dispc2_data0 */
 };
 
+const struct pad_conf_entry core_padconf_array_non_essential_4430[] = {
+       {ABE_MCBSP2_CLKX, (IEN | OFF_EN | OFF_PD | OFF_IN | M0)},       /* abe_mcbsp2_clkx */
+};
+
+const struct pad_conf_entry core_padconf_array_non_essential_4460[] = {
+       {ABE_MCBSP2_CLKX, (PTU | OFF_EN | OFF_OUT_PTU | M3)},           /* led status_1 */
+};
+
 const struct pad_conf_entry wkup_padconf_array_non_essential[] = {
        {PAD0_SIM_IO, (IEN | M0)},              /* sim_io */
        {PAD1_SIM_CLK, (M0)},                   /* sim_clk */
@@ -214,7 +221,6 @@ const struct pad_conf_entry wkup_padconf_array_non_essential[] = {
        {PAD0_FREF_CLK0_OUT, (M2)},             /* sys_drm_msecure */
        {PAD1_FREF_CLK3_REQ, M7},                                       /* safe mode */
        {PAD0_FREF_CLK3_OUT, (M0)},             /* fref_clk3_out */
-       {PAD1_FREF_CLK4_REQ, (PTU | M3)},       /* led status_1 */
        {PAD0_FREF_CLK4_OUT, (PTU | M3)},       /* led status_2 */
        {PAD0_SYS_NRESPWRON, (M0)},             /* sys_nrespwron */
        {PAD1_SYS_NRESWARM, (M0)},              /* sys_nreswarm */
@@ -224,4 +230,8 @@ const struct pad_conf_entry wkup_padconf_array_non_essential[] = {
        {PAD1_SYS_BOOT7, (IEN | M3)},           /* gpio_wk10 */
 };
 
+const struct pad_conf_entry wkup_padconf_array_non_essential_4430[] = {
+       {PAD1_FREF_CLK4_REQ, (PTU | M3)},       /* led status_1 */
+};
+
 #endif /* _PANDA_MUX_DATA_H_ */