[PATCH 2/3] [POWERPC] Makalu dts

2007-12-20 Thread Stefan Roese
Signed-off-by: Stefan Roese <[EMAIL PROTECTED]>
---
 arch/powerpc/boot/dts/makalu.dts |  347 ++
 1 files changed, 347 insertions(+), 0 deletions(-)
 create mode 100644 arch/powerpc/boot/dts/makalu.dts

diff --git a/arch/powerpc/boot/dts/makalu.dts b/arch/powerpc/boot/dts/makalu.dts
new file mode 100644
index 000..bdd70e4
--- /dev/null
+++ b/arch/powerpc/boot/dts/makalu.dts
@@ -0,0 +1,347 @@
+/*
+ * Device Tree Source for AMCC Makalu (405EX)
+ *
+ * Copyright 2007 DENX Software Engineering, Stefan Roese <[EMAIL PROTECTED]>
+ *
+ * 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.
+ */
+
+/ {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   model = "amcc,makalu";
+   compatible = "amcc,makalu";
+   dcr-parent = <&/cpus/[EMAIL PROTECTED]>;
+
+   aliases {
+   ethernet0 = &EMAC0;
+   ethernet1 = &EMAC1;
+   serial0 = &UART0;
+   serial1 = &UART1;
+   };
+
+   cpus {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   [EMAIL PROTECTED] {
+   device_type = "cpu";
+   model = "PowerPC,405EX";
+   reg = <0>;
+   clock-frequency = <0>; /* Filled in by U-Boot */
+   timebase-frequency = <0>; /* Filled in by U-Boot */
+   i-cache-line-size = <20>;
+   d-cache-line-size = <20>;
+   i-cache-size = <4000>; /* 16 kB */
+   d-cache-size = <4000>; /* 16 kB */
+   dcr-controller;
+   dcr-access-method = "native";
+   };
+   };
+
+   memory {
+   device_type = "memory";
+   reg = <0 0>; /* Filled in by U-Boot */
+   };
+
+   UIC0: interrupt-controller {
+   compatible = "ibm,uic-405ex", "ibm,uic";
+   interrupt-controller;
+   cell-index = <0>;
+   dcr-reg = <0c0 009>;
+   #address-cells = <0>;
+   #size-cells = <0>;
+   #interrupt-cells = <2>;
+   };
+
+   UIC1: interrupt-controller1 {
+   compatible = "ibm,uic-405ex","ibm,uic";
+   interrupt-controller;
+   cell-index = <1>;
+   dcr-reg = <0d0 009>;
+   #address-cells = <0>;
+   #size-cells = <0>;
+   #interrupt-cells = <2>;
+   interrupts = <1e 4 1f 4>; /* cascade */
+   interrupt-parent = <&UIC0>;
+   };
+
+   UIC2: interrupt-controller2 {
+   compatible = "ibm,uic-405ex","ibm,uic";
+   interrupt-controller;
+   cell-index = <2>;
+   dcr-reg = <0e0 009>;
+   #address-cells = <0>;
+   #size-cells = <0>;
+   #interrupt-cells = <2>;
+   interrupts = <1c 4 1d 4>; /* cascade */
+   interrupt-parent = <&UIC0>;
+   };
+
+   plb {
+   compatible = "ibm,plb-405ex", "ibm,plb4";
+   #address-cells = <1>;
+   #size-cells = <1>;
+   ranges;
+   clock-frequency = <0>; /* Filled in by U-Boot */
+
+   SDRAM0: memory-controller {
+   compatible = "ibm,sdram-405ex";
+   dcr-reg = <010 2>;
+   };
+
+   MAL0: mcmal {
+   compatible = "ibm,mcmal-405ex", "ibm,mcmal2";
+   dcr-reg = <180 62>;
+   num-tx-chans = <2>;
+   num-rx-chans = <2>;
+   interrupt-parent = <&MAL0>;
+   interrupts = <0 1 2 3 4>;
+   #interrupt-cells = <1>;
+   #address-cells = <0>;
+   #size-cells = <0>;
+   interrupt-map = ;
+   interrupt-map-mask = ;
+   };
+
+   POB0: opb {
+   compatible = "ibm,opb-405ex", "ibm,opb";
+   #address-cells = <1>;
+   #size-cells = <1>;
+   ranges = <8000 8000 1000
+ ef60 ef60 a0
+ f000 f000 1000>;
+   dcr-reg = <0a0 5>;
+   clock-frequency = <0>; /* Filled in by U-Boot */
+
+   EBC0: ebc {
+   compatible = "ibm,ebc-405ex", "ibm,ebc";
+   dcr-reg = <012 2>;
+   #address-cells = <2>;
+   #size-cells = <1>;
+   clock-frequency = <0>; /* Filled in by U-Boot */
+   

Re: [PATCH -mm 18/43] powerpc compat_binfmt_elf

2007-12-20 Thread Christoph Hellwig
On Thu, Dec 20, 2007 at 03:58:16AM -0800, Roland McGrath wrote:
> +obj-$(CONFIG_PPC64)  += ../../../fs/compat_binfmt_elf.o

Building files from another directory is nasty.  Please add a
CONFIG_BINFMT_COMPAT_ELF so we can simply build it in fs/

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 3/3] [POWERPC] Makalu defconfig

2007-12-20 Thread Stefan Roese
Signed-off-by: Stefan Roese <[EMAIL PROTECTED]>
---
 arch/powerpc/configs/makalu_defconfig |  812 +
 1 files changed, 812 insertions(+), 0 deletions(-)
 create mode 100644 arch/powerpc/configs/makalu_defconfig

diff --git a/arch/powerpc/configs/makalu_defconfig 
b/arch/powerpc/configs/makalu_defconfig
new file mode 100644
index 000..df65baa
--- /dev/null
+++ b/arch/powerpc/configs/makalu_defconfig
@@ -0,0 +1,812 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.24-rc4
+# Fri Dec 21 07:58:43 2007
+#
+# CONFIG_PPC64 is not set
+
+#
+# Processor support
+#
+# CONFIG_6xx is not set
+# CONFIG_PPC_85xx is not set
+# CONFIG_PPC_8xx is not set
+CONFIG_40x=y
+# CONFIG_44x is not set
+# CONFIG_E200 is not set
+CONFIG_4xx=y
+# CONFIG_PPC_MM_SLICES is not set
+CONFIG_NOT_COHERENT_CACHE=y
+CONFIG_PPC32=y
+CONFIG_WORD_SIZE=32
+CONFIG_PPC_MERGE=y
+CONFIG_MMU=y
+CONFIG_GENERIC_CMOS_UPDATE=y
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_TIME_VSYSCALL=y
+CONFIG_GENERIC_CLOCKEVENTS=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_ARCH_NO_VIRT_TO_BUS is not set
+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_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
+CONFIG_PPC_DCR_NATIVE=y
+# CONFIG_PPC_DCR_MMIO is not set
+CONFIG_PPC_DCR=y
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+CONFIG_POSIX_MQUEUE=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_USER_NS is not set
+# CONFIG_PID_NS is not set
+# CONFIG_AUDIT is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+# CONFIG_FAIR_GROUP_SCHED 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=y
+CONFIG_KALLSYMS_EXTRA_PASS=y
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_ANON_INODES=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLUB_DEBUG=y
+# CONFIG_SLAB is not set
+CONFIG_SLUB=y
+# CONFIG_SLOB is not set
+CONFIG_RT_MUTEXES=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
+CONFIG_BLOCK=y
+CONFIG_LBD=y
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG 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"
+CONFIG_PPC4xx_PCI_EXPRESS=y
+
+#
+# Platform support
+#
+# 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_EP405 is not set
+# CONFIG_KILAUEA is not set
+CONFIG_MAKALU=y
+# CONFIG_WALNUT is not set
+# CONFIG_XILINX_VIRTEX_GENERIC_BOARD is not set
+CONFIG_405EX=y
+# CONFIG_MPIC is not set
+# CONFIG_MPIC_WEIRD is not set
+# 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
+# CONFIG_CPU_FREQ is not set
+# CONFIG_CPM2 is not set
+# CONFIG_FSL_ULI1575 is not set
+
+#
+# Kernel options
+#
+# CONFIG_HIGHMEM is not set
+# CONFIG_TICK_ONESHOT is not set
+# CONFIG_NO_HZ is not set
+# CONFIG_HIGH_RES_TIMERS is not set
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+# 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 is not set
+# CONFIG_MATH_EMULATION is not set
+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

[PATCH 1/3] [POWERPC] Add AMCC Makalu board support to platforms/40x

2007-12-20 Thread Stefan Roese
This patch adds basic support for the AMCC Makalu board to arch/powerpc.

Signed-off-by: Stefan Roese <[EMAIL PROTECTED]>
---
 arch/powerpc/platforms/40x/Kconfig  |   10 ++
 arch/powerpc/platforms/40x/Makefile |1 +
 arch/powerpc/platforms/40x/makalu.c |   61 +++
 3 files changed, 72 insertions(+), 0 deletions(-)
 create mode 100644 arch/powerpc/platforms/40x/makalu.c

diff --git a/arch/powerpc/platforms/40x/Kconfig 
b/arch/powerpc/platforms/40x/Kconfig
index b685ec5..4742401 100644
--- a/arch/powerpc/platforms/40x/Kconfig
+++ b/arch/powerpc/platforms/40x/Kconfig
@@ -32,6 +32,16 @@ config KILAUEA
help
  This option enables support for the AMCC PPC405EX evaluation board.
 
+config MAKALU
+   bool "Makalu"
+   depends on 40x
+   default n
+   select 405EX
+   select PCI
+   select PPC4xx_PCI_EXPRESS
+   help
+ This option enables support for the AMCC PPC405EX board.
+
 #config REDWOOD_5
 #  bool "Redwood-5"
 #  depends on 40x
diff --git a/arch/powerpc/platforms/40x/Makefile 
b/arch/powerpc/platforms/40x/Makefile
index 0f42fd4..5533a5c 100644
--- a/arch/powerpc/platforms/40x/Makefile
+++ b/arch/powerpc/platforms/40x/Makefile
@@ -1,4 +1,5 @@
 obj-$(CONFIG_KILAUEA)  += kilauea.o
+obj-$(CONFIG_MAKALU)   += makalu.o
 obj-$(CONFIG_WALNUT)   += walnut.o
 obj-$(CONFIG_XILINX_VIRTEX_GENERIC_BOARD)  += virtex.o
 obj-$(CONFIG_EP405)+= ep405.o
diff --git a/arch/powerpc/platforms/40x/makalu.c 
b/arch/powerpc/platforms/40x/makalu.c
new file mode 100644
index 000..780f5ec
--- /dev/null
+++ b/arch/powerpc/platforms/40x/makalu.c
@@ -0,0 +1,61 @@
+/*
+ * Makalu board specific routines
+ *
+ * Copyright 2007 DENX Software Engineering, Stefan Roese <[EMAIL PROTECTED]>
+ *
+ * Based on the Walnut code by
+ * Josh Boyer <[EMAIL PROTECTED]>
+ * Copyright 2007 IBM Corporation
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static struct of_device_id makalu_of_bus[] = {
+   { .compatible = "ibm,plb4", },
+   { .compatible = "ibm,opb", },
+   { .compatible = "ibm,ebc", },
+   {},
+};
+
+static int __init makalu_device_probe(void)
+{
+   if (!machine_is(makalu))
+   return 0;
+
+   of_platform_bus_probe(NULL, makalu_of_bus, NULL);
+
+   return 0;
+}
+device_initcall(makalu_device_probe);
+
+static int __init makalu_probe(void)
+{
+   unsigned long root = of_get_flat_dt_root();
+
+   if (!of_flat_dt_is_compatible(root, "amcc,makalu"))
+   return 0;
+
+   ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
+
+   return 1;
+}
+
+define_machine(makalu) {
+   .name   = "Makalu",
+   .probe  = makalu_probe,
+   .progress   = udbg_progress,
+   .init_IRQ   = uic_init_tree,
+   .get_irq= uic_get_irq,
+   .calibrate_decr = generic_calibrate_decr,
+};
-- 
1.5.4.rc1

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 3/3] sbc8548: Add default .config file for Wind River SBC8548

2007-12-20 Thread Paul Gortmaker
This is a suitable .config file for building the WRS SBC8548 kernel
to be used for NFS root via one of the TSEC interfaces and with
serial console via the soc/16550 compatible UART.

Signed-off-by: Paul Gortmaker <[EMAIL PROTECTED]>
---
 arch/powerpc/configs/sbc8548_defconfig |  740 
 1 files changed, 740 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/configs/sbc8548_defconfig 
b/arch/powerpc/configs/sbc8548_defconfig
new file mode 100644
index 000..cb0448a
--- /dev/null
+++ b/arch/powerpc/configs/sbc8548_defconfig
@@ -0,0 +1,740 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.24-rc4
+# Thu Dec 20 18:10:58 2007
+#
+# CONFIG_PPC64 is not set
+
+#
+# Processor support
+#
+# CONFIG_6xx is not set
+CONFIG_PPC_85xx=y
+# CONFIG_PPC_8xx is not set
+# CONFIG_40x is not set
+# CONFIG_44x is not set
+# CONFIG_E200 is not set
+CONFIG_85xx=y
+CONFIG_E500=y
+CONFIG_BOOKE=y
+CONFIG_FSL_BOOKE=y
+# CONFIG_PHYS_64BIT is not set
+CONFIG_SPE=y
+# CONFIG_PPC_MM_SLICES is not set
+CONFIG_PPC32=y
+CONFIG_WORD_SIZE=32
+CONFIG_PPC_MERGE=y
+CONFIG_MMU=y
+CONFIG_GENERIC_CMOS_UPDATE=y
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_TIME_VSYSCALL=y
+CONFIG_GENERIC_CLOCKEVENTS=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_ARCH_NO_VIRT_TO_BUS is not set
+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_OF=y
+CONFIG_PPC_UDBG_16550=y
+# CONFIG_GENERIC_TBSYNC is not set
+CONFIG_AUDIT_ARCH=y
+CONFIG_GENERIC_BUG=y
+CONFIG_DEFAULT_UIMAGE=y
+# CONFIG_PPC_DCR_NATIVE is not set
+# CONFIG_PPC_DCR_MMIO is not set
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_USER_NS is not set
+# CONFIG_PID_NS is not set
+# CONFIG_AUDIT is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+CONFIG_FAIR_GROUP_SCHED=y
+CONFIG_FAIR_USER_SCHED=y
+# CONFIG_FAIR_CGROUP_SCHED 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_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_ANON_INODES=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+CONFIG_RT_MUTEXES=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+# CONFIG_MODULES is not set
+CONFIG_BLOCK=y
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG 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_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_MPC8540_ADS is not set
+# CONFIG_MPC8560_ADS is not set
+# CONFIG_MPC85xx_CDS is not set
+# CONFIG_MPC85xx_MDS is not set
+# CONFIG_MPC85xx_DS is not set
+CONFIG_SBC8548=y
+# CONFIG_SBC8560 is not set
+CONFIG_MPC8540=y
+CONFIG_MPC85xx=y
+CONFIG_MPIC=y
+# CONFIG_MPIC_WEIRD is not set
+# 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
+# CONFIG_CPU_FREQ is not set
+# CONFIG_FSL_ULI1575 is not set
+
+#
+# Kernel options
+#
+# CONFIG_HIGHMEM is not set
+# CONFIG_TICK_ONESHOT is not set
+# CONFIG_NO_HZ is not set
+# CONFIG_HIGH_RES_TIMERS is not set
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+# 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_MATH_EMULATION=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

[PATCH 2/3] sbc8548: Add device tree source for Wind River SBC8548 board

2007-12-20 Thread Paul Gortmaker
This adds the device tree source for the Wind River SBC8548 board.  The
biggest difference between this and the MPC8548CDS reference platform
is the absence of the CDS's Arcadia peripherals and physical access to PCI#2.

Signed-off-by: Paul Gortmaker <[EMAIL PROTECTED]>
---
 arch/powerpc/boot/dts/sbc8548.dts |  242 +
 1 files changed, 242 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/boot/dts/sbc8548.dts 
b/arch/powerpc/boot/dts/sbc8548.dts
new file mode 100644
index 000..e63ed20
--- /dev/null
+++ b/arch/powerpc/boot/dts/sbc8548.dts
@@ -0,0 +1,242 @@
+/*
+ * SBC8548 Device Tree Source
+ *
+ * Copyright 2007 Wind River Systems Inc.
+ *
+ * Paul Gortmaker (see MAINTAINERS for contact information)
+ *
+ * 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.
+ */
+
+
+/ {
+   model = "SBC8548";
+   compatible = "SBC8548";
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   aliases {
+   ethernet0 = &enet0;
+   ethernet1 = &enet1;
+   serial0 = &serial0;
+   serial1 = &serial1;
+   pci0 = &pci0;
+   /* pci1 doesn't have a corresponding physical connector */
+   pci2 = &pci2;
+   };
+
+   cpus {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   PowerPC,[EMAIL PROTECTED] {
+   device_type = "cpu";
+   reg = <0>;
+   d-cache-line-size = <20>;   // 32 bytes
+   i-cache-line-size = <20>;   // 32 bytes
+   d-cache-size = <8000>;  // L1, 32K
+   i-cache-size = <8000>;  // L1, 32K
+   timebase-frequency = <0>;   // From uboot
+   bus-frequency = <0>;
+   clock-frequency = <0>;
+   };
+   };
+
+   memory {
+   device_type = "memory";
+   reg = < 1000>;
+   };
+
+   [EMAIL PROTECTED] {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   device_type = "soc";
+   ranges = < e000 0010>;
+   reg = ;  // CCSRBAR
+   bus-frequency = <0>;
+
+   [EMAIL PROTECTED] {
+   compatible = "fsl,8548-memory-controller";
+   reg = <2000 1000>;
+   interrupt-parent = <&mpic>;
+   interrupts = <12 2>;
+   };
+
+   [EMAIL PROTECTED] {
+   compatible = "fsl,8548-l2-cache-controller";
+   reg = <2 1000>;
+   cache-line-size = <20>; // 32 bytes
+   cache-size = <8>;   // L2, 512K
+   interrupt-parent = <&mpic>;
+   interrupts = <10 2>;
+   };
+
+   [EMAIL PROTECTED] {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   cell-index = <0>;
+   compatible = "fsl-i2c";
+   reg = <3000 100>;
+   interrupts = <2b 2>;
+   interrupt-parent = <&mpic>;
+   dfsrr;
+   };
+
+   [EMAIL PROTECTED] {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   cell-index = <1>;
+   compatible = "fsl-i2c";
+   reg = <3100 100>;
+   interrupts = <2b 2>;
+   interrupt-parent = <&mpic>;
+   dfsrr;
+   };
+
+   [EMAIL PROTECTED] {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   compatible = "fsl,gianfar-mdio";
+   reg = <24520 20>;
+
+   phy0: [EMAIL PROTECTED] {
+   interrupt-parent = <&mpic>;
+   interrupts = <6 1>;
+   reg = <19>;
+   device_type = "ethernet-phy";
+   };
+   phy1: [EMAIL PROTECTED] {
+   interrupt-parent = <&mpic>;
+   interrupts = <7 1>;
+   reg = <1a>;
+   device_type = "ethernet-phy";
+   };
+   };
+
+   enet0: [EMAIL PROTECTED] {
+   cell-index = <0>;
+   device_type = "network";
+   model = "eTSEC"

[PATCH 1/3] sbc8548: Add basic support for Wind River SBC8548 as powerpc

2007-12-20 Thread Paul Gortmaker
This adds the basic support for the Wind River SBC8548 board, implemented
as powerpc.  It closely follows the implementation of the MPC8548CDS.

Signed-off-by: Paul Gortmaker <[EMAIL PROTECTED]>
---
 arch/powerpc/platforms/85xx/Kconfig   |   10 ++-
 arch/powerpc/platforms/85xx/Makefile  |1 +
 arch/powerpc/platforms/85xx/sbc8548.c |  182 +
 3 files changed, 191 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/85xx/Kconfig 
b/arch/powerpc/platforms/85xx/Kconfig
index 33d3bea..8407f43 100644
--- a/arch/powerpc/platforms/85xx/Kconfig
+++ b/arch/powerpc/platforms/85xx/Kconfig
@@ -39,6 +39,12 @@ config MPC85xx_DS
help
  This option enables support for the MPC85xx DS (MPC8544 DS) board
 
+config SBC8548
+   bool "Wind River SBC8548"
+   select DEFAULT_UIMAGE
+   help
+ This option enables support for the Wind River SBC8548 board
+
 config SBC8560
bool "Wind River SBC8560"
select DEFAULT_UIMAGE
@@ -52,7 +58,7 @@ config MPC8540
bool
select PPC_UDBG_16550
select PPC_INDIRECT_PCI
-   default y if MPC8540_ADS || MPC85xx_CDS
+   default y if MPC8540_ADS || MPC85xx_CDS || SBC8548
 
 config MPC8560
bool
@@ -66,4 +72,4 @@ config MPC85xx
select FSL_PCI if PCI
select SERIAL_8250_SHARE_IRQ if SERIAL_8250
default y if MPC8540_ADS || MPC85xx_CDS || MPC8560_ADS \
-   || MPC85xx_MDS || MPC85xx_DS || SBC8560
+   || MPC85xx_MDS || MPC85xx_DS || SBC8560 || SBC8548
diff --git a/arch/powerpc/platforms/85xx/Makefile 
b/arch/powerpc/platforms/85xx/Makefile
index c3f4d01..3a47b7a 100644
--- a/arch/powerpc/platforms/85xx/Makefile
+++ b/arch/powerpc/platforms/85xx/Makefile
@@ -6,4 +6,5 @@ obj-$(CONFIG_MPC8560_ADS) += mpc85xx_ads.o
 obj-$(CONFIG_MPC85xx_CDS) += mpc85xx_cds.o
 obj-$(CONFIG_MPC85xx_DS)  += mpc85xx_ds.o
 obj-$(CONFIG_MPC85xx_MDS) += mpc85xx_mds.o
+obj-$(CONFIG_SBC8548) += sbc8548.o
 obj-$(CONFIG_SBC8560) += sbc8560.o
diff --git a/arch/powerpc/platforms/85xx/sbc8548.c 
b/arch/powerpc/platforms/85xx/sbc8548.c
new file mode 100644
index 000..f3ab271
--- /dev/null
+++ b/arch/powerpc/platforms/85xx/sbc8548.c
@@ -0,0 +1,182 @@
+/*
+ * Wind River SBC8548 setup and early boot code.
+ *
+ * Copyright 2007 Wind River Systems Inc.
+ *
+ * By Paul Gortmaker (see MAINTAINERS for contact information)
+ *
+ * Based largely on the MPC8548CDS support - Copyright 2005 Freescale Inc.
+ *
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#ifdef CONFIG_PCI
+static int sbc8548_exclude_device(struct pci_controller *hose,
+ u_char bus, u_char devfn)
+{
+   if (bus == 0 && PCI_SLOT(devfn) == 0)
+   return PCIBIOS_DEVICE_NOT_FOUND;
+   else
+   return PCIBIOS_SUCCESSFUL;
+}
+#endif
+
+static void __init sbc8548_pic_init(void)
+{
+   struct mpic *mpic;
+   struct resource r;
+   struct device_node *np = NULL;
+
+   np = of_find_node_by_type(np, "open-pic");
+
+   if (np == NULL) {
+   printk(KERN_ERR "Could not find open-pic node\n");
+   return;
+   }
+
+   if (of_address_to_resource(np, 0, &r)) {
+   printk(KERN_ERR "Failed to map mpic register space\n");
+   of_node_put(np);
+   return;
+   }
+
+   mpic = mpic_alloc(np, r.start,
+   MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
+   0, 256, " OpenPIC  ");
+   BUG_ON(mpic == NULL);
+
+   /* Return the mpic node */
+   of_node_put(np);
+
+   mpic_init(mpic);
+}
+
+/*
+ * Setup the architecture
+ */
+static void __init sbc8548_setup_arch(void)
+{
+#ifdef CONFIG_PCI
+   struct device_node *np;
+#endif
+
+   if (ppc_md.progress)
+   ppc_md.progress("sbc8548_setup_arch()", 0);
+
+#ifdef CONFIG_PCI
+   for_each_node_by_type(np, "pci") {
+   if (of_device_is_compatible(np, "fsl,mpc8540-pci") ||
+   of_device_is_compatible(np, "fsl,mpc8548-pcie")) {
+   struct resource rsrc;
+   of_address_to_resource(np, 0, &rsrc);
+   if ((rsrc.start & 0xf) == 0x8000)
+   fsl_add_bridge(np, 1);
+   else
+   fsl_add_bridge(np, 0);
+   }
+ 

[PATCH 0/3] Powerpc support for SBC8548 board

2007-12-20 Thread Paul Gortmaker

The following three patches add support for the Wind River SBC8548 board
onto the powerpc branch.  The patches are as follows:

1) Add basic support for Wind River SBC8548 as powerpc

This adds in the basic platform support file -- closely matching that which
exists for the MPC8548CDS board.  These are layered on top of the earlier
SBC8560 patches (only is an issue for the usual Makefile/Kconfig patch
collisions).

 powerpc/arch/powerpc/platforms/85xx/Kconfig   |   10 +
 powerpc/arch/powerpc/platforms/85xx/Makefile  |1 
 powerpc/arch/powerpc/platforms/85xx/sbc8548.c |  182 ++
 3 files changed, 191 insertions(+), 2 deletions(-)


2) Add device tree source for Wind River SBC8548 board

This also closely matches what exists for the MPC8548CDS platform.  The big
difference here is that this board doesn't have physical access to PCI#2
and it doesn't have the CDS's bridges, i8259, peripherals, etc, so the dts
is overall quite a bit smaller.  I've believe I've got all aliases and the
associated gianfar updates etc. that I'd somehow missed in the sbc8560 dts.

 powerpc/arch/powerpc/boot/dts/sbc8548.dts |  219 ++
 1 file changed, 219 insertions(+)


3) Add default .config file for Wind River SBC8548

This config gives basic serial console and ethernet support for doing an
NFS root setup.  The SBC8548 has one PCI-X slot, and a short PCI-e slot,
so I've enabled PCI.  

 powerpc/arch/powerpc/configs/sbc8548_defconfig |  740 +
 1 file changed, 740 insertions(+)


Like the 8560 board, I'd quickly spun together a u-boot 1.2.0 for testing
this -- since that was the quickest route for me to get a powerpc capable
version.  This too needs a proper u-boot 1.3.1 patchset so we get all the
associated updates within that, like local-mac-address etc.  Soon...

Paul.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


kernel stops at probing MTD CFI driver

2007-12-20 Thread Ishizaki Kou
When I build the MTD Common Flush Interface(CFI) driver as modules,
the kernel stops at BUG() in symbol_put_addr() called by
cfi_cmdset_unknown()[gen_probe.c] and shows the following message. 

I found this problem on Toshiba Cell Reference Set. I think this
problem relates with powerpc64 ABI.

kernel BUG at kernel/module.c:783!
cpu 0x1: Vector: 700 (Program Check) at [c2723070]
pc: c007faac: .symbol_put_addr+0x34/0x64
lr: c007faa4: .symbol_put_addr+0x2c/0x64
sp: c27232f0
   msr: 90029032
  current = 0xc271c000
  paca= 0xc047c380
pid   = 762, comm = modprobe
kernel BUG at kernel/module.c:783!
enter ? for help
[c2723370] d01040f0 .check_cmd_set+0xf0/0x138 [gen_probe]
[c2723430] d0104464 .mtd_do_chip_probe+0x32c/0x650 [gen_probe]
[c2723550] d0100334 .cfi_probe+0x1c/0x34 [cfi_probe]
[c27235d0] d00fd20c .do_map_probe+0x84/0xc0 [chipreg]
[c2723670] d0171348 .of_physmap_probe+0x280/0x4f0 [physmap_of]
[c2723780] c001bd44 .of_platform_device_probe+0x78/0xb0
[c2723810] c01e1708 .driver_probe_device+0x140/0x208
[c27238a0] c01e1a00 .__driver_attach+0xdc/0x164
[c2723930] c01e0550 .bus_for_each_dev+0x7c/0xd4
[c27239f0] c01e1470 .driver_attach+0x28/0x40
[c2723a70] c01e0a6c .bus_add_driver+0x90/0x1fc
[c2723b10] c01e1e28 .driver_register+0x94/0xb0
[c2723b90] c001c150 .of_register_platform_driver+0x28/0x3c
[c2723c00] d0171608 .of_physmap_init+0x1c/0x4e4 [physmap_of]
[c2723c80] c007f8b8 .sys_init_module+0x1608/0x17c8
[c2723e30] c0008634 syscall_exit+0x0/0x40
--- Exception: c01 (System Call) at 0ff0f4b4

symbol_put_addr() tests the address by module_text_address(). Because
the address is not in .text section on powerpc64 system,
module_text_address() fails and symbol_put_addr() calls BUG().

Though we can avoid this problem by using __symbol_put() instead of
symbol_put_addr(), I don't think this is proper way. Does anyone have
better solutions for this problem?

Best regards,
Kou Ishizaki


--- linux-2.6.24-rc5.org/drivers/mtd/chips/gen_probe.c  2007-12-19 
19:05:56.0 +0900
+++ linux-2.6.24-rc5/drivers/mtd/chips/gen_probe.c  2007-12-19 
19:44:23.0 +0900
@@ -222,7 +222,7 @@ static inline struct mtd_info *cfi_cmdse

mtd = (*probe_function)(map, primary);
/* If it was happy, it'll have increased its own use count */
-   symbol_put_addr(probe_function);
+   __symbol_put(probename);
return mtd;
}
 #endif
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [alsa-devel] [PATCH] ASoC drivers for the Freescale MPC8610 SoC

2007-12-20 Thread Lee Revell
On Dec 20, 2007 8:54 AM, Takashi Iwai <[EMAIL PROTECTED]> wrote:
> At Thu, 20 Dec 2007 08:24:35 -0600,
> Timur Tabi wrote:
> >
> > >> +static int fsl_dma_new(struct snd_card *card, struct snd_soc_codec_dai 
> > >> *dai,
> > >> +  struct snd_pcm *pcm)
> > >> +{
> > >> +  static u64 fsl_dma_dmamask = 0x;
> > >> +  int ret;
> > >> +
> > >> +  if (!card->dev->dma_mask)
> > >> +  card->dev->dma_mask = &fsl_dma_dmamask;
> > >
> > > I haven't read how your channel allocation works, but providing a
> > > pointer to a local static variable is a bit fishy no matter what.
> >
> > I just copied this code from another module.  All the ALSA drivers do this,
>
> All?  No, only a few...
> For PCI, usually pci_set_dma_mask() and pci_set_consistent_dma_mask()
> are used, of course.

Timur,

Nicely commented driver!  I wish they were all like this ;-)

Please use DMA_32BIT_MASK (see include/linux/dma-mapping.h) instead of
0x.  I've personally fixed a heisenbug in an ALSA driver
caused by incorrectly typed DMA mask...

Lee
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: Enable RTC for Ebony and Walnut

2007-12-20 Thread Stephen Rothwell
On Fri, 21 Dec 2007 13:21:30 +1100 David Gibson <[EMAIL PROTECTED]> wrote:
>
> +++ working-2.6/arch/powerpc/sysdev/of_rtc.c  2007-12-21 13:11:34.0 
> +1100
> +#include 

Use linux/of_platform.h, please.

> +
> +static struct {

const or __initdata

> + char *compatible;

const

> + char *plat_name;

const (ok, no, thanks to platform_device_register_simple()).

> +} of_rtc_table[] = {
> + { "ds1743-nvram", "rtc-ds1742" },
> +};
> +
> +void __init of_instantiate_rtc(void)
> +{
> + struct device_node *node;
> + int err;
> + int i;
> +
> + for (i = 0; i < ARRAY_SIZE(of_rtc_table); i++) {
> + char *compatible = of_rtc_table[i].compatible;

const (or maybe just use of_rtc_table[i].compatible directly in the one
place it is used).

-- 
Cheers,
Stephen Rothwell[EMAIL PROTECTED]
http://www.canb.auug.org.au/~sfr/


pgpDDXOSTigHn.pgp
Description: PGP signature
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

[PATCH] [POWERPC] pci_32.c: use for_each_child_of_node

2007-12-20 Thread Stephen Rothwell

Signed-off-by: Stephen Rothwell <[EMAIL PROTECTED]>
---
 arch/powerpc/kernel/pci_32.c |   20 +---
 1 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
index 37cb7b9..b5121b8 100644
--- a/arch/powerpc/kernel/pci_32.c
+++ b/arch/powerpc/kernel/pci_32.c
@@ -13,6 +13,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -171,7 +172,7 @@ make_one_node_map(struct device_node* node, u8 pci_bus)
} else
pci_to_OF_bus_map[pci_bus] = bus_range[0];
 
-   for (node=node->child; node != 0;node = node->sibling) {
+   for_each_child_of_node(node, node) {
struct pci_dev* dev;
const unsigned int *class_code, *reg;

@@ -240,15 +241,18 @@ pcibios_make_OF_bus_map(void)
 typedef int (*pci_OF_scan_iterator)(struct device_node* node, void* data);
 
 static struct device_node*
-scan_OF_pci_childs(struct device_node* node, pci_OF_scan_iterator filter, 
void* data)
+scan_OF_pci_childs(struct device_node *parent, pci_OF_scan_iterator filter, 
void* data)
 {
+   struct device_node *node;
struct device_node* sub_node;
 
-   for (; node != 0;node = node->sibling) {
+   for_each_child_of_node(parent, node) {
const unsigned int *class_code;

-   if (filter(node, data))
+   if (filter(node, data)) {
+   of_node_put(node);
return node;
+   }
 
/* For PCI<->PCI bridges or CardBus bridges, we go down
 * Note: some OFs create a parent node "multifunc-device" as
@@ -260,9 +264,11 @@ scan_OF_pci_childs(struct device_node* node, 
pci_OF_scan_iterator filter, void*
(*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS)) &&
strcmp(node->name, "multifunc-device"))
continue;
-   sub_node = scan_OF_pci_childs(node->child, filter, data);
-   if (sub_node)
+   sub_node = scan_OF_pci_childs(node, filter, data);
+   if (sub_node) {
+   of_node_put(node);
return sub_node;
+   }
}
return NULL;
 }
@@ -366,7 +372,7 @@ pci_device_from_OF_node(struct device_node* node, u8* bus, 
u8* devfn)
hose = pci_find_hose_for_OF_device(node);
if (!hose || !hose->dn)
return -ENODEV;
-   if (!scan_OF_pci_childs(hose->dn->child,
+   if (!scan_OF_pci_childs(hose->dn,
find_OF_pci_device_filter, (void *)node))
return -ENODEV;
reg = of_get_property(node, "reg", NULL);
-- 
1.5.3.7

-- 
Cheers,
Stephen Rothwell[EMAIL PROTECTED]
http://www.canb.auug.org.au/~sfr/
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] [POWERPC] eeh.c: use for_each_child_of_node

2007-12-20 Thread Stephen Rothwell

Signed-off-by: Stephen Rothwell <[EMAIL PROTECTED]>
---
 arch/powerpc/platforms/pseries/eeh.c |   43 -
 1 files changed, 21 insertions(+), 22 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/eeh.c 
b/arch/powerpc/platforms/pseries/eeh.c
index aa14a85..9eb539e 100644
--- a/arch/powerpc/platforms/pseries/eeh.c
+++ b/arch/powerpc/platforms/pseries/eeh.c
@@ -29,6 +29,8 @@
 #include 
 #include 
 #include 
+#include 
+
 #include 
 #include 
 #include 
@@ -169,7 +171,6 @@ static void rtas_slot_error_detail(struct pci_dn *pdn, int 
severity,
  */
 static size_t gather_pci_data(struct pci_dn *pdn, char * buf, size_t len)
 {
-   struct device_node *dn;
struct pci_dev *dev = pdn->pcidev;
u32 cfg;
int cap, i;
@@ -243,12 +244,12 @@ static size_t gather_pci_data(struct pci_dn *pdn, char * 
buf, size_t len)
 
/* Gather status on devices under the bridge */
if (dev->class >> 16 == PCI_BASE_CLASS_BRIDGE) {
-   dn = pdn->node->child;
-   while (dn) {
+   struct device_node *dn;
+
+   for_each_child_of_node(pdn->node, dn) {
pdn = PCI_DN(dn);
if (pdn)
n += gather_pci_data(pdn, buf+n, len-n);
-   dn = dn->sibling;
}
}
 
@@ -372,7 +373,7 @@ struct device_node * find_device_pe(struct device_node *dn)
return dn;
 }
 
-/** Mark all devices that are peers of this device as failed.
+/** Mark all devices that are children of this device as failed.
  *  Mark the device driver too, so that it can see the failure
  *  immediately; this is critical, since some drivers poll
  *  status registers in interrupts ... If a driver is polling,
@@ -380,9 +381,11 @@ struct device_node * find_device_pe(struct device_node *dn)
  *  an interrupt context, which is bad.
  */
 
-static void __eeh_mark_slot (struct device_node *dn, int mode_flag)
+static void __eeh_mark_slot(struct device_node *parent, int mode_flag)
 {
-   while (dn) {
+   struct device_node *dn;
+
+   for_each_child_of_node(parent, dn) {
if (PCI_DN(dn)) {
/* Mark the pci device driver too */
struct pci_dev *dev = PCI_DN(dn)->pcidev;
@@ -392,10 +395,8 @@ static void __eeh_mark_slot (struct device_node *dn, int 
mode_flag)
if (dev && dev->driver)
dev->error_state = pci_channel_io_frozen;
 
-   if (dn->child)
-   __eeh_mark_slot (dn->child, mode_flag);
+   __eeh_mark_slot(dn, mode_flag);
}
-   dn = dn->sibling;
}
 }
 
@@ -415,19 +416,19 @@ void eeh_mark_slot (struct device_node *dn, int mode_flag)
if (dev)
dev->error_state = pci_channel_io_frozen;
 
-   __eeh_mark_slot (dn->child, mode_flag);
+   __eeh_mark_slot(dn, mode_flag);
 }
 
-static void __eeh_clear_slot (struct device_node *dn, int mode_flag)
+static void __eeh_clear_slot(struct device_node *parent, int mode_flag)
 {
-   while (dn) {
+   struct device_node *dn;
+
+   for_each_child_of_node(parent, dn) {
if (PCI_DN(dn)) {
PCI_DN(dn)->eeh_mode &= ~mode_flag;
PCI_DN(dn)->eeh_check_count = 0;
-   if (dn->child)
-   __eeh_clear_slot (dn->child, mode_flag);
+   __eeh_clear_slot(dn, mode_flag);
}
-   dn = dn->sibling;
}
 }
 
@@ -444,7 +445,7 @@ void eeh_clear_slot (struct device_node *dn, int mode_flag)
 
PCI_DN(dn)->eeh_mode &= ~mode_flag;
PCI_DN(dn)->eeh_check_count = 0;
-   __eeh_clear_slot (dn->child, mode_flag);
+   __eeh_clear_slot(dn, mode_flag);
spin_unlock_irqrestore(&confirm_error_lock, flags);
 }
 
@@ -849,11 +850,8 @@ void eeh_restore_bars(struct pci_dn *pdn)
if ((pdn->eeh_mode & EEH_MODE_SUPPORTED) && !IS_BRIDGE(pdn->class_code))
__restore_bars (pdn);
 
-   dn = pdn->node->child;
-   while (dn) {
+   for_each_child_of_node(pdn->node, dn)
eeh_restore_bars (PCI_DN(dn));
-   dn = dn->sibling;
-   }
 }
 
 /**
@@ -1131,7 +1129,8 @@ static void eeh_add_device_early(struct device_node *dn)
 void eeh_add_device_tree_early(struct device_node *dn)
 {
struct device_node *sib;
-   for (sib = dn->child; sib; sib = sib->sibling)
+
+   for_each_child_of_node(dn, sib)
eeh_add_device_tree_early(sib);
eeh_add_device_early(dn);
 }
-- 
1.5.3.7

-- 
Cheers,
Stephen Rothwell[EMAIL PROTECTED]
http://www.canb.auug.org.au/~sfr/
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 3/3] [POWERPC] iSeries: eliminate pci_dn bussubno

2007-12-20 Thread Stephen Rothwell
xlate_iomm_address() really wants the ds_addr to pass to the HV, so store
that value (instead of the BAR number) when we allocate the device bars.
This is not a fast path, so we can look up the device_node property
there instead of using the bussubno field of the pci_dn.

The other user of iseries_ds_addr() was already scanning the device tree,
so looking up a property will not slow it down any more.

Signed-off-by: Stephen Rothwell <[EMAIL PROTECTED]>
---
 arch/powerpc/kernel/pci_dn.c |5 -
 arch/powerpc/platforms/iseries/pci.c |   12 +++-
 include/asm-powerpc/pci-bridge.h |1 -
 3 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/arch/powerpc/kernel/pci_dn.c b/arch/powerpc/kernel/pci_dn.c
index 85d4d89..1c67de5 100644
--- a/arch/powerpc/kernel/pci_dn.c
+++ b/arch/powerpc/kernel/pci_dn.c
@@ -56,11 +56,6 @@ static void * __devinit update_dn_pci_info(struct 
device_node *dn, void *data)
pdn->busno = (regs[0] >> 16) & 0xff;
pdn->devfn = (regs[0] >> 8) & 0xff;
}
-   if (firmware_has_feature(FW_FEATURE_ISERIES)) {
-   const u32 *busp = of_get_property(dn, "linux,subbus", NULL);
-   if (busp)
-   pdn->bussubno = *busp;
-   }
 
pdn->pci_ext_config_space = (type && *type == 1);
return NULL;
diff --git a/arch/powerpc/platforms/iseries/pci.c 
b/arch/powerpc/platforms/iseries/pci.c
index 9319410..cc562e4 100644
--- a/arch/powerpc/platforms/iseries/pci.c
+++ b/arch/powerpc/platforms/iseries/pci.c
@@ -29,6 +29,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -70,7 +71,7 @@ static long current_iomm_table_entry;
  * Lookup Tables.
  */
 static struct device_node *iomm_table[IOMM_TABLE_MAX_ENTRIES];
-static u8 iobar_table[IOMM_TABLE_MAX_ENTRIES];
+static u64 ds_addr_table[IOMM_TABLE_MAX_ENTRIES];
 
 static DEFINE_SPINLOCK(iomm_table_lock);
 
@@ -80,8 +81,9 @@ static DEFINE_SPINLOCK(iomm_table_lock);
 static inline u64 iseries_ds_addr(struct device_node *node)
 {
struct pci_dn *pdn = PCI_DN(node);
+   const u32 *sbp = of_get_property(node, "linux,subbus", NULL);
 
-   return ((u64)pdn->busno << 48) + ((u64)pdn->bussubno << 40)
+   return ((u64)pdn->busno << 48) + ((u64)(sbp ? *sbp : 0) << 40)
+ ((u64)0x10 << 32);
 }
 
@@ -333,7 +335,8 @@ static void __init iomm_table_allocate_entry(struct pci_dev 
*dev, int bar_num)
 */
while (bar_size > 0 ) {
iomm_table[current_iomm_table_entry] = dev->sysdata;
-   iobar_table[current_iomm_table_entry] = bar_num;
+   ds_addr_table[current_iomm_table_entry] =
+   iseries_ds_addr(dev->sysdata) | (bar_num << 24);
bar_size -= IOMM_TABLE_ENTRY_SIZE;
++current_iomm_table_entry;
}
@@ -598,8 +601,7 @@ static inline struct device_node *xlate_iomm_address(
dn = iomm_table[ind];
 
if (dn != NULL) {
-   int barnum = iobar_table[ind];
-   *dsaptr = iseries_ds_addr(dn) | (barnum << 24);
+   *dsaptr = ds_addr_table[ind];
*bar_offset = base_addr % IOMM_TABLE_ENTRY_SIZE;
} else
panic("PCI: Invalid PCI IO address detected!\n");
diff --git a/include/asm-powerpc/pci-bridge.h b/include/asm-powerpc/pci-bridge.h
index 2932404..a6ea49e 100644
--- a/include/asm-powerpc/pci-bridge.h
+++ b/include/asm-powerpc/pci-bridge.h
@@ -165,7 +165,6 @@ struct iommu_table;
 
 struct pci_dn {
int busno;  /* pci bus number */
-   int bussubno;   /* pci subordinate bus number */
int devfn;  /* pci device and function number */
 
struct  pci_controller *phb;/* for pci devices */
-- 
1.5.3.7

-- 
Cheers,
Stephen Rothwell[EMAIL PROTECTED]
http://www.canb.auug.org.au/~sfr/
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 2/3] [POWERPC] the pci_dn pcidev is only used by EEH

2007-12-20 Thread Stephen Rothwell

Signed-off-by: Stephen Rothwell <[EMAIL PROTECTED]>
---
 arch/powerpc/platforms/iseries/pci.c |1 -
 include/asm-powerpc/pci-bridge.h |2 +-
 2 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/iseries/pci.c 
b/arch/powerpc/platforms/iseries/pci.c
index 30e3d99..9319410 100644
--- a/arch/powerpc/platforms/iseries/pci.c
+++ b/arch/powerpc/platforms/iseries/pci.c
@@ -438,7 +438,6 @@ void __init iSeries_pcibios_fixup_resources(struct pci_dev 
*pdev)
}
 
pdev->sysdata = node;
-   PCI_DN(node)->pcidev = pdev;
allocate_device_bars(pdev);
iseries_device_information(pdev, bus, *sub_bus);
iommu_devnode_init_iSeries(pdev, node);
diff --git a/include/asm-powerpc/pci-bridge.h b/include/asm-powerpc/pci-bridge.h
index 07cdb5b..2932404 100644
--- a/include/asm-powerpc/pci-bridge.h
+++ b/include/asm-powerpc/pci-bridge.h
@@ -170,12 +170,12 @@ struct pci_dn {
 
struct  pci_controller *phb;/* for pci devices */
struct  iommu_table *iommu_table;   /* for phb's or bridges */
-   struct  pci_dev *pcidev;/* back-pointer to the pci device */
struct  device_node *node;  /* back-pointer to the device_node */
 
int pci_ext_config_space;   /* for pci devices */
 
 #ifdef CONFIG_EEH
+   struct  pci_dev *pcidev;/* back-pointer to the pci device */
int class_code; /* pci device class */
int eeh_mode;   /* See eeh.h for possible EEH_MODEs */
int eeh_config_addr;
-- 
1.5.3.7

-- 
Cheers,
Stephen Rothwell[EMAIL PROTECTED]
http://www.canb.auug.org.au/~sfr/
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 1/3] [POWERPC] the pci_dn class_code is only used by EEH

2007-12-20 Thread Stephen Rothwell

Signed-off-by: Stephen Rothwell <[EMAIL PROTECTED]>
---
 include/asm-powerpc/pci-bridge.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/asm-powerpc/pci-bridge.h b/include/asm-powerpc/pci-bridge.h
index 9b16d3b..07cdb5b 100644
--- a/include/asm-powerpc/pci-bridge.h
+++ b/include/asm-powerpc/pci-bridge.h
@@ -167,7 +167,6 @@ struct pci_dn {
int busno;  /* pci bus number */
int bussubno;   /* pci subordinate bus number */
int devfn;  /* pci device and function number */
-   int class_code; /* pci device class */
 
struct  pci_controller *phb;/* for pci devices */
struct  iommu_table *iommu_table;   /* for phb's or bridges */
@@ -177,6 +176,7 @@ struct pci_dn {
int pci_ext_config_space;   /* for pci devices */
 
 #ifdef CONFIG_EEH
+   int class_code; /* pci device class */
int eeh_mode;   /* See eeh.h for possible EEH_MODEs */
int eeh_config_addr;
int eeh_pe_config_addr; /* new-style partition endpoint address */
-- 
1.5.3.7

-- 
Cheers,
Stephen Rothwell[EMAIL PROTECTED]
http://www.canb.auug.org.au/~sfr/
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [patch v2] PS3: Fix printing of os-area magic numbers

2007-12-20 Thread Paul Mackerras
Geoff Levand writes:

> Fix a bug in the printing of the os-area magic numbers which assumed that
> magic numbers were zero terminated strings.  The magic numbers are represented
> in memory as integers.  If the os-area sections are not initialized correctly
> they could contained random data that would be printed to the display.

> + u8 str[sizeof(h->magic_num) + 1];
> + u8 *s, *d;
> +
> + for(s = h->magic_num, d = str; s < h->magic_num + sizeof(h->magic_num);
> + s++, d++) {
> + *d = isprint(*s) ? *s : '.';
> + }
> + d[sizeof(h->magic_num)] = 0;

This last statement is wrong, because d has been incremented to point
to the last byte of str already by this stage.

It would be nicer if you pulled out the two instances of the for loop
into a little helper function.

> + for(s = (u8*)&db->magic_num, d = str;

Why do you need the (u8*) cast in this case but not the other?

Paul.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] [POWERPC] Make non-PCI build work again

2007-12-20 Thread Olof Johansson
On Fri, Dec 21, 2007 at 03:37:07PM +1100, Stephen Rothwell wrote:
> Maple and pasemi both require PCI as does CONFIG_OF_PLATFORM_PCI.
> The default setting of CONFIG_ISA_DMA_API is set to match the protection
> around the relevant routines in asm/dma.h.
> 
> I also had to remove the PMAC platform from the combined build.  The
> precis is that to build a 64 bit kernel with no PCI, you can only include
> pSeries and iSeries.
> 
> Signed-off-by: Stephen Rothwell <[EMAIL PROTECTED]>
> ---
>  arch/powerpc/Kconfig  |3 ++-
>  arch/powerpc/platforms/maple/Kconfig  |1 +
>  arch/powerpc/platforms/pasemi/Kconfig |1 +

Acked-by: Olof Johansson <[EMAIL PROTECTED]>


-Olof

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 21/21] [POWERPC] 4xx: Add 440SPe revA runtime detection to PCIe

2007-12-20 Thread Benjamin Herrenschmidt
From: Stefan Roese <[EMAIL PROTECTED]>

This patch adds runtime detection of the 440SPe revision A chips. These
chips are equipped with a slighly different PCIe core and need special/
different initialization. The compatible node is changed to
"plb-pciex-440spe" ("A" and "B" dropped). This is needed for boards that
can be equipped with both PPC revisions like the AMCC Yucca.

Signed-off-by: Stefan Roese <[EMAIL PROTECTED]>
Signed-off-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
---

 arch/powerpc/boot/dts/katmai.dts |6 +++---
 arch/powerpc/sysdev/ppc4xx_pci.c |   25 +
 2 files changed, 20 insertions(+), 11 deletions(-)

--- linux-merge.orig/arch/powerpc/boot/dts/katmai.dts   2007-12-21 
14:37:05.0 +1100
+++ linux-merge/arch/powerpc/boot/dts/katmai.dts2007-12-21 
14:37:06.0 +1100
@@ -267,7 +267,7 @@
#interrupt-cells = <1>;
#size-cells = <2>;
#address-cells = <3>;
-   compatible = "ibm,plb-pciex-440speB", "ibm,plb-pciex";
+   compatible = "ibm,plb-pciex-440spe", "ibm,plb-pciex";
primary;
port = <0>; /* port number */
reg = ;
#size-cells = <2>;
#address-cells = <3>;
-   compatible = "ibm,plb-pciex-440speB", "ibm,plb-pciex";
+   compatible = "ibm,plb-pciex-440spe", "ibm,plb-pciex";
primary;
port = <1>; /* port number */
reg = ;
#size-cells = <2>;
#address-cells = <3>;
-   compatible = "ibm,plb-pciex-440speB", "ibm,plb-pciex";
+   compatible = "ibm,plb-pciex-440spe", "ibm,plb-pciex";
primary;
port = <2>; /* port number */
reg = sdr_base + PESDRn_DLPSET, val);
mtdcri(SDR0, port->sdr_base + PESDRn_UTLSET1, 0x2022);
-   if (of_device_is_compatible(port->node, "ibm,plb-pciex-440speA"))
+   if (ppc440spe_revA())
mtdcri(SDR0, port->sdr_base + PESDRn_UTLSET2, 0x1100);
mtdcri(SDR0, port->sdr_base + PESDRn_440SPE_HSSL0SET1, 0x3500);
mtdcri(SDR0, port->sdr_base + PESDRn_440SPE_HSSL1SET1, 0x3500);
@@ -767,7 +775,6 @@ static struct ppc4xx_pciex_hwops ppc440s
.setup_utl  = ppc440speB_pciex_init_utl,
 };
 
-
 #endif /* CONFIG_44x */
 
 #ifdef CONFIG_40x
@@ -881,10 +888,12 @@ static int __init ppc4xx_pciex_check_cor
return 0;
 
 #ifdef CONFIG_44x
-   if (of_device_is_compatible(np, "ibm,plb-pciex-440speA"))
-   ppc4xx_pciex_hwops = &ppc440speA_pcie_hwops;
-   else if (of_device_is_compatible(np, "ibm,plb-pciex-440speB"))
-   ppc4xx_pciex_hwops = &ppc440speB_pcie_hwops;
+   if (of_device_is_compatible(np, "ibm,plb-pciex-440spe")) {
+   if (ppc440spe_revA())
+   ppc4xx_pciex_hwops = &ppc440speA_pcie_hwops;
+   else
+   ppc4xx_pciex_hwops = &ppc440speB_pcie_hwops;
+   }
 #endif /* CONFIG_44x*/
 #ifdef CONFIG_40x
if (of_device_is_compatible(np, "ibm,plb-pciex-405ex"))
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 20/21] [POWERPC] pci32: 4xx embedded platforms want to reassign all PCI resources

2007-12-20 Thread Benjamin Herrenschmidt
This makes 4xx embedded platforms re-assign all PCI resources as we
pretty much never care about what the various firmwares have done on
these, it's generally not compatible with the way the kernel will map
the bridges.

We still need to also enable bus renumbering on some of them, but I
will do that from a separate patch after I've fixed 4xx PCIe to handle
all bus numbers.

Signed-off-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
---

 arch/powerpc/platforms/40x/ep405.c   |2 ++
 arch/powerpc/platforms/40x/kilauea.c |3 +++
 arch/powerpc/platforms/40x/walnut.c  |3 +++
 arch/powerpc/platforms/44x/bamboo.c  |4 
 arch/powerpc/platforms/44x/ebony.c   |3 +++
 arch/powerpc/platforms/44x/katmai.c  |3 +++
 arch/powerpc/platforms/44x/sequoia.c |5 -
 arch/powerpc/platforms/44x/taishan.c |2 ++
 8 files changed, 24 insertions(+), 1 deletion(-)

--- linux-merge.orig/arch/powerpc/platforms/44x/bamboo.c2007-12-14 
15:48:53.0 +1100
+++ linux-merge/arch/powerpc/platforms/44x/bamboo.c 2007-12-14 
15:49:52.0 +1100
@@ -21,6 +21,8 @@
 #include 
 #include 
 #include 
+#include 
+
 #include "44x.h"
 
 static struct of_device_id bamboo_of_bus[] = {
@@ -48,6 +50,8 @@ static int __init bamboo_probe(void)
if (!of_flat_dt_is_compatible(root, "amcc,bamboo"))
return 0;
 
+   ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
+
return 1;
 }
 
Index: linux-merge/arch/powerpc/platforms/40x/ep405.c
===
--- linux-merge.orig/arch/powerpc/platforms/40x/ep405.c 2007-12-14 
15:49:45.0 +1100
+++ linux-merge/arch/powerpc/platforms/40x/ep405.c  2007-12-14 
15:49:52.0 +1100
@@ -101,6 +101,8 @@ static void __init ep405_setup_arch(void
 {
/* Find & init the BCSR CPLD */
ep405_init_bcsr();
+
+   ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
 }
 
 static int __init ep405_probe(void)
Index: linux-merge/arch/powerpc/platforms/40x/kilauea.c
===
--- linux-merge.orig/arch/powerpc/platforms/40x/kilauea.c   2007-12-14 
15:48:53.0 +1100
+++ linux-merge/arch/powerpc/platforms/40x/kilauea.c2007-12-14 
15:49:52.0 +1100
@@ -19,6 +19,7 @@
 #include 
 #include 
 #include 
+#include 
 
 static struct of_device_id kilauea_of_bus[] = {
{ .compatible = "ibm,plb4", },
@@ -45,6 +46,8 @@ static int __init kilauea_probe(void)
if (!of_flat_dt_is_compatible(root, "amcc,kilauea"))
return 0;
 
+   ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
+
return 1;
 }
 
Index: linux-merge/arch/powerpc/platforms/40x/walnut.c
===
--- linux-merge.orig/arch/powerpc/platforms/40x/walnut.c2007-12-14 
15:48:53.0 +1100
+++ linux-merge/arch/powerpc/platforms/40x/walnut.c 2007-12-14 
15:49:52.0 +1100
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 
 static struct of_device_id walnut_of_bus[] = {
{ .compatible = "ibm,plb3", },
@@ -51,6 +52,8 @@ static int __init walnut_probe(void)
if (!of_flat_dt_is_compatible(root, "ibm,walnut"))
return 0;
 
+   ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
+
return 1;
 }
 
Index: linux-merge/arch/powerpc/platforms/44x/ebony.c
===
--- linux-merge.orig/arch/powerpc/platforms/44x/ebony.c 2007-12-14 
15:48:53.0 +1100
+++ linux-merge/arch/powerpc/platforms/44x/ebony.c  2007-12-14 
15:49:52.0 +1100
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "44x.h"
 
@@ -55,6 +56,8 @@ static int __init ebony_probe(void)
if (!of_flat_dt_is_compatible(root, "ibm,ebony"))
return 0;
 
+   ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
+
return 1;
 }
 
Index: linux-merge/arch/powerpc/platforms/44x/katmai.c
===
--- linux-merge.orig/arch/powerpc/platforms/44x/katmai.c2007-12-14 
15:49:51.0 +1100
+++ linux-merge/arch/powerpc/platforms/44x/katmai.c 2007-12-14 
15:49:52.0 +1100
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "44x.h"
 
@@ -49,6 +50,8 @@ static int __init katmai_probe(void)
if (!of_flat_dt_is_compatible(root, "amcc,katmai"))
return 0;
 
+   ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
+
return 1;
 }
 
Index: linux-merge/arch/powerpc/platforms/44x/sequoia.c
===
--- linux-merge.orig/arch/powerpc/platforms/44x/sequoia.c   2007-12-14 
15:48:53.0 +1100
+++ linux-merge/arch/powerpc/platforms/44x/sequoia.c2007-12-14 
15:49:52.0 +1100
@@ -21,7 +21,8 @@
 #include 
 #include 
 #include 
-#include "44x.h"
+#include 
+
 
 static struct of_device_id 

[PATCH 19/21] [POWERPC] 4xx PCI-E Link setup improvements

2007-12-20 Thread Benjamin Herrenschmidt
This improves the way the 4xx PCI-E code handles checking for a link
and adds explicit testing of CRS result codes on config space accesses.

This should make it more reliable.

Also, bridges with no link are now still created, though config space
accesses beyond the root complex are filtered. This is one step toward
eventually supporting hotplug.

Signed-off-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
---

 arch/powerpc/sysdev/ppc4xx_pci.c |  222 +++
 arch/powerpc/sysdev/ppc4xx_pci.h |2 
 2 files changed, 134 insertions(+), 90 deletions(-)

--- linux-merge.orig/arch/powerpc/sysdev/ppc4xx_pci.c   2007-12-18 
11:21:49.0 +1100
+++ linux-merge/arch/powerpc/sysdev/ppc4xx_pci.c2007-12-19 
15:45:19.0 +1100
@@ -16,6 +16,8 @@
  *
  */
 
+#undef DEBUG
+
 #include 
 #include 
 #include 
@@ -531,10 +533,13 @@ struct ppc4xx_pciex_port
struct device_node  *node;
unsigned intindex;
int endpoint;
+   int link;
+   int has_ibpre;
unsigned intsdr_base;
dcr_host_t  dcrs;
struct resource cfg_space;
struct resource utl_regs;
+   void __iomem*utl_base;
 };
 
 static struct ppc4xx_pciex_port *ppc4xx_pciex_ports;
@@ -706,29 +711,44 @@ static int ppc440spe_pciex_init_port_hw(
return 0;
 }
 
-static int ppc440speA_pciex_init_utl(struct ppc4xx_pciex_port *port)
+static int ppc440speA_pciex_init_port_hw(struct ppc4xx_pciex_port *port)
+{
+   return ppc440spe_pciex_init_port_hw(port);
+}
+
+static int ppc440speB_pciex_init_port_hw(struct ppc4xx_pciex_port *port)
 {
-   void __iomem *utl_base;
+   int rc = ppc440spe_pciex_init_port_hw(port);
+
+   port->has_ibpre = 1;
+
+   return rc;
+}
 
+static int ppc440speA_pciex_init_utl(struct ppc4xx_pciex_port *port)
+{
/* XXX Check what that value means... I hate magic */
dcr_write(port->dcrs, DCRO_PEGPL_SPECIAL, 0x68782800);
 
-   utl_base = ioremap(port->utl_regs.start, 0x100);
-   BUG_ON(utl_base == NULL);
-
/*
 * Set buffer allocations and then assert VRB and TXE.
 */
-   out_be32(utl_base + PEUTL_OUTTR,   0x0800);
-   out_be32(utl_base + PEUTL_INTR,0x0200);
-   out_be32(utl_base + PEUTL_OPDBSZ,  0x1000);
-   out_be32(utl_base + PEUTL_PBBSZ,   0x5300);
-   out_be32(utl_base + PEUTL_IPHBSZ,  0x0800);
-   out_be32(utl_base + PEUTL_IPDBSZ,  0x1000);
-   out_be32(utl_base + PEUTL_RCIRQEN, 0x00f0);
-   out_be32(utl_base + PEUTL_PCTL,0x80800066);
+   out_be32(port->utl_base + PEUTL_OUTTR,   0x0800);
+   out_be32(port->utl_base + PEUTL_INTR,0x0200);
+   out_be32(port->utl_base + PEUTL_OPDBSZ,  0x1000);
+   out_be32(port->utl_base + PEUTL_PBBSZ,   0x5300);
+   out_be32(port->utl_base + PEUTL_IPHBSZ,  0x0800);
+   out_be32(port->utl_base + PEUTL_IPDBSZ,  0x1000);
+   out_be32(port->utl_base + PEUTL_RCIRQEN, 0x00f0);
+   out_be32(port->utl_base + PEUTL_PCTL,0x80800066);
 
-   iounmap(utl_base);
+   return 0;
+}
+
+static int ppc440speB_pciex_init_utl(struct ppc4xx_pciex_port *port)
+{
+   /* Report CRS to the operating system */
+   out_be32(port->utl_base + PEUTL_PBCTL,0x0800);
 
return 0;
 }
@@ -736,14 +756,15 @@ static int ppc440speA_pciex_init_utl(str
 static struct ppc4xx_pciex_hwops ppc440speA_pcie_hwops __initdata =
 {
.core_init  = ppc440spe_pciex_core_init,
-   .port_init_hw   = ppc440spe_pciex_init_port_hw,
+   .port_init_hw   = ppc440speA_pciex_init_port_hw,
.setup_utl  = ppc440speA_pciex_init_utl,
 };
 
 static struct ppc4xx_pciex_hwops ppc440speB_pcie_hwops __initdata =
 {
.core_init  = ppc440spe_pciex_core_init,
-   .port_init_hw   = ppc440spe_pciex_init_port_hw,
+   .port_init_hw   = ppc440speB_pciex_init_port_hw,
+   .setup_utl  = ppc440speB_pciex_init_utl,
 };
 
 
@@ -821,30 +842,21 @@ static int ppc405ex_pciex_init_port_hw(s
 
 static int ppc405ex_pciex_init_utl(struct ppc4xx_pciex_port *port)
 {
-   void __iomem *utl_base;
-
dcr_write(port->dcrs, DCRO_PEGPL_SPECIAL, 0x0);
 
-   utl_base = ioremap(port->utl_regs.start, 0x100);
-   BUG_ON(utl_base == NULL);
-
/*
 * Set buffer allocations and then assert VRB and TXE.
 */
-   out_be32(utl_base + PEUTL_OUTTR,   0x0200);
-   out_be32(utl_base + PEUTL_INTR,0x0200);
-   out_be32(utl_base + PEUTL_OPDBSZ,  0x0400);
-   out_be32(utl_base + PEUTL_PBBSZ,   0x2100);
-   out_be32(utl_base + PEUTL_IPHBSZ,  0x0200);
-   out_be32(utl_base + PEUTL_IPDBSZ,  0x0400);
-   out_be32(utl_base + PEUTL_RCIRQEN, 0x00f0);
-   out_be32(utl_base + PEUTL_PCTL,0x80800066);
-
-   out_be32(utl_

[PATCH 18/21] [POWERPC] bamboo: remove bogus "ranges" property in EBC node

2007-12-20 Thread Benjamin Herrenschmidt
This removes a bogus empty "ranges" property in the EBC device node
of the Bamboo board device-tree.

The "ranges" property will be created by the boot wrapper, there is
no need to have an empty property there, and that causes recent
dtc to complain.

Signed-off-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
---

 arch/powerpc/boot/dts/bamboo.dts |1 -
 1 file changed, 1 deletion(-)

--- linux-merge.orig/arch/powerpc/boot/dts/bamboo.dts   2007-12-21 
14:35:23.0 +1100
+++ linux-merge/arch/powerpc/boot/dts/bamboo.dts2007-12-21 
14:35:25.0 +1100
@@ -126,7 +126,6 @@
#address-cells = <2>;
#size-cells = <1>;
clock-frequency = <0>; /* Filled in by zImage */
-   ranges;
interrupts = <5 1>;
interrupt-parent = <&UIC1>;
};
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 17/21] [POWERPC] Base support for 440SPe "Katmai" eval board

2007-12-20 Thread Benjamin Herrenschmidt
This adds base support for the Katmai board, including PCI-X and
PCI-Express (but no RTC, nvram, etc... yet).

Signed-off-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
Acked-by: Stefan Roese <[EMAIL PROTECTED]>
---

As for Taishan, the bootwrapper code can be simplified. In fact,
we probably don't need to probe clocks & memsize off the chip and
just trust what uboot tells us.

 arch/powerpc/boot/Makefile|5 
 arch/powerpc/boot/cuboot-katmai.c |   56 ++
 arch/powerpc/boot/dts/katmai.dts  |  392 
 arch/powerpc/configs/katmai_defconfig |  789 ++
 arch/powerpc/platforms/44x/Kconfig|   14 
 arch/powerpc/platforms/44x/Makefile   |3 
 arch/powerpc/platforms/44x/katmai.c   |   63 ++
 7 files changed, 1320 insertions(+), 2 deletions(-)

--- linux-merge.orig/arch/powerpc/platforms/44x/Kconfig 2007-12-21 
14:20:11.0 +1100
+++ linux-merge/arch/powerpc/platforms/44x/Kconfig  2007-12-21 
14:21:23.0 +1100
@@ -34,6 +34,16 @@ config TAISHAN
  This option enables support for the AMCC PPC440GX "Taishan"
  evaluation board.
 
+config KATMAI
+   bool "Katmai"
+   depends on 44x
+   default n
+   select 440SPe
+   select PCI
+   select PPC4xx_PCI_EXPRESS
+   help
+ This option enables support for the AMCC PPC440SPe evaluation board.
+
 #config LUAN
 #  bool "Luan"
 #  depends on 44x
@@ -78,6 +88,10 @@ config 440GX
 config 440SP
bool
 
+config 440SPe
+select IBM_NEW_EMAC_EMAC4
+   bool
+
 # 44x errata/workaround config symbols, selected by the CPU models above
 config IBM440EP_ERR42
bool
Index: linux-merge/arch/powerpc/platforms/44x/Makefile
===
--- linux-merge.orig/arch/powerpc/platforms/44x/Makefile2007-12-21 
14:20:04.0 +1100
+++ linux-merge/arch/powerpc/platforms/44x/Makefile 2007-12-21 
14:21:23.0 +1100
@@ -1,5 +1,6 @@
 obj-$(CONFIG_44x)  := misc_44x.o
 obj-$(CONFIG_EBONY)+= ebony.o
 obj-$(CONFIG_TAISHAN)  += taishan.o
-obj-$(CONFIG_BAMBOO) += bamboo.o
+obj-$(CONFIG_BAMBOO)   += bamboo.o
 obj-$(CONFIG_SEQUOIA)  += sequoia.o
+obj-$(CONFIG_KATMAI)   += katmai.o
Index: linux-merge/arch/powerpc/boot/dts/katmai.dts
===
--- /dev/null   1970-01-01 00:00:00.0 +
+++ linux-merge/arch/powerpc/boot/dts/katmai.dts2007-12-21 
14:34:45.0 +1100
@@ -0,0 +1,392 @@
+/*
+ * Device Tree Source for AMCC Katmai eval board
+ *
+ * Copyright (c) 2006, 2007 IBM Corp.
+ * Benjamin Herrenschmidt <[EMAIL PROTECTED]>
+ *
+ * Copyright (c) 2006, 2007 IBM Corp.
+ * Josh Boyer <[EMAIL PROTECTED]>
+ *
+ * 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.
+ */
+
+/ {
+   #address-cells = <2>;
+   #size-cells = <1>;
+   model = "amcc,katmai";
+   compatible = "amcc,katmai";
+   dcr-parent = <&/cpus/PowerPC,[EMAIL PROTECTED]>;
+
+   cpus {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   PowerPC,[EMAIL PROTECTED] {
+   device_type = "cpu";
+   reg = <0>;
+   clock-frequency = <0>; /* Filled in by zImage */
+   timebase-frequency = <0>; /* Filled in by zImage */
+   i-cache-line-size = <20>;
+   d-cache-line-size = <20>;
+   i-cache-size = <2>;
+   d-cache-size = <2>;
+   dcr-controller;
+   dcr-access-method = "native";
+   };
+   };
+
+   memory {
+   device_type = "memory";
+   reg = <0 0 0>; /* Filled in by zImage */
+   };
+
+   UIC0: interrupt-controller0 {
+   compatible = "ibm,uic-440spe","ibm,uic";
+   interrupt-controller;
+   cell-index = <0>;
+   dcr-reg = <0c0 009>;
+   #address-cells = <0>;
+   #size-cells = <0>;
+   #interrupt-cells = <2>;
+   };
+
+   UIC1: interrupt-controller1 {
+   compatible = "ibm,uic-440spe","ibm,uic";
+   interrupt-controller;
+   cell-index = <1>;
+   dcr-reg = <0d0 009>;
+   #address-cells = <0>;
+   #size-cells = <0>;
+   #interrupt-cells = <2>;
+   interrupts = <1e 4 1f 4>; /* cascade */
+   interrupt-parent = <&UIC0>;
+   };
+
+   UIC2: interrupt-controller2 {
+   compatible = "ibm,uic-440spe","ibm,uic";
+   interrupt-controller;
+   cell-index = <2>;
+   dcr-reg = <0e0 009>;
+   #address-cells = <0>;
+   #size-cell

[PATCH 16/21] [POWERPC] Rework 4xx clock probing in boot wrapper

2007-12-20 Thread Benjamin Herrenschmidt
This reworks the boot wrapper library function that probes
the chip clocks. Better separate the base function that is
used on 440GX,SPe,EP,... from the uart fixups as those need
different device-tree path on different processors.

Also, rework the function itself based on the arch/ppc code
from Eugene Surovegin which I find more readable, and which
handles one more bypass case. Also handle the subtle difference
between 440EP/EPx and 440SPe/GX, on the former, PerClk is derived
from the PLB clock while on the later, it's derived from the OPB. 

Signed-off-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
---

 arch/powerpc/boot/4xx.c|  272 +++--
 arch/powerpc/boot/4xx.h|   11 +
 arch/powerpc/boot/bamboo.c |2 
 arch/powerpc/boot/cuboot-sequoia.c |2 
 arch/powerpc/boot/cuboot-taishan.c |4 
 arch/powerpc/boot/dcr.h|   17 ++
 arch/powerpc/boot/ebony.c  |   60 
 7 files changed, 233 insertions(+), 135 deletions(-)

--- linux-merge.orig/arch/powerpc/boot/4xx.c2007-12-14 15:49:48.0 
+1100
+++ linux-merge/arch/powerpc/boot/4xx.c 2007-12-14 15:49:50.0 +1100
@@ -275,89 +275,225 @@ void ibm4xx_fixup_ebc_ranges(const char 
setprop(devp, "ranges", ranges, (p - ranges) * sizeof(u32));
 }
 
-#define SPRN_CCR1 0x378
-void ibm440ep_fixup_clocks(unsigned int sysclk, unsigned int ser_clk)
+/* Calculate 440GP clocks */
+void ibm440gp_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk)
 {
-   u32 cpu, plb, opb, ebc, tb, uart0, m, vco;
-   u32 reg;
-   u32 fwdva, fwdvb, fbdv, lfbdv, opbdv0, perdv0, spcid0, prbdv0, tmp;
-
-   mtdcr(DCRN_CPR0_ADDR, CPR0_PLLD0);
-   reg = mfdcr(DCRN_CPR0_DATA);
-   tmp = (reg & 0x000F) >> 16;
-   fwdva = tmp ? tmp : 16;
-   tmp = (reg & 0x0700) >> 8;
-   fwdvb = tmp ? tmp : 8;
-   tmp = (reg & 0x1F00) >> 24;
-   fbdv = tmp ? tmp : 32;
-   lfbdv = (reg & 0x007F);
-
-   mtdcr(DCRN_CPR0_ADDR, CPR0_OPBD0);
-   reg = mfdcr(DCRN_CPR0_DATA);
-   tmp = (reg & 0x0300) >> 24;
-   opbdv0 = tmp ? tmp : 4;
-
-   mtdcr(DCRN_CPR0_ADDR, CPR0_PERD0);
-   reg = mfdcr(DCRN_CPR0_DATA);
-   tmp = (reg & 0x0700) >> 24;
-   perdv0 = tmp ? tmp : 8;
-
-   mtdcr(DCRN_CPR0_ADDR, CPR0_PRIMBD0);
-   reg = mfdcr(DCRN_CPR0_DATA);
-   tmp = (reg & 0x0700) >> 24;
-   prbdv0 = tmp ? tmp : 8;
-
-   mtdcr(DCRN_CPR0_ADDR, CPR0_SCPID);
-   reg = mfdcr(DCRN_CPR0_DATA);
-   tmp = (reg & 0x0300) >> 24;
-   spcid0 = tmp ? tmp : 4;
-
-   /* Calculate M */
-   mtdcr(DCRN_CPR0_ADDR, CPR0_PLLC0);
-   reg = mfdcr(DCRN_CPR0_DATA);
-   tmp = (reg & 0x0300) >> 24;
-   if (tmp == 0) { /* PLL output */
-   tmp = (reg & 0x2000) >> 29;
-   if (!tmp) /* PLLOUTA */
-   m = fbdv * lfbdv * fwdva;
+   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 = sys_clk;
+   } else {
+   if (sys0 & CPC0_SYS0_EXTSL)
+   /* PerClk */
+   m = CPC0_SYS0_FWDVB(sys0) * opdv * epdv;
else
-   m = fbdv * lfbdv * fwdvb;
+   /* CPU clock */
+   m = CPC0_SYS0_FBDV(sys0) * CPC0_SYS0_FWDVA(sys0);
+   cpu = sys_clk * m / CPC0_SYS0_FWDVA(sys0);
+   plb = sys_clk * m / CPC0_SYS0_FWDVB(sys0);
}
-   else if (tmp == 1) /* CPU output */
-   m = fbdv * fwdva;
+
+   opb = plb / opdv;
+   ebc = opb / epdv;
+
+   /* FIXME: Check if this is for all 440GP, or just Ebony */
+   if ((mfpvr() & 0xffff) == 0x4440)
+   /* Rev. B 440GP, use external system clock */
+   tb = sys_clk;
else
-   m = perdv0 * opbdv0 * fwdvb;
+   /* Rev. C 440GP, errata force us to use internal clock */
+   tb = cpu;
 
-   vco = (m * sysclk) + (m >> 1);
-   cpu = vco / fwdva;
-   plb = vco / fwdvb / prbdv0;
-   opb = plb / opbdv0;
-   ebc = plb / perdv0;
+   if (cr0 & CPC0_CR0_U0EC)
+   /* External UART clock */
+   uart0 = ser_clk;
+   else
+   /* Internal UART clock */
+   uart0 = plb / CPC0_CR0_UDIV(cr0);
 
-   /* FIXME */
-   uart0 = ser_clk;
+   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",
+  (sys_clk + 50) / 100, sys_clk);
+

[PATCH 15/21] [POWERPC] Adds 44x CPR0 accessors to boot wrapper

2007-12-20 Thread Benjamin Herrenschmidt
This adds macros to the boot wrapper to access the CPR
registers from the boot wrappers.

Signed-off-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
---

 arch/powerpc/boot/dcr.h |   27 +++
 1 file changed, 27 insertions(+)

--- linux-merge.orig/arch/powerpc/boot/dcr.h2007-12-14 15:49:48.0 
+1100
+++ linux-merge/arch/powerpc/boot/dcr.h 2007-12-14 15:49:49.0 +1100
@@ -147,4 +147,31 @@ static const unsigned long sdram_bxcr[] 
 #define DCRN_405_CPC0_CR0 0xb1
 #define DCRN_405_CPC0_CR1 0xb2
 
+
+/* 440GX Clock control etc */
+
+
+#define DCRN_CPR0_CLKUPD   0x020
+#define DCRN_CPR0_PLLC 0x040
+#define DCRN_CPR0_PLLD 0x060
+#define DCRN_CPR0_PRIMAD   0x080
+#define DCRN_CPR0_PRIMBD   0x0a0
+#define DCRN_CPR0_OPBD 0x0c0
+#define DCRN_CPR0_PERD 0x0e0
+#define DCRN_CPR0_MALD 0x100
+
+/* CPRs read/write helper macros - based off include/asm-ppc/ibm44x.h */
+
+#define DCRN_CPR0_CFGADDR  0xc
+#define DCRN_CPR0_CFGDATA  0xd
+
+#define CPR0_READ(offset) ({\
+   mtdcr(DCRN_CPR0_CFGADDR, offset); \
+   mfdcr(DCRN_CPR0_CFGDATA); })
+#define CPR0_WRITE(offset, data) ({\
+   mtdcr(DCRN_CPR0_CFGADDR, offset); \
+   mtdcr(DCRN_CPR0_CFGDATA, data); })
+
+
+
 #endif /* _PPC_BOOT_DCR_H_ */
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 14/21] [POWERPC] Add mfspr/mtspr inline macros to 4xx bootwrapper

2007-12-20 Thread Benjamin Herrenschmidt
The 4xx bootwrapper occasionally needs to access SPR registers,
this adds mfspr/mtspr wrappers to it.

Signed-off-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
---

===
 arch/powerpc/boot/reg.h |8 
 1 file changed, 8 insertions(+)

--- linux-merge.orig/arch/powerpc/boot/reg.h2007-12-14 15:48:54.0 
+1100
+++ linux-merge/arch/powerpc/boot/reg.h 2007-12-14 15:49:49.0 +1100
@@ -16,6 +16,14 @@ static inline u32 mfpvr(void)
return pvr;
 }
 
+#define __stringify_1(x)   #x
+#define __stringify(x) __stringify_1(x)
+
+#define mfspr(rn)  ({unsigned long rval; \
+   asm volatile("mfspr %0," __stringify(rn) \
+   : "=r" (rval)); rval; })
+#define mtspr(rn, v)   asm volatile("mtspr " __stringify(rn) ",%0" : : "r" (v))
+
 register void *__stack_pointer asm("r1");
 #define get_sp()   (__stack_pointer)
 
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 13/21] [POWERPC] Adds decoding of 440SPE memory size to boot wrapper library

