Skip to content

Commit

Permalink
Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upst…
Browse files Browse the repository at this point in the history
…ream-linus

Pull MIPS fixes from Ralf Baechle:
 "MIPS fixes for 3.11.  Half of then is for Netlogic the remainder
  touches things across arch/mips.

  Nothing really dramatic and by rc1 standards MIPS will be in fairly
  good shape with this applied.  Tested by building all MIPS defconfigs
  of which with this pull request four platforms won't build.  And yes,
  it boots also on my favorite test systems"

* 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus:
  MIPS: kvm: Kconfig: Drop HAVE_KVM dependency from VIRTUALIZATION
  MIPS: Octeon: Fix DT pruning bug with pip ports
  MIPS: KVM: Mark KVM_GUEST (T&E KVM) as BROKEN_ON_SMP
  MIPS: tlbex: fix broken build in v3.11-rc1
  MIPS: Netlogic: Add XLP PIC irqdomain
  MIPS: Netlogic: Fix USB block's coherent DMA mask
  MIPS: tlbex: Fix typo in r3000 tlb store handler
  MIPS: BMIPS: Fix thinko to release slave TP from reset
  MIPS: Delete dead invocation of exception_exit().
  • Loading branch information
torvalds committed Jul 19, 2013
2 parents 89d0abe + f1b7001 commit 1b05018
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 21 deletions.
1 change: 1 addition & 0 deletions arch/mips/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1702,6 +1702,7 @@ endchoice

config KVM_GUEST
bool "KVM Guest Kernel"
depends on BROKEN_ON_SMP
help
Select this option if building a guest kernel for KVM (Trap & Emulate) mode

Expand Down
5 changes: 3 additions & 2 deletions arch/mips/cavium-octeon/octeon-platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,10 @@ static void __init octeon_fdt_pip_iface(int pip, int idx, u64 *pmac)
char name_buffer[20];
int iface;
int p;
int count;
int count = 0;

count = cvmx_helper_interface_enumerate(idx);
if (cvmx_helper_interface_enumerate(idx) == 0)
count = cvmx_helper_ports_on_interface(idx);

snprintf(name_buffer, sizeof(name_buffer), "interface@%d", idx);
iface = fdt_subnode_offset(initial_boot_params, pip, name_buffer);
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/kernel/smp-bmips.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ static void bmips_boot_secondary(int cpu, struct task_struct *idle)
else {
#if defined(CONFIG_CPU_BMIPS4350) || defined(CONFIG_CPU_BMIPS4380)
/* Reset slave TP1 if booting from TP0 */
if (cpu_logical_map(cpu) == 0)
if (cpu_logical_map(cpu) == 1)
set_c0_brcm_cmt_ctrl(0x01);
#elif defined(CONFIG_CPU_BMIPS5000)
if (cpu & 0x01)
Expand Down
1 change: 0 additions & 1 deletion arch/mips/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,6 @@ asmlinkage void do_mcheck(struct pt_regs *regs)
panic("Caught Machine Check exception - %scaused by multiple "
"matching entries in the TLB.",
(multi_match) ? "" : "not ");
exception_exit(prev_state);
}

asmlinkage void do_mt(struct pt_regs *regs)
Expand Down
1 change: 0 additions & 1 deletion arch/mips/kvm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ source "virt/kvm/Kconfig"

menuconfig VIRTUALIZATION
bool "Virtualization"
depends on HAVE_KVM
---help---
Say Y here to get to see options for using your Linux host to run
other operating systems inside virtual machines (guests).
Expand Down
4 changes: 2 additions & 2 deletions arch/mips/mm/tlbex.c
Original file line number Diff line number Diff line change
Expand Up @@ -1456,7 +1456,7 @@ static void build_r4000_setup_pgd(void)
{
const int a0 = 4;
const int a1 = 5;
u32 *p = tlbmiss_handler_setup_pgd_array;
u32 *p = tlbmiss_handler_setup_pgd;
const int tlbmiss_handler_setup_pgd_size =
tlbmiss_handler_setup_pgd_end - tlbmiss_handler_setup_pgd;
struct uasm_label *l = labels;
Expand Down Expand Up @@ -1793,7 +1793,7 @@ static void build_r3000_tlb_store_handler(void)
uasm_i_j(&p, (unsigned long)tlb_do_page_fault_1 & 0x0fffffff);
uasm_i_nop(&p);

if (p >= handle_tlbs)
if (p >= handle_tlbs_end)
panic("TLB store handler fastpath space exceeded");

uasm_resolve_relocs(relocs, labels);
Expand Down
68 changes: 57 additions & 11 deletions arch/mips/netlogic/common/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
#include <linux/slab.h>
#include <linux/irq.h>

#include <linux/irqdomain.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>

#include <asm/errno.h>
#include <asm/signal.h>
#include <asm/ptrace.h>
Expand Down Expand Up @@ -223,17 +227,6 @@ static void nlm_init_node_irqs(int node)
nodep->irqmask = irqmask;
}

