Commit c59cebe8 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'sh-for-v6.10-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/glaubitz/sh-linux

Pull sh updates from John Paul Adrian Glaubitz:
 "The majority of improvements are coming from Geert Uytterhoeven who
  took the time to fix a total of 30 cases of "-Wmissing-prototypes"
  compiler warnings, either by adding a missing header include, defining
  the missing forward declarations or making the functions in question
  static.

  In the case of several DMA functions, the fix was to actually just
  remove them as they were added but never used. Another one of these
  warnings was eliminated by removing the left-over sh5 cache handling
  support, a change that was suggested by Yoshinori Sato and, finally,
  the last of these warnings was fixed by guarding the function
  setup_profiling_timer() with CONFIG_PROFILING.

  While at it, Geert also removed two unneeded casts to kprobe_opcode_t
  in the kprobes code.

  Another change was contributed by Guenter Roeck to fix errors that
  were reported during checksum unit tests. The fix actually reverts the
  older change cadc4e1a ("sh: Handle calling csum_partial with
  misaligned data") which turned to be incorrect. It remains to be
  investigated whether there is a better way to handle misaligned data
  in csum_partial().

  A small fix contributed by Krzysztof Kozlowski drops the incorrect SPI
  controller spi-max-frequency property in the device tree source file
  for the J2 device platform while Uwe Kleine-König converted the
  push-switch driver to have its callback function return void, a change
  that is currently being applied to all drivers throughout the kernel
  in order to avoid resource leaks.

  Last but not least, Artur Rojek has fixed the IOPORT base address for
  the Sega Dreamcast platform which allows the Linux kernel to be
  successfully booted on this once popular video game console for the
  first time since a long time ago"

* tag 'sh-for-v6.10-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/glaubitz/sh-linux: (35 commits)
  sh: setup: Add missing forward declaration for sh_fdt_init()
  sh: smp: Protect setup_profiling_timer() by CONFIG_PROFILING
  sh: of-generic: Add missing #include <asm/clock.h>
  sh: dreamcast: Fix GAPS PCI bridge addressing
  sh: boot: Add proper forward declarations
  sh: boot: Remove sh5 cache handling
  Revert "sh: Handle calling csum_partial with misaligned data"
  sh: j2: Drop incorrect SPI controller spi-max-frequency property
  sh: push-switch: Convert to platform remove callback returning void
  sh: sh7785lcr: Make init_sh7785lcr_IRQ() static
  sh: sh7757: Add missing #include <asm/mmzone.h>
  sh: sh7757lcr: Make init_sh7757lcr_IRQ() static
  sh: mach-sh03: Make sh03_rtc_settimeofday() static
  sh: mach-highlander: Add missing #include <mach/highlander.h>
  sh: traps: Make is_dsp_inst() static
  sh: cache: Move forward declarations to <asm/cacheflush.h>
  sh: dma: Remove unused functionality
  sh: dwarf: Make dwarf_lookup_fde() static
  sh: kprobes: Remove unneeded kprobe_opcode_t casts
  sh: kprobes: Make trampoline_probe_handler() static
  ...
parents 103916ff efe976b7
...@@ -125,7 +125,8 @@ config ARCH_HAS_ILOG2_U64 ...@@ -125,7 +125,8 @@ config ARCH_HAS_ILOG2_U64
config NO_IOPORT_MAP config NO_IOPORT_MAP
def_bool !PCI def_bool !PCI
depends on !SH_SHMIN && !SH_HP6XX && !SH_SOLUTION_ENGINE depends on !SH_SHMIN && !SH_HP6XX && !SH_SOLUTION_ENGINE && \
!SH_DREAMCAST
config IO_TRAPPED config IO_TRAPPED
bool bool
......
...@@ -569,7 +569,7 @@ static int __init sh7757lcr_devices_setup(void) ...@@ -569,7 +569,7 @@ static int __init sh7757lcr_devices_setup(void)
arch_initcall(sh7757lcr_devices_setup); arch_initcall(sh7757lcr_devices_setup);
/* Initialize IRQ setting */ /* Initialize IRQ setting */
void __init init_sh7757lcr_IRQ(void) static void __init init_sh7757lcr_IRQ(void)
{ {
plat_irq_setup_pins(IRQ_MODE_IRQ7654); plat_irq_setup_pins(IRQ_MODE_IRQ7654);
plat_irq_setup_pins(IRQ_MODE_IRQ3210); plat_irq_setup_pins(IRQ_MODE_IRQ3210);
......
...@@ -295,7 +295,7 @@ static int __init sh7785lcr_devices_setup(void) ...@@ -295,7 +295,7 @@ static int __init sh7785lcr_devices_setup(void)
device_initcall(sh7785lcr_devices_setup); device_initcall(sh7785lcr_devices_setup);
/* Initialize IRQ setting */ /* Initialize IRQ setting */
void __init init_sh7785lcr_IRQ(void) static void __init init_sh7785lcr_IRQ(void)
{ {
plat_irq_setup_pins(IRQ_MODE_IRQ7654); plat_irq_setup_pins(IRQ_MODE_IRQ7654);
plat_irq_setup_pins(IRQ_MODE_IRQ3210); plat_irq_setup_pins(IRQ_MODE_IRQ3210);
......
...@@ -25,10 +25,13 @@ ...@@ -25,10 +25,13 @@
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/rtc.h> #include <asm/rtc.h>
#include <asm/machvec.h> #include <asm/machvec.h>
#include <cpu/addrspace.h>
#include <mach/sysasic.h> #include <mach/sysasic.h>
static void __init dreamcast_setup(char **cmdline_p) static void __init dreamcast_setup(char **cmdline_p)
{ {
/* GAPS PCI bridge assumes P2 area relative addresses. */
__set_io_port_base(P2SEG);
} }
static struct sh_machine_vector mv_dreamcast __initmv = { static struct sh_machine_vector mv_dreamcast __initmv = {
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/gpio.h> #include <linux/gpio.h>
#include <cpu/sh7785.h> #include <cpu/sh7785.h>
#include <mach/highlander.h>
void __init highlander_plat_pinmux_setup(void) void __init highlander_plat_pinmux_setup(void)
{ {
......
...@@ -120,7 +120,7 @@ static int set_rtc_mmss(struct rtc_time *tm) ...@@ -120,7 +120,7 @@ static int set_rtc_mmss(struct rtc_time *tm)
return retval; return retval;
} }
int sh03_rtc_settimeofday(struct device *dev, struct rtc_time *tm) static int sh03_rtc_settimeofday(struct device *dev, struct rtc_time *tm)
{ {
return set_rtc_mmss(tm); return set_rtc_mmss(tm);
} }
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
#include <linux/of_fdt.h> #include <linux/of_fdt.h>
#include <linux/clocksource.h> #include <linux/clocksource.h>
#include <linux/irqchip.h> #include <linux/irqchip.h>
#include <asm/clock.h>
#include <asm/machvec.h> #include <asm/machvec.h>
#include <asm/rtc.h> #include <asm/rtc.h>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
# create a compressed vmlinux image from the original vmlinux # create a compressed vmlinux image from the original vmlinux
# #
OBJECTS := head_32.o misc.o cache.o piggy.o \ OBJECTS := head_32.o misc.o piggy.o \
ashiftrt.o ashldi3.o ashrsi3.o ashlsi3.o lshrsi3.o ashiftrt.o ashldi3.o ashrsi3.o ashlsi3.o lshrsi3.o
targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 \ targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 \
......
// SPDX-License-Identifier: GPL-2.0
int cache_control(unsigned int command)
{
volatile unsigned int *p = (volatile unsigned int *) 0x80000000;
int i;
for (i = 0; i < (32 * 1024); i += 32) {
(void)*p;
p += (32 / sizeof(int));
}
return 0;
}
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
#include <asm/addrspace.h> #include <asm/addrspace.h>
#include <asm/page.h> #include <asm/page.h>
#include "misc.h"
/* /*
* gzip declarations * gzip declarations
*/ */
...@@ -26,11 +28,6 @@ ...@@ -26,11 +28,6 @@
#undef memcpy #undef memcpy
#define memzero(s, n) memset ((s), 0, (n)) #define memzero(s, n) memset ((s), 0, (n))
/* cache.c */
#define CACHE_ENABLE 0
#define CACHE_DISABLE 1
int cache_control(unsigned int command);
extern char input_data[]; extern char input_data[];
extern int input_len; extern int input_len;
static unsigned char *output; static unsigned char *output;
...@@ -139,8 +136,6 @@ void decompress_kernel(void) ...@@ -139,8 +136,6 @@ void decompress_kernel(void)
free_mem_end_ptr = free_mem_ptr + HEAP_SIZE; free_mem_end_ptr = free_mem_ptr + HEAP_SIZE;
puts("Uncompressing Linux... "); puts("Uncompressing Linux... ");
cache_control(CACHE_ENABLE);
__decompress(input_data, input_len, NULL, NULL, output, 0, NULL, error); __decompress(input_data, input_len, NULL, NULL, output, 0, NULL, error);
cache_control(CACHE_DISABLE);
puts("Ok, booting the kernel.\n"); puts("Ok, booting the kernel.\n");
} }
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef MISC_H
#define MISC_H
void arch_ftrace_ops_list_func(void);
void decompress_kernel(void);
void ftrace_stub(void);
#endif /* MISC_H */
...@@ -71,8 +71,6 @@ spi0: spi@40 { ...@@ -71,8 +71,6 @@ spi0: spi@40 {
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
spi-max-frequency = <25000000>;
reg = <0x40 0x8>; reg = <0x40 0x8>;
sdcard@0 { sdcard@0 {
......
...@@ -41,21 +41,6 @@ struct dma_info *get_dma_info(unsigned int chan) ...@@ -41,21 +41,6 @@ struct dma_info *get_dma_info(unsigned int chan)
} }
EXPORT_SYMBOL(get_dma_info); EXPORT_SYMBOL(get_dma_info);
struct dma_info *get_dma_info_by_name(const char *dmac_name)
{
struct dma_info *info;
list_for_each_entry(info, &registered_dmac_list, list) {
if (dmac_name && (strcmp(dmac_name, info->name) != 0))
continue;
else
return info;
}
return NULL;
}
EXPORT_SYMBOL(get_dma_info_by_name);
static unsigned int get_nr_channels(void) static unsigned int get_nr_channels(void)
{ {
struct dma_info *info; struct dma_info *info;
...@@ -101,93 +86,6 @@ int get_dma_residue(unsigned int chan) ...@@ -101,93 +86,6 @@ int get_dma_residue(unsigned int chan)
} }
EXPORT_SYMBOL(get_dma_residue); EXPORT_SYMBOL(get_dma_residue);
static int search_cap(const char **haystack, const char *needle)
{
const char **p;
for (p = haystack; *p; p++)
if (strcmp(*p, needle) == 0)
return 1;
return 0;
}
/**
* request_dma_bycap - Allocate a DMA channel based on its capabilities
* @dmac: List of DMA controllers to search
* @caps: List of capabilities
*
* Search all channels of all DMA controllers to find a channel which
* matches the requested capabilities. The result is the channel
* number if a match is found, or %-ENODEV if no match is found.
*
* Note that not all DMA controllers export capabilities, in which
* case they can never be allocated using this API, and so
* request_dma() must be used specifying the channel number.
*/
int request_dma_bycap(const char **dmac, const char **caps, const char *dev_id)
{
unsigned int found = 0;
struct dma_info *info;
const char **p;
int i;
BUG_ON(!dmac || !caps);
list_for_each_entry(info, &registered_dmac_list, list)
if (strcmp(*dmac, info->name) == 0) {
found = 1;
break;
}
if (!found)
return -ENODEV;
for (i = 0; i < info->nr_channels; i++) {
struct dma_channel *channel = &info->channels[i];
if (unlikely(!channel->caps))
continue;
for (p = caps; *p; p++) {
if (!search_cap(channel->caps, *p))
break;
if (request_dma(channel->chan, dev_id) == 0)
return channel->chan;
}
}
return -EINVAL;
}
EXPORT_SYMBOL(request_dma_bycap);
int dmac_search_free_channel(const char *dev_id)
{
struct dma_channel *channel = { 0 };
struct dma_info *info = get_dma_info(0);
int i;
for (i = 0; i < info->nr_channels; i++) {
channel = &info->channels[i];
if (unlikely(!channel))
return -ENODEV;
if (atomic_read(&channel->busy) == 0)
break;
}
if (info->ops->request) {
int result = info->ops->request(channel);
if (result)
return result;
atomic_set(&channel->busy, 1);
return channel->chan;
}
return -ENOSYS;
}
int request_dma(unsigned int chan, const char *dev_id) int request_dma(unsigned int chan, const char *dev_id)
{ {
struct dma_channel *channel = { 0 }; struct dma_channel *channel = { 0 };
...@@ -240,35 +138,6 @@ void dma_wait_for_completion(unsigned int chan) ...@@ -240,35 +138,6 @@ void dma_wait_for_completion(unsigned int chan)
} }
EXPORT_SYMBOL(dma_wait_for_completion); EXPORT_SYMBOL(dma_wait_for_completion);
int register_chan_caps(const char *dmac, struct dma_chan_caps *caps)
{
struct dma_info *info;
unsigned int found = 0;
int i;
list_for_each_entry(info, &registered_dmac_list, list)
if (strcmp(dmac, info->name) == 0) {
found = 1;
break;
}
if (unlikely(!found))
return -ENODEV;
for (i = 0; i < info->nr_channels; i++, caps++) {
struct dma_channel *channel;
if ((info->first_channel_nr + i) != caps->ch_num)
return -EINVAL;
channel = &info->channels[i];
channel->caps = caps->caplist;
}
return 0;
}
EXPORT_SYMBOL(register_chan_caps);
void dma_configure_channel(unsigned int chan, unsigned long flags) void dma_configure_channel(unsigned int chan, unsigned long flags)
{ {
struct dma_info *info = get_dma_info(chan); struct dma_info *info = get_dma_info(chan);
...@@ -294,18 +163,6 @@ int dma_xfer(unsigned int chan, unsigned long from, ...@@ -294,18 +163,6 @@ int dma_xfer(unsigned int chan, unsigned long from,
} }
EXPORT_SYMBOL(dma_xfer); EXPORT_SYMBOL(dma_xfer);
int dma_extend(unsigned int chan, unsigned long op, void *param)
{
struct dma_info *info = get_dma_info(chan);
struct dma_channel *channel = get_dma_channel(chan);
if (info->ops->extend)
return info->ops->extend(channel, op, param);
return -ENOSYS;
}
EXPORT_SYMBOL(dma_extend);
static int dma_proc_show(struct seq_file *m, void *v) static int dma_proc_show(struct seq_file *m, void *v)
{ {
struct dma_info *info = v; struct dma_info *info = v;
......
...@@ -91,7 +91,7 @@ static int switch_drv_probe(struct platform_device *pdev) ...@@ -91,7 +91,7 @@ static int switch_drv_probe(struct platform_device *pdev)
return ret; return ret;
} }
static int switch_drv_remove(struct platform_device *pdev) static void switch_drv_remove(struct platform_device *pdev)
{ {
struct push_switch *psw = platform_get_drvdata(pdev); struct push_switch *psw = platform_get_drvdata(pdev);
struct push_switch_platform_info *psw_info = pdev->dev.platform_data; struct push_switch_platform_info *psw_info = pdev->dev.platform_data;
...@@ -106,13 +106,11 @@ static int switch_drv_remove(struct platform_device *pdev) ...@@ -106,13 +106,11 @@ static int switch_drv_remove(struct platform_device *pdev)
free_irq(irq, pdev); free_irq(irq, pdev);
kfree(psw); kfree(psw);
return 0;
} }
static struct platform_driver switch_driver = { static struct platform_driver switch_driver = {
.probe = switch_drv_probe, .probe = switch_drv_probe,
.remove = switch_drv_remove, .remove_new = switch_drv_remove,
.driver = { .driver = {
.name = DRV_NAME, .name = DRV_NAME,
}, },
......
...@@ -104,6 +104,18 @@ void kunmap_coherent(void *kvaddr); ...@@ -104,6 +104,18 @@ void kunmap_coherent(void *kvaddr);
void cpu_cache_init(void); void cpu_cache_init(void);
void __weak l2_cache_init(void);
void __weak j2_cache_init(void);
void __weak sh2_cache_init(void);
void __weak sh2a_cache_init(void);
void __weak sh3_cache_init(void);
void __weak shx3_cache_init(void);
void __weak sh4_cache_init(void);
void __weak sh7705_cache_init(void);
void __weak sh4__flush_region_init(void);
static inline void *sh_cacheop_vaddr(void *vaddr) static inline void *sh_cacheop_vaddr(void *vaddr)
{ {
if (__in_29bit_mode()) if (__in_29bit_mode())
......
...@@ -56,7 +56,6 @@ struct dma_ops { ...@@ -56,7 +56,6 @@ struct dma_ops {
int (*get_residue)(struct dma_channel *chan); int (*get_residue)(struct dma_channel *chan);
int (*xfer)(struct dma_channel *chan); int (*xfer)(struct dma_channel *chan);
int (*configure)(struct dma_channel *chan, unsigned long flags); int (*configure)(struct dma_channel *chan, unsigned long flags);
int (*extend)(struct dma_channel *chan, unsigned long op, void *param);
}; };
struct dma_channel { struct dma_channel {
...@@ -118,8 +117,6 @@ extern int dma_xfer(unsigned int chan, unsigned long from, ...@@ -118,8 +117,6 @@ extern int dma_xfer(unsigned int chan, unsigned long from,
#define dma_read_page(chan, from, to) \ #define dma_read_page(chan, from, to) \
dma_read(chan, from, to, PAGE_SIZE) dma_read(chan, from, to, PAGE_SIZE)
extern int request_dma_bycap(const char **dmac, const char **caps,
const char *dev_id);
extern int get_dma_residue(unsigned int chan); extern int get_dma_residue(unsigned int chan);
extern struct dma_info *get_dma_info(unsigned int chan); extern struct dma_info *get_dma_info(unsigned int chan);
extern struct dma_channel *get_dma_channel(unsigned int chan); extern struct dma_channel *get_dma_channel(unsigned int chan);
...@@ -128,10 +125,6 @@ extern void dma_configure_channel(unsigned int chan, unsigned long flags); ...@@ -128,10 +125,6 @@ extern void dma_configure_channel(unsigned int chan, unsigned long flags);
extern int register_dmac(struct dma_info *info); extern int register_dmac(struct dma_info *info);
extern void unregister_dmac(struct dma_info *info); extern void unregister_dmac(struct dma_info *info);
extern struct dma_info *get_dma_info_by_name(const char *dmac_name);
extern int dma_extend(unsigned int chan, unsigned long op, void *param);
extern int register_chan_caps(const char *dmac, struct dma_chan_caps *capslist);
/* arch/sh/drivers/dma/dma-sysfs.c */ /* arch/sh/drivers/dma/dma-sysfs.c */
extern int dma_create_sysfs_files(struct dma_channel *, struct dma_info *); extern int dma_create_sysfs_files(struct dma_channel *, struct dma_info *);
......
...@@ -64,6 +64,9 @@ static inline void clear_fpu(struct task_struct *tsk, struct pt_regs *regs) ...@@ -64,6 +64,9 @@ static inline void clear_fpu(struct task_struct *tsk, struct pt_regs *regs)
preempt_enable(); preempt_enable();
} }
void float_raise(unsigned int flags);
int float_rounding_mode(void);
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
#endif /* __ASM_SH_FPU_H */ #endif /* __ASM_SH_FPU_H */
...@@ -33,6 +33,8 @@ static inline unsigned long ftrace_call_adjust(unsigned long addr) ...@@ -33,6 +33,8 @@ static inline unsigned long ftrace_call_adjust(unsigned long addr)
return addr; return addr;
} }
void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr);
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
#endif /* CONFIG_FUNCTION_TRACER */ #endif /* CONFIG_FUNCTION_TRACER */
...@@ -43,6 +45,14 @@ extern void *return_address(unsigned int); ...@@ -43,6 +45,14 @@ extern void *return_address(unsigned int);
#define ftrace_return_address(n) return_address(n) #define ftrace_return_address(n) return_address(n)
#ifdef CONFIG_DYNAMIC_FTRACE
extern void arch_ftrace_nmi_enter(void);
extern void arch_ftrace_nmi_exit(void);
#else
static inline void arch_ftrace_nmi_enter(void) { }
static inline void arch_ftrace_nmi_exit(void) { }
#endif
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
#endif /* __ASM_SH_FTRACE_H */ #endif /* __ASM_SH_FTRACE_H */
...@@ -52,6 +52,8 @@ struct pmu; ...@@ -52,6 +52,8 @@ struct pmu;
/* arch/sh/kernel/hw_breakpoint.c */ /* arch/sh/kernel/hw_breakpoint.c */
extern int arch_check_bp_in_kernelspace(struct arch_hw_breakpoint *hw); extern int arch_check_bp_in_kernelspace(struct arch_hw_breakpoint *hw);
extern int arch_bp_generic_fields(int sh_len, int sh_type, int *gen_len,
int *gen_type);
extern int hw_breakpoint_arch_parse(struct perf_event *bp, extern int hw_breakpoint_arch_parse(struct perf_event *bp,
const struct perf_event_attr *attr, const struct perf_event_attr *attr,
struct arch_hw_breakpoint *hw); struct arch_hw_breakpoint *hw);
......
...@@ -21,5 +21,6 @@ ...@@ -21,5 +21,6 @@
void sh_mv_setup(void); void sh_mv_setup(void);
void check_for_initrd(void); void check_for_initrd(void);
void per_cpu_trap_init(void); void per_cpu_trap_init(void);
void sh_fdt_init(phys_addr_t dt_phys);
#endif /* _SH_SETUP_H */ #endif /* _SH_SETUP_H */
...@@ -8,6 +8,7 @@ asmlinkage int old_mmap(unsigned long addr, unsigned long len, ...@@ -8,6 +8,7 @@ asmlinkage int old_mmap(unsigned long addr, unsigned long len,
asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
unsigned long prot, unsigned long flags, unsigned long prot, unsigned long flags,
unsigned long fd, unsigned long pgoff); unsigned long fd, unsigned long pgoff);
asmlinkage int sys_cacheflush(unsigned long addr, unsigned long len, int op);
#include <asm/syscalls_32.h> #include <asm/syscalls_32.h>
......
...@@ -24,6 +24,10 @@ static inline void tlb_unwire_entry(void) ...@@ -24,6 +24,10 @@ static inline void tlb_unwire_entry(void)
BUG(); BUG();
} }
#endif /* CONFIG_CPU_SH4 */ #endif /* CONFIG_CPU_SH4 */
asmlinkage int handle_tlbmiss(struct pt_regs *regs, unsigned long error_code,
unsigned long address);
#endif /* CONFIG_MMU */ #endif /* CONFIG_MMU */
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
#endif /* __ASM_SH_TLB_H */ #endif /* __ASM_SH_TLB_H */
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
*/ */
#include <linux/kernel.h> #include <linux/kernel.h>
#include <asm/processor.h>
/* /*
* Instructions on SH are generally fixed at 16-bits, however, SH-2A * Instructions on SH are generally fixed at 16-bits, however, SH-2A
* introduces some 32-bit instructions. Since there are no real * introduces some 32-bit instructions. Since there are no real
......
...@@ -14,9 +14,12 @@ ...@@ -14,9 +14,12 @@
#include <linux/sh_timer.h> #include <linux/sh_timer.h>
#include <linux/sh_intc.h> #include <linux/sh_intc.h>
#include <linux/io.h> #include <linux/io.h>
#include <asm/cacheflush.h>
#include <asm/clock.h> #include <asm/clock.h>
#include <asm/mmzone.h> #include <asm/mmzone.h>
#include <asm/platform_early.h> #include <asm/platform_early.h>
#include <cpu/sh7723.h> #include <cpu/sh7723.h>
/* Serial */ /* Serial */
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <linux/io.h> #include <linux/io.h>
#include <linux/notifier.h> #include <linux/notifier.h>
#include <asm/cacheflush.h>
#include <asm/suspend.h> #include <asm/suspend.h>
#include <asm/clock.h> #include <asm/clock.h>
#include <asm/mmzone.h> #include <asm/mmzone.h>
......
...@@ -17,8 +17,11 @@ ...@@ -17,8 +17,11 @@
#include <linux/sh_dma.h> #include <linux/sh_dma.h>
#include <linux/sh_intc.h> #include <linux/sh_intc.h>
#include <linux/usb/ohci_pdriver.h> #include <linux/usb/ohci_pdriver.h>
#include <cpu/dma-register.h> #include <cpu/dma-register.h>
#include <cpu/sh7757.h> #include <cpu/sh7757.h>
#include <asm/mmzone.h>
#include <asm/platform_early.h> #include <asm/platform_early.h>
static struct plat_sci_port scif2_platform_data = { static struct plat_sci_port scif2_platform_data = {
......
...@@ -400,20 +400,6 @@ static struct platform_device *sh7786_devices[] __initdata = { ...@@ -400,20 +400,6 @@ static struct platform_device *sh7786_devices[] __initdata = {
&usb_ohci_device, &usb_ohci_device,
}; };
/*
* Please call this function if your platform board
* use external clock for USB
* */
#define USBCTL0 0xffe70858
#define CLOCK_MODE_MASK 0xffffff7f
#define EXT_CLOCK_MODE 0x00000080
void __init sh7786_usb_use_exclock(void)
{
u32 val = __raw_readl(USBCTL0) & CLOCK_MODE_MASK;
__raw_writel(val | EXT_CLOCK_MODE, USBCTL0);
}
#define USBINITREG1 0xffe70094 #define USBINITREG1 0xffe70094
#define USBINITREG2 0xffe7009c #define USBINITREG2 0xffe7009c
#define USBINITVAL1 0x00ff0040 #define USBINITVAL1 0x00ff0040
......
...@@ -344,7 +344,7 @@ static struct dwarf_cie *dwarf_lookup_cie(unsigned long cie_ptr) ...@@ -344,7 +344,7 @@ static struct dwarf_cie *dwarf_lookup_cie(unsigned long cie_ptr)
* dwarf_lookup_fde - locate the FDE that covers pc * dwarf_lookup_fde - locate the FDE that covers pc
* @pc: the program counter * @pc: the program counter
*/ */
struct dwarf_fde *dwarf_lookup_fde(unsigned long pc) static struct dwarf_fde *dwarf_lookup_fde(unsigned long pc)
{ {
struct rb_node **rb_node = &fde_root.rb_node; struct rb_node **rb_node = &fde_root.rb_node;
struct dwarf_fde *fde = NULL; struct dwarf_fde *fde = NULL;
......
...@@ -39,22 +39,17 @@ static DEFINE_PER_CPU(struct kprobe, saved_next_opcode2); ...@@ -39,22 +39,17 @@ static DEFINE_PER_CPU(struct kprobe, saved_next_opcode2);
int __kprobes arch_prepare_kprobe(struct kprobe *p) int __kprobes arch_prepare_kprobe(struct kprobe *p)
{ {
kprobe_opcode_t opcode = *(kprobe_opcode_t *) (p->addr); kprobe_opcode_t opcode = *p->addr;
if (OPCODE_RTE(opcode)) if (OPCODE_RTE(opcode))
return -EFAULT; /* Bad breakpoint */ return -EFAULT; /* Bad breakpoint */
memcpy(p->ainsn.insn, p->addr, MAX_INSN_SIZE * sizeof(kprobe_opcode_t));
p->opcode = opcode; p->opcode = opcode;
return 0; return 0;
} }
void __kprobes arch_copy_kprobe(struct kprobe *p)
{
memcpy(p->ainsn.insn, p->addr, MAX_INSN_SIZE * sizeof(kprobe_opcode_t));
p->opcode = *p->addr;
}
void __kprobes arch_arm_kprobe(struct kprobe *p) void __kprobes arch_arm_kprobe(struct kprobe *p)
{ {
*p->addr = BREAKPOINT_INSTRUCTION; *p->addr = BREAKPOINT_INSTRUCTION;
...@@ -253,7 +248,7 @@ static int __kprobes kprobe_handler(struct pt_regs *regs) ...@@ -253,7 +248,7 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
p = get_kprobe(addr); p = get_kprobe(addr);
if (!p) { if (!p) {
/* Not one of ours: let kernel handle it */ /* Not one of ours: let kernel handle it */
if (*(kprobe_opcode_t *)addr != BREAKPOINT_INSTRUCTION) { if (*addr != BREAKPOINT_INSTRUCTION) {
/* /*
* The breakpoint instruction was removed right * The breakpoint instruction was removed right
* after we hit it. Another cpu has removed * after we hit it. Another cpu has removed
...@@ -301,7 +296,7 @@ static void __used kretprobe_trampoline_holder(void) ...@@ -301,7 +296,7 @@ static void __used kretprobe_trampoline_holder(void)
/* /*
* Called when we hit the probe point at __kretprobe_trampoline * Called when we hit the probe point at __kretprobe_trampoline
*/ */
int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs) static int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
{ {
regs->pc = __kretprobe_trampoline_handler(regs, NULL); regs->pc = __kretprobe_trampoline_handler(regs, NULL);
......
...@@ -7,7 +7,9 @@ ...@@ -7,7 +7,9 @@
*/ */
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <asm/dwarf.h> #include <asm/dwarf.h>
#include <asm/ftrace.h>
#ifdef CONFIG_DWARF_UNWINDER #ifdef CONFIG_DWARF_UNWINDER
......
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
#include <linux/sched/hotplug.h> #include <linux/sched/hotplug.h>
#include <linux/atomic.h> #include <linux/atomic.h>
#include <linux/clockchips.h> #include <linux/clockchips.h>
#include <linux/profile.h>
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/mmu_context.h> #include <asm/mmu_context.h>
#include <asm/smp.h> #include <asm/smp.h>
...@@ -170,7 +172,7 @@ void native_play_dead(void) ...@@ -170,7 +172,7 @@ void native_play_dead(void)
} }
#endif #endif
asmlinkage void start_secondary(void) static asmlinkage void start_secondary(void)
{ {
unsigned int cpu = smp_processor_id(); unsigned int cpu = smp_processor_id();
struct mm_struct *mm = &init_mm; struct mm_struct *mm = &init_mm;
...@@ -320,11 +322,13 @@ void smp_message_recv(unsigned int msg) ...@@ -320,11 +322,13 @@ void smp_message_recv(unsigned int msg)
} }
} }
#ifdef CONFIG_PROFILING
/* Not really SMP stuff ... */ /* Not really SMP stuff ... */
int setup_profiling_timer(unsigned int multiplier) int setup_profiling_timer(unsigned int multiplier)
{ {
return 0; return 0;
} }
#endif
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
#include <linux/extable.h> #include <linux/extable.h>
#include <linux/module.h> /* print_modules */ #include <linux/module.h> /* print_modules */
#include <asm/ftrace.h>
#include <asm/unwinder.h> #include <asm/unwinder.h>
#include <asm/traps.h> #include <asm/traps.h>
...@@ -170,14 +172,6 @@ BUILD_TRAP_HANDLER(bug) ...@@ -170,14 +172,6 @@ BUILD_TRAP_HANDLER(bug)
force_sig(SIGTRAP); force_sig(SIGTRAP);
} }
#ifdef CONFIG_DYNAMIC_FTRACE
extern void arch_ftrace_nmi_enter(void);
extern void arch_ftrace_nmi_exit(void);
#else
static inline void arch_ftrace_nmi_enter(void) { }
static inline void arch_ftrace_nmi_exit(void) { }
#endif
BUILD_TRAP_HANDLER(nmi) BUILD_TRAP_HANDLER(nmi)
{ {
TRAP_HANDLER_DECL; TRAP_HANDLER_DECL;
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <asm/alignment.h> #include <asm/alignment.h>
#include <asm/fpu.h> #include <asm/fpu.h>
#include <asm/kprobes.h> #include <asm/kprobes.h>
#include <asm/setup.h>
#include <asm/traps.h> #include <asm/traps.h>
#include <asm/bl_bit.h> #include <asm/bl_bit.h>
...@@ -568,7 +569,7 @@ asmlinkage void do_address_error(struct pt_regs *regs, ...@@ -568,7 +569,7 @@ asmlinkage void do_address_error(struct pt_regs *regs,
/* /*
* SH-DSP support gerg@snapgear.com. * SH-DSP support gerg@snapgear.com.
*/ */
int is_dsp_inst(struct pt_regs *regs) static int is_dsp_inst(struct pt_regs *regs)
{ {
unsigned short inst = 0; unsigned short inst = 0;
...@@ -590,7 +591,7 @@ int is_dsp_inst(struct pt_regs *regs) ...@@ -590,7 +591,7 @@ int is_dsp_inst(struct pt_regs *regs)
return 0; return 0;
} }
#else #else
#define is_dsp_inst(regs) (0) static inline int is_dsp_inst(struct pt_regs *regs) { return 0; }
#endif /* CONFIG_SH_DSP */ #endif /* CONFIG_SH_DSP */
#ifdef CONFIG_CPU_SH2A #ifdef CONFIG_CPU_SH2A
......
...@@ -33,7 +33,8 @@ ...@@ -33,7 +33,8 @@
*/ */
/* /*
* asmlinkage __wsum csum_partial(const void *buf, int len, __wsum sum); * unsigned int csum_partial(const unsigned char *buf, int len,
* unsigned int sum);
*/ */
.text .text
...@@ -45,31 +46,11 @@ ENTRY(csum_partial) ...@@ -45,31 +46,11 @@ ENTRY(csum_partial)
* Fortunately, it is easy to convert 2-byte alignment to 4-byte * Fortunately, it is easy to convert 2-byte alignment to 4-byte
* alignment for the unrolled loop. * alignment for the unrolled loop.
*/ */
mov r5, r1
mov r4, r0 mov r4, r0
tst #3, r0 ! Check alignment. tst #2, r0 ! Check alignment.
bt/s 2f ! Jump if alignment is ok. bt 2f ! Jump if alignment is ok.
mov r4, r7 ! Keep a copy to check for alignment
! !
tst #1, r0 ! Check alignment.
bt 21f ! Jump if alignment is boundary of 2bytes.
! buf is odd
tst r5, r5
add #-1, r5
bt 9f
mov.b @r4+, r0
extu.b r0, r0
addc r0, r6 ! t=0 from previous tst
mov r6, r0
shll8 r6
shlr16 r0
shlr8 r0
or r0, r6
mov r4, r0
tst #2, r0
bt 2f
21:
! buf is 2 byte aligned (len could be 0)
add #-2, r5 ! Alignment uses up two bytes. add #-2, r5 ! Alignment uses up two bytes.
cmp/pz r5 ! cmp/pz r5 !
bt/s 1f ! Jump if we had at least two bytes. bt/s 1f ! Jump if we had at least two bytes.
...@@ -77,17 +58,16 @@ ENTRY(csum_partial) ...@@ -77,17 +58,16 @@ ENTRY(csum_partial)
bra 6f bra 6f
add #2, r5 ! r5 was < 2. Deal with it. add #2, r5 ! r5 was < 2. Deal with it.
1: 1:
mov r5, r1 ! Save new len for later use.
mov.w @r4+, r0 mov.w @r4+, r0
extu.w r0, r0 extu.w r0, r0
addc r0, r6 addc r0, r6
bf 2f bf 2f
add #1, r6 add #1, r6
2: 2:
! buf is 4 byte aligned (len could be 0)
mov r5, r1
mov #-5, r0 mov #-5, r0
shld r0, r1 shld r0, r5
tst r1, r1 tst r5, r5
bt/s 4f ! if it's =0, go to 4f bt/s 4f ! if it's =0, go to 4f
clrt clrt
.align 2 .align 2
...@@ -109,31 +89,30 @@ ENTRY(csum_partial) ...@@ -109,31 +89,30 @@ ENTRY(csum_partial)
addc r0, r6 addc r0, r6
addc r2, r6 addc r2, r6
movt r0 movt r0
dt r1 dt r5
bf/s 3b bf/s 3b
cmp/eq #1, r0 cmp/eq #1, r0
! here, we know r1==0 ! here, we know r5==0
addc r1, r6 ! add carry to r6 addc r5, r6 ! add carry to r6
4: 4:
mov r5, r0 mov r1, r0
and #0x1c, r0 and #0x1c, r0
tst r0, r0 tst r0, r0
bt 6f bt/s 6f
! 4 bytes or more remaining mov r0, r5
mov r0, r1 shlr2 r5
shlr2 r1
mov #0, r2 mov #0, r2
5: 5:
addc r2, r6 addc r2, r6
mov.l @r4+, r2 mov.l @r4+, r2
movt r0 movt r0
dt r1 dt r5
bf/s 5b bf/s 5b
cmp/eq #1, r0 cmp/eq #1, r0
addc r2, r6 addc r2, r6
addc r1, r6 ! r1==0 here, so it means add carry-bit addc r5, r6 ! r5==0 here, so it means add carry-bit
6: 6:
! 3 bytes or less remaining mov r1, r5
mov #3, r0 mov #3, r0
and r0, r5 and r0, r5
tst r5, r5 tst r5, r5
...@@ -159,16 +138,6 @@ ENTRY(csum_partial) ...@@ -159,16 +138,6 @@ ENTRY(csum_partial)
mov #0, r0 mov #0, r0
addc r0, r6 addc r0, r6
9: 9:
! Check if the buffer was misaligned, if so realign sum
mov r7, r0
tst #1, r0
bt 10f
mov r6, r0
shll8 r6
shlr16 r0
shlr8 r0
or r0, r6
10:
rts rts
mov r6, r0 mov r6, r0
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
#include <linux/perf_event.h> #include <linux/perf_event.h>
#include <linux/uaccess.h> #include <linux/uaccess.h>
#include <asm/fpu.h>
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/io.h> #include <asm/io.h>
......
...@@ -376,8 +376,6 @@ static void __flush_cache_one(unsigned long addr, unsigned long phys, ...@@ -376,8 +376,6 @@ static void __flush_cache_one(unsigned long addr, unsigned long phys,
} while (--way_count != 0); } while (--way_count != 0);
} }
extern void __weak sh4__flush_region_init(void);
/* /*
* SH-4 has virtually indexed and physically tagged cache. * SH-4 has virtually indexed and physically tagged cache.
*/ */
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/io.h> #include <linux/io.h>
#include <asm/cache.h> #include <asm/cache.h>
#include <asm/cacheflush.h>
#define CCR_CACHE_SNM 0x40000 /* Hardware-assisted synonym avoidance */ #define CCR_CACHE_SNM 0x40000 /* Hardware-assisted synonym avoidance */
#define CCR_CACHE_IBE 0x1000000 /* ICBI broadcast */ #define CCR_CACHE_IBE 0x1000000 /* ICBI broadcast */
......
...@@ -320,30 +320,20 @@ void __init cpu_cache_init(void) ...@@ -320,30 +320,20 @@ void __init cpu_cache_init(void)
goto skip; goto skip;
if (boot_cpu_data.type == CPU_J2) { if (boot_cpu_data.type == CPU_J2) {
extern void __weak j2_cache_init(void);
j2_cache_init(); j2_cache_init();
} else if (boot_cpu_data.family == CPU_FAMILY_SH2) { } else if (boot_cpu_data.family == CPU_FAMILY_SH2) {
extern void __weak sh2_cache_init(void);
sh2_cache_init(); sh2_cache_init();
} }
if (boot_cpu_data.family == CPU_FAMILY_SH2A) { if (boot_cpu_data.family == CPU_FAMILY_SH2A) {
extern void __weak sh2a_cache_init(void);
sh2a_cache_init(); sh2a_cache_init();
} }
if (boot_cpu_data.family == CPU_FAMILY_SH3) { if (boot_cpu_data.family == CPU_FAMILY_SH3) {
extern void __weak sh3_cache_init(void);
sh3_cache_init(); sh3_cache_init();
if ((boot_cpu_data.type == CPU_SH7705) && if ((boot_cpu_data.type == CPU_SH7705) &&
(boot_cpu_data.dcache.sets == 512)) { (boot_cpu_data.dcache.sets == 512)) {
extern void __weak sh7705_cache_init(void);
sh7705_cache_init(); sh7705_cache_init();
} }
} }
...@@ -351,14 +341,10 @@ void __init cpu_cache_init(void) ...@@ -351,14 +341,10 @@ void __init cpu_cache_init(void)
if ((boot_cpu_data.family == CPU_FAMILY_SH4) || if ((boot_cpu_data.family == CPU_FAMILY_SH4) ||
(boot_cpu_data.family == CPU_FAMILY_SH4A) || (boot_cpu_data.family == CPU_FAMILY_SH4A) ||
(boot_cpu_data.family == CPU_FAMILY_SH4AL_DSP)) { (boot_cpu_data.family == CPU_FAMILY_SH4AL_DSP)) {
extern void __weak sh4_cache_init(void);
sh4_cache_init(); sh4_cache_init();
if ((boot_cpu_data.type == CPU_SH7786) || if ((boot_cpu_data.type == CPU_SH7786) ||
(boot_cpu_data.type == CPU_SHX3)) { (boot_cpu_data.type == CPU_SHX3)) {
extern void __weak shx3_cache_init(void);
shx3_cache_init(); shx3_cache_init();
} }
} }
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <asm/cacheflush.h>
#include <asm/tlbflush.h> #include <asm/tlbflush.h>
#include <asm/page.h> #include <asm/page.h>
#include <linux/uaccess.h> #include <linux/uaccess.h>
......
...@@ -2,12 +2,14 @@ ...@@ -2,12 +2,14 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <asm/pgalloc.h>
static struct kmem_cache *pgd_cachep; static struct kmem_cache *pgd_cachep;
#if PAGETABLE_LEVELS > 2 #if PAGETABLE_LEVELS > 2
static struct kmem_cache *pmd_cachep; static struct kmem_cache *pmd_cachep;
#endif #endif
void pgd_ctor(void *x) static void pgd_ctor(void *x)
{ {
pgd_t *pgd = x; pgd_t *pgd = x;
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <linux/kdebug.h> #include <linux/kdebug.h>
#include <asm/mmu_context.h> #include <asm/mmu_context.h>
#include <asm/thread_info.h> #include <asm/thread_info.h>
#include <asm/tlb.h>
/* /*
* Called with interrupts disabled. * Called with interrupts disabled.
......
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