LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: update: consolidated flat device tree code
From: Paul Mackerras @ 2006-08-23  6:47 UTC (permalink / raw)
  To: Hollis Blanchard
  Cc: linuxppc-dev, Pantelis Antoniou, Sachin P. Sant,
	linuxppc-embedded
In-Reply-To: <1155860626.27466.126.camel@basalt.austin.ibm.com>

Hollis Blanchard writes:

> Still haven't looked to merge Matt's changes (because I'm busy, the
> current code works for me, and they haven't been accepted in u-boot
> yet).

The other version that was posted had support for modifying an
existing flat tree, which I need for the wrapper code for prep.  Are
those "Matt's changes"?  Are you thinking of adding that capability to
your version?

Paul.

^ permalink raw reply

* RE: [PATCH ] powerpc:  pass UPIO_TSI flag to 8259 serial driver
From: Zang Roy-r61911 @ 2006-08-23  6:27 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev list, Paul Mackerras, Yang Xin-Xin-r48390
In-Reply-To: <526188FB-0FE5-40BA-AB21-EB491BB24911@kernel.crashing.org>

>=20
> On Aug 22, 2006, at 9:20 PM, Zang Roy-r61911 wrote:
>=20
> > The patch passes the UPIO_TSI flag to general 8259 serial driver
> >
> > Signed-off-by: Roy Zang	<tie-fei.zang@freescale.com>
>=20
> Maybe, I'm missing something, but why do we need this?  Why=20
> doesn't iotype =3D=3D UPIO_MEM work for the TSI?
>=20
> - kumar
>=20

Tsi108 serial port has some difference from the standard 8250 port.
 I add UPIO_TSI in general 8250 serial driver to handle IIR and IER
register=20
in serial_in and serial_out.

(1) the reason to rewrite serial_in:

    TSI108 rev Z1 version ERRATA.  Reading the UART's Interrupt
    Identification Register (IIR) clears the Transmit Holding Register
    Empty (THRE) and Transmit buffer Empty (TEMP) interrupts even if
they
    are not enabled in the Interrupt Enable Register (IER).  This leads
to
    loss of the interrupts.  Interrupts are not cleared when reading
UART
    registers as 32-bit word.

(2) the reason to rewrite serial_out:

    Check for UART_IER_UUE bit in the autoconfig routine.  This section
    of autoconfig is excluded for Tsi108/109 because bits 7 and 6 are
    reserved for internal use.  They are R/W bits.  In addition to
    incorrect identification, changing these bits (from 00) will make
    Tsi108/109 UART non-functional.

I need to pass UPIO_TSI flag to the 8250 driver when the tsi108 bridge
serial port is used.

^ permalink raw reply

* Re: [PATCH] update pmac32_defconfig
From: Benjamin Herrenschmidt @ 2006-08-23  6:16 UTC (permalink / raw)
  To: Olaf Hering; +Cc: linuxppc-dev, Paul Mackerras
In-Reply-To: <20060823060815.GA9071@aepfle.de>

On Wed, 2006-08-23 at 08:08 +0200, Olaf Hering wrote:
> On Wed, Aug 23, Paul Mackerras wrote:
> 
> > Olaf Hering writes:
> > 
> > > enable windfarm, pppoe, pegasus, Euro nls and magic sysrq.
> > 
> > Why windfarm?  It doesn't do anything useful on 32-bit machines, not
> > yet anyway...
> 
> I was under the impression that some G4 use this driver.

Nope. Only G5s. I had plans to use the windfarm infrastructure to move
over some of the G4 thermal control code as well but never had the time
to do so.

Ben.

^ permalink raw reply

* Re: [PATCH ] powerpc:  pass UPIO_TSI flag to 8259 serial driver
From: Paul Mackerras @ 2006-08-23  6:13 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev list, Yang Xin-Xin-r48390
In-Reply-To: <526188FB-0FE5-40BA-AB21-EB491BB24911@kernel.crashing.org>

Kumar Gala writes:

> Maybe, I'm missing something, but why do we need this?  Why doesn't  
> iotype == UPIO_MEM work for the TSI?

It seems that there are some workarounds for TSI "features" in
drivers/serial/8250.c that this will invoke.

Paul.

^ permalink raw reply

* [PATCH] Fix compile problem without CONFIG_PCI
From: Li Yang @ 2006-08-23  6:13 UTC (permalink / raw)
  To: linuxppc-dev

Compile fails without defining CONFIG_PCI.  
The patch fix this.

Signed-off-by: Li Yang <leoli@freescale.com>
---

arch/powerpc/kernel/prom_parse.c |    5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/kernel/prom_parse.c b/arch/powerpc/kernel/prom_parse.c
index 6a7e997..f460b7d 100644
--- a/arch/powerpc/kernel/prom_parse.c
+++ b/arch/powerpc/kernel/prom_parse.c
@@ -598,10 +598,12 @@ static struct device_node *of_irq_find_p
    return p;
}

+#ifdef CONFIG_PCI
static u8 of_irq_pci_swizzle(u8 slot, u8 pin)
{
    return (((pin - 1) + slot) % 4) + 1;
}
+#endif

/* This doesn't need to be called if you don't have any special workaround
 * flags to pass
@@ -891,6 +893,7 @@ int of_irq_map_one(struct device_node *d
}
EXPORT_SYMBOL_GPL(of_irq_map_one);

+#ifdef CONFIG_PCI
int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq)
{
    struct device_node *dn, *ppnode;
@@ -967,4 +970,4 @@ #endif
    return of_irq_map_raw(ppnode, &lspec, laddr, out_irq);
}
EXPORT_SYMBOL_GPL(of_irq_map_pci);
-
+#endif

^ permalink raw reply related

* Re: [PATCH] update pmac32_defconfig
From: Olaf Hering @ 2006-08-23  6:08 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <17643.60111.162041.406187@cargo.ozlabs.ibm.com>

On Wed, Aug 23, Paul Mackerras wrote:

> Olaf Hering writes:
> 
> > enable windfarm, pppoe, pegasus, Euro nls and magic sysrq.
> 
> Why windfarm?  It doesn't do anything useful on 32-bit machines, not
> yet anyway...

I was under the impression that some G4 use this driver.

^ permalink raw reply

* Re: [PATCH] update pmac32_defconfig
From: Paul Mackerras @ 2006-08-23  5:42 UTC (permalink / raw)
  To: Olaf Hering; +Cc: linuxppc-dev
In-Reply-To: <20060821124323.GA28970@aepfle.de>

Olaf Hering writes:

> enable windfarm, pppoe, pegasus, Euro nls and magic sysrq.

Why windfarm?  It doesn't do anything useful on 32-bit machines, not
yet anyway...

Paul.

^ permalink raw reply

* Re: [PATCH ] powerpc:  pass UPIO_TSI flag to 8259 serial driver
From: Kumar Gala @ 2006-08-23  4:30 UTC (permalink / raw)
  To: Zang Roy-r61911; +Cc: linuxppc-dev list, Paul Mackerras, Yang Xin-Xin-r48390
In-Reply-To: <7EA18FDD2DC2154AA3BD6D2F22A62A0E26E532@zch01exm23.fsl.freescale.net>


On Aug 22, 2006, at 9:20 PM, Zang Roy-r61911 wrote:

> The patch passes the UPIO_TSI flag to general 8259 serial driver
>
> Signed-off-by: Roy Zang	<tie-fei.zang@freescale.com>

Maybe, I'm missing something, but why do we need this?  Why doesn't  
iotype == UPIO_MEM work for the TSI?

- kumar

>
> ---
>  arch/powerpc/kernel/legacy_serial.c |    8 ++++++--
>  1 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/arch/powerpc/kernel/legacy_serial.c
> b/arch/powerpc/kernel/legacy_serial.c
> index 359ab89..07c2c00 100644
> --- a/arch/powerpc/kernel/legacy_serial.c
> +++ b/arch/powerpc/kernel/legacy_serial.c
> @@ -115,6 +115,7 @@ static int __init add_legacy_soc_port(st
>  	u64 addr;
>  	u32 *addrp;
>  	upf_t flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_SHARE_IRQ;
> +	struct device_node *tsi = of_get_parent(np);
>
>  	/* We only support ports that have a clock frequency properly
>  	 * encoded in the device-tree.
> @@ -134,7 +135,10 @@ static int __init add_legacy_soc_port(st
>  	/* Add port, irq will be dealt with later. We passed a
> translated
>  	 * IO port value. It will be fixed up later along with the irq
>  	 */
> -	return add_legacy_port(np, -1, UPIO_MEM, addr, addr, NO_IRQ,
> flags, 0);
> +	if (tsi && !strcmp(tsi->type, "tsi-bridge"))
> +		return add_legacy_port(np, -1, UPIO_TSI, addr, addr,
> NO_IRQ, flags, 0);
> +	else
> +		return add_legacy_port(np, -1, UPIO_MEM, addr, addr,
> NO_IRQ, flags, 0);
>  }
>
>  static int __init add_legacy_isa_port(struct device_node *np,
> @@ -464,7 +468,7 @@ static int __init serial_dev_init(void)
>  			fixup_port_irq(i, np, port);
>  		if (port->iotype == UPIO_PORT)
>  			fixup_port_pio(i, np, port);
> -		if (port->iotype == UPIO_MEM)
> +		if ((port->iotype == UPIO_MEM) || (port->iotype ==
> UPIO_TSI))
>  			fixup_port_mmio(i, np, port);
>  	}
>
> -- 
> 1.4.0
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev

^ permalink raw reply

* Re: [PATCH] powerpc: update mpc7448hpc2 board irq support using device tree
From: Benjamin Herrenschmidt @ 2006-08-23  3:38 UTC (permalink / raw)
  To: Zang Roy-r61911
  Cc: linuxppc-dev list, Paul Mackerras, Alexandre.Bounine,
	Yang Xin-Xin-r48390