2007-12-20 Thread Benjamin Herrenschmidt
This adds a function to the bootwrapper 4xx library to decode memory
size on 440SPE processors.

Signed-off-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
---

 arch/powerpc/boot/4xx.c |   85 +---
 arch/powerpc/boot/4xx.h |3 -
 arch/powerpc/boot/bamboo.c  |2 
 arch/powerpc/boot/cuboot-taishan.c  |2 
 arch/powerpc/boot/dcr.h |   10 +++-
 arch/powerpc/boot/ebony.c   |2 
 arch/powerpc/boot/treeboot-walnut.c |2 
 7 files changed, 85 insertions(+), 21 deletions(-)

--- linux-merge.orig/arch/powerpc/boot/4xx.c2007-12-21 14:19:46.0 
+1100
+++ linux-merge/arch/powerpc/boot/4xx.c 2007-12-21 14:21:16.0 +1100
@@ -22,16 +22,14 @@
 #include "dcr.h"
 
 /* Read the 4xx SDRAM controller to get size of system memory. */
-void ibm4xx_fixup_memsize(void)
+void ibm4xx_sdram_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);
-
+   bank_config = SDRAM0_READ(sdram_bxcr[i]);
if (bank_config & SDRAM_CONFIG_BANK_ENABLE)
memsize += SDRAM_CONFIG_BANK_SIZE(bank_config);
}
@@ -39,6 +37,69 @@ void ibm4xx_fixup_memsize(void)
dt_fixup_memory(0, memsize);
 }
 
