arch/powerpc Ebony support (draft 3)
cover arch/powerpc Ebony support (draft 3)
Here's my latest stack of Ebony patches. Not yet ready for merging, but getting closer. Notable changes:
- Rebased on top of my latest set of zImage patches (which in
turn are based on some of Milton and Scott's zImage work)
- Device tree now contains rudimentary information on the EBC
and the Ebony's off-chip devices
- Reset support is now folded in, rather than a distinct patch
in the series.
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
PATCH 1/10 Define FIXED_PORT flag for serial_core
At present, the serial core always allows setserial in userspace to change the port address, irq and base clock of any serial port. That makes sense for legacy ISA ports, but not for (say) embedded ns16550 compatible serial ports at peculiar addresses. In these cases, the kernel code configuring the ports must know exactly where they are, and their clocking arrangements (which can be unusual on embedded boards). It doesn't make sense for userspace to change these settings.
Therefore, this patch defines a UPF_FIXED_PORT flag for the uart_port structure. If this flag is set when the serial port is configured, any attempts to alter the port's type, io address, irq or base clock with setserial are ignored.
In addition this patch uses the new flag for on-chip serial ports probed in arch/powerpc/kernel/legacy_serial.c, and for other hard-wired serial ports probed by drivers/serial/of_serial.c.
---
arch/powerpc/kernel/legacy_serial.c | 3 ++- drivers/serial/of_serial.c | 3 ++- drivers/serial/serial_core.c | 22 +++++++++++++--------- include/linux/serial_core.h | 1 + 4 files changed, 18 insertions(+), 11 deletions(-)
drivers/serial/serial_core.c +13 -9
@@ -672,19 +672,21 @@ static int uart_set_info(struct uart_sta*/ mutex_lock (&state->mutex); - change_irq = new_serial.irq != port->irq; + change_irq = !(port->flags &UPF_FIXED_PORT ) + && new_serial.irq != port->irq;/* * Since changing the 'type' of the port changes its resource * allocations, we should treat type changes the same as * IO port changes. */ - change_port = new_port != port->iobase || - (unsigned long )new_serial.iomem_base != port->mapbase || - new_serial.hub6 != port->hub6 || - new_serial.io_type != port->iotype || - new_serial.iomem_reg_shift != port->regshift || - new_serial.type != port->type; + change_port = !(port->flags &UPF_FIXED_PORT ) + && (new_port != port->iobase || + (unsigned long )new_serial.iomem_base != port->mapbase || + new_serial.hub6 != port->hub6 || + new_serial.io_type != port->iotype || + new_serial.iomem_reg_shift != port->regshift || + new_serial.type != port->type); old_flags = port->flags; new_flags = new_serial.flags;
@@ -796,8 +798,10 @@ static int uart_set_info(struct uart_sta } } - port->irq = new_serial.irq; - port->uartclk = new_serial.baud_base *16 ; +if (change_irq) + port->irq = new_serial.irq; +if (! (port->flags &UPF_FIXED_PORT )) + port->uartclk = new_serial.baud_base *16 ; port->flags = (port->flags & ~UPF_CHANGE_MASK ) | (new_flags &UPF_CHANGE_MASK ); port->custom_divisor = new_serial.custom_divisor;
include/linux/serial_core.h +1 -0
@@ -260,6 +260,7 @@ struct uart_port {#define UPF_CONS_FLOW ((__force upf_t) (1 << 23))#define UPF_SHARE_IRQ ((__force upf_t) (1 << 24))#define UPF_BOOT_AUTOCONF ((__force upf_t) (1 << 28)) +#define UPF_FIXED_PORT ((__force upf_t) (1 << 29))#define UPF_DEAD ((__force upf_t) (1 << 30))#define UPF_IOREMAP ((__force upf_t) (1 << 31))
arch/powerpc/kernel/legacy_serial.c +2 -1
@@ -115,7 +115,8 @@ static int __init add_legacy_soc_port(st {u64 addr;const u32 *addrp; -upf_t flags =UPF_BOOT_AUTOCONF |UPF_SKIP_TEST |UPF_SHARE_IRQ ; +upf_t flags =UPF_BOOT_AUTOCONF |UPF_SKIP_TEST |UPF_SHARE_IRQ + |UPF_FIXED_PORT ;struct device_node *tsi =of_get_parent (np);/* We only support ports that have a clock frequency properly
drivers/serial/of_serial.c +2 -1
@@ -48,7 +48,8 @@ static int __devinit of_platform_serial_ port->iotype =UPIO_MEM ; port->type = type; port->uartclk = *clk; - port->flags =UPF_SHARE_IRQ |UPF_BOOT_AUTOCONF |UPF_IOREMAP ; + port->flags =UPF_SHARE_IRQ |UPF_BOOT_AUTOCONF |UPF_IOREMAP + |UPF_FIXED_PORT ; port->dev = &ofdev->dev; port->custom_divisor = *clk / (16 * (*spd));
PATCH 2/10 Use resource_size_t for serial port IO addresses
In reply to David GibsonAt present, various parts of the serial code use unsigned long to define resource addresses. This is a problem, because some 32-bit platforms have physical addresses larger than 32-bits, and have mmio serial uarts located above the 4GB point.
This patch changes the type of mapbase in both struct uart_port and struct plat_serial8250_port to resource_size_t, which can be configured to be 64 bits on such platforms. The mapbase in serial_struct can't safely be changed, because that structure is user visible.
---
drivers/serial/8250.c | 5 +++-- drivers/serial/8250_early.c | 16 +++++++++------- drivers/serial/serial_core.c | 9 +++++---- include/linux/serial_8250.h | 2 +- include/linux/serial_core.h | 2 +- 5 files changed, 19 insertions(+), 15 deletions(-)
include/linux/serial_core.h +1 -1
@@ -273,7 +273,7 @@ struct uart_port {const struct uart_ops *ops;unsigned int custom_divisor;unsigned int line;/* port index */ -unsigned long mapbase;/* for ioremap */ +resource_size_t mapbase;/* for ioremap */ struct device *dev;/* parent device */ unsigned char hub6;/* this should be in the 8250 driver */ unsigned char unused[3 ];
drivers/serial/serial_core.c +5 -4
@@ -633,7 +633,7 @@ static int uart_get_info(struct uart_sta tmp.hub6 = port->hub6; tmp.io_type = port->iotype; tmp.iomem_reg_shift = port->regshift; - tmp.iomem_base = (void *)port->mapbase; + tmp.iomem_base = (void *)(unsigned long )port->mapbase;if (copy_to_user (retinfo, &tmp,sizeof (*retinfo)))return -EFAULT ;
@@ -1673,10 +1673,11 @@ static int uart_line_info(char *buf, strreturn 0 ; mmio = port->iotype >=UPIO_MEM ; - ret =sprintf (buf,"%d: uart:%s %s%08lX irq:%d" , + ret =sprintf (buf,"%d: uart:%s %s%08llX irq:%d" , port->line,uart_type (port), mmio ?"mmio:0x" :"port:" , - mmio ? port->mapbase : (unsigned long ) port->iobase, + mmio ? (unsigned long long )port->mapbase + : (unsigned long long ) port->iobase, port->irq);if (port->type ==PORT_UNKNOWN ) {
@@ -2069,7 +2070,7 @@ uart_report_port(struct uart_driver *drvcase UPIO_AU :case UPIO_TSI :snprintf (address,sizeof (address), -"MMIO 0x%lx" , port->mapbase); +"MMIO 0x%llx" , (unsigned long long )port->mapbase);break ;default :strlcpy (address,"*unknown*" ,sizeof (address));
drivers/serial/8250_early.c +9 -7
@@ -145,8 +145,9 @@ static int __init parse_options(struct e port->mapbase =simple_strtoul (options +5 , &options,0 ); port->membase =ioremap (port->mapbase, mapsize);if (!port->membase) { -printk (KERN_ERR "%s: Couldn't ioremap 0x%lx\n" , - __FUNCTION__, port->mapbase); +printk (KERN_ERR "%s: Couldn't ioremap 0x%llx\n" , + __FUNCTION__, + (unsigned long long )port->mapbase);return -ENOMEM ; } mmio =1 ;
@@ -168,9 +169,10 @@ static int __init parse_options(struct e device->baud); } -printk (KERN_INFO "Early serial console at %s 0x%lx (options '%s')\n" , +printk (KERN_INFO "Early serial console at %s 0x%llx (options '%s')\n" , mmio ?"MMIO" :"I/O port" , - mmio ? port->mapbase : (unsigned long ) port->iobase, + mmio ? (unsigned long long ) port->mapbase + : (unsigned long long ) port->iobase, device->options);return 0 ; }
@@ -236,10 +238,10 @@ static int __init early_uart_console_swi mmio = (port->iotype ==UPIO_MEM ); line =serial8250_start_console (port, device->options);if (line <0 ) -printk ("No ttyS device at %s 0x%lx for console\n" , +printk ("No ttyS device at %s 0x%llx for console\n" , mmio ?"MMIO" :"I/O port" , - mmio ? port->mapbase : - (unsigned long ) port->iobase); + mmio ? (unsigned long long ) port->mapbase + : (unsigned long long ) port->iobase);unregister_console (&early_uart_console);if (mmio)
include/linux/serial_8250.h +1 -1
@@ -20,7 +20,7 @@struct plat_serial8250_port {unsigned long iobase;/* io base address */ void __iomem *membase;/* ioremap cookie or NULL */ -unsigned long mapbase;/* resource base */ +resource_size_t mapbase;/* resource base */ unsigned int irq;/* interrupt number */ unsigned int uartclk;/* UART clock rate */ unsigned char regshift;/* register shift */
drivers/serial/8250.c +3 -2
@@ -2550,8 +2550,9 @@ static int __devinit serial8250_probe(st ret =serial8250_register_port (&port);if (ret <0 ) {dev_err (&dev->dev,"unable to register port at index %d " -"(IO%lx MEM%lx IRQ%d): %d\n" , i, - p->iobase, p->mapbase, p->irq, ret); +"(IO%lx MEM%llx IRQ%d): %d\n" , i, + p->iobase, (unsigned long long )p->mapbase, + p->irq, ret); } }return 0 ;
PATCH 3/10 Re-organize Kconfig code for 4xx in arch/powerpc
In reply to David GibsonNow that we always take a device tree in arch/powerpc, there's no good reason not to allow a single kernel to support multiple embedded 4xx boards - the correct platform code can be selected based on the device tree information.
Therefore, this patch re-arranges the 4xx Kconfig code to allow this. In addition we:
- use "select" instead of depends to configure the correct config options for specific 4xx CPUs and workarounds, which makes the information about specific boards and CPUs less scattered.
- Some old, unused (in arch/powerpc) config options are
removed: WANT_EARLY_SERIAL, IBM_OCP, etc.
---
arch/powerpc/platforms/4xx/Kconfig | 378 ++++++++++++++----------------------- 1 file changed, 153 insertions(+), 225 deletions(-)
arch/powerpc/platforms/4xx/Kconfig +153 -225
@@ -3,278 +3,206 @@ config 4xx depends on 40x || 44x default y -config WANT_EARLY_SERIAL +config BOOKE bool - select SERIAL_8250 - default n - -menu "AMCC 4xx options" - depends on 4xx - -choice - prompt "Machine Type" - depends on 40x - default WALNUT - -config BUBINGA - bool "Bubinga" - select WANT_EARLY_SERIAL - help - This option enables support for the IBM 405EP evaluation board. - -config CPCI405 - bool "CPCI405" - help - This option enables support for the CPCI405 board. - -config EP405 - bool "EP405/EP405PC" - help - This option enables support for the EP405/EP405PC boards. - -config REDWOOD_5 - bool "Redwood-5" - help - This option enables support for the IBM STB04 evaluation board. - -config REDWOOD_6 - bool "Redwood-6" - help - This option enables support for the IBM STBx25xx evaluation board. - -config SYCAMORE - bool "Sycamore" - help - This option enables support for the IBM PPC405GPr evaluation board. - -config WALNUT - bool "Walnut" - help - This option enables support for the IBM PPC405GP evaluation board. - -config XILINX_ML300 - bool "Xilinx-ML300" - help - This option enables support for the Xilinx ML300 evaluation board. - -endchoice - -choice - prompt "Machine Type" depends on 44x - default EBONY - -config BAMBOO - bool "Bamboo" - select WANT_EARLY_SERIAL - help - This option enables support for the IBM PPC440EP evaluation board. - -config EBONY - bool "Ebony" - select WANT_EARLY_SERIAL - help - This option enables support for the IBM PPC440GP evaluation board. - -config LUAN - bool "Luan" - select WANT_EARLY_SERIAL - help - This option enables support for the IBM PPC440SP evaluation board. - -config OCOTEA - bool "Ocotea" - select WANT_EARLY_SERIAL - help - This option enables support for the IBM PPC440GX evaluation board. + default y -endchoice +menu "AMCC 40x options" + depends on 40x -config EP405PC - bool "EP405PC Support" - depends on EP405 +#config BUBINGA +# bool "Bubinga" +# depends on 40x +# default n +# select 405EP +# help +# This option enables support for the IBM 405EP evaluation board. + +#config CPCI405 +# bool "CPCI405" +# depends on 40x +# default n +# select 405GP +# help +# This option enables support for the CPCI405 board. + +#config EP405 +# bool "EP405/EP405PC" +# depends on 40x +# default n +# select 405GP +# help +# This option enables support for the EP405/EP405PC boards. + +#config EP405PC +# bool "EP405PC Support" +# depends on EP405 +# default y +# help +# This option enables support for the extra features of the EP405PC board. + +#config REDWOOD_5 +# bool "Redwood-5" +# depends on 40x +# default n +# select STB03xxx +# help +# This option enables support for the IBM STB04 evaluation board. + +#config REDWOOD_6 +# bool "Redwood-6" +# depends on 40x +# default n +# select STB03xxx +# help +# This option enables support for the IBM STBx25xx evaluation board. + +#config SYCAMORE +# bool "Sycamore" +# depends on 40x +# default n +# select 405GPR +# help +# This option enables support for the IBM PPC405GPr evaluation board. + +#config WALNUT +# bool "Walnut" +# depends on 40x +# default y +# select 405GP +# help +# This option enables support for the IBM PPC405GP evaluation board. + +#config XILINX_ML300 +# bool "Xilinx-ML300" +# depends on 40x +# default y +# select VIRTEX_II_PRO +# help +# This option enables support for the Xilinx ML300 evaluation board. +endmenu -# It's often necessary to know the specific 4xx processor type. -# Fortunately, it is impled (so far) from the board type, so we -# don't need to ask more redundant questions. +# 40x specific CPU modules, selected based on the board above. config NP405H bool - depends on ASH - default y + #depends on ASH -config 440EP +# OAK doesn't exist but wanted to keep this around for any future 403GCX boards +config 403GCX bool - depends on BAMBOO - select PPC_FPU - default y + #depends on OAK + select IBM405_ERR51 -config 440GP +config 405GP bool - depends on EBONY - default y + select IBM405_ERR77 + select IBM405_ERR51 -config 440GX +config 405EP bool - depends on OCOTEA - default y -config 440SP +config 405GPR bool - depends on LUAN - default y -config 440 +config VIRTEX_II_PRO bool - depends on 440GP || 440SP || 440EP - default y + select IBM405_ERR77 + select IBM405_ERR51 -config 440A +config STB03xxx bool - depends on 440GX - default y + select IBM405_ERR77 + select IBM405_ERR51 -config IBM440EP_ERR42 - bool - depends on 440EP - default y +# 40x errata/workaround config symbols, selected by the CPU models above # All 405-based cores up until the 405GPR and 405EP have this errata. config IBM405_ERR77 bool - depends on 40x && !403GCX && !405GPR && !405EP - default y # All 40x-based cores, up until the 405GPR and 405EP have this errata. config IBM405_ERR51 bool - depends on 40x && !405GPR && !405EP - default y -config BOOKE - bool +menu "AMCC 44x options" depends on 44x - default y -config IBM_OCP - bool - depends on ASH || BAMBOO || BUBINGA || CPCI405 || EBONY || EP405 || LUAN || OCOTEA || REDWOOD_5 || REDWOOD_6 || SYCAMORE || WALNUT - default y +#config BAMBOO +# bool "Bamboo" +# depends on 44x +# default n +# select 440EP +# help +# This option enables support for the IBM PPC440EP evaluation board. -config XILINX_OCP - bool - depends on XILINX_ML300 - default y - -config IBM_EMAC4 - bool - depends on 440GX || 440SP - default y - -config BIOS_FIXUP - bool - depends on BUBINGA || EP405 || SYCAMORE || WALNUT - default y - -# OAK doesn't exist but wanted to keep this around for any future 403GCX boards -config 403GCX - bool - depends on OAK - default y - -config 405EP - bool - depends on BUBINGA - default y - -config 405GP - bool - depends on CPCI405 || EP405 || WALNUT - default y - -config 405GPR - bool - depends on SYCAMORE - default y - -config VIRTEX_II_PRO - bool - depends on XILINX_ML300 - default y - -config STB03xxx - bool - depends on REDWOOD_5 || REDWOOD_6 - default y - -config EMBEDDEDBOOT - bool - depends on EP405 || XILINX_ML300 +config EBONY + bool "Ebony" + depends on 44x default y + select 440GP + help + This option enables support for the IBM PPC440GP evaluation board. -config IBM_OPENBIOS - bool - depends on ASH || BUBINGA || REDWOOD_5 || REDWOOD_6 || SYCAMORE || WALNUT - default y +#config LUAN +# bool "Luan" +# depends on 44x +# default n +# select 440SP +# help +# This option enables support for the IBM PPC440SP evaluation board. + +#config OCOTEA +# bool "Ocotea" +# depends on 44x +# default n +# select 440GX +# help +# This option enables support for the IBM PPC440GX evaluation board. -config PPC4xx_DMA - bool "PPC4xx DMA controller support" - depends on 4xx +endmenu -config PPC4xx_EDMA +# 44x specific CPU modules, selected based on the board above. +config 440EP bool - depends on !STB03xxx && PPC4xx_DMA - default y + select PPC_FPU + select IBM440EP_ERR42 -config PPC_GEN550 +config 440GP bool - depends on 4xx - default y - -choice - prompt "TTYS0 device and default console" - depends on 40x - default UART0_TTYS0 - -config UART0_TTYS0 - bool "UART0" - -config UART0_TTYS1 - bool "UART1" + select IBM_NEW_EMAC_ZMII -endchoice - -config SERIAL_SICC - bool "SICC Serial port support" - depends on STB03xxx - -config UART1_DFLT_CONSOLE +config 440GX bool - depends on SERIAL_SICC && UART0_TTYS1 - default y -config SERIAL_SICC_CONSOLE +config 440SP bool - depends on SERIAL_SICC && UART0_TTYS1 - default y -endmenu - -menu "IBM 40x options" - depends on 40x - -config SERIAL_SICC - bool "SICC Serial port" - depends on STB03xxx - -config UART1_DFLT_CONSOLE +config 440A bool - depends on SERIAL_SICC && UART0_TTYS1 + depends on 440GX default y -config SERIAL_SICC_CONSOLE +# 44x errata/workaround config symbols, selected by the CPU models above +config IBM440EP_ERR42 bool - depends on SERIAL_SICC && UART0_TTYS1 - default y -endmenu +#config XILINX_OCP +# bool +# depends on XILINX_ML300 +# default y + +#config BIOS_FIXUP +# bool +# depends on BUBINGA || EP405 || SYCAMORE || WALNUT +# default y + +#config PPC4xx_DMA +# bool "PPC4xx DMA controller support" +# depends on 4xx + +#config PPC4xx_EDMA +# bool +# depends on !STB03xxx && PPC4xx_DMA +# default y
PATCH 4/10 Add arch/powerpc driver for UIC, PPC4xx interrupt controller
In reply to David GibsonThis patch adds a driver to arch/powerpc/sysdev for the UIC, the on-chip interrupt controller from IBM/AMCC 4xx chips. It uses the new irq host mapping infrastructure.
---
arch/powerpc/sysdev/Makefile | 1 arch/powerpc/sysdev/uic.c | 338 +++++++++++++++++++++++++++++++++++++++++++ include/asm-powerpc/uic.h | 23 ++ 3 files changed, 362 insertions(+)
arch/powerpc/sysdev/uic.c new file +338 -0
@@ -0,0 +1,338 @@ +/* +* arch/powerpc/sysdev/uic.c +* +* IBM PowerPC 4xx Universal Interrupt Controller +* +* Copyright 2007 David Gibson <[email protected]>, IBM Corporation. +* +* 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. +*/ +#include <linux/kernel.h> +#include <linux/init.h> +#include <linux/errno.h> +#include <linux/reboot.h> +#include <linux/slab.h> +#include <linux/stddef.h> +#include <linux/sched.h> +#include <linux/signal.h> +#include <linux/sysdev.h> +#include <linux/device.h> +#include <linux/bootmem.h> +#include <linux/spinlock.h> +#include <linux/irq.h> +#include <linux/interrupt.h> +#include <asm/irq.h> +#include <asm/io.h> +#include <asm/prom.h> +#include <asm/dcr.h> + +#define NR_UIC_INTS 32 + +#define UIC_SR 0x0 +#define UIC_ER 0x2 +#define UIC_CR 0x3 +#define UIC_PR 0x4 +#define UIC_TR 0x5 +#define UIC_MSR 0x6 +#define UIC_VR 0x7 +#define UIC_VCR 0x8 + +#define uic_irq_to_hw (virq) (irq_map[virq].hwirq) + +struct uic *primary_uic; + +struct uic { +int index; +int dcrbase; + +spinlock_t lock; + +/* The remapper for this UIC */ +struct irq_host *irqhost; + +/* For secondary UICs, the cascade interrupt's irqaction */ +struct irqaction cascade; + +/* The device node of the interrupt controller */ +struct device_node *of_node; +}; + +static void uic_unmask_irq (unsigned int virq) +{ +struct uic *uic =get_irq_chip_data (virq); +unsigned int src =uic_irq_to_hw (virq); +unsigned long flags; +u32 er; + +spin_lock_irqsave (&uic->lock, flags); + er =mfdcr (uic->dcrbase +UIC_ER ); + er |=1 << (31 - src); +mtdcr (uic->dcrbase +UIC_ER , er); +spin_unlock_irqrestore (&uic->lock, flags); +} + +static void uic_mask_irq (unsigned int virq) +{ +struct uic *uic =get_irq_chip_data (virq); +unsigned int src =uic_irq_to_hw (virq); +unsigned long flags; +u32 er; + +spin_lock_irqsave (&uic->lock, flags); + er =mfdcr (uic->dcrbase +UIC_ER ); + er &= ~(1 << (31 - src)); +mtdcr (uic->dcrbase +UIC_ER , er); +spin_unlock_irqrestore (&uic->lock, flags); +} + +static void uic_ack_irq (unsigned int virq) +{ +struct uic *uic =get_irq_chip_data (virq); +unsigned int src =uic_irq_to_hw (virq); +unsigned long flags; + +spin_lock_irqsave (&uic->lock, flags); +mtdcr (uic->dcrbase +UIC_SR ,1 << (31 -src)); +spin_unlock_irqrestore (&uic->lock, flags); +} + +static int uic_set_irq_type (unsigned int virq,unsigned int flow_type) +{ +struct uic *uic =get_irq_chip_data (virq); +unsigned int src =uic_irq_to_hw (virq); +struct irq_desc *desc =get_irq_desc (virq); +unsigned long flags; +int trigger, polarity; +u32 tr, pr, mask; + +switch (flow_type &IRQ_TYPE_SENSE_MASK ) { +case IRQ_TYPE_NONE : +uic_mask_irq (virq); +return 0 ; + +case IRQ_TYPE_EDGE_RISING : + trigger =1 ; polarity =1 ; +break ; +case IRQ_TYPE_EDGE_FALLING : + trigger =1 ; polarity =0 ; +break ; +case IRQ_TYPE_LEVEL_HIGH : + trigger =0 ; polarity =1 ; +break ; +case IRQ_TYPE_LEVEL_LOW : + trigger =0 ; polarity =1 ; +break ; +default : +return -EINVAL ; + } + + mask = ~(1 << (31 - src)); + +spin_lock_irqsave (&uic->lock, flags); + tr =mfdcr (uic->dcrbase +UIC_TR ); + pr =mfdcr (uic->dcrbase +UIC_PR ); + tr = (tr & mask) | (trigger << (31 -src)); + pr = (pr & mask) | (polarity << (31 -src)); + +mtdcr (uic->dcrbase +UIC_PR , pr); +mtdcr (uic->dcrbase +UIC_TR , tr); + + desc->status &= ~(IRQ_TYPE_SENSE_MASK |IRQ_LEVEL ); + desc->status |= flow_type &IRQ_TYPE_SENSE_MASK ; +if (trigger) + desc->status |=IRQ_LEVEL ; + +spin_unlock_irqrestore (&uic->lock, flags); + +return 0 ; +} + +static struct irq_chip uic_irq_chip = { + .typename =" UIC " , + .unmask = uic_unmask_irq, + .mask = uic_mask_irq, +/* .mask_ack = uic_mask_irq_and_ack, */ + .ack = uic_ack_irq, + .set_type = uic_set_irq_type, +}; + +static int uic_host_match (struct irq_host *h,struct device_node *node) +{ +struct uic *uic = h->host_data; +return uic->of_node == node; +} + +static int uic_host_map (struct irq_host *h,unsigned int virq, +irq_hw_number_t hw) +{ +struct uic *uic = h->host_data; + +set_irq_chip_data (virq, uic); +/* Despite the name, handle_level_irq() works for both level +* and edge irqs on UIC. FIXME: check this is correct */ +set_irq_chip_and_handler (virq, &uic_irq_chip, handle_level_irq); + +/* Set default irq type */ +set_irq_type (virq,IRQ_TYPE_NONE ); + +return 0 ; +} + +static int uic_host_xlate (struct irq_host *h,struct device_node *ct, +u32 *intspec,unsigned int intsize, +irq_hw_number_t *out_hwirq,unsigned int *out_type) + +{ +/* UIC intspecs must have 2 cells */ +BUG_ON (intsize !=2 ); + *out_hwirq = intspec[0 ]; + *out_type = intspec[1 ]; +return 0 ; +} + +static struct irq_host_ops uic_host_ops = { + .match = uic_host_match, + .map = uic_host_map, + .xlate = uic_host_xlate, +}; + +irqreturn_t uic_cascade (int virq,void *data) +{ +struct uic *uic = data; +u32 msr; +int src; +int subvirq; + + msr =mfdcr (uic->dcrbase +UIC_MSR ); + src =32 -ffs (msr); + + subvirq =irq_linear_revmap (uic->irqhost, src); +generic_handle_irq (subvirq); + +return IRQ_HANDLED ; +} + +static struct uic *__init uic_init_one (struct device_node *node) +{ +struct uic *uic; +const u32 *indexp, *dcrreg; +int len; + +BUG_ON (!device_is_compatible (node,"ibm,uic" )); + + uic =alloc_bootmem (sizeof (*uic)); +if (! uic) +return NULL ;/* FIXME: panic? */ + +memset (uic,0 ,sizeof (*uic)); + uic->of_node =of_node_get (node); + indexp =get_property (node,"cell-index" , &len); +if (!indexp || (len !=sizeof (u32))) { +printk (KERN_ERR "uic: Device node %s has missing or invalid " +"cell-index property\n" , node->full_name); +return NULL ; + } + uic->index = *indexp; + + dcrreg =get_property (node,"dcr-reg" , &len); +if (!dcrreg || (len !=2 *sizeof (u32))) { +printk (KERN_ERR "uic: Device node %s has missing or invalid " +"dcr-reg property\n" , node->full_name); +return NULL ; + } + uic->dcrbase = *dcrreg; + + uic->irqhost =irq_alloc_host (IRQ_HOST_MAP_LINEAR ,NR_UIC_INTS , + &uic_host_ops,-1 ); +if (! uic->irqhost) { +of_node_put (node); +return NULL ;/* FIXME: panic? */ + } + + uic->irqhost->host_data = uic; + +/* Start with all interrupts disable and non-critical */ +mtdcr (uic->dcrbase +UIC_ER ,0 ); +mtdcr (uic->dcrbase +UIC_CR ,0 ); + +printk ("UIC%d (%d IRQ sources) at DCR 0x%x\n" , uic->index, +NR_UIC_INTS , uic->dcrbase); + +return uic; +} + +void __init uic_init_tree (void ) +{ +struct device_node *np; +struct uic *uic; +const u32 *interrupts; + +/* First locate and initialize the top-level UIC */ + + np =of_find_compatible_node (NULL ,NULL ,"ibm,uic" ); +while (np) { + interrupts =get_property (np,"interrupts" ,NULL ); +if (! interrupts) +break ; + + np =of_find_compatible_node (np,NULL ,"ibm,uic" ); + } + +BUG_ON (!np);/* uic_init_tree() assumes there's a UIC as the +* top-level interrupt controller */ + primary_uic =uic_init_one (np); +if (! primary_uic) +panic ("Unable to initialize primary UIC %s\n" , np->full_name); + +irq_set_default_host (primary_uic->irqhost); +of_node_put (np); + +/* The scan again for cascaded UICs */ + np =of_find_compatible_node (NULL ,NULL ,"ibm,uic" ); +while (np) { + interrupts =get_property (np,"interrupts" ,NULL ); +if (interrupts) { +/* Secondary UIC */ +int cascade_virq; +int ret; + + uic =uic_init_one (np); +if (! uic) +panic ("Unable to initialize a secondary UIC %s\n" , + np->full_name); + + cascade_virq =irq_of_parse_and_map (np,0 ); + + uic->cascade.handler = uic_cascade; + uic->cascade.name ="UIC cascade" ; + uic->cascade.dev_id = uic; + + ret =setup_irq (cascade_virq, &uic->cascade); +if (ret) +printk (KERN_ERR "Failed to setup_irq(%d) for " +"UIC%d cascade\n" , cascade_virq, + uic->index); + +/* FIXME: setup critical cascade?? */ + } + + np =of_find_compatible_node (np,NULL ,"ibm,uic" ); + } +} + +/* Return an interrupt vector or NO_IRQ if no interrupt is pending. */ +unsigned int uic_get_irq (void ) +{ +u32 msr; +int src; + +BUG_ON (! primary_uic); + + msr =mfdcr (primary_uic->dcrbase +UIC_MSR ); + src =32 -ffs (msr); + +return irq_linear_revmap (primary_uic->irqhost, src); +}
arch/powerpc/sysdev/Makefile +1 -0
@@ -17,6 +17,7 @@ obj-$(CONFIG_QUICC_ENGINE) += qe_lib/ ifeq ($(CONFIG_PPC_MERGE),y) obj-$(CONFIG_PPC_I8259) += i8259.o obj-$(CONFIG_PPC_83xx) += ipic.o +obj-$(CONFIG_4xx) += uic.o endif # Temporary hack until we have migrated to asm-powerpc
include/asm-powerpc/uic.h new file +23 -0
@@ -0,0 +1,23 @@ +/* +* include/asm-powerpc/uic.h +* +* IBM PPC4xx UIC external definitions and structure. +* +* Maintainer: David Gibson <[email protected]> +* Copyright 2007 IBM Corporation. +* +* 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. +*/ +#ifndef _ASM_POWERPC_UIC_H +#define _ASM_POWERPC_UIC_H + +#ifdef __KERNEL__ + +extern void __init uic_init_tree (void ); +extern unsigned int uic_get_irq (void ); + +#endif /* __KERNEL__ */ +#endif /* _ASM_POWERPC_UIC_H */
PATCH 5/10 Port 44x MMU definitions to ARCH=powerpc
In reply to David GibsonThis patch moves the mmu.h definitions which are still relevant for ARCH=powerpc from include/asm-ppc/mmu.h to their own file, include/asm-powerpc/mmu_44x.h. The new file is included from asm-powerpc/mmu.h, and a couple of other tweaks to correct mmu definitions for 44x are made.
---
arch/powerpc/kernel/head_44x.S | 4 - arch/powerpc/mm/44x_mmu.c | 81 +++++++------------------------------- arch/powerpc/mm/mmu_decl.h | 2 include/asm-powerpc/mmu-44x/mmu.h | 75 +++++++++++++++++++++++++++++++++++ include/asm-powerpc/mmu.h | 11 ++++- 5 files changed, 105 insertions(+), 68 deletions(-)
include/asm-powerpc/mmu.h +9 -2
@@ -2,8 +2,15 @@#define _ASM_POWERPC_MMU_H_#ifdef __KERNEL__ -#ifndef CONFIG_PPC64 -#include <asm-ppc/mmu.h> +#if defined(CONFIG_44x) +/* 44x-style software loaded TLB */ +# include <asm/mmu-44x/mmu.h> +#elif !defined(CONFIG_PPC64 ) +/* Other 32-bit. +* +* FIXME: split up the other 32-bit MMU types, and revise for +* arch/powerpc */ +# include <asm-ppc/mmu.h> #else /*
arch/powerpc/mm/44x_mmu.c +17 -64
112 lines not on this page · raw message
arch/powerpc/mm/mmu_decl.h +2 -0
@@ -35,8 +35,10 @@ extern int __map_without_bats;extern unsigned long ioremap_base;extern unsigned int rtas_data, rtas_size; +#ifdef CONFIG_CLASSIC32 extern PTE *Hash, *Hash_end;extern unsigned long Hash_size, Hash_mask; +#endif /* CONFIG_CLASSIC32 */ extern unsigned int num_tlbcam_entries;#endif
arch/powerpc/kernel/head_44x.S +2 -2
@@ -120,8 +120,8 @@ skpinv: addi r4,r4,1 /* Increment */ * Configure and load pinned entry into TLB slot 63. */ - lis r3,KERNELBASE@h /* Load the kernel virtual address */ - ori r3,r3,KERNELBASE@l + lis r3,PAGE_OFFSET@h + ori r3,r3,PAGE_OFFSET@l /* Kernel is at the base of RAM */ li r4, 0 /* Load the kernel physical address */
include/asm-powerpc/mmu-44x/mmu.h new file +75 -0
75 lines not on this page · raw message
PATCH 6/10 Support for Ebony in arch/powerpc
In reply to David GibsonThis patch adds platform support code for the Ebony (440GP) evaluation board.
---
arch/powerpc/configs/ebony_defconfig | 886 ++++++++++++++++++++++++++++++++++ arch/powerpc/kernel/head_44x.S | 10 arch/powerpc/platforms/4xx/44x.h | 7 arch/powerpc/platforms/4xx/Makefile | 3 arch/powerpc/platforms/4xx/ebony.c | 72 ++ arch/powerpc/platforms/4xx/misc_44x.S | 25 6 files changed, 992 insertions(+), 11 deletions(-)
arch/powerpc/platforms/4xx/Makefile +2 -1
@@ -1 +1,2 @@ -# empty makefile so make clean works +obj-$(CONFIG_EBONY) := ebony.o +obj-$(CONFIG_44x) += misc_44x.o
arch/powerpc/platforms/4xx/ebony.c new file +72 -0
72 lines not on this page · raw message
arch/powerpc/configs/ebony_defconfig new file +886 -0
886 lines not on this page · raw message
arch/powerpc/platforms/4xx/44x.h new file +7 -0
@@ -0,0 +1,7 @@ +#ifndef __POWERPC_PLATFORMS_4XX_44X_H +#define __POWERPC_PLATFORMS_4XX_44X_H + +extern void ppc44x_reset_system (char *cmd); + +#endif /* __POWERPC_PLATFORMS_4XX_44X_H */ +
arch/powerpc/platforms/4xx/misc_44x.S new file +25 -0
@@ -0,0 +1,25 @@ +/* + * This file contains miscellaneous low-level functions for PPC 44x. + * Copyright 2007 David Gibson <[email protected]>, IBM Corporation. + * + * 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. + * + */ + +#include <asm/reg.h> +#include <asm/ppc_asm.h> + + .text + +/* + * void ppc44x_reset_system(char *cmd) + * + * At present, this routine just applies a system reset. + */ +_GLOBAL(ppc44x_reset_system) + mfspr r13,SPRN_DBCR0 + oris r13,r13,DBCR0_RST_SYSTEM@h + mtspr SPRN_DBCR0,r13
arch/powerpc/kernel/head_44x.S +0 -10
@@ -709,16 +709,6 @@ _GLOBAL(giveup_fpu) blr #endif -/* - * extern void abort(void) - * - * At present, this routine just applies a system reset. - */ -_GLOBAL(abort) - mfspr r13,SPRN_DBCR0 - oris r13,r13,DBCR0_RST_SYSTEM@h - mtspr SPRN_DBCR0,r13 - _GLOBAL(set_context) #ifdef CONFIG_BDI_SWITCH
PATCH 7/10 Early serial debug support for PPC44x
In reply to David GibsonThis patch adds support for early serial debugging via the built in port on IBM/AMCC PowerPC 44x CPUs. It uses a bolted TLB entry in address space 1 for the UART's mapping, allowing robust debugging both before and after the initialization of the MMU.
---
arch/powerpc/Kconfig.debug | 23 ++++++++++++++++++----- arch/powerpc/kernel/head_44x.S | 34 +++++++++++++--------------------- arch/powerpc/kernel/of_platform.c | 1 - arch/powerpc/kernel/udbg.c | 3 +++ arch/powerpc/kernel/udbg_16550.c | 23 +++++++++++++++++++++++ arch/powerpc/platforms/4xx/44x.h | 2 ++ arch/powerpc/platforms/4xx/misc_44x.S | 31 +++++++++++++++++++++++++++++++ include/asm-powerpc/mmu-44x/mmu.h | 7 ++++++- include/asm-powerpc/udbg.h | 1 + 9 files changed, 97 insertions(+), 28 deletions(-)
arch/powerpc/Kconfig.debug +18 -5
@@ -130,11 +130,6 @@ config BOOTX_TEXT Say Y here to see progress messages from the boot firmware in text mode. Requires either BootX or Open Firmware. -config SERIAL_TEXT_DEBUG - bool "Support for early boot texts over serial port" - depends on 4xx || LOPEC || MV64X60 || PPLUS || PRPMC800 || \ - PPC_GEN550 || PPC_MPC52xx - config PPC_EARLY_DEBUG bool "Early debugging (dangerous)"
@@ -199,6 +194,24 @@ config PPC_EARLY_DEBUG_BEAT help Select this to enable early debugging for Celleb with Beat. +config PPC_EARLY_DEBUG_44x + bool "Early serial debugging for IBM/AMCC 44x CPUs" + depends on 44x + select PPC_UDBG_16550 + help + Select this to enable early debugging for IBM 44x chips via the + inbuilt serial port. + endchoice +config PPC_EARLY_DEBUG_44x_PHYSLOW + hex "Low 32 bits of early debug UART physical address" + depends PPC_EARLY_DEBUG_44x + default "0x40000200" + +config PPC_EARLY_DEBUG_44x_PHYSHIGH + hex "EPRN of early debug UART physical address" + depends PPC_EARLY_DEBUG_44x + default "0x1" + endmenu
arch/powerpc/kernel/head_44x.S +13 -21
@@ -172,36 +172,28 @@ skpinv: addi r4,r4,1 /* Increment */ isync 4: -#ifdef CONFIG_SERIAL_TEXT_DEBUG - /* - * Add temporary UART mapping for early debug. - * We can map UART registers wherever we want as long as they don't - * interfere with other system mappings (e.g. with pinned entries). - * For an example of how we handle this - see ocotea.h. --ebs - */ +#ifdef CONFIG_PPC_EARLY_DEBUG_44x + /* Add UART mapping for early debug. */ + /* pageid fields */ - lis r3,UART0_IO_BASE@h - ori r3,r3,PPC44x_TLB_VALID | PPC44x_TLB_4K + lis r3,PPC44x_EARLY_DEBUG_VIRTADDR@h + ori r3,r3,PPC44x_TLB_VALID|PPC44x_TLB_TS|PPC44x_TLB_64K /* xlat fields */ - lis r4,UART0_PHYS_IO_BASE@h /* RPN depends on SoC */ -#ifndef CONFIG_440EP - ori r4,r4,0x0001 /* ERPN is 1 for second 4GB page */ -#endif + lis r4,CONFIG_PPC_EARLY_DEBUG_44x_PHYSLOW@h + ori r4,r4,CONFIG_PPC_EARLY_DEBUG_44x_PHYSHIGH /* attrib fields */ - li r5,0 - ori r5,r5,(PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_I | PPC44x_TLB_G) - - li r0,0 /* TLB slot 0 */ + li r5,(PPC44x_TLB_SW|PPC44x_TLB_SR|PPC44x_TLB_I|PPC44x_TLB_G) + li r0,62 /* TLB slot 0 */ - tlbwe r3,r0,PPC44x_TLB_PAGEID /* Load the pageid fields */ - tlbwe r4,r0,PPC44x_TLB_XLAT /* Load the translation fields */ - tlbwe r5,r0,PPC44x_TLB_ATTRIB /* Load the attrib/access fields */ + tlbwe r3,r0,PPC44x_TLB_PAGEID + tlbwe r4,r0,PPC44x_TLB_XLAT + tlbwe r5,r0,PPC44x_TLB_ATTRIB /* Force context change */ isync -#endif /* CONFIG_SERIAL_TEXT_DEBUG */ +#endif /* CONFIG_PPC_EARLY_DEBUG_44x */ /* Establish the interrupt vector offsets */ SET_IVOR(0, CriticalInput);
arch/powerpc/kernel/udbg_16550.c +23 -0
@@ -191,3 +191,26 @@ void udbg_init_pas_realmode(void) udbg_getc_poll = NULL; }#endif /* CONFIG_PPC_MAPLE */ + +#ifdef CONFIG_PPC_EARLY_DEBUG_44x +#include <platforms/4xx/44x.h> + +static void udbg_44x_as1_putc (char c) +{ +if (udbg_comport) { +while ((as1_readb (&udbg_comport->lsr) &LSR_THRE ) ==0 ) +/* wait for idle */ ; +as1_writeb (c, &udbg_comport->thr);eieio (); +if (c =='\n' ) +udbg_44x_as1_putc ('\r' ); + } +} + +void __init udbg_init_44x_as1 (void ) +{ + udbg_comport = + (volatile struct NS16550 __iomem *)PPC44x_EARLY_DEBUG_VIRTADDR; + + udbg_putc = udbg_44x_as1_putc; +} +#endif /* CONFIG_PPC_EARLY_DEBUG_44x */
include/asm-powerpc/mmu-44x/mmu.h +6 -1
@@ -69,7 +69,12 @@ typedef struct {#define PPC44x_PIN_SHIFT 28#define PPC_PIN_SIZE (1 << PPC44x_PIN_SHIFT) +#ifndef CONFIG_PPC_EARLY_DEBUG_44x#define PPC44x_EARLY_TLBS 1 +#else +#define PPC44x_EARLY_TLBS 2 +#define PPC44x_EARLY_DEBUG_VIRTADDR (ASM_CONST(0xf0000000) \ + | (ASM_CONST(CONFIG_PPC_EARLY_DEBUG_44x_PHYSLOW) & 0xffff)) +#endif #endif /* _ASM_POWERPC_MMU_44X_MMU_H_ */ -
arch/powerpc/kernel/udbg.c +3 -0
@@ -51,6 +51,9 @@ void __init udbg_early_init(void)udbg_init_pas_realmode ();#elif defined(CONFIG_BOOTX_TEXT )udbg_init_btext (); +#elif defined(CONFIG_PPC_EARLY_DEBUG_44x) +/* PPC44x debug */ +udbg_init_44x_as1 ();#endif }
include/asm-powerpc/udbg.h +1 -0
@@ -47,6 +47,7 @@ extern void __init udbg_init_rtas_panel(extern void __init udbg_init_rtas_console (void );extern void __init udbg_init_debug_beat (void );extern void __init udbg_init_btext (void ); +extern void __init udbg_init_44x_as1 (void );#endif /* __KERNEL__ */ #endif /* _ASM_POWERPC_UDBG_H */
arch/powerpc/kernel/of_platform.c +0 -1
@@ -29,7 +29,6 @@#include <asm/ppc-pci.h> #include <asm/atomic.h> -/* * The list of OF IDs below is used for matching bus types in the * system whose devices are to be exposed as of_platform_devices.
arch/powerpc/platforms/4xx/misc_44x.S +31 -0
@@ -15,6 +15,37 @@ .text /* + * Do an IO access in AS1 + */ +_GLOBAL(as1_readb) + mfmsr r7 + ori r0,r7,MSR_DS + sync + mtmsr r0 + sync + isync + lbz r3,0(r3) + sync + mtmsr r7 + sync + isync + blr + +_GLOBAL(as1_writeb) + mfmsr r7 + ori r0,r7,MSR_DS + sync + mtmsr r0 + sync + isync + stb r3,0(r4) + sync + mtmsr r7 + sync + isync + blr + +/* * void ppc44x_reset_system(char *cmd) * * At present, this routine just applies a system reset.
arch/powerpc/platforms/4xx/44x.h +2 -0
@@ -1,6 +1,8 @@#ifndef __POWERPC_PLATFORMS_4XX_44X_H#define __POWERPC_PLATFORMS_4XX_44X_H +extern u8 as1_readb (volatile u8 __iomem *addr); +extern void as1_writeb (u8 data,volatile u8 __iomem *addr);extern void ppc44x_reset_system (char *cmd);#endif /* __POWERPC_PLATFORMS_4XX_44X_H */
Re: [PATCH 4/10] Add arch/powerpc driver for UIC, PPC4xx interrupt controller
In reply to David Gibsonarch/powerpc/sysdev/uic.c line 126
Quoted 7 lines · David Gibson
arch/powerpc/sysdev/uic.c new file +6
-0+static int uic_set_irq_type (unsigned int virq,unsigned int flow_type) + case IRQ_TYPE_LEVEL_HIGH: + trigger =0 ; polarity =1 ; +break ; +case IRQ_TYPE_LEVEL_LOW : + trigger =0 ; polarity =1 ;
Is this intended to be the same?
Domen
Re: [PATCH 4/10] Add arch/powerpc driver for UIC, PPC4xx interrupt controller
Quoted 10 lines · Domen Puncer
arch/powerpc/sysdev/uic.c line 126
Quoted 7 lines · David Gibson
arch/powerpc/sysdev/uic.c new file +6
-0+static int uic_set_irq_type (unsigned int virq,unsigned int flow_type) + case IRQ_TYPE_LEVEL_HIGH: + trigger =0 ; polarity =1 ; +break ; +case IRQ_TYPE_LEVEL_LOW : + trigger =0 ; polarity =1 ;Is this intended to be the same?
Oops, no. Thanks for spotting that, the Ebony has no level-low devices, so I didn't notice any problems.
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Re: [PATCH 4/10] Add arch/powerpc driver for UIC, PPC4xx interrupt controller
In reply to David GibsonQuoted 3 lines · David Gibson
Index:
working-2.6/arch/powerpc/sysdev/uic.c
===================================================================
<snip>
Quoted 32 lines
arch/powerpc/sysdev/uic.c new file +32
-0+static struct uic *__init uic_init_one (struct device_node *node) +{ +struct uic *uic; +const u32 *indexp, *dcrreg; +int len; + +BUG_ON (!device_is_compatible (node,"ibm,uic" )); + + uic =alloc_bootmem (sizeof (*uic)); +if (! uic) +return NULL ;/* FIXME: panic? */ + +memset (uic,0 ,sizeof (*uic)); + uic->of_node =of_node_get (node); + indexp =get_property (node,"cell-index" , &len); +if (!indexp || (len !=sizeof (u32))) { +printk (KERN_ERR "uic: Device node %s has missing or invalid " +"cell-index property\n" , node->full_name); +return NULL ; + } + uic->index = *indexp; + + dcrreg =get_property (node,"dcr-reg" , &len); +if (!dcrreg || (len !=2 *sizeof (u32))) { +printk (KERN_ERR "uic: Device node %s has missing or invalid " +"dcr-reg property\n" , node->full_name); +return NULL ; + } + uic->dcrbase = *dcrreg; + + uic->irqhost =irq_alloc_host (IRQ_HOST_MAP_LINEAR ,NR_UIC_INTS , + &uic_host_ops,-1 );
arch/powerpc/sysdev/uic.c line 259
Quoted 10 lines
arch/powerpc/sysdev/uic.c new file +10
-0+if (! uic->irqhost) { +of_node_put (node); +return NULL ;/* FIXME: panic? */ + } + + uic->irqhost->host_data = uic; + +/* Start with all interrupts disable and non-critical */ +mtdcr (uic->dcrbase +UIC_ER ,0 ); +mtdcr (uic->dcrbase +UIC_CR ,0 );
I think at this point we should also clear the interrupts in the SR register as well. When playing with the Bamboo port, I found that the firmware leaves pending interrupts, which can lead to some not nice results when the cascade bits are enabled.
josh
Re: [PATCH 5/10] Port 44x MMU definitions to ARCH=powerpc
In reply to David GibsonQuoted 9 lines · David Gibson
This patch moves the
mmu.hdefinitions which are still relevant for ARCH=powerpc frominclude/asm-ppc/mmu.hto their own file,include/asm-powerpc/mmu_44x.h. The new file is included fromasm-powerpc/mmu.h, and a couple of other tweaks to correct mmu definitions for 44x are made.Signed-off-by David Gibson <[email protected]>---
Quoted 8 lines
arch/powerpc/kernel/head_44x.S | 4 - arch/powerpc/mm/44x_mmu.c | 81 ++++++ +------------------------------- arch/powerpc/mm/mmu_decl.h | 2 include/asm-powerpc/mmu-44x/mmu.h | 75 ++++++++++++++++++++++++++ +++++++++ include/asm-powerpc/mmu.h | 11 ++++- 5 files changed, 105 insertions(+), 68 deletions(-)
Any reason you are creating a new directory in include/asm-powerpc for 44x mmu defn? why not just mmu_44x.h or something like that?
- k
Re: [PATCH 5/10] Port 44x MMU definitions to ARCH=powerpc
Quoted 21 lines · Kumar Gala
Quoted 9 lines · David Gibson
This patch moves the
mmu.hdefinitions which are still relevant for ARCH=powerpc frominclude/asm-ppc/mmu.hto their own file,include/asm-powerpc/mmu_44x.h. The new file is included fromasm-powerpc/mmu.h, and a couple of other tweaks to correct mmu definitions for 44x are made.Signed-off-by David Gibson <[email protected]>---
Quoted 8 lines
arch/powerpc/kernel/head_44x.S | 4 - arch/powerpc/mm/44x_mmu.c | 81 ++++++ +------------------------------- arch/powerpc/mm/mmu_decl.h | 2 include/asm-powerpc/mmu-44x/mmu.h | 75 ++++++++++++++++++++++++++ +++++++++ include/asm-powerpc/mmu.h | 11 ++++- 5 files changed, 105 insertions(+), 68 deletions(-)
Quoted 2 lines
Any reason you are creating a new directory in
include/asm-powerpcfor 44x mmu defn? why not justmmu_44x.hor something like that?
Heh, Stephen asked me that too, in person.
Originally I did use mmu_44x.h, but I'm looking ahead. In the middle term, I want to purge the last dependencies on include/asm-ppc from include/asm-powerpc, which currently includes all the mm headers:mmu.h, pgtable.h, pgalloc.h, possibly a couple of others.
It seems most sensible to me to have a subdirectory for each mmu family (32-bit has, 64-bit hash, 40x, 44x, FSL Book E, etc..) , with the relevant version of each of these files. This patch is a first tiny step in that direction.
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson