-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ARM: shmobile: kzm9g: Reference DT implementation
Provide alternate board code for the kzm9g to demonstrate how DT may be used given the current state of driver device tree support. This is intended to act as a reference for mach-shmobile developers. Some notes: * Brings up the GIC interrupt handler using device tree * Brings up the following device using device tree: - MMCIF (MMC) * Does not bring up the INTC interrupt controller at all, thus external devices may not be used. In particular, the SMSC ethernet device may not be used and thus NFS root may not be used. * Uses existing C code and not device tree to initialise the following, which are needed for a working board: - SCIF (Serial) - CMT (Clock) - PFC (GPIO) To use this alternate board code instead of the normal board code, CONFIG_MACH_KZM9G_REFERENCE should be selected in the kernel config. And the sh73a0-kzm9g-reference.dtb flattened device tree blob should be used. Includes fix by Thierry Reding to no longer use gic_handle_irq() Includes fixes by Guennadi Liakhovetski for recent pinmux changes. Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Cc: Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
- Loading branch information
Simon Horman
committed
Mar 18, 2013
1 parent
73d6a69
commit b8b82b2
Showing
5 changed files
with
140 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Device Tree Source for the KZM-A9-GT board | ||
* | ||
* Copyright (C) 2012 Horms Solutions Ltd. | ||
* | ||
* Based on sh73a0-kzm9g.dts | ||
* Copyright (C) 2012 Renesas Solutions Corp. | ||
* | ||
* This file is licensed under the terms of the GNU General Public License | ||
* version 2. This program is licensed "as is" without any warranty of any | ||
* kind, whether express or implied. | ||
*/ | ||
|
||
/dts-v1/; | ||
/include/ "sh73a0-reference.dtsi" | ||
|
||
/ { | ||
model = "KZM-A9-GT"; | ||
compatible = "renesas,kzm9g-reference", "renesas,sh73a0"; | ||
|
||
chosen { | ||
bootargs = "console=tty0 console=ttySC4,115200 root=/dev/nfs ip=dhcp ignore_loglevel earlyprintk=sh-sci.4,115200"; | ||
}; | ||
|
||
memory { | ||
device_type = "memory"; | ||
reg = <0x41000000 0x1e800000>; | ||
}; | ||
|
||
fixedregulator1v8: fixedregulator@0 { | ||
compatible = "regulator-fixed"; | ||
regulator-name = "fixed-1.8V"; | ||
regulator-min-microvolt = <1800000>; | ||
regulator-max-microvolt = <1800000>; | ||
}; | ||
}; | ||
|
||
&mmcif { | ||
vmmc-supply = <&fixedregulator1v8>; | ||
vqmmc-supply = <&fixedregulator1v8>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
/* | ||
* 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> | ||
#include <mach/sh73a0.h> | ||
#include <mach/common.h> | ||
#include <asm/hardware/cache-l2x0.h> | ||
#include <asm/mach-types.h> | ||
#include <asm/mach/arch.h> | ||
|
||
static const struct pinctrl_map kzm_pinctrl_map[] = { | ||
PIN_MAP_MUX_GROUP_DEFAULT("i2c-sh_mobile.3", "pfc-sh73a0", | ||
"i2c3_1", "i2c3"), | ||
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"), | ||
}; | ||
|
||
static void __init kzm_init(void) | ||
{ | ||
sh73a0_add_standard_devices_dt(); | ||
pinctrl_register_mappings(kzm_pinctrl_map, ARRAY_SIZE(kzm_pinctrl_map)); | ||
|
||
#ifdef CONFIG_CACHE_L2X0 | ||
/* Early BRESP enable, Shared attribute override enable, 64K*8way */ | ||
l2x0_init(IOMEM(0xf0100000), 0x40460000, 0x82000fff); | ||
#endif | ||
} | ||
|
||
static void kzm9g_restart(char mode, const char *cmd) | ||
{ | ||
#define RESCNT2 IOMEM(0xe6188020) | ||
/* Do soft power on reset */ | ||
writel((1 << 31), RESCNT2); | ||
} | ||
|
||
static const char *kzm9g_boards_compat_dt[] __initdata = { | ||
"renesas,kzm9g-reference", | ||
NULL, | ||
}; | ||
|
||
/* Please note that the clock initialisation shcheme used in | ||
* sh73a0_add_early_devices_dt() and sh73a0_add_standard_devices_dt() | ||
* does not work with SMP as there is a yet to be resolved lock-up in | ||
* workqueue initialisation. | ||
* | ||
* CONFIG_SMP should be disabled when using this code. | ||
*/ | ||
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_late = shmobile_init_late, | ||
.init_time = shmobile_timer_init, | ||
.restart = kzm9g_restart, | ||
.dt_compat = kzm9g_boards_compat_dt, | ||
MACHINE_END |