2012-11-21 22:34:25 +07:00
|
|
|
/*
|
|
|
|
* KZM-A9-GT board support - Reference Device Tree Implementation
|
|
|
|
*
|
|
|
|
* Copyright (C) 2012 Horms Solutions Ltd.
|
|
|
|
*
|
|
|
|
* Based on board-kzm9g.c
|
|
|
|
* Copyright (C) 2012 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
|
|
|
|
*
|
|
|
|
* 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/delay.h>
|
|
|
|
#include <linux/gpio.h>
|
|
|
|
#include <linux/io.h>
|
|
|
|
#include <linux/irq.h>
|
|
|
|
#include <linux/irqchip.h>
|
|
|
|
#include <linux/input.h>
|
|
|
|
#include <linux/of_platform.h>
|
|
|
|
#include <linux/pinctrl/machine.h>
|
2013-02-09 01:38:27 +07:00
|
|
|
#include <linux/pinctrl/pinconf-generic.h>
|
2012-11-21 22:34:25 +07:00
|
|
|
#include <mach/sh73a0.h>
|
|
|
|
#include <mach/common.h>
|
|
|
|
#include <asm/hardware/cache-l2x0.h>
|
|
|
|
#include <asm/mach-types.h>
|
|
|
|
#include <asm/mach/arch.h>
|
|
|
|
|
2013-02-09 01:38:27 +07:00
|
|
|
static unsigned long pin_pullup_conf[] = {
|
|
|
|
PIN_CONF_PACKED(PIN_CONFIG_BIAS_PULL_UP, 0),
|
|
|
|
};
|
|
|
|
|
2012-11-21 22:34:25 +07:00
|
|
|
static const struct pinctrl_map kzm_pinctrl_map[] = {
|
2013-03-20 00:38:50 +07:00
|
|
|
PIN_MAP_MUX_GROUP_DEFAULT("e6826000.i2c", "pfc-sh73a0",
|
2012-11-21 22:34:25 +07:00
|
|
|
"i2c3_1", "i2c3"),
|
2013-02-09 01:38:27 +07:00
|
|
|
/* MMCIF */
|
2013-03-20 00:38:50 +07:00
|
|
|
PIN_MAP_MUX_GROUP_DEFAULT("e6bd0000.mmcif", "pfc-sh73a0",
|
2013-02-09 01:38:27 +07:00
|
|
|
"mmc0_data8_0", "mmc0"),
|
2013-03-20 00:38:50 +07:00
|
|
|
PIN_MAP_MUX_GROUP_DEFAULT("e6bd0000.mmcif", "pfc-sh73a0",
|
2013-02-09 01:38:27 +07:00
|
|
|
"mmc0_ctrl_0", "mmc0"),
|
2013-03-20 00:38:50 +07:00
|
|
|
PIN_MAP_CONFIGS_PIN_DEFAULT("e6bd0000.mmcif", "pfc-sh73a0",
|
2013-02-09 01:38:27 +07:00
|
|
|
"PORT279", pin_pullup_conf),
|
2013-03-20 00:38:50 +07:00
|
|
|
PIN_MAP_CONFIGS_GROUP_DEFAULT("e6bd0000.mmcif", "pfc-sh73a0",
|
2013-02-09 01:38:27 +07:00
|
|
|
"mmc0_data8_0", pin_pullup_conf),
|
|
|
|
/* SCIFA4 */
|
2012-11-21 22:34:25 +07:00
|
|
|
PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.4", "pfc-sh73a0",
|
|
|
|
"scifa4_data", "scifa4"),
|
|
|
|
PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.4", "pfc-sh73a0",
|
|
|
|
"scifa4_ctrl", "scifa4"),
|
2013-02-09 01:38:27 +07:00
|
|
|
/* SDHI0 */
|
2013-03-20 00:38:50 +07:00
|
|
|
PIN_MAP_MUX_GROUP_DEFAULT("ee100000.sdhi", "pfc-sh73a0",
|
2013-02-09 01:38:27 +07:00
|
|
|
"sdhi0_data4", "sdhi0"),
|
2013-03-20 00:38:50 +07:00
|
|
|
PIN_MAP_MUX_GROUP_DEFAULT("ee100000.sdhi", "pfc-sh73a0",
|
2013-02-09 01:38:27 +07:00
|
|
|
"sdhi0_ctrl", "sdhi0"),
|
2013-03-20 00:38:50 +07:00
|
|
|
PIN_MAP_MUX_GROUP_DEFAULT("ee100000.sdhi", "pfc-sh73a0",
|
2013-02-09 01:38:27 +07:00
|
|
|
"sdhi0_cd", "sdhi0"),
|
2013-03-20 00:38:50 +07:00
|
|
|
PIN_MAP_MUX_GROUP_DEFAULT("ee100000.sdhi", "pfc-sh73a0",
|
2013-02-09 01:38:27 +07:00
|
|
|
"sdhi0_wp", "sdhi0"),
|
|
|
|
/* SDHI2 */
|
2013-03-20 00:38:50 +07:00
|
|
|
PIN_MAP_MUX_GROUP_DEFAULT("ee140000.sdhi", "pfc-sh73a0",
|
2013-02-09 01:38:27 +07:00
|
|
|
"sdhi2_data4", "sdhi2"),
|
2013-03-20 00:38:50 +07:00
|
|
|
PIN_MAP_MUX_GROUP_DEFAULT("ee140000.sdhi", "pfc-sh73a0",
|
2013-02-09 01:38:27 +07:00
|
|
|
"sdhi2_ctrl", "sdhi2"),
|
2012-11-21 22:34:25 +07:00
|
|
|
};
|
|
|
|
|
|
|
|
static void __init kzm_init(void)
|
|
|
|
{
|
|
|
|
sh73a0_add_standard_devices_dt();
|
|
|
|
pinctrl_register_mappings(kzm_pinctrl_map, ARRAY_SIZE(kzm_pinctrl_map));
|
2013-02-09 01:38:31 +07:00
|
|
|
sh73a0_pinmux_init();
|
2012-11-21 22:34:25 +07:00
|
|
|
|
2013-02-09 01:38:27 +07:00
|
|
|
/* enable SD */
|
2013-03-20 00:38:50 +07:00
|
|
|
gpio_request_one(15, GPIOF_OUT_INIT_HIGH, NULL); /* power */
|
2013-02-09 01:38:27 +07:00
|
|
|
|
2013-03-20 00:38:50 +07:00
|
|
|
gpio_request_one(14, GPIOF_OUT_INIT_HIGH, NULL); /* power */
|
2013-02-09 01:38:27 +07:00
|
|
|
|
2012-11-21 22:34:25 +07:00
|
|
|
#ifdef CONFIG_CACHE_L2X0
|
|
|
|
/* Early BRESP enable, Shared attribute override enable, 64K*8way */
|
|
|
|
l2x0_init(IOMEM(0xf0100000), 0x40460000, 0x82000fff);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
static const char *kzm9g_boards_compat_dt[] __initdata = {
|
|
|
|
"renesas,kzm9g-reference",
|
|
|
|
NULL,
|
|
|
|
};
|
|
|
|
|
|
|
|
DT_MACHINE_START(KZM9G_DT, "kzm9g-reference")
|
|
|
|
.smp = smp_ops(sh73a0_smp_ops),
|
|
|
|
.map_io = sh73a0_map_io,
|
|
|
|
.init_early = sh73a0_init_delay,
|
|
|
|
.nr_irqs = NR_IRQS_LEGACY,
|
|
|
|
.init_irq = irqchip_init,
|
|
|
|
.init_machine = kzm_init,
|
|
|
|
.init_time = shmobile_timer_init,
|
|
|
|
.dt_compat = kzm9g_boards_compat_dt,
|
|
|
|
MACHINE_END
|