+/* Read the 440SPe MQ controller to get size of system memory. */
+#define DCRN_MQ0_B0BAS 0x40
+#define DCRN_MQ0_B1BAS 0x41
+#define DCRN_MQ0_B2BAS 0x42
+#define DCRN_MQ0_B3BAS 0x43
+
+static u64 ibm440spe_decode_bas(u32 bas)
+{
+   u64 base = ((u64)(bas & 0xFFE0u)) << 2;
+
+   /* open coded because I'm paranoid about invalid values */
+   switch ((bas >> 4) & 0xFFF) {
+   case 0:
+   return 0;
+   case 0xffc:
+   return base + 0x00080ull;
+   case 0xff8:
+   return base + 0x00100ull;
+   case 0xff0:
+   return base + 0x00200ull;
+   case 0xfe0:
+   return base + 0x00400ull;
+   case 0xfc0:
+   return base + 0x00800ull;
+   case 0xf80:
+   return base + 0x01000ull;
+   case 0xf00:
+   return base + 0x02000ull;
+   case 0xe00:
+   return base + 0x04000ull;
+   case 0xc00:
+   return base + 0x08000ull;
+   case 0x800:
+   return base + 0x1ull;
+   }
+   printf("Memory BAS value 0x%08x unsupported !\n", bas);
+   return 0;
+}
+
+void ibm440spe_fixup_memsize(void)
+{
+   u64 banktop, memsize = 0;
+
+   /* Ultimately, we should directly construct the memory node
+* so we are able to handle holes in the memory address space
+*/
+   banktop = ibm440spe_decode_bas(mfdcr(DCRN_MQ0_B0BAS));
+   if (banktop > memsize)
+   memsize = banktop;
+   banktop = ibm440spe_decode_bas(mfdcr(DCRN_MQ0_B1BAS));
+   if (banktop > memsize)
+   memsize = banktop;
+   banktop = ibm440spe_decode_bas(mfdcr(DCRN_MQ0_B2BAS));
+   if (banktop > memsize)
+   memsize = banktop;
+   banktop = ibm440spe_decode_bas(mfdcr(DCRN_MQ0_B3BAS));
+   if (banktop > memsize)
+   memsize = banktop;
+
+   dt_fixup_memory(0, memsize);
+}
+
+
 /* 4xx DDR1/2 Denali memory controller support */
 /* DDR0 registers */
 #define DDR0_022
@@ -77,19 +138,13 @@ void ibm4xx_fixup_memsize(void)
 
 #define DDR_GET_VAL(val, mask, shift)  (((val) >> (shift)) & (mask))
 
-static inline u32 mfdcr_sdram0(u32 reg)
-{
-mtdcr(DCRN_SDRAM0_CFGADDR, reg);
-return mfdcr(DCRN_SDRAM0_CFGDATA);
-}
-
 void ibm4xx_denali_fixup_memsize(void)
 {
u32 val, max_cs, max_col, max_row;
u32 cs, col, row, bank, dpath;
unsigned long memsize;
 
-   val = mfdcr_sdram0(DDR0_02);
+   val = SDRAM0_READ(DDR0_02);
if (!DDR_GET_VAL(val, DDR_START, DDR_START_SHIFT))
fatal("DDR controller is not initialized\n");
 
@@ -99,7 +154,7 @@ void ibm4xx_denali_fixup_memsize(void)
max_row = DDR_GET_VAL(val, DDR_MAX_ROW_REG, DDR_MAX_ROW_REG_SHIFT);
 
/* get CS value */
-   val = mfdcr_sdram0(DDR0_10);
+   val = SDRAM0_READ(DDR0_10);
 
val = DDR_GET_VAL(val, DDR_CS_MAP, DDR_CS_MAP_SHIFT);
cs = 0;
@@ -115,7 +170,7 @@ void ibm4xx_denali_fixup_memsize(void)
fatal("DDR wrong CS configuration\n");
 
/* get data path bytes */
-   val = mfdcr_sdram0(DDR0_14);
+   val = SDRAM0_READ(DDR0_14);
 
if (DDR_GET_VAL(val, DDR_REDUC, DDR_REDUC_SHIFT))
dpath = 8; /* 64 bits */
@@ -123,7 +178,7 @@ void ibm4xx_denali_fixup_memsize(void)
dpath = 4; /* 32 bits */
 
/* get address pins (rows) */
-   val = mfdcr_

[PATCH 12/21] [POWERPC] Wire up 440EP USB controlle support to Bamboo board

2007-12-20 Thread Benjamin Herrenschmidt
This adds the definition of the on-chip OHCI controller to the
Bamboo board's device-tree. This is enough to get it probed and
working, though a separate patch fixing a bug in the OHCI driver
is needed to make it reliable.

Signed-off-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
---

 arch/powerpc/boot/dts/bamboo.dts |7 +++
 1 file changed, 7 insertions(+)

--- linux-merge.orig/arch/powerpc/boot/dts/bamboo.dts   2007-12-14 
15:49:47.0 +1100
+++ linux-merge/arch/powerpc/boot/dts/bamboo.dts2007-12-14 
15:49:48.0 +1100
@@ -238,6 +238,13 @@
zmii-device = <&ZMII0>;
zmii-channel = <1>;
};
+
+   [EMAIL PROTECTED] {
+   compatible = "ohci-be";
+   reg = ;
+   interrupts = <8 1 9 1>;
+   interrupt-parent = < &UIC1 >;
+   };
};
 
PCI0: [EMAIL PROTECTED] {
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 11/21] [POWERPC] Wire up PCI on Bamboo board

2007-12-20 Thread Benjamin Herrenschmidt
This adds the device-tree bits & call to ppc4xx_pci_find_bridges()
to make PCI work on the Bamboo board

Signed-off-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
---

 arch/powerpc/boot/dts/bamboo.dts   |   40 -
 arch/powerpc/platforms/44x/Kconfig |1 
 2 files changed, 40 insertions(+), 1 deletion(-)

--- linux-merge.orig/arch/powerpc/boot/dts/bamboo.dts   2007-12-21 
14:10:33.0 +1100
+++ linux-merge/arch/powerpc/boot/dts/bamboo.dts2007-12-21 
14:13:20.0 +1100
@@ -239,10 +239,48 @@
zmii-channel = <1>;
};
};
+
+   PCI0: [EMAIL PROTECTED] {
+   device_type = "pci";
+   #interrupt-cells = <1>;
+   #size-cells = <2>;
+   #address-cells = <3>;
+   compatible = "ibm,plb440ep-pci", "ibm,plb-pci";
+   primary;
+   reg = <0 eec0 8 /* Config space access */
+  0 eed0 4 /* IACK */
+  0 eed0 4 /* Special cycle */
+  0 ef40 40>;  /* Internal registers */
+
+   /* Outbound ranges, one memory and one IO,
+* later cannot be changed. Chip supports a second
+* IO range but we don't use it for now
+*/
+   ranges = <0200 0 a000 0 a000 0 2000
+ 0100 0  0 e800 0 0001>;
+
+   /* Inbound 2GB range starting at 0 */
+   dma-ranges = <4200 0 0 0 0 0 8000>;
+
+   /* Bamboo has all 4 IRQ pins tied together per slot */
+   interrupt-map-mask = ;
+   interrupt-map = <
+   /* IDSEL 1 */
+   0800 0 0 0 &UIC0 1c 8
+
+   /* IDSEL 2 */
+   1000 0 0 0 &UIC0 1b 8
+
+   /* IDSEL 3 */
+   1800 0 0 0 &UIC0 1a 8
+
+   /* IDSEL 4 */
+   2000 0 0 0 &UIC0 19 8
+   >;
+   };
};
 
chosen {
linux,stdout-path = "/plb/opb/[EMAIL PROTECTED]";
-   bootargs = "console=ttyS0,115200";
};
 };
Index: linux-merge/arch/powerpc/platforms/44x/Kconfig
===
--- linux-merge.orig/arch/powerpc/platforms/44x/Kconfig 2007-12-21 
14:13:33.0 +1100
+++ linux-merge/arch/powerpc/platforms/44x/Kconfig  2007-12-21 
14:13:38.0 +1100
@@ -3,6 +3,7 @@ config BAMBOO
depends on 44x
default n
select 440EP
+   select PCI
help
  This option enables support for the IBM PPC440EP evaluation board.
 
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 10/21] [POWERPC] Base support for 440GX Taishan eval board

2007-12-20 Thread Benjamin Herrenschmidt
From: Hugh Blemings <[EMAIL PROTECTED]>

This patch adds base support for the AMCC Taishan 440GX evaluation
board.

Signed-off-by: Hugh Blemings <[EMAIL PROTECTED]>
Signed-off-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
---

 arch/powerpc/Kconfig.debug |6 
 arch/powerpc/boot/Makefile |5 
 arch/powerpc/boot/cuboot-taishan.c |   56 ++
 arch/powerpc/boot/dts/taishan.dts  |  375 +++
 arch/powerpc/configs/taishan_defconfig |  787 +
 arch/powerpc/platforms/44x/Kconfig |   14 
 arch/powerpc/platforms/44x/Makefile|1 
 arch/powerpc/platforms/44x/taishan.c   |   74 +++
 8 files changed, 1316 insertions(+), 2 deletions(-)

--- linux-merge.orig/arch/powerpc/boot/Makefile 2007-12-21 14:20:00.0 
+1100
+++ linux-merge/arch/powerpc/boot/Makefile  2007-12-21 14:20:04.0 
+1100
@@ -37,8 +37,10 @@ BOOTCFLAGS   += -I$(obj) -I$(srctree)/$(ob
 
 $(obj)/4xx.o: BOOTCFLAGS += -mcpu=440
 $(obj)/ebony.o: BOOTCFLAGS += -mcpu=440
+$(obj)/cuboot-taishan.o: BOOTCFLAGS += -mcpu=440
 $(obj)/treeboot-walnut.o: BOOTCFLAGS += -mcpu=405
 
+
 zlib   := inffast.c inflate.c inftrees.c
 zlibheader := inffast.h inffixed.h inflate.h inftrees.h infutil.h
 zliblinuxheader := zlib.h zconf.h zutil.h
@@ -58,7 +60,7 @@ src-plat := of.c cuboot-52xx.c cuboot-83
cuboot-ebony.c treeboot-ebony.c prpmc2800.c \
ps3-head.S ps3-hvcall.S ps3.c treeboot-bamboo.c cuboot-8xx.c \
cuboot-pq2.c cuboot-sequoia.c treeboot-walnut.c cuboot-bamboo.c 
\
-   fixed-head.S ep88xc.c cuboot-hpc2.c ep405.c
+   fixed-head.S ep88xc.c cuboot-hpc2.c ep405.c cuboot-taishan.c
 src-boot := $(src-wlib) $(src-plat) empty.c
 
 src-boot := $(addprefix $(obj)/, $(src-boot))
@@ -199,6 +201,7 @@ image-$(CONFIG_EBONY)   += treeImage.ebo
 image-$(CONFIG_BAMBOO) += treeImage.bamboo cuImage.bamboo
 image-$(CONFIG_SEQUOIA)+= cuImage.sequoia
 image-$(CONFIG_WALNUT) += treeImage.walnut
+image-$(CONFIG_TAISHAN)+= cuImage.taishan
 endif
 
 # For 32-bit powermacs, build the COFF and miboot images
Index: linux-merge/arch/powerpc/Kconfig.debug
===
--- linux-merge.orig/arch/powerpc/Kconfig.debug 2007-12-21 14:20:00.0 
+1100
+++ linux-merge/arch/powerpc/Kconfig.debug  2007-12-21 14:20:04.0 
+1100
@@ -225,7 +225,8 @@ config PPC_EARLY_DEBUG_44x
depends on 44x
help
  Select this to enable early debugging for IBM 44x chips via the
- inbuilt serial port.
+ inbuilt serial port.  If you enable this, ensure you set
+  PPC_EARLY_DEBUG_44x_PHYSLOW below to suit your target board.
 
 config PPC_EARLY_DEBUG_40x
bool "Early serial debugging for IBM/AMCC 40x CPUs"
@@ -250,6 +251,9 @@ config PPC_EARLY_DEBUG_44x_PHYSLOW
hex "Low 32 bits of early debug UART physical address"
depends on PPC_EARLY_DEBUG_44x
default "0x4200"
+   help
+ You probably want 0x4200 for ebony boards and
+  0x4300 for taishan
 
 config PPC_EARLY_DEBUG_44x_PHYSHIGH
hex "EPRN of early debug UART physical address"
Index: linux-merge/arch/powerpc/platforms/44x/Kconfig
===
--- linux-merge.orig/arch/powerpc/platforms/44x/Kconfig 2007-12-21 
14:20:00.0 +1100
+++ linux-merge/arch/powerpc/platforms/44x/Kconfig  2007-12-21 
14:20:04.0 +1100
@@ -23,6 +23,16 @@ config SEQUOIA
help
  This option enables support for the AMCC PPC440EPX evaluation board.
 
+config TAISHAN
+   bool "Taishan"
+   depends on 44x
+   default n
+   select 440GX
+   select PCI
+   help
+ This option enables support for the AMCC PPC440GX "Taishan"
+ evaluation board.
+
 #config LUAN
 #  bool "Luan"
 #  depends on 44x
@@ -59,6 +69,10 @@ config 440GP
 
 config 440GX
bool
+select IBM_NEW_EMAC_EMAC4
+   select IBM_NEW_EMAC_RGMII
+select IBM_NEW_EMAC_ZMII #test only
+select IBM_NEW_EMAC_TAH  #test only
 
 config 440SP
bool
Index: linux-merge/arch/powerpc/platforms/44x/Makefile
===
--- linux-merge.orig/arch/powerpc/platforms/44x/Makefile2007-12-21 
14:20:00.0 +1100
+++ linux-merge/arch/powerpc/platforms/44x/Makefile 2007-12-21 
14:20:04.0 +1100
@@ -1,4 +1,5 @@
 obj-$(CONFIG_44x)  := misc_44x.o
 obj-$(CONFIG_EBONY)+= ebony.o
+obj-$(CONFIG_TAISHAN)  += taishan.o
 obj-$(CONFIG_BAMBOO) += bamboo.o
 obj-$(CONFIG_SEQUOIA)  += sequoia.o
Index: linux-merge/arch/powerpc/platforms/44x/taishan.c
===
--- /dev/null   1970-01-01 00:00:00.0 +
+++ linux-merge/arch

[PATCH 9/21] [POWERPC] Add PCI to Walnut platform

2007-12-20 Thread Benjamin Herrenschmidt
This wires up the 4xx PCI support & device-tree bits for the
405GP based Walnut platform.

Signed-off-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
---

This one is untested, haven't had time to dig my walnut and put it
back into working condition. Josh, can you verify that IRQs are
working (routing is correct ?) Thanks !

 arch/powerpc/boot/dts/walnut.dts   |   39 +
 arch/powerpc/platforms/40x/Kconfig |1 
 2 files changed, 40 insertions(+)

--- linux-merge.orig/arch/powerpc/boot/dts/walnut.dts   2007-12-21 
14:10:33.0 +1100
+++ linux-merge/arch/powerpc/boot/dts/walnut.dts2007-12-21 
14:12:36.0 +1100
@@ -190,6 +190,45 @@
virtual-reg = ;
};
};
+
+   PCI0: [EMAIL PROTECTED] {
+   device_type = "pci";
+   #interrupt-cells = <1>;
+   #size-cells = <2>;
+   #address-cells = <3>;
+   compatible = "ibm,plb405gp-pci", "ibm,plb-pci";
+   primary;
+   reg = ;/* Internal registers */
+
+   /* Outbound ranges, one memory and one IO,
+* later cannot be changed. Chip supports a second
+* IO range but we don't use it for now
+*/
+   ranges = <0200 0 8000 8000 0 2000
+ 0100 0  e800 0 0001>;
+
+   /* Inbound 2GB range starting at 0 */
+   dma-ranges = <4200 0 0 0 0 8000>;
+
+   /* Walnut has all 4 IRQ pins tied together per slot */
+   interrupt-map-mask = ;
+   interrupt-map = <
+   /* IDSEL 1 */
+   0800 0 0 0 &UIC0 1c 8
+
+   /* IDSEL 2 */
+   1000 0 0 0 &UIC0 1d 8
+
+   /* IDSEL 3 */
+   1800 0 0 0 &UIC0 1e 8
+
+   /* IDSEL 4 */
+   2000 0 0 0 &UIC0 1f 8
+   >;
+   };
};
 
chosen {
Index: linux-merge/arch/powerpc/platforms/40x/Kconfig
===
--- linux-merge.orig/arch/powerpc/platforms/40x/Kconfig 2007-12-21 
14:12:52.0 +1100
+++ linux-merge/arch/powerpc/platforms/40x/Kconfig  2007-12-21 
14:12:55.0 +1100
@@ -59,6 +59,7 @@ config WALNUT
depends on 40x
default y
select 405GP
+   select PCI
help
  This option enables support for the IBM PPC405GP evaluation board.
 
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 8/21] [POWERPC] EP405 boards support for arch/powerpc

2007-12-20 Thread Benjamin Herrenschmidt
Brings EP405 support to arch/powerpc. The IRQ routing for the CPLD
comes from a device-tree property, PCI is working to the point where
I can see the video card, USB device, and south bridge.

This should work with both EP405 and EP405PC.

I've not totally figured out how IRQs are wired on this hardware
though, thus at this stage, expect only USB interrupts working,
pretty much the same as what arch/ppc did.

Also, the flash, nvram, rtc and temp control still have to be wired.

Signed-off-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
---

Note about IRQ routing: The doc is very obscure in that area.

I _think_ the SB interrupt on the CPLD is actually the Windond's
8259 output and the NB interrupt is the PCI_A...PCI_D mux in
there (which can be implemented as a cascaded controller) but
I haven't sorted that out yet. If anybody from Embedded Planet
is around, I could use some advice there.

If my deductions are correct, then we would need to wire up the
8259 driver to SB, which should be trivial provided I stick the
windbond bridge in the device-tree, or at least part of it,
and probably implement a cascaded controller for the PCI IRQ
A...D mux thingy, which should also be trivial.

Note also that it tends to lockup during the transition from
the boot wrapper to the kernel, before udbg is started. I didn't
have a RiscWatch at hand so I haven't yet been able to track that
down. It's random though, quite weird. Maybe some stale TLB entries
or cache content that isn't cleared properly...

 arch/powerpc/boot/4xx.c  |   55 +-
 arch/powerpc/boot/4xx.h  |1 
 arch/powerpc/boot/Makefile   |3 
 arch/powerpc/boot/dts/ep405.dts  |  221 
 arch/powerpc/boot/ep405.c|   74 ++
 arch/powerpc/boot/treeboot-walnut.c  |   49 -
 arch/powerpc/boot/wrapper|2 
 arch/powerpc/configs/ep405_defconfig |  951 +++
 arch/powerpc/platforms/40x/Kconfig   |   22 
 arch/powerpc/platforms/40x/Makefile  |1 
 arch/powerpc/platforms/40x/ep405.c   |  124 
 11 files changed, 1437 insertions(+), 66 deletions(-)

--- linux-merge.orig/arch/powerpc/boot/Makefile 2007-12-21 14:19:24.0 
+1100
+++ linux-merge/arch/powerpc/boot/Makefile  2007-12-21 14:19:46.0 
+1100
@@ -58,7 +58,7 @@ src-plat := of.c cuboot-52xx.c cuboot-83
cuboot-ebony.c treeboot-ebony.c prpmc2800.c \
ps3-head.S ps3-hvcall.S ps3.c treeboot-bamboo.c cuboot-8xx.c \
cuboot-pq2.c cuboot-sequoia.c treeboot-walnut.c cuboot-bamboo.c 
\
-   fixed-head.S ep88xc.c cuboot-hpc2.c
+   fixed-head.S ep88xc.c cuboot-hpc2.c ep405.c
 src-boot := $(src-wlib) $(src-plat) empty.c
 
 src-boot := $(addprefix $(obj)/, $(src-boot))
@@ -189,6 +189,7 @@ image-$(CONFIG_DEFAULT_UIMAGE)  += uImag
 ifneq ($(CONFIG_DEVICE_TREE),"")
 image-$(CONFIG_PPC_8xx)+= cuImage.8xx
 image-$(CONFIG_PPC_EP88XC) += zImage.ep88xc
+image-$(CONFIG_EP405)  += zImage.ep405
 image-$(CONFIG_8260)   += cuImage.pq2
 image-$(CONFIG_PPC_MPC52xx)+= cuImage.52xx
 image-$(CONFIG_PPC_83xx)   += cuImage.83xx
