Commit f8f44f09 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'sh-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-3.x

* 'sh-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-3.x:
  sh: sh7724: Add USBHS DMAEngine support
  sh: ecovec: Add renesas_usbhs support
  sh, exec: remove redundant set_fs(USER_DS)
  drivers: sh: resume enabled clocks fix
  dmaengine: shdma: SH_DMAC_MAX_CHANNELS message fix
  sh: Fix up xchg/cmpxchg corruption with gUSA RB.
  sh: Remove compressed kernel libgcc dependency.
  sh: fix wrong icache/dcache address-array start addr in cache-debugfs.
parents f49cc57c 261a9af6
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <linux/io.h> #include <linux/io.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/usb/r8a66597.h> #include <linux/usb/r8a66597.h>
#include <linux/usb/renesas_usbhs.h>
#include <linux/i2c.h> #include <linux/i2c.h>
#include <linux/i2c/tsc2007.h> #include <linux/i2c/tsc2007.h>
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
...@@ -232,6 +233,52 @@ static struct platform_device usb1_common_device = { ...@@ -232,6 +233,52 @@ static struct platform_device usb1_common_device = {
.resource = usb1_common_resources, .resource = usb1_common_resources,
}; };
/*
* USBHS
*/
static int usbhs_get_id(struct platform_device *pdev)
{
return gpio_get_value(GPIO_PTB3);
}
static struct renesas_usbhs_platform_info usbhs_info = {
.platform_callback = {
.get_id = usbhs_get_id,
},
.driver_param = {
.buswait_bwait = 4,
.detection_delay = 5,
},
};
static struct resource usbhs_resources[] = {
[0] = {
.start = 0xa4d90000,
.end = 0xa4d90124 - 1,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = 66,
.end = 66,
.flags = IORESOURCE_IRQ,
},
};
static struct platform_device usbhs_device = {
.name = "renesas_usbhs",
.id = 1,
.dev = {
.dma_mask = NULL, /* not use dma */
.coherent_dma_mask = 0xffffffff,
.platform_data = &usbhs_info,
},
.num_resources = ARRAY_SIZE(usbhs_resources),
.resource = usbhs_resources,
.archdata = {
.hwblk_id = HWBLK_USB1,
},
};
/* LCDC */ /* LCDC */
const static struct fb_videomode ecovec_lcd_modes[] = { const static struct fb_videomode ecovec_lcd_modes[] = {
{ {
...@@ -897,6 +944,7 @@ static struct platform_device *ecovec_devices[] __initdata = { ...@@ -897,6 +944,7 @@ static struct platform_device *ecovec_devices[] __initdata = {
&sh_eth_device, &sh_eth_device,
&usb0_host_device, &usb0_host_device,
&usb1_common_device, &usb1_common_device,
&usbhs_device,
&lcdc_device, &lcdc_device,
&ceu0_device, &ceu0_device,
&ceu1_device, &ceu1_device,
......
...@@ -27,8 +27,6 @@ IMAGE_OFFSET := $(shell /bin/bash -c 'printf "0x%08x" \ ...@@ -27,8 +27,6 @@ IMAGE_OFFSET := $(shell /bin/bash -c 'printf "0x%08x" \
$(CONFIG_BOOT_LINK_OFFSET)]') $(CONFIG_BOOT_LINK_OFFSET)]')
endif endif
LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
ifeq ($(CONFIG_MCOUNT),y) ifeq ($(CONFIG_MCOUNT),y)
ORIG_CFLAGS := $(KBUILD_CFLAGS) ORIG_CFLAGS := $(KBUILD_CFLAGS)
KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS)) KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS))
...@@ -37,7 +35,25 @@ endif ...@@ -37,7 +35,25 @@ endif
LDFLAGS_vmlinux := --oformat $(ld-bfd) -Ttext $(IMAGE_OFFSET) -e startup \ LDFLAGS_vmlinux := --oformat $(ld-bfd) -Ttext $(IMAGE_OFFSET) -e startup \
-T $(obj)/../../kernel/vmlinux.lds -T $(obj)/../../kernel/vmlinux.lds
$(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o $(LIBGCC) FORCE #
# Pull in the necessary libgcc bits from the in-kernel implementation.
#
lib1funcs-$(CONFIG_SUPERH32) := ashiftrt.S ashldi3.c ashrsi3.S ashlsi3.S \
lshrsi3.S
lib1funcs-obj := \
$(addsuffix .o, $(basename $(addprefix $(obj)/, $(lib1funcs-y))))
lib1funcs-dir := $(srctree)/arch/$(SRCARCH)/lib
ifeq ($(BITS),64)
lib1funcs-dir := $(addsuffix $(BITS), $(lib1funcs-dir))
endif
KBUILD_CFLAGS += -I$(lib1funcs-dir)
$(addprefix $(obj)/,$(lib1funcs-y)): $(obj)/%: $(lib1funcs-dir)/% FORCE
$(call cmd,shipped)
$(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o $(lib1funcs-obj) FORCE
$(call if_changed,ld) $(call if_changed,ld)
@: @:
......
...@@ -15,8 +15,9 @@ static inline unsigned long xchg_u32(volatile u32 *m, unsigned long val) ...@@ -15,8 +15,9 @@ static inline unsigned long xchg_u32(volatile u32 *m, unsigned long val)
" mov.l %2, @%1 \n\t" /* store new value */ " mov.l %2, @%1 \n\t" /* store new value */
"1: mov r1, r15 \n\t" /* LOGOUT */ "1: mov r1, r15 \n\t" /* LOGOUT */
: "=&r" (retval), : "=&r" (retval),
"+r" (m) "+r" (m),
: "r" (val) "+r" (val) /* inhibit r15 overloading */
:
: "memory", "r0", "r1"); : "memory", "r0", "r1");
return retval; return retval;
...@@ -36,8 +37,9 @@ static inline unsigned long xchg_u8(volatile u8 *m, unsigned long val) ...@@ -36,8 +37,9 @@ static inline unsigned long xchg_u8(volatile u8 *m, unsigned long val)
" mov.b %2, @%1 \n\t" /* store new value */ " mov.b %2, @%1 \n\t" /* store new value */
"1: mov r1, r15 \n\t" /* LOGOUT */ "1: mov r1, r15 \n\t" /* LOGOUT */
: "=&r" (retval), : "=&r" (retval),
"+r" (m) "+r" (m),
: "r" (val) "+r" (val) /* inhibit r15 overloading */
:
: "memory" , "r0", "r1"); : "memory" , "r0", "r1");
return retval; return retval;
...@@ -54,13 +56,14 @@ static inline unsigned long __cmpxchg_u32(volatile int *m, unsigned long old, ...@@ -54,13 +56,14 @@ static inline unsigned long __cmpxchg_u32(volatile int *m, unsigned long old,
" nop \n\t" " nop \n\t"
" mov r15, r1 \n\t" /* r1 = saved sp */ " mov r15, r1 \n\t" /* r1 = saved sp */
" mov #-8, r15 \n\t" /* LOGIN */ " mov #-8, r15 \n\t" /* LOGIN */
" mov.l @%1, %0 \n\t" /* load old value */ " mov.l @%3, %0 \n\t" /* load old value */
" cmp/eq %0, %2 \n\t" " cmp/eq %0, %1 \n\t"
" bf 1f \n\t" /* if not equal */ " bf 1f \n\t" /* if not equal */
" mov.l %3, @%1 \n\t" /* store new value */ " mov.l %2, @%3 \n\t" /* store new value */
"1: mov r1, r15 \n\t" /* LOGOUT */ "1: mov r1, r15 \n\t" /* LOGOUT */
: "=&r" (retval) : "=&r" (retval),
: "r" (m), "r" (old), "r" (new) "+r" (old), "+r" (new) /* old or new can be r15 */
: "r" (m)
: "memory" , "r0", "r1", "t"); : "memory" , "r0", "r1", "t");
return retval; return retval;
......
...@@ -150,7 +150,6 @@ struct thread_struct { ...@@ -150,7 +150,6 @@ struct thread_struct {
#define SR_USER (SR_MMU | SR_FD) #define SR_USER (SR_MMU | SR_FD)
#define start_thread(_regs, new_pc, new_sp) \ #define start_thread(_regs, new_pc, new_sp) \
set_fs(USER_DS); \
_regs->sr = SR_USER; /* User mode. */ \ _regs->sr = SR_USER; /* User mode. */ \
_regs->pc = new_pc - 4; /* Compensate syscall exit */ \ _regs->pc = new_pc - 4; /* Compensate syscall exit */ \
_regs->pc |= 1; /* Set SHmedia ! */ \ _regs->pc |= 1; /* Set SHmedia ! */ \
......
...@@ -298,6 +298,14 @@ enum { ...@@ -298,6 +298,14 @@ enum {
SHDMA_SLAVE_SCIF4_RX, SHDMA_SLAVE_SCIF4_RX,
SHDMA_SLAVE_SCIF5_TX, SHDMA_SLAVE_SCIF5_TX,
SHDMA_SLAVE_SCIF5_RX, SHDMA_SLAVE_SCIF5_RX,
SHDMA_SLAVE_USB0D0_TX,
SHDMA_SLAVE_USB0D0_RX,
SHDMA_SLAVE_USB0D1_TX,
SHDMA_SLAVE_USB0D1_RX,
SHDMA_SLAVE_USB1D0_TX,
SHDMA_SLAVE_USB1D0_RX,
SHDMA_SLAVE_USB1D1_TX,
SHDMA_SLAVE_USB1D1_RX,
SHDMA_SLAVE_SDHI0_TX, SHDMA_SLAVE_SDHI0_TX,
SHDMA_SLAVE_SDHI0_RX, SHDMA_SLAVE_SDHI0_RX,
SHDMA_SLAVE_SDHI1_TX, SHDMA_SLAVE_SDHI1_TX,
......
...@@ -92,6 +92,46 @@ static const struct sh_dmae_slave_config sh7724_dmae_slaves[] = { ...@@ -92,6 +92,46 @@ static const struct sh_dmae_slave_config sh7724_dmae_slaves[] = {
.addr = 0xa4e50024, .addr = 0xa4e50024,
.chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT), .chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT),
.mid_rid = 0x36, .mid_rid = 0x36,
}, {
.slave_id = SHDMA_SLAVE_USB0D0_TX,
.addr = 0xA4D80100,
.chcr = DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_32BIT),
.mid_rid = 0x73,
}, {
.slave_id = SHDMA_SLAVE_USB0D0_RX,
.addr = 0xA4D80100,
.chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_32BIT),
.mid_rid = 0x73,
}, {
.slave_id = SHDMA_SLAVE_USB0D1_TX,
.addr = 0xA4D80120,
.chcr = DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_32BIT),
.mid_rid = 0x77,
}, {
.slave_id = SHDMA_SLAVE_USB0D1_RX,
.addr = 0xA4D80120,
.chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_32BIT),
.mid_rid = 0x77,
}, {
.slave_id = SHDMA_SLAVE_USB1D0_TX,
.addr = 0xA4D90100,
.chcr = DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_32BIT),
.mid_rid = 0xab,
}, {
.slave_id = SHDMA_SLAVE_USB1D0_RX,
.addr = 0xA4D90100,
.chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_32BIT),
.mid_rid = 0xab,
}, {
.slave_id = SHDMA_SLAVE_USB1D1_TX,
.addr = 0xA4D90120,
.chcr = DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_32BIT),
.mid_rid = 0xaf,
}, {
.slave_id = SHDMA_SLAVE_USB1D1_RX,
.addr = 0xA4D90120,
.chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_32BIT),
.mid_rid = 0xaf,
}, { }, {
.slave_id = SHDMA_SLAVE_SDHI0_TX, .slave_id = SHDMA_SLAVE_SDHI0_TX,
.addr = 0x04ce0030, .addr = 0x04ce0030,
......
...@@ -102,8 +102,6 @@ EXPORT_SYMBOL(kernel_thread); ...@@ -102,8 +102,6 @@ EXPORT_SYMBOL(kernel_thread);
void start_thread(struct pt_regs *regs, unsigned long new_pc, void start_thread(struct pt_regs *regs, unsigned long new_pc,
unsigned long new_sp) unsigned long new_sp)
{ {
set_fs(USER_DS);
regs->pr = 0; regs->pr = 0;
regs->sr = SR_FD; regs->sr = SR_FD;
regs->pc = new_pc; regs->pc = new_pc;
......
...@@ -26,9 +26,9 @@ static int cache_seq_show(struct seq_file *file, void *iter) ...@@ -26,9 +26,9 @@ static int cache_seq_show(struct seq_file *file, void *iter)
{ {
unsigned int cache_type = (unsigned int)file->private; unsigned int cache_type = (unsigned int)file->private;
struct cache_info *cache; struct cache_info *cache;
unsigned int waysize, way, cache_size; unsigned int waysize, way;
unsigned long ccr, base; unsigned long ccr;
static unsigned long addrstart = 0; unsigned long addrstart = 0;
/* /*
* Go uncached immediately so we don't skew the results any * Go uncached immediately so we don't skew the results any
...@@ -45,28 +45,13 @@ static int cache_seq_show(struct seq_file *file, void *iter) ...@@ -45,28 +45,13 @@ static int cache_seq_show(struct seq_file *file, void *iter)
} }
if (cache_type == CACHE_TYPE_DCACHE) { if (cache_type == CACHE_TYPE_DCACHE) {
base = CACHE_OC_ADDRESS_ARRAY; addrstart = CACHE_OC_ADDRESS_ARRAY;
cache = &current_cpu_data.dcache; cache = &current_cpu_data.dcache;
} else { } else {
base = CACHE_IC_ADDRESS_ARRAY; addrstart = CACHE_IC_ADDRESS_ARRAY;
cache = &current_cpu_data.icache; cache = &current_cpu_data.icache;
} }
/*
* Due to the amount of data written out (depending on the cache size),
* we may be iterated over multiple times. In this case, keep track of
* the entry position in addrstart, and rewind it when we've hit the
* end of the cache.
*
* Likewise, the same code is used for multiple caches, so care must
* be taken for bouncing addrstart back and forth so the appropriate
* cache is hit.
*/
cache_size = cache->ways * cache->sets * cache->linesz;
if (((addrstart & 0xff000000) != base) ||
(addrstart & 0x00ffffff) > cache_size)
addrstart = base;
waysize = cache->sets; waysize = cache->sets;
/* /*
......
...@@ -1221,6 +1221,11 @@ static int __init sh_dmae_probe(struct platform_device *pdev) ...@@ -1221,6 +1221,11 @@ static int __init sh_dmae_probe(struct platform_device *pdev)
} else { } else {
do { do {
for (i = chanirq_res->start; i <= chanirq_res->end; i++) { for (i = chanirq_res->start; i <= chanirq_res->end; i++) {
if (irq_cnt >= SH_DMAC_MAX_CHANNELS) {
irq_cap = 1;
break;
}
if ((errirq_res->flags & IORESOURCE_BITS) == if ((errirq_res->flags & IORESOURCE_BITS) ==
IORESOURCE_IRQ_SHAREABLE) IORESOURCE_IRQ_SHAREABLE)
chan_flag[irq_cnt] = IRQF_SHARED; chan_flag[irq_cnt] = IRQF_SHARED;
...@@ -1230,15 +1235,11 @@ static int __init sh_dmae_probe(struct platform_device *pdev) ...@@ -1230,15 +1235,11 @@ static int __init sh_dmae_probe(struct platform_device *pdev)
"Found IRQ %d for channel %d\n", "Found IRQ %d for channel %d\n",
i, irq_cnt); i, irq_cnt);
chan_irq[irq_cnt++] = i; chan_irq[irq_cnt++] = i;
if (irq_cnt >= SH_DMAC_MAX_CHANNELS)
break;
} }
if (irq_cnt >= SH_DMAC_MAX_CHANNELS) { if (irq_cnt >= SH_DMAC_MAX_CHANNELS)
irq_cap = 1;
break; break;
}
chanirq_res = platform_get_resource(pdev, chanirq_res = platform_get_resource(pdev,
IORESOURCE_IRQ, ++irqres); IORESOURCE_IRQ, ++irqres);
} while (irq_cnt < pdata->channel_num && chanirq_res); } while (irq_cnt < pdata->channel_num && chanirq_res);
......
...@@ -635,7 +635,7 @@ static void clks_core_resume(void) ...@@ -635,7 +635,7 @@ static void clks_core_resume(void)
struct clk *clkp; struct clk *clkp;
list_for_each_entry(clkp, &clock_list, node) { list_for_each_entry(clkp, &clock_list, node) {
if (likely(clkp->ops)) { if (likely(clkp->usecount && clkp->ops)) {
unsigned long rate = clkp->rate; unsigned long rate = clkp->rate;
if (likely(clkp->ops->set_parent)) if (likely(clkp->ops->set_parent))
......
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