diff options
Diffstat (limited to 'arch/powerpc/platforms/embedded6xx')
| -rw-r--r-- | arch/powerpc/platforms/embedded6xx/Kconfig | 33 | ||||
| -rw-r--r-- | arch/powerpc/platforms/embedded6xx/Makefile | 2 | ||||
| -rw-r--r-- | arch/powerpc/platforms/embedded6xx/c2k.c | 1 | ||||
| -rw-r--r-- | arch/powerpc/platforms/embedded6xx/flipper-pic.c | 70 | ||||
| -rw-r--r-- | arch/powerpc/platforms/embedded6xx/gamecube.c | 11 | ||||
| -rw-r--r-- | arch/powerpc/platforms/embedded6xx/hlwd-pic.c | 91 | ||||
| -rw-r--r-- | arch/powerpc/platforms/embedded6xx/holly.c | 31 | ||||
| -rw-r--r-- | arch/powerpc/platforms/embedded6xx/linkstation.c | 19 | ||||
| -rw-r--r-- | arch/powerpc/platforms/embedded6xx/mpc10x.h | 11 | ||||
| -rw-r--r-- | arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c | 32 | ||||
| -rw-r--r-- | arch/powerpc/platforms/embedded6xx/mvme5100.c | 221 | ||||
| -rw-r--r-- | arch/powerpc/platforms/embedded6xx/prpmc2800.c | 157 | ||||
| -rw-r--r-- | arch/powerpc/platforms/embedded6xx/storcenter.c | 28 | ||||
| -rw-r--r-- | arch/powerpc/platforms/embedded6xx/wii.c | 34 | 
14 files changed, 338 insertions, 403 deletions
diff --git a/arch/powerpc/platforms/embedded6xx/Kconfig b/arch/powerpc/platforms/embedded6xx/Kconfig index 524d971a147..a25f496c2ef 100644 --- a/arch/powerpc/platforms/embedded6xx/Kconfig +++ b/arch/powerpc/platforms/embedded6xx/Kconfig @@ -9,7 +9,6 @@ config LINKSTATION  	select FSL_SOC  	select PPC_UDBG_16550 if SERIAL_8250  	select DEFAULT_UIMAGE -	select MPC10X_OPENPIC  	select MPC10X_BRIDGE  	help  	  Select LINKSTATION if configuring for one of PPC- (MPC8241) @@ -24,7 +23,6 @@ config STORCENTER  	select MPIC  	select FSL_SOC  	select PPC_UDBG_16550 if SERIAL_8250 -	select MPC10X_OPENPIC  	select MPC10X_BRIDGE  	help  	  Select STORCENTER if configuring for the iomega StorCenter @@ -36,7 +34,6 @@ config MPC7448HPC2  	select TSI108_BRIDGE  	select DEFAULT_UIMAGE  	select PPC_UDBG_16550 -	select TSI108_BRIDGE  	help  	  Select MPC7448HPC2 if configuring for Freescale MPC7448HPC2 (Taiga)  	  platform @@ -46,19 +43,10 @@ config PPC_HOLLY  	depends on EMBEDDED6xx  	select TSI108_BRIDGE  	select PPC_UDBG_16550 -	select TSI108_BRIDGE  	help  	  Select PPC_HOLLY if configuring for an IBM 750GX/CL Eval  	  Board with TSI108/9 bridge (Hickory/Holly) -config PPC_PRPMC2800 -	bool "Motorola-PrPMC2800" -	depends on EMBEDDED6xx -	select MV64X60 -	select NOT_COHERENT_CACHE -	help -	  This option enables support for the Motorola PrPMC2800 board -  config PPC_C2K  	bool "SBS/GEFanuc C2K board"  	depends on EMBEDDED6xx @@ -69,6 +57,19 @@ config PPC_C2K  	  This option enables support for the GE Fanuc C2K board (formerly  	  an SBS board). +config MVME5100 +	bool "Motorola/Emerson MVME5100" +	depends on EMBEDDED6xx +	select MPIC +	select PCI +	select PPC_INDIRECT_PCI +	select PPC_I8259 +	select PPC_NATIVE +	select PPC_UDBG_16550 +	help +	  This option enables support for the Motorola (now Emerson) MVME5100 +	  board. +  config TSI108_BRIDGE  	bool  	select PCI @@ -84,13 +85,6 @@ config MV64X60  	select PPC_INDIRECT_PCI  	select CHECK_CACHE_COHERENCY -config MPC10X_OPENPIC -	bool - -config MPC10X_STORE_GATHERING -	bool "Enable MPC10x store gathering" -	depends on MPC10X_BRIDGE -  config GAMECUBE_COMMON  	bool @@ -122,4 +116,3 @@ config WII  	help  	  Select WII if configuring for the Nintendo Wii.  	  More information at: <http://gc-linux.sourceforge.net/> - diff --git a/arch/powerpc/platforms/embedded6xx/Makefile b/arch/powerpc/platforms/embedded6xx/Makefile index 66c23e423f4..f126a2a0998 100644 --- a/arch/powerpc/platforms/embedded6xx/Makefile +++ b/arch/powerpc/platforms/embedded6xx/Makefile @@ -5,9 +5,9 @@ obj-$(CONFIG_MPC7448HPC2)	+= mpc7448_hpc2.o  obj-$(CONFIG_LINKSTATION)	+= linkstation.o ls_uart.o  obj-$(CONFIG_STORCENTER)	+= storcenter.o  obj-$(CONFIG_PPC_HOLLY)		+= holly.o -obj-$(CONFIG_PPC_PRPMC2800)	+= prpmc2800.o  obj-$(CONFIG_PPC_C2K)		+= c2k.o  obj-$(CONFIG_USBGECKO_UDBG)	+= usbgecko_udbg.o  obj-$(CONFIG_GAMECUBE_COMMON)	+= flipper-pic.o  obj-$(CONFIG_GAMECUBE)		+= gamecube.o  obj-$(CONFIG_WII)		+= wii.o hlwd-pic.o +obj-$(CONFIG_MVME5100)		+= mvme5100.o diff --git a/arch/powerpc/platforms/embedded6xx/c2k.c b/arch/powerpc/platforms/embedded6xx/c2k.c index 8cab5731850..ebd3963fdf9 100644 --- a/arch/powerpc/platforms/embedded6xx/c2k.c +++ b/arch/powerpc/platforms/embedded6xx/c2k.c @@ -23,7 +23,6 @@  #include <asm/machdep.h>  #include <asm/prom.h> -#include <asm/system.h>  #include <asm/time.h>  #include <mm/mmu_decl.h> diff --git a/arch/powerpc/platforms/embedded6xx/flipper-pic.c b/arch/powerpc/platforms/embedded6xx/flipper-pic.c index c278bd3a8fe..4cde8e7da4b 100644 --- a/arch/powerpc/platforms/embedded6xx/flipper-pic.c +++ b/arch/powerpc/platforms/embedded6xx/flipper-pic.c @@ -18,6 +18,7 @@  #include <linux/init.h>  #include <linux/irq.h>  #include <linux/of.h> +#include <linux/of_address.h>  #include <asm/io.h>  #include "flipper-pic.h" @@ -46,10 +47,10 @@   *   */ -static void flipper_pic_mask_and_ack(unsigned int virq) +static void flipper_pic_mask_and_ack(struct irq_data *d)  { -	int irq = virq_to_hw(virq); -	void __iomem *io_base = get_irq_chip_data(virq); +	int irq = irqd_to_hwirq(d); +	void __iomem *io_base = irq_data_get_irq_chip_data(d);  	u32 mask = 1 << irq;  	clrbits32(io_base + FLIPPER_IMR, mask); @@ -57,27 +58,27 @@ static void flipper_pic_mask_and_ack(unsigned int virq)  	out_be32(io_base + FLIPPER_ICR, mask);  } -static void flipper_pic_ack(unsigned int virq) +static void flipper_pic_ack(struct irq_data *d)  { -	int irq = virq_to_hw(virq); -	void __iomem *io_base = get_irq_chip_data(virq); +	int irq = irqd_to_hwirq(d); +	void __iomem *io_base = irq_data_get_irq_chip_data(d);  	/* this is at least needed for RSW */  	out_be32(io_base + FLIPPER_ICR, 1 << irq);  } -static void flipper_pic_mask(unsigned int virq) +static void flipper_pic_mask(struct irq_data *d)  { -	int irq = virq_to_hw(virq); -	void __iomem *io_base = get_irq_chip_data(virq); +	int irq = irqd_to_hwirq(d); +	void __iomem *io_base = irq_data_get_irq_chip_data(d);  	clrbits32(io_base + FLIPPER_IMR, 1 << irq);  } -static void flipper_pic_unmask(unsigned int virq) +static void flipper_pic_unmask(struct irq_data *d)  { -	int irq = virq_to_hw(virq); -	void __iomem *io_base = get_irq_chip_data(virq); +	int irq = irqd_to_hwirq(d); +	void __iomem *io_base = irq_data_get_irq_chip_data(d);  	setbits32(io_base + FLIPPER_IMR, 1 << irq);  } @@ -85,10 +86,10 @@ static void flipper_pic_unmask(unsigned int virq)  static struct irq_chip flipper_pic = {  	.name		= "flipper-pic", -	.ack		= flipper_pic_ack, -	.mask_ack	= flipper_pic_mask_and_ack, -	.mask		= flipper_pic_mask, -	.unmask		= flipper_pic_unmask, +	.irq_ack	= flipper_pic_ack, +	.irq_mask_ack	= flipper_pic_mask_and_ack, +	.irq_mask	= flipper_pic_mask, +	.irq_unmask	= flipper_pic_unmask,  };  /* @@ -96,32 +97,25 @@ static struct irq_chip flipper_pic = {   *   */ -static struct irq_host *flipper_irq_host; +static struct irq_domain *flipper_irq_host; -static int flipper_pic_map(struct irq_host *h, unsigned int virq, +static int flipper_pic_map(struct irq_domain *h, unsigned int virq,  			   irq_hw_number_t hwirq)  { -	set_irq_chip_data(virq, h->host_data); -	irq_to_desc(virq)->status |= IRQ_LEVEL; -	set_irq_chip_and_handler(virq, &flipper_pic, handle_level_irq); +	irq_set_chip_data(virq, h->host_data); +	irq_set_status_flags(virq, IRQ_LEVEL); +	irq_set_chip_and_handler(virq, &flipper_pic, handle_level_irq);  	return 0;  } -static void flipper_pic_unmap(struct irq_host *h, unsigned int irq) -{ -	set_irq_chip_data(irq, NULL); -	set_irq_chip(irq, NULL); -} - -static int flipper_pic_match(struct irq_host *h, struct device_node *np) +static int flipper_pic_match(struct irq_domain *h, struct device_node *np)  {  	return 1;  } -static struct irq_host_ops flipper_irq_host_ops = { +static const struct irq_domain_ops flipper_irq_domain_ops = {  	.map = flipper_pic_map, -	.unmap = flipper_pic_unmap,  	.match = flipper_pic_match,  }; @@ -137,10 +131,10 @@ static void __flipper_quiesce(void __iomem *io_base)  	out_be32(io_base + FLIPPER_ICR, 0xffffffff);  } -struct irq_host * __init flipper_pic_init(struct device_node *np) +struct irq_domain * __init flipper_pic_init(struct device_node *np)  {  	struct device_node *pi; -	struct irq_host *irq_host = NULL; +	struct irq_domain *irq_domain = NULL;  	struct resource res;  	void __iomem *io_base;  	int retval; @@ -166,17 +160,15 @@ struct irq_host * __init flipper_pic_init(struct device_node *np)  	__flipper_quiesce(io_base); -	irq_host = irq_alloc_host(np, IRQ_HOST_MAP_LINEAR, FLIPPER_NR_IRQS, -				  &flipper_irq_host_ops, -1); -	if (!irq_host) { -		pr_err("failed to allocate irq_host\n"); +	irq_domain = irq_domain_add_linear(np, FLIPPER_NR_IRQS, +				  &flipper_irq_domain_ops, io_base); +	if (!irq_domain) { +		pr_err("failed to allocate irq_domain\n");  		return NULL;  	} -	irq_host->host_data = io_base; -  out: -	return irq_host; +	return irq_domain;  }  unsigned int flipper_pic_get_irq(void) diff --git a/arch/powerpc/platforms/embedded6xx/gamecube.c b/arch/powerpc/platforms/embedded6xx/gamecube.c index 1106fd99627..a138e14bad2 100644 --- a/arch/powerpc/platforms/embedded6xx/gamecube.c +++ b/arch/powerpc/platforms/embedded6xx/gamecube.c @@ -75,14 +75,6 @@ static void gamecube_shutdown(void)  	flipper_quiesce();  } -#ifdef CONFIG_KEXEC -static int gamecube_kexec_prepare(struct kimage *image) -{ -	return 0; -} -#endif /* CONFIG_KEXEC */ - -  define_machine(gamecube) {  	.name			= "gamecube",  	.probe			= gamecube_probe, @@ -95,9 +87,6 @@ define_machine(gamecube) {  	.calibrate_decr		= generic_calibrate_decr,  	.progress		= udbg_progress,  	.machine_shutdown	= gamecube_shutdown, -#ifdef CONFIG_KEXEC -	.machine_kexec_prepare	= gamecube_kexec_prepare, -#endif  }; diff --git a/arch/powerpc/platforms/embedded6xx/hlwd-pic.c b/arch/powerpc/platforms/embedded6xx/hlwd-pic.c index a771f91e215..c269caee58f 100644 --- a/arch/powerpc/platforms/embedded6xx/hlwd-pic.c +++ b/arch/powerpc/platforms/embedded6xx/hlwd-pic.c @@ -15,9 +15,10 @@  #define pr_fmt(fmt) DRV_MODULE_NAME ": " fmt  #include <linux/kernel.h> -#include <linux/init.h>  #include <linux/irq.h>  #include <linux/of.h> +#include <linux/of_address.h> +#include <linux/of_irq.h>  #include <asm/io.h>  #include "hlwd-pic.h" @@ -41,36 +42,36 @@   *   */ -static void hlwd_pic_mask_and_ack(unsigned int virq) +static void hlwd_pic_mask_and_ack(struct irq_data *d)  { -	int irq = virq_to_hw(virq); -	void __iomem *io_base = get_irq_chip_data(virq); +	int irq = irqd_to_hwirq(d); +	void __iomem *io_base = irq_data_get_irq_chip_data(d);  	u32 mask = 1 << irq;  	clrbits32(io_base + HW_BROADWAY_IMR, mask);  	out_be32(io_base + HW_BROADWAY_ICR, mask);  } -static void hlwd_pic_ack(unsigned int virq) +static void hlwd_pic_ack(struct irq_data *d)  { -	int irq = virq_to_hw(virq); -	void __iomem *io_base = get_irq_chip_data(virq); +	int irq = irqd_to_hwirq(d); +	void __iomem *io_base = irq_data_get_irq_chip_data(d);  	out_be32(io_base + HW_BROADWAY_ICR, 1 << irq);  } -static void hlwd_pic_mask(unsigned int virq) +static void hlwd_pic_mask(struct irq_data *d)  { -	int irq = virq_to_hw(virq); -	void __iomem *io_base = get_irq_chip_data(virq); +	int irq = irqd_to_hwirq(d); +	void __iomem *io_base = irq_data_get_irq_chip_data(d);  	clrbits32(io_base + HW_BROADWAY_IMR, 1 << irq);  } -static void hlwd_pic_unmask(unsigned int virq) +static void hlwd_pic_unmask(struct irq_data *d)  { -	int irq = virq_to_hw(virq); -	void __iomem *io_base = get_irq_chip_data(virq); +	int irq = irqd_to_hwirq(d); +	void __iomem *io_base = irq_data_get_irq_chip_data(d);  	setbits32(io_base + HW_BROADWAY_IMR, 1 << irq);  } @@ -78,10 +79,10 @@ static void hlwd_pic_unmask(unsigned int virq)  static struct irq_chip hlwd_pic = {  	.name		= "hlwd-pic", -	.ack		= hlwd_pic_ack, -	.mask_ack	= hlwd_pic_mask_and_ack, -	.mask		= hlwd_pic_mask, -	.unmask		= hlwd_pic_unmask, +	.irq_ack	= hlwd_pic_ack, +	.irq_mask_ack	= hlwd_pic_mask_and_ack, +	.irq_mask	= hlwd_pic_mask, +	.irq_unmask	= hlwd_pic_unmask,  };  /* @@ -89,29 +90,22 @@ static struct irq_chip hlwd_pic = {   *   */ -static struct irq_host *hlwd_irq_host; +static struct irq_domain *hlwd_irq_host; -static int hlwd_pic_map(struct irq_host *h, unsigned int virq, +static int hlwd_pic_map(struct irq_domain *h, unsigned int virq,  			   irq_hw_number_t hwirq)  { -	set_irq_chip_data(virq, h->host_data); -	irq_to_desc(virq)->status |= IRQ_LEVEL; -	set_irq_chip_and_handler(virq, &hlwd_pic, handle_level_irq); +	irq_set_chip_data(virq, h->host_data); +	irq_set_status_flags(virq, IRQ_LEVEL); +	irq_set_chip_and_handler(virq, &hlwd_pic, handle_level_irq);  	return 0;  } -static void hlwd_pic_unmap(struct irq_host *h, unsigned int irq) -{ -	set_irq_chip_data(irq, NULL); -	set_irq_chip(irq, NULL); -} - -static struct irq_host_ops hlwd_irq_host_ops = { +static const struct irq_domain_ops hlwd_irq_domain_ops = {  	.map = hlwd_pic_map, -	.unmap = hlwd_pic_unmap,  }; -static unsigned int __hlwd_pic_get_irq(struct irq_host *h) +static unsigned int __hlwd_pic_get_irq(struct irq_domain *h)  {  	void __iomem *io_base = h->host_data;  	int irq; @@ -129,23 +123,24 @@ static unsigned int __hlwd_pic_get_irq(struct irq_host *h)  static void hlwd_pic_irq_cascade(unsigned int cascade_virq,  				      struct irq_desc *desc)  { -	struct irq_host *irq_host = get_irq_data(cascade_virq); +	struct irq_chip *chip = irq_desc_get_chip(desc); +	struct irq_domain *irq_domain = irq_get_handler_data(cascade_virq);  	unsigned int virq;  	raw_spin_lock(&desc->lock); -	desc->chip->mask(cascade_virq); /* IRQ_LEVEL */ +	chip->irq_mask(&desc->irq_data); /* IRQ_LEVEL */  	raw_spin_unlock(&desc->lock); -	virq = __hlwd_pic_get_irq(irq_host); +	virq = __hlwd_pic_get_irq(irq_domain);  	if (virq != NO_IRQ)  		generic_handle_irq(virq);  	else  		pr_err("spurious interrupt!\n");  	raw_spin_lock(&desc->lock); -	desc->chip->ack(cascade_virq); /* IRQ_LEVEL */ -	if (!(desc->status & IRQ_DISABLED) && desc->chip->unmask) -		desc->chip->unmask(cascade_virq); +	chip->irq_ack(&desc->irq_data); /* IRQ_LEVEL */ +	if (!irqd_irq_disabled(&desc->irq_data) && chip->irq_unmask) +		chip->irq_unmask(&desc->irq_data);  	raw_spin_unlock(&desc->lock);  } @@ -161,9 +156,9 @@ static void __hlwd_quiesce(void __iomem *io_base)  	out_be32(io_base + HW_BROADWAY_ICR, 0xffffffff);  } -struct irq_host *hlwd_pic_init(struct device_node *np) +struct irq_domain *hlwd_pic_init(struct device_node *np)  { -	struct irq_host *irq_host; +	struct irq_domain *irq_domain;  	struct resource res;  	void __iomem *io_base;  	int retval; @@ -183,15 +178,15 @@ struct irq_host *hlwd_pic_init(struct device_node *np)  	__hlwd_quiesce(io_base); -	irq_host = irq_alloc_host(np, IRQ_HOST_MAP_LINEAR, HLWD_NR_IRQS, -				  &hlwd_irq_host_ops, -1); -	if (!irq_host) { -		pr_err("failed to allocate irq_host\n"); +	irq_domain = irq_domain_add_linear(np, HLWD_NR_IRQS, +					   &hlwd_irq_domain_ops, io_base); +	if (!irq_domain) { +		pr_err("failed to allocate irq_domain\n"); +		iounmap(io_base);  		return NULL;  	} -	irq_host->host_data = io_base; -	return irq_host; +	return irq_domain;  }  unsigned int hlwd_pic_get_irq(void) @@ -206,7 +201,7 @@ unsigned int hlwd_pic_get_irq(void)  void hlwd_pic_probe(void)  { -	struct irq_host *host; +	struct irq_domain *host;  	struct device_node *np;  	const u32 *interrupts;  	int cascade_virq; @@ -217,8 +212,8 @@ void hlwd_pic_probe(void)  			host = hlwd_pic_init(np);  			BUG_ON(!host);  			cascade_virq = irq_of_parse_and_map(np, 0); -			set_irq_data(cascade_virq, host); -			set_irq_chained_handler(cascade_virq, +			irq_set_handler_data(cascade_virq, host); +			irq_set_chained_handler(cascade_virq,  						hlwd_pic_irq_cascade);  			hlwd_irq_host = host;  			break; diff --git a/arch/powerpc/platforms/embedded6xx/holly.c b/arch/powerpc/platforms/embedded6xx/holly.c index b21fde589ca..8c305c7c897 100644 --- a/arch/powerpc/platforms/embedded6xx/holly.c +++ b/arch/powerpc/platforms/embedded6xx/holly.c @@ -26,8 +26,8 @@  #include <linux/tty.h>  #include <linux/serial_core.h>  #include <linux/of_platform.h> +#include <linux/module.h> -#include <asm/system.h>  #include <asm/time.h>  #include <asm/machdep.h>  #include <asm/prom.h> @@ -147,38 +147,20 @@ static void __init holly_setup_arch(void)  static void __init holly_init_IRQ(void)  {  	struct mpic *mpic; -	phys_addr_t mpic_paddr = 0; -	struct device_node *tsi_pic;  #ifdef CONFIG_PCI  	unsigned int cascade_pci_irq;  	struct device_node *tsi_pci;  	struct device_node *cascade_node = NULL;  #endif -	tsi_pic = of_find_node_by_type(NULL, "open-pic"); -	if (tsi_pic) { -		unsigned int size; -		const void *prop = of_get_property(tsi_pic, "reg", &size); -		mpic_paddr = of_translate_address(tsi_pic, prop); -	} - -	if (mpic_paddr == 0) { -		printk(KERN_ERR "%s: No tsi108 PIC found !\n", __func__); -		return; -	} - -	pr_debug("%s: tsi108 pic phys_addr = 0x%x\n", __func__, (u32) mpic_paddr); - -	mpic = mpic_alloc(tsi_pic, mpic_paddr, -			MPIC_PRIMARY | MPIC_BIG_ENDIAN | MPIC_WANTS_RESET | +	mpic = mpic_alloc(NULL, 0, MPIC_BIG_ENDIAN |  			MPIC_SPV_EOI | MPIC_NO_PTHROU_DIS | MPIC_REGSET_TSI108, -			24, -			NR_IRQS-4, /* num_sources used */ +			24, 0,  			"Tsi108_PIC");  	BUG_ON(mpic == NULL); -	mpic_assign_isu(mpic, 0, mpic_paddr + 0x100); +	mpic_assign_isu(mpic, 0, mpic->paddr + 0x100);  	mpic_init(mpic); @@ -198,12 +180,11 @@ static void __init holly_init_IRQ(void)  	cascade_pci_irq = irq_of_parse_and_map(tsi_pci, 0);  	pr_debug("%s: tsi108 cascade_pci_irq = 0x%x\n", __func__, (u32) cascade_pci_irq);  	tsi108_pci_int_init(cascade_node); -	set_irq_data(cascade_pci_irq, mpic); -	set_irq_chained_handler(cascade_pci_irq, tsi108_irq_cascade); +	irq_set_handler_data(cascade_pci_irq, mpic); +	irq_set_chained_handler(cascade_pci_irq, tsi108_irq_cascade);  #endif  	/* Configure MPIC outputs to CPU0 */  	tsi108_write_reg(TSI108_MPIC_OFFSET + 0x30c, 0); -	of_node_put(tsi_pic);  }  void holly_show_cpuinfo(struct seq_file *m) diff --git a/arch/powerpc/platforms/embedded6xx/linkstation.c b/arch/powerpc/platforms/embedded6xx/linkstation.c index 244f997de79..455e7c08742 100644 --- a/arch/powerpc/platforms/embedded6xx/linkstation.c +++ b/arch/powerpc/platforms/embedded6xx/linkstation.c @@ -81,29 +81,18 @@ static void __init linkstation_setup_arch(void)  static void __init linkstation_init_IRQ(void)  {  	struct mpic *mpic; -	struct device_node *dnp; -	const u32 *prop; -	int size; -	phys_addr_t paddr; -	dnp = of_find_node_by_type(NULL, "open-pic"); -	if (dnp == NULL) -		return; - -	prop = of_get_property(dnp, "reg", &size); -	paddr = (phys_addr_t)of_translate_address(dnp, prop); - -	mpic = mpic_alloc(dnp, paddr, MPIC_PRIMARY | MPIC_WANTS_RESET, 4, 32, " EPIC     "); +	mpic = mpic_alloc(NULL, 0, 0, 4, 0, " EPIC     ");  	BUG_ON(mpic == NULL);  	/* PCI IRQs */ -	mpic_assign_isu(mpic, 0, paddr + 0x10200); +	mpic_assign_isu(mpic, 0, mpic->paddr + 0x10200);  	/* I2C */ -	mpic_assign_isu(mpic, 1, paddr + 0x11000); +	mpic_assign_isu(mpic, 1, mpic->paddr + 0x11000);  	/* ttyS0, ttyS1 */ -	mpic_assign_isu(mpic, 2, paddr + 0x11100); +	mpic_assign_isu(mpic, 2, mpic->paddr + 0x11100);  	mpic_init(mpic);  } diff --git a/arch/powerpc/platforms/embedded6xx/mpc10x.h b/arch/powerpc/platforms/embedded6xx/mpc10x.h index b30a6a3b5bd..b290b63661f 100644 --- a/arch/powerpc/platforms/embedded6xx/mpc10x.h +++ b/arch/powerpc/platforms/embedded6xx/mpc10x.h @@ -81,17 +81,6 @@  #define	MPC10X_MAPB_PCI_MEM_OFFSET	(MPC10X_MAPB_ISA_MEM_BASE -	\  					 MPC10X_MAPB_PCI_MEM_START) -/* Set hose members to values appropriate for the mem map used */ -#define	MPC10X_SETUP_HOSE(hose, map) {					\ -	(hose)->pci_mem_offset = MPC10X_MAP##map##_PCI_MEM_OFFSET;	\ -	(hose)->io_space.start = MPC10X_MAP##map##_PCI_IO_START;	\ -	(hose)->io_space.end = MPC10X_MAP##map##_PCI_IO_END;		\ -	(hose)->mem_space.start = MPC10X_MAP##map##_PCI_MEM_START;	\ -	(hose)->mem_space.end = MPC10X_MAP##map##_PCI_MEM_END;		\ -	(hose)->io_base_virt = (void *)MPC10X_MAP##map##_ISA_IO_BASE;	\ -} - -  /* Miscellaneous Configuration register offsets */  #define	MPC10X_CFG_PIR_REG		0x09  #define	MPC10X_CFG_PIR_HOST_BRIDGE	0x00 diff --git a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c b/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c index 7a2ba39d781..beeaf4a173e 100644 --- a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c +++ b/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c @@ -23,6 +23,7 @@  #include <linux/pci.h>  #include <linux/kdev_t.h>  #include <linux/console.h> +#include <linux/module.h>  #include <linux/delay.h>  #include <linux/irq.h>  #include <linux/seq_file.h> @@ -31,7 +32,6 @@  #include <linux/tty.h>  #include <linux/serial_core.h> -#include <asm/system.h>  #include <asm/time.h>  #include <asm/machdep.h>  #include <asm/prom.h> @@ -101,39 +101,20 @@ static void __init mpc7448_hpc2_setup_arch(void)  static void __init mpc7448_hpc2_init_IRQ(void)  {  	struct mpic *mpic; -	phys_addr_t mpic_paddr = 0; -	struct device_node *tsi_pic;  #ifdef CONFIG_PCI  	unsigned int cascade_pci_irq;  	struct device_node *tsi_pci;  	struct device_node *cascade_node = NULL;  #endif -	tsi_pic = of_find_node_by_type(NULL, "open-pic"); -	if (tsi_pic) { -		unsigned int size; -		const void *prop = of_get_property(tsi_pic, "reg", &size); -		mpic_paddr = of_translate_address(tsi_pic, prop); -	} - -	if (mpic_paddr == 0) { -		printk("%s: No tsi108 PIC found !\n", __func__); -		return; -	} - -	DBG("%s: tsi108 pic phys_addr = 0x%x\n", __func__, -	    (u32) mpic_paddr); - -	mpic = mpic_alloc(tsi_pic, mpic_paddr, -			MPIC_PRIMARY | MPIC_BIG_ENDIAN | MPIC_WANTS_RESET | +	mpic = mpic_alloc(NULL, 0, MPIC_BIG_ENDIAN |  			MPIC_SPV_EOI | MPIC_NO_PTHROU_DIS | MPIC_REGSET_TSI108, -			24, -			NR_IRQS-4, /* num_sources used */ +			24, 0,  			"Tsi108_PIC");  	BUG_ON(mpic == NULL); -	mpic_assign_isu(mpic, 0, mpic_paddr + 0x100); +	mpic_assign_isu(mpic, 0, mpic->paddr + 0x100);  	mpic_init(mpic); @@ -153,12 +134,11 @@ static void __init mpc7448_hpc2_init_IRQ(void)  	DBG("%s: tsi108 cascade_pci_irq = 0x%x\n", __func__,  	    (u32) cascade_pci_irq);  	tsi108_pci_int_init(cascade_node); -	set_irq_data(cascade_pci_irq, mpic); -	set_irq_chained_handler(cascade_pci_irq, tsi108_irq_cascade); +	irq_set_handler_data(cascade_pci_irq, mpic); +	irq_set_chained_handler(cascade_pci_irq, tsi108_irq_cascade);  #endif  	/* Configure MPIC outputs to CPU0 */  	tsi108_write_reg(TSI108_MPIC_OFFSET + 0x30c, 0); -	of_node_put(tsi_pic);  }  void mpc7448_hpc2_show_cpuinfo(struct seq_file *m) diff --git a/arch/powerpc/platforms/embedded6xx/mvme5100.c b/arch/powerpc/platforms/embedded6xx/mvme5100.c new file mode 100644 index 00000000000..25e3bfb64ef --- /dev/null +++ b/arch/powerpc/platforms/embedded6xx/mvme5100.c @@ -0,0 +1,221 @@ +/* + * Board setup routines for the Motorola/Emerson MVME5100. + * + * Copyright 2013 CSC Australia Pty. Ltd. + * + * Based on earlier code by: + * + *    Matt Porter, MontaVista Software Inc. + *    Copyright 2001 MontaVista Software Inc. + * + * This program is free software; you can redistribute  it and/or modify it + * under  the terms of  the GNU General  Public License as published by the + * Free Software Foundation;  either version 2 of the  License, or (at your + * option) any later version. + * + * Author: Stephen Chivers <schivers@csc.com> + * + */ + +#include <linux/of_platform.h> + +#include <asm/i8259.h> +#include <asm/pci-bridge.h> +#include <asm/mpic.h> +#include <asm/prom.h> +#include <mm/mmu_decl.h> +#include <asm/udbg.h> + +#define HAWK_MPIC_SIZE		0x00040000U +#define MVME5100_PCI_MEM_OFFSET 0x00000000 + +/* Board register addresses. */ +#define BOARD_STATUS_REG	0xfef88080 +#define BOARD_MODFAIL_REG	0xfef88090 +#define BOARD_MODRST_REG	0xfef880a0 +#define BOARD_TBEN_REG		0xfef880c0 +#define BOARD_SW_READ_REG	0xfef880e0 +#define BOARD_GEO_ADDR_REG	0xfef880e8 +#define BOARD_EXT_FEATURE1_REG	0xfef880f0 +#define BOARD_EXT_FEATURE2_REG	0xfef88100 + +static phys_addr_t pci_membase; +static u_char *restart; + +static void mvme5100_8259_cascade(unsigned int irq, struct irq_desc *desc) +{ +	struct irq_chip *chip = irq_desc_get_chip(desc); +	unsigned int cascade_irq = i8259_irq(); + +	if (cascade_irq != NO_IRQ) +		generic_handle_irq(cascade_irq); + +	chip->irq_eoi(&desc->irq_data); +} + +static void __init mvme5100_pic_init(void) +{ +	struct mpic *mpic; +	struct device_node *np; +	struct device_node *cp = NULL; +	unsigned int cirq; +	unsigned long intack = 0; +	const u32 *prop = NULL; + +	np = of_find_node_by_type(NULL, "open-pic"); +	if (!np) { +		pr_err("Could not find open-pic node\n"); +		return; +	} + +	mpic = mpic_alloc(np, pci_membase, 0, 16, 256, " OpenPIC  "); + +	BUG_ON(mpic == NULL); +	of_node_put(np); + +	mpic_assign_isu(mpic, 0, pci_membase + 0x10000); + +	mpic_init(mpic); + +	cp = of_find_compatible_node(NULL, NULL, "chrp,iic"); +	if (cp == NULL) { +		pr_warn("mvme5100_pic_init: couldn't find i8259\n"); +		return; +	} + +	cirq = irq_of_parse_and_map(cp, 0); +	if (cirq == NO_IRQ) { +		pr_warn("mvme5100_pic_init: no cascade interrupt?\n"); +		return; +	} + +	np = of_find_compatible_node(NULL, "pci", "mpc10x-pci"); +	if (np) { +		prop = of_get_property(np, "8259-interrupt-acknowledge", NULL); + +		if (prop) +			intack = prop[0]; + +		of_node_put(np); +	} + +	if (intack) +		pr_debug("mvme5100_pic_init: PCI 8259 intack at 0x%016lx\n", +		   intack); + +	i8259_init(cp, intack); +	of_node_put(cp); +	irq_set_chained_handler(cirq, mvme5100_8259_cascade); +} + +static int __init mvme5100_add_bridge(struct device_node *dev) +{ +	const int		*bus_range; +	int			len; +	struct pci_controller	*hose; +	unsigned short		devid; + +	pr_info("Adding PCI host bridge %s\n", dev->full_name); + +	bus_range = of_get_property(dev, "bus-range", &len); + +	hose = pcibios_alloc_controller(dev); +	if (hose == NULL) +		return -ENOMEM; + +	hose->first_busno = bus_range ? bus_range[0] : 0; +	hose->last_busno = bus_range ? bus_range[1] : 0xff; + +	setup_indirect_pci(hose, 0xfe000cf8, 0xfe000cfc, 0); + +	pci_process_bridge_OF_ranges(hose, dev, 1); + +	early_read_config_word(hose, 0, 0, PCI_DEVICE_ID, &devid); + +	if (devid != PCI_DEVICE_ID_MOTOROLA_HAWK) { +		pr_err("HAWK PHB not present?\n"); +		return 0; +	} + +	early_read_config_dword(hose, 0, 0, PCI_BASE_ADDRESS_1, &pci_membase); + +	if (pci_membase == 0) { +		pr_err("HAWK PHB mibar not correctly set?\n"); +		return 0; +	} + +	pr_info("mvme5100_pic_init: pci_membase: %x\n", pci_membase); + +	return 0; +} + +static struct of_device_id mvme5100_of_bus_ids[] __initdata = { +	{ .compatible = "hawk-bridge", }, +	{}, +}; + +/* + * Setup the architecture + */ +static void __init mvme5100_setup_arch(void) +{ +	struct device_node *np; + +	if (ppc_md.progress) +		ppc_md.progress("mvme5100_setup_arch()", 0); + +	for_each_compatible_node(np, "pci", "hawk-pci") +		mvme5100_add_bridge(np); + +	restart = ioremap(BOARD_MODRST_REG, 4); +} + + +static void mvme5100_show_cpuinfo(struct seq_file *m) +{ +	seq_puts(m, "Vendor\t\t: Motorola/Emerson\n"); +	seq_puts(m, "Machine\t\t: MVME5100\n"); +} + +static void mvme5100_restart(char *cmd) +{ + +	local_irq_disable(); +	mtmsr(mfmsr() | MSR_IP); + +	out_8((u_char *) restart, 0x01); + +	while (1) +		; +} + +/* + * Called very early, device-tree isn't unflattened + */ +static int __init mvme5100_probe(void) +{ +	unsigned long root = of_get_flat_dt_root(); + +	return of_flat_dt_is_compatible(root, "MVME5100"); +} + +static int __init probe_of_platform_devices(void) +{ + +	of_platform_bus_probe(NULL, mvme5100_of_bus_ids, NULL); +	return 0; +} + +machine_device_initcall(mvme5100, probe_of_platform_devices); + +define_machine(mvme5100) { +	.name			= "MVME5100", +	.probe			= mvme5100_probe, +	.setup_arch		= mvme5100_setup_arch, +	.init_IRQ		= mvme5100_pic_init, +	.show_cpuinfo		= mvme5100_show_cpuinfo, +	.get_irq		= mpic_get_irq, +	.restart		= mvme5100_restart, +	.calibrate_decr		= generic_calibrate_decr, +	.progress		= udbg_progress, +}; diff --git a/arch/powerpc/platforms/embedded6xx/prpmc2800.c b/arch/powerpc/platforms/embedded6xx/prpmc2800.c deleted file mode 100644 index 670035f49a6..00000000000 --- a/arch/powerpc/platforms/embedded6xx/prpmc2800.c +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Board setup routines for the Motorola PrPMC2800 - * - * Author: Dale Farnsworth <dale@farnsworth.org> - * - * 2007 (c) MontaVista, Software, Inc.  This file is licensed under - * the terms of the GNU General Public License version 2.  This program - * is licensed "as is" without any warranty of any kind, whether express - * or implied. - */ - -#include <linux/stddef.h> -#include <linux/kernel.h> -#include <linux/delay.h> -#include <linux/interrupt.h> -#include <linux/seq_file.h> - -#include <asm/machdep.h> -#include <asm/prom.h> -#include <asm/system.h> -#include <asm/time.h> - -#include <mm/mmu_decl.h> - -#include <sysdev/mv64x60.h> - -#define MV64x60_MPP_CNTL_0	0x0000 -#define MV64x60_MPP_CNTL_2	0x0008 - -#define MV64x60_GPP_IO_CNTL	0x0000 -#define MV64x60_GPP_LEVEL_CNTL	0x0010 -#define MV64x60_GPP_VALUE_SET	0x0018 - -#define PLATFORM_NAME_MAX	32 - -static char prpmc2800_platform_name[PLATFORM_NAME_MAX]; - -static void __iomem *mv64x60_mpp_reg_base; -static void __iomem *mv64x60_gpp_reg_base; - -static void __init prpmc2800_setup_arch(void) -{ -	struct device_node *np; -	phys_addr_t paddr; -	const unsigned int *reg; - -	/* -	 * ioremap mpp and gpp registers in case they are later -	 * needed by prpmc2800_reset_board(). -	 */ -	np = of_find_compatible_node(NULL, NULL, "marvell,mv64360-mpp"); -	reg = of_get_property(np, "reg", NULL); -	paddr = of_translate_address(np, reg); -	of_node_put(np); -	mv64x60_mpp_reg_base = ioremap(paddr, reg[1]); - -	np = of_find_compatible_node(NULL, NULL, "marvell,mv64360-gpp"); -	reg = of_get_property(np, "reg", NULL); -	paddr = of_translate_address(np, reg); -	of_node_put(np); -	mv64x60_gpp_reg_base = ioremap(paddr, reg[1]); - -#ifdef CONFIG_PCI -	mv64x60_pci_init(); -#endif - -	printk("Motorola %s\n", prpmc2800_platform_name); -} - -static void prpmc2800_reset_board(void) -{ -	u32 temp; - -	local_irq_disable(); - -	temp = in_le32(mv64x60_mpp_reg_base + MV64x60_MPP_CNTL_0); -	temp &= 0xFFFF0FFF; -	out_le32(mv64x60_mpp_reg_base + MV64x60_MPP_CNTL_0, temp); - -	temp = in_le32(mv64x60_gpp_reg_base + MV64x60_GPP_LEVEL_CNTL); -	temp |= 0x00000004; -	out_le32(mv64x60_gpp_reg_base + MV64x60_GPP_LEVEL_CNTL, temp); - -	temp = in_le32(mv64x60_gpp_reg_base + MV64x60_GPP_IO_CNTL); -	temp |= 0x00000004; -	out_le32(mv64x60_gpp_reg_base + MV64x60_GPP_IO_CNTL, temp); - -	temp = in_le32(mv64x60_mpp_reg_base + MV64x60_MPP_CNTL_2); -	temp &= 0xFFFF0FFF; -	out_le32(mv64x60_mpp_reg_base + MV64x60_MPP_CNTL_2, temp); - -	temp = in_le32(mv64x60_gpp_reg_base + MV64x60_GPP_LEVEL_CNTL); -	temp |= 0x00080000; -	out_le32(mv64x60_gpp_reg_base + MV64x60_GPP_LEVEL_CNTL, temp); - -	temp = in_le32(mv64x60_gpp_reg_base + MV64x60_GPP_IO_CNTL); -	temp |= 0x00080000; -	out_le32(mv64x60_gpp_reg_base + MV64x60_GPP_IO_CNTL, temp); - -	out_le32(mv64x60_gpp_reg_base + MV64x60_GPP_VALUE_SET, 0x00080004); -} - -static void prpmc2800_restart(char *cmd) -{ -	volatile ulong i = 10000000; - -	prpmc2800_reset_board(); - -	while (i-- > 0); -	panic("restart failed\n"); -} - -#ifdef CONFIG_NOT_COHERENT_CACHE -#define PPRPM2800_COHERENCY_SETTING "off" -#else -#define PPRPM2800_COHERENCY_SETTING "on" -#endif - -void prpmc2800_show_cpuinfo(struct seq_file *m) -{ -	seq_printf(m, "Vendor\t\t: Motorola\n"); -	seq_printf(m, "coherency\t: %s\n", PPRPM2800_COHERENCY_SETTING); -} - -/* - * Called very early, device-tree isn't unflattened - */ -static int __init prpmc2800_probe(void) -{ -	unsigned long root = of_get_flat_dt_root(); -	unsigned long len = PLATFORM_NAME_MAX; -	void *m; - -	if (!of_flat_dt_is_compatible(root, "motorola,PrPMC2800")) -		return 0; - -	/* Update ppc_md.name with name from dt */ -	m = of_get_flat_dt_prop(root, "model", &len); -	if (m) -		strncpy(prpmc2800_platform_name, m, -			min((int)len, PLATFORM_NAME_MAX - 1)); - -	_set_L2CR(_get_L2CR() | L2CR_L2E); -	return 1; -} - -define_machine(prpmc2800){ -	.name			= prpmc2800_platform_name, -	.probe			= prpmc2800_probe, -	.setup_arch		= prpmc2800_setup_arch, -	.init_early		= mv64x60_init_early, -	.show_cpuinfo		= prpmc2800_show_cpuinfo, -	.init_IRQ		= mv64x60_init_irq, -	.get_irq		= mv64x60_get_irq, -	.restart		= prpmc2800_restart, -	.calibrate_decr		= generic_calibrate_decr, -}; diff --git a/arch/powerpc/platforms/embedded6xx/storcenter.c b/arch/powerpc/platforms/embedded6xx/storcenter.c index 613070e9ddb..c458b60d14c 100644 --- a/arch/powerpc/platforms/embedded6xx/storcenter.c +++ b/arch/powerpc/platforms/embedded6xx/storcenter.c @@ -16,7 +16,6 @@  #include <linux/initrd.h>  #include <linux/of_platform.h> -#include <asm/system.h>  #include <asm/time.h>  #include <asm/prom.h>  #include <asm/mpic.h> @@ -77,41 +76,22 @@ static void __init storcenter_setup_arch(void)  }  /* - * Interrupt setup and service.  Interrrupts on the turbostation come + * Interrupt setup and service.  Interrupts on the turbostation come   * from the four PCI slots plus onboard 8241 devices: I2C, DUART.   */  static void __init storcenter_init_IRQ(void)  {  	struct mpic *mpic; -	struct device_node *dnp; -	const void *prop; -	int size; -	phys_addr_t paddr; - -	dnp = of_find_node_by_type(NULL, "open-pic"); -	if (dnp == NULL) -		return; - -	prop = of_get_property(dnp, "reg", &size); -	if (prop == NULL) { -		of_node_put(dnp); -		return; -	} - -	paddr = (phys_addr_t)of_translate_address(dnp, prop); -	mpic = mpic_alloc(dnp, paddr, MPIC_PRIMARY | MPIC_WANTS_RESET, -			16, 32, " OpenPIC  "); - -	of_node_put(dnp); +	mpic = mpic_alloc(NULL, 0, 0, 16, 0, " OpenPIC  ");  	BUG_ON(mpic == NULL);  	/*  	 * 16 Serial Interrupts followed by 16 Internal Interrupts.  	 * I2C is the second internal, so it is at 17, 0x11020.  	 */ -	mpic_assign_isu(mpic, 0, paddr + 0x10200); -	mpic_assign_isu(mpic, 1, paddr + 0x11000); +	mpic_assign_isu(mpic, 0, mpic->paddr + 0x10200); +	mpic_assign_isu(mpic, 1, mpic->paddr + 0x11000);  	mpic_init(mpic);  } diff --git a/arch/powerpc/platforms/embedded6xx/wii.c b/arch/powerpc/platforms/embedded6xx/wii.c index 649473a729b..6d8dadf19f0 100644 --- a/arch/powerpc/platforms/embedded6xx/wii.c +++ b/arch/powerpc/platforms/embedded6xx/wii.c @@ -18,7 +18,6 @@  #include <linux/init.h>  #include <linux/irq.h>  #include <linux/seq_file.h> -#include <linux/kexec.h>  #include <linux/of_platform.h>  #include <linux/memblock.h>  #include <mm/mmu_decl.h> @@ -80,24 +79,19 @@ void __init wii_memory_fixups(void)  	BUG_ON(memblock.memory.cnt != 2);  	BUG_ON(!page_aligned(p[0].base) || !page_aligned(p[1].base)); -	p[0].size = _ALIGN_DOWN(p[0].size, PAGE_SIZE); -	p[1].size = _ALIGN_DOWN(p[1].size, PAGE_SIZE); +	/* trim unaligned tail */ +	memblock_remove(ALIGN(p[1].base + p[1].size, PAGE_SIZE), +			(phys_addr_t)ULLONG_MAX); -	wii_hole_start = p[0].base + p[0].size; +	/* determine hole, add & reserve them */ +	wii_hole_start = ALIGN(p[0].base + p[0].size, PAGE_SIZE);  	wii_hole_size = p[1].base - wii_hole_start; - -	pr_info("MEM1: <%08llx %08llx>\n", p[0].base, p[0].size); -	pr_info("HOLE: <%08lx %08lx>\n", wii_hole_start, wii_hole_size); -	pr_info("MEM2: <%08llx %08llx>\n", p[1].base, p[1].size); - -	p[0].size += wii_hole_size + p[1].size; - -	memblock.memory.cnt = 1; -	memblock_analyze(); - -	/* reserve the hole */ +	memblock_add(wii_hole_start, wii_hole_size);  	memblock_reserve(wii_hole_start, wii_hole_size); +	BUG_ON(memblock.memory.cnt != 1); +	__memblock_dump_all(); +  	/* allow ioremapping the address space in the hole */  	__allow_ioremap_reserved = 1;  } @@ -226,13 +220,6 @@ static void wii_shutdown(void)  	flipper_quiesce();  } -#ifdef CONFIG_KEXEC -static int wii_machine_kexec_prepare(struct kimage *image) -{ -	return 0; -} -#endif /* CONFIG_KEXEC */ -  define_machine(wii) {  	.name			= "wii",  	.probe			= wii_probe, @@ -246,9 +233,6 @@ define_machine(wii) {  	.calibrate_decr		= generic_calibrate_decr,  	.progress		= udbg_progress,  	.machine_shutdown	= wii_shutdown, -#ifdef CONFIG_KEXEC -	.machine_kexec_prepare	= wii_machine_kexec_prepare, -#endif  };  static struct of_device_id wii_of_bus[] = {  | 
