Commit 54413b82 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus

* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus: (27 commits)
  MIPS: Loongson 2F: Fix of problems introduced by -mfix-loongson2f-jump
  MIPS: Loongson-2F: Use CONFIG_CPU_JUMP_WORKAROUNDS to control workarounds.
  MIPS: Loongson 2F: Enable fixups of the latest binutils
  MIPS: Loongson: Add CPU_LOONGSON2F_WORKAROUNDS
  MIPS: Kconfig: Make Broadcom SoC support naming consistent
  MIPS: BCM63xx: Update defconfig
  MIPS: oprofile: Fix breakage when CONFIG_OPROFILE=m
  STAGING: octeon-ethernet: Use proper phy addresses for Movidis hardware.
  NET: mdio-octeon: Enable the hardware before using it.
  I2C: Fix section mismatch errors in i2c-octeon.c
  MIPS: Loongson: Fix LOONGSON_ADDRWIN_CFG macro.
  MIPS: Loongson: Fix phys_mem_access_prot() check
  MIPS: Loongson: Fix find_vga_mem_init()
  MIPS: Loongson: Fix typo in gdium mach type string.
  MIPS: Use CKSEG1ADDR for uncached handler
  MIPS: Check for accesses beyond the end of the PGD.
  MIPS: Use uasm_i_ds{r,l}l_safe() instead of uasm_i_ds{r,l}l() in tlbex.c
  MIPS: Add uasm_i_dsrl_safe() and uasm_i_dsll_safe() to uasm.
  MIPS: die() does not call die notifier chain
  MIPS: Swarm, Littlesur: Enable PATA platform driver.
  ...
parents be1066bb 64fc74f5
...@@ -49,7 +49,7 @@ config AR7 ...@@ -49,7 +49,7 @@ config AR7
family: TNETD7100, 7200 and 7300. family: TNETD7100, 7200 and 7300.
config BCM47XX config BCM47XX
bool "BCM47XX based boards" bool "Broadcom BCM47XX based boards"
select CEVT_R4K select CEVT_R4K
select CSRC_R4K select CSRC_R4K
select DMA_NONCOHERENT select DMA_NONCOHERENT
...@@ -509,6 +509,7 @@ config SIBYTE_SWARM ...@@ -509,6 +509,7 @@ config SIBYTE_SWARM
bool "Sibyte BCM91250A-SWARM" bool "Sibyte BCM91250A-SWARM"
select BOOT_ELF32 select BOOT_ELF32
select DMA_COHERENT select DMA_COHERENT
select HAVE_PATA_PLATFORM
select NR_CPUS_DEFAULT_2 select NR_CPUS_DEFAULT_2
select SIBYTE_SB1250 select SIBYTE_SB1250
select SWAP_IO_SPACE select SWAP_IO_SPACE
...@@ -523,6 +524,7 @@ config SIBYTE_LITTLESUR ...@@ -523,6 +524,7 @@ config SIBYTE_LITTLESUR
depends on EXPERIMENTAL depends on EXPERIMENTAL
select BOOT_ELF32 select BOOT_ELF32
select DMA_COHERENT select DMA_COHERENT
select HAVE_PATA_PLATFORM
select NR_CPUS_DEFAULT_2 select NR_CPUS_DEFAULT_2
select SIBYTE_SB1250 select SIBYTE_SB1250
select SWAP_IO_SPACE select SWAP_IO_SPACE
...@@ -1305,6 +1307,33 @@ config CPU_CAVIUM_OCTEON ...@@ -1305,6 +1307,33 @@ config CPU_CAVIUM_OCTEON
endchoice endchoice
if CPU_LOONGSON2F
config CPU_NOP_WORKAROUNDS
bool
config CPU_JUMP_WORKAROUNDS
bool
config CPU_LOONGSON2F_WORKAROUNDS
bool "Loongson 2F Workarounds"
default y
select CPU_NOP_WORKAROUNDS
select CPU_JUMP_WORKAROUNDS
help
Loongson 2F01 / 2F02 processors have the NOP & JUMP issues which
require workarounds. Without workarounds the system may hang
unexpectedly. For more information please refer to the gas
-mfix-loongson2f-nop and -mfix-loongson2f-jump options.
Loongson 2F03 and later have fixed these issues and no workarounds
are needed. The workarounds have no significant side effect on them
but may decrease the performance of the system so this option should
be disabled unless the kernel is intended to be run on 2F01 or 2F02
systems.
If unsure, please say Y.
endif # CPU_LOONGSON2F
config SYS_SUPPORTS_ZBOOT config SYS_SUPPORTS_ZBOOT
bool bool
select HAVE_KERNEL_GZIP select HAVE_KERNEL_GZIP
......
...@@ -136,6 +136,19 @@ cflags-$(CONFIG_CPU_LOONGSON2E) += \ ...@@ -136,6 +136,19 @@ cflags-$(CONFIG_CPU_LOONGSON2E) += \
$(call cc-option,-march=loongson2e,-march=r4600) $(call cc-option,-march=loongson2e,-march=r4600)
cflags-$(CONFIG_CPU_LOONGSON2F) += \ cflags-$(CONFIG_CPU_LOONGSON2F) += \
$(call cc-option,-march=loongson2f,-march=r4600) $(call cc-option,-march=loongson2f,-march=r4600)
# enable the workarounds for loongson2f
ifdef CONFIG_CPU_LOONGSON2F_WORKAROUNDS
ifeq ($(call as-option,-Wa$(comma)-mfix-loongson2f-nop,),)
$(error only binutils >= 2.20.2 have needed option -mfix-loongson2f-nop)
else
cflags-$(CONFIG_CPU_NOP_WORKAROUNDS) += -Wa$(comma)-mfix-loongson2f-nop
endif
ifeq ($(call as-option,-Wa$(comma)-mfix-loongson2f-jump,),)
$(error only binutils >= 2.20.2 have needed option -mfix-loongson2f-jump)
else
cflags-$(CONFIG_CPU_JUMP_WORKAROUNDS) += -Wa$(comma)-mfix-loongson2f-jump
endif
endif
cflags-$(CONFIG_CPU_MIPS32_R1) += $(call cc-option,-march=mips32,-mips32 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS32) \ cflags-$(CONFIG_CPU_MIPS32_R1) += $(call cc-option,-march=mips32,-mips32 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS32) \
-Wa,-mips32 -Wa,--trap -Wa,-mips32 -Wa,--trap
......
...@@ -66,12 +66,16 @@ static int __init db1200_arch_init(void) ...@@ -66,12 +66,16 @@ static int __init db1200_arch_init(void)
set_irq_type(AU1200_GPIO7_INT, IRQF_TRIGGER_LOW); set_irq_type(AU1200_GPIO7_INT, IRQF_TRIGGER_LOW);
bcsr_init_irq(DB1200_INT_BEGIN, DB1200_INT_END, AU1200_GPIO7_INT); bcsr_init_irq(DB1200_INT_BEGIN, DB1200_INT_END, AU1200_GPIO7_INT);
/* do not autoenable these: CPLD has broken edge int handling, /* insert/eject pairs: one of both is always screaming. To avoid
* and the CD handler setup requires manual enabling to work * issues they must not be automatically enabled when initially
* around that. * requested.
*/ */
irq_to_desc(DB1200_SD0_INSERT_INT)->status |= IRQ_NOAUTOEN; irq_to_desc(DB1200_SD0_INSERT_INT)->status |= IRQ_NOAUTOEN;
irq_to_desc(DB1200_SD0_EJECT_INT)->status |= IRQ_NOAUTOEN; irq_to_desc(DB1200_SD0_EJECT_INT)->status |= IRQ_NOAUTOEN;
irq_to_desc(DB1200_PC0_INSERT_INT)->status |= IRQ_NOAUTOEN;
irq_to_desc(DB1200_PC0_EJECT_INT)->status |= IRQ_NOAUTOEN;
irq_to_desc(DB1200_PC1_INSERT_INT)->status |= IRQ_NOAUTOEN;
irq_to_desc(DB1200_PC1_EJECT_INT)->status |= IRQ_NOAUTOEN;
return 0; return 0;
} }
......
This diff is collapsed.
...@@ -307,7 +307,7 @@ extern unsigned long _loongson_addrwincfg_base; ...@@ -307,7 +307,7 @@ extern unsigned long _loongson_addrwincfg_base;
*/ */
#define LOONGSON_ADDRWIN_CFG(s, d, w, src, dst, size) do {\ #define LOONGSON_ADDRWIN_CFG(s, d, w, src, dst, size) do {\
s##_WIN##w##_BASE = (src); \ s##_WIN##w##_BASE = (src); \
s##_WIN##w##_MMAP = (src) | ADDRWIN_MAP_DST_##d; \ s##_WIN##w##_MMAP = (dst) | ADDRWIN_MAP_DST_##d; \
s##_WIN##w##_MASK = ~(size-1); \ s##_WIN##w##_MASK = ~(size-1); \
} while (0) } while (0)
......
...@@ -120,9 +120,14 @@ ...@@ -120,9 +120,14 @@
#endif #endif
#define FIRST_USER_ADDRESS 0UL #define FIRST_USER_ADDRESS 0UL
#define VMALLOC_START MAP_BASE /*
* TLB refill handlers also map the vmalloc area into xuseg. Avoid
* the first couple of pages so NULL pointer dereferences will still
* reliably trap.
*/
#define VMALLOC_START (MAP_BASE + (2 * PAGE_SIZE))
#define VMALLOC_END \ #define VMALLOC_END \
(VMALLOC_START + \ (MAP_BASE + \
min(PTRS_PER_PGD * PTRS_PER_PMD * PTRS_PER_PTE * PAGE_SIZE, \ min(PTRS_PER_PGD * PTRS_PER_PMD * PTRS_PER_PTE * PAGE_SIZE, \
(1UL << cpu_vmbits)) - (1UL << 32)) (1UL << cpu_vmbits)) - (1UL << 32))
......
...@@ -142,9 +142,9 @@ extern int ptrace_set_watch_regs(struct task_struct *child, ...@@ -142,9 +142,9 @@ extern int ptrace_set_watch_regs(struct task_struct *child,
extern asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit); extern asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit);
extern NORET_TYPE void die(const char *, const struct pt_regs *) ATTRIB_NORET; extern NORET_TYPE void die(const char *, struct pt_regs *) ATTRIB_NORET;
static inline void die_if_kernel(const char *str, const struct pt_regs *regs) static inline void die_if_kernel(const char *str, struct pt_regs *regs)
{ {
if (unlikely(!user_mode(regs))) if (unlikely(!user_mode(regs)))
die(str, regs); die(str, regs);
......
...@@ -121,7 +121,7 @@ ...@@ -121,7 +121,7 @@
.endm .endm
#else #else
.macro get_saved_sp /* Uniprocessor variation */ .macro get_saved_sp /* Uniprocessor variation */
#ifdef CONFIG_CPU_LOONGSON2F #ifdef CONFIG_CPU_JUMP_WORKAROUNDS
/* /*
* Clear BTB (branch target buffer), forbid RAS (return address * Clear BTB (branch target buffer), forbid RAS (return address
* stack) to workaround the Out-of-order Issue in Loongson2F * stack) to workaround the Out-of-order Issue in Loongson2F
......
...@@ -167,6 +167,24 @@ static inline void __cpuinit uasm_l##lb(struct uasm_label **lab, u32 *addr) \ ...@@ -167,6 +167,24 @@ static inline void __cpuinit uasm_l##lb(struct uasm_label **lab, u32 *addr) \
#define uasm_i_ssnop(buf) uasm_i_sll(buf, 0, 0, 1) #define uasm_i_ssnop(buf) uasm_i_sll(buf, 0, 0, 1)
#define uasm_i_ehb(buf) uasm_i_sll(buf, 0, 0, 3) #define uasm_i_ehb(buf) uasm_i_sll(buf, 0, 0, 3)
static inline void uasm_i_dsrl_safe(u32 **p, unsigned int a1,
unsigned int a2, unsigned int a3)
{
if (a3 < 32)
uasm_i_dsrl(p, a1, a2, a3);
else
uasm_i_dsrl32(p, a1, a2, a3 - 32);
}
static inline void uasm_i_dsll_safe(u32 **p, unsigned int a1,
unsigned int a2, unsigned int a3)
{
if (a3 < 32)
uasm_i_dsll(p, a1, a2, a3);
else
uasm_i_dsll32(p, a1, a2, a3 - 32);
}
/* Handle relocations. */ /* Handle relocations. */
struct uasm_reloc { struct uasm_reloc {
u32 *addr; u32 *addr;
......
...@@ -76,15 +76,9 @@ void __init plat_mem_setup(void) ...@@ -76,15 +76,9 @@ void __init plat_mem_setup(void)
#ifdef CONFIG_VT #ifdef CONFIG_VT
screen_info = (struct screen_info) { screen_info = (struct screen_info) {
0, 0, /* orig-x, orig-y */ .orig_video_cols = 160,
0, /* unused */ .orig_video_lines = 64,
0, /* orig_video_page */ .orig_video_points = 16,
0, /* orig_video_mode */
160, /* orig_video_cols */
0, 0, 0, /* unused, ega_bx, unused */
64, /* orig_video_lines */
0, /* orig_video_isVGA */
16 /* orig_video_points */
}; };
#endif #endif
......
...@@ -352,9 +352,10 @@ void show_registers(const struct pt_regs *regs) ...@@ -352,9 +352,10 @@ void show_registers(const struct pt_regs *regs)
static DEFINE_SPINLOCK(die_lock); static DEFINE_SPINLOCK(die_lock);
void __noreturn die(const char * str, const struct pt_regs * regs) void __noreturn die(const char * str, struct pt_regs * regs)
{ {
static int die_counter; static int die_counter;
int sig = SIGSEGV;
#ifdef CONFIG_MIPS_MT_SMTC #ifdef CONFIG_MIPS_MT_SMTC
unsigned long dvpret = dvpe(); unsigned long dvpret = dvpe();
#endif /* CONFIG_MIPS_MT_SMTC */ #endif /* CONFIG_MIPS_MT_SMTC */
...@@ -365,6 +366,10 @@ void __noreturn die(const char * str, const struct pt_regs * regs) ...@@ -365,6 +366,10 @@ void __noreturn die(const char * str, const struct pt_regs * regs)
#ifdef CONFIG_MIPS_MT_SMTC #ifdef CONFIG_MIPS_MT_SMTC
mips_mt_regdump(dvpret); mips_mt_regdump(dvpret);
#endif /* CONFIG_MIPS_MT_SMTC */ #endif /* CONFIG_MIPS_MT_SMTC */
if (notify_die(DIE_OOPS, str, regs, 0, current->thread.trap_no, SIGSEGV) == NOTIFY_STOP)
sig = 0;
printk("%s[#%d]:\n", str, ++die_counter); printk("%s[#%d]:\n", str, ++die_counter);
show_registers(regs); show_registers(regs);
add_taint(TAINT_DIE); add_taint(TAINT_DIE);
...@@ -379,7 +384,7 @@ void __noreturn die(const char * str, const struct pt_regs * regs) ...@@ -379,7 +384,7 @@ void __noreturn die(const char * str, const struct pt_regs * regs)
panic("Fatal exception"); panic("Fatal exception");
} }
do_exit(SIGSEGV); do_exit(sig);
} }
extern struct exception_table_entry __start___dbe_table[]; extern struct exception_table_entry __start___dbe_table[];
...@@ -1557,12 +1562,7 @@ static char panic_null_cerr[] __cpuinitdata = ...@@ -1557,12 +1562,7 @@ static char panic_null_cerr[] __cpuinitdata =
void __cpuinit set_uncached_handler(unsigned long offset, void *addr, void __cpuinit set_uncached_handler(unsigned long offset, void *addr,
unsigned long size) unsigned long size)
{ {
#ifdef CONFIG_32BIT unsigned long uncached_ebase = CKSEG1ADDR(ebase);
unsigned long uncached_ebase = KSEG1ADDR(ebase);
#endif
#ifdef CONFIG_64BIT
unsigned long uncached_ebase = TO_UNCAC(ebase);
#endif
if (!addr) if (!addr)
panic(panic_null_cerr); panic(panic_null_cerr);
......
...@@ -24,7 +24,7 @@ static const char *system_types[] = { ...@@ -24,7 +24,7 @@ static const char *system_types[] = {
[MACH_LEMOTE_FL2F] "lemote-fuloong-2f-box", [MACH_LEMOTE_FL2F] "lemote-fuloong-2f-box",
[MACH_LEMOTE_ML2F7] "lemote-mengloong-2f-7inches", [MACH_LEMOTE_ML2F7] "lemote-mengloong-2f-7inches",
[MACH_LEMOTE_YL2F89] "lemote-yeeloong-2f-8.9inches", [MACH_LEMOTE_YL2F89] "lemote-yeeloong-2f-8.9inches",
[MACH_DEXXON_GDIUM2F10] "dexxon-gidum-2f-10inches", [MACH_DEXXON_GDIUM2F10] "dexxon-gdium-2f",
[MACH_LEMOTE_NAS] "lemote-nas-2f", [MACH_LEMOTE_NAS] "lemote-nas-2f",
[MACH_LEMOTE_LL2F] "lemote-lynloong-2f", [MACH_LEMOTE_LL2F] "lemote-lynloong-2f",
[MACH_LOONGSON_END] NULL, [MACH_LOONGSON_END] NULL,
......
...@@ -75,7 +75,7 @@ pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, ...@@ -75,7 +75,7 @@ pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
unsigned long end = offset + size; unsigned long end = offset + size;
if (__uncached_access(file, offset)) { if (__uncached_access(file, offset)) {
if (((uca_start && offset) >= uca_start) && if (uca_start && (offset >= uca_start) &&
(end <= uca_end)) (end <= uca_end))
return __pgprot((pgprot_val(vma_prot) & return __pgprot((pgprot_val(vma_prot) &
~_CACHE_MASK) | ~_CACHE_MASK) |
...@@ -96,7 +96,7 @@ static int __init find_vga_mem_init(void) ...@@ -96,7 +96,7 @@ static int __init find_vga_mem_init(void)
return 0; return 0;
for_each_pci_dev(dev) { for_each_pci_dev(dev) {
if ((dev->class >> 8) == PCI_CLASS_DISPLAY_VGA) { if ((dev->class >> 16) == PCI_BASE_CLASS_DISPLAY) {
for (idx = 0; idx < PCI_NUM_RESOURCES; idx++) { for (idx = 0; idx < PCI_NUM_RESOURCES; idx++) {
r = &dev->resource[idx]; r = &dev->resource[idx];
if (!r->start && r->end) if (!r->start && r->end)
......
...@@ -16,13 +16,31 @@ ...@@ -16,13 +16,31 @@
#include <loongson.h> #include <loongson.h>
static inline void loongson_reboot(void)
{
#ifndef CONFIG_CPU_JUMP_WORKAROUNDS
((void (*)(void))ioremap_nocache(LOONGSON_BOOT_BASE, 4)) ();
#else
void (*func)(void);
func = (void *)ioremap_nocache(LOONGSON_BOOT_BASE, 4);
__asm__ __volatile__(
" .set noat \n"
" jr %[func] \n"
" .set at \n"
: /* No outputs */
: [func] "r" (func));
#endif
}
static void loongson_restart(char *command) static void loongson_restart(char *command)
{ {
/* do preparation for reboot */ /* do preparation for reboot */
mach_prepare_reboot(); mach_prepare_reboot();
/* reboot via jumping to boot base address */ /* reboot via jumping to boot base address */
((void (*)(void))ioremap_nocache(LOONGSON_BOOT_BASE, 4)) (); loongson_reboot();
} }
static void loongson_poweroff(void) static void loongson_poweroff(void)
......
...@@ -41,15 +41,12 @@ void __init plat_mem_setup(void) ...@@ -41,15 +41,12 @@ void __init plat_mem_setup(void)
conswitchp = &vga_con; conswitchp = &vga_con;
screen_info = (struct screen_info) { screen_info = (struct screen_info) {
0, 25, /* orig-x, orig-y */ .orig_x = 0,
0, /* unused */ .orig_y = 25,
0, /* orig-video-page */ .orig_video_cols = 80,
0, /* orig-video-mode */ .orig_video_lines = 25,
80, /* orig-video-cols */ .orig_video_isVGA = VIDEO_TYPE_VGAC,
0, 0, 0, /* ega_ax, ega_bx, ega_cx */ .orig_video_points = 16,
25, /* orig-video-lines */
VIDEO_TYPE_VGAC, /* orig-video-isVGA */
16 /* orig-video-points */
}; };
#elif defined(CONFIG_DUMMY_CONSOLE) #elif defined(CONFIG_DUMMY_CONSOLE)
conswitchp = &dummy_con; conswitchp = &dummy_con;
......
...@@ -79,7 +79,7 @@ void mach_irq_dispatch(unsigned int pending) ...@@ -79,7 +79,7 @@ void mach_irq_dispatch(unsigned int pending)
if (pending & CAUSEF_IP7) if (pending & CAUSEF_IP7)
do_IRQ(LOONGSON_TIMER_IRQ); do_IRQ(LOONGSON_TIMER_IRQ);
else if (pending & CAUSEF_IP6) { /* North Bridge, Perf counter */ else if (pending & CAUSEF_IP6) { /* North Bridge, Perf counter */
#ifdef CONFIG_OPROFILE #if defined(CONFIG_OPROFILE) || defined(CONFIG_OPROFILE_MODULE)
do_IRQ(LOONGSON2_PERFCNT_IRQ); do_IRQ(LOONGSON2_PERFCNT_IRQ);
#endif #endif
bonito_irqdispatch(); bonito_irqdispatch();
......
...@@ -31,6 +31,16 @@ ...@@ -31,6 +31,16 @@
#include <asm/war.h> #include <asm/war.h>
#include <asm/uasm.h> #include <asm/uasm.h>
/*
* TLB load/store/modify handlers.
*
* Only the fastpath gets synthesized at runtime, the slowpath for
* do_page_fault remains normal asm.
*/
extern void tlb_do_page_fault_0(void);
extern void tlb_do_page_fault_1(void);
static inline int r45k_bvahwbug(void) static inline int r45k_bvahwbug(void)
{ {
/* XXX: We should probe for the presence of this bug, but we don't. */ /* XXX: We should probe for the presence of this bug, but we don't. */
...@@ -83,6 +93,7 @@ enum label_id { ...@@ -83,6 +93,7 @@ enum label_id {
label_nopage_tlbm, label_nopage_tlbm,
label_smp_pgtable_change, label_smp_pgtable_change,
label_r3000_write_probe_fail, label_r3000_write_probe_fail,
label_large_segbits_fault,
#ifdef CONFIG_HUGETLB_PAGE #ifdef CONFIG_HUGETLB_PAGE
label_tlb_huge_update, label_tlb_huge_update,
#endif #endif
...@@ -101,6 +112,7 @@ UASM_L_LA(_nopage_tlbs) ...@@ -101,6 +112,7 @@ UASM_L_LA(_nopage_tlbs)
UASM_L_LA(_nopage_tlbm) UASM_L_LA(_nopage_tlbm)
UASM_L_LA(_smp_pgtable_change) UASM_L_LA(_smp_pgtable_change)
UASM_L_LA(_r3000_write_probe_fail) UASM_L_LA(_r3000_write_probe_fail)
UASM_L_LA(_large_segbits_fault)
#ifdef CONFIG_HUGETLB_PAGE #ifdef CONFIG_HUGETLB_PAGE
UASM_L_LA(_tlb_huge_update) UASM_L_LA(_tlb_huge_update)
#endif #endif
...@@ -157,6 +169,10 @@ static u32 tlb_handler[128] __cpuinitdata; ...@@ -157,6 +169,10 @@ static u32 tlb_handler[128] __cpuinitdata;
static struct uasm_label labels[128] __cpuinitdata; static struct uasm_label labels[128] __cpuinitdata;
static struct uasm_reloc relocs[128] __cpuinitdata; static struct uasm_reloc relocs[128] __cpuinitdata;
#ifdef CONFIG_64BIT
static int check_for_high_segbits __cpuinitdata;
#endif
#ifndef CONFIG_MIPS_PGD_C0_CONTEXT #ifndef CONFIG_MIPS_PGD_C0_CONTEXT
/* /*
* CONFIG_MIPS_PGD_C0_CONTEXT implies 64 bit and lack of pgd_current, * CONFIG_MIPS_PGD_C0_CONTEXT implies 64 bit and lack of pgd_current,
...@@ -408,7 +424,7 @@ static __cpuinit __maybe_unused void build_convert_pte_to_entrylo(u32 **p, ...@@ -408,7 +424,7 @@ static __cpuinit __maybe_unused void build_convert_pte_to_entrylo(u32 **p,
UASM_i_ROTR(p, reg, reg, ilog2(_PAGE_GLOBAL) - ilog2(_PAGE_NO_EXEC)); UASM_i_ROTR(p, reg, reg, ilog2(_PAGE_GLOBAL) - ilog2(_PAGE_NO_EXEC));
} else { } else {
#ifdef CONFIG_64BIT_PHYS_ADDR #ifdef CONFIG_64BIT_PHYS_ADDR
uasm_i_dsrl(p, reg, reg, ilog2(_PAGE_GLOBAL)); uasm_i_dsrl_safe(p, reg, reg, ilog2(_PAGE_GLOBAL));
#else #else
UASM_i_SRL(p, reg, reg, ilog2(_PAGE_GLOBAL)); UASM_i_SRL(p, reg, reg, ilog2(_PAGE_GLOBAL));
#endif #endif
...@@ -532,7 +548,24 @@ build_get_pmde64(u32 **p, struct uasm_label **l, struct uasm_reloc **r, ...@@ -532,7 +548,24 @@ build_get_pmde64(u32 **p, struct uasm_label **l, struct uasm_reloc **r,
* The vmalloc handling is not in the hotpath. * The vmalloc handling is not in the hotpath.
*/ */
uasm_i_dmfc0(p, tmp, C0_BADVADDR); uasm_i_dmfc0(p, tmp, C0_BADVADDR);
if (check_for_high_segbits) {
/*
* The kernel currently implicitely assumes that the
* MIPS SEGBITS parameter for the processor is
* (PGDIR_SHIFT+PGDIR_BITS) or less, and will never
* allocate virtual addresses outside the maximum
* range for SEGBITS = (PGDIR_SHIFT+PGDIR_BITS). But
* that doesn't prevent user code from accessing the
* higher xuseg addresses. Here, we make sure that
* everything but the lower xuseg addresses goes down
* the module_alloc/vmalloc path.
*/
uasm_i_dsrl_safe(p, ptr, tmp, PGDIR_SHIFT + PGD_ORDER + PAGE_SHIFT - 3);
uasm_il_bnez(p, r, ptr, label_vmalloc);
} else {
uasm_il_bltz(p, r, tmp, label_vmalloc); uasm_il_bltz(p, r, tmp, label_vmalloc);
}
/* No uasm_i_nop needed here, since the next insn doesn't touch TMP. */ /* No uasm_i_nop needed here, since the next insn doesn't touch TMP. */
#ifdef CONFIG_MIPS_PGD_C0_CONTEXT #ifdef CONFIG_MIPS_PGD_C0_CONTEXT
...@@ -549,14 +582,14 @@ build_get_pmde64(u32 **p, struct uasm_label **l, struct uasm_reloc **r, ...@@ -549,14 +582,14 @@ build_get_pmde64(u32 **p, struct uasm_label **l, struct uasm_reloc **r,
* SMTC uses TCBind value as "CPU" index * SMTC uses TCBind value as "CPU" index
*/ */
uasm_i_mfc0(p, ptr, C0_TCBIND); uasm_i_mfc0(p, ptr, C0_TCBIND);
uasm_i_dsrl(p, ptr, ptr, 19); uasm_i_dsrl_safe(p, ptr, ptr, 19);
# else # else
/* /*
* 64 bit SMP running in XKPHYS has smp_processor_id() << 3 * 64 bit SMP running in XKPHYS has smp_processor_id() << 3
* stored in CONTEXT. * stored in CONTEXT.
*/ */
uasm_i_dmfc0(p, ptr, C0_CONTEXT); uasm_i_dmfc0(p, ptr, C0_CONTEXT);
uasm_i_dsrl(p, ptr, ptr, 23); uasm_i_dsrl_safe(p, ptr, ptr, 23);
# endif # endif
UASM_i_LA_mostly(p, tmp, pgdc); UASM_i_LA_mostly(p, tmp, pgdc);
uasm_i_daddu(p, ptr, ptr, tmp); uasm_i_daddu(p, ptr, ptr, tmp);
...@@ -569,34 +602,49 @@ build_get_pmde64(u32 **p, struct uasm_label **l, struct uasm_reloc **r, ...@@ -569,34 +602,49 @@ build_get_pmde64(u32 **p, struct uasm_label **l, struct uasm_reloc **r,
uasm_l_vmalloc_done(l, *p); uasm_l_vmalloc_done(l, *p);
if (PGDIR_SHIFT - 3 < 32) /* get pgd offset in bytes */ /* get pgd offset in bytes */
uasm_i_dsrl(p, tmp, tmp, PGDIR_SHIFT-3); uasm_i_dsrl_safe(p, tmp, tmp, PGDIR_SHIFT - 3);
else
uasm_i_dsrl32(p, tmp, tmp, PGDIR_SHIFT - 3 - 32);
uasm_i_andi(p, tmp, tmp, (PTRS_PER_PGD - 1)<<3); uasm_i_andi(p, tmp, tmp, (PTRS_PER_PGD - 1)<<3);
uasm_i_daddu(p, ptr, ptr, tmp); /* add in pgd offset */ uasm_i_daddu(p, ptr, ptr, tmp); /* add in pgd offset */
#ifndef __PAGETABLE_PMD_FOLDED #ifndef __PAGETABLE_PMD_FOLDED
uasm_i_dmfc0(p, tmp, C0_BADVADDR); /* get faulting address */ uasm_i_dmfc0(p, tmp, C0_BADVADDR); /* get faulting address */
uasm_i_ld(p, ptr, 0, ptr); /* get pmd pointer */ uasm_i_ld(p, ptr, 0, ptr); /* get pmd pointer */
uasm_i_dsrl(p, tmp, tmp, PMD_SHIFT-3); /* get pmd offset in bytes */ uasm_i_dsrl_safe(p, tmp, tmp, PMD_SHIFT-3); /* get pmd offset in bytes */
uasm_i_andi(p, tmp, tmp, (PTRS_PER_PMD - 1)<<3); uasm_i_andi(p, tmp, tmp, (PTRS_PER_PMD - 1)<<3);
uasm_i_daddu(p, ptr, ptr, tmp); /* add in pmd offset */ uasm_i_daddu(p, ptr, ptr, tmp); /* add in pmd offset */
#endif #endif
} }
enum vmalloc64_mode {not_refill, refill};
/* /*
* BVADDR is the faulting address, PTR is scratch. * BVADDR is the faulting address, PTR is scratch.
* PTR will hold the pgd for vmalloc. * PTR will hold the pgd for vmalloc.
*/ */
static void __cpuinit static void __cpuinit
build_get_pgd_vmalloc64(u32 **p, struct uasm_label **l, struct uasm_reloc **r, build_get_pgd_vmalloc64(u32 **p, struct uasm_label **l, struct uasm_reloc **r,
unsigned int bvaddr, unsigned int ptr) unsigned int bvaddr, unsigned int ptr,
enum vmalloc64_mode mode)
{ {
long swpd = (long)swapper_pg_dir; long swpd = (long)swapper_pg_dir;
int single_insn_swpd;
int did_vmalloc_branch = 0;
single_insn_swpd = uasm_in_compat_space_p(swpd) && !uasm_rel_lo(swpd);
uasm_l_vmalloc(l, *p); uasm_l_vmalloc(l, *p);
if (mode == refill && check_for_high_segbits) {
if (single_insn_swpd) {
uasm_il_bltz(p, r, bvaddr, label_vmalloc_done);
uasm_i_lui(p, ptr, uasm_rel_hi(swpd));
did_vmalloc_branch = 1;
/* fall through */
} else {
uasm_il_bgez(p, r, bvaddr, label_large_segbits_fault);
}
}
if (!did_vmalloc_branch) {
if (uasm_in_compat_space_p(swpd) && !uasm_rel_lo(swpd)) { if (uasm_in_compat_space_p(swpd) && !uasm_rel_lo(swpd)) {
uasm_il_b(p, r, label_vmalloc_done); uasm_il_b(p, r, label_vmalloc_done);
uasm_i_lui(p, ptr, uasm_rel_hi(swpd)); uasm_i_lui(p, ptr, uasm_rel_hi(swpd));
...@@ -608,6 +656,25 @@ build_get_pgd_vmalloc64(u32 **p, struct uasm_label **l, struct uasm_reloc **r, ...@@ -608,6 +656,25 @@ build_get_pgd_vmalloc64(u32 **p, struct uasm_label **l, struct uasm_reloc **r,
else else
uasm_i_daddiu(p, ptr, ptr, uasm_rel_lo(swpd)); uasm_i_daddiu(p, ptr, ptr, uasm_rel_lo(swpd));
} }
}
if (mode == refill && check_for_high_segbits) {
uasm_l_large_segbits_fault(l, *p);
/*
* We get here if we are an xsseg address, or if we are
* an xuseg address above (PGDIR_SHIFT+PGDIR_BITS) boundary.
*
* Ignoring xsseg (assume disabled so would generate
* (address errors?), the only remaining possibility
* is the upper xuseg addresses. On processors with
* TLB_SEGBITS <= PGDIR_SHIFT+PGDIR_BITS, these
* addresses would have taken an address error. We try
* to mimic that here by taking a load/istream page
* fault.
*/
UASM_i_LA(p, ptr, (unsigned long)tlb_do_page_fault_0);
uasm_i_jr(p, ptr);
uasm_i_nop(p);
}
} }
#else /* !CONFIG_64BIT */ #else /* !CONFIG_64BIT */
...@@ -720,9 +787,9 @@ static void __cpuinit build_update_entries(u32 **p, unsigned int tmp, ...@@ -720,9 +787,9 @@ static void __cpuinit build_update_entries(u32 **p, unsigned int tmp,
UASM_i_MTC0(p, tmp, C0_ENTRYLO0); /* load it */ UASM_i_MTC0(p, tmp, C0_ENTRYLO0); /* load it */
UASM_i_ROTR(p, ptep, ptep, ilog2(_PAGE_GLOBAL) - ilog2(_PAGE_NO_EXEC)); UASM_i_ROTR(p, ptep, ptep, ilog2(_PAGE_GLOBAL) - ilog2(_PAGE_NO_EXEC));
} else { } else {
uasm_i_dsrl(p, tmp, tmp, ilog2(_PAGE_GLOBAL)); /* convert to entrylo0 */ uasm_i_dsrl_safe(p, tmp, tmp, ilog2(_PAGE_GLOBAL)); /* convert to entrylo0 */
UASM_i_MTC0(p, tmp, C0_ENTRYLO0); /* load it */ UASM_i_MTC0(p, tmp, C0_ENTRYLO0); /* load it */
uasm_i_dsrl(p, ptep, ptep, ilog2(_PAGE_GLOBAL)); /* convert to entrylo1 */ uasm_i_dsrl_safe(p, ptep, ptep, ilog2(_PAGE_GLOBAL)); /* convert to entrylo1 */
} }
UASM_i_MTC0(p, ptep, C0_ENTRYLO1); /* load it */ UASM_i_MTC0(p, ptep, C0_ENTRYLO1); /* load it */
} else { } else {
...@@ -793,9 +860,9 @@ static void __cpuinit build_r4000_tlb_refill_handler(void) ...@@ -793,9 +860,9 @@ static void __cpuinit build_r4000_tlb_refill_handler(void)
uasm_i_dmfc0(&p, K0, C0_BADVADDR); uasm_i_dmfc0(&p, K0, C0_BADVADDR);
uasm_i_dmfc0(&p, K1, C0_ENTRYHI); uasm_i_dmfc0(&p, K1, C0_ENTRYHI);
uasm_i_xor(&p, K0, K0, K1); uasm_i_xor(&p, K0, K0, K1);
uasm_i_dsrl32(&p, K1, K0, 62 - 32); uasm_i_dsrl_safe(&p, K1, K0, 62);
uasm_i_dsrl(&p, K0, K0, 12 + 1); uasm_i_dsrl_safe(&p, K0, K0, 12 + 1);
uasm_i_dsll32(&p, K0, K0, 64 + 12 + 1 - segbits - 32); uasm_i_dsll_safe(&p, K0, K0, 64 + 12 + 1 - segbits);
uasm_i_or(&p, K0, K0, K1); uasm_i_or(&p, K0, K0, K1);
uasm_il_bnez(&p, &r, K0, label_leave); uasm_il_bnez(&p, &r, K0, label_leave);
/* No need for uasm_i_nop */ /* No need for uasm_i_nop */
...@@ -825,7 +892,7 @@ static void __cpuinit build_r4000_tlb_refill_handler(void) ...@@ -825,7 +892,7 @@ static void __cpuinit build_r4000_tlb_refill_handler(void)
#endif #endif
#ifdef CONFIG_64BIT #ifdef CONFIG_64BIT
build_get_pgd_vmalloc64(&p, &l, &r, K0, K1); build_get_pgd_vmalloc64(&p, &l, &r, K0, K1, refill);
#endif #endif
/* /*
...@@ -934,15 +1001,6 @@ static void __cpuinit build_r4000_tlb_refill_handler(void) ...@@ -934,15 +1001,6 @@ static void __cpuinit build_r4000_tlb_refill_handler(void)
dump_handler((u32 *)ebase, 64); dump_handler((u32 *)ebase, 64);
} }
/*
* TLB load/store/modify handlers.
*
* Only the fastpath gets synthesized at runtime, the slowpath for
* do_page_fault remains normal asm.
*/
extern void tlb_do_page_fault_0(void);
extern void tlb_do_page_fault_1(void);
/* /*
* 128 instructions for the fastpath handler is generous and should * 128 instructions for the fastpath handler is generous and should
* never be exceeded. * never be exceeded.
...@@ -1302,7 +1360,7 @@ build_r4000_tlbchange_handler_tail(u32 **p, struct uasm_label **l, ...@@ -1302,7 +1360,7 @@ build_r4000_tlbchange_handler_tail(u32 **p, struct uasm_label **l,
uasm_i_eret(p); /* return from trap */ uasm_i_eret(p); /* return from trap */
#ifdef CONFIG_64BIT #ifdef CONFIG_64BIT
build_get_pgd_vmalloc64(p, l, r, tmp, ptr); build_get_pgd_vmalloc64(p, l, r, tmp, ptr, not_refill);
#endif #endif
} }
...@@ -1322,9 +1380,9 @@ static void __cpuinit build_r4000_tlb_load_handler(void) ...@@ -1322,9 +1380,9 @@ static void __cpuinit build_r4000_tlb_load_handler(void)
uasm_i_dmfc0(&p, K0, C0_BADVADDR); uasm_i_dmfc0(&p, K0, C0_BADVADDR);
uasm_i_dmfc0(&p, K1, C0_ENTRYHI); uasm_i_dmfc0(&p, K1, C0_ENTRYHI);
uasm_i_xor(&p, K0, K0, K1); uasm_i_xor(&p, K0, K0, K1);
uasm_i_dsrl32(&p, K1, K0, 62 - 32); uasm_i_dsrl_safe(&p, K1, K0, 62);
uasm_i_dsrl(&p, K0, K0, 12 + 1); uasm_i_dsrl_safe(&p, K0, K0, 12 + 1);
uasm_i_dsll32(&p, K0, K0, 64 + 12 + 1 - segbits - 32); uasm_i_dsll_safe(&p, K0, K0, 64 + 12 + 1 - segbits);
uasm_i_or(&p, K0, K0, K1); uasm_i_or(&p, K0, K0, K1);
uasm_il_bnez(&p, &r, K0, label_leave); uasm_il_bnez(&p, &r, K0, label_leave);
/* No need for uasm_i_nop */ /* No need for uasm_i_nop */
...@@ -1526,6 +1584,10 @@ void __cpuinit build_tlb_refill_handler(void) ...@@ -1526,6 +1584,10 @@ void __cpuinit build_tlb_refill_handler(void)
*/ */
static int run_once = 0; static int run_once = 0;
#ifdef CONFIG_64BIT
check_for_high_segbits = current_cpu_data.vmbits > (PGDIR_SHIFT + PGD_ORDER + PAGE_SHIFT - 3);
#endif
switch (current_cpu_type()) { switch (current_cpu_type()) {
case CPU_R2000: case CPU_R2000:
case CPU_R3000: case CPU_R3000:
......
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
* Reset the PNX8550 board. * Reset the PNX8550 board.
* *
*/ */
#include <linux/kernel.h>
#include <asm/reboot.h> #include <asm/reboot.h>
#include <glb.h> #include <glb.h>
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/console.h> #include <linux/console.h>
#include <linux/tty.h> #include <linux/tty.h>
#include <linux/vt.h>
#include <asm/io.h> #include <asm/io.h>
...@@ -254,7 +255,7 @@ static int __init sb1250_pcibios_init(void) ...@@ -254,7 +255,7 @@ static int __init sb1250_pcibios_init(void)
* XXX ehs: Should this happen in PCI Device mode? * XXX ehs: Should this happen in PCI Device mode?
*/ */
io_map_base = ioremap(A_PHYS_LDTPCI_IO_MATCH_BYTES, 1024 * 1024); io_map_base = ioremap(A_PHYS_LDTPCI_IO_MATCH_BYTES, 1024 * 1024);
sb1250_controller.io_map_base = io_map_base; sb1250_controller.io_map_base = (unsigned long)io_map_base;
set_io_port_base((unsigned long)io_map_base); set_io_port_base((unsigned long)io_map_base);
#ifdef CONFIG_SIBYTE_HAS_LDT #ifdef CONFIG_SIBYTE_HAS_LDT
......
...@@ -89,7 +89,7 @@ static void print_buserr(void) ...@@ -89,7 +89,7 @@ static void print_buserr(void)
void ip22_be_interrupt(int irq) void ip22_be_interrupt(int irq)
{ {
const int field = 2 * sizeof(unsigned long); const int field = 2 * sizeof(unsigned long);
const struct pt_regs *regs = get_irq_regs(); struct pt_regs *regs = get_irq_regs();
save_and_clear_buserr(); save_and_clear_buserr();
print_buserr(); print_buserr();
......
...@@ -453,7 +453,7 @@ mips_be_fatal: ...@@ -453,7 +453,7 @@ mips_be_fatal:
void ip22_be_interrupt(int irq) void ip22_be_interrupt(int irq)
{ {
const struct pt_regs *regs = get_irq_regs(); struct pt_regs *regs = get_irq_regs();
count_be_interrupt++; count_be_interrupt++;
......
...@@ -145,15 +145,14 @@ void __init plat_mem_setup(void) ...@@ -145,15 +145,14 @@ void __init plat_mem_setup(void)
#ifdef CONFIG_VT #ifdef CONFIG_VT
screen_info = (struct screen_info) { screen_info = (struct screen_info) {
0, 0, /* orig-x, orig-y */ .orig_video_page = 52,
0, /* unused */ .orig_video_mode = 3,
52, /* orig_video_page */ .orig_video_cols = 80,
3, /* orig_video_mode */ .flags = 12,
80, /* orig_video_cols */ .orig_video_ega_bx = 3,
4626, 3, 9, /* unused, ega_bx, unused */ .orig_video_lines = 25,
25, /* orig_video_lines */ .orig_video_isVGA = 0x22,
0x22, /* orig_video_isVGA */ .orig_video_points = 16,
16 /* orig_video_points */
}; };
/* XXXKW for CFE, get lines/cols from environment */ /* XXXKW for CFE, get lines/cols from environment */
#endif #endif
......
...@@ -1359,3 +1359,5 @@ module_exit(txx9dmac_exit); ...@@ -1359,3 +1359,5 @@ module_exit(txx9dmac_exit);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("TXx9 DMA Controller driver"); MODULE_DESCRIPTION("TXx9 DMA Controller driver");
MODULE_AUTHOR("Atsushi Nemoto <anemo@mba.ocn.ne.jp>"); MODULE_AUTHOR("Atsushi Nemoto <anemo@mba.ocn.ne.jp>");
MODULE_ALIAS("platform:txx9dmac");
MODULE_ALIAS("platform:txx9dmac-chan");
...@@ -447,7 +447,7 @@ static struct i2c_adapter octeon_i2c_ops = { ...@@ -447,7 +447,7 @@ static struct i2c_adapter octeon_i2c_ops = {
/** /**
* octeon_i2c_setclock - Calculate and set clock divisors. * octeon_i2c_setclock - Calculate and set clock divisors.
*/ */
static int __init octeon_i2c_setclock(struct octeon_i2c *i2c) static int __devinit octeon_i2c_setclock(struct octeon_i2c *i2c)
{ {
int tclk, thp_base, inc, thp_idx, mdiv_idx, ndiv_idx, foscl, diff; int tclk, thp_base, inc, thp_idx, mdiv_idx, ndiv_idx, foscl, diff;
int thp = 0x18, mdiv = 2, ndiv = 0, delta_hz = 1000000; int thp = 0x18, mdiv = 2, ndiv = 0, delta_hz = 1000000;
...@@ -490,7 +490,7 @@ static int __init octeon_i2c_setclock(struct octeon_i2c *i2c) ...@@ -490,7 +490,7 @@ static int __init octeon_i2c_setclock(struct octeon_i2c *i2c)
return 0; return 0;
} }
static int __init octeon_i2c_initlowlevel(struct octeon_i2c *i2c) static int __devinit octeon_i2c_initlowlevel(struct octeon_i2c *i2c)
{ {
u8 status; u8 status;
int tries; int tries;
......
...@@ -88,6 +88,7 @@ static int octeon_mdiobus_write(struct mii_bus *bus, int phy_id, ...@@ -88,6 +88,7 @@ static int octeon_mdiobus_write(struct mii_bus *bus, int phy_id,
static int __init octeon_mdiobus_probe(struct platform_device *pdev) static int __init octeon_mdiobus_probe(struct platform_device *pdev)
{ {
struct octeon_mdiobus *bus; struct octeon_mdiobus *bus;
union cvmx_smix_en smi_en;
int i; int i;
int err = -ENOENT; int err = -ENOENT;
...@@ -103,6 +104,10 @@ static int __init octeon_mdiobus_probe(struct platform_device *pdev) ...@@ -103,6 +104,10 @@ static int __init octeon_mdiobus_probe(struct platform_device *pdev)
if (!bus->mii_bus) if (!bus->mii_bus)
goto err; goto err;
smi_en.u64 = 0;
smi_en.s.en = 1;
cvmx_write_csr(CVMX_SMIX_EN(bus->unit), smi_en.u64);
/* /*
* Standard Octeon evaluation boards don't support phy * Standard Octeon evaluation boards don't support phy
* interrupts, we need to poll. * interrupts, we need to poll.
...@@ -133,17 +138,22 @@ err_register: ...@@ -133,17 +138,22 @@ err_register:
err: err:
devm_kfree(&pdev->dev, bus); devm_kfree(&pdev->dev, bus);
smi_en.u64 = 0;
cvmx_write_csr(CVMX_SMIX_EN(bus->unit), smi_en.u64);
return err; return err;
} }
static int __exit octeon_mdiobus_remove(struct platform_device *pdev) static int __exit octeon_mdiobus_remove(struct platform_device *pdev)
{ {
struct octeon_mdiobus *bus; struct octeon_mdiobus *bus;
union cvmx_smix_en smi_en;
bus = dev_get_drvdata(&pdev->dev); bus = dev_get_drvdata(&pdev->dev);
mdiobus_unregister(bus->mii_bus); mdiobus_unregister(bus->mii_bus);
mdiobus_free(bus->mii_bus); mdiobus_free(bus->mii_bus);
smi_en.u64 = 0;
cvmx_write_csr(CVMX_SMIX_EN(bus->unit), smi_en.u64);
return 0; return 0;
} }
......
...@@ -146,7 +146,6 @@ static irqreturn_t db1200_pcmcia_cdirq(int irq, void *data) ...@@ -146,7 +146,6 @@ static irqreturn_t db1200_pcmcia_cdirq(int irq, void *data)
static int db1x_pcmcia_setup_irqs(struct db1x_pcmcia_sock *sock) static int db1x_pcmcia_setup_irqs(struct db1x_pcmcia_sock *sock)
{ {
int ret; int ret;
unsigned long flags;
if (sock->stschg_irq != -1) { if (sock->stschg_irq != -1) {
ret = request_irq(sock->stschg_irq, db1000_pcmcia_stschgirq, ret = request_irq(sock->stschg_irq, db1000_pcmcia_stschgirq,
...@@ -162,30 +161,23 @@ static int db1x_pcmcia_setup_irqs(struct db1x_pcmcia_sock *sock) ...@@ -162,30 +161,23 @@ static int db1x_pcmcia_setup_irqs(struct db1x_pcmcia_sock *sock)
* active one disabled. * active one disabled.
*/ */
if (sock->board_type == BOARD_TYPE_DB1200) { if (sock->board_type == BOARD_TYPE_DB1200) {
local_irq_save(flags);
ret = request_irq(sock->insert_irq, db1200_pcmcia_cdirq, ret = request_irq(sock->insert_irq, db1200_pcmcia_cdirq,
IRQF_DISABLED, "pcmcia_insert", sock); IRQF_DISABLED, "pcmcia_insert", sock);
if (ret) { if (ret)
local_irq_restore(flags);
goto out1; goto out1;
}
ret = request_irq(sock->eject_irq, db1200_pcmcia_cdirq, ret = request_irq(sock->eject_irq, db1200_pcmcia_cdirq,
IRQF_DISABLED, "pcmcia_eject", sock); IRQF_DISABLED, "pcmcia_eject", sock);
if (ret) { if (ret) {
free_irq(sock->insert_irq, sock); free_irq(sock->insert_irq, sock);
local_irq_restore(flags);
goto out1; goto out1;
} }
/* disable the currently active one */ /* enable the currently silent one */
if (db1200_card_inserted(sock)) if (db1200_card_inserted(sock))
disable_irq_nosync(sock->insert_irq); enable_irq(sock->eject_irq);
else else
disable_irq_nosync(sock->eject_irq); enable_irq(sock->insert_irq);
local_irq_restore(flags);
} else { } else {
/* all other (older) Db1x00 boards use a GPIO to show /* all other (older) Db1x00 boards use a GPIO to show
* card detection status: use both-edge triggers. * card detection status: use both-edge triggers.
......
...@@ -153,6 +153,14 @@ int cvmx_helper_board_get_mii_address(int ipd_port) ...@@ -153,6 +153,14 @@ int cvmx_helper_board_get_mii_address(int ipd_port)
* through switch. * through switch.
*/ */
return -1; return -1;
case CVMX_BOARD_TYPE_CUST_WSX16:
if (ipd_port >= 0 && ipd_port <= 3)
return ipd_port;
else if (ipd_port >= 16 && ipd_port <= 19)
return ipd_port - 16 + 4;
else
return -1;
} }
/* Some unknown board. Somebody forgot to update this function... */ /* Some unknown board. Somebody forgot to update this function... */
......
...@@ -254,3 +254,4 @@ module_exit(txx9aclc_ac97_exit); ...@@ -254,3 +254,4 @@ module_exit(txx9aclc_ac97_exit);
MODULE_AUTHOR("Atsushi Nemoto <anemo@mba.ocn.ne.jp>"); MODULE_AUTHOR("Atsushi Nemoto <anemo@mba.ocn.ne.jp>");
MODULE_DESCRIPTION("TXx9 ACLC AC97 driver"); MODULE_DESCRIPTION("TXx9 ACLC AC97 driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:txx9aclc-ac97");
...@@ -96,3 +96,4 @@ module_exit(txx9aclc_generic_exit); ...@@ -96,3 +96,4 @@ module_exit(txx9aclc_generic_exit);
MODULE_AUTHOR("Atsushi Nemoto <anemo@mba.ocn.ne.jp>"); MODULE_AUTHOR("Atsushi Nemoto <anemo@mba.ocn.ne.jp>");
MODULE_DESCRIPTION("Generic TXx9 ACLC ALSA SoC audio driver"); MODULE_DESCRIPTION("Generic TXx9 ACLC ALSA SoC audio driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:txx9aclc-generic");
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