void __init arch_init_irq(void)
{
/* Initialize the irq descriptors */
nlm_init_percpu_irqs();
nlm_init_node_irqs(0);
write_c0_eimr(nlm_current_node()->irqmask);
#if defined(CONFIG_CPU_XLR)
nlm_setup_fmn_irq();
#endif
}

void nlm_smp_irq_init(int hwcpuid)
{
int node, cpu;
Expand Down Expand Up @@ -266,3 +259,56 @@ asmlinkage void plat_irq_dispatch(void)
/* top level irq handling */
do_IRQ(nlm_irq_to_xirq(node, i));
}

#ifdef CONFIG_OF
static struct irq_domain *xlp_pic_domain;

static const struct irq_domain_ops xlp_pic_irq_domain_ops = {
.xlate = irq_domain_xlate_onetwocell,
};

static int __init xlp_of_pic_init(struct device_node *node,
struct device_node *parent)
{
const int n_picirqs = PIC_IRT_LAST_IRQ - PIC_IRQ_BASE + 1;
struct resource res;
int socid, ret;

/* we need a hack to get the PIC's SoC chip id */
ret = of_address_to_resource(node, 0, &res);
if (ret < 0) {
pr_err("PIC %s: reg property not found!\n", node->name);
return -EINVAL;
}
socid = (res.start >> 18) & 0x3;
xlp_pic_domain = irq_domain_add_legacy(node, n_picirqs,
nlm_irq_to_xirq(socid, PIC_IRQ_BASE), PIC_IRQ_BASE,
&xlp_pic_irq_domain_ops, NULL);
if (xlp_pic_domain == NULL) {
pr_err("PIC %s: Creating legacy domain failed!\n", node->name);
return -EINVAL;
}
pr_info("Node %d: IRQ domain created for PIC@%pa\n", socid,
&res.start);
return 0;
}

static struct of_device_id __initdata xlp_pic_irq_ids[] = {
{ .compatible = "netlogic,xlp-pic", .data = xlp_of_pic_init },
{},
};
#endif

void __init arch_init_irq(void)
{
/* Initialize the irq descriptors */
nlm_init_percpu_irqs();
nlm_init_node_irqs(0);
write_c0_eimr(nlm_current_node()->irqmask);
#if defined(CONFIG_CPU_XLR)
nlm_setup_fmn_irq();
#endif
#if defined(CONFIG_OF)
of_irq_init(xlp_pic_irq_ids);
#endif
}
3 changes: 2 additions & 1 deletion arch/mips/netlogic/dts/xlp_evp.dts
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,11 @@
};
};
pic: pic@4000 {
interrupt-controller;
compatible = "netlogic,xlp-pic";
#address-cells = <0>;
#interrupt-cells = <1>;
reg = <0 0x4000 0x200>;
interrupt-controller;
};

nor_flash@1,0 {
Expand Down
3 changes: 2 additions & 1 deletion arch/mips/netlogic/dts/xlp_svp.dts
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,11 @@
};
};
pic: pic@4000 {
interrupt-controller;
compatible = "netlogic,xlp-pic";
#address-cells = <0>;
#interrupt-cells = <1>;
reg = <0 0x4000 0x200>;
interrupt-controller;
};

nor_flash@1,0 {
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/netlogic/xlp/usb-init.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ static u64 xlp_usb_dmamask = ~(u32)0;
static void nlm_usb_fixup_final(struct pci_dev *dev)
{
dev->dev.dma_mask = &xlp_usb_dmamask;
dev->dev.coherent_dma_mask = DMA_BIT_MASK(64);
dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
switch (dev->devfn) {
case 0x10:
dev->irq = PIC_EHCI_0_IRQ;
Expand Down

0 comments on commit 1b05018

Please sign in to comment.