Index: linux-merge/arch/powerpc/boot/ep405.c
===
--- /dev/null   1970-01-01 00:00:00.0 +
+++ linux-merge/arch/powerpc/boot/ep405.c   2007-12-21 14:19:46.0 
+1100
@@ -0,0 +1,74 @@
+/*
+ * Embedded Planet EP405 with PlanetCore firmware
+ *
+ * (c) Benjamin Herrenschmidt <[EMAIL PROTECTED]>, IBM Corp,\
+ *
+ * Based on ep88xc.c by
+ *
+ * Scott Wood <[EMAIL PROTECTED]>
+ *
+ * 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 "planetcore.h"
+#include "dcr.h"
+#include "4xx.h"
+#include "io.h"
+
+static char *table;
+static u64 mem_size;
+
+static void platform_fixups(void)
+{
+   u64 val;
+   void *nvrtc;
+
+   dt_fixup_memory(0, mem_size);
+   planetcore_set_mac_addrs(table);
+
+   if (!planetcore_get_decimal(table, PLANETCORE_KEY_CRYSTAL_HZ, &val)) {
+   printf("No PlanetCore crystal frequency key.\r\n");
+   return;
+   }
+   ibm405gp_fixup_clocks(val, 0xa8c000);
+   ibm4xx_quiesce_eth((u32 *)0xef600800, NULL);
+   ibm4xx_fixup_ebc_ranges("/plb/ebc");
+
+   if (!planetcore_get_decimal(table, PLANETCORE_KEY_KB_NVRAM, &val)) {
+   printf("No PlanetCore NVRAM size key.\r\n");
+   return;
+   }
+   nvrtc = finddevice("/plb/ebc/[EMAIL PROTECTED],20");
+   if (nvrtc != NULL) {
+   u32 reg[3] = { 4, 0x20, 0};
+   getprop(nvrtc, "reg", reg, 3);
+   reg[2] = (val << 10) & 0x

[PATCH 7/21] [POWERPC] Add early udbg support for 40x processors

2007-12-20 Thread Benjamin Herrenschmidt
This adds some basic real mode based early udbg support for 40x
in order to debug things more easily

Signed-off-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
---

 arch/powerpc/Kconfig.debug |   13 +++
 arch/powerpc/kernel/misc_32.S  |   39 +
 arch/powerpc/kernel/udbg.c |3 ++
 arch/powerpc/kernel/udbg_16550.c   |   33 +++
 arch/powerpc/platforms/Kconfig.cputype |1 
 include/asm-powerpc/udbg.h |1 
 6 files changed, 90 insertions(+)

--- linux-merge.orig/arch/powerpc/Kconfig.debug 2007-12-14 15:48:56.0 
+1100
+++ linux-merge/arch/powerpc/Kconfig.debug  2007-12-14 15:49:44.0 
+1100
@@ -227,6 +227,14 @@ config PPC_EARLY_DEBUG_44x
  Select this to enable early debugging for IBM 44x chips via the
  inbuilt serial port.
 
+config PPC_EARLY_DEBUG_40x
+   bool "Early serial debugging for IBM/AMCC 40x CPUs"
+   depends on 40x
+   help
+ Select this to enable early debugging for IBM 40x chips via the
+ inbuilt serial port. This works on chips with a 16550 compatible
+ UART. Xilinx chips with uartlite cannot use this option.
+
 config PPC_EARLY_DEBUG_CPM
bool "Early serial debugging for Freescale CPM-based serial ports"
depends on SERIAL_CPM
@@ -248,6 +256,11 @@ config PPC_EARLY_DEBUG_44x_PHYSHIGH
depends on PPC_EARLY_DEBUG_44x
default "0x1"
 
+config PPC_EARLY_DEBUG_40x_PHYSADDR
+   hex "Early debug UART physical address"
+   depends on PPC_EARLY_DEBUG_40x
+   default "0xef600300"
+
 config PPC_EARLY_DEBUG_CPM_ADDR
hex "CPM UART early debug transmit descriptor address"
depends on PPC_EARLY_DEBUG_CPM
Index: linux-merge/arch/powerpc/kernel/misc_32.S
===
--- linux-merge.orig/arch/powerpc/kernel/misc_32.S  2007-12-14 
15:48:56.0 +1100
+++ linux-merge/arch/powerpc/kernel/misc_32.S   2007-12-14 15:49:44.0 
+1100
@@ -206,6 +206,45 @@ _GLOBAL(_nmask_and_or_msr)
isync
blr /* Done */
 
+#ifdef CONFIG_40x
+
+/*
+ * Do an IO access in real mode
+ */
+_GLOBAL(real_readb)
+   mfmsr   r7
+   ori r0,r7,MSR_DR
+   xorir0,r0,MSR_DR
+   sync
+   mtmsr   r0
+   sync
+   isync
+   lbz r3,0(r3)
+   sync
+   mtmsr   r7
+   sync
+   isync
+   blr
+
+   /*
+ * Do an IO access in real mode
+ */
+_GLOBAL(real_writeb)
+   mfmsr   r7
+   ori r0,r7,MSR_DR
+   xorir0,r0,MSR_DR
+   sync
+   mtmsr   r0
+   sync
+   isync
+   stb r3,0(r4)
+   sync
+   mtmsr   r7
+   sync
+   isync
+   blr
+
+#endif /* CONFIG_40x */
 
 /*
  * Flush MMU TLB
Index: linux-merge/arch/powerpc/kernel/udbg.c
===
--- linux-merge.orig/arch/powerpc/kernel/udbg.c 2007-12-14 15:48:56.0 
+1100
+++ linux-merge/arch/powerpc/kernel/udbg.c  2007-12-14 15:49:44.0 
+1100
@@ -54,6 +54,9 @@ void __init udbg_early_init(void)
 #elif defined(CONFIG_PPC_EARLY_DEBUG_44x)
/* PPC44x debug */
udbg_init_44x_as1();
+#elif defined(CONFIG_PPC_EARLY_DEBUG_40x)
+   /* PPC40x debug */
+   udbg_init_40x_realmode();
 #elif defined(CONFIG_PPC_EARLY_DEBUG_CPM)
udbg_init_cpm();
 #endif
Index: linux-merge/arch/powerpc/kernel/udbg_16550.c
===
--- linux-merge.orig/arch/powerpc/kernel/udbg_16550.c   2007-12-14 
15:48:56.0 +1100
+++ linux-merge/arch/powerpc/kernel/udbg_16550.c2007-12-14 
15:49:44.0 +1100
@@ -225,3 +225,36 @@ void __init udbg_init_44x_as1(void)
udbg_getc = udbg_44x_as1_getc;
 }
 #endif /* CONFIG_PPC_EARLY_DEBUG_44x */
+
+#ifdef CONFIG_PPC_EARLY_DEBUG_40x
+static void udbg_40x_real_putc(char c)
+{
+   if (udbg_comport) {
+   while ((real_readb(&udbg_comport->lsr) & LSR_THRE) == 0)
+   /* wait for idle */;
+   real_writeb(c, &udbg_comport->thr); eieio();
+   if (c == '\n')
+   udbg_40x_real_putc('\r');
+   }
+}
+
+static int udbg_40x_real_getc(void)
+{
+   if (udbg_comport) {
+   while ((real_readb(&udbg_comport->lsr) & LSR_DR) == 0)
+   ; /* wait for char */
+   return real_readb(&udbg_comport->rbr);
+   }
+   return -1;
+}
+
+void __init udbg_init_40x_realmode(void)
+{
+   udbg_comport = (struct NS16550 __iomem *)
+   CONFIG_PPC_EARLY_DEBUG_40x_PHYSADDR;
+
+   udbg_putc = udbg_40x_real_putc;
+   udbg_getc = udbg_40x_real_getc;
+   udbg_getc_poll = NULL;
+}
+#endif /* CONFIG_PPC_EARLY_DEBUG_40x */
Index: linux-merge/include/asm-powerpc/udbg.h
===
--- linux-merge.

[PATCH 6/21] [POWERPC] PCI support for 4xx Ebony board

2007-12-20 Thread Benjamin Herrenschmidt
This wires up the 4xx PCI support & device tree bits for
440GP based Ebony platform.

Signed-off-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
---

 arch/powerpc/boot/dts/ebony.dts|   41 -
 arch/powerpc/platforms/44x/Kconfig |1 
 2 files changed, 37 insertions(+), 5 deletions(-)

--- linux-merge.orig/arch/powerpc/boot/dts/ebony.dts2007-12-21 
14:10:34.0 +1100
+++ linux-merge/arch/powerpc/boot/dts/ebony.dts 2007-12-21 14:11:51.0 
+1100
@@ -284,12 +284,43 @@
 
};
 
-   PCIX0: [EMAIL PROTECTED] {
+   PCIX0: [EMAIL PROTECTED] {
device_type = "pci";
-   /* FIXME */
-   reg = <2 0ec0 8
-  2 0ec8 f0
-  2 0ec80100 fc>;
+   #interrupt-cells = <1>;
+   #size-cells = <2>;
+   #address-cells = <3>;
+   compatible = "ibm,plb440gp-pcix", "ibm,plb-pcix";
+   primary;
+   reg = <2 0ec0 8 /* Config space access */
+  0 0 0/* no IACK cycles */
+  2 0ed0 4 /* Special cycles */
+  2 0ec8 f0/* Internal registers */
+  2 0ec80100 fc>;  /* Internal messaging registers 
*/
+
+   /* Outbound ranges, one memory and one IO,
+* later cannot be changed
+*/
+   ranges = <0200 0 8000 0003 8000 0 
8000
+ 0100 0  0002 0800 0 
0001>;
+
+   /* Inbound 2GB range starting at 0 */
+   dma-ranges = <4200 0 0 0 0 0 8000>;
+
+   /* Ebony has all 4 IRQ pins tied together per slot */
+   interrupt-map-mask = ;
+   interrupt-map = <
+   /* IDSEL 1 */
+   0800 0 0 0 &UIC0 17 8
+
+   /* IDSEL 2 */
+   1000 0 0 0 &UIC0 18 8
+
+   /* IDSEL 3 */
+   1800 0 0 0 &UIC0 19 8
+
+   /* IDSEL 4 */
+   2000 0 0 0 &UIC0 1a 8
+   >;
};
};
 
Index: linux-merge/arch/powerpc/platforms/44x/Kconfig
===
--- linux-merge.orig/arch/powerpc/platforms/44x/Kconfig 2007-12-21 
14:12:05.0 +1100
+++ linux-merge/arch/powerpc/platforms/44x/Kconfig  2007-12-21 
14:12:09.0 +1100
@@ -11,6 +11,7 @@ config EBONY
depends on 44x
default y
select 440GP
+   select PCI
help
  This option enables support for the IBM PPC440GP evaluation board.
 
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 5/21] [POWERPC] 4xx PLB to PCI Express support

2007-12-20 Thread Benjamin Herrenschmidt
This adds to the previous 2 patches the support for the 4xx PCI Express
cells as found in the 440SPe revA, revB and 405EX.

Unfortunately, due to significant differences between these, and other
interesting "features" of those pieces of HW, the code isn't as simple
as it is for PCI and PCI-X and some of the functions differ significantly
between the 3 implementations. Thus, not only this code can only support
those 3 implementations for now and will refuse to operate on any other,
but there are added ifdef's to avoid the bloat of building a fairly large
amount of code on platforms that don't need it.

Also, this code currently only supports fully initializing root complex
nodes, not endpoint. Some more code will have to be lifted from the
arch/ppc implementation to add the endpoint support, though it's mostly
differences in memory mapping, and the question on how to represent
endpoint mode PCI in the device-tree is thus open.

Many thanks to Stefan Roese for testing & fixing up the 405EX bits !

Signed-off-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
Signed-off-by: Stefan Roese <[EMAIL PROTECTED]>
---

 arch/powerpc/Kconfig |1 
 arch/powerpc/sysdev/Kconfig  |8 
 arch/powerpc/sysdev/ppc4xx_pci.c |  994 ++-
 arch/powerpc/sysdev/ppc4xx_pci.h |  242 +
 4 files changed, 1227 insertions(+), 18 deletions(-)

--- linux-merge.orig/arch/powerpc/sysdev/ppc4xx_pci.c   2007-12-14 
15:49:43.0 +1100
+++ linux-merge/arch/powerpc/sysdev/ppc4xx_pci.c2007-12-14 
15:49:43.0 +1100
@@ -3,16 +3,31 @@
  *
  * Copyright 2007 Ben. Herrenschmidt <[EMAIL PROTECTED]>, IBM Corp.
  *
+ * Most PCI Express code is coming from Stefan Roese implementation for
+ * arch/ppc in the Denx tree, slightly reworked by me.
+ *
+ * Copyright 2007 DENX Software Engineering, Stefan Roese <[EMAIL PROTECTED]>
+ *
+ * Some of that comes itself from a previous implementation for 440SPE only
+ * by Roland Dreier:
+ *
+ * Copyright (c) 2005 Cisco Systems.  All rights reserved.
+ * Roland Dreier <[EMAIL PROTECTED]>
+ *
  */
 
 #include 
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include "ppc4xx_pci.h"
 
@@ -21,6 +36,17 @@ static int dma_offset_set;
 /* Move that to a useable header */
 extern unsigned long total_memory;
 
