Skip to content

Commit

Permalink
Merge branch 'sh/for-2.6.34' of git://git.kernel.org/pub/scm/linux/ke…
Browse files Browse the repository at this point in the history
…rnel/git/lethal/sh-2.6

* 'sh/for-2.6.34' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6:
  sh: Fix up the SH-3 build for recent TLB changes.
  sh: export return_address() symbol.
  sh: Enable the mmu in start_secondary()
  sh: Fix FDPIC binary loader
  arch/sh/kernel: Use set_cpus_allowed_ptr
  sh: Update ecovec_defconfig
  USB gadget r8a66597-udc.c: duplicated include
  sh: update the TLB replacement counter for entry wiring.
  • Loading branch information
Linus Torvalds committed Apr 2, 2010
2 parents 42be79e + be97d75 commit bc53ba2
Show file tree
Hide file tree
Showing 12 changed files with 294 additions and 84 deletions.
236 changes: 190 additions & 46 deletions arch/sh/configs/ecovec24_defconfig

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions arch/sh/include/asm/elf.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,15 +211,17 @@ extern void __kernel_vsyscall;

#define VSYSCALL_AUX_ENT \
if (vdso_enabled) \
NEW_AUX_ENT(AT_SYSINFO_EHDR, VDSO_BASE);
NEW_AUX_ENT(AT_SYSINFO_EHDR, VDSO_BASE); \
else \
NEW_AUX_ENT(AT_IGNORE, 0);
#else
#define VSYSCALL_AUX_ENT
#endif /* CONFIG_VSYSCALL */

#ifdef CONFIG_SH_FPU
#define FPU_AUX_ENT NEW_AUX_ENT(AT_FPUCW, FPSCR_INIT)
#else
#define FPU_AUX_ENT
#define FPU_AUX_ENT NEW_AUX_ENT(AT_IGNORE, 0)
#endif

extern int l1i_cache_shape, l1d_cache_shape, l2_cache_shape;
Expand Down
2 changes: 2 additions & 0 deletions arch/sh/include/cpu-sh4/cpu/mmu_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#define MMUCR_URB 0x00FC0000
#define MMUCR_URB_SHIFT 18
#define MMUCR_URB_NENTRIES 64
#define MMUCR_URC 0x0000FC00
#define MMUCR_URC_SHIFT 10

#if defined(CONFIG_32BIT) && defined(CONFIG_CPU_SUBTYPE_ST40)
#define MMUCR_SE (1 << 4)
Expand Down
4 changes: 2 additions & 2 deletions arch/sh/kernel/cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ static int sh_cpufreq_target(struct cpufreq_policy *policy,
return -ENODEV;

cpus_allowed = current->cpus_allowed;
set_cpus_allowed(current, cpumask_of_cpu(cpu));
set_cpus_allowed_ptr(current, cpumask_of(cpu));

BUG_ON(smp_processor_id() != cpu);

Expand All @@ -66,7 +66,7 @@ static int sh_cpufreq_target(struct cpufreq_policy *policy,
freqs.flags = 0;

cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
set_cpus_allowed(current, cpus_allowed);
set_cpus_allowed_ptr(current, &cpus_allowed);
clk_set_rate(cpuclk, freq);
cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);

Expand Down
3 changes: 3 additions & 0 deletions arch/sh/kernel/return_address.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* for more details.
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <asm/dwarf.h>

#ifdef CONFIG_DWARF_UNWINDER
Expand Down Expand Up @@ -52,3 +53,5 @@ void *return_address(unsigned int depth)
}

#endif

EXPORT_SYMBOL_GPL(return_address);
1 change: 1 addition & 0 deletions arch/sh/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ asmlinkage void __cpuinit start_secondary(void)
unsigned int cpu;
struct mm_struct *mm = &init_mm;

enable_mmu();
atomic_inc(&mm->mm_count);
atomic_inc(&mm->mm_users);
current->active_mm = mm;
Expand Down
28 changes: 28 additions & 0 deletions arch/sh/mm/tlb-pteaex.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,31 @@ void local_flush_tlb_one(unsigned long asid, unsigned long page)
__raw_writel(asid, MMU_ITLB_ADDRESS_ARRAY2 | MMU_PAGE_ASSOC_BIT);
back_to_cached();
}

