Commit a80b824f authored by Linus Torvalds's avatar Linus Torvalds

Merge master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6: (26 commits)
  sh: remove dead config symbols from SH code
  sh: Kill off broken snapgear ds1302 code.
  sh: Add a dummy vga.h.
  rtc: rtc-sh: Zero out tm value for invalid rtc states.
  rtc: sh-rtc: Handle rtc_device_register() failure properly.
  sh: Fix heartbeart on Solution Engine series
  sh: Remove SCI_NPORTS from sh-sci.h
  sh: Fix up PAGE_KERNEL_PCC() for nommu.
  sh: hs7751rvoip: Kill off dead IPR IRQ mappings.
  sh: hs7751rvoip: irq.c needs linux/interrupt.h.
  sh: Kill off __{copy,clear}_user_page().
  sh: Optimized copy_{to,from}_user_page() for SH-4.
  sh: Wire up clear_user_highpage().
  sh: Kill off the remaining ST40 cruft.
  superhyway: Handle device_register() retval properly.
  sh: kgdb sysrq depends on magic sysrq.
  sh: Add -Werror for clean directories.
  sh: Fix up kgdb build with modular sh-sci.
  sh: Export __{s,u}divsi3_i4i on all CPUs.
  sh: Fix up kgdb-on-NMI branch target.
  ...
parents 45ff993d 06e5fda1
...@@ -211,10 +211,12 @@ config SH_SOLUTION_ENGINE ...@@ -211,10 +211,12 @@ config SH_SOLUTION_ENGINE
bool "SolutionEngine" bool "SolutionEngine"
select SOLUTION_ENGINE select SOLUTION_ENGINE
select CPU_HAS_IPR_IRQ select CPU_HAS_IPR_IRQ
depends on CPU_SUBTYPE_SH7709 || CPU_SUBTYPE_SH7750 depends on CPU_SUBTYPE_SH7705 || CPU_SUBTYPE_SH7709 || CPU_SUBTYPE_SH7710 || \
CPU_SUBTYPE_SH7712 || CPU_SUBTYPE_SH7750 || CPU_SUBTYPE_SH7750S || \
CPU_SUBTYPE_SH7750R
help help
Select SolutionEngine if configuring for a Hitachi SH7709 Select SolutionEngine if configuring for a Hitachi SH7705, SH7709,
or SH7750 evaluation board. SH7710, SH7712, SH7750, SH7750S or SH7750R evaluation board.
config SH_7206_SOLUTION_ENGINE config SH_7206_SOLUTION_ENGINE
bool "SolutionEngine7206" bool "SolutionEngine7206"
...@@ -603,7 +605,7 @@ config BOOT_LINK_OFFSET ...@@ -603,7 +605,7 @@ config BOOT_LINK_OFFSET
config UBC_WAKEUP config UBC_WAKEUP
bool "Wakeup UBC on startup" bool "Wakeup UBC on startup"
depends on CPU_SH4 depends on CPU_SH4 && !CPU_SH4A
help help
Selecting this option will wakeup the User Break Controller (UBC) on Selecting this option will wakeup the User Break Controller (UBC) on
startup. Although the UBC is left in an awake state when the processor startup. Although the UBC is left in an awake state when the processor
......
...@@ -124,12 +124,13 @@ config KGDB_NMI ...@@ -124,12 +124,13 @@ config KGDB_NMI
config SH_KGDB_CONSOLE config SH_KGDB_CONSOLE
bool "Console messages through GDB" bool "Console messages through GDB"
depends on !SERIAL_SH_SCI_CONSOLE depends on !SERIAL_SH_SCI_CONSOLE && SERIAL_SH_SCI=y
select SERIAL_CORE_CONSOLE select SERIAL_CORE_CONSOLE
default n default n
config KGDB_SYSRQ config KGDB_SYSRQ
bool "Allow SysRq 'G' to enter KGDB" bool "Allow SysRq 'G' to enter KGDB"
depends on MAGIC_SYSRQ
default y default y
comment "Serial port setup" comment "Serial port setup"
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/interrupt.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/hs7751rvoip.h> #include <asm/hs7751rvoip.h>
......
...@@ -15,20 +15,6 @@ ...@@ -15,20 +15,6 @@
#include <asm/io.h> #include <asm/io.h>
#include <asm/machvec.h> #include <asm/machvec.h>
static struct ipr_data hs77501rvoip_ipr_map[] = {
#if defined(CONFIG_HS7751RVOIP_CODEC)
{ DMTE0_IRQ, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY },
{ DMTE1_IRQ, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY },
#endif
};
static void __init hs7751rvoip_init_irq(void)
{
make_ipr_irq(hs77501rvoip_ipr_map, ARRAY_SIZE(hs77501rvoip_ipr_map));
init_hs7751rvoip_IRQ();
}
static void hs7751rvoip_power_off(void) static void hs7751rvoip_power_off(void)
{ {
ctrl_outw(ctrl_inw(PA_OUTPORTR) & 0xffdf, PA_OUTPORTR); ctrl_outw(ctrl_inw(PA_OUTPORTR) & 0xffdf, PA_OUTPORTR);
...@@ -75,14 +61,13 @@ static int __init hs7751rvoip_cf_init(void) ...@@ -75,14 +61,13 @@ static int __init hs7751rvoip_cf_init(void)
return 0; return 0;
} }
device_initcall(hs7751rvoip_cf_init);
/* /*
* Initialize the board * Initialize the board
*/ */
static void __init hs7751rvoip_setup(char **cmdline_p) static void __init hs7751rvoip_setup(char **cmdline_p)
{ {
device_initcall(hs7751rvoip_cf_init);
ctrl_outb(0xf0, PA_OUTPORTR); ctrl_outb(0xf0, PA_OUTPORTR);
pm_power_off = hs7751rvoip_power_off; pm_power_off = hs7751rvoip_power_off;
...@@ -115,6 +100,6 @@ static struct sh_machine_vector mv_hs7751rvoip __initmv = { ...@@ -115,6 +100,6 @@ static struct sh_machine_vector mv_hs7751rvoip __initmv = {
.mv_outsw = hs7751rvoip_outsw, .mv_outsw = hs7751rvoip_outsw,
.mv_outsl = hs7751rvoip_outsl, .mv_outsl = hs7751rvoip_outsl,
.mv_init_irq = hs7751rvoip_init_irq, .mv_init_irq = init_hs7751rvoip_IRQ,
.mv_ioport_map = hs7751rvoip_ioport_map, .mv_ioport_map = hs7751rvoip_ioport_map,
}; };
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include <asm/machvec.h> #include <asm/machvec.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/irq.h>
static struct ipr_data sh7710voipgw_ipr_map[] = { static struct ipr_data sh7710voipgw_ipr_map[] = {
{ TIMER2_IRQ, TIMER2_IPR_ADDR, TIMER2_IPR_POS, TIMER2_PRIORITY }, { TIMER2_IRQ, TIMER2_IPR_ADDR, TIMER2_IPR_POS, TIMER2_PRIORITY },
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/irq.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <asm/se7206.h> #include <asm/se7206.h>
......
...@@ -94,6 +94,7 @@ static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 }; ...@@ -94,6 +94,7 @@ static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
static struct heartbeat_data heartbeat_data = { static struct heartbeat_data heartbeat_data = {
.bit_pos = heartbeat_bit_pos, .bit_pos = heartbeat_bit_pos,
.nr_bits = ARRAY_SIZE(heartbeat_bit_pos), .nr_bits = ARRAY_SIZE(heartbeat_bit_pos),
.regsize = 16,
}; };
static struct resource heartbeat_resources[] = { static struct resource heartbeat_resources[] = {
......
...@@ -16,8 +16,13 @@ ...@@ -16,8 +16,13 @@
#include <asm/machvec.h> #include <asm/machvec.h>
#include <asm/se7722.h> #include <asm/se7722.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/heartbeat.h>
/* Heartbeat */ /* Heartbeat */
static struct heartbeat_data heartbeat_data = {
.regsize = 16,
};
static struct resource heartbeat_resources[] = { static struct resource heartbeat_resources[] = {
[0] = { [0] = {
.start = PA_LED, .start = PA_LED,
...@@ -29,6 +34,9 @@ static struct resource heartbeat_resources[] = { ...@@ -29,6 +34,9 @@ static struct resource heartbeat_resources[] = {
static struct platform_device heartbeat_device = { static struct platform_device heartbeat_device = {
.name = "heartbeat", .name = "heartbeat",
.id = -1, .id = -1,
.dev = {
.platform_data = &heartbeat_data,
},
.num_resources = ARRAY_SIZE(heartbeat_resources), .num_resources = ARRAY_SIZE(heartbeat_resources),
.resource = heartbeat_resources, .resource = heartbeat_resources,
}; };
......
...@@ -14,8 +14,13 @@ ...@@ -14,8 +14,13 @@
#include <asm/machvec.h> #include <asm/machvec.h>
#include <asm/se7780.h> #include <asm/se7780.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/heartbeat.h>
/* Heartbeat */ /* Heartbeat */
static struct heartbeat_data heartbeat_data = {
.regsize = 16,
};
static struct resource heartbeat_resources[] = { static struct resource heartbeat_resources[] = {
[0] = { [0] = {
.start = PA_LED, .start = PA_LED,
...@@ -27,6 +32,9 @@ static struct resource heartbeat_resources[] = { ...@@ -27,6 +32,9 @@ static struct resource heartbeat_resources[] = {
static struct platform_device heartbeat_device = { static struct platform_device heartbeat_device = {
.name = "heartbeat", .name = "heartbeat",
.id = -1, .id = -1,
.dev = {
.platform_data = &heartbeat_data,
},
.num_resources = ARRAY_SIZE(heartbeat_resources), .num_resources = ARRAY_SIZE(heartbeat_resources),
.resource = heartbeat_resources, .resource = heartbeat_resources,
}; };
......
...@@ -2,5 +2,4 @@ ...@@ -2,5 +2,4 @@
# Makefile for the SnapGear specific parts of the kernel # Makefile for the SnapGear specific parts of the kernel
# #
obj-y := setup.o io.o rtc.o obj-y := setup.o io.o
/****************************************************************************/
/*
* linux/arch/sh/boards/snapgear/rtc.c -- Secureedge5410 RTC code
*
* Copyright (C) 2002 David McCullough <davidm@snapgear.com>
* Copyright (C) 2003 Paul Mundt <lethal@linux-sh.org>
*
* The SecureEdge5410 can have one of 2 real time clocks, the SH
* built in version or the preferred external DS1302. Here we work out
* each to see what we have and then run with it.
*/
/****************************************************************************/
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/time.h>
#include <linux/rtc.h>
#include <linux/mc146818rtc.h>
#include <asm/io.h>
static int use_ds1302;
/****************************************************************************/
/*
* we need to implement a DS1302 driver here that can operate in
* conjunction with the builtin rtc driver which is already quite friendly
*/
/*****************************************************************************/
#define RTC_CMD_READ 0x81 /* Read command */
#define RTC_CMD_WRITE 0x80 /* Write command */
#define RTC_ADDR_YEAR 0x06 /* Address of year register */
#define RTC_ADDR_DAY 0x05 /* Address of day of week register */
#define RTC_ADDR_MON 0x04 /* Address of month register */
#define RTC_ADDR_DATE 0x03 /* Address of day of month register */
#define RTC_ADDR_HOUR 0x02 /* Address of hour register */
#define RTC_ADDR_MIN 0x01 /* Address of minute register */
#define RTC_ADDR_SEC 0x00 /* Address of second register */
#define RTC_RESET 0x1000
#define RTC_IODATA 0x0800
#define RTC_SCLK 0x0400
#define set_dirp(x)
#define get_dirp(x) 0
#define set_dp(x) SECUREEDGE_WRITE_IOPORT(x, 0x1c00)
#define get_dp(x) SECUREEDGE_READ_IOPORT()
static void ds1302_sendbits(unsigned int val)
{
int i;
for (i = 8; (i); i--, val >>= 1) {
set_dp((get_dp() & ~RTC_IODATA) | ((val & 0x1) ? RTC_IODATA : 0));
set_dp(get_dp() | RTC_SCLK); // clock high
set_dp(get_dp() & ~RTC_SCLK); // clock low
}
}
static unsigned int ds1302_recvbits(void)
{
unsigned int val;
int i;
for (i = 0, val = 0; (i < 8); i++) {
val |= (((get_dp() & RTC_IODATA) ? 1 : 0) << i);
set_dp(get_dp() | RTC_SCLK); // clock high
set_dp(get_dp() & ~RTC_SCLK); // clock low
}
return(val);
}
static unsigned int ds1302_readbyte(unsigned int addr)
{
unsigned int val;
unsigned long flags;
local_irq_save(flags);
set_dirp(get_dirp() | RTC_RESET | RTC_IODATA | RTC_SCLK);
set_dp(get_dp() & ~(RTC_RESET | RTC_IODATA | RTC_SCLK));
set_dp(get_dp() | RTC_RESET);
ds1302_sendbits(((addr & 0x3f) << 1) | RTC_CMD_READ);
set_dirp(get_dirp() & ~RTC_IODATA);
val = ds1302_recvbits();
set_dp(get_dp() & ~RTC_RESET);
local_irq_restore(flags);
return(val);
}
static void ds1302_writebyte(unsigned int addr, unsigned int val)
{
unsigned long flags;
local_irq_save(flags);
set_dirp(get_dirp() | RTC_RESET | RTC_IODATA | RTC_SCLK);
set_dp(get_dp() & ~(RTC_RESET | RTC_IODATA | RTC_SCLK));
set_dp(get_dp() | RTC_RESET);
ds1302_sendbits(((addr & 0x3f) << 1) | RTC_CMD_WRITE);
ds1302_sendbits(val);
set_dp(get_dp() & ~RTC_RESET);
local_irq_restore(flags);
}
static void ds1302_reset(void)
{
unsigned long flags;
/* Hardware dependent reset/init */
local_irq_save(flags);
set_dirp(get_dirp() | RTC_RESET | RTC_IODATA | RTC_SCLK);
set_dp(get_dp() & ~(RTC_RESET | RTC_IODATA | RTC_SCLK));
local_irq_restore(flags);
}
/*****************************************************************************/
static inline int bcd2int(int val)
{
return((((val & 0xf0) >> 4) * 10) + (val & 0xf));
}
static inline int int2bcd(int val)
{
return(((val / 10) << 4) + (val % 10));
}
/*****************************************************************************/
/*
* Write and Read some RAM in the DS1302, if it works assume it's there
* Otherwise use the SH4 internal RTC
*/
void snapgear_rtc_gettimeofday(struct timespec *);
int snapgear_rtc_settimeofday(const time_t);
void __init secureedge5410_rtc_init(void)
{
unsigned char *test = "snapgear";
int i;
ds1302_reset();
use_ds1302 = 1;
for (i = 0; test[i]; i++)
ds1302_writebyte(32 + i, test[i]);
for (i = 0; test[i]; i++)
if (ds1302_readbyte(32 + i) != test[i]) {
use_ds1302 = 0;
break;
}
if (use_ds1302) {
rtc_sh_get_time = snapgear_rtc_gettimeofday;
rtc_sh_set_time = snapgear_rtc_settimeofday;
}
printk("SnapGear RTC: using %s rtc.\n", use_ds1302 ? "ds1302" : "internal");
}
/****************************************************************************/
/*
* our generic interface that chooses the correct code to use
*/
void snapgear_rtc_gettimeofday(struct timespec *ts)
{
unsigned int sec, min, hr, day, mon, yr;
if (!use_ds1302)
return;
sec = bcd2int(ds1302_readbyte(RTC_ADDR_SEC));
min = bcd2int(ds1302_readbyte(RTC_ADDR_MIN));
hr = bcd2int(ds1302_readbyte(RTC_ADDR_HOUR));
day = bcd2int(ds1302_readbyte(RTC_ADDR_DATE));
mon = bcd2int(ds1302_readbyte(RTC_ADDR_MON));
yr = bcd2int(ds1302_readbyte(RTC_ADDR_YEAR));
bad_time:
if (yr > 99 || mon < 1 || mon > 12 || day > 31 || day < 1 ||
hr > 23 || min > 59 || sec > 59) {
printk(KERN_ERR
"SnapGear RTC: invalid value, resetting to 1 Jan 2000\n");
ds1302_writebyte(RTC_ADDR_MIN, min = 0);
ds1302_writebyte(RTC_ADDR_HOUR, hr = 0);
ds1302_writebyte(RTC_ADDR_DAY, 7);
ds1302_writebyte(RTC_ADDR_DATE, day = 1);
ds1302_writebyte(RTC_ADDR_MON, mon = 1);
ds1302_writebyte(RTC_ADDR_YEAR, yr = 0);
ds1302_writebyte(RTC_ADDR_SEC, sec = 0);
}
ts->tv_sec = mktime(2000 + yr, mon, day, hr, min, sec);
if (ts->tv_sec < 0) {
#if 0
printk("BAD TIME %d %d %d %d %d %d\n", yr, mon, day, hr, min, sec);
#endif
yr = 100;
goto bad_time;
}
ts->tv_nsec = 0;
}
int snapgear_rtc_settimeofday(const time_t secs)
{
int retval = 0;
int real_seconds, real_minutes, cmos_minutes;
unsigned long nowtime;
if (!use_ds1302)
return 0;
/*
* This is called direct from the kernel timer handling code.
* It is supposed to synchronize the kernel clock to the RTC.
*/
nowtime = secs;
/* STOP RTC */
ds1302_writebyte(RTC_ADDR_SEC, ds1302_readbyte(RTC_ADDR_SEC) | 0x80);
cmos_minutes = bcd2int(ds1302_readbyte(RTC_ADDR_MIN));
/*
* since we're only adjusting minutes and seconds,
* don't interfere with hour overflow. This avoids
* messing with unknown time zones but requires your
* RTC not to be off by more than 15 minutes
*/
real_seconds = nowtime % 60;
real_minutes = nowtime / 60;
if (((abs(real_minutes - cmos_minutes) + 15)/30) & 1)
real_minutes += 30; /* correct for half hour time zone */
real_minutes %= 60;
if (abs(real_minutes - cmos_minutes) < 30) {
ds1302_writebyte(RTC_ADDR_MIN, int2bcd(real_minutes));
ds1302_writebyte(RTC_ADDR_SEC, int2bcd(real_seconds));
} else {
printk(KERN_WARNING
"SnapGear RTC: can't update from %d to %d\n",
cmos_minutes, real_minutes);
retval = -1;
}
/* START RTC */
ds1302_writebyte(RTC_ADDR_SEC, ds1302_readbyte(RTC_ADDR_SEC) & ~0x80);
return(0);
}
unsigned char secureedge5410_cmos_read(int addr)
{
unsigned char val = 0;
if (!use_ds1302)
return(__CMOS_READ(addr, w));
switch(addr) {
case RTC_SECONDS: val = ds1302_readbyte(RTC_ADDR_SEC); break;
case RTC_SECONDS_ALARM: break;
case RTC_MINUTES: val = ds1302_readbyte(RTC_ADDR_MIN); break;
case RTC_MINUTES_ALARM: break;
case RTC_HOURS: val = ds1302_readbyte(RTC_ADDR_HOUR); break;
case RTC_HOURS_ALARM: break;
case RTC_DAY_OF_WEEK: val = ds1302_readbyte(RTC_ADDR_DAY); break;
case RTC_DAY_OF_MONTH: val = ds1302_readbyte(RTC_ADDR_DATE); break;
case RTC_MONTH: val = ds1302_readbyte(RTC_ADDR_MON); break;
case RTC_YEAR: val = ds1302_readbyte(RTC_ADDR_YEAR); break;
case RTC_REG_A: /* RTC_FREQ_SELECT */ break;
case RTC_REG_B: /* RTC_CONTROL */ break;
case RTC_REG_C: /* RTC_INTR_FLAGS */ break;
case RTC_REG_D: val = RTC_VRT /* RTC_VALID */; break;
default: break;
}
return(val);
}
void secureedge5410_cmos_write(unsigned char val, int addr)
{
if (!use_ds1302) {
__CMOS_WRITE(val, addr, w);
return;
}
switch(addr) {
case RTC_SECONDS: ds1302_writebyte(RTC_ADDR_SEC, val); break;
case RTC_SECONDS_ALARM: break;
case RTC_MINUTES: ds1302_writebyte(RTC_ADDR_MIN, val); break;
case RTC_MINUTES_ALARM: break;
case RTC_HOURS: ds1302_writebyte(RTC_ADDR_HOUR, val); break;
case RTC_HOURS_ALARM: break;
case RTC_DAY_OF_WEEK: ds1302_writebyte(RTC_ADDR_DAY, val); break;
case RTC_DAY_OF_MONTH: ds1302_writebyte(RTC_ADDR_DATE, val); break;
case RTC_MONTH: ds1302_writebyte(RTC_ADDR_MON, val); break;
case RTC_YEAR: ds1302_writebyte(RTC_ADDR_YEAR, val); break;
case RTC_REG_A: /* RTC_FREQ_SELECT */ break;
case RTC_REG_B: /* RTC_CONTROL */ break;
case RTC_REG_C: /* RTC_INTR_FLAGS */ break;
case RTC_REG_D: /* RTC_VALID */ break;
default: break;
}
}
...@@ -22,20 +22,15 @@ ...@@ -22,20 +22,15 @@
#include <asm/snapgear.h> #include <asm/snapgear.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/rtc.h>
#include <asm/cpu/timer.h> #include <asm/cpu/timer.h>
extern void secureedge5410_rtc_init(void);
extern void pcibios_init(void);
/****************************************************************************/
/* /*
* EraseConfig handling functions * EraseConfig handling functions
*/ */
static irqreturn_t eraseconfig_interrupt(int irq, void *dev_id) static irqreturn_t eraseconfig_interrupt(int irq, void *dev_id)
{ {
volatile char dummy __attribute__((unused)) = * (volatile char *) 0xb8000000; (void)ctrl_inb(0xb8000000); /* dummy read */
printk("SnapGear: erase switch interrupt!\n"); printk("SnapGear: erase switch interrupt!\n");
...@@ -75,20 +70,11 @@ static void __init init_snapgear_IRQ(void) ...@@ -75,20 +70,11 @@ static void __init init_snapgear_IRQ(void)
plat_irq_setup_pins(IRQ_MODE_IRQ); plat_irq_setup_pins(IRQ_MODE_IRQ);
} }
/*
* Initialize the board
*/
static void __init snapgear_setup(char **cmdline_p)
{
board_time_init = secureedge5410_rtc_init;
}
/* /*
* The Machine Vector * The Machine Vector
*/ */
static struct sh_machine_vector mv_snapgear __initmv = { static struct sh_machine_vector mv_snapgear __initmv = {
.mv_name = "SnapGear SecureEdge5410", .mv_name = "SnapGear SecureEdge5410",
.mv_setup = snapgear_setup,
.mv_nr_irqs = 72, .mv_nr_irqs = 72,
.mv_inb = snapgear_inb, .mv_inb = snapgear_inb,
......
...@@ -39,7 +39,7 @@ KERNEL_LOAD := $(shell /bin/bash -c 'printf "0x%8x" \ ...@@ -39,7 +39,7 @@ KERNEL_LOAD := $(shell /bin/bash -c 'printf "0x%8x" \
quiet_cmd_uimage = UIMAGE $@ quiet_cmd_uimage = UIMAGE $@
cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A sh -O linux -T kernel \ cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A sh -O linux -T kernel \
-C gzip -a $(KERNEL_LOAD) -e $(KERNEL_LOAD) \ -C none -a $(KERNEL_LOAD) -e $(KERNEL_LOAD) \
-n 'Linux-$(KERNELRELEASE)' -d $< $@ -n 'Linux-$(KERNELRELEASE)' -d $< $@
$(obj)/uImage: $(obj)/zImage FORCE $(obj)/uImage: $(obj)/zImage FORCE
......
obj-$(CONFIG_HD64461) += hd64461.o obj-$(CONFIG_HD64461) += hd64461.o
obj-$(CONFIG_HD64465) += hd64465/ obj-$(CONFIG_HD64465) += hd64465/
EXTRA_CFLAGS += -Werror
...@@ -6,3 +6,4 @@ obj-y := irq.o setup.o ...@@ -6,3 +6,4 @@ obj-y := irq.o setup.o
obj-$(CONFIG_USB_OHCI_HCD) += consistent.o obj-$(CONFIG_USB_OHCI_HCD) += consistent.o
EXTRA_CFLAGS += -Werror
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
obj-y += pci.o obj-y += pci.o
obj-$(CONFIG_PCI_AUTO) += pci-auto.o obj-$(CONFIG_PCI_AUTO) += pci-auto.o
obj-$(CONFIG_CPU_SUBTYPE_ST40STB1) += pci-st40.o
obj-$(CONFIG_CPU_SUBTYPE_SH7751) += pci-sh7751.o ops-sh4.o obj-$(CONFIG_CPU_SUBTYPE_SH7751) += pci-sh7751.o ops-sh4.o
obj-$(CONFIG_CPU_SUBTYPE_SH7751R) += pci-sh7751.o ops-sh4.o obj-$(CONFIG_CPU_SUBTYPE_SH7751R) += pci-sh7751.o ops-sh4.o
obj-$(CONFIG_CPU_SUBTYPE_SH7780) += pci-sh7780.o ops-sh4.o obj-$(CONFIG_CPU_SUBTYPE_SH7780) += pci-sh7780.o ops-sh4.o
......
This diff is collapsed.
/*
* Copyright (C) 2001 David J. Mckay (david.mckay@st.com)
*
* May be copied or modified under the terms of the GNU General Public
* License. See linux/COPYING for more information.
*
* Definitions for the ST40 PCI hardware.
*/
#ifndef __PCI_ST40_H__
#define __PCI_ST40_H__
#define ST40PCI_VCR_STATUS 0x00
#define ST40PCI_VCR_VERSION 0x08
#define ST40PCI_CR 0x10
#define CR_SOFT_RESET (1<<12)
#define CR_PFCS (1<<11)
#define CR_PFE (1<<9)
#define CR_BMAM (1<<6)
#define CR_HOST (1<<5)
#define CR_CLKEN (1<<4)
#define CR_SOCS (1<<3)
#define CR_IOCS (1<<2)
#define CR_RSTCTL (1<<1)
#define CR_CFINT (1<<0)
#define CR_LOCK_MASK 0x5a000000
#define ST40PCI_LSR0 0X14
#define ST40PCI_LAR0 0x1c
#define ST40PCI_INT 0x24
#define INT_MNLTDIM (1<<15)
#define INT_TTADI (1<<14)
#define INT_TMTO (1<<9)
#define INT_MDEI (1<<8)
#define INT_APEDI (1<<7)
#define INT_SDI (1<<6)
#define INT_DPEITW (1<<5)
#define INT_PEDITR (1<<4)
#define INT_TADIM (1<<3)
#define INT_MADIM (1<<2)
#define INT_MWPDI (1<<1)
#define INT_MRDPEI (1<<0)
#define ST40PCI_INTM 0x28
#define ST40PCI_AIR 0x2c
#define ST40PCI_CIR 0x30
#define CIR_PIOTEM (1<<31)
#define CIR_RWTET (1<<26)
#define ST40PCI_AINT 0x40
#define AINT_MBI (1<<13)
#define AINT_TBTOI (1<<12)
#define AINT_MBTOI (1<<11)
#define AINT_TAI (1<<3)
#define AINT_MAI (1<<2)
#define AINT_RDPEI (1<<1)
#define AINT_WDPE (1<<0)
#define ST40PCI_AINTM 0x44
#define ST40PCI_BMIR 0x48
#define ST40PCI_PAR 0x4c
#define ST40PCI_MBR 0x50
#define ST40PCI_IOBR 0x54
#define ST40PCI_PINT 0x58
#define ST40PCI_PINTM 0x5c
#define ST40PCI_MBMR 0x70
#define ST40PCI_IOBMR 0x74
#define ST40PCI_PDR 0x78
/* H8 specific registers start here */
#define ST40PCI_WCBAR 0x7c
#define ST40PCI_LOCCFG_UNLOCK 0x34
#define ST40PCI_RBAR0 0x100
#define ST40PCI_RSR0 0x104
#define ST40PCI_RLAR0 0x108
#define ST40PCI_RBAR1 0x110
#define ST40PCI_RSR1 0x114
#define ST40PCI_RLAR1 0x118
#define ST40PCI_RBAR2 0x120
#define ST40PCI_RSR2 0x124
#define ST40PCI_RLAR2 0x128
#define ST40PCI_RBAR3 0x130
#define ST40PCI_RSR3 0x134
#define ST40PCI_RLAR3 0x138
#define ST40PCI_RBAR4 0x140
#define ST40PCI_RSR4 0x144
#define ST40PCI_RLAR4 0x148
#define ST40PCI_RBAR5 0x150
#define ST40PCI_RSR5 0x154
#define ST40PCI_RLAR5 0x158
#define ST40PCI_RBAR6 0x160
#define ST40PCI_RSR6 0x164
#define ST40PCI_RLAR6 0x168
#define ST40PCI_RBAR7 0x170
#define ST40PCI_RSR7 0x174
#define ST40PCI_RLAR7 0x178
#define ST40PCI_RBAR(n) (0x100+(0x10*(n)))
#define ST40PCI_RSR(n) (0x104+(0x10*(n)))
#define ST40PCI_RLAR(n) (0x108+(0x10*(n)))
#define ST40PCI_PERF 0x80
#define PERF_MASTER_WRITE_POSTING (1<<4)
/* H8 specific registers end here */
/* These are configs space registers */
#define ST40PCI_CSR_VID 0x10000
#define ST40PCI_CSR_DID 0x10002
#define ST40PCI_CSR_CMD 0x10004
#define ST40PCI_CSR_STATUS 0x10006
#define ST40PCI_CSR_MBAR0 0x10010
#define ST40PCI_CSR_TRDY 0x10040
#define ST40PCI_CSR_RETRY 0x10041
#define ST40PCI_CSR_MIT 0x1000d
#define ST40_IO_ADDR 0xb6000000
#endif /* __PCI_ST40_H__ */
...@@ -10,7 +10,6 @@ obj-y := debugtraps.o io.o io_generic.o irq.o machvec.o process.o ptrace.o \ ...@@ -10,7 +10,6 @@ obj-y := debugtraps.o io.o io_generic.o irq.o machvec.o process.o ptrace.o \
obj-y += cpu/ timers/ obj-y += cpu/ timers/
obj-$(CONFIG_VSYSCALL) += vsyscall/ obj-$(CONFIG_VSYSCALL) += vsyscall/
obj-$(CONFIG_SMP) += smp.o obj-$(CONFIG_SMP) += smp.o
obj-$(CONFIG_CF_ENABLER) += cf-enabler.o obj-$(CONFIG_CF_ENABLER) += cf-enabler.o
obj-$(CONFIG_SH_STANDARD_BIOS) += sh_bios.o obj-$(CONFIG_SH_STANDARD_BIOS) += sh_bios.o
...@@ -22,3 +21,5 @@ obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o ...@@ -22,3 +21,5 @@ obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o
obj-$(CONFIG_CRASH_DUMP) += crash_dump.o obj-$(CONFIG_CRASH_DUMP) += crash_dump.o
obj-$(CONFIG_PM) += pm.o obj-$(CONFIG_PM) += pm.o
obj-$(CONFIG_STACKTRACE) += stacktrace.o obj-$(CONFIG_STACKTRACE) += stacktrace.o
EXTRA_CFLAGS += -Werror
...@@ -46,7 +46,7 @@ ENTRY(exception_handling_table) ...@@ -46,7 +46,7 @@ ENTRY(exception_handling_table)
.long exception_error ! illegal_slot_instruction (filled by trap_init) /*1A0*/ .long exception_error ! illegal_slot_instruction (filled by trap_init) /*1A0*/
ENTRY(nmi_slot) ENTRY(nmi_slot)
#if defined (CONFIG_KGDB_NMI) #if defined (CONFIG_KGDB_NMI)
.long debug_enter /* 1C0 */ ! Allow trap to debugger .long kgdb_handle_exception /* 1C0 */ ! Allow trap to debugger
#else #else
.long exception_none /* 1C0 */ ! Not implemented yet .long exception_none /* 1C0 */ ! Not implemented yet
#endif #endif
......
...@@ -139,14 +139,6 @@ int __init detect_cpu_and_cache_system(void) ...@@ -139,14 +139,6 @@ int __init detect_cpu_and_cache_system(void)
boot_cpu_data.flags |= CPU_HAS_FPU | CPU_HAS_PERF_COUNTER | boot_cpu_data.flags |= CPU_HAS_FPU | CPU_HAS_PERF_COUNTER |
CPU_HAS_LLSC; CPU_HAS_LLSC;
break; break;
case 0x8000:
boot_cpu_data.type = CPU_ST40RA;
boot_cpu_data.flags |= CPU_HAS_FPU;
break;
case 0x8100:
boot_cpu_data.type = CPU_ST40GX1;
boot_cpu_data.flags |= CPU_HAS_FPU;
break;
case 0x700: case 0x700:
boot_cpu_data.type = CPU_SH4_501; boot_cpu_data.type = CPU_SH4_501;
boot_cpu_data.icache.ways = 2; boot_cpu_data.icache.ways = 2;
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/kernel_stat.h> #include <linux/kernel_stat.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/irq.h>
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/machvec.h> #include <asm/machvec.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
......
...@@ -102,6 +102,7 @@ ...@@ -102,6 +102,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/console.h> #include <linux/console.h>
#include <linux/sysrq.h> #include <linux/sysrq.h>
#include <linux/module.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
#include <asm/current.h> #include <asm/current.h>
...@@ -116,7 +117,9 @@ kgdb_debug_hook_t *kgdb_debug_hook; ...@@ -116,7 +117,9 @@ kgdb_debug_hook_t *kgdb_debug_hook;
kgdb_bus_error_hook_t *kgdb_bus_err_hook; kgdb_bus_error_hook_t *kgdb_bus_err_hook;
int (*kgdb_getchar)(void); int (*kgdb_getchar)(void);
EXPORT_SYMBOL_GPL(kgdb_getchar);
void (*kgdb_putchar)(int); void (*kgdb_putchar)(int);
EXPORT_SYMBOL_GPL(kgdb_putchar);
static void put_debug_char(int c) static void put_debug_char(int c)
{ {
...@@ -136,7 +139,7 @@ static int get_debug_char(void) ...@@ -136,7 +139,7 @@ static int get_debug_char(void)
#define NUMREGBYTES (MAXREG*4) #define NUMREGBYTES (MAXREG*4)
#define OUTBUFMAX (NUMREGBYTES*2+512) #define OUTBUFMAX (NUMREGBYTES*2+512)
enum regs { enum {
R0 = 0, R1, R2, R3, R4, R5, R6, R7, R0 = 0, R1, R2, R3, R4, R5, R6, R7,
R8, R9, R10, R11, R12, R13, R14, R15, R8, R9, R10, R11, R12, R13, R14, R15,
PC, PR, GBR, VBR, MACH, MACL, SR, PC, PR, GBR, VBR, MACH, MACL, SR,
...@@ -176,9 +179,13 @@ int kgdb_nofault; /* Boolean to ignore bus errs (i.e. in GDB) */ ...@@ -176,9 +179,13 @@ int kgdb_nofault; /* Boolean to ignore bus errs (i.e. in GDB) */
/* SCI/UART settings, used in kgdb_console_setup() */ /* SCI/UART settings, used in kgdb_console_setup() */
int kgdb_portnum = CONFIG_KGDB_DEFPORT; int kgdb_portnum = CONFIG_KGDB_DEFPORT;
EXPORT_SYMBOL_GPL(kgdb_portnum);
int kgdb_baud = CONFIG_KGDB_DEFBAUD; int kgdb_baud = CONFIG_KGDB_DEFBAUD;
EXPORT_SYMBOL_GPL(kgdb_baud);
char kgdb_parity = CONFIG_KGDB_DEFPARITY; char kgdb_parity = CONFIG_KGDB_DEFPARITY;
EXPORT_SYMBOL_GPL(kgdb_parity);
char kgdb_bits = CONFIG_KGDB_DEFBITS; char kgdb_bits = CONFIG_KGDB_DEFBITS;
EXPORT_SYMBOL_GPL(kgdb_bits);
/* Jump buffer for setjmp/longjmp */ /* Jump buffer for setjmp/longjmp */
static jmp_buf rem_com_env; static jmp_buf rem_com_env;
......
...@@ -303,7 +303,6 @@ static const char *cpu_name[] = { ...@@ -303,7 +303,6 @@ static const char *cpu_name[] = {
[CPU_SH7750S] = "SH7750S", [CPU_SH7750R] = "SH7750R", [CPU_SH7750S] = "SH7750S", [CPU_SH7750R] = "SH7750R",
[CPU_SH7751] = "SH7751", [CPU_SH7751R] = "SH7751R", [CPU_SH7751] = "SH7751", [CPU_SH7751R] = "SH7751R",
[CPU_SH7760] = "SH7760", [CPU_SH7760] = "SH7760",
[CPU_ST40RA] = "ST40RA", [CPU_ST40GX1] = "ST40GX1",
[CPU_SH4_202] = "SH4-202", [CPU_SH4_501] = "SH4-501", [CPU_SH4_202] = "SH4-202", [CPU_SH4_501] = "SH4-501",
[CPU_SH7770] = "SH7770", [CPU_SH7780] = "SH7780", [CPU_SH7770] = "SH7770", [CPU_SH7780] = "SH7780",
[CPU_SH7781] = "SH7781", [CPU_SH7343] = "SH7343", [CPU_SH7781] = "SH7781", [CPU_SH7343] = "SH7343",
......
...@@ -106,7 +106,6 @@ DECLARE_EXPORT(__movmem); ...@@ -106,7 +106,6 @@ DECLARE_EXPORT(__movmem);
DECLARE_EXPORT(__movstr); DECLARE_EXPORT(__movstr);
#endif #endif
#ifdef CONFIG_CPU_SH4
#if __GNUC__ == 4 #if __GNUC__ == 4
DECLARE_EXPORT(__movmem_i4_even); DECLARE_EXPORT(__movmem_i4_even);
DECLARE_EXPORT(__movmem_i4_odd); DECLARE_EXPORT(__movmem_i4_odd);
...@@ -126,7 +125,6 @@ DECLARE_EXPORT(__movstr_i4_even); ...@@ -126,7 +125,6 @@ DECLARE_EXPORT(__movstr_i4_even);
DECLARE_EXPORT(__movstr_i4_odd); DECLARE_EXPORT(__movstr_i4_odd);
DECLARE_EXPORT(__movstrSI12_i4); DECLARE_EXPORT(__movstrSI12_i4);
#endif /* __GNUC__ == 4 */ #endif /* __GNUC__ == 4 */
#endif
#if !defined(CONFIG_CACHE_OFF) && (defined(CONFIG_CPU_SH4) || \ #if !defined(CONFIG_CACHE_OFF) && (defined(CONFIG_CPU_SH4) || \
defined(CONFIG_SH7705_CACHE_32KB)) defined(CONFIG_SH7705_CACHE_32KB))
......
...@@ -9,3 +9,5 @@ memcpy-y := memcpy.o ...@@ -9,3 +9,5 @@ memcpy-y := memcpy.o
memcpy-$(CONFIG_CPU_SH4) := memcpy-sh4.o memcpy-$(CONFIG_CPU_SH4) := memcpy-sh4.o
lib-y += $(memcpy-y) lib-y += $(memcpy-y)
EXTRA_CFLAGS += -Werror
...@@ -17,7 +17,7 @@ config CPU_SH4 ...@@ -17,7 +17,7 @@ config CPU_SH4
bool bool
select CPU_HAS_INTEVT select CPU_HAS_INTEVT
select CPU_HAS_SR_RB select CPU_HAS_SR_RB
select CPU_HAS_PTEA if (!CPU_SUBTYPE_ST40 && !CPU_SH4A) || CPU_SHX2 select CPU_HAS_PTEA if !CPU_SH4A || CPU_SHX2
select CPU_HAS_FPU if !CPU_SH4AL_DSP select CPU_HAS_FPU if !CPU_SH4AL_DSP
config CPU_SH4A config CPU_SH4A
...@@ -29,10 +29,6 @@ config CPU_SH4AL_DSP ...@@ -29,10 +29,6 @@ config CPU_SH4AL_DSP
select CPU_SH4A select CPU_SH4A
select CPU_HAS_DSP select CPU_HAS_DSP
config CPU_SUBTYPE_ST40
bool
select CPU_SH4
config CPU_SHX2 config CPU_SHX2
bool bool
...@@ -152,21 +148,6 @@ config CPU_SUBTYPE_SH4_202 ...@@ -152,21 +148,6 @@ config CPU_SUBTYPE_SH4_202
bool "Support SH4-202 processor" bool "Support SH4-202 processor"
select CPU_SH4 select CPU_SH4
# ST40 Processor Support
config CPU_SUBTYPE_ST40STB1
bool "Support ST40STB1/ST40RA processors"
select CPU_SUBTYPE_ST40
help
Select ST40STB1 if you have a ST40RA CPU.
This was previously called the ST40STB1, hence the option name.
config CPU_SUBTYPE_ST40GX1
bool "Support ST40GX1 processor"
select CPU_SUBTYPE_ST40
help
Select ST40GX1 if you have a ST40GX1 CPU.
# SH-4A Processor Support # SH-4A Processor Support
config CPU_SUBTYPE_SH7770 config CPU_SUBTYPE_SH7770
......
...@@ -33,3 +33,5 @@ endif ...@@ -33,3 +33,5 @@ endif
obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
obj-$(CONFIG_32BIT) += pmb.o obj-$(CONFIG_32BIT) += pmb.o
obj-$(CONFIG_NUMA) += numa.o obj-$(CONFIG_NUMA) += numa.o
EXTRA_CFLAGS += -Werror
...@@ -150,48 +150,3 @@ ENTRY(__clear_user) ...@@ -150,48 +150,3 @@ ENTRY(__clear_user)
.long 8b, .Lbad_clear_user .long 8b, .Lbad_clear_user
.long 9b, .Lbad_clear_user .long 9b, .Lbad_clear_user
.previous .previous
#if defined(CONFIG_CPU_SH4)
/*
* __clear_user_page
* @to: P3 address (with same color)
* @orig_to: P1 address
*
* void __clear_user_page(void *to, void *orig_to)
*/
/*
* r0 --- scratch
* r4 --- to
* r5 --- orig_to
* r6 --- to + PAGE_SIZE
*/
ENTRY(__clear_user_page)
mov.l .Lpsz,r0
mov r4,r6
add r0,r6
mov #0,r0
!
1: ocbi @r5
add #32,r5
movca.l r0,@r4
mov r4,r1
add #32,r4
mov.l r0,@-r4
mov.l r0,@-r4
mov.l r0,@-r4
mov.l r0,@-r4
mov.l r0,@-r4
mov.l r0,@-r4
mov.l r0,@-r4
add #28,r4
cmp/eq r6,r4
bf/s 1b
ocbwb @r1
!
rts
nop
.Lpsz: .long PAGE_SIZE
#endif
...@@ -68,67 +68,6 @@ ENTRY(copy_page_slow) ...@@ -68,67 +68,6 @@ ENTRY(copy_page_slow)
rts rts
nop nop
#if defined(CONFIG_CPU_SH4)
/*
* __copy_user_page
* @to: P1 address (with same color)
* @from: P1 address
* @orig_to: P1 address
*
* void __copy_user_page(void *to, void *from, void *orig_to)
*/
/*
* r0, r1, r2, r3, r4, r5, r6, r7 --- scratch
* r8 --- from + PAGE_SIZE
* r9 --- orig_to
* r10 --- to
* r11 --- from
*/
ENTRY(__copy_user_page)
mov.l r8,@-r15
mov.l r9,@-r15
mov.l r10,@-r15
mov.l r11,@-r15
mov r4,r10
mov r5,r11
mov r6,r9
mov r5,r8
mov.l .Lpsz,r0
add r0,r8
!
1: ocbi @r9
add #32,r9
mov.l @r11+,r0
mov.l @r11+,r1
mov.l @r11+,r2
mov.l @r11+,r3
mov.l @r11+,r4
mov.l @r11+,r5
mov.l @r11+,r6
mov.l @r11+,r7
movca.l r0,@r10
mov r10,r0
add #32,r10
mov.l r7,@-r10
mov.l r6,@-r10
mov.l r5,@-r10
mov.l r4,@-r10
mov.l r3,@-r10
mov.l r2,@-r10
mov.l r1,@-r10
ocbwb @r0
cmp/eq r11,r8
bf/s 1b
add #28,r10
!
mov.l @r15+,r11
mov.l @r15+,r10
mov.l @r15+,r9
mov.l @r15+,r8
rts
nop
#endif
.align 2 .align 2
.Lpsz: .long PAGE_SIZE .Lpsz: .long PAGE_SIZE
/* /*
......
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/highmem.h>
#include <linux/module.h>
#include <asm/mmu_context.h> #include <asm/mmu_context.h>
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
...@@ -50,34 +52,61 @@ static inline void kunmap_coherent(struct page *page) ...@@ -50,34 +52,61 @@ static inline void kunmap_coherent(struct page *page)
void clear_user_page(void *to, unsigned long address, struct page *page) void clear_user_page(void *to, unsigned long address, struct page *page)
{ {
__set_bit(PG_mapped, &page->flags); __set_bit(PG_mapped, &page->flags);
if (((address ^ (unsigned long)to) & CACHE_ALIAS) == 0)
clear_page(to); clear_page(to);
else { if ((((address & PAGE_MASK) ^ (unsigned long)to) & CACHE_ALIAS))
void *vto = kmap_coherent(page, address); __flush_wback_region(to, PAGE_SIZE);
__clear_user_page(vto, to);
kunmap_coherent(vto);
}
} }
/* void copy_to_user_page(struct vm_area_struct *vma, struct page *page,
* copy_user_page unsigned long vaddr, void *dst, const void *src,
* @to: P1 address unsigned long len)
* @from: P1 address
* @address: U0 address to be mapped
* @page: page (virt_to_page(to))
*/
void copy_user_page(void *to, void *from, unsigned long address,
struct page *page)
{ {
void *vto;
__set_bit(PG_mapped, &page->flags); __set_bit(PG_mapped, &page->flags);
if (((address ^ (unsigned long)to) & CACHE_ALIAS) == 0)
copy_page(to, from); vto = kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK);
else { memcpy(vto, src, len);
void *vfrom = kmap_coherent(page, address); kunmap_coherent(vto);
__copy_user_page(vfrom, from, to);
kunmap_coherent(vfrom); if (vma->vm_flags & VM_EXEC)
} flush_cache_page(vma, vaddr, page_to_pfn(page));
}
void copy_from_user_page(struct vm_area_struct *vma, struct page *page,
unsigned long vaddr, void *dst, const void *src,
unsigned long len)
{
void *vfrom;
__set_bit(PG_mapped, &page->flags);
vfrom = kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK);
memcpy(dst, vfrom, len);
kunmap_coherent(vfrom);
}
void copy_user_highpage(struct page *to, struct page *from,
unsigned long vaddr, struct vm_area_struct *vma)
{
void *vfrom, *vto;
__set_bit(PG_mapped, &to->flags);
vto = kmap_atomic(to, KM_USER1);
vfrom = kmap_coherent(from, vaddr);
copy_page(vto, vfrom);
kunmap_coherent(vfrom);
if (((vaddr ^ (unsigned long)vto) & CACHE_ALIAS))
__flush_wback_region(vto, PAGE_SIZE);
kunmap_atomic(vto, KM_USER1);
/* Make sure this page is cleared on other CPU's too before using it */
smp_wmb();
} }
EXPORT_SYMBOL(copy_user_highpage);
/* /*
* For SH-4, we have our own implementation for ptep_get_and_clear * For SH-4, we have our own implementation for ptep_get_and_clear
......
...@@ -15,3 +15,4 @@ profdrvr-$(CONFIG_CPU_SUBTYPE_SH7091) := op_model_sh7750.o ...@@ -15,3 +15,4 @@ profdrvr-$(CONFIG_CPU_SUBTYPE_SH7091) := op_model_sh7750.o
oprofile-y := $(DRIVER_OBJS) $(profdrvr-y) oprofile-y := $(DRIVER_OBJS) $(profdrvr-y)
EXTRA_CFLAGS += -Werror
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <linux/reboot.h> #include <linux/reboot.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/proc_fs.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
...@@ -656,9 +657,6 @@ unsigned long get_wchan(struct task_struct *p) ...@@ -656,9 +657,6 @@ unsigned long get_wchan(struct task_struct *p)
*/ */
#if defined(CONFIG_SH64_PROC_ASIDS) #if defined(CONFIG_SH64_PROC_ASIDS)
#include <linux/init.h>
#include <linux/proc_fs.h>
static int static int
asids_proc_info(char *buf, char **start, off_t fpos, int length, int *eof, void *data) asids_proc_info(char *buf, char **start, off_t fpos, int length, int *eof, void *data)
{ {
...@@ -686,10 +684,8 @@ asids_proc_info(char *buf, char **start, off_t fpos, int length, int *eof, void ...@@ -686,10 +684,8 @@ asids_proc_info(char *buf, char **start, off_t fpos, int length, int *eof, void
static int __init register_proc_asids(void) static int __init register_proc_asids(void)
{ {
create_proc_read_entry("asids", 0, NULL, asids_proc_info, NULL); create_proc_read_entry("asids", 0, NULL, asids_proc_info, NULL);
return 0; return 0;
} }
__initcall(register_proc_asids); __initcall(register_proc_asids);
#endif #endif
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/sysctl.h> #include <linux/sysctl.h>
#include <linux/module.h> #include <linux/module.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/io.h> #include <asm/io.h>
...@@ -242,9 +241,6 @@ DO_ERROR(12, SIGILL, "reserved instruction", reserved_inst, current) ...@@ -242,9 +241,6 @@ DO_ERROR(12, SIGILL, "reserved instruction", reserved_inst, current)
#endif /* CONFIG_SH64_ID2815_WORKAROUND */ #endif /* CONFIG_SH64_ID2815_WORKAROUND */
#include <asm/system.h>
/* Called with interrupts disabled */ /* Called with interrupts disabled */
asmlinkage void do_exception_error(unsigned long ex, struct pt_regs *regs) asmlinkage void do_exception_error(unsigned long ex, struct pt_regs *regs)
{ {
...@@ -984,4 +980,3 @@ asmlinkage void do_debug_interrupt(unsigned long code, struct pt_regs *regs) ...@@ -984,4 +980,3 @@ asmlinkage void do_debug_interrupt(unsigned long code, struct pt_regs *regs)
/* Clear all DEBUGINT causes */ /* Clear all DEBUGINT causes */
poke_real_address_q(DM_EXP_CAUSE_PHY, 0x0); poke_real_address_q(DM_EXP_CAUSE_PHY, 0x0);
} }
...@@ -351,8 +351,10 @@ static int sh_rtc_read_time(struct device *dev, struct rtc_time *tm) ...@@ -351,8 +351,10 @@ static int sh_rtc_read_time(struct device *dev, struct rtc_time *tm)
tm->tm_sec, tm->tm_min, tm->tm_hour, tm->tm_sec, tm->tm_min, tm->tm_hour,
tm->tm_mday, tm->tm_mon + 1, tm->tm_year, tm->tm_wday); tm->tm_mday, tm->tm_mon + 1, tm->tm_year, tm->tm_wday);
if (rtc_valid_tm(tm) < 0) if (rtc_valid_tm(tm) < 0) {
dev_err(dev, "invalid date\n"); dev_err(dev, "invalid date\n");
rtc_time_to_tm(0, tm);
}
return 0; return 0;
} }
...@@ -588,7 +590,7 @@ static int __devinit sh_rtc_probe(struct platform_device *pdev) ...@@ -588,7 +590,7 @@ static int __devinit sh_rtc_probe(struct platform_device *pdev)
rtc->rtc_dev = rtc_device_register("sh", &pdev->dev, rtc->rtc_dev = rtc_device_register("sh", &pdev->dev,
&sh_rtc_ops, THIS_MODULE); &sh_rtc_ops, THIS_MODULE);
if (IS_ERR(rtc)) { if (IS_ERR(rtc->rtc_dev)) {
ret = PTR_ERR(rtc->rtc_dev); ret = PTR_ERR(rtc->rtc_dev);
goto err_badmap; goto err_badmap;
} }
......
...@@ -77,7 +77,6 @@ ...@@ -77,7 +77,6 @@
# define SCIF_ONLY # define SCIF_ONLY
#elif defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712) #elif defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712)
# define SCSPTR0 0xA4400000 /* 16 bit SCIF */ # define SCSPTR0 0xA4400000 /* 16 bit SCIF */
# define SCI_NPORTS 2
# define SCIF_ORER 0x0001 /* overrun error bit */ # define SCIF_ORER 0x0001 /* overrun error bit */
# define PACR 0xa4050100 # define PACR 0xa4050100
# define PBCR 0xa4050102 # define PBCR 0xa4050102
...@@ -102,12 +101,6 @@ ...@@ -102,12 +101,6 @@
# define SCIF_ORER 0x0001 /* overrun error bit */ # define SCIF_ORER 0x0001 /* overrun error bit */
# define SCSCR_INIT(port) 0x38 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ # define SCSCR_INIT(port) 0x38 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */
# define SCIF_ONLY # define SCIF_ONLY
#elif defined(CONFIG_CPU_SUBTYPE_ST40STB1)
# define SCSPTR1 0xffe00020 /* 16 bit SCIF */
# define SCSPTR2 0xffe80020 /* 16 bit SCIF */
# define SCIF_ORER 0x0001 /* overrun error bit */
# define SCSCR_INIT(port) 0x38 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */
# define SCIF_ONLY
#elif defined(CONFIG_CPU_SUBTYPE_SH5_101) || defined(CONFIG_CPU_SUBTYPE_SH5_103) #elif defined(CONFIG_CPU_SUBTYPE_SH5_101) || defined(CONFIG_CPU_SUBTYPE_SH5_103)
# include <asm/hardware.h> # include <asm/hardware.h>
# define SCIF_BASE_ADDR 0x01030000 # define SCIF_BASE_ADDR 0x01030000
...@@ -116,8 +109,7 @@ ...@@ -116,8 +109,7 @@
# define SCIF_LSR2_OFFS 0x0000024 # define SCIF_LSR2_OFFS 0x0000024
# define SCSPTR2 ((port->mapbase)+SCIF_PTR2_OFFS) /* 16 bit SCIF */ # define SCSPTR2 ((port->mapbase)+SCIF_PTR2_OFFS) /* 16 bit SCIF */
# define SCLSR2 ((port->mapbase)+SCIF_LSR2_OFFS) /* 16 bit SCIF */ # define SCLSR2 ((port->mapbase)+SCIF_LSR2_OFFS) /* 16 bit SCIF */
# define SCSCR_INIT(port) 0x38 /* TIE=0,RIE=0, # define SCSCR_INIT(port) 0x38 /* TIE=0,RIE=0, TE=1,RE=1,REIE=1 */
TE=1,RE=1,REIE=1 */
# define SCIF_ONLY # define SCIF_ONLY
#elif defined(CONFIG_H83007) || defined(CONFIG_H83068) #elif defined(CONFIG_H83007) || defined(CONFIG_H83068)
# define SCSCR_INIT(port) 0x30 /* TIE=0,RIE=0,TE=1,RE=1 */ # define SCSCR_INIT(port) 0x30 /* TIE=0,RIE=0,TE=1,RE=1 */
...@@ -577,15 +569,6 @@ static inline int sci_rxd_in(struct uart_port *port) ...@@ -577,15 +569,6 @@ static inline int sci_rxd_in(struct uart_port *port)
return ctrl_inb(SCPDR0) & 0x0001 ? 1 : 0; /* SCIF0 */ return ctrl_inb(SCPDR0) & 0x0001 ? 1 : 0; /* SCIF0 */
return 1; return 1;
} }
#elif defined(CONFIG_CPU_SUBTYPE_ST40STB1)
static inline int sci_rxd_in(struct uart_port *port)
{
if (port->mapbase == 0xffe00000)
return ctrl_inw(SCSPTR1)&0x0001 ? 1 : 0; /* SCIF */
else
return ctrl_inw(SCSPTR2)&0x0001 ? 1 : 0; /* SCIF */
}
#elif defined(CONFIG_CPU_SUBTYPE_SH5_101) || defined(CONFIG_CPU_SUBTYPE_SH5_103) #elif defined(CONFIG_CPU_SUBTYPE_SH5_101) || defined(CONFIG_CPU_SUBTYPE_SH5_103)
static inline int sci_rxd_in(struct uart_port *port) static inline int sci_rxd_in(struct uart_port *port)
{ {
......
...@@ -107,16 +107,17 @@ int superhyway_add_devices(struct superhyway_bus *bus, ...@@ -107,16 +107,17 @@ int superhyway_add_devices(struct superhyway_bus *bus,
static int __init superhyway_init(void) static int __init superhyway_init(void)
{ {
struct superhyway_bus *bus; struct superhyway_bus *bus;
int ret = 0; int ret;
device_register(&superhyway_bus_device); ret = device_register(&superhyway_bus_device);
if (unlikely(ret))
return ret;
for (bus = superhyway_channels; bus->ops; bus++) for (bus = superhyway_channels; bus->ops; bus++)
ret |= superhyway_scan_bus(bus); ret |= superhyway_scan_bus(bus);
return ret; return ret;
} }
postcore_initcall(superhyway_init); postcore_initcall(superhyway_init);
static const struct superhyway_device_id * static const struct superhyway_device_id *
......
...@@ -43,21 +43,31 @@ extern void __flush_purge_region(void *start, int size); ...@@ -43,21 +43,31 @@ extern void __flush_purge_region(void *start, int size);
extern void __flush_invalidate_region(void *start, int size); extern void __flush_invalidate_region(void *start, int size);
#endif #endif
#define flush_cache_vmap(start, end) flush_cache_all() #ifdef CONFIG_CPU_SH4
#define flush_cache_vunmap(start, end) flush_cache_all() extern void copy_to_user_page(struct vm_area_struct *vma,
struct page *page, unsigned long vaddr, void *dst, const void *src,
unsigned long len);
#define copy_to_user_page(vma, page, vaddr, dst, src, len) \ extern void copy_from_user_page(struct vm_area_struct *vma,
struct page *page, unsigned long vaddr, void *dst, const void *src,
unsigned long len);
#else
#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
do { \ do { \
flush_cache_page(vma, vaddr, page_to_pfn(page));\ flush_cache_page(vma, vaddr, page_to_pfn(page));\
memcpy(dst, src, len); \ memcpy(dst, src, len); \
flush_icache_user_range(vma, page, vaddr, len); \ flush_icache_user_range(vma, page, vaddr, len); \
} while (0) } while (0)
#define copy_from_user_page(vma, page, vaddr, dst, src, len) \ #define copy_from_user_page(vma, page, vaddr, dst, src, len) \
do { \ do { \
flush_cache_page(vma, vaddr, page_to_pfn(page));\ flush_cache_page(vma, vaddr, page_to_pfn(page));\
memcpy(dst, src, len); \ memcpy(dst, src, len); \
} while (0) } while (0)
#endif
#define flush_cache_vmap(start, end) flush_cache_all()
#define flush_cache_vunmap(start, end) flush_cache_all()
#define HAVE_ARCH_UNMAPPED_AREA #define HAVE_ARCH_UNMAPPED_AREA
......
...@@ -23,8 +23,7 @@ ...@@ -23,8 +23,7 @@
* --------------------------------------------------------------------------- * ---------------------------------------------------------------------------
*/ */
#if !defined(CONFIG_CPU_SUBTYPE_SH7720) && \ #if !defined(CONFIG_CPU_SUBTYPE_SH7720)
!defined(CONFIG_CPU_SUBTYPE_SH7727)
#define TMU_TOCR 0xfffffe90 /* Byte access */ #define TMU_TOCR 0xfffffe90 /* Byte access */
#endif #endif
...@@ -58,8 +57,7 @@ ...@@ -58,8 +57,7 @@
#define TMU2_TCOR 0xfffffeac /* Long access */ #define TMU2_TCOR 0xfffffeac /* Long access */
#define TMU2_TCNT 0xfffffeb0 /* Long access */ #define TMU2_TCNT 0xfffffeb0 /* Long access */
#define TMU2_TCR 0xfffffeb4 /* Word access */ #define TMU2_TCR 0xfffffeb4 /* Word access */
#if !defined(CONFIG_CPU_SUBTYPE_SH7720) && \ #if !defined(CONFIG_CPU_SUBTYPE_SH7720)
!defined(CONFIG_CPU_SUBTYPE_SH7727)
#define TMU2_TCPR2 0xfffffeb8 /* Long access */ #define TMU2_TCPR2 0xfffffeb8 /* Long access */
#endif #endif
#endif #endif
......
...@@ -73,10 +73,13 @@ extern void copy_page_nommu(void *to, void *from); ...@@ -73,10 +73,13 @@ extern void copy_page_nommu(void *to, void *from);
#if !defined(CONFIG_CACHE_OFF) && defined(CONFIG_MMU) && \ #if !defined(CONFIG_CACHE_OFF) && defined(CONFIG_MMU) && \
(defined(CONFIG_CPU_SH4) || defined(CONFIG_SH7705_CACHE_32KB)) (defined(CONFIG_CPU_SH4) || defined(CONFIG_SH7705_CACHE_32KB))
struct page; struct page;
extern void clear_user_page(void *to, unsigned long address, struct page *pg); struct vm_area_struct;
extern void copy_user_page(void *to, void *from, unsigned long address, struct page *pg); extern void clear_user_page(void *to, unsigned long address, struct page *page);
extern void __clear_user_page(void *to, void *orig_to); #ifdef CONFIG_CPU_SH4
extern void __copy_user_page(void *to, void *from, void *orig_to); extern void copy_user_highpage(struct page *to, struct page *from,
unsigned long vaddr, struct vm_area_struct *vma);
#define __HAVE_ARCH_COPY_USER_HIGHPAGE
#endif
#else #else
#define clear_user_page(page, vaddr, pg) clear_page(page) #define clear_user_page(page, vaddr, pg) clear_page(page)
#define copy_user_page(to, from, vaddr, pg) copy_page(to, from) #define copy_user_page(to, from, vaddr, pg) copy_page(to, from)
......
...@@ -322,7 +322,9 @@ extern unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)]; ...@@ -322,7 +322,9 @@ extern unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)];
#define PAGE_KERNEL __pgprot(0) #define PAGE_KERNEL __pgprot(0)
#define PAGE_KERNEL_NOCACHE __pgprot(0) #define PAGE_KERNEL_NOCACHE __pgprot(0)
#define PAGE_KERNEL_RO __pgprot(0) #define PAGE_KERNEL_RO __pgprot(0)
#define PAGE_KERNEL_PCC __pgprot(0)
#define PAGE_KERNEL_PCC(slot, type) \
__pgprot(0)
#endif #endif
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
......
...@@ -49,7 +49,7 @@ enum cpu_type { ...@@ -49,7 +49,7 @@ enum cpu_type {
/* SH-4 types */ /* SH-4 types */
CPU_SH7750, CPU_SH7750S, CPU_SH7750R, CPU_SH7751, CPU_SH7751R, CPU_SH7750, CPU_SH7750S, CPU_SH7750R, CPU_SH7751, CPU_SH7751R,
CPU_SH7760, CPU_ST40RA, CPU_ST40GX1, CPU_SH4_202, CPU_SH4_501, CPU_SH7760, CPU_SH4_202, CPU_SH4_501,
/* SH-4A types */ /* SH-4A types */
CPU_SH7770, CPU_SH7780, CPU_SH7781, CPU_SH7785, CPU_SHX3, CPU_SH7770, CPU_SH7780, CPU_SH7781, CPU_SH7785, CPU_SHX3,
......
...@@ -42,9 +42,6 @@ ...@@ -42,9 +42,6 @@
#define REG_FPSCR 55 #define REG_FPSCR 55
#define REG_FPUL 56 #define REG_FPUL 56
/* options set using PTRACE_SETOPTIONS */
#define PTRACE_O_TRACESYSGOOD 0x00000001
/* /*
* This struct defines the way the registers are stored on the * This struct defines the way the registers are stored on the
* kernel stack during a system call or other kernel entry. * kernel stack during a system call or other kernel entry.
......
#ifndef __ASM_SH_VGA_H
#define __ASM_SH_VGA_H
/* Stupid drivers. */
#endif /* __ASM_SH_VGA_H */
...@@ -32,6 +32,4 @@ struct pt_regs { ...@@ -32,6 +32,4 @@ struct pt_regs {
extern void show_regs(struct pt_regs *); extern void show_regs(struct pt_regs *);
#endif #endif
#define PTRACE_O_TRACESYSGOOD 0x00000001
#endif /* __ASM_SH64_PTRACE_H */ #endif /* __ASM_SH64_PTRACE_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment