Patchwork [U-Boot,RFC,v2,04/12] arm, da830: Move the definitions of pinmux configurations to the arch tree

login
register
mail settings
Submitter Christian Riesch
Date Nov. 21, 2011, 4:33 p.m.
Message ID <1321893227-19545-6-git-send-email-christian.riesch@omicron.at>
Download mbox | patch
Permalink /patch/126840/
State RFC
Delegated to: Tom Rini
Headers show

Comments

Christian Riesch - Nov. 21, 2011, 4:33 p.m.
The boards in board/davinci/da8xxevm/ define pinmux_config[] vectors
that contain pinmux configurations for emac, uarts, memory controllers...
This patch moves the pinmux configurations to a header file in the
arch tree for the da830evm.

Signed-off-by: Christian Riesch <christian.riesch@omicron.at>
Cc: Sandeep Paulraj <s-paulraj@ti.com>
Cc: Heiko Schocher <hs@denx.de>
Cc: Nick Thompson <nick.thompson@gefanuc.com>
---
 arch/arm/include/asm/arch-davinci/da830_pinmux.h |  131 ++++++++++++++++++++++
 board/davinci/da8xxevm/da830evm.c                |  114 +------------------
 2 files changed, 135 insertions(+), 110 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-davinci/da830_pinmux.h

Patch

diff --git a/arch/arm/include/asm/arch-davinci/da830_pinmux.h b/arch/arm/include/asm/arch-davinci/da830_pinmux.h
new file mode 100644
index 0000000..2900b6c
--- /dev/null
+++ b/arch/arm/include/asm/arch-davinci/da830_pinmux.h
@@ -0,0 +1,131 @@ 
+/*
+ * Pinmux configurations for the DA830 SoCs
+ *
+ * Copyright (C) 2011 OMICRON electronics GmbH
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef __ASM_ARCH_DA830_PINMUX_H
+#define __ASM_ARCH_DA830_PINMUX_H
+
+#include <asm/arch/hardware.h>
+#include <asm/arch/davinci_misc.h>
+
+/* SPI pin muxer settings */
+const struct pinmux_config spi0_pins[] = {
+	{ pinmux(7), 1, 3 },
+	{ pinmux(7), 1, 4 },
+	{ pinmux(7), 1, 5 },
+	{ pinmux(7), 1, 6 },
+	{ pinmux(7), 1, 7 }
+};
+
+/* EMIF-A bus pins for 8-bit NAND support on CS3 */
+const struct pinmux_config emifa_nand_8bit_cs3_pins[] = {
+	{ pinmux(13), 1, 6 },
+	{ pinmux(13), 1, 7 },
+	{ pinmux(14), 1, 0 },
+	{ pinmux(14), 1, 1 },
+	{ pinmux(14), 1, 2 },
+	{ pinmux(14), 1, 3 },
+	{ pinmux(14), 1, 4 },
+	{ pinmux(14), 1, 5 },
+	{ pinmux(15), 1, 7 },
+	{ pinmux(16), 1, 0 },
+	{ pinmux(18), 1, 1 },
+	{ pinmux(18), 1, 4 },
+	{ pinmux(18), 1, 5 },
+};
+
+/* EMAC PHY interface pins */
+const struct pinmux_config emac_pins[] = {
+	{ pinmux(9), 0, 5 },
+	{ pinmux(10), 2, 1 },
+	{ pinmux(10), 2, 2 },
+	{ pinmux(10), 2, 3 },
+	{ pinmux(10), 2, 4 },
+	{ pinmux(10), 2, 5 },
+	{ pinmux(10), 2, 6 },
+	{ pinmux(10), 2, 7 },
+	{ pinmux(11), 2, 0 },
+	{ pinmux(11), 2, 1 },
+};
+
+/* UART pin muxer settings */
+const struct pinmux_config uart2_pins[] = {
+	{ pinmux(8), 2, 7 },
+	{ pinmux(9), 2, 0 }
+};
+
+/* I2C pin muxer settings */
+const struct pinmux_config i2c0_pins[] = {
+	{ pinmux(8), 2, 3 },
+	{ pinmux(8), 2, 4 }
+};
+
+/* NAND pin muxer settings */
+const struct pinmux_config aemif_pins[] = {
+	{ pinmux(13), 1, 6 },
+	{ pinmux(13), 1, 7 },
+	{ pinmux(14), 1, 0 },
+	{ pinmux(14), 1, 1 },
+	{ pinmux(14), 1, 2 },
+	{ pinmux(14), 1, 3 },
+	{ pinmux(14), 1, 4 },
+	{ pinmux(14), 1, 5 },
+	{ pinmux(14), 1, 6 },
+	{ pinmux(14), 1, 7 },
+	{ pinmux(15), 1, 0 },
+	{ pinmux(15), 1, 1 },
+	{ pinmux(15), 1, 2 },
+	{ pinmux(15), 1, 3 },
+	{ pinmux(15), 1, 4 },
+	{ pinmux(15), 1, 5 },
+	{ pinmux(15), 1, 6 },
+	{ pinmux(15), 1, 7 },
+	{ pinmux(16), 1, 0 },
+	{ pinmux(16), 1, 1 },
+	{ pinmux(16), 1, 2 },
+	{ pinmux(16), 1, 3 },
+	{ pinmux(16), 1, 4 },
+	{ pinmux(16), 1, 5 },
+	{ pinmux(16), 1, 6 },
+	{ pinmux(16), 1, 7 },
+	{ pinmux(17), 1, 0 },
+	{ pinmux(17), 1, 1 },
+	{ pinmux(17), 1, 2 },
+	{ pinmux(17), 1, 3 },
+	{ pinmux(17), 1, 4 },
+	{ pinmux(17), 1, 5 },
+	{ pinmux(17), 1, 6 },
+	{ pinmux(17), 1, 7 },
+	{ pinmux(18), 1, 0 },
+	{ pinmux(18), 1, 1 },
+	{ pinmux(18), 1, 2 },
+	{ pinmux(18), 1, 3 },
+	{ pinmux(18), 1, 4 },
+	{ pinmux(18), 1, 5 },
+	{ pinmux(18), 1, 6 },
+	{ pinmux(18), 1, 7 },
+	{ pinmux(10), 1, 0 }
+};
+
+/* USB0_DRVVBUS pin muxer settings */
+const struct pinmux_config usb_pins[] = {
+	{ pinmux(9), 1, 1 }
+};
+
+#endif
diff --git a/board/davinci/da8xxevm/da830evm.c b/board/davinci/da8xxevm/da830evm.c
index c45c94b..07789f6 100644
--- a/board/davinci/da8xxevm/da830evm.c
+++ b/board/davinci/da8xxevm/da830evm.c
@@ -39,6 +39,7 @@ 
 #include <asm/arch/hardware.h>
 #include <asm/arch/emif_defs.h>
 #include <asm/arch/emac_defs.h>
