|
@@ -0,0 +1,90 @@
|
|
|
+/*
|
|
|
+ * sh73a0 processor support - PFC hardware block
|
|
|
+ *
|
|
|
+ * Copyright (C) 2010 Renesas Solutions Corp.
|
|
|
+ * Copyright (C) 2010 NISHIMOTO Hiroki
|
|
|
+ *
|
|
|
+ * 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; version 2 of the
|
|
|
+ * License.
|
|
|
+ *
|
|
|
+ * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
+ */
|
|
|
+#include <linux/init.h>
|
|
|
+#include <linux/kernel.h>
|
|
|
+#include <linux/sh_pfc.h>
|
|
|
+#include <mach/sh73a0.h>
|
|
|
+#include <mach/irqs.h>
|
|
|
+
|
|
|
+#define CPU_ALL_PORT(fn, pfx, sfx) \
|
|
|
+ PORT_10(fn, pfx, sfx), PORT_10(fn, pfx##1, sfx), \
|
|
|
+ PORT_10(fn, pfx##2, sfx), PORT_10(fn, pfx##3, sfx), \
|
|
|
+ PORT_10(fn, pfx##4, sfx), PORT_10(fn, pfx##5, sfx), \
|
|
|
+ PORT_10(fn, pfx##6, sfx), PORT_10(fn, pfx##7, sfx), \
|
|
|
+ PORT_10(fn, pfx##8, sfx), PORT_10(fn, pfx##9, sfx), \
|
|
|
+ PORT_10(fn, pfx##10, sfx), \
|
|
|
+ PORT_1(fn, pfx##110, sfx), PORT_1(fn, pfx##111, sfx), \
|
|
|
+ PORT_1(fn, pfx##112, sfx), PORT_1(fn, pfx##113, sfx), \
|
|
|
+ PORT_1(fn, pfx##114, sfx), PORT_1(fn, pfx##115, sfx), \
|
|
|
+ PORT_1(fn, pfx##116, sfx), PORT_1(fn, pfx##117, sfx), \
|
|
|
+ PORT_1(fn, pfx##118, sfx), \
|
|
|
+ PORT_1(fn, pfx##128, sfx), PORT_1(fn, pfx##129, sfx), \
|
|
|
+ PORT_10(fn, pfx##13, sfx), PORT_10(fn, pfx##14, sfx), \
|
|
|
+ PORT_10(fn, pfx##15, sfx), \
|
|
|
+ PORT_1(fn, pfx##160, sfx), PORT_1(fn, pfx##161, sfx), \
|
|
|
+ PORT_1(fn, pfx##162, sfx), PORT_1(fn, pfx##163, sfx), \
|
|
|
+ PORT_1(fn, pfx##164, sfx), \
|
|
|
+ PORT_1(fn, pfx##192, sfx), PORT_1(fn, pfx##193, sfx), \
|
|
|
+ PORT_1(fn, pfx##194, sfx), PORT_1(fn, pfx##195, sfx), \
|
|
|
+ PORT_1(fn, pfx##196, sfx), PORT_1(fn, pfx##197, sfx), \
|
|
|
+ PORT_1(fn, pfx##198, sfx), PORT_1(fn, pfx##199, sfx), \
|
|
|
+ PORT_10(fn, pfx##20, sfx), PORT_10(fn, pfx##21, sfx), \
|
|
|
+ PORT_10(fn, pfx##22, sfx), PORT_10(fn, pfx##23, sfx), \
|
|
|
+ PORT_10(fn, pfx##24, sfx), PORT_10(fn, pfx##25, sfx), \
|
|
|
+ PORT_10(fn, pfx##26, sfx), PORT_10(fn, pfx##27, sfx), \
|
|
|
+ PORT_1(fn, pfx##280, sfx), PORT_1(fn, pfx##281, sfx), \
|
|
|
+ PORT_1(fn, pfx##282, sfx), \
|
|
|
+ PORT_1(fn, pfx##288, sfx), PORT_1(fn, pfx##289, sfx), \
|
|
|
+ PORT_10(fn, pfx##29, sfx), PORT_10(fn, pfx##30, sfx)
|
|
|
+
|
|
|
+enum {
|
|
|
+ PINMUX_RESERVED = 0,
|
|
|
+
|
|
|
+ PINMUX_DATA_BEGIN,
|
|
|
+ PORT_ALL(DATA), /* PORT0_DATA -> PORT309_DATA */
|
|
|
+ PINMUX_DATA_END,
|
|
|
+
|
|
|
+ PINMUX_INPUT_BEGIN,
|
|
|
+ PORT_ALL(IN), /* PORT0_IN -> PORT309_IN */
|
|
|
+ PINMUX_INPUT_END,
|
|
|
+
|
|
|
+ PINMUX_INPUT_PULLUP_BEGIN,
|
|
|
+ PORT_ALL(IN_PU), /* PORT0_IN_PU -> PORT309_IN_PU */
|
|
|
+ PINMUX_INPUT_PULLUP_END,
|
|
|
+
|
|
|
+ PINMUX_INPUT_PULLDOWN_BEGIN,
|
|
|
+ PORT_ALL(IN_PD), /* PORT0_IN_PD -> PORT309_IN_PD */
|
|
|
+ PINMUX_INPUT_PULLDOWN_END,
|
|
|
+
|
|
|
+ PINMUX_OUTPUT_BEGIN,
|
|
|
+ PORT_ALL(OUT), /* PORT0_OUT -> PORT309_OUT */
|
|
|
+ PINMUX_OUTPUT_END,
|
|
|
+
|
|
|
+ PINMUX_FUNCTION_BEGIN,
|
|
|
+ PORT_ALL(FN_IN), /* PORT0_FN_IN -> PORT309_FN_IN */
|
|
|
+ PORT_ALL(FN_OUT), /* PORT0_FN_OUT -> PORT309_FN_OUT */
|
|
|
+ PORT_ALL(FN0), /* PORT0_FN0 -> PORT309_FN0 */
|
|
|
+ PORT_ALL(FN1), /* PORT0_FN1 -> PORT309_FN1 */
|
|
|
+ PORT_ALL(FN2), /* PORT0_FN2 -> PORT309_FN2 */
|
|
|
+ PORT_ALL(FN3), /* PORT0_FN3 -> PORT309_FN3 */
|
|
|
+ PORT_ALL(FN4), /* PORT0_FN4 -> PORT309_FN4 */
|
|
|
+ PORT_ALL(FN5), /* PORT0_FN5 -> PORT309_FN5 */
|
|
|
+ PORT_ALL(FN6), /* PORT0_FN6 -> PORT309_FN6 */
|