void local_flush_tlb_all(void)
{
unsigned long flags, status;
int i;

/*
* Flush all the TLB.
*/
local_irq_save(flags);
jump_to_uncached();

status = __raw_readl(MMUCR);
status = ((status & MMUCR_URB) >> MMUCR_URB_SHIFT);

if (status == 0)
status = MMUCR_URB_NENTRIES;

for (i = 0; i < status; i++)
__raw_writel(0x0, MMU_UTLB_ADDRESS_ARRAY | (i << 8));

for (i = 0; i < 4; i++)
__raw_writel(0x0, MMU_ITLB_ADDRESS_ARRAY | (i << 8));

back_to_cached();
ctrl_barrier();
local_irq_restore(flags);
}
19 changes: 19 additions & 0 deletions arch/sh/mm/tlb-sh3.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,22 @@ void local_flush_tlb_one(unsigned long asid, unsigned long page)
for (i = 0; i < ways; i++)
__raw_writel(data, addr + (i << 8));
}

void local_flush_tlb_all(void)
{
unsigned long flags, status;

/*
* Flush all the TLB.
*
* Write to the MMU control register's bit:
* TF-bit for SH-3, TI-bit for SH-4.
* It's same position, bit #2.
*/
local_irq_save(flags);
status = __raw_readl(MMUCR);
status |= 0x04;
__raw_writel(status, MMUCR);
ctrl_barrier();
local_irq_restore(flags);
}
28 changes: 28 additions & 0 deletions arch/sh/mm/tlb-sh4.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,31 @@ void local_flush_tlb_one(unsigned long asid, unsigned long page)
__raw_writel(data, addr);
back_to_cached();
}

void local_flush_tlb_all(void)
{
unsigned long flags, status;
int i;

/*
* Flush all the TLB.
*/
local_irq_save(flags);
jump_to_uncached();

status = __raw_readl(MMUCR);
status = ((status & MMUCR_URB) >> MMUCR_URB_SHIFT);

if (status == 0)
status = MMUCR_URB_NENTRIES;

for (i = 0; i < status; i++)
__raw_writel(0x0, MMU_UTLB_ADDRESS_ARRAY | (i << 8));

for (i = 0; i < 4; i++)
__raw_writel(0x0, MMU_ITLB_ADDRESS_ARRAY | (i << 8));

back_to_cached();
ctrl_barrier();
local_irq_restore(flags);
}
22 changes: 17 additions & 5 deletions arch/sh/mm/tlb-urb.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,9 @@ void tlb_wire_entry(struct vm_area_struct *vma, unsigned long addr, pte_t pte)

local_irq_save(flags);

/* Load the entry into the TLB */
__update_tlb(vma, addr, pte);

/* ... and wire it up. */
status = __raw_readl(MMUCR);
urb = (status & MMUCR_URB) >> MMUCR_URB_SHIFT;
status &= ~MMUCR_URB;
status &= ~MMUCR_URC;

/*
* Make sure we're not trying to wire the last TLB entry slot.
Expand All @@ -39,7 +35,23 @@ void tlb_wire_entry(struct vm_area_struct *vma, unsigned long addr, pte_t pte)

urb = urb % MMUCR_URB_NENTRIES;

/*
* Insert this entry into the highest non-wired TLB slot (via
* the URC field).
*/
status |= (urb << MMUCR_URC_SHIFT);
__raw_writel(status, MMUCR);
ctrl_barrier();

/* Load the entry into the TLB */
__update_tlb(vma, addr, pte);

/* ... and wire it up. */
status = __raw_readl(MMUCR);

status &= ~MMUCR_URB;
status |= (urb << MMUCR_URB_SHIFT);

__raw_writel(status, MMUCR);
ctrl_barrier();

Expand Down
28 changes: 0 additions & 28 deletions arch/sh/mm/tlbflush_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,31 +119,3 @@ void local_flush_tlb_mm(struct mm_struct *mm)
local_irq_restore(flags);
}
}

void local_flush_tlb_all(void)
{
unsigned long flags, status;
int i;

/*
* Flush all the TLB.
*/
local_irq_save(flags);
jump_to_uncached();

status = __raw_readl(MMUCR);
status = ((status & MMUCR_URB) >> MMUCR_URB_SHIFT);

if (status == 0)
status = MMUCR_URB_NENTRIES;

for (i = 0; i < status; i++)
__raw_writel(0x0, MMU_UTLB_ADDRESS_ARRAY | (i << 8));

for (i = 0; i < 4; i++)
__raw_writel(0x0, MMU_ITLB_ADDRESS_ARRAY | (i << 8));

back_to_cached();
ctrl_barrier();
local_irq_restore(flags);
}
1 change: 0 additions & 1 deletion drivers/usb/gadget/r8a66597-udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <linux/err.h>
#include <linux/io.h>
#include <linux/platform_device.h>
#include <linux/clk.h>
Expand Down

0 comments on commit bc53ba2

Please sign in to comment.