+#include <asm/arch/da830_pinmux.h>
 #include <asm/io.h>
 #include <nand.h>
 #include <asm/arch/nand_defs.h>
@@ -46,124 +47,17 @@ 
 
 DECLARE_GLOBAL_DATA_PTR;
 
-/* SPI0 pin muxer settings */
-static const struct pinmux_config spi0_pins[] = {
-	{ pinmux(7), 1, 3 },
-	{ pinmux(7), 1, 4 },
-	{ pinmux(7), 1, 5 },
-	{ pinmux(7), 1, 6 },
-	{ pinmux(7), 1, 7 }
-};
-
-/* EMIF-A bus pins for 8-bit NAND support on CS3 */
-static const struct pinmux_config emifa_nand_pins[] = {
-	{ pinmux(13), 1, 6 },
-	{ pinmux(13), 1, 7 },
-	{ pinmux(14), 1, 0 },
-	{ pinmux(14), 1, 1 },
-	{ pinmux(14), 1, 2 },
-	{ pinmux(14), 1, 3 },
-	{ pinmux(14), 1, 4 },
-	{ pinmux(14), 1, 5 },
-	{ pinmux(15), 1, 7 },
-	{ pinmux(16), 1, 0 },
-	{ pinmux(18), 1, 1 },
-	{ pinmux(18), 1, 4 },
-	{ pinmux(18), 1, 5 },
-};
-
-/* EMAC PHY interface pins */
-static const struct pinmux_config emac_pins[] = {
-	{ pinmux(9), 0, 5 },
-	{ pinmux(10), 2, 1 },
-	{ pinmux(10), 2, 2 },
-	{ pinmux(10), 2, 3 },
-	{ pinmux(10), 2, 4 },
-	{ pinmux(10), 2, 5 },
-	{ pinmux(10), 2, 6 },
-	{ pinmux(10), 2, 7 },
-	{ pinmux(11), 2, 0 },
-	{ pinmux(11), 2, 1 },
-};
-
-/* UART pin muxer settings */
-static const struct pinmux_config uart_pins[] = {
-	{ pinmux(8), 2, 7 },
-	{ pinmux(9), 2, 0 }
-};
-
-/* I2C pin muxer settings */
-static const struct pinmux_config i2c_pins[] = {
-	{ pinmux(8), 2, 3 },
-	{ pinmux(8), 2, 4 }
-};
-
-#ifdef CONFIG_USE_NAND
-/* NAND pin muxer settings */
-const struct pinmux_config aemif_pins[] = {
-	{ pinmux(13), 1, 6 },
-	{ pinmux(13), 1, 7 },
-	{ pinmux(14), 1, 0 },
-	{ pinmux(14), 1, 1 },
-	{ pinmux(14), 1, 2 },
-	{ pinmux(14), 1, 3 },
-	{ pinmux(14), 1, 4 },
-	{ pinmux(14), 1, 5 },
-	{ pinmux(14), 1, 6 },
-	{ pinmux(14), 1, 7 },
-	{ pinmux(15), 1, 0 },
-	{ pinmux(15), 1, 1 },
-	{ pinmux(15), 1, 2 },
-	{ pinmux(15), 1, 3 },
-	{ pinmux(15), 1, 4 },
-	{ pinmux(15), 1, 5 },
-	{ pinmux(15), 1, 6 },
-	{ pinmux(15), 1, 7 },
-	{ pinmux(16), 1, 0 },
-	{ pinmux(16), 1, 1 },
-	{ pinmux(16), 1, 2 },
-	{ pinmux(16), 1, 3 },
-	{ pinmux(16), 1, 4 },
-	{ pinmux(16), 1, 5 },
-	{ pinmux(16), 1, 6 },
-	{ pinmux(16), 1, 7 },
-	{ pinmux(17), 1, 0 },
-	{ pinmux(17), 1, 1 },
-	{ pinmux(17), 1, 2 },
-	{ pinmux(17), 1, 3 },
-	{ pinmux(17), 1, 4 },
-	{ pinmux(17), 1, 5 },
-	{ pinmux(17), 1, 6 },
-	{ pinmux(17), 1, 7 },
-	{ pinmux(18), 1, 0 },
-	{ pinmux(18), 1, 1 },
-	{ pinmux(18), 1, 2 },
-	{ pinmux(18), 1, 3 },
-	{ pinmux(18), 1, 4 },
-	{ pinmux(18), 1, 5 },
-	{ pinmux(18), 1, 6 },
-	{ pinmux(18), 1, 7 },
-	{ pinmux(10), 1, 0 }
-};
-#endif
-
-
-/* USB0_DRVVBUS pin muxer settings */
-static const struct pinmux_config usb_pins[] = {
-	{ pinmux(9), 1, 1 }
-};
-
 static const struct pinmux_resource pinmuxes[] = {
 #ifdef CONFIG_SPI_FLASH
 	PINMUX_ITEM(spi0_pins),
 #endif
-	PINMUX_ITEM(uart_pins),
-	PINMUX_ITEM(i2c_pins),
+	PINMUX_ITEM(uart2_pins),
+	PINMUX_ITEM(i2c0_pins),
 #ifdef CONFIG_USB_DA8XX
 	PINMUX_ITEM(usb_pins),
 #endif
 #ifdef CONFIG_USE_NAND
-	PINMUX_ITEM(emifa_nand_pins),
+	PINMUX_ITEM(emifa_nand_8bit_cs3_pins),
 	PINMUX_ITEM(aemif_pins),
 #endif
 #if defined(CONFIG_DRIVER_TI_EMAC)