LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: Fwd: [PATCH] bootwrapper: adds cuboot for MPC7448HPC2 platform
From: David Gibson @ 2007-07-26  6:59 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <B37B73EC-54FE-442C-A1FF-348D89D3D840@kernel.crashing.org>

On Thu, Jul 26, 2007 at 01:28:10AM -0500, Kumar Gala wrote:
> 
> 
> Begin forwarded message:
> 
> >From: Zang Roy-r61911 <tie-fei.zang@freescale.com>
> >Date: July 11, 2007 3:54:16 AM CDT
> >To: Paul Mackerras <paulus@samba.org>
> >Cc: Kumar Gala <galak@kernel.crashing.org>, linuxppc-dev list  
> ><linuxppc-dev@ozlabs.org>
> >Subject: [PATCH] bootwrapper: adds cuboot for MPC7448HPC2 platform
> >
> >From: Roy Zang <tie-fei.zang@freescale.com>
> >
> >This patch adds cuboot support for MPC7448HPC2 platform.
> >The cuImage can be used with legacy u-boot without FDT support.
> >
> >Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>

[snip]

> >--- /dev/null
> >+++ b/arch/powerpc/boot/cuboot-hpc2.c
> >@@ -0,0 +1,48 @@
> >+/*
> >+ * Copyright (C) 2007 Freescale Semiconductor, Inc. All rights  
> >reserved.
> >+ *
> >+ * Author: Roy Zang <tie-fei.zang@freescale.com>
> >+ *
> >+ * Description:
> >+ * Old U-boot compatibility for mpc7448hpc2 board
> >+ * Based on the code of Scott Wood <scottwood@freescale.com>
> >+ * for 83xx and 85xx.
> >+ *
> >+ * This 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 "ops.h"
> >+#include "stdio.h"
> >+#include "cuboot.h"
> >+
> >+#define TARGET_HAS_ENET1
> >+#include "ppcboot.h"

Including ppcboot.h without first defining TARGET_* defines which give
the type of system seems... fragile at best, broken at worst.  Surely
this can only work by accident.

-- 
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

^ permalink raw reply

* Reboot Command Makes kernel to hang (MPC8560)
From: Ansari @ 2007-07-26  6:55 UTC (permalink / raw)
  To: linuxppc-embedded

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

Hi all,

Processor (MPC8560)

Whenever reboot command is given in the linux console. The processor gets reset and it loads bootloader , kernel and when uncompressing the ramdisk it gets hang. The sample log is given below. Any u please tell me what are the factors that can makes this to happen.

Log 
----

070500 U-Boot 1.1.2 (May 30 2007 - 20:20:09)

Motorola PowerPC ProcessorID=00000000 Rev. PVR=80200020
Board: XXX MPC8560 [PowerQUICC III]
        CPU: 660 MHz
        CCB: 330 MHz
        DDR: 165 MHz
Performing version scanning
I2C:   ready
DRAM:  Configuring UPM for NAND
Configuring UPM for MSC8122 DSI Port
Initializing DRAM
    DDR: 256 MB
Relocating POST functions.
FLASH: 16 MB
L2 cache enabled: 256KB
In:    serial
Out:   serial
Err:   serial
Net:   MOTO ENET0: PHY is Intel LXT971A (1378e2)
MOTO ENET1: PHY is Intel LXT971A (1378e2)
MOTO ENET0, MOTO ENET1
POST I: Before relocation. <DEL> to start...   1 
POST II: After relocation. <DEL> to start...   1 
Micro Controller version 75
Hit any key to stop autoboot:  0 
## Booting image at ffd00000 ...
   Image Name:   070500 Linux-cscpp
   Created:      2007-05-30  14:49:24 UTC
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:    938254 Bytes = 916.3 kB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
## Loading RAMDisk Image at ff000000 ...
   Image Name:   070500 cscpp-REL_7_5
   Created:      2007-05-30  14:51:09 UTC
   Image Type:   PowerPC Linux RAMDisk Image (gzip compressed)
   Data Size:    3543240 Bytes =  3.4 MB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   Loading Ramdisk to 0fc4e000, end 0ffaf0c8 ... OK
Memory CAM mapping: CAM0=256Mb, CAM1=0Mb, CAM2=0Mb residual: 0Mb
Linux version 2.4.20_mvlcge31-cscpp-7.5 (root@turing) (gcc version 3.3.1 (MontaVista 3.3.1-3.0.10.0300532 2003-12-24)) #1 Wed May 30 20:14:43 IST 2007
max_pfn = 8192
On node 0 totalpages: 65536
zone(0): 65536 pages.
zone(1): 0 pages.
zone(2): 0 pages.
Kernel command line: root=/dev/ram rw console=ttyS0,115200 ip=off
OpenPIC Version 1.2 (1 CPUs and 44 IRQ sources) at fdf80000
time_init: decrementer frequency = 41.250000 MHz
hr_time_init: arch_to_nsec = 50840048, nsec_to_arch = 177167400
Calibrating delay loop... 658.63 BogoMIPS
Memory: 253056k available (1696k kernel code, 760k data, 68k init, 0k highmem)
RMON - kernel resource monitoring
Dentry cache hash table entries: 32768 (order: 6, 262144 bytes)
Inode cache hash table entries: 16384 (order: 5, 131072 bytes)
Mount-cache hash table entries: 4096 (order: 3, 32768 bytes)
Buffer-cache hash table entries: 16384 (order: 4, 65536 bytes)
Page-cache hash table entries: 65536 (order: 6, 262144 bytes)
POSIX conformance testing by UNIFIX
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
LSP Revision 14
ikconfig 0.5 with /proc/ikconfig
Starting kswapd
Journalled Block Device driver loaded
JFFS version 1.0, (C) 1999, 2000  Axis Communications AB
JFFS2 version 2.1. (C) 2001, 2002 Red Hat, Inc., designed by Axis Communications AB.
CPM UART driver version 0.01
ttyS0 on SCC1 at 0x8000, BRG1
pty: 256 Unix98 ptys configured
eth0: FCC ENET Version 0.3, 02:e0:0c:80:31:03
eth0: RMON initialized
RAMDISK driver initialized: 16 RAM disks of 32768K size 1024 blocksize
loop: loaded (max 8 devices)
eth1: Gianfar Ethernet Controller Version 1.0, 02:e0:0c:00:31:03 
eth1: Running with NAPI disabled
eth1: 64/64 RX/TX BD ring size
eth1: RMON initialized
eth2: Gianfar Ethernet Controller Version 1.0, 02:e0:0c:00:31:02 
eth2: Running with NAPI disabled
eth2: 64/64 RX/TX BD ring size
eth2: RMON initialized
network device driver for LKCD registered
Crash dump driver initialized.
CSC flash: Found 1 x16 devices at 0x0 in 16-bit bank
 Intel/Sharp Extended Query Table at 0x0031
Using buffer write method
cfi_cmdset_0001: Erase suspend on write enabled
Creating 7 MTD partitions on "CSC flash":
0x00f80000-0x01000000 : "uboot"
0x00d00000-0x00e00000 : "kernel0"
0x00e00000-0x00f00000 : "kernel1"
0x00700000-0x00d00000 : "app"
0x00000000-0x00380000 : "root0"
0x00380000-0x00700000 : "root1"
0x00f00000-0x00f80000 : "env"
Creating 2 MTD partitions on "CSC NVRAM":
0x00000000-0x00010000 : "applog"
0x00010000-0x00020000 : "kernellog"
NAND device: Manufacturer ID: 0x2c, Chip ID: 0xca (Unknown NAND 256MiB 3,3V 16-bit)
Scanning device for bad blocks
Bad eraseblock 1780 at 0x0de80000
Creating 1 MTD partitions on "NAND 256MiB 3,3V 16-bit":
0x00000000-0x10000000 : "NAND Partition"
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP, IGMP
IP: routing cache hash table of 2048 buckets, 16Kbytes
TCP: Hash tables configured (established 16384 bind 32768)
ip_conntrack version 2.1 (2048 buckets, 16384 max) - 296 bytes per conntrack
ip_tables: (C) 2000-2002 Netfilter core team
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
Event Broker Driver (C) 2001,2002 MontaVista Software (source@mvista.com)
Done starting sysfs
RAMDISK: Compressed image found at block 0
Freeing initrd memory: 3460k freed
VFS: Mounted root (ext2 filesystem).
Freeing unused kernel memory: 68k init

Welcome to Linux Group

Starting system...
Mounting /proc: done.
Brining up loopback interface: done.
Mounting /tmp: done.
Starting syslogd: done.
Starting klogd: done.
Starting telnetd: done.

MC-I2C DRIVER Successfully Installed
mcc: mcc_dev_siram_entries_config: siram config: start entry: 0, start channel: 128, count: 64
mcc: mcc_dev_siram_entries_config: siram config: start entry: 128, start channel: 192, count: 64
mcc: mcc_dev_iopin_init: IO port init done
mcc: mcc_dev_clock_mux_init: clock mux init done 0x88
mcc: mcc_dev_init: Board specific init done.
mcc: mcc_dev_init: BDs init done
mcc: mcc_dev_init: global param init done
mcc: mcc_dev_init: extra channel param init done
mcc: mcc_dev_init: channel param init done
[: 1: unknown operand

DSP-7116: Driver registered. 
DSP MSC 7116 Driver for HDI Interface May 30 2007  20:19:35
DSP-7116: Insmoded Successfully Default Status & Control Register 426 6618

MSC8122_DSI driver registered. 
MSC8122_DSI Driver for DSI Interface May 30 2007  20:19:35DSI init...[2]
loading LSCL module...May 30 2007 ,20:19:36
scc  at 0x8100
sccp 0xd2575a20
priv size 176
dev name lscl0
scc1 clk 0x000100b2
device lscl0 
lscl module loaded
Setting the LSCL address & IP address
setting slot id 0x0021
bonding.c:v2.2.5 (May 22, 2003)
bonding_init(): eth1 primary device specified but has no effect in fault-tolerance (broadcast) mode
bond0 registered with MII link monitoring set to 200 ms, in fault-tolerance (broadcast) mode.
bond0 registered without ARP monitoring
eth1: PHY is Intel LXT971A (1378e2)
eth1: No link detected
bond0: enslaving eth1 as an active interface with a down link.
eth1: Auto-negotiation done
eth1: Full Duplex
eth1: Speed 100BT
eth1: Link is up
eth2: PHY is Intel LXT971A (1378e2)
eth2: No link detected
bond0: enslaving eth2 as an active interface with a down link.
eth2: Auto-negotiation done
eth2: Full Duplex
eth2: Speed 100BT
eth2: Link is up
Setting system time from hardware clock.
yaffs: dev is 7945 name is "1f:09"
bond0: link status definitely up for interface eth2.
bond0: link status definitely up for interface eth1.
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000000: 0xd355 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000004: 0xcf85 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000008: 0x435c instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000000c: 0xc451 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000010: 0xb677 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000014: 0x15f5 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000018: 0xfbfb instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000001c: 0x4491 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000020: 0x543a instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000024: 0x1193 instead
Further such events for this erase block will not be printed
Cowardly refusing to erase blocks on filesystem with no valid JFFS2 nodes
empty_blocks 0, bad_blocks 0, c->nr_blocks 16
mount: Mounting /dev/mtdblock7 on /mnt/app-nvram failed: Invalid argument
Punching Microcontroller. 
Creating TSI LOCK fileDone
Starting the xxx agent

                 ====== SYSTEM STARTED ======


System started

  _____  _   _  _    _      __ _       _                     
 / ____|| \ | || |  | |    / /| |     (_)                    
| |  __ |  \| || |  | |   / / | |      _  _ __   _   _ __  __
| | |_ || .   || |  | |  / /  | |     | || '_ \ | | | |\ \/ /
| |__| || |\  || |__| | / /   | |____ | || | | || |_| | >  < 
 \_____||_| \_| \____/ /_/    |______||_||_| |_| \__,_|/_/\_\

(none) login: root


BusyBox v1.1.0 (2006.03.23-09:02+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

[root@(none) /root]# reboot

The system is going down NOW !!
Sending SIGTERM to all processeExiting Syslogd!
Sending SIGKILL to all processes.
Please stand by while rebooting the system.
Restarting systemste?

070500 U-Boot 1.1.2 (May 30 2007 - 20:20:09)

Motorola PowerPC ProcessorID=00000000 Rev. PVR=80200020
Board: XXX MPC8560 [PowerQUICC III]
        CPU: 660 MHz
        CCB: 330 MHz
        DDR: 165 MHz
Performing version scanning
I2C:   ready
DRAM:  Configuring UPM for NAND
Configuring UPM for MSC8122 DSI Port
Initializing DRAM
    DDR: 256 MB
Relocating POST functions.
FLASH: 16 MB
L2 cache enabled: 256KB
In:    serial
Out:   serial
Err:   serial
Net:   MOTO ENET0: PHY is Intel LXT971A (1378e2)
MOTO ENET1: PHY is Intel LXT971A (1378e2)
MOTO ENET0, MOTO ENET1
POST I: Before relocation. <DEL> to start...   1 
POST II: After relocation. <DEL> to start...   1 
Micro Controller version 75
Hit any key to stop autoboot:  0 
## Booting image at ffd00000 ...
   Image Name:   070500 Linux-cscpp
   Created:      2007-05-30  14:49:24 UTC
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:    938254 Bytes = 916.3 kB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
## Loading RAMDisk Image at ff000000 ...
   Image Name:   070500 cscpp-REL_7_5
   Created:      2007-05-30  14:51:09 UTC
   Image Type:   PowerPC Linux RAMDisk Image (gzip compressed)
   Data Size:    3543240 Bytes =  3.4 MB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   Loading Ramdisk to 0fc4e000, end 0ffaf0c8 ... OK
Memory CAM mapping: CAM0=256Mb, CAM1=0Mb, CAM2=0Mb residual: 0Mb
Linux version 2.4.20_mvlcge31-cscpp-7.5 (root@turing) (gcc version 3.3.1 (MontaVista 3.3.1-3.0.10.0300532 2003-12-24)) #1 Wed May 30 20:14:43 IST 2007
max_pfn = 8192
On node 0 totalpages: 65536
zone(0): 65536 pages.
zone(1): 0 pages.
zone(2): 0 pages.
Kernel command line: root=/dev/ram rw console=ttyS0,115200 ip=off
OpenPIC Version 1.2 (1 CPUs and 44 IRQ sources) at fdf80000
time_init: decrementer frequency = 41.250000 MHz
hr_time_init: arch_to_nsec = 50840048, nsec_to_arch = 177167400
Calibrating delay loop... 658.63 BogoMIPS
Memory: 253056k available (1696k kernel code, 760k data, 68k init, 0k highmem)
RMON - kernel resource monitoring
Dentry cache hash table entries: 32768 (order: 6, 262144 bytes)
Inode cache hash table entries: 16384 (order: 5, 131072 bytes)
Mount-cache hash table entries: 4096 (order: 3, 32768 bytes)
Buffer-cache hash table entries: 16384 (order: 4, 65536 bytes)
Page-cache hash table entries: 65536 (order: 6, 262144 bytes)
POSIX conformance testing by UNIFIX
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
LSP Revision 14
ikconfig 0.5 with /proc/ikconfig
Starting kswapd
Journalled Block Device driver loaded
JFFS version 1.0, (C) 1999, 2000  Axis Communications AB
JFFS2 version 2.1. (C) 2001, 2002 Red Hat, Inc., designed by Axis Communications AB.
CPM UART driver version 0.01
ttyS0 on SCC1 at 0x8000, BRG1
pty: 256 Unix98 ptys configured
eth0: FCC ENET Version 0.3, 02:e0:0c:80:31:03
eth0: RMON initialized
RAMDISK driver initialized: 16 RAM disks of 32768K size 1024 blocksize
loop: loaded (max 8 devices)
eth1: Gianfar Ethernet Controller Version 1.0, 02:e0:0c:00:31:03 
eth1: Running with NAPI disabled
eth1: 64/64 RX/TX BD ring size
eth1: RMON initialized
eth2: Gianfar Ethernet Controller Version 1.0, 02:e0:0c:00:31:02 
eth2: Running with NAPI disabled
eth2: 64/64 RX/TX BD ring size
eth2: RMON initialized
network device driver for LKCD registered
Crash dump driver initialized.
CSC flash: Found 1 x16 devices at 0x0 in 16-bit bank
 Intel/Sharp Extended Query Table at 0x0031
Using buffer write method
cfi_cmdset_0001: Erase suspend on write enabled
Creating 7 MTD partitions on "CSC flash":
0x00f80000-0x01000000 : "uboot"
0x00d00000-0x00e00000 : "kernel0"
0x00e00000-0x00f00000 : "kernel1"
0x00700000-0x00d00000 : "app"
0x00000000-0x00380000 : "root0"
0x00380000-0x00700000 : "root1"
0x00f00000-0x00f80000 : "env"
Creating 2 MTD partitions on "CSC NVRAM":
0x00000000-0x00010000 : "applog"
0x00010000-0x00020000 : "kernellog"
NAND device: Manufacturer ID: 0x2c, Chip ID: 0xca (Unknown NAND 256MiB 3,3V 16-bit)
Scanning device for bad blocks
Bad eraseblock 1780 at 0x0de80000
Creating 1 MTD partitions on "NAND 256MiB 3,3V 16-bit":
0x00000000-0x10000000 : "NAND Partition"
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP, IGMP
IP: routing cache hash table of 2048 buckets, 16Kbytes
TCP: Hash tables configured (established 16384 bind 32768)
ip_conntrack version 2.1 (2048 buckets, 16384 max) - 296 bytes per conntrack
ip_tables: (C) 2000-2002 Netfilter core team
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
Event Broker Driver (C) 2001,2002 MontaVista Software (source@mvista.com)
Done starting sysfs
RAMDISK: Compressed image found at block 0
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<Hangs Here>>>>>>>>>>>>>>>>>>>>>>


Thanks in advance

Haroun Ansari M A


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

^ permalink raw reply

* [PATCH 6/8] [POWERPC] Fix the ability to reset on MPC8544 DS and MPC8568 MDS boards
From: Kumar Gala @ 2007-07-26  6:32 UTC (permalink / raw)
  To: linuxppc-dev

From: Roy Zang <tie-fei.zang@freescale.com>

Add global-utilities node with has-rstcr on MPC8544 DS and MPC8568 MDS
boards so they are able to reset properly.

Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 arch/powerpc/boot/dts/mpc8544ds.dts  |    6 ++++++
 arch/powerpc/boot/dts/mpc8568mds.dts |    6 ++++++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/boot/dts/mpc8544ds.dts b/arch/powerpc/boot/dts/mpc8544ds.dts
index d8ee4a0..4680e20 100644
--- a/arch/powerpc/boot/dts/mpc8544ds.dts
+++ b/arch/powerpc/boot/dts/mpc8544ds.dts
@@ -350,6 +350,12 @@
 
 		};
 
+		global-utilities@e0000 {	//global utilities block
+			compatible = "fsl,mpc8548-guts";
+			reg = <e0000 1000>;
+			fsl,has-rstcr;
+		};
+
 		mpic: pic@40000 {
 			clock-frequency = <0>;
 			interrupt-controller;
diff --git a/arch/powerpc/boot/dts/mpc8568mds.dts b/arch/powerpc/boot/dts/mpc8568mds.dts
index 99fa5a0..b1dcfbe 100644
--- a/arch/powerpc/boot/dts/mpc8568mds.dts
+++ b/arch/powerpc/boot/dts/mpc8568mds.dts
@@ -170,6 +170,12 @@
 			interrupt-parent = <&mpic>;
 		};
 
+		global-utilities@e0000 {	//global utilities block
+			compatible = "fsl,mpc8548-guts";
+			reg = <e0000 1000>;
+			fsl,has-rstcr;
+		};
+
 		pci@8000 {
 			interrupt-map-mask = <f800 0 0 7>;
 			interrupt-map = <
-- 
1.5.2.2

^ permalink raw reply related

* [PATCH 8/8] [POWERPC] Fix register labels on show_regs() message for 4xx/Book-E
From: Kumar Gala @ 2007-07-26  6:32 UTC (permalink / raw)
  To: linuxppc-dev

In a show_regs()  message The DEAR and ESR were reported as
DAR and DSISR which only exist on classic parts.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 arch/powerpc/kernel/process.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 84f000a..a83727b 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -423,7 +423,11 @@ void show_regs(struct pt_regs * regs)
 	printk("  CR: %08lx  XER: %08lx\n", regs->ccr, regs->xer);
 	trap = TRAP(regs);
 	if (trap == 0x300 || trap == 0x600)
+#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
+		printk("DEAR: "REG", ESR: "REG"\n", regs->dar, regs->dsisr);
+#else
 		printk("DAR: "REG", DSISR: "REG"\n", regs->dar, regs->dsisr);
+#endif
 	printk("TASK = %p[%d] '%s' THREAD: %p",
 	       current, current->pid, current->comm, task_thread_info(current));
 
-- 
1.5.2.2

^ permalink raw reply related

* [PATCH 7/8] [POWERPC] Only allow building of BootX text support on PPC_MULTIPLATFORM
From: Kumar Gala @ 2007-07-26  6:32 UTC (permalink / raw)
  To: linuxppc-dev

BootX text code is only supported on systems with real OF at this point
which is PPC_OF && PPC_MULTIPLATFORM.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 arch/powerpc/Kconfig.debug |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug
index 346cd3b..5c71624 100644
--- a/arch/powerpc/Kconfig.debug
+++ b/arch/powerpc/Kconfig.debug
@@ -134,7 +134,7 @@ config BDI_SWITCH
 
 config BOOTX_TEXT
 	bool "Support for early boot text console (BootX or OpenFirmware only)"
-	depends PPC_OF
+	depends PPC_OF && PPC_MULTIPLATFORM
 	help
 	  Say Y here to see progress messages from the boot firmware in text
 	  mode. Requires either BootX or Open Firmware.
-- 
1.5.2.2

^ permalink raw reply related

* [PATCH 5/8] [POWERPC] Fix mpc7448hpc2 tsi108 device_type bug
From: Kumar Gala @ 2007-07-26  6:32 UTC (permalink / raw)
  To: linuxppc-dev

From: Roy Zang <tie-fei.zang@freescale.com>

Fix mpc7448hpc2 tsi108 device_type bug.
Wrong device type will break the board startup.

Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 arch/powerpc/boot/dts/mpc7448hpc2.dts |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/boot/dts/mpc7448hpc2.dts b/arch/powerpc/boot/dts/mpc7448hpc2.dts
index 0e3d314..b9158eb 100644
--- a/arch/powerpc/boot/dts/mpc7448hpc2.dts
+++ b/arch/powerpc/boot/dts/mpc7448hpc2.dts
@@ -45,7 +45,7 @@
 		#address-cells = <1>;
 		#size-cells = <1>;
 		#interrupt-cells = <2>;
-		device_type = "tsi108-bridge";
+		device_type = "tsi-bridge";
 		ranges = <00000000 c0000000 00010000>;
 		reg = <c0000000 00010000>;
 		bus-frequency = <0>;
-- 
1.5.2.2

^ permalink raw reply related

* [PATCH 4/8] [POWREPC] Fixup a number of modpost warnings on ppc32
From: Kumar Gala @ 2007-07-26  6:32 UTC (permalink / raw)
  To: linuxppc-dev

Fixed the following warnings:

WARNING: vmlinux.o(.text+0x2934): Section mismatch: reference to .init.text:__alloc_bootmem (between 'irq_alloc_host' and 'irq_set_default_host')
WARNING: vmlinux.o(.text+0xb2aa): Section mismatch: reference to .init.data:boot_command_line (between 'register_early_udbg_console' and 'udbg_printf')
WARNING: vmlinux.o(.text+0xb2b2): Section mismatch: reference to .init.data:boot_command_line (between 'register_early_udbg_console' and 'udbg_printf')
WARNING: vmlinux.o(.text+0xe354): Section mismatch: reference to .init.text:__alloc_bootmem (between 'pcibios_alloc_controller' and 'pci_domain_nr')
WARNING: vmlinux.o(.text+0x12768): Section mismatch: reference to .init.text:update_bridge_resource (between 'quirk_fsl_pcie_transparent' and 'indirect_read_config')
WARNING: vmlinux.o(.text+0x127a8): Section mismatch: reference to .init.text:update_bridge_resource (between 'quirk_fsl_pcie_transparent' and 'indirect_read_config')
WARNING: vmlinux.o(.text+0x17566c): Section mismatch: reference to .init.text:pcibios_fixup_bus (between 'pci_scan_child_bus' and 'pci_scan_bus_parented')

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 arch/powerpc/kernel/irq.c        |    8 ++++----
 arch/powerpc/kernel/pci-common.c |    2 +-
 arch/powerpc/kernel/pci_32.c     |    2 +-
 arch/powerpc/kernel/udbg.c       |    2 +-
 arch/powerpc/sysdev/fsl_pci.c    |    2 +-
 5 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 2fc8786..24bea97 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -418,10 +418,10 @@ irq_hw_number_t virq_to_hw(unsigned int virq)
 }
 EXPORT_SYMBOL_GPL(virq_to_hw);
 
-struct irq_host *irq_alloc_host(unsigned int revmap_type,
-				unsigned int revmap_arg,
-				struct irq_host_ops *ops,
-				irq_hw_number_t inval_irq)
+__init_refok struct irq_host *irq_alloc_host(unsigned int revmap_type,
+						unsigned int revmap_arg,
+						struct irq_host_ops *ops,
+						irq_hw_number_t inval_irq)
 {
 	struct irq_host *host;
 	unsigned int size = sizeof(struct irq_host);
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index fe7d125..7b41a99 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -65,7 +65,7 @@ static void __devinit pci_setup_pci_controller(struct pci_controller *hose)
 	spin_unlock(&hose_spinlock);
 }
 
-struct pci_controller * pcibios_alloc_controller(struct device_node *dev)
+__init_refok struct pci_controller * pcibios_alloc_controller(struct device_node *dev)
 {
 	struct pci_controller *phb;
 
diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
index 395086f..cd35c96 100644
--- a/arch/powerpc/kernel/pci_32.c
+++ b/arch/powerpc/kernel/pci_32.c
@@ -1247,7 +1247,7 @@ pcibios_init(void)
 
 subsys_initcall(pcibios_init);
 
-void __init pcibios_fixup_bus(struct pci_bus *bus)
+void pcibios_fixup_bus(struct pci_bus *bus)
 {
 	struct pci_controller *hose = (struct pci_controller *) bus->sysdata;
 	unsigned long io_offset;
diff --git a/arch/powerpc/kernel/udbg.c b/arch/powerpc/kernel/udbg.c
index cbca1df..0f9b4ea 100644
--- a/arch/powerpc/kernel/udbg.c
+++ b/arch/powerpc/kernel/udbg.c
@@ -155,7 +155,7 @@ static int early_console_initialized;
  * Called by setup_system after ppc_md->probe and ppc_md->early_init.
  * Call it again after setting udbg_putc in ppc_md->setup_arch.
  */
