-
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.
sh: Add support for SH7206 and SH7619 CPU subtypes.
This implements initial support for the SH7206 (SH-2A) and SH7619 (SH-2) MMU-less CPUs. Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
- Loading branch information
Yoshinori Sato
authored and
Paul Mundt
committed
Dec 6, 2006
1 parent
e624386
commit 9d4436a
Showing
26 changed files
with
1,036 additions
and
53 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
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
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
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,81 @@ | ||
/* | ||
* arch/sh/kernel/cpu/sh2/clock-sh7619.c | ||
* | ||
* SH7619 support for the clock framework | ||
* | ||
* Copyright (C) 2006 Yoshinori Sato | ||
* | ||
* Based on clock-sh4.c | ||
* Copyright (C) 2005 Paul Mundt | ||
* | ||
* This file is subject to the terms and conditions of the GNU General Public | ||
* License. See the file "COPYING" in the main directory of this archive | ||
* for more details. | ||
*/ | ||
#include <linux/init.h> | ||
#include <linux/kernel.h> | ||
#include <asm/clock.h> | ||
#include <asm/freq.h> | ||
#include <asm/io.h> | ||
|
||
const static int pll1rate[]={1,2}; | ||
const static int pfc_divisors[]={1,2,0,4}; | ||
|
||
#if (CONFIG_SH_CLK_MD == 1) || (CONFIG_SH_CLK_MD == 2) | ||
#define PLL2 (4) | ||
#elif (CONFIG_SH_CLK_MD == 5) || (CONFIG_SH_CLK_MD == 6) | ||
#define PLL2 (2) | ||
#else | ||
#error "Illigal Clock Mode!" | ||
#endif | ||
|
||
static void master_clk_init(struct clk *clk) | ||
{ | ||
clk->rate *= PLL2 * pll1rate[(ctrl_inw(FREQCR) >> 8) & 7]; | ||
} | ||
|
||
static struct clk_ops sh7619_master_clk_ops = { | ||
.init = master_clk_init, | ||
}; | ||
|
||
static void module_clk_recalc(struct clk *clk) | ||
{ | ||
int idx = (ctrl_inw(FREQCR) & 0x0007); | ||
clk->rate = clk->parent->rate / pfc_divisors[idx]; | ||
} | ||
|
||
static struct clk_ops sh7619_module_clk_ops = { | ||
.recalc = module_clk_recalc, | ||
}; | ||
|
||
static void bus_clk_recalc(struct clk *clk) | ||
{ | ||
clk->rate = clk->parent->rate / pll1rate[(ctrl_inw(FREQCR) >> 8) & 7]; | ||
} | ||
|
||
static struct clk_ops sh7619_bus_clk_ops = { | ||
.recalc = bus_clk_recalc, | ||
}; | ||
|
||
static void cpu_clk_recalc(struct clk *clk) | ||
{ | ||
clk->rate = clk->parent->rate; | ||
} | ||
|
||
static struct clk_ops sh7619_cpu_clk_ops = { | ||
.recalc = cpu_clk_recalc, | ||
}; | ||
|
||
static struct clk_ops *sh7619_clk_ops[] = { | ||
&sh7619_master_clk_ops, | ||
&sh7619_module_clk_ops, | ||
&sh7619_bus_clk_ops, | ||
&sh7619_cpu_clk_ops, | ||
}; | ||
|
||
void __init arch_init_clk_ops(struct clk_ops **ops, int idx) | ||
{ | ||
if (idx < ARRAY_SIZE(sh7619_clk_ops)) | ||
*ops = sh7619_clk_ops[idx]; | ||
} | ||
|
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,53 @@ | ||
/* | ||
* SH7619 Setup | ||
* | ||
* Copyright (C) 2006 Yoshinori Sato | ||
* | ||
* This file is subject to the terms and conditions of the GNU General Public | ||
* License. See the file "COPYING" in the main directory of this archive | ||
* for more details. | ||
*/ | ||
#include <linux/platform_device.h> | ||
#include <linux/init.h> | ||
#include <linux/serial.h> | ||
#include <asm/sci.h> | ||
|
||
static struct plat_sci_port sci_platform_data[] = { | ||
{ | ||
.mapbase = 0xf8400000, | ||
.flags = UPF_BOOT_AUTOCONF, | ||
.type = PORT_SCIF, | ||
.irqs = { 88, 89, 91, 90}, | ||
}, { | ||
.mapbase = 0xf8410000, | ||
.flags = UPF_BOOT_AUTOCONF, | ||
.type = PORT_SCIF, | ||
.irqs = { 92, 93, 95, 94}, | ||
}, { | ||
.mapbase = 0xf8420000, | ||
.flags = UPF_BOOT_AUTOCONF, | ||
.type = PORT_SCIF, | ||
.irqs = { 96, 97, 99, 98}, | ||
}, { | ||
.flags = 0, | ||
} | ||
}; | ||
|
||
static struct platform_device sci_device = { | ||
.name = "sh-sci", | ||
.id = -1, | ||
.dev = { | ||
.platform_data = sci_platform_data, | ||
}, | ||
}; | ||
|
||
static struct platform_device *sh7619_devices[] __initdata = { | ||
&sci_device, | ||
}; | ||
|
||
static int __init sh7619_devices_setup(void) | ||
{ | ||
return platform_add_devices(sh7619_devices, | ||
ARRAY_SIZE(sh7619_devices)); | ||
} | ||
__initcall(sh7619_devices_setup); |
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,10 @@ | ||
# | ||
# Makefile for the Linux/SuperH SH-2A backends. | ||
# | ||
|
||
obj-y := common.o probe.o | ||
|
||
common-y += $(addprefix ../sh2/, ex.o) | ||
common-y += $(addprefix ../sh2/, entry.o) | ||
|
||
obj-$(CONFIG_CPU_SUBTYPE_SH7206) += setup-sh7206.o clock-sh7206.o |
Oops, something went wrong.