Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: (110 commits) sh: i2c-sh7760: Replase from ctrl_* to __raw_* sh: clkfwk: Shuffle around to match the intc split up. sh: clkfwk: modify for_each_frequency end condition sh: fix clk_get() error handling sh: clkfwk: Fix fault in frequency iterator. sh: clkfwk: Add a helper for rate rounding by divisor ranges. sh: clkfwk: Abstract rate rounding helper. sh: clkfwk: support clock remapping. sh: pci: Convert to upper/lower_32_bits() helpers. sh: mach-sdk7786: Add support for the FPGA SRAM. sh: Provide a generic SRAM pool for tiny memories. sh: pci: Support secondary FPGA-driven PCIe clocks on SDK7786. sh: pci: Support slot 4 routing on SDK7786. sh: Fix up PMB locking. sh: mach-sdk7786: Add support for fpga gpios. sh: use pr_fmt for clock framework, too. sh: remove name and id from struct clk sh: free-without-alloc fix for sh_mobile_lcdcfb sh: perf: Set up perf_max_events. sh: perf: Support SH-X3 hardware counters. ... Fix up trivial conflicts (perf_max_events got removed) in arch/sh/kernel/perf_event.c
This commit is contained in:
@ -12,9 +12,9 @@ endif
|
||||
CFLAGS_REMOVE_return_address.o = -pg
|
||||
|
||||
obj-y := clkdev.o debugtraps.o dma-nommu.o dumpstack.o \
|
||||
idle.o io.o irq.o \
|
||||
irq_$(BITS).o machvec.o nmi_debug.o process.o \
|
||||
process_$(BITS).o ptrace_$(BITS).o \
|
||||
idle.o io.o irq.o irq_$(BITS).o kdebugfs.o \
|
||||
machvec.o nmi_debug.o process.o \
|
||||
process_$(BITS).o ptrace.o ptrace_$(BITS).o \
|
||||
reboot.o return_address.o \
|
||||
setup.o signal_$(BITS).o sys_sh.o sys_sh$(BITS).o \
|
||||
syscalls_$(BITS).o time.o topology.o traps.o \
|
||||
@ -44,4 +44,4 @@ obj-$(CONFIG_HAS_IOPORT) += io_generic.o
|
||||
obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o
|
||||
obj-$(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST) += localtimer.o
|
||||
|
||||
EXTRA_CFLAGS += -Werror
|
||||
ccflags-y := -Werror
|
||||
|
@ -161,9 +161,11 @@ EXPORT_SYMBOL(clk_add_alias);
|
||||
*/
|
||||
void clkdev_drop(struct clk_lookup *cl)
|
||||
{
|
||||
struct clk_lookup_alloc *cla = container_of(cl, struct clk_lookup_alloc, cl);
|
||||
|
||||
mutex_lock(&clocks_mutex);
|
||||
list_del(&cl->node);
|
||||
mutex_unlock(&clocks_mutex);
|
||||
kfree(cl);
|
||||
kfree(cla);
|
||||
}
|
||||
EXPORT_SYMBOL(clkdev_drop);
|
||||
|
@ -150,7 +150,7 @@ void __cpuinit cpu_probe(void)
|
||||
boot_cpu_data.type = CPU_SH7724;
|
||||
boot_cpu_data.flags |= CPU_HAS_L2_CACHE;
|
||||
break;
|
||||
case 0x50:
|
||||
case 0x10:
|
||||
boot_cpu_data.type = CPU_SH7757;
|
||||
break;
|
||||
}
|
||||
|
@ -8,13 +8,13 @@ obj-$(CONFIG_CPU_SUBTYPE_SH7763) += setup-sh7763.o
|
||||
obj-$(CONFIG_CPU_SUBTYPE_SH7770) += setup-sh7770.o
|
||||
obj-$(CONFIG_CPU_SUBTYPE_SH7780) += setup-sh7780.o
|
||||
obj-$(CONFIG_CPU_SUBTYPE_SH7785) += setup-sh7785.o
|
||||
obj-$(CONFIG_CPU_SUBTYPE_SH7786) += setup-sh7786.o
|
||||
obj-$(CONFIG_CPU_SUBTYPE_SH7786) += setup-sh7786.o intc-shx3.o
|
||||
obj-$(CONFIG_CPU_SUBTYPE_SH7343) += setup-sh7343.o
|
||||
obj-$(CONFIG_CPU_SUBTYPE_SH7722) += setup-sh7722.o
|
||||
obj-$(CONFIG_CPU_SUBTYPE_SH7723) += setup-sh7723.o
|
||||
obj-$(CONFIG_CPU_SUBTYPE_SH7724) += setup-sh7724.o
|
||||
obj-$(CONFIG_CPU_SUBTYPE_SH7366) += setup-sh7366.o
|
||||
obj-$(CONFIG_CPU_SUBTYPE_SHX3) += setup-shx3.o
|
||||
obj-$(CONFIG_CPU_SUBTYPE_SHX3) += setup-shx3.o intc-shx3.o
|
||||
|
||||
# SMP setup
|
||||
smp-$(CONFIG_CPU_SHX3) := smp-shx3.o
|
||||
@ -40,6 +40,7 @@ pinmux-$(CONFIG_CPU_SUBTYPE_SH7724) := pinmux-sh7724.o
|
||||
pinmux-$(CONFIG_CPU_SUBTYPE_SH7757) := pinmux-sh7757.o
|
||||
pinmux-$(CONFIG_CPU_SUBTYPE_SH7785) := pinmux-sh7785.o
|
||||
pinmux-$(CONFIG_CPU_SUBTYPE_SH7786) := pinmux-sh7786.o
|
||||
pinmux-$(CONFIG_CPU_SUBTYPE_SHX3) := pinmux-shx3.o
|
||||
|
||||
obj-y += $(clock-y)
|
||||
obj-$(CONFIG_SMP) += $(smp-y)
|
||||
|
@ -3,7 +3,7 @@
|
||||
*
|
||||
* SH7757 support for the clock framework
|
||||
*
|
||||
* Copyright (C) 2009 Renesas Solutions Corp.
|
||||
* Copyright (C) 2009-2010 Renesas Solutions Corp.
|
||||
*
|
||||
* 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
|
||||
@ -16,124 +16,147 @@
|
||||
#include <asm/clock.h>
|
||||
#include <asm/freq.h>
|
||||
|
||||
static int ifc_divisors[] = { 2, 1, 4, 1, 1, 8, 1, 1,
|
||||
16, 1, 1, 32, 1, 1, 1, 1 };
|
||||
static int sfc_divisors[] = { 2, 1, 4, 1, 1, 8, 1, 1,
|
||||
16, 1, 1, 32, 1, 1, 1, 1 };
|
||||
static int bfc_divisors[] = { 2, 1, 4, 1, 1, 8, 1, 1,
|
||||
16, 1, 1, 32, 1, 1, 1, 1 };
|
||||
static int p1fc_divisors[] = { 2, 1, 4, 1, 1, 8, 1, 1,
|
||||
16, 1, 1, 32, 1, 1, 1, 1 };
|
||||
|
||||
static void master_clk_init(struct clk *clk)
|
||||
{
|
||||
clk->rate = CONFIG_SH_PCLK_FREQ * 16;
|
||||
}
|
||||
|
||||
static struct clk_ops sh7757_master_clk_ops = {
|
||||
.init = master_clk_init,
|
||||
};
|
||||
|
||||
static void module_clk_recalc(struct clk *clk)
|
||||
{
|
||||
int idx = __raw_readl(FRQCR) & 0x0000000f;
|
||||
clk->rate = clk->parent->rate / p1fc_divisors[idx];
|
||||
}
|
||||
|
||||
static struct clk_ops sh7757_module_clk_ops = {
|
||||
.recalc = module_clk_recalc,
|
||||
};
|
||||
|
||||
static void bus_clk_recalc(struct clk *clk)
|
||||
{
|
||||
int idx = (__raw_readl(FRQCR) >> 8) & 0x0000000f;
|
||||
clk->rate = clk->parent->rate / bfc_divisors[idx];
|
||||
}
|
||||
|
||||
static struct clk_ops sh7757_bus_clk_ops = {
|
||||
.recalc = bus_clk_recalc,
|
||||
};
|
||||
|
||||
static void cpu_clk_recalc(struct clk *clk)
|
||||
{
|
||||
int idx = (__raw_readl(FRQCR) >> 20) & 0x0000000f;
|
||||
clk->rate = clk->parent->rate / ifc_divisors[idx];
|
||||
}
|
||||
|
||||
static struct clk_ops sh7757_cpu_clk_ops = {
|
||||
.recalc = cpu_clk_recalc,
|
||||
};
|
||||
|
||||
static struct clk_ops *sh7757_clk_ops[] = {
|
||||
&sh7757_master_clk_ops,
|
||||
&sh7757_module_clk_ops,
|
||||
&sh7757_bus_clk_ops,
|
||||
&sh7757_cpu_clk_ops,
|
||||
};
|
||||
|
||||
void __init arch_init_clk_ops(struct clk_ops **ops, int idx)
|
||||
{
|
||||
if (idx < ARRAY_SIZE(sh7757_clk_ops))
|
||||
*ops = sh7757_clk_ops[idx];
|
||||
}
|
||||
|
||||
static void shyway_clk_recalc(struct clk *clk)
|
||||
{
|
||||
int idx = (__raw_readl(FRQCR) >> 12) & 0x0000000f;
|
||||
clk->rate = clk->parent->rate / sfc_divisors[idx];
|
||||
}
|
||||
|
||||
static struct clk_ops sh7757_shyway_clk_ops = {
|
||||
.recalc = shyway_clk_recalc,
|
||||
};
|
||||
|
||||
static struct clk sh7757_shyway_clk = {
|
||||
.flags = CLK_ENABLE_ON_INIT,
|
||||
.ops = &sh7757_shyway_clk_ops,
|
||||
};
|
||||
|
||||
/*
|
||||
* Additional sh7757-specific on-chip clocks that aren't already part of the
|
||||
* clock framework
|
||||
* Default rate for the root input clock, reset this with clk_set_rate()
|
||||
* from the platform code.
|
||||
*/
|
||||
static struct clk *sh7757_onchip_clocks[] = {
|
||||
&sh7757_shyway_clk,
|
||||
static struct clk extal_clk = {
|
||||
.rate = 48000000,
|
||||
};
|
||||
|
||||
static unsigned long pll_recalc(struct clk *clk)
|
||||
{
|
||||
int multiplier;
|
||||
|
||||
multiplier = test_mode_pin(MODE_PIN0) ? 24 : 16;
|
||||
|
||||
return clk->parent->rate * multiplier;
|
||||
}
|
||||
|
||||
static struct clk_ops pll_clk_ops = {
|
||||
.recalc = pll_recalc,
|
||||
};
|
||||
|
||||
static struct clk pll_clk = {
|
||||
.ops = &pll_clk_ops,
|
||||
.parent = &extal_clk,
|
||||
.flags = CLK_ENABLE_ON_INIT,
|
||||
};
|
||||
|
||||
static struct clk *clks[] = {
|
||||
&extal_clk,
|
||||
&pll_clk,
|
||||
};
|
||||
|
||||
static unsigned int div2[] = { 1, 1, 2, 1, 1, 4, 1, 6,
|
||||
1, 1, 1, 16, 1, 24, 1, 1 };
|
||||
|
||||
static struct clk_div_mult_table div4_div_mult_table = {
|
||||
.divisors = div2,
|
||||
.nr_divisors = ARRAY_SIZE(div2),
|
||||
};
|
||||
|
||||
static struct clk_div4_table div4_table = {
|
||||
.div_mult_table = &div4_div_mult_table,
|
||||
};
|
||||
|
||||
enum { DIV4_I, DIV4_SH, DIV4_P, DIV4_NR };
|
||||
|
||||
#define DIV4(_bit, _mask, _flags) \
|
||||
SH_CLK_DIV4(&pll_clk, FRQCR, _bit, _mask, _flags)
|
||||
|
||||
struct clk div4_clks[DIV4_NR] = {
|
||||
/*
|
||||
* P clock is always enable, because some P clock modules is used
|
||||
* by Host PC.
|
||||
*/
|
||||
[DIV4_P] = DIV4(0, 0x2800, CLK_ENABLE_ON_INIT),
|
||||
[DIV4_SH] = DIV4(12, 0x00a0, CLK_ENABLE_ON_INIT),
|
||||
[DIV4_I] = DIV4(20, 0x0004, CLK_ENABLE_ON_INIT),
|
||||
};
|
||||
|
||||
#define MSTPCR0 0xffc80030
|
||||
#define MSTPCR1 0xffc80034
|
||||
|
||||
enum { MSTP004, MSTP000, MSTP114, MSTP113, MSTP112,
|
||||
MSTP111, MSTP110, MSTP103, MSTP102,
|
||||
MSTP_NR };
|
||||
|
||||
static struct clk mstp_clks[MSTP_NR] = {
|
||||
/* MSTPCR0 */
|
||||
[MSTP004] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 4, 0),
|
||||
[MSTP000] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 0, 0),
|
||||
|
||||
/* MSTPCR1 */
|
||||
[MSTP114] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 14, 0),
|
||||
[MSTP113] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 13, 0),
|
||||
[MSTP112] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 12, 0),
|
||||
[MSTP111] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 11, 0),
|
||||
[MSTP110] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 10, 0),
|
||||
[MSTP103] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 3, 0),
|
||||
[MSTP102] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 2, 0),
|
||||
};
|
||||
|
||||
#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
|
||||
|
||||
static struct clk_lookup lookups[] = {
|
||||
/* main clocks */
|
||||
CLKDEV_CON_ID("shyway_clk", &sh7757_shyway_clk),
|
||||
CLKDEV_CON_ID("extal", &extal_clk),
|
||||
CLKDEV_CON_ID("pll_clk", &pll_clk),
|
||||
|
||||
/* DIV4 clocks */
|
||||
CLKDEV_CON_ID("peripheral_clk", &div4_clks[DIV4_P]),
|
||||
CLKDEV_CON_ID("shyway_clk", &div4_clks[DIV4_SH]),
|
||||
CLKDEV_CON_ID("cpu_clk", &div4_clks[DIV4_I]),
|
||||
|
||||
/* MSTP32 clocks */
|
||||
CLKDEV_CON_ID("sdhi0", &mstp_clks[MSTP004]),
|
||||
CLKDEV_CON_ID("riic", &mstp_clks[MSTP000]),
|
||||
{
|
||||
/* TMU0 */
|
||||
.dev_id = "sh_tmu.0",
|
||||
.con_id = "tmu_fck",
|
||||
.clk = &mstp_clks[MSTP113],
|
||||
}, {
|
||||
/* TMU1 */
|
||||
.dev_id = "sh_tmu.1",
|
||||
.con_id = "tmu_fck",
|
||||
.clk = &mstp_clks[MSTP114],
|
||||
},
|
||||
{
|
||||
/* SCIF4 (But, ID is 2) */
|
||||
.dev_id = "sh-sci.2",
|
||||
.con_id = "sci_fck",
|
||||
.clk = &mstp_clks[MSTP112],
|
||||
}, {
|
||||
/* SCIF3 */
|
||||
.dev_id = "sh-sci.1",
|
||||
.con_id = "sci_fck",
|
||||
.clk = &mstp_clks[MSTP111],
|
||||
}, {
|
||||
/* SCIF2 */
|
||||
.dev_id = "sh-sci.0",
|
||||
.con_id = "sci_fck",
|
||||
.clk = &mstp_clks[MSTP110],
|
||||
},
|
||||
CLKDEV_CON_ID("usb0", &mstp_clks[MSTP102]),
|
||||
};
|
||||
|
||||
static int __init sh7757_clk_init(void)
|
||||
int __init arch_clk_init(void)
|
||||
{
|
||||
struct clk *clk = clk_get(NULL, "master_clk");
|
||||
int i;
|
||||
int i, ret = 0;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(sh7757_onchip_clocks); i++) {
|
||||
struct clk *clkp = sh7757_onchip_clocks[i];
|
||||
for (i = 0; i < ARRAY_SIZE(clks); i++)
|
||||
ret |= clk_register(clks[i]);
|
||||
for (i = 0; i < ARRAY_SIZE(lookups); i++)
|
||||
clkdev_add(&lookups[i]);
|
||||
|
||||
clkp->parent = clk;
|
||||
clk_register(clkp);
|
||||
clk_enable(clkp);
|
||||
}
|
||||
if (!ret)
|
||||
ret = sh_clk_div4_register(div4_clks, ARRAY_SIZE(div4_clks),
|
||||
&div4_table);
|
||||
if (!ret)
|
||||
ret = sh_clk_mstp32_register(mstp_clks, MSTP_NR);
|
||||
|
||||
/*
|
||||
* Now that we have the rest of the clocks registered, we need to
|
||||
* force the parent clock to propagate so that these clocks will
|
||||
* automatically figure out their rate. We cheat by handing the
|
||||
* parent clock its current rate and forcing child propagation.
|
||||
*/
|
||||
clk_set_rate(clk, clk_get_rate(clk));
|
||||
|
||||
clk_put(clk);
|
||||
|
||||
clkdev_add_table(lookups, ARRAY_SIZE(lookups));
|
||||
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
arch_initcall(sh7757_clk_init);
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
*
|
||||
* Copyright (C) 2006-2007 Renesas Technology Corp.
|
||||
* Copyright (C) 2006-2007 Renesas Solutions Corp.
|
||||
* Copyright (C) 2006-2007 Paul Mundt
|
||||
* Copyright (C) 2006-2010 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
|
||||
@ -18,120 +18,179 @@
|
||||
#include <asm/clock.h>
|
||||
#include <asm/freq.h>
|
||||
|
||||
static int ifc_divisors[] = { 1, 2, 4 ,6 };
|
||||
static int bfc_divisors[] = { 1, 1, 1, 1, 1, 12, 16, 18, 24, 32, 36, 48 };
|
||||
static int pfc_divisors[] = { 1, 1, 1, 1, 1, 1, 1, 18, 24, 32, 36, 48 };
|
||||
static int cfc_divisors[] = { 1, 1, 4, 6 };
|
||||
|
||||
#define IFC_POS 28
|
||||
#define IFC_MSK 0x0003
|
||||
#define BFC_MSK 0x000f
|
||||
#define PFC_MSK 0x000f
|
||||
#define CFC_MSK 0x0003
|
||||
#define BFC_POS 16
|
||||
#define PFC_POS 0
|
||||
#define CFC_POS 20
|
||||
|
||||
static void master_clk_init(struct clk *clk)
|
||||
{
|
||||
clk->rate *= pfc_divisors[(__raw_readl(FRQCR) >> PFC_POS) & PFC_MSK];
|
||||
}
|
||||
|
||||
static struct clk_ops shx3_master_clk_ops = {
|
||||
.init = master_clk_init,
|
||||
};
|
||||
|
||||
static unsigned long module_clk_recalc(struct clk *clk)
|
||||
{
|
||||
int idx = ((__raw_readl(FRQCR) >> PFC_POS) & PFC_MSK);
|
||||
return clk->parent->rate / pfc_divisors[idx];
|
||||
}
|
||||
|
||||
static struct clk_ops shx3_module_clk_ops = {
|
||||
.recalc = module_clk_recalc,
|
||||
};
|
||||
|
||||
static unsigned long bus_clk_recalc(struct clk *clk)
|
||||
{
|
||||
int idx = ((__raw_readl(FRQCR) >> BFC_POS) & BFC_MSK);
|
||||
return clk->parent->rate / bfc_divisors[idx];
|
||||
}
|
||||
|
||||
static struct clk_ops shx3_bus_clk_ops = {
|
||||
.recalc = bus_clk_recalc,
|
||||
};
|
||||
|
||||
static unsigned long cpu_clk_recalc(struct clk *clk)
|
||||
{
|
||||
int idx = ((__raw_readl(FRQCR) >> IFC_POS) & IFC_MSK);
|
||||
return clk->parent->rate / ifc_divisors[idx];
|
||||
}
|
||||
|
||||
static struct clk_ops shx3_cpu_clk_ops = {
|
||||
.recalc = cpu_clk_recalc,
|
||||
};
|
||||
|
||||
static struct clk_ops *shx3_clk_ops[] = {
|
||||
&shx3_master_clk_ops,
|
||||
&shx3_module_clk_ops,
|
||||
&shx3_bus_clk_ops,
|
||||
&shx3_cpu_clk_ops,
|
||||
};
|
||||
|
||||
void __init arch_init_clk_ops(struct clk_ops **ops, int idx)
|
||||
{
|
||||
if (idx < ARRAY_SIZE(shx3_clk_ops))
|
||||
*ops = shx3_clk_ops[idx];
|
||||
}
|
||||
|
||||
static unsigned long shyway_clk_recalc(struct clk *clk)
|
||||
{
|
||||
int idx = ((__raw_readl(FRQCR) >> CFC_POS) & CFC_MSK);
|
||||
return clk->parent->rate / cfc_divisors[idx];
|
||||
}
|
||||
|
||||
static struct clk_ops shx3_shyway_clk_ops = {
|
||||
.recalc = shyway_clk_recalc,
|
||||
};
|
||||
|
||||
static struct clk shx3_shyway_clk = {
|
||||
.flags = CLK_ENABLE_ON_INIT,
|
||||
.ops = &shx3_shyway_clk_ops,
|
||||
};
|
||||
|
||||
/*
|
||||
* Additional SHx3-specific on-chip clocks that aren't already part of the
|
||||
* clock framework
|
||||
* Default rate for the root input clock, reset this with clk_set_rate()
|
||||
* from the platform code.
|
||||
*/
|
||||
static struct clk *shx3_onchip_clocks[] = {
|
||||
&shx3_shyway_clk,
|
||||
static struct clk extal_clk = {
|
||||
.rate = 16666666,
|
||||
};
|
||||
|
||||
static unsigned long pll_recalc(struct clk *clk)
|
||||
{
|
||||
/* PLL1 has a fixed x72 multiplier. */
|
||||
return clk->parent->rate * 72;
|
||||
}
|
||||
|
||||
static struct clk_ops pll_clk_ops = {
|
||||
.recalc = pll_recalc,
|
||||
};
|
||||
|
||||
static struct clk pll_clk = {
|
||||
.ops = &pll_clk_ops,
|
||||
.parent = &extal_clk,
|
||||
.flags = CLK_ENABLE_ON_INIT,
|
||||
};
|
||||
|
||||
static struct clk *clks[] = {
|
||||
&extal_clk,
|
||||
&pll_clk,
|
||||
};
|
||||
|
||||
static unsigned int div2[] = { 1, 2, 4, 6, 8, 12, 16, 18,
|
||||
24, 32, 36, 48 };
|
||||
|
||||
static struct clk_div_mult_table div4_div_mult_table = {
|
||||
.divisors = div2,
|
||||
.nr_divisors = ARRAY_SIZE(div2),
|
||||
};
|
||||
|
||||
static struct clk_div4_table div4_table = {
|
||||
.div_mult_table = &div4_div_mult_table,
|
||||
};
|
||||
|
||||
enum { DIV4_I, DIV4_SH, DIV4_B, DIV4_DDR, DIV4_SHA, DIV4_P, DIV4_NR };
|
||||
|
||||
#define DIV4(_bit, _mask, _flags) \
|
||||
SH_CLK_DIV4(&pll_clk, FRQMR1, _bit, _mask, _flags)
|
||||
|
||||
struct clk div4_clks[DIV4_NR] = {
|
||||
[DIV4_P] = DIV4(0, 0x0f80, 0),
|
||||
[DIV4_SHA] = DIV4(4, 0x0ff0, 0),
|
||||
[DIV4_DDR] = DIV4(12, 0x000c, CLK_ENABLE_ON_INIT),
|
||||
[DIV4_B] = DIV4(16, 0x0fe0, CLK_ENABLE_ON_INIT),
|
||||
[DIV4_SH] = DIV4(20, 0x000c, CLK_ENABLE_ON_INIT),
|
||||
[DIV4_I] = DIV4(28, 0x000e, CLK_ENABLE_ON_INIT),
|
||||
};
|
||||
|
||||
#define MSTPCR0 0xffc00030
|
||||
#define MSTPCR1 0xffc00034
|
||||
|
||||
enum { MSTP027, MSTP026, MSTP025, MSTP024,
|
||||
MSTP009, MSTP008, MSTP003, MSTP002,
|
||||
MSTP001, MSTP000, MSTP119, MSTP105,
|
||||
MSTP104, MSTP_NR };
|
||||
|
||||
static struct clk mstp_clks[MSTP_NR] = {
|
||||
/* MSTPCR0 */
|
||||
[MSTP027] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 27, 0),
|
||||
[MSTP026] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 26, 0),
|
||||
[MSTP025] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 25, 0),
|
||||
[MSTP024] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 24, 0),
|
||||
[MSTP009] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 9, 0),
|
||||
[MSTP008] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 8, 0),
|
||||
[MSTP003] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 3, 0),
|
||||
[MSTP002] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 2, 0),
|
||||
[MSTP001] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 1, 0),
|
||||
[MSTP000] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 0, 0),
|
||||
|
||||
/* MSTPCR1 */
|
||||
[MSTP119] = SH_CLK_MSTP32(NULL, MSTPCR1, 19, 0),
|
||||
[MSTP105] = SH_CLK_MSTP32(NULL, MSTPCR1, 5, 0),
|
||||
[MSTP104] = SH_CLK_MSTP32(NULL, MSTPCR1, 4, 0),
|
||||
};
|
||||
|
||||
#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
|
||||
|
||||
static struct clk_lookup lookups[] = {
|
||||
/* main clocks */
|
||||
CLKDEV_CON_ID("shyway_clk", &shx3_shyway_clk),
|
||||
CLKDEV_CON_ID("extal", &extal_clk),
|
||||
CLKDEV_CON_ID("pll_clk", &pll_clk),
|
||||
|
||||
/* DIV4 clocks */
|
||||
CLKDEV_CON_ID("peripheral_clk", &div4_clks[DIV4_P]),
|
||||
CLKDEV_CON_ID("shywaya_clk", &div4_clks[DIV4_SHA]),
|
||||
CLKDEV_CON_ID("ddr_clk", &div4_clks[DIV4_DDR]),
|
||||
CLKDEV_CON_ID("bus_clk", &div4_clks[DIV4_B]),
|
||||
CLKDEV_CON_ID("shyway_clk", &div4_clks[DIV4_SH]),
|
||||
CLKDEV_CON_ID("cpu_clk", &div4_clks[DIV4_I]),
|
||||
|
||||
/* MSTP32 clocks */
|
||||
{
|
||||
/* SCIF3 */
|
||||
.dev_id = "sh-sci.3",
|
||||
.con_id = "sci_fck",
|
||||
.clk = &mstp_clks[MSTP027],
|
||||
}, {
|
||||
/* SCIF2 */
|
||||
.dev_id = "sh-sci.2",
|
||||
.con_id = "sci_fck",
|
||||
.clk = &mstp_clks[MSTP026],
|
||||
}, {
|
||||
/* SCIF1 */
|
||||
.dev_id = "sh-sci.1",
|
||||
.con_id = "sci_fck",
|
||||
.clk = &mstp_clks[MSTP025],
|
||||
}, {
|
||||
/* SCIF0 */
|
||||
.dev_id = "sh-sci.0",
|
||||
.con_id = "sci_fck",
|
||||
.clk = &mstp_clks[MSTP024],
|
||||
},
|
||||
CLKDEV_CON_ID("h8ex_fck", &mstp_clks[MSTP003]),
|
||||
CLKDEV_CON_ID("csm_fck", &mstp_clks[MSTP002]),
|
||||
CLKDEV_CON_ID("fe1_fck", &mstp_clks[MSTP001]),
|
||||
CLKDEV_CON_ID("fe0_fck", &mstp_clks[MSTP000]),
|
||||
{
|
||||
/* TMU0 */
|
||||
.dev_id = "sh_tmu.0",
|
||||
.con_id = "tmu_fck",
|
||||
.clk = &mstp_clks[MSTP008],
|
||||
}, {
|
||||
/* TMU1 */
|
||||
.dev_id = "sh_tmu.1",
|
||||
.con_id = "tmu_fck",
|
||||
.clk = &mstp_clks[MSTP008],
|
||||
}, {
|
||||
/* TMU2 */
|
||||
.dev_id = "sh_tmu.2",
|
||||
.con_id = "tmu_fck",
|
||||
.clk = &mstp_clks[MSTP008],
|
||||
}, {
|
||||
/* TMU3 */
|
||||
.dev_id = "sh_tmu.3",
|
||||
.con_id = "tmu_fck",
|
||||
.clk = &mstp_clks[MSTP009],
|
||||
}, {
|
||||
/* TMU4 */
|
||||
.dev_id = "sh_tmu.4",
|
||||
.con_id = "tmu_fck",
|
||||
.clk = &mstp_clks[MSTP009],
|
||||
}, {
|
||||
/* TMU5 */
|
||||
.dev_id = "sh_tmu.5",
|
||||
.con_id = "tmu_fck",
|
||||
.clk = &mstp_clks[MSTP009],
|
||||
},
|
||||
CLKDEV_CON_ID("hudi_fck", &mstp_clks[MSTP119]),
|
||||
CLKDEV_CON_ID("dmac_11_6_fck", &mstp_clks[MSTP105]),
|
||||
CLKDEV_CON_ID("dmac_5_0_fck", &mstp_clks[MSTP104]),
|
||||
};
|
||||
|
||||
int __init arch_clk_init(void)
|
||||
{
|
||||
struct clk *clk;
|
||||
int i, ret = 0;
|
||||
|
||||
cpg_clk_init();
|
||||
for (i = 0; i < ARRAY_SIZE(clks); i++)
|
||||
ret |= clk_register(clks[i]);
|
||||
for (i = 0; i < ARRAY_SIZE(lookups); i++)
|
||||
clkdev_add(&lookups[i]);
|
||||
|
||||
clk = clk_get(NULL, "master_clk");
|
||||
for (i = 0; i < ARRAY_SIZE(shx3_onchip_clocks); i++) {
|
||||
struct clk *clkp = shx3_onchip_clocks[i];
|
||||
|
||||
clkp->parent = clk;
|
||||
ret |= clk_register(clkp);
|
||||
}
|
||||
|
||||
clk_put(clk);
|
||||
|
||||
clkdev_add_table(lookups, ARRAY_SIZE(lookups));
|
||||
if (!ret)
|
||||
ret = sh_clk_div4_register(div4_clks, ARRAY_SIZE(div4_clks),
|
||||
&div4_table);
|
||||
if (!ret)
|
||||
ret = sh_clk_mstp32_register(mstp_clks, MSTP_NR);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
34
arch/sh/kernel/cpu/sh4a/intc-shx3.c
Normal file
34
arch/sh/kernel/cpu/sh4a/intc-shx3.c
Normal file
@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Shared support for SH-X3 interrupt controllers.
|
||||
*
|
||||
* Copyright (C) 2009 - 2010 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/irq.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/init.h>
|
||||
|
||||
#define INTACK 0xfe4100b8
|
||||
#define INTACKCLR 0xfe4100bc
|
||||
#define INTC_USERIMASK 0xfe411000
|
||||
|
||||
#ifdef CONFIG_INTC_BALANCING
|
||||
unsigned int irq_lookup(unsigned int irq)
|
||||
{
|
||||
return __raw_readl(INTACK) & 1 ? irq : NO_IRQ_IGNORE;
|
||||
}
|
||||
|
||||
void irq_finish(unsigned int irq)
|
||||
{
|
||||
__raw_writel(irq2evt(irq), INTACKCLR);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int __init shx3_irq_setup(void)
|
||||
{
|
||||
return register_intc_userimask(INTC_USERIMASK);
|
||||
}
|
||||
arch_initcall(shx3_irq_setup);
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Performance events support for SH-4A performance counters
|
||||
*
|
||||
* Copyright (C) 2009 Paul Mundt
|
||||
* Copyright (C) 2009, 2010 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
|
||||
@ -22,7 +22,25 @@
|
||||
#define CCBR_CMDS (1 << 1)
|
||||
#define CCBR_PPCE (1 << 0)
|
||||
|
||||
#ifdef CONFIG_CPU_SHX3
|
||||
/*
|
||||
* The PMCAT location for SH-X3 CPUs was quietly moved, while the CCBR
|
||||
* and PMCTR locations remains tentatively constant. This change remains
|
||||
* wholly undocumented, and was simply found through trial and error.
|
||||
*
|
||||
* Early cuts of SH-X3 still appear to use the SH-X/SH-X2 locations, and
|
||||
* it's unclear when this ceased to be the case. For now we always use
|
||||
* the new location (if future parts keep up with this trend then
|
||||
* scanning for them at runtime also remains a viable option.)
|
||||
*
|
||||
* The gap in the register space also suggests that there are other
|
||||
* undocumented counters, so this will need to be revisited at a later
|
||||
* point in time.
|
||||
*/
|
||||
#define PPC_PMCAT 0xfc100240
|
||||
#else
|
||||
#define PPC_PMCAT 0xfc100080
|
||||
#endif
|
||||
|
||||
#define PMCAT_OVF3 (1 << 27)
|
||||
#define PMCAT_CNN3 (1 << 26)
|
||||
|
File diff suppressed because it is too large
Load Diff
587
arch/sh/kernel/cpu/sh4a/pinmux-shx3.c
Normal file
587
arch/sh/kernel/cpu/sh4a/pinmux-shx3.c
Normal file
@ -0,0 +1,587 @@
|
||||
/*
|
||||
* SH-X3 prototype CPU pinmux
|
||||
*
|
||||
* Copyright (C) 2010 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 <linux/gpio.h>
|
||||
#include <cpu/shx3.h>
|
||||
|
||||
enum {
|
||||
PINMUX_RESERVED = 0,
|
||||
|
||||
PINMUX_DATA_BEGIN,
|
||||
PA7_DATA, PA6_DATA, PA5_DATA, PA4_DATA,
|
||||
PA3_DATA, PA2_DATA, PA1_DATA, PA0_DATA,
|
||||
PB7_DATA, PB6_DATA, PB5_DATA, PB4_DATA,
|
||||
PB3_DATA, PB2_DATA, PB1_DATA, PB0_DATA,
|
||||
PC7_DATA, PC6_DATA, PC5_DATA, PC4_DATA,
|
||||
PC3_DATA, PC2_DATA, PC1_DATA, PC0_DATA,
|
||||
PD7_DATA, PD6_DATA, PD5_DATA, PD4_DATA,
|
||||
PD3_DATA, PD2_DATA, PD1_DATA, PD0_DATA,
|
||||
PE7_DATA, PE6_DATA, PE5_DATA, PE4_DATA,
|
||||
PE3_DATA, PE2_DATA, PE1_DATA, PE0_DATA,
|
||||
PF7_DATA, PF6_DATA, PF5_DATA, PF4_DATA,
|
||||
PF3_DATA, PF2_DATA, PF1_DATA, PF0_DATA,
|
||||
PG7_DATA, PG6_DATA, PG5_DATA, PG4_DATA,
|
||||
PG3_DATA, PG2_DATA, PG1_DATA, PG0_DATA,
|
||||
|
||||
PH5_DATA, PH4_DATA,
|
||||
PH3_DATA, PH2_DATA, PH1_DATA, PH0_DATA,
|
||||
PINMUX_DATA_END,
|
||||
|
||||
PINMUX_INPUT_BEGIN,
|
||||
PA7_IN, PA6_IN, PA5_IN, PA4_IN,
|
||||
PA3_IN, PA2_IN, PA1_IN, PA0_IN,
|
||||
PB7_IN, PB6_IN, PB5_IN, PB4_IN,
|
||||
PB3_IN, PB2_IN, PB1_IN, PB0_IN,
|
||||
PC7_IN, PC6_IN, PC5_IN, PC4_IN,
|
||||
PC3_IN, PC2_IN, PC1_IN, PC0_IN,
|
||||
PD7_IN, PD6_IN, PD5_IN, PD4_IN,
|
||||
PD3_IN, PD2_IN, PD1_IN, PD0_IN,
|
||||
PE7_IN, PE6_IN, PE5_IN, PE4_IN,
|
||||
PE3_IN, PE2_IN, PE1_IN, PE0_IN,
|
||||
PF7_IN, PF6_IN, PF5_IN, PF4_IN,
|
||||
PF3_IN, PF2_IN, PF1_IN, PF0_IN,
|
||||
PG7_IN, PG6_IN, PG5_IN, PG4_IN,
|
||||
PG3_IN, PG2_IN, PG1_IN, PG0_IN,
|
||||
|
||||
PH5_IN, PH4_IN,
|
||||
PH3_IN, PH2_IN, PH1_IN, PH0_IN,
|
||||
PINMUX_INPUT_END,
|
||||
|
||||
PINMUX_INPUT_PULLUP_BEGIN,
|
||||
PA7_IN_PU, PA6_IN_PU, PA5_IN_PU, PA4_IN_PU,
|
||||
PA3_IN_PU, PA2_IN_PU, PA1_IN_PU, PA0_IN_PU,
|
||||
PB7_IN_PU, PB6_IN_PU, PB5_IN_PU, PB4_IN_PU,
|
||||
PB3_IN_PU, PB2_IN_PU, PB1_IN_PU, PB0_IN_PU,
|
||||
PC7_IN_PU, PC6_IN_PU, PC5_IN_PU, PC4_IN_PU,
|
||||
PC3_IN_PU, PC2_IN_PU, PC1_IN_PU, PC0_IN_PU,
|
||||
PD7_IN_PU, PD6_IN_PU, PD5_IN_PU, PD4_IN_PU,
|
||||
PD3_IN_PU, PD2_IN_PU, PD1_IN_PU, PD0_IN_PU,
|
||||
PE7_IN_PU, PE6_IN_PU, PE5_IN_PU, PE4_IN_PU,
|
||||
PE3_IN_PU, PE2_IN_PU, PE1_IN_PU, PE0_IN_PU,
|
||||
PF7_IN_PU, PF6_IN_PU, PF5_IN_PU, PF4_IN_PU,
|
||||
PF3_IN_PU, PF2_IN_PU, PF1_IN_PU, PF0_IN_PU,
|
||||
PG7_IN_PU, PG6_IN_PU, PG5_IN_PU, PG4_IN_PU,
|
||||
PG3_IN_PU, PG2_IN_PU, PG1_IN_PU, PG0_IN_PU,
|
||||
|
||||
PH5_IN_PU, PH4_IN_PU,
|
||||
PH3_IN_PU, PH2_IN_PU, PH1_IN_PU, PH0_IN_PU,
|
||||
PINMUX_INPUT_PULLUP_END,
|
||||
|
||||
PINMUX_OUTPUT_BEGIN,
|
||||
PA7_OUT, PA6_OUT, PA5_OUT, PA4_OUT,
|
||||
PA3_OUT, PA2_OUT, PA1_OUT, PA0_OUT,
|
||||
PB7_OUT, PB6_OUT, PB5_OUT, PB4_OUT,
|
||||
PB3_OUT, PB2_OUT, PB1_OUT, PB0_OUT,
|
||||
PC7_OUT, PC6_OUT, PC5_OUT, PC4_OUT,
|
||||
PC3_OUT, PC2_OUT, PC1_OUT, PC0_OUT,
|
||||
PD7_OUT, PD6_OUT, PD5_OUT, PD4_OUT,
|
||||
PD3_OUT, PD2_OUT, PD1_OUT, PD0_OUT,
|
||||
PE7_OUT, PE6_OUT, PE5_OUT, PE4_OUT,
|
||||
PE3_OUT, PE2_OUT, PE1_OUT, PE0_OUT,
|
||||
PF7_OUT, PF6_OUT, PF5_OUT, PF4_OUT,
|
||||
PF3_OUT, PF2_OUT, PF1_OUT, PF0_OUT,
|
||||
PG7_OUT, PG6_OUT, PG5_OUT, PG4_OUT,
|
||||
PG3_OUT, PG2_OUT, PG1_OUT, PG0_OUT,
|
||||
|
||||
PH5_OUT, PH4_OUT,
|
||||
PH3_OUT, PH2_OUT, PH1_OUT, PH0_OUT,
|
||||
PINMUX_OUTPUT_END,
|
||||
|
||||
PINMUX_FUNCTION_BEGIN,
|
||||
PA7_FN, PA6_FN, PA5_FN, PA4_FN,
|
||||
PA3_FN, PA2_FN, PA1_FN, PA0_FN,
|
||||
PB7_FN, PB6_FN, PB5_FN, PB4_FN,
|
||||
PB3_FN, PB2_FN, PB1_FN, PB0_FN,
|
||||
PC7_FN, PC6_FN, PC5_FN, PC4_FN,
|
||||
PC3_FN, PC2_FN, PC1_FN, PC0_FN,
|
||||
PD7_FN, PD6_FN, PD5_FN, PD4_FN,
|
||||
PD3_FN, PD2_FN, PD1_FN, PD0_FN,
|
||||
PE7_FN, PE6_FN, PE5_FN, PE4_FN,
|
||||
PE3_FN, PE2_FN, PE1_FN, PE0_FN,
|
||||
PF7_FN, PF6_FN, PF5_FN, PF4_FN,
|
||||
PF3_FN, PF2_FN, PF1_FN, PF0_FN,
|
||||
PG7_FN, PG6_FN, PG5_FN, PG4_FN,
|
||||
PG3_FN, PG2_FN, PG1_FN, PG0_FN,
|
||||
|
||||
PH5_FN, PH4_FN,
|
||||
PH3_FN, PH2_FN, PH1_FN, PH0_FN,
|
||||
PINMUX_FUNCTION_END,
|
||||
|
||||
PINMUX_MARK_BEGIN,
|
||||
|
||||
D31_MARK, D30_MARK, D29_MARK, D28_MARK, D27_MARK, D26_MARK,
|
||||
D25_MARK, D24_MARK, D23_MARK, D22_MARK, D21_MARK, D20_MARK,
|
||||
D19_MARK, D18_MARK, D17_MARK, D16_MARK,
|
||||
|
||||
BACK_MARK, BREQ_MARK,
|
||||
WE3_MARK, WE2_MARK,
|
||||
CS6_MARK, CS5_MARK, CS4_MARK,
|
||||
CLKOUTENB_MARK,
|
||||
|
||||
DACK3_MARK, DACK2_MARK, DACK1_MARK, DACK0_MARK,
|
||||
DREQ3_MARK, DREQ2_MARK, DREQ1_MARK, DREQ0_MARK,
|
||||
|
||||
IRQ3_MARK, IRQ2_MARK, IRQ1_MARK, IRQ0_MARK,
|
||||
|
||||
DRAK3_MARK, DRAK2_MARK, DRAK1_MARK, DRAK0_MARK,
|
||||
|
||||
SCK3_MARK, SCK2_MARK, SCK1_MARK, SCK0_MARK,
|
||||
IRL3_MARK, IRL2_MARK, IRL1_MARK, IRL0_MARK,
|
||||
TXD3_MARK, TXD2_MARK, TXD1_MARK, TXD0_MARK,
|
||||
RXD3_MARK, RXD2_MARK, RXD1_MARK, RXD0_MARK,
|
||||
|
||||
CE2B_MARK, CE2A_MARK, IOIS16_MARK,
|
||||
STATUS1_MARK, STATUS0_MARK,
|
||||
|
||||
IRQOUT_MARK,
|
||||
|
||||
PINMUX_MARK_END,
|
||||
};
|
||||
|
||||
static pinmux_enum_t shx3_pinmux_data[] = {
|
||||
|
||||
/* PA GPIO */
|
||||
PINMUX_DATA(PA7_DATA, PA7_IN, PA7_OUT, PA7_IN_PU),
|
||||
PINMUX_DATA(PA6_DATA, PA6_IN, PA6_OUT, PA6_IN_PU),
|
||||
PINMUX_DATA(PA5_DATA, PA5_IN, PA5_OUT, PA5_IN_PU),
|
||||
PINMUX_DATA(PA4_DATA, PA4_IN, PA4_OUT, PA4_IN_PU),
|
||||
PINMUX_DATA(PA3_DATA, PA3_IN, PA3_OUT, PA3_IN_PU),
|
||||
PINMUX_DATA(PA2_DATA, PA2_IN, PA2_OUT, PA2_IN_PU),
|
||||
PINMUX_DATA(PA1_DATA, PA1_IN, PA1_OUT, PA1_IN_PU),
|
||||
PINMUX_DATA(PA0_DATA, PA0_IN, PA0_OUT, PA0_IN_PU),
|
||||
|
||||
/* PB GPIO */
|
||||
PINMUX_DATA(PB7_DATA, PB7_IN, PB7_OUT, PB7_IN_PU),
|
||||
PINMUX_DATA(PB6_DATA, PB6_IN, PB6_OUT, PB6_IN_PU),
|
||||
PINMUX_DATA(PB5_DATA, PB5_IN, PB5_OUT, PB5_IN_PU),
|
||||
PINMUX_DATA(PB4_DATA, PB4_IN, PB4_OUT, PB4_IN_PU),
|
||||
PINMUX_DATA(PB3_DATA, PB3_IN, PB3_OUT, PB3_IN_PU),
|
||||
PINMUX_DATA(PB2_DATA, PB2_IN, PB2_OUT, PB2_IN_PU),
|
||||
PINMUX_DATA(PB1_DATA, PB1_IN, PB1_OUT, PB1_IN_PU),
|
||||
PINMUX_DATA(PB0_DATA, PB0_IN, PB0_OUT, PB0_IN_PU),
|
||||
|
||||
/* PC GPIO */
|
||||
PINMUX_DATA(PC7_DATA, PC7_IN, PC7_OUT, PC7_IN_PU),
|
||||
PINMUX_DATA(PC6_DATA, PC6_IN, PC6_OUT, PC6_IN_PU),
|
||||
PINMUX_DATA(PC5_DATA, PC5_IN, PC5_OUT, PC5_IN_PU),
|
||||
PINMUX_DATA(PC4_DATA, PC4_IN, PC4_OUT, PC4_IN_PU),
|
||||
PINMUX_DATA(PC3_DATA, PC3_IN, PC3_OUT, PC3_IN_PU),
|
||||
PINMUX_DATA(PC2_DATA, PC2_IN, PC2_OUT, PC2_IN_PU),
|
||||
PINMUX_DATA(PC1_DATA, PC1_IN, PC1_OUT, PC1_IN_PU),
|
||||
PINMUX_DATA(PC0_DATA, PC0_IN, PC0_OUT, PC0_IN_PU),
|
||||
|
||||
/* PD GPIO */
|
||||
PINMUX_DATA(PD7_DATA, PD7_IN, PD7_OUT, PD7_IN_PU),
|
||||
PINMUX_DATA(PD6_DATA, PD6_IN, PD6_OUT, PD6_IN_PU),
|
||||
PINMUX_DATA(PD5_DATA, PD5_IN, PD5_OUT, PD5_IN_PU),
|
||||
PINMUX_DATA(PD4_DATA, PD4_IN, PD4_OUT, PD4_IN_PU),
|
||||
PINMUX_DATA(PD3_DATA, PD3_IN, PD3_OUT, PD3_IN_PU),
|
||||
PINMUX_DATA(PD2_DATA, PD2_IN, PD2_OUT, PD2_IN_PU),
|
||||
PINMUX_DATA(PD1_DATA, PD1_IN, PD1_OUT, PD1_IN_PU),
|
||||
PINMUX_DATA(PD0_DATA, PD0_IN, PD0_OUT, PD0_IN_PU),
|
||||
|
||||
/* PE GPIO */
|
||||
PINMUX_DATA(PE7_DATA, PE7_IN, PE7_OUT, PE7_IN_PU),
|
||||
PINMUX_DATA(PE6_DATA, PE6_IN, PE6_OUT, PE6_IN_PU),
|
||||
PINMUX_DATA(PE5_DATA, PE5_IN, PE5_OUT, PE5_IN_PU),
|
||||
PINMUX_DATA(PE4_DATA, PE4_IN, PE4_OUT, PE4_IN_PU),
|
||||
PINMUX_DATA(PE3_DATA, PE3_IN, PE3_OUT, PE3_IN_PU),
|
||||
PINMUX_DATA(PE2_DATA, PE2_IN, PE2_OUT, PE2_IN_PU),
|
||||
PINMUX_DATA(PE1_DATA, PE1_IN, PE1_OUT, PE1_IN_PU),
|
||||
PINMUX_DATA(PE0_DATA, PE0_IN, PE0_OUT, PE0_IN_PU),
|
||||
|
||||
/* PF GPIO */
|
||||
PINMUX_DATA(PF7_DATA, PF7_IN, PF7_OUT, PF7_IN_PU),
|
||||
PINMUX_DATA(PF6_DATA, PF6_IN, PF6_OUT, PF6_IN_PU),
|
||||
PINMUX_DATA(PF5_DATA, PF5_IN, PF5_OUT, PF5_IN_PU),
|
||||
PINMUX_DATA(PF4_DATA, PF4_IN, PF4_OUT, PF4_IN_PU),
|
||||
PINMUX_DATA(PF3_DATA, PF3_IN, PF3_OUT, PF3_IN_PU),
|
||||
PINMUX_DATA(PF2_DATA, PF2_IN, PF2_OUT, PF2_IN_PU),
|
||||
PINMUX_DATA(PF1_DATA, PF1_IN, PF1_OUT, PF1_IN_PU),
|
||||
PINMUX_DATA(PF0_DATA, PF0_IN, PF0_OUT, PF0_IN_PU),
|
||||
|
||||
/* PG GPIO */
|
||||
PINMUX_DATA(PG7_DATA, PG7_IN, PG7_OUT, PG7_IN_PU),
|
||||
PINMUX_DATA(PG6_DATA, PG6_IN, PG6_OUT, PG6_IN_PU),
|
||||
PINMUX_DATA(PG5_DATA, PG5_IN, PG5_OUT, PG5_IN_PU),
|
||||
PINMUX_DATA(PG4_DATA, PG4_IN, PG4_OUT, PG4_IN_PU),
|
||||
PINMUX_DATA(PG3_DATA, PG3_IN, PG3_OUT, PG3_IN_PU),
|
||||
PINMUX_DATA(PG2_DATA, PG2_IN, PG2_OUT, PG2_IN_PU),
|
||||
PINMUX_DATA(PG1_DATA, PG1_IN, PG1_OUT, PG1_IN_PU),
|
||||
PINMUX_DATA(PG0_DATA, PG0_IN, PG0_OUT, PG0_IN_PU),
|
||||
|
||||
/* PH GPIO */
|
||||
PINMUX_DATA(PH5_DATA, PH5_IN, PH5_OUT, PH5_IN_PU),
|
||||
PINMUX_DATA(PH4_DATA, PH4_IN, PH4_OUT, PH4_IN_PU),
|
||||
PINMUX_DATA(PH3_DATA, PH3_IN, PH3_OUT, PH3_IN_PU),
|
||||
PINMUX_DATA(PH2_DATA, PH2_IN, PH2_OUT, PH2_IN_PU),
|
||||
PINMUX_DATA(PH1_DATA, PH1_IN, PH1_OUT, PH1_IN_PU),
|
||||
PINMUX_DATA(PH0_DATA, PH0_IN, PH0_OUT, PH0_IN_PU),
|
||||
|
||||
/* PA FN */
|
||||
PINMUX_DATA(D31_MARK, PA7_FN),
|
||||
PINMUX_DATA(D30_MARK, PA6_FN),
|
||||
PINMUX_DATA(D29_MARK, PA5_FN),
|
||||
PINMUX_DATA(D28_MARK, PA4_FN),
|
||||
PINMUX_DATA(D27_MARK, PA3_FN),
|
||||
PINMUX_DATA(D26_MARK, PA2_FN),
|
||||
PINMUX_DATA(D25_MARK, PA1_FN),
|
||||
PINMUX_DATA(D24_MARK, PA0_FN),
|
||||
|
||||
/* PB FN */
|
||||
PINMUX_DATA(D23_MARK, PB7_FN),
|
||||
PINMUX_DATA(D22_MARK, PB6_FN),
|
||||
PINMUX_DATA(D21_MARK, PB5_FN),
|
||||
PINMUX_DATA(D20_MARK, PB4_FN),
|
||||
PINMUX_DATA(D19_MARK, PB3_FN),
|
||||
PINMUX_DATA(D18_MARK, PB2_FN),
|
||||
PINMUX_DATA(D17_MARK, PB1_FN),
|
||||
PINMUX_DATA(D16_MARK, PB0_FN),
|
||||
|
||||
/* PC FN */
|
||||
PINMUX_DATA(BACK_MARK, PC7_FN),
|
||||
PINMUX_DATA(BREQ_MARK, PC6_FN),
|
||||
PINMUX_DATA(WE3_MARK, PC5_FN),
|
||||
PINMUX_DATA(WE2_MARK, PC4_FN),
|
||||
PINMUX_DATA(CS6_MARK, PC3_FN),
|
||||
PINMUX_DATA(CS5_MARK, PC2_FN),
|
||||
PINMUX_DATA(CS4_MARK, PC1_FN),
|
||||
PINMUX_DATA(CLKOUTENB_MARK, PC0_FN),
|
||||
|
||||
/* PD FN */
|
||||
PINMUX_DATA(DACK3_MARK, PD7_FN),
|
||||
PINMUX_DATA(DACK2_MARK, PD6_FN),
|
||||
PINMUX_DATA(DACK1_MARK, PD5_FN),
|
||||
PINMUX_DATA(DACK0_MARK, PD4_FN),
|
||||
PINMUX_DATA(DREQ3_MARK, PD3_FN),
|
||||
PINMUX_DATA(DREQ2_MARK, PD2_FN),
|
||||
PINMUX_DATA(DREQ1_MARK, PD1_FN),
|
||||
PINMUX_DATA(DREQ0_MARK, PD0_FN),
|
||||
|
||||
/* PE FN */
|
||||
PINMUX_DATA(IRQ3_MARK, PE7_FN),
|
||||
PINMUX_DATA(IRQ2_MARK, PE6_FN),
|
||||
PINMUX_DATA(IRQ1_MARK, PE5_FN),
|
||||
PINMUX_DATA(IRQ0_MARK, PE4_FN),
|
||||
PINMUX_DATA(DRAK3_MARK, PE3_FN),
|
||||
PINMUX_DATA(DRAK2_MARK, PE2_FN),
|
||||
PINMUX_DATA(DRAK1_MARK, PE1_FN),
|
||||
PINMUX_DATA(DRAK0_MARK, PE0_FN),
|
||||
|
||||
/* PF FN */
|
||||
PINMUX_DATA(SCK3_MARK, PF7_FN),
|
||||
PINMUX_DATA(SCK2_MARK, PF6_FN),
|
||||
PINMUX_DATA(SCK1_MARK, PF5_FN),
|
||||
PINMUX_DATA(SCK0_MARK, PF4_FN),
|
||||
PINMUX_DATA(IRL3_MARK, PF3_FN),
|
||||
PINMUX_DATA(IRL2_MARK, PF2_FN),
|
||||
PINMUX_DATA(IRL1_MARK, PF1_FN),
|
||||
PINMUX_DATA(IRL0_MARK, PF0_FN),
|
||||
|
||||
/* PG FN */
|
||||
PINMUX_DATA(TXD3_MARK, PG7_FN),
|
||||
PINMUX_DATA(TXD2_MARK, PG6_FN),
|
||||
PINMUX_DATA(TXD1_MARK, PG5_FN),
|
||||
PINMUX_DATA(TXD0_MARK, PG4_FN),
|
||||
PINMUX_DATA(RXD3_MARK, PG3_FN),
|
||||
PINMUX_DATA(RXD2_MARK, PG2_FN),
|
||||
PINMUX_DATA(RXD1_MARK, PG1_FN),
|
||||
PINMUX_DATA(RXD0_MARK, PG0_FN),
|
||||
|
||||
/* PH FN */
|
||||
PINMUX_DATA(CE2B_MARK, PH5_FN),
|
||||
PINMUX_DATA(CE2A_MARK, PH4_FN),
|
||||
PINMUX_DATA(IOIS16_MARK, PH3_FN),
|
||||
PINMUX_DATA(STATUS1_MARK, PH2_FN),
|
||||
PINMUX_DATA(STATUS0_MARK, PH1_FN),
|
||||
PINMUX_DATA(IRQOUT_MARK, PH0_FN),
|
||||
};
|
||||
|
||||
static struct pinmux_gpio shx3_pinmux_gpios[] = {
|
||||
/* PA */
|
||||
PINMUX_GPIO(GPIO_PA7, PA7_DATA),
|
||||
PINMUX_GPIO(GPIO_PA6, PA6_DATA),
|
||||
PINMUX_GPIO(GPIO_PA5, PA5_DATA),
|
||||
PINMUX_GPIO(GPIO_PA4, PA4_DATA),
|
||||
PINMUX_GPIO(GPIO_PA3, PA3_DATA),
|
||||
PINMUX_GPIO(GPIO_PA2, PA2_DATA),
|
||||
PINMUX_GPIO(GPIO_PA1, PA1_DATA),
|
||||
PINMUX_GPIO(GPIO_PA0, PA0_DATA),
|
||||
|
||||
/* PB */
|
||||
PINMUX_GPIO(GPIO_PB7, PB7_DATA),
|
||||
PINMUX_GPIO(GPIO_PB6, PB6_DATA),
|
||||
PINMUX_GPIO(GPIO_PB5, PB5_DATA),
|
||||
PINMUX_GPIO(GPIO_PB4, PB4_DATA),
|
||||
PINMUX_GPIO(GPIO_PB3, PB3_DATA),
|
||||
PINMUX_GPIO(GPIO_PB2, PB2_DATA),
|
||||
PINMUX_GPIO(GPIO_PB1, PB1_DATA),
|
||||
PINMUX_GPIO(GPIO_PB0, PB0_DATA),
|
||||
|
||||
/* PC */
|
||||
PINMUX_GPIO(GPIO_PC7, PC7_DATA),
|
||||
PINMUX_GPIO(GPIO_PC6, PC6_DATA),
|
||||
PINMUX_GPIO(GPIO_PC5, PC5_DATA),
|
||||
PINMUX_GPIO(GPIO_PC4, PC4_DATA),
|
||||
PINMUX_GPIO(GPIO_PC3, PC3_DATA),
|
||||
PINMUX_GPIO(GPIO_PC2, PC2_DATA),
|
||||
PINMUX_GPIO(GPIO_PC1, PC1_DATA),
|
||||
PINMUX_GPIO(GPIO_PC0, PC0_DATA),
|
||||
|
||||
/* PD */
|
||||
PINMUX_GPIO(GPIO_PD7, PD7_DATA),
|
||||
PINMUX_GPIO(GPIO_PD6, PD6_DATA),
|
||||
PINMUX_GPIO(GPIO_PD5, PD5_DATA),
|
||||
PINMUX_GPIO(GPIO_PD4, PD4_DATA),
|
||||
PINMUX_GPIO(GPIO_PD3, PD3_DATA),
|
||||
PINMUX_GPIO(GPIO_PD2, PD2_DATA),
|
||||
PINMUX_GPIO(GPIO_PD1, PD1_DATA),
|
||||
PINMUX_GPIO(GPIO_PD0, PD0_DATA),
|
||||
|
||||
/* PE */
|
||||
PINMUX_GPIO(GPIO_PE7, PE7_DATA),
|
||||
PINMUX_GPIO(GPIO_PE6, PE6_DATA),
|
||||
PINMUX_GPIO(GPIO_PE5, PE5_DATA),
|
||||
PINMUX_GPIO(GPIO_PE4, PE4_DATA),
|
||||
PINMUX_GPIO(GPIO_PE3, PE3_DATA),
|
||||
PINMUX_GPIO(GPIO_PE2, PE2_DATA),
|
||||
PINMUX_GPIO(GPIO_PE1, PE1_DATA),
|
||||
PINMUX_GPIO(GPIO_PE0, PE0_DATA),
|
||||
|
||||
/* PF */
|
||||
PINMUX_GPIO(GPIO_PF7, PF7_DATA),
|
||||
PINMUX_GPIO(GPIO_PF6, PF6_DATA),
|
||||
PINMUX_GPIO(GPIO_PF5, PF5_DATA),
|
||||
PINMUX_GPIO(GPIO_PF4, PF4_DATA),
|
||||
PINMUX_GPIO(GPIO_PF3, PF3_DATA),
|
||||
PINMUX_GPIO(GPIO_PF2, PF2_DATA),
|
||||
PINMUX_GPIO(GPIO_PF1, PF1_DATA),
|
||||
PINMUX_GPIO(GPIO_PF0, PF0_DATA),
|
||||
|
||||
/* PG */
|
||||
PINMUX_GPIO(GPIO_PG7, PG7_DATA),
|
||||
PINMUX_GPIO(GPIO_PG6, PG6_DATA),
|
||||
PINMUX_GPIO(GPIO_PG5, PG5_DATA),
|
||||
PINMUX_GPIO(GPIO_PG4, PG4_DATA),
|
||||
PINMUX_GPIO(GPIO_PG3, PG3_DATA),
|
||||
PINMUX_GPIO(GPIO_PG2, PG2_DATA),
|
||||
PINMUX_GPIO(GPIO_PG1, PG1_DATA),
|
||||
PINMUX_GPIO(GPIO_PG0, PG0_DATA),
|
||||
|
||||
/* PH */
|
||||
PINMUX_GPIO(GPIO_PH5, PH5_DATA),
|
||||
PINMUX_GPIO(GPIO_PH4, PH4_DATA),
|
||||
PINMUX_GPIO(GPIO_PH3, PH3_DATA),
|
||||
PINMUX_GPIO(GPIO_PH2, PH2_DATA),
|
||||
PINMUX_GPIO(GPIO_PH1, PH1_DATA),
|
||||
PINMUX_GPIO(GPIO_PH0, PH0_DATA),
|
||||
|
||||
/* FN */
|
||||
PINMUX_GPIO(GPIO_FN_D31, D31_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_D30, D30_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_D29, D29_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_D28, D28_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_D27, D27_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_D26, D26_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_D25, D25_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_D24, D24_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_D23, D23_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_D22, D22_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_D21, D21_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_D20, D20_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_D19, D19_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_D18, D18_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_D17, D17_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_D16, D16_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_BACK, BACK_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_BREQ, BREQ_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_WE3, WE3_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_WE2, WE2_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_CS6, CS6_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_CS5, CS5_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_CS4, CS4_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_CLKOUTENB, CLKOUTENB_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_DACK3, DACK3_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_DACK2, DACK2_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_DACK1, DACK1_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_DACK0, DACK0_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_DREQ3, DREQ3_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_DREQ2, DREQ2_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_DREQ1, DREQ1_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_DREQ0, DREQ0_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_IRQ3, IRQ3_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_IRQ2, IRQ2_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_IRQ1, IRQ1_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_IRQ0, IRQ0_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_DRAK3, DRAK3_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_DRAK2, DRAK2_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_DRAK1, DRAK1_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_DRAK0, DRAK0_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_SCK3, SCK3_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_SCK2, SCK2_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_SCK1, SCK1_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_SCK0, SCK0_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_IRL3, IRL3_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_IRL2, IRL2_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_IRL1, IRL1_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_IRL0, IRL0_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_TXD3, TXD3_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_TXD2, TXD2_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_TXD1, TXD1_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_TXD0, TXD0_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_RXD3, RXD3_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_RXD2, RXD2_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_RXD1, RXD1_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_RXD0, RXD0_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_CE2B, CE2B_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_CE2A, CE2A_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_IOIS16, IOIS16_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_STATUS1, STATUS1_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_STATUS0, STATUS0_MARK),
|
||||
PINMUX_GPIO(GPIO_FN_IRQOUT, IRQOUT_MARK),
|
||||
};
|
||||
|
||||
static struct pinmux_cfg_reg shx3_pinmux_config_regs[] = {
|
||||
{ PINMUX_CFG_REG("PABCR", 0xffc70000, 32, 2) {
|
||||
PA7_FN, PA7_OUT, PA7_IN, PA7_IN_PU,
|
||||
PA6_FN, PA6_OUT, PA6_IN, PA6_IN_PU,
|
||||
PA5_FN, PA5_OUT, PA5_IN, PA5_IN_PU,
|
||||
PA4_FN, PA4_OUT, PA4_IN, PA4_IN_PU,
|
||||
PA3_FN, PA3_OUT, PA3_IN, PA3_IN_PU,
|
||||
PA2_FN, PA2_OUT, PA2_IN, PA2_IN_PU,
|
||||
PA1_FN, PA1_OUT, PA1_IN, PA1_IN_PU,
|
||||
PA0_FN, PA0_OUT, PA0_IN, PA0_IN_PU,
|
||||
PB7_FN, PB7_OUT, PB7_IN, PB7_IN_PU,
|
||||
PB6_FN, PB6_OUT, PB6_IN, PB6_IN_PU,
|
||||
PB5_FN, PB5_OUT, PB5_IN, PB5_IN_PU,
|
||||
PB4_FN, PB4_OUT, PB4_IN, PB4_IN_PU,
|
||||
PB3_FN, PB3_OUT, PB3_IN, PB3_IN_PU,
|
||||
PB2_FN, PB2_OUT, PB2_IN, PB2_IN_PU,
|
||||
PB1_FN, PB1_OUT, PB1_IN, PB1_IN_PU,
|
||||
PB0_FN, PB0_OUT, PB0_IN, PB0_IN_PU, },
|
||||
},
|
||||
{ PINMUX_CFG_REG("PCDCR", 0xffc70004, 32, 2) {
|
||||
PC7_FN, PC7_OUT, PC7_IN, PC7_IN_PU,
|
||||
PC6_FN, PC6_OUT, PC6_IN, PC6_IN_PU,
|
||||
PC5_FN, PC5_OUT, PC5_IN, PC5_IN_PU,
|
||||
PC4_FN, PC4_OUT, PC4_IN, PC4_IN_PU,
|
||||
PC3_FN, PC3_OUT, PC3_IN, PC3_IN_PU,
|
||||
PC2_FN, PC2_OUT, PC2_IN, PC2_IN_PU,
|
||||
PC1_FN, PC1_OUT, PC1_IN, PC1_IN_PU,
|
||||
PC0_FN, PC0_OUT, PC0_IN, PC0_IN_PU,
|
||||
PD7_FN, PD7_OUT, PD7_IN, PD7_IN_PU,
|
||||
PD6_FN, PD6_OUT, PD6_IN, PD6_IN_PU,
|
||||
PD5_FN, PD5_OUT, PD5_IN, PD5_IN_PU,
|
||||
PD4_FN, PD4_OUT, PD4_IN, PD4_IN_PU,
|
||||
PD3_FN, PD3_OUT, PD3_IN, PD3_IN_PU,
|
||||
PD2_FN, PD2_OUT, PD2_IN, PD2_IN_PU,
|
||||
PD1_FN, PD1_OUT, PD1_IN, PD1_IN_PU,
|
||||
PD0_FN, PD0_OUT, PD0_IN, PD0_IN_PU, },
|
||||
},
|
||||
{ PINMUX_CFG_REG("PEFCR", 0xffc70008, 32, 2) {
|
||||
PE7_FN, PE7_OUT, PE7_IN, PE7_IN_PU,
|
||||
PE6_FN, PE6_OUT, PE6_IN, PE6_IN_PU,
|
||||
PE5_FN, PE5_OUT, PE5_IN, PE5_IN_PU,
|
||||
PE4_FN, PE4_OUT, PE4_IN, PE4_IN_PU,
|
||||
PE3_FN, PE3_OUT, PE3_IN, PE3_IN_PU,
|
||||
PE2_FN, PE2_OUT, PE2_IN, PE2_IN_PU,
|
||||
PE1_FN, PE1_OUT, PE1_IN, PE1_IN_PU,
|
||||
PE0_FN, PE0_OUT, PE0_IN, PE0_IN_PU,
|
||||
PF7_FN, PF7_OUT, PF7_IN, PF7_IN_PU,
|
||||
PF6_FN, PF6_OUT, PF6_IN, PF6_IN_PU,
|
||||
PF5_FN, PF5_OUT, PF5_IN, PF5_IN_PU,
|
||||
PF4_FN, PF4_OUT, PF4_IN, PF4_IN_PU,
|
||||
PF3_FN, PF3_OUT, PF3_IN, PF3_IN_PU,
|
||||
PF2_FN, PF2_OUT, PF2_IN, PF2_IN_PU,
|
||||
PF1_FN, PF1_OUT, PF1_IN, PF1_IN_PU,
|
||||
PF0_FN, PF0_OUT, PF0_IN, PF0_IN_PU, },
|
||||
},
|
||||
{ PINMUX_CFG_REG("PGHCR", 0xffc7000c, 32, 2) {
|
||||
PG7_FN, PG7_OUT, PG7_IN, PG7_IN_PU,
|
||||
PG6_FN, PG6_OUT, PG6_IN, PG6_IN_PU,
|
||||
PG5_FN, PG5_OUT, PG5_IN, PG5_IN_PU,
|
||||
PG4_FN, PG4_OUT, PG4_IN, PG4_IN_PU,
|
||||
PG3_FN, PG3_OUT, PG3_IN, PG3_IN_PU,
|
||||
PG2_FN, PG2_OUT, PG2_IN, PG2_IN_PU,
|
||||
PG1_FN, PG1_OUT, PG1_IN, PG1_IN_PU,
|
||||
PG0_FN, PG0_OUT, PG0_IN, PG0_IN_PU,
|
||||
0, 0, 0, 0,
|
||||
0, 0, 0, 0,
|
||||
PH5_FN, PH5_OUT, PH5_IN, PH5_IN_PU,
|
||||
PH4_FN, PH4_OUT, PH4_IN, PH4_IN_PU,
|
||||
PH3_FN, PH3_OUT, PH3_IN, PH3_IN_PU,
|
||||
PH2_FN, PH2_OUT, PH2_IN, PH2_IN_PU,
|
||||
PH1_FN, PH1_OUT, PH1_IN, PH1_IN_PU,
|
||||
PH0_FN, PH0_OUT, PH0_IN, PH0_IN_PU, },
|
||||
},
|
||||
{ },
|
||||
};
|
||||
|
||||
static struct pinmux_data_reg shx3_pinmux_data_regs[] = {
|
||||
{ PINMUX_DATA_REG("PABDR", 0xffc70010, 32) {
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
PA7_DATA, PA6_DATA, PA5_DATA, PA4_DATA,
|
||||
PA3_DATA, PA2_DATA, PA1_DATA, PA0_DATA,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
PB7_DATA, PB6_DATA, PB5_DATA, PB4_DATA,
|
||||
PB3_DATA, PB2_DATA, PB1_DATA, PB0_DATA, },
|
||||
},
|
||||
{ PINMUX_DATA_REG("PCDDR", 0xffc70014, 32) {
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
PC7_DATA, PC6_DATA, PC5_DATA, PC4_DATA,
|
||||
PC3_DATA, PC2_DATA, PC1_DATA, PC0_DATA,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
PD7_DATA, PD6_DATA, PD5_DATA, PD4_DATA,
|
||||
PD3_DATA, PD2_DATA, PD1_DATA, PD0_DATA, },
|
||||
},
|
||||
{ PINMUX_DATA_REG("PEFDR", 0xffc70018, 32) {
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
PE7_DATA, PE6_DATA, PE5_DATA, PE4_DATA,
|
||||
PE3_DATA, PE2_DATA, PE1_DATA, PE0_DATA,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
PF7_DATA, PF6_DATA, PF5_DATA, PF4_DATA,
|
||||
PF3_DATA, PF2_DATA, PF1_DATA, PF0_DATA, },
|
||||
},
|
||||
{ PINMUX_DATA_REG("PGHDR", 0xffc7001c, 32) {
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
PG7_DATA, PG6_DATA, PG5_DATA, PG4_DATA,
|
||||
PG3_DATA, PG2_DATA, PG1_DATA, PG0_DATA,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, PH5_DATA, PH4_DATA,
|
||||
PH3_DATA, PH2_DATA, PH1_DATA, PH0_DATA, },
|
||||
},
|
||||
{ },
|
||||
};
|
||||
|
||||
static struct pinmux_info shx3_pinmux_info = {
|
||||
.name = "shx3_pfc",
|
||||
.reserved_id = PINMUX_RESERVED,
|
||||
.data = { PINMUX_DATA_BEGIN, PINMUX_DATA_END },
|
||||
.input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END },
|
||||
.input_pu = { PINMUX_INPUT_PULLUP_BEGIN,
|
||||
PINMUX_INPUT_PULLUP_END },
|
||||
.output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END },
|
||||
.mark = { PINMUX_MARK_BEGIN, PINMUX_MARK_END },
|
||||
.function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
|
||||
.first_gpio = GPIO_PA7,
|
||||
.last_gpio = GPIO_FN_IRQOUT,
|
||||
.gpios = shx3_pinmux_gpios,
|
||||
.gpio_data = shx3_pinmux_data,
|
||||
.gpio_data_size = ARRAY_SIZE(shx3_pinmux_data),
|
||||
.cfg_regs = shx3_pinmux_config_regs,
|
||||
.data_regs = shx3_pinmux_data_regs,
|
||||
};
|
||||
|
||||
static int __init shx3_pinmux_setup(void)
|
||||
{
|
||||
return register_pinmux(&shx3_pinmux_info);
|
||||
}
|
||||
arch_initcall(shx3_pinmux_setup);
|
@ -524,6 +524,70 @@ static struct platform_device veu1_device = {
|
||||
},
|
||||
};
|
||||
|
||||
/* BEU0 */
|
||||
static struct uio_info beu0_platform_data = {
|
||||
.name = "BEU0",
|
||||
.version = "0",
|
||||
.irq = evt2irq(0x8A0),
|
||||
};
|
||||
|
||||
static struct resource beu0_resources[] = {
|
||||
[0] = {
|
||||
.name = "BEU0",
|
||||
.start = 0xfe930000,
|
||||
.end = 0xfe933400,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
/* place holder for contiguous memory */
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device beu0_device = {
|
||||
.name = "uio_pdrv_genirq",
|
||||
.id = 6,
|
||||
.dev = {
|
||||
.platform_data = &beu0_platform_data,
|
||||
},
|
||||
.resource = beu0_resources,
|
||||
.num_resources = ARRAY_SIZE(beu0_resources),
|
||||
.archdata = {
|
||||
.hwblk_id = HWBLK_BEU0,
|
||||
},
|
||||
};
|
||||
|
||||
/* BEU1 */
|
||||
static struct uio_info beu1_platform_data = {
|
||||
.name = "BEU1",
|
||||
.version = "0",
|
||||
.irq = evt2irq(0xA00),
|
||||
};
|
||||
|
||||
static struct resource beu1_resources[] = {
|
||||
[0] = {
|
||||
.name = "BEU1",
|
||||
.start = 0xfe940000,
|
||||
.end = 0xfe943400,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
/* place holder for contiguous memory */
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device beu1_device = {
|
||||
.name = "uio_pdrv_genirq",
|
||||
.id = 7,
|
||||
.dev = {
|
||||
.platform_data = &beu1_platform_data,
|
||||
},
|
||||
.resource = beu1_resources,
|
||||
.num_resources = ARRAY_SIZE(beu1_resources),
|
||||
.archdata = {
|
||||
.hwblk_id = HWBLK_BEU1,
|
||||
},
|
||||
};
|
||||
|
||||
static struct sh_timer_config cmt_platform_data = {
|
||||
.channel_offset = 0x60,
|
||||
.timer_bit = 5,
|
||||
@ -857,6 +921,8 @@ static struct platform_device *sh7724_devices[] __initdata = {
|
||||
&vpu_device,
|
||||
&veu0_device,
|
||||
&veu1_device,
|
||||
&beu0_device,
|
||||
&beu1_device,
|
||||
&jpu_device,
|
||||
&spu0_device,
|
||||
&spu1_device,
|
||||
|
@ -26,7 +26,7 @@ static struct plat_sci_port scif2_platform_data = {
|
||||
|
||||
static struct platform_device scif2_device = {
|
||||
.name = "sh-sci",
|
||||
.id = 2,
|
||||
.id = 0,
|
||||
.dev = {
|
||||
.platform_data = &scif2_platform_data,
|
||||
},
|
||||
@ -41,7 +41,7 @@ static struct plat_sci_port scif3_platform_data = {
|
||||
|
||||
static struct platform_device scif3_device = {
|
||||
.name = "sh-sci",
|
||||
.id = 3,
|
||||
.id = 1,
|
||||
.dev = {
|
||||
.platform_data = &scif3_platform_data,
|
||||
},
|
||||
@ -56,7 +56,7 @@ static struct plat_sci_port scif4_platform_data = {
|
||||
|
||||
static struct platform_device scif4_device = {
|
||||
.name = "sh-sci",
|
||||
.id = 4,
|
||||
.id = 2,
|
||||
.dev = {
|
||||
.platform_data = &scif4_platform_data,
|
||||
},
|
||||
@ -163,39 +163,23 @@ enum {
|
||||
IRL4_HHLL, IRL4_HHLH, IRL4_HHHL,
|
||||
IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7,
|
||||
|
||||
SDHI,
|
||||
DVC,
|
||||
IRQ8, IRQ9, IRQ10,
|
||||
WDT0,
|
||||
TMU0, TMU1, TMU2, TMU2_TICPI,
|
||||
SDHI, DVC,
|
||||
IRQ8, IRQ9, IRQ11, IRQ10, IRQ12, IRQ13, IRQ14, IRQ15,
|
||||
TMU0, TMU1, TMU2, TMU2_TICPI, TMU3, TMU4, TMU5,
|
||||
HUDI,
|
||||
|
||||
ARC4,
|
||||
DMAC0,
|
||||
IRQ11,
|
||||
SCIF2,
|
||||
DMAC1_6,
|
||||
USB0,
|
||||
IRQ12,
|
||||
DMAC0_5, DMAC6_7, DMAC8_11,
|
||||
SCIF0, SCIF1, SCIF2, SCIF3, SCIF4,
|
||||
USB0, USB1,
|
||||
JMC,
|
||||
SPI1,
|
||||
IRQ13, IRQ14,
|
||||
USB1,
|
||||
SPI0, SPI1,
|
||||
TMR01, TMR23, TMR45,
|
||||
WDT1,
|
||||
FRT,
|
||||
LPC,
|
||||
SCIF0, SCIF1, SCIF3,
|
||||
PECI0I, PECI1I, PECI2I,
|
||||
IRQ15,
|
||||
LPC, LPC5, LPC6, LPC7, LPC8,
|
||||
PECI0, PECI1, PECI2, PECI3, PECI4, PECI5,
|
||||
ETHERC,
|
||||
SPI0,
|
||||
ADC1,
|
||||
DMAC1_8,
|
||||
ADC0, ADC1,
|
||||
SIM,
|
||||
TMU3, TMU4, TMU5,
|
||||
ADC0,
|
||||
SCIF4,
|
||||
IIC0_0, IIC0_1, IIC0_2, IIC0_3,
|
||||
IIC1_0, IIC1_1, IIC1_2, IIC1_3,
|
||||
IIC2_0, IIC2_1, IIC2_2, IIC2_3,
|
||||
@ -206,9 +190,23 @@ enum {
|
||||
IIC7_0, IIC7_1, IIC7_2, IIC7_3,
|
||||
IIC8_0, IIC8_1, IIC8_2, IIC8_3,
|
||||
IIC9_0, IIC9_1, IIC9_2, IIC9_3,
|
||||
PCIINTA,
|
||||
PCIE,
|
||||
ONFICTL,
|
||||
MMC1, MMC2,
|
||||
ECCU,
|
||||
PCIC,
|
||||
G200,
|
||||
RSPI,
|
||||
SGPIO,
|
||||
DMINT12, DMINT13, DMINT14, DMINT15, DMINT16, DMINT17, DMINT18, DMINT19,
|
||||
DMINT20, DMINT21, DMINT22, DMINT23,
|
||||
DDRECC,
|
||||
TSIP,
|
||||
PCIE_BRIDGE,
|
||||
WDT0B, WDT1B, WDT2B, WDT3B, WDT4B, WDT5B, WDT6B, WDT7B, WDT8B,
|
||||
GETHER0, GETHER1, GETHER2,
|
||||
PBIA, PBIB, PBIC,
|
||||
DMAE2, DMAE3,
|
||||
SERMUX2, SERMUX3,
|
||||
|
||||
/* interrupt groups */
|
||||
|
||||
@ -221,19 +219,18 @@ static struct intc_vect vectors[] __initdata = {
|
||||
INTC_VECT(DVC, 0x4e0),
|
||||
INTC_VECT(IRQ8, 0x500), INTC_VECT(IRQ9, 0x520),
|
||||
INTC_VECT(IRQ10, 0x540),
|
||||
INTC_VECT(WDT0, 0x560),
|
||||
INTC_VECT(TMU0, 0x580), INTC_VECT(TMU1, 0x5a0),
|
||||
INTC_VECT(TMU2, 0x5c0), INTC_VECT(TMU2_TICPI, 0x5e0),
|
||||
INTC_VECT(HUDI, 0x600),
|
||||
INTC_VECT(ARC4, 0x620),
|
||||
INTC_VECT(DMAC0, 0x640), INTC_VECT(DMAC0, 0x660),
|
||||
INTC_VECT(DMAC0, 0x680), INTC_VECT(DMAC0, 0x6a0),
|
||||
INTC_VECT(DMAC0, 0x6c0),
|
||||
INTC_VECT(DMAC0_5, 0x640), INTC_VECT(DMAC0_5, 0x660),
|
||||
INTC_VECT(DMAC0_5, 0x680), INTC_VECT(DMAC0_5, 0x6a0),
|
||||
INTC_VECT(DMAC0_5, 0x6c0),
|
||||
INTC_VECT(IRQ11, 0x6e0),
|
||||
INTC_VECT(SCIF2, 0x700), INTC_VECT(SCIF2, 0x720),
|
||||
INTC_VECT(SCIF2, 0x740), INTC_VECT(SCIF2, 0x760),
|
||||
INTC_VECT(DMAC0, 0x780), INTC_VECT(DMAC0, 0x7a0),
|
||||
INTC_VECT(DMAC1_6, 0x7c0), INTC_VECT(DMAC1_6, 0x7e0),
|
||||
INTC_VECT(DMAC0_5, 0x780), INTC_VECT(DMAC0_5, 0x7a0),
|
||||
INTC_VECT(DMAC6_7, 0x7c0), INTC_VECT(DMAC6_7, 0x7e0),
|
||||
INTC_VECT(USB0, 0x840),
|
||||
INTC_VECT(IRQ12, 0x880),
|
||||
INTC_VECT(JMC, 0x8a0),
|
||||
@ -242,7 +239,6 @@ static struct intc_vect vectors[] __initdata = {
|
||||
INTC_VECT(USB1, 0x920),
|
||||
INTC_VECT(TMR01, 0xa00), INTC_VECT(TMR23, 0xa20),
|
||||
INTC_VECT(TMR45, 0xa40),
|
||||
INTC_VECT(WDT1, 0xa60),
|
||||
INTC_VECT(FRT, 0xa80),
|
||||
INTC_VECT(LPC, 0xaa0), INTC_VECT(LPC, 0xac0),
|
||||
INTC_VECT(LPC, 0xae0), INTC_VECT(LPC, 0xb00),
|
||||
@ -250,14 +246,14 @@ static struct intc_vect vectors[] __initdata = {
|
||||
INTC_VECT(SCIF0, 0xb40), INTC_VECT(SCIF1, 0xb60),
|
||||
INTC_VECT(SCIF3, 0xb80), INTC_VECT(SCIF3, 0xba0),
|
||||
INTC_VECT(SCIF3, 0xbc0), INTC_VECT(SCIF3, 0xbe0),
|
||||
INTC_VECT(PECI0I, 0xc00), INTC_VECT(PECI1I, 0xc20),
|
||||
INTC_VECT(PECI2I, 0xc40),
|
||||
INTC_VECT(PECI0, 0xc00), INTC_VECT(PECI1, 0xc20),
|
||||
INTC_VECT(PECI2, 0xc40),
|
||||
INTC_VECT(IRQ15, 0xc60),
|
||||
INTC_VECT(ETHERC, 0xc80), INTC_VECT(ETHERC, 0xca0),
|
||||
INTC_VECT(SPI0, 0xcc0),
|
||||
INTC_VECT(ADC1, 0xce0),
|
||||
INTC_VECT(DMAC1_8, 0xd00), INTC_VECT(DMAC1_8, 0xd20),
|
||||
INTC_VECT(DMAC1_8, 0xd40), INTC_VECT(DMAC1_8, 0xd60),
|
||||
INTC_VECT(DMAC8_11, 0xd00), INTC_VECT(DMAC8_11, 0xd20),
|
||||
INTC_VECT(DMAC8_11, 0xd40), INTC_VECT(DMAC8_11, 0xd60),
|
||||
INTC_VECT(SIM, 0xd80), INTC_VECT(SIM, 0xda0),
|
||||
INTC_VECT(SIM, 0xdc0), INTC_VECT(SIM, 0xde0),
|
||||
INTC_VECT(TMU3, 0xe00), INTC_VECT(TMU4, 0xe20),
|
||||
@ -278,17 +274,47 @@ static struct intc_vect vectors[] __initdata = {
|
||||
INTC_VECT(IIC5_0, 0x1860), INTC_VECT(IIC5_1, 0x1880),
|
||||
INTC_VECT(IIC5_2, 0x18a0), INTC_VECT(IIC5_3, 0x18c0),
|
||||
INTC_VECT(IIC6_0, 0x18e0), INTC_VECT(IIC6_1, 0x1900),
|
||||
INTC_VECT(IIC6_2, 0x1920), INTC_VECT(IIC6_3, 0x1980),
|
||||
INTC_VECT(IIC6_2, 0x1920),
|
||||
INTC_VECT(ONFICTL, 0x1960),
|
||||
INTC_VECT(IIC6_3, 0x1980),
|
||||
INTC_VECT(IIC7_0, 0x19a0), INTC_VECT(IIC7_1, 0x1a00),
|
||||
INTC_VECT(IIC7_2, 0x1a20), INTC_VECT(IIC7_3, 0x1a40),
|
||||
INTC_VECT(IIC8_0, 0x1a60), INTC_VECT(IIC8_1, 0x1a80),
|
||||
INTC_VECT(IIC8_2, 0x1aa0), INTC_VECT(IIC8_3, 0x1b40),
|
||||
INTC_VECT(IIC9_0, 0x1b60), INTC_VECT(IIC9_1, 0x1b80),
|
||||
INTC_VECT(IIC9_2, 0x1c00), INTC_VECT(IIC9_3, 0x1c20),
|
||||
INTC_VECT(PCIINTA, 0x1ce0),
|
||||
INTC_VECT(PCIE, 0x1e00),
|
||||
INTC_VECT(SGPIO, 0x1f80),
|
||||
INTC_VECT(SGPIO, 0x1fa0),
|
||||
INTC_VECT(MMC1, 0x1c60), INTC_VECT(MMC2, 0x1c80),
|
||||
INTC_VECT(ECCU, 0x1cc0),
|
||||
INTC_VECT(PCIC, 0x1ce0),
|
||||
INTC_VECT(G200, 0x1d00),
|
||||
INTC_VECT(RSPI, 0x1d80), INTC_VECT(RSPI, 0x1da0),
|
||||
INTC_VECT(RSPI, 0x1dc0), INTC_VECT(RSPI, 0x1de0),
|
||||
INTC_VECT(PECI3, 0x1ec0), INTC_VECT(PECI4, 0x1ee0),
|
||||
INTC_VECT(PECI5, 0x1f00),
|
||||
INTC_VECT(SGPIO, 0x1f80), INTC_VECT(SGPIO, 0x1fa0),
|
||||
INTC_VECT(SGPIO, 0x1fc0),
|
||||
INTC_VECT(DMINT12, 0x2400), INTC_VECT(DMINT13, 0x2420),
|
||||
INTC_VECT(DMINT14, 0x2440), INTC_VECT(DMINT15, 0x2460),
|
||||
INTC_VECT(DMINT16, 0x2480), INTC_VECT(DMINT17, 0x24e0),
|
||||
INTC_VECT(DMINT18, 0x2500), INTC_VECT(DMINT19, 0x2520),
|
||||
INTC_VECT(DMINT20, 0x2540), INTC_VECT(DMINT21, 0x2560),
|
||||
INTC_VECT(DMINT22, 0x2580), INTC_VECT(DMINT23, 0x2600),
|
||||
INTC_VECT(DDRECC, 0x2620),
|
||||
INTC_VECT(TSIP, 0x2640),
|
||||
INTC_VECT(PCIE_BRIDGE, 0x27c0),
|
||||
INTC_VECT(WDT0B, 0x2800), INTC_VECT(WDT1B, 0x2820),
|
||||
INTC_VECT(WDT2B, 0x2840), INTC_VECT(WDT3B, 0x2860),
|
||||
INTC_VECT(WDT4B, 0x2880), INTC_VECT(WDT5B, 0x28a0),
|
||||
INTC_VECT(WDT6B, 0x28c0), INTC_VECT(WDT7B, 0x28e0),
|
||||
INTC_VECT(WDT8B, 0x2900),
|
||||
INTC_VECT(GETHER0, 0x2960), INTC_VECT(GETHER1, 0x2980),
|
||||
INTC_VECT(GETHER2, 0x29a0),
|
||||
INTC_VECT(PBIA, 0x2a00), INTC_VECT(PBIB, 0x2a20),
|
||||
INTC_VECT(PBIC, 0x2a40),
|
||||
INTC_VECT(DMAE2, 0x2a60), INTC_VECT(DMAE3, 0x2a80),
|
||||
INTC_VECT(SERMUX2, 0x2aa0), INTC_VECT(SERMUX3, 0x2b40),
|
||||
INTC_VECT(LPC5, 0x2b60), INTC_VECT(LPC6, 0x2b80),
|
||||
INTC_VECT(LPC7, 0x2c00), INTC_VECT(LPC8, 0x2c20),
|
||||
};
|
||||
|
||||
static struct intc_group groups[] __initdata = {
|
||||
@ -312,31 +338,45 @@ static struct intc_mask_reg mask_registers[] __initdata = {
|
||||
|
||||
{ 0xffd40038, 0xffd4003c, 32, /* INT2MSKR / INT2MSKCR */
|
||||
{ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, DMAC1_8, 0, PECI0I, LPC, FRT, WDT1, TMR45,
|
||||
TMR23, TMR01, 0, 0, 0, 0, 0, DMAC0,
|
||||
HUDI, 0, WDT0, SCIF3, SCIF2, SDHI, TMU345, TMU012
|
||||
0, DMAC8_11, 0, PECI0, LPC, FRT, 0, TMR45,
|
||||
TMR23, TMR01, 0, 0, 0, 0, 0, DMAC0_5,
|
||||
HUDI, 0, 0, SCIF3, SCIF2, SDHI, TMU345, TMU012
|
||||
} },
|
||||
|
||||
{ 0xffd400d0, 0xffd400d4, 32, /* INT2MSKR1 / INT2MSKCR1 */
|
||||
{ IRQ15, IRQ14, IRQ13, IRQ12, IRQ11, IRQ10, SCIF4, ETHERC,
|
||||
IRQ9, IRQ8, SCIF1, SCIF0, USB0, 0, 0, USB1,
|
||||
ADC1, 0, DMAC1_6, ADC0, SPI0, SIM, PECI2I, PECI1I,
|
||||
ADC1, 0, DMAC6_7, ADC0, SPI0, SIM, PECI2, PECI1,
|
||||
ARC4, 0, SPI1, JMC, 0, 0, 0, DVC
|
||||
} },
|
||||
|
||||
{ 0xffd10038, 0xffd1003c, 32, /* INT2MSKR2 / INT2MSKCR2 */
|
||||
{ IIC4_1, IIC4_2, IIC5_0, 0, 0, 0, SGPIO, 0,
|
||||
0, 0, 0, IIC9_2, IIC8_2, IIC8_1, IIC8_0, IIC7_3,
|
||||
{ IIC4_1, IIC4_2, IIC5_0, ONFICTL, 0, 0, SGPIO, 0,
|
||||
0, G200, 0, IIC9_2, IIC8_2, IIC8_1, IIC8_0, IIC7_3,
|
||||
IIC7_2, IIC7_1, IIC6_3, IIC0_0, IIC0_1, IIC0_2, IIC0_3, IIC3_1,
|
||||
IIC2_3, 0, IIC2_1, IIC9_1, IIC3_3, IIC1_0, PCIE, IIC2_2
|
||||
IIC2_3, 0, IIC2_1, IIC9_1, IIC3_3, IIC1_0, 0, IIC2_2
|
||||
} },
|
||||
|
||||
{ 0xffd100d0, 0xff1400d4, 32, /* INT2MSKR3 / INT2MSKCR4 */
|
||||
{ 0, IIC6_1, IIC6_0, IIC5_1, IIC3_2, IIC2_0, 0, 0,
|
||||
{ 0xffd100d0, 0xffd100d4, 32, /* INT2MSKR3 / INT2MSKCR3 */
|
||||
{ MMC1, IIC6_1, IIC6_0, IIC5_1, IIC3_2, IIC2_0, PECI5, MMC2,
|
||||
IIC1_3, IIC1_2, IIC9_0, IIC8_3, IIC4_3, IIC7_0, 0, IIC6_2,
|
||||
PCIINTA, 0, IIC4_0, 0, 0, 0, 0, IIC9_3,
|
||||
PCIC, 0, IIC4_0, 0, ECCU, RSPI, 0, IIC9_3,
|
||||
IIC3_0, 0, IIC5_3, IIC5_2, 0, 0, 0, IIC1_1
|
||||
} },
|
||||
|
||||
{ 0xffd20038, 0xffd2003c, 32, /* INT2MSKR4 / INT2MSKCR4 */
|
||||
{ WDT0B, WDT1B, WDT3B, GETHER0, 0, 0, 0, 0,
|
||||
0, 0, 0, LPC7, SERMUX2, DMAE3, DMAE2, PBIC,
|
||||
PBIB, PBIA, GETHER1, DMINT12, DMINT13, DMINT14, DMINT15, TSIP,
|
||||
DMINT23, 0, DMINT21, LPC6, 0, DMINT16, 0, DMINT22
|
||||
} },
|
||||
|
||||
{ 0xffd200d0, 0xffd200d4, 32, /* INT2MSKR5 / INT2MSKCR5 */
|
||||
{ 0, WDT8B, WDT7B, WDT4B, 0, DMINT20, 0, 0,
|
||||
DMINT19, DMINT18, LPC5, SERMUX3, WDT2B, GETHER2, 0, 0,
|
||||
0, 0, PCIE_BRIDGE, 0, 0, 0, 0, LPC8,
|
||||
DDRECC, 0, WDT6B, WDT5B, 0, 0, 0, DMINT17
|
||||
} },
|
||||
};
|
||||
|
||||
#define INTPRI 0xffd00010
|
||||
@ -372,6 +412,22 @@ static struct intc_mask_reg mask_registers[] __initdata = {
|
||||
#define INT2PRI29 0xffd100b4
|
||||
#define INT2PRI30 0xffd100b8
|
||||
#define INT2PRI31 0xffd100bc
|
||||
#define INT2PRI32 0xffd20000
|
||||
#define INT2PRI33 0xffd20004
|
||||
#define INT2PRI34 0xffd20008
|
||||
#define INT2PRI35 0xffd2000c
|
||||
#define INT2PRI36 0xffd20010
|
||||
#define INT2PRI37 0xffd20014
|
||||
#define INT2PRI38 0xffd20018
|
||||
#define INT2PRI39 0xffd2001c
|
||||
#define INT2PRI40 0xffd200a0
|
||||
#define INT2PRI41 0xffd200a4
|
||||
#define INT2PRI42 0xffd200a8
|
||||
#define INT2PRI43 0xffd200ac
|
||||
#define INT2PRI44 0xffd200b0
|
||||
#define INT2PRI45 0xffd200b4
|
||||
#define INT2PRI46 0xffd200b8
|
||||
#define INT2PRI47 0xffd200bc
|
||||
|
||||
static struct intc_prio_reg prio_registers[] __initdata = {
|
||||
{ INTPRI, 0, 32, 4, { IRQ0, IRQ1, IRQ2, IRQ3,
|
||||
@ -379,39 +435,61 @@ static struct intc_prio_reg prio_registers[] __initdata = {
|
||||
|
||||
{ INT2PRI0, 0, 32, 8, { TMU0, TMU1, TMU2, TMU2_TICPI } },
|
||||
{ INT2PRI1, 0, 32, 8, { TMU3, TMU4, TMU5, SDHI } },
|
||||
{ INT2PRI2, 0, 32, 8, { SCIF2, SCIF3, WDT0, IRQ8 } },
|
||||
{ INT2PRI3, 0, 32, 8, { HUDI, DMAC0, ADC0, IRQ9 } },
|
||||
{ INT2PRI2, 0, 32, 8, { SCIF2, SCIF3, 0, IRQ8 } },
|
||||
{ INT2PRI3, 0, 32, 8, { HUDI, DMAC0_5, ADC0, IRQ9 } },
|
||||
{ INT2PRI4, 0, 32, 8, { IRQ10, 0, TMR01, TMR23 } },
|
||||
{ INT2PRI5, 0, 32, 8, { TMR45, WDT1, FRT, LPC } },
|
||||
{ INT2PRI6, 0, 32, 8, { PECI0I, ETHERC, DMAC1_8, 0 } },
|
||||
{ INT2PRI5, 0, 32, 8, { TMR45, 0, FRT, LPC } },
|
||||
{ INT2PRI6, 0, 32, 8, { PECI0, ETHERC, DMAC8_11, 0 } },
|
||||
{ INT2PRI7, 0, 32, 8, { SCIF4, 0, IRQ11, IRQ12 } },
|
||||
{ INT2PRI8, 0, 32, 8, { 0, 0, 0, DVC } },
|
||||
{ INT2PRI9, 0, 32, 8, { ARC4, 0, SPI1, JMC } },
|
||||
{ INT2PRI10, 0, 32, 8, { SPI0, SIM, PECI2I, PECI1I } },
|
||||
{ INT2PRI11, 0, 32, 8, { ADC1, IRQ13, DMAC1_6, IRQ14 } },
|
||||
{ INT2PRI10, 0, 32, 8, { SPI0, SIM, PECI2, PECI1 } },
|
||||
{ INT2PRI11, 0, 32, 8, { ADC1, IRQ13, DMAC6_7, IRQ14 } },
|
||||
{ INT2PRI12, 0, 32, 8, { USB0, 0, IRQ15, USB1 } },
|
||||
{ INT2PRI13, 0, 32, 8, { 0, 0, SCIF1, SCIF0 } },
|
||||
|
||||
{ INT2PRI16, 0, 32, 8, { IIC2_2, 0, 0, 0 } },
|
||||
{ INT2PRI17, 0, 32, 8, { PCIE, 0, 0, IIC1_0 } },
|
||||
{ INT2PRI17, 0, 32, 8, { 0, 0, 0, IIC1_0 } },
|
||||
{ INT2PRI18, 0, 32, 8, { IIC3_3, IIC9_1, IIC2_1, IIC1_2 } },
|
||||
{ INT2PRI19, 0, 32, 8, { IIC2_3, IIC3_1, 0, IIC1_3 } },
|
||||
{ INT2PRI20, 0, 32, 8, { IIC2_0, IIC6_3, IIC7_1, IIC7_2 } },
|
||||
{ INT2PRI21, 0, 32, 8, { IIC7_3, IIC8_0, IIC8_1, IIC8_2 } },
|
||||
{ INT2PRI22, 0, 32, 8, { IIC9_2, 0, 0, 0 } },
|
||||
{ INT2PRI23, 0, 32, 8, { 0, SGPIO, IIC3_2, IIC5_1 } },
|
||||
{ INT2PRI24, 0, 32, 8, { 0, 0, 0, IIC1_1 } },
|
||||
{ INT2PRI22, 0, 32, 8, { IIC9_2, MMC2, G200, 0 } },
|
||||
{ INT2PRI23, 0, 32, 8, { PECI5, SGPIO, IIC3_2, IIC5_1 } },
|
||||
{ INT2PRI24, 0, 32, 8, { PECI4, PECI3, 0, IIC1_1 } },
|
||||
{ INT2PRI25, 0, 32, 8, { IIC3_0, 0, IIC5_3, IIC5_2 } },
|
||||
{ INT2PRI26, 0, 32, 8, { 0, 0, 0, IIC9_3 } },
|
||||
{ INT2PRI27, 0, 32, 8, { PCIINTA, IIC6_0, IIC4_0, IIC6_1 } },
|
||||
{ INT2PRI28, 0, 32, 8, { IIC4_3, IIC7_0, 0, IIC6_2 } },
|
||||
{ INT2PRI26, 0, 32, 8, { ECCU, RSPI, 0, IIC9_3 } },
|
||||
{ INT2PRI27, 0, 32, 8, { PCIC, IIC6_0, IIC4_0, IIC6_1 } },
|
||||
{ INT2PRI28, 0, 32, 8, { IIC4_3, IIC7_0, MMC1, IIC6_2 } },
|
||||
{ INT2PRI29, 0, 32, 8, { 0, 0, IIC9_0, IIC8_3 } },
|
||||
{ INT2PRI30, 0, 32, 8, { IIC4_1, IIC4_2, IIC5_0, 0 } },
|
||||
{ INT2PRI30, 0, 32, 8, { IIC4_1, IIC4_2, IIC5_0, ONFICTL } },
|
||||
{ INT2PRI31, 0, 32, 8, { IIC0_0, IIC0_1, IIC0_2, IIC0_3 } },
|
||||
{ INT2PRI32, 0, 32, 8, { DMINT22, 0, 0, 0 } },
|
||||
{ INT2PRI33, 0, 32, 8, { 0, 0, 0, DMINT16 } },
|
||||
{ INT2PRI34, 0, 32, 8, { 0, LPC6, DMINT21, DMINT18 } },
|
||||
{ INT2PRI35, 0, 32, 8, { DMINT23, TSIP, 0, DMINT19 } },
|
||||
{ INT2PRI36, 0, 32, 8, { DMINT20, GETHER1, PBIA, PBIB } },
|
||||
{ INT2PRI37, 0, 32, 8, { PBIC, DMAE2, DMAE3, SERMUX2 } },
|
||||
{ INT2PRI38, 0, 32, 8, { LPC7, 0, 0, 0 } },
|
||||
{ INT2PRI39, 0, 32, 8, { 0, 0, 0, WDT4B } },
|
||||
{ INT2PRI40, 0, 32, 8, { 0, 0, 0, DMINT17 } },
|
||||
{ INT2PRI41, 0, 32, 8, { DDRECC, 0, WDT6B, WDT5B } },
|
||||
{ INT2PRI42, 0, 32, 8, { 0, 0, 0, LPC8 } },
|
||||
{ INT2PRI43, 0, 32, 8, { 0, WDT7B, PCIE_BRIDGE, WDT8B } },
|
||||
{ INT2PRI44, 0, 32, 8, { WDT2B, GETHER2, 0, 0 } },
|
||||
{ INT2PRI45, 0, 32, 8, { 0, 0, LPC5, SERMUX3 } },
|
||||
{ INT2PRI46, 0, 32, 8, { WDT0B, WDT1B, WDT3B, GETHER0 } },
|
||||
{ INT2PRI47, 0, 32, 8, { DMINT12, DMINT13, DMINT14, DMINT15 } },
|
||||
};
|
||||
|
||||
static struct intc_sense_reg sense_registers_irq8to15[] __initdata = {
|
||||
{ 0xffd100f8, 32, 2, /* ICR2 */ { IRQ15, IRQ14, IRQ13, IRQ12,
|
||||
IRQ11, IRQ10, IRQ9, IRQ8 } },
|
||||
};
|
||||
|
||||
static DECLARE_INTC_DESC(intc_desc, "sh7757", vectors, groups,
|
||||
mask_registers, prio_registers, NULL);
|
||||
mask_registers, prio_registers,
|
||||
sense_registers_irq8to15);
|
||||
|
||||
/* Support for external interrupt pins in IRQ mode */
|
||||
static struct intc_vect vectors_irq0123[] __initdata = {
|
||||
|
@ -629,33 +629,10 @@ static void __init sh7786_usb_setup(void)
|
||||
}
|
||||
}
|
||||
|
||||
static int __init sh7786_devices_setup(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
sh7786_usb_setup();
|
||||
|
||||
ret = platform_add_devices(sh7786_early_devices,
|
||||
ARRAY_SIZE(sh7786_early_devices));
|
||||
if (unlikely(ret != 0))
|
||||
return ret;
|
||||
|
||||
return platform_add_devices(sh7786_devices,
|
||||
ARRAY_SIZE(sh7786_devices));
|
||||
}
|
||||
arch_initcall(sh7786_devices_setup);
|
||||
|
||||
void __init plat_early_device_setup(void)
|
||||
{
|
||||
early_platform_add_devices(sh7786_early_devices,
|
||||
ARRAY_SIZE(sh7786_early_devices));
|
||||
}
|
||||
|
||||
enum {
|
||||
UNUSED = 0,
|
||||
|
||||
/* interrupt sources */
|
||||
|
||||
IRL0_LLLL, IRL0_LLLH, IRL0_LLHL, IRL0_LLHH,
|
||||
IRL0_LHLL, IRL0_LHLH, IRL0_LHHL, IRL0_LHHH,
|
||||
IRL0_HLLL, IRL0_HLLH, IRL0_HLHL, IRL0_HLHH,
|
||||
@ -693,9 +670,12 @@ enum {
|
||||
Thermal,
|
||||
INTICI0, INTICI1, INTICI2, INTICI3,
|
||||
INTICI4, INTICI5, INTICI6, INTICI7,
|
||||
|
||||
/* Muxed sub-events */
|
||||
TXI1, BRI1, RXI1, ERI1,
|
||||
};
|
||||
|
||||
static struct intc_vect vectors[] __initdata = {
|
||||
static struct intc_vect sh7786_vectors[] __initdata = {
|
||||
INTC_VECT(WDT, 0x3e0),
|
||||
INTC_VECT(TMU0_0, 0x400), INTC_VECT(TMU0_1, 0x420),
|
||||
INTC_VECT(TMU0_2, 0x440), INTC_VECT(TMU0_3, 0x460),
|
||||
@ -756,14 +736,12 @@ static struct intc_vect vectors[] __initdata = {
|
||||
|
||||
#define INTDISTCR0 0xfe4100b0
|
||||
#define INTDISTCR1 0xfe4100b4
|
||||
#define INTACK 0xfe4100b8
|
||||
#define INTACKCLR 0xfe4100bc
|
||||
#define INT2DISTCR0 0xfe410900
|
||||
#define INT2DISTCR1 0xfe410904
|
||||
#define INT2DISTCR2 0xfe410908
|
||||
#define INT2DISTCR3 0xfe41090c
|
||||
|
||||
static struct intc_mask_reg mask_registers[] __initdata = {
|
||||
static struct intc_mask_reg sh7786_mask_registers[] __initdata = {
|
||||
{ CnINTMSK0, CnINTMSKCLR0, 32,
|
||||
{ IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7 },
|
||||
INTC_SMP_BALANCING(INTDISTCR0) },
|
||||
@ -807,7 +785,7 @@ static struct intc_mask_reg mask_registers[] __initdata = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0 }, INTC_SMP_BALANCING(INT2DISTCR3) },
|
||||
};
|
||||
|
||||
static struct intc_prio_reg prio_registers[] __initdata = {
|
||||
static struct intc_prio_reg sh7786_prio_registers[] __initdata = {
|
||||
{ 0xfe410010, 0, 32, 4, /* INTPRI */ { IRQ0, IRQ1, IRQ2, IRQ3,
|
||||
IRQ4, IRQ5, IRQ6, IRQ7 } },
|
||||
{ 0xfe410800, 0, 32, 8, /* INT2PRI0 */ { 0, 0, 0, WDT } },
|
||||
@ -851,11 +829,27 @@ static struct intc_prio_reg prio_registers[] __initdata = {
|
||||
INTICI3, INTICI2, INTICI1, INTICI0 }, INTC_SMP(4, 2) },
|
||||
};
|
||||
|
||||
static DECLARE_INTC_DESC(intc_desc, "sh7786", vectors, NULL,
|
||||
mask_registers, prio_registers, NULL);
|
||||
static struct intc_subgroup sh7786_subgroups[] __initdata = {
|
||||
{ 0xfe410c20, 32, SCIF1,
|
||||
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, TXI1, BRI1, RXI1, ERI1 } },
|
||||
};
|
||||
|
||||
static struct intc_desc sh7786_intc_desc __initdata = {
|
||||
.name = "sh7786",
|
||||
.hw = {
|
||||
.vectors = sh7786_vectors,
|
||||
.nr_vectors = ARRAY_SIZE(sh7786_vectors),
|
||||
.mask_regs = sh7786_mask_registers,
|
||||
.nr_mask_regs = ARRAY_SIZE(sh7786_mask_registers),
|
||||
.subgroups = sh7786_subgroups,
|
||||
.nr_subgroups = ARRAY_SIZE(sh7786_subgroups),
|
||||
.prio_regs = sh7786_prio_registers,
|
||||
.nr_prio_regs = ARRAY_SIZE(sh7786_prio_registers),
|
||||
},
|
||||
};
|
||||
|
||||
/* Support for external interrupt pins in IRQ mode */
|
||||
|
||||
static struct intc_vect vectors_irq0123[] __initdata = {
|
||||
INTC_VECT(IRQ0, 0x200), INTC_VECT(IRQ1, 0x240),
|
||||
INTC_VECT(IRQ2, 0x280), INTC_VECT(IRQ3, 0x2c0),
|
||||
@ -866,23 +860,25 @@ static struct intc_vect vectors_irq4567[] __initdata = {
|
||||
INTC_VECT(IRQ6, 0x380), INTC_VECT(IRQ7, 0x3c0),
|
||||
};
|
||||
|
||||
static struct intc_sense_reg sense_registers[] __initdata = {
|
||||
static struct intc_sense_reg sh7786_sense_registers[] __initdata = {
|
||||
{ 0xfe41001c, 32, 2, /* ICR1 */ { IRQ0, IRQ1, IRQ2, IRQ3,
|
||||
IRQ4, IRQ5, IRQ6, IRQ7 } },
|
||||
};
|
||||
|
||||
static struct intc_mask_reg ack_registers[] __initdata = {
|
||||
static struct intc_mask_reg sh7786_ack_registers[] __initdata = {
|
||||
{ 0xfe410024, 0, 32, /* INTREQ */
|
||||
{ IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7 } },
|
||||
};
|
||||
|
||||
static DECLARE_INTC_DESC_ACK(intc_desc_irq0123, "sh7786-irq0123",
|
||||
vectors_irq0123, NULL, mask_registers,
|
||||
prio_registers, sense_registers, ack_registers);
|
||||
vectors_irq0123, NULL, sh7786_mask_registers,
|
||||
sh7786_prio_registers, sh7786_sense_registers,
|
||||
sh7786_ack_registers);
|
||||
|
||||
static DECLARE_INTC_DESC_ACK(intc_desc_irq4567, "sh7786-irq4567",
|
||||
vectors_irq4567, NULL, mask_registers,
|
||||
prio_registers, sense_registers, ack_registers);
|
||||
vectors_irq4567, NULL, sh7786_mask_registers,
|
||||
sh7786_prio_registers, sh7786_sense_registers,
|
||||
sh7786_ack_registers);
|
||||
|
||||
/* External interrupt pins in IRL mode */
|
||||
|
||||
@ -909,10 +905,10 @@ static struct intc_vect vectors_irl4567[] __initdata = {
|
||||
};
|
||||
|
||||
static DECLARE_INTC_DESC(intc_desc_irl0123, "sh7786-irl0123", vectors_irl0123,
|
||||
NULL, mask_registers, NULL, NULL);
|
||||
NULL, sh7786_mask_registers, NULL, NULL);
|
||||
|
||||
static DECLARE_INTC_DESC(intc_desc_irl4567, "sh7786-irl4567", vectors_irl4567,
|
||||
NULL, mask_registers, NULL, NULL);
|
||||
NULL, sh7786_mask_registers, NULL, NULL);
|
||||
|
||||
#define INTC_ICR0 0xfe410000
|
||||
#define INTC_INTMSK0 CnINTMSK0
|
||||
@ -920,19 +916,6 @@ static DECLARE_INTC_DESC(intc_desc_irl4567, "sh7786-irl4567", vectors_irl4567,
|
||||
#define INTC_INTMSK2 INTMSK2
|
||||
#define INTC_INTMSKCLR1 CnINTMSKCLR1
|
||||
#define INTC_INTMSKCLR2 INTMSKCLR2
|
||||
#define INTC_USERIMASK 0xfe411000
|
||||
|
||||
#ifdef CONFIG_INTC_BALANCING
|
||||
unsigned int irq_lookup(unsigned int irq)
|
||||
{
|
||||
return __raw_readl(INTACK) & 1 ? irq : NO_IRQ_IGNORE;
|
||||
}
|
||||
|
||||
void irq_finish(unsigned int irq)
|
||||
{
|
||||
__raw_writel(irq2evt(irq), INTACKCLR);
|
||||
}
|
||||
#endif
|
||||
|
||||
void __init plat_irq_setup(void)
|
||||
{
|
||||
@ -946,8 +929,7 @@ void __init plat_irq_setup(void)
|
||||
/* select IRL mode for IRL3-0 + IRL7-4 */
|
||||
__raw_writel(__raw_readl(INTC_ICR0) & ~0x00c00000, INTC_ICR0);
|
||||
|
||||
register_intc_controller(&intc_desc);
|
||||
register_intc_userimask(INTC_USERIMASK);
|
||||
register_intc_controller(&sh7786_intc_desc);
|
||||
}
|
||||
|
||||
void __init plat_irq_setup_pins(int mode)
|
||||
@ -991,3 +973,39 @@ void __init plat_irq_setup_pins(int mode)
|
||||
void __init plat_mem_setup(void)
|
||||
{
|
||||
}
|
||||
|
||||
static int __init sh7786_devices_setup(void)
|
||||
{
|
||||
int ret, irq;
|
||||
|
||||
sh7786_usb_setup();
|
||||
|
||||
/*
|
||||
* De-mux SCIF1 IRQs if possible
|
||||
*/
|
||||
irq = intc_irq_lookup(sh7786_intc_desc.name, TXI1);
|
||||
if (irq > 0) {
|
||||
scif1_platform_data.irqs[SCIx_TXI_IRQ] = irq;
|
||||
scif1_platform_data.irqs[SCIx_ERI_IRQ] =
|
||||
intc_irq_lookup(sh7786_intc_desc.name, ERI1);
|
||||
scif1_platform_data.irqs[SCIx_BRI_IRQ] =
|
||||
intc_irq_lookup(sh7786_intc_desc.name, BRI1);
|
||||
scif1_platform_data.irqs[SCIx_RXI_IRQ] =
|
||||
intc_irq_lookup(sh7786_intc_desc.name, RXI1);
|
||||
}
|
||||
|
||||
ret = platform_add_devices(sh7786_early_devices,
|
||||
ARRAY_SIZE(sh7786_early_devices));
|
||||
if (unlikely(ret != 0))
|
||||
return ret;
|
||||
|
||||
return platform_add_devices(sh7786_devices,
|
||||
ARRAY_SIZE(sh7786_devices));
|
||||
}
|
||||
arch_initcall(sh7786_devices_setup);
|
||||
|
||||
void __init plat_early_device_setup(void)
|
||||
{
|
||||
early_platform_add_devices(sh7786_early_devices,
|
||||
ARRAY_SIZE(sh7786_early_devices));
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* SH-X3 Prototype Setup
|
||||
*
|
||||
* Copyright (C) 2007 - 2009 Paul Mundt
|
||||
* Copyright (C) 2007 - 2010 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
|
||||
@ -12,7 +12,9 @@
|
||||
#include <linux/serial.h>
|
||||
#include <linux/serial_sci.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <linux/sh_timer.h>
|
||||
#include <cpu/shx3.h>
|
||||
#include <asm/mmzone.h>
|
||||
|
||||
/*
|
||||
@ -354,6 +356,10 @@ static struct intc_group groups[] __initdata = {
|
||||
DMAC1_DMINT9, DMAC1_DMINT10, DMAC1_DMINT11),
|
||||
};
|
||||
|
||||
#define INT2DISTCR0 0xfe4108a0
|
||||
#define INT2DISTCR1 0xfe4108a4
|
||||
#define INT2DISTCR2 0xfe4108a8
|
||||
|
||||
static struct intc_mask_reg mask_registers[] __initdata = {
|
||||
{ 0xfe410030, 0xfe410050, 32, /* CnINTMSK0 / CnINTMSKCLR0 */
|
||||
{ IRQ0, IRQ1, IRQ2, IRQ3 } },
|
||||
@ -363,20 +369,23 @@ static struct intc_mask_reg mask_registers[] __initdata = {
|
||||
{ FE1, FE0, 0, ATAPI, VCORE0, VIN1, VIN0, IIC,
|
||||
DU, GPIO3, GPIO2, GPIO1, GPIO0, PAM, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, /* HUDI bits ignored */
|
||||
0, TMU5, TMU4, TMU3, TMU2, TMU1, TMU0, 0, } },
|
||||
0, TMU5, TMU4, TMU3, TMU2, TMU1, TMU0, 0, },
|
||||
INTC_SMP_BALANCING(INT2DISTCR0) },
|
||||
{ 0xfe410830, 0xfe410860, 32, /* CnINT2MSK1 / CnINT2MSKCLR1 */
|
||||
{ 0, 0, 0, 0, DTU3, DTU2, DTU1, DTU0, /* IRM bits ignored */
|
||||
PCII9, PCII8, PCII7, PCII6, PCII5, PCII4, PCII3, PCII2,
|
||||
PCII1, PCII0, DMAC1_DMAE, DMAC1_DMINT11,
|
||||
DMAC1_DMINT10, DMAC1_DMINT9, DMAC1_DMINT8, DMAC1_DMINT7,
|
||||
DMAC1_DMINT6, DMAC0_DMAE, DMAC0_DMINT5, DMAC0_DMINT4,
|
||||
DMAC0_DMINT3, DMAC0_DMINT2, DMAC0_DMINT1, DMAC0_DMINT0 } },
|
||||
DMAC0_DMINT3, DMAC0_DMINT2, DMAC0_DMINT1, DMAC0_DMINT0 },
|
||||
INTC_SMP_BALANCING(INT2DISTCR1) },
|
||||
{ 0xfe410840, 0xfe410870, 32, /* CnINT2MSK2 / CnINT2MSKCLR2 */
|
||||
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
SCIF3_TXI, SCIF3_BRI, SCIF3_RXI, SCIF3_ERI,
|
||||
SCIF2_TXI, SCIF2_BRI, SCIF2_RXI, SCIF2_ERI,
|
||||
SCIF1_TXI, SCIF1_BRI, SCIF1_RXI, SCIF1_ERI,
|
||||
SCIF0_TXI, SCIF0_BRI, SCIF0_RXI, SCIF0_ERI } },
|
||||
SCIF0_TXI, SCIF0_BRI, SCIF0_RXI, SCIF0_ERI },
|
||||
INTC_SMP_BALANCING(INT2DISTCR2) },
|
||||
};
|
||||
|
||||
static struct intc_prio_reg prio_registers[] __initdata = {
|
||||
@ -433,11 +442,33 @@ static DECLARE_INTC_DESC(intc_desc_irl, "shx3-irl", vectors_irl, groups,
|
||||
|
||||
void __init plat_irq_setup_pins(int mode)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
switch (mode) {
|
||||
case IRQ_MODE_IRQ:
|
||||
ret |= gpio_request(GPIO_FN_IRQ3, intc_desc_irq.name);
|
||||
ret |= gpio_request(GPIO_FN_IRQ2, intc_desc_irq.name);
|
||||
ret |= gpio_request(GPIO_FN_IRQ1, intc_desc_irq.name);
|
||||
ret |= gpio_request(GPIO_FN_IRQ0, intc_desc_irq.name);
|
||||
|
||||
if (unlikely(ret)) {
|
||||
pr_err("Failed to set IRQ mode\n");
|
||||
return;
|
||||
}
|
||||
|
||||
register_intc_controller(&intc_desc_irq);
|
||||
break;
|
||||
case IRQ_MODE_IRL3210:
|
||||
ret |= gpio_request(GPIO_FN_IRL3, intc_desc_irl.name);
|
||||
ret |= gpio_request(GPIO_FN_IRL2, intc_desc_irl.name);
|
||||
ret |= gpio_request(GPIO_FN_IRL1, intc_desc_irl.name);
|
||||
ret |= gpio_request(GPIO_FN_IRL0, intc_desc_irl.name);
|
||||
|
||||
if (unlikely(ret)) {
|
||||
pr_err("Failed to set IRL mode\n");
|
||||
return;
|
||||
}
|
||||
|
||||
register_intc_controller(&intc_desc_irl);
|
||||
break;
|
||||
default:
|
||||
@ -447,6 +478,9 @@ void __init plat_irq_setup_pins(int mode)
|
||||
|
||||
void __init plat_irq_setup(void)
|
||||
{
|
||||
reserve_intc_vectors(vectors_irq, ARRAY_SIZE(vectors_irq));
|
||||
reserve_intc_vectors(vectors_irl, ARRAY_SIZE(vectors_irl));
|
||||
|
||||
register_intc_controller(&intc_desc);
|
||||
}
|
||||
|
||||
|
@ -330,7 +330,7 @@ ENTRY(_stext)
|
||||
#if defined(CONFIG_CPU_SH2)
|
||||
1: .long 0x000000F0 ! IMASK=0xF
|
||||
#else
|
||||
1: .long 0x400080F0 ! MD=1, RB=0, BL=0, FD=1, IMASK=0xF
|
||||
1: .long 0x500080F0 ! MD=1, RB=0, BL=1, FD=1, IMASK=0xF
|
||||
#endif
|
||||
ENTRY(stack_start)
|
||||
2: .long init_thread_union+THREAD_SIZE
|
||||
|
@ -291,7 +291,7 @@ int handle_trapped_io(struct pt_regs *regs, unsigned long address)
|
||||
}
|
||||
|
||||
tmp = handle_unaligned_access(instruction, regs,
|
||||
&trapped_io_access, 1);
|
||||
&trapped_io_access, 1, address);
|
||||
set_fs(oldfs);
|
||||
return tmp == 0;
|
||||
}
|
||||
|
@ -283,6 +283,8 @@ void __init init_IRQ(void)
|
||||
if (sh_mv.mv_init_irq)
|
||||
sh_mv.mv_init_irq();
|
||||
|
||||
intc_finalize();
|
||||
|
||||
irq_ctx_init(smp_processor_id());
|
||||
}
|
||||
|
||||
|
16
arch/sh/kernel/kdebugfs.c
Normal file
16
arch/sh/kernel/kdebugfs.c
Normal file
@ -0,0 +1,16 @@
|
||||
#include <linux/module.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/debugfs.h>
|
||||
|
||||
struct dentry *arch_debugfs_dir;
|
||||
EXPORT_SYMBOL(arch_debugfs_dir);
|
||||
|
||||
static int __init arch_kdebugfs_init(void)
|
||||
{
|
||||
arch_debugfs_dir = debugfs_create_dir("sh", NULL);
|
||||
if (!arch_debugfs_dir)
|
||||
return -ENOMEM;
|
||||
|
||||
return 0;
|
||||
}
|
||||
arch_initcall(arch_kdebugfs_init);
|
@ -20,9 +20,9 @@
|
||||
DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL;
|
||||
DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk);
|
||||
|
||||
static struct kprobe saved_current_opcode;
|
||||
static struct kprobe saved_next_opcode;
|
||||
static struct kprobe saved_next_opcode2;
|
||||
static DEFINE_PER_CPU(struct kprobe, saved_current_opcode);
|
||||
static DEFINE_PER_CPU(struct kprobe, saved_next_opcode);
|
||||
static DEFINE_PER_CPU(struct kprobe, saved_next_opcode2);
|
||||
|
||||
#define OPCODE_JMP(x) (((x) & 0xF0FF) == 0x402b)
|
||||
#define OPCODE_JSR(x) (((x) & 0xF0FF) == 0x400b)
|
||||
@ -102,16 +102,21 @@ int __kprobes kprobe_handle_illslot(unsigned long pc)
|
||||
|
||||
void __kprobes arch_remove_kprobe(struct kprobe *p)
|
||||
{
|
||||
if (saved_next_opcode.addr != 0x0) {
|
||||
arch_disarm_kprobe(p);
|
||||
arch_disarm_kprobe(&saved_next_opcode);
|
||||
saved_next_opcode.addr = 0x0;
|
||||
saved_next_opcode.opcode = 0x0;
|
||||
struct kprobe *saved = &__get_cpu_var(saved_next_opcode);
|
||||
|
||||
if (saved_next_opcode2.addr != 0x0) {
|
||||
arch_disarm_kprobe(&saved_next_opcode2);
|
||||
saved_next_opcode2.addr = 0x0;
|
||||
saved_next_opcode2.opcode = 0x0;
|
||||
if (saved->addr) {
|
||||
arch_disarm_kprobe(p);
|
||||
arch_disarm_kprobe(saved);
|
||||
|
||||
saved->addr = NULL;
|
||||
saved->opcode = 0;
|
||||
|
||||
saved = &__get_cpu_var(saved_next_opcode2);
|
||||
if (saved->addr) {
|
||||
arch_disarm_kprobe(saved);
|
||||
|
||||
saved->addr = NULL;
|
||||
saved->opcode = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -141,57 +146,59 @@ static void __kprobes set_current_kprobe(struct kprobe *p, struct pt_regs *regs,
|
||||
*/
|
||||
static void __kprobes prepare_singlestep(struct kprobe *p, struct pt_regs *regs)
|
||||
{
|
||||
kprobe_opcode_t *addr = NULL;
|
||||
saved_current_opcode.addr = (kprobe_opcode_t *) (regs->pc);
|
||||
addr = saved_current_opcode.addr;
|
||||
__get_cpu_var(saved_current_opcode).addr = (kprobe_opcode_t *)regs->pc;
|
||||
|
||||
if (p != NULL) {
|
||||
struct kprobe *op1, *op2;
|
||||
|
||||
arch_disarm_kprobe(p);
|
||||
|
||||
op1 = &__get_cpu_var(saved_next_opcode);
|
||||
op2 = &__get_cpu_var(saved_next_opcode2);
|
||||
|
||||
if (OPCODE_JSR(p->opcode) || OPCODE_JMP(p->opcode)) {
|
||||
unsigned int reg_nr = ((p->opcode >> 8) & 0x000F);
|
||||
saved_next_opcode.addr =
|
||||
(kprobe_opcode_t *) regs->regs[reg_nr];
|
||||
op1->addr = (kprobe_opcode_t *) regs->regs[reg_nr];
|
||||
} else if (OPCODE_BRA(p->opcode) || OPCODE_BSR(p->opcode)) {
|
||||
unsigned long disp = (p->opcode & 0x0FFF);
|
||||
saved_next_opcode.addr =
|
||||
op1->addr =
|
||||
(kprobe_opcode_t *) (regs->pc + 4 + disp * 2);
|
||||
|
||||
} else if (OPCODE_BRAF(p->opcode) || OPCODE_BSRF(p->opcode)) {
|
||||
unsigned int reg_nr = ((p->opcode >> 8) & 0x000F);
|
||||
saved_next_opcode.addr =
|
||||
op1->addr =
|
||||
(kprobe_opcode_t *) (regs->pc + 4 +
|
||||
regs->regs[reg_nr]);
|
||||
|
||||
} else if (OPCODE_RTS(p->opcode)) {
|
||||
saved_next_opcode.addr = (kprobe_opcode_t *) regs->pr;
|
||||
op1->addr = (kprobe_opcode_t *) regs->pr;
|
||||
|
||||
} else if (OPCODE_BF(p->opcode) || OPCODE_BT(p->opcode)) {
|
||||
unsigned long disp = (p->opcode & 0x00FF);
|
||||
/* case 1 */
|
||||
saved_next_opcode.addr = p->addr + 1;
|
||||
op1->addr = p->addr + 1;
|
||||
/* case 2 */
|
||||
saved_next_opcode2.addr =
|
||||
op2->addr =
|
||||
(kprobe_opcode_t *) (regs->pc + 4 + disp * 2);
|
||||
saved_next_opcode2.opcode = *(saved_next_opcode2.addr);
|
||||
arch_arm_kprobe(&saved_next_opcode2);
|
||||
op2->opcode = *(op2->addr);
|
||||
arch_arm_kprobe(op2);
|
||||
|
||||
} else if (OPCODE_BF_S(p->opcode) || OPCODE_BT_S(p->opcode)) {
|
||||
unsigned long disp = (p->opcode & 0x00FF);
|
||||
/* case 1 */
|
||||
saved_next_opcode.addr = p->addr + 2;
|
||||
op1->addr = p->addr + 2;
|
||||
/* case 2 */
|
||||
saved_next_opcode2.addr =
|
||||
op2->addr =
|
||||
(kprobe_opcode_t *) (regs->pc + 4 + disp * 2);
|
||||
saved_next_opcode2.opcode = *(saved_next_opcode2.addr);
|
||||
arch_arm_kprobe(&saved_next_opcode2);
|
||||
op2->opcode = *(op2->addr);
|
||||
arch_arm_kprobe(op2);
|
||||
|
||||
} else {
|
||||
saved_next_opcode.addr = p->addr + 1;
|
||||
op1->addr = p->addr + 1;
|
||||
}
|
||||
|
||||
saved_next_opcode.opcode = *(saved_next_opcode.addr);
|
||||
arch_arm_kprobe(&saved_next_opcode);
|
||||
op1->opcode = *(op1->addr);
|
||||
arch_arm_kprobe(op1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -376,21 +383,23 @@ static int __kprobes post_kprobe_handler(struct pt_regs *regs)
|
||||
cur->post_handler(cur, regs, 0);
|
||||
}
|
||||
|
||||
if (saved_next_opcode.addr != 0x0) {
|
||||
arch_disarm_kprobe(&saved_next_opcode);
|
||||
saved_next_opcode.addr = 0x0;
|
||||
saved_next_opcode.opcode = 0x0;
|
||||
p = &__get_cpu_var(saved_next_opcode);
|
||||
if (p->addr) {
|
||||
arch_disarm_kprobe(p);
|
||||
p->addr = NULL;
|
||||
p->opcode = 0;
|
||||
|
||||
addr = saved_current_opcode.addr;
|
||||
saved_current_opcode.addr = 0x0;
|
||||
addr = __get_cpu_var(saved_current_opcode).addr;
|
||||
__get_cpu_var(saved_current_opcode).addr = NULL;
|
||||
|
||||
p = get_kprobe(addr);
|
||||
arch_arm_kprobe(p);
|
||||
|
||||
if (saved_next_opcode2.addr != 0x0) {
|
||||
arch_disarm_kprobe(&saved_next_opcode2);
|
||||
saved_next_opcode2.addr = 0x0;
|
||||
saved_next_opcode2.opcode = 0x0;
|
||||
p = &__get_cpu_var(saved_next_opcode2);
|
||||
if (p->addr) {
|
||||
arch_disarm_kprobe(p);
|
||||
p->addr = NULL;
|
||||
p->opcode = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -572,14 +581,5 @@ static struct kprobe trampoline_p = {
|
||||
|
||||
int __init arch_init_kprobes(void)
|
||||
{
|
||||
saved_next_opcode.addr = 0x0;
|
||||
saved_next_opcode.opcode = 0x0;
|
||||
|
||||
saved_current_opcode.addr = 0x0;
|
||||
saved_current_opcode.opcode = 0x0;
|
||||
|
||||
saved_next_opcode2.addr = 0x0;
|
||||
saved_next_opcode2.opcode = 0x0;
|
||||
|
||||
return register_kprobe(&trampoline_p);
|
||||
}
|
||||
|
33
arch/sh/kernel/ptrace.c
Normal file
33
arch/sh/kernel/ptrace.c
Normal file
@ -0,0 +1,33 @@
|
||||
#include <linux/ptrace.h>
|
||||
|
||||
/**
|
||||
* regs_query_register_offset() - query register offset from its name
|
||||
* @name: the name of a register
|
||||
*
|
||||
* regs_query_register_offset() returns the offset of a register in struct
|
||||
* pt_regs from its name. If the name is invalid, this returns -EINVAL;
|
||||
*/
|
||||
int regs_query_register_offset(const char *name)
|
||||
{
|
||||
const struct pt_regs_offset *roff;
|
||||
for (roff = regoffset_table; roff->name != NULL; roff++)
|
||||
if (!strcmp(roff->name, name))
|
||||
return roff->offset;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/**
|
||||
* regs_query_register_name() - query register name from its offset
|
||||
* @offset: the offset of a register in struct pt_regs.
|
||||
*
|
||||
* regs_query_register_name() returns the name of a register from its
|
||||
* offset in struct pt_regs. If the @offset is invalid, this returns NULL;
|
||||
*/
|
||||
const char *regs_query_register_name(unsigned int offset)
|
||||
{
|
||||
const struct pt_regs_offset *roff;
|
||||
for (roff = regoffset_table; roff->name != NULL; roff++)
|
||||
if (roff->offset == offset)
|
||||
return roff->name;
|
||||
return NULL;
|
||||
}
|
@ -274,6 +274,33 @@ static int dspregs_active(struct task_struct *target,
|
||||
}
|
||||
#endif
|
||||
|
||||
const struct pt_regs_offset regoffset_table[] = {
|
||||
REGS_OFFSET_NAME(0),
|
||||
REGS_OFFSET_NAME(1),
|
||||
REGS_OFFSET_NAME(2),
|
||||
REGS_OFFSET_NAME(3),
|
||||
REGS_OFFSET_NAME(4),
|
||||
REGS_OFFSET_NAME(5),
|
||||
REGS_OFFSET_NAME(6),
|
||||
REGS_OFFSET_NAME(7),
|
||||
REGS_OFFSET_NAME(8),
|
||||
REGS_OFFSET_NAME(9),
|
||||
REGS_OFFSET_NAME(10),
|
||||
REGS_OFFSET_NAME(11),
|
||||
REGS_OFFSET_NAME(12),
|
||||
REGS_OFFSET_NAME(13),
|
||||
REGS_OFFSET_NAME(14),
|
||||
REGS_OFFSET_NAME(15),
|
||||
REG_OFFSET_NAME(pc),
|
||||
REG_OFFSET_NAME(pr),
|
||||
REG_OFFSET_NAME(sr),
|
||||
REG_OFFSET_NAME(gbr),
|
||||
REG_OFFSET_NAME(mach),
|
||||
REG_OFFSET_NAME(macl),
|
||||
REG_OFFSET_NAME(tra),
|
||||
REG_OFFSET_END,
|
||||
};
|
||||
|
||||
/*
|
||||
* These are our native regset flavours.
|
||||
*/
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include <linux/sched.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/smp.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/ptrace.h>
|
||||
#include <linux/user.h>
|
||||
@ -252,6 +252,85 @@ static int fpregs_active(struct task_struct *target,
|
||||
}
|
||||
#endif
|
||||
|
||||
const struct pt_regs_offset regoffset_table[] = {
|
||||
REG_OFFSET_NAME(pc),
|
||||
REG_OFFSET_NAME(sr),
|
||||
REG_OFFSET_NAME(syscall_nr),
|
||||
REGS_OFFSET_NAME(0),
|
||||
REGS_OFFSET_NAME(1),
|
||||
REGS_OFFSET_NAME(2),
|
||||
REGS_OFFSET_NAME(3),
|
||||
REGS_OFFSET_NAME(4),
|
||||
REGS_OFFSET_NAME(5),
|
||||
REGS_OFFSET_NAME(6),
|
||||
REGS_OFFSET_NAME(7),
|
||||
REGS_OFFSET_NAME(8),
|
||||
REGS_OFFSET_NAME(9),
|
||||
REGS_OFFSET_NAME(10),
|
||||
REGS_OFFSET_NAME(11),
|
||||
REGS_OFFSET_NAME(12),
|
||||
REGS_OFFSET_NAME(13),
|
||||
REGS_OFFSET_NAME(14),
|
||||
REGS_OFFSET_NAME(15),
|
||||
REGS_OFFSET_NAME(16),
|
||||
REGS_OFFSET_NAME(17),
|
||||
REGS_OFFSET_NAME(18),
|
||||
REGS_OFFSET_NAME(19),
|
||||
REGS_OFFSET_NAME(20),
|
||||
REGS_OFFSET_NAME(21),
|
||||
REGS_OFFSET_NAME(22),
|
||||
REGS_OFFSET_NAME(23),
|
||||
REGS_OFFSET_NAME(24),
|
||||
REGS_OFFSET_NAME(25),
|
||||
REGS_OFFSET_NAME(26),
|
||||
REGS_OFFSET_NAME(27),
|
||||
REGS_OFFSET_NAME(28),
|
||||
REGS_OFFSET_NAME(29),
|
||||
REGS_OFFSET_NAME(30),
|
||||
REGS_OFFSET_NAME(31),
|
||||
REGS_OFFSET_NAME(32),
|
||||
REGS_OFFSET_NAME(33),
|
||||
REGS_OFFSET_NAME(34),
|
||||
REGS_OFFSET_NAME(35),
|
||||
REGS_OFFSET_NAME(36),
|
||||
REGS_OFFSET_NAME(37),
|
||||
REGS_OFFSET_NAME(38),
|
||||
REGS_OFFSET_NAME(39),
|
||||
REGS_OFFSET_NAME(40),
|
||||
REGS_OFFSET_NAME(41),
|
||||
REGS_OFFSET_NAME(42),
|
||||
REGS_OFFSET_NAME(43),
|
||||
REGS_OFFSET_NAME(44),
|
||||
REGS_OFFSET_NAME(45),
|
||||
REGS_OFFSET_NAME(46),
|
||||
REGS_OFFSET_NAME(47),
|
||||
REGS_OFFSET_NAME(48),
|
||||
REGS_OFFSET_NAME(49),
|
||||
REGS_OFFSET_NAME(50),
|
||||
REGS_OFFSET_NAME(51),
|
||||
REGS_OFFSET_NAME(52),
|
||||
REGS_OFFSET_NAME(53),
|
||||
REGS_OFFSET_NAME(54),
|
||||
REGS_OFFSET_NAME(55),
|
||||
REGS_OFFSET_NAME(56),
|
||||
REGS_OFFSET_NAME(57),
|
||||
REGS_OFFSET_NAME(58),
|
||||
REGS_OFFSET_NAME(59),
|
||||
REGS_OFFSET_NAME(60),
|
||||
REGS_OFFSET_NAME(61),
|
||||
REGS_OFFSET_NAME(62),
|
||||
REGS_OFFSET_NAME(63),
|
||||
TREGS_OFFSET_NAME(0),
|
||||
TREGS_OFFSET_NAME(1),
|
||||
TREGS_OFFSET_NAME(2),
|
||||
TREGS_OFFSET_NAME(3),
|
||||
TREGS_OFFSET_NAME(4),
|
||||
TREGS_OFFSET_NAME(5),
|
||||
TREGS_OFFSET_NAME(6),
|
||||
TREGS_OFFSET_NAME(7),
|
||||
REG_OFFSET_END,
|
||||
};
|
||||
|
||||
/*
|
||||
* These are our native regset flavours.
|
||||
*/
|
||||
@ -395,10 +474,9 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
|
||||
asmlinkage int sh64_ptrace(long request, long pid, long addr, long data)
|
||||
{
|
||||
#define WPC_DBRMODE 0x0d104008
|
||||
static int first_call = 1;
|
||||
static unsigned long first_call;
|
||||
|
||||
lock_kernel();
|
||||
if (first_call) {
|
||||
if (!test_and_set_bit(0, &first_call)) {
|
||||
/* Set WPC.DBRMODE to 0. This makes all debug events get
|
||||
* delivered through RESVEC, i.e. into the handlers in entry.S.
|
||||
* (If the kernel was downloaded using a remote gdb, WPC.DBRMODE
|
||||
@ -408,9 +486,7 @@ asmlinkage int sh64_ptrace(long request, long pid, long addr, long data)
|
||||
* the remote gdb.) */
|
||||
printk("DBRMODE set to 0 to permit native debugging\n");
|
||||
poke_real_address_q(WPC_DBRMODE, 0);
|
||||
first_call = 0;
|
||||
}
|
||||
unlock_kernel();
|
||||
|
||||
return sys_ptrace(request, pid, addr, data);
|
||||
}
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include <asm/addrspace.h>
|
||||
#include <asm/reboot.h>
|
||||
#include <asm/system.h>
|
||||
#include <asm/tlbflush.h>
|
||||
|
||||
void (*pm_power_off)(void);
|
||||
EXPORT_SYMBOL(pm_power_off);
|
||||
@ -25,6 +26,9 @@ static void native_machine_restart(char * __unused)
|
||||
{
|
||||
local_irq_disable();
|
||||
|
||||
/* Destroy all of the TLBs in preparation for reset by MMU */
|
||||
__flush_tlb_global();
|
||||
|
||||
/* Address error with SR.BL=1 first. */
|
||||
trigger_address_error();
|
||||
|
||||
|
@ -24,7 +24,6 @@
|
||||
#include <linux/module.h>
|
||||
#include <linux/smp.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/debugfs.h>
|
||||
#include <linux/crash_dump.h>
|
||||
#include <linux/mmzone.h>
|
||||
#include <linux/clk.h>
|
||||
@ -136,8 +135,9 @@ void __init check_for_initrd(void)
|
||||
goto disable;
|
||||
}
|
||||
|
||||
if (unlikely(start < PAGE_OFFSET)) {
|
||||
pr_err("initrd start < PAGE_OFFSET\n");
|
||||
if (unlikely(start < __MEMORY_START)) {
|
||||
pr_err("initrd start (%08lx) < __MEMORY_START(%x)\n",
|
||||
start, __MEMORY_START);
|
||||
goto disable;
|
||||
}
|
||||
|
||||
@ -158,7 +158,7 @@ void __init check_for_initrd(void)
|
||||
/*
|
||||
* Address sanitization
|
||||
*/
|
||||
initrd_start = (unsigned long)__va(__pa(start));
|
||||
initrd_start = (unsigned long)__va(start);
|
||||
initrd_end = initrd_start + INITRD_SIZE;
|
||||
|
||||
memblock_reserve(__pa(initrd_start), INITRD_SIZE);
|
||||
@ -458,17 +458,3 @@ const struct seq_operations cpuinfo_op = {
|
||||
.show = show_cpuinfo,
|
||||
};
|
||||
#endif /* CONFIG_PROC_FS */
|
||||
|
||||
struct dentry *sh_debugfs_root;
|
||||
|
||||
static int __init sh_debugfs_init(void)
|
||||
{
|
||||
sh_debugfs_root = debugfs_create_dir("sh", NULL);
|
||||
if (!sh_debugfs_root)
|
||||
return -ENOMEM;
|
||||
if (IS_ERR(sh_debugfs_root))
|
||||
return PTR_ERR(sh_debugfs_root);
|
||||
|
||||
return 0;
|
||||
}
|
||||
arch_initcall(sh_debugfs_init);
|
||||
|
@ -353,3 +353,25 @@ ENTRY(sys_call_table)
|
||||
.long sys_pwritev
|
||||
.long sys_rt_tgsigqueueinfo /* 335 */
|
||||
.long sys_perf_event_open
|
||||
.long sys_fanotify_init
|
||||
.long sys_fanotify_mark
|
||||
.long sys_prlimit64
|
||||
/* Broken-out socket family */
|
||||
.long sys_socket /* 340 */
|
||||
.long sys_bind
|
||||
.long sys_connect
|
||||
.long sys_listen
|
||||
.long sys_accept
|
||||
.long sys_getsockname /* 345 */
|
||||
.long sys_getpeername
|
||||
.long sys_socketpair
|
||||
.long sys_send
|
||||
.long sys_sendto
|
||||
.long sys_recv /* 350 */
|
||||
.long sys_recvfrom
|
||||
.long sys_shutdown
|
||||
.long sys_setsockopt
|
||||
.long sys_getsockopt
|
||||
.long sys_sendmsg /* 355 */
|
||||
.long sys_recvmsg
|
||||
.long sys_recvmmsg
|
||||
|
@ -393,3 +393,6 @@ sys_call_table:
|
||||
.long sys_perf_event_open
|
||||
.long sys_recvmmsg /* 365 */
|
||||
.long sys_accept4
|
||||
.long sys_fanotify_init
|
||||
.long sys_fanotify_mark
|
||||
.long sys_prlimit64
|
||||
|
@ -5,7 +5,7 @@
|
||||
* SuperH version: Copyright (C) 1999 Niibe Yutaka
|
||||
* Copyright (C) 2000 Philipp Rumpf
|
||||
* Copyright (C) 2000 David Howells
|
||||
* Copyright (C) 2002 - 2007 Paul Mundt
|
||||
* Copyright (C) 2002 - 2010 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
|
||||
@ -26,6 +26,7 @@
|
||||
#include <linux/limits.h>
|
||||
#include <linux/sysfs.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/perf_event.h>
|
||||
#include <asm/system.h>
|
||||
#include <asm/alignment.h>
|
||||
#include <asm/fpu.h>
|
||||
@ -369,7 +370,8 @@ static inline int handle_delayslot(struct pt_regs *regs,
|
||||
#define SH_PC_12BIT_OFFSET(instr) ((((signed short)(instr<<4))>>3) + 4)
|
||||
|
||||
int handle_unaligned_access(insn_size_t instruction, struct pt_regs *regs,
|
||||
struct mem_access *ma, int expected)
|
||||
struct mem_access *ma, int expected,
|
||||
unsigned long address)
|
||||
{
|
||||
u_int rm;
|
||||
int ret, index;
|
||||
@ -383,9 +385,18 @@ int handle_unaligned_access(insn_size_t instruction, struct pt_regs *regs,
|
||||
index = (instruction>>8)&15; /* 0x0F00 */
|
||||
rm = regs->regs[index];
|
||||
|
||||
/* shout about fixups */
|
||||
if (!expected)
|
||||
/*
|
||||
* Log the unexpected fixups, and then pass them on to perf.
|
||||
*
|
||||
* We intentionally don't report the expected cases to perf as
|
||||
* otherwise the trapped I/O case will skew the results too much
|
||||
* to be useful.
|
||||
*/
|
||||
if (!expected) {
|
||||
unaligned_fixups_notify(current, instruction, regs);
|
||||
perf_sw_event(PERF_COUNT_SW_ALIGNMENT_FAULTS, 1, 0,
|
||||
regs, address);
|
||||
}
|
||||
|
||||
ret = -EFAULT;
|
||||
switch (instruction&0xF000) {
|
||||
@ -574,7 +585,8 @@ fixup:
|
||||
|
||||
set_fs(USER_DS);
|
||||
tmp = handle_unaligned_access(instruction, regs,
|
||||
&user_mem_access, 0);
|
||||
&user_mem_access, 0,
|
||||
address);
|
||||
set_fs(oldfs);
|
||||
|
||||
if (tmp == 0)
|
||||
@ -607,8 +619,8 @@ uspace_segv:
|
||||
|
||||
unaligned_fixups_notify(current, instruction, regs);
|
||||
|
||||
handle_unaligned_access(instruction, regs,
|
||||
&user_mem_access, 0);
|
||||
handle_unaligned_access(instruction, regs, &user_mem_access,
|
||||
0, address);
|
||||
set_fs(oldfs);
|
||||
}
|
||||
}
|
||||
@ -802,6 +814,9 @@ void __cpuinit per_cpu_trap_init(void)
|
||||
: /* no output */
|
||||
: "r" (&vbr_base)
|
||||
: "memory");
|
||||
|
||||
/* disable exception blocking now when the vbr has been setup */
|
||||
clear_bl_bit();
|
||||
}
|
||||
|
||||
void *set_exception_table_vec(unsigned int vec, void *handler)
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/sysctl.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/perf_event.h>
|
||||
#include <asm/system.h>
|
||||
#include <asm/uaccess.h>
|
||||
#include <asm/io.h>
|
||||
@ -50,7 +51,7 @@ asmlinkage void do_##name(unsigned long error_code, struct pt_regs *regs) \
|
||||
do_unhandled_exception(trapnr, signr, str, __stringify(name), error_code, regs, current); \
|
||||
}
|
||||
|
||||
spinlock_t die_lock;
|
||||
static DEFINE_SPINLOCK(die_lock);
|
||||
|
||||
void die(const char * str, struct pt_regs * regs, long err)
|
||||
{
|
||||
@ -433,6 +434,8 @@ static int misaligned_load(struct pt_regs *regs,
|
||||
return error;
|
||||
}
|
||||
|
||||
perf_sw_event(PERF_COUNT_SW_ALIGNMENT_FAULTS, 1, 0, regs, address);
|
||||
|
||||
destreg = (opcode >> 4) & 0x3f;
|
||||
if (user_mode(regs)) {
|
||||
__u64 buffer;
|
||||
@ -509,6 +512,8 @@ static int misaligned_store(struct pt_regs *regs,
|
||||
return error;
|
||||
}
|
||||
|
||||
perf_sw_event(PERF_COUNT_SW_ALIGNMENT_FAULTS, 1, 0, regs, address);
|
||||
|
||||
srcreg = (opcode >> 4) & 0x3f;
|
||||
if (user_mode(regs)) {
|
||||
__u64 buffer;
|
||||
@ -583,6 +588,8 @@ static int misaligned_fpu_load(struct pt_regs *regs,
|
||||
return error;
|
||||
}
|
||||
|
||||
perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, 0, regs, address);
|
||||
|
||||
destreg = (opcode >> 4) & 0x3f;
|
||||
if (user_mode(regs)) {
|
||||
__u64 buffer;
|
||||
@ -658,6 +665,8 @@ static int misaligned_fpu_store(struct pt_regs *regs,
|
||||
return error;
|
||||
}
|
||||
|
||||
perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, 0, regs, address);
|
||||
|
||||
srcreg = (opcode >> 4) & 0x3f;
|
||||
if (user_mode(regs)) {
|
||||
__u64 buffer;
|
||||
|
Reference in New Issue
Block a user