-void register_early_udbg_console(void)
+void __init register_early_udbg_console(void)
 {
 	if (early_console_initialized)
 		return;
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index 8712227..9fb0ce5 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -107,7 +107,7 @@ void __init setup_pci_cmd(struct pci_controller *hose)
 	}
 }
 
-static void __devinit quirk_fsl_pcie_transparent(struct pci_dev *dev)
+static void __init quirk_fsl_pcie_transparent(struct pci_dev *dev)
 {
 	struct resource *res;
 	int i, res_idx = PCI_BRIDGE_RESOURCES;
-- 
1.5.2.2

^ permalink raw reply related

* [PATCH 3/8] [POWERPC] Fix ethernet PHY support on MPC8544 DS
From: Kumar Gala @ 2007-07-26  6:32 UTC (permalink / raw)
  To: linuxppc-dev

The MPC8544 dts needed to set the new phy-connection-type to rgmii-id
for the Vitesse PHY on the board to work properly.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 arch/powerpc/boot/dts/mpc8544ds.dts |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/boot/dts/mpc8544ds.dts b/arch/powerpc/boot/dts/mpc8544ds.dts
index 4a900c6..d8ee4a0 100644
--- a/arch/powerpc/boot/dts/mpc8544ds.dts
+++ b/arch/powerpc/boot/dts/mpc8544ds.dts
@@ -104,6 +104,7 @@
 			interrupts = <1d 2 1e 2 22 2>;
 			interrupt-parent = <&mpic>;
 			phy-handle = <&phy0>;
+			phy-connection-type = "rgmii-id";
 		};
 
 		ethernet@26000 {
@@ -117,6 +118,7 @@
 			interrupts = <1f 2 20 2 21 2>;
 			interrupt-parent = <&mpic>;
 			phy-handle = <&phy1>;
+			phy-connection-type = "rgmii-id";
 		};
 
 		serial@4500 {
-- 
1.5.2.2

^ permalink raw reply related

* [PATCH 2/8] [POWERPC] Don't try to allocate resources for a Freescale POWERPC PHB
From: Kumar Gala @ 2007-07-26  6:32 UTC (permalink / raw)
  To: linuxppc-dev

The Freescale PCI PHBs actual report back values in the BAR registers
this causes issues in that we try to allocate resources for them
and will get error messages like the following on MPC8544 DS:

PCI: Failed to allocate mem resource #1:80000000@0 for 0000:00:00.0

To address this if we are class PCI_CLASS_PROCESSOR_POWERPC, a normal
header type, and the PHB we clear out all the resources.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 arch/powerpc/kernel/pci_32.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
index 721a694..395086f 100644
--- a/arch/powerpc/kernel/pci_32.c
+++ b/arch/powerpc/kernel/pci_32.c
@@ -60,6 +60,24 @@ LIST_HEAD(hose_list);
 static int pci_bus_count;
 
 static void
+fixup_hide_host_resource_fsl(struct pci_dev* dev)
+{
+	int i, class = dev->class >> 8;
+
+	if ((class == PCI_CLASS_PROCESSOR_POWERPC) &&
+		(dev->hdr_type == PCI_HEADER_TYPE_NORMAL) &&
+		(dev->bus->parent == NULL)) {
+		for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
+			dev->resource[i].start = 0;
+			dev->resource[i].end = 0;
+			dev->resource[i].flags = 0;
+		}
+	}
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MOTOROLA, PCI_ANY_ID, fixup_hide_host_resource_fsl); 
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_FREESCALE, PCI_ANY_ID, fixup_hide_host_resource_fsl); 
+
+static void
 fixup_broken_pcnet32(struct pci_dev* dev)
 {
 	if ((dev->class>>8 == PCI_CLASS_NETWORK_ETHERNET)) {
-- 
1.5.2.2

^ permalink raw reply related

* [PATCH 1/8] [POWERPC] Fix PCI indirect for big-endian cfg_addr
From: Kumar Gala @ 2007-07-26  6:32 UTC (permalink / raw)
  To: linuxppc-dev

We didn't actually propogate the flag we pass into setup_indirect_pci()
to set indirect_type and thus were getting the wrong endianness if
PPC_INDIRECT_TYPE_BIG_ENDIAN was set.

Also, we need to or in additional flags rather than just doing a
direct assignment.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 arch/powerpc/sysdev/fsl_pci.c      |    2 +-
 arch/powerpc/sysdev/indirect_pci.c |    1 +
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index 51c2233..8712227 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -216,7 +216,7 @@ int __init fsl_add_bridge(struct device_node *dev, int is_primary)
 
 	/* check PCI express link status */
 	if (early_find_capability(hose, 0, 0, PCI_CAP_ID_EXP)) {
-		hose->indirect_type = PPC_INDIRECT_TYPE_EXT_REG |
+		hose->indirect_type |= PPC_INDIRECT_TYPE_EXT_REG |
 			PPC_INDIRECT_TYPE_SURPRESS_PRIMARY_BUS;
 		if (fsl_pcie_check_link(hose))
 			hose->indirect_type |= PPC_INDIRECT_TYPE_NO_PCIE_LINK;
diff --git a/arch/powerpc/sysdev/indirect_pci.c b/arch/powerpc/sysdev/indirect_pci.c
index a8ac2df..5294560 100644
--- a/arch/powerpc/sysdev/indirect_pci.c
+++ b/arch/powerpc/sysdev/indirect_pci.c
@@ -160,4 +160,5 @@ setup_indirect_pci(struct pci_controller* hose, u32 cfg_addr, u32 cfg_data, u32
 		mbase = ioremap(cfg_data & PAGE_MASK, PAGE_SIZE);
 	hose->cfg_data = mbase + (cfg_data & ~PAGE_MASK);
 	hose->ops = &indirect_pci_ops;
+	hose->indirect_type = flags;
 }
-- 
1.5.2.2

^ permalink raw reply related

* [PATCH 0/8] Fixes for 2.6.23
From: Kumar Gala @ 2007-07-26  6:32 UTC (permalink / raw)
  To: linuxppc-dev

Here are the individual patches in my for-2.6.23 branch.  Posting them
here for completeness.

- k

^ permalink raw reply

* Please pull from 'fixes-2.6.23' branch
From: Kumar Gala @ 2007-07-26  6:28 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev

Please pull from 'fixes-2.6.23' branch of

	master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc.git fixes-2.6.23

to receive the following updates:

 arch/powerpc/Kconfig.debug            |    2 +-
 arch/powerpc/boot/dts/mpc7448hpc2.dts |    2 +-
 arch/powerpc/boot/dts/mpc8544ds.dts   |    8 ++++++++
 arch/powerpc/boot/dts/mpc8568mds.dts  |    6 ++++++
 arch/powerpc/kernel/irq.c             |    8 ++++----
 arch/powerpc/kernel/pci-common.c      |    2 +-
 arch/powerpc/kernel/pci_32.c          |   20 +++++++++++++++++++-
 arch/powerpc/kernel/process.c         |    4 ++++
 arch/powerpc/kernel/udbg.c            |    2 +-
 arch/powerpc/sysdev/fsl_pci.c         |    4 ++--
 arch/powerpc/sysdev/indirect_pci.c    |    1 +
 11 files changed, 48 insertions(+), 11 deletions(-)

Kumar Gala (6):
      [POWERPC] Fix PCI indirect for big-endian cfg_addr
      [POWERPC] Don't try to allocate resources for a Freescale POWERPC PHB
      [POWERPC] Fix ethernet PHY support on MPC8544 DS
      [POWREPC] Fixup a number of modpost warnings on ppc32
      [POWERPC] Only allow building of BootX text support on PPC_MULTIPLATFORM
      [POWERPC] Fix register labels on show_regs() message for 4xx/Book-E

Roy Zang (2):
      [POWERPC] Fix mpc7448hpc2 tsi108 device_type bug
      [POWERPC] Fix the ability to reset on MPC8544 DS and MPC8568 MDS boards

^ permalink raw reply

* Re: [PATCH] POWERPC: Fix definition of global-utilites structure for 86xx
From: Kumar Gala @ 2007-07-26  6:08 UTC (permalink / raw)
  To: Timur Tabi; +Cc: linuxppc-dev
In-Reply-To: <11853846332917-git-send-email-timur@freescale.com>


On Jul 25, 2007, at 12:30 PM, Timur Tabi wrote:

> The current definition of struct ccsr_guts in immap_86xx.h was for  
> 85xx.
> This patch fixes that and replaces the vague integer types with  
> sized types
> of the correct endianness.  The unused struct ccsr_pci is also  
> deleted.
>
> Signed-off-by: Timur Tabi <timur@freescale.com>
> ---
>  include/asm-powerpc/immap_86xx.h |  151 +++++++++++ 
> +--------------------------
>  1 files changed, 46 insertions(+), 105 deletions(-)

Why don't we remove this completely, nothing uses it?

- k

^ permalink raw reply

* [PATCH] gfar: Fix modpost warning
From: Kumar Gala @ 2007-07-26  5:52 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev, linuxppc-dev

Fix the following modpost warning:

WARNING: vmlinux.o(.init.text+0x1aa6c): Section mismatch: reference to .exit.text:gfar_mdio_exit (between 'gfar_init' and 'gfar_mdio_init')

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 drivers/net/gianfar_mii.c |    2 +-
 drivers/net/gianfar_mii.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/gianfar_mii.c b/drivers/net/gianfar_mii.c
index ac3596f..100bf41 100644
--- a/drivers/net/gianfar_mii.c
+++ b/drivers/net/gianfar_mii.c
@@ -245,7 +245,7 @@ int __init gfar_mdio_init(void)
 	return driver_register(&gianfar_mdio_driver);
 }

-void __exit gfar_mdio_exit(void)
+void gfar_mdio_exit(void)
 {
 	driver_unregister(&gianfar_mdio_driver);
 }
diff --git a/drivers/net/gianfar_mii.h b/drivers/net/gianfar_mii.h
index 5d34004..b373091 100644
--- a/drivers/net/gianfar_mii.h
+++ b/drivers/net/gianfar_mii.h
@@ -42,5 +42,5 @@ struct gfar_mii {
 int gfar_mdio_read(struct mii_bus *bus, int mii_id, int regnum);
 int gfar_mdio_write(struct mii_bus *bus, int mii_id, int regnum, u16 value);
 int __init gfar_mdio_init(void);
-void __exit gfar_mdio_exit(void);
+void gfar_mdio_exit(void);
 #endif /* GIANFAR_PHY_H */
-- 
1.5.2.2

^ permalink raw reply related

* Re: [PATCH] fix ppc kernels after build-id addition
From: Paul Mackerras @ 2007-07-26  5:01 UTC (permalink / raw)
  To: Meelis Roos; +Cc: linuxppc-dev, Linux Kernel list
In-Reply-To: <Pine.SOC.4.64.0707251301200.21641@math.ut.ee>

Meelis Roos writes:

> This patch fixes arch/ppc kernels, at least for prep subarch, after 
> build-id addition. Without the patch, kernels were 3 times the size and 
> bootloader refused to load them. Now they are back to normal again.

I just built an ARCH=ppc kernel for the prep subarch and the vmlinux
size was normal.  Can you identify exactly why the kernels got so much
bigger, i.e. what is taking up all the space?

Paul.

^ permalink raw reply

* [PATCH 3/3] powerpc: Fix Maple platform ISA bus
From: Benjamin Herrenschmidt @ 2007-07-26  4:07 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev

The Maple platform has ISA IOs but didn't call the new functions to
actually map those, thus crashing when trying to access the nvram.

This fixes Maple and js2x using SLOF

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 
 arch/powerpc/platforms/maple/pci.c |    3 +++
 1 file changed, 3 insertions(+)

Index: linux-work/arch/powerpc/platforms/maple/pci.c
===================================================================
--- linux-work.orig/arch/powerpc/platforms/maple/pci.c	2007-07-25 16:29:22.000000000 +1000
+++ linux-work/arch/powerpc/platforms/maple/pci.c	2007-07-26 10:30:43.000000000 +1000
@@ -490,6 +490,9 @@ static int __init maple_add_bridge(struc
 	/* Fixup "bus-range" OF property */
 	fixup_bus_range(dev);
 
+	/* Check for legacy IOs */
+	isa_bridge_find_early(hose);
+
 	return 0;
 }
 

^ permalink raw reply

* [PATCH 2/3] powerpc: Make pci_iounmap actually unmap things
From: Benjamin Herrenschmidt @ 2007-07-26  4:07 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev

This patch uses the newly added functions for testing if an address is
an ISA or PCI IO port to properly unmap things in pci_iounmap that
aren't such ports. Without that, drivers using the iomap API will never
actually unmap resources which on IBM server machines will prevent
hot-unplug of the corresponding HW adapters.

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

 arch/powerpc/kernel/iomap.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Index: linux-work/arch/powerpc/kernel/iomap.c
===================================================================
--- linux-work.orig/arch/powerpc/kernel/iomap.c	2007-07-26 13:44:23.000000000 +1000
+++ linux-work/arch/powerpc/kernel/iomap.c	2007-07-26 13:50:48.000000000 +1000
@@ -7,6 +7,7 @@
 #include <linux/pci.h>
 #include <linux/mm.h>
 #include <asm/io.h>
+#include <asm/pci-bridge.h>
 
 /*
  * Here comes the ppc64 implementation of the IOMAP 
@@ -136,7 +137,12 @@ void __iomem *pci_iomap(struct pci_dev *
 
 void pci_iounmap(struct pci_dev *dev, void __iomem *addr)
 {
-	/* Nothing to do */
+	if (isa_vaddr_is_ioport(addr))
+		return;
+	if (pcibios_vaddr_is_ioport(addr))
+		return;
+	iounmap(addr);
 }
+
 EXPORT_SYMBOL(pci_iomap);
 EXPORT_SYMBOL(pci_iounmap);

^ permalink raw reply

* [PATCH 1/3] powerpc: Add function to check if address is an IO port
From: Benjamin Herrenschmidt @ 2007-07-26  4:07 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev

This adds a function that tells you if a given kernel virtual address
is hitting a PCI or ISA IO port permanent mapping or not. This is to
be used in the next patch to fix iomap APIs to properly unmap things.

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

 arch/powerpc/kernel/pci-common.c |   23 +++++++++++++++++++++++
 include/asm-powerpc/pci-bridge.h |   20 ++++++++++++++++++++
 2 files changed, 43 insertions(+)

Index: linux-work/arch/powerpc/kernel/pci-common.c
===================================================================
--- linux-work.orig/arch/powerpc/kernel/pci-common.c	2007-07-26 13:21:41.000000000 +1000
+++ linux-work/arch/powerpc/kernel/pci-common.c	2007-07-26 13:38:48.000000000 +1000
@@ -101,6 +101,29 @@ void pcibios_free_controller(struct pci_
 		kfree(phb);
 }
 
+int pcibios_vaddr_is_ioport(void __iomem *address)
+{
+	int ret = 0;
+	struct pci_controller *hose;
+	unsigned long size;
+
+	spin_lock(&hose_spinlock);
+	list_for_each_entry(hose, &hose_list, list_node) {
+#ifdef CONFIG_PPC64
+		size = hose->pci_io_size;
+#else
+		size = hose->io_resource.end - hose->io_resource.start + 1;
+#endif
+		if (address >= hose->io_base_virt &&
+		    address < (hose->io_base_virt + size)) {
+			ret = 1;
+			break;
+		}
+	}
+	spin_unlock(&hose_spinlock);
+	return ret;
+}
+
 /*
  * Return the domain number for this bus.
  */
Index: linux-work/include/asm-powerpc/pci-bridge.h
===================================================================
--- linux-work.orig/include/asm-powerpc/pci-bridge.h	2007-07-26 13:21:41.000000000 +1000
+++ linux-work/include/asm-powerpc/pci-bridge.h	2007-07-26 14:01:01.000000000 +1000
@@ -64,6 +64,14 @@ static inline struct pci_controller *pci
 	return bus->sysdata;
 }
 
+static inline int isa_vaddr_is_ioport(void __iomem *address)
+{
+	/* No specific ISA handling on ppc32 at this stage, it
+	 * all goes through PCI
+	 */
+	return 0;
+}
+
 /* These are used for config access before all the PCI probing
    has been done. */
 int early_read_config_byte(struct pci_controller *hose, int bus, int dev_fn,
@@ -231,6 +239,13 @@ extern void pcibios_free_controller(stru
 
 extern void isa_bridge_find_early(struct pci_controller *hose);
 
+static inline int isa_vaddr_is_ioport(void __iomem *address)
+{
+	/* Check if address hits the reserved legacy IO range */
+	unsigned long ea = (unsigned long)address;
+	return ea >= ISA_IO_BASE && ea < ISA_IO_END;
+}
+
 extern int pcibios_unmap_io_space(struct pci_bus *bus);
 extern int pcibios_map_io_space(struct pci_bus *bus);
 
@@ -261,11 +276,16 @@ extern struct pci_controller *
 pcibios_alloc_controller(struct device_node *dev);
 #ifdef CONFIG_PCI
 extern unsigned long pci_address_to_pio(phys_addr_t address);
+extern int pcibios_vaddr_is_ioport(void __iomem *address);
 #else
 static inline unsigned long pci_address_to_pio(phys_addr_t address)
 {
 	return (unsigned long)-1;
 }
+static inline int pcibios_vaddr_is_ioport(void __iomem *address)
+{
+	return 0;
+}
 #endif
 
 

^ permalink raw reply

* [PATCH v2][POWERPC] Don't try to allocate resources for a POWERPC PHB
From: Kumar Gala @ 2007-07-26  3:47 UTC (permalink / raw)
  To: linuxppc-dev

>From e314b31e4650c789829bf870f83ee7ae4be46426 Mon Sep 17 00:00:00 2001
From: Kumar Gala <galak@kernel.crashing.org>
Date: Wed, 25 Jul 2007 00:44:11 -0500
Subject: [PATCH] [POWERPC] Don't try to allocate resources for a POWERPC PHB

The Freescale PCI PHBs actual report back values in the BAR registers
this causes issues in that we try to allocate resources for them
and will get error messages like the following on MPC8544 DS:

PCI: Failed to allocate mem resource #1:80000000@0 for 0000:00:00.0

To address this if we are class PCI_CLASS_PROCESSOR_POWERPC, a normal
header type, and the PHB we clear out all the resources.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---

Ben suggested to do this by a quirk and blow away the resources which I
like better.

- k

 arch/powerpc/kernel/pci_32.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
index 721a694..ec80779 100644
--- a/arch/powerpc/kernel/pci_32.c
+++ b/arch/powerpc/kernel/pci_32.c
@@ -60,6 +60,24 @@ LIST_HEAD(hose_list);
 static int pci_bus_count;

 static void
+fixup_broken_fsl(struct pci_dev* dev)
+{
+	int i, class = dev->class >> 8;
+
+	if ((class == PCI_CLASS_PROCESSOR_POWERPC) &&
+		(dev->hdr_type == PCI_HEADER_TYPE_NORMAL) &&
+		(dev->bus->parent == NULL)) {
+		for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
+			dev->resource[i].start = 0;
+			dev->resource[i].end = 0;
+			dev->resource[i].flags = 0;
+		}
+	}
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MOTOROLA, PCI_ANY_ID, fixup_broken_fsl);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_FREESCALE, PCI_ANY_ID, fixup_broken_fsl);
+
+static void
 fixup_broken_pcnet32(struct pci_dev* dev)
 {
 	if ((dev->class>>8 == PCI_CLASS_NETWORK_ETHERNET)) {
-- 
1.5.2.2

^ permalink raw reply related

* Re: [PATCH] Re: 2.6.22-git hangs during boot on PowerBook G3 in 0.0 seconds
From: Paul Mackerras @ 2007-07-26  3:42 UTC (permalink / raw)
  To: Kim Phillips; +Cc: Rutger Nijlunsing, linuxppc-dev
In-Reply-To: <20070724185946.722f34b5.kim.phillips@freescale.com>

Kim Phillips writes:

> > In which circumstances are you trying to translate an address with no
> > size cell ?
> 
> for the enumerated PHYs. As the original commit comment states, I was
> getting these messages:
> 
> prom_parse: Bad cell count for /qe@e0100000/mdio@2120/ethernet-phy@00
> prom_parse: Bad cell count for /qe@e0100000/mdio@2120/ethernet-phy@01

Specifically, which of_address_to_resource or other call is producing
these error messages?

Paul.

^ permalink raw reply

* Re: [PATCH] Re: 2.6.22-git hangs during boot on PowerBook G3 in 0.0 seconds
From: Paul Mackerras @ 2007-07-26  3:31 UTC (permalink / raw)
  To: Kim Phillips; +Cc: Rutger Nijlunsing, linuxppc-dev
In-Reply-To: <20070724185946.722f34b5.kim.phillips@freescale.com>

Kim Phillips writes:

> but yeah, size-cells should be allowed to be 0 (even address-cells) and
> it may be the case that the Lombard needs some fixup code.

So it turns out that the nvram is under the via-pmu node on the
Lombard.  The via-pmu node has #size-cells == 0, which is correct
since things under the via-pmu aren't directly accessible.  The nvram
driver code relies on not being able to translate an address for the
nvram nodes on machines where the nvram isn't directly accessible.
That is, it looks for "nvram" nodes, and if it can translate the
address, assumes it can access the nvram directly.

So nothing is incorrect here except your patch. :)  I'll revert it.

Paul.

^ permalink raw reply

* Re: DTC 1.0.0 Release Coming?
From: David Gibson @ 2007-07-26  3:05 UTC (permalink / raw)
  To: Jon Loeliger; +Cc: linuxppc-dev
In-Reply-To: <E1IDjSy-0003eC-T4@jdl.com>

On Wed, Jul 25, 2007 at 11:12:00AM -0500, Jon Loeliger wrote:
> Folks,
> 
> I'd like to make an official DTC Version 1.0.0 release soon!
> To that end, I've published a repo on jdl.com with a v1.0.0-rc1
> tag on it.  I anticipate some updates to the Documentation before
> a final 1.0.0 release still.  However, if you have something
> you would like to have be in The Real 1.0.0 release, please
> let me know soon!

It would certainly be great to have a release, since dtc is becoming
necessary for more and more kernel builds.

Only thing I'm not really happy with in the current release is the
versioning stuff.  For starters, it always reports my builds as
-dirty, even when they're not.  It also seems a bit hideously
complicated for what it does.  I'd prefer to see something simpler
using git-describe to derive the version strings directly from the git
tags themselves.  Obviously we need some sort of cacheing mechanism to
make the versioning work for tarball releases without the git history,
but I think we can handle that with a suitable "make dist" target.

I'll see if I can make a patch or two in the next few days.

-- 
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

^ permalink raw reply

* Re: [PATCH] [POWERPC] iSeries: fix section mismatch warnings
From: Stephen Rothwell @ 2007-07-26  1:56 UTC (permalink / raw)
  To: will_schmidt; +Cc: ppc-dev, paulus
In-Reply-To: <1185382531.22237.46.camel@farscape.rchland.ibm.com>

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

Hi Will,

On Wed, 25 Jul 2007 11:55:31 -0500 Will Schmidt <will_schmidt@vnet.ibm.com> wrote:
>
> >  	cmpwi	0,r24,0			/* Are we processor 0? */
> > -	beq	.__start_initialization_iSeries	/* Start up the first processor */
> > -	mfspr	r4,SPRN_CTRLF
> > +	bne	1f
> > +	b	.__start_initialization_iSeries	/* Start up the first processor */
> > +1:	mfspr	r4,SPRN_CTRLF
> >  	li	r5,CTRL_RUNLATCH	/* Turn off the run light */
> 
> This part isnt clicking for me.. 
> How does changing a "beq" to a "bne" over a "b" fit into changing
> __start_initialization_iSeries static?  

Because I moved __start_initialization_iSeries into another section, it
ends up too far away for a conditional branch so something adds a jump
table to the .text section and changes this branch to be via that table.
Unfortunately, the jump table ends up at the start of the .text and ruins
our carefully laid out kernel image.  By inverting the test I can turn
the branch into an unconditional one which has a larger possible offse
(effectively building the jump table manually).

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply

* Re: [PATCH] Fix ibmvscsi client for multiplatform iSeries+pSeries kernel.
From: Michael Ellerman @ 2007-07-26  1:27 UTC (permalink / raw)
  To: David Woodhouse; +Cc: Stephen Rothwell, Paul Mackerras, linuxppc-dev
In-Reply-To: <1185374509.14697.384.camel@pmac.infradead.org>

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

On Wed, 2007-07-25 at 15:41 +0100, David Woodhouse wrote:
> If you build a multiplatform kernel for iSeries and pSeries, with
> ibmvscsic support, the resulting client doesn't work on iSeries.
> 
> This patch should fix that, using the appropriate low-level operations
> for the machine detected at runtime.
> 
> Signed-off-by: David Woodhouse <dwmw2@infradead.org>

Nice that someone finally fixed this up.

But I get:

drivers/scsi/ibmvscsi/ibmvscsi.c:1651: error: 'FW_FEATURE_ISERIES' undeclared (first use in this function)
drivers/scsi/ibmvscsi/ibmvscsi.c:1651: error: (Each undeclared identifier is reported only once
drivers/scsi/ibmvscsi/ibmvscsi.c:1651: error: for each function it appears in.)
drivers/scsi/ibmvscsi/ibmvscsi.c:1653: error: 'FW_FEATURE_VIO' undeclared (first use in this function)

Missing <asm/firmware.h> ?

cheers


> --- linux-2.6.19.ppc64/drivers/scsi/ibmvscsi/rpa_vscsi.c~	2006-11-29 21:57:37.000000000 +0000
> +++ linux-2.6.19.ppc64/drivers/scsi/ibmvscsi/rpa_vscsi.c	2006-12-19 15:42:57.000000000 +0000
> @@ -42,14 +42,14 @@ static unsigned int partition_number = -
>   * Routines for managing the command/response queue
>   */
>  /**
> - * ibmvscsi_handle_event: - Interrupt handler for crq events
> + * rpavscsi_handle_event: - Interrupt handler for crq events
>   * @irq:	number of irq to handle, not used
>   * @dev_instance: ibmvscsi_host_data of host that received interrupt
>   *
>   * Disables interrupts and schedules srp_task
>   * Always returns IRQ_HANDLED
>   */
> -static irqreturn_t ibmvscsi_handle_event(int irq, void *dev_instance)
> +static irqreturn_t rpavscsi_handle_event(int irq, void *dev_instance)
>  {
>  	struct ibmvscsi_host_data *hostdata =
>  	    (struct ibmvscsi_host_data *)dev_instance;
> @@ -66,9 +66,9 @@ static irqreturn_t ibmvscsi_handle_event
>   * Frees irq, deallocates a page for messages, unmaps dma, and unregisters
>   * the crq with the hypervisor.
>   */
> -void ibmvscsi_release_crq_queue(struct crq_queue *queue,
> -				struct ibmvscsi_host_data *hostdata,
> -				int max_requests)
> +static void rpavscsi_release_crq_queue(struct crq_queue *queue,
> +				       struct ibmvscsi_host_data *hostdata,
> +				       int max_requests)
>  {
>  	long rc;
>  	struct vio_dev *vdev = to_vio_dev(hostdata->dev);
> @@ -108,12 +108,13 @@ static struct viosrp_crq *crq_queue_next
>  }
>  
>  /**
> - * ibmvscsi_send_crq: - Send a CRQ
> + * rpavscsi_send_crq: - Send a CRQ
>   * @hostdata:	the adapter
>   * @word1:	the first 64 bits of the data
>   * @word2:	the second 64 bits of the data
>   */
> -int ibmvscsi_send_crq(struct ibmvscsi_host_data *hostdata, u64 word1, u64 word2)
> +static int rpavscsi_send_crq(struct ibmvscsi_host_data *hostdata,
> +			     u64 word1, u64 word2)
>  {
>  	struct vio_dev *vdev = to_vio_dev(hostdata->dev);
>  
> @@ -121,10 +122,10 @@ int ibmvscsi_send_crq(struct ibmvscsi_ho
>  }
>  
>  /**
> - * ibmvscsi_task: - Process srps asynchronously
> + * rpavscsi_task: - Process srps asynchronously
>   * @data:	ibmvscsi_host_data of host
>   */
> -static void ibmvscsi_task(void *data)
> +static void rpavscsi_task(void *data)
>  {
>  	struct ibmvscsi_host_data *hostdata = (struct ibmvscsi_host_data *)data;
>  	struct vio_dev *vdev = to_vio_dev(hostdata->dev);
> @@ -189,6 +190,42 @@ static void set_adapter_info(struct ibmv
>  }
>  
>  /**
> + * reset_crq_queue: - resets a crq after a failure
> + * @queue:	crq_queue to initialize and register
> + * @hostdata:	ibmvscsi_host_data of host
> + *
> + */
> +static int rpavscsi_reset_crq_queue(struct crq_queue *queue,
> +				    struct ibmvscsi_host_data *hostdata)
> +{
> +	int rc;
> +	struct vio_dev *vdev = to_vio_dev(hostdata->dev);
> +
> +	/* Close the CRQ */
> +	do {
> +		rc = plpar_hcall_norets(H_FREE_CRQ, vdev->unit_address);
> +	} while ((rc == H_BUSY) || (H_IS_LONG_BUSY(rc)));
> +
> +	/* Clean out the queue */
> +	memset(queue->msgs, 0x00, PAGE_SIZE);
> +	queue->cur = 0;
> +
> +	set_adapter_info(hostdata);
> +
> +	/* And re-open it again */
> +	rc = plpar_hcall_norets(H_REG_CRQ,
> +				vdev->unit_address,
> +				queue->msg_token, PAGE_SIZE);
> +	if (rc == 2) {
> +		/* Adapter is good, but other end is not ready */
> +		printk(KERN_WARNING "ibmvscsi: Partner adapter not ready\n");
> +	} else if (rc != 0) {
> +		printk(KERN_WARNING
> +		       "ibmvscsi: couldn't register crq--rc 0x%x\n", rc);
> +	}
> +	return rc;
> +}
> +/**
>   * initialize_crq_queue: - Initializes and registers CRQ with hypervisor
>   * @queue:	crq_queue to initialize and register
>   * @hostdata:	ibmvscsi_host_data of host
> @@ -197,9 +234,9 @@ static void set_adapter_info(struct ibmv
>   * the crq with the hypervisor.
>   * Returns zero on success.
>   */
> -int ibmvscsi_init_crq_queue(struct crq_queue *queue,
> -			    struct ibmvscsi_host_data *hostdata,
> -			    int max_requests)
> +static int rpavscsi_init_crq_queue(struct crq_queue *queue,
> +				   struct ibmvscsi_host_data *hostdata,
> +				   int max_requests)
>  {
>  	int rc;
>  	int retrc;
> @@ -226,7 +263,7 @@ int ibmvscsi_init_crq_queue(struct crq_q
>  				queue->msg_token, PAGE_SIZE);
>  	if (rc == H_RESOURCE)
>  		/* maybe kexecing and resource is busy. try a reset */
> -		rc = ibmvscsi_reset_crq_queue(queue,
> +		rc = rpavscsi_reset_crq_queue(queue,
>  					      hostdata);
>  
>  	if (rc == 2) {
> @@ -239,7 +276,7 @@ int ibmvscsi_init_crq_queue(struct crq_q
>  	}
>  
>  	if (request_irq(vdev->irq,
> -			ibmvscsi_handle_event,
> +			rpavscsi_handle_event,
>  			0, "ibmvscsi", (void *)hostdata) != 0) {
>  		printk(KERN_ERR "ibmvscsi: couldn't register irq 0x%x\n",
>  		       vdev->irq);
> @@ -256,7 +293,7 @@ int ibmvscsi_init_crq_queue(struct crq_q
>  	queue->cur = 0;
>  	spin_lock_init(&queue->lock);
>  
> -	tasklet_init(&hostdata->srp_task, (void *)ibmvscsi_task,
> +	tasklet_init(&hostdata->srp_task, (void *)rpavscsi_task,
>  		     (unsigned long)hostdata);
>  
>  	return retrc;
> @@ -281,8 +318,8 @@ int ibmvscsi_init_crq_queue(struct crq_q
>   * @hostdata:	ibmvscsi_host_data of host
>   *
>   */
> -int ibmvscsi_reenable_crq_queue(struct crq_queue *queue,
> -				 struct ibmvscsi_host_data *hostdata)
> +static int rpavscsi_reenable_crq_queue(struct crq_queue *queue,
> +				       struct ibmvscsi_host_data *hostdata)
>  {
>  	int rc;
>  	struct vio_dev *vdev = to_vio_dev(hostdata->dev);
> @@ -297,39 +334,10 @@ int ibmvscsi_reenable_crq_queue(struct c
>  	return rc;
>  }
>  
> -/**
> - * reset_crq_queue: - resets a crq after a failure
> - * @queue:	crq_queue to initialize and register
> - * @hostdata:	ibmvscsi_host_data of host
> - *
> - */
> -int ibmvscsi_reset_crq_queue(struct crq_queue *queue,
> -			      struct ibmvscsi_host_data *hostdata)
> -{
> -	int rc;
> -	struct vio_dev *vdev = to_vio_dev(hostdata->dev);
> -
> -	/* Close the CRQ */
> -	do {
> -		rc = plpar_hcall_norets(H_FREE_CRQ, vdev->unit_address);
> -	} while ((rc == H_BUSY) || (H_IS_LONG_BUSY(rc)));
> -
> -	/* Clean out the queue */
> -	memset(queue->msgs, 0x00, PAGE_SIZE);
> -	queue->cur = 0;
> -
> -	set_adapter_info(hostdata);
> -
> -	/* And re-open it again */
> -	rc = plpar_hcall_norets(H_REG_CRQ,
> -				vdev->unit_address,
> -				queue->msg_token, PAGE_SIZE);
> -	if (rc == 2) {
> -		/* Adapter is good, but other end is not ready */
> -		printk(KERN_WARNING "ibmvscsi: Partner adapter not ready\n");
> -	} else if (rc != 0) {
> -		printk(KERN_WARNING
> -		       "ibmvscsi: couldn't register crq--rc 0x%x\n", rc);
> -	}
> -	return rc;
> -}
> +struct ibmvscsi_ops rpavscsi_ops = {
> +	.init_crq_queue = rpavscsi_init_crq_queue,
> +	.release_crq_queue = rpavscsi_release_crq_queue,
> +	.reset_crq_queue = rpavscsi_reset_crq_queue,
> +	.reenable_crq_queue = rpavscsi_reenable_crq_queue,
> +	.send_crq = rpavscsi_send_crq,
> +};
> --- linux-2.6.19.ppc64/drivers/scsi/ibmvscsi/ibmvscsi.c~	2006-11-29 21:57:37.000000000 +0000
> +++ linux-2.6.19.ppc64/drivers/scsi/ibmvscsi/ibmvscsi.c	2006-12-19 15:53:59.000000000 +0000
> @@ -89,6 +89,8 @@ static int max_requests = 50;
>  
>  #define IBMVSCSI_VERSION "1.5.8"
>  
> +static struct ibmvscsi_ops *ibmvscsi_ops;
> +
>  MODULE_DESCRIPTION("IBM Virtual SCSI");
>  MODULE_AUTHOR("Dave Boutcher");
>  MODULE_LICENSE("GPL");
> @@ -567,7 +569,7 @@ static int ibmvscsi_send_srp_event(struc
>  	list_add_tail(&evt_struct->list, &hostdata->sent);
>  
>  	if ((rc =
> -	     ibmvscsi_send_crq(hostdata, crq_as_u64[0], crq_as_u64[1])) != 0) {
> +	     ibmvscsi_ops->send_crq(hostdata, crq_as_u64[0], crq_as_u64[1])) != 0) {
>  		list_del(&evt_struct->list);
>  
>  		printk(KERN_ERR "ibmvscsi: send error %d\n",
> @@ -1183,8 +1185,8 @@ void ibmvscsi_handle_crq(struct viosrp_c
>  		case 0x01:	/* Initialization message */
>  			printk(KERN_INFO "ibmvscsi: partner initialized\n");
>  			/* Send back a response */
> -			if (ibmvscsi_send_crq(hostdata,
> -					      0xC002000000000000LL, 0) == 0) {
> +			if (ibmvscsi_ops->send_crq(hostdata,
> +						   0xC002000000000000LL, 0) == 0) {
>  				/* Now login */
>  				send_srp_login(hostdata);
>  			} else {
> @@ -1212,10 +1214,10 @@ void ibmvscsi_handle_crq(struct viosrp_c
>  			printk(KERN_INFO
>  			       "ibmvscsi: Re-enabling adapter!\n");
>  			purge_requests(hostdata, DID_REQUEUE);
> -			if ((ibmvscsi_reenable_crq_queue(&hostdata->queue,
> -							hostdata)) ||
> -			    (ibmvscsi_send_crq(hostdata,
> -					       0xC001000000000000LL, 0))) {
> +			if ((ibmvscsi_ops->reenable_crq_queue(&hostdata->queue,
> +							      hostdata)) ||
> +			    (ibmvscsi_ops->send_crq(hostdata,
> +						    0xC001000000000000LL, 0))) {
>  					atomic_set(&hostdata->request_limit,
>  						   -1);
>  					printk(KERN_ERR
> @@ -1228,10 +1230,10 @@ void ibmvscsi_handle_crq(struct viosrp_c
>  			       crq->format);
>  
>  			purge_requests(hostdata, DID_ERROR);
> -			if ((ibmvscsi_reset_crq_queue(&hostdata->queue,
> -							hostdata)) ||
> -			    (ibmvscsi_send_crq(hostdata,
> -					       0xC001000000000000LL, 0))) {
> +			if ((ibmvscsi_ops->reset_crq_queue(&hostdata->queue,
> +							   hostdata)) ||
> +			    (ibmvscsi_ops->send_crq(hostdata,
> +						    0xC001000000000000LL, 0))) {
>  					atomic_set(&hostdata->request_limit,
>  						   -1);
>  					printk(KERN_ERR
> @@ -1517,7 +1519,7 @@ static int ibmvscsi_probe(struct vio_dev
>  	atomic_set(&hostdata->request_limit, -1);
>  	hostdata->host->max_sectors = 32 * 8; /* default max I/O 32 pages */
>  
> -	rc = ibmvscsi_init_crq_queue(&hostdata->queue, hostdata, max_requests);
> +	rc = ibmvscsi_ops->init_crq_queue(&hostdata->queue, hostdata, max_requests);
>  	if (rc != 0 && rc != H_RESOURCE) {
>  		printk(KERN_ERR "ibmvscsi: couldn't initialize crq\n");
>  		goto init_crq_failed;
> @@ -1538,7 +1540,7 @@ static int ibmvscsi_probe(struct vio_dev
>  	 * to fail if the other end is not acive.  In that case we don't
>  	 * want to scan
>  	 */
> -	if (ibmvscsi_send_crq(hostdata, 0xC001000000000000LL, 0) == 0
> +	if (ibmvscsi_ops->send_crq(hostdata, 0xC001000000000000LL, 0) == 0
>  	    || rc == H_RESOURCE) {
>  		/*
>  		 * Wait around max init_timeout secs for the adapter to finish
> @@ -1564,7 +1566,7 @@ static int ibmvscsi_probe(struct vio_dev
>        add_host_failed:
>  	release_event_pool(&hostdata->pool, hostdata);
>        init_pool_failed:
> -	ibmvscsi_release_crq_queue(&hostdata->queue, hostdata, max_requests);
> +	ibmvscsi_ops->release_crq_queue(&hostdata->queue, hostdata, max_requests);
>        init_crq_failed:
>  	scsi_host_put(host);
>        scsi_host_alloc_failed:
> @@ -1575,8 +1577,8 @@ static int ibmvscsi_remove(struct vio_de
>  {
>  	struct ibmvscsi_host_data *hostdata = vdev->dev.driver_data;
>  	release_event_pool(&hostdata->pool, hostdata);
> -	ibmvscsi_release_crq_queue(&hostdata->queue, hostdata,
> -				   max_requests);
> +	ibmvscsi_ops->release_crq_queue(&hostdata->queue, hostdata,
> +					max_requests);
>  	
>  	scsi_remove_host(hostdata->host);
>  	scsi_host_put(hostdata->host);
> @@ -1606,6 +1608,13 @@ static struct vio_driver ibmvscsi_driver
>  
>  int __init ibmvscsi_module_init(void)
>  {
> +	if (firmware_has_feature(FW_FEATURE_ISERIES))
> +		ibmvscsi_ops = &iseriesvscsi_ops;
> +	else if (firmware_has_feature(FW_FEATURE_VIO))
> +		ibmvscsi_ops = &rpavscsi_ops;
> +	else
> +		return -ENODEV;
> +
>  	return vio_register_driver(&ibmvscsi_driver);
>  }
>  
> --- linux-2.6.19.ppc64/drivers/scsi/ibmvscsi/ibmvscsi.h~	2006-11-29 21:57:37.000000000 +0000
> +++ linux-2.6.19.ppc64/drivers/scsi/ibmvscsi/ibmvscsi.h	2006-12-19 15:54:18.000000000 +0000
> @@ -94,21 +94,25 @@ struct ibmvscsi_host_data {
>  };
>  
>  /* routines for managing a command/response queue */
> -int ibmvscsi_init_crq_queue(struct crq_queue *queue,
> -			    struct ibmvscsi_host_data *hostdata,
> -			    int max_requests);
> -void ibmvscsi_release_crq_queue(struct crq_queue *queue,
> -				struct ibmvscsi_host_data *hostdata,
> -				int max_requests);
> -int ibmvscsi_reset_crq_queue(struct crq_queue *queue,
> -			      struct ibmvscsi_host_data *hostdata);
> -
> -int ibmvscsi_reenable_crq_queue(struct crq_queue *queue,
> -				struct ibmvscsi_host_data *hostdata);
> -
>  void ibmvscsi_handle_crq(struct viosrp_crq *crq,
>  			 struct ibmvscsi_host_data *hostdata);
> -int ibmvscsi_send_crq(struct ibmvscsi_host_data *hostdata,
> -		      u64 word1, u64 word2);
> +
> +struct ibmvscsi_ops {
> +	int (*init_crq_queue)(struct crq_queue *queue,
> +			      struct ibmvscsi_host_data *hostdata,
> +			      int max_requests);
> +	void (*release_crq_queue)(struct crq_queue *queue,
> +				  struct ibmvscsi_host_data *hostdata,
> +				  int max_requests);
> +	int (*reset_crq_queue)(struct crq_queue *queue,
> +			       struct ibmvscsi_host_data *hostdata);
> +	int (*reenable_crq_queue)(struct crq_queue *queue,
> +				  struct ibmvscsi_host_data *hostdata);
> +	int (*send_crq)(struct ibmvscsi_host_data *hostdata,
> +		       u64 word1, u64 word2);
> +};
> +
> +extern struct ibmvscsi_ops iseriesvscsi_ops;
> +extern struct ibmvscsi_ops rpavscsi_ops;
>  
>  #endif				/* IBMVSCSI_H */
> --- linux-2.6.19.ppc64/drivers/scsi/ibmvscsi/iseries_vscsi.c~	2006-11-29 21:57:37.000000000 +0000
> +++ linux-2.6.19.ppc64/drivers/scsi/ibmvscsi/iseries_vscsi.c	2006-12-19 15:47:03.000000000 +0000
> @@ -53,7 +53,7 @@ struct srp_lp_event {
>  /** 
>   * standard interface for handling logical partition events.
>   */
> -static void ibmvscsi_handle_event(struct HvLpEvent *lpevt)
> +static void iseriesvscsi_handle_event(struct HvLpEvent *lpevt)
>  {
>  	struct srp_lp_event *evt = (struct srp_lp_event *)lpevt;
>  
> @@ -74,9 +74,9 @@ static void ibmvscsi_handle_event(struct
>  /* ------------------------------------------------------------
>   * Routines for driver initialization
>   */
> -int ibmvscsi_init_crq_queue(struct crq_queue *queue,
> -			    struct ibmvscsi_host_data *hostdata,
> -			    int max_requests)
> +static int iseriesvscsi_init_crq_queue(struct crq_queue *queue,
> +				       struct ibmvscsi_host_data *hostdata,
> +				       int max_requests)
>  {
>  	int rc;
>  
> @@ -88,7 +88,7 @@ int ibmvscsi_init_crq_queue(struct crq_q
>  		goto viopath_open_failed;
>  	}
>  
> -	rc = vio_setHandler(viomajorsubtype_scsi, ibmvscsi_handle_event);
> +	rc = vio_setHandler(viomajorsubtype_scsi, iseriesvscsi_handle_event);
>  	if (rc < 0) {
>  		printk("vio_setHandler failed with rc %d in open_event_path\n",
>  		       rc);
> @@ -102,9 +102,9 @@ int ibmvscsi_init_crq_queue(struct crq_q
>  	return -1;
>  }
>  
> -void ibmvscsi_release_crq_queue(struct crq_queue *queue,
> -				struct ibmvscsi_host_data *hostdata,
> -				int max_requests)
> +static void iseriesvscsi_release_crq_queue(struct crq_queue *queue,
> +					   struct ibmvscsi_host_data *hostdata,
> +					   int max_requests)
>  {
>  	vio_clearHandler(viomajorsubtype_scsi);
>  	viopath_close(viopath_hostLp, viomajorsubtype_scsi, max_requests);
> @@ -117,8 +117,8 @@ void ibmvscsi_release_crq_queue(struct c
>   *
>   * no-op for iSeries
>   */
> -int ibmvscsi_reset_crq_queue(struct crq_queue *queue,
> -			      struct ibmvscsi_host_data *hostdata)
> +static int iseriesvscsi_reset_crq_queue(struct crq_queue *queue,
> +					struct ibmvscsi_host_data *hostdata)
>  {
>  	return 0;
>  }
> @@ -130,19 +130,20 @@ int ibmvscsi_reset_crq_queue(struct crq_
>   *
>   * no-op for iSeries
>   */
> -int ibmvscsi_reenable_crq_queue(struct crq_queue *queue,
> -				struct ibmvscsi_host_data *hostdata)
> +static int iseriesvscsi_reenable_crq_queue(struct crq_queue *queue,
> +					   struct ibmvscsi_host_data *hostdata)
>  {
>  	return 0;
>  }
>  
>  /**
> - * ibmvscsi_send_crq: - Send a CRQ
> + * iseriesvscsi_send_crq: - Send a CRQ
>   * @hostdata:	the adapter
>   * @word1:	the first 64 bits of the data
>   * @word2:	the second 64 bits of the data
>   */
> -int ibmvscsi_send_crq(struct ibmvscsi_host_data *hostdata, u64 word1, u64 word2)
> +static int iseriesvscsi_send_crq(struct ibmvscsi_host_data *hostdata,
> +				 u64 word1, u64 word2)
>  {
>  	single_host_data = hostdata;
>  	return HvCallEvent_signalLpEventFast(viopath_hostLp,
> @@ -156,3 +157,11 @@ int ibmvscsi_send_crq(struct ibmvscsi_ho
>  					     VIOVERSION << 16, word1, word2, 0,
>  					     0);
>  }
> +
> +struct ibmvscsi_ops iseriesvscsi_ops = {
> +	.init_crq_queue = iseriesvscsi_init_crq_queue,
> +	.release_crq_queue = iseriesvscsi_release_crq_queue,
> +	.reset_crq_queue = iseriesvscsi_reset_crq_queue,
> +	.reenable_crq_queue = iseriesvscsi_reenable_crq_queue,
> +	.send_crq = iseriesvscsi_send_crq,
> +};
> --- linux-2.6.19.ppc64/drivers/scsi/ibmvscsi/Makefile.orig	2007-01-01 20:06:26.000000000 +0000
> +++ linux-2.6.19.ppc64/drivers/scsi/ibmvscsi/Makefile	2007-01-01 20:06:35.000000000 +0000
> @@ -1,9 +1,7 @@
>  obj-$(CONFIG_SCSI_IBMVSCSI)	+= ibmvscsic.o
>  
>  ibmvscsic-y			+= ibmvscsi.o
> -ifndef CONFIG_PPC_PSERIES
>  ibmvscsic-$(CONFIG_PPC_ISERIES)	+= iseries_vscsi.o 
> -endif
>  ibmvscsic-$(CONFIG_PPC_PSERIES)	+= rpa_vscsi.o 
>  
>  obj-$(CONFIG_SCSI_IBMVSCSIS)	+= ibmvstgt.o
> 
> 
-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person

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

^ permalink raw reply

* Re: [RFC 0/1] lro: Generic Large Receive Offload for TCP traffic
From: David Miller @ 2007-07-26  0:28 UTC (permalink / raw)
  To: gallatin
  Cc: tklein, jeff, themann, netdev, linux-kernel, raisch, linuxppc-dev,
	ossthema, meder, stefan.roscher
In-Reply-To: <46A785C2.9090708@myri.com>

From: Andrew Gallatin <gallatin@myri.com>
Date: Wed, 25 Jul 2007 13:17:54 -0400

> I've ported myri10ge to use the new LRO interface.  I have attached a
> preliminary patch to myri10ge.  I'm very pleased to note that the
> performance is on-par with my own LRO used by our out-of-tree driver.
> (except when using mixed MTUS, see performance data below).

Thanks for posting this port and feedback on the generic LRO
code.

^ permalink raw reply


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