In-Reply-To: <7EA18FDD2DC2154AA3BD6D2F22A62A0E26E531@zch01exm23.fsl.freescale.net>

On Wed, 2006-08-23 at 10:19 +0800, Zang Roy-r61911 wrote:
> The patch rewrites mpc7448hpc2 board irq support according to the new
> mpic 
> device tree interface.

Same comment as the other patch, it looks like it got wrapped by your
mailer. Also make sure you don't add trailing whitespaces (if you quilt,
the latest version detects them and has an option to fix them up for
you).

Appart from that, what the patch does looks good.

Cheers,
Ben.

> Signed-off-by: Roy Zang	<tie-fei.zang@freescale.com> 
> 
> ---
>  arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c |   73 ++++--------
>  arch/powerpc/sysdev/tsi108_dev.c                  |   10 +-
>  arch/powerpc/sysdev/tsi108_pci.c                  |   21 ++--
>  include/asm-powerpc/tsi108.h                      |   14 +-
>  include/asm-powerpc/tsi108_irq.h                  |  124
> +++++++++++++++++++++
>  5 files changed, 174 insertions(+), 68 deletions(-)
> 
> diff --git a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
> b/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
> index d7a4fc7..6a0c179 100644
> --- a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
> +++ b/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
> @@ -1,7 +1,7 @@
>  /*
>   * mpc7448_hpc2.c
>   *
> - * Board setup routines for the Freescale Taiga platform
> + * Board setup routines for the Freescale mpc7448hpc2(taiga) platform
>   *
>   * Author: Jacob Pan
>   *	 jacob.pan@freescale.com
> @@ -12,10 +12,10 @@
>   *
>   * Copyright 2004-2006 Freescale Semiconductor, 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.
> + * 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/config.h>
> @@ -62,43 +62,8 @@ #endif
>  extern int tsi108_setup_pci(struct device_node *dev);
>  extern void _nmask_and_or_msr(unsigned long nmask, unsigned long
> or_val);
>  extern void tsi108_pci_int_init(void);
> -extern int tsi108_irq_cascade(struct pt_regs *regs, void *unused);
> -
> -/*
> - * Define all of the IRQ senses and polarities.  Taken from the
> - * mpc7448hpc  manual.
> - * Note:  Likely, this table and the following function should be
> - *        obtained and derived from the OF Device Tree.
> - */
> -
> -static u_char mpc7448_hpc2_pic_initsenses[] __initdata = {
> -	/* External on-board sources */
> -	(IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),	/* INT[0] XINT0
> from FPGA */
> -	(IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),	/* INT[1] XINT1
> from FPGA */
> -	(IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),	/* INT[2]
> PHY_INT from both GIGE */
> -	(IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),	/* INT[3]
> RESERVED */
> -	/* Internal Tsi108/109 interrupt sources */
> -	(IRQ_SENSE_EDGE  | IRQ_POLARITY_POSITIVE),	/* Reserved IRQ
> */
> -	(IRQ_SENSE_EDGE  | IRQ_POLARITY_POSITIVE),	/* Reserved IRQ
> */
> -	(IRQ_SENSE_EDGE  | IRQ_POLARITY_POSITIVE),	/* Reserved IRQ
> */
> -	(IRQ_SENSE_EDGE  | IRQ_POLARITY_POSITIVE),	/* Reserved IRQ
> */
> -	(IRQ_SENSE_EDGE  | IRQ_POLARITY_POSITIVE),	/* DMA0 */
> -	(IRQ_SENSE_EDGE  | IRQ_POLARITY_POSITIVE),	/* DMA1 */
> -	(IRQ_SENSE_EDGE  | IRQ_POLARITY_POSITIVE),	/* DMA2 */
> -	(IRQ_SENSE_EDGE  | IRQ_POLARITY_POSITIVE),	/* DMA3 */
> -	(IRQ_SENSE_EDGE  | IRQ_POLARITY_POSITIVE),	/* UART0 */
> -	(IRQ_SENSE_EDGE  | IRQ_POLARITY_POSITIVE),	/* UART1 */
> -	(IRQ_SENSE_EDGE  | IRQ_POLARITY_POSITIVE),	/* I2C */
> -	(IRQ_SENSE_EDGE  | IRQ_POLARITY_POSITIVE),	/* GPIO */
> -	(IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE),	/* GIGE0 */
> -	(IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE),	/* GIGE1 */
> -	(IRQ_SENSE_EDGE  | IRQ_POLARITY_POSITIVE),	/* Reserved IRQ
> */
> -	(IRQ_SENSE_EDGE  | IRQ_POLARITY_POSITIVE),	/* HLP */
> -	(IRQ_SENSE_EDGE  | IRQ_POLARITY_POSITIVE),	/* SDC */
> -	(IRQ_SENSE_EDGE  | IRQ_POLARITY_POSITIVE),	/* Processor IF
> */
> -	(IRQ_SENSE_EDGE  | IRQ_POLARITY_POSITIVE),	/* Reserved IRQ
> */
> -	(IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE),	/* PCI/X block
> */
> -};
> +extern void tsi108_irq_cascade(unsigned int irq, struct irq_desc *desc,
> +			    struct pt_regs *regs);
>  
>  int mpc7448_hpc2_exclude_device(u_char bus, u_char devfn)
>  {
> @@ -229,6 +194,8 @@ static void __init mpc7448_hpc2_init_IRQ
>  {
>  	struct mpic *mpic;
>  	phys_addr_t mpic_paddr = 0;
> +	unsigned int cascade_pci_irq;
> +	struct device_node *tsi_pci;
>  	struct device_node *tsi_pic;
>  
>  	tsi_pic = of_find_node_by_type(NULL, "open-pic");
> @@ -246,24 +213,31 @@ static void __init mpc7448_hpc2_init_IRQ
>  	DBG("%s: tsi108pic phys_addr = 0x%x\n", __FUNCTION__,
>  	    (u32) mpic_paddr);
>  
> -	mpic = mpic_alloc(mpic_paddr,
> +	mpic = mpic_alloc(tsi_pic, mpic_paddr,
>  			MPIC_PRIMARY | MPIC_BIG_ENDIAN |
> MPIC_WANTS_RESET |
>  			MPIC_SPV_EOI | MPIC_MOD_ID(MPIC_ID_TSI108),
>  			0, /* num_sources used */
> -			TSI108_IRQ_BASE,
>  			0, /* num_sources used */
> -			NR_IRQS - 4 /* XXXX */,
> -			mpc7448_hpc2_pic_initsenses,
> -			sizeof(mpc7448_hpc2_pic_initsenses),
> "Tsi108_PIC");
> +			"Tsi108_PIC");
>  
>  	BUG_ON(mpic == NULL); /* XXXX */
> -
>  	mpic_init(mpic);
> -	mpic_setup_cascade(IRQ_TSI108_PCI, tsi108_irq_cascade, mpic);
> +	
> +	tsi_pci = of_find_node_by_type(NULL, "pci");
> +	if (tsi_pci == 0) {
> +		printk("%s: No tsi108 pci node found !\n",
> __FUNCTION__);
> +		return;
> +	}
> +	
> +	cascade_pci_irq = irq_of_parse_and_map(tsi_pci, 0);
> +	set_irq_data(cascade_pci_irq, mpic);
> +	set_irq_chained_handler(cascade_pci_irq, tsi108_irq_cascade);
> +	
>  	tsi108_pci_int_init();
>  
>  	/* 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)
> @@ -320,6 +294,7 @@ static int mpc7448_machine_check_excepti
>  	return 0;
>  
>  }
> +
>  define_machine(mpc7448_hpc2){
>  	.name 			= "MPC7448 HPC2",
>  	.probe 			= mpc7448_hpc2_probe,
> diff --git a/arch/powerpc/sysdev/tsi108_dev.c
> b/arch/powerpc/sysdev/tsi108_dev.c
> index 26a0cc8..f303846 100644
> --- a/arch/powerpc/sysdev/tsi108_dev.c
> +++ b/arch/powerpc/sysdev/tsi108_dev.c
> @@ -93,13 +93,15 @@ static int __init tsi108_eth_of_init(voi
>  			goto err;
>  
>  		r[1].name = "tx";
> -		r[1].start = np->intrs[0].line;
> -		r[1].end = np->intrs[0].line;
> +		r[1].start = irq_of_parse_and_map(np, 0);
> +		r[1].end = irq_of_parse_and_map(np, 0);
>  		r[1].flags = IORESOURCE_IRQ;
> +		DBG("%s: name:start->end = %s:0x%lx-> 0x%lx\n",
> +			__FUNCTION__,r[1].name, r[1].start, r[1].end);
>  
>  		tsi_eth_dev =
>  		    platform_device_register_simple("tsi-ethernet", i,
> &r[0],
> -						    np->n_intrs + 1);
> +						    1);
>  
>  		if (IS_ERR(tsi_eth_dev)) {
>  			ret = PTR_ERR(tsi_eth_dev);
> @@ -127,7 +129,7 @@ static int __init tsi108_eth_of_init(voi
>  		tsi_eth_data.regs = r[0].start;
>  		tsi_eth_data.phyregs = res.start;
>  		tsi_eth_data.phy = *phy_id;
> -		tsi_eth_data.irq_num = np->intrs[0].line;
> +		tsi_eth_data.irq_num = irq_of_parse_and_map(np, 0);
>  		of_node_put(phy);
>  		ret =
>  		    platform_device_add_data(tsi_eth_dev, &tsi_eth_data,
> diff --git a/arch/powerpc/sysdev/tsi108_pci.c
> b/arch/powerpc/sysdev/tsi108_pci.c
> index 3265d54..906b204 100644
> --- a/arch/powerpc/sysdev/tsi108_pci.c
> +++ b/arch/powerpc/sysdev/tsi108_pci.c
> @@ -26,7 +26,6 @@ #include <linux/slab.h>
>  #include <linux/irq.h>
>  #include <linux/interrupt.h>
>  
> -
>  #include <asm/byteorder.h>
>  #include <asm/io.h>
>  #include <asm/irq.h>
> @@ -228,7 +227,7 @@ int __init tsi108_setup_pci(struct devic
>  
>  	(hose)->ops = &tsi108_direct_pci_ops;
>  
> -	printk(KERN_INFO "Found tsi108 PCI host bridge at 0x%08lx. "
> +	printk(KERN_INFO "Found tsi108 PCI host bridge at 0x%08x. "
>  	       "Firmware bus number: %d->%d\n",
>  	       rsrc.start, hose->first_busno, hose->last_busno);
>  
> @@ -278,7 +277,7 @@ static void init_pci_source(void)
>  	mb();
>  }
>  
> -static inline int get_pci_source(void)
> +static inline unsigned int get_pci_source(void)
>  {
>  	u_int temp = 0;
>  	int irq = -1;
> @@ -371,12 +370,12 @@ static void tsi108_pci_irq_end(u_int irq
>   * Interrupt controller descriptor for cascaded PCI interrupt
> controller.
>   */
>  
> -struct hw_interrupt_type tsi108_pci_irq = {
> +static struct irq_chip tsi108_pci_irq = {
>  	.typename = "tsi108_PCI_int",
> -	.enable = tsi108_pci_irq_enable,
> -	.disable = tsi108_pci_irq_disable,
> +	.mask = tsi108_pci_irq_disable,
>  	.ack = tsi108_pci_irq_ack,
>  	.end = tsi108_pci_irq_end,
> +	.unmask = tsi108_pci_irq_enable,
>  };
>  
>  /*
> @@ -399,14 +398,18 @@ void __init tsi108_pci_int_init(void)
>  	DBG("Tsi108_pci_int_init: initializing PCI interrupts\n");
>  
>  	for (i = 0; i < NUM_PCI_IRQS; i++) {
> -		irq_desc[i + IRQ_PCI_INTAD_BASE].handler =
> &tsi108_pci_irq;
> +		irq_desc[i + IRQ_PCI_INTAD_BASE].chip = &tsi108_pci_irq;
>  		irq_desc[i + IRQ_PCI_INTAD_BASE].status |= IRQ_LEVEL;
>  	}
>  
>  	init_pci_source();
>  }
>  
> -int tsi108_irq_cascade(struct pt_regs *regs, void *unused)
> +void tsi108_irq_cascade(unsigned int irq, struct irq_desc *desc,
> +			    struct pt_regs *regs)
>  {
> -	return get_pci_source();
> +	unsigned int cascade_irq = get_pci_source();
> +	if (cascade_irq != NO_IRQ)
> +		generic_handle_irq(cascade_irq, regs);
> +	desc->chip->eoi(irq); 
>  }
> diff --git a/include/asm-powerpc/tsi108.h b/include/asm-powerpc/tsi108.h
> index c4c278d..e62250b 100644
> --- a/include/asm-powerpc/tsi108.h
> +++ b/include/asm-powerpc/tsi108.h
> @@ -1,16 +1,18 @@
>  /*
> - * include/asm-ppc/tsi108.h
> - *
>   * common routine and memory layout for Tundra TSI108(Grendel) host
> bridge
>   * memory controller.
>   *
>   * Author: Jacob Pan (jacob.pan@freescale.com)
>   *	   Alex Bounine (alexandreb@tundra.com)
> - * 2004 (c) Freescale Semiconductor 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.
> + *	   
> + * Copyright 2004-2006 Freescale Semiconductor, 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.
>   */
> +
>  #ifndef __PPC_KERNEL_TSI108_H
>  #define __PPC_KERNEL_TSI108_H
>  
> diff --git a/include/asm-powerpc/tsi108_irq.h
> b/include/asm-powerpc/tsi108_irq.h
> new file mode 100644
> index 0000000..8ac1389
> --- /dev/null
> +++ b/include/asm-powerpc/tsi108_irq.h
> @@ -0,0 +1,124 @@
> +/*
> + * (C) Copyright 2005 Tundra Semiconductor Corp.
> + * Alex Bounine, <alexandreb at tundra.com).
> + *
> + * See file CREDITS for list of people who contributed to this
> + * project.
> + *
> + * 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.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> + * MA 02111-1307 USA
> + */
> +
> +/*
> + * definitions for interrupt controller initialization and external
> interrupt 
> + * demultiplexing on TSI108EMU/SVB boards.
> + */
> +
> +#ifndef _ASM_PPC_TSI108_IRQ_H
> +#define _ASM_PPC_TSI108_IRQ_H
> +
> +/*
> + * Tsi108 interrupts
> + */
> +#ifndef TSI108_IRQ_REG_BASE
> +#define TSI108_IRQ_REG_BASE		0
> +#endif
> +
> +#define TSI108_IRQ(x)		(TSI108_IRQ_REG_BASE + (x))
> +
> +#define TSI108_MAX_VECTORS	(36 + 4)	/* 36 sources + PCI INT
> demux */
> +#define MAX_TASK_PRIO	0xF
> +
> +#define TSI108_IRQ_SPURIOUS	(TSI108_MAX_VECTORS)
> +
> +#define DEFAULT_PRIO_LVL	10	/* initial priority level */
> +
> +/* Interrupt vectors assignment to external and internal 
> + * sources of requests. */
> +
> +/* EXTERNAL INTERRUPT SOURCES */
> +
> +#define IRQ_TSI108_EXT_INT0	TSI108_IRQ(0)	/* External Source at
> INT[0] */
> +#define IRQ_TSI108_EXT_INT1	TSI108_IRQ(1)	/* External Source at
> INT[1] */
> +#define IRQ_TSI108_EXT_INT2	TSI108_IRQ(2)	/* External Source at
> INT[2] */
> +#define IRQ_TSI108_EXT_INT3	TSI108_IRQ(3)	/* External Source at
> INT[3] */
> +
> +/* INTERNAL INTERRUPT SOURCES */
> +
> +#define IRQ_TSI108_RESERVED0	TSI108_IRQ(4)	/* Reserved IRQ */
> +#define IRQ_TSI108_RESERVED1	TSI108_IRQ(5)	/* Reserved IRQ */
> +#define IRQ_TSI108_RESERVED2	TSI108_IRQ(6)	/* Reserved IRQ */
> +#define IRQ_TSI108_RESERVED3	TSI108_IRQ(7)	/* Reserved IRQ */
> +#define IRQ_TSI108_DMA0		TSI108_IRQ(8)	/* DMA0 */
> +#define IRQ_TSI108_DMA1		TSI108_IRQ(9)	/* DMA1 */
> +#define IRQ_TSI108_DMA2		TSI108_IRQ(10)	/* DMA2 */
> +#define IRQ_TSI108_DMA3		TSI108_IRQ(11)	/* DMA3 */
> +#define IRQ_TSI108_UART0	TSI108_IRQ(12)	/* UART0 */
> +#define IRQ_TSI108_UART1	TSI108_IRQ(13)	/* UART1 */
> +#define IRQ_TSI108_I2C		TSI108_IRQ(14)	/* I2C */
> +#define IRQ_TSI108_GPIO		TSI108_IRQ(15)	/* GPIO */
> +#define IRQ_TSI108_GIGE0	TSI108_IRQ(16)	/* GIGE0 */
> +#define IRQ_TSI108_GIGE1	TSI108_IRQ(17)	/* GIGE1 */
> +#define IRQ_TSI108_RESERVED4	TSI108_IRQ(18)	/* Reserved IRQ */
> +#define IRQ_TSI108_HLP		TSI108_IRQ(19)	/* HLP */
> +#define IRQ_TSI108_SDRAM	TSI108_IRQ(20)	/* SDC */
> +#define IRQ_TSI108_PROC_IF	TSI108_IRQ(21)	/* Processor IF */
> +#define IRQ_TSI108_RESERVED5	TSI108_IRQ(22)	/* Reserved IRQ */
> +#define IRQ_TSI108_PCI		TSI108_IRQ(23)	/* PCI/X block */
> +
> +#define IRQ_TSI108_MBOX0	TSI108_IRQ(24)	/* Mailbox 0 register */
> +#define IRQ_TSI108_MBOX1	TSI108_IRQ(25)	/* Mailbox 1 register */
> +#define IRQ_TSI108_MBOX2	TSI108_IRQ(26)	/* Mailbox 2 register */
> +#define IRQ_TSI108_MBOX3	TSI108_IRQ(27)	/* Mailbox 3 register */
> +
> +#define IRQ_TSI108_DBELL0	TSI108_IRQ(28)	/* Doorbell 0 */
> +#define IRQ_TSI108_DBELL1	TSI108_IRQ(29)	/* Doorbell 1 */
> +#define IRQ_TSI108_DBELL2	TSI108_IRQ(30)	/* Doorbell 2 */
> +#define IRQ_TSI108_DBELL3	TSI108_IRQ(31)	/* Doorbell 3 */
> +
> +#define IRQ_TSI108_TIMER0	TSI108_IRQ(32)	/* Global Timer 0 */
> +#define IRQ_TSI108_TIMER1	TSI108_IRQ(33)	/* Global Timer 1 */
> +#define IRQ_TSI108_TIMER2	TSI108_IRQ(34)	/* Global Timer 2 */
> +#define IRQ_TSI108_TIMER3	TSI108_IRQ(35)	/* Global Timer 3 */
> +
> +/*
> + * PCI bus INTA# - INTD# lines demultiplexor
> + */
> +#define IRQ_PCI_INTAD_BASE	TSI108_IRQ(36)
> +#define IRQ_PCI_INTA		(IRQ_PCI_INTAD_BASE + 0)
> +#define IRQ_PCI_INTB		(IRQ_PCI_INTAD_BASE + 1)
> +#define IRQ_PCI_INTC		(IRQ_PCI_INTAD_BASE + 2)
> +#define IRQ_PCI_INTD		(IRQ_PCI_INTAD_BASE + 3)
> +#define NUM_PCI_IRQS		(4)
> +
> +/* number of entries in vector dispatch table */
> +#define IRQ_TSI108_TAB_SIZE	(TSI108_MAX_VECTORS + 1)
> +
> +/* Mapping of MPIC outputs to processors' interrupt pins */
> +
> +#define IDIR_INT_OUT0		0x1
> +#define IDIR_INT_OUT1		0x2
> +#define IDIR_INT_OUT2		0x4
> +#define IDIR_INT_OUT3		0x8
> +
> +/*---------------------------------------------------------------
> + * IRQ line configuration parameters */
> +
> +/* Interrupt delivery modes */
> +typedef enum {
> +	TSI108_IRQ_DIRECTED,
> +	TSI108_IRQ_DISTRIBUTED,
> +} TSI108_IRQ_MODE;
> +#endif				/*  _ASM_PPC_TSI108_IRQ_H */

^ permalink raw reply

* Re: [PATCH ] powerpc:  pass UPIO_TSI flag to 8259 serial driver
From: Benjamin Herrenschmidt @ 2006-08-23  3:36 UTC (permalink / raw)
  To: Zang Roy-r61911; +Cc: linuxppc-dev list, Paul Mackerras, Yang Xin-Xin-r48390
In-Reply-To: <7EA18FDD2DC2154AA3BD6D2F22A62A0E26E532@zch01exm23.fsl.freescale.net>

On Wed, 2006-08-23 at 10:20 +0800, Zang Roy-r61911 wrote:
> The patch passes the UPIO_TSI flag to general 8259 serial driver

Patch looks damaged to me... appart from that, what it does looks ok to
me.

> Signed-off-by: Roy Zang	<tie-fei.zang@freescale.com> 
> 
> ---
>  arch/powerpc/kernel/legacy_serial.c |    8 ++++++--
>  1 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/legacy_serial.c
> b/arch/powerpc/kernel/legacy_serial.c
> index 359ab89..07c2c00 100644
> --- a/arch/powerpc/kernel/legacy_serial.c
> +++ b/arch/powerpc/kernel/legacy_serial.c
> @@ -115,6 +115,7 @@ static int __init add_legacy_soc_port(st
>  	u64 addr;
>  	u32 *addrp;
>  	upf_t flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_SHARE_IRQ;
> +	struct device_node *tsi = of_get_parent(np);
>  
>  	/* We only support ports that have a clock frequency properly
>  	 * encoded in the device-tree.
> @@ -134,7 +135,10 @@ static int __init add_legacy_soc_port(st
>  	/* Add port, irq will be dealt with later. We passed a
> translated
>  	 * IO port value. It will be fixed up later along with the irq
>  	 */
> -	return add_legacy_port(np, -1, UPIO_MEM, addr, addr, NO_IRQ,
> flags, 0);
> +	if (tsi && !strcmp(tsi->type, "tsi-bridge"))
> +		return add_legacy_port(np, -1, UPIO_TSI, addr, addr,
> NO_IRQ, flags, 0);
> +	else 
> +		return add_legacy_port(np, -1, UPIO_MEM, addr, addr,
> NO_IRQ, flags, 0);
>  }
>  
>  static int __init add_legacy_isa_port(struct device_node *np,
> @@ -464,7 +468,7 @@ static int __init serial_dev_init(void)
>  			fixup_port_irq(i, np, port);
>  		if (port->iotype == UPIO_PORT)
>  			fixup_port_pio(i, np, port);
> -		if (port->iotype == UPIO_MEM)
> +		if ((port->iotype == UPIO_MEM) || (port->iotype ==
> UPIO_TSI))
>  			fixup_port_mmio(i, np, port);
>  	}
>  

^ permalink raw reply

* [PATCH ] powerpc:  pass UPIO_TSI flag to 8259 serial driver
From: Zang Roy-r61911 @ 2006-08-23  2:20 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev list, Yang Xin-Xin-r48390

The patch passes the UPIO_TSI flag to general 8259 serial driver

Signed-off-by: Roy Zang	<tie-fei.zang@freescale.com>=20

---
 arch/powerpc/kernel/legacy_serial.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kernel/legacy_serial.c
b/arch/powerpc/kernel/legacy_serial.c
index 359ab89..07c2c00 100644
--- a/arch/powerpc/kernel/legacy_serial.c
+++ b/arch/powerpc/kernel/legacy_serial.c
@@ -115,6 +115,7 @@ static int __init add_legacy_soc_port(st
 	u64 addr;
 	u32 *addrp;
 	upf_t flags =3D UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_SHARE_IRQ;
+	struct device_node *tsi =3D of_get_parent(np);
=20
 	/* We only support ports that have a clock frequency properly
 	 * encoded in the device-tree.
@@ -134,7 +135,10 @@ static int __init add_legacy_soc_port(st
 	/* Add port, irq will be dealt with later. We passed a
translated
 	 * IO port value. It will be fixed up later along with the irq
 	 */
-	return add_legacy_port(np, -1, UPIO_MEM, addr, addr, NO_IRQ,
flags, 0);
+	if (tsi && !strcmp(tsi->type, "tsi-bridge"))
+		return add_legacy_port(np, -1, UPIO_TSI, addr, addr,
NO_IRQ, flags, 0);
+	else=20
+		return add_legacy_port(np, -1, UPIO_MEM, addr, addr,
NO_IRQ, flags, 0);
 }
=20
 static int __init add_legacy_isa_port(struct device_node *np,
@@ -464,7 +468,7 @@ static int __init serial_dev_init(void)
 			fixup_port_irq(i, np, port);
 		if (port->iotype =3D=3D UPIO_PORT)
 			fixup_port_pio(i, np, port);
-		if (port->iotype =3D=3D UPIO_MEM)
+		if ((port->iotype =3D=3D UPIO_MEM) || (port->iotype =3D=3D
UPIO_TSI))
 			fixup_port_mmio(i, np, port);
 	}
=20
--=20
1.4.0

^ permalink raw reply related

* [PATCH] powerpc: update mpc7448hpc2 board irq support using device tree
From: Zang Roy-r61911 @ 2006-08-23  2:19 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev list, Yang Xin-Xin-r48390, Alexandre.Bounine

The patch rewrites mpc7448hpc2 board irq support according to the new
mpic=20
device tree interface.

Signed-off-by: Roy Zang	<tie-fei.zang@freescale.com>=20

---
 arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c |   73 ++++--------
 arch/powerpc/sysdev/tsi108_dev.c                  |   10 +-
 arch/powerpc/sysdev/tsi108_pci.c                  |   21 ++--
 include/asm-powerpc/tsi108.h                      |   14 +-
 include/asm-powerpc/tsi108_irq.h                  |  124
+++++++++++++++++++++
 5 files changed, 174 insertions(+), 68 deletions(-)

diff --git a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
b/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
index d7a4fc7..6a0c179 100644
--- a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
+++ b/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
@@ -1,7 +1,7 @@
 /*
  * mpc7448_hpc2.c
  *
- * Board setup routines for the Freescale Taiga platform
+ * Board setup routines for the Freescale mpc7448hpc2(taiga) platform
  *
  * Author: Jacob Pan
  *	 jacob.pan@freescale.com
@@ -12,10 +12,10 @@
  *
  * Copyright 2004-2006 Freescale Semiconductor, 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.
+ * 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.
  */
=20
 #include <linux/config.h>
@@ -62,43 +62,8 @@ #endif
 extern int tsi108_setup_pci(struct device_node *dev);
 extern void _nmask_and_or_msr(unsigned long nmask, unsigned long
or_val);
 extern void tsi108_pci_int_init(void);
-extern int tsi108_irq_cascade(struct pt_regs *regs, void *unused);
-
-/*
- * Define all of the IRQ senses and polarities.  Taken from the
- * mpc7448hpc  manual.
- * Note:  Likely, this table and the following function should be
- *        obtained and derived from the OF Device Tree.
- */
-
-static u_char mpc7448_hpc2_pic_initsenses[] __initdata =3D {
-	/* External on-board sources */
-	(IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),	/* INT[0] XINT0
from FPGA */
-	(IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),	/* INT[1] XINT1
from FPGA */
-	(IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),	/* INT[2]
PHY_INT from both GIGE */
-	(IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),	/* INT[3]
RESERVED */
-	/* Internal Tsi108/109 interrupt sources */
-	(IRQ_SENSE_EDGE  | IRQ_POLARITY_POSITIVE),	/* Reserved IRQ
*/
-	(IRQ_SENSE_EDGE  | IRQ_POLARITY_POSITIVE),	/* Reserved IRQ
*/
-	(IRQ_SENSE_EDGE  | IRQ_POLARITY_POSITIVE),	/* Reserved IRQ
*/
-	(IRQ_SENSE_EDGE  | IRQ_POLARITY_POSITIVE),	/* Reserved IRQ
*/
-	(IRQ_SENSE_EDGE  | IRQ_POLARITY_POSITIVE),	/* DMA0 */
-	(IRQ_SENSE_EDGE  | IRQ_POLARITY_POSITIVE),	/* DMA1 */
-	(IRQ_SENSE_EDGE  | IRQ_POLARITY_POSITIVE),	/* DMA2 */
-	(IRQ_SENSE_EDGE  | IRQ_POLARITY_POSITIVE),	/* DMA3 */
-	(IRQ_SENSE_EDGE  | IRQ_POLARITY_POSITIVE),	/* UART0 */
-	(IRQ_SENSE_EDGE  | IRQ_POLARITY_POSITIVE),	/* UART1 */
-	(IRQ_SENSE_EDGE  | IRQ_POLARITY_POSITIVE),	/* I2C */
-	(IRQ_SENSE_EDGE  | IRQ_POLARITY_POSITIVE),	/* GPIO */
-	(IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE),	/* GIGE0 */
-	(IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE),	/* GIGE1 */
-	(IRQ_SENSE_EDGE  | IRQ_POLARITY_POSITIVE),	/* Reserved IRQ
*/
-	(IRQ_SENSE_EDGE  | IRQ_POLARITY_POSITIVE),	/* HLP */
-	(IRQ_SENSE_EDGE  | IRQ_POLARITY_POSITIVE),	/* SDC */
-	(IRQ_SENSE_EDGE  | IRQ_POLARITY_POSITIVE),	/* Processor IF
*/
-	(IRQ_SENSE_EDGE  | IRQ_POLARITY_POSITIVE),	/* Reserved IRQ
*/
-	(IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE),	/* PCI/X block
*/
-};
+extern void tsi108_irq_cascade(unsigned int irq, struct irq_desc *desc,
+			    struct pt_regs *regs);
=20
 int mpc7448_hpc2_exclude_device(u_char bus, u_char devfn)
 {
@@ -229,6 +194,8 @@ static void __init mpc7448_hpc2_init_IRQ
 {
 	struct mpic *mpic;
 	phys_addr_t mpic_paddr =3D 0;
+	unsigned int cascade_pci_irq;
+	struct device_node *tsi_pci;
 	struct device_node *tsi_pic;
=20
 	tsi_pic =3D of_find_node_by_type(NULL, "open-pic");
@@ -246,24 +213,31 @@ static void __init mpc7448_hpc2_init_IRQ
 	DBG("%s: tsi108pic phys_addr =3D 0x%x\n", __FUNCTION__,
 	    (u32) mpic_paddr);
=20
-	mpic =3D mpic_alloc(mpic_paddr,
+	mpic =3D mpic_alloc(tsi_pic, mpic_paddr,
 			MPIC_PRIMARY | MPIC_BIG_ENDIAN |
MPIC_WANTS_RESET |
 			MPIC_SPV_EOI | MPIC_MOD_ID(MPIC_ID_TSI108),
 			0, /* num_sources used */
-			TSI108_IRQ_BASE,
 			0, /* num_sources used */
-			NR_IRQS - 4 /* XXXX */,
-			mpc7448_hpc2_pic_initsenses,
-			sizeof(mpc7448_hpc2_pic_initsenses),
"Tsi108_PIC");
+			"Tsi108_PIC");
=20
 	BUG_ON(mpic =3D=3D NULL); /* XXXX */
-
 	mpic_init(mpic);
-	mpic_setup_cascade(IRQ_TSI108_PCI, tsi108_irq_cascade, mpic);
+=09
+	tsi_pci =3D of_find_node_by_type(NULL, "pci");
+	if (tsi_pci =3D=3D 0) {
+		printk("%s: No tsi108 pci node found !\n",
__FUNCTION__);
+		return;
+	}
+=09
+	cascade_pci_irq =3D irq_of_parse_and_map(tsi_pci, 0);
+	set_irq_data(cascade_pci_irq, mpic);
+	set_irq_chained_handler(cascade_pci_irq, tsi108_irq_cascade);
+=09
 	tsi108_pci_int_init();
=20
 	/* Configure MPIC outputs to CPU0 */
 	tsi108_write_reg(TSI108_MPIC_OFFSET + 0x30c, 0);
+	of_node_put(tsi_pic);
 }
=20
 void mpc7448_hpc2_show_cpuinfo(struct seq_file *m)
@@ -320,6 +294,7 @@ static int mpc7448_machine_check_excepti
 	return 0;
=20
 }
+
 define_machine(mpc7448_hpc2){
 	.name 			=3D "MPC7448 HPC2",
 	.probe 			=3D mpc7448_hpc2_probe,
diff --git a/arch/powerpc/sysdev/tsi108_dev.c
b/arch/powerpc/sysdev/tsi108_dev.c
index 26a0cc8..f303846 100644
--- a/arch/powerpc/sysdev/tsi108_dev.c
+++ b/arch/powerpc/sysdev/tsi108_dev.c
@@ -93,13 +93,15 @@ static int __init tsi108_eth_of_init(voi
 			goto err;
=20
 		r[1].name =3D "tx";
-		r[1].start =3D np->intrs[0].line;
-		r[1].end =3D np->intrs[0].line;
+		r[1].start =3D irq_of_parse_and_map(np, 0);
+		r[1].end =3D irq_of_parse_and_map(np, 0);
 		r[1].flags =3D IORESOURCE_IRQ;
+		DBG("%s: name:start->end =3D %s:0x%lx-> 0x%lx\n",
+			__FUNCTION__,r[1].name, r[1].start, r[1].end);
=20
 		tsi_eth_dev =3D
 		    platform_device_register_simple("tsi-ethernet", i,
&r[0],
-						    np->n_intrs + 1);
+						    1);
=20
 		if (IS_ERR(tsi_eth_dev)) {
 			ret =3D PTR_ERR(tsi_eth_dev);
@@ -127,7 +129,7 @@ static int __init tsi108_eth_of_init(voi
 		tsi_eth_data.regs =3D r[0].start;
 		tsi_eth_data.phyregs =3D res.start;
 		tsi_eth_data.phy =3D *phy_id;
-		tsi_eth_data.irq_num =3D np->intrs[0].line;
+		tsi_eth_data.irq_num =3D irq_of_parse_and_map(np, 0);
 		of_node_put(phy);
 		ret =3D
 		    platform_device_add_data(tsi_eth_dev, &tsi_eth_data,
diff --git a/arch/powerpc/sysdev/tsi108_pci.c
b/arch/powerpc/sysdev/tsi108_pci.c
index 3265d54..906b204 100644
--- a/arch/powerpc/sysdev/tsi108_pci.c
+++ b/arch/powerpc/sysdev/tsi108_pci.c
@@ -26,7 +26,6 @@ #include <linux/slab.h>
 #include <linux/irq.h>
 #include <linux/interrupt.h>
=20
-
 #include <asm/byteorder.h>
 #include <asm/io.h>
 #include <asm/irq.h>
@@ -228,7 +227,7 @@ int __init tsi108_setup_pci(struct devic
=20
 	(hose)->ops =3D &tsi108_direct_pci_ops;
=20
-	printk(KERN_INFO "Found tsi108 PCI host bridge at 0x%08lx. "
+	printk(KERN_INFO "Found tsi108 PCI host bridge at 0x%08x. "
 	       "Firmware bus number: %d->%d\n",
 	       rsrc.start, hose->first_busno, hose->last_busno);
=20
@@ -278,7 +277,7 @@ static void init_pci_source(void)
 	mb();
 }
=20
-static inline int get_pci_source(void)
+static inline unsigned int get_pci_source(void)
 {
 	u_int temp =3D 0;
 	int irq =3D -1;
@@ -371,12 +370,12 @@ static void tsi108_pci_irq_end(u_int irq
  * Interrupt controller descriptor for cascaded PCI interrupt
controller.
  */
=20
-struct hw_interrupt_type tsi108_pci_irq =3D {
+static struct irq_chip tsi108_pci_irq =3D {
 	.typename =3D "tsi108_PCI_int",
-	.enable =3D tsi108_pci_irq_enable,
-	.disable =3D tsi108_pci_irq_disable,
+	.mask =3D tsi108_pci_irq_disable,
 	.ack =3D tsi108_pci_irq_ack,
 	.end =3D tsi108_pci_irq_end,
+	.unmask =3D tsi108_pci_irq_enable,
 };
=20
 /*
@@ -399,14 +398,18 @@ void __init tsi108_pci_int_init(void)
 	DBG("Tsi108_pci_int_init: initializing PCI interrupts\n");
=20
 	for (i =3D 0; i < NUM_PCI_IRQS; i++) {
-		irq_desc[i + IRQ_PCI_INTAD_BASE].handler =3D
&tsi108_pci_irq;
+		irq_desc[i + IRQ_PCI_INTAD_BASE].chip =3D &tsi108_pci_irq;
 		irq_desc[i + IRQ_PCI_INTAD_BASE].status |=3D IRQ_LEVEL;
 	}
=20
 	init_pci_source();
 }
=20
-int tsi108_irq_cascade(struct pt_regs *regs, void *unused)
+void tsi108_irq_cascade(unsigned int irq, struct irq_desc *desc,
+			    struct pt_regs *regs)
 {
-	return get_pci_source();
+	unsigned int cascade_irq =3D get_pci_source();
+	if (cascade_irq !=3D NO_IRQ)
+		generic_handle_irq(cascade_irq, regs);
+	desc->chip->eoi(irq);=20
 }
diff --git a/include/asm-powerpc/tsi108.h b/include/asm-powerpc/tsi108.h
index c4c278d..e62250b 100644
--- a/include/asm-powerpc/tsi108.h
+++ b/include/asm-powerpc/tsi108.h
@@ -1,16 +1,18 @@
 /*
- * include/asm-ppc/tsi108.h
- *
  * common routine and memory layout for Tundra TSI108(Grendel) host
bridge
  * memory controller.
  *
  * Author: Jacob Pan (jacob.pan@freescale.com)
  *	   Alex Bounine (alexandreb@tundra.com)
- * 2004 (c) Freescale Semiconductor 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.
+ *	  =20
+ * Copyright 2004-2006 Freescale Semiconductor, 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.
  */
+
 #ifndef __PPC_KERNEL_TSI108_H
 #define __PPC_KERNEL_TSI108_H
=20
diff --git a/include/asm-powerpc/tsi108_irq.h
b/include/asm-powerpc/tsi108_irq.h
new file mode 100644
index 0000000..8ac1389
--- /dev/null
+++ b/include/asm-powerpc/tsi108_irq.h
@@ -0,0 +1,124 @@
+/*
+ * (C) Copyright 2005 Tundra Semiconductor Corp.
+ * Alex Bounine, <alexandreb at tundra.com).
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+/*
+ * definitions for interrupt controller initialization and external
interrupt=20
+ * demultiplexing on TSI108EMU/SVB boards.
+ */
+
+#ifndef _ASM_PPC_TSI108_IRQ_H
+#define _ASM_PPC_TSI108_IRQ_H
+
+/*
+ * Tsi108 interrupts
+ */
+#ifndef TSI108_IRQ_REG_BASE
+#define TSI108_IRQ_REG_BASE		0
+#endif
+
+#define TSI108_IRQ(x)		(TSI108_IRQ_REG_BASE + (x))
+
+#define TSI108_MAX_VECTORS	(36 + 4)	/* 36 sources + PCI INT
demux */
+#define MAX_TASK_PRIO	0xF
+
+#define TSI108_IRQ_SPURIOUS	(TSI108_MAX_VECTORS)
+
+#define DEFAULT_PRIO_LVL	10	/* initial priority level */
+
+/* Interrupt vectors assignment to external and internal=20
+ * sources of requests. */
+
+/* EXTERNAL INTERRUPT SOURCES */
+
+#define IRQ_TSI108_EXT_INT0	TSI108_IRQ(0)	/* External Source at
INT[0] */
+#define IRQ_TSI108_EXT_INT1	TSI108_IRQ(1)	/* External Source at
INT[1] */
+#define IRQ_TSI108_EXT_INT2	TSI108_IRQ(2)	/* External Source at
INT[2] */
+#define IRQ_TSI108_EXT_INT3	TSI108_IRQ(3)	/* External Source at
INT[3] */
+
+/* INTERNAL INTERRUPT SOURCES */
+
+#define IRQ_TSI108_RESERVED0	TSI108_IRQ(4)	/* Reserved IRQ */
+#define IRQ_TSI108_RESERVED1	TSI108_IRQ(5)	/* Reserved IRQ */
+#define IRQ_TSI108_RESERVED2	TSI108_IRQ(6)	/* Reserved IRQ */
+#define IRQ_TSI108_RESERVED3	TSI108_IRQ(7)	/* Reserved IRQ */
+#define IRQ_TSI108_DMA0		TSI108_IRQ(8)	/* DMA0 */
+#define IRQ_TSI108_DMA1		TSI108_IRQ(9)	/* DMA1 */
+#define IRQ_TSI108_DMA2		TSI108_IRQ(10)	/* DMA2 */
+#define IRQ_TSI108_DMA3		TSI108_IRQ(11)	/* DMA3 */
+#define IRQ_TSI108_UART0	TSI108_IRQ(12)	/* UART0 */
+#define IRQ_TSI108_UART1	TSI108_IRQ(13)	/* UART1 */
+#define IRQ_TSI108_I2C		TSI108_IRQ(14)	/* I2C */
+#define IRQ_TSI108_GPIO		TSI108_IRQ(15)	/* GPIO */
+#define IRQ_TSI108_GIGE0	TSI108_IRQ(16)	/* GIGE0 */
+#define IRQ_TSI108_GIGE1	TSI108_IRQ(17)	/* GIGE1 */
+#define IRQ_TSI108_RESERVED4	TSI108_IRQ(18)	/* Reserved IRQ */
+#define IRQ_TSI108_HLP		TSI108_IRQ(19)	/* HLP */
+#define IRQ_TSI108_SDRAM	TSI108_IRQ(20)	/* SDC */
+#define IRQ_TSI108_PROC_IF	TSI108_IRQ(21)	/* Processor IF */
+#define IRQ_TSI108_RESERVED5	TSI108_IRQ(22)	/* Reserved IRQ */
+#define IRQ_TSI108_PCI		TSI108_IRQ(23)	/* PCI/X block */
+
+#define IRQ_TSI108_MBOX0	TSI108_IRQ(24)	/* Mailbox 0 register */
+#define IRQ_TSI108_MBOX1	TSI108_IRQ(25)	/* Mailbox 1 register */
+#define IRQ_TSI108_MBOX2	TSI108_IRQ(26)	/* Mailbox 2 register */
+#define IRQ_TSI108_MBOX3	TSI108_IRQ(27)	/* Mailbox 3 register */
+
+#define IRQ_TSI108_DBELL0	TSI108_IRQ(28)	/* Doorbell 0 */
+#define IRQ_TSI108_DBELL1	TSI108_IRQ(29)	/* Doorbell 1 */
+#define IRQ_TSI108_DBELL2	TSI108_IRQ(30)	/* Doorbell 2 */
+#define IRQ_TSI108_DBELL3	TSI108_IRQ(31)	/* Doorbell 3 */
+
+#define IRQ_TSI108_TIMER0	TSI108_IRQ(32)	/* Global Timer 0 */
+#define IRQ_TSI108_TIMER1	TSI108_IRQ(33)	/* Global Timer 1 */
+#define IRQ_TSI108_TIMER2	TSI108_IRQ(34)	/* Global Timer 2 */
+#define IRQ_TSI108_TIMER3	TSI108_IRQ(35)	/* Global Timer 3 */
+
+/*
+ * PCI bus INTA# - INTD# lines demultiplexor
+ */
+#define IRQ_PCI_INTAD_BASE	TSI108_IRQ(36)
+#define IRQ_PCI_INTA		(IRQ_PCI_INTAD_BASE + 0)
+#define IRQ_PCI_INTB		(IRQ_PCI_INTAD_BASE + 1)
+#define IRQ_PCI_INTC		(IRQ_PCI_INTAD_BASE + 2)
+#define IRQ_PCI_INTD		(IRQ_PCI_INTAD_BASE + 3)
+#define NUM_PCI_IRQS		(4)
+
+/* number of entries in vector dispatch table */
+#define IRQ_TSI108_TAB_SIZE	(TSI108_MAX_VECTORS + 1)
+
+/* Mapping of MPIC outputs to processors' interrupt pins */
+
+#define IDIR_INT_OUT0		0x1
+#define IDIR_INT_OUT1		0x2
+#define IDIR_INT_OUT2		0x4
+#define IDIR_INT_OUT3		0x8
+
+/*---------------------------------------------------------------
+ * IRQ line configuration parameters */
+
+/* Interrupt delivery modes */
+typedef enum {
+	TSI108_IRQ_DIRECTED,
+	TSI108_IRQ_DISTRIBUTED,
+} TSI108_IRQ_MODE;
+#endif				/*  _ASM_PPC_TSI108_IRQ_H */
--=20
1.4.0

^ permalink raw reply related

* Re: Deactivate serial console?
From: Michael Richardson @ 2006-08-23  1:26 UTC (permalink / raw)
  To: Lee Revell; +Cc: Howard, Marc, ppc
In-Reply-To: <1156269300.10565.180.camel@mindpipe>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


>>>>> "Lee" == Lee Revell <rlrevell@joe-job.com> writes:
    Lee> On Tue, 2006-08-22 at 10:46 -0700, Howard, Marc wrote:
    >> stty -F /dev/console 0

    Lee> Thanks - so if I read the man page correctly the 0 is interpreted as 0
    Lee> baud, and I would re-enable it by "stty -F /dev/console 115200"?

  Yes, and historically baud 0 meant 'hang up modem'.
  It causes DTR to drop. 

- -- 
]       ON HUMILITY: to err is human. To moo, bovine.           |  firewalls  [
]   Michael Richardson,    Xelerance Corporation, Ottawa, ON    |net architect[
] mcr@xelerance.com      http://www.sandelman.ottawa.on.ca/mcr/ |device driver[
] panic("Just another Debian GNU/Linux using, kernel hacking, security guy"); [

    "The Microsoft _Get the Facts CD_ does not work on Linux." - orospakr

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Finger me for keys

iQEVAwUBROuuqYCLcPvd0N1lAQIN4Qf/TtpVAE3baaZJt7UYp6Pogi1lyAjDpWZt
cf2rteFYzRBDmhQli8BSwobrGphPRpiCahUc6G/P2+gs6LS9djjgJ4vwv0+m/eLP
FFSG+67rh3lkZKay5sjHX7M03UKhFOuNv7N+Iiu/cJtDyz6FgBJSRPdztY4xN4h1
rGXRMvGMqHQlNEBkdN0bKv9TmhEpHgYMJdGlIn+BNh54f5Uet6/As1vzHosQJFR5
54jLDVG5PMYHXtpfOWDTW07QMSnljfZPtWi7Ixo/r04omjScyQGCpcbs4WzTXzf5
Ndc00cxX2AAoBMe1xyNMcq8aTlovuoEm1Zs15WJR7H8IBCrYm43zWw==
=pTam
-----END PGP SIGNATURE-----

^ permalink raw reply

* [Correction #2] Re: Broken Firewire 400/SCSI on ppc Powerbook5,8
From: Wolfgang Pfeiffer @ 2006-08-23  1:50 UTC (permalink / raw)
  To: Stefan Richter; +Cc: linuxppc-dev, billfink, linux1394-devel
In-Reply-To: <20060823003638.GB2709@localhost>

On Wed, Aug 23, 2006 at 02:36:38AM +0200, Wolfgang Pfeiffer wrote:
> On Wed, Aug 23, 2006 at 02:28:01AM +0200, Wolfgang Pfeiffer wrote:
> 
> > [ ... ]
> 
> > Some tests on the Alubook:
> > 
> > I compiled a fresh git kernel now with verbose ieee logging turned on.

> > 
> >   [ ..... ]
> > 
> > Only after running the latter script, I switch on the FW disk. The log
> > for these moments covering about 60 seconds is here:
> > 
> > wolfgangpfeiffer.com/kern.log.when.fw.disk.is.switched.on.txt
> > 
> > Then, some time later on with no /dev/sda available, I run gscanbus,
> > forcing a bus reset. The log, again covering about 60 seconds is here:
> > 
> > wolfgangpfeiffer.com/kern.log.with.gscanbus.after.failed.fw.connection.txt
> 
> 
> Sorry, forgot that: After running gscanbus above, and a few minutes after
> sending the quoted message: still no /dev/sda


More precise, IIRC, it should have said: 

"Minutes after running gscanbus, that is a few minutes after sending
the quoted message: still no /dev/sda"

Sorry for the overhead
Wolfgang


-- 
Wolfgang Pfeiffer: /ICQ: 286585973/ + + +  /AIM: crashinglinux/
http://profiles.yahoo.com/wolfgangpfeiffer

Key ID: E3037113
http://keyserver.mine.nu/pks/lookup?search=0xE3037113&fingerprint=on

^ permalink raw reply

* [PATCH] powepc: Fix BootX booting with an initrd
From: Benjamin Herrenschmidt @ 2006-08-23  1:45 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev list

The bootx_init.c trampoline didn't properly add the ramdisk to the
"reserve map" (list of reserved areas of memory), thus causing all sorts
of failures when using BootX with an initrd. Also fixes a possible
problem if the ramdisk is located before the device-tree passed by
BootX.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Index: linux-work/arch/powerpc/platforms/powermac/bootx_init.c
===================================================================
--- linux-work.orig/arch/powerpc/platforms/powermac/bootx_init.c	2006-08-17 16:16:03.000000000 +1000
+++ linux-work/arch/powerpc/platforms/powermac/bootx_init.c	2006-08-18 14:01:36.000000000 +1000
@@ -411,8 +411,15 @@
 	DBG("End of boot params: %x\n", mem_end);
 	rsvmap[0] = mem_start;
 	rsvmap[1] = mem_end;
-	rsvmap[2] = 0;
-	rsvmap[3] = 0;
+	if (bootx_info->ramDisk) {
+		rsvmap[2] = ((unsigned long)bootx_info) + bootx_info->ramDisk;
+		rsvmap[3] = rsvmap[2] + bootx_info->ramDiskSize;
+		rsvmap[4] = 0;
+		rsvmap[5] = 0;
+	} else {
+		rsvmap[2] = 0;
+		rsvmap[3] = 0;
+	}
 
 	return (unsigned long)hdr;
 }
@@ -543,12 +550,12 @@
 	 */
 	if (bi->version < 5) {
 		space = bi->deviceTreeOffset + bi->deviceTreeSize;
-		if (bi->ramDisk)
+		if (bi->ramDisk >= space)
 			space = bi->ramDisk + bi->ramDiskSize;
 	} else
 		space = bi->totalParamsSize;
 
-	bootx_printf("Total space used by parameters & ramdisk: %x \n", space);
+	bootx_printf("Total space used by parameters & ramdisk: 0x%x \n", space);
 
 	/* New BootX will have flushed all TLBs and enters kernel with
 	 * MMU switched OFF, so this should not be useful anymore.

^ permalink raw reply

* [PATCH] fix gettimeofday inaccuracies
From: Nathan Lynch @ 2006-08-23  1:36 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Paul Mackerras

There are two problems in the powerpc gettimeofday code which can
cause incorrect results to be returned.

The first is that there is a race between do_gettimeofday and the
timer interrupt:

1. do_gettimeofday does get_tb()

2. decrementer exception on boot cpu which runs timer_recalc_offset,
   which also samples the timebase and updates the do_gtod structure
   with a greater timebase value.

3. do_gettimeofday calls __do_gettimeofday, which leads to the
   negative result from tb_val - temp_varp->tb_orig_stamp.

The second is caused by taking the boot cpu offline, which can cause
the value of tb_last_jiffy to be increased past the currently
available timebase, causing the same underflow as above.


Signed-off-by: Nathan Lynch <ntl@pobox.com>

--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -417,7 +417,7 @@ static __inline__ void timer_check_rtc(v
 /*
  * This version of gettimeofday has microsecond resolution.
  */
-static inline void __do_gettimeofday(struct timeval *tv, u64 tb_val)
+static inline void __do_gettimeofday(struct timeval *tv)
 {
 	unsigned long sec, usec;
 	u64 tb_ticks, xsec;
@@ -431,7 +431,12 @@ static inline void __do_gettimeofday(str
 	 * without a divide (and in fact, without a multiply)
 	 */
 	temp_varp = do_gtod.varp;
-	tb_ticks = tb_val - temp_varp->tb_orig_stamp;
+
+	/* Sampling the time base must be done after loading
+	 * do_gtod.varp in order to avoid racing with update_gtod.
+	 */
+	mb();
+	tb_ticks = get_tb() - temp_varp->tb_orig_stamp;
 	temp_tb_to_xs = temp_varp->tb_to_xs;
 	temp_stamp_xsec = temp_varp->stamp_xsec;
 	xsec = temp_stamp_xsec + mulhdu(tb_ticks, temp_tb_to_xs);
@@ -464,7 +469,7 @@ void do_gettimeofday(struct timeval *tv)
 		tv->tv_usec = usec;
 		return;
 	}
-	__do_gettimeofday(tv, get_tb());
+	__do_gettimeofday(tv);
 }
 
 EXPORT_SYMBOL(do_gettimeofday);
@@ -650,6 +655,7 @@ void timer_interrupt(struct pt_regs * re
 	int next_dec;
 	int cpu = smp_processor_id();
 	unsigned long ticks;
+	u64 tb_next_jiffy;
 
 #ifdef CONFIG_PPC32
 	if (atomic_read(&ppc_n_lost_interrupts) != 0)
@@ -691,11 +697,14 @@ void timer_interrupt(struct pt_regs * re
 			continue;
 
 		write_seqlock(&xtime_lock);
-		tb_last_jiffy += tb_ticks_per_jiffy;
-		tb_last_stamp = per_cpu(last_jiffy, cpu);
-		do_timer(regs);
-		timer_recalc_offset(tb_last_jiffy);
-		timer_check_rtc();
+		tb_next_jiffy = tb_last_jiffy + tb_ticks_per_jiffy;
+		if (per_cpu(last_jiffy, cpu) >= tb_next_jiffy) {
+			tb_last_jiffy = tb_next_jiffy;
+			tb_last_stamp = per_cpu(last_jiffy, cpu);
+			do_timer(regs);
+			timer_recalc_offset(tb_last_jiffy);
+			timer_check_rtc();
+		}
 		write_sequnlock(&xtime_lock);
 	}
 	

^ permalink raw reply

* Re: [RFC] HOWTO use NAPI to reduce TX interrupts
From: Shirley Ma @ 2006-08-23  1:29 UTC (permalink / raw)
  To: David Miller
  Cc: akpm, arnd, Jens.Osterkamp, James K Lewis, linux-kernel,
	linuxppc-dev, netdev, linuxppc-dev-bounces+xma=us.ibm.com,
	jgarzik, rdreier, shemminger
In-Reply-To: <20060821.173225.68047257.davem@davemloft.net>

[-- Attachment #1: Type: text/plain, Size: 958 bytes --]





> > This is a digression from spidernet, but what if a device is able to
> > generate separate MSIs for TX and RX?  Some people from IBM have
> > suggested that it is beneficial for throughput to handle TX work and
> > RX work for IP-over-InfiniBand in parallel on separate CPUs, and
> > handling everything through the ->poll() method would defeat this.
>
> The TX work is so incredibly cheap, relatively speaking, compared
> to the full input packet processing path that the RX side runs
> that I see no real benefit.
>
> In fact, you might even get better locality due to the way the
> locking can be performed if TX reclaim runs inside of ->poll()

We are still comparing these two approaches IPoIB performance under
different configurations. Hopefully the performance work can be done soon.
So we can have some data to share.

Thanks
Shirley Ma
IBM Linux Technology Center
15300 SW Koll Parkway
Beaverton, OR 97006-6063
Phone(Fax): (503) 578-7638



[-- Attachment #2: Type: text/html, Size: 1163 bytes --]

^ permalink raw reply

* test - please ignore (again)
From: Benjamin Herrenschmidt @ 2006-08-23  1:28 UTC (permalink / raw)
  To: linuxppc-dev list

Sorry about that ...

Mail with accents: èéêëä

Now, let's see if the CRLF's, one is here ->
have been corrupted.

Ben.

^ permalink raw reply

* RE: [PATCH ] powerpc: Add tsi108/9 and non standard mpic support
From: Zang Roy-r61911 @ 2006-08-23  1:20 UTC (permalink / raw)
  To: Adrian Cox
  Cc: Yang Xin-Xin-r48390, Paul Mackerras, Alexandre.Bounine,
	linuxppc-dev list
In-Reply-To: <1156266914.10233.26.camel@localhost.localdomain>

>=20
> I don't support IPI 2 and IPI 3, though it would be possible=20
> to use the mailbox registers in a similar scheme. This=20
> approach works, but I've not worked out how to cleanly=20
> integrate this with the rest of the MPIC driver, and won't=20
> have any time to do this in the near future.
>=20
It might be better to deal with the tsi108/9 smp support
in a separate file.=20
Roy

^ permalink raw reply

* Re: Broken Firewire 400/SCSI on ppc Powerbook5,8
From: Wolfgang Pfeiffer @ 2006-08-23  0:36 UTC (permalink / raw)
  To: Stefan Richter; +Cc: linuxppc-dev, billfink, linux1394-devel
In-Reply-To: <20060823002801.GA2709@localhost>

On Wed, Aug 23, 2006 at 02:28:01AM +0200, Wolfgang Pfeiffer wrote:

> [ ... ]

> Some tests on the Alubook:
> 
> I compiled a fresh git kernel now with verbose ieee logging turned on.
> 
> $ uname -r
> 2.6.18-rc4-ieeeverbose-gef7d1b24-dirty
> 
> $ zgrep 4_VERBOS /proc/config.gz 
> 
>   [ ..... ]
> 
> Only after running the latter script, I switch on the FW disk. The log
> for these moments covering about 60 seconds is here:
> 
> wolfgangpfeiffer.com/kern.log.when.fw.disk.is.switched.on.txt
> 
> Then, some time later on with no /dev/sda available, I run gscanbus,
> forcing a bus reset. The log, again covering about 60 seconds is here:
> 
> wolfgangpfeiffer.com/kern.log.with.gscanbus.after.failed.fw.connection.txt


Sorry, forgot that: After running gscanbus above, and a few minutes after
sending the quoted message: still no /dev/sda

Regards
Wolfgang 

-- 
Wolfgang Pfeiffer: /ICQ: 286585973/ + + +  /AIM: crashinglinux/
http://profiles.yahoo.com/wolfgangpfeiffer

Key ID: E3037113
http://keyserver.mine.nu/pks/lookup?search=0xE3037113&fingerprint=on

^ permalink raw reply

* Re: Broken Firewire 400/SCSI on ppc Powerbook5,8
From: Wolfgang Pfeiffer @ 2006-08-23  0:28 UTC (permalink / raw)
  To: Stefan Richter; +Cc: linuxppc-dev, billfink, linux1394-devel
In-Reply-To: <44E6D634.3000207@s5r6.in-berlin.de>


Hi Stefan,
Hi All

On Sat, Aug 19, 2006 at 11:13:24AM +0200, Stefan Richter wrote:

          [ ... ]

> The fact that Linux on the AlBook gets at least as far as "ieee1394: 
> Error parsing configrom for node 0-00:1023" indicates that not all hope 
> is lost. If you have got the time, compile the 1394 drivers for verbose 
> logging and send the log. Don't crosspost the log if it gets too big.

Some tests on the Alubook:

I compiled a fresh git kernel now with verbose ieee logging turned on.

$ uname -r
2.6.18-rc4-ieeeverbose-gef7d1b24-dirty

$ zgrep 4_VERBOS /proc/config.gz 
CONFIG_IEEE1394_VERBOSEDEBUG=y


Before starting the FW disk I removed all ieee drivers I thought could
be relevant, with this little script:

-------------------------
#!/bin/sh -x
/bin/sh -n /home/shorty/scripts/scsi.stop.sh; \
rmmod raw1394; \
rmmod eth1394;
rmmod ohci1394; \
rmmod sbp2; \
rmmod ieee1394
---------------------------------------



Then, with the FW disk connected to the alubook, but *not yet* powered
on by the latter via a switch at the enclosure which obviously, when
switched on, feeds the current to the firewire disk, thus switching it on:

-----------------------------------
#!/bin/sh -x
/bin/sh -n /home/shorty/scripts/scsi.start.sh ; \

modprobe ieee1394 disable_irm=0; \
sleep 2; \
modprobe ohci1394; \
sleep 2; \
modprobe sbp2; \
sleep 2; \
modprobe raw1394; \
sleep 2
chown root.shorty /dev/raw1394
sleep 4; \
ls /dev/sda


-------------------------------



Only after running the latter script, I switch on the FW disk. The log
for these moments covering about 60 seconds is here:

wolfgangpfeiffer.com/kern.log.when.fw.disk.is.switched.on.txt

Then, some time later on with no /dev/sda available, I run gscanbus,
forcing a bus reset. The log, again covering about 60 seconds is here:

wolfgangpfeiffer.com/kern.log.with.gscanbus.after.failed.fw.connection.txt


Again a bit later I click the 3 icons on the gscanbus window:

Clicking
"Unknown 
Linux - ohci1394"

------------------------------------------------------
SelfID Info
-----------
Physical ID: 2
Link active: Yes
Gap Count: 63
PHY Speed: Unknown
PHY Delay: <=144ns
IRM Capable: Yes
Power Class: -1W
Port 0: Not connected
Port 1: Connected to child node
Port 2: Not connected
Init. reset: Yes

CSR ROM Info
------------
GUID: 0x001451FFFE3148BE
Node Capabilities: 0x000083C0
Vendor ID: 0x00001451
Unit Spec ID: 0x0000005E
Unit SW Version: 0x00000001
Model ID: 0x00000000
Nr. Textual Leafes: 1

Vendor: Unknown
Textual Leafes: 
Linux - ohci1394

AV/C Subunits
-------------
N/A
-------------------------------------------------





Clicking

" <question mark>
S400 Unknown":

------------------------------------------
SelfID Info
-----------
Physical ID: 1
Link active: No
Gap Count: 63
PHY Speed: S400
PHY Delay: <=144ns
IRM Capable: No
Power Class: -1W
Port 0: Not connected
Port 1: Connected to parent node
Port 2: Connected to child node
Init. reset: No

CSR ROM Info
------------
GUID: 0x0000000000000000
Node Capabilities: 0x00000000
Vendor ID: 0x00000000
Unit Spec ID: 0x00000000
Unit SW Version: 0x00000000
Model ID: 0x00000000
Nr. Textual Leafes: 0

Vendor: (null)
Textual Leafes: 

AV/C Subunits
-------------
N/A

-------------------------------------------------------------


Clicking a second

" <question mark>
S400 Unknown":

----------------------------------------------------
SelfID Info
-----------
Physical ID: 0
Link active: Yes
Gap Count: 63
PHY Speed: S400
PHY Delay: <=144ns
IRM Capable: No
Power Class: None
Port 0: Connected to parent node
Port 1: Not connected
Port 2: Not connected
Init. reset: No

CSR ROM Info
------------
GUID: 0x0000000000000000
Node Capabilities: 0x00000000
Vendor ID: 0x00000000
Unit Spec ID: 0x00000000
Unit SW Version: 0x00000000
Model ID: 0x00000000
Nr. Textual Leafes: 0

Vendor: (null)
Textual Leafes: 

AV/C Subunits
-------------
N/A

---------------------------------------------------



Please, if you think it might help, let me know if want to change the
scripts to load the ieee drivers ...  (Note the disable_irm=0 in one of
the scripts above .. )


Til then

Best Regards
Wolfgang

-- 
Wolfgang Pfeiffer: /ICQ: 286585973/ + + +  /AIM: crashinglinux/
http://profiles.yahoo.com/wolfgangpfeiffer

Key ID: E3037113
http://keyserver.mine.nu/pks/lookup?search=0xE3037113&fingerprint=on

^ permalink raw reply

* test - please ignore
From: Benjamin Herrenschmidt @ 2006-08-22 23:27 UTC (permalink / raw)
  To: linuxppc-dev list

Mail with accents: èéêëä

Now, let's see if the CRLF's, one is here ->
have been corrupted.

Ben.

^ permalink raw reply

* MontaVista 2.4.30 kernel support for bus error status registers on Xilinx VirtexIIPro?
From: Keith J Outwater @ 2006-08-22 23:04 UTC (permalink / raw)
  To: linuxppc-embedded

Hello,

I am running a 2.4.30 kernel rsynced from Monta Vista on a Xilinx 
VirtexIIPro FPGA.
My design includes a PLB2OPB (Processor Local Bus to On chip Peripheral 
Bus) bridge that is
capable of generating a bus error interrupt when an OPM slave device 
asserts it's bus error
signal.  The PLB2OPB bridge also has a set of "bus error status and 
address registers"
that are capable of capturing information regarding the type of error that 
occurred.

Has anyone implemented support  for this functionality in a 2.4.x kernel 
running on
VirtexIIPro FPGAs?


Thanks!
Keith

^ permalink raw reply

* Re: boot problems on pseries
From: Olaf Hering @ 2006-08-22 22:35 UTC (permalink / raw)
  To: dtutty; +Cc: linuxppc-dev
In-Reply-To: <20060822165023.GA4807@hooton>

On Tue, Aug 22, dtutty@porchlight.ca wrote:

> Boot failures:
> 
> 	1.	CD not recognized as bootable, so use OF manually.
> 	2.	OF manually will boot yaboot.
> 	3.	yaboot doesn't find its config in the /etc directory
> 		of the cd, nor in the / directory of the CD with the
> 		yaboot executable.
> 	4.	when manually from yaboot attempt to boot a kernel
> 		image, get either:
> 			a)	CLAIMED	FAILED	
> 			b)	incorrect ELF format
> 				(something like that, I wasn't there
> 				when the tech got that one)
> 			c)	not a valid kernel image
> 
> At no point do I get any indication that the linux kernel has had a
> chance to try booting; it doesn't get that far.

I havent seen that sort of error, maybe a bad burn.

> I'll look at SuSE and see if there's a free-download of a boot floppy.

http://mirrors.kernel.org/opensuse/distribution/SL-stable/iso/SUSE-Linux-10.1-GM-ppc-mini.iso
http://mirrors.kernel.org/opensuse/distribution/SL-OSS-factory/inst-source/boot/boot.ppc.iso

You can try to boot the inst32 file via the network. Make sure to fix
the ARP entry for the H50 on the tftp server, like 'arp -s 1.2.3.4 MAC'
yaboot.ibm can also be used. Rename yaboot.cnf to yaboot.conf so yaboot
will be able to download it.

^ permalink raw reply

* Re: atomic operations in user space
From: Arnd Bergmann @ 2006-08-22 22:23 UTC (permalink / raw)
  To: linuxppc-embedded; +Cc: Xupei Liang
In-Reply-To: <20060822205024.98433.qmail@web36105.mail.mud.yahoo.com>

Am Tuesday 22 August 2006 22:50 schrieb Xupei Liang:
> #include <asm-ppc/atomic.h>
>
> int main()
> {
> =A0=A0=A0=A0=A0=A0=A0=A0atomic_t atom;
>
> =A0=A0=A0=A0=A0=A0=A0=A0atomic_add(1, &atom);
> =A0=A0=A0=A0=A0=A0=A0=A0return (0);
> }
>
> I am able to compile it and the atomic_add seems to be
> translated into the correct instructions. Can anybody
> please confirm? Thanks.

No, you can't do that, the kernel headers are not generally
working in user space, recent kernel versions protect you
from doing this.

If you don't have a library providing you with atomic operations,
you can copy the inline functions from the kernel, which will
work fine, but require that your app is GPL licensed.

	Arnd <><

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox