LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: initramfs on PowerPC
From: David H. Lynch Jr. @ 2007-05-04 19:02 UTC (permalink / raw)
  To: Richard Danter; +Cc: linuxppc-embedded
In-Reply-To: <200705041332.27296.richard.danter@ntlworld.com>

 I tried numerous approaches, I never got anything to work except pointing
CONFIG_INITRAMFS_SOURCE at a directory with my intramfs tree in it.
I am sure other ways work, but I never managed to figure out what I was
doing
wrong. Regardless that has worked well for me.

When I build I end up with a single file - zImage,.elf that has both my
kernel
and the initramfs tree in it. While there are a number of distro's that
seem to
use initramfs as a separate file - much like initrd, my loader has no
provisions for a 2nd file, and the kernel build process wraps everything
together
which works fine for me.

I have never seen your "junk in compressed archive" error, and I have
been doing this
for almost 2 years. But I have frequently had decompression errors.
These typically
have been the result of errors in the PPC zlib libraries. I beleive
somewhere between
2.6.16 and 2.6.18 these libraries got updated, and the PPC version of
the new ones
had problems. Anyway, after 2.6.18 the new ones are good - though somehow
once in a while the broken ones seem to creep into my development tree,
but updating it usually fixes things.

There also may be a total size issue. I am hazy on the details, but I
beleive if the
size of size of the kernel goes over 3mb that there are CONFIG values that
may need to be changed. I am not sure whether that is compressed size
decompressed size, kernel size, or combined kernel + initramfs size.

Regardless, one suguestion would be to try with a very minimal initramfs
tree
and add things until it blows up.






Richard Danter wrote:
> Hi all,
>
> I am having a problem booting a kernel with an initramfs. The kernel version 
> is 2.6.14. The target is a ppc 82xx board.
>
> I have tried both generating the cpio.gz file myself (find . | copi -o -H 
> newc | gzip > ../initramfs_data.cpio.gz) and pointing initramfs source to a 
> root FS directory (using xconfig) and then re-building my kernel.
>
> Usually the error is "junk in compressed archive" though I also see an 
> occasional error about padding.
>
> I am using U-Boot to load the kernel image (uImage).
>
> My host is SuSE 10.0 (x86), though I guess that shouldn't make any difference 
> (endianism?).
>
> Any thoughts on what I may be doing wrong?
>
> Thanks
> Rich
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>   

^ permalink raw reply

* Re: [PATCH 1/4] Add support for 750CL Holly board
From: Olof Johansson @ 2007-05-04 19:01 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linuxppc-dev
In-Reply-To: <1178302469.3026.204.camel@zod.rchland.ibm.com>

Hi,

Overall pretty good, I have a few comments below.


-Olof

On Fri, May 04, 2007 at 01:14:29PM -0500, Josh Boyer wrote:
> Add PowerPC 750 Holly/Hickory platform support
> 
> Signed-off-by: Stephen Winiecki <stevewin@us.ibm.com>
> Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
> ---
>  arch/powerpc/Kconfig                        |    2 
>  arch/powerpc/platforms/embedded6xx/Kconfig  |   12 -
>  arch/powerpc/platforms/embedded6xx/Makefile |    1 
>  arch/powerpc/platforms/embedded6xx/holly.c  |  326 ++++++++++++++++++++++++++++
>  arch/powerpc/platforms/embedded6xx/holly.h  |   24 ++
>  drivers/net/tsi108_eth.h                    |    4 
>  include/asm-powerpc/tsi108.h                |    4 
>  7 files changed, 371 insertions(+), 2 deletions(-)
> 
> --- linux-2.6.orig/arch/powerpc/Kconfig
> +++ linux-2.6/arch/powerpc/Kconfig
> @@ -659,7 +659,7 @@ config MCA
>  config PCI
>  	bool "PCI support" if 40x || CPM2 || PPC_83xx || PPC_85xx || PPC_86xx \
>  		|| PPC_MPC52xx || (EMBEDDED && (PPC_PSERIES || PPC_ISERIES)) \
> -		|| MPC7448HPC2 || PPC_PS3
> +		|| MPC7448HPC2 || PPC_PS3 || HOLLY
>  	default y if !40x && !CPM2 && !8xx && !APUS && !PPC_83xx \
>  		&& !PPC_85xx && !PPC_86xx
>  	default PCI_PERMEDIA if !4xx && !CPM2 && !8xx && APUS
> --- linux-2.6.orig/arch/powerpc/platforms/embedded6xx/Kconfig
> +++ linux-2.6/arch/powerpc/platforms/embedded6xx/Kconfig
> @@ -25,11 +25,21 @@ config MPC7448HPC2
>  	help
>  	  Select MPC7448HPC2 if configuring for Freescale MPC7448HPC2 (Taiga)
>  	  platform
> +
> +config HOLLY
> +	bool "PPC750GX/CL with TSI10x bridge (Hickory/Holly)"
> +	select TSI108_BRIDGE
> +	select PPC_UDBG_16550
> +	select MPIC
> +	select MPIC_WEIRD
> +	help
> +	  Select HOLLY if configuring for an IBM 750GX/CL Eval
> +	  Board with TSI108/9 bridge (Hickory/Holly)
>  endchoice
>  
>  config TSI108_BRIDGE
>  	bool
> -	depends on MPC7448HPC2
> +	depends on MPC7448HPC2 || HOLLY
>  	default y
>  
>  config MPC10X_BRIDGE
> --- linux-2.6.orig/arch/powerpc/platforms/embedded6xx/Makefile
> +++ linux-2.6/arch/powerpc/platforms/embedded6xx/Makefile
> @@ -3,3 +3,4 @@
>  #
>  obj-$(CONFIG_MPC7448HPC2)	+= mpc7448_hpc2.o
>  obj-$(CONFIG_LINKSTATION)	+= linkstation.o ls_uart.o
> +obj-$(CONFIG_HOLLY)		+= holly.o
> --- /dev/null
> +++ linux-2.6/arch/powerpc/platforms/embedded6xx/holly.c
> @@ -0,0 +1,326 @@
> +/*
> + * Board setup routines for the IBM 750GX/CL platform w/ TSI10x bridge
> + *
> + * Copyright 2007 IBM Corporation
> + *
> + * Stephen Winiecki <stevewin@us.ibm.com>
> + * Josh Boyer <jwboyer@linux.vnet.ibm.com>
> + *
> + * Based on code from mpc7448_hpc2.c
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License
> + * version 2 as published by the Free Software Foundation.
> + */
> +
> +#include <linux/stddef.h>
> +#include <linux/kernel.h>
> +#include <linux/pci.h>
> +#include <linux/kdev_t.h>
> +#include <linux/console.h>
> +#include <linux/delay.h>
> +#include <linux/irq.h>
> +#include <linux/ide.h>
> +#include <linux/seq_file.h>
> +#include <linux/root_dev.h>
> +#include <linux/serial.h>
> +#include <linux/tty.h>
> +#include <linux/serial_core.h>
> +
> +#include <asm/system.h>
> +#include <asm/time.h>
> +#include <asm/machdep.h>
> +#include <asm/prom.h>
> +#include <asm/udbg.h>
> +#include <asm/tsi108.h>
> +#include <asm/pci-bridge.h>
> +#include <asm/reg.h>
> +#include <mm/mmu_decl.h>
> +#include "holly.h"
> +#include <asm/tsi108_irq.h>
> +#include <asm/mpic.h>
> +#include <asm/of_platform.h>
> +
> +#undef DEBUG
> +#ifdef DEBUG
> +#define DBG(fmt...) do { printk(fmt); } while(0)
> +#else
> +#define DBG(fmt...) do { } while(0)
> +#endif

Please use pr_debug() instead.

> +#ifndef CONFIG_PCI
> +pci_dram_offset = PPC750GXCL_TSI_PCI_MEM_OFFSET;
> +#endif

What's this about?

> +extern int tsi108_setup_pci(struct device_node *dev);
> +extern void tsi108_pci_int_init(struct device_node *node);
> +extern void tsi108_irq_cascade(unsigned int irq, struct irq_desc *desc);
> +
> +int holly_exclude_device(u_char bus, u_char devfn)
> +{
> +	if (bus == 0 && PCI_SLOT(devfn) == 0)
> +		return PCIBIOS_DEVICE_NOT_FOUND;
> +	else
> +		return PCIBIOS_SUCCESSFUL;
> +}
> +
> +static void holly_remap_bridge(void)
> +{
> +	u32 lut_val, lut_addr = 0x900, misc_cfg;

Please initialize lut_addr right before using it instead of here, especially
since you re-assign it later on.

> +	int i;
> +
> +	printk(KERN_ERR "Remapping PCI bridge\n");
> +
> +	/* Re-init the PCI bridge and LUT registers to have mappings that don't
> +	 * rely on PIBS */

Comment style

> +	for (i = 0; i < 31; i++) {
> +		tsi108_write_reg(TSI108_PB_OFFSET + lut_addr, 0x00000201);
> +		lut_addr += 4;
> +		tsi108_write_reg(TSI108_PB_OFFSET + lut_addr, 0x0);
> +		lut_addr += 4;
> +	}
> +
> +	/* Reserve the last LUT entry for PCI I/O space */
> +	tsi108_write_reg(TSI108_PB_OFFSET + lut_addr, 0x00000241);
> +	lut_addr += 4;
> +	tsi108_write_reg(TSI108_PB_OFFSET + lut_addr, 0x0);
> +
> +	/* Map PCI I/O space */
> +	tsi108_write_reg(TSI108_PCI_OFFSET + 0x210, 0x0);
> +	tsi108_write_reg(TSI108_PCI_OFFSET + 0x20c, 0x1);
> +
> +	/* Map PCI CFG space */
> +	tsi108_write_reg(TSI108_PCI_OFFSET + 0x208, 0x0);
> +	tsi108_write_reg(TSI108_PCI_OFFSET + 0x204, 0x7c000000 | 0x01);
> +
> +	/* We don't need MEM32 and PRM remapping so disable them */
> +	tsi108_write_reg(TSI108_PCI_OFFSET + 0x214, 0x0);
> +	tsi108_write_reg(TSI108_PCI_OFFSET + 0x220, 0x0);
> +	tsi108_write_reg(TSI108_PCI_OFFSET + 0x230, 0x0);

It would be nice to get these constants defined up, but I know it's not always
practical. I'll bring it up anyway. :-)

> +
> +	/* Set P2O_BAR0 */
> +	tsi108_write_reg(TSI108_PCI_OFFSET + 0x14, 0x0);
> +	tsi108_write_reg(TSI108_PCI_OFFSET + 0x10, 0xc0000000);
> +
> +	/* Init the PCI LUTs to do no remapping */
> +	lut_addr = 0x500;
> +	lut_val = 0x00000002;
> +
> +	for (i = 0; i < 32; i++) {
> +		tsi108_write_reg(TSI108_PCI_OFFSET + lut_addr, lut_val);
> +		lut_addr += 4;
> +		tsi108_write_reg(TSI108_PCI_OFFSET + lut_addr, 0x40000000);
> +		lut_addr += 4;
> +		lut_val += 0x02000000;
> +	}
> +	tsi108_write_reg(TSI108_PCI_OFFSET + 0x4c, 0x00007900);
> +
> +	/* Set 64-bit PCI bus address for system memory */
> +	tsi108_write_reg(TSI108_PCI_OFFSET + 0x1c, 0x0);
> +	tsi108_write_reg(TSI108_PCI_OFFSET + 0x18, 0x0);
> +}
> +
> +static void __init holly_setup_arch(void)
> +{
> +	struct device_node *cpu;
> +	struct device_node *np;
> +
> +	if (ppc_md.progress)
> +		ppc_md.progress("holly_setup_arch():set_bridge", 0);
> +
> +	cpu = of_find_node_by_type(NULL, "cpu");
> +	if (cpu != 0) {
> +		const unsigned int *fp;
> +
> +		fp = of_get_property(cpu, "clock-frequency", NULL);
> +		if (fp != 0)
> +			loops_per_jiffy = *fp / HZ;
> +		else
> +			loops_per_jiffy = 50000000 / HZ;
> +		of_node_put(cpu);
> +	}
> +	tsi108_csr_vir_base = get_vir_csrbase();
> +
> +	/* setup PCI host bridge */
> +	holly_remap_bridge();
> +#ifdef CONFIG_PCI
> +	for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
> +		tsi108_setup_pci(np);

On an environment without PCI, wouldn't it make more sense to leave it
out of the device tree, and thus not have a match in the above, instead
of taking out CONFIG_PCI?

> +
> +	ppc_md.pci_exclude_device = holly_exclude_device;
> +	if (ppc_md.progress)
> +		ppc_md.progress("tsi108: resources set", 0x100);
> +#endif
> +	printk(KERN_INFO "PPC750GX/CL Platform\n");
> +}
> +
> +/*
> + * Interrupt setup and service.  Interrrupts on the holly come
> + * from the four external INT pins, PCI interrupts are routed via
> + * PCI interrupt control registers, it generates internal IRQ23
> + *
> + * Interrupt routing on the Holly Board:
> + * TSI108:PB_INT[0] -> CPU0:INT#
> + * TSI108:PB_INT[1] -> CPU0:MCP#
> + * TSI108:PB_INT[2] -> N/C
> + * TSI108:PB_INT[3] -> N/C
> + */
> +static void __init holly_init_IRQ(void)
> +{
> +	struct mpic *mpic;
> +	phys_addr_t mpic_paddr = 0;
> +	struct device_node *tsi_pic;
> +#ifdef CONFIG_PCI
> +	unsigned int cascade_pci_irq;
> +	struct device_node *tsi_pci;
> +	struct device_node *cascade_node = NULL;
> +#endif
> +
> +	tsi_pic = of_find_node_by_type(NULL, "open-pic");
> +	if (tsi_pic) {
> +		unsigned int size;
> +		const void *prop = of_get_property(tsi_pic, "reg", &size);
> +		mpic_paddr = of_translate_address(tsi_pic, prop);
> +	}
> +
> +	if (mpic_paddr == 0) {
> +		printk(KERN_ERR "%s: No tsi108 PIC found !\n", __func__);
> +		return;
> +	}
> +
> +	DBG("%s: tsi108 pic phys_addr = 0x%x\n", __func__, (u32) mpic_paddr);
> +
> +	mpic = mpic_alloc(tsi_pic, mpic_paddr,
> +			MPIC_PRIMARY | MPIC_BIG_ENDIAN | MPIC_WANTS_RESET |
> +			MPIC_SPV_EOI | MPIC_NO_PTHROU_DIS | MPIC_REGSET_TSI108,
> +			24,
> +			NR_IRQS-4, /* num_sources used */
> +			"Tsi108_PIC");
> +
> +	BUG_ON(mpic == NULL);
> +
> +	mpic_assign_isu(mpic, 0, mpic_paddr + 0x100);
> +
> +	mpic_init(mpic);
> +
> +#ifdef CONFIG_PCI
> +	tsi_pci = of_find_node_by_type(NULL, "pci");
> +	if (tsi_pci == NULL) {
> +		printk(KERN_ERR "%s: No tsi108 pci node found !\n", __func__);
> +		return;
> +	}
> +
> +	cascade_node = of_find_node_by_type(NULL, "pic-router");
> +	if (cascade_node == NULL) {
> +		printk(KERN_ERR "%s: No tsi108 pci cascade node found !\n", __func__);
> +		return;
> +	}
> +
> +	cascade_pci_irq = irq_of_parse_and_map(tsi_pci, 0);
> +	DBG("%s: tsi108 cascade_pci_irq = 0x%x\n", __func__, (u32) cascade_pci_irq);
> +	tsi108_pci_int_init(cascade_node);
> +	set_irq_data(cascade_pci_irq, mpic);
> +	set_irq_chained_handler(cascade_pci_irq, tsi108_irq_cascade);
> +#endif
> +	/* Configure MPIC outputs to CPU0 */
> +	tsi108_write_reg(TSI108_MPIC_OFFSET + 0x30c, 0);
> +	of_node_put(tsi_pic);
> +}
> +
> +void holly_show_cpuinfo(struct seq_file *m)
> +{
> +	seq_printf(m, "vendor\t\t: IBM\n");
> +	seq_printf(m, "machine\t\t: PPC750 GX/CL\n");
> +}
> +
> +void holly_restart(char *cmd)
> +{
> +	unsigned long *ocn_bar1 = NULL;
> +	unsigned long bar;
> +	struct device_node *bridge = NULL;
> +	const void *prop;
> +	int size;
> +	phys_addr_t addr = 0xc0000000;
> +
> +	local_irq_disable();
> +
> +	bridge = of_find_node_by_type(NULL, "tsi-bridge");
> +	if (bridge) {
> +		prop = of_get_property(bridge, "reg", &size);
> +		addr = of_translate_address(bridge, prop);
> +	}
> +	addr += (TSI108_PB_OFFSET + 0x414);
> +
> +	ocn_bar1 = ioremap(addr, 0x4);
> +
> +	/* Turn on the BOOT bit so the addresses are correctly
> +	 * routed to the HLP interface */
> +	bar = ioread32be(ocn_bar1);
> +	bar |= 2;
> +	iowrite32be(bar, ocn_bar1);
> +	iosync();
> +
> +	/* Set SRR0 to the reset vector and turn on MSR_IP */
> +	mtspr(SPRN_SRR0, 0xfff00100);
> +	mtspr(SPRN_SRR1, MSR_IP);
> +
> +	/* Do an rfi to jump back to firmware.  Somewhat evil,
> +	 * but it works
> +	 */
> +	__asm__ __volatile__("rfi" : : : "memory");

Evil, yes, but it should work. Actually, it should work for me as well,
thanks for the tip. :)

> +
> +	/* Spin until reset happens.  Shouldn't really get here */
> +	for (;;) ;
> +}
> +
> +void holly_power_off(void)
> +{
> +	local_irq_disable();
> +	/* No way to shut power off with software */
> +	for (;;) ;
> +}
> +
> +void holly_halt(void)
> +{
> +	holly_power_off();
> +}
> +
> +/*
> + * Called very early, device-tree isn't unflattened
> + */
> +static int __init holly_probe(void)
> +{
> +	unsigned long root = of_get_flat_dt_root();
> +
> +	if (!of_flat_dt_is_compatible(root, "ppc750"))
> +		return 0;

That's a pretty broad compatible check?

> +	return 1;
> +}
> +
> +static int ppc750_machine_check_exception(struct pt_regs *regs)
> +{
> +	extern void tsi108_clear_pci_cfg_error(void);
> +	const struct exception_table_entry *entry;
> +
> +	/* Are we prepared to handle this fault */
> +	if ((entry = search_exception_tables(regs->nip)) != NULL) {
> +		tsi108_clear_pci_cfg_error();
> +		regs->msr |= MSR_RI;
> +		regs->nip = entry->fixup;
> +		return 1;
> +	}
> +	return 0;
> +}
> +
> +define_machine(holly){
> +	.name 						= "PPC750 GX/CL TSI",
> +	.probe 						= holly_probe,
> +	.setup_arch 				= holly_setup_arch,
> +	.init_IRQ 					= holly_init_IRQ,
> +	.show_cpuinfo 				= holly_show_cpuinfo,
> +	.get_irq 					= mpic_get_irq,
> +	.restart 					= holly_restart,
> +	.calibrate_decr 			= generic_calibrate_decr,
> +	.machine_check_exception	= ppc750_machine_check_exception,
> +	.progress 					= udbg_progress,

These look all unaligned for me.

> +};
> --- /dev/null
> +++ linux-2.6/arch/powerpc/platforms/embedded6xx/holly.h
> @@ -0,0 +1,24 @@
> +/*
> + * Definitions for the IBM 750GX/CL platform w/ TSI10x bridge
> + *
> + * Copyright 2007 IBM Corporation
> + *
> + * Stephen Winiecki <stevewin@us.ibm.com>
> + * Josh Boyer <jwboyer@linux.vnet.ibm.com>
> + *
> + * Based on code from mpc7448_hpc2.h
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License
> + * version 2 as published by the Free Software Foundation.
> + */
> +
> +#ifndef __PPC_PLATFORMS_PPC750GXCL_TSI_H
> +#define __PPC_PLATFORMS_PPC750GXCL_TSI_H
> +
> +#include <asm/ppcboot.h>
> +
> +/* Base Addresses for the PCI bus
> + */
> +#define PPC750GXCL_TSI_PCI_MEM_OFFSET	(0x00000000)
> +#endif				/* __PPC_PLATFORMS_H */
> --- linux-2.6.orig/drivers/net/tsi108_eth.h
> +++ linux-2.6/drivers/net/tsi108_eth.h
> @@ -49,7 +49,11 @@
>   */
>  #define PHY_MV88E	1	/* Marvel 88Exxxx PHY */
>  #define PHY_BCM54XX	2	/* Broardcom BCM54xx PHY */
> +#if defined(CONFIG_HOLLY)
> +#define TSI108_PHY_TYPE PHY_BCM54XX
> +#else
>  #define TSI108_PHY_TYPE	PHY_MV88E
> +#endif

This won't work well if you ever want to build a multiplatform kernel.

>  
>  /*
>   * TSI108 GIGE port registers
> --- linux-2.6.orig/include/asm-powerpc/tsi108.h
> +++ linux-2.6/include/asm-powerpc/tsi108.h
> @@ -68,7 +68,11 @@
>  #define TSI108_PB_ERRCS_ES		(1 << 1)
>  #define TSI108_PB_ISR_PBS_RD_ERR	(1 << 8)
>  
> +#ifdef CONFIG_HOLLY
> +#define TSI108_PCI_CFG_BASE_PHYS	(0x7c000000)
> +#else
>  #define TSI108_PCI_CFG_BASE_PHYS	(0xfb000000)
> +#endif
>  #define TSI108_PCI_CFG_SIZE		(0x01000000)

Same here. Shouldn't this come out of the devicetree?



-Olof

^ permalink raw reply

* Re: [PATCH 1/4] Add support for 750CL Holly board
From: Kumar Gala @ 2007-05-04 18:35 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linuxppc-dev
In-Reply-To: <1178302469.3026.204.camel@zod.rchland.ibm.com>


On May 4, 2007, at 1:14 PM, Josh Boyer wrote:

> Add PowerPC 750 Holly/Hickory platform support
>
> Signed-off-by: Stephen Winiecki <stevewin@us.ibm.com>
> Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
> ---
>  arch/powerpc/Kconfig                        |    2
>  arch/powerpc/platforms/embedded6xx/Kconfig  |   12 -
>  arch/powerpc/platforms/embedded6xx/Makefile |    1
>  arch/powerpc/platforms/embedded6xx/holly.c  |  326 ++++++++++++++++ 
> ++++++++++++
>  arch/powerpc/platforms/embedded6xx/holly.h  |   24 ++
>  drivers/net/tsi108_eth.h                    |    4
>  include/asm-powerpc/tsi108.h                |    4
>  7 files changed, 371 insertions(+), 2 deletions(-)
>
> --- linux-2.6.orig/arch/powerpc/Kconfig
> +++ linux-2.6/arch/powerpc/Kconfig
> @@ -659,7 +659,7 @@ config MCA
>  config PCI
>  	bool "PCI support" if 40x || CPM2 || PPC_83xx || PPC_85xx ||  
> PPC_86xx \
>  		|| PPC_MPC52xx || (EMBEDDED && (PPC_PSERIES || PPC_ISERIES)) \
> -		|| MPC7448HPC2 || PPC_PS3
> +		|| MPC7448HPC2 || PPC_PS3 || HOLLY
>  	default y if !40x && !CPM2 && !8xx && !APUS && !PPC_83xx \
>  		&& !PPC_85xx && !PPC_86xx
>  	default PCI_PERMEDIA if !4xx && !CPM2 && !8xx && APUS
> --- linux-2.6.orig/arch/powerpc/platforms/embedded6xx/Kconfig
> +++ linux-2.6/arch/powerpc/platforms/embedded6xx/Kconfig
> @@ -25,11 +25,21 @@ config MPC7448HPC2
>  	help
>  	  Select MPC7448HPC2 if configuring for Freescale MPC7448HPC2  
> (Taiga)
>  	  platform
> +
> +config HOLLY
> +	bool "PPC750GX/CL with TSI10x bridge (Hickory/Holly)"
> +	select TSI108_BRIDGE
> +	select PPC_UDBG_16550
> +	select MPIC
> +	select MPIC_WEIRD
> +	help
> +	  Select HOLLY if configuring for an IBM 750GX/CL Eval
> +	  Board with TSI108/9 bridge (Hickory/Holly)
>  endchoice
>
>  config TSI108_BRIDGE
>  	bool

I wondering if we should have select MPIC and MPIC_WEIRD here instead  
of on the board config.

> -	depends on MPC7448HPC2
> +	depends on MPC7448HPC2 || HOLLY
>  	default y
>
>  config MPC10X_BRIDGE
> --- linux-2.6.orig/arch/powerpc/platforms/embedded6xx/Makefile
> +++ linux-2.6/arch/powerpc/platforms/embedded6xx/Makefile
> @@ -3,3 +3,4 @@
>  #
>  obj-$(CONFIG_MPC7448HPC2)	+= mpc7448_hpc2.o
>  obj-$(CONFIG_LINKSTATION)	+= linkstation.o ls_uart.o
> +obj-$(CONFIG_HOLLY)		+= holly.o
> --- /dev/null
> +++ linux-2.6/arch/powerpc/platforms/embedded6xx/holly.c
> @@ -0,0 +1,326 @@
> +/*
> + * Board setup routines for the IBM 750GX/CL platform w/ TSI10x  
> bridge
> + *
> + * Copyright 2007 IBM Corporation
> + *
> + * Stephen Winiecki <stevewin@us.ibm.com>
> + * Josh Boyer <jwboyer@linux.vnet.ibm.com>
> + *
> + * Based on code from mpc7448_hpc2.c
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License
> + * version 2 as published by the Free Software Foundation.
> + */
> +
> +#include <linux/stddef.h>
> +#include <linux/kernel.h>
> +#include <linux/pci.h>
> +#include <linux/kdev_t.h>
> +#include <linux/console.h>
> +#include <linux/delay.h>
> +#include <linux/irq.h>
> +#include <linux/ide.h>
> +#include <linux/seq_file.h>
> +#include <linux/root_dev.h>
> +#include <linux/serial.h>
> +#include <linux/tty.h>
> +#include <linux/serial_core.h>
> +
> +#include <asm/system.h>
> +#include <asm/time.h>
> +#include <asm/machdep.h>
> +#include <asm/prom.h>
> +#include <asm/udbg.h>
> +#include <asm/tsi108.h>
> +#include <asm/pci-bridge.h>
> +#include <asm/reg.h>
> +#include <mm/mmu_decl.h>
> +#include "holly.h"
> +#include <asm/tsi108_irq.h>
> +#include <asm/mpic.h>
> +#include <asm/of_platform.h>
> +
> +#undef DEBUG
> +#ifdef DEBUG
> +#define DBG(fmt...) do { printk(fmt); } while(0)
> +#else
> +#define DBG(fmt...) do { } while(0)
> +#endif
> +
> +#ifndef CONFIG_PCI
> +pci_dram_offset = PPC750GXCL_TSI_PCI_MEM_OFFSET;
> +#endif
> +
> +extern int tsi108_setup_pci(struct device_node *dev);
> +extern void tsi108_pci_int_init(struct device_node *node);
> +extern void tsi108_irq_cascade(unsigned int irq, struct irq_desc  
> *desc);
> +
> +int holly_exclude_device(u_char bus, u_char devfn)
> +{
> +	if (bus == 0 && PCI_SLOT(devfn) == 0)
> +		return PCIBIOS_DEVICE_NOT_FOUND;
> +	else
> +		return PCIBIOS_SUCCESSFUL;
> +}
> +
> +static void holly_remap_bridge(void)
> +{
> +	u32 lut_val, lut_addr = 0x900, misc_cfg;
> +	int i;
> +
> +	printk(KERN_ERR "Remapping PCI bridge\n");
> +
> +	/* Re-init the PCI bridge and LUT registers to have mappings that  
> don't
> +	 * rely on PIBS */
> +	for (i = 0; i < 31; i++) {
> +		tsi108_write_reg(TSI108_PB_OFFSET + lut_addr, 0x00000201);
> +		lut_addr += 4;
> +		tsi108_write_reg(TSI108_PB_OFFSET + lut_addr, 0x0);
> +		lut_addr += 4;
> +	}
> +
> +	/* Reserve the last LUT entry for PCI I/O space */
> +	tsi108_write_reg(TSI108_PB_OFFSET + lut_addr, 0x00000241);
> +	lut_addr += 4;
> +	tsi108_write_reg(TSI108_PB_OFFSET + lut_addr, 0x0);
> +
> +	/* Map PCI I/O space */
> +	tsi108_write_reg(TSI108_PCI_OFFSET + 0x210, 0x0);
> +	tsi108_write_reg(TSI108_PCI_OFFSET + 0x20c, 0x1);
> +
> +	/* Map PCI CFG space */
> +	tsi108_write_reg(TSI108_PCI_OFFSET + 0x208, 0x0);
> +	tsi108_write_reg(TSI108_PCI_OFFSET + 0x204, 0x7c000000 | 0x01);
> +
> +	/* We don't need MEM32 and PRM remapping so disable them */
> +	tsi108_write_reg(TSI108_PCI_OFFSET + 0x214, 0x0);
> +	tsi108_write_reg(TSI108_PCI_OFFSET + 0x220, 0x0);
> +	tsi108_write_reg(TSI108_PCI_OFFSET + 0x230, 0x0);
> +
> +	/* Set P2O_BAR0 */
> +	tsi108_write_reg(TSI108_PCI_OFFSET + 0x14, 0x0);
> +	tsi108_write_reg(TSI108_PCI_OFFSET + 0x10, 0xc0000000);
> +
> +	/* Init the PCI LUTs to do no remapping */
> +	lut_addr = 0x500;
> +	lut_val = 0x00000002;
> +
> +	for (i = 0; i < 32; i++) {
> +		tsi108_write_reg(TSI108_PCI_OFFSET + lut_addr, lut_val);
> +		lut_addr += 4;
> +		tsi108_write_reg(TSI108_PCI_OFFSET + lut_addr, 0x40000000);
> +		lut_addr += 4;
> +		lut_val += 0x02000000;
> +	}
> +	tsi108_write_reg(TSI108_PCI_OFFSET + 0x4c, 0x00007900);
> +
> +	/* Set 64-bit PCI bus address for system memory */
> +	tsi108_write_reg(TSI108_PCI_OFFSET + 0x1c, 0x0);
> +	tsi108_write_reg(TSI108_PCI_OFFSET + 0x18, 0x0);
> +}
> +
> +static void __init holly_setup_arch(void)
> +{
> +	struct device_node *cpu;
> +	struct device_node *np;
> +
> +	if (ppc_md.progress)
> +		ppc_md.progress("holly_setup_arch():set_bridge", 0);
> +
> +	cpu = of_find_node_by_type(NULL, "cpu");
> +	if (cpu != 0) {
> +		const unsigned int *fp;
> +
> +		fp = of_get_property(cpu, "clock-frequency", NULL);
> +		if (fp != 0)
> +			loops_per_jiffy = *fp / HZ;
> +		else
> +			loops_per_jiffy = 50000000 / HZ;
> +		of_node_put(cpu);
> +	}
> +	tsi108_csr_vir_base = get_vir_csrbase();
> +
> +	/* setup PCI host bridge */
> +	holly_remap_bridge();
> +#ifdef CONFIG_PCI
> +	for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
> +		tsi108_setup_pci(np);
> +
> +	ppc_md.pci_exclude_device = holly_exclude_device;
> +	if (ppc_md.progress)
> +		ppc_md.progress("tsi108: resources set", 0x100);
> +#endif
> +	printk(KERN_INFO "PPC750GX/CL Platform\n");

Should this be something like "Holly PPC750GX/CL Platform"

> +}
> +
> +/*
> + * Interrupt setup and service.  Interrrupts on the holly come
> + * from the four external INT pins, PCI interrupts are routed via
> + * PCI interrupt control registers, it generates internal IRQ23
> + *
> + * Interrupt routing on the Holly Board:
> + * TSI108:PB_INT[0] -> CPU0:INT#
> + * TSI108:PB_INT[1] -> CPU0:MCP#
> + * TSI108:PB_INT[2] -> N/C
> + * TSI108:PB_INT[3] -> N/C
> + */
> +static void __init holly_init_IRQ(void)
> +{
> +	struct mpic *mpic;
> +	phys_addr_t mpic_paddr = 0;
> +	struct device_node *tsi_pic;
> +#ifdef CONFIG_PCI
> +	unsigned int cascade_pci_irq;
> +	struct device_node *tsi_pci;
> +	struct device_node *cascade_node = NULL;
> +#endif
> +
> +	tsi_pic = of_find_node_by_type(NULL, "open-pic");
> +	if (tsi_pic) {
> +		unsigned int size;
> +		const void *prop = of_get_property(tsi_pic, "reg", &size);
> +		mpic_paddr = of_translate_address(tsi_pic, prop);
> +	}
> +
> +	if (mpic_paddr == 0) {
> +		printk(KERN_ERR "%s: No tsi108 PIC found !\n", __func__);
> +		return;
> +	}
> +
> +	DBG("%s: tsi108 pic phys_addr = 0x%x\n", __func__, (u32)  
> mpic_paddr);
> +
> +	mpic = mpic_alloc(tsi_pic, mpic_paddr,
> +			MPIC_PRIMARY | MPIC_BIG_ENDIAN | MPIC_WANTS_RESET |
> +			MPIC_SPV_EOI | MPIC_NO_PTHROU_DIS | MPIC_REGSET_TSI108,
> +			24,
> +			NR_IRQS-4, /* num_sources used */
> +			"Tsi108_PIC");
> +
> +	BUG_ON(mpic == NULL);
> +
> +	mpic_assign_isu(mpic, 0, mpic_paddr + 0x100);
> +
> +	mpic_init(mpic);
> +
> +#ifdef CONFIG_PCI
> +	tsi_pci = of_find_node_by_type(NULL, "pci");
> +	if (tsi_pci == NULL) {
> +		printk(KERN_ERR "%s: No tsi108 pci node found !\n", __func__);
> +		return;
> +	}
> +
> +	cascade_node = of_find_node_by_type(NULL, "pic-router");
> +	if (cascade_node == NULL) {
> +		printk(KERN_ERR "%s: No tsi108 pci cascade node found !\n",  
> __func__);
> +		return;
> +	}
> +
> +	cascade_pci_irq = irq_of_parse_and_map(tsi_pci, 0);
> +	DBG("%s: tsi108 cascade_pci_irq = 0x%x\n", __func__, (u32)  
> cascade_pci_irq);
> +	tsi108_pci_int_init(cascade_node);
> +	set_irq_data(cascade_pci_irq, mpic);
> +	set_irq_chained_handler(cascade_pci_irq, tsi108_irq_cascade);
> +#endif
> +	/* Configure MPIC outputs to CPU0 */
> +	tsi108_write_reg(TSI108_MPIC_OFFSET + 0x30c, 0);
> +	of_node_put(tsi_pic);
> +}
> +
> +void holly_show_cpuinfo(struct seq_file *m)
> +{
> +	seq_printf(m, "vendor\t\t: IBM\n");
> +	seq_printf(m, "machine\t\t: PPC750 GX/CL\n");

Should 'Holly' be in the machine name?

> +}
> +
> +void holly_restart(char *cmd)
> +{
> +	unsigned long *ocn_bar1 = NULL;

This should probably be __be32 __iomem

> +	unsigned long bar;
> +	struct device_node *bridge = NULL;
> +	const void *prop;
> +	int size;
> +	phys_addr_t addr = 0xc0000000;
> +
> +	local_irq_disable();
> +
> +	bridge = of_find_node_by_type(NULL, "tsi-bridge");
> +	if (bridge) {
> +		prop = of_get_property(bridge, "reg", &size);
> +		addr = of_translate_address(bridge, prop);
> +	}
> +	addr += (TSI108_PB_OFFSET + 0x414);
> +
> +	ocn_bar1 = ioremap(addr, 0x4);
> +
> +	/* Turn on the BOOT bit so the addresses are correctly
> +	 * routed to the HLP interface */
> +	bar = ioread32be(ocn_bar1);
> +	bar |= 2;
> +	iowrite32be(bar, ocn_bar1);
> +	iosync();
> +
> +	/* Set SRR0 to the reset vector and turn on MSR_IP */
> +	mtspr(SPRN_SRR0, 0xfff00100);
> +	mtspr(SPRN_SRR1, MSR_IP);
> +
> +	/* Do an rfi to jump back to firmware.  Somewhat evil,
> +	 * but it works
> +	 */
> +	__asm__ __volatile__("rfi" : : : "memory");
> +
> +	/* Spin until reset happens.  Shouldn't really get here */
> +	for (;;) ;
> +}
> +
> +void holly_power_off(void)
> +{
> +	local_irq_disable();
> +	/* No way to shut power off with software */
> +	for (;;) ;
> +}
> +
> +void holly_halt(void)
> +{
> +	holly_power_off();
> +}
> +
> +/*
> + * Called very early, device-tree isn't unflattened
> + */
> +static int __init holly_probe(void)
> +{
> +	unsigned long root = of_get_flat_dt_root();
> +
> +	if (!of_flat_dt_is_compatible(root, "ppc750"))
> +		return 0;

This seems like to generic of a match.

> +	return 1;
> +}
> +
> +static int ppc750_machine_check_exception(struct pt_regs *regs)
> +{
> +	extern void tsi108_clear_pci_cfg_error(void);
> +	const struct exception_table_entry *entry;
> +
> +	/* Are we prepared to handle this fault */
> +	if ((entry = search_exception_tables(regs->nip)) != NULL) {
> +		tsi108_clear_pci_cfg_error();
> +		regs->msr |= MSR_RI;
> +		regs->nip = entry->fixup;
> +		return 1;
> +	}
> +	return 0;
> +}
> +
> +define_machine(holly){
> +	.name 						= "PPC750 GX/CL TSI",
> +	.probe 						= holly_probe,
> +	.setup_arch 				= holly_setup_arch,
> +	.init_IRQ 					= holly_init_IRQ,
> +	.show_cpuinfo 				= holly_show_cpuinfo,
> +	.get_irq 					= mpic_get_irq,
> +	.restart 					= holly_restart,
> +	.calibrate_decr 			= generic_calibrate_decr,
> +	.machine_check_exception	= ppc750_machine_check_exception,
> +	.progress 					= udbg_progress,
> +};
> --- /dev/null
> +++ linux-2.6/arch/powerpc/platforms/embedded6xx/holly.h
> @@ -0,0 +1,24 @@
> +/*
> + * Definitions for the IBM 750GX/CL platform w/ TSI10x bridge
> + *
> + * Copyright 2007 IBM Corporation
> + *
> + * Stephen Winiecki <stevewin@us.ibm.com>
> + * Josh Boyer <jwboyer@linux.vnet.ibm.com>
> + *
> + * Based on code from mpc7448_hpc2.h
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License
> + * version 2 as published by the Free Software Foundation.
> + */
> +
> +#ifndef __PPC_PLATFORMS_PPC750GXCL_TSI_H
> +#define __PPC_PLATFORMS_PPC750GXCL_TSI_H
> +
> +#include <asm/ppcboot.h>
> +
> +/* Base Addresses for the PCI bus
> + */
> +#define PPC750GXCL_TSI_PCI_MEM_OFFSET	(0x00000000)
> +#endif				/* __PPC_PLATFORMS_H */
> --- linux-2.6.orig/drivers/net/tsi108_eth.h
> +++ linux-2.6/drivers/net/tsi108_eth.h
> @@ -49,7 +49,11 @@
>   */
>  #define PHY_MV88E	1	/* Marvel 88Exxxx PHY */
>  #define PHY_BCM54XX	2	/* Broardcom BCM54xx PHY */
> +#if defined(CONFIG_HOLLY)
> +#define TSI108_PHY_TYPE PHY_BCM54XX
> +#else
>  #define TSI108_PHY_TYPE	PHY_MV88E
> +#endif

This seems pretty bad.  Can we at least make this some type of kernel  
config since I'm guessing the tsi108 isn't using the phylib.

>  /*
>   * TSI108 GIGE port registers
> --- linux-2.6.orig/include/asm-powerpc/tsi108.h
> +++ linux-2.6/include/asm-powerpc/tsi108.h
> @@ -68,7 +68,11 @@
>  #define TSI108_PB_ERRCS_ES		(1 << 1)
>  #define TSI108_PB_ISR_PBS_RD_ERR	(1 << 8)
>
> +#ifdef CONFIG_HOLLY
> +#define TSI108_PCI_CFG_BASE_PHYS	(0x7c000000)
> +#else
>  #define TSI108_PCI_CFG_BASE_PHYS	(0xfb000000)
> +#endif
>  #define TSI108_PCI_CFG_SIZE		(0x01000000)
>  /* Global variables */
>
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev

^ permalink raw reply

* Re: Correct location for ADC/DAC drivers
From: Robin Getz @ 2007-05-04 18:21 UTC (permalink / raw)
  To: Stefan Roese; +Cc: linuxppc-dev, linux-kernel
In-Reply-To: <200705041054.05650.ml@stefan-roese.de>

On Fri 4 May 2007 04:54, Stefan Roese pondered:
> On Friday 04 May 2007 10:24, Robert Schwebel wrote:
> > On Tue, May 01, 2007 at 02:35:44PM +0200, Stefan Roese wrote:
> > > I'm in the stage of integrating some ADC and DAC drivers for the AMCC
> > > 405EZ PPC and looking for the correct location to place these drivers
> > > in the Linux source tree. The drivers are basically character-drivers,
> > > so my first thought is to put them in "drivers/char/adc/foo.c" or
> > > "drivers/char/adc_foo.c". Is this a good solution?
> > >
> > > Any suggestions welcome (could be that I missed an already existing
> > > example).
> > >
> > > BTW: I am aware of the hwmon subsystem, but I don't think it fits my
> > > needs in this case.
> >
> > Could you elaborate the requirements a bit more? ADC is not ADC, because
> > slow i2c ADCs which measure a temperature every five minutes have other
> > requirements than multi-megabyte-per-second-dma-driven ADCs.
>
> The hardware (PPC405EZ) actually implements an high speed, dma capable, ADC
> controller with 10-bit resolution and up to 4MHz sample rate. The current
> driver doesn't support all these features though (dma is not supported
> right now for example). Could be that this will be added in future
> releases. It would be good though, to have the driver located at the
> "correct" place in the kernel tree right away.

We also have DAC and ADC drivers (up to 16 bits @ 64MS/s, via DMA), that would 
be nice to put in the "right" place  - I don't think that drivers/char is the 
right place, nor drivers/misc - I also don't think that /adc is a descriptive 
place for DAC or mixed signal front ends (MxFE).

What about /drivers/char/daq or just drivers/daq - drivers for 
non-PCI/USB/ISA/PCMCIA Data Acquisition Hardware, D/A and A/D converters, 
Analog Front ends, etc.

I think that is the common TLA - at least according to 
http://en.wikipedia.org/wiki/Data_acquisition

?

-Robin

^ permalink raw reply

* [PATCH 4/4] Holly bootwrapper
From: Josh Boyer @ 2007-05-04 18:16 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <1178302414.3026.202.camel@zod.rchland.ibm.com>

Add Holly/Hickory bootwrapper

Signed-off-by: Stephen Winiecki <stevewin@us.ibm.com>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
---
 arch/powerpc/boot/Makefile |    9 ++++++++-
 arch/powerpc/boot/holly.c  |   38 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 46 insertions(+), 1 deletion(-)

--- linux-2.6.orig/arch/powerpc/boot/Makefile
+++ linux-2.6/arch/powerpc/boot/Makefile
@@ -43,7 +43,7 @@ $(addprefix $(obj)/,$(zlib) main.o): $(a
 src-wlib := string.S crt0.S stdio.c main.c flatdevtree.c flatdevtree_misc.c \
 		ns16550.c serial.c simple_alloc.c div64.S util.S \
 		gunzip_util.c elf_util.c $(zlib) devtree.c
-src-plat := of.c cuboot-83xx.c cuboot-85xx.c
+src-plat := of.c cuboot-83xx.c cuboot-85xx.c holly.c
 src-boot := $(src-wlib) $(src-plat) empty.c
 
 src-boot := $(addprefix $(obj)/, $(src-boot))
@@ -131,6 +131,7 @@ image-$(CONFIG_PPC_EFIKA)		+= zImage.chr
 image-$(CONFIG_PPC_PMAC)		+= zImage.pmac
 image-$(CONFIG_PPC_83xx)		+= cuImage.83xx
 image-$(CONFIG_PPC_85xx)		+= cuImage.85xx
+image-$(CONFIG_HOLLY)			+= zImage.holly-elf
 image-$(CONFIG_DEFAULT_UIMAGE)		+= uImage
 
 # For 32-bit powermacs, build the COFF and miboot images
@@ -161,6 +162,12 @@ $(obj)/zImage.ps3: vmlinux
 $(obj)/zImage.initrd.ps3: vmlinux
 	@echo "  WARNING zImage.initrd.ps3 not supported (yet)"
 
+$(obj)/zImage.holly-elf: vmlinux $(wrapperbits)
+	$(call if_changed,wrap,holly,$(obj)/dts/holly.dts,,)
+
+$(obj)/zImage.initrd.holly-elf: vmlinux $(wrapperbits) $(obj)/ramdisk.image.gz
+	$(call if_changed,wrap,holly,$(obj)/dts/holly.dts,,$(obj)/ramdisk.image.gz)
+
 $(obj)/uImage: vmlinux $(wrapperbits)
 	$(call if_changed,wrap,uboot)
 
--- /dev/null
+++ linux-2.6/arch/powerpc/boot/holly.c
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2007 IBM Corporation
+ *
+ * Stephen Winiecki <stevewin@us.ibm.com>
+ * Josh Boyer <jwboyer@linux.vnet.ibm.com>
+ *
+ * Based on earlier code:
+ * Copyright (C) Paul Mackerras 1997.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ */
+#include <stdarg.h>
+#include <stddef.h>
+#include "types.h"
+#include "elf.h"
+#include "string.h"
+#include "stdio.h"
+#include "page.h"
+#include "ops.h"
+#include "io.h"
+
+extern char _start[];
+extern char _end[];
+extern char _dtb_start[];
+extern char _dtb_end[];
+
+BSS_STACK(4096);
+
+void platform_init(unsigned long r3, unsigned long r4, unsigned long r5)
+{
+	u32 heapsize = 0x8000000 - (u32)_end; /* 128M */
+
+	simple_alloc_init(_end, heapsize, 32, 64);
+	ft_init(_dtb_start, 0, 4);
+	serial_console_init();
+}

^ permalink raw reply

* [PATCH 3/4] Holly DTS
From: Josh Boyer @ 2007-05-04 18:16 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <1178302414.3026.202.camel@zod.rchland.ibm.com>

Add Holly/Hickory DTS file

Signed-off-by: Stephen Winiecki <stevewin@us.ibm.com>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
---
 arch/powerpc/boot/dts/holly.dts |  229 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 229 insertions(+)

--- /dev/null
+++ linux-2.6/arch/powerpc/boot/dts/holly.dts
@@ -0,0 +1,229 @@
+/*
+ * Device Tree Source for IBM Holly/Hickory (PPC 750CL/GX with TSI controller)
+ * Copyright 2007, IBM Corporation
+ *
+ * Stephen Winiecki <stevewin@us.ibm.com>
+ * Josh Boyer <jwboyer@linux.vnet.ibm.com>
+ *
+ * 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.
+ *
+ * To build:
+ *   dtc -I dts -O asm -o holly.S -b 0 holly.dts
+ *   dtc -I dts -O dtb -o holly.dtb -b 0 holly.dts
+ */
+
+/ {
+	model = "ppc750-tsi109";
+	compatible = "ppc750";
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	cpus {
+		name = "cpus";
+		#address-cells = <1>;
+		#size-cells =<0>;
+		PowerPC,750@0 {
+			name = "PowerPC,750";
+			device_type = "cpu";
+			reg = <0>;
+			d-cache-line-size = <20>;
+			i-cache-line-size = <20>;
+			d-cache-size = <8000>;
+			i-cache-size = <8000>;
+			d-cache-sets = <80>;
+			i-cache-sets = <80>;
+			timebase-frequency = <2faf080>;
+			clock-frequency = <23c34600>;
+			bus-frequency = <bebc200>;
+			32-bit;
+		};
+	};
+
+	memory@0 {
+		name = "memory";
+		device_type = "memory";
+		reg = <00000000 20000000>;
+	};
+
+  	tsi109@c0000000 {
+		name = "tsi109";
+		device_type = "tsi-bridge";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges = <00000000 c0000000 00010000>;
+		reg = <c0000000 00010000>;
+		bus-frequency = <0>;
+
+		i2c@7000 {
+			name = "i2c";
+			device_type = "i2c";
+			compatible  = "tsi-i2c";
+			interrupt-parent = < &/tsi109@c0000000/pic@7400 >;
+			interrupts = <e 2>;
+			reg = <7000 400>;
+		};
+
+		mdio@6000 {
+			name = "mdio";
+			device_type = "mdio";
+			compatible = "tsi-ethernet";
+			ethernet-phy@6000 {
+				name = "ethernet-phy";
+				device_type = "ethernet-phy";
+				reg = <6000 50>;
+				phy-id = <1>;
+				linux,phandle = <421>;
+			};
+			ethernet-phy@6400 {
+				name = "ethernet-phy";
+				device_type = "ethernet-phy";
+				reg = <6000 50>;
+				phy-id = <2>;
+				linux,phandle = <422>;
+			};
+		};
+
+		ethernet@6200 {
+			name = "ethernet";
+			device_type = "network";
+			compatible = "tsi-ethernet";
+			model = "TSI-ETH";
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <6000 200>;
+			address = [ 00 0d 60 f4 3f 04 ];
+			interrupt-parent = < &/tsi109@c0000000/pic@7400 >;
+			interrupts = <10 2>;
+			phy-handle = <421>;
+		};
+
+		ethernet@6600 {
+			name = "ethernet";
+			device_type = "network";
+			compatible = "tsi-ethernet";
+			model = "TSI-ETH";
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <6400 200>;
+			address = [ 00 0d 60 f4 3f 05 ];
+			interrupt-parent = < &/tsi109@c0000000/pic@7400 >;
+			interrupts = <11 2>;
+			phy-handle = <422>;
+		};
+
+		serial@7808 {
+			name = "serial";
+			device_type = "serial";
+			compatible = "ns16550";
+			reg = <7808 200>;
+			virtual-reg = <c0007808>;
+			reg-shift = <0>;
+			clock-frequency = <3F9C6000>;
+			current-speed = <1c200>;
+			interrupt-parent = < &/tsi109@c0000000/pic@7400 >;
+			interrupts = <c 2>;
+		};
+
+		serial@7c08 {
+			name = "serial";
+			device_type = "serial";
+			compatible = "ns16550";
+			reg = <7c08 200>;
+			virtual-reg = <c0007c08>;
+			reg-shift = <0>;
+			clock-frequency = <3F9C6000>;
+			current-speed = <1c200>;
+			interrupt-parent = < &/tsi109@c0000000/pic@7400 >;
+			interrupts = <d 2>;
+		};
+
+	  	pic@7400 {
+			name = "pic";
+			device_type = "open-pic";
+			compatible = "chrp,open-pic";
+			interrupt-controller;
+			#interrupt-cells = <2>;
+			reg = <7400 400>;
+			built-in;
+			big-endian;
+		};
+
+		pci@1000 {
+			name = "pci";
+			device_type = "pci";
+			compatible = "tsi109";
+			#interrupt-cells = <1>;
+			#size-cells = <2>;
+			#address-cells = <3>;
+			reg = <1000 1000>;
+			bus-range = <0 0>;
+			/*----------------------------------------------------+
+			| PCI memory range.
+			| 01 denotes I/O space
+			| 02 denotes 32-bit memory space
+			+----------------------------------------------------*/
+			ranges = <02000000 0 40000000 40000000 0 10000000
+				  01000000 0 00000000 7e000000 0 00010000>;
+			clock-frequency = <7f28154>;
+			interrupt-parent = < &/tsi109@c0000000/pic@7400 >;
+			interrupts = <17 2>;
+			interrupt-map-mask = <f800 0 0 7>;
+			/*----------------------------------------------------+
+			| The INTA, INTB, INTC, INTD are shared.
+			+----------------------------------------------------*/
+			interrupt-map = <
+				/*--------------------------------------------+
+				| AD17.
+				+--------------------------------------------*/
+				0800 0 0 1 1180 24 0
+				0800 0 0 2 1180 25 0
+				0800 0 0 3 1180 26 0
+				0800 0 0 4 1180 27 0
+				/*--------------------------------------------+
+				| AD18.
+				+--------------------------------------------*/
+				1000 0 0 1 1180 25 0
+				1000 0 0 2 1180 26 0
+				1000 0 0 3 1180 27 0
+				1000 0 0 4 1180 24 0
+				/*--------------------------------------------+
+				| AD19.
+				+--------------------------------------------*/
+				1800 0 0 1 1180 26 0
+				1800 0 0 2 1180 27 0
+				1800 0 0 3 1180 24 0
+				1800 0 0 4 1180 25 0
+
+				2000 0 0 1 1180 27 0
+				2000 0 0 2 1180 24 0
+				2000 0 0 3 1180 25 0
+				2000 0 0 4 1180 26 0
+				>;
+
+			router@1180 {
+				name = "router";
+ 				device_type = "pic-router";
+				linux,phandle = <1180>;
+ 				interrupt-controller;
+ 				built-in;
+ 				big-endian;
+ 				clock-frequency = <0>;
+ 				#address-cells = <0>;
+ 				#interrupt-cells = <2>;
+ 				interrupts = <17 2>;
+				interrupt-parent = < &/tsi109@c0000000/pic@7400 >;
+			};
+		};
+	};
+
+	chosen {
+		name = "chosen";
+		linux,stdout-path = "/tsi109@c0000000/serial@7808";
+		bootargs = "console=ttyS0,115200";
+		linux,platform = <0>;
+		linux,initrd-start = <0>;
+		linux,initrd-end = <0>;
+	};
+};

^ permalink raw reply

* [PATCH 2/4] Holly defconfig
From: Josh Boyer @ 2007-05-04 18:15 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <1178302414.3026.202.camel@zod.rchland.ibm.com>

Holly/Hickory defconfig

Signed-off-by: Stephen Winiecki <stevewin@us.ibm.com>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
---
 arch/powerpc/configs/holly_defconfig | 1067 +++++++++++++++++++++++++++++++++++
 1 file changed, 1067 insertions(+)

--- /dev/null
+++ linux-2.6/arch/powerpc/configs/holly_defconfig
@@ -0,0 +1,1067 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.21
+# Mon Apr 30 12:51:49 2007
+#
+# CONFIG_PPC64 is not set
+CONFIG_PPC32=y
+CONFIG_PPC_MERGE=y
+CONFIG_MMU=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_IRQ_PER_CPU=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_ARCH_HAS_ILOG2_U32=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+CONFIG_PPC=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_GENERIC_NVRAM=y
+CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+CONFIG_PPC_OF=y
+CONFIG_PPC_UDBG_16550=y
+# CONFIG_GENERIC_TBSYNC is not set
+CONFIG_AUDIT_ARCH=y
+CONFIG_GENERIC_BUG=y
+# CONFIG_DEFAULT_UIMAGE is not set
+
+#
+# Processor support
+#
+CONFIG_CLASSIC32=y
+# CONFIG_PPC_82xx is not set
+# CONFIG_PPC_83xx is not set
+# CONFIG_PPC_85xx is not set
+# CONFIG_PPC_86xx is not set
+# CONFIG_PPC_8xx is not set
+# CONFIG_40x is not set
+# CONFIG_44x is not set
+# CONFIG_E200 is not set
+CONFIG_6xx=y
+CONFIG_PPC_FPU=y
+# CONFIG_PPC_DCR_NATIVE is not set
+# CONFIG_PPC_DCR_MMIO is not set
+# CONFIG_ALTIVEC is not set
+CONFIG_PPC_STD_MMU=y
+CONFIG_PPC_STD_MMU_32=y
+# CONFIG_SMP is not set
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+# CONFIG_IPC_NS is not set
+CONFIG_SYSVIPC_SYSCTL=y
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_UTS_NS is not set
+# CONFIG_AUDIT is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_SYSFS_DEPRECATED=y
+# CONFIG_RELAY is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SYSCTL=y
+CONFIG_EMBEDDED=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_SHMEM=y
+CONFIG_SLAB=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_RT_MUTEXES=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+# CONFIG_SLOB is not set
+
+#
+# Loadable module support
+#
+# CONFIG_MODULES is not set
+
+#
+# Block layer
+#
+CONFIG_BLOCK=y
+CONFIG_LBD=y
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+CONFIG_DEFAULT_AS=y
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="anticipatory"
+
+#
+# Platform support
+#
+# CONFIG_PPC_MULTIPLATFORM is not set
+CONFIG_EMBEDDED6xx=y
+# CONFIG_APUS is not set
+# CONFIG_PPC_MPC52xx is not set
+# CONFIG_PPC_MPC5200 is not set
+# CONFIG_PPC_CELL is not set
+# CONFIG_PPC_CELL_NATIVE is not set
+# CONFIG_PQ2ADS is not set
+# CONFIG_LINKSTATION is not set
+# CONFIG_MPC7448HPC2 is not set
+CONFIG_HOLLY=y
+CONFIG_TSI108_BRIDGE=y
+CONFIG_MPIC=y
+CONFIG_MPIC_WEIRD=y
+# CONFIG_PPC_I8259 is not set
+# CONFIG_PPC_RTAS is not set
+# CONFIG_MMIO_NVRAM is not set
+# CONFIG_PPC_MPC106 is not set
+# CONFIG_PPC_970_NAP is not set
+# CONFIG_PPC_INDIRECT_IO is not set
+# CONFIG_GENERIC_IOMAP is not set
+
+#
+# CPU Frequency support
+#
+# CONFIG_CPU_FREQ is not set
+# CONFIG_TAU is not set
+# CONFIG_CPM2 is not set
+
+#
+# Kernel options
+#
+# CONFIG_HIGHMEM is not set
+# CONFIG_HZ_100 is not set
+CONFIG_HZ_250=y
+# CONFIG_HZ_300 is not set
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=250
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+CONFIG_BINFMT_ELF=y
+CONFIG_BINFMT_MISC=y
+CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_POPULATES_NODE_MAP=y
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4
+# CONFIG_RESOURCES_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_PROC_DEVICETREE=y
+# CONFIG_CMDLINE_BOOL is not set
+# CONFIG_PM is not set
+# CONFIG_SECCOMP is not set
+# CONFIG_WANT_DEVICE_TREE is not set
+CONFIG_ISA_DMA_API=y
+
+#
+# Bus options
+#
+CONFIG_ZONE_DMA=y
+CONFIG_GENERIC_ISA_DMA=y
+# CONFIG_PPC_INDIRECT_PCI is not set
+CONFIG_PCI=y
+CONFIG_PCI_DOMAINS=y
+# CONFIG_PCIEPORTBUS is not set
+# CONFIG_PCI_DEBUG is not set
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+# CONFIG_PCCARD is not set
+
+#
+# PCI Hotplug Support
+#
+# CONFIG_HOTPLUG_PCI is not set
+
+#
+# Advanced setup
+#
+# CONFIG_ADVANCED_OPTIONS is not set
+
+#
+# Default settings for advanced configuration options are used
+#
+CONFIG_HIGHMEM_START=0xfe000000
+CONFIG_LOWMEM_SIZE=0x30000000
+CONFIG_KERNEL_START=0xc0000000
+CONFIG_TASK_SIZE=0x80000000
+CONFIG_BOOT_LOAD=0x00800000
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+# CONFIG_NETDEBUG is not set
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+CONFIG_XFRM_USER=y
+# CONFIG_XFRM_SUB_POLICY is not set
+# CONFIG_XFRM_MIGRATE is not set
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_IP_MROUTE is not set
+# CONFIG_ARPD is not set
+CONFIG_SYN_COOKIES=y
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+# CONFIG_INET_TUNNEL is not set
+CONFIG_INET_XFRM_MODE_TRANSPORT=y
+CONFIG_INET_XFRM_MODE_TUNNEL=y
+CONFIG_INET_XFRM_MODE_BEET=y
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
+# CONFIG_IPV6 is not set
+# CONFIG_INET6_XFRM_TUNNEL is not set
+# CONFIG_INET6_TUNNEL is not set
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NETFILTER is not set
+
+#
+# DCCP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_DCCP is not set
+
+#
+# SCTP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_SCTP is not set
+
+#
+# TIPC Configuration (EXPERIMENTAL)
+#
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+
+#
+# QoS and/or fair queueing
+#
+# CONFIG_NET_SCHED is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_IEEE80211 is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+# CONFIG_FW_LOADER is not set
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
+# CONFIG_SYS_HYPERVISOR is not set
+
+#
+# Connector - unified userspace <-> kernelspace linker
+#
+# CONFIG_CONNECTOR is not set
+
+#
+# Memory Technology Devices (MTD)
+#
+# CONFIG_MTD is not set
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
+# Plug and Play support
+#
+# CONFIG_PNPACPI is not set
+
+#
+# Block devices
+#
+# CONFIG_BLK_DEV_FD is not set
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=y
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_SX8 is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=131072
+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+
+#
+# Misc devices
+#
+# CONFIG_SGI_IOC4 is not set
+# CONFIG_TIFM_CORE is not set
+
+#
+# ATA/ATAPI/MFM/RLL support
+#
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+CONFIG_SCSI=y
+# CONFIG_SCSI_TGT is not set
+# CONFIG_SCSI_NETLINK is not set
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=y
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
+# CONFIG_BLK_DEV_SR is not set
+# CONFIG_CHR_DEV_SG is not set
+# CONFIG_CHR_DEV_SCH is not set
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+# CONFIG_SCSI_MULTI_LUN is not set
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+# CONFIG_SCSI_SCAN_ASYNC is not set
+
+#
+# SCSI Transports
+#
+# CONFIG_SCSI_SPI_ATTRS is not set
+# CONFIG_SCSI_FC_ATTRS is not set
+# CONFIG_SCSI_ISCSI_ATTRS is not set
+# CONFIG_SCSI_SAS_ATTRS is not set
+# CONFIG_SCSI_SAS_LIBSAS is not set
+
+#
+# SCSI low-level drivers
+#
+# CONFIG_ISCSI_TCP is not set
+# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
+# CONFIG_SCSI_3W_9XXX is not set
+# CONFIG_SCSI_ACARD is not set
+# CONFIG_SCSI_AACRAID is not set
+# CONFIG_SCSI_AIC7XXX is not set
+# CONFIG_SCSI_AIC7XXX_OLD is not set
+# CONFIG_SCSI_AIC79XX is not set
+# CONFIG_SCSI_AIC94XX is not set
+# CONFIG_SCSI_DPT_I2O is not set
+# CONFIG_SCSI_ARCMSR is not set
+# CONFIG_MEGARAID_NEWGEN is not set
+# CONFIG_MEGARAID_LEGACY is not set
+# CONFIG_MEGARAID_SAS is not set
+# CONFIG_SCSI_HPTIOP is not set
+# CONFIG_SCSI_BUSLOGIC is not set
+# CONFIG_SCSI_DMX3191D is not set
+# CONFIG_SCSI_EATA is not set
+# CONFIG_SCSI_FUTURE_DOMAIN is not set
+# CONFIG_SCSI_GDTH is not set
+# CONFIG_SCSI_IPS is not set
+# CONFIG_SCSI_INITIO is not set
+# CONFIG_SCSI_INIA100 is not set
+# CONFIG_SCSI_STEX is not set
+# CONFIG_SCSI_SYM53C8XX_2 is not set
+# CONFIG_SCSI_IPR is not set
+# CONFIG_SCSI_QLOGIC_1280 is not set
+# CONFIG_SCSI_QLA_FC is not set
+# CONFIG_SCSI_QLA_ISCSI is not set
+# CONFIG_SCSI_LPFC is not set
+# CONFIG_SCSI_DC395x is not set
+# CONFIG_SCSI_DC390T is not set
+# CONFIG_SCSI_NSP32 is not set
+# CONFIG_SCSI_DEBUG is not set
+# CONFIG_SCSI_SRP is not set
+
+#
+# Serial ATA (prod) and Parallel ATA (experimental) drivers
+#
+CONFIG_ATA=y
+# CONFIG_ATA_NONSTANDARD is not set
+# CONFIG_SATA_AHCI is not set
+# CONFIG_SATA_SVW is not set
+# CONFIG_ATA_PIIX is not set
+CONFIG_SATA_MV=y
+# CONFIG_SATA_NV is not set
+# CONFIG_PDC_ADMA is not set
+# CONFIG_SATA_QSTOR is not set
+# CONFIG_SATA_PROMISE is not set
+# CONFIG_SATA_SX4 is not set
+# CONFIG_SATA_SIL is not set
+# CONFIG_SATA_SIL24 is not set
+# CONFIG_SATA_SIS is not set
+# CONFIG_SATA_ULI is not set
+# CONFIG_SATA_VIA is not set
+# CONFIG_SATA_VITESSE is not set
+# CONFIG_SATA_INIC162X is not set
+# CONFIG_PATA_ALI is not set
+# CONFIG_PATA_AMD is not set
+# CONFIG_PATA_ARTOP is not set
+# CONFIG_PATA_ATIIXP is not set
+# CONFIG_PATA_CMD64X is not set
+# CONFIG_PATA_CS5520 is not set
+# CONFIG_PATA_CS5530 is not set
+# CONFIG_PATA_CYPRESS is not set
+# CONFIG_PATA_EFAR is not set
+# CONFIG_ATA_GENERIC is not set
+# CONFIG_PATA_HPT366 is not set
+# CONFIG_PATA_HPT37X is not set
+# CONFIG_PATA_HPT3X2N is not set
+# CONFIG_PATA_HPT3X3 is not set
+# CONFIG_PATA_IT821X is not set
+# CONFIG_PATA_IT8213 is not set
+# CONFIG_PATA_JMICRON is not set
+# CONFIG_PATA_TRIFLEX is not set
+# CONFIG_PATA_MARVELL is not set
+# CONFIG_PATA_MPIIX is not set
+# CONFIG_PATA_OLDPIIX is not set
+# CONFIG_PATA_NETCELL is not set
+# CONFIG_PATA_NS87410 is not set
+# CONFIG_PATA_OPTI is not set
+# CONFIG_PATA_OPTIDMA is not set
+# CONFIG_PATA_PDC_OLD is not set
+# CONFIG_PATA_RADISYS is not set
+# CONFIG_PATA_RZ1000 is not set
+# CONFIG_PATA_SC1200 is not set
+# CONFIG_PATA_SERVERWORKS is not set
+# CONFIG_PATA_PDC2027X is not set
+# CONFIG_PATA_SIL680 is not set
+# CONFIG_PATA_SIS is not set
+# CONFIG_PATA_VIA is not set
+# CONFIG_PATA_WINBOND is not set
+# CONFIG_PATA_PLATFORM is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+
+#
+# Fusion MPT device support
+#
+# CONFIG_FUSION is not set
+# CONFIG_FUSION_SPI is not set
+# CONFIG_FUSION_FC is not set
+# CONFIG_FUSION_SAS is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+# CONFIG_IEEE1394 is not set
+
+#
+# I2O device support
+#
+# CONFIG_I2O is not set
+
+#
+# Macintosh device drivers
+#
+# CONFIG_MAC_EMUMOUSEBTN is not set
+# CONFIG_WINDFARM is not set
+
+#
+# Network device support
+#
+CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
+#
+# PHY device support
+#
+CONFIG_PHYLIB=y
+
+#
+# MII PHY device drivers
+#
+# CONFIG_MARVELL_PHY is not set
+# CONFIG_DAVICOM_PHY is not set
+# CONFIG_QSEMI_PHY is not set
+# CONFIG_LXT_PHY is not set
+# CONFIG_CICADA_PHY is not set
+# CONFIG_VITESSE_PHY is not set
+# CONFIG_SMSC_PHY is not set
+# CONFIG_BROADCOM_PHY is not set
+# CONFIG_FIXED_PHY is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_CASSINI is not set
+# CONFIG_NET_VENDOR_3COM is not set
+
+#
+# Tulip family network device support
+#
+# CONFIG_NET_TULIP is not set
+# CONFIG_HP100 is not set
+# CONFIG_NET_PCI is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+# CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+# CONFIG_E1000 is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_R8169 is not set
+# CONFIG_SIS190 is not set
+# CONFIG_SKGE is not set
+# CONFIG_SKY2 is not set
+# CONFIG_SK98LIN is not set
+# CONFIG_TIGON3 is not set
+# CONFIG_BNX2 is not set
+CONFIG_TSI108_ETH=y
+# CONFIG_QLA3XXX is not set
+# CONFIG_ATL1 is not set
+
+#
+# Ethernet (10000 Mbit)
+#
+# CONFIG_CHELSIO_T1 is not set
+# CONFIG_CHELSIO_T3 is not set
+# CONFIG_IXGB is not set
+# CONFIG_S2IO is not set
+# CONFIG_MYRI10GE is not set
+# CONFIG_NETXEN_NIC is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_NET_FC is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Telephony Support
+#
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
+
+#
+# Userland interfaces
+#
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_TSDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+# CONFIG_INPUT_KEYBOARD is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+# CONFIG_SERIO is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+# CONFIG_VT is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+# CONFIG_SERIAL_8250_PCI is not set
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+CONFIG_SERIAL_8250_EXTENDED=y
+# CONFIG_SERIAL_8250_MANY_PORTS is not set
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+# CONFIG_SERIAL_8250_DETECT_IRQ is not set
+# CONFIG_SERIAL_8250_RSA is not set
+
+#
+# Non-8250 serial port support
+#
+# CONFIG_SERIAL_UARTLITE is not set
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_JSM is not set
+CONFIG_SERIAL_OF_PLATFORM=y
+CONFIG_UNIX98_PTYS=y
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_NVRAM is not set
+CONFIG_GEN_RTC=y
+# CONFIG_GEN_RTC_X is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+# CONFIG_RAW_DRIVER is not set
+
+#
+# TPM devices
+#
+# CONFIG_TCG_TPM is not set
+
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#
+# SPI support
+#
+# CONFIG_SPI is not set
+# CONFIG_SPI_MASTER is not set
+
+#
+# Dallas's 1-wire bus
+#
+# CONFIG_W1 is not set
+
+#
+# Hardware Monitoring support
+#
+CONFIG_HWMON=y
+# CONFIG_HWMON_VID is not set
+# CONFIG_SENSORS_ABITUGURU is not set
+# CONFIG_SENSORS_F71805F is not set
+# CONFIG_SENSORS_PC87427 is not set
+# CONFIG_SENSORS_VT1211 is not set
+# CONFIG_HWMON_DEBUG_CHIP is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_SM501 is not set
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+
+#
+# Digital Video Broadcasting Devices
+#
+# CONFIG_DVB is not set
+
+#
+# Graphics support
+#
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+# CONFIG_FB is not set
+# CONFIG_FB_IBM_GXT4500 is not set
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# HID Devices
+#
+CONFIG_HID=y
+# CONFIG_HID_DEBUG is not set
+
+#
+# USB support
+#
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB_ARCH_HAS_EHCI=y
+# CONFIG_USB is not set
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET is not set
+
+#
+# MMC/SD Card support
+#
+# CONFIG_MMC is not set
+
+#
+# LED devices
+#
+# CONFIG_NEW_LEDS is not set
+
+#
+# LED drivers
+#
+
+#
+# LED Triggers
+#
+
+#
+# InfiniBand support
+#
+# CONFIG_INFINIBAND is not set
+
+#
+# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
+#
+
+#
+# Real Time Clock
+#
+# CONFIG_RTC_CLASS is not set
+
+#
+# DMA Engine support
+#
+# CONFIG_DMA_ENGINE is not set
+
+#
+# DMA Clients
+#
+
+#
+# DMA Devices
+#
+
+#
+# Auxiliary Display support
+#
+
+#
+# Virtualization
+#
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS_XATTR is not set
+# CONFIG_EXT2_FS_XIP is not set
+CONFIG_EXT3_FS=y
+CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_POSIX_ACL is not set
+# CONFIG_EXT3_FS_SECURITY is not set
+# CONFIG_EXT4DEV_FS is not set
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_FS_POSIX_ACL is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_GFS2_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_ROMFS_FS is not set
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+# CONFIG_QUOTA is not set
+CONFIG_DNOTIFY=y
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+# CONFIG_MSDOS_FS is not set
+# CONFIG_VFAT_FS is not set
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_RAMFS=y
+# CONFIG_CONFIGFS_FS is not set
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+
+#
+# Network File Systems
+#
+CONFIG_NFS_FS=y
+# CONFIG_NFS_V3 is not set
+# CONFIG_NFS_V4 is not set
+# CONFIG_NFS_DIRECTIO is not set
+# CONFIG_NFSD is not set
+CONFIG_ROOT_NFS=y
+CONFIG_LOCKD=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+# CONFIG_RPCSEC_GSS_KRB5 is not set
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
+# CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+# CONFIG_9P_FS is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+
+#
+# Native Language Support
+#
+# CONFIG_NLS is not set
+
+#
+# Distributed Lock Manager
+#
+# CONFIG_DLM is not set
+# CONFIG_UCC_SLOW is not set
+# CONFIG_UCC_FAST is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
+CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+
+#
+# Instrumentation Support
+#
+# CONFIG_PROFILING is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_UNUSED_SYMBOLS is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
+CONFIG_DEBUG_KERNEL=y
+# CONFIG_DEBUG_SHIRQ is not set
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_DETECT_SOFTLOCKUP=y
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_TIMER_STATS is not set
+# CONFIG_DEBUG_SLAB is not set
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_MUTEXES is not set
+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
+# CONFIG_DEBUG_KOBJECT is not set
+# CONFIG_DEBUG_BUGVERBOSE is not set
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_LIST is not set
+CONFIG_FORCED_INLINING=y
+# CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_FAULT_INJECTION is not set
+# CONFIG_DEBUG_STACKOVERFLOW is not set
+# CONFIG_DEBUG_STACK_USAGE is not set
+# CONFIG_DEBUG_PAGEALLOC is not set
+CONFIG_DEBUGGER=y
+CONFIG_XMON=y
+CONFIG_XMON_DEFAULT=y
+CONFIG_XMON_DISASSEMBLY=y
+# CONFIG_BDI_SWITCH is not set
+# CONFIG_BOOTX_TEXT is not set
+# CONFIG_PPC_EARLY_DEBUG is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+
+#
+# Cryptographic options
+#
+# CONFIG_CRYPTO is not set

^ permalink raw reply

* [PATCH 1/4] Add support for 750CL Holly board
From: Josh Boyer @ 2007-05-04 18:14 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <1178302414.3026.202.camel@zod.rchland.ibm.com>

Add PowerPC 750 Holly/Hickory platform support

Signed-off-by: Stephen Winiecki <stevewin@us.ibm.com>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
---
 arch/powerpc/Kconfig                        |    2 
 arch/powerpc/platforms/embedded6xx/Kconfig  |   12 -
 arch/powerpc/platforms/embedded6xx/Makefile |    1 
 arch/powerpc/platforms/embedded6xx/holly.c  |  326 ++++++++++++++++++++++++++++
 arch/powerpc/platforms/embedded6xx/holly.h  |   24 ++
 drivers/net/tsi108_eth.h                    |    4 
 include/asm-powerpc/tsi108.h                |    4 
 7 files changed, 371 insertions(+), 2 deletions(-)

--- linux-2.6.orig/arch/powerpc/Kconfig
+++ linux-2.6/arch/powerpc/Kconfig
@@ -659,7 +659,7 @@ config MCA
 config PCI
 	bool "PCI support" if 40x || CPM2 || PPC_83xx || PPC_85xx || PPC_86xx \
 		|| PPC_MPC52xx || (EMBEDDED && (PPC_PSERIES || PPC_ISERIES)) \
-		|| MPC7448HPC2 || PPC_PS3
+		|| MPC7448HPC2 || PPC_PS3 || HOLLY
 	default y if !40x && !CPM2 && !8xx && !APUS && !PPC_83xx \
 		&& !PPC_85xx && !PPC_86xx
 	default PCI_PERMEDIA if !4xx && !CPM2 && !8xx && APUS
--- linux-2.6.orig/arch/powerpc/platforms/embedded6xx/Kconfig
+++ linux-2.6/arch/powerpc/platforms/embedded6xx/Kconfig
@@ -25,11 +25,21 @@ config MPC7448HPC2
 	help
 	  Select MPC7448HPC2 if configuring for Freescale MPC7448HPC2 (Taiga)
 	  platform
+
+config HOLLY
+	bool "PPC750GX/CL with TSI10x bridge (Hickory/Holly)"
+	select TSI108_BRIDGE
+	select PPC_UDBG_16550
+	select MPIC
+	select MPIC_WEIRD
+	help
+	  Select HOLLY if configuring for an IBM 750GX/CL Eval
+	  Board with TSI108/9 bridge (Hickory/Holly)
 endchoice
 
 config TSI108_BRIDGE
 	bool
-	depends on MPC7448HPC2
+	depends on MPC7448HPC2 || HOLLY
 	default y
 
 config MPC10X_BRIDGE
--- linux-2.6.orig/arch/powerpc/platforms/embedded6xx/Makefile
+++ linux-2.6/arch/powerpc/platforms/embedded6xx/Makefile
@@ -3,3 +3,4 @@
 #
 obj-$(CONFIG_MPC7448HPC2)	+= mpc7448_hpc2.o
 obj-$(CONFIG_LINKSTATION)	+= linkstation.o ls_uart.o
+obj-$(CONFIG_HOLLY)		+= holly.o
--- /dev/null
+++ linux-2.6/arch/powerpc/platforms/embedded6xx/holly.c
@@ -0,0 +1,326 @@
+/*
+ * Board setup routines for the IBM 750GX/CL platform w/ TSI10x bridge
+ *
+ * Copyright 2007 IBM Corporation
+ *
+ * Stephen Winiecki <stevewin@us.ibm.com>
+ * Josh Boyer <jwboyer@linux.vnet.ibm.com>
+ *
+ * Based on code from mpc7448_hpc2.c
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ */
+
+#include <linux/stddef.h>
+#include <linux/kernel.h>
+#include <linux/pci.h>
+#include <linux/kdev_t.h>
+#include <linux/console.h>
+#include <linux/delay.h>
+#include <linux/irq.h>
+#include <linux/ide.h>
+#include <linux/seq_file.h>
+#include <linux/root_dev.h>
+#include <linux/serial.h>
+#include <linux/tty.h>
+#include <linux/serial_core.h>
+
+#include <asm/system.h>
+#include <asm/time.h>
+#include <asm/machdep.h>
+#include <asm/prom.h>
+#include <asm/udbg.h>
+#include <asm/tsi108.h>
+#include <asm/pci-bridge.h>
+#include <asm/reg.h>
+#include <mm/mmu_decl.h>
+#include "holly.h"
+#include <asm/tsi108_irq.h>
+#include <asm/mpic.h>
+#include <asm/of_platform.h>
+
+#undef DEBUG
+#ifdef DEBUG
+#define DBG(fmt...) do { printk(fmt); } while(0)
+#else
+#define DBG(fmt...) do { } while(0)
+#endif
+
+#ifndef CONFIG_PCI
+pci_dram_offset = PPC750GXCL_TSI_PCI_MEM_OFFSET;
+#endif
+
+extern int tsi108_setup_pci(struct device_node *dev);
+extern void tsi108_pci_int_init(struct device_node *node);
+extern void tsi108_irq_cascade(unsigned int irq, struct irq_desc *desc);
+
+int holly_exclude_device(u_char bus, u_char devfn)
+{
+	if (bus == 0 && PCI_SLOT(devfn) == 0)
+		return PCIBIOS_DEVICE_NOT_FOUND;
+	else
+		return PCIBIOS_SUCCESSFUL;
+}
+
+static void holly_remap_bridge(void)
+{
+	u32 lut_val, lut_addr = 0x900, misc_cfg;
+	int i;
+
+	printk(KERN_ERR "Remapping PCI bridge\n");
+
+	/* Re-init the PCI bridge and LUT registers to have mappings that don't
+	 * rely on PIBS */
+	for (i = 0; i < 31; i++) {
+		tsi108_write_reg(TSI108_PB_OFFSET + lut_addr, 0x00000201);
+		lut_addr += 4;
+		tsi108_write_reg(TSI108_PB_OFFSET + lut_addr, 0x0);
+		lut_addr += 4;
+	}
+
+	/* Reserve the last LUT entry for PCI I/O space */
+	tsi108_write_reg(TSI108_PB_OFFSET + lut_addr, 0x00000241);
+	lut_addr += 4;
+	tsi108_write_reg(TSI108_PB_OFFSET + lut_addr, 0x0);
+
+	/* Map PCI I/O space */
+	tsi108_write_reg(TSI108_PCI_OFFSET + 0x210, 0x0);
+	tsi108_write_reg(TSI108_PCI_OFFSET + 0x20c, 0x1);
+
+	/* Map PCI CFG space */
+	tsi108_write_reg(TSI108_PCI_OFFSET + 0x208, 0x0);
+	tsi108_write_reg(TSI108_PCI_OFFSET + 0x204, 0x7c000000 | 0x01);
+
+	/* We don't need MEM32 and PRM remapping so disable them */
+	tsi108_write_reg(TSI108_PCI_OFFSET + 0x214, 0x0);
+	tsi108_write_reg(TSI108_PCI_OFFSET + 0x220, 0x0);
+	tsi108_write_reg(TSI108_PCI_OFFSET + 0x230, 0x0);
+
+	/* Set P2O_BAR0 */
+	tsi108_write_reg(TSI108_PCI_OFFSET + 0x14, 0x0);
+	tsi108_write_reg(TSI108_PCI_OFFSET + 0x10, 0xc0000000);
+
+	/* Init the PCI LUTs to do no remapping */
+	lut_addr = 0x500;
+	lut_val = 0x00000002;
+
+	for (i = 0; i < 32; i++) {
+		tsi108_write_reg(TSI108_PCI_OFFSET + lut_addr, lut_val);
+		lut_addr += 4;
+		tsi108_write_reg(TSI108_PCI_OFFSET + lut_addr, 0x40000000);
+		lut_addr += 4;
+		lut_val += 0x02000000;
+	}
+	tsi108_write_reg(TSI108_PCI_OFFSET + 0x4c, 0x00007900);
+
+	/* Set 64-bit PCI bus address for system memory */
+	tsi108_write_reg(TSI108_PCI_OFFSET + 0x1c, 0x0);
+	tsi108_write_reg(TSI108_PCI_OFFSET + 0x18, 0x0);
+}
+
+static void __init holly_setup_arch(void)
+{
+	struct device_node *cpu;
+	struct device_node *np;
+
+	if (ppc_md.progress)
+		ppc_md.progress("holly_setup_arch():set_bridge", 0);
+
+	cpu = of_find_node_by_type(NULL, "cpu");
+	if (cpu != 0) {
+		const unsigned int *fp;
+
+		fp = of_get_property(cpu, "clock-frequency", NULL);
+		if (fp != 0)
+			loops_per_jiffy = *fp / HZ;
+		else
+			loops_per_jiffy = 50000000 / HZ;
+		of_node_put(cpu);
+	}
+	tsi108_csr_vir_base = get_vir_csrbase();
+
+	/* setup PCI host bridge */
+	holly_remap_bridge();
+#ifdef CONFIG_PCI
+	for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
+		tsi108_setup_pci(np);
+
+	ppc_md.pci_exclude_device = holly_exclude_device;
+	if (ppc_md.progress)
+		ppc_md.progress("tsi108: resources set", 0x100);
+#endif
+	printk(KERN_INFO "PPC750GX/CL Platform\n");
+}
+
+/*
+ * Interrupt setup and service.  Interrrupts on the holly come
+ * from the four external INT pins, PCI interrupts are routed via
+ * PCI interrupt control registers, it generates internal IRQ23
+ *
+ * Interrupt routing on the Holly Board:
+ * TSI108:PB_INT[0] -> CPU0:INT#
+ * TSI108:PB_INT[1] -> CPU0:MCP#
+ * TSI108:PB_INT[2] -> N/C
+ * TSI108:PB_INT[3] -> N/C
+ */
+static void __init holly_init_IRQ(void)
+{
+	struct mpic *mpic;
+	phys_addr_t mpic_paddr = 0;
+	struct device_node *tsi_pic;
+#ifdef CONFIG_PCI
+	unsigned int cascade_pci_irq;
+	struct device_node *tsi_pci;
+	struct device_node *cascade_node = NULL;
+#endif
+
+	tsi_pic = of_find_node_by_type(NULL, "open-pic");
+	if (tsi_pic) {
+		unsigned int size;
+		const void *prop = of_get_property(tsi_pic, "reg", &size);
+		mpic_paddr = of_translate_address(tsi_pic, prop);
+	}
+
+	if (mpic_paddr == 0) {
+		printk(KERN_ERR "%s: No tsi108 PIC found !\n", __func__);
+		return;
+	}
+
+	DBG("%s: tsi108 pic phys_addr = 0x%x\n", __func__, (u32) mpic_paddr);
+
+	mpic = mpic_alloc(tsi_pic, mpic_paddr,
+			MPIC_PRIMARY | MPIC_BIG_ENDIAN | MPIC_WANTS_RESET |
+			MPIC_SPV_EOI | MPIC_NO_PTHROU_DIS | MPIC_REGSET_TSI108,
+			24,
+			NR_IRQS-4, /* num_sources used */
+			"Tsi108_PIC");
+
+	BUG_ON(mpic == NULL);
+
+	mpic_assign_isu(mpic, 0, mpic_paddr + 0x100);
+
+	mpic_init(mpic);
+
+#ifdef CONFIG_PCI
+	tsi_pci = of_find_node_by_type(NULL, "pci");
+	if (tsi_pci == NULL) {
+		printk(KERN_ERR "%s: No tsi108 pci node found !\n", __func__);
+		return;
+	}
+
+	cascade_node = of_find_node_by_type(NULL, "pic-router");
+	if (cascade_node == NULL) {
+		printk(KERN_ERR "%s: No tsi108 pci cascade node found !\n", __func__);
+		return;
+	}
+
+	cascade_pci_irq = irq_of_parse_and_map(tsi_pci, 0);
+	DBG("%s: tsi108 cascade_pci_irq = 0x%x\n", __func__, (u32) cascade_pci_irq);
+	tsi108_pci_int_init(cascade_node);
+	set_irq_data(cascade_pci_irq, mpic);
+	set_irq_chained_handler(cascade_pci_irq, tsi108_irq_cascade);
+#endif
+	/* Configure MPIC outputs to CPU0 */
+	tsi108_write_reg(TSI108_MPIC_OFFSET + 0x30c, 0);
+	of_node_put(tsi_pic);
+}
+
+void holly_show_cpuinfo(struct seq_file *m)
+{
+	seq_printf(m, "vendor\t\t: IBM\n");
+	seq_printf(m, "machine\t\t: PPC750 GX/CL\n");
+}
+
+void holly_restart(char *cmd)
+{
+	unsigned long *ocn_bar1 = NULL;
+	unsigned long bar;
+	struct device_node *bridge = NULL;
+	const void *prop;
+	int size;
+	phys_addr_t addr = 0xc0000000;
+
+	local_irq_disable();
+
+	bridge = of_find_node_by_type(NULL, "tsi-bridge");
+	if (bridge) {
+		prop = of_get_property(bridge, "reg", &size);
+		addr = of_translate_address(bridge, prop);
+	}
+	addr += (TSI108_PB_OFFSET + 0x414);
+
+	ocn_bar1 = ioremap(addr, 0x4);
+
+	/* Turn on the BOOT bit so the addresses are correctly
+	 * routed to the HLP interface */
+	bar = ioread32be(ocn_bar1);
+	bar |= 2;
+	iowrite32be(bar, ocn_bar1);
+	iosync();
+
+	/* Set SRR0 to the reset vector and turn on MSR_IP */
+	mtspr(SPRN_SRR0, 0xfff00100);
+	mtspr(SPRN_SRR1, MSR_IP);
+
+	/* Do an rfi to jump back to firmware.  Somewhat evil,
+	 * but it works
+	 */
+	__asm__ __volatile__("rfi" : : : "memory");
+
+	/* Spin until reset happens.  Shouldn't really get here */
+	for (;;) ;
+}
+
+void holly_power_off(void)
+{
+	local_irq_disable();
+	/* No way to shut power off with software */
+	for (;;) ;
+}
+
+void holly_halt(void)
+{
+	holly_power_off();
+}
+
+/*
+ * Called very early, device-tree isn't unflattened
+ */
+static int __init holly_probe(void)
+{
+	unsigned long root = of_get_flat_dt_root();
+
+	if (!of_flat_dt_is_compatible(root, "ppc750"))
+		return 0;
+	return 1;
+}
+
+static int ppc750_machine_check_exception(struct pt_regs *regs)
+{
+	extern void tsi108_clear_pci_cfg_error(void);
+	const struct exception_table_entry *entry;
+
+	/* Are we prepared to handle this fault */
+	if ((entry = search_exception_tables(regs->nip)) != NULL) {
+		tsi108_clear_pci_cfg_error();
+		regs->msr |= MSR_RI;
+		regs->nip = entry->fixup;
+		return 1;
+	}
+	return 0;
+}
+
+define_machine(holly){
+	.name 						= "PPC750 GX/CL TSI",
+	.probe 						= holly_probe,
+	.setup_arch 				= holly_setup_arch,
+	.init_IRQ 					= holly_init_IRQ,
+	.show_cpuinfo 				= holly_show_cpuinfo,
+	.get_irq 					= mpic_get_irq,
+	.restart 					= holly_restart,
+	.calibrate_decr 			= generic_calibrate_decr,
+	.machine_check_exception	= ppc750_machine_check_exception,
+	.progress 					= udbg_progress,
+};
--- /dev/null
+++ linux-2.6/arch/powerpc/platforms/embedded6xx/holly.h
@@ -0,0 +1,24 @@
+/*
+ * Definitions for the IBM 750GX/CL platform w/ TSI10x bridge
+ *
+ * Copyright 2007 IBM Corporation
+ *
+ * Stephen Winiecki <stevewin@us.ibm.com>
+ * Josh Boyer <jwboyer@linux.vnet.ibm.com>
+ *
+ * Based on code from mpc7448_hpc2.h
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ */
+
+#ifndef __PPC_PLATFORMS_PPC750GXCL_TSI_H
+#define __PPC_PLATFORMS_PPC750GXCL_TSI_H
+
+#include <asm/ppcboot.h>
+
+/* Base Addresses for the PCI bus
+ */
+#define PPC750GXCL_TSI_PCI_MEM_OFFSET	(0x00000000)
+#endif				/* __PPC_PLATFORMS_H */
--- linux-2.6.orig/drivers/net/tsi108_eth.h
+++ linux-2.6/drivers/net/tsi108_eth.h
@@ -49,7 +49,11 @@
  */
 #define PHY_MV88E	1	/* Marvel 88Exxxx PHY */
 #define PHY_BCM54XX	2	/* Broardcom BCM54xx PHY */
+#if defined(CONFIG_HOLLY)
+#define TSI108_PHY_TYPE PHY_BCM54XX
+#else
 #define TSI108_PHY_TYPE	PHY_MV88E
+#endif
 
 /*
  * TSI108 GIGE port registers
--- linux-2.6.orig/include/asm-powerpc/tsi108.h
+++ linux-2.6/include/asm-powerpc/tsi108.h
@@ -68,7 +68,11 @@
 #define TSI108_PB_ERRCS_ES		(1 << 1)
 #define TSI108_PB_ISR_PBS_RD_ERR	(1 << 8)
 
+#ifdef CONFIG_HOLLY
+#define TSI108_PCI_CFG_BASE_PHYS	(0x7c000000)
+#else
 #define TSI108_PCI_CFG_BASE_PHYS	(0xfb000000)
+#endif
 #define TSI108_PCI_CFG_SIZE		(0x01000000)
 /* Global variables */
 

^ permalink raw reply

* [PATCH 0/4] Add support for 750CL Holly board
From: Josh Boyer @ 2007-05-04 18:13 UTC (permalink / raw)
  To: linuxppc-dev

Hi All,

This is the initial round of support for the 750CL Holly eval board.  It
should also work for the 750GX Hickory board as well.  Overall this is
mostly ready to go, but I'm still fighting a minor issue with PCI.  I
wanted to get this put out for review while I fix that.

Comments welcome.

thx,
josh

^ permalink raw reply

* PATCH: free mm if spufs_fill_dir() failed
From: Sebastian Siewior @ 2007-05-04 17:27 UTC (permalink / raw)
  To: linuxppc-dev

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




[-- Attachment #2: spufs-free_mm.diff --]
[-- Type: text/plain, Size: 592 bytes --]


In case spufs_fill_dir() fails only put_spu_context() 
gets called for cleanup and the acquired mm_struct never gets freed.

Signed-off-by: Sebastian Siewior <bigeasy@linux.vnet.ibm.com>
Index: ps3-linux/arch/powerpc/platforms/cell/spufs/inode.c
===================================================================
--- ps3-linux.orig/arch/powerpc/platforms/cell/spufs/inode.c
+++ ps3-linux/arch/powerpc/platforms/cell/spufs/inode.c
@@ -277,6 +277,7 @@ spufs_mkdir(struct inode *dir, struct de
 	goto out;
 
 out_free_ctx:
+	spu_forget(ctx);
 	put_spu_context(ctx);
 out_iput:
 	iput(inode);


^ permalink raw reply

* BUG: spufs_prune_dir() / spufs_fill_dir() error handling
From: Sebastian Siewior @ 2007-05-04 17:27 UTC (permalink / raw)
  To: linuxppc-dev

If d_alloc_name() fails in spufs_fill_dir() spufs_prune_dir(dir) gets
called. dir->inode is still NULL and used.

Sebastian

^ permalink raw reply

* Re: zImage.elf loads but does not start
From: Andrei Konovalov @ 2007-05-04 15:41 UTC (permalink / raw)
  To: Mirek23; +Cc: linuxppc-embedded
In-Reply-To: <10323147.post@talk.nabble.com>

Mirek23 wrote:
> I came to the point with my kernel 2.6 (patched by Grant)  struggle on ml403
> that it reaches the 
> stage to mount nfs root file system from the computer which is on another
> segment  of the network:
> 
> [    2.565946] eth%d: XTemac: PHY detected at address 3.
> [    2.629348] eth0: Xilinx TEMAC #0 at 0x81200000 mapped to 0xC5020000,rq=1
> [    2.713113] eth0: XTemac id 1.0f, block id 5, type 8
> [    2.774335] mice: PS/2 mouse device common for all mice
> [    2.837152] TCP cubic registered
> [    2.876220] NET: Registered protocol family 1
> [    2.928569] NET: Registered protocol family 17
> [    3.485990] eth0: XTemac: Options: 0xb8f2
> [    7.517827] eth0: XTemac: We renegotiated the speed to: 100
> [    7.584504] eth0: XTemac: speed set to 100Mb/s
> [    8.652764] IP-Config: Unable to set interface netmask (-22).
> [    8.724733] Looking up port of RPC 100003/2 on 129.129.130.106
> 
> It cannot however go through the gateway because the macaddress is not
> properly set (ie. it is set to 00:00:00:00).
> My command line argument looks like:
> 
> CONFIG_CMDLINE="console=ttyUL0,9600 root=/dev/nfs rw
> nfsroot=129.129.130.106:/opt/eldk41/ppc_4xx,tcp macaddr=00:50:c2:46:d8:01
> ip=129.129.129.29:129.129.130.106:129.129.129.1:255.255.255.0:ML403:eth0:off
> panic=1"
> 
> Does somebody know why the macaddress is not taken into account.
> 
> Mirek
> 

Not sure how "macaddr=" in the cmdline is processed,
but here is what I've used to play with TEMAC (this is
essentially a copy from 2.4 kernels). The patch is
few month old, and could not apply cleanly. Especially
now when the Xilinx Virtex boards has been switched to the
u-boot's bd_t structure (a very recent change by
Grant Likely; probably not yet in the tree you are using).
So this patch is rather an illustration.

Thanks,
Andrei

--- linux-2.6.20.orig/arch/ppc/boot/simple/embed_config.c
+++ linux-2.6.20/arch/ppc/boot/simple/embed_config.c
@@ -778,6 +778,20 @@ embed_config(bd_t ** bdp)
         bd->bi_intfreq = XPAR_CORE_CLOCK_FREQ_HZ;
         bd->bi_busfreq = XPAR_PLB_CLOCK_FREQ_HZ;
         bd->bi_pci_busfreq = XPAR_PCI_0_CLOCK_FREQ_HZ;
+
+       /* Set the address to Xilinx's preferred default.
+        * However, first to eliminate a compiler warning
+        * because we don't really use def_enet_addr,
+        * we'll reference it. The compiler
+        * optimizes it away so no harm done. */
+       bd->bi_enetaddr[0] = def_enet_addr[0];
+       bd->bi_enetaddr[0] = 0x00;
+       bd->bi_enetaddr[1] = 0x0A;
+       bd->bi_enetaddr[2] = 0x35;
+       bd->bi_enetaddr[3] = 0x00;
+       bd->bi_enetaddr[4] = 0x22;
+       bd->bi_enetaddr[5] = 0x00;
+
         timebase_period_ns = 1000000000 / bd->bi_tbfreq;
         /* see bi_tbfreq definition in arch/ppc/platforms/4xx/xilinx_ml300.h */
  }

^ permalink raw reply

* RE: RFC: new device types in the device tree (RE: [PATCH] powerpc: Add EDAC platform devices for 85xx)
From: Yoder Stuart-B08248 @ 2007-05-04 15:29 UTC (permalink / raw)
  To: David Gibson; +Cc: linuxppc-dev, bluesmoke-devel
In-Reply-To: <20070503001729.GB4331@localhost.localdomain>

=20

> -----Original Message-----
> From: David Gibson [mailto:david@gibson.dropbear.id.au]=20
> Sent: Wednesday, May 02, 2007 7:17 PM
> To: Yoder Stuart-B08248
> Cc: Segher Boessenkool; linuxppc-dev@ozlabs.org;=20
> bluesmoke-devel@lists.sourceforge.net
> Subject: Re: RFC: new device types in the device tree (RE:=20
> [PATCH] powerpc: Add EDAC platform devices for 85xx)
>=20
> On Wed, May 02, 2007 at 12:04:11PM -0700, Yoder Stuart-B08248 wrote:
> > =20
> >=20
> > > -----Original Message-----
> > > From: David Gibson [mailto:david@gibson.dropbear.id.au]=20
> > > Sent: Tuesday, May 01, 2007 8:20 PM
> > > To: Segher Boessenkool
> > > Cc: Yoder Stuart-B08248; linuxppc-dev@ozlabs.org;=20
> > > bluesmoke-devel@lists.sourceforge.net
> > > Subject: Re: RFC: new device types in the device tree (RE:=20
> > > [PATCH] powerpc: Add EDAC platform devices for 85xx)
> > >=20
> > > On Wed, May 02, 2007 at 02:34:45AM +0200, Segher=20
> Boessenkool wrote:
> > > > >> "name" =3D "memory-controller"
> > > > >> "compatible" =3D "fsl,85xx-memory-controller"
> > > > >> (or a more specific 85xx model if the controller
> > > > >> isn't identical across those chips)
> > > > >> No "device_type" at all, since there is no binding
> > > > >> for this kind of device.
> > > > >
> > > > > Is "no device_type" really the approach that should be
> > > > > taken?
> > > >=20
> > > > Yes.
> > > >=20
> > > > > booting-without-of.txt currently reads:
> > > > >
> > > > >    Every node which actually represents an actual device
> > > > >    (that is, a node which isn't only a virtual "container"
> > > > >    for more nodes, like "/cpus" is) is also required to
> > > > >    have a "device_type" property indicating the type of
> > > > >    node
> > > >=20
> > > > That is wrong, IMNSHO.
> > >=20
> > > I tend to agree. Device drivers should generally be=20
> searching on the
> > > "compatible" property, not "device_type".  Defining new=20
> device_type
> > > values isn't really of any use to the kernel, so we=20
> should just avoid
> > > it.
> >=20
> > Right-- drivers search on "compatible".
> >=20
> > But, don't we want to keep standardized sets of properties for
> > certain classes/types of devices?  Defining a standardized,
> > required set of properties for a "network", "rom", or "i2c"
> > class of device is helpful.  Without a standardized 'template'
> > of properties, developers may make up whatever properties they
> > want and things will work fine as long as the device tree and
> > driver are in sync.  It works, but you wind up with a plethora
> > of properties each describing the same thing.
>=20
> If there's an obvious new class, with common properties, then yes,
> sure.  But I don't think we need to feel impelled to think up new
> classes (and therefore a device_type value) for each new device. =20
>=20
> And even in the case of new classes, I think we might be best off
> waiting for a few devices to appear so we can tell what's really
> common information before we define the class's device_type and
> required properties.

I think this makes sense.  I have seen various new device_type=20
properties popping up that seem very generic.  They simply have
the standard list of "reg",  "compatible", "interrupts",
"interrupt-parent".

I think one thing that would be very helpful would be a=20
crisp list of what the standardized device_types are so
when people create new device trees they have a guideline.
I'll take a stab at adding a section to booting-without-of.txt
for this.

Stuart

^ permalink raw reply

* [PATCH] Xilinx framebuffer device driver - 4th version
From: Andrei Konovalov @ 2007-05-04 15:25 UTC (permalink / raw)
  To: linux-fbdev-devel; +Cc: adaplas, linuxppc-embedded

Add support for the video controller IP block included into Xilinx ML300
and ML403 reference designs.

Signed-off-by: Andrei Konovalov <akonovalov@ru.mvista.com>

-----

The patch is against 2.6.21-git4 snapshot.

Fixed the issues pointed out by Antonino A. Daplas. Thanks Antonino!

Here is the interdiff against the previous version:

===8<===
diff -u linux-2.6.20/drivers/video/xilinxfb.c linux-2.6.20/drivers/video/xilinxfb.c
--- linux-2.6.20/drivers/video/xilinxfb.c
+++ linux-2.6.20/drivers/video/xilinxfb.c
@@ -167,14 +167,15 @@
  	struct xilinxfb_drvdata *drvdata = to_xilinxfb_drvdata(fbi);

  	switch (blank_mode) {
-	case VESA_NO_BLANKING:
+	case FB_BLANK_UNBLANK:
  		/* turn on panel */
  		xilinx_fb_out_be32(drvdata, REG_CTRL, drvdata->reg_ctrl_default);
  		break;

-	case VESA_VSYNC_SUSPEND:
-	case VESA_HSYNC_SUSPEND:
-	case VESA_POWERDOWN:
+	case FB_BLANK_NORMAL:
+	case FB_BLANK_VSYNC_SUSPEND:
+	case FB_BLANK_HSYNC_SUSPEND:
+	case FB_BLANK_POWERDOWN:
  		/* turn off panel */
  		xilinx_fb_out_be32(drvdata, REG_CTRL, 0);
  	default:
@@ -184,21 +185,11 @@
  	return 0; /* success */
  }

-static int
-xilinx_fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *fbi)
-{
-	if (var->xoffset != 0 || var->yoffset != 0)
-		return -EINVAL;
-
-	return 0;
-}
-
  static struct fb_ops xilinxfb_ops =
  {
  	.owner			= THIS_MODULE,
  	.fb_setcolreg		= xilinx_fb_setcolreg,
  	.fb_blank		= xilinx_fb_blank,
-	.fb_pan_display		= xilinx_fb_pan_display,
  	.fb_fillrect		= cfb_fillrect,
  	.fb_copyarea		= cfb_copyarea,
  	.fb_imageblit		= cfb_imageblit,
@@ -219,7 +210,7 @@
  		return -EINVAL;

  	pdev = to_platform_device(dev);
-	pdata = (struct xilinxfb_platform_data *)pdev->dev.platform_data;
+	pdata = pdev->dev.platform_data;

  	if (pdata == NULL) {
  		printk(KERN_ERR "Couldn't find platform data.\n");
@@ -231,7 +222,7 @@
  		printk(KERN_ERR "Couldn't allocate device private record\n");
  		return -ENOMEM;
  	}
-	dev_set_drvdata(dev, (void *)drvdata);
+	dev_set_drvdata(dev, drvdata);

  	/* Map the control registers in */
  	regs_res = platform_get_resource(pdev, IORESOURCE_IO, 0);
@@ -261,7 +252,7 @@
  	}

  	/* Clear (turn to black) the framebuffer */
-	memset((void *) drvdata->fb_virt, 0, FB_SIZE);
+	memset_io((void *) drvdata->fb_virt, 0, FB_SIZE);

  	/* Tell the hardware where the frame buffer is */
  	xilinx_fb_out_be32(drvdata, REG_FB_ADDR, drvdata->fb_phys);
@@ -275,6 +266,7 @@
  	xilinx_fb_out_be32(drvdata, REG_CTRL, drvdata->reg_ctrl_default);

  	/* Fill struct fb_info */
+	drvdata->info.device = dev;
  	drvdata->info.screen_base = drvdata->fb_virt;
  	drvdata->info.fbops = &xilinxfb_ops;
  	drvdata->info.fix = xilinx_fb_fix;
===8<===

And here is the patch itself:
===8<===
Add support for the video controller IP block included into Xilinx ML300 and
ML403 reference designs.

  arch/ppc/syslib/virtex_devices.h |    7
  drivers/video/Kconfig            |   11 +
  drivers/video/Makefile           |    1
  drivers/video/xilinxfb.c         |  381 +++++++++++++++++++++++++++++++++++++++
  4 files changed, 400 insertions(+)

Index: linux-2.6.20/drivers/video/Kconfig
===================================================================
--- linux-2.6.20.orig/drivers/video/Kconfig
+++ linux-2.6.20/drivers/video/Kconfig
@@ -1633,6 +1633,17 @@ config FB_PS3_DEFAULT_SIZE_M
  	  The default value can be overridden on the kernel command line
  	  using the "ps3fb" option (e.g. "ps3fb=9M");

+config FB_XILINX
+	tristate "Xilinx frame buffer support"
+	depends on FB && XILINX_VIRTEX
+	select FB_CFB_FILLRECT
+	select FB_CFB_COPYAREA
+	select FB_CFB_IMAGEBLIT
+	---help---
+	  Include support for the Xilinx ML300/ML403 reference design
+	  framebuffer. ML300 carries a 640*480 LCD display on the board,
+	  ML403 uses a standard DB15 VGA connector.
+
  config FB_VIRTUAL
  	tristate "Virtual Frame Buffer support (ONLY FOR TESTING!)"
  	depends on FB
Index: linux-2.6.20/drivers/video/Makefile
===================================================================
--- linux-2.6.20.orig/drivers/video/Makefile
+++ linux-2.6.20/drivers/video/Makefile
@@ -99,6 +99,7 @@ obj-$(CONFIG_FB_PNX4008_DUM_RGB)  += pnx
  obj-$(CONFIG_FB_IBM_GXT4500)	  += gxt4500.o
  obj-$(CONFIG_FB_PS3)		  += ps3fb.o
  obj-$(CONFIG_FB_SM501)            += sm501fb.o
+obj-$(CONFIG_FB_XILINX)           += xilinxfb.o

  # Platform or fallback drivers go here
  obj-$(CONFIG_FB_VESA)             += vesafb.o
Index: linux-2.6.20/drivers/video/xilinxfb.c
===================================================================
--- /dev/null
+++ linux-2.6.20/drivers/video/xilinxfb.c
@@ -0,0 +1,381 @@
+/*
+ * xilinxfb.c
+ *
+ * Xilinx TFT LCD frame buffer driver
+ *
+ * Author: MontaVista Software, Inc.
+ *         source@mvista.com
+ *
+ * 2002-2007 (c) MontaVista Software, Inc.  This file is licensed under the
+ * terms of the GNU General Public License version 2.  This program is licensed
+ * "as is" without any warranty of any kind, whether express or implied.
+ */
+
+/*
+ * This driver was based on au1100fb.c by MontaVista rewritten for 2.6
+ * by Embedded Alley Solutions <source@embeddedalley.com>, which in turn
+ * was based on skeletonfb.c, Skeleton for a frame buffer device by
+ * Geert Uytterhoeven.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/version.h>
+#include <linux/errno.h>
+#include <linux/string.h>
+#include <linux/mm.h>
+#include <linux/fb.h>
+#include <linux/init.h>
+#include <linux/dma-mapping.h>
+#include <linux/platform_device.h>
+
+#include <asm/io.h>
+#include <syslib/virtex_devices.h>
+
+#define DRIVER_NAME		"xilinxfb"
+#define DRIVER_DESCRIPTION	"Xilinx TFT LCD frame buffer driver"
+
+/*
+ * Xilinx calls it "PLB TFT LCD Controller" though it can also be used for
+ * the VGA port on the Xilinx ML40x board. This is a hardware display controller
+ * for a 640x480 resolution TFT or VGA screen.
+ *
+ * The interface to the framebuffer is nice and simple.  There are two
+ * control registers.  The first tells the LCD interface where in memory
+ * the frame buffer is (only the 11 most significant bits are used, so
+ * don't start thinking about scrolling).  The second allows the LCD to
+ * be turned on or off as well as rotated 180 degrees.
+ */
+#define NUM_REGS	2
+#define REG_FB_ADDR	0
+#define REG_CTRL	1
+#define REG_CTRL_ENABLE	 0x0001
+#define REG_CTRL_ROTATE	 0x0002
+
+/*
+ * The hardware only handles a single mode: 640x480 24 bit true
+ * color. Each pixel gets a word (32 bits) of memory.  Within each word,
+ * the 8 most significant bits are ignored, the next 8 bits are the red
+ * level, the next 8 bits are the green level and the 8 least
+ * significant bits are the blue level.  Each row of the LCD uses 1024
+ * words, but only the first 640 pixels are displayed with the other 384
+ * words being ignored.  There are 480 rows.
+ */
+#define BYTES_PER_PIXEL	4
+#define BITS_PER_PIXEL	(BYTES_PER_PIXEL * 8)
+#define XRES		640
+#define YRES		480
+#define XRES_VIRTUAL	1024
+#define YRES_VIRTUAL	YRES
+#define LINE_LENGTH	(XRES_VIRTUAL * BYTES_PER_PIXEL)
+#define FB_SIZE		(YRES_VIRTUAL * LINE_LENGTH)
+
+#define RED_SHIFT	16
+#define GREEN_SHIFT	8
+#define BLUE_SHIFT	0
+
+#define PALETTE_ENTRIES_NO	16	/* passed to fb_alloc_cmap() */
+
+/*
+ * Here are the default fb_fix_screeninfo and fb_var_screeninfo structures
+ */
+static struct fb_fix_screeninfo xilinx_fb_fix __initdata = {
+	.id =		"Xilinx",
+	.type =		FB_TYPE_PACKED_PIXELS,
+	.visual =	FB_VISUAL_TRUECOLOR,
+	.smem_len =	FB_SIZE,
+	.line_length =	LINE_LENGTH,
+	.accel =	FB_ACCEL_NONE
+};
+
+static struct fb_var_screeninfo xilinx_fb_var __initdata = {
+	.xres =			XRES,
+	.yres =			YRES,
+	.xres_virtual =		XRES_VIRTUAL,
+	.yres_virtual =		YRES_VIRTUAL,
+
+	.bits_per_pixel =	BITS_PER_PIXEL,
+
+	.red =		{ RED_SHIFT, 8, 0 },
+	.green =	{ GREEN_SHIFT, 8, 0 },
+	.blue =		{ BLUE_SHIFT, 8, 0 },
+	.transp =	{ 0, 0, 0 },
+
+	.activate =	FB_ACTIVATE_NOW
+};
+
+struct xilinxfb_drvdata {
+
+	struct fb_info	info;		/* FB driver info record */
+
+	u32		regs_phys;	/* phys. address of the control registers */
+	u32 __iomem	*regs;		/* virt. address of the control registers */
+
+	unsigned char __iomem	*fb_virt;	/* virt. address of the frame buffer */
+	dma_addr_t	fb_phys;	/* phys. address of the frame buffer */
+
+	u32		reg_ctrl_default;
+
+	u32		pseudo_palette[PALETTE_ENTRIES_NO];
+					/* Fake palette of 16 colors */
+};
+
+#define to_xilinxfb_drvdata(_info) \
+	container_of(_info, struct xilinxfb_drvdata, info)
+
+/*
+ * The LCD controller has DCR interface to its registers, but all
+ * the boards and configurations the driver has been tested with
+ * use opb2dcr bridge. So the registers are seen as memory mapped.
+ * This macro is to make it simple to add the direct DCR access
+ * when it's needed.
+ */
+#define xilinx_fb_out_be32(driverdata, offset, val) \
+	out_be32(driverdata->regs + offset, val)
+
+static int
+xilinx_fb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned blue,
+	unsigned transp, struct fb_info *fbi)
+{
+	u32 *palette = fbi->pseudo_palette;
+
+	if (regno >= PALETTE_ENTRIES_NO)
+		return -EINVAL;
+
+	if (fbi->var.grayscale) {
+		/* Convert color to grayscale.
+		 * grayscale = 0.30*R + 0.59*G + 0.11*B */
+		red = green = blue =
+			(red * 77 + green * 151 + blue * 28 + 127) >> 8;
+	}
+
+	/* fbi->fix.visual is always FB_VISUAL_TRUECOLOR */
+
+	/* We only handle 8 bits of each color. */
+	red >>= 8;
+	green >>= 8;
+	blue >>= 8;
+	palette[regno] = (red << RED_SHIFT) | (green << GREEN_SHIFT) |
+			 (blue << BLUE_SHIFT);
+
+	return 0;
+}
+
+static int
+xilinx_fb_blank(int blank_mode, struct fb_info *fbi)
+{
+	struct xilinxfb_drvdata *drvdata = to_xilinxfb_drvdata(fbi);
+
+	switch (blank_mode) {
+	case FB_BLANK_UNBLANK:
+		/* turn on panel */
+		xilinx_fb_out_be32(drvdata, REG_CTRL, drvdata->reg_ctrl_default);
+		break;
+
+	case FB_BLANK_NORMAL:
+	case FB_BLANK_VSYNC_SUSPEND:
+	case FB_BLANK_HSYNC_SUSPEND:
+	case FB_BLANK_POWERDOWN:
+		/* turn off panel */
+		xilinx_fb_out_be32(drvdata, REG_CTRL, 0);
+	default:
+		break;
+
+	}
+	return 0; /* success */
+}
+
+static struct fb_ops xilinxfb_ops =
+{
+	.owner			= THIS_MODULE,
+	.fb_setcolreg		= xilinx_fb_setcolreg,
+	.fb_blank		= xilinx_fb_blank,
+	.fb_fillrect		= cfb_fillrect,
+	.fb_copyarea		= cfb_copyarea,
+	.fb_imageblit		= cfb_imageblit,
+};
+
+/* === The device driver === */
+
+static int
+xilinxfb_drv_probe(struct device *dev)
+{
+	struct platform_device *pdev;
+	struct xilinxfb_platform_data *pdata;
+	struct xilinxfb_drvdata *drvdata;
+	struct resource *regs_res;
+	int retval;
+
+	if (!dev)
+		return -EINVAL;
+
+	pdev = to_platform_device(dev);
+	pdata = pdev->dev.platform_data;
+
+	if (pdata == NULL) {
+		printk(KERN_ERR "Couldn't find platform data.\n");
+		return -EFAULT;
+	}
+
+	drvdata = kzalloc(sizeof(*drvdata), GFP_KERNEL);
+	if (!drvdata) {
+		printk(KERN_ERR "Couldn't allocate device private record\n");
+		return -ENOMEM;
+	}
+	dev_set_drvdata(dev, drvdata);
+
+	/* Map the control registers in */
+	regs_res = platform_get_resource(pdev, IORESOURCE_IO, 0);
+	if (!regs_res || (regs_res->end - regs_res->start + 1 < 8)) {
+		printk(KERN_ERR "Couldn't get registers resource\n");
+		retval = -EFAULT;
+		goto failed1;
+	}
+
+	if (!request_mem_region(regs_res->start, 8, DRIVER_NAME)) {
+		printk(KERN_ERR
+		       "Couldn't lock memory region at 0x%08X\n",
+		       regs_res->start);
+		retval = -EBUSY;
+		goto failed1;
+	}
+	drvdata->regs = (u32 __iomem*) ioremap(regs_res->start, 8);
+	drvdata->regs_phys = regs_res->start;
+
+	/* Allocate the framebuffer memory */
+	drvdata->fb_virt = dma_alloc_coherent(dev, PAGE_ALIGN(FB_SIZE),
+				&drvdata->fb_phys, GFP_KERNEL);
+	if (!drvdata->fb_virt) {
+		printk(KERN_ERR "Could not allocate frame buffer memory\n");
+		retval = -ENOMEM;
+		goto failed2;
+	}
+
+	/* Clear (turn to black) the framebuffer */
+	memset_io((void *) drvdata->fb_virt, 0, FB_SIZE);
+
+	/* Tell the hardware where the frame buffer is */
+	xilinx_fb_out_be32(drvdata, REG_FB_ADDR, drvdata->fb_phys);
+
+	/* Turn on the display */
+	if (pdata->rotate_screen) {
+		drvdata->reg_ctrl_default = REG_CTRL_ENABLE | REG_CTRL_ROTATE;
+	} else {
+		drvdata->reg_ctrl_default = REG_CTRL_ENABLE;
+	}
+	xilinx_fb_out_be32(drvdata, REG_CTRL, drvdata->reg_ctrl_default);
+
+	/* Fill struct fb_info */
+	drvdata->info.device = dev;
+	drvdata->info.screen_base = drvdata->fb_virt;
+	drvdata->info.fbops = &xilinxfb_ops;
+	drvdata->info.fix = xilinx_fb_fix;
+	drvdata->info.fix.smem_start = drvdata->fb_phys;
+	drvdata->info.pseudo_palette = drvdata->pseudo_palette;
+
+	if (fb_alloc_cmap(&drvdata->info.cmap, PALETTE_ENTRIES_NO, 0) < 0) {
+		printk(KERN_ERR "Fail to allocate colormap (%d entries)\n",
+			PALETTE_ENTRIES_NO);
+		retval = -EFAULT;
+		goto failed3;
+	}
+
+	drvdata->info.flags = FBINFO_DEFAULT;
+	xilinx_fb_var.height = pdata->screen_height_mm;
+	xilinx_fb_var.width = pdata->screen_width_mm;
+	drvdata->info.var = xilinx_fb_var;
+
+	/* Register new frame buffer */
+	if (register_framebuffer(&drvdata->info) < 0) {
+		printk(KERN_ERR "Could not register frame buffer\n");
+		retval = -EINVAL;
+		goto failed4;
+	}
+
+	return 0;	/* success */
+
+failed4:
+	fb_dealloc_cmap(&drvdata->info.cmap);
+
+failed3:
+	dma_free_coherent(dev, PAGE_ALIGN(FB_SIZE), drvdata->fb_virt,
+		drvdata->fb_phys);
+
+	/* Turn off the display */
+	xilinx_fb_out_be32(drvdata, REG_CTRL, 0);
+	iounmap(drvdata->regs);
+
+failed2:
+	release_mem_region(regs_res->start, 8);
+
+failed1:
+	kfree(drvdata);
+	dev_set_drvdata(dev, NULL);
+
+	return retval;
+}
+
+static int
+xilinxfb_drv_remove(struct device *dev)
+{
+	struct xilinxfb_drvdata *drvdata;
+
+	if (!dev)
+		return -ENODEV;
+
+	drvdata = (struct xilinxfb_drvdata *) dev_get_drvdata(dev);
+
+#if !defined(CONFIG_FRAMEBUFFER_CONSOLE) && defined(CONFIG_LOGO)
+	xilinx_fb_blank(VESA_POWERDOWN, &drvdata->info);
+#endif
+
+	unregister_framebuffer(&drvdata->info);
+
+	fb_dealloc_cmap(&drvdata->info.cmap);
+
+	dma_free_coherent(dev, PAGE_ALIGN(FB_SIZE), drvdata->fb_virt,
+		drvdata->fb_phys);
+
+	/* Turn off the display */
+	xilinx_fb_out_be32(drvdata, REG_CTRL, 0);
+	iounmap(drvdata->regs);
+
+	release_mem_region(drvdata->regs_phys, 8);
+
+	kfree(drvdata);
+	dev_set_drvdata(dev, NULL);
+
+	return 0;
+}
+
+
+static struct device_driver xilinxfb_driver = {
+	.name		= DRIVER_NAME,
+	.bus		= &platform_bus_type,
+
+	.probe		= xilinxfb_drv_probe,
+	.remove		= xilinxfb_drv_remove
+};
+
+static int __init
+xilinxfb_init(void)
+{
+	/*
+	 * No kernel boot options used,
+	 * so we just need to register the driver
+	 */
+	return driver_register(&xilinxfb_driver);
+}
+
+static void __exit
+xilinxfb_cleanup(void)
+{
+	driver_unregister(&xilinxfb_driver);
+}
+
+module_init(xilinxfb_init);
+module_exit(xilinxfb_cleanup);
+
+MODULE_AUTHOR("MontaVista Software, Inc. <source@mvista.com>");
+MODULE_DESCRIPTION(DRIVER_DESCRIPTION);
+MODULE_LICENSE("GPL");
Index: linux-2.6.20/arch/ppc/syslib/virtex_devices.h
===================================================================
--- linux-2.6.20.orig/arch/ppc/syslib/virtex_devices.h
+++ linux-2.6.20/arch/ppc/syslib/virtex_devices.h
@@ -13,6 +13,13 @@

  #include <linux/platform_device.h>

+/* ML300/403 reference design framebuffer driver platform data struct */
+struct xilinxfb_platform_data {
+	u32 rotate_screen;
+	u32 screen_height_mm;
+	u32 screen_width_mm;
+};
+
  void __init virtex_early_serial_map(void);

  /* Prototype for device fixup routine.  Implement this routine in the
===8<===

Thanks,
Andrei

^ permalink raw reply

* Re: [PATCH] Remove CPU_FTR_NEED_COHERENT for 7448.
From: Jon Loeliger @ 2007-05-04 15:16 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev@ozlabs.org
In-Reply-To: <1178228208.6353.55.camel@localhost.localdomain>

So, like, the other day Benjamin Herrenschmidt mumbled:
> 
> I still maintain it should be a runtime thing tho :-)
> 
> Ben.

So, could you comment on my proposed solution doing
things exactly this way?  Speifically, would folks
prefer the dynamic 

    number_of_cpus() == 1 

and possibly checking the device tree or SMP map, or the 

    #ifndef SMP

test guarding the removal of the CPU_FTR_NEED_COHERENT bit?

Thanks,
jdl

^ permalink raw reply

* RE: RFC: new device types in the device tree (RE: [PATCH] powerpc: Add EDAC platform devices for 85xx)
From: Yoder Stuart-B08248 @ 2007-05-04 15:16 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: linuxppc-dev, david, bluesmoke-devel
In-Reply-To: <1624cd331b61117d7251f70caaa86292@kernel.crashing.org>

=20

> -----Original Message-----
> From: Segher Boessenkool [mailto:segher@kernel.crashing.org]=20
> Sent: Wednesday, May 02, 2007 7:48 PM
> To: Yoder Stuart-B08248
> Cc: Dave Jiang; linuxppc-dev@ozlabs.org;=20
> david@gibson.dropbear.id.au; bluesmoke-devel@lists.sourceforge.net
> Subject: Re: RFC: new device types in the device tree (RE:=20
> [PATCH] powerpc: Add EDAC platform devices for 85xx)
>=20
> >>> The 1275 spec is 'Open Firmware centric' in that it says
> >>> you don't need a device_type if the node is not used
> >>> by Open Firmware.
> >>
> >> It is "Open firmware centric" in every way; it is
> >> the Open firmware definition after all.
> >>
> >> "device_type" specifies what firmware interfaces a
> >> node implements.  "name" and "compatible" are for
> >> the client (i.e., OS, bootloader, etc.) to use for
> >> matching drivers to device nodes.
> >
> > The flat device tree standard (i.e. booting-without-of.txt)
> > certainly inherited stuff from IEEE-1275, but can diverge
> > if need be.
>=20
> It shares the kernel interface.  You cannot go diverge
> on fundamental things.
>=20
> > name is always optional (as defined by b-w-of.txt)
>=20
> Where does it say that?  "name" is always required!  In
> the newer flat tree format, it's even impossible to
> create a node without "name".

I'm specifically referring to the "name" property.  Here is
what booting-without-of.txt says:

   While earlier users of Open Firmware like OldWorld
   macintoshes tended to use the actual device name for
   the "name" property, it's nowadays considered a good
   practice to use a name that is closer to the device
   class (often equal to device_type)...[snip]... However,
   the kernel doesn't generally put any restriction on the
   "name" property; it is simply considered good practice
   to follow the standard and its evolutions as closely as
   possible.

   Note also that the new format version 16 makes the
   "name" property optional. If it's absent for a node, then
   the node's unit name is then used to reconstruct the name.
   That is, the part of the unit name before the "@" sign
   is used (or the entire unit name if no "@" sign is present).

If the name property is missing the kernel contructs it from
the unit name.  I guess my point is the name property implies
nothing and the kernel doesn't seem to care what name is used.
It certainly doesn't imply a required set of properties.

Stuart

^ permalink raw reply

* Re: [PATCH] Remove CPU_FTR_NEED_COHERENT for 7448.
From: Jon Loeliger @ 2007-05-04 15:13 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev@ozlabs.org
In-Reply-To: <17978.29080.935808.707458@cargo.ozlabs.ibm.com>

So, like, the other day Paul Mackerras mumbled:
> Jon Loeliger writes:
> 
> > Yes.  We have the data to back this claim up.
> 
> Care to share it with us? :)

To quote our very own Olof Johansson:

    Not at this time, sorry.

jdl

^ permalink raw reply

* RE: zImage.elf loads but does not start
From: Mirek23 @ 2007-05-04 15:04 UTC (permalink / raw)
  To: linuxppc-embedded
In-Reply-To: <10165159.post@talk.nabble.com>


I came to the point with my kernel 2.6 (patched by Grant)  struggle on ml403
that it reaches the 
stage to mount nfs root file system from the computer which is on another
segment  of the network:

[    2.565946] eth%d: XTemac: PHY detected at address 3.
[    2.629348] eth0: Xilinx TEMAC #0 at 0x81200000 mapped to 0xC5020000,rq=1
[    2.713113] eth0: XTemac id 1.0f, block id 5, type 8
[    2.774335] mice: PS/2 mouse device common for all mice
[    2.837152] TCP cubic registered
[    2.876220] NET: Registered protocol family 1
[    2.928569] NET: Registered protocol family 17
[    3.485990] eth0: XTemac: Options: 0xb8f2
[    7.517827] eth0: XTemac: We renegotiated the speed to: 100
[    7.584504] eth0: XTemac: speed set to 100Mb/s
[    8.652764] IP-Config: Unable to set interface netmask (-22).
[    8.724733] Looking up port of RPC 100003/2 on 129.129.130.106

It cannot however go through the gateway because the macaddress is not
properly set (ie. it is set to 00:00:00:00).
My command line argument looks like:

CONFIG_CMDLINE="console=ttyUL0,9600 root=/dev/nfs rw
nfsroot=129.129.130.106:/opt/eldk41/ppc_4xx,tcp macaddr=00:50:c2:46:d8:01
ip=129.129.129.29:129.129.130.106:129.129.129.1:255.255.255.0:ML403:eth0:off
panic=1"

Does somebody know why the macaddress is not taken into account.

Mirek

-- 
View this message in context: http://www.nabble.com/zImage.elf-loads-but-not-starts-tf3607582.html#a10323147
Sent from the linuxppc-embedded mailing list archive at Nabble.com.

^ permalink raw reply

* Re: [PATCH 2/2] Rename get_property to of_get_property: drivers/net
From: Kumar Gala @ 2007-05-04 14:40 UTC (permalink / raw)
  To: Jeff Garzik
  Cc: Stephen Rothwell, netdev, linuxppc-dev@ozlabs.org list,
	Paul Mackerras, Andrew Morton, David Miller
In-Reply-To: <Pine.LNX.4.64.0705021113020.27995@localhost.localdomain>


On May 2, 2007, at 11:14 AM, Kumar Gala wrote:

> On Wed, 2 May 2007, Jeff Garzik wrote:
>
>> Kumar Gala wrote:
>>>
>>> On May 2, 2007, at 9:17 AM, Jeff Garzik wrote:
>>>
>>>> Kumar Gala wrote:
>>>>> On Apr 28, 2007, at 10:47 PM, David Miller wrote:
>>>>>> From: Stephen Rothwell <sfr@canb.auug.org.au>
>>>>>> Date: Sun, 29 Apr 2007 11:44:46 +1000
>>>>>>
>>>>>>> So can I take this as a future OK for architecture specific  
>>>>>>> network
>>>>>>> drivers changes to go through the architecture trees (cc'd to  
>>>>>>> you)?
>>>>>>
>>>>>> It's been my experience that if I'm just working through some
>>>>>> platform or bus specific API changes, people like Jeff tend to
>>>>>> not mind if it goes via ARCH trees and the like.
>>>>> Is this acceptable?   Just want to make sure before I ask Paul  
>>>>> to pull
>>>>> some changes that touches the following drivers:
>>>>> drivers/net/fs_enet/mac-scc.c           |    2 +-
>>>>> drivers/net/ucc_geth.c                  |   30 ++++----
>>>>> drivers/serial/cpm_uart/cpm_uart_cpm1.c |    4 +-
>>>>> drivers/serial/cpm_uart/cpm_uart_cpm2.c |    4 +-
>>>>
>>>> I don't see a patch, just a diffstat.
>>>
>>> I haven't sent a patch, just asking the question if I need to  
>>> break it up or
>>> not.
>>
>> Without seeing the patch, I have no idea...
>
> Here's an older version of the patch (may need to respin for it to  
> apply
> cleanly)

Didn't hear one way or the other if this is ok to go via the  
powerpc.git tree?

- k

>
>> From 2dd748e71cd24641c4c5d2aa6fbf86c72080ed0d Mon Sep 17 00:00:00  
>> 2001
> From: Timur Tabi <timur@freescale.com>
> Date: Thu, 12 Apr 2007 17:44:06 -0500
> Subject: [PATCH] [POWERPC] Change rheap functions to use ulongs  
> instead of pointers
>
> The rheap allocation functions return a pointer, but the actual  
> value is based
> on how the heap was initialized, and so it can be anything, e.g. an  
> offset
> into a buffer.  A ulong is a better representation of the value  
> returned by
> the allocation functions.
>
> This patch changes all of the relevant rheap functions to use a  
> unsigned long
> integers instead of a pointer.  In case of an error, the value  
> returned is
> a negative error code that has been cast to an unsigned long.  The  
> caller can
> use the IS_ERR_VALUE() macro to check for this.
>
> All code which calls the rheap functions is updated accordingly.   
> Macros
> IS_MURAM_ERR() and IS_DPERR(), have been deleted in favor of  
> IS_ERR_VALUE().
>
> Also added error checking to rh_attach_region().
>
> Signed-off-by: Timur Tabi <timur@freescale.com>
> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
> ---
>  arch/powerpc/lib/rheap.c                |  117 +++++++++++++++++ 
> +-------------
>  arch/powerpc/sysdev/commproc.c          |   20 +++---
>  arch/powerpc/sysdev/cpm2_common.c       |   21 +++---
>  arch/powerpc/sysdev/qe_lib/qe.c         |   29 ++++----
>  arch/powerpc/sysdev/qe_lib/ucc_fast.c   |    5 +-
>  arch/powerpc/sysdev/qe_lib/ucc_slow.c   |    7 +-
>  arch/ppc/8xx_io/commproc.c              |   22 +++---
>  arch/ppc/lib/rheap.c                    |   95 ++++++++++++ 
> +------------
>  arch/ppc/syslib/cpm2_common.c           |   23 +++---
>  drivers/net/fs_enet/mac-scc.c           |    2 +-
>  drivers/net/ucc_geth.c                  |   30 ++++----
>  drivers/serial/cpm_uart/cpm_uart_cpm1.c |    4 +-
>  drivers/serial/cpm_uart/cpm_uart_cpm2.c |    4 +-
>  include/asm-powerpc/qe.h                |   13 +---
>  include/asm-ppc/commproc.h              |   13 +---
>  include/asm-ppc/cpm2.h                  |   13 +---
>  include/asm-ppc/rheap.h                 |   20 +++---
>  17 files changed, 221 insertions(+), 217 deletions(-)
>
> diff --git a/arch/powerpc/lib/rheap.c b/arch/powerpc/lib/rheap.c
> index 6c5c5dd..b2f6dcc 100644
> --- a/arch/powerpc/lib/rheap.c
> +++ b/arch/powerpc/lib/rheap.c
> @@ -133,7 +133,7 @@ static rh_block_t *get_slot(rh_info_t * info)
>  	info->empty_slots--;
>
>  	/* Initialize */
> -	blk->start = NULL;
> +	blk->start = 0;
>  	blk->size = 0;
>  	blk->owner = NULL;
>
> @@ -158,7 +158,7 @@ static void attach_free_block(rh_info_t * info,  
> rh_block_t * blkn)
>
>  	/* We assume that they are aligned properly */
>  	size = blkn->size;
> -	s = (unsigned long)blkn->start;
> +	s = blkn->start;
>  	e = s + size;
>
>  	/* Find the blocks immediately before and after the given one
> @@ -170,7 +170,7 @@ static void attach_free_block(rh_info_t * info,  
> rh_block_t * blkn)
>  	list_for_each(l, &info->free_list) {
>  		blk = list_entry(l, rh_block_t, list);
>
> -		bs = (unsigned long)blk->start;
> +		bs = blk->start;
>  		be = bs + blk->size;
>
>  		if (next == NULL && s >= bs)
> @@ -188,10 +188,10 @@ static void attach_free_block(rh_info_t *  
> info, rh_block_t * blkn)
>  	}
>
>  	/* Now check if they are really adjacent */
> -	if (before != NULL && s != (unsigned long)before->start + before- 
> >size)
> +	if (before && s != (before->start + before->size))
>  		before = NULL;
>
> -	if (after != NULL && e != (unsigned long)after->start)
> +	if (after && e != after->start)
>  		after = NULL;
>
>  	/* No coalescing; list insert and return */
> @@ -216,7 +216,7 @@ static void attach_free_block(rh_info_t * info,  
> rh_block_t * blkn)
>
>  	/* Grow the after block backwards */
>  	if (before == NULL && after != NULL) {
> -		after->start = (int8_t *)after->start - size;
> +		after->start -= size;
>  		after->size += size;
>  		return;
>  	}
> @@ -321,14 +321,14 @@ void rh_init(rh_info_t * info, unsigned int  
> alignment, int max_blocks,
>  }
>
>  /* Attach a free memory region, coalesces regions if adjuscent */
> -int rh_attach_region(rh_info_t * info, void *start, int size)
> +int rh_attach_region(rh_info_t * info, unsigned long start, int size)
>  {
>  	rh_block_t *blk;
>  	unsigned long s, e, m;
>  	int r;
>
>  	/* The region must be aligned */
> -	s = (unsigned long)start;
> +	s = start;
>  	e = s + size;
>  	m = info->alignment - 1;
>
> @@ -338,9 +338,12 @@ int rh_attach_region(rh_info_t * info, void  
> *start, int size)
>  	/* Round end down */
>  	e = e & ~m;
>
> +	if (IS_ERR_VALUE(e) || (e < s))
> +		return -ERANGE;
> +
>  	/* Take final values */
> -	start = (void *)s;
> -	size = (int)(e - s);
> +	start = s;
> +	size = e - s;
>
>  	/* Grow the blocks, if needed */
>  	r = assure_empty(info, 1);
> @@ -358,7 +361,7 @@ int rh_attach_region(rh_info_t * info, void  
> *start, int size)
>  }
>
>  /* Detatch given address range, splits free block if needed. */
> -void *rh_detach_region(rh_info_t * info, void *start, int size)
> +unsigned long rh_detach_region(rh_info_t * info, unsigned long  
> start, int size)
>  {
>  	struct list_head *l;
>  	rh_block_t *blk, *newblk;
> @@ -366,10 +369,10 @@ void *rh_detach_region(rh_info_t * info, void  
> *start, int size)
>
>  	/* Validate size */
>  	if (size <= 0)
> -		return ERR_PTR(-EINVAL);
> +		return (unsigned long) -EINVAL;
>
>  	/* The region must be aligned */
> -	s = (unsigned long)start;
> +	s = start;
>  	e = s + size;
>  	m = info->alignment - 1;
>
> @@ -380,34 +383,34 @@ void *rh_detach_region(rh_info_t * info, void  
> *start, int size)
>  	e = e & ~m;
>
>  	if (assure_empty(info, 1) < 0)
> -		return ERR_PTR(-ENOMEM);
> +		return (unsigned long) -ENOMEM;
>
>  	blk = NULL;
>  	list_for_each(l, &info->free_list) {
>  		blk = list_entry(l, rh_block_t, list);
>  		/* The range must lie entirely inside one free block */
> -		bs = (unsigned long)blk->start;
> -		be = (unsigned long)blk->start + blk->size;
> +		bs = blk->start;
> +		be = blk->start + blk->size;
>  		if (s >= bs && e <= be)
>  			break;
>  		blk = NULL;
>  	}
>
>  	if (blk == NULL)
> -		return ERR_PTR(-ENOMEM);
> +		return (unsigned long) -ENOMEM;
>
>  	/* Perfect fit */
>  	if (bs == s && be == e) {
>  		/* Delete from free list, release slot */
>  		list_del(&blk->list);
>  		release_slot(info, blk);
> -		return (void *)s;
> +		return s;
>  	}
>
>  	/* blk still in free list, with updated start and/or size */
>  	if (bs == s || be == e) {
>  		if (bs == s)
> -			blk->start = (int8_t *)blk->start + size;
> +			blk->start += size;
>  		blk->size -= size;
>
>  	} else {
> @@ -416,25 +419,29 @@ void *rh_detach_region(rh_info_t * info, void  
> *start, int size)
>
>  		/* the back free fragment */
>  		newblk = get_slot(info);
> -		newblk->start = (void *)e;
> +		newblk->start = e;
>  		newblk->size = be - e;
>
>  		list_add(&newblk->list, &blk->list);
>  	}
>
> -	return (void *)s;
> +	return s;
>  }
>
> -void *rh_alloc_align(rh_info_t * info, int size, int alignment,  
> const char *owner)
> +/* Allocate a block of memory at the specified alignment.  The  
> value returned
> + * is an offset into the buffer initialized by rh_init(), or a  
> negative number
> + * if there is an error.
> + */
> +unsigned long rh_alloc_align(rh_info_t * info, int size, int  
> alignment, const char *owner)
>  {
>  	struct list_head *l;
>  	rh_block_t *blk;
>  	rh_block_t *newblk;
> -	void *start;
> +	unsigned long start;
>
> -	/* Validate size, (must be power of two) */
> +	/* Validate size, and alignment must be power of two */
>  	if (size <= 0 || (alignment & (alignment - 1)) != 0)
> -		return ERR_PTR(-EINVAL);
> +		return (unsigned long) -EINVAL;
>
>  	/* given alignment larger that default rheap alignment */
>  	if (alignment > info->alignment)
> @@ -444,7 +451,7 @@ void *rh_alloc_align(rh_info_t * info, int  
> size, int alignment, const char *owne
>  	size = (size + (info->alignment - 1)) & ~(info->alignment - 1);
>
>  	if (assure_empty(info, 1) < 0)
> -		return ERR_PTR(-ENOMEM);
> +		return (unsigned long) -ENOMEM;
>
>  	blk = NULL;
>  	list_for_each(l, &info->free_list) {
> @@ -455,7 +462,7 @@ void *rh_alloc_align(rh_info_t * info, int  
> size, int alignment, const char *owne
>  	}
>
>  	if (blk == NULL)
> -		return ERR_PTR(-ENOMEM);
> +		return (unsigned long) -ENOMEM;
>
>  	/* Just fits */
>  	if (blk->size == size) {
> @@ -475,7 +482,7 @@ void *rh_alloc_align(rh_info_t * info, int  
> size, int alignment, const char *owne
>  	newblk->owner = owner;
>
>  	/* blk still in free list, with updated start, size */
> -	blk->start = (int8_t *)blk->start + size;
> +	blk->start += size;
>  	blk->size -= size;
>
>  	start = newblk->start;
> @@ -486,19 +493,25 @@ void *rh_alloc_align(rh_info_t * info, int  
> size, int alignment, const char *owne
>  	/* this is no problem with the deallocator since */
>  	/* we scan for pointers that lie in the blocks   */
>  	if (alignment > info->alignment)
> -		start = (void *)(((unsigned long)start + alignment - 1) &
> -				~(alignment - 1));
> +		start = (start + alignment - 1) & ~(alignment - 1);
>
>  	return start;
>  }
>
> -void *rh_alloc(rh_info_t * info, int size, const char *owner)
> +/* Allocate a block of memory at the default alignment.  The value  
> returned is
> + * an offset into the buffer initialized by rh_init(), or a  
> negative number if
> + * there is an error.
> + */
> +unsigned long rh_alloc(rh_info_t * info, int size, const char *owner)
>  {
>  	return rh_alloc_align(info, size, info->alignment, owner);
>  }
>
> -/* allocate at precisely the given address */
> -void *rh_alloc_fixed(rh_info_t * info, void *start, int size,  
> const char *owner)
> +/* Allocate a block of memory at the given offset, rounded up to  
> the default
> + * alignment.  The value returned is an offset into the buffer  
> initialized by
> + * rh_init(), or a negative number if there is an error.
> + */
> +unsigned long rh_alloc_fixed(rh_info_t * info, unsigned long  
> start, int size, const char *owner)
>  {
>  	struct list_head *l;
>  	rh_block_t *blk, *newblk1, *newblk2;
> @@ -506,10 +519,10 @@ void *rh_alloc_fixed(rh_info_t * info, void  
> *start, int size, const char *owner)
>
>  	/* Validate size */
>  	if (size <= 0)
> -		return ERR_PTR(-EINVAL);
> +		return (unsigned long) -EINVAL;
>
>  	/* The region must be aligned */
> -	s = (unsigned long)start;
> +	s = start;
>  	e = s + size;
>  	m = info->alignment - 1;
>
> @@ -520,20 +533,20 @@ void *rh_alloc_fixed(rh_info_t * info, void  
> *start, int size, const char *owner)
>  	e = e & ~m;
>
>  	if (assure_empty(info, 2) < 0)
> -		return ERR_PTR(-ENOMEM);
> +		return (unsigned long) -ENOMEM;
>
>  	blk = NULL;
>  	list_for_each(l, &info->free_list) {
>  		blk = list_entry(l, rh_block_t, list);
>  		/* The range must lie entirely inside one free block */
> -		bs = (unsigned long)blk->start;
> -		be = (unsigned long)blk->start + blk->size;
> +		bs = blk->start;
> +		be = blk->start + blk->size;
>  		if (s >= bs && e <= be)
>  			break;
>  	}
>
>  	if (blk == NULL)
> -		return ERR_PTR(-ENOMEM);
> +		return (unsigned long) -ENOMEM;
>
>  	/* Perfect fit */
>  	if (bs == s && be == e) {
> @@ -551,7 +564,7 @@ void *rh_alloc_fixed(rh_info_t * info, void  
> *start, int size, const char *owner)
>  	/* blk still in free list, with updated start and/or size */
>  	if (bs == s || be == e) {
>  		if (bs == s)
> -			blk->start = (int8_t *)blk->start + size;
> +			blk->start += size;
>  		blk->size -= size;
>
>  	} else {
> @@ -560,14 +573,14 @@ void *rh_alloc_fixed(rh_info_t * info, void  
> *start, int size, const char *owner)
>
>  		/* The back free fragment */
>  		newblk2 = get_slot(info);
> -		newblk2->start = (void *)e;
> +		newblk2->start = e;
>  		newblk2->size = be - e;
>
>  		list_add(&newblk2->list, &blk->list);
>  	}
>
>  	newblk1 = get_slot(info);
> -	newblk1->start = (void *)s;
> +	newblk1->start = s;
>  	newblk1->size = e - s;
>  	newblk1->owner = owner;
>
> @@ -577,7 +590,11 @@ void *rh_alloc_fixed(rh_info_t * info, void  
> *start, int size, const char *owner)
>  	return start;
>  }
>
> -int rh_free(rh_info_t * info, void *start)
> +/* Deallocate the memory previously allocated by one of the  
> rh_alloc functions.
> + * The return value is the size of the deallocated block, or a  
> negative number
> + * if there is an error.
> + */
> +int rh_free(rh_info_t * info, unsigned long start)
>  {
>  	rh_block_t *blk, *blk2;
>  	struct list_head *l;
> @@ -642,7 +659,7 @@ int rh_get_stats(rh_info_t * info, int what,  
> int max_stats, rh_stats_t * stats)
>  	return nr;
>  }
>
> -int rh_set_owner(rh_info_t * info, void *start, const char *owner)
> +int rh_set_owner(rh_info_t * info, unsigned long start, const char  
> *owner)
>  {
>  	rh_block_t *blk, *blk2;
>  	struct list_head *l;
> @@ -684,8 +701,8 @@ void rh_dump(rh_info_t * info)
>  		nr = maxnr;
>  	for (i = 0; i < nr; i++)
>  		printk(KERN_INFO
> -		       "    0x%p-0x%p (%u)\n",
> -		       st[i].start, (int8_t *) st[i].start + st[i].size,
> +		       "    0x%lx-0x%lx (%u)\n",
> +		       st[i].start, st[i].start + st[i].size,
>  		       st[i].size);
>  	printk(KERN_INFO "\n");
>
> @@ -695,8 +712,8 @@ void rh_dump(rh_info_t * info)
>  		nr = maxnr;
>  	for (i = 0; i < nr; i++)
>  		printk(KERN_INFO
> -		       "    0x%p-0x%p (%u) %s\n",
> -		       st[i].start, (int8_t *) st[i].start + st[i].size,
> +		       "    0x%lx-0x%lx (%u) %s\n",
> +		       st[i].start, st[i].start + st[i].size,
>  		       st[i].size, st[i].owner != NULL ? st[i].owner : "");
>  	printk(KERN_INFO "\n");
>  }
> @@ -704,6 +721,6 @@ void rh_dump(rh_info_t * info)
>  void rh_dump_blk(rh_info_t * info, rh_block_t * blk)
>  {
>  	printk(KERN_INFO
> -	       "blk @0x%p: 0x%p-0x%p (%u)\n",
> -	       blk, blk->start, (int8_t *) blk->start + blk->size, blk- 
> >size);
> +	       "blk @0x%p: 0x%lx-0x%lx (%u)\n",
> +	       blk, blk->start, blk->start + blk->size, blk->size);
>  }
> diff --git a/arch/powerpc/sysdev/commproc.c b/arch/powerpc/sysdev/ 
> commproc.c
> index 9b4fafd..4f67b89 100644
> --- a/arch/powerpc/sysdev/commproc.c
> +++ b/arch/powerpc/sysdev/commproc.c
> @@ -330,7 +330,7 @@ void m8xx_cpm_dpinit(void)
>  	 * with the processor and the microcode patches applied / activated.
>  	 * But the following should be at least safe.
>  	 */
> -	rh_attach_region(&cpm_dpmem_info, (void *)CPM_DATAONLY_BASE,  
> CPM_DATAONLY_SIZE);
> +	rh_attach_region(&cpm_dpmem_info, CPM_DATAONLY_BASE,  
> CPM_DATAONLY_SIZE);
>  }
>
>  /*
> @@ -338,9 +338,9 @@ void m8xx_cpm_dpinit(void)
>   * This function returns an offset into the DPRAM area.
>   * Use cpm_dpram_addr() to get the virtual address of the area.
>   */
> -uint cpm_dpalloc(uint size, uint align)
> +unsigned long cpm_dpalloc(uint size, uint align)
>  {
> -	void *start;
> +	unsigned long start;
>  	unsigned long flags;
>
>  	spin_lock_irqsave(&cpm_dpmem_lock, flags);
> @@ -352,30 +352,30 @@ uint cpm_dpalloc(uint size, uint align)
>  }
>  EXPORT_SYMBOL(cpm_dpalloc);
>
> -int cpm_dpfree(uint offset)
> +int cpm_dpfree(unsigned long offset)
>  {
>  	int ret;
>  	unsigned long flags;
>
>  	spin_lock_irqsave(&cpm_dpmem_lock, flags);
> -	ret = rh_free(&cpm_dpmem_info, (void *)offset);
> +	ret = rh_free(&cpm_dpmem_info, offset);
>  	spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
>
>  	return ret;
>  }
>  EXPORT_SYMBOL(cpm_dpfree);
>
> -uint cpm_dpalloc_fixed(uint offset, uint size, uint align)
> +unsigned long cpm_dpalloc_fixed(unsigned long offset, uint size,  
> uint align)
>  {
> -	void *start;
> +	unsigned long start;
>  	unsigned long flags;
>
>  	spin_lock_irqsave(&cpm_dpmem_lock, flags);
>  	cpm_dpmem_info.alignment = align;
> -	start = rh_alloc_fixed(&cpm_dpmem_info, (void *)offset, size,  
> "commproc");
> +	start = rh_alloc_fixed(&cpm_dpmem_info, offset, size, "commproc");
>  	spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
>
> -	return (uint)start;
> +	return start;
>  }
>  EXPORT_SYMBOL(cpm_dpalloc_fixed);
>
> @@ -385,7 +385,7 @@ void cpm_dpdump(void)
>  }
>  EXPORT_SYMBOL(cpm_dpdump);
>
> -void *cpm_dpram_addr(uint offset)
> +void *cpm_dpram_addr(unsigned long offset)
>  {
>  	return (void *)(dpram_vbase + offset);
>  }
> diff --git a/arch/powerpc/sysdev/cpm2_common.c b/arch/powerpc/ 
> sysdev/cpm2_common.c
> index ec26599..9244129 100644
> --- a/arch/powerpc/sysdev/cpm2_common.c
> +++ b/arch/powerpc/sysdev/cpm2_common.c
> @@ -248,15 +248,14 @@ static void cpm2_dpinit(void)
>  	 * varies with the processor and the microcode patches activated.
>  	 * But the following should be at least safe.
>  	 */
> -	rh_attach_region(&cpm_dpmem_info, (void *)CPM_DATAONLY_BASE,
> -			CPM_DATAONLY_SIZE);
> +	rh_attach_region(&cpm_dpmem_info, CPM_DATAONLY_BASE,  
> CPM_DATAONLY_SIZE);
>  }
>
>  /* This function returns an index into the DPRAM area.
>   */
> -uint cpm_dpalloc(uint size, uint align)
> +unsigned long cpm_dpalloc(uint size, uint align)
>  {
> -	void *start;
> +	unsigned long start;
>  	unsigned long flags;
>
>  	spin_lock_irqsave(&cpm_dpmem_lock, flags);
> @@ -268,13 +267,13 @@ uint cpm_dpalloc(uint size, uint align)
>  }
>  EXPORT_SYMBOL(cpm_dpalloc);
>
> -int cpm_dpfree(uint offset)
> +int cpm_dpfree(unsigned long offset)
>  {
>  	int ret;
>  	unsigned long flags;
>
>  	spin_lock_irqsave(&cpm_dpmem_lock, flags);
> -	ret = rh_free(&cpm_dpmem_info, (void *)offset);
> +	ret = rh_free(&cpm_dpmem_info, offset);
>  	spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
>
>  	return ret;
> @@ -282,17 +281,17 @@ int cpm_dpfree(uint offset)
>  EXPORT_SYMBOL(cpm_dpfree);
>
>  /* not sure if this is ever needed */
> -uint cpm_dpalloc_fixed(uint offset, uint size, uint align)
> +unsigned long cpm_dpalloc_fixed(unsigned long offset, uint size,  
> uint align)
>  {
> -	void *start;
> +	unsigned long start;
>  	unsigned long flags;
>
>  	spin_lock_irqsave(&cpm_dpmem_lock, flags);
>  	cpm_dpmem_info.alignment = align;
> -	start = rh_alloc_fixed(&cpm_dpmem_info, (void *)offset, size,  
> "commproc");
> +	start = rh_alloc_fixed(&cpm_dpmem_info, offset, size, "commproc");
>  	spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
>
> -	return (uint)start;
> +	return start;
>  }
>  EXPORT_SYMBOL(cpm_dpalloc_fixed);
>
> @@ -302,7 +301,7 @@ void cpm_dpdump(void)
>  }
>  EXPORT_SYMBOL(cpm_dpdump);
>
> -void *cpm_dpram_addr(uint offset)
> +void *cpm_dpram_addr(unsigned long offset)
>  {
>  	return (void *)(im_dprambase + offset);
>  }
> diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/ 
> qe_lib/qe.c
> index e3d71e0..28dc1aa 100644
> --- a/arch/powerpc/sysdev/qe_lib/qe.c
> +++ b/arch/powerpc/sysdev/qe_lib/qe.c
> @@ -244,7 +244,7 @@ EXPORT_SYMBOL(qe_put_snum);
>  static int qe_sdma_init(void)
>  {
>  	struct sdma *sdma = &qe_immr->sdma;
> -	u32 sdma_buf_offset;
> +	unsigned long sdma_buf_offset;
>
>  	if (!sdma)
>  		return -ENODEV;
> @@ -252,10 +252,10 @@ static int qe_sdma_init(void)
>  	/* allocate 2 internal temporary buffers (512 bytes size each) for
>  	 * the SDMA */
>  	sdma_buf_offset = qe_muram_alloc(512 * 2, 64);
> -	if (IS_MURAM_ERR(sdma_buf_offset))
> +	if (IS_ERR_VALUE(sdma_buf_offset))
>  		return -ENOMEM;
>
> -	out_be32(&sdma->sdebcr, sdma_buf_offset & QE_SDEBCR_BA_MASK);
> +	out_be32(&sdma->sdebcr, (u32) sdma_buf_offset & QE_SDEBCR_BA_MASK);
>  	out_be32(&sdma->sdmr, (QE_SDMR_GLB_1_MSK | (0x1 >>
>  					QE_SDMR_CEN_SHIFT)));
>
> @@ -291,33 +291,32 @@ static void qe_muram_init(void)
>  	if ((np = of_find_node_by_name(NULL, "data-only")) != NULL) {
>  		address = *of_get_address(np, 0, &size, &flags);
>  		of_node_put(np);
> -		rh_attach_region(&qe_muram_info,
> -			(void *)address, (int)size);
> +		rh_attach_region(&qe_muram_info, address, (int) size);
>  	}
>  }
>
>  /* This function returns an index into the MURAM area.
>   */
> -u32 qe_muram_alloc(u32 size, u32 align)
> +unsigned long qe_muram_alloc(int size, int align)
>  {
> -	void *start;
> +	unsigned long start;
>  	unsigned long flags;
>
>  	spin_lock_irqsave(&qe_muram_lock, flags);
>  	start = rh_alloc_align(&qe_muram_info, size, align, "QE");
>  	spin_unlock_irqrestore(&qe_muram_lock, flags);
>
> -	return (u32) start;
> +	return start;
>  }
>  EXPORT_SYMBOL(qe_muram_alloc);
>
> -int qe_muram_free(u32 offset)
> +int qe_muram_free(unsigned long offset)
>  {
>  	int ret;
>  	unsigned long flags;
>
>  	spin_lock_irqsave(&qe_muram_lock, flags);
> -	ret = rh_free(&qe_muram_info, (void *)offset);
> +	ret = rh_free(&qe_muram_info, offset);
>  	spin_unlock_irqrestore(&qe_muram_lock, flags);
>
>  	return ret;
> @@ -325,16 +324,16 @@ int qe_muram_free(u32 offset)
>  EXPORT_SYMBOL(qe_muram_free);
>
>  /* not sure if this is ever needed */
> -u32 qe_muram_alloc_fixed(u32 offset, u32 size)
> +unsigned long qe_muram_alloc_fixed(unsigned long offset, int size)
>  {
> -	void *start;
> +	unsigned long start;
>  	unsigned long flags;
>
>  	spin_lock_irqsave(&qe_muram_lock, flags);
> -	start = rh_alloc_fixed(&qe_muram_info, (void *)offset, size,  
> "commproc");
> +	start = rh_alloc_fixed(&qe_muram_info, offset, size, "commproc");
>  	spin_unlock_irqrestore(&qe_muram_lock, flags);
>
> -	return (u32) start;
> +	return start;
>  }
>  EXPORT_SYMBOL(qe_muram_alloc_fixed);
>
> @@ -344,7 +343,7 @@ void qe_muram_dump(void)
>  }
>  EXPORT_SYMBOL(qe_muram_dump);
>
> -void *qe_muram_addr(u32 offset)
> +void *qe_muram_addr(unsigned long offset)
>  {
>  	return (void *)&qe_immr->muram[offset];
>  }
> diff --git a/arch/powerpc/sysdev/qe_lib/ucc_fast.c b/arch/powerpc/ 
> sysdev/qe_lib/ucc_fast.c
> index a457ac1..a8e3063 100644
> --- a/arch/powerpc/sysdev/qe_lib/ucc_fast.c
> +++ b/arch/powerpc/sysdev/qe_lib/ucc_fast.c
> @@ -18,6 +18,7 @@
>  #include <linux/slab.h>
>  #include <linux/stddef.h>
>  #include <linux/interrupt.h>
> +#include <linux/err.h>
>
>  #include <asm/io.h>
>  #include <asm/immap_qe.h>
> @@ -265,7 +266,7 @@ int ucc_fast_init(struct ucc_fast_info *  
> uf_info, struct ucc_fast_private ** ucc
>  	/* Allocate memory for Tx Virtual Fifo */
>  	uccf->ucc_fast_tx_virtual_fifo_base_offset =
>  	    qe_muram_alloc(uf_info->utfs,  
> UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT);
> -	if (IS_MURAM_ERR(uccf->ucc_fast_tx_virtual_fifo_base_offset)) {
> +	if (IS_ERR_VALUE(uccf->ucc_fast_tx_virtual_fifo_base_offset)) {
>  		printk(KERN_ERR "%s: cannot allocate MURAM for TX FIFO",  
> __FUNCTION__);
>  		uccf->ucc_fast_tx_virtual_fifo_base_offset = 0;
>  		ucc_fast_free(uccf);
> @@ -277,7 +278,7 @@ int ucc_fast_init(struct ucc_fast_info *  
> uf_info, struct ucc_fast_private ** ucc
>  		qe_muram_alloc(uf_info->urfs +
>  			   UCC_FAST_RECEIVE_VIRTUAL_FIFO_SIZE_FUDGE_FACTOR,
>  			   UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT);
> -	if (IS_MURAM_ERR(uccf->ucc_fast_rx_virtual_fifo_base_offset)) {
> +	if (IS_ERR_VALUE(uccf->ucc_fast_rx_virtual_fifo_base_offset)) {
>  		printk(KERN_ERR "%s: cannot allocate MURAM for RX FIFO",  
> __FUNCTION__);
>  		uccf->ucc_fast_rx_virtual_fifo_base_offset = 0;
>  		ucc_fast_free(uccf);
> diff --git a/arch/powerpc/sysdev/qe_lib/ucc_slow.c b/arch/powerpc/ 
> sysdev/qe_lib/ucc_slow.c
> index b930d68..1f65c26 100644
> --- a/arch/powerpc/sysdev/qe_lib/ucc_slow.c
> +++ b/arch/powerpc/sysdev/qe_lib/ucc_slow.c
> @@ -18,6 +18,7 @@
>  #include <linux/slab.h>
>  #include <linux/stddef.h>
>  #include <linux/interrupt.h>
> +#include <linux/err.h>
>
>  #include <asm/io.h>
>  #include <asm/immap_qe.h>
> @@ -175,7 +176,7 @@ int ucc_slow_init(struct ucc_slow_info *  
> us_info, struct ucc_slow_private ** ucc
>  	/* Get PRAM base */
>  	uccs->us_pram_offset =
>  		qe_muram_alloc(UCC_SLOW_PRAM_SIZE, ALIGNMENT_OF_UCC_SLOW_PRAM);
> -	if (IS_MURAM_ERR(uccs->us_pram_offset)) {
> +	if (IS_ERR_VALUE(uccs->us_pram_offset)) {
>  		printk(KERN_ERR "%s: cannot allocate MURAM for PRAM",  
> __FUNCTION__);
>  		ucc_slow_free(uccs);
>  		return -ENOMEM;
> @@ -210,7 +211,7 @@ int ucc_slow_init(struct ucc_slow_info *  
> us_info, struct ucc_slow_private ** ucc
>  	uccs->rx_base_offset =
>  		qe_muram_alloc(us_info->rx_bd_ring_len * sizeof(struct qe_bd),
>  				QE_ALIGNMENT_OF_BD);
> -	if (IS_MURAM_ERR(uccs->rx_base_offset)) {
> +	if (IS_ERR_VALUE(uccs->rx_base_offset)) {
>  		printk(KERN_ERR "%s: cannot allocate RX BDs", __FUNCTION__);
>  		uccs->rx_base_offset = 0;
>  		ucc_slow_free(uccs);
> @@ -220,7 +221,7 @@ int ucc_slow_init(struct ucc_slow_info *  
> us_info, struct ucc_slow_private ** ucc
>  	uccs->tx_base_offset =
>  		qe_muram_alloc(us_info->tx_bd_ring_len * sizeof(struct qe_bd),
>  			QE_ALIGNMENT_OF_BD);
> -	if (IS_MURAM_ERR(uccs->tx_base_offset)) {
> +	if (IS_ERR_VALUE(uccs->tx_base_offset)) {
>  		printk(KERN_ERR "%s: cannot allocate TX BDs", __FUNCTION__);
>  		uccs->tx_base_offset = 0;
>  		ucc_slow_free(uccs);
> diff --git a/arch/ppc/8xx_io/commproc.c b/arch/ppc/8xx_io/commproc.c
> index 3b23bcb..50cee10 100644
> --- a/arch/ppc/8xx_io/commproc.c
> +++ b/arch/ppc/8xx_io/commproc.c
> @@ -382,7 +382,7 @@ void m8xx_cpm_dpinit(void)
>  	 * with the processor and the microcode patches applied / activated.
>  	 * But the following should be at least safe.
>  	 */
> -	rh_attach_region(&cpm_dpmem_info, (void *)CPM_DATAONLY_BASE,  
> CPM_DATAONLY_SIZE);
> +	rh_attach_region(&cpm_dpmem_info, CPM_DATAONLY_BASE,  
> CPM_DATAONLY_SIZE);
>  }
>
>  /*
> @@ -390,9 +390,9 @@ void m8xx_cpm_dpinit(void)
>   * This function returns an offset into the DPRAM area.
>   * Use cpm_dpram_addr() to get the virtual address of the area.
>   */
> -uint cpm_dpalloc(uint size, uint align)
> +unsigned long cpm_dpalloc(uint size, uint align)
>  {
> -	void *start;
> +	unsigned long start;
>  	unsigned long flags;
>
>  	spin_lock_irqsave(&cpm_dpmem_lock, flags);
> @@ -400,34 +400,34 @@ uint cpm_dpalloc(uint size, uint align)
>  	start = rh_alloc(&cpm_dpmem_info, size, "commproc");
>  	spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
>
> -	return (uint)start;
> +	return start;
>  }
>  EXPORT_SYMBOL(cpm_dpalloc);
>
> -int cpm_dpfree(uint offset)
> +int cpm_dpfree(unsigned long offset)
>  {
>  	int ret;
>  	unsigned long flags;
>
>  	spin_lock_irqsave(&cpm_dpmem_lock, flags);
> -	ret = rh_free(&cpm_dpmem_info, (void *)offset);
> +	ret = rh_free(&cpm_dpmem_info, offset);
>  	spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
>
>  	return ret;
>  }
>  EXPORT_SYMBOL(cpm_dpfree);
>
> -uint cpm_dpalloc_fixed(uint offset, uint size, uint align)
> +unsigned long cpm_dpalloc_fixed(unsigned long offset, uint size,  
> uint align)
>  {
> -	void *start;
> +	unsigned long start;
>  	unsigned long flags;
>
>  	spin_lock_irqsave(&cpm_dpmem_lock, flags);
>  	cpm_dpmem_info.alignment = align;
> -	start = rh_alloc_fixed(&cpm_dpmem_info, (void *)offset, size,  
> "commproc");
> +	start = rh_alloc_fixed(&cpm_dpmem_info, offset, size, "commproc");
>  	spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
>
> -	return (uint)start;
> +	return start;
>  }
>  EXPORT_SYMBOL(cpm_dpalloc_fixed);
>
> @@ -437,7 +437,7 @@ void cpm_dpdump(void)
>  }
>  EXPORT_SYMBOL(cpm_dpdump);
>
> -void *cpm_dpram_addr(uint offset)
> +void *cpm_dpram_addr(unsigned long offset)
>  {
>  	return ((immap_t *)IMAP_ADDR)->im_cpm.cp_dpmem + offset;
>  }
> diff --git a/arch/ppc/lib/rheap.c b/arch/ppc/lib/rheap.c
> index d407007..9dc2f34 100644
> --- a/arch/ppc/lib/rheap.c
> +++ b/arch/ppc/lib/rheap.c
> @@ -132,7 +132,7 @@ static rh_block_t *get_slot(rh_info_t * info)
>  	info->empty_slots--;
>
>  	/* Initialize */
> -	blk->start = NULL;
> +	blk->start = 0;
>  	blk->size = 0;
>  	blk->owner = NULL;
>
> @@ -157,7 +157,7 @@ static void attach_free_block(rh_info_t * info,  
> rh_block_t * blkn)
>
>  	/* We assume that they are aligned properly */
>  	size = blkn->size;
> -	s = (unsigned long)blkn->start;
> +	s = blkn->start;
>  	e = s + size;
>
>  	/* Find the blocks immediately before and after the given one
> @@ -169,7 +169,7 @@ static void attach_free_block(rh_info_t * info,  
> rh_block_t * blkn)
>  	list_for_each(l, &info->free_list) {
>  		blk = list_entry(l, rh_block_t, list);
>
> -		bs = (unsigned long)blk->start;
> +		bs = blk->start;
>  		be = bs + blk->size;
>
>  		if (next == NULL && s >= bs)
> @@ -187,10 +187,10 @@ static void attach_free_block(rh_info_t *  
> info, rh_block_t * blkn)
>  	}
>
>  	/* Now check if they are really adjacent */
> -	if (before != NULL && s != (unsigned long)before->start + before- 
> >size)
> +	if (before && s != (before->start + before->size))
>  		before = NULL;
>
> -	if (after != NULL && e != (unsigned long)after->start)
> +	if (after && e != after->start)
>  		after = NULL;
>
>  	/* No coalescing; list insert and return */
> @@ -215,7 +215,7 @@ static void attach_free_block(rh_info_t * info,  
> rh_block_t * blkn)
>
>  	/* Grow the after block backwards */
>  	if (before == NULL && after != NULL) {
> -		after->start = (int8_t *)after->start - size;
> +		after->start -= size;
>  		after->size += size;
>  		return;
>  	}
> @@ -320,14 +320,14 @@ void rh_init(rh_info_t * info, unsigned int  
> alignment, int max_blocks,
>  }
>
>  /* Attach a free memory region, coalesces regions if adjuscent */
> -int rh_attach_region(rh_info_t * info, void *start, int size)
> +int rh_attach_region(rh_info_t * info, unsigned long start, int size)
>  {
>  	rh_block_t *blk;
>  	unsigned long s, e, m;
>  	int r;
>
>  	/* The region must be aligned */
> -	s = (unsigned long)start;
> +	s = start;
>  	e = s + size;
>  	m = info->alignment - 1;
>
> @@ -337,9 +337,12 @@ int rh_attach_region(rh_info_t * info, void  
> *start, int size)
>  	/* Round end down */
>  	e = e & ~m;
>
> +	if (IS_ERR_VALUE(e) || (e < s))
> +		return -ERANGE;
> +
>  	/* Take final values */
> -	start = (void *)s;
> -	size = (int)(e - s);
> +	start = s;
> +	size = e - s;
>
>  	/* Grow the blocks, if needed */
>  	r = assure_empty(info, 1);
> @@ -357,7 +360,7 @@ int rh_attach_region(rh_info_t * info, void  
> *start, int size)
>  }
>
>  /* Detatch given address range, splits free block if needed. */
> -void *rh_detach_region(rh_info_t * info, void *start, int size)
> +unsigned long rh_detach_region(rh_info_t * info, unsigned long  
> start, int size)
>  {
>  	struct list_head *l;
>  	rh_block_t *blk, *newblk;
> @@ -365,10 +368,10 @@ void *rh_detach_region(rh_info_t * info, void  
> *start, int size)
>
>  	/* Validate size */
>  	if (size <= 0)
> -		return ERR_PTR(-EINVAL);
> +		return (unsigned long) -EINVAL;
>
>  	/* The region must be aligned */
> -	s = (unsigned long)start;
> +	s = start;
>  	e = s + size;
>  	m = info->alignment - 1;
>
> @@ -379,34 +382,34 @@ void *rh_detach_region(rh_info_t * info, void  
> *start, int size)
>  	e = e & ~m;
>
>  	if (assure_empty(info, 1) < 0)
> -		return ERR_PTR(-ENOMEM);
> +		return (unsigned long) -ENOMEM;
>
>  	blk = NULL;
>  	list_for_each(l, &info->free_list) {
>  		blk = list_entry(l, rh_block_t, list);
>  		/* The range must lie entirely inside one free block */
> -		bs = (unsigned long)blk->start;
> -		be = (unsigned long)blk->start + blk->size;
> +		bs = blk->start;
> +		be = blk->start + blk->size;
>  		if (s >= bs && e <= be)
>  			break;
>  		blk = NULL;
>  	}
>
>  	if (blk == NULL)
> -		return ERR_PTR(-ENOMEM);
> +		return (unsigned long) -ENOMEM;
>
>  	/* Perfect fit */
>  	if (bs == s && be == e) {
>  		/* Delete from free list, release slot */
>  		list_del(&blk->list);
>  		release_slot(info, blk);
> -		return (void *)s;
> +		return s;
>  	}
>
>  	/* blk still in free list, with updated start and/or size */
>  	if (bs == s || be == e) {
>  		if (bs == s)
> -			blk->start = (int8_t *)blk->start + size;
> +			blk->start += size;
>  		blk->size -= size;
>
>  	} else {
> @@ -415,31 +418,31 @@ void *rh_detach_region(rh_info_t * info, void  
> *start, int size)
>
>  		/* the back free fragment */
>  		newblk = get_slot(info);
> -		newblk->start = (void *)e;
> +		newblk->start = e;
>  		newblk->size = be - e;
>
>  		list_add(&newblk->list, &blk->list);
>  	}
>
> -	return (void *)s;
> +	return s;
>  }
>
> -void *rh_alloc(rh_info_t * info, int size, const char *owner)
> +unsigned long rh_alloc(rh_info_t * info, int size, const char *owner)
>  {
>  	struct list_head *l;
>  	rh_block_t *blk;
>  	rh_block_t *newblk;
> -	void *start;
> +	unsigned long start;
>
>  	/* Validate size */
>  	if (size <= 0)
> -		return ERR_PTR(-EINVAL);
> +		return (unsigned long) -EINVAL;
>
>  	/* Align to configured alignment */
>  	size = (size + (info->alignment - 1)) & ~(info->alignment - 1);
>
>  	if (assure_empty(info, 1) < 0)
> -		return ERR_PTR(-ENOMEM);
> +		return (unsigned long) -ENOMEM;
>
>  	blk = NULL;
>  	list_for_each(l, &info->free_list) {
> @@ -450,7 +453,7 @@ void *rh_alloc(rh_info_t * info, int size,  
> const char *owner)
>  	}
>
>  	if (blk == NULL)
> -		return ERR_PTR(-ENOMEM);
> +		return (unsigned long) -ENOMEM;
>
>  	/* Just fits */
>  	if (blk->size == size) {
> @@ -470,7 +473,7 @@ void *rh_alloc(rh_info_t * info, int size,  
> const char *owner)
>  	newblk->owner = owner;
>
>  	/* blk still in free list, with updated start, size */
> -	blk->start = (int8_t *)blk->start + size;
> +	blk->start += size;
>  	blk->size -= size;
>
>  	start = newblk->start;
> @@ -481,18 +484,18 @@ void *rh_alloc(rh_info_t * info, int size,  
> const char *owner)
>  }
>
>  /* allocate at precisely the given address */
> -void *rh_alloc_fixed(rh_info_t * info, void *start, int size,  
> const char *owner)
> +unsigned long rh_alloc_fixed(rh_info_t * info, unsigned long  
> start, int size, const char *owner)
>  {
>  	struct list_head *l;
>  	rh_block_t *blk, *newblk1, *newblk2;
> -	unsigned long s, e, m, bs, be;
> +	unsigned long s, e, m, bs=0, be=0;
>
>  	/* Validate size */
>  	if (size <= 0)
> -		return ERR_PTR(-EINVAL);
> +		return (unsigned long) -EINVAL;
>
>  	/* The region must be aligned */
> -	s = (unsigned long)start;
> +	s = start;
>  	e = s + size;
>  	m = info->alignment - 1;
>
> @@ -503,20 +506,20 @@ void *rh_alloc_fixed(rh_info_t * info, void  
> *start, int size, const char *owner)
>  	e = e & ~m;
>
>  	if (assure_empty(info, 2) < 0)
> -		return ERR_PTR(-ENOMEM);
> +		return (unsigned long) -ENOMEM;
>
>  	blk = NULL;
>  	list_for_each(l, &info->free_list) {
>  		blk = list_entry(l, rh_block_t, list);
>  		/* The range must lie entirely inside one free block */
> -		bs = (unsigned long)blk->start;
> -		be = (unsigned long)blk->start + blk->size;
> +		bs = blk->start;
> +		be = blk->start + blk->size;
>  		if (s >= bs && e <= be)
>  			break;
>  	}
>
>  	if (blk == NULL)
> -		return ERR_PTR(-ENOMEM);
> +		return (unsigned long) -ENOMEM;
>
>  	/* Perfect fit */
>  	if (bs == s && be == e) {
> @@ -534,7 +537,7 @@ void *rh_alloc_fixed(rh_info_t * info, void  
> *start, int size, const char *owner)
>  	/* blk still in free list, with updated start and/or size */
>  	if (bs == s || be == e) {
>  		if (bs == s)
> -			blk->start = (int8_t *)blk->start + size;
> +			blk->start += size;
>  		blk->size -= size;
>
>  	} else {
> @@ -543,14 +546,14 @@ void *rh_alloc_fixed(rh_info_t * info, void  
> *start, int size, const char *owner)
>
>  		/* The back free fragment */
>  		newblk2 = get_slot(info);
> -		newblk2->start = (void *)e;
> +		newblk2->start = e;
>  		newblk2->size = be - e;
>
>  		list_add(&newblk2->list, &blk->list);
>  	}
>
>  	newblk1 = get_slot(info);
> -	newblk1->start = (void *)s;
> +	newblk1->start = s;
>  	newblk1->size = e - s;
>  	newblk1->owner = owner;
>
> @@ -560,7 +563,7 @@ void *rh_alloc_fixed(rh_info_t * info, void  
> *start, int size, const char *owner)
>  	return start;
>  }
>
> -int rh_free(rh_info_t * info, void *start)
> +int rh_free(rh_info_t * info, unsigned long start)
>  {
>  	rh_block_t *blk, *blk2;
>  	struct list_head *l;
> @@ -625,7 +628,7 @@ int rh_get_stats(rh_info_t * info, int what,  
> int max_stats, rh_stats_t * stats)
>  	return nr;
>  }
>
> -int rh_set_owner(rh_info_t * info, void *start, const char *owner)
> +int rh_set_owner(rh_info_t * info, unsigned long start, const char  
> *owner)
>  {
>  	rh_block_t *blk, *blk2;
>  	struct list_head *l;
> @@ -667,8 +670,8 @@ void rh_dump(rh_info_t * info)
>  		nr = maxnr;
>  	for (i = 0; i < nr; i++)
>  		printk(KERN_INFO
> -		       "    0x%p-0x%p (%u)\n",
> -		       st[i].start, (int8_t *) st[i].start + st[i].size,
> +		       "    0x%lx-0x%lx (%u)\n",
> +		       st[i].start, st[i].start + st[i].size,
>  		       st[i].size);
>  	printk(KERN_INFO "\n");
>
> @@ -678,8 +681,8 @@ void rh_dump(rh_info_t * info)
>  		nr = maxnr;
>  	for (i = 0; i < nr; i++)
>  		printk(KERN_INFO
> -		       "    0x%p-0x%p (%u) %s\n",
> -		       st[i].start, (int8_t *) st[i].start + st[i].size,
> +		       "    0x%lx-0x%lx (%u) %s\n",
> +		       st[i].start, st[i].start + st[i].size,
>  		       st[i].size, st[i].owner != NULL ? st[i].owner : "");
>  	printk(KERN_INFO "\n");
>  }
> @@ -687,6 +690,6 @@ void rh_dump(rh_info_t * info)
>  void rh_dump_blk(rh_info_t * info, rh_block_t * blk)
>  {
>  	printk(KERN_INFO
> -	       "blk @0x%p: 0x%p-0x%p (%u)\n",
> -	       blk, blk->start, (int8_t *) blk->start + blk->size, blk- 
> >size);
> +	       "blk @0x%p: 0x%lx-0x%lx (%u)\n",
> +	       blk, blk->start, blk->start + blk->size, blk->size);
>  }
> diff --git a/arch/ppc/syslib/cpm2_common.c b/arch/ppc/syslib/ 
> cpm2_common.c
> index cbac44b..6cd859d 100644
> --- a/arch/ppc/syslib/cpm2_common.c
> +++ b/arch/ppc/syslib/cpm2_common.c
> @@ -136,15 +136,14 @@ static void cpm2_dpinit(void)
>  	 * varies with the processor and the microcode patches activated.
>  	 * But the following should be at least safe.
>  	 */
> -	rh_attach_region(&cpm_dpmem_info, (void *)CPM_DATAONLY_BASE,
> -			CPM_DATAONLY_SIZE);
> +	rh_attach_region(&cpm_dpmem_info, CPM_DATAONLY_BASE,  
> CPM_DATAONLY_SIZE);
>  }
>
>  /* This function returns an index into the DPRAM area.
>   */
> -uint cpm_dpalloc(uint size, uint align)
> +unsigned long cpm_dpalloc(uint size, uint align)
>  {
> -	void *start;
> +	unsigned long start;
>  	unsigned long flags;
>
>  	spin_lock_irqsave(&cpm_dpmem_lock, flags);
> @@ -152,17 +151,17 @@ uint cpm_dpalloc(uint size, uint align)
>  	start = rh_alloc(&cpm_dpmem_info, size, "commproc");
>  	spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
>
> -	return (uint)start;
> +	return start;
>  }
>  EXPORT_SYMBOL(cpm_dpalloc);
>
> -int cpm_dpfree(uint offset)
> +int cpm_dpfree(unsigned long offset)
>  {
>  	int ret;
>  	unsigned long flags;
>
>  	spin_lock_irqsave(&cpm_dpmem_lock, flags);
> -	ret = rh_free(&cpm_dpmem_info, (void *)offset);
> +	ret = rh_free(&cpm_dpmem_info, offset);
>  	spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
>
>  	return ret;
> @@ -170,17 +169,17 @@ int cpm_dpfree(uint offset)
>  EXPORT_SYMBOL(cpm_dpfree);
>
>  /* not sure if this is ever needed */
> -uint cpm_dpalloc_fixed(uint offset, uint size, uint align)
> +unsigned long cpm_dpalloc_fixed(unsigned long offset, uint size,  
> uint align)
>  {
> -	void *start;
> +	unsigned long start;
>  	unsigned long flags;
>
>  	spin_lock_irqsave(&cpm_dpmem_lock, flags);
>  	cpm_dpmem_info.alignment = align;
> -	start = rh_alloc_fixed(&cpm_dpmem_info, (void *)offset, size,  
> "commproc");
> +	start = rh_alloc_fixed(&cpm_dpmem_info, offset, size, "commproc");
>  	spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
>
> -	return (uint)start;
> +	return start;
>  }
>  EXPORT_SYMBOL(cpm_dpalloc_fixed);
>
> @@ -190,7 +189,7 @@ void cpm_dpdump(void)
>  }
>  EXPORT_SYMBOL(cpm_dpdump);
>
> -void *cpm_dpram_addr(uint offset)
> +void *cpm_dpram_addr(unsigned long offset)
>  {
>  	return (void *)&cpm2_immr->im_dprambase[offset];
>  }
> diff --git a/drivers/net/fs_enet/mac-scc.c b/drivers/net/fs_enet/ 
> mac-scc.c
> index 65925b5..c315aa4 100644
> --- a/drivers/net/fs_enet/mac-scc.c
> +++ b/drivers/net/fs_enet/mac-scc.c
> @@ -168,7 +168,7 @@ static int allocate_bd(struct net_device *dev)
>
>  	fep->ring_mem_addr = cpm_dpalloc((fpi->tx_ring + fpi->rx_ring) *
>  					 sizeof(cbd_t), 8);
> -	if (IS_DPERR(fep->ring_mem_addr))
> +	if (IS_ERR_VALUE(fep->ring_mem_addr))
>  		return -ENOMEM;
>
>  	fep->ring_base = cpm_dpram_addr(fep->ring_mem_addr);
> diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
> index dab88b9..f024bbe 100644
> --- a/drivers/net/ucc_geth.c
> +++ b/drivers/net/ucc_geth.c
> @@ -364,7 +364,7 @@ static int fill_init_enet_entries(struct  
> ucc_geth_private *ugeth,
>  		else {
>  			init_enet_offset =
>  			    qe_muram_alloc(thread_size, thread_alignment);
> -			if (IS_MURAM_ERR(init_enet_offset)) {
> +			if (IS_ERR_VALUE(init_enet_offset)) {
>  				ugeth_err
>  		("fill_init_enet_entries: Can not allocate DPRAM memory.");
>  				qe_put_snum((u8) snum);
> @@ -2814,7 +2814,7 @@ static int ucc_geth_startup(struct  
> ucc_geth_private *ugeth)
>  			ugeth->tx_bd_ring_offset[j] =
>  			    qe_muram_alloc(length,
>  					   UCC_GETH_TX_BD_RING_ALIGNMENT);
> -			if (!IS_MURAM_ERR(ugeth->tx_bd_ring_offset[j]))
> +			if (!IS_ERR_VALUE(ugeth->tx_bd_ring_offset[j]))
>  				ugeth->p_tx_bd_ring[j] =
>  				    (u8 *) qe_muram_addr(ugeth->
>  							 tx_bd_ring_offset[j]);
> @@ -2849,7 +2849,7 @@ static int ucc_geth_startup(struct  
> ucc_geth_private *ugeth)
>  			ugeth->rx_bd_ring_offset[j] =
>  			    qe_muram_alloc(length,
>  					   UCC_GETH_RX_BD_RING_ALIGNMENT);
> -			if (!IS_MURAM_ERR(ugeth->rx_bd_ring_offset[j]))
> +			if (!IS_ERR_VALUE(ugeth->rx_bd_ring_offset[j]))
>  				ugeth->p_rx_bd_ring[j] =
>  				    (u8 *) qe_muram_addr(ugeth->
>  							 rx_bd_ring_offset[j]);
> @@ -2933,7 +2933,7 @@ static int ucc_geth_startup(struct  
> ucc_geth_private *ugeth)
>  	ugeth->tx_glbl_pram_offset =
>  	    qe_muram_alloc(sizeof(struct ucc_geth_tx_global_pram),
>  			   UCC_GETH_TX_GLOBAL_PRAM_ALIGNMENT);
> -	if (IS_MURAM_ERR(ugeth->tx_glbl_pram_offset)) {
> +	if (IS_ERR_VALUE(ugeth->tx_glbl_pram_offset)) {
>  		ugeth_err
>  		    ("%s: Can not allocate DPRAM memory for p_tx_glbl_pram.",
>  		     __FUNCTION__);
> @@ -2955,7 +2955,7 @@ static int ucc_geth_startup(struct  
> ucc_geth_private *ugeth)
>  			   sizeof(struct ucc_geth_thread_data_tx) +
>  			   32 * (numThreadsTxNumerical == 1),
>  			   UCC_GETH_THREAD_DATA_ALIGNMENT);
> -	if (IS_MURAM_ERR(ugeth->thread_dat_tx_offset)) {
> +	if (IS_ERR_VALUE(ugeth->thread_dat_tx_offset)) {
>  		ugeth_err
>  		    ("%s: Can not allocate DPRAM memory for p_thread_data_tx.",
>  		     __FUNCTION__);
> @@ -2983,7 +2983,7 @@ static int ucc_geth_startup(struct  
> ucc_geth_private *ugeth)
>  	    qe_muram_alloc(ug_info->numQueuesTx *
>  			   sizeof(struct ucc_geth_send_queue_qd),
>  			   UCC_GETH_SEND_QUEUE_QUEUE_DESCRIPTOR_ALIGNMENT);
> -	if (IS_MURAM_ERR(ugeth->send_q_mem_reg_offset)) {
> +	if (IS_ERR_VALUE(ugeth->send_q_mem_reg_offset)) {
>  		ugeth_err
>  		    ("%s: Can not allocate DPRAM memory for p_send_q_mem_reg.",
>  		     __FUNCTION__);
> @@ -3026,7 +3026,7 @@ static int ucc_geth_startup(struct  
> ucc_geth_private *ugeth)
>  		ugeth->scheduler_offset =
>  		    qe_muram_alloc(sizeof(struct ucc_geth_scheduler),
>  				   UCC_GETH_SCHEDULER_ALIGNMENT);
> -		if (IS_MURAM_ERR(ugeth->scheduler_offset)) {
> +		if (IS_ERR_VALUE(ugeth->scheduler_offset)) {
>  			ugeth_err
>  			 ("%s: Can not allocate DPRAM memory for p_scheduler.",
>  			     __FUNCTION__);
> @@ -3074,7 +3074,7 @@ static int ucc_geth_startup(struct  
> ucc_geth_private *ugeth)
>  		    qe_muram_alloc(sizeof
>  				   (struct ucc_geth_tx_firmware_statistics_pram),
>  				   UCC_GETH_TX_STATISTICS_ALIGNMENT);
> -		if (IS_MURAM_ERR(ugeth->tx_fw_statistics_pram_offset)) {
> +		if (IS_ERR_VALUE(ugeth->tx_fw_statistics_pram_offset)) {
>  			ugeth_err
>  			    ("%s: Can not allocate DPRAM memory for"
>  				" p_tx_fw_statistics_pram.", __FUNCTION__);
> @@ -3113,7 +3113,7 @@ static int ucc_geth_startup(struct  
> ucc_geth_private *ugeth)
>  	ugeth->rx_glbl_pram_offset =
>  	    qe_muram_alloc(sizeof(struct ucc_geth_rx_global_pram),
>  			   UCC_GETH_RX_GLOBAL_PRAM_ALIGNMENT);
> -	if (IS_MURAM_ERR(ugeth->rx_glbl_pram_offset)) {
> +	if (IS_ERR_VALUE(ugeth->rx_glbl_pram_offset)) {
>  		ugeth_err
>  		    ("%s: Can not allocate DPRAM memory for p_rx_glbl_pram.",
>  		     __FUNCTION__);
> @@ -3134,7 +3134,7 @@ static int ucc_geth_startup(struct  
> ucc_geth_private *ugeth)
>  	    qe_muram_alloc(numThreadsRxNumerical *
>  			   sizeof(struct ucc_geth_thread_data_rx),
>  			   UCC_GETH_THREAD_DATA_ALIGNMENT);
> -	if (IS_MURAM_ERR(ugeth->thread_dat_rx_offset)) {
> +	if (IS_ERR_VALUE(ugeth->thread_dat_rx_offset)) {
>  		ugeth_err
>  		    ("%s: Can not allocate DPRAM memory for p_thread_data_rx.",
>  		     __FUNCTION__);
> @@ -3157,7 +3157,7 @@ static int ucc_geth_startup(struct  
> ucc_geth_private *ugeth)
>  		    qe_muram_alloc(sizeof
>  				   (struct ucc_geth_rx_firmware_statistics_pram),
>  				   UCC_GETH_RX_STATISTICS_ALIGNMENT);
> -		if (IS_MURAM_ERR(ugeth->rx_fw_statistics_pram_offset)) {
> +		if (IS_ERR_VALUE(ugeth->rx_fw_statistics_pram_offset)) {
>  			ugeth_err
>  				("%s: Can not allocate DPRAM memory for"
>  				" p_rx_fw_statistics_pram.", __FUNCTION__);
> @@ -3179,7 +3179,7 @@ static int ucc_geth_startup(struct  
> ucc_geth_private *ugeth)
>  	    qe_muram_alloc(ug_info->numQueuesRx *
>  			   sizeof(struct ucc_geth_rx_interrupt_coalescing_entry),
>  			   UCC_GETH_RX_INTERRUPT_COALESCING_ALIGNMENT);
> -	if (IS_MURAM_ERR(ugeth->rx_irq_coalescing_tbl_offset)) {
> +	if (IS_ERR_VALUE(ugeth->rx_irq_coalescing_tbl_offset)) {
>  		ugeth_err
>  		    ("%s: Can not allocate DPRAM memory for"
>  			" p_rx_irq_coalescing_tbl.", __FUNCTION__);
> @@ -3247,7 +3247,7 @@ static int ucc_geth_startup(struct  
> ucc_geth_private *ugeth)
>  			   (sizeof(struct ucc_geth_rx_bd_queues_entry) +
>  			    sizeof(struct ucc_geth_rx_prefetched_bds)),
>  			   UCC_GETH_RX_BD_QUEUES_ALIGNMENT);
> -	if (IS_MURAM_ERR(ugeth->rx_bd_qs_tbl_offset)) {
> +	if (IS_ERR_VALUE(ugeth->rx_bd_qs_tbl_offset)) {
>  		ugeth_err
>  		    ("%s: Can not allocate DPRAM memory for p_rx_bd_qs_tbl.",
>  		     __FUNCTION__);
> @@ -3336,7 +3336,7 @@ static int ucc_geth_startup(struct  
> ucc_geth_private *ugeth)
>  		ugeth->exf_glbl_param_offset =
>  		    qe_muram_alloc(sizeof(struct ucc_geth_exf_global_pram),
>  		UCC_GETH_RX_EXTENDED_FILTERING_GLOBAL_PARAMETERS_ALIGNMENT);
> -		if (IS_MURAM_ERR(ugeth->exf_glbl_param_offset)) {
> +		if (IS_ERR_VALUE(ugeth->exf_glbl_param_offset)) {
>  			ugeth_err
>  				("%s: Can not allocate DPRAM memory for"
>  				" p_exf_glbl_param.", __FUNCTION__);
> @@ -3485,7 +3485,7 @@ static int ucc_geth_startup(struct  
> ucc_geth_private *ugeth)
>
>  	/* Allocate InitEnet command parameter structure */
>  	init_enet_pram_offset = qe_muram_alloc(sizeof(struct  
> ucc_geth_init_pram), 4);
> -	if (IS_MURAM_ERR(init_enet_pram_offset)) {
> +	if (IS_ERR_VALUE(init_enet_pram_offset)) {
>  		ugeth_err
>  		    ("%s: Can not allocate DPRAM memory for p_init_enet_pram.",
>  		     __FUNCTION__);
> diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm1.c b/drivers/ 
> serial/cpm_uart/cpm_uart_cpm1.c
> index 925fb60..bb7afe9 100644
> --- a/drivers/serial/cpm_uart/cpm_uart_cpm1.c
> +++ b/drivers/serial/cpm_uart/cpm_uart_cpm1.c
> @@ -125,7 +125,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port  
> *pinfo, unsigned int is_con)
>  {
>  	int dpmemsz, memsz;
>  	u8 *dp_mem;
> -	uint dp_offset;
> +	unsigned long dp_offset;
>  	u8 *mem_addr;
>  	dma_addr_t dma_addr = 0;
>
> @@ -133,7 +133,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port  
> *pinfo, unsigned int is_con)
>
>  	dpmemsz = sizeof(cbd_t) * (pinfo->rx_nrfifos + pinfo->tx_nrfifos);
>  	dp_offset = cpm_dpalloc(dpmemsz, 8);
> -	if (IS_DPERR(dp_offset)) {
> +	if (IS_ERR_VALUE(dp_offset)) {
>  		printk(KERN_ERR
>  		       "cpm_uart_cpm1.c: could not allocate buffer descriptors\n");
>  		return -ENOMEM;
> diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm2.c b/drivers/ 
> serial/cpm_uart/cpm_uart_cpm2.c
> index fa45599..1eeea36 100644
> --- a/drivers/serial/cpm_uart/cpm_uart_cpm2.c
> +++ b/drivers/serial/cpm_uart/cpm_uart_cpm2.c
> @@ -222,7 +222,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port  
> *pinfo, unsigned int is_con)
>  {
>  	int dpmemsz, memsz;
>  	u8 *dp_mem;
> -	uint dp_offset;
> +	unsigned long dp_offset;
>  	u8 *mem_addr;
>  	dma_addr_t dma_addr = 0;
>
> @@ -230,7 +230,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port  
> *pinfo, unsigned int is_con)
>
>  	dpmemsz = sizeof(cbd_t) * (pinfo->rx_nrfifos + pinfo->tx_nrfifos);
>  	dp_offset = cpm_dpalloc(dpmemsz, 8);
> -	if (IS_DPERR(dp_offset)) {
> +	if (IS_ERR_VALUE(dp_offset)) {
>  		printk(KERN_ERR
>  		       "cpm_uart_cpm.c: could not allocate buffer descriptors\n");
>  		return -ENOMEM;
> diff --git a/include/asm-powerpc/qe.h b/include/asm-powerpc/qe.h
> index a62168e..9d304b1 100644
> --- a/include/asm-powerpc/qe.h
> +++ b/include/asm-powerpc/qe.h
> @@ -38,11 +38,11 @@ int qe_issue_cmd(u32 cmd, u32 device, u8  
> mcn_protocol, u32 cmd_input);
>  void qe_setbrg(u32 brg, u32 rate);
>  int qe_get_snum(void);
>  void qe_put_snum(u8 snum);
> -u32 qe_muram_alloc(u32 size, u32 align);
> -int qe_muram_free(u32 offset);
> -u32 qe_muram_alloc_fixed(u32 offset, u32 size);
> +unsigned long qe_muram_alloc(int size, int align);
> +int qe_muram_free(unsigned long offset);
> +unsigned long qe_muram_alloc_fixed(unsigned long offset, int size);
>  void qe_muram_dump(void);
> -void *qe_muram_addr(u32 offset);
> +void *qe_muram_addr(unsigned long offset);
>
>  /* Buffer descriptors */
>  struct qe_bd {
> @@ -448,10 +448,5 @@ struct ucc_slow_pram {
>  #define UCC_FAST_FUNCTION_CODE_DTB_LCL	0x02
>  #define UCC_FAST_FUNCTION_CODE_BDB_LCL	0x01
>
> -static inline long IS_MURAM_ERR(const u32 offset)
> -{
> -	return offset > (u32) - 1000L;
> -}
> -
>  #endif /* __KERNEL__ */
>  #endif /* _ASM_POWERPC_QE_H */
> diff --git a/include/asm-ppc/commproc.h b/include/asm-ppc/commproc.h
> index 4f99df1..3972487 100644
> --- a/include/asm-ppc/commproc.h
> +++ b/include/asm-ppc/commproc.h
> @@ -63,20 +63,15 @@
>  #define CPM_DATAONLY_SIZE	((uint)0x0700)
>  #define CPM_DP_NOSPACE		((uint)0x7fffffff)
>
> -static inline long IS_DPERR(const uint offset)
> -{
> -	return (uint)offset > (uint)-1000L;
> -}
> -
>  /* Export the base address of the communication processor registers
>   * and dual port ram.
>   */
>  extern	cpm8xx_t	*cpmp;		/* Pointer to comm processor */
> -extern uint cpm_dpalloc(uint size, uint align);
> -extern int cpm_dpfree(uint offset);
> -extern uint cpm_dpalloc_fixed(uint offset, uint size, uint align);
> +extern unsigned long cpm_dpalloc(uint size, uint align);
> +extern int cpm_dpfree(unsigned long offset);
> +extern unsigned long cpm_dpalloc_fixed(unsigned long offset, uint  
> size, uint align);
>  extern void cpm_dpdump(void);
> -extern void *cpm_dpram_addr(uint offset);
> +extern void *cpm_dpram_addr(unsigned long offset);
>  extern uint cpm_dpram_phys(u8* addr);
>  extern void cpm_setbrg(uint brg, uint rate);
>
> diff --git a/include/asm-ppc/cpm2.h b/include/asm-ppc/cpm2.h
> index 220cc2d..12a2860 100644
> --- a/include/asm-ppc/cpm2.h
> +++ b/include/asm-ppc/cpm2.h
> @@ -104,21 +104,16 @@
>   */
>  #define NUM_CPM_HOST_PAGES	2
>
> -static inline long IS_DPERR(const uint offset)
> -{
> -	return (uint)offset > (uint)-1000L;
> -}
> -
>  /* Export the base address of the communication processor registers
>   * and dual port ram.
>   */
>  extern		cpm_cpm2_t	*cpmp;	 /* Pointer to comm processor */
>
> -extern uint cpm_dpalloc(uint size, uint align);
> -extern int cpm_dpfree(uint offset);
> -extern uint cpm_dpalloc_fixed(uint offset, uint size, uint align);
> +extern unsigned long cpm_dpalloc(uint size, uint align);
> +extern int cpm_dpfree(unsigned long offset);
> +extern unsigned long cpm_dpalloc_fixed(unsigned long offset, uint  
> size, uint align);
>  extern void cpm_dpdump(void);
> -extern void *cpm_dpram_addr(uint offset);
> +extern void *cpm_dpram_addr(unsigned long offset);
>  extern void cpm_setbrg(uint brg, uint rate);
>  extern void cpm2_fastbrg(uint brg, uint rate, int div16);
>  extern void cpm2_reset(void);
> diff --git a/include/asm-ppc/rheap.h b/include/asm-ppc/rheap.h
> index 39a10d8..1723817 100644
> --- a/include/asm-ppc/rheap.h
> +++ b/include/asm-ppc/rheap.h
> @@ -18,7 +18,7 @@
>
>  typedef struct _rh_block {
>  	struct list_head list;
> -	void *start;
> +	unsigned long start;
>  	int size;
>  	const char *owner;
>  } rh_block_t;
> @@ -37,8 +37,8 @@ typedef struct _rh_info {
>  #define RHIF_STATIC_INFO	0x1
>  #define RHIF_STATIC_BLOCK	0x2
>
> -typedef struct rh_stats_t {
> -	void *start;
> +typedef struct _rh_stats {
> +	unsigned long start;
>  	int size;
>  	const char *owner;
>  } rh_stats_t;
> @@ -57,24 +57,24 @@ extern void rh_init(rh_info_t * info, unsigned  
> int alignment, int max_blocks,
>  		    rh_block_t * block);
>
>  /* Attach a free region to manage */
> -extern int rh_attach_region(rh_info_t * info, void *start, int size);
> +extern int rh_attach_region(rh_info_t * info, unsigned long start,  
> int size);
>
>  /* Detach a free region */
> -extern void *rh_detach_region(rh_info_t * info, void *start, int  
> size);
> +extern unsigned long rh_detach_region(rh_info_t * info, unsigned  
> long start, int size);
>
>  /* Allocate the given size from the remote heap (with alignment) */
> -extern void *rh_alloc_align(rh_info_t * info, int size, int  
> alignment,
> +extern unsigned long rh_alloc_align(rh_info_t * info, int size,  
> int alignment,
>  		const char *owner);
>
>  /* Allocate the given size from the remote heap */
> -extern void *rh_alloc(rh_info_t * info, int size, const char *owner);
> +extern unsigned long rh_alloc(rh_info_t * info, int size, const  
> char *owner);
>
>  /* Allocate the given size from the given address */
> -extern void *rh_alloc_fixed(rh_info_t * info, void *start, int size,
> +extern unsigned long rh_alloc_fixed(rh_info_t * info, unsigned  
> long start, int size,
>  			    const char *owner);
>
>  /* Free the allocated area */
> -extern int rh_free(rh_info_t * info, void *start);
> +extern int rh_free(rh_info_t * info, unsigned long start);
>
>  /* Get stats for debugging purposes */
>  extern int rh_get_stats(rh_info_t * info, int what, int max_stats,
> @@ -84,6 +84,6 @@ extern int rh_get_stats(rh_info_t * info, int  
> what, int max_stats,
>  extern void rh_dump(rh_info_t * info);
>
>  /* Set owner of taken block */
> -extern int rh_set_owner(rh_info_t * info, void *start, const char  
> *owner);
> +extern int rh_set_owner(rh_info_t * info, unsigned long start,  
> const char *owner);
>
>  #endif				/* __ASM_PPC_RHEAP_H__ */
> -- 
> 1.5.0.6
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev

^ permalink raw reply

* Re: [PATCH 5/6] Support for the Ebony 440GP reference board in arch/powerpc
From: Olof Johansson @ 2007-05-04 14:36 UTC (permalink / raw)
  To: David Gibson; +Cc: linuxppc-dev, Paul Mackerras
In-Reply-To: <20070504055733.8FB7EDDFFD@ozlabs.org>

Hi,

Not much actual board support code in here, nice and clean. :-) Seems
like most of this was boot wrapper enhancements.

Some comments below.


-Olof

On Fri, May 04, 2007 at 03:57:33PM +1000, David Gibson wrote:

> Index: working-2.6/arch/powerpc/kernel/head_44x.S
> ===================================================================
> --- working-2.6.orig/arch/powerpc/kernel/head_44x.S	2007-05-03 10:19:32.000000000 +1000
> +++ working-2.6/arch/powerpc/kernel/head_44x.S	2007-05-04 13:46:51.000000000 +1000
> @@ -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
> -

Looks like this rename is really separate from the platform support. Maybe
post it as such in a patch before this one?

Also, I know it was just a rename but you might want to add a "b ."
after it, if for some reason the reset doesn't happen instantly to avoid
executing random code afterwards.

> ===================================================================
> --- /dev/null	1970-01-01 00:00:00.000000000 +0000
> +++ working-2.6/arch/powerpc/platforms/44x/ebony.c	2007-05-04 13:46:51.000000000 +1000
> @@ -0,0 +1,73 @@
> +/*
> + * Ebony board specific routines
> + *
> + * Matt Porter <mporter@kernel.crashing.org>
> + * Copyright 2002-2005 MontaVista Software Inc.
> + *
> + * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
> + * Copyright (c) 2003-2005 Zultys Technologies
> + *
> + * Rewritten and ported to the merged powerpc tree:
> + * Copyright 2007 David Gibson <dwg@au1.ibm.com>, 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/init.h>
> +#include <asm/machdep.h>
> +#include <asm/prom.h>
> +#include <asm/udbg.h>
> +#include <asm/time.h>
> +#include <asm/uic.h>
> +#include <asm/of_platform.h>
> +
> +#include "44x.h"
> +
> +static struct of_device_id ebony_of_bus[] = {
> +	{ .type = "ibm,plb", },
> +	{ .type = "ibm,opb", },
> +	{ .type = "ibm,ebc", },
> +	{},
> +};
> +
> +static int __init ebony_device_probe(void)
> +{
> +	if (! machine_is(ebony))

Extra space after !

> +		return 0;
> +
> +	of_platform_bus_probe(NULL, ebony_of_bus, NULL);
> +
> +	return 0;
> +}
> +device_initcall(ebony_device_probe);
> +
> +/*
> + * Called very early, MMU is off, device-tree isn't unflattened
> + */
> +static int __init ebony_probe(void)
> +{
> +	unsigned long root = of_get_flat_dt_root();
> +
> +	if (!of_flat_dt_is_compatible(root, "Ebony"))
> +		return 0;
> +
> +	return 1;
> +}
> +
> +static void __init ebony_setup_arch(void)
> +{
> +}
> +
> +define_machine(ebony) {
> +	.name			= "Ebony",
> +	.probe			= ebony_probe,
> +	.setup_arch		= ebony_setup_arch,
> +	.progress		= udbg_progress,
> +	.init_IRQ		= uic_init_tree,
> +	.get_irq		= uic_get_irq,
> +	.restart		= ppc44x_reset_system,
> +	.calibrate_decr		= generic_calibrate_decr,
> +};
> Index: working-2.6/arch/powerpc/platforms/44x/misc_44x.S
> ===================================================================
> --- /dev/null	1970-01-01 00:00:00.000000000 +0000
> +++ working-2.6/arch/powerpc/platforms/44x/misc_44x.S	2007-05-04 13:46:51.000000000 +1000
> @@ -0,0 +1,25 @@
> +/*
> + * This file contains miscellaneous low-level functions for PPC 44x.
> + *    Copyright 2007 David Gibson <dwg@au1.ibm.com>, 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
> Index: working-2.6/arch/powerpc/platforms/44x/44x.h
> ===================================================================
> --- /dev/null	1970-01-01 00:00:00.000000000 +0000
> +++ working-2.6/arch/powerpc/platforms/44x/44x.h	2007-05-04 13:46:51.000000000 +1000
> @@ -0,0 +1,7 @@
> +#ifndef __POWERPC_PLATFORMS_44X_44X_H
> +#define __POWERPC_PLATFORMS_44X_44X_H
> +
> +extern void ppc44x_reset_system(char *cmd);
> +
> +#endif /* __POWERPC_PLATFORMS_44X_44X_H */
> +
> Index: working-2.6/arch/powerpc/platforms/44x/Kconfig
> ===================================================================
> --- /dev/null	1970-01-01 00:00:00.000000000 +0000
> +++ working-2.6/arch/powerpc/platforms/44x/Kconfig	2007-05-04 13:46:51.000000000 +1000
> @@ -0,0 +1,56 @@
> +#config BAMBOO
> +#	bool "Bamboo"
> +#	depends on 44x
> +#	default n
> +#	select 440EP
> +#	help
> +#	  This option enables support for the IBM PPC440EP evaluation board.
> +
> +config EBONY
> +	bool "Ebony"
> +	depends on 44x
> +	default y
> +	select 440GP
> +	help
> +	  This option enables support for the IBM PPC440GP evaluation board.
> +
> +#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.

Any reason you add them commented out?

> +
> +# 44x specific CPU modules, selected based on the board above.
> +config 440EP
> +	bool
> +	select PPC_FPU
> +	select IBM440EP_ERR42
> +
> +config 440GP
> +	bool
> +	select IBM_NEW_EMAC_ZMII
> +
> +config 440GX
> +	bool
> +
> +config 440SP
> +	bool
> +
> +config 440A
> +	bool
> +	depends on 440GX
> +	default y
> +
> +# 44x errata/workaround config symbols, selected by the CPU models above
> +config IBM440EP_ERR42
> +	bool
> Index: working-2.6/arch/powerpc/platforms/Makefile
> ===================================================================
> --- working-2.6.orig/arch/powerpc/platforms/Makefile	2007-02-14 10:58:22.000000000 +1100
> +++ working-2.6/arch/powerpc/platforms/Makefile	2007-05-04 13:46:51.000000000 +1000
> @@ -6,7 +6,8 @@ obj-$(CONFIG_PPC_PMAC)		+= powermac/
>  endif
>  endif
>  obj-$(CONFIG_PPC_CHRP)		+= chrp/
> -obj-$(CONFIG_4xx)		+= 4xx/
> +#obj-$(CONFIG_4xx)		+= 4xx/

Hmm?

> +obj-$(CONFIG_44x)		+= 44x/
>  obj-$(CONFIG_PPC_MPC52xx)	+= 52xx/
>  obj-$(CONFIG_PPC_8xx)		+= 8xx/
>  obj-$(CONFIG_PPC_82xx)		+= 82xx/
> Index: working-2.6/arch/powerpc/platforms/Kconfig
> ===================================================================
> --- working-2.6.orig/arch/powerpc/platforms/Kconfig	2007-05-01 10:04:59.000000000 +1000
> +++ working-2.6/arch/powerpc/platforms/Kconfig	2007-05-04 13:46:51.000000000 +1000
> @@ -42,6 +42,7 @@ source "arch/powerpc/platforms/83xx/Kcon
>  source "arch/powerpc/platforms/85xx/Kconfig"
>  source "arch/powerpc/platforms/86xx/Kconfig"
>  source "arch/powerpc/platforms/embedded6xx/Kconfig"
> +source "arch/powerpc/platforms/44x/Kconfig"
>  #source "arch/powerpc/platforms/4xx/Kconfig
>  
>  config PPC_NATIVE
> Index: working-2.6/arch/powerpc/Kconfig
> ===================================================================
> --- working-2.6.orig/arch/powerpc/Kconfig	2007-05-03 10:19:32.000000000 +1000
> +++ working-2.6/arch/powerpc/Kconfig	2007-05-04 13:46:51.000000000 +1000
> @@ -196,6 +196,7 @@ config 40x
>  config 44x
>  	bool "AMCC 44x"
>  	select PPC_DCR_NATIVE
> +	select WANT_DEVICE_TREE
>  
>  config E200
>  	bool "Freescale e200"
> @@ -260,9 +261,14 @@ config PPC_OF_PLATFORM_PCI
>  	depends on PPC64 # not supported on 32 bits yet
>  	default n
>  
> +config 4xx
> +	bool
> +	depends on 40x || 44x
> +	default y
> +
>  config BOOKE
>  	bool
> -	depends on E200 || E500
> +	depends on E200 || E500 || 44x
>  	default y
>  
>  config FSL_BOOKE
> Index: working-2.6/arch/powerpc/boot/44x.c
> ===================================================================
> --- /dev/null	1970-01-01 00:00:00.000000000 +0000
> +++ working-2.6/arch/powerpc/boot/44x.c	2007-05-04 13:46:51.000000000 +1000
> @@ -0,0 +1,37 @@
> +/*
> + * Copyright 2007 David Gibson, IBM Corporation.
> + *
> + * Based on earlier code:
> + * Copyright 2002-2005 MontaVista Software Inc.
> + * Copyright (c) 2003, 2004 Zultys Technologies
> +
> + * 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 <stddef.h>
> +#include "types.h"
> +#include "string.h"
> +#include "stdio.h"
> +#include "ops.h"
> +#include "reg.h"
> +#include "dcr.h"
> +
> +/* Read the 44x memory controller to get size of system memory. */
> +void ibm44x_fixup_memsize(void)
> +{
> +	int i;
> +	unsigned long memsize, bank_config;
> +
> +	memsize = 0;
> +	for (i = 0; i < ARRAY_SIZE(sdram_bxcr); i++) {
> +		mtdcr(DCRN_SDRAM0_CFGADDR, sdram_bxcr[i]);
> +		bank_config = mfdcr(DCRN_SDRAM0_CFGDATA);
> +
> +		if (bank_config & SDRAM_CONFIG_BANK_ENABLE)
> +			memsize += SDRAM_CONFIG_BANK_SIZE(bank_config);
> +	}
> +
> +	dt_fixup_memory(0, memsize);
> +}
> Index: working-2.6/arch/powerpc/boot/44x.h
> ===================================================================
> --- /dev/null	1970-01-01 00:00:00.000000000 +0000
> +++ working-2.6/arch/powerpc/boot/44x.h	2007-05-04 13:46:51.000000000 +1000
> @@ -0,0 +1,16 @@
> +/*
> + * PowerPC 44x related functions
> + *
> + * Copyright 2007 David Gibson, IBM Corporation.
> + *
> + * 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.
> + */
> +#ifndef _PPC_BOOT_44X_H_
> +#define _PPC_BOOT_44X_H_
> +
> +void ibm44x_fixup_memsize(void);
> +void ebony_init(void *mac0, void *mac1);
> +
> +#endif /* _PPC_BOOT_44X_H_ */
> Index: working-2.6/arch/powerpc/boot/Makefile
> ===================================================================
> --- working-2.6.orig/arch/powerpc/boot/Makefile	2007-05-04 13:46:50.000000000 +1000
> +++ working-2.6/arch/powerpc/boot/Makefile	2007-05-04 13:46:51.000000000 +1000
> @@ -42,8 +42,9 @@ $(addprefix $(obj)/,$(zlib) main.o): $(a
>  
>  src-wlib := string.S crt0.S stdio.c main.c flatdevtree.c flatdevtree_misc.c \
>  		ns16550.c serial.c simple_alloc.c div64.S util.S \
> -		gunzip_util.c elf_util.c $(zlib) devtree.c
> -src-plat := of.c cuboot-83xx.c cuboot-85xx.c
> +		gunzip_util.c elf_util.c $(zlib) devtree.c \
> +		44x.c ebony.c
> +src-plat := of.c cuboot-83xx.c cuboot-85xx.c cuboot-ebony.c treeboot-ebony.c
>  src-boot := $(src-wlib) $(src-plat) empty.c
>  
>  src-boot := $(addprefix $(obj)/, $(src-boot))
> @@ -131,6 +132,7 @@ image-$(CONFIG_PPC_EFIKA)		+= zImage.chr
>  image-$(CONFIG_PPC_PMAC)		+= zImage.pmac
>  image-$(CONFIG_PPC_83xx)		+= cuImage.83xx
>  image-$(CONFIG_PPC_85xx)		+= cuImage.85xx
> +image-$(CONFIG_EBONY)			+= treeImage.ebony cuImage.ebony
>  image-$(CONFIG_DEFAULT_UIMAGE)		+= uImage
>  
>  # For 32-bit powermacs, build the COFF and miboot images
> @@ -140,7 +142,8 @@ image-$(CONFIG_PPC_PMAC)	+= zImage.coff 
>  endif
>  
>  initrd-  := $(patsubst zImage%, zImage.initrd%, $(image-n) $(image-))
> -initrd-y := $(patsubst zImage%, zImage.initrd%, $(image-y))
> +initrd-y := $(patsubst zImage%, zImage.initrd%, \
> +		$(patsubst treeImage%, treeImage.initrd%, $(image-y)))
>  initrd-y := $(filter-out $(image-y), $(initrd-y))
>  targets	+= $(image-y) $(initrd-y)
>  
> @@ -170,6 +173,12 @@ dts = $(if $(shell echo $(CONFIG_DEVICE_
>  $(obj)/cuImage.%: vmlinux $(wrapperbits)
>  	$(call if_changed,wrap,cuboot-$*,$(dts))
>  
> +$(obj)/treeImage.%: vmlinux $(wrapperbits)
> +	$(call if_changed,wrap,treeboot-$*,$(dts))
> +
> +$(obj)/treeImage.initrd.%: vmlinux $(wrapperbits)
> +	$(call if_changed,wrap,treeboot-$*,$(dts),,$(obj)/ramdisk.image.gz)
> +
>  $(obj)/zImage:		$(addprefix $(obj)/, $(image-y))
>  	@rm -f $@; ln $< $@
>  $(obj)/zImage.initrd:	$(addprefix $(obj)/, $(initrd-y))
> @@ -179,7 +188,8 @@ install: $(CONFIGURE) $(addprefix $(obj)
>  	sh -x $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)" $<
>  
>  # anything not in $(targets)
> -clean-files += $(image-) $(initrd-) zImage zImage.initrd cuImage.*
> +clean-files += $(image-) $(initrd-) zImage zImage.initrd cuImage.* \
> +	treeImage.*
>  
>  # clean up files cached by wrapper
>  clean-kernel := vmlinux.strip vmlinux.bin
> Index: working-2.6/arch/powerpc/boot/cuboot-ebony.c
> ===================================================================
> --- /dev/null	1970-01-01 00:00:00.000000000 +0000
> +++ working-2.6/arch/powerpc/boot/cuboot-ebony.c	2007-05-04 13:46:51.000000000 +1000
> @@ -0,0 +1,42 @@
> +/*
> + * Old U-boot compatibility for Ebony
> + *
> + * Author: David Gibson <david@gibson.dropbear.id.au>
> + *
> + * Copyright 2007 David Gibson, IBM Corporatio.
> + *   Based on cuboot-83xx.c, which is:
> + * Copyright (c) 2007 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 version 2 as published
> + * by the Free Software Foundation.
> + */
> +
> +#include "ops.h"
> +#include "stdio.h"
> +#include "44x.h"
> +
> +#define TARGET_44x
> +#include "ppcboot.h"
> +
> +static bd_t bd;
> +extern char _end[];
> +
> +BSS_STACK(4096);
> +
> +void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
> +                   unsigned long r6, unsigned long r7)
> +{
> +	unsigned long end_of_ram = bd.bi_memstart + bd.bi_memsize;
> +	unsigned long avail_ram = end_of_ram - (unsigned long)_end;
> +
> +	memcpy(&bd, (bd_t *)r3, sizeof(bd));
> +	loader_info.initrd_addr = r4;
> +	loader_info.initrd_size = r4 ? r5 : 0;
> +	loader_info.cmdline = (char *)r6;
> +	loader_info.cmdline_len = r7 - r6;
> +
> +	simple_alloc_init(_end, avail_ram, 32, 64);
> +
> +	ebony_init(&bd.bi_enetaddr, &bd.bi_enet1addr);
> +}
> Index: working-2.6/arch/powerpc/boot/dcr.h
> ===================================================================
> --- /dev/null	1970-01-01 00:00:00.000000000 +0000
> +++ working-2.6/arch/powerpc/boot/dcr.h	2007-05-04 13:46:51.000000000 +1000
> @@ -0,0 +1,85 @@
> +#ifndef _PPC_BOOT_DCR_H_
> +#define _PPC_BOOT_DCR_H_
> +
> +#define mfdcr(rn) \
> +	({	\
> +		unsigned long rval; \
> +		asm volatile("mfdcr %0,%1" : "=r"(rval) : "i"(rn)); \
> +		rval; \
> +	})
> +#define mtdcr(rn, val) \
> +	asm volatile("mtdcr %0,%1" : : "i"(rn), "r"(val))
> +
> +/* 440GP/440GX SDRAM controller DCRs */
> +#define DCRN_SDRAM0_CFGADDR				0x010
> +#define DCRN_SDRAM0_CFGDATA				0x011
> +
> +#define 	SDRAM0_B0CR				0x40
> +#define 	SDRAM0_B1CR				0x44
> +#define 	SDRAM0_B2CR				0x48
> +#define 	SDRAM0_B3CR				0x4c
> +
> +static const unsigned long sdram_bxcr[] = { SDRAM0_B0CR, SDRAM0_B1CR, SDRAM0_B2CR, SDRAM0_B3CR };
> +
> +#define			SDRAM_CONFIG_BANK_ENABLE        0x00000001
> +#define			SDRAM_CONFIG_SIZE_MASK          0x000e0000
> +#define			SDRAM_CONFIG_BANK_SIZE(reg)	\
> +	(0x00400000 << ((reg & SDRAM_CONFIG_SIZE_MASK) >> 17))

Lots of tabs here? Other powerpc code tends to use
<tab><space><space><space> for the register field defines indentation.

Same for below.

> +
> +/* 440GP Clock, PM, chip control */
> +#define DCRN_CPC0_SR					0x0b0
> +#define DCRN_CPC0_ER					0x0b1
> +#define DCRN_CPC0_FR					0x0b2
> +#define DCRN_CPC0_SYS0					0x0e0
> +#define		CPC0_SYS0_TUNE				0xffc00000
> +#define		CPC0_SYS0_FBDV_MASK			0x003c0000
> +#define		CPC0_SYS0_FBDV(reg)			\
> +	((((((reg) & CPC0_SYS0_FBDV_MASK) >> 18) - 1) & 0xf) + 1)

Would you mind a short comment about why the above math is needed?

> +#define		CPC0_SYS0_FWDVA_MASK			0x00038000
> +#define		CPC0_SYS0_FWDVA(reg)			\
> +	(8 - (((reg) & CPC0_SYS0_FWDVA_MASK) >> 15))
> +#define		CPC0_SYS0_FWDVB_MASK			0x00007000
> +#define		CPC0_SYS0_FWDVB(reg)			\
> +	(8 - (((reg) & CPC0_SYS0_FWDVB_MASK) >> 12))
> +#define		CPC0_SYS0_OPDV_MASK			0x00000c00
> +#define		CPC0_SYS0_OPDV(reg)			\
> +	((((reg) & CPC0_SYS0_OPDV_MASK) >> 10) + 1)
> +#define		CPC0_SYS0_EPDV_MASK			0x00000300
> +#define		CPC0_SYS0_EPDV(reg)			\
> +	((((reg) & CPC0_SYS0_EPDV_MASK) >> 8) + 1)
> +#define		CPC0_SYS0_EXTSL				0x00000080
> +#define		CPC0_SYS0_RW_MASK			0x00000060
> +#define		CPC0_SYS0_RL				0x00000010
> +#define		CPC0_SYS0_ZMIISL_MASK			0x0000000c
> +#define		CPC0_SYS0_BYPASS			0x00000002
> +#define		CPC0_SYS0_NTO1				0x00000001
> +#define DCRN_CPC0_SYS1					0x0e1
> +#define DCRN_CPC0_CUST0					0x0e2
> +#define DCRN_CPC0_CUST1					0x0e3
> +#define DCRN_CPC0_STRP0					0x0e4
> +#define DCRN_CPC0_STRP1					0x0e5
> +#define DCRN_CPC0_STRP2					0x0e6
> +#define DCRN_CPC0_STRP3					0x0e7
> +#define DCRN_CPC0_GPIO					0x0e8
> +#define DCRN_CPC0_PLB					0x0e9
> +#define DCRN_CPC0_CR1					0x0ea
> +#define DCRN_CPC0_CR0					0x0eb
> +#define		CPC0_CR0_SWE				0x80000000
> +#define		CPC0_CR0_CETE				0x40000000
> +#define		CPC0_CR0_U1FCS				0x20000000
> +#define		CPC0_CR0_U0DTE				0x10000000
> +#define		CPC0_CR0_U0DRE				0x08000000
> +#define		CPC0_CR0_U0DC				0x04000000
> +#define		CPC0_CR0_U1DTE				0x02000000
> +#define		CPC0_CR0_U1DRE				0x01000000
> +#define		CPC0_CR0_U1DC				0x00800000
> +#define		CPC0_CR0_U0EC				0x00400000
> +#define		CPC0_CR0_U1EC				0x00200000
> +#define		CPC0_CR0_UDIV_MASK			0x001f0000
> +#define		CPC0_CR0_UDIV(reg)			\
> +	((((reg) & CPC0_CR0_UDIV_MASK) >> 16) + 1)
> +#define DCRN_CPC0_MIRQ0					0x0ec
> +#define DCRN_CPC0_MIRQ1					0x0ed
> +#define DCRN_CPC0_JTAGID				0x0ef
> +
> +#endif	/* _PPC_BOOT_DCR_H_ */
> Index: working-2.6/arch/powerpc/boot/ebony.c
> ===================================================================
> --- /dev/null	1970-01-01 00:00:00.000000000 +0000
> +++ working-2.6/arch/powerpc/boot/ebony.c	2007-05-04 13:46:51.000000000 +1000
> @@ -0,0 +1,125 @@
> +/*
> + * Copyright 2007 David Gibson, IBM Corporation.
> + *
> + * Based on earlier code:
> + * Copyright (C) Paul Mackerras 1997.
> + * Copyright 2002-2005 MontaVista Software Inc.
> + * Copyright (c) 2003, 2004 Zultys Technologies
> +
> + * 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 <stdarg.h>
> +#include <stddef.h>
> +#include "types.h"
> +#include "elf.h"
> +#include "string.h"
> +#include "stdio.h"
> +#include "page.h"
> +#include "ops.h"
> +#include "reg.h"
> +#include "dcr.h"
> +#include "44x.h"
> +
> +extern char _dtb_start[];
> +extern char _dtb_end[];
> +
> +static u8 *ebony_mac0, *ebony_mac1;
> +
> +/* Calculate 440GP clocks */
> +void ibm440gp_fixup_clocks(unsigned int sysclk, unsigned int ser_clk)
> +{
> +	u32 sys0 = mfdcr(DCRN_CPC0_SYS0);
> +	u32 cr0 = mfdcr(DCRN_CPC0_CR0);
> +	u32 cpu, plb, opb, ebc, tb, uart0, uart1, m;
> +	u32 opdv = CPC0_SYS0_OPDV(sys0);
> +	u32 epdv = CPC0_SYS0_EPDV(sys0);
> +
> +	if (sys0 & CPC0_SYS0_BYPASS) {
> +		/* Bypass system PLL */
> +		cpu = plb = sysclk;
> +	} else {
> +		if (sys0 & CPC0_SYS0_EXTSL)
> +			/* PerClk */
> +			m = CPC0_SYS0_FWDVB(sys0) * opdv * epdv;
> +		else
> +			/* CPU clock */
> +			m = CPC0_SYS0_FBDV(sys0) * CPC0_SYS0_FWDVA(sys0);
> +		cpu = sysclk * m / CPC0_SYS0_FWDVA(sys0);
> +		plb = sysclk * m / CPC0_SYS0_FWDVB(sys0);
> +	}
> +
> +	opb = plb / opdv;
> +	ebc = opb / epdv;
> +
> +	/* FIXME: Check if this is for all 440GP, or just Ebony */
> +	if ((mfpvr() & 0xf0000fff) == 0x40000440)
> +		/* Rev. B 440GP, use external system clock */
> +		tb = sysclk;
> +	else
> +		/* Rev. C 440GP, errata force us to use internal clock */
> +		tb = cpu;
> +
> +	if (cr0 & CPC0_CR0_U0EC)
> +		/* External UART clock */
> +		uart0 = ser_clk;
> +	else
> +		/* Internal UART clock */
> +		uart0 = plb / CPC0_CR0_UDIV(cr0);
> +
> +	if (cr0 & CPC0_CR0_U1EC)
> +		/* External UART clock */
> +		uart1 = ser_clk;
> +	else
> +		/* Internal UART clock */
> +		uart1 = plb / CPC0_CR0_UDIV(cr0);
> +
> +	printf("PPC440GP: SysClk = %dMHz (%x)\n\r",
> +	       (sysclk + 500000) / 1000000, sysclk);
> +
> +	dt_fixup_cpu_clocks(cpu, tb, 0);
> +
> +	dt_fixup_clock("/plb", plb);
> +	dt_fixup_clock("/plb/opb", opb);
> +	dt_fixup_clock("/plb/opb/ebc", ebc);
> +	dt_fixup_clock("/plb/opb/serial@40000200", uart0);
> +	dt_fixup_clock("/plb/opb/serial@40000300", uart1);
> +}
> +
> +static void ebony_fixups(void)
> +{
> +	// FIXME: sysclk should be derived by reading the FPGA registers
> +	unsigned long sysclk = 33000000;
> +
> +	ibm440gp_fixup_clocks(sysclk, 6 * 1843200);
> +	ibm44x_fixup_memsize();
> +	dt_fixup_mac_addresses(ebony_mac0, ebony_mac1);
> +}
> +
> +#define SPRN_DBCR0		0x134
> +#define   DBCR0_RST_SYSTEM	0x30000000
> +
> +static void ebony_exit(void)
> +{
> +	unsigned long tmp;
> +
> +	asm volatile (
> +		"mfspr	%0,%1\n"
> +		"oris	%0,%0,%2@h\n"
> +		"mtspr	%1,%0"
> +		: "=&r"(tmp) : "i"(SPRN_DBCR0), "i"(DBCR0_RST_SYSTEM)

You don't have to pass in the constants here, you can specify them in
the asm. Makes it a little more readable.

> +		);
> +
> +}
> +
> +void ebony_init(void *mac0, void *mac1)
> +{
> +	platform_ops.fixups = ebony_fixups;
> +	platform_ops.exit = ebony_exit;
> +	ebony_mac0 = mac0;
> +	ebony_mac1 = mac1;
> +	ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
> +	serial_console_init();
> +}
> Index: working-2.6/arch/powerpc/boot/mktree.c
> ===================================================================
> --- working-2.6.orig/arch/powerpc/boot/mktree.c	2007-01-24 12:01:17.000000000 +1100
> +++ working-2.6/arch/powerpc/boot/mktree.c	2007-05-04 13:46:51.000000000 +1000
> @@ -46,8 +46,8 @@ int main(int argc, char *argv[])
>  	struct	stat	st;
>  	boot_block_t	bt;
>  
> -	if (argc < 3) {
> -		fprintf(stderr, "usage: %s <zImage-file> <boot-image> [entry-point]\n",argv[0]);
> +	if (argc < 5) {
> +		fprintf(stderr, "usage: %s <zImage-file> <boot-image> <load address> <entry point>\n",argv[0]);
>  		exit(1);
>  	}
>  
> @@ -61,10 +61,8 @@ int main(int argc, char *argv[])
>  	bt.bb_magic = htonl(0x0052504F);
>  
>  	/* If we have the optional entry point parameter, use it */
> -	if (argc == 4)
> -		bt.bb_dest = bt.bb_entry_point = htonl(strtoul(argv[3], NULL, 0));
> -	else
> -		bt.bb_dest = bt.bb_entry_point = htonl(0x500000);
> +	bt.bb_dest = htonl(strtoul(argv[3], NULL, 0));
> +	bt.bb_entry_point = htonl(strtoul(argv[4], NULL, 0));
>  
>  	/* We know these from the linker command.
>  	 * ...and then move it up into memory a little more so the
> Index: working-2.6/arch/powerpc/boot/treeboot-ebony.c
> ===================================================================
> --- /dev/null	1970-01-01 00:00:00.000000000 +0000
> +++ working-2.6/arch/powerpc/boot/treeboot-ebony.c	2007-05-04 13:46:51.000000000 +1000
> @@ -0,0 +1,34 @@
> +/*
> + * Old U-boot compatibility for Ebony
> + *
> + * Author: David Gibson <david@gibson.dropbear.id.au>
> + *
> + * Copyright 2007 David Gibson, IBM Corporatio.
> + *   Based on cuboot-83xx.c, which is:
> + * Copyright (c) 2007 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 version 2 as published
> + * by the Free Software Foundation.
> + */
> +
> +#include "ops.h"
> +#include "stdio.h"
> +#include "44x.h"
> +
> +extern char _end[];
> +
> +BSS_STACK(4096);
> +
> +#define OPENBIOS_MAC_BASE	0xfffffe0c
> +#define OPENBIOS_MAC_OFFSET	0xc
> +
> +void platform_init(void)
> +{
> +	unsigned long end_of_ram = 0x8000000;
> +	unsigned long avail_ram = end_of_ram - (unsigned long)_end;
> +
> +	simple_alloc_init(_end, avail_ram, 32, 64);
> +	ebony_init((u8 *)OPENBIOS_MAC_BASE,
> +		   (u8 *)(OPENBIOS_MAC_BASE + OPENBIOS_MAC_OFFSET));
> +}
> Index: working-2.6/arch/powerpc/boot/wrapper
> ===================================================================
> --- working-2.6.orig/arch/powerpc/boot/wrapper	2007-05-03 10:19:32.000000000 +1000
> +++ working-2.6/arch/powerpc/boot/wrapper	2007-05-04 13:46:51.000000000 +1000
> @@ -231,4 +231,12 @@ cuboot*)
>      mkimage -A ppc -O linux -T kernel -C gzip -a "$base" -e "$entry" \
>              $uboot_version -d "$ofile".bin.gz "$ofile"
>      ;;
> +treeboot*)
> +    mv "$ofile" "$ofile.elf"
> +    $object/mktree "$ofile.elf" "$ofile" "$base" "$entry"
> +    if [ -z "$cacheit" ]; then
> +	rm -f "$ofile.elf"
> +    fi
> +    exit 0
> +    ;;
>  esac
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev

^ permalink raw reply

* initramfs on PowerPC
From: Richard Danter @ 2007-05-04 12:32 UTC (permalink / raw)
  To: linuxppc-embedded

Hi all,

I am having a problem booting a kernel with an initramfs. The kernel version 
is 2.6.14. The target is a ppc 82xx board.

I have tried both generating the cpio.gz file myself (find . | copi -o -H 
newc | gzip > ../initramfs_data.cpio.gz) and pointing initramfs source to a 
root FS directory (using xconfig) and then re-building my kernel.

Usually the error is "junk in compressed archive" though I also see an 
occasional error about padding.

I am using U-Boot to load the kernel image (uImage).

My host is SuSE 10.0 (x86), though I guess that shouldn't make any difference 
(endianism?).

Any thoughts on what I may be doing wrong?

Thanks
Rich

^ permalink raw reply

* [PATCH] Re: 2.6.21-rc7-mm2 -- hvsi console driver registration failure
From: Andy Whitcroft @ 2007-05-04 11:38 UTC (permalink / raw)
  To: gregkh, paulus; +Cc: Andrew Morton, linuxppc-dev, linux-kernel
In-Reply-To: <20070425225716.8e9b28ca.akpm@linux-foundation.org>


Trying to get 2.6.21-rc7-mm2 to boot on large PPC64 seems to be a
bit of a challenge.  We have been seeing panics on boot from the
hvsi driver:

	Couldn't register hvsi console driver

Tracking this back, this seems to come from hvsi driver trying to
register itself via tty_register_driver() with a zero units.

The failure is triggered by a change in semantics for kmalloc()
between SLAB and SLUB; kmalloc(0) now returns NULL rather than an
allocation at the smallest size.  Looking at the code in question
even when the allocation succeeds we will not actually use the
memory when device->num is zero.

It is not clear to me if this is a bug in the hvsi driver in that
it should specify some units.  It seems we will try and reserve zero
devices in this case, which seems pointless.

I have tested with the patch below which seems safe to me and stops
the errors and even seems to make the console work.  But perhaps
someone with more driver fu, could verify if driver->num of zero
has any meaning and kick this to the hvsi people if not.

-apw

=== 8< ===
tty_register_driver: only allocate tty instances when defined

If device->num is zero we attempt to kmalloc() zero bytes.
When SLUB is enabled this returns a null pointer and take that as
an allocation failure and fail the device register.  Check for no
devices and avoid the allocation.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
---
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index 959a616..71c4579 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -3724,7 +3724,7 @@ int tty_register_driver(struct tty_driver *driver)
 	if (driver->flags & TTY_DRIVER_INSTALLED)
 		return 0;
 
-	if (!(driver->flags & TTY_DRIVER_DEVPTS_MEM)) {
+	if (!(driver->flags & TTY_DRIVER_DEVPTS_MEM) && driver->num) {
 		p = kmalloc(driver->num * 3 * sizeof(void *), GFP_KERNEL);
 		if (!p)
 			return -ENOMEM;

^ permalink raw reply related

* Re: powerpc_flash_init(), wtf!?
From: Segher Boessenkool @ 2007-05-04 12:14 UTC (permalink / raw)
  To: David Gibson; +Cc: linuxppc-dev
In-Reply-To: <20070503235620.GB28599@localhost.localdomain>

>> If the RAM and/or ROM sit on the SoC bus, the "ranges"
>> property in the SoC node should be able to translate
>> their addresses, yes.  You could opt for having the
>> memory controller a separate device node, as a sibling
>> of the "soc" node, if that agrees better with your
>> SoC architecture.  "It all depends".
>
> But if the flash really is on an external bus controlled by a bus
> controller on the SoC, it sounds like it should go under that bus
> bridge.  In which case the SoC would need another range in its ranges
> property.

Yeah, it all depends on the specific SoC device.
I don't know which one we're talking about here
so I can't give any more specific advice.


Segher

^ permalink raw reply

* Re: [PATCH] powerpc: dart iommu suspend
From: Johannes Berg @ 2007-05-04 10:51 UTC (permalink / raw)
  To: Olof Johansson; +Cc: Paul Mackerras, linuxppc-dev
In-Reply-To: <20070503142441.GA31110@lixom.net>

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

On Thu, 2007-05-03 at 09:24 -0500, Olof Johansson wrote:

> > Maybe somebody can offer opinions on other iommus?
> 
> The PWRficient iommu

[...]

> I don't know what's happened to the IBM bloa^WPAPR platforms

[...]

Thanks for this analysis. I guess that we really want the save/restore
hooks there, and then it doesn't matter if the dart code right now
actually does the copy or if we manage to map it CI up front, we can fix
that later.

johannes


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 190 bytes --]

^ permalink raw reply

* Re: Correct location for ADC/DAC drivers
From: Stefan Roese @ 2007-05-04  8:54 UTC (permalink / raw)
  To: Robert Schwebel; +Cc: linuxppc-dev, linux-kernel
In-Reply-To: <20070504082434.GA22585@pengutronix.de>

On Friday 04 May 2007 10:24, Robert Schwebel wrote:
> On Tue, May 01, 2007 at 02:35:44PM +0200, Stefan Roese wrote:
> > I'm in the stage of integrating some ADC and DAC drivers for the AMCC
> > 405EZ PPC and looking for the correct location to place these drivers
> > in the Linux source tree. The drivers are basically character-drivers,
> > so my first thought is to put them in "drivers/char/adc/foo.c" or
> > "drivers/char/adc_foo.c". Is this a good solution?
> >
> > Any suggestions welcome (could be that I missed an already existing
> > example).
> >
> > BTW: I am aware of the hwmon subsystem, but I don't think it fits my
> > needs in this case.
>
> Could you elaborate the requirements a bit more? ADC is not ADC, because
> slow i2c ADCs which measure a temperature every five minutes have other
> requirements than multi-megabyte-per-second-dma-driven ADCs.

The hardware (PPC405EZ) actually implements an high speed, dma capable, ADC 
controller with 10-bit resolution and up to 4MHz sample rate. The current 
driver doesn't support all these features though (dma is not supported right 
now for example). Could be that this will be added in future releases. It 
would be good though, to have the driver located at the "correct" place in 
the kernel tree right away.

Best regards,
Stefan

^ 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