+#define U64_TO_U32_LOW(val)((u32)((val) & 0xULL))
+#define U64_TO_U32_HIGH(val)   ((u32)((val) >> 32))
+
+#ifdef CONFIG_RESOURCES_64BIT
+#define RES_TO_U32_LOW(val)U64_TO_U32_LOW(val)
+#define RES_TO_U32_HIGH(val)   U64_TO_U32_HIGH(val)
+#else
+#define RES_TO_U32_LOW(val)(val)
+#define RES_TO_U32_HIGH(val)   (0)
+#endif
+
 static void fixup_ppc4xx_pci_bridge(struct pci_dev *dev)
 {
struct pci_controller *hose;
@@ -178,13 +204,8 @@ static void __init ppc4xx_configure_pci_
 
/* Calculate register values */
la = res->start;
-#ifdef CONFIG_RESOURCES_64BIT
-   pciha = (res->start - hose->pci_mem_offset) >> 32;
-   pcila = (res->start - hose->pci_mem_offset) & 0xu;
-#else
-   pciha = 0;
-   pcila = res->start - hose->pci_mem_offset;
-#endif
+   pciha = RES_TO_U32_HIGH(res->start - hose->pci_mem_offset);
+   pcila = RES_TO_U32_LOW(res->start - hose->pci_mem_offset);
 
ma = res->end + 1 - res->start;
if (!is_power_of_2(ma) || ma < 0x1000 || ma > 0xu) {
@@ -333,16 +354,10 @@ static void __init ppc4xx_configure_pcix
}
 
/* Calculate register values */
-#ifdef CONFIG_RESOURCES_64BIT
-   lah = res->start >> 32;
-   lal = res->start & 0xu;
-   pciah = (res->start - hose->pci_mem_offset) >> 32;
-   pcial = (res->start - hose->pci_mem_offset) & 0xu;
-#else
-   lah = pciah = 0;
-   lal = res->start;
-   pcial = res->start - hose->pci_mem_offset;
-#endif
+   lah = RES_TO_U32_HIGH(res->start);
+   lal = RES_TO_U32_LOW(res->start);
+   pciah = RES_TO_U32_HIGH(res->start - hose->pci_mem_offset);
+   pcial = RES_TO_U32_LOW(res->start - hose->pci_mem_offset);
sa = res->end + 1 - res->start;
if (!is_power_of_2(sa) || sa < 0x10 ||
sa > 0xu) {
@@ -492,20 +507,963 @@ static void __init ppc4xx_probe_pcix_bri
iounmap(reg);
 }
 
+#ifdef CONFIG_PPC4xx_PCI_EXPRESS
+
 /*
  * 4xx PCI-Express part
+ *
+ * We support 3 parts currently based on the compatible property:
+ *
+ * ibm,plb-pciex-440speA
+ * ibm,plb-pciex-440speB
+ * ibm,plb-pciex-405ex
+ *
+ * Anything else will be rejected for now as they are all subtly
+ * different unfortunately.
+ *
  */
+
+#define MAX_PCIE_BUS_MAPPED0x10
+
+struct ppc4xx_pciex_port
+{
+   struct pci_controller   *hose;
+   stru

[PATCH 4/21] [POWERPC] 4xx PLB to PCI 2.x support

2007-12-20 Thread Benjamin Herrenschmidt
This adds to the previous patch the support for the 4xx PCI 2.x
bridges.

Signed-off-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
---

This version implement the basic support for the 405GP bridge,
I haven't yet looked at differences that other implementations
may have for the PCI 2.x part.

 arch/powerpc/sysdev/ppc4xx_pci.c |  180 ++-
 arch/powerpc/sysdev/ppc4xx_pci.h |   19 
 2 files changed, 198 insertions(+), 1 deletion(-)

--- linux-merge.orig/arch/powerpc/sysdev/ppc4xx_pci.c   2007-12-14 
15:49:42.0 +1100
+++ linux-merge/arch/powerpc/sysdev/ppc4xx_pci.c2007-12-14 
15:49:43.0 +1100
@@ -21,6 +21,36 @@ static int dma_offset_set;
 /* Move that to a useable header */
 extern unsigned long total_memory;
 
+static void fixup_ppc4xx_pci_bridge(struct pci_dev *dev)
+{
+   struct pci_controller *hose;
+   int i;
+
+   if (dev->devfn != 0 || dev->bus->self != NULL)
+   return;
+
+   hose = pci_bus_to_host(dev->bus);
+   if (hose == NULL)
+   return;
+
+   if (!of_device_is_compatible(hose->dn, "ibm,plb-pciex") &&
+   !of_device_is_compatible(hose->dn, "ibm,plb-pcix") &&
+   !of_device_is_compatible(hose->dn, "ibm,plb-pci"))
+   return;
+
+   /* Hide the PCI host BARs from the kernel as their content doesn't
+* fit well in the resource management
+*/
+   for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
+   dev->resource[i].start = dev->resource[i].end = 0;
+   dev->resource[i].flags = 0;
+   }
+
+   printk(KERN_INFO "PCI: Hiding 4xx host bridge resources %s\n",
+  pci_name(dev));
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, fixup_ppc4xx_pci_bridge);
+
 static int __init ppc4xx_parse_dma_ranges(struct pci_controller *hose,
  void __iomem *reg,
  struct resource *res)
@@ -126,9 +156,157 @@ static int __init ppc4xx_parse_dma_range
 /*
  * 4xx PCI 2.x part
  */
+
+static void __init ppc4xx_configure_pci_PMMs(struct pci_controller *hose,
+void __iomem *reg)
+{
+   u32 la, ma, pcila, pciha;
+   int i, j;
+
+   /* Setup outbound memory windows */
+   for (i = j = 0; i < 3; i++) {
+   struct resource *res = &hose->mem_resources[i];
+
+   /* we only care about memory windows */
+   if (!(res->flags & IORESOURCE_MEM))
+   continue;
+   if (j > 2) {
+   printk(KERN_WARNING "%s: Too many ranges\n",
+  hose->dn->full_name);
+   break;
+   }
+
+   /* Calculate register values */
+   la = res->start;
+#ifdef CONFIG_RESOURCES_64BIT
+   pciha = (res->start - hose->pci_mem_offset) >> 32;
+   pcila = (res->start - hose->pci_mem_offset) & 0xu;
+#else
+   pciha = 0;
+   pcila = res->start - hose->pci_mem_offset;
+#endif
+
+   ma = res->end + 1 - res->start;
+   if (!is_power_of_2(ma) || ma < 0x1000 || ma > 0xu) {
+   printk(KERN_WARNING "%s: Resource out of range\n",
+  hose->dn->full_name);
+   continue;
+   }
+   ma = (0xu << ilog2(ma)) | 0x1;
+   if (res->flags & IORESOURCE_PREFETCH)
+   ma |= 0x2;
+
+   /* Program register values */
+   writel(la, reg + PCIL0_PMM0LA + (0x10 * j));
+   writel(pcila, reg + PCIL0_PMM0PCILA + (0x10 * j));
+   writel(pciha, reg + PCIL0_PMM0PCIHA + (0x10 * j));
+   writel(ma, reg + PCIL0_PMM0MA + (0x10 * j));
+   j++;
+   }
+}
+
+static void __init ppc4xx_configure_pci_PTMs(struct pci_controller *hose,
+void __iomem *reg,
+const struct resource *res)
+{
+   resource_size_t size = res->end - res->start + 1;
+   u32 sa;
+
+   /* Calculate window size */
+   sa = (0xu << ilog2(size)) | 1;
+   sa |= 0x1;
+
+   /* RAM is always at 0 local for now */
+   writel(0, reg + PCIL0_PTM1LA);
+   writel(sa, reg + PCIL0_PTM1MS);
+
+   /* Map on PCI side */
+   early_write_config_dword(hose, hose->first_busno, 0,
+PCI_BASE_ADDRESS_1, res->start);
+   early_write_config_dword(hose, hose->first_busno, 0,
+PCI_BASE_ADDRESS_2, 0x);
+   early_write_config_word(hose, hose->first_busno, 0,
+   PCI_COMMAND, 0x0006);
+}
+
 static void __init ppc4xx_probe_pci_bridge(struct device_node *np)
 {
/* NYI */
+   struct resource rsrc_cfg;
+   struct resource rsrc_reg;
+  

[PATCH 3/21] [POWERPC] 4xx PLB to PCI-X support

2007-12-20 Thread Benjamin Herrenschmidt
This adds base support code for the 4xx PCI-X bridge. It also provides
placeholders for the PCI and PCI-E version but they aren't supported
with this patch.

The bridges are configured based on device-tree properties.

Signed-off-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
---

Tested on 440GP only so far.

 arch/powerpc/sysdev/Makefile |3 
 arch/powerpc/sysdev/ppc4xx_pci.c |  339 +++
 arch/powerpc/sysdev/ppc4xx_pci.h |  106 
 3 files changed, 448 insertions(+)

--- linux-merge.orig/arch/powerpc/sysdev/Makefile   2007-12-14 
15:48:56.0 +1100
+++ linux-merge/arch/powerpc/sysdev/Makefile2007-12-14 15:49:42.0 
+1100
@@ -27,6 +27,9 @@ obj-$(CONFIG_PPC_I8259)   += i8259.o
 obj-$(CONFIG_PPC_83xx) += ipic.o
 obj-$(CONFIG_4xx)  += uic.o
 obj-$(CONFIG_XILINX_VIRTEX)+= xilinx_intc.o
+ifeq ($(CONFIG_PCI),y)
+obj-$(CONFIG_4xx)  += ppc4xx_pci.o
+endif
 endif
 
 # Temporary hack until we have migrated to asm-powerpc
Index: linux-merge/arch/powerpc/sysdev/ppc4xx_pci.c
===
--- /dev/null   1970-01-01 00:00:00.0 +
+++ linux-merge/arch/powerpc/sysdev/ppc4xx_pci.c2007-12-14 
15:49:42.0 +1100
@@ -0,0 +1,339 @@
+/*
+ * PCI / PCI-X / PCI-Express support for 4xx parts
+ *
+ * Copyright 2007 Ben. Herrenschmidt <[EMAIL PROTECTED]>, IBM Corp.
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include "ppc4xx_pci.h"
+
+static int dma_offset_set;
+
+/* Move that to a useable header */
+extern unsigned long total_memory;
+
+static int __init ppc4xx_parse_dma_ranges(struct pci_controller *hose,
+ void __iomem *reg,
+ struct resource *res)
+{
+   u64 size;
+   const u32 *ranges;
+   int rlen;
+   int pna = of_n_addr_cells(hose->dn);
+   int np = pna + 5;
+
+   /* Default */
+   res->start = 0;
+   res->end = size = 0x8000;
+   res->flags = IORESOURCE_MEM | IORESOURCE_PREFETCH;
+
+   /* Get dma-ranges property */
+   ranges = of_get_property(hose->dn, "dma-ranges", &rlen);
+   if (ranges == NULL)
+   goto out;
+
+   /* Walk it */
+   while ((rlen -= np * 4) >= 0) {
+   u32 pci_space = ranges[0];
+   u64 pci_addr = of_read_number(ranges + 1, 2);
+   u64 cpu_addr = of_translate_dma_address(hose->dn, ranges + 3);
+   size = of_read_number(ranges + pna + 3, 2);
+   ranges += np;
+   if (cpu_addr == OF_BAD_ADDR || size == 0)
+   continue;
+
+   /* We only care about memory */
+   if ((pci_space & 0x0300) != 0x0200)
+   continue;
+
+   /* We currently only support memory at 0, and pci_addr
+* within 32 bits space
+*/
+   if (cpu_addr != 0 || pci_addr > 0x) {
+   printk(KERN_WARNING "%s: Ignored unsupported dma range"
+  " 0x%016llx...0x%016llx -> 0x%016llx\n",
+  hose->dn->full_name,
+  pci_addr, pci_addr + size - 1, cpu_addr);
+   continue;
+   }
+
+   /* Check if not prefetchable */
+   if (!(pci_space & 0x4000))
+   res->flags &= ~IORESOURCE_PREFETCH;
+
+
+   /* Use that */
+   res->start = pci_addr;
+#ifndef CONFIG_RESOURCES_64BIT
+   /* Beware of 32 bits resources */
+   if ((pci_addr + size) > 0x1ull)
+   res->end = 0x;
+   else
+#endif
+   res->end = res->start + size - 1;
+   break;
+   }
+
+   /* We only support one global DMA offset */
+   if (dma_offset_set && pci_dram_offset != res->start) {
+   printk(KERN_ERR "%s: dma-ranges(s) mismatch\n",
+  hose->dn->full_name);
+   return -ENXIO;
+   }
+
+   /* Check that we can fit all of memory as we don't support
+* DMA bounce buffers
+*/
+   if (size < total_memory) {
+   printk(KERN_ERR "%s: dma-ranges too small "
+  "(size=%llx total_memory=%lx)\n",
+  hose->dn->full_name, size, total_memory);
+   return -ENXIO;
+   }
+
+   /* Check we are a power of 2 size and that base is a multiple of size*/
+   if (!is_power_of_2(size) ||
+   (res->start & (size - 1)) != 0) {
+   printk(KERN_ERR "%s: dma-ranges unaligned\n",
+  hose->dn->full_name);
+   return -ENXIO;
+   }
+
+   /* Check that we are fully contained within 32 bits space */
+   if (res->end > 0x

[PATCH 2/21] [POWERPC] Improve support for 4xx indirect DCRs

2007-12-20 Thread Benjamin Herrenschmidt
Accessing indirect DCRs is done via a pair of address/data DCRs.

Such accesses are thus inherently racy, vs. interrupts, preemption
and possibly SMP if 4xx SMP cores are ever used.

This updates the mfdcri/mtdcri macros in dcr-native.h (which were
so far unused) to use a spinlock.

In addition, add some common definitions to a new dcr-regs.h file.

Signed-off-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
---

 include/asm-powerpc/dcr-native.h |   30 ++--
 include/asm-powerpc/dcr-regs.h   |   71 +++
 2 files changed, 91 insertions(+), 10 deletions(-)

--- linux-merge.orig/include/asm-powerpc/dcr-native.h   2007-12-14 
15:48:56.0 +1100
+++ linux-merge/include/asm-powerpc/dcr-native.h2007-12-14 
15:49:41.0 +1100
@@ -22,6 +22,8 @@
 #ifdef __KERNEL__
 #ifndef __ASSEMBLY__
 
+#include 
+
 typedef struct {
unsigned int base;
 } dcr_host_t;
@@ -55,20 +57,28 @@ do {
\
 } while (0)
 
 /* R/W of indirect DCRs make use of standard naming conventions for DCRs */
-#define mfdcri(base, reg)  \
-({ \
-   mtdcr(base ## _CFGADDR, base ## _ ## reg);  \
-   mfdcr(base ## _CFGDATA);\
+extern spinlock_t dcr_ind_lock;
+
+#define mfdcri(base, reg)  \
+({ \
+   unsigned long flags;\
+   unsigned int val;   \
+   spin_lock_irqsave(&dcr_ind_lock, flags);\
+   mtdcr(DCRN_ ## base ## _CONFIG_ADDR, reg);  \
+   val = mfdcr(DCRN_ ## base ## _CONFIG_DATA); \
+   spin_unlock_irqrestore(&dcr_ind_lock, flags);   \
+   val;\
 })
 
-#define mtdcri(base, reg, data)\
-do {   \
-   mtdcr(base ## _CFGADDR, base ## _ ## reg);  \
-   mtdcr(base ## _CFGDATA, data);  \
+#define mtdcri(base, reg, data)\
+do {   \
+   unsigned long flags;\
+   spin_lock_irqsave(&dcr_ind_lock, flags);\
+   mtdcr(DCRN_ ## base ## _CONFIG_ADDR, reg);  \
+   mtdcr(DCRN_ ## base ## _CONFIG_DATA, data); \
+   spin_unlock_irqrestore(&dcr_ind_lock, flags);   \
 } while (0)
 
 #endif /* __ASSEMBLY__ */
 #endif /* __KERNEL__ */
 #endif /* _ASM_POWERPC_DCR_NATIVE_H */
-
-
Index: linux-merge/include/asm-powerpc/dcr-regs.h
===
--- /dev/null   1970-01-01 00:00:00.0 +
+++ linux-merge/include/asm-powerpc/dcr-regs.h  2007-12-14 15:49:41.0 
+1100
@@ -0,0 +1,71 @@
+/*
+ * Common DCR / SDR / CPR register definitions used on various IBM/AMCC
+ * 4xx processors
+ *
+ *Copyright 2007 Benjamin Herrenschmidt, IBM Corp
+ *   <[EMAIL PROTECTED]>
+ *
+ * Mostly lifted from asm-ppc/ibm4xx.h by
+ *
+ *Copyright (c) 1999 Grant Erickson <[EMAIL PROTECTED]>
+ *
+ */
+
+#ifndef __DCR_REGS_H__
+#define __DCR_REGS_H__
+
+/*
+ * Most DCRs used for controlling devices such as the MAL, DMA engine,
+ * etc... are obtained for the device tree.
+ *
+ * The definitions in this files are fixed DCRs and indirect DCRs that
+ * are commonly used outside of specific drivers or refer to core
+ * common registers that may occasionally have to be tweaked outside
+ * of the driver main register set
+ */
+
+/* CPRs (440GX and 440SP/440SPe) */
+#define DCRN_CPR0_CONFIG_ADDR  0xc
+#define DCRN_CPR0_CONFIG_DATA  0xd
+
+/* SDRs (440GX and 440SP/440SPe) */
+#define DCRN_SDR0_CONFIG_ADDR  0xe
+#define DCRN_SDR0_CONFIG_DATA  0xf
+
+#define SDR0_PFC0  0x4100
+#define SDR0_PFC1  0x4101
+#define SDR0_PFC1_EPS  0x1c0
+#define SDR0_PFC1_EPS_SHIFT22
+#define SDR0_PFC1_RMII 0x0200
+#define SDR0_MFR   0x4300
+#define SDR0_MFR_TAH0  0x8000  /* TAHOE0 Enable */
+#define SDR0_MFR_TAH1  0x4000  /* TAHOE1 Enable */
+#define SDR0_MFR_PCM   0x1000  /* PPC440GP irq compat mode */
+#define SDR0_MFR_ECS   0x0800  /* EMAC int clk */
+#define SDR0_MFR_T0TXFL0x0008
+#define SDR0_MFR_T0TXFH0x0004
+#define SDR0_MFR_T1TXFL0x0002
+#define SDR0_MFR_T1TXFH0x0001
+#define SDR0_MFR_E0TXFL0x8000
+#define SDR0_MFR_E0TXFH0x4000
+#define SDR0_MFR_E0RXFL0x2000
+#define SDR0_MFR_E0RXFH0x1000
+#define SDR0_MFR_E1TXFL0x0800
+#define SDR0_MFR_E1TXFH0x0400
+#define SDR0_MFR_E1RXFL0x0200
+#define SDR0_MFR_E1RXFH0x01

[PATCH 1/21] [POWERPC] Reworking machine check handling and Fix 440/440A

2007-12-20 Thread Benjamin Herrenschmidt
This adds a cputable function pointer for the CPU-side machine
check handling. The semantic is still the same as the old one,
the one in ppc_md. overrides the one in cputable, though
ultimately we'll want to change that so the CPU gets first.

This removes CONFIG_440A which was a problem for multiplatform
kernels and instead fixes up the IVOR at runtime from a setup_cpu
function. The "A" version of the machine check also tweaks the
regs->trap value to differenciate the 2 versions at the C level.

Signed-off-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
---

 arch/powerpc/kernel/cpu_setup_44x.S |9 +++
 arch/powerpc/kernel/cputable.c  |  105 
 arch/powerpc/kernel/head_44x.S  |   14 +++-
 arch/powerpc/kernel/head_booke.h|2 
 arch/powerpc/kernel/traps.c |   62 -
 arch/powerpc/platforms/44x/Kconfig  |5 -
 arch/ppc/kernel/traps.c |   98 ++---
 include/asm-powerpc/cputable.h  |   13 
 include/asm-powerpc/ptrace.h|3 -
 include/asm-powerpc/reg_booke.h |3 -
 include/asm-ppc/reg_booke.h |2 
 11 files changed, 258 insertions(+), 58 deletions(-)

--- linux-merge.orig/arch/powerpc/kernel/cpu_setup_44x.S2007-10-15 
11:19:35.0 +1000
+++ linux-merge/arch/powerpc/kernel/cpu_setup_44x.S 2007-12-20 
11:35:40.0 +1100
@@ -23,11 +23,20 @@ _GLOBAL(__setup_cpu_440epx)
mflrr4
bl  __init_fpu_44x
bl  __plb_disable_wrp
+   bl  __fixup_440A_mcheck
mtlrr4
blr
 _GLOBAL(__setup_cpu_440grx)
b   __plb_disable_wrp
+_GLOBAL(__setup_cpu_440gx)
+_GLOBAL(__setup_cpu_440spe)
+   b   __fixup_440A_mcheck
 
+ /* Temporary fixup for arch/ppc until we kill the whole thing */
+#ifndef CONFIG_PPC_MERGE
+_GLOBAL(__fixup_440A_mcheck)
+   blr
+#endif
 
 /* enable APU between CPU and FPU */
 _GLOBAL(__init_fpu_44x)
Index: linux-merge/arch/powerpc/kernel/cputable.c
===
--- linux-merge.orig/arch/powerpc/kernel/cputable.c 2007-12-20 
11:34:43.0 +1100
+++ linux-merge/arch/powerpc/kernel/cputable.c  2007-12-20 11:35:40.0 
+1100
@@ -33,7 +33,9 @@ EXPORT_SYMBOL(cur_cpu_spec);
 #ifdef CONFIG_PPC32
 extern void __setup_cpu_440ep(unsigned long offset, struct cpu_spec* spec);
 extern void __setup_cpu_440epx(unsigned long offset, struct cpu_spec* spec);
+extern void __setup_cpu_440gx(unsigned long offset, struct cpu_spec* spec);
 extern void __setup_cpu_440grx(unsigned long offset, struct cpu_spec* spec);
+extern void __setup_cpu_440spe(unsigned long offset, struct cpu_spec* spec);
 extern void __setup_cpu_603(unsigned long offset, struct cpu_spec* spec);
 extern void __setup_cpu_604(unsigned long offset, struct cpu_spec* spec);
 extern void __setup_cpu_750(unsigned long offset, struct cpu_spec* spec);
@@ -85,6 +87,7 @@ static struct cpu_spec __initdata cpu_sp
.pmc_type   = PPC_PMC_IBM,
.oprofile_cpu_type  = "ppc64/power3",
.oprofile_type  = PPC_OPROFILE_RS64,
+   .machine_check  = machine_check_generic,
.platform   = "power3",
},
{   /* Power3+ */
@@ -99,6 +102,7 @@ static struct cpu_spec __initdata cpu_sp
.pmc_type   = PPC_PMC_IBM,
.oprofile_cpu_type  = "ppc64/power3",
.oprofile_type  = PPC_OPROFILE_RS64,
+   .machine_check  = machine_check_generic,
.platform   = "power3",
},
{   /* Northstar */
@@ -113,6 +117,7 @@ static struct cpu_spec __initdata cpu_sp
.pmc_type   = PPC_PMC_IBM,
.oprofile_cpu_type  = "ppc64/rs64",
.oprofile_type  = PPC_OPROFILE_RS64,
+   .machine_check  = machine_check_generic,
.platform   = "rs64",
},
{   /* Pulsar */
@@ -127,6 +132,7 @@ static struct cpu_spec __initdata cpu_sp
.pmc_type   = PPC_PMC_IBM,
.oprofile_cpu_type  = "ppc64/rs64",
.oprofile_type  = PPC_OPROFILE_RS64,
+   .machine_check  = machine_check_generic,
.platform   = "rs64",
},
{   /* I-star */
@@ -141,6 +147,7 @@ static struct cpu_spec __initdata cpu_sp
.pmc_type   = PPC_PMC_IBM,
.oprofile_cpu_type  = "ppc64/rs64",
.oprofile_type  = PPC_OPROFILE_RS64,
+   .machine_check  = machine_check_generic,
.platform   = "rs64",
},
{   /* S-star */
@@ -155,6 +162,7 @@ static struct cpu_spec __initdata cpu_sp
.pmc_type 

[PATCH] [POWERPC] Make non-PCI build work again

2007-12-20 Thread Stephen Rothwell
Maple and pasemi both require PCI as does CONFIG_OF_PLATFORM_PCI.
The default setting of CONFIG_ISA_DMA_API is set to match the protection
around the relevant routines in asm/dma.h.

I also had to remove the PMAC platform from the combined build.  The
precis is that to build a 64 bit kernel with no PCI, you can only include
pSeries and iSeries.

Signed-off-by: Stephen Rothwell <[EMAIL PROTECTED]>
---
 arch/powerpc/Kconfig  |3 ++-
 arch/powerpc/platforms/maple/Kconfig  |1 +
 arch/powerpc/platforms/pasemi/Kconfig |1 +
 3 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 232c298..d40844f 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -160,6 +160,7 @@ config PPC_DCR
 
 config PPC_OF_PLATFORM_PCI
bool
+   depends on PCI
depends on PPC64 # not supported on 32 bits yet
default n
 
@@ -417,7 +418,7 @@ endmenu
 
 config ISA_DMA_API
bool
-   default y
+   default !PPC_ISERIES || PCI
 
 menu "Bus options"
 
diff --git a/arch/powerpc/platforms/maple/Kconfig 
b/arch/powerpc/platforms/maple/Kconfig
index f7c95eb..a6467a5 100644
--- a/arch/powerpc/platforms/maple/Kconfig
+++ b/arch/powerpc/platforms/maple/Kconfig
@@ -1,6 +1,7 @@
 config PPC_MAPLE
depends on PPC_MULTIPLATFORM && PPC64
bool "Maple 970FX Evaluation Board"
+   select PCI
select MPIC
select U3_DART
select MPIC_U3_HT_IRQS
diff --git a/arch/powerpc/platforms/pasemi/Kconfig 
b/arch/powerpc/platforms/pasemi/Kconfig
index 2f4dd6e..b3458a1 100644
--- a/arch/powerpc/platforms/pasemi/Kconfig
+++ b/arch/powerpc/platforms/pasemi/Kconfig
@@ -3,6 +3,7 @@ config PPC_PASEMI
bool "PA Semi SoC-based platforms"
default n
select MPIC
+   select PCI
select PPC_UDBG_16550
select PPC_NATIVE
select MPIC_BROKEN_REGREAD
-- 
1.5.3.7

-- 
Cheers,
Stephen Rothwell[EMAIL PROTECTED]
http://www.canb.auug.org.au/~sfr/
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] [POWERPC] pointers marked as __iomem do not need to be volatile

2007-12-20 Thread Stephen Rothwell
Fixes this warning:

arch/powerpc/platforms/powermac/pci.c: In function 'u3_ht_cfg_access':
arch/powerpc/platforms/powermac/pci.c:354: warning: return discards qualifiers 
from pointer target type
arch/powerpc/platforms/powermac/pci.c:358: warning: return discards qualifiers 
from pointer target type

Signed-off-by: Stephen Rothwell <[EMAIL PROTECTED]>
---
 include/asm-powerpc/pci-bridge.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/asm-powerpc/pci-bridge.h b/include/asm-powerpc/pci-bridge.h
index f7ed2b6..a6ea49e 100644
--- a/include/asm-powerpc/pci-bridge.h
+++ b/include/asm-powerpc/pci-bridge.h
@@ -75,8 +75,8 @@ struct pci_controller {
 #endif
 
struct pci_ops *ops;
-   volatile unsigned int __iomem *cfg_addr;
-   volatile void __iomem *cfg_data;
+   unsigned int __iomem *cfg_addr;
+   void __iomem *cfg_data;
 
 #ifndef CONFIG_PPC64
/*
-- 
1.5.3.7

-- 
Cheers,
Stephen Rothwell[EMAIL PROTECTED]
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] [POWERPC] constify the of_device_id passed to of_platform_bus_probe

2007-12-20 Thread Stephen Rothwell
This will allow us to declare const all the statically declared arrrays
of these.

Signed-off-by: Stephen Rothwell <[EMAIL PROTECTED]>
---
 arch/powerpc/kernel/of_platform.c |8 
 include/asm-powerpc/of_platform.h |2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/kernel/of_platform.c 
b/arch/powerpc/kernel/of_platform.c
index 79c04d1..de36e23 100644
--- a/arch/powerpc/kernel/of_platform.c
+++ b/arch/powerpc/kernel/of_platform.c
@@ -40,7 +40,7 @@
  * a bus type in the list
  */
 
-static struct of_device_id of_default_bus_ids[] = {
+static const struct of_device_id of_default_bus_ids[] = {
{ .type = "soc", },
{ .compatible = "soc", },
{ .type = "spider", },
@@ -100,8 +100,8 @@ EXPORT_SYMBOL(of_platform_device_create);
  * @matches: match table, NULL to use the default, OF_NO_DEEP_PROBE to
  * disallow recursive creation of child busses
  */
-static int of_platform_bus_create(struct device_node *bus,
- struct of_device_id *matches,
+static int of_platform_bus_create(const struct device_node *bus,
+ const struct of_device_id *matches,
  struct device *parent)
 {
struct device_node *child;
@@ -137,7 +137,7 @@ static int of_platform_bus_create(struct device_node *bus,
  */
 
 int of_platform_bus_probe(struct device_node *root,
- struct of_device_id *matches,
+ const struct of_device_id *matches,
  struct device *parent)
 {
struct device_node *child;
diff --git a/include/asm-powerpc/of_platform.h 
b/include/asm-powerpc/of_platform.h
index d20a4cd..1bce5ef 100644
--- a/include/asm-powerpc/of_platform.h
+++ b/include/asm-powerpc/of_platform.h
@@ -32,7 +32,7 @@ extern struct of_device *of_platform_device_create(struct 
device_node *np,
 #define OF_NO_DEEP_PROBE ((struct of_device_id *)-1)
 
 extern int of_platform_bus_probe(struct device_node *root,
-struct of_device_id *matches,
+const struct of_device_id *matches,
 struct device *parent);
 
 extern struct of_device *of_find_device_by_phandle(phandle ph);
-- 
1.5.3.7

-- 
Cheers,
Stephen Rothwell[EMAIL PROTECTED]
http://www.canb.auug.org.au/~sfr/
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] [POWERPC] The builtin matches for ibmebus.c can be __initdata

2007-12-20 Thread Stephen Rothwell

Signed-off-by: Stephen Rothwell <[EMAIL PROTECTED]>
---
 arch/powerpc/kernel/ibmebus.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/kernel/ibmebus.c b/arch/powerpc/kernel/ibmebus.c
index 72fd871..caae49f 100644
--- a/arch/powerpc/kernel/ibmebus.c
+++ b/arch/powerpc/kernel/ibmebus.c
@@ -52,7 +52,7 @@ static struct device ibmebus_bus_device = { /* fake "parent" 
device */
 struct bus_type ibmebus_bus_type;
 
 /* These devices will automatically be added to the bus during init */
-static struct of_device_id builtin_matches[] = {
+static struct of_device_id __initdata builtin_matches[] = {
{ .compatible = "IBM,lhca" },
{ .compatible = "IBM,lhea" },
{},
-- 
1.5.3.7

-- 
Cheers,
Stephen Rothwell[EMAIL PROTECTED]
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 0/4] arch/powerpc support for SBC8560 board

2007-12-20 Thread David Gibson
On Thu, Dec 20, 2007 at 10:38:15PM -0500, Paul Gortmaker wrote:
> In message: Re: [PATCH 0/4] arch/powerpc support for SBC8560 board
> on 20/12/2007 Kumar Gala wrote:
> 
> >> 3) Add device tree source for Wind River SBC8560 board
> >>
> >> This is probably the most interesting part of the group, given that the
> >> board doesn't use the CPM2 to provide the serial console.  I've made a
> >> duart dts entry that is kind of similar to what is done for the tsi108
> >> on the mpc7448/hpc-ii board, and made sure that the serial had their
> >> parent marked as "soc" (found out the hard way that UARTs were ignored
> >> as possible consoles unless they were soc or tsi108 children...)
> >>
> >> b/arch/powerpc/boot/dts/sbc8560.dts |  203 
> >> +++-
> >
> > we need to figure out to fix this so we don't need the parent marked as 
> > 'soc'.
> 
> Here is my interpretation of what is happening here -- we come in via
> find_legacy_serial_ports() to pick a console port.  It grabs "chosen"
> to get np stdout, and then checks the parent of the 16550 compat ports
> against the following, requiring at least one of them to match:
> 
>   parent->type == "soc" ? add_legacy_soc_port()
> 
>   parent->type == "isa" ? add_legacy_isa_port()
> 
>   parent->type == "tsi-bridge" ? add_legacy_soc_port()
> 
>   parent->type == "opb" ? add_legacy_soc_port()
> 
> No match means no serial console, it seems.

Not necessarily.  If the port is picked up by the of_serial driver it
should work.  The drawback is that the console will be initialized
rather late by this method.

>  I figured that parent == "soc"
> was the lesser lie to choose from, but I'm open to an alternate approach 
> that is less apt to make David go "ewww" (an understandable
> reaction...).

Lying in the device tree like this is just bad.  Adding another case
to legacy_serial for your specific case would be ugly but infinitely
preferable to mislabelling the node with type "doc".

-- 
David Gibson| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] [POWERPC] Add EHEA and EHCA as modules in the ppc64_defconfig

2007-12-20 Thread Stephen Rothwell

Signed-off-by: Stephen Rothwell <[EMAIL PROTECTED]>
---
 arch/powerpc/configs/ppc64_defconfig |8 +---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/configs/ppc64_defconfig 
b/arch/powerpc/configs/ppc64_defconfig
index 5760b9f..7695a4c 100644
--- a/arch/powerpc/configs/ppc64_defconfig
+++ b/arch/powerpc/configs/ppc64_defconfig
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
 # Linux kernel version: 2.6.24-rc4
-# Thu Dec  6 16:49:07 2007
+# Fri Dec 21 14:47:29 2007
 #
 CONFIG_PPC64=y
 
@@ -211,7 +211,7 @@ CONFIG_MMIO_NVRAM=y
 CONFIG_MPIC_U3_HT_IRQS=y
 CONFIG_MPIC_BROKEN_REGREAD=y
 CONFIG_IBMVIO=y
-# CONFIG_IBMEBUS is not set
+CONFIG_IBMEBUS=y
 # CONFIG_PPC_MPC106 is not set
 CONFIG_PPC_970_NAP=y
 CONFIG_PPC_INDIRECT_IO=y
@@ -375,7 +375,7 @@ CONFIG_INET_TUNNEL=y
 CONFIG_INET_XFRM_MODE_TRANSPORT=y
 CONFIG_INET_XFRM_MODE_TUNNEL=y
 CONFIG_INET_XFRM_MODE_BEET=y
-# CONFIG_INET_LRO is not set
+CONFIG_INET_LRO=m
 CONFIG_INET_DIAG=y
 CONFIG_INET_TCP_DIAG=y
 # CONFIG_TCP_CONG_ADVANCED is not set
@@ -929,6 +929,7 @@ CONFIG_SPIDER_NET=m
 CONFIG_NETDEV_1=y
 # CONFIG_CHELSIO_T1 is not set
 # CONFIG_CHELSIO_T3 is not set
+CONFIG_EHEA=m
 # CONFIG_IXGBE is not set
 CONFIG_IXGB=m
 # CONFIG_IXGB_NAPI is not set
@@ -1558,6 +1559,7 @@ CONFIG_INFINIBAND_ADDR_TRANS=y
 CONFIG_INFINIBAND_MTHCA=m
 CONFIG_INFINIBAND_MTHCA_DEBUG=y
 # CONFIG_INFINIBAND_IPATH is not set
+CONFIG_INFINIBAND_EHCA=m
 # CONFIG_INFINIBAND_AMSO1100 is not set
 # CONFIG_MLX4_INFINIBAND is not set
 CONFIG_INFINIBAND_IPOIB=m
-- 
1.5.3.7

-- 
Cheers,
Stephen Rothwell[EMAIL PROTECTED]
http://www.canb.auug.org.au/~sfr/
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] [POWERPC] Fix possible NULL deref in ppc32 PCI

2007-12-20 Thread Benjamin Herrenschmidt
The 32-bit PCI code tests if "bus" is non-NULL after calling
pci_scan_bus_parented() in one place but not another before
derefencing it.

Signed-off-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
---

 arch/powerpc/kernel/pci_32.c |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

--- linux-merge.orig/arch/powerpc/kernel/pci_32.c   2007-12-21 
14:50:24.0 +1100
+++ linux-merge/arch/powerpc/kernel/pci_32.c2007-12-21 14:51:20.0 
+1100
@@ -442,9 +442,10 @@ static int __init pcibios_init(void)
hose->last_busno = 0xff;
bus = pci_scan_bus_parented(hose->parent, hose->first_busno,
hose->ops, hose);
-   if (bus)
+   if (bus) {
pci_bus_add_devices(bus);
-   hose->last_busno = bus->subordinate;
+   hose->last_busno = bus->subordinate;
+   }
if (pci_assign_all_buses || next_busno <= hose->last_busno)
next_busno = hose->last_busno + 
pcibios_assign_bus_offset;
}
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 0/4] arch/powerpc support for SBC8560 board

2007-12-20 Thread Paul Gortmaker
In message: Re: [PATCH 0/4] arch/powerpc support for SBC8560 board
on 20/12/2007 Kumar Gala wrote:

>> 3) Add device tree source for Wind River SBC8560 board
>>
>> This is probably the most interesting part of the group, given that the
>> board doesn't use the CPM2 to provide the serial console.  I've made a
>> duart dts entry that is kind of similar to what is done for the tsi108
>> on the mpc7448/hpc-ii board, and made sure that the serial had their
>> parent marked as "soc" (found out the hard way that UARTs were ignored
>> as possible consoles unless they were soc or tsi108 children...)
>>
>> b/arch/powerpc/boot/dts/sbc8560.dts |  203 
>> +++-
>
> we need to figure out to fix this so we don't need the parent marked as 
> 'soc'.

Here is my interpretation of what is happening here -- we come in via
find_legacy_serial_ports() to pick a console port.  It grabs "chosen"
to get np stdout, and then checks the parent of the 16550 compat ports
against the following, requiring at least one of them to match:

parent->type == "soc" ? add_legacy_soc_port()

parent->type == "isa" ? add_legacy_isa_port()

parent->type == "tsi-bridge" ? add_legacy_soc_port()

parent->type == "opb" ? add_legacy_soc_port()

No match means no serial console, it seems.  I figured that parent == "soc"
was the lesser lie to choose from, but I'm open to an alternate approach 
that is less apt to make David go "ewww" (an understandable reaction...).

>
> Out of interest how exactly are the duart's wired on the 8560.  Are they 
> off localbus?

The board has a bunch of stuff hanging off of CS5 -- an RTC, a 7 segment
display, an EEPROM, some BCSR-like registers, and of course the two
UARTs which are supposed to be 16C2550.  According to TFM, an EPM7128
PLD is responsible for mashing/sub-decoding this all onto/off of CS5.
CS3 and CS4 are the LB-SDRAM.

>
>> I'd quickly spun together a u-boot 1.2.0 for testing this -- since that 
>> was
>> the quickest route to getting a powerpc capable version.  I'll see what
>> can be done for getting a u-boot 1.3.1 patchset out so the 
>> local-mac-address
>> vs address thing in the dtb isn't an issue.
>
> Probably should add a boot wrapper to work with old non-device tree aware 
> u-boots.

Something to consider, sure -- but I figured working towards a more up
to date u-boot is something people would see more of a future for and
more of an interest in.

Paul.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[DTC PATCH 2/2] Add support for binary includes.

2007-12-20 Thread Scott Wood
A property's data can be populated with a file's contents
as follows:

node {
prop = /bin-include/ "path/to/data";
};

Search paths are not yet implemented; non-absolute lookups are relative to
the directory from which dtc was invoked.

Signed-off-by: Scott Wood <[EMAIL PROTECTED]>
---
 dtc-lexer.l  |6 ++
 dtc-parser.y |   26 ++
 dtc.h|1 +
 3 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/dtc-lexer.l b/dtc-lexer.l
index c811b22..1f3e6d6 100644
--- a/dtc-lexer.l
+++ b/dtc-lexer.l
@@ -190,6 +190,12 @@ static int dts_version; /* = 0 */
return DT_PROPNODENAME;
}
 
+"/bin-include/"{
+   yylloc.filenum = srcpos_filenum;
+   yylloc.first_line = yylineno;
+   DPRINT("Binary Include\n");
+   return DT_BININCLUDE;
+   }
 
 <*>[[:space:]]+/* eat whitespace */
 
diff --git a/dtc-parser.y b/dtc-parser.y
index 4a0181d..c7ed715 100644
--- a/dtc-parser.y
+++ b/dtc-parser.y
@@ -21,6 +21,8 @@
 %locations
 
 %{
+#include 
+
 #include "dtc.h"
 #include "srcpos.h"
 
@@ -58,6 +60,7 @@ extern struct boot_info *the_boot_info;
 %token  DT_STRING
 %token  DT_LABEL
 %token  DT_REF
+%token DT_BININCLUDE
 
 %type  propdata
 %type  propdataprefix
@@ -196,6 +199,29 @@ propdata:
{
$$ = data_add_marker($1, REF_PATH, $2);
}
+   | propdataprefix DT_BININCLUDE DT_STRING
+   {
+   struct stat st;
+   FILE *f;
+   int fd;
+   
+   f = fopen($3.val, "rb");
+   if (!f) {
+   yyerrorf("Cannot open file \"%s\": %s",
+$3.val, strerror(errno));
+   YYERROR;
+   }
+
+   fd = fileno(f);
+   if (fstat(fd, &st) < 0) {
+   yyerrorf("Cannot stat file \"%s\": %s",
+$3.val, strerror(errno));
+   YYERROR;
+   }
+
+   $$ = data_merge($1, data_copy_file(f, st.st_size));
+   fclose(f);
+   }
| propdata DT_LABEL
{
$$ = data_add_marker($1, LABEL, $2);
diff --git a/dtc.h b/dtc.h
index 9b89689..87b5bb1 100644
--- a/dtc.h
+++ b/dtc.h
@@ -138,6 +138,7 @@ struct data data_grow_for(struct data d, int xlen);
 struct data data_copy_mem(const char *mem, int len);
 struct data data_copy_escape_string(const char *s, int len);
 struct data data_copy_file(FILE *f, size_t len);
+struct data data_bin_include(const char *filename);
 
 struct data data_append_data(struct data d, const void *p, int len);
 struct data data_insert_at_marker(struct data d, struct marker *m,
-- 
1.5.3
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Enable RTC for Ebony and Walnut

2007-12-20 Thread David Gibson
This patch extends the Ebony and Walnut platform code to instantiate
the existing ds1742 RTC class driver for the DS1743 RTC/NVRAM chip
found on both those boards.  The patch uses a helper function to scan
the device tree and instantiate the appropriate platform_device based
on it, so it should be easy to extend for other boards which have mmio
mapped RTC chips.

Along with this, the device tree binding for the ds1743 chips is
tweaked, based on the existing DS1385 OF binding found at:

http://playground.sun.com/1275/proposals/Closed/Remanded/Accepted/346-it.txt
Although that document covers the NVRAM portion of the chip, whereas
here we're interested in the RTC portion, so it's not entirely clear
if that's a good model.

This implements only RTC class driver support - that is /dev/rtc0, not
/dev/rtc, and the low-level get/set time callbacks remain
unimplemented.  That means in order to get at the clock you will
either need a modified version of hwclock which will look at
/dev/rtc0, or you'll need to configure udev to symlink rtc0 to rtc.

Signed-off-by: David Gibson <[EMAIL PROTECTED]>

Index: working-2.6/arch/powerpc/boot/dts/ebony.dts
===
--- working-2.6.orig/arch/powerpc/boot/dts/ebony.dts2007-10-22 
13:55:49.0 +1000
+++ working-2.6/arch/powerpc/boot/dts/ebony.dts 2007-12-21 13:11:34.0 
+1100
@@ -150,9 +150,10 @@
};
};
 
-   [EMAIL PROTECTED],0 {
+   [EMAIL PROTECTED],0 {
/* NVRAM & RTC */
-   compatible = "ds1743";
+   compatible = "ds1743-nvram";
+   #bytes = <2000>;
reg = <1 0 2000>;
};
 
Index: working-2.6/arch/powerpc/platforms/44x/ebony.c
===
--- working-2.6.orig/arch/powerpc/platforms/44x/ebony.c 2007-12-10 
10:52:44.0 +1100
+++ working-2.6/arch/powerpc/platforms/44x/ebony.c  2007-12-21 
13:11:34.0 +1100
@@ -18,6 +18,7 @@
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -40,6 +41,7 @@ static int __init ebony_device_probe(voi
return 0;
 
of_platform_bus_probe(NULL, ebony_of_bus, NULL);
+   of_instantiate_rtc();
 
return 0;
 }
Index: working-2.6/arch/powerpc/platforms/Kconfig
===
--- working-2.6.orig/arch/powerpc/platforms/Kconfig 2007-12-10 
10:52:44.0 +1100
+++ working-2.6/arch/powerpc/platforms/Kconfig  2007-12-21 13:11:34.0 
+1100
@@ -315,6 +315,9 @@ config FSL_ULI1575
 config CPM
bool
 
+config OF_RTC
+   bool
+
 source "arch/powerpc/sysdev/bestcomm/Kconfig"
 
 endmenu
Index: working-2.6/arch/powerpc/sysdev/Makefile
===
--- working-2.6.orig/arch/powerpc/sysdev/Makefile   2007-12-21 
13:11:32.0 +1100
+++ working-2.6/arch/powerpc/sysdev/Makefile2007-12-21 13:11:34.0 
+1100
@@ -27,6 +27,7 @@ obj-$(CONFIG_PPC_I8259)   += i8259.o
 obj-$(CONFIG_PPC_83xx) += ipic.o
 obj-$(CONFIG_4xx)  += uic.o
 obj-$(CONFIG_XILINX_VIRTEX)+= xilinx_intc.o
+obj-$(CONFIG_OF_RTC)   += of_rtc.o
 endif
 
 # Temporary hack until we have migrated to asm-powerpc
Index: working-2.6/arch/powerpc/sysdev/of_rtc.c
===
--- /dev/null   1970-01-01 00:00:00.0 +
+++ working-2.6/arch/powerpc/sysdev/of_rtc.c2007-12-21 13:11:34.0 
+1100
@@ -0,0 +1,59 @@
+/*
+ * Instantiate mmio-mapped RTC chips based on device tree information
+ *
+ * Copyright 2007 David Gibson <[EMAIL PROTECTED]>, IBM Corporation.
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+#include 
+#include 
+#include 
+#include 
+
+static struct {
+   char *compatible;
+   char *plat_name;
+} of_rtc_table[] = {
+   { "ds1743-nvram", "rtc-ds1742" },
+};
+
+void __init of_instantiate_rtc(void)
+{
+   struct device_node *node;
+   int err;
+   int i;
+
+   for (i = 0; i < ARRAY_SIZE(of_rtc_table); i++) {
+   char *compatible = of_rtc_table[i].compatible;
+   char *plat_name = of_rtc_table[i].plat_name;
+
+   for_each_compatible_node(node, NULL, compatible) {
+   struct resource *res;
+
+   res = kmalloc(sizeof(*res), GFP_KERNEL);
+   if (!res) {
+  

Re: [PATCH v3 2/2] mpc82xx: Embedded Planet EP8248E support

2007-12-20 Thread David Gibson
On Thu, Dec 20, 2007 at 11:45:24AM -0600, Scott Wood wrote:
> This board is also resold by Freescale under the names
> "QUICCStart MPC8248 Evaluation System" and "CWH-PPC-8248N-VE".
> 
> Signed-off-by: Scott Wood <[EMAIL PROTECTED]>
[snip]
> + [EMAIL PROTECTED],0 {
> + #address-cells = <2>;
> + #size-cells = <1>;
> + reg = <1 0 0x10>;
> + compatible = "fsl,ep8248e-bcsr";
> + ranges;
> +
> + mdio {
> + device_type = "mdio";

Shouldn't have this device_type.

> + compatible = "fsl,ep8248e-mdio-bitbang";
> + #address-cells = <1>;
> + #size-cells = <0>;
> + reg = <1 8 1>;
> +
> + PHY0: [EMAIL PROTECTED] {
> + interrupt-parent = <&PIC>;
> + reg = <0>;
> + device_type = "ethernet-phy";
> + };
> +
> + PHY1: [EMAIL PROTECTED] {
> + interrupt-parent = <&PIC>;
> + reg = <1>;
> + device_type = "ethernet-phy";
> + };
> + };
> + };
> + };

-- 
David Gibson| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [RESEND DTC PATCH 2/2] Add support for binary includes.

2007-12-20 Thread David Gibson
On Thu, Dec 20, 2007 at 01:52:59PM -0600, Scott Wood wrote:
> A property's data can be populated with a file's contents
> as follows:
> 
> node {
>   prop = /bin-include/ "path/to/data";
> };

I'd be inclined to use /incbin/ rather than /bin-include/.  It's only
slightly less obvious, but it's then the same as the gas pseudo-op as
well as being a little briefer.

> Search paths are not yet implemented; non-absolute lookups are relative to
> the directory from which dtc was invoked.

Hrm.  I think that's a bit too bogus.  Although it's rather more work
to implement, I think we have to make relative paths relative to the
location of the dts file until search paths are implemented.

> Signed-off-by: Scott Wood <[EMAIL PROTECTED]>
> ---
> Apologies if you get this twice, but AFAICT the original got eaten by our
> mail server.
> 
>  dtc-lexer.l  |6 ++
>  dtc-parser.y |   26 ++
>  dtc.h|1 +
>  3 files changed, 33 insertions(+), 0 deletions(-)
> 
> diff --git a/dtc-lexer.l b/dtc-lexer.l
> index c811b22..1f3e6d6 100644
> --- a/dtc-lexer.l
> +++ b/dtc-lexer.l
> @@ -190,6 +190,12 @@ static int dts_version; /* = 0 */
>   return DT_PROPNODENAME;
>   }
>  
> +"/bin-include/"  {
> + yylloc.filenum = srcpos_filenum;
> + yylloc.first_line = yylineno;
> + DPRINT("Binary Include\n");
> + return DT_BININCLUDE;
> + }
>  
>  <*>[[:space:]]+  /* eat whitespace */
>  
> diff --git a/dtc-parser.y b/dtc-parser.y
> index 4a0181d..c7ed715 100644
> --- a/dtc-parser.y
> +++ b/dtc-parser.y
> @@ -21,6 +21,8 @@
>  %locations
>  
>  %{
> +#include 
> +
>  #include "dtc.h"
>  #include "srcpos.h"
>  
> @@ -58,6 +60,7 @@ extern struct boot_info *the_boot_info;
>  %token  DT_STRING
>  %token  DT_LABEL
>  %token  DT_REF
> +%token DT_BININCLUDE
>  
>  %type  propdata
>  %type  propdataprefix
> @@ -196,6 +199,29 @@ propdata:
>   {
>   $$ = data_add_marker($1, REF_PATH, $2);
>   }
> + | propdataprefix DT_BININCLUDE DT_STRING
> + {
> + struct stat st;
> + FILE *f;
> + int fd;
> + 
> + f = fopen($3.val, "rb");
> + if (!f) {
> + yyerrorf("Cannot open file \"%s\": %s",
> +  $3.val, strerror(errno));
> + YYERROR;

Hrm.  I'm not sure that being unable to open the file should cause a
*parse* error which is what YYERROR will do.  Probably better to print
an error message, but let the parsing continue, with the property
value being as though the file were empty.

> + }
> +
> + fd = fileno(f);
> + if (fstat(fd, &st) < 0) {
> + yyerrorf("Cannot stat file \"%s\": %s",
> +  $3.val, strerror(errno));
> + YYERROR;
> + }

I'm also not sure that stat()ing the file is a good way to get the
size.  This requires that the included file be a regular file with a
sane st_size value, and I can imagine cases where it might be useful
to incbin from a /dev node or other special file.  Obviosuly
implementing that will require work to data_copy_file().

Actually, I think the way to go here would be to have two variants of
the incbin directive:  one which takes just a filename and includes
the whole file contents, another which takes a filename and a number
and includes just the first N bytes of the file.

> + $$ = data_merge($1, data_copy_file(f, st.st_size));
> + fclose(f);
> + }
>   | propdata DT_LABEL
>   {
>   $$ = data_add_marker($1, LABEL, $2);
> diff --git a/dtc.h b/dtc.h
> index 9b89689..87b5bb1 100644
> --- a/dtc.h
> +++ b/dtc.h
> @@ -138,6 +138,7 @@ struct data data_grow_for(struct data d, int xlen);
>  struct data data_copy_mem(const char *mem, int len);
>  struct data data_copy_escape_string(const char *s, int len);
>  struct data data_copy_file(FILE *f, size_t len);
> +struct data data_bin_include(const char *filename);

This looks like a hangover from an earlier version.

-- 
David Gibson| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: patch pci-fix-bus-resource-assignment-on-32-bits-with-64b-resources.patch added to gregkh-2.6 tree

2007-12-20 Thread Greg KH
On Fri, Dec 21, 2007 at 10:56:13AM +1100, Benjamin Herrenschmidt wrote:
> 
> > The current pci_assign_unassigned_resources() code doesn't work properly
> > on 32 bits platforms with 64 bits resources. The main reason is the use
> > of unsigned long in various places instead of resource_size_t.
> > 
> > This fixes it, along with some tricks to avoid casting to 64 bits on
> > platforms that don't need it in every printk around.
> 
> Can you still edit the changelog ?

Yes I can.

> If yes, please remove that sentence
> since the latest version (which you put in your tree) doesn't actually
> have those tricks anymore as per discussion on the list...

Ok, now done, thanks.

greg k-h
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [DTC PATCH 1/2] Add yyerrorf() for formatted error messages.

2007-12-20 Thread David Gibson
On Thu, Dec 20, 2007 at 10:48:23AM -0600, Scott Wood wrote:
> Signed-off-by: Scott Wood <[EMAIL PROTECTED]>

No need for a new function.  If yyerror() is defined as a varargs
function it's still compatible with bison's built-in usage.

Oh, and while you're at it, you can kill off the bogus prototype for
yyerror() in treesource.c

-- 
David Gibson| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] ASoC drivers for the Freescale MPC8610 SoC

2007-12-20 Thread David Gibson
On Thu, Dec 20, 2007 at 06:13:31PM -0500, Jon Smirl wrote:
> On 12/20/07, Scott Wood <[EMAIL PROTECTED]> wrote:
> > Timur Tabi wrote:
> > > Jon Smirl wrote:
> > >
> > >> mpc5200 does it like this:
> > >> of_platform_bus_probe(NULL, NULL, NULL);
> > >
> > > I think that tells the OF base code to probe everything in the device 
> > > tree,
> > > which is probably overkill.  I think fsl_soc.c covers most of the device 
> > > tree,
> > > but the SSI is not defined in fsl_soc.c.
> >
> > Not quite; it tells it to use a built-in list of bus matches.  Most of
> > which are device_type-based, FWIW.
> 
> Here's the default. Using NULL would work.

It might work, but using the default list is discouraged.  Pass an
explicit list of match ids for the buses you need to scan instead (and
use compatible to match them, not device_type).

-- 
David Gibson| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 3/4] sbc8560: Add device tree source for Wind River SBC8560 board

2007-12-20 Thread David Gibson
On Thu, Dec 20, 2007 at 09:54:31AM -0500, Paul Gortmaker wrote:
> This adds the device tree source for the Wind River SBC8560 board.  The
> biggest difference between this and the MPC8560ADS reference platform
> is the use of an external 16550 compatible UART instead of the CPM2.
> 
> Signed-off-by: Paul Gortmaker <[EMAIL PROTECTED]>
> ---
>  arch/powerpc/boot/dts/sbc8560.dts |  202 
> +
>  1 files changed, 202 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/powerpc/boot/dts/sbc8560.dts 
> b/arch/powerpc/boot/dts/sbc8560.dts
> new file mode 100644
> index 000..85fc488
> --- /dev/null
> +++ b/arch/powerpc/boot/dts/sbc8560.dts
> @@ -0,0 +1,202 @@
> +/*
> + * SBC8560 Device Tree Source
> + *
> + * Copyright 2007 Wind River Systems Inc.
> + *
> + * Paul Gortmaker (see MAINTAINERS for contact information)
> + *
> + * 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.
> + */
> +
> +
> +/ {
> + model = "SBC8560";
> + compatible = "SBC8560";
> + #address-cells = <1>;
> + #size-cells = <1>;
> +
> + cpus {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + PowerPC,[EMAIL PROTECTED] {
> + device_type = "cpu";
> + reg = <0>;
> + d-cache-line-size = <20>;   // 32 bytes
> + i-cache-line-size = <20>;   // 32 bytes
> + d-cache-size = <8000>;  // L1, 32K
> + i-cache-size = <8000>;  // L1, 32K
> + timebase-frequency = <0>;   // From uboot
> + bus-frequency = <0>;
> + clock-frequency = <0>;
> + 32-bit;

Drop the "32-bit".  It was created in analogy with the "64-bit"
property, but nothing ever actually specified it.

> + };
> + };
> +
> + memory {
> + device_type = "memory";
> + reg = < 2000>;
> + };
> +
> + [EMAIL PROTECTED] {

I believe we're trying to call these "[EMAIL PROTECTED]" now rather than
"[EMAIL PROTECTED]".

> + #address-cells = <1>;
> + #size-cells = <1>;
> + #interrupt-cells = <2>;
> + device_type = "soc";
> + ranges = <0 ff70 0010>;
> + reg = ;
> + bus-frequency = <0>;

This should be "clock-frequency" not "bus-frequency" although I don't
know if you can fix this within your code, or if it's a pre-existing
brokenness.

[snip]
> + [EMAIL PROTECTED] {
> + device_type = "i2c";

Drop this device_type.

> + compatible = "fsl-i2c";
> + reg = <3000 100>;
> + interrupts = <2b 2>;
> + interrupt-parent = <&mpic>;
> + dfsrr;
> + };
> +
> + [EMAIL PROTECTED] {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + device_type = "mdio";
> + compatible = "gianfar";

And this one, and change the compatible.  The gianfar driver has
recently been updated to change this.

[snip]
> + [EMAIL PROTECTED] {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + device_type = "network";
> + model = "TSEC";
> + compatible = "gianfar";

Likewise here.

> + reg = <24000 1000>;
> + local-mac-address = [ 00 00 00 00 00 00 ];
> + interrupts = <1d 2 1e 2 22 2>;
> + interrupt-parent = <&mpic>;
> + phy-handle = <&phy0>;
> + };

[snip]
> + mpic: [EMAIL PROTECTED] {
> + clock-frequency = <0>;

The mpic has a clock-frequency??

> + interrupt-controller;
> + #address-cells = <0>;

Should have #size-cells = <0> too.

> + #interrupt-cells = <2>;
> + reg = <4 4>;
> + built-in;
> + compatible = "chrp,open-pic";
> + device_type = "open-pic";
> + big-endian;
> + };
> +
> + [EMAIL PROTECTED] {
> + compatible = "fsl,mpc8560-guts";
> + reg = ;
> + fsl,has-rstcr;
> + };
> + };
> +
> + [EMAIL PROTECTED] {
> + #address-cells = <1>;
> + #size-cells = <1>;
> + #interrupt-cells = <2>;

This is neither an interrupt-controller nor an interrupt-nexus, so it
shouldn't have #interrupt-cells.

>

Re: [PATCH 0/4] arch/powerpc support for SBC8560 board

2007-12-20 Thread Paul Gortmaker
Kumar Gala wrote:
> Can we get ride of sbc85xx in arch/ppc with these patches?
>
> - k

That was the plan, yes.

P.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 0/5] Version 17, series to add device tree naming to i2c

2007-12-20 Thread Jon Smirl
Are there any other objections to this patch? If not, can it be
targeted for 2.6.25?

On 12/19/07, Jon Smirl <[EMAIL PROTECTED]> wrote:
> Since copying i2c-mpc.c to maintain support for the ppc architecture seems to 
> be an issue; instead rework i2c-mpc.c to use CONFIG_PPC_MERGE #ifdefs to 
> support both the ppc and powerpc architecture. When ppc is deleted in six 
> months these #ifdefs will need to be removed.
>
> Another rework of the i2c for powerpc device tree patch. This version 
> implements standard alias naming only on the powerpc platform and only for 
> the device tree names. The old naming mechanism of 
> i2c_client.name,driver_name is left in place and not changed for non-powerpc 
> platforms. This patch is fully capable of dynamically loading the i2c 
> modules. You can modprobe in the i2c-mpc driver and the i2c modules described 
> in the device tree will be automatically loaded. Modules also work if 
> compiled in.
>
> The follow on patch to module-init-tools is also needed since the i2c 
> subsystem has never implemented dynamic loading.
>
> The following series implements standard linux module aliasing for i2c 
> modules on arch=powerpc. It then converts the mpc i2c driver from being a 
> platform driver to an open firmware one. I2C device names are picked up from 
> the device tree. Module aliasing is used to translate from device tree names 
> into to linux kernel names. Several i2c drivers are updated to use the new 
> aliasing.
>
> --
> Jon Smirl
> [EMAIL PROTECTED]
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [EMAIL PROTECTED]
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>


-- 
Jon Smirl
[EMAIL PROTECTED]
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 0/4] arch/powerpc support for SBC8560 board

2007-12-20 Thread Kumar Gala
> 3) Add device tree source for Wind River SBC8560 board
>
> This is probably the most interesting part of the group, given that  
> the
> board doesn't use the CPM2 to provide the serial console.  I've made a
> duart dts entry that is kind of similar to what is done for the tsi108
> on the mpc7448/hpc-ii board, and made sure that the serial had their
> parent marked as "soc" (found out the hard way that UARTs were ignored
> as possible consoles unless they were soc or tsi108 children...)
>
> b/arch/powerpc/boot/dts/sbc8560.dts |  203 ++ 
> +-

we need to figure out to fix this so we don't need the parent marked  
as 'soc'.

Out of interest how exactly are the duart's wired on the 8560.  Are  
they off localbus?


> I'd quickly spun together a u-boot 1.2.0 for testing this -- since  
> that was
> the quickest route to getting a powerpc capable version.  I'll see  
> what
> can be done for getting a u-boot 1.3.1 patchset out so the local-mac- 
> address
> vs address thing in the dtb isn't an issue.

Probably should add a boot wrapper to work with old non-device tree  
aware u-boots.

- k
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: patch pci-fix-bus-resource-assignment-on-32-bits-with-64b-resources.patch added to gregkh-2.6 tree

2007-12-20 Thread Benjamin Herrenschmidt

> The current pci_assign_unassigned_resources() code doesn't work properly
> on 32 bits platforms with 64 bits resources. The main reason is the use
> of unsigned long in various places instead of resource_size_t.
> 
> This fixes it, along with some tricks to avoid casting to 64 bits on
> platforms that don't need it in every printk around.

Can you still edit the changelog ? If yes, please remove that sentence
since the latest version (which you put in your tree) doesn't actually
have those tricks anymore as per discussion on the list...

Sorry about that.

Cheers,
Ben.

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 3/4] sbc8560: Add device tree source for Wind River SBC8560 board

2007-12-20 Thread Kumar Gala

On Dec 20, 2007, at 8:54 AM, Paul Gortmaker wrote:

> This adds the device tree source for the Wind River SBC8560 board.   
> The
> biggest difference between this and the MPC8560ADS reference platform
> is the use of an external 16550 compatible UART instead of the CPM2.
>
> Signed-off-by: Paul Gortmaker <[EMAIL PROTECTED]>
> ---
> arch/powerpc/boot/dts/sbc8560.dts |  202  
> +
> 1 files changed, 202 insertions(+), 0 deletions(-)
>
> diff --git a/arch/powerpc/boot/dts/sbc8560.dts b/arch/powerpc/boot/ 
> dts/sbc8560.dts
> new file mode 100644
> index 000..85fc488
> --- /dev/null
> +++ b/arch/powerpc/boot/dts/sbc8560.dts
> @@ -0,0 +1,202 @@
> +/*
> + * SBC8560 Device Tree Source
> + *
> + * Copyright 2007 Wind River Systems Inc.
> + *
> + * Paul Gortmaker (see MAINTAINERS for contact information)
> + *
> + * 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.
> + */
> +

can you look at converting this to a dts-v1 format.

>
> +
> +/ {
> + model = "SBC8560";
> + compatible = "SBC8560";
> + #address-cells = <1>;
> + #size-cells = <1>;

add aliases.

>
> +
> + cpus {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + PowerPC,[EMAIL PROTECTED] {
> + device_type = "cpu";
> + reg = <0>;
> + d-cache-line-size = <20>;   // 32 bytes
> + i-cache-line-size = <20>;   // 32 bytes
> + d-cache-size = <8000>;  // L1, 32K
> + i-cache-size = <8000>;  // L1, 32K
> + timebase-frequency = <0>;   // From uboot
> + bus-frequency = <0>;
> + clock-frequency = <0>;
> + 32-bit;
> + };
> + };
> +
> + memory {
> + device_type = "memory";
> + reg = < 2000>;
> + };
> +
> + [EMAIL PROTECTED] {
> + #address-cells = <1>;
> + #size-cells = <1>;
> + #interrupt-cells = <2>;
> + device_type = "soc";
> + ranges = <0 ff70 0010>;
> + reg = ;
> + bus-frequency = <0>;
> +
> + [EMAIL PROTECTED] {
> + compatible = "fsl,8560-memory-controller";
> + reg = <2000 1000>;
> + interrupt-parent = <&mpic>;
> + interrupts = <12 2>;
> + };
> +
> + [EMAIL PROTECTED] {
> + compatible = "fsl,8560-l2-cache-controller";
> + reg = <2 1000>;
> + cache-line-size = <20>; // 32 bytes
> + cache-size = <4>;   // L2, 256K
> + interrupt-parent = <&mpic>;
> + interrupts = <10 2>;
> + };
> +
> + [EMAIL PROTECTED] {
> + device_type = "i2c";
> + compatible = "fsl-i2c";
> + reg = <3000 100>;
> + interrupts = <2b 2>;
> + interrupt-parent = <&mpic>;
> + dfsrr;
> + };

See updates for i2c controllers in the for-2.6.25 branch.

>
> +
> + [EMAIL PROTECTED] {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + device_type = "mdio";
> + compatible = "gianfar";

seem updates to mdio in for-2.6.25 branch.

>
> + reg = <24520 20>;
> + phy0: [EMAIL PROTECTED] {
> + interrupt-parent = <&mpic>;
> + interrupts = <6 1>;
> + reg = <19>;
> + device_type = "ethernet-phy";
> + };
> + phy1: [EMAIL PROTECTED] {
> + interrupt-parent = <&mpic>;
> + interrupts = <7 1>;
> + reg = <1a>;
> + device_type = "ethernet-phy";
> + };
> + };
> +
> + [EMAIL PROTECTED] {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + device_type = "network";
> + model = "TSEC";
> + compatible = "gianfar";
> + reg = <24000 1000>;
> + local-mac-address = [ 00 00 00 00 00 00 ];
> + interrupts = <1d 2 1e 2 22 2>;
> + interrupt-parent = <&mpic>;
> + phy-handle = <&phy0>;

see updates to enet nodes.

>
> +

Re: [PATCH v2 3/4] [POWERPC][SPI] use brg-frequency for SPI in QE

2007-12-20 Thread Anton Vorontsov
On Thu, Dec 20, 2007 at 11:33:22PM +0300, Anton Vorontsov wrote:
> In case of QE we can use brg-frequency (which is qeclk/2).
> Thus no need to divide sysclk in the spi_mpc83xx.
> 
> This patch also adds code to use get_brgfreq() on QE chips.

> Signed-off-by: Anton Vorontsov <[EMAIL PROTECTED]>
> ---
[...]
> @@ -91,6 +91,11 @@ u32 get_brgfreq(void)
>  
>   /* Legacy device binding -- will go away when no users are left. */
>   node = of_find_node_by_type(NULL, "cpm");
> + if (!node)
> + node = of_find_compatible_node(NULL, NULL, "fsl,qe");
> + if (!node)
> + node = of_find_node_by_type(NULL, "qe");
> +
>   if (node) {
>   prop = of_get_property(node, "brg-frequency", &size);

I beg your pardon, truly. I just tested this on MPC8323E-RDB. No,
older u-boots doesn't have brg-frequency. So, I must add
of_get_property() for bus-frequency in case of failing
brg-frequency. :-/

I also found few glitches in `fsl_spi_init and users: stop using
device_type = "spi"' patch, regarding of_node_put(). Heh,
of_find_compatible_node() _puts_ `from' argument by itself, which
is not obvious at all.

I'll attach updated patches, with David's Acked-by on SPI driver
part. Other patches seem to be fine though.

Thanks,

p.s. dropping spi-devel list, because only powerpc stuff
affected.

-- 
Anton Vorontsov
email: [EMAIL PROTECTED]
backup email: [EMAIL PROTECTED]
irc://irc.freenode.net/bd2
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 0/4] arch/powerpc support for SBC8560 board

2007-12-20 Thread Kumar Gala
Can we get ride of sbc85xx in arch/ppc with these patches?

- k
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 1/4] sbc8560: add basic support for Wind River SBC8560 as powerpc

2007-12-20 Thread Kumar Gala

On Dec 20, 2007, at 8:54 AM, Paul Gortmaker wrote:

> This adds the basic support for the Wind River SBC8560 board,  
> implemented
> as powerpc.  It closely follows the implementation of the MPC8560ADS.
>
> Signed-off-by: Paul Gortmaker <[EMAIL PROTECTED]>
> ---
> arch/powerpc/platforms/85xx/Kconfig   |   11 +-
> arch/powerpc/platforms/85xx/Makefile  |1 +
> arch/powerpc/platforms/85xx/sbc8560.c |  302  
> +
> 3 files changed, 312 insertions(+), 2 deletions(-)
>
> diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/ 
> platforms/85xx/Kconfig
> index 7748a3a..0eb497b 100644
> --- a/arch/powerpc/platforms/85xx/Kconfig
> +++ b/arch/powerpc/platforms/85xx/Kconfig
> @@ -38,6 +38,13 @@ config MPC85xx_DS
>   help
> This option enables support for the MPC85xx DS (MPC8544 DS) board
>
> +config SBC8560
> + bool "Wind River SBC8560"
> + select DEFAULT_UIMAGE
> + select PPC_CPM_NEW_BINDING
> + help
> +   This option enables support for the Wind River SBC8560 board
> +
> endchoice
>
> config MPC8540
> @@ -49,7 +56,7 @@ config MPC8540
> config MPC8560
>   bool
>   select CPM2
> - default y if MPC8560_ADS
> + default y if MPC8560_ADS || SBC8560
>
> config MPC85xx
>   bool
> @@ -59,4 +66,4 @@ config MPC85xx
>   select FSL_PCI if PCI
>   select SERIAL_8250_SHARE_IRQ if SERIAL_8250
>   default y if MPC8540_ADS || MPC85xx_CDS || MPC8560_ADS \
> - || MPC85xx_MDS || MPC85xx_DS
> + || MPC85xx_MDS || MPC85xx_DS || SBC8560
> diff --git a/arch/powerpc/platforms/85xx/Makefile b/arch/powerpc/ 
> platforms/85xx/Makefile
> index 5eca920..c3f4d01 100644
> --- a/arch/powerpc/platforms/85xx/Makefile
> +++ b/arch/powerpc/platforms/85xx/Makefile
> @@ -6,3 +6,4 @@ obj-$(CONFIG_MPC8560_ADS) += mpc85xx_ads.o
> obj-$(CONFIG_MPC85xx_CDS) += mpc85xx_cds.o
> obj-$(CONFIG_MPC85xx_DS)  += mpc85xx_ds.o
> obj-$(CONFIG_MPC85xx_MDS) += mpc85xx_mds.o
> +obj-$(CONFIG_SBC8560) += sbc8560.o
> diff --git a/arch/powerpc/platforms/85xx/sbc8560.c b/arch/powerpc/ 
> platforms/85xx/sbc8560.c
> new file mode 100644
> index 000..6aef38b
> --- /dev/null
> +++ b/arch/powerpc/platforms/85xx/sbc8560.c
> @@ -0,0 +1,302 @@
> +/*
> + * Wind River SBC8560 setup and early boot code.
> + *
> + * Copyright 2007 Wind River Systems Inc.
> + *
> + * By Paul Gortmaker (see MAINTAINERS for contact information)
> + *
> + * Based largely on the MPC8560ADS support - Copyright 2005  
> Freescale Inc.
> + *
> + * This program is free software; you can redistribute  it and/or  
> modify it
> + * under  the terms of  the GNU General  Public License as  
> published by the
> + * Free Software Foundation;  either version 2 of the  License, or  
> (at your
> + * option) any later version.
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +#include 
> +
> +#ifdef CONFIG_CPM2
> +#include 
> +#include 
> +#endif
> +
> +#ifdef CONFIG_PCI
> +static int sbc8560_exclude_device(struct pci_controller *hose,
> +u_char bus, u_char devfn)
> +{
> + if (bus == 0 && PCI_SLOT(devfn) == 0)
> + return PCIBIOS_DEVICE_NOT_FOUND;
> + else
> + return PCIBIOS_SUCCESSFUL;
> +}

do you really need to exclude the PHB itself?  I've fixed this for FSL  
PHBs so I don't believe you need this anymore.

>
> +#endif /* CONFIG_PCI */
> +

- k


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


patch pci-fix-warning-in-setup-res.c-on-32-bit-platforms-with-64-bit-resources.patch added to gregkh-2.6 tree

2007-12-20 Thread gregkh

This is a note to let you know that I've just added the patch titled

 Subject: PCI: Fix warning in setup-res.c on 32-bit platforms with 64-bit 
resources

to my gregkh-2.6 tree.  Its filename is

 
pci-fix-warning-in-setup-res.c-on-32-bit-platforms-with-64-bit-resources.patch

This tree can be found at 
http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/


>From [EMAIL PROTECTED] Sun Dec  9 22:32:23 2007
From: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
Date: Mon, 10 Dec 2007 17:32:16 +1100
Subject: PCI: Fix warning in setup-res.c on 32-bit platforms with 64-bit 
resources
To: Greg Kroah-Hartman <[EMAIL PROTECTED]>
Cc: [EMAIL PROTECTED], , <[EMAIL PROTECTED]>
Message-ID: <[EMAIL PROTECTED]>


This adds appropriate casts to avoid a warning and print the correct
values in pr_debug.

Signed-off-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>

---
 drivers/pci/setup-res.c |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

--- a/drivers/pci/setup-res.c
+++ b/drivers/pci/setup-res.c
@@ -51,10 +51,12 @@ pci_update_resource(struct pci_dev *dev,
 
pcibios_resource_to_bus(dev, ®ion, res);
 
-   pr_debug("  got res [%llx:%llx] bus [%lx:%lx] flags %lx for "
+   pr_debug("  got res [%llx:%llx] bus [%llx:%llx] flags %lx for "
 "BAR %d of %s\n", (unsigned long long)res->start,
 (unsigned long long)res->end,
-region.start, region.end, res->flags, resno, pci_name(dev));
+(unsigned long long)region.start,
+(unsigned long long)region.end,
+(unsigned long)res->flags, resno, pci_name(dev));
 
new = region.start | (res->flags & PCI_REGION_FLAG_MASK);
if (res->flags & IORESOURCE_IO)


Patches currently in gregkh-2.6 which might be from [EMAIL PROTECTED] are

bad/battery-class-driver.patch
driver/adb-convert-from-class_device-to-device.patch
driver/kobject-convert-hvc_console-to-use-kref-not-kobject.patch
driver/kobject-convert-hvcs-to-use-kref-not-kobject.patch
driver/kobject-convert-icom-to-use-kref-not-kobject.patch
pci/pci-fix-bus-resource-assignment-on-32-bits-with-64b-resources.patch
pci/pci-fix-warning-in-setup-res.c-on-32-bit-platforms-with-64-bit-resources.patch
usb/usb-remove-ohci-useless-masking-unmasking-of-wdh-interrupt.patch
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


patch pci-fix-bus-resource-assignment-on-32-bits-with-64b-resources.patch added to gregkh-2.6 tree

2007-12-20 Thread gregkh

This is a note to let you know that I've just added the patch titled

 Subject: PCI: Fix bus resource assignment on 32 bits with 64b resources

to my gregkh-2.6 tree.  Its filename is

 pci-fix-bus-resource-assignment-on-32-bits-with-64b-resources.patch

This tree can be found at 
http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/


>From [EMAIL PROTECTED] Sun Dec  9 22:32:23 2007
From: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
Date: Mon, 10 Dec 2007 17:32:15 +1100
Subject: PCI: Fix bus resource assignment on 32 bits with 64b resources
To: Greg Kroah-Hartman <[EMAIL PROTECTED]>
Cc: [EMAIL PROTECTED], , <[EMAIL PROTECTED]>
Message-ID: <[EMAIL PROTECTED]>


The current pci_assign_unassigned_resources() code doesn't work properly
on 32 bits platforms with 64 bits resources. The main reason is the use
of unsigned long in various places instead of resource_size_t.

This fixes it, along with some tricks to avoid casting to 64 bits on
platforms that don't need it in every printk around.

This is a pre-requisite for making powerpc use the generic code instead of
its own half-useful implementation.

Signed-off-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>

---
 drivers/pci/setup-bus.c |   64 ++--
 include/linux/pci.h |4 +--
 2 files changed, 42 insertions(+), 26 deletions(-)

--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -89,8 +89,9 @@ void pci_setup_cardbus(struct pci_bus *b
 * The IO resource is allocated a range twice as large as it
 * would normally need.  This allows us to set both IO regs.
 */
-   printk("  IO window: %08lx-%08lx\n",
-   region.start, region.end);
+   printk(KERN_INFO "  IO window: 0x%08lx-0x%08lx\n",
+  (unsigned long)region.start,
+  (unsigned long)region.end);
pci_write_config_dword(bridge, PCI_CB_IO_BASE_0,
region.start);
pci_write_config_dword(bridge, PCI_CB_IO_LIMIT_0,
@@ -99,8 +100,9 @@ void pci_setup_cardbus(struct pci_bus *b
 
pcibios_resource_to_bus(bridge, ®ion, bus->resource[1]);
if (bus->resource[1]->flags & IORESOURCE_IO) {
-   printk("  IO window: %08lx-%08lx\n",
-   region.start, region.end);
+   printk(KERN_INFO "  IO window: 0x%08lx-0x%08lx\n",
+  (unsigned long)region.start,
+  (unsigned long)region.end);
pci_write_config_dword(bridge, PCI_CB_IO_BASE_1,
region.start);
pci_write_config_dword(bridge, PCI_CB_IO_LIMIT_1,
@@ -109,8 +111,9 @@ void pci_setup_cardbus(struct pci_bus *b
 
pcibios_resource_to_bus(bridge, ®ion, bus->resource[2]);
if (bus->resource[2]->flags & IORESOURCE_MEM) {
-   printk("  PREFETCH window: %08lx-%08lx\n",
-   region.start, region.end);
+   printk(KERN_INFO "  PREFETCH window: 0x%08lx-0x%08lx\n",
+  (unsigned long)region.start,
+  (unsigned long)region.end);
pci_write_config_dword(bridge, PCI_CB_MEMORY_BASE_0,
region.start);
pci_write_config_dword(bridge, PCI_CB_MEMORY_LIMIT_0,
@@ -119,8 +122,9 @@ void pci_setup_cardbus(struct pci_bus *b
 
pcibios_resource_to_bus(bridge, ®ion, bus->resource[3]);
if (bus->resource[3]->flags & IORESOURCE_MEM) {
-   printk("  MEM window: %08lx-%08lx\n",
-   region.start, region.end);
+   printk(KERN_INFO "  MEM window: 0x%08lx-0x%08lx\n",
+  (unsigned long)region.start,
+  (unsigned long)region.end);
pci_write_config_dword(bridge, PCI_CB_MEMORY_BASE_1,
region.start);
pci_write_config_dword(bridge, PCI_CB_MEMORY_LIMIT_1,
@@ -145,7 +149,7 @@ pci_setup_bridge(struct pci_bus *bus)
 {
struct pci_dev *bridge = bus->self;
struct pci_bus_region region;
-   u32 l, io_upper16;
+   u32 l, bu, lu, io_upper16;
 
DBG(KERN_INFO "PCI: Bridge: %s\n", pci_name(bridge));
 
@@ -159,7 +163,8 @@ pci_setup_bridge(struct pci_bus *bus)
/* Set up upper 16 bits of I/O base/limit. */
io_upper16 = (region.end & 0x) | (region.start >> 16);
DBG(KERN_INFO "  IO window: %04lx-%04lx\n",
-   region.start, region.end);
+   (unsigned long)region.start,
+   (unsigned long)region.end);
}
else {
/* Clear upper 16 bits of I/O base/limit. */
@@ -180,8 +185,9 @@ pci_setup_bridge(struct pci_bus *bus)
if (bus->resource

Re: More patches added to for-2.6.25 and master branches of powerpc.git

2007-12-20 Thread Michael Neuling
Paulus,

Can you take the crash shutdown hook patches as well?

http://patchwork.ozlabs.org/linuxppc/patch?person=414&id=15546
http://patchwork.ozlabs.org/linuxppc/patch?person=414&id=15547

Mikey


In message <[EMAIL PROTECTED]> you wrote:
> Andre Detsch (1):
>   [POWERPC] cell: safer of_has_vicinity routine
> 
> Balbir Singh (1):
>   [POWERPC] Fake NUMA emulation for PowerPC
> 
> Benjamin Herrenschmidt (20):
>   [POWERPC] pci32: Remove bogus alignment message
>   [POWERPC] pci32: Use generic pci_assign_unassign_resources
>   [POWERPC] pci32: Remove PowerMac P2P bridge IO hack
>   [POWERPC] pci32: Add flags modifying the PCI code behaviour
>   [POWERPC] pci32: Remove obsolete PowerMac bus number hack
>   [POWERPC] pci32: Add platform option to enable /proc PCI domains
>   [POWERPC] Merge pcibios_resource_to_bus/bus_to_resource
>   [POWERPC] Merge PCI resource fixups
>   [POWERPC] Merge PCI resource allocation & assignment
>   [POWERPC] fix iSeries PCI resource management
>   [POWERPC] Updates/fixes to 32 bits pcibios_enable_device()
>   [POWERPC] Merge 32 and 64 bits pcibios_enable_device
>   [POWERPC] Fixup powermac enable device hook
>   [POWERPC] Clear pci_probe_only on 64 bits PowerMac
>   [POWERPC] Various fixes to pcibios_enable_device()
>   [POWERPC] Enable self-view of the HT host bridge on PowerMac G5
>   [POWERPC] Improve resource setup of PowerMac G5 HT bridge
>   [POWERPC] Fixup skipping of PowerMac PCI<->PCI bridge "closed" resource
s
>   [POWERPC] Disable PCI IO/Mem on a device when resources can't be alloca
ted
>   [POWERPC] Fix PCI IRQ fallback code to not map IRQ 0
> 
> Bob Nelson (1):
>   [POWERPC] OProfile: fix cbe pm signal routing problem
> 
> Cyrill Gorcunov (1):
>   [POWERPC] CHRP: Fix possible NULL pointer dereference
> 
> David Gibson (2):
>   [POWERPC] Merge dtc upstream source
>   [POWERPC] Use embedded dtc in kernel builds
> 
> Grant Likely (1):
>   [POWERPC] Add machine initcall macros
> 
> Ishizaki Kou (3):
>   [POWERPC] cell: add missing '\n'
>   [POWERPC] Cleanup calling mmio_nvram_init
>   [POWERPC] celleb: Split machine definition
> 
> Jeremy Kerr (6):
>   [POWERPC] cell: export force_sig_info()
>   [POWERPC] cell: handle kernel SLB setup in spu_base.c
>   [POWERPC] cell: use spu_load_slb for SLB setup
>   [POWERPC] cell: add spu_64k_pages_available() check
>   [POWERPC] cell: handle SPE kernel mappings that cross segment boundarie
s
>   [POWERPC] cell: catch errors from sysfs_create_group()
> 
> Jochen Friedrich (2):
>   [POWERPC] Add support for PORTA and PORTB odr registers
>   [POWERPC] Move CPM command handling into the cpm drivers
> 
> Johannes Berg (3):
>   [POWERPC] adb: Replace sleep notifier with platform driver suspend/resu
me hooks
>   [POWERPC] via-pmu: Kill sleep notifiers completely
>   [POWERPC] powermac: Use generic suspend code
> 
> Jon Loeliger (3):
>   [POWERPC] 8xxx: Convert #include of asm/of_{platform, device}.h into li
nux/of_{platform, device}.h.
>   [POWERPC] 86xx: Add aliases node to 8641hpcn DTS file.
>   [POWERPC] cell: Convert #include of asm/of_{platform, device}.h into li
nux/of_{platform, device}.h.
> 
> Julia Lawall (3):
>   [POWERPC] arch/ppc: Remove an unnecessary pci_dev_put
>   [POWERPC] arch/powerpc: Add missing of_node_put
>   [POWERPC] cell/cbe_regs.c: Add missing of_node_put
> 
> Kevin Corry (1):
>   [POWERPC] perfmon2: make pm_interval register read/write
> 
> Kumar Gala (5):
>   [POWERPC] Add SPRN for Embedded registers specified in PowerISA 2.04
>   [POWERPC] Emulate isel (Integer Select) instruction
>   [POWERPC] FSL: I2C device tree cleanups
>   [POWERPC] FSL: enet device tree cleanups
>   [POWERPC] FSL: Added aliases node to device trees
> 
> Li Yang (5):
>   [POWERPC] add e300c4 entry to cputable
>   [POWERPC] ipic: add new interrupts introduced by new chip
>   [POWERPC] 83xx: Add platform support for MPC837x MDS board
>   [POWERPC] 83xx: Add MPC837x MDS default kernel configuration
>   [POWERPC] ipic: ack only for edge interrupts
> 
> Li Zefan (1):
>   [POWERPC] Don't cast a struct pointer to list_head pointer
> 
> Lucas Woods (2):
>   [POWERPC] arch/powerpc: Remove duplicate includes
>   [POWERPC] arch/ppc: Remove duplicate includes
> 
> Michael Ellerman (1):
>   [POWERPC] Implement pci_set_dma_mask() in terms of the dma_ops
> 
> Milton Miller (6):
>   [POWERPC] Push down or eliminate smp_processor_id calls in xics code
>   [POWERPC] init_decrementer_clockevent can be static __init
>   [POWERPC] Use __get_cpu_var in time.c
>   [POWERPC] Timer interrupt: use a struct for two per_cpu varables
>   [POWERPC] Depend on ->initialized in calc_steal_time
>   [POWERPC] Optimize account_system_vtime
> 
> Olof Johansson (3):
>   [POWERPC] MPIC: Minor optimizatio

Re: [PATCH 1/4] sbc8560: add basic support for Wind River SBC8560 as powerpc

2007-12-20 Thread Stephen Rothwell
Hi Paul,

Just a couple of comments.

On Thu, 20 Dec 2007 09:54:29 -0500 Paul Gortmaker <[EMAIL PROTECTED]> wrote:
>
> +++ b/arch/powerpc/platforms/85xx/sbc8560.c
> +static void cpm2_cascade(unsigned int irq, struct irq_desc *desc)
> +{
> + int cascade_irq;
> +
> + while ((cascade_irq = cpm2_get_irq()) >= 0) {
> + generic_handle_irq(cascade_irq);
> + }

The braces are unnecessary.

> +static void __init sbc8560_pic_init(void)
> +{
> + struct mpic *mpic;
> + struct resource r;
> + struct device_node *np = NULL;
> +#ifdef CONFIG_CPM2
> + int irq;
> +#endif
> +
> + np = of_find_node_by_type(np, "open-pic");
> +
> + if (np == NULL) {

We often say "if (!np)" and leave out the blank line above.

> + if(of_address_to_resource(np, 0, &r)) {
  ^
Put a space here.

> +#ifdef CONFIG_CPM2
> + /* Setup CPM2 PIC */
> + np = of_find_compatible_node(NULL, NULL, "fsl,cpm2-pic");
> + if (np == NULL) {
> + printk(KERN_ERR "PIC init: can not find fsl,cpm2-pic node\n");
> + return;
> + }
> + irq = irq_of_parse_and_map(np, 0);
> +
> + cpm2_pic_init(np);

Need an of_node_pit(np) - cpm2_pic_init() does its own of_node_get.

> +static struct cpm_pin sbc8560_pins[] = {

const?

-- 
Cheers,
Stephen Rothwell[EMAIL PROTECTED]
http://www.canb.auug.org.au/~sfr/


pgpNxS42SAQNy.pgp
Description: PGP signature
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: [PATCH] ASoC drivers for the Freescale MPC8610 SoC

2007-12-20 Thread Jon Smirl
On 12/20/07, Scott Wood <[EMAIL PROTECTED]> wrote:
> Timur Tabi wrote:
> > Jon Smirl wrote:
> >
> >> mpc5200 does it like this:
> >> of_platform_bus_probe(NULL, NULL, NULL);
> >
> > I think that tells the OF base code to probe everything in the device tree,
> > which is probably overkill.  I think fsl_soc.c covers most of the device 
> > tree,
> > but the SSI is not defined in fsl_soc.c.
>
> Not quite; it tells it to use a built-in list of bus matches.  Most of
> which are device_type-based, FWIW.

Here's the default. Using NULL would work.

static struct of_device_id of_default_bus_ids[] = {
{ .type = "soc", },
{ .compatible = "soc", },
{ .type = "spider", },
{ .type = "axon", },
{ .type = "plb5", },
{ .type = "plb4", },
{ .type = "opb", },
{ .type = "ebc", },
{},
};


>
> -Scott
>


-- 
Jon Smirl
[EMAIL PROTECTED]
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [spi-devel-general] [PATCH v2 3/4] [POWERPC][SPI] use brg-frequency for SPI in QE

2007-12-20 Thread David Brownell
On Thursday 20 December 2007, Anton Vorontsov wrote:
> In case of QE we can use brg-frequency (which is qeclk/2).
> Thus no need to divide sysclk in the spi_mpc83xx.
> 
> This patch also adds code to use get_brgfreq() on QE chips.
> 
> Signed-off-by: Anton Vorontsov <[EMAIL PROTECTED]>
> ---
>  arch/powerpc/sysdev/fsl_soc.c |   37 -
>  drivers/spi/spi_mpc83xx.c     |    6 +-
>  2 files changed, 25 insertions(+), 18 deletions(-)

For the SPI parts:

Acked-by: David Brownell <[EMAIL PROTECTED]>

Though it all looks a bit confusing to me, and I wonder
if the OF docs would make it less so.

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] ASoC drivers for the Freescale MPC8610 SoC

2007-12-20 Thread Scott Wood
Timur Tabi wrote:
> Jon Smirl wrote:
> 
>> mpc5200 does it like this:
>> of_platform_bus_probe(NULL, NULL, NULL);
> 
> I think that tells the OF base code to probe everything in the device tree, 
> which is probably overkill.  I think fsl_soc.c covers most of the device 
> tree, 
> but the SSI is not defined in fsl_soc.c.

Not quite; it tells it to use a built-in list of bus matches.  Most of 
which are device_type-based, FWIW.

-Scott
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] ASoC drivers for the Freescale MPC8610 SoC

2007-12-20 Thread Scott Wood
Timur Tabi wrote:
> Olof Johansson wrote:
> 
>>> I was just following the example from another board file.  However, the 
>>> 'soc' 
>>> node in the device tree does not have a compatible property, so I don't how 
>>> to 
>>> change this.
>> Then add an appropriate compatible entry to it, please.
> 
> None of the SOC nodes in any DTS have a "compatible" entry.

Not quite true; ep88xc, mpc8272ads, and pq2fads have them.

-Scott
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] ASoC drivers for the Freescale MPC8610 SoC

2007-12-20 Thread Timur Tabi
Jon Smirl wrote:

> mpc5200 does it like this:
> of_platform_bus_probe(NULL, NULL, NULL);

I think that tells the OF base code to probe everything in the device tree, 
which is probably overkill.  I think fsl_soc.c covers most of the device tree, 
but the SSI is not defined in fsl_soc.c.

-- 
Timur Tabi
Linux kernel developer at Freescale
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] ASoC drivers for the Freescale MPC8610 SoC

2007-12-20 Thread Jon Smirl
On 12/20/07, Timur Tabi <[EMAIL PROTECTED]> wrote:
> Jon Smirl wrote:
>
> > How is of_platform_bus_probe() supposed to be called? mpc5200/virtex
> > call it with three NULLs. Is it necessary to name all of the buses in
> > a of_device_id? If it's not necessary to list the buses the
> > of_platform_bus_probe() call could be moved to common code.
>
> I added the above code because it is the only way I could get my SSI nodes to 
> be
> probed.  If there's a better way to do it, I'm all ears.  I just copied that
> code from the mpc836x_mds.c platform file.

mpc5200 does it like this:
of_platform_bus_probe(NULL, NULL, NULL);

No need for the ids.


>
> > Are these buses?
> > { .compatible = "ibm,plb4", },
> > { .compatible = "ibm,opb", },
> > { .compatible = "ibm,ebc", },
>
> I have no idea.
>
> > Could of_platform_bus_probe() be simplified? No one uses the first and
> > third parameters.
>
> Maybe, but that's not a discussion for this thread!
>
> --
> Timur Tabi
> Linux kernel developer at Freescale
>


-- 
Jon Smirl
[EMAIL PROTECTED]
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] ASoC drivers for the Freescale MPC8610 SoC

2007-12-20 Thread Timur Tabi
Olof Johansson wrote:

>> I was just following the example from another board file.  However, the 
>> 'soc' 
>> node in the device tree does not have a compatible property, so I don't how 
>> to 
>> change this.
> 
> Then add an appropriate compatible entry to it, please.

None of the SOC nodes in any DTS have a "compatible" entry.  I understand the 
issue, but you're asking me to fix a larger problem, one that is beyond the 
scope of this patch.  You're saying that *all* SOC needs are incorrectly 
defined 
and need to be probed differently.

-- 
Timur Tabi
Linux kernel developer at Freescale
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] ASoC drivers for the Freescale MPC8610 SoC

2007-12-20 Thread Olof Johansson
On Thu, Dec 20, 2007 at 08:24:35AM -0600, Timur Tabi wrote:
> Olof Johansson wrote:
> 
> >> +static struct of_device_id mpc8610_ids[] = {
> >> +  { .type = "soc", },
> >> +  {}
> > 
> > Please scan based on compatible instead of device_type.
> 
> I was just following the example from another board file.  However, the 'soc' 
> node in the device tree does not have a compatible property, so I don't how 
> to 
> change this.

Then add an appropriate compatible entry to it, please.

> > Do you ever anticipate having other dma users on the system, such as
> > memcpy offload? You'll probably need allocation support for channels
> > when that day comes (I ended up writing a simple library for dma channel
> > management for that very reason on my platform).
> 
> Yes, I plan on updating this driver to work with the standard Freescale "Elo" 
> device driver, but that will have to wait until that code is in the kernel 
> and 
> stabilized.  The SSI is limited in which DMA channels it can use, anyway.

Ok.


-Olof
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] ASoC drivers for the Freescale MPC8610 SoC

2007-12-20 Thread Timur Tabi
Jon Smirl wrote:

> How is of_platform_bus_probe() supposed to be called? mpc5200/virtex
> call it with three NULLs. Is it necessary to name all of the buses in
> a of_device_id? If it's not necessary to list the buses the
> of_platform_bus_probe() call could be moved to common code.

I added the above code because it is the only way I could get my SSI nodes to 
be 
probed.  If there's a better way to do it, I'm all ears.  I just copied that 
code from the mpc836x_mds.c platform file.

> Are these buses?
> { .compatible = "ibm,plb4", },
> { .compatible = "ibm,opb", },
> { .compatible = "ibm,ebc", },

I have no idea.

> Could of_platform_bus_probe() be simplified? No one uses the first and
> third parameters.

Maybe, but that's not a discussion for this thread!

-- 
Timur Tabi
Linux kernel developer at Freescale
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] ASoC drivers for the Freescale MPC8610 SoC

2007-12-20 Thread Jon Smirl
On 12/19/07, Timur Tabi <[EMAIL PROTECTED]> wrote:

> +static struct of_device_id mpc8610_ids[] = {
> +   { .type = "soc", },
> +   {}
> +};
> +
> +static int __init mpc8610_declare_of_platform_devices(void)
> +{
> +   if (!machine_is(mpc86xx_hpcd))
> +   return 0;
> +
> +   /* Without this call, the SSI device driver won't get probed. */
> +   of_platform_bus_probe(NULL, mpc8610_ids, NULL);
> +
> +   return 0;
> +}
> +device_initcall(mpc8610_declare_of_platform_devices);

How is of_platform_bus_probe() supposed to be called? mpc5200/virtex
call it with three NULLs. Is it necessary to name all of the buses in
a of_device_id? If it's not necessary to list the buses the
of_platform_bus_probe() call could be moved to common code.

Are these buses?
{ .compatible = "ibm,plb4", },
{ .compatible = "ibm,opb", },
{ .compatible = "ibm,ebc", },

Could of_platform_bus_probe() be simplified? No one uses the first and
third parameters.

-- 
Jon Smirl
[EMAIL PROTECTED]
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: Oops: Kernel access of bad area

2007-12-20 Thread Nathan Lynch
Christian Kujau wrote:
> Hi,
> 
> I started some x11 application (here: firefox) through an ssh connection 
> on a remote host and it crashed somehow. OK, no biggie, killed the 
> application and be done with it. However, I noticed that the load of the 
> machine is now constantly at 7. It's an iBook G4, has nothing to do, 
> disks, cpu, netwokr is idle and load is usually < 1. Now it's not
> slow to work or anyhow sluggish, but only the load is at 7 after the 
> application crashed. When I looked into dmesg I saw:
> 
> [84983.750977] Unable to handle kernel paging request for data at address 
> 0x4815d000
> [84983.751046] Faulting instruction address: 0xc0012090
> [84983.751157] Oops: Kernel access of bad area, sig: 11 [#1]
> [84983.751178] PREEMPT PowerMac
> [84983.751214] Modules linked in: nls_iso8859_15 nls_cp850 vfat fat isofs 
> nls_base zlib_inflate radeon drm snd_powermac snd_pcm snd_timer snd soundcore 
> snd_page_alloc fuse firewire_ohci firewire_core crc_itu_t ide_cd cdrom ssb 
> bcm43xx rng_core ieee80211softmac uninorth_agp ieee80211 ieee80211_crypt 
> agpgart
> [84983.751750] NIP: c0012090 LR: c00165fc CTR: 0080
> [84983.751786] REGS: cea65b30 TRAP: 0300   Not tainted  (2.6.24-rc5)
> [84983.751805] MSR: 9032   CR: 24822282  XER: 
> [84983.751946] DAR: 4815d000, DSISR: 4000
> [84983.751965] TASK = ee372670[9138] 'firefox-bin' THREAD: cea64000
> [84983.751984] GPR00: e62b3a00 cea65be0 ee372670 4815d000 0080 1bc0c181 
> 4815d000 
> [84983.752148] GPR08: 00010008 e62b3a00  c045f000 24822288 1002ea3c 
> cea67690 ce954000
> [84983.752315] GPR16: c042 c03f6400 cea65cac cea65ca8 c044 ce974480 
> c07d7180 ceba2280
> [84983.752468] GPR24: e62b3a00 e62b3a50 4815d000 0574 ceba2280 4815d000 
> 1bc0c181 c07d7180
> [84983.752665] NIP [c0012090] __flush_dcache_icache+0x14/0x40
> [84983.752716] LR [c00165fc] update_mmu_cache+0x11c/0x120

Better to include the full stack trace in such reports, but here it
is:

 NIP [c0012090] __flush_dcache_icache+0x14/0x40
 LR [c00165fc] update_mmu_cache+0x11c/0x120
 Call Trace:
 [cea65be0] [ce8c1000] 0xce8c1000 (unreliable)
 [cea65c00] [c0075868] handle_mm_fault+0x39c/0x7f8
 [cea65c50] [c0075dec] get_user_pages+0x128/0x398
 [cea65ca0] [c00c5e18] elf_core_dump+0xb64/0xc28
 [cea65d40] [c0091e64] do_coredump+0x754/0x788
 [cea65e50] [c003cb20] get_signal_to_deliver+0x2dc/0x3fc
 [cea65e80] [c000a678] do_signal+0x48/0x28c
 [cea65f40] [c0012cb4] do_user_signal+0x74/0xc4
 --- Exception: c00 at 0xfd36ea4
 LR = 0x10012018
 Instruction dump:
 4d820020 7c8903a6 7c001bac 38630020 4200fff8 7c0004ac 4e800020 6000
 54630026 38800080 7c8903a6 7c661b78 <7c00186c> 38630020 4200fff8 7c0004ac

So it looks like the kernel oopsed while firefox was dumping core,
yuck.

> This is the first time that this happened on this iBook, and it was not 
> reproducible so far (well, it happened just a few minutes ago). Is this 
> something to worry about? Or should I file this under "well, shit 
> happens"?

It's a real bug.  Hopefully someone on the list can help...
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[RESEND DTC PATCH 2/2] Add support for binary includes.

2007-12-20 Thread Scott Wood
A property's data can be populated with a file's contents
as follows:

node {
prop = /bin-include/ "path/to/data";
};

Search paths are not yet implemented; non-absolute lookups are relative to
the directory from which dtc was invoked.

Signed-off-by: Scott Wood <[EMAIL PROTECTED]>
---
Apologies if you get this twice, but AFAICT the original got eaten by our
mail server.

 dtc-lexer.l  |6 ++
 dtc-parser.y |   26 ++
 dtc.h|1 +
 3 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/dtc-lexer.l b/dtc-lexer.l
index c811b22..1f3e6d6 100644
--- a/dtc-lexer.l
+++ b/dtc-lexer.l
@@ -190,6 +190,12 @@ static int dts_version; /* = 0 */
return DT_PROPNODENAME;
}
 
+"/bin-include/"{
+   yylloc.filenum = srcpos_filenum;
+   yylloc.first_line = yylineno;
+   DPRINT("Binary Include\n");
+   return DT_BININCLUDE;
+   }
 
 <*>[[:space:]]+/* eat whitespace */
 
diff --git a/dtc-parser.y b/dtc-parser.y
index 4a0181d..c7ed715 100644
--- a/dtc-parser.y
+++ b/dtc-parser.y
@@ -21,6 +21,8 @@
 %locations
 
 %{
+#include 
+
 #include "dtc.h"
 #include "srcpos.h"
 
@@ -58,6 +60,7 @@ extern struct boot_info *the_boot_info;
 %token  DT_STRING
 %token  DT_LABEL
 %token  DT_REF
+%token DT_BININCLUDE
 
 %type  propdata
 %type  propdataprefix
@@ -196,6 +199,29 @@ propdata:
{
$$ = data_add_marker($1, REF_PATH, $2);
}
+   | propdataprefix DT_BININCLUDE DT_STRING
+   {
+   struct stat st;
+   FILE *f;
+   int fd;
+   
+   f = fopen($3.val, "rb");
+   if (!f) {
+   yyerrorf("Cannot open file \"%s\": %s",
+$3.val, strerror(errno));
+   YYERROR;
+   }
+
+   fd = fileno(f);
+   if (fstat(fd, &st) < 0) {
+   yyerrorf("Cannot stat file \"%s\": %s",
+$3.val, strerror(errno));
+   YYERROR;
+   }
+
+   $$ = data_merge($1, data_copy_file(f, st.st_size));
+   fclose(f);
+   }
| propdata DT_LABEL
{
$$ = data_add_marker($1, LABEL, $2);
diff --git a/dtc.h b/dtc.h
index 9b89689..87b5bb1 100644
--- a/dtc.h
+++ b/dtc.h
@@ -138,6 +138,7 @@ struct data data_grow_for(struct data d, int xlen);
 struct data data_copy_mem(const char *mem, int len);
 struct data data_copy_escape_string(const char *s, int len);
 struct data data_copy_file(FILE *f, size_t len);
+struct data data_bin_include(const char *filename);
 
 struct data data_append_data(struct data d, const void *p, int len);
 struct data data_insert_at_marker(struct data d, struct marker *m,
-- 
1.5.3
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 4/4] sbc8560: Add default .config file for Wind River SBC8560

2007-12-20 Thread Paul Gortmaker
This is a suitable .config file for building the WRS SBC8560 kernel
to be used for NFS root via one of the TSEC interfaces and with
serial console via the 16550 compatible UART on the board.

Signed-off-by: Paul Gortmaker <[EMAIL PROTECTED]>
---
 arch/powerpc/configs/sbc8560_defconfig |  764 
 1 files changed, 764 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/configs/sbc8560_defconfig 
b/arch/powerpc/configs/sbc8560_defconfig
new file mode 100644
index 000..5d13e22
--- /dev/null
+++ b/arch/powerpc/configs/sbc8560_defconfig
@@ -0,0 +1,764 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.24-rc4
+# Wed Dec 19 15:46:40 2007
+#
+# CONFIG_PPC64 is not set
+
+#
+# Processor support
+#
+# CONFIG_6xx is not set
+CONFIG_PPC_85xx=y
+# CONFIG_PPC_8xx is not set
+# CONFIG_40x is not set
+# CONFIG_44x is not set
+# CONFIG_E200 is not set
+CONFIG_85xx=y
+CONFIG_E500=y
+CONFIG_BOOKE=y
+CONFIG_FSL_BOOKE=y
+# CONFIG_PHYS_64BIT is not set
+CONFIG_SPE=y
+# CONFIG_PPC_MM_SLICES is not set
+CONFIG_PPC32=y
+CONFIG_WORD_SIZE=32
+CONFIG_PPC_MERGE=y
+CONFIG_MMU=y
+CONFIG_GENERIC_CMOS_UPDATE=y
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_TIME_VSYSCALL=y
+CONFIG_GENERIC_CLOCKEVENTS=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_ARCH_NO_VIRT_TO_BUS is not set
+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_OF=y
+CONFIG_PPC_UDBG_16550=y
+# CONFIG_GENERIC_TBSYNC is not set
+CONFIG_AUDIT_ARCH=y
+CONFIG_GENERIC_BUG=y
+CONFIG_DEFAULT_UIMAGE=y
+# CONFIG_PPC_DCR_NATIVE is not set
+# CONFIG_PPC_DCR_MMIO is not set
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_USER_NS is not set
+# CONFIG_PID_NS is not set
+# CONFIG_AUDIT is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+CONFIG_FAIR_GROUP_SCHED=y
+CONFIG_FAIR_USER_SCHED=y
+# CONFIG_FAIR_CGROUP_SCHED 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_ANON_INODES=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+CONFIG_RT_MUTEXES=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+# CONFIG_MODULES is not set
+CONFIG_BLOCK=y
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG 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_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_MPC8540_ADS is not set
+# CONFIG_MPC8560_ADS is not set
+# CONFIG_MPC85xx_CDS is not set
+# CONFIG_MPC85xx_MDS is not set
+# CONFIG_MPC85xx_DS is not set
+CONFIG_SBC8560=y
+CONFIG_MPC8560=y
+CONFIG_MPC85xx=y
+CONFIG_MPIC=y
+# CONFIG_MPIC_WEIRD is not set
+# 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
+# CONFIG_CPU_FREQ is not set
+# CONFIG_CPM2 is not set
+# CONFIG_FSL_ULI1575 is not set
+
+#
+# Kernel options
+#
+# CONFIG_HIGHMEM is not set
+# CONFIG_TICK_ONESHOT is not set
+# CONFIG_NO_HZ is not set
+# CONFIG_HIGH_RES_TIMERS is not set
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+# 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_MATH_EMULATION is not set
+CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_POPULATES_NODE_MAP=y
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFI

Re: [PATCH 11/20] [POWERPC] Wire up PCI on Bamboo board

2007-12-20 Thread Benjamin Herrenschmidt

On Thu, 2007-12-20 at 23:26 +0300, Valentine Barshak wrote:

> Just checked the ppc440ep user manual again.
> Special cycle/IACK registers are at 0xeed0 instead of 0xeed8.
> Looks like the same typo as in the internal registers.
> It works because all these registers are mirrored at 0x8 offset 
> (though it's claimed to be a reserved region).

Well, as for IACK, it also probably works because nobody uses it :-) I
put it in the device-tree for completeness (and in case somebody ever
uses it) but so far, nobody does and there is no proper interface to
expose it in linux.

Ben.


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH v2 4/4] [POWERPC] fsl_spi_init and users: stop using device_type = "spi"

2007-12-20 Thread Anton Vorontsov
..also rename "fsl_spi" to "fsl,spi" and add cell-index property.

Per http://ozlabs.org/pipermail/linuxppc-dev/2007-December/048388.html

Signed-off-by: Anton Vorontsov <[EMAIL PROTECTED]>
---
 arch/powerpc/boot/dts/mpc8313erdb.dts|4 ++--
 arch/powerpc/boot/dts/mpc832x_mds.dts|8 
 arch/powerpc/boot/dts/mpc832x_rdb.dts|8 
 arch/powerpc/boot/dts/mpc8349emitx.dts   |4 ++--
 arch/powerpc/boot/dts/mpc8349emitxgp.dts |4 ++--
 arch/powerpc/boot/dts/mpc834x_mds.dts|4 ++--
 arch/powerpc/boot/dts/mpc836x_mds.dts|8 
 arch/powerpc/boot/dts/mpc8568mds.dts |8 
 arch/powerpc/sysdev/fsl_soc.c|   23 +--
 9 files changed, 41 insertions(+), 30 deletions(-)

diff --git a/arch/powerpc/boot/dts/mpc8313erdb.dts 
b/arch/powerpc/boot/dts/mpc8313erdb.dts
index c5b6665..a0492b6 100644
--- a/arch/powerpc/boot/dts/mpc8313erdb.dts
+++ b/arch/powerpc/boot/dts/mpc8313erdb.dts
@@ -82,8 +82,8 @@
};
 
[EMAIL PROTECTED] {
-   device_type = "spi";
-   compatible = "fsl_spi";
+   cell-index = <0>;
+   compatible = "fsl,spi";
reg = <7000 1000>;
interrupts = <10 8>;
interrupt-parent = < &ipic >;
diff --git a/arch/powerpc/boot/dts/mpc832x_mds.dts 
b/arch/powerpc/boot/dts/mpc832x_mds.dts
index 8844d30..36ecd39 100644
--- a/arch/powerpc/boot/dts/mpc832x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc832x_mds.dts
@@ -193,8 +193,8 @@
};
 
[EMAIL PROTECTED] {
-   device_type = "spi";
-   compatible = "fsl_spi";
+   cell-index = <0>;
+   compatible = "fsl,spi";
reg = <4c0 40>;
interrupts = <2>;
interrupt-parent = < &qeic >;
@@ -202,8 +202,8 @@
};
 
[EMAIL PROTECTED] {
-   device_type = "spi";
-   compatible = "fsl_spi";
+   cell-index = <1>;
+   compatible = "fsl,spi";
reg = <500 40>;
interrupts = <1>;
interrupt-parent = < &qeic >;
diff --git a/arch/powerpc/boot/dts/mpc832x_rdb.dts 
b/arch/powerpc/boot/dts/mpc832x_rdb.dts
index a7a2e45..ce63b13 100644
--- a/arch/powerpc/boot/dts/mpc832x_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc832x_rdb.dts
@@ -183,8 +183,8 @@
};
 
[EMAIL PROTECTED] {
-   device_type = "spi";
-   compatible = "fsl_spi";
+   cell-index = <0>;
+   compatible = "fsl,spi";
reg = <4c0 40>;
interrupts = <2>;
interrupt-parent = <&qeic>;
@@ -192,8 +192,8 @@
};
 
[EMAIL PROTECTED] {
-   device_type = "spi";
-   compatible = "fsl_spi";
+   cell-index = <1>;
+   compatible = "fsl,spi";
reg = <500 40>;
interrupts = <1>;
interrupt-parent = <&qeic>;
diff --git a/arch/powerpc/boot/dts/mpc8349emitx.dts 
b/arch/powerpc/boot/dts/mpc8349emitx.dts
index e354f26..f8fc5f6 100644
--- a/arch/powerpc/boot/dts/mpc8349emitx.dts
+++ b/arch/powerpc/boot/dts/mpc8349emitx.dts
@@ -82,8 +82,8 @@
};
 
[EMAIL PROTECTED] {
-   device_type = "spi";
-   compatible = "fsl_spi";
+   cell-index = <0>;
+   compatible = "fsl,spi";
reg = <7000 1000>;
interrupts = <10 8>;
interrupt-parent = < &ipic >;
diff --git a/arch/powerpc/boot/dts/mpc8349emitxgp.dts 
b/arch/powerpc/boot/dts/mpc8349emitxgp.dts
index ebdf0b7..50c 100644
--- a/arch/powerpc/boot/dts/mpc8349emitxgp.dts
+++ b/arch/powerpc/boot/dts/mpc8349emitxgp.dts
@@ -80,8 +80,8 @@
};
 
[EMAIL PROTECTED] {
-   device_type = "spi";
-   compatible = "fsl_spi";
+   cell-index = <0>;
+   compatible = "fsl,spi";
reg = <7000 1000>;
interrupts = <10 8>;
interrupt-parent = < &ipic >;
diff --git a/arch/powerpc/boot/dts/mpc834x_mds.dts 
b/arch/powerpc/boot/dts/mpc834x_mds.dts
index 0ba13eb..6ed36a1 100644
--- a/arch/powerpc/boot/dts/mpc834x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc834x_mds.dts
@@ -93,8 +93,8 @@
};
 
[EMAIL PROTECTED] {
-   device_type = "spi";
-   compatible = "fsl_spi";
+  

[PATCH v2 3/4] [POWERPC][SPI] use brg-frequency for SPI in QE

2007-12-20 Thread Anton Vorontsov
In case of QE we can use brg-frequency (which is qeclk/2).
Thus no need to divide sysclk in the spi_mpc83xx.

This patch also adds code to use get_brgfreq() on QE chips.

Signed-off-by: Anton Vorontsov <[EMAIL PROTECTED]>
---
 arch/powerpc/sysdev/fsl_soc.c |   37 -
 drivers/spi/spi_mpc83xx.c |6 +-
 2 files changed, 25 insertions(+), 18 deletions(-)

diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index 60d9c4e..f04d5cc 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -66,7 +66,7 @@ phys_addr_t get_immrbase(void)
 
 EXPORT_SYMBOL(get_immrbase);
 
-#if defined(CONFIG_CPM2) || defined(CONFIG_8xx)
+#if defined(CONFIG_CPM2) || defined(CONFIG_QUICC_ENGINE) || defined(CONFIG_8xx)
 
 static u32 brgfreq = -1;
 
@@ -91,6 +91,11 @@ u32 get_brgfreq(void)
 
/* Legacy device binding -- will go away when no users are left. */
node = of_find_node_by_type(NULL, "cpm");
+   if (!node)
+   node = of_find_compatible_node(NULL, NULL, "fsl,qe");
+   if (!node)
+   node = of_find_node_by_type(NULL, "qe");
+
if (node) {
prop = of_get_property(node, "brg-frequency", &size);
if (prop && size == 4)
@@ -1223,22 +1228,26 @@ int __init fsl_spi_init(struct spi_board_info 
*board_infos,
 {
struct device_node *np;
unsigned int i;
-   const u32 *sysclk;
+   u32 sysclk;
 
/* SPI controller is either clocked from QE or SoC clock */
-   np = of_find_compatible_node(NULL, NULL, "fsl,qe");
-   if (!np)
-   np = of_find_node_by_type(NULL, "qe");
+   sysclk = get_brgfreq();
+   if (sysclk == -1) {
+   const u32 *prop;
 
-   if (!np)
np = of_find_node_by_type(NULL, "soc");
+   if (!np)
+   return -ENODEV;
 
-   if (!np)
-   return -ENODEV;
+   prop = of_get_property(np, "bus-frequency", NULL);
+   if (!prop) {
+   of_node_put(np);
+   return -ENODEV;
+   }
 
-   sysclk = of_get_property(np, "bus-frequency", NULL);
-   if (!sysclk)
-   return -ENODEV;
+   sysclk = *prop;
+   of_node_put(np);
+   }
 
for (np = NULL, i = 1;
 (np = of_find_compatible_node(np, "spi", "fsl_spi")) != NULL;
@@ -1255,7 +1264,7 @@ int __init fsl_spi_init(struct spi_board_info 
*board_infos,
 
memset(res, 0, sizeof(res));
 
-   pdata.sysclk = *sysclk;
+   pdata.sysclk = sysclk;
 
prop = of_get_property(np, "reg", NULL);
if (!prop)
@@ -1299,10 +1308,12 @@ int __init fsl_spi_init(struct spi_board_info 
*board_infos,
if (ret)
goto unreg;
 
-   continue;
+   goto next;
 unreg:
platform_device_del(pdev);
 err:
+next:
+   of_node_put(np);
continue;
}
 
diff --git a/drivers/spi/spi_mpc83xx.c b/drivers/spi/spi_mpc83xx.c
index 4580b9c..04f7cd9 100644
--- a/drivers/spi/spi_mpc83xx.c
+++ b/drivers/spi/spi_mpc83xx.c
@@ -436,11 +436,7 @@ static int __init mpc83xx_spi_probe(struct platform_device 
*dev)
mpc83xx_spi->qe_mode = pdata->qe_mode;
mpc83xx_spi->get_rx = mpc83xx_spi_rx_buf_u8;
mpc83xx_spi->get_tx = mpc83xx_spi_tx_buf_u8;
-
-   if (mpc83xx_spi->qe_mode)
-   mpc83xx_spi->spibrg = pdata->sysclk / 2;
-   else
-   mpc83xx_spi->spibrg = pdata->sysclk;
+   mpc83xx_spi->spibrg = pdata->sysclk;
 
mpc83xx_spi->rx_shift = 0;
mpc83xx_spi->tx_shift = 0;
-- 
1.5.2.2

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH v2 2/4] [POWERPC][NET] ucc_geth_mii and users: get rid of device_type

2007-12-20 Thread Anton Vorontsov
device_type property is bogus, thus use proper compatible.

Also change compatible property to "fsl,ucc-mdio".

Per http://ozlabs.org/pipermail/linuxppc-dev/2007-December/048388.html

Signed-off-by: Anton Vorontsov <[EMAIL PROTECTED]>
---
 arch/powerpc/boot/dts/mpc832x_mds.dts |3 +--
 arch/powerpc/boot/dts/mpc832x_rdb.dts |3 +--
 arch/powerpc/boot/dts/mpc836x_mds.dts |3 +--
 arch/powerpc/boot/dts/mpc8568mds.dts  |2 +-
 drivers/net/ucc_geth_mii.c|3 +++
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/boot/dts/mpc832x_mds.dts 
b/arch/powerpc/boot/dts/mpc832x_mds.dts
index 588d658..8844d30 100644
--- a/arch/powerpc/boot/dts/mpc832x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc832x_mds.dts
@@ -255,8 +255,7 @@
#address-cells = <1>;
#size-cells = <0>;
reg = <2320 18>;
-   device_type = "mdio";
-   compatible = "ucc_geth_phy";
+   compatible = "fsl,ucc-mdio";
 
phy3: [EMAIL PROTECTED] {
interrupt-parent = < &ipic >;
diff --git a/arch/powerpc/boot/dts/mpc832x_rdb.dts 
b/arch/powerpc/boot/dts/mpc832x_rdb.dts
index 719f375..a7a2e45 100644
--- a/arch/powerpc/boot/dts/mpc832x_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc832x_rdb.dts
@@ -236,8 +236,7 @@
#address-cells = <1>;
#size-cells = <0>;
reg = <3120 18>;
-   device_type = "mdio";
-   compatible = "ucc_geth_phy";
+   compatible = "fsl,ucc-mdio";
 
phy00:[EMAIL PROTECTED] {
interrupt-parent = <&pic>;
diff --git a/arch/powerpc/boot/dts/mpc836x_mds.dts 
b/arch/powerpc/boot/dts/mpc836x_mds.dts
index 8d7124e..5f0b427 100644
--- a/arch/powerpc/boot/dts/mpc836x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc836x_mds.dts
@@ -288,8 +288,7 @@
#address-cells = <1>;
#size-cells = <0>;
reg = <2120 18>;
-   device_type = "mdio";
-   compatible = "ucc_geth_phy";
+   compatible = "fsl,ucc-mdio";
 
phy0: [EMAIL PROTECTED] {
interrupt-parent = < &ipic >;
diff --git a/arch/powerpc/boot/dts/mpc8568mds.dts 
b/arch/powerpc/boot/dts/mpc8568mds.dts
index 89add8d..ea70010 100644
--- a/arch/powerpc/boot/dts/mpc8568mds.dts
+++ b/arch/powerpc/boot/dts/mpc8568mds.dts
@@ -356,7 +356,7 @@
#address-cells = <1>;
#size-cells = <0>;
reg = <2120 18>;
-   compatible = "ucc_geth_phy";
+   compatible = "fsl,ucc-mdio";
 
/* These are the same PHYs as on
 * gianfar's MDIO bus */
diff --git a/drivers/net/ucc_geth_mii.c b/drivers/net/ucc_geth_mii.c
index df884f0..e3ba14a 100644
--- a/drivers/net/ucc_geth_mii.c
+++ b/drivers/net/ucc_geth_mii.c
@@ -256,6 +256,9 @@ static struct of_device_id uec_mdio_match[] = {
.type = "mdio",
.compatible = "ucc_geth_phy",
},
+   {
+   .compatible = "fsl,ucc-mdio",
+   },
{},
 };
 
-- 
1.5.2.2

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH v2 1/4] [POWERPC] qe_lib and users: get rid of device_type and model

2007-12-20 Thread Anton Vorontsov
Now we're searching for "fsl,qe", "fsl,qe-muram", "fsl,qe-muram-data".

Per http://ozlabs.org/pipermail/linuxppc-dev/2007-December/048388.html

Signed-off-by: Anton Vorontsov <[EMAIL PROTECTED]>
---
 arch/powerpc/boot/dts/mpc832x_mds.dts |7 ---
 arch/powerpc/boot/dts/mpc832x_rdb.dts |7 ---
 arch/powerpc/boot/dts/mpc836x_mds.dts |7 ---
 arch/powerpc/boot/dts/mpc8568mds.dts  |7 ---
 arch/powerpc/sysdev/fsl_soc.c |5 -
 arch/powerpc/sysdev/qe_lib/qe.c   |   16 +---
 6 files changed, 33 insertions(+), 16 deletions(-)

diff --git a/arch/powerpc/boot/dts/mpc832x_mds.dts 
b/arch/powerpc/boot/dts/mpc832x_mds.dts
index 26ac467..588d658 100644
--- a/arch/powerpc/boot/dts/mpc832x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc832x_mds.dts
@@ -175,18 +175,19 @@
[EMAIL PROTECTED] {
#address-cells = <1>;
#size-cells = <1>;
-   device_type = "qe";
-   model = "QE";
+   compatible = "fsl,qe";
ranges = <0 e010 0010>;
reg = ;
brg-frequency = <0>;
bus-frequency = ;
 
[EMAIL PROTECTED] {
-   device_type = "muram";
+   compatible = "fsl,qe-muram", "fsl,cpm-muram";
ranges = <0 0001 4000>;
 
[EMAIL PROTECTED] {
+   compatible = "fsl,qe-muram-data",
+"fsl,cpm-muram-data";
reg = <0 4000>;
};
};
diff --git a/arch/powerpc/boot/dts/mpc832x_rdb.dts 
b/arch/powerpc/boot/dts/mpc832x_rdb.dts
index 10ff7aa..719f375 100644
--- a/arch/powerpc/boot/dts/mpc832x_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc832x_rdb.dts
@@ -165,18 +165,19 @@
[EMAIL PROTECTED] {
#address-cells = <1>;
#size-cells = <1>;
-   device_type = "qe";
-   model = "QE";
+   compatible = "fsl,qe";
ranges = <0 e010 0010>;
reg = ;
brg-frequency = <0>;
bus-frequency = ;
 
[EMAIL PROTECTED] {
-   device_type = "muram";
+   compatible = "fsl,qe-muram", "fsl,cpm-muram";
ranges = <0 0001 4000>;
 
[EMAIL PROTECTED] {
+   compatible = "fsl,qe-muram-data",
+"fsl,cpm-muram-data";
reg = <0 4000>;
};
};
diff --git a/arch/powerpc/boot/dts/mpc836x_mds.dts 
b/arch/powerpc/boot/dts/mpc836x_mds.dts
index fd841b2..8d7124e 100644
--- a/arch/powerpc/boot/dts/mpc836x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc836x_mds.dts
@@ -206,18 +206,19 @@
[EMAIL PROTECTED] {
#address-cells = <1>;
#size-cells = <1>;
-   device_type = "qe";
-   model = "QE";
+   compatible = "fsl,qe";
ranges = <0 e010 0010>;
reg = ;
brg-frequency = <0>;
bus-frequency = <179A7B00>;
 
[EMAIL PROTECTED] {
-   device_type = "muram";
+   device_type = "fsl,qe-muram", "fsl,cpm-muram";
ranges = <0 0001 c000>;
 
[EMAIL PROTECTED]
+   device_type = "fsl,qe-muram-data",
+ "fsl,cpm-muram-data";
reg = <0 c000>;
};
};
diff --git a/arch/powerpc/boot/dts/mpc8568mds.dts 
b/arch/powerpc/boot/dts/mpc8568mds.dts
index 5818a7c..89add8d 100644
--- a/arch/powerpc/boot/dts/mpc8568mds.dts
+++ b/arch/powerpc/boot/dts/mpc8568mds.dts
@@ -283,18 +283,19 @@
[EMAIL PROTECTED] {
#address-cells = <1>;
#size-cells = <1>;
-   device_type = "qe";
-   model = "QE";
+   compatible = "fsl,qe";
ranges = <0 e008 0004>;
reg = ;
brg-frequency = <0>;
bus-frequency = <179A7B00>;
 
[EMAIL PROTECTED] {
-   device_type = "muram";
+   compatible = "fsl,qe-muram", "fsl,cpm-muram";
ranges = <0 0001 c000>;
 
[EMAIL PROTECTED]
+   compatible = "fsl,qe-muram-data",
+"fsl,cpm-muram-data";
reg = <0 c000>;
};
};
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index 4baad80..60d9c4e 100644
--- a/arch/powerpc/sysdev/fsl_soc.c

Re: [PATCH 11/20] [POWERPC] Wire up PCI on Bamboo board

2007-12-20 Thread Valentine Barshak
Benjamin Herrenschmidt wrote:
> On Wed, 2007-12-19 at 16:34 +0300, Valentine Barshak wrote:
> 
>>> --- linux-work.orig/arch/powerpc/boot/dts/bamboo.dts2007-12-10 
>>> 15:56:59.0 +1100
>>> +++ linux-work/arch/powerpc/boot/dts/bamboo.dts 2007-12-10 
>>> 16:39:51.0 +1100
>>> @@ -239,10 +239,48 @@
>>> zmii-channel = <1>;
>>> };
>>> };
>>> +
>>> +   PCI0: [EMAIL PROTECTED] {
>>> +   device_type = "pci";
>>> +   #interrupt-cells = <1>;
>>> +   #size-cells = <2>;
>>> +   #address-cells = <3>;
>>> +   compatible = "ibm,plb440ep-pci", "ibm,plb-pci";
>>> +   primary;
>>> +   reg = <0 eec0 8 /* Config space access */
>>> +  0 eed8 4 /* IACK */
>>> +  0 eed8 4 /* Special cycle */
>>> +  0 ef48 40>;  /* Internal registers */
>> Why ef48 here? IIRC, the docs say it should be ef40, while 
>> ef400040 - ef4f are reserved and can mirror local registers.
> 
> Dunno... probably a typo, though it worked :-) I'll fix it up.

Just checked the ppc440ep user manual again.
Special cycle/IACK registers are at 0xeed0 instead of 0xeed8.
Looks like the same typo as in the internal registers.
It works because all these registers are mirrored at 0x8 offset 
(though it's claimed to be a reserved region).

Thanks,
Valentine.

> 
> Ben.
> 
> 

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH v2 0/4] device_type/compatible cleanups

2007-12-20 Thread Anton Vorontsov
Hi all,

Here is the second version.

Changes since v1:
- Device tree lookup changes should be backward compatible with
  older dtbs;
- Few of_put_node() cleanups;
- cell-index property added to spi nodes;
- cpm-muram{,-data} added as an addition to qe-muram{,-data}.


Thanks,

-- 
Anton Vorontsov
email: [EMAIL PROTECTED]
backup email: [EMAIL PROTECTED]
irc://irc.freenode.net/bd2
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 1/3] ps3: vuart: fix error path locking

2007-12-20 Thread Daniel Walker
On Thu, 2007-12-20 at 12:06 -0800, Andrew Morton wrote:
> On Thu, 20 Dec 2007 11:32:25 -0800 Daniel Walker <[EMAIL PROTECTED]> wrote:
> 
> > On Tue, 2007-12-18 at 19:04 -0800, Geoff Levand wrote:
> > 
> > > Unfortunately there wasn't enough context in the patch to see
> > > that there is a down() earlier in the routine, and that the patch
> > > does indeed remove an incorrectly placed down().  Here is the
> > > entire routine, marked with what the patch removes.
> > > 
> > 
> > Andrew have you had a chance to review this?
> > 
> 
> Confused.  I did review it: http://lkml.org/lkml/2007/12/18/384

Yeah, but Geoff countered http://lkml.org/lkml/2007/12/18/409

Do you still think the patch is wrong, given the whole function?

Daniel

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 1/3] ps3: vuart: fix error path locking

2007-12-20 Thread Andrew Morton
On Thu, 20 Dec 2007 11:32:25 -0800 Daniel Walker <[EMAIL PROTECTED]> wrote:

> On Tue, 2007-12-18 at 19:04 -0800, Geoff Levand wrote:
> 
> > Unfortunately there wasn't enough context in the patch to see
> > that there is a down() earlier in the routine, and that the patch
> > does indeed remove an incorrectly placed down().  Here is the
> > entire routine, marked with what the patch removes.
> > 
> 
> Andrew have you had a chance to review this?
> 

Confused.  I did review it: http://lkml.org/lkml/2007/12/18/384
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 0/2] ASoC drivers for the Freescale MPC8610 SoC

2007-12-20 Thread Timur Tabi

These patches add ALSA SoC device drivers for the Freescale MPC8610 SoC
and the MPC8610-HPCD reference board.

The first patch updates some files in arch/powerpc and booting-without-of.txt.

The second patch adds the new audio driver files to sound/soc.

Both must be applied in order to avoid a build break.

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 1/2] [POWERPC] Update MPC8610 HPCD to support audio drivers

2007-12-20 Thread Timur Tabi
Update the MPC8610 HPCD files to support the audio driver.  Update
booting-without-of.txt with information on the SSI device.

Signed-off-by: Timur Tabi <[EMAIL PROTECTED]>
---

This patch applies on top of
git://git.kernel.org/pub/scm/linux/kernel/git/perex/alsa.git.

 Documentation/powerpc/booting-without-of.txt |   40 ++
 arch/powerpc/boot/dts/mpc8610_hpcd.dts   |  107 
 arch/powerpc/configs/mpc8610_hpcd_defconfig  |  171 +-
 arch/powerpc/platforms/86xx/mpc8610_hpcd.c   |   19 +++
 4 files changed, 334 insertions(+), 3 deletions(-)

diff --git a/Documentation/powerpc/booting-without-of.txt 
b/Documentation/powerpc/booting-without-of.txt
index e9a3cb1..826af91 100644
--- a/Documentation/powerpc/booting-without-of.txt
+++ b/Documentation/powerpc/booting-without-of.txt
@@ -53,6 +53,7 @@ Table of Contents
   j) CFI or JEDEC memory-mapped NOR flash
   k) Global Utilities Block
   l) Xilinx IP cores
+  p) Freescale Synchronous Serial Interface
 
   VII - Specifying interrupt information for devices
 1) interrupts property
@@ -2514,6 +2515,45 @@ platforms are moved over to use the 
flattened-device-tree model.
   Requred properties:
- current-speed : Baud rate of uartlite
 
+p) Freescale Synchronous Serial Interface
+
+   The SSI is a serial device that communicates with audio codecs.  It can
+   be programmed in AC97, I2S, left-justified, or right-justified modes.
+
+   Required properties:
+   - compatible  : compatible list, containing "fsl,ssi"
+   - cell-index  : the SSI, <0> = SSI1, <1> = SSI2, and so on
+   - reg : offset and length of the register set for the device
+   - interrupts  :  where a is the interrupt number and b is a
+field that represents an encoding of the sense and
+   level information for the interrupt.  This should be
+   encoded based on the information in section 2)
+   depending on the type of interrupt controller you
+   have.
+   - interrupt-parent : the phandle for the interrupt controller that
+services interrupts for this device.
+   - fsl,mode: the operating mode for the SSI interface
+   "i2s-slave" - I2S mode, SSI is clock slave
+   "i2s-master" - I2S mode, SSI is clock master
+   "lj-slave" - left-justified mode, SSI is clock slave
+   "lj-master" - l.j. mode, SSI is clock master
+   "rj-slave" - right-justified mode, SSI is clock 
slave
+   "rj-master" - r.j., SSI is clock master
+   "ac97-slave" - AC97 mode, SSI is clock slave
+   "ac97-master" - AC97 mode, SSI is clock master
+
+   Optional properties:
+   - codec   : child node that defines an audio codec connected
+   to this SSI
+
+   Child 'codec' node required properties:
+   - compatible  : compatible list, contains the name of the codec
+
+   Child 'codec' node optional properties:
+   - bus-frequency   : The frequency of the input clock, which typically
+comes from an on-board dedicated oscillator.
+
+
More devices will be defined as this spec matures.
 
 VII - Specifying interrupt information for devices
diff --git a/arch/powerpc/boot/dts/mpc8610_hpcd.dts 
b/arch/powerpc/boot/dts/mpc8610_hpcd.dts
index 966edf1..974acc3 100644
--- a/arch/powerpc/boot/dts/mpc8610_hpcd.dts
+++ b/arch/powerpc/boot/dts/mpc8610_hpcd.dts
@@ -103,6 +103,113 @@
reg = ;
fsl,has-rstcr;
};
+
+   [EMAIL PROTECTED] {
+   compatible = "fsl,ssi";
+   cell-index = <0>;
+   reg = <16000 100>;
+   interrupt-parent = <&mpic>;
+   interrupts = <3e 2>;
+   fsl,mode = "i2s-slave";
+   codec {
+   compatible = "cirrus,cs4270";
+   /* MCLK source is a stand-alone oscillator */
+   bus-frequency = ;
+   };
+   };
+
+   [EMAIL PROTECTED] {
+   compatible = "fsl,ssi";
+   cell-index = <1>;
+   reg = <16100 100>;
+   interrupt-parent = <&mpic>;
+   interrupts = <3f 2>;
+   };
+
+[EMAIL PROTECTED] {
+#address-cells = <1>;
+#size-cells = <1>;
+compatible = "fsl,mpc8610-dma", "fsl,eloplus-dma";
+cell-index = <0>;
+   

[PATCH 1/4] sbc8560: add basic support for Wind River SBC8560 as powerpc

2007-12-20 Thread Paul Gortmaker
This adds the basic support for the Wind River SBC8560 board, implemented
as powerpc.  It closely follows the implementation of the MPC8560ADS.

Signed-off-by: Paul Gortmaker <[EMAIL PROTECTED]>
---
 arch/powerpc/platforms/85xx/Kconfig   |   11 +-
 arch/powerpc/platforms/85xx/Makefile  |1 +
 arch/powerpc/platforms/85xx/sbc8560.c |  302 +
 3 files changed, 312 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/85xx/Kconfig 
b/arch/powerpc/platforms/85xx/Kconfig
index 7748a3a..0eb497b 100644
--- a/arch/powerpc/platforms/85xx/Kconfig
+++ b/arch/powerpc/platforms/85xx/Kconfig
@@ -38,6 +38,13 @@ config MPC85xx_DS
help
  This option enables support for the MPC85xx DS (MPC8544 DS) board
 
+config SBC8560
+   bool "Wind River SBC8560"
+   select DEFAULT_UIMAGE
+   select PPC_CPM_NEW_BINDING
+   help
+ This option enables support for the Wind River SBC8560 board
+
 endchoice
 
 config MPC8540
@@ -49,7 +56,7 @@ config MPC8540
 config MPC8560
bool
select CPM2
-   default y if MPC8560_ADS
+   default y if MPC8560_ADS || SBC8560
 
 config MPC85xx
bool
@@ -59,4 +66,4 @@ config MPC85xx
select FSL_PCI if PCI
select SERIAL_8250_SHARE_IRQ if SERIAL_8250
default y if MPC8540_ADS || MPC85xx_CDS || MPC8560_ADS \
-   || MPC85xx_MDS || MPC85xx_DS
+   || MPC85xx_MDS || MPC85xx_DS || SBC8560
diff --git a/arch/powerpc/platforms/85xx/Makefile 
b/arch/powerpc/platforms/85xx/Makefile
index 5eca920..c3f4d01 100644
--- a/arch/powerpc/platforms/85xx/Makefile
+++ b/arch/powerpc/platforms/85xx/Makefile
@@ -6,3 +6,4 @@ obj-$(CONFIG_MPC8560_ADS) += mpc85xx_ads.o
 obj-$(CONFIG_MPC85xx_CDS) += mpc85xx_cds.o
 obj-$(CONFIG_MPC85xx_DS)  += mpc85xx_ds.o
 obj-$(CONFIG_MPC85xx_MDS) += mpc85xx_mds.o
+obj-$(CONFIG_SBC8560) += sbc8560.o
diff --git a/arch/powerpc/platforms/85xx/sbc8560.c 
b/arch/powerpc/platforms/85xx/sbc8560.c
new file mode 100644
index 000..6aef38b
--- /dev/null
+++ b/arch/powerpc/platforms/85xx/sbc8560.c
@@ -0,0 +1,302 @@
+/*
+ * Wind River SBC8560 setup and early boot code.
+ *
+ * Copyright 2007 Wind River Systems Inc.
+ *
+ * By Paul Gortmaker (see MAINTAINERS for contact information)
+ *
+ * Based largely on the MPC8560ADS support - Copyright 2005 Freescale Inc.
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#ifdef CONFIG_CPM2
+#include 
+#include 
+#endif
+
+#ifdef CONFIG_PCI
+static int sbc8560_exclude_device(struct pci_controller *hose,
+  u_char bus, u_char devfn)
+{
+   if (bus == 0 && PCI_SLOT(devfn) == 0)
+   return PCIBIOS_DEVICE_NOT_FOUND;
+   else
+   return PCIBIOS_SUCCESSFUL;
+}
+#endif /* CONFIG_PCI */
+
+#ifdef CONFIG_CPM2
+
+static void cpm2_cascade(unsigned int irq, struct irq_desc *desc)
+{
+   int cascade_irq;
+
+   while ((cascade_irq = cpm2_get_irq()) >= 0) {
+   generic_handle_irq(cascade_irq);
+   }
+   desc->chip->eoi(irq);
+}
+
+#endif /* CONFIG_CPM2 */
+
+static void __init sbc8560_pic_init(void)
+{
+   struct mpic *mpic;
+   struct resource r;
+   struct device_node *np = NULL;
+#ifdef CONFIG_CPM2
+   int irq;
+#endif
+
+   np = of_find_node_by_type(np, "open-pic");
+
+   if (np == NULL) {
+   printk(KERN_ERR "Could not find open-pic node\n");
+   return;
+   }
+
+   if(of_address_to_resource(np, 0, &r)) {
+   printk(KERN_ERR "Could not map mpic register space\n");
+   of_node_put(np);
+   return;
+   }
+
+   mpic = mpic_alloc(np, r.start,
+   MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
+   0, 256, " OpenPIC  ");
+   BUG_ON(mpic == NULL);
+   of_node_put(np);
+
+   mpic_init(mpic);
+
+#ifdef CONFIG_CPM2
+   /* Setup CPM2 PIC */
+   np = of_find_compatible_node(NULL, NULL, "fsl,cpm2-pic");
+   if (np == NULL) {
+   printk(KERN_ERR "PIC init: can not find fsl,cpm2-pic node\n");
+   return;
+   }
+   irq = irq_of_parse_and_map(np, 0);
+
+   cpm2_pic_init(np);
+   set_irq_chained_handler(irq, cpm2_cascade);
+#endif
+}
+
+/*
+ * Setup the architecture
+ */
+#ifdef CONFIG_CPM2
+struct cpm_pin {
+   int port, pin, flags;
+};
+
+static struct cpm_pin sbc8560_pins[] = {
+   /* SCC1 */
+   {3, 29, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
+   {3, 30, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
+   {3, 31, CPM_PIN_INPUT | CPM_PIN_PRIMARY}

Re: [PATCH 1/3] ps3: vuart: fix error path locking

2007-12-20 Thread Daniel Walker
On Tue, 2007-12-18 at 19:04 -0800, Geoff Levand wrote:

> Unfortunately there wasn't enough context in the patch to see
> that there is a down() earlier in the routine, and that the patch
> does indeed remove an incorrectly placed down().  Here is the
> entire routine, marked with what the patch removes.
> 

Andrew have you had a chance to review this?

Daniel

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 3/4] sbc8560: Add device tree source for Wind River SBC8560 board

2007-12-20 Thread Paul Gortmaker
This adds the device tree source for the Wind River SBC8560 board.  The
biggest difference between this and the MPC8560ADS reference platform
is the use of an external 16550 compatible UART instead of the CPM2.

Signed-off-by: Paul Gortmaker <[EMAIL PROTECTED]>
---
 arch/powerpc/boot/dts/sbc8560.dts |  202 +
 1 files changed, 202 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/boot/dts/sbc8560.dts 
b/arch/powerpc/boot/dts/sbc8560.dts
new file mode 100644
index 000..85fc488
--- /dev/null
+++ b/arch/powerpc/boot/dts/sbc8560.dts
@@ -0,0 +1,202 @@
+/*
+ * SBC8560 Device Tree Source
+ *
+ * Copyright 2007 Wind River Systems Inc.
+ *
+ * Paul Gortmaker (see MAINTAINERS for contact information)
+ *
+ * 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.
+ */
+
+
+/ {
+   model = "SBC8560";
+   compatible = "SBC8560";
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   cpus {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   PowerPC,[EMAIL PROTECTED] {
+   device_type = "cpu";
+   reg = <0>;
+   d-cache-line-size = <20>;   // 32 bytes
+   i-cache-line-size = <20>;   // 32 bytes
+   d-cache-size = <8000>;  // L1, 32K
+   i-cache-size = <8000>;  // L1, 32K
+   timebase-frequency = <0>;   // From uboot
+   bus-frequency = <0>;
+   clock-frequency = <0>;
+   32-bit;
+   };
+   };
+
+   memory {
+   device_type = "memory";
+   reg = < 2000>;
+   };
+
+   [EMAIL PROTECTED] {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   #interrupt-cells = <2>;
+   device_type = "soc";
+   ranges = <0 ff70 0010>;
+   reg = ;
+   bus-frequency = <0>;
+
+   [EMAIL PROTECTED] {
+   compatible = "fsl,8560-memory-controller";
+   reg = <2000 1000>;
+   interrupt-parent = <&mpic>;
+   interrupts = <12 2>;
+   };
+
+   [EMAIL PROTECTED] {
+   compatible = "fsl,8560-l2-cache-controller";
+   reg = <2 1000>;
+   cache-line-size = <20>; // 32 bytes
+   cache-size = <4>;   // L2, 256K
+   interrupt-parent = <&mpic>;
+   interrupts = <10 2>;
+   };
+
+   [EMAIL PROTECTED] {
+   device_type = "i2c";
+   compatible = "fsl-i2c";
+   reg = <3000 100>;
+   interrupts = <2b 2>;
+   interrupt-parent = <&mpic>;
+   dfsrr;
+   };
+
+   [EMAIL PROTECTED] {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   device_type = "mdio";
+   compatible = "gianfar";
+   reg = <24520 20>;
+   phy0: [EMAIL PROTECTED] {
+   interrupt-parent = <&mpic>;
+   interrupts = <6 1>;
+   reg = <19>;
+   device_type = "ethernet-phy";
+   };
+   phy1: [EMAIL PROTECTED] {
+   interrupt-parent = <&mpic>;
+   interrupts = <7 1>;
+   reg = <1a>;
+   device_type = "ethernet-phy";
+   };
+   };
+
+   [EMAIL PROTECTED] {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   device_type = "network";
+   model = "TSEC";
+   compatible = "gianfar";
+   reg = <24000 1000>;
+   local-mac-address = [ 00 00 00 00 00 00 ];
+   interrupts = <1d 2 1e 2 22 2>;
+   interrupt-parent = <&mpic>;
+   phy-handle = <&phy0>;
+   };
+
+   [EMAIL PROTECTED] {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   device_type = "network";
+   model = "TSEC";
+   compatible = "gianfar";
+   reg = <25000 1000>;
+   local-mac-address = [ 0

[PATCH 2/4] CPM2: Make support for the CPM2 optional on 8560 based boards

2007-12-20 Thread Paul Gortmaker
Currently there is no way to disable the CPM2 support.  Some boards,
like the SBC8560 have their own external UART and don't have any direct
dependencies on the CPM for a serial console or anything else.

Signed-off-by: Paul Gortmaker <[EMAIL PROTECTED]>
---
 arch/powerpc/platforms/85xx/Kconfig |4 ++--
 arch/powerpc/platforms/Kconfig  |4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/platforms/85xx/Kconfig 
b/arch/powerpc/platforms/85xx/Kconfig
index 0eb497b..33d3bea 100644
--- a/arch/powerpc/platforms/85xx/Kconfig
+++ b/arch/powerpc/platforms/85xx/Kconfig
@@ -13,6 +13,7 @@ config MPC8560_ADS
bool "Freescale MPC8560 ADS"
select DEFAULT_UIMAGE
select PPC_CPM_NEW_BINDING
+   select CPM2
help
  This option enables support for the MPC 8560 ADS board
 
@@ -41,7 +42,7 @@ config MPC85xx_DS
 config SBC8560
bool "Wind River SBC8560"
select DEFAULT_UIMAGE
-   select PPC_CPM_NEW_BINDING
+   select PPC_CPM_NEW_BINDING if CPM2
help
  This option enables support for the Wind River SBC8560 board
 
@@ -55,7 +56,6 @@ config MPC8540
 
 config MPC8560
bool
-   select CPM2
default y if MPC8560_ADS || SBC8560
 
 config MPC85xx
diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
index ea22cad..d355dd6 100644
--- a/arch/powerpc/platforms/Kconfig
+++ b/arch/powerpc/platforms/Kconfig
@@ -272,8 +272,8 @@ config QUICC_ENGINE
  for a machine with a QE coprocessor.
 
 config CPM2
-   bool
-   default n
+   bool "Enable support for the CPM2 (Communications Processor Module)"
+   depends on MPC8560 || 8260
select CPM
select PPC_LIB_RHEAP
help
-- 
1.5.0.rc1.gf4b6c

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 0/4] arch/powerpc support for SBC8560 board

2007-12-20 Thread Paul Gortmaker


The following four patches add support for the Wind River SBC8560 board
onto the powerpc branch.  The patches are as follows:

1) Add basic support for Wind River SBC8560 as powerpc

This adds in the basic platform support file -- closely matching that which
exists for the MPC8560ADS board.

 b/arch/powerpc/platforms/85xx/Kconfig   |   11 -
 b/arch/powerpc/platforms/85xx/Makefile  |1 
 b/arch/powerpc/platforms/85xx/sbc8560.c |  303 +++-


2) Make support for the CPM2 optional on 8560 based boards

Since the SBC8560 has a 16550 compatible UART on board, there really is
no direct requirement for any of the CPM functionality to be forced on
all the time.  This allows you to turn off the CPM2 support for this board.

 b/arch/powerpc/platforms/85xx/Kconfig |4 ++--
 b/arch/powerpc/platforms/Kconfig  |5 ++---


3) Add device tree source for Wind River SBC8560 board

This is probably the most interesting part of the group, given that the
board doesn't use the CPM2 to provide the serial console.  I've made a
duart dts entry that is kind of similar to what is done for the tsi108
on the mpc7448/hpc-ii board, and made sure that the serial had their
parent marked as "soc" (found out the hard way that UARTs were ignored
as possible consoles unless they were soc or tsi108 children...)

 b/arch/powerpc/boot/dts/sbc8560.dts |  203 +++-


4) Add default .config file for Wind River SBC8560

 b/arch/powerpc/configs/sbc8560_defconfig |  765 ++-

This config gives basic serial console and ethernet support for doing an
NFS root setup.  The SBC8560 can be used as a PCI host when put into
a suitable backplane, and the FCC ports can be used for eth2/eth3 if
the board is fitted with a daughtercard with a couple Broadcom PHY, but
at the moment these features aren't enabled/tested as they weren't on
the board I was using.


I'd quickly spun together a u-boot 1.2.0 for testing this -- since that was
the quickest route to getting a powerpc capable version.  I'll see what
can be done for getting a u-boot 1.3.1 patchset out so the local-mac-address
vs address thing in the dtb isn't an issue.

Paul.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH v3 2/2] mpc82xx: Embedded Planet EP8248E support

2007-12-20 Thread Scott Wood
This board is also resold by Freescale under the names
"QUICCStart MPC8248 Evaluation System" and "CWH-PPC-8248N-VE".

Signed-off-by: Scott Wood <[EMAIL PROTECTED]>
---
Resent with dts-v1 and aliases.

 arch/powerpc/boot/Makefile |3 +-
 arch/powerpc/boot/dts/ep8248e.dts  |  205 
 arch/powerpc/boot/ep8248e.c|   55 ++
 arch/powerpc/boot/wrapper  |2 +-
 arch/powerpc/configs/ep8248e_defconfig |  864 
 arch/powerpc/platforms/82xx/Kconfig|   13 +
 arch/powerpc/platforms/82xx/Makefile   |1 +
 arch/powerpc/platforms/82xx/ep8248e.c  |  325 
 include/asm-powerpc/mpc8260.h  |1 +
 9 files changed, 1467 insertions(+), 2 deletions(-)
 create mode 100644 arch/powerpc/boot/dts/ep8248e.dts
 create mode 100644 arch/powerpc/boot/ep8248e.c
 create mode 100644 arch/powerpc/configs/ep8248e_defconfig
 create mode 100644 arch/powerpc/platforms/82xx/ep8248e.c

diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 9dfadc0..57bee27 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -58,7 +58,7 @@ src-plat := of.c cuboot-52xx.c cuboot-83xx.c cuboot-85xx.c 
holly.c \
cuboot-ebony.c treeboot-ebony.c prpmc2800.c \
ps3-head.S ps3-hvcall.S ps3.c treeboot-bamboo.c cuboot-8xx.c \
cuboot-pq2.c cuboot-sequoia.c treeboot-walnut.c cuboot-bamboo.c 
\
-   fixed-head.S ep88xc.c cuboot-hpc2.c redboot-8xx.c
+   fixed-head.S ep88xc.c cuboot-hpc2.c redboot-8xx.c ep8248e.c
 src-boot := $(src-wlib) $(src-plat) empty.c
 
 src-boot := $(addprefix $(obj)/, $(src-boot))
@@ -190,6 +190,7 @@ ifneq ($(CONFIG_DEVICE_TREE),"")
 image-$(CONFIG_PPC_8xx)+= cuImage.8xx
 image-$(CONFIG_PPC_EP88XC) += zImage.ep88xc
 image-$(CONFIG_8260)   += cuImage.pq2
+image-$(CONFIG_EP8248E)+= zImage.ep8248e
 image-$(CONFIG_PPC_MPC52xx)+= cuImage.52xx
 image-$(CONFIG_PPC_83xx)   += cuImage.83xx
 image-$(CONFIG_PPC_85xx)   += cuImage.85xx
diff --git a/arch/powerpc/boot/dts/ep8248e.dts 
b/arch/powerpc/boot/dts/ep8248e.dts
new file mode 100644
index 000..f5b058c
--- /dev/null
+++ b/arch/powerpc/boot/dts/ep8248e.dts
@@ -0,0 +1,205 @@
+/*
+ * Device Tree for the Embedded Planet EP8248E board running PlanetCore.
+ *
+ * Copyright 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 as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+/dts-v1/;
+/ {
+   model = "EP8248E";
+   compatible = "fsl,ep8248e";
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   aliases {
+   planetcore-SMC1 = &smc1;
+   planetcore-SCC1 = &scc1;
+   enet0 = ð0;
+   enet1 = ð1;
+   serial0 = &smc1;
+   serial1 = &scc1;
+   };
+
+   cpus {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   PowerPC,[EMAIL PROTECTED] {
+   device_type = "cpu";
+   reg = <0>;
+   d-cache-line-size = <32>;
+   i-cache-line-size = <32>;
+   d-cache-size = <16384>;
+   i-cache-size = <16384>;
+   timebase-frequency = <0>;
+   clock-frequency = <0>;
+   };
+   };
+
+   localbus {
+   compatible = "fsl,mpc8248-localbus",
+"fsl,pq2-localbus",
+"simple-bus";
+   #address-cells = <2>;
+   #size-cells = <1>;
+   reg = <0xf0010100 0x40>;
+
+   ranges = <0 0 0xfc00 0x0400
+ 1 0 0xfa00 0x8000>;
+
+   [EMAIL PROTECTED],380 {
+   compatible = "cfi-flash";
+   reg = <0 0x380 0x80>;
+   bank-width = <4>;
+   device-width = <2>;
+   };
+
+   [EMAIL PROTECTED],0 {
+   #address-cells = <2>;
+   #size-cells = <1>;
+   reg = <1 0 0x10>;
+   compatible = "fsl,ep8248e-bcsr";
+   ranges;
+
+   mdio {
+   device_type = "mdio";
+   compatible = "fsl,ep8248e-mdio-bitbang";
+   #address-cells = <1>;
+   #size-cells = <0>;
+   reg = <1 8 1>;
+
+   PHY0: [EMAIL PROTECTED] {
+   interrupt-parent = <&PIC>;
+

Re: [alsa-devel] [PATCH] ASoC drivers for the Freescale MPC8610 SoC

2007-12-20 Thread Timur Tabi
Takashi Iwai wrote:

> All?  No, only a few...
> For PCI, usually pci_set_dma_mask() and pci_set_consistent_dma_mask()
> are used, of course.

Hmm, ok I was wrong.  I took this code from the ASoC at91 driver.

Unfortunately, I don't understand what this code is trying to do.  The AT91 
driver isn't documented, so I don't even know if I need it.  Can someone 
explain 
what all this is?  What's the alternative to using a static global?

-- 
Timur Tabi
Linux kernel developer at Freescale
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [patch/rfc 3/7] ps3: Use the HVs storage device notification mechanism properly

2007-12-20 Thread Geert Uytterhoeven
On Wed, 28 Nov 2007, Geert Uytterhoeven wrote:
> From: Geert Uytterhoeven <[EMAIL PROTECTED]>
> 
> ps3: Use the HV's storage device notification mechanism properly
> 
> The hypervisor has a storage device notification mechanism to wait until a
> storage device is ready. Unfortunately the storage device probing code used
> this mechanism in an incorrect way, needing a polling loop and handling of
> devices that are not yet ready.
> 
> This change corrects this by:
>   - First waiting for the reception of an asynchronous notification that a new
> storage device became ready,
>   - Then looking up the storage device in the device repository.

The PS3 storage probe thread left the storage notification device open on
shutdown, so the device open would fail with LV1_BUSY when the second stage
kexec kernel tried to open the device.

To fix this:
  - Replace the call to wait_for_completion_interruptible() by a call to
wait_event_interruptible() that also checks kthread_should_stop(),
  - Install a reboot notifier that stops the storage probe thread on shutdown.

---
Question: Does there exist a better way to achieve this?

To do: ps3_probe_thread() may still exit prematurely in case of an error,
   causing the call to kthread_stop() to hang on shutdown later.
   The setup code in ps3_probe_thread() can easily be moved outside the
   kthread, but what to do in case of an error in the do/while loop? Just
   sleep until woken up by kthread_stop()?

 arch/powerpc/platforms/ps3/device-init.c |   29 +++--
 1 files changed, 27 insertions(+), 2 deletions(-)

--- a/arch/powerpc/platforms/ps3/device-init.c
+++ b/arch/powerpc/platforms/ps3/device-init.c
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -565,8 +566,9 @@ static int ps3_notification_read_write(s
}
pr_debug("%s:%u: notification %s issued\n", __func__, __LINE__, op);
 
-   res = wait_for_completion_interruptible(&dev->done);
-   if (res) {
+   res = wait_event_interruptible(dev->done.wait,
+  dev->done.done || kthread_should_stop());
+   if (res || kthread_should_stop()) {
pr_debug("%s:%u: interrupted %s\n", __func__, __LINE__, op);
return res;
}
@@ -707,6 +709,26 @@ fail_free:
 }
 
 /**
+ * ps3_stop_probe_thread - Stops the background probe thread.
+ *
+ */
+
+static struct task_struct *probe_task;
+
+static int ps3_stop_probe_thread(struct notifier_block *nb, unsigned long code,
+void *data)
+{
+   if (probe_task)
+   kthread_stop(probe_task);
+   return 0;
+}
+
+static struct notifier_block nb = {
+   .notifier_call = ps3_stop_probe_thread
+};
+
+
+/**
  * ps3_start_probe_thread - Starts the background probe thread.
  *
  */
@@ -748,6 +770,9 @@ static int __init ps3_start_probe_thread
return result;
}
 
+   probe_task = task;
+   register_reboot_notifier(&nb);
+
pr_debug(" <- %s:%d\n", __func__, __LINE__);
return 0;
 }

With kind regards,
 
Geert Uytterhoeven
Software Architect

Sony Network and Software Technology Center Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium
 
Phone:+32 (0)2 700 8453 
Fax:  +32 (0)2 700 8622 
E-mail:   [EMAIL PROTECTED] 
Internet: http://www.sony-europe.com/

Sony Network and Software Technology Center Europe  
A division of Sony Service Centre (Europe) N.V. 
Registered office: Technologielaan 7 · B-1840 Londerzeel · Belgium  
VAT BE 0413.825.160 · RPR Brussels  
Fortis Bank Zaventem · Swift GEBABEBB08A · IBAN BE39001382358619___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

[DTC PATCH 1/2] Add yyerrorf() for formatted error messages.

2007-12-20 Thread Scott Wood
Signed-off-by: Scott Wood <[EMAIL PROTECTED]>
---
 dtc-parser.y |   16 
 srcpos.h |1 +
 2 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/dtc-parser.y b/dtc-parser.y
index 002ea7f..4a0181d 100644
--- a/dtc-parser.y
+++ b/dtc-parser.y
@@ -318,6 +318,22 @@ void yyerror (char const *s)
fname, yylloc.first_line, s);
 }
 
+void yyerrorf(char const *s, ...)
+{
+   const char *fname = srcpos_filename_for_num(yylloc.filenum);
+   va_list va;
+   va_start(va, s);
+
+   if (strcmp(fname, "-") == 0)
+   fname = "stdin";
+
+   fprintf(stderr, "%s:%d ", fname, yylloc.first_line);
+   vfprintf(stderr, s, va);
+   fprintf(stderr, "\n");
+   
+   va_end(va);
+}
+
 unsigned long long eval_literal(const char *s, int base, int bits)
 {
unsigned long long val;
diff --git a/srcpos.h b/srcpos.h
index ce7ab5b..e59c788 100644
--- a/srcpos.h
+++ b/srcpos.h
@@ -63,6 +63,7 @@ typedef struct YYLTYPE {
 
 
 extern void yyerror(char const *);
+extern void yyerrorf(char const *, ...) __attribute__((format(printf, 1, 2)));
 
 extern int srcpos_filenum;
 
-- 
1.5.3

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


  1   2   >