Skip to content

Commit

Permalink
Merge branch 'master' into sh/cachetlb
Browse files Browse the repository at this point in the history
Conflicts:
	arch/sh/kernel/Makefile_64
  • Loading branch information
Paul Mundt committed Aug 19, 2009
2 parents 1b3edd9 + e174d13 commit ee8365f
Show file tree
Hide file tree
Showing 61 changed files with 1,277 additions and 571 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 31
EXTRAVERSION = -rc5
EXTRAVERSION = -rc6
NAME = Man-Eating Seals of Antiquity

# *DOCUMENTATION*
Expand Down
9 changes: 5 additions & 4 deletions arch/sh/boards/mach-se/7724/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ static struct platform_device ceu1_device = {
},
};

/* KEYSC */
/* KEYSC in SoC (Needs SW33-2 set to ON) */
static struct sh_keysc_info keysc_info = {
.mode = SH_KEYSC_MODE_1,
.scan_timing = 10,
Expand All @@ -263,12 +263,13 @@ static struct sh_keysc_info keysc_info = {

static struct resource keysc_resources[] = {
[0] = {
.start = 0x1a204000,
.end = 0x1a20400f,
.name = "KEYSC",
.start = 0x044b0000,
.end = 0x044b000f,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = IRQ0_KEY,
.start = 79,
.flags = IORESOURCE_IRQ,
},
};
Expand Down
10 changes: 10 additions & 0 deletions arch/sh/drivers/heartbeat.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,19 @@ static inline void heartbeat_toggle_bit(struct heartbeat_data *hd,
if (inverted)
new = ~new;

new &= hd->mask;

switch (hd->regsize) {
case 32:
new |= ioread32(hd->base) & ~hd->mask;
iowrite32(new, hd->base);
break;
case 16:
new |= ioread16(hd->base) & ~hd->mask;
iowrite16(new, hd->base);
break;
default:
new |= ioread8(hd->base) & ~hd->mask;
iowrite8(new, hd->base);
break;
}
Expand All @@ -72,6 +77,7 @@ static int heartbeat_drv_probe(struct platform_device *pdev)
{
struct resource *res;
struct heartbeat_data *hd;
int i;

if (unlikely(pdev->num_resources != 1)) {
dev_err(&pdev->dev, "invalid number of resources\n");
Expand Down Expand Up @@ -107,6 +113,10 @@ static int heartbeat_drv_probe(struct platform_device *pdev)
hd->nr_bits = ARRAY_SIZE(default_bit_pos);
}

hd->mask = 0;
for (i = 0; i < hd->nr_bits; i++)
hd->mask |= (1 << hd->bit_pos[i]);

if (!hd->regsize)
hd->regsize = 8; /* default access size */

Expand Down
4 changes: 4 additions & 0 deletions arch/sh/include/asm/dwarf.h
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,10 @@ struct dwarf_stack {
#define DW_CFA_lo_user 0x1c
#define DW_CFA_hi_user 0x3f

/* GNU extension opcodes */
#define DW_CFA_GNU_args_size 0x2e
#define DW_CFA_GNU_negative_offset_extended 0x2f

/*
* Some call frame instructions encode their operands in the opcode. We
* need some helper functions to extract both the opcode and operands
Expand Down
1 change: 1 addition & 0 deletions arch/sh/include/asm/heartbeat.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ struct heartbeat_data {
unsigned int nr_bits;
struct timer_list timer;
unsigned int regsize;
unsigned int mask;
unsigned long flags;
};

Expand Down
1 change: 1 addition & 0 deletions arch/sh/include/mach-kfr2r09/mach/partner-jet-setup.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ LIST "setup clocks"
ED 0xa4150004, 0x00000050
ED 0xa4150000, 0x91053508
WAIT 1
ED 0xa4150050, 0x00000340
ED 0xa4150024, 0x00005000

LIST "setup pins"
Expand Down
43 changes: 39 additions & 4 deletions arch/sh/kernel/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,40 @@
ifeq ($(CONFIG_SUPERH32),y)
include ${srctree}/arch/sh/kernel/Makefile_32
else
include ${srctree}/arch/sh/kernel/Makefile_64
#
# Makefile for the Linux/SuperH kernel.
#

extra-y := head_$(BITS).o init_task.o vmlinux.lds

ifdef CONFIG_FUNCTION_TRACER
# Do not profile debug and lowlevel utilities
CFLAGS_REMOVE_ftrace.o = -pg
endif

obj-y := debugtraps.o dumpstack.o idle.o io.o io_generic.o irq.o \
machvec.o process_$(BITS).o ptrace_$(BITS).o setup.o \
signal_$(BITS).o sys_sh.o sys_sh$(BITS).o syscalls_$(BITS).o \
time.o topology.o traps.o traps_$(BITS).o unwinder.o

obj-y += cpu/
obj-$(CONFIG_VSYSCALL) += vsyscall/
obj-$(CONFIG_SMP) += smp.o
obj-$(CONFIG_SH_STANDARD_BIOS) += sh_bios.o
obj-$(CONFIG_KGDB) += kgdb.o
obj-$(CONFIG_SH_CPU_FREQ) += cpufreq.o
obj-$(CONFIG_MODULES) += sh_ksyms_$(BITS).o module.o
obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o
obj-$(CONFIG_CRASH_DUMP) += crash_dump.o
obj-$(CONFIG_STACKTRACE) += stacktrace.o
obj-$(CONFIG_IO_TRAPPED) += io_trapped.o
obj-$(CONFIG_KPROBES) += kprobes.o
obj-$(CONFIG_GENERIC_GPIO) += gpio.o
obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o
obj-$(CONFIG_FTRACE_SYSCALLS) += ftrace.o
obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o
obj-$(CONFIG_DUMP_CODE) += disassemble.o
obj-$(CONFIG_HIBERNATION) += swsusp.o
obj-$(CONFIG_DWARF_UNWINDER) += dwarf.o

obj-$(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST) += localtimer.o

EXTRA_CFLAGS += -Werror
40 changes: 0 additions & 40 deletions arch/sh/kernel/Makefile_32

This file was deleted.

21 changes: 0 additions & 21 deletions arch/sh/kernel/Makefile_64

This file was deleted.

34 changes: 33 additions & 1 deletion arch/sh/kernel/cpu/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* CPU init code
*
* Copyright (C) 2002 - 2007 Paul Mundt
* Copyright (C) 2002 - 2009 Paul Mundt
* Copyright (C) 2003 Richard Curnow
*
* This file is subject to the terms and conditions of the GNU General Public
Expand Down Expand Up @@ -62,6 +62,37 @@ static void __init speculative_execution_init(void)
#define speculative_execution_init() do { } while (0)
#endif

#ifdef CONFIG_CPU_SH4A
#define EXPMASK 0xff2f0004
#define EXPMASK_RTEDS (1 << 0)
#define EXPMASK_BRDSSLP (1 << 1)
#define EXPMASK_MMCAW (1 << 4)

static void __init expmask_init(void)
{
unsigned long expmask = __raw_readl(EXPMASK);

/*
* Future proofing.
*
* Disable support for slottable sleep instruction
* and non-nop instructions in the rte delay slot.
*/
expmask &= ~(EXPMASK_RTEDS | EXPMASK_BRDSSLP);

/*
* Enable associative writes to the memory-mapped cache array
* until the cache flush ops have been rewritten.
*/
expmask |= EXPMASK_MMCAW;

__raw_writel(expmask, EXPMASK);
ctrl_barrier();
}
#else
#define expmask_init() do { } while (0)
#endif

/* 2nd-level cache init */
void __uses_jump_to_uncached __attribute__ ((weak)) l2_cache_init(void)
{
Expand Down Expand Up @@ -319,4 +350,5 @@ asmlinkage void __init sh_cpu_init(void)
#endif

speculative_execution_init();
expmask_init();
}
3 changes: 2 additions & 1 deletion arch/sh/kernel/cpu/sh2/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,9 @@ ENTRY(sh_bios_handler)
mov.l @r15+, r14
add #8,r15
lds.l @r15+, pr
mov.l @r15+,r15
rte
mov.l @r15+,r15
nop
.align 2
1: .long gdb_vbr_vector
#endif /* CONFIG_SH_STANDARD_BIOS */
Expand Down
3 changes: 2 additions & 1 deletion arch/sh/kernel/cpu/sh2a/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,9 @@ ENTRY(sh_bios_handler)
movml.l @r15+,r14
add #8,r15
lds.l @r15+, pr
mov.l @r15+,r15
rte
mov.l @r15+,r15
nop
.align 2
1: .long gdb_vbr_vector
#endif /* CONFIG_SH_STANDARD_BIOS */
Expand Down
8 changes: 8 additions & 0 deletions arch/sh/kernel/cpu/sh3/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,14 @@ ENTRY(handle_interrupt)
bsr save_regs ! needs original pr value in k3
mov #-1, k2 ! default vector kept in k2

stc sr, r0 ! get status register
shlr2 r0
and #0x3c, r0
cmp/eq #0x3c, r0
bf 9f
TRACE_IRQS_OFF
9:

! Setup return address and jump to do_IRQ
mov.l 4f, r9 ! fetch return address
lds r9, pr ! put return address in pr
Expand Down
2 changes: 1 addition & 1 deletion arch/sh/kernel/cpu/sh4a/clock-sh7724.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ struct clk *main_clks[] = {
&div3_clk,
};

static int divisors[] = { 2, 0, 4, 6, 8, 12, 16, 0, 24, 32, 36, 48, 0, 72 };
static int divisors[] = { 2, 3, 4, 6, 8, 12, 16, 0, 24, 32, 36, 48, 0, 72 };

static struct clk_div_mult_table div4_table = {
.divisors = divisors,
Expand Down
11 changes: 11 additions & 0 deletions arch/sh/kernel/cpu/shmobile/cpuidle.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
static unsigned long cpuidle_mode[] = {
SUSP_SH_SLEEP, /* regular sleep mode */
SUSP_SH_SLEEP | SUSP_SH_SF, /* sleep mode + self refresh */
SUSP_SH_STANDBY | SUSP_SH_SF, /* software standby mode + self refresh */
};

static int cpuidle_sleep_enter(struct cpuidle_device *dev,
Expand Down Expand Up @@ -96,6 +97,16 @@ void sh_mobile_setup_cpuidle(void)
state->flags |= CPUIDLE_FLAG_TIME_VALID;
state->enter = cpuidle_sleep_enter;

state = &dev->states[i++];
snprintf(state->name, CPUIDLE_NAME_LEN, "C2");
strncpy(state->desc, "SuperH Mobile Standby Mode [SF]", CPUIDLE_DESC_LEN);
state->exit_latency = 2300;
state->target_residency = 1 * 2;
state->power_usage = 1;
state->flags = 0;
state->flags |= CPUIDLE_FLAG_TIME_VALID;
state->enter = cpuidle_sleep_enter;

dev->state_count = i;

cpuidle_register_device(dev);
Expand Down
16 changes: 2 additions & 14 deletions arch/sh/kernel/cpu/shmobile/pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,11 @@ extern const unsigned int sh_mobile_standby_size;

void sh_mobile_call_standby(unsigned long mode)
{
extern void *vbr_base;
void *onchip_mem = (void *)ILRAM_BASE;
void (*standby_onchip_mem)(unsigned long) = onchip_mem;

/* Note: Wake up from sleep may generate exceptions!
* Setup VBR to point to on-chip ram if self-refresh is
* going to be used.
*/
if (mode & SUSP_SH_SF)
asm volatile("ldc %0, vbr" : : "r" (onchip_mem) : "memory");
void (*standby_onchip_mem)(unsigned long, unsigned long) = onchip_mem;

/* Let assembly snippet in on-chip memory handle the rest */
standby_onchip_mem(mode);

/* Put VBR back in System RAM again */
if (mode & SUSP_SH_SF)
asm volatile("ldc %0, vbr" : : "r" (&vbr_base) : "memory");
standby_onchip_mem(mode, ILRAM_BASE);
}

static int sh_pm_enter(suspend_state_t state)
Expand Down
Loading

0 comments on commit ee8365f

Please sign in to comment.