From c793c1b0c8ea11b46caf5a532752214b27a2df42 Mon Sep 17 00:00:00 2001 From: Magnus Damm Date: Fri, 5 Feb 2010 11:14:49 +0000 Subject: ARM: mach-shmobile: SH-Mobile G3 support. This adds preliminary support for the SH-Mobile G-series. The SH-Mobile G-series is a series of ARM/SH multi-core CPUs that aside from the ARM MPU are primarily composed of existing SH IP blocks. This includes initial support for the SH7367 (SH-Mobile G3) CPU and the G3EVM reference board. Only timer, serial console, and NOR flash are supported at this point. Patches for the interrupt controller, pinmux support, clock framework and runtime pm will be submitted as feature patches on top of this. Signed-off-by: Magnus Damm Signed-off-by: Paul Mundt --- arch/arm/mach-shmobile/clock-sh7367.c | 89 +++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 arch/arm/mach-shmobile/clock-sh7367.c (limited to 'arch/arm/mach-shmobile/clock-sh7367.c') diff --git a/arch/arm/mach-shmobile/clock-sh7367.c b/arch/arm/mach-shmobile/clock-sh7367.c new file mode 100644 index 000000000000..3b2e3f2fc7ea --- /dev/null +++ b/arch/arm/mach-shmobile/clock-sh7367.c @@ -0,0 +1,89 @@ +/* + * Preliminary clock framework support for sh7367 + * + * Copyright (C) 2010 Magnus Damm + * + * 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 +#include +#include +#include +#include + +struct clk { + const char *name; + unsigned long rate; +}; + +#include + +int __clk_get(struct clk *clk) +{ + return 1; +} +EXPORT_SYMBOL(__clk_get); + +void __clk_put(struct clk *clk) +{ +} +EXPORT_SYMBOL(__clk_put); + + +int clk_enable(struct clk *clk) +{ + return 0; +} +EXPORT_SYMBOL(clk_enable); + +void clk_disable(struct clk *clk) +{ +} +EXPORT_SYMBOL(clk_disable); + +unsigned long clk_get_rate(struct clk *clk) +{ + return clk ? clk->rate : 0; +} +EXPORT_SYMBOL(clk_get_rate); + +/* a static peripheral clock for now - enough to get sh-sci working */ +static struct clk peripheral_clk = { + .name = "peripheral_clk", + .rate = 48000000, +}; + +/* a static rclk for now - enough to get sh_cmt working */ +static struct clk r_clk = { + .name = "r_clk", + .rate = 32768, +}; + +static struct clk_lookup lookups[] = { + { + .clk = &peripheral_clk, + }, { + .clk = &r_clk, + } +}; + +void __init sh7367_clock_init(void) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(lookups); i++) { + lookups[i].con_id = lookups[i].clk->name; + clkdev_add(&lookups[i]); + } +} -- cgit From 3a7b802d1a8c279876ec74094d71f3c6c45d8030 Mon Sep 17 00:00:00 2001 From: Magnus Damm Date: Wed, 10 Feb 2010 20:13:31 +0900 Subject: ARM: mach-shmobile: G3EVM USBHS support Add G3EVM platform data and a magic setup sequence to initialize the r8a66597 block aka USBHS in sh7367. Signed-off-by: Magnus Damm Signed-off-by: Paul Mundt --- arch/arm/mach-shmobile/clock-sh7367.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'arch/arm/mach-shmobile/clock-sh7367.c') diff --git a/arch/arm/mach-shmobile/clock-sh7367.c b/arch/arm/mach-shmobile/clock-sh7367.c index 3b2e3f2fc7ea..58bd54e1113a 100644 --- a/arch/arm/mach-shmobile/clock-sh7367.c +++ b/arch/arm/mach-shmobile/clock-sh7367.c @@ -70,11 +70,18 @@ static struct clk r_clk = { .rate = 32768, }; +/* a static usb0 for now - enough to get r8a66597 working */ +static struct clk usb0_clk = { + .name = "usb0", +}; + static struct clk_lookup lookups[] = { { .clk = &peripheral_clk, }, { .clk = &r_clk, + }, { + .clk = &usb0_clk, } }; -- cgit