LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 14/18] Sysace: Use the established platform bus api
From: Grant Likely @ 2007-09-28 18:18 UTC (permalink / raw)
  To: linuxppc-dev, jwboyer, jacmet
In-Reply-To: <20070928181421.18608.74224.stgit@trillian.cg.shawcable.net>

From: Grant Likely <grant.likely@secretlab.ca>

SystemACE uses the platform bus binding, but it doesn't use the
platform bus API.  Move to using the correct API for consistency
sake.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---

 drivers/block/xsysace.c |   48 +++++++++++++++++++++++++++++------------------
 1 files changed, 30 insertions(+), 18 deletions(-)

diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c
index 3ede0b6..b104476 100644
--- a/drivers/block/xsysace.c
+++ b/drivers/block/xsysace.c
@@ -1060,13 +1060,12 @@ static void __devexit ace_teardown(struct ace_device *ace)
  * Platform Bus Support
  */
 
-static int __devinit ace_probe(struct device *device)
+static int __devinit ace_probe(struct platform_device *dev)
 {
-	struct platform_device *dev = to_platform_device(device);
 	struct ace_device *ace;
 	int i;
 
-	dev_dbg(device, "ace_probe(%p)\n", device);
+	dev_dbg(&dev->dev, "ace_probe(%p)\n", dev);
 
 	/*
 	 * Allocate the ace device structure
@@ -1075,7 +1074,7 @@ static int __devinit ace_probe(struct device *device)
 	if (!ace)
 		goto err_alloc;
 
-	ace->dev = device;
+	ace->dev = &dev->dev;
 	ace->id = dev->id;
 	ace->irq = NO_IRQ;
 
@@ -1089,7 +1088,7 @@ static int __devinit ace_probe(struct device *device)
 	/* FIXME: Should get bus_width from the platform_device struct */
 	ace->bus_width = 1;
 
-	dev_set_drvdata(&dev->dev, ace);
+	platform_set_drvdata(dev, ace);
 
 	/* Call the bus-independant setup code */
 	if (ace_setup(ace) != 0)
@@ -1098,7 +1097,7 @@ static int __devinit ace_probe(struct device *device)
 	return 0;
 
       err_setup:
-	dev_set_drvdata(&dev->dev, NULL);
+	platform_set_drvdata(dev, NULL);
 	kfree(ace);
       err_alloc:
 	printk(KERN_ERR "xsysace: could not initialize device\n");
@@ -1108,25 +1107,27 @@ static int __devinit ace_probe(struct device *device)
 /*
  * Platform bus remove() method
  */
-static int __devexit ace_remove(struct device *device)
+static int __devexit ace_remove(struct platform_device *dev)
 {
-	struct ace_device *ace = dev_get_drvdata(device);
-
-	dev_dbg(device, "ace_remove(%p)\n", device);
+	struct ace_device *ace =  platform_get_drvdata(dev);
+	dev_dbg(&dev->dev, "ace_remove(%p)\n", dev);
 
 	if (ace) {
 		ace_teardown(ace);
+		platform_set_drvdata(dev, NULL);
 		kfree(ace);
 	}
 
 	return 0;
 }
 
-static struct device_driver ace_driver = {
-	.name = "xsysace",
-	.bus = &platform_bus_type,
+static struct platform_driver ace_platform_driver = {
 	.probe = ace_probe,
 	.remove = __devexit_p(ace_remove),
+	.driver = {
+		.owner = THIS_MODULE,
+		.name = "xsysace",
+	},
 };
 
 /* ---------------------------------------------------------------------
@@ -1134,20 +1135,31 @@ static struct device_driver ace_driver = {
  */
 static int __init ace_init(void)
 {
+	int rc;
+
 	ace_major = register_blkdev(ace_major, "xsysace");
 	if (ace_major <= 0) {
-		printk(KERN_WARNING "xsysace: register_blkdev() failed\n");
-		return ace_major;
+		rc = -ENOMEM;
+		goto err_blk;
 	}
 
-	pr_debug("Registering Xilinx SystemACE driver, major=%i\n", ace_major);
-	return driver_register(&ace_driver);
+	if ((rc = platform_driver_register(&ace_platform_driver)) != 0)
+		goto err_plat;
+
+	pr_info("Xilinx SystemACE device driver, major=%i\n", ace_major);
+	return 0;
+
+      err_plat:
+	unregister_blkdev(ace_major, "xsysace");
+      err_blk:
+	printk(KERN_ERR "xsysace: registration failed; err=%i\n", rc);
+	return rc;
 }
 
 static void __exit ace_exit(void)
 {
 	pr_debug("Unregistering Xilinx SystemACE driver\n");
-	driver_unregister(&ace_driver);
+	platform_driver_unregister(&ace_platform_driver);
 	unregister_blkdev(ace_major, "xsysace");
 }
 

^ permalink raw reply related

* Re: [PATCH 02/18] Add Kconfig macros for Xilinx Virtex support
From: Scott Wood @ 2007-09-28 18:20 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev
In-Reply-To: <20070928181558.18608.23527.stgit@trillian.cg.shawcable.net>

Grant Likely wrote:
> From: Grant Likely <grant.likely@secretlab.ca>
> 
> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
> ---
> 
>  arch/powerpc/platforms/40x/Kconfig |   30 +++++++++++++++++-------------
>  1 files changed, 17 insertions(+), 13 deletions(-)
> 
> diff --git a/arch/powerpc/platforms/40x/Kconfig b/arch/powerpc/platforms/40x/Kconfig
> index c3dce3b..1aae0e6 100644
> --- a/arch/powerpc/platforms/40x/Kconfig
> +++ b/arch/powerpc/platforms/40x/Kconfig
> @@ -61,13 +61,14 @@ config WALNUT
>  	help
>  	  This option enables support for the IBM PPC405GP evaluation board.
>  
> -#config XILINX_ML300
> -#	bool "Xilinx-ML300"
> -#	depends on 40x
> -#	default y
> -#	select VIRTEX_II_PRO
> -#	help
> -#	  This option enables support for the Xilinx ML300 evaluation board.
> +config XILINX_VIRTEX_GENERIC_BOARD
> +	bool "Generic Xilinx Virtex board"
> +	depends on 40x
> +	default y
> +	select VIRTEX_II_PRO
> +	select VIRTEX_4_FX
> +	help
> +	  This option enables generic support for Xilinx Virtex based boards.

I don't think we want default y here.

-Scott

^ permalink raw reply

* DMA-related IDE driver crash on mount of second partition
From: Randy Sharo @ 2007-09-28 18:23 UTC (permalink / raw)
  To: linuxppc-embedded


[-- Attachment #1.1: Type: text/plain, Size: 4450 bytes --]

Hello,

 

I could use some guidance on tracking down this problem.

 

I have all off-the-shelf components:

   * Artesyn PMPPC440  PMC (uses 440gp processor)

   * Artesyn CC1000dm carrier card

   * Kontron PMC-HDD1 hard drive module.

 

I'm running U-boot with linux kernel 2.4.10.  The system boots, but the
kernel is unable to allocate resource region 5 of the IDE controller at
0xa0000000.  

 

Even without region 5, I can mount and access a hard drive partition.  When
I mount a second partition I get a kernel oops, though.  The two partitions
are normal ext3 partitions and there is nothing wrong with the hard drive
images - I can mount either individually with no problems.  But the kernel
crashes when I mount both together.

 

I've traced the oops to determine that the kernel is trying to (and failing
to) invalidate the cache for address 0xE0000000.  Per the output of lspci,
the 0xA0000000 window is not large enough to extend to 0xE000000.  I don't
understand why the driver is trying to access such a high address.

 

Any advice on how to resolve the resource conflict and/or crash would be
appreciated.

 

I've attached my kernel config and a complete listing of the boot sequence
and error.  Here are the immediately relevant lines, though:

 

   At boot time:

 

PCI: Probing PCI hardware

PCI: Cannot allocate resource region 5 of device 0000:00:06.0

PCI: Failed to allocate mem resource #5:100@a0000000 for 0000:00:06.0

.

.

.

SiI680: IDE controller at PCI slot 0000:00:06.0

SiI680: chipset revision 2

siimage: IDE controller MMIO ports not available.

SiI680: BASE CLOCK == 100

SiI680: 100% native mode on irq 25

    ide0: BM-DMA at 0xffd0-0xffd7, BIOS settings: hda:pio, hdb:pio

    ide1: BM-DMA at 0xffd8-0xffdf, BIOS settings: hdc:pio, hdd:pio

hda: HTS424040M9AT00, ATA DISK drive

 

 

   At run time:

 

bash-2.05b# lspci -v

00:02.0 Class 0680: 3388:0021 (rev 04)

        Subsystem: 1223:003a

        Flags: bus master, stepping, 66Mhz, medium devsel, latency 128, IRQ
25

        Memory at 80000000 (32-bit, prefetchable) [size=512M]

        Capabilities: [dc] Power Management version 4

        Capabilities: [e4] #06 [0094]

        Capabilities: [e8] Vital Product Data

 

00:06.0 Class 0101: 1095:0680 (rev 02) (prog-if 85 [Master SecO PriO])

        Subsystem: 1095:0680

        Flags: bus master, medium devsel, latency 128, IRQ 25

        I/O ports at fff8 [size=8]

        I/O ports at fff4 [size=4]

        I/O ports at ffe8 [size=8]

        I/O ports at ffe4 [size=4]

        I/O ports at ffd0 [size=16]

        Memory at a0000000 (32-bit, non-prefetchable)

        Expansion ROM at a0080000 [disabled] [size=512K]

        Capabilities: [60] Power Management version 2

 

bash-2.05b# mount /dev/ide/host0/bus0/target0/lun0/part3 x

bash-2.05b# ls x

bin  boot  etc  images  lib  lost+found  mnt  proc  root  sbin  tmp  usr
var

bash-2.05b# mount /dev/ide/host0/bus0/target0/lun0/part1 y

Oops: kernel access of bad area, sig: 11 [#1]

NIP: C0003804 LR: C00081B0 SP: DE8A3AF0 REGS: de8a3a40 TRAP: 0300    Not
tainted

 

MSR: 00021000 EE: 0 PR: 0 FP: 0 ME: 1 IR/DR: 00

DAR: E0000000, DSISR: 00800000

TASK = dfe9ae20[336] 'mount' THREAD: de8a2000

Last syscall: 21

PLB0: bear= 0x00000000 acr=   0x9b000000 besr=  0x00000000

 

GPR00: C00082B4 DE8A3AF0 DFE9AE20 E0000000 07FFFFE0 0000001F 00000002
C02A0000

GPR08: 00000000 1FB44000 00000000 C02A0000 00000001 1002863C 1FFA8600
100C0000

GPR16: 00000000 00000000 100D0888 100C2A88 00000001 C02A0000 00029000
00000001

GPR24: 00000002 00000400 00000000 FFFFFC00 DE8A2000 DFB44800 C06BF880
FFFFFC00

NIP [c0003804] invalidate_dcache_range+0x1c/0x30

LR [c00081b0] __dma_sync+0x54/0x60

Call trace:

 [c00082b4] __dma_sync_page+0xf8/0x19c

 [c01467c0] ide_build_sglist+0xa8/0xf8

 [c0146840] ide_build_dmatable+0x30/0x1ac

 [c0146d64] ide_dma_setup+0x3c/0xc8

 [c0148ee4] __ide_do_rw_disk+0x2b8/0x598

 [c013e0f0] start_request+0x190/0x280

 [c013e438] ide_do_request+0x238/0x3d8

 [c011711c] __generic_unplug_device+0x68/0x6c

 [c011713c] generic_unplug_device+0x1c/0x38

 [c0117190] blk_backing_dev_unplug+0x38/0x3c

 [c0056a68] sync_buffer+0x64/0x68

 [c01ca8c4] __wait_on_bit+0xb0/0xc0

 [c01ca934] out_of_line_wait_on_bit+0x60/0x74

 [c0056b30] __wait_on_buffer+0x3c/0x40

 [c0058560] __bread_slow+0xac/0xd4

note: mount[336] exited with preempt_count 1

 

 

 

Regards,

   Randy Sharo

   Blue Collar Objects, LLC


[-- Attachment #1.2: Type: text/html, Size: 22602 bytes --]

[-- Attachment #2: config.txt --]
[-- Type: text/plain, Size: 18728 bytes --]

#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.10
# Wed Sep 19 13:46:12 2007
#
CONFIG_MMU=y
CONFIG_GENERIC_HARDIRQS=y
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
CONFIG_HAVE_DEC_LOCK=y
CONFIG_PPC=y
CONFIG_PPC32=y
CONFIG_GENERIC_NVRAM=y

#
# Code maturity level options
#
CONFIG_EXPERIMENTAL=y
CONFIG_CLEAN_COMPILE=y
CONFIG_BROKEN_ON_SMP=y

#
# General setup
#
CONFIG_LOCALVERSION="-pmppc440"
CONFIG_SWAP=y
CONFIG_SYSVIPC=y
CONFIG_POSIX_MQUEUE=y
# CONFIG_BSD_PROCESS_ACCT is not set
CONFIG_SYSCTL=y
# CONFIG_AUDIT is not set
CONFIG_LOG_BUF_SHIFT=14
# CONFIG_HOTPLUG is not set
CONFIG_KOBJECT_UEVENT=y
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
CONFIG_EMBEDDED=y
CONFIG_KALLSYMS=y
# CONFIG_KALLSYMS_ALL is not set
# CONFIG_KALLSYMS_EXTRA_PASS is not set
CONFIG_FUTEX=y
CONFIG_EPOLL=y
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
CONFIG_SHMEM=y
CONFIG_CC_ALIGN_FUNCTIONS=0
CONFIG_CC_ALIGN_LABELS=0
CONFIG_CC_ALIGN_LOOPS=0
CONFIG_CC_ALIGN_JUMPS=0
# CONFIG_TINY_SHMEM is not set

#
# Loadable module support
#
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
CONFIG_MODULE_FORCE_UNLOAD=y
CONFIG_OBSOLETE_MODPARM=y
# CONFIG_MODVERSIONS is not set
# CONFIG_MODULE_SRCVERSION_ALL is not set
CONFIG_KMOD=y

#
# Processor
#
# CONFIG_6xx is not set
# CONFIG_40x is not set
CONFIG_44x=y
# CONFIG_POWER3 is not set
# CONFIG_POWER4 is not set
# CONFIG_8xx is not set
# CONFIG_E500 is not set
CONFIG_BOOKE=y
CONFIG_PTE_64BIT=y
# CONFIG_MATH_EMULATION is not set
# CONFIG_CPU_FREQ is not set
CONFIG_4xx=y

#
# IBM 4xx options
#
# CONFIG_EBONY is not set
# CONFIG_OCOTEA is not set
CONFIG_PMPPC440=y
CONFIG_440GP=y
CONFIG_440=y
CONFIG_IBM_OCP=y
CONFIG_PPC4xx_DMA=y
CONFIG_PPC4xx_EDMA=y
CONFIG_PPC_GEN550=y
# CONFIG_PM is not set
CONFIG_NOT_COHERENT_CACHE=y

#
# Platform options
#
CONFIG_PMC_BASEBOARD=y
# CONFIG_K750I_SITE1 is not set
# CONFIG_K750I_SITE2 is not set
# CONFIG_K752I_SITE1 is not set
# CONFIG_K752I_SITE2 is not set
# CONFIG_CC1000_SITE1 is not set
CONFIG_CC1000_SITE2=y
# CONFIG_KATANAQP_SITE1 is not set
# CONFIG_KATANAQP_SITE2 is not set
# CONFIG_KATANAQP_SITE3 is not set
# CONFIG_KATANAQP_SITE4 is not set
# CONFIG_PC_KEYBOARD is not set
# CONFIG_SMP is not set
# CONFIG_PREEMPT is not set
CONFIG_HIGHMEM=y
CONFIG_BINFMT_ELF=y
# CONFIG_BINFMT_MISC is not set
CONFIG_CMDLINE_BOOL=y
CONFIG_CMDLINE="ip=on"

#
# Bus options
#
CONFIG_PCI=y
CONFIG_PCI_DOMAINS=y
# CONFIG_PCI_LEGACY_PROC is not set
CONFIG_PCI_NAMES=y

#
# Advanced setup
#
CONFIG_ADVANCED_OPTIONS=y
# CONFIG_HIGHMEM_START_BOOL is not set
CONFIG_HIGHMEM_START=0xfe000000
# CONFIG_LOWMEM_SIZE_BOOL is not set
CONFIG_LOWMEM_SIZE=0x30000000
# CONFIG_KERNEL_START_BOOL is not set
CONFIG_KERNEL_START=0xc0000000
# CONFIG_TASK_SIZE_BOOL is not set
CONFIG_TASK_SIZE=0x80000000
# CONFIG_CONSISTENT_START_BOOL is not set
CONFIG_CONSISTENT_START=0xff100000
# CONFIG_CONSISTENT_SIZE_BOOL is not set
CONFIG_CONSISTENT_SIZE=0x00200000
# CONFIG_BOOT_LOAD_BOOL is not set
CONFIG_BOOT_LOAD=0x01000000

#
# Device Drivers
#

#
# Generic Driver Options
#
# CONFIG_STANDALONE is not set
CONFIG_PREVENT_FIRMWARE_BUILD=y
# CONFIG_DEBUG_DRIVER is not set

#
# Memory Technology Devices (MTD)
#
CONFIG_MTD=y
# CONFIG_MTD_DEBUG is not set
CONFIG_MTD_PARTITIONS=y
# CONFIG_MTD_CONCAT is not set
# CONFIG_MTD_REDBOOT_PARTS is not set
# CONFIG_MTD_CMDLINE_PARTS is not set

#
# User Modules And Translation Layers
#
CONFIG_MTD_CHAR=y
CONFIG_MTD_BLOCK=y
# CONFIG_FTL is not set
# CONFIG_NFTL is not set
# CONFIG_INFTL is not set

#
# RAM/ROM/Flash chip drivers
#
CONFIG_MTD_CFI=y
# CONFIG_MTD_JEDECPROBE is not set
CONFIG_MTD_GEN_PROBE=y
CONFIG_MTD_CFI_ADV_OPTIONS=y
CONFIG_MTD_CFI_NOSWAP=y
# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
CONFIG_MTD_CFI_GEOMETRY=y
# CONFIG_MTD_MAP_BANK_WIDTH_1 is not set
CONFIG_MTD_MAP_BANK_WIDTH_2=y
# CONFIG_MTD_MAP_BANK_WIDTH_4 is not set
# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
CONFIG_MTD_CFI_I1=y
CONFIG_MTD_CFI_I2=y
# CONFIG_MTD_CFI_I4 is not set
# CONFIG_MTD_CFI_I8 is not set
CONFIG_MTD_CFI_INTELEXT=y
# CONFIG_MTD_CFI_AMDSTD is not set
# CONFIG_MTD_CFI_STAA is not set
CONFIG_MTD_CFI_UTIL=y
# CONFIG_MTD_RAM is not set
# CONFIG_MTD_ROM is not set
# CONFIG_MTD_ABSENT is not set

#
# Mapping drivers for chip access
#
# CONFIG_MTD_COMPLEX_MAPPINGS is not set
# CONFIG_MTD_PHYSMAP is not set
CONFIG_MTD_PMPPC440=y

#
# Self-contained MTD device drivers
#
# CONFIG_MTD_PMC551 is not set
# CONFIG_MTD_SLRAM is not set
# CONFIG_MTD_PHRAM is not set
# CONFIG_MTD_MTDRAM is not set
# CONFIG_MTD_BLKMTD is not set

#
# Disk-On-Chip Device Drivers
#
# CONFIG_MTD_DOC2000 is not set
# CONFIG_MTD_DOC2001 is not set
# CONFIG_MTD_DOC2001PLUS is not set

#
# NAND Flash Device Drivers
#
# CONFIG_MTD_NAND is not set

#
# Parallel port support
#
# CONFIG_PARPORT is not set

#
# Plug and Play support
#

#
# Block devices
#
# CONFIG_BLK_DEV_FD is not set
# CONFIG_BLK_CPQ_DA is not set
# CONFIG_BLK_CPQ_CISS_DA is not set
# CONFIG_BLK_DEV_DAC960 is not set
# CONFIG_BLK_DEV_UMEM is not set
CONFIG_BLK_DEV_LOOP=y
# CONFIG_BLK_DEV_CRYPTOLOOP is not set
# CONFIG_BLK_DEV_NBD is not set
# CONFIG_BLK_DEV_SX8 is not set
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_COUNT=16
CONFIG_BLK_DEV_RAM_SIZE=8192
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_LBD=y
# CONFIG_CDROM_PKTCDVD is not set

#
# IO Schedulers
#
CONFIG_IOSCHED_NOOP=y
CONFIG_IOSCHED_AS=y
CONFIG_IOSCHED_DEADLINE=y
CONFIG_IOSCHED_CFQ=y

#
# ATA/ATAPI/MFM/RLL support
#
CONFIG_IDE=y
CONFIG_BLK_DEV_IDE=y

#
# Please see Documentation/ide.txt for help/info on IDE drives
#
# CONFIG_BLK_DEV_IDE_SATA is not set
CONFIG_BLK_DEV_IDEDISK=y
# CONFIG_IDEDISK_MULTI_MODE is not set
# CONFIG_BLK_DEV_IDECD is not set
# CONFIG_BLK_DEV_IDETAPE is not set
# CONFIG_BLK_DEV_IDEFLOPPY is not set
# CONFIG_IDE_TASK_IOCTL is not set

#
# IDE chipset support/bugfixes
#
CONFIG_IDE_GENERIC=y
CONFIG_BLK_DEV_IDEPCI=y
CONFIG_IDEPCI_SHARE_IRQ=y
# CONFIG_BLK_DEV_OFFBOARD is not set
CONFIG_BLK_DEV_GENERIC=y
# CONFIG_BLK_DEV_OPTI621 is not set
# CONFIG_BLK_DEV_SL82C105 is not set
CONFIG_BLK_DEV_IDEDMA_PCI=y
# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
CONFIG_IDEDMA_PCI_AUTO=y
# CONFIG_IDEDMA_ONLYDISK is not set
# CONFIG_BLK_DEV_AEC62XX is not set
# CONFIG_BLK_DEV_ALI15X3 is not set
# CONFIG_BLK_DEV_AMD74XX is not set
# CONFIG_BLK_DEV_CMD64X is not set
# CONFIG_BLK_DEV_TRIFLEX is not set
# CONFIG_BLK_DEV_CY82C693 is not set
# CONFIG_BLK_DEV_CS5520 is not set
# CONFIG_BLK_DEV_CS5530 is not set
# CONFIG_BLK_DEV_HPT34X is not set
# CONFIG_BLK_DEV_HPT366 is not set
# CONFIG_BLK_DEV_SC1200 is not set
# CONFIG_BLK_DEV_PIIX is not set
# CONFIG_BLK_DEV_NS87415 is not set
# CONFIG_BLK_DEV_PDC202XX_OLD is not set
# CONFIG_BLK_DEV_PDC202XX_NEW is not set
# CONFIG_BLK_DEV_SVWKS is not set
CONFIG_BLK_DEV_SIIMAGE=y
# CONFIG_BLK_DEV_SLC90E66 is not set
# CONFIG_BLK_DEV_TRM290 is not set
# CONFIG_BLK_DEV_VIA82CXXX is not set
# CONFIG_IDE_ARM is not set
CONFIG_BLK_DEV_IDEDMA=y
# CONFIG_IDEDMA_IVB is not set
CONFIG_IDEDMA_AUTO=y
# CONFIG_BLK_DEV_HD is not set

#
# SCSI device support
#
# CONFIG_SCSI is not set

#
# Multi-device support (RAID and LVM)
#
# CONFIG_MD is not set

#
# Fusion MPT device support
#

#
# IEEE 1394 (FireWire) support
#
# CONFIG_IEEE1394 is not set

#
# I2O device support
#
# CONFIG_I2O is not set

#
# Macintosh device drivers
#

#
# Networking support
#
CONFIG_NET=y

#
# Networking options
#
CONFIG_PACKET=y
# CONFIG_PACKET_MMAP is not set
# CONFIG_NETLINK_DEV is not set
CONFIG_UNIX=y
# CONFIG_NET_KEY is not set
CONFIG_INET=y
# CONFIG_IP_MULTICAST is not set
# CONFIG_IP_ADVANCED_ROUTER is not set
CONFIG_IP_PNP=y
# CONFIG_IP_PNP_DHCP is not set
CONFIG_IP_PNP_BOOTP=y
# CONFIG_IP_PNP_RARP is not set
# CONFIG_NET_IPIP is not set
# CONFIG_NET_IPGRE is not set
# CONFIG_ARPD is not set
# CONFIG_SYN_COOKIES is not set
# CONFIG_INET_AH is not set
# CONFIG_INET_ESP is not set
# CONFIG_INET_IPCOMP is not set
# CONFIG_INET_TUNNEL is not set
CONFIG_IP_TCPDIAG=y
# CONFIG_IP_TCPDIAG_IPV6 is not set

#
# IP: Virtual Server Configuration
#
# CONFIG_IP_VS is not set
# CONFIG_IPV6 is not set
CONFIG_NETFILTER=y
# CONFIG_NETFILTER_DEBUG is not set

#
# IP: Netfilter Configuration
#
# CONFIG_IP_NF_CONNTRACK is not set
# CONFIG_IP_NF_CONNTRACK_MARK is not set
# CONFIG_IP_NF_QUEUE is not set
# CONFIG_IP_NF_IPTABLES is not set
# CONFIG_IP_NF_ARPTABLES is not set
# CONFIG_IP_NF_COMPAT_IPCHAINS is not set
# CONFIG_IP_NF_COMPAT_IPFWADM is not set

#
# SCTP Configuration (EXPERIMENTAL)
#
# CONFIG_IP_SCTP is not set
# CONFIG_ATM is not set
# CONFIG_BRIDGE is not set
# CONFIG_VLAN_8021Q is not set
# CONFIG_DECNET is not set
# CONFIG_LLC2 is not set
# CONFIG_IPX is not set
# CONFIG_ATALK is not set
# CONFIG_X25 is not set
# CONFIG_LAPB is not set
# CONFIG_NET_DIVERT is not set
# CONFIG_ECONET is not set
# CONFIG_WAN_ROUTER is not set

#
# QoS and/or fair queueing
#
# CONFIG_NET_SCHED is not set
# CONFIG_NET_CLS_ROUTE is not set

#
# Network testing
#
# CONFIG_NET_PKTGEN is not set
# CONFIG_NETPOLL is not set
# CONFIG_NET_POLL_CONTROLLER is not set
# CONFIG_HAMRADIO is not set
# CONFIG_IRDA is not set
# CONFIG_BT is not set
CONFIG_NETDEVICES=y
# CONFIG_DUMMY is not set
CONFIG_BONDING=m
# CONFIG_EQUALIZER is not set
# CONFIG_TUN is not set

#
# ARCnet devices
#
# CONFIG_ARCNET is not set

#
# Ethernet (10 or 100Mbit)
#
# CONFIG_NET_ETHERNET is not set
CONFIG_IBM_EMAC=y
# CONFIG_IBM_EMAC_ERRMSG is not set
CONFIG_IBM_EMAC_RXB=64
CONFIG_IBM_EMAC_TXB=8
CONFIG_IBM_EMAC_FGAP=8
CONFIG_IBM_EMAC_SKBRES=0

#
# Ethernet (1000 Mbit)
#
# CONFIG_ACENIC is not set
# CONFIG_DL2K is not set
CONFIG_E1000=y
# CONFIG_E1000_NAPI is not set
# CONFIG_NS83820 is not set
# CONFIG_HAMACHI is not set
# CONFIG_YELLOWFIN is not set
# CONFIG_R8169 is not set
# CONFIG_SK98LIN is not set
# CONFIG_TIGON3 is not set

#
# Ethernet (10000 Mbit)
#
# CONFIG_IXGB is not set
# CONFIG_S2IO is not set

#
# Token Ring devices
#
# CONFIG_TR is not set

#
# Wireless LAN (non-hamradio)
#
# CONFIG_NET_RADIO is not set

#
# Wan interfaces
#
# CONFIG_WAN is not set
# CONFIG_FDDI is not set
# CONFIG_HIPPI is not set
# CONFIG_PPP is not set
# CONFIG_SLIP is not set
# CONFIG_SHAPER is not set
# CONFIG_NETCONSOLE is not set

#
# ISDN subsystem
#
# CONFIG_ISDN is not set

#
# Telephony Support
#
# CONFIG_PHONE is not set

#
# Input device support
#
CONFIG_INPUT=y

#
# Userland interfaces
#
CONFIG_INPUT_MOUSEDEV=y
CONFIG_INPUT_MOUSEDEV_PSAUX=y
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
# CONFIG_INPUT_JOYDEV is not set
# CONFIG_INPUT_TSDEV is not set
# CONFIG_INPUT_EVDEV is not set
# CONFIG_INPUT_EVBUG is not set

#
# Input I/O drivers
#
# CONFIG_GAMEPORT is not set
CONFIG_SOUND_GAMEPORT=y
CONFIG_SERIO=y
# CONFIG_SERIO_I8042 is not set
# CONFIG_SERIO_SERPORT is not set
# CONFIG_SERIO_CT82C710 is not set
# CONFIG_SERIO_PCIPS2 is not set
# CONFIG_SERIO_RAW is not set

#
# Input Device Drivers
#
# CONFIG_INPUT_KEYBOARD is not set
# CONFIG_INPUT_MOUSE is not set
# CONFIG_INPUT_JOYSTICK is not set
# CONFIG_INPUT_TOUCHSCREEN is not set
# CONFIG_INPUT_MISC is not set

#
# Character devices
#
# CONFIG_VT is not set
# CONFIG_SERIAL_NONSTANDARD is not set

#
# Serial drivers
#
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_8250_NR_UARTS=4
CONFIG_SERIAL_8250_EXTENDED=y
# CONFIG_SERIAL_8250_MANY_PORTS is not set
CONFIG_SERIAL_8250_SHARE_IRQ=y
# CONFIG_SERIAL_8250_DETECT_IRQ is not set
# CONFIG_SERIAL_8250_MULTIPORT is not set
# CONFIG_SERIAL_8250_RSA is not set

#
# Non-8250 serial port support
#
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
CONFIG_UNIX98_PTYS=y
CONFIG_LEGACY_PTYS=y
CONFIG_LEGACY_PTY_COUNT=256

#
# IPMI
#
# CONFIG_IPMI_HANDLER is not set

#
# Watchdog Cards
#
# CONFIG_WATCHDOG is not set
# CONFIG_NVRAM is not set
CONFIG_GEN_RTC=y
# CONFIG_GEN_RTC_X is not set
# CONFIG_DTLK is not set
# CONFIG_R3964 is not set
# CONFIG_APPLICOM is not set

#
# Ftape, the floppy tape device driver
#
# CONFIG_AGP is not set
# CONFIG_DRM is not set
# CONFIG_RAW_DRIVER is not set

#
# I2C support
#
CONFIG_I2C=y
CONFIG_I2C_CHARDEV=y

#
# I2C Algorithms
#
# CONFIG_I2C_ALGOBIT is not set
# CONFIG_I2C_ALGOPCF is not set
# CONFIG_I2C_ALGOPCA is not set

#
# I2C Hardware Bus support
#
# CONFIG_I2C_ALI1535 is not set
# CONFIG_I2C_ALI1563 is not set
# CONFIG_I2C_ALI15X3 is not set
# CONFIG_I2C_AMD756 is not set
# CONFIG_I2C_AMD8111 is not set
# CONFIG_I2C_I801 is not set
# CONFIG_I2C_I810 is not set
CONFIG_I2C_IBM_IIC=y
# CONFIG_I2C_ISA is not set
# CONFIG_I2C_NFORCE2 is not set
# CONFIG_I2C_PARPORT_LIGHT is not set
# CONFIG_I2C_PIIX4 is not set
# CONFIG_I2C_PROSAVAGE is not set
# CONFIG_I2C_SAVAGE4 is not set
# CONFIG_SCx200_ACB is not set
# CONFIG_I2C_SIS5595 is not set
# CONFIG_I2C_SIS630 is not set
# CONFIG_I2C_SIS96X is not set
# CONFIG_I2C_STUB is not set
# CONFIG_I2C_VIA is not set
# CONFIG_I2C_VIAPRO is not set
# CONFIG_I2C_VOODOO3 is not set
# CONFIG_I2C_PCA_ISA is not set

#
# Hardware Sensors Chip support
#
# CONFIG_I2C_SENSOR is not set
# CONFIG_SENSORS_ADM1021 is not set
# CONFIG_SENSORS_ADM1025 is not set
# CONFIG_SENSORS_ADM1026 is not set
# CONFIG_SENSORS_ADM1031 is not set
# CONFIG_SENSORS_ASB100 is not set
# CONFIG_SENSORS_DS1621 is not set
# CONFIG_SENSORS_FSCHER is not set
# CONFIG_SENSORS_GL518SM is not set
# CONFIG_SENSORS_IT87 is not set
# CONFIG_SENSORS_LM63 is not set
# CONFIG_SENSORS_LM75 is not set
# CONFIG_SENSORS_LM77 is not set
# CONFIG_SENSORS_LM78 is not set
# CONFIG_SENSORS_LM80 is not set
# CONFIG_SENSORS_LM83 is not set
# CONFIG_SENSORS_LM85 is not set
# CONFIG_SENSORS_LM87 is not set
# CONFIG_SENSORS_LM90 is not set
# CONFIG_SENSORS_MAX1619 is not set
# CONFIG_SENSORS_PC87360 is not set
# CONFIG_SENSORS_SMSC47M1 is not set
# CONFIG_SENSORS_VIA686A is not set
# CONFIG_SENSORS_W83781D is not set
# CONFIG_SENSORS_W83L785TS is not set
# CONFIG_SENSORS_W83627HF is not set
CONFIG_SENSORS_M41T00=y

#
# Other I2C Chip support
#
# CONFIG_SENSORS_EEPROM is not set
# CONFIG_SENSORS_PCF8574 is not set
# CONFIG_SENSORS_PCF8591 is not set
# CONFIG_SENSORS_RTC8564 is not set
# CONFIG_I2C_DEBUG_CORE is not set
# CONFIG_I2C_DEBUG_ALGO is not set
# CONFIG_I2C_DEBUG_BUS is not set
# CONFIG_I2C_DEBUG_CHIP is not set

#
# Dallas's 1-wire bus
#
# CONFIG_W1 is not set

#
# Misc devices
#

#
# Multimedia devices
#
# CONFIG_VIDEO_DEV is not set

#
# Digital Video Broadcasting Devices
#
# CONFIG_DVB is not set

#
# Graphics support
#
# CONFIG_FB is not set

#
# Sound
#
# CONFIG_SOUND is not set

#
# USB support
#
# CONFIG_USB is not set
CONFIG_USB_ARCH_HAS_HCD=y
CONFIG_USB_ARCH_HAS_OHCI=y

#
# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
#

#
# USB Gadget Support
#
# CONFIG_USB_GADGET is not set

#
# MMC/SD Card support
#
# CONFIG_MMC is not set

#
# File systems
#
CONFIG_EXT2_FS=y
CONFIG_EXT2_FS_XATTR=y
# CONFIG_EXT2_FS_POSIX_ACL is not set
# CONFIG_EXT2_FS_SECURITY is not set
CONFIG_EXT3_FS=y
CONFIG_EXT3_FS_XATTR=y
# CONFIG_EXT3_FS_POSIX_ACL is not set
# CONFIG_EXT3_FS_SECURITY is not set
CONFIG_JBD=y
# CONFIG_JBD_DEBUG is not set
CONFIG_FS_MBCACHE=y
# CONFIG_REISERFS_FS is not set
# CONFIG_JFS_FS is not set
# CONFIG_XFS_FS is not set
CONFIG_MINIX_FS=y
# CONFIG_ROMFS_FS is not set
# CONFIG_QUOTA is not set
CONFIG_DNOTIFY=y
# CONFIG_AUTOFS_FS is not set
# CONFIG_AUTOFS4_FS is not set

#
# CD-ROM/DVD Filesystems
#
# CONFIG_ISO9660_FS is not set
# CONFIG_UDF_FS is not set

#
# DOS/FAT/NT Filesystems
#
# CONFIG_MSDOS_FS is not set
# CONFIG_VFAT_FS is not set
# CONFIG_NTFS_FS is not set

#
# Pseudo filesystems
#
CONFIG_PROC_FS=y
CONFIG_PROC_KCORE=y
CONFIG_SYSFS=y
CONFIG_DEVFS_FS=y
CONFIG_DEVFS_MOUNT=y
# CONFIG_DEVFS_DEBUG is not set
# CONFIG_DEVPTS_FS_XATTR is not set
# CONFIG_TMPFS is not set
# CONFIG_HUGETLB_PAGE is not set
CONFIG_RAMFS=y

#
# Miscellaneous filesystems
#
# CONFIG_ADFS_FS is not set
# CONFIG_AFFS_FS is not set
# CONFIG_HFS_FS is not set
# CONFIG_HFSPLUS_FS is not set
# CONFIG_BEFS_FS is not set
# CONFIG_BFS_FS is not set
# CONFIG_EFS_FS is not set
# CONFIG_JFFS_FS is not set
CONFIG_JFFS2_FS=y
CONFIG_JFFS2_FS_DEBUG=0
# CONFIG_JFFS2_FS_NAND is not set
# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
CONFIG_JFFS2_ZLIB=y
CONFIG_JFFS2_RTIME=y
# CONFIG_JFFS2_RUBIN is not set
# CONFIG_CRAMFS is not set
# CONFIG_VXFS_FS is not set
# CONFIG_HPFS_FS is not set
# CONFIG_QNX4FS_FS is not set
# CONFIG_SYSV_FS is not set
# CONFIG_UFS_FS is not set

#
# Network File Systems
#
CONFIG_NFS_FS=y
# CONFIG_NFS_V3 is not set
# CONFIG_NFS_V4 is not set
# CONFIG_NFS_DIRECTIO is not set
# CONFIG_NFSD is not set
CONFIG_ROOT_NFS=y
CONFIG_LOCKD=y
# CONFIG_EXPORTFS is not set
CONFIG_SUNRPC=y
# CONFIG_RPCSEC_GSS_KRB5 is not set
# CONFIG_RPCSEC_GSS_SPKM3 is not set
# CONFIG_SMB_FS is not set
# CONFIG_CIFS is not set
# CONFIG_NCP_FS is not set
# CONFIG_CODA_FS is not set
# CONFIG_AFS_FS is not set

#
# Partition Types
#
# CONFIG_PARTITION_ADVANCED is not set
CONFIG_MSDOS_PARTITION=y

#
# Native Language Support
#
# CONFIG_NLS is not set

#
# Library routines
#
# CONFIG_CRC_CCITT is not set
CONFIG_CRC32=y
# CONFIG_LIBCRC32C is not set
CONFIG_ZLIB_INFLATE=y
CONFIG_ZLIB_DEFLATE=y

#
# Profiling support
#
# CONFIG_PROFILING is not set

#
# Kernel hacking
#
CONFIG_DEBUG_KERNEL=y
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_SCHEDSTATS is not set
# CONFIG_DEBUG_SLAB is not set
# CONFIG_DEBUG_SPINLOCK is not set
# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
# CONFIG_DEBUG_KOBJECT is not set
# CONFIG_DEBUG_HIGHMEM is not set
# CONFIG_DEBUG_INFO is not set
# CONFIG_KGDB is not set
# CONFIG_XMON is not set
CONFIG_BDI_SWITCH=y
# CONFIG_SERIAL_TEXT_DEBUG is not set
CONFIG_PPC_OCP=y

#
# Security options
#
# CONFIG_KEYS is not set
# CONFIG_SECURITY is not set

#
# Cryptographic options
#
# CONFIG_CRYPTO is not set

[-- Attachment #3: legacymode.txt --]
[-- Type: text/plain, Size: 9332 bytes --]

TFTP from server 10.10.2.24
our IP address is 10.10.14.5
Filename 'kernel-aspmppc440-linux-2.6.10'.
Load address: 0xc000000
Loading: #################################################################
         #################################################################
         #################################################################
         ####################################################
done
Bytes transferred = 1260746 (133cca hex)
## Booting image at 0c000000 ...
   Image Name:   Linux-2.6.10-pmppc440
   Created:      2007-09-18  19:28:50 UTC
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:    1260682 Bytes = 1231 kB = 1 MB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
Linux version 2.6.10-pmppc440 (randy@fred) (gcc version 3.3.3 (DENX ELDK 3.1 3.3
.3-8)) #2 Tue Sep 18 19:28:48 GMT 2007
Artesyn PmPPC440 Copyright 2006, Artesyn Communication Products, Inc.
Built 1 zonelists
Kernel command line: rw ip=on
PID hash table entries: 4096 (order: 12, 65536 bytes)
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Memory: 516480k available (1844k kernel code, 648k data, 324k init, 0k highmem)
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
NET: Registered protocol family 16
PCI: Probing PCI hardware
PCI: Cannot allocate resource region 5 of device 0000:00:06.0
PCI: Failed to allocate mem resource #5:100@a0000000 for 0000:00:06.0
devfs: 2004-01-31 Richard Gooch (rgooch@atnf.csiro.au)
devfs: boot_options: 0x1
JFFS2 version 2.2. (C) 2001-2003 Red Hat, Inc.
Generic RTC Driver v1.07
Serial: 8250/16550 driver $Revision: 1.90 $ 6 ports, IRQ sharing enabled
ttyS0 at MMIO 0x0 (irq = 0) is a 16550A
ttyS1 at MMIO 0x0 (irq = 1) is a 16550A
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered
RAMDISK driver initialized: 16 RAM disks of 8192K size 1024 blocksize
loop: loaded (max 8 devices)
Intel(R) PRO/1000 Network Driver - version 5.5.4-k2
Copyright (c) 1999-2004 Intel Corporation.
mal0: Initialized, 4 tx channels, 2 rx channels
emac: IBM EMAC Ethernet driver, version 2.0
Maintained by Benjamin Herrenschmidt <benh@kernel.crashing.org>
zmii0: input 0 in RMII mode
eth0: IBM emac, MAC 00:80:f9:69:0b:1f
eth0: Found Generic MII PHY (0x04)
zmii0: input 1 in RMII mode
eth1: IBM emac, MAC 00:80:f9:69:08:1f
eth1: Found Generic MII PHY (0x05)
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
SiI680: IDE controller at PCI slot 0000:00:06.0
SiI680: chipset revision 2
siimage: IDE controller MMIO ports not available.
SiI680: BASE CLOCK == 100
SiI680: 100% native mode on irq 25
    ide0: BM-DMA at 0xffd0-0xffd7, BIOS settings: hda:pio, hdb:pio
    ide1: BM-DMA at 0xffd8-0xffdf, BIOS settings: hdc:pio, hdd:pio
hda: HTS424040M9AT00, ATA DISK drive
elevator: using anticipatory as default io scheduler
ide0 at 0xfff8-0xffff,0xfff6 on irq 25
eth0: Link is Up
eth0: Speed: 100, Full duplex.
hda: max request size: 64KiB
hda: 78140160 sectors (40007 MB) w/1739KiB Cache, CHS=16383/255/63, UDMA(100)
 /dev/ide/host0/bus0/target0/lun0: p1 p2 p3
PmPPC440 flash: Found 1 x16 devices at 0x0 in 16-bit bank
PmPPC440 flash: Found 1 x16 devices at 0x1000000 in 16-bit bank
PmPPC440 flash: Found 1 x16 devices at 0x2000000 in 16-bit bank
PmPPC440 flash: Found 1 x16 devices at 0x3000000 in 16-bit bank
 Intel/Sharp Extended Query Table at 0x0031
Using buffer write method
cfi_cmdset_0001: Erase suspend on write enabled
Creating 5 MTD partitions on "PmPPC440 flash":
0x00000000-0x01d80000 : "Primary Filesystem"
0x01d80000-0x02000000 : "Primary Kernel"
0x02000000-0x03d80000 : "Secondary Filesystem"
0x03d80000-0x03f00000 : "Secondary Kernel"
0x03f00000-0x04000000 : "U-Boot (Reserved)"
mice: PS/2 mouse device common for all mice
i2c /dev entries driver
IBM IIC driver v2.1
ibm-iic0: using standard (100 kHz) mode
ibm-iic1: using standard (100 kHz) mode
NET: Registered protocol family 2
IP: routing cache hash table of 4096 buckets, 32Kbytes
TCP: Hash tables configured (established 131072 bind 65536)
NET: Registered protocol family 1
NET: Registered protocol family 17
eth0: Link is Up
eth0: Speed: 100, Full duplex.
Sending BOOTP requests . OK
IP-Config: Got BOOTP answer from 10.10.2.24, my address is 10.10.14.5
IP-Config: Gateway not on directly connected network.
Looking up port of RPC 100003/2 on 10.10.2.24
Looking up port of RPC 100005/1 on 10.10.2.24
VFS: Mounted root (nfs filesystem).
Mounted devfs on /dev
Freeing unused kernel memory: 324k init
INIT: version 2.84 booting
                Welcome to DENX Embedded Linux Environment
                Press 'I' to enter interactive startup.
Building the cache [  OK  ]
Mounting proc filesystem:  [  OK  ]
Configuring kernel parameters:  [  OK  ]
Setting clock : Tue Sep 18 14:47:08 EDT 2007 [  OK  ]
Setting hostname gsr-fileserver5:  [  OK  ]

Activating swap partitions:  [  OK  ]
Checking filesystems
[  OK  ]
Mounting local filesystems:  [  OK  ]
Enabling swap space:  [  OK  ]

INIT: Entering runlevel: 3
Entering non-interactive startup
Setting network parameters:  [  OK  ]
Bringing up loopback interface:  [  OK  ]
Starting system logger: [  OK  ]
Starting kernel logger: [  OK  ]
Initializing random number generator:  [  OK  ]
Starting portmapper: [  OK  ]
Mounting NFS filesystems:  [  OK  ]
Mounting other filesystems:  [  OK  ]
Starting xinetd: [  OK  ]

gsr-fileserver5 login: root
Last login: Mon Sep 17 20:37:51 on console
bash-2.05b# lspci -v
00:02.0 Class 0680: 3388:0021 (rev 04)
        Subsystem: 1223:003a
        Flags: bus master, stepping, 66Mhz, medium devsel, latency 128, IRQ 25
        Memory at 80000000 (32-bit, prefetchable) [size=512M]
        Capabilities: [dc] Power Management version 4
        Capabilities: [e4] #06 [0094]
        Capabilities: [e8] Vital Product Data

00:06.0 Class 0101: 1095:0680 (rev 02) (prog-if 85 [Master SecO PriO])
        Subsystem: 1095:0680
        Flags: bus master, medium devsel, latency 128, IRQ 25
        I/O ports at fff8 [size=8]
        I/O ports at fff4 [size=4]
        I/O ports at ffe8 [size=8]
        I/O ports at ffe4 [size=4]
        I/O ports at ffd0 [size=16]
        Memory at a0000000 (32-bit, non-prefetchable)
        Expansion ROM at a0080000 [disabled] [size=512K]
        Capabilities: [60] Power Management version 2

bash-2.05b# mount /dev/ide/host0/bus0/target0/lun0/part3 x
bash-2.05b# ls x
bin  boot  etc  images  lib  lost+found  mnt  proc  root  sbin  tmp  usr  var
bash-2.05b# mount /dev/ide/host0/bus0/target0/lun0/part1 y
Oops: kernel access of bad area, sig: 11 [#1]
NIP: C0003804 LR: C00081B0 SP: DE8A3AF0 REGS: de8a3a40 TRAP: 0300    Not tainted

MSR: 00021000 EE: 0 PR: 0 FP: 0 ME: 1 IR/DR: 00
DAR: E0000000, DSISR: 00800000
TASK = dfe9ae20[336] 'mount' THREAD: de8a2000
Last syscall: 21
PLB0: bear= 0x00000000 acr=   0x9b000000 besr=  0x00000000

GPR00: C00082B4 DE8A3AF0 DFE9AE20 E0000000 07FFFFE0 0000001F 00000002 C02A0000
GPR08: 00000000 1FB44000 00000000 C02A0000 00000001 1002863C 1FFA8600 100C0000
GPR16: 00000000 00000000 100D0888 100C2A88 00000001 C02A0000 00029000 00000001
GPR24: 00000002 00000400 00000000 FFFFFC00 DE8A2000 DFB44800 C06BF880 FFFFFC00
NIP [c0003804] invalidate_dcache_range+0x1c/0x30
LR [c00081b0] __dma_sync+0x54/0x60
Call trace:
 [c00082b4] __dma_sync_page+0xf8/0x19c
 [c01467c0] ide_build_sglist+0xa8/0xf8
 [c0146840] ide_build_dmatable+0x30/0x1ac
 [c0146d64] ide_dma_setup+0x3c/0xc8
 [c0148ee4] __ide_do_rw_disk+0x2b8/0x598
 [c013e0f0] start_request+0x190/0x280
 [c013e438] ide_do_request+0x238/0x3d8
 [c011711c] __generic_unplug_device+0x68/0x6c
 [c011713c] generic_unplug_device+0x1c/0x38
 [c0117190] blk_backing_dev_unplug+0x38/0x3c
 [c0056a68] sync_buffer+0x64/0x68
 [c01ca8c4] __wait_on_bit+0xb0/0xc0
 [c01ca934] out_of_line_wait_on_bit+0x60/0x74
 [c0056b30] __wait_on_buffer+0x3c/0x40
 [c0058560] __bread_slow+0xac/0xd4
note: mount[336] exited with preempt_count 1
Oops: kernel access of bad area, sig: 11 [#2]
NIP: C007C7B4 LR: C007CB0C SP: DFDD5E80 REGS: dfdd5dd0 TRAP: 0300    Not tainted

MSR: 00029000 EE: 1 PR: 0 FP: 0 ME: 1 IR/DR: 00
DAR: 00000094, DSISR: 00000000
TASK = c07d0720[7] 'pdflush' THREAD: dfdd4000
Last syscall: -1
PLB0: bear= 0x00000000 acr=   0x9b000000 besr=  0x00000000

GPR00: A0000000 DFDD5E80 C07D0720 DFFD2000 DFDD5F00 00000000 000001F4 00000BB8
GPR08: 00000004 20000000 00000400 00000004 00005B8A 00000000 1FFA8600 007FFF08
GPR16: 00000000 00000001 007FFF00 FFFFFFFF 1FFA3428 00000000 C0250000 FFFC615D
GPR24: C02A0000 C02A0000 DFFD2074 DFFD207C DFDD5F00 C0250000 FFFFFFFC DFFD2000
NIP [c007c7b4] sync_sb_inodes+0x54/0x2a4
LR [c007cb0c] writeback_inodes+0x108/0x120
Call trace:
 [c007cb0c] writeback_inodes+0x108/0x120
 [c0038f48] wb_kupdate+0xe4/0x168
 [c0039c30] __pdflush+0x120/0x1e4
 [c0039d14] pdflush+0x20/0x30
 [c002bd44] kthread+0xb4/0xbc
 [c0003bec] kernel_thread+0x44/0x60
Segmentation fault
bash-2.05b#

^ permalink raw reply

* Re: [PATCH 05/18] Add PowerPC Xilinx Virtex entry to maintainers
From: Grant Likely @ 2007-09-28 19:05 UTC (permalink / raw)
  To: linuxppc-dev, jwboyer, jacmet
In-Reply-To: <20070928181627.18608.29878.stgit@trillian.cg.shawcable.net>

On 9/28/07, Grant Likely <grant.likely@secretlab.ca> wrote:
> From: Grant Likely <grant.likely@secretlab.ca>
>
> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
> ---
>
> Paul, is this okay by you?  Josh has already okayed it.

Specifically, I'll collect the virtex changes and ask Josh to pull
them from me before requesting a pull from you.

Cheers,
g.

> diff --git a/MAINTAINERS b/MAINTAINERS
> index 8f80068..ea4ff15 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -2304,6 +2304,13 @@ L:       linuxppc-embedded@ozlabs.org
>  T:     git kernel.org:/pub/scm/linux/kernel/git/jwboyer/powerpc.git
>  S:     Maintained
>
> +LINUX FOR POWERPC EMBEDDED XILINX VIRTEX
> +P:     Grant Likely
> +M:     grant.likely@secretlab.ca
> +W:     http://www.secretlab.ca/
> +L:     linuxppc-embedded@ozlabs.org
> +S:     Maintained
> +
>  LINUX FOR POWERPC BOOT CODE
>  P:     Tom Rini
>  M:     trini@kernel.crashing.org
>
>


-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195

^ permalink raw reply

* [PATCH] cpm: Describe multi-user ram in its own device node.
From: Scott Wood @ 2007-09-28 19:06 UTC (permalink / raw)
  To: galak; +Cc: linuxppc-dev

The way the current CPM binding describes available multi-user (a.k.a.
dual-ported) RAM doesn't work well when there are multiple free regions,
and it doesn't work at all if the region doesn't begin at the start of
the muram area (as the hardware needs to be programmed with offsets into
this area).  The latter situation can happen with SMC UARTs on CPM2, as its
parameter RAM is relocatable, u-boot puts it at zero, and the kernel doesn't
support moving it.

It is now described with a muram node, similar to QE.  The current CPM
binding is sufficiently recent (i.e. never appeared in an official release)
that compatibility with existing device trees is not an issue.

The code supporting the new binding is shared between cpm1 and cpm2, rather
than remain separated.  QE should be able to use this code as well, once
minor fixes are made to its device trees.

Signed-off-by: Scott Wood <scottwood@freescale.com>
---
 Documentation/powerpc/booting-without-of.txt |   40 ++++++-
 arch/powerpc/Kconfig.debug                   |    6 +-
 arch/powerpc/boot/cpm-serial.c               |   44 +++++--
 arch/powerpc/boot/dts/ep88xc.dts             |   13 ++-
 arch/powerpc/boot/dts/mpc8272ads.dts         |   11 ++
 arch/powerpc/boot/dts/mpc885ads.dts          |   13 ++-
 arch/powerpc/boot/dts/pq2fads.dts            |   13 ++-
 arch/powerpc/sysdev/commproc.c               |   11 ++-
 arch/powerpc/sysdev/cpm2_common.c            |   36 ++----
 arch/powerpc/sysdev/cpm_common.c             |  159 ++++++++++++++++++++++++++
 drivers/serial/cpm_uart/cpm_uart_cpm2.c      |    4 +-
 include/asm-powerpc/commproc.h               |   12 ++
 include/asm-powerpc/cpm.h                    |   14 +++
 include/asm-powerpc/cpm2.h                   |   10 ++
 14 files changed, 338 insertions(+), 48 deletions(-)
 create mode 100644 include/asm-powerpc/cpm.h

diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/powerpc/booting-without-of.txt
index c36dcd2..ce5d67f 100644
--- a/Documentation/powerpc/booting-without-of.txt
+++ b/Documentation/powerpc/booting-without-of.txt
@@ -1861,9 +1861,7 @@ platforms are moved over to use the flattened-device-tree model.
 
    Properties:
    - compatible : "fsl,cpm1", "fsl,cpm2", or "fsl,qe".
-   - reg : The first resource is a 48-byte region beginning with
-           CPCR.  The second is the available general-purpose
-           DPRAM.
+   - reg : A 48-byte region beginning with CPCR.
 
    Example:
 	cpm@119c0 {
@@ -1871,7 +1869,7 @@ platforms are moved over to use the flattened-device-tree model.
 		#size-cells = <1>;
 		#interrupt-cells = <2>;
 		compatible = "fsl,mpc8272-cpm", "fsl,cpm2";
-		reg = <119c0 30 0 2000>;
+		reg = <119c0 30>;
 	}
 
    ii) Properties common to mulitple CPM/QE devices
@@ -2017,6 +2015,40 @@ platforms are moved over to use the flattened-device-tree model.
 		fsl,cpm-command = <2e600000>;
 	};
 
+   viii) Multi-User RAM (MURAM)
+
+   The multi-user/dual-ported RAM is expressed as a bus under the CPM node.
+
+   Ranges must be set up subject to the following restrictions:
+
+   - Children's reg nodes must be offsets from the start of all muram, even
+     if the user-data area does not begin at zero.
+   - If multiple range entries are used, the difference between the parent
+     address and the child address must be the same in all, so that a single
+     mapping can cover them all while maintaining the ability to determine
+     CPM-side offsets with pointer subtraction.  It is recommended that
+     multiple range entries not be used.
+   - A child address of zero must be translatable, even if no reg resources
+     contain it.
+
+   A child "data" node must exist, compatible with "fsl,cpm-muram-data", to
+   indicate the portion of muram that is usable by the OS for arbitrary
+   purposes.  The data node may have an arbitrary number of reg resources,
+   all of which contribute to the allocatable muram pool.
+
+   Example, based on mpc8272:
+
+	muram@0 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges = <0 0 10000>;
+
+		data@0 {
+			compatible = "fsl,cpm-muram-data";
+			reg = <0 2000 9800 800>;
+		};
+	};
+
    m) Chipselect/Local Bus
 
    Properties:
diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug
index f4e5d22..464f9b4 100644
--- a/arch/powerpc/Kconfig.debug
+++ b/arch/powerpc/Kconfig.debug
@@ -245,9 +245,9 @@ config PPC_EARLY_DEBUG_44x_PHYSHIGH
 config PPC_EARLY_DEBUG_CPM_ADDR
 	hex "CPM UART early debug transmit descriptor address"
 	depends on PPC_EARLY_DEBUG_CPM
-	default "0xfa202808" if PPC_EP88XC
-	default "0xf0000808" if CPM2
-	default "0xff002808" if CPM1
+	default "0xfa202008" if PPC_EP88XC
+	default "0xf0000008" if CPM2
+	default "0xff002008" if CPM1
 	help
 	  This specifies the address of the transmit descriptor
 	  used for early debug output.  Because it is needed before
diff --git a/arch/powerpc/boot/cpm-serial.c b/arch/powerpc/boot/cpm-serial.c
index fcb8b5e..28296fa 100644
--- a/arch/powerpc/boot/cpm-serial.c
+++ b/arch/powerpc/boot/cpm-serial.c
@@ -56,7 +56,8 @@ static struct cpm_smc *smc;
 static struct cpm_scc *scc;
 struct cpm_bd *tbdf, *rbdf;
 static u32 cpm_cmd;
-static u8 *dpram_start;
+static u8 *muram_start;
+static u32 muram_offset;
 
 static void (*do_cmd)(int op);
 static void (*enable_port)(void);
@@ -114,13 +115,12 @@ static void scc_enable_port(void)
 
 static int cpm_serial_open(void)
 {
-	int dpaddr = 0x800;
 	disable_port();
 
 	out_8(&param->rfcr, 0x10);
 	out_8(&param->tfcr, 0x10);
 
-	rbdf = (struct cpm_bd *)(dpram_start + dpaddr);
+	rbdf = (struct cpm_bd *)muram_start;
 	rbdf->addr = (u8 *)(rbdf + 2);
 	rbdf->sc = 0xa000;
 	rbdf->len = 1;
@@ -131,8 +131,8 @@ static int cpm_serial_open(void)
 	tbdf->len = 1;
 
 	sync();
-	out_be16(&param->rbase, dpaddr);
-	out_be16(&param->tbase, dpaddr + sizeof(struct cpm_bd));
+	out_be16(&param->rbase, muram_offset);
+	out_be16(&param->tbase, muram_offset + sizeof(struct cpm_bd));
 
 	do_cmd(CPM_CMD_INIT_RX_TX);
 
@@ -178,7 +178,7 @@ int cpm_console_init(void *devp, struct serial_console_data *scdp)
 	void *reg_virt[2];
 	int is_smc = 0, is_cpm2 = 0, n;
 	unsigned long reg_phys;
-	void *parent;
+	void *parent, *muram;
 
 	if (dt_is_compatible(devp, "fsl,cpm1-smc-uart")) {
 		is_smc = 1;
@@ -229,16 +229,36 @@ int cpm_console_init(void *devp, struct serial_console_data *scdp)
 
 	n = getprop(parent, "virtual-reg", reg_virt, sizeof(reg_virt));
 	if (n < (int)sizeof(reg_virt)) {
-		for (n = 0; n < 2; n++) {
-			if (!dt_xlate_reg(parent, n, &reg_phys, NULL))
-				return -1;
+		if (!dt_xlate_reg(parent, 0, &reg_phys, NULL))
+			return -1;
 
-			reg_virt[n] = (void *)reg_phys;
-		}
+		reg_virt[0] = (void *)reg_phys;
 	}
 
 	cpcr = reg_virt[0];
-	dpram_start = reg_virt[1];
+
+	muram = finddevice("/soc/cpm/muram/data");
+	if (!muram)
+		return -1;
+
+	/* For bootwrapper-compatible device trees, we assume that the first
+	 * entry has at least 18 bytes, and that #address-cells/#data-cells
+	 * is one for both parent and child.
+	 */
+
+	n = getprop(muram, "virtual-reg", reg_virt, sizeof(reg_virt));
+	if (n < (int)sizeof(reg_virt)) {
+		if (!dt_xlate_reg(muram, 0, &reg_phys, NULL))
+			return -1;
+
+		reg_virt[0] = (void *)reg_phys;
+	}
+
+	muram_start = reg_virt[0];
+
+	n = getprop(muram, "reg", &muram_offset, 4);
+	if (n < 4)
+		return -1;
 
 	scdp->open = cpm_serial_open;
 	scdp->putc = cpm_serial_putc;
diff --git a/arch/powerpc/boot/dts/ep88xc.dts b/arch/powerpc/boot/dts/ep88xc.dts
index 0406fc5..02705f2 100644
--- a/arch/powerpc/boot/dts/ep88xc.dts
+++ b/arch/powerpc/boot/dts/ep88xc.dts
@@ -142,9 +142,20 @@
 			command-proc = <9c0>;
 			interrupts = <0>;	// cpm error interrupt
 			interrupt-parent = <&CPM_PIC>;
-			reg = <9c0 40 2000 1c00>;
+			reg = <9c0 40>;
 			ranges;
 
+			muram@2000 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				ranges = <0 2000 2000>;
+
+				data@0 {
+					compatible = "fsl,cpm-muram-data";
+					reg = <0 1c00>;
+				};
+			};
+
 			brg@9f0 {
 				compatible = "fsl,mpc885-brg",
 				             "fsl,cpm1-brg",
diff --git a/arch/powerpc/boot/dts/mpc8272ads.dts b/arch/powerpc/boot/dts/mpc8272ads.dts
index 3fe991d..188179d 100644
--- a/arch/powerpc/boot/dts/mpc8272ads.dts
+++ b/arch/powerpc/boot/dts/mpc8272ads.dts
@@ -124,6 +124,17 @@
 			reg = <119c0 30 0 2000>;
 			ranges;
 
+			muram@0 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				ranges = <0 0 10000>;
+
+				data@0 {
+					compatible = "fsl,cpm-muram-data";
+					reg = <0 2000 9800 800>;
+				};
+			};
+
 			brg@119f0 {
 				compatible = "fsl,mpc8272-brg",
 				             "fsl,cpm2-brg",
diff --git a/arch/powerpc/boot/dts/mpc885ads.dts b/arch/powerpc/boot/dts/mpc885ads.dts
index cbcd16f..8848e63 100644
--- a/arch/powerpc/boot/dts/mpc885ads.dts
+++ b/arch/powerpc/boot/dts/mpc885ads.dts
@@ -148,9 +148,20 @@
 			command-proc = <9c0>;
 			interrupts = <0>;	// cpm error interrupt
 			interrupt-parent = <&CPM_PIC>;
-			reg = <9c0 40 2000 1c00>;
+			reg = <9c0 40>;
 			ranges;
 
+			muram@2000 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				ranges = <0 2000 2000>;
+
+				data@0 {
+					compatible = "fsl,cpm-muram-data";
+					reg = <0 1c00>;
+				};
+			};
+
 			brg@9f0 {
 				compatible = "fsl,mpc885-brg",
 				             "fsl,cpm1-brg",
diff --git a/arch/powerpc/boot/dts/pq2fads.dts b/arch/powerpc/boot/dts/pq2fads.dts
index 54e8bd1..2d56492 100644
--- a/arch/powerpc/boot/dts/pq2fads.dts
+++ b/arch/powerpc/boot/dts/pq2fads.dts
@@ -119,9 +119,20 @@
 			#size-cells = <1>;
 			#interrupt-cells = <2>;
 			compatible = "fsl,mpc8280-cpm", "fsl,cpm2";
-			reg = <119c0 30 0 2000>;
+			reg = <119c0 30>;
 			ranges;
 
+			muram@0 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				ranges = <0 0 10000>;
+
+				data@0 {
+					compatible = "fsl,cpm-muram-data";
+					reg = <0 2000 9800 800>;
+				};
+			};
+
 			brg@119f0 {
 				compatible = "fsl,mpc8280-brg",
 				             "fsl,cpm2-brg",
diff --git a/arch/powerpc/sysdev/commproc.c b/arch/powerpc/sysdev/commproc.c
index e37f0a8..4b3e93c 100644
--- a/arch/powerpc/sysdev/commproc.c
+++ b/arch/powerpc/sysdev/commproc.c
@@ -39,12 +39,15 @@
 #include <asm/tlbflush.h>
 #include <asm/rheap.h>
 #include <asm/prom.h>
+#include <asm/cpm.h>
 
 #include <asm/fs_pd.h>
 
 #define CPM_MAP_SIZE    (0x4000)
 
+#ifndef CONFIG_PPC_CPM_NEW_BINDING
 static void m8xx_cpm_dpinit(void);
+#endif
 static uint host_buffer; /* One page of host buffer */
 static uint host_end;    /* end + 1 */
 cpm8xx_t __iomem *cpmp;  /* Pointer to comm processor space */
@@ -193,7 +196,7 @@ end:
 	return sirq;
 }
 
-void cpm_reset(void)
+void __init cpm_reset(void)
 {
 	sysconf8xx_t __iomem *siu_conf;
 
@@ -229,8 +232,12 @@ void cpm_reset(void)
 	out_be32(&siu_conf->sc_sdcr, 1);
 	immr_unmap(siu_conf);
 
+#ifdef CONFIG_PPC_CPM_NEW_BINDING
+	cpm_muram_init();
+#else
 	/* Reclaim the DP memory for our use. */
 	m8xx_cpm_dpinit();
+#endif
 }
 
 /* We used to do this earlier, but have to postpone as long as possible
@@ -296,6 +303,7 @@ cpm_setbrg(uint brg, uint rate)
 		             CPM_BRG_EN | CPM_BRG_DIV16);
 }
 
+#ifndef CONFIG_PPC_CPM_NEW_BINDING
 /*
  * dpalloc / dpfree bits.
  */
@@ -397,6 +405,7 @@ uint cpm_dpram_phys(u8 *addr)
 	return (dpram_pbase + (uint)(addr - dpram_vbase));
 }
 EXPORT_SYMBOL(cpm_dpram_addr);
+#endif /* !CONFIG_PPC_CPM_NEW_BINDING */
 
 struct cpm_ioport16 {
 	__be16 dir, par, sor, dat, intr;
diff --git a/arch/powerpc/sysdev/cpm2_common.c b/arch/powerpc/sysdev/cpm2_common.c
index 9058da2..453f8a5 100644
--- a/arch/powerpc/sysdev/cpm2_common.c
+++ b/arch/powerpc/sysdev/cpm2_common.c
@@ -46,7 +46,10 @@
 
 #include <sysdev/fsl_soc.h>
 
+#ifndef CONFIG_PPC_CPM_NEW_BINDING
 static void cpm2_dpinit(void);
+#endif
+
 cpm_cpm2_t __iomem *cpmp; /* Pointer to comm processor space */
 
 /* We allocate this here because it is used almost exclusively for
@@ -65,7 +68,11 @@ cpm2_reset(void)
 
 	/* Reclaim the DP memory for our use.
 	 */
+#ifdef CONFIG_PPC_CPM_NEW_BINDING
+	cpm_muram_init();
+#else
 	cpm2_dpinit();
+#endif
 
 	/* Tell everyone where the comm processor resides.
 	 */
@@ -312,6 +319,7 @@ int cpm2_smc_clk_setup(enum cpm_clk_target target, int clock)
 	return ret;
 }
 
+#ifndef CONFIG_PPC_CPM_NEW_BINDING
 /*
  * dpalloc / dpfree bits.
  */
@@ -324,28 +332,6 @@ static u8 __iomem *im_dprambase;
 
 static void cpm2_dpinit(void)
 {
-	struct resource r;
-
-#ifdef CONFIG_PPC_CPM_NEW_BINDING
-	struct device_node *np;
-
-	np = of_find_compatible_node(NULL, NULL, "fsl,cpm2");
-	if (!np)
-		panic("Cannot find CPM2 node");
-
-	if (of_address_to_resource(np, 1, &r))
-		panic("Cannot get CPM2 resource 1");
-
-	of_node_put(np);
-#else
-	r.start = CPM_MAP_ADDR + CPM_DATAONLY_BASE;
-	r.end = r.start + CPM_DATAONLY_SIZE - 1;
-#endif
-
-	im_dprambase = ioremap(r.start, r.end - r.start + 1);
-	if (!im_dprambase)
-		panic("Cannot map DPRAM");
-
 	spin_lock_init(&cpm_dpmem_lock);
 
 	/* initialize the info header */
@@ -354,13 +340,16 @@ static void cpm2_dpinit(void)
 			sizeof(cpm_boot_dpmem_rh_block[0]),
 			cpm_boot_dpmem_rh_block);
 
+	im_dprambase = cpm2_immr->im_dprambase;
+
 	/* Attach the usable dpmem area */
 	/* XXX: This is actually crap. CPM_DATAONLY_BASE and
 	 * CPM_DATAONLY_SIZE is only a subset of the available dpram. It
 	 * varies with the processor and the microcode patches activated.
 	 * But the following should be at least safe.
 	 */
-	rh_attach_region(&cpm_dpmem_info, 0, r.end - r.start + 1);
+	rh_attach_region(&cpm_dpmem_info, CPM_MAP_ADDR + CPM_DATAONLY_BASE,
+	                 CPM_DATAONLY_SIZE);
 }
 
 /* This function returns an index into the DPRAM area.
@@ -418,6 +407,7 @@ void *cpm_dpram_addr(unsigned long offset)
 	return (void *)(im_dprambase + offset);
 }
 EXPORT_SYMBOL(cpm_dpram_addr);
+#endif /* !CONFIG_PPC_CPM_NEW_BINDING */
 
 struct cpm2_ioports {
 	u32 dir, par, sor, odr, dat;
diff --git a/arch/powerpc/sysdev/cpm_common.c b/arch/powerpc/sysdev/cpm_common.c
index 9daa6ac..66c8ad4 100644
--- a/arch/powerpc/sysdev/cpm_common.c
+++ b/arch/powerpc/sysdev/cpm_common.c
@@ -5,15 +5,27 @@
  *
  * Copyright 2007 Freescale Semiconductor, Inc.
  *
+ * Some parts derived from commproc.c/cpm2_common.c, which is:
+ * Copyright (c) 1997 Dan error_act (dmalek@jlc.net)
+ * Copyright (c) 1999-2001 Dan Malek <dan@embeddedalley.com>
+ * Copyright (c) 2000 MontaVista Software, Inc (source@mvista.com)
+ * 2006 (c) MontaVista Software, Inc.
+ * Vitaly Bordug <vbordug@ru.mvista.com>
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of version 2 of the GNU General Public License as
  * published by the Free Software Foundation.
  */
 
 #include <linux/init.h>
+#include <linux/of_device.h>
+
 #include <asm/udbg.h>
 #include <asm/io.h>
 #include <asm/system.h>
+#include <asm/rheap.h>
+#include <asm/cpm.h>
+
 #include <mm/mmu_decl.h>
 
 #ifdef CONFIG_PPC_EARLY_DEBUG_CPM
@@ -41,6 +53,153 @@ void __init udbg_init_cpm(void)
 		setbat(1, 0xf0000000, 0xf0000000, 1024*1024, _PAGE_IO);
 #endif
 		udbg_putc = udbg_putc_cpm;
+		udbg_putc('X');
 	}
 }
 #endif
+
+#ifdef CONFIG_PPC_CPM_NEW_BINDING
+static spinlock_t cpm_muram_lock;
+static rh_block_t cpm_boot_muram_rh_block[16];
+static rh_info_t cpm_muram_info;
+static u8 __iomem *muram_vbase;
+static phys_addr_t muram_pbase;
+
+/* Max address size we deal with */
+#define OF_MAX_ADDR_CELLS	4
+
+int __init cpm_muram_init(void)
+{
+	struct device_node *np;
+	struct resource r;
+	u32 zero[OF_MAX_ADDR_CELLS] = {};
+	resource_size_t max = 0;
+	int i = 0;
+	int ret = 0;
+
+	printk("cpm_muram_init\n");
+
+	spin_lock_init(&cpm_muram_lock);
+	/* initialize the info header */
+	rh_init(&cpm_muram_info, 1,
+	        sizeof(cpm_boot_muram_rh_block) /
+	        sizeof(cpm_boot_muram_rh_block[0]),
+	        cpm_boot_muram_rh_block);
+
+	np = of_find_compatible_node(NULL, NULL, "fsl,cpm-muram-data");
+	if (!np) {
+		printk(KERN_ERR "Cannot find CPM muram data node");
+		ret = -ENODEV;
+		goto out;
+	}
+
+	muram_pbase = of_translate_address(np, zero);
+	if (muram_pbase == (phys_addr_t)OF_BAD_ADDR) {
+		printk(KERN_ERR "Cannot translate zero through CPM muram node");
+		ret = -ENODEV;
+		goto out;
+	}
+
+	while (of_address_to_resource(np, i++, &r) == 0) {
+		if (r.end > max)
+			max = r.end;
+
+		rh_attach_region(&cpm_muram_info, r.start - muram_pbase,
+		                 r.end - r.start + 1);
+	}
+
+	muram_vbase = ioremap(muram_pbase, max - muram_pbase + 1);
+	if (!muram_vbase) {
+		printk(KERN_ERR "Cannot map CPM muram");
+		ret = -ENOMEM;
+	}
+
+out:
+	of_node_put(np);
+	return ret;
+}
+
+/**
+ * cpm_muram_alloc - allocate the requested size worth of multi-user ram
+ * @size: number of bytes to allocate
+ * @align: requested alignment, in bytes
+ *
+ * This function returns an offset into the muram area.
+ * Use cpm_dpram_addr() to get the virtual address of the area.
+ * Use cpm_muram_free() to free the allocation.
+ */
+unsigned long cpm_muram_alloc(unsigned long size, unsigned long align)
+{
+	unsigned long start;
+	unsigned long flags;
+
+	spin_lock_irqsave(&cpm_muram_lock, flags);
+	cpm_muram_info.alignment = align;
+	start = rh_alloc(&cpm_muram_info, size, "commproc");
+	spin_unlock_irqrestore(&cpm_muram_lock, flags);
+
+	return start;
+}
+EXPORT_SYMBOL(cpm_muram_alloc);
+
+/**
+ * cpm_muram_free - free a chunk of multi-user ram
+ * @offset: The beginning of the chunk as returned by cpm_muram_alloc().
+ */
+int cpm_muram_free(unsigned long offset)
+{
+	int ret;
+	unsigned long flags;
+
+	spin_lock_irqsave(&cpm_muram_lock, flags);
+	ret = rh_free(&cpm_muram_info, offset);
+	spin_unlock_irqrestore(&cpm_muram_lock, flags);
+
+	return ret;
+}
+EXPORT_SYMBOL(cpm_muram_free);
+
+/**
+ * cpm_muram_alloc_fixed - reserve a specific region of multi-user ram
+ * @offset: the offset into the muram area to reserve
+ * @size: the number of bytes to reserve
+ *
+ * This function returns "start" on success, -ENOMEM on failure.
+ * Use cpm_dpram_addr() to get the virtual address of the area.
+ * Use cpm_muram_free() to free the allocation.
+ */
+unsigned long cpm_muram_alloc_fixed(unsigned long offset, unsigned long size)
+{
+	unsigned long start;
+	unsigned long flags;
+
+	spin_lock_irqsave(&cpm_muram_lock, flags);
+	cpm_muram_info.alignment = 1;
+	start = rh_alloc_fixed(&cpm_muram_info, offset, size, "commproc");
+	spin_unlock_irqrestore(&cpm_muram_lock, flags);
+
+	return start;
+}
+EXPORT_SYMBOL(cpm_muram_alloc_fixed);
+
+/**
+ * cpm_muram_addr - turn a muram offset into a virtual address
+ * @offset: muram offset to convert
+ */
+void __iomem *cpm_muram_addr(unsigned long offset)
+{
+	return muram_vbase + offset;
+}
+EXPORT_SYMBOL(cpm_muram_addr);
+
+/**
+ * cpm_muram_phys - turn a muram virtual address into a DMA address
+ * @offset: virtual address from cpm_muram_addr() to convert
+ */
+dma_addr_t cpm_muram_dma(void __iomem *addr)
+{
+	return muram_pbase + ((u8 __iomem *)addr - muram_vbase);
+}
+EXPORT_SYMBOL(cpm_muram_dma);
+
+#endif /* CONFIG_PPC_CPM_NEW_BINDING */
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm2.c b/drivers/serial/cpm_uart/cpm_uart_cpm2.c
index 5bd4508..882dbc1 100644
--- a/drivers/serial/cpm_uart/cpm_uart_cpm2.c
+++ b/drivers/serial/cpm_uart/cpm_uart_cpm2.c
@@ -235,7 +235,7 @@ void scc4_lineif(struct uart_cpm_port *pinfo)
 int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con)
 {
 	int dpmemsz, memsz;
-	u8 *dp_mem;
+	u8 __iomem *dp_mem;
 	unsigned long dp_offset;
 	u8 *mem_addr;
 	dma_addr_t dma_addr = 0;
@@ -278,7 +278,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con)
 	pinfo->tx_buf = pinfo->rx_buf + L1_CACHE_ALIGN(pinfo->rx_nrfifos
 						       * pinfo->rx_fifosize);
 
-	pinfo->rx_bd_base = (cbd_t __iomem __force *)dp_mem;
+	pinfo->rx_bd_base = (cbd_t __iomem *)dp_mem;
 	pinfo->tx_bd_base = pinfo->rx_bd_base + pinfo->rx_nrfifos;
 
 	return 0;
diff --git a/include/asm-powerpc/commproc.h b/include/asm-powerpc/commproc.h
index 5dec324..0307c84 100644
--- a/include/asm-powerpc/commproc.h
+++ b/include/asm-powerpc/commproc.h
@@ -19,6 +19,7 @@
 
 #include <asm/8xx_immap.h>
 #include <asm/ptrace.h>
+#include <asm/cpm.h>
 
 /* CPM Command register.
 */
@@ -54,6 +55,7 @@
 
 #define mk_cr_cmd(CH, CMD)	((CMD << 8) | (CH << 4))
 
+#ifndef CONFIG_PPC_CPM_NEW_BINDING
 /* The dual ported RAM is multi-functional.  Some areas can be (and are
  * being) used for microcode.  There is an area that can only be used
  * as data ram for buffer descriptors, which is all we use right now.
@@ -62,17 +64,27 @@
 #define CPM_DATAONLY_BASE	((uint)0x0800)
 #define CPM_DATAONLY_SIZE	((uint)0x0700)
 #define CPM_DP_NOSPACE		((uint)0x7fffffff)
+#endif
 
 /* Export the base address of the communication processor registers
  * and dual port ram.
  */
 extern cpm8xx_t __iomem *cpmp; /* Pointer to comm processor */
+
+#ifdef CONFIG_PPC_CPM_NEW_BINDING
+#define cpm_dpalloc cpm_muram_alloc
+#define cpm_dpfree cpm_muram_free
+#define cpm_dpram_addr cpm_muram_addr
+#define cpm_dpram_phys cpm_muram_dma
+#else
 extern unsigned long cpm_dpalloc(uint size, uint align);
 extern int cpm_dpfree(unsigned long offset);
 extern unsigned long cpm_dpalloc_fixed(unsigned long offset, uint size, uint align);
 extern void cpm_dpdump(void);
 extern void *cpm_dpram_addr(unsigned long offset);
 extern uint cpm_dpram_phys(u8* addr);
+#endif
+
 extern void cpm_setbrg(uint brg, uint rate);
 
 extern uint m8xx_cpm_hostalloc(uint size);
diff --git a/include/asm-powerpc/cpm.h b/include/asm-powerpc/cpm.h
new file mode 100644
index 0000000..48df9f3
--- /dev/null
+++ b/include/asm-powerpc/cpm.h
@@ -0,0 +1,14 @@
+#ifndef __CPM_H
+#define __CPM_H
+
+#include <linux/compiler.h>
+#include <linux/types.h>
+
+int cpm_muram_init(void);
+unsigned long cpm_muram_alloc(unsigned long size, unsigned long align);
+int cpm_muram_free(unsigned long offset);
+unsigned long cpm_muram_alloc_fixed(unsigned long offset, unsigned long size);
+void __iomem *cpm_muram_addr(unsigned long offset);
+dma_addr_t cpm_muram_dma(void __iomem *addr);
+
+#endif
diff --git a/include/asm-powerpc/cpm2.h b/include/asm-powerpc/cpm2.h
index d7b57ac..e698b1d 100644
--- a/include/asm-powerpc/cpm2.h
+++ b/include/asm-powerpc/cpm2.h
@@ -11,6 +11,7 @@
 #define __CPM2__
 
 #include <asm/immap_cpm2.h>
+#include <asm/cpm.h>
 
 /* CPM Command register.
 */
@@ -82,6 +83,7 @@
 #define mk_cr_cmd(PG, SBC, MCN, OP) \
 	((PG << 26) | (SBC << 21) | (MCN << 6) | OP)
 
+#ifndef CONFIG_PPC_CPM_NEW_BINDING
 /* Dual Port RAM addresses.  The first 16K is available for almost
  * any CPM use, so we put the BDs there.  The first 128 bytes are
  * used for SMC1 and SMC2 parameter RAM, so we start allocating
@@ -97,6 +99,7 @@
 #define CPM_DATAONLY_SIZE	((uint)(16 * 1024) - CPM_DATAONLY_BASE)
 #define CPM_FCC_SPECIAL_BASE	((uint)0x0000b000)
 #endif
+#endif
 
 /* The number of pages of host memory we allocate for CPM.  This is
  * done early in kernel initialization to get physically contiguous
@@ -109,11 +112,18 @@
  */
 extern cpm_cpm2_t __iomem *cpmp; /* Pointer to comm processor */
 
+#ifdef CONFIG_PPC_CPM_NEW_BINDING
+#define cpm_dpalloc cpm_muram_alloc
+#define cpm_dpfree cpm_muram_free
+#define cpm_dpram_addr cpm_muram_addr
+#else
 extern unsigned long cpm_dpalloc(uint size, uint align);
 extern int cpm_dpfree(unsigned long offset);
 extern unsigned long cpm_dpalloc_fixed(unsigned long offset, uint size, uint align);
 extern void cpm_dpdump(void);
 extern void *cpm_dpram_addr(unsigned long offset);
+#endif
+
 extern void cpm_setbrg(uint brg, uint rate);
 extern void cpm2_fastbrg(uint brg, uint rate, int div16);
 extern void cpm2_reset(void);
-- 
1.5.3.2

^ permalink raw reply related

* Re: [Cbe-oss-dev] [patch 0/8] PS3 AV Settings Driver patches for 2.6.24
From: Geoff Levand @ 2007-09-28 19:29 UTC (permalink / raw)
  To: michael
  Cc: Geert Uytterhoeven, linuxppc-dev, linux-fbdev-devel, cbe-oss-dev,
	Antonino A. Daplas
In-Reply-To: <1190968833.15970.3.camel@concordia>

Michael Ellerman wrote:
> On Thu, 2007-09-27 at 10:23 -0700, Geoff Levand wrote:
>> Michael Ellerman wrote:
>> > On Wed, 2007-09-26 at 18:33 +0200, Geert Uytterhoeven wrote:
>> >> Question: As several DVI-D displays advertise they support 1080i modes while
>> >> they actually don't (cfr. the quirk database), perhaps I should drop 1080i
>> >> modes completely from the ps3av_preferred_modes[] table? Usually 720p looks
>> >> better than 1080i anyway.  What do you think?
>> > 
>> > Definitely. If the autodetection fails Linux is basically unusable on
>> > PS3 unless you hack the kernel sources and build your own kboot and
>> > otheros.bld - not entirely trivial for novice users. So it's pretty
>> > important that it works 100%.
>> 
>> It is not that bad.  If a bootloader is configued to use autodetection
>> so that it is shown at best video mode, then it should have advertised
>> key sequences to default to known video modes, with at least a 480p 'safe'
>> mode.
> 
> Oh OK, that is a good idea. What's the "safe mode" key sequence for the
> otheros.bld you provide on kernel.org?


I don't maintain that, and have no idea how it sets its video mode.  Did you
have trouble with it?  I know in the past it used a fixed 480p mode. 


-Geoff

^ permalink raw reply

* Re: [PATCH 02/18] Add Kconfig macros for Xilinx Virtex support
From: Grant Likely @ 2007-09-28 19:35 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev
In-Reply-To: <46FD45FA.3000205@freescale.com>

On 9/28/07, Scott Wood <scottwood@freescale.com> wrote:
> Grant Likely wrote:
> > From: Grant Likely <grant.likely@secretlab.ca>
> >
> > Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
> > ---
> >
> >  arch/powerpc/platforms/40x/Kconfig |   30 +++++++++++++++++-------------
> >  1 files changed, 17 insertions(+), 13 deletions(-)
> >
> > diff --git a/arch/powerpc/platforms/40x/Kconfig b/arch/powerpc/platforms/40x/Kconfig
> > index c3dce3b..1aae0e6 100644
> > --- a/arch/powerpc/platforms/40x/Kconfig
> > +++ b/arch/powerpc/platforms/40x/Kconfig
> > @@ -61,13 +61,14 @@ config WALNUT
> >       help
> >         This option enables support for the IBM PPC405GP evaluation board.
> >
> > -#config XILINX_ML300
> > -#    bool "Xilinx-ML300"
> > -#    depends on 40x
> > -#    default y
> > -#    select VIRTEX_II_PRO
> > -#    help
> > -#      This option enables support for the Xilinx ML300 evaluation board.
> > +config XILINX_VIRTEX_GENERIC_BOARD
> > +     bool "Generic Xilinx Virtex board"
> > +     depends on 40x
> > +     default y
> > +     select VIRTEX_II_PRO
> > +     select VIRTEX_4_FX
> > +     help
> > +       This option enables generic support for Xilinx Virtex based boards.
>
> I don't think we want default y here.

I just followed the lead of Walnut here.  Perhaps for the embedded
targets all of them should be 'default n'.  Josh, thoughts?

g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195

^ permalink raw reply

* Re: [PATCH 11/18] Virtex: Port UARTLITE driver to of-platform-bus
From: Arnd Bergmann @ 2007-09-28 19:32 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <20070928181748.18608.62409.stgit@trillian.cg.shawcable.net>

T24gRnJpZGF5IDI4IFNlcHRlbWJlciAyMDA3LCBHcmFudCBMaWtlbHkgd3JvdGU6Cj4gLaCgoKCg
oKByZXQgPSB1YXJ0X3JlZ2lzdGVyX2RyaXZlcigmdWxpdGVfdWFydF9kcml2ZXIpOwo+IC2goKCg
oKCgaWYgKHJldCkKPiAtoKCgoKCgoKCgoKCgoKCgcmV0dXJuIHJldDsKPiAroKCgoKCgoHByX2Rl
YnVnKCJ1YXJ0bGl0ZTogY2FsbGluZyB1YXJ0X3JlZ2lzdGVyX2RyaXZlcigpXG4iKTsKPiAroKCg
oKCgoGlmICgocmV0ID0gdWFydF9yZWdpc3Rlcl9kcml2ZXIoJnVsaXRlX3VhcnRfZHJpdmVyKSkg
IT0gMCkKPiAroKCgoKCgoKCgoKCgoKCgZ290byBlcnJfdWFydDsKPiCgCj4gLaCgoKCgoKByZXQg
PSBwbGF0Zm9ybV9kcml2ZXJfcmVnaXN0ZXIoJnVsaXRlX3BsYXRmb3JtX2RyaXZlcik7Cj4gLaCg
oKCgoKBpZiAocmV0KQo+IC2goKCgoKCgoKCgoKCgoKB1YXJ0X3VucmVnaXN0ZXJfZHJpdmVyKCZ1
bGl0ZV91YXJ0X2RyaXZlcik7Cj4gK6CgoKCgoKBpZiAoKHJldCA9IHVsaXRlX29mX3JlZ2lzdGVy
KCkpICE9IDApCj4gK6CgoKCgoKCgoKCgoKCgoGdvdG8gZXJyX29mOwo+IKAKPiAroKCgoKCgoHBy
X2RlYnVnKCJ1YXJ0bGl0ZTogY2FsbGluZyBwbGF0Zm9ybV9kcml2ZXJfcmVnaXN0ZXIoKVxuIik7
Cj4gK6CgoKCgoKBpZiAoKHJldCA9IHBsYXRmb3JtX2RyaXZlcl9yZWdpc3RlcigmdWxpdGVfcGxh
dGZvcm1fZHJpdmVyKSkgIT0gMCkKPiAroKCgoKCgoKCgoKCgoKCgZ290byBlcnJfcGxhdDsKPiAr
Cj4gK6CgoKCgoKByZXR1cm4gMDsKCkkgZG9uJ3Qgc2VlIHRoaXMgYXMgbXVjaCBvZiBhbiBpbXBy
b3ZlbWVudC4gRG9pbmcgYW4gYXNzaWdubWVudCBpbiB0aGUKY29uZGl0aW9uIG1ha2VzIHRoZSBj
b2RlIGxlc3MgcmVhZGFibGUgSU1ITywgc28gaXQgc2hvdWxkIHJlYWxseQpiZSB3cml0dGVuIGFz
CgoJcmV0ID0gdHJ5X3NvbWV0aGluZygpOwoJaWYgKHJldCkKCQlnb3RvIHNvbWV0aGluZ19mYWls
ZWQ7CgpUaGlzIGtlZXBzIHRoZSBub3JtYWwgY29kZSB0byB0aGUgbGVmdCwgYW5kIHRoZSBlcnJv
ciBoYW5kbGluZyBpbmRlbnRlZAp0byB0aGUgcmlnaHQuCgoKCUFybmQgPD48Cg==

^ permalink raw reply

* Re: [PATCH 12/18] Uartlite: Let the console be initialized earlier
From: Arnd Bergmann @ 2007-09-28 19:40 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <20070928181754.18608.52779.stgit@trillian.cg.shawcable.net>

On Friday 28 September 2007, Grant Likely wrote:
> +#else /* CONFIG_OF */
> +static void __init ulite_console_of_find_device(int id) { /* do nothing */ }
> +#endif /* CONFIG_OF */

Shouldn't this be inline? It shouldn't matter much since most of the time
gcc -funit-at-a-time takes care of this, but it's common to make the inlining
explicit.

	Arnd <><

^ permalink raw reply

* Re: [PATCH 10/18] Uartlite: improve in-code comments
From: Arnd Bergmann @ 2007-09-28 19:43 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <20070928181740.18608.67126.stgit@trillian.cg.shawcable.net>

On Friday 28 September 2007, Grant Likely wrote:
> +/* ---------------------------------------------------------------------
> + * Core UART driver operations
> + */
> +

This is a rather unusual style of commenting. IMHO it would be better if you
left out the ----- line.

	Arnd <><

^ permalink raw reply

* Re: [PATCH 01/18] Virtex: Add uartlite bootwrapper driver
From: Arnd Bergmann @ 2007-09-28 19:45 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <20070928181551.18608.88418.stgit@trillian.cg.shawcable.net>

On Friday 28 September 2007, Grant Likely wrote:
> +static void uartlite_putc(unsigned char c)
> +{
> +=A0=A0=A0=A0=A0=A0=A0while ((in_be32(reg_base + 0x8) & 0x08) !=3D 0); /*=
 spin */
> +=A0=A0=A0=A0=A0=A0=A0out_be32(reg_base + 0x4, c);
> +}

When coding a spin-loop, it's better to do a cpu_relax() between
each attempt.

	Arnd <><

^ permalink raw reply

* Re: [PATCH 12/18] Uartlite: Let the console be initialized earlier
From: Grant Likely @ 2007-09-28 20:01 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linuxppc-dev
In-Reply-To: <200709282140.07000.arnd@arndb.de>

On 9/28/07, Arnd Bergmann <arnd@arndb.de> wrote:
> On Friday 28 September 2007, Grant Likely wrote:
> > +#else /* CONFIG_OF */
> > +static void __init ulite_console_of_find_device(int id) { /* do nothing */ }
> > +#endif /* CONFIG_OF */
>
> Shouldn't this be inline? It shouldn't matter much since most of the time
> gcc -funit-at-a-time takes care of this, but it's common to make the inlining
> explicit.

heh, I even had the inline in there on an earlier version of the
patch.  I can add it back it.

g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195

^ permalink raw reply

* Re: [PATCH 00/18] Virtex support in arch/powerpc
From: Arnd Bergmann @ 2007-09-28 19:46 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <20070928181421.18608.74224.stgit@trillian.cg.shawcable.net>

Hi Grant!

On Friday 28 September 2007, Grant Likely wrote:
> This series adds Xilinx Virtex support to arch/powerpc. =A0Please review
> and comment. =A0It includes support for the uartlite and SystemACE devices

Very nice set of patches, I looked at all of them but couldn't find much
to complain about, just trivial details.

	Arnd <><

^ permalink raw reply

* Re: [PATCH 10/18] Uartlite: improve in-code comments
From: Grant Likely @ 2007-09-28 20:02 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linuxppc-dev
In-Reply-To: <200709282143.16815.arnd@arndb.de>

On 9/28/07, Arnd Bergmann <arnd@arndb.de> wrote:
> On Friday 28 September 2007, Grant Likely wrote:
> > +/* ---------------------------------------------------------------------
> > + * Core UART driver operations
> > + */
> > +
>
> This is a rather unusual style of commenting. IMHO it would be better if you
> left out the ----- line.

I find the horizontal breaks useful when parsing through the code.  If
others agree with you, then I'll happily remove them.

g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195

^ permalink raw reply

* Re: [PATCH 01/18] Virtex: Add uartlite bootwrapper driver
From: Grant Likely @ 2007-09-28 20:04 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linuxppc-dev
In-Reply-To: <200709282145.09411.arnd@arndb.de>

On 9/28/07, Arnd Bergmann <arnd@arndb.de> wrote:
> On Friday 28 September 2007, Grant Likely wrote:
> > +static void uartlite_putc(unsigned char c)
> > +{
> > +while ((in_be32(reg_base + 0x8) & 0x08) != 0); /* spin */
> > +out_be32(reg_base + 0x4, c);
> > +}
>
> When coding a spin-loop, it's better to do a cpu_relax() between
> each attempt.

Is cpu_relax even implemented in the bootwrapper?

g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195

^ permalink raw reply

* Re: [PATCH 00/18] Virtex support in arch/powerpc
From: Grant Likely @ 2007-09-28 20:05 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linuxppc-dev
In-Reply-To: <200709282146.14944.arnd@arndb.de>

On 9/28/07, Arnd Bergmann <arnd@arndb.de> wrote:
> Hi Grant!
>
> On Friday 28 September 2007, Grant Likely wrote:
> > This series adds Xilinx Virtex support to arch/powerpc. Please review
> > and comment. It includes support for the uartlite and SystemACE devices
>
> Very nice set of patches, I looked at all of them but couldn't find much
> to complain about, just trivial details.

Thank you very much for the review!

Cheers,
g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195

^ permalink raw reply

* Re: [PATCH] cpm: Describe multi-user ram in its own device node.
From: Vitaly Bordug @ 2007-09-28 20:06 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev
In-Reply-To: <20070928190616.GB20213@loki.buserror.net>

Hello Scott,

Looks good, only one note:

On Fri, 28 Sep 2007 14:06:16 -0500
Scott Wood wrote:

> +	im_dprambase = cpm2_immr->im_dprambase;
> +
>  	/* Attach the usable dpmem area */
>  	/* XXX: This is actually crap. CPM_DATAONLY_BASE and
>  	 * CPM_DATAONLY_SIZE is only a subset of the available dpram. It
>  	 * varies with the processor and the microcode patches activated.
>  	 * But the following should be at least safe.
>  	 */
> -	rh_attach_region(&cpm_dpmem_info, 0, r.end - r.start + 1);
> +	rh_attach_region(&cpm_dpmem_info, CPM_MAP_ADDR + CPM_DATAONLY_BASE,
> +	                 CPM_DATAONLY_SIZE);
>  }
>  
Can we have something to address upper comment? I mean,any way to have dpram beginning and size encoded in the device tree? We seem to be adding new bus, and still pulling the information from the defines. Maybe I miss something
here, but it looks a bit odd.

-- 
Sincerely, Vitaly

^ permalink raw reply

* Re: [PATCH] cpm: Describe multi-user ram in its own device node.
From: Scott Wood @ 2007-09-28 20:10 UTC (permalink / raw)
  To: Vitaly Bordug; +Cc: linuxppc-dev
In-Reply-To: <20070929000621.2d332e86@kernel.crashing.org>

Vitaly Bordug wrote:
> Hello Scott,
> 
> Looks good, only one note:
> 
> On Fri, 28 Sep 2007 14:06:16 -0500
> Scott Wood wrote:
> 
>> +	im_dprambase = cpm2_immr->im_dprambase;
>> +
>>  	/* Attach the usable dpmem area */
>>  	/* XXX: This is actually crap. CPM_DATAONLY_BASE and
>>  	 * CPM_DATAONLY_SIZE is only a subset of the available dpram. It
>>  	 * varies with the processor and the microcode patches activated.
>>  	 * But the following should be at least safe.
>>  	 */
>> -	rh_attach_region(&cpm_dpmem_info, 0, r.end - r.start + 1);
>> +	rh_attach_region(&cpm_dpmem_info, CPM_MAP_ADDR + CPM_DATAONLY_BASE,
>> +	                 CPM_DATAONLY_SIZE);
>>  }
>>  
 >
> Can we have something to address upper comment? I mean,any way to
> have dpram beginning and size encoded in the device tree? We seem to
> be adding new bus, and still pulling the information from the
> defines. Maybe I miss something here, but it looks a bit odd.

This bit is #ifndef CONFIG_PPC_CPM_NEW_BINDING (and can come out once 
all arch/powerpc boards are converted and tested -- I think it's just 
mpc866ads and CPM mpc85xx left to go).  The new code in 
arch/powerpc/sysdev/cpm_common.c does get it from the device tree.

-Scott

^ permalink raw reply

* Re: [PATCH 03/18] Virtex: add xilinx interrupt controller driver
From: Olof Johansson @ 2007-09-28 20:17 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev
In-Reply-To: <20070928181606.18608.30412.stgit@trillian.cg.shawcable.net>

On Fri, Sep 28, 2007 at 12:16:07PM -0600, Grant Likely wrote:

> +/*
> + * INTC Registers
> + */
> +#define ISR	0	/* Interrupt Status */
> +#define IPR	4	/* Interrupt Pending */
> +#define IER	8	/* Interrupt Enable */
> +#define IAR	12	/* Interrupt Acknowledge */
> +#define SIE	16	/* Set Interrupt Enable bits */
> +#define CIE	20	/* Clear Interrupt Enable bits */
> +#define IVR	24	/* Interrupt Vector */
> +#define MER	28	/* Master Enable */

The defines are fairly generic, I guess you haven't ran across cases
where there's naming conflicts, but you might want to prefix them with
something more unique just in case.

> +static struct irq_host *master_irqhost;
> +
> +/*
> + * IRQ Chip operations
> + */
> +static void xilinx_intc_mask(unsigned int virq)
> +{
> +	int irq = irq_map[virq].hwirq;
> +	void * regs = get_irq_chip_data(virq);
> +	pr_debug("mask: %d\n", irq);
> +	out_be32(regs + CIE, 1 << irq);
> +}
> +
> +static void xilinx_intc_unmask(unsigned int virq)
> +{
> +	int irq = irq_map[virq].hwirq;
> +	void * regs = get_irq_chip_data(virq);
> +	pr_debug("unmask: %d\n", irq);
> +	out_be32(regs + SIE, 1 << irq);
> +}
> +
> +static void xilinx_intc_ack(unsigned int virq)
> +{
> +	int irq = irq_map[virq].hwirq;
> +	void * regs = get_irq_chip_data(virq);
> +	pr_debug("ack: %d\n", irq);
> +	out_be32(regs + IAR, 1 << irq);
> +}

I guess some of the above are open-coded instead of using virq_to_hw()
for performance reasons, it could be useful to have comments regarding
this so they aren't changed by some janitor down the road. Or, in case
they're not performance-critical, change them to use virq_to_hw.


-Olof

^ permalink raw reply

* Re: [PATCH 1/2] qemu platform, v2
From: Rob Landley @ 2007-09-28 20:14 UTC (permalink / raw)
  To: Segher Boessenkool
  Cc: linuxppc-dev, Paul Mackerras, Christoph Hellwig, Milton Miller,
	David Gibson
In-Reply-To: <4d27912d86d1373ca01d43bd296e237b@kernel.crashing.org>

On Friday 28 September 2007 11:53:28 am Segher Boessenkool wrote:
> >> I'd be following this more closely if compiling a device tree didn't
> >> currently
> >> require an external utility (dtc or some such) that doesn't come with
> >> the
> >> Linux kernel.  No other target platform I've built kernels for
> >> requires such
> >> an environmental dependency.
> >
> > No?  You haven't built kernels for other platforms that have external
> > dependencies such as perl, gcc, make, binutils, etc.? :)
>
> Two of the supported Linux archs cannot be built with a mainline
> compiler, even!

Strange definition of "supported"...

> And I have to install GNU sed/awk to get builds to work, too.

I extended busybox sed until it built everything I threw at it.  (I even added 
a "lie to autoconf" step that replies to --version to say "This is not gnu 
sed 4.0" so a regex in autoconf doesn't do something stupid.)

That's how I got into busybox development in the first place...

> OTOH, it would be nice if we didn't need DTC -- it itself doesn't
> build out-of-the-box on all systems, either ;-)

I've built x86, x86-64, mips, arm, and sparc.  None of them needed anything 
but the seven packages I mentioned.  I'm poking at adding m68k, alpha, bfin, 
and powerpc, but my free time's been spoken for recently.  (I'll become 
interested in sh or parisc when qemu grows support for it.  I'm only 
interested in bfin because I was given some free blackfin hardware at OLS.)

I've even poked at running s390 under Hercules but the setup was insane enough 
to throw it way the heck down on my todo list.  (Step 1: download and 
configure an IBM operating system image from the 1970's...  Oh yeah, fills me 
with enthusiasm...)

> >>  (This is a problem both for hardwiring the
> >> device tree into the kernel and for building a new boot rom from the
> >> linux
> >> kernel's ppc boot wrapper that would contain such a device tree to
> >> feed to
> >> the kernel.)
> >
> > It's only really been a problem for ps3 so far, since the embedded
> > guys don't seem to have any difficulty with installing dtc.  We are
> > looking at what to do for ps3 and prep, and the answer may well
> > involve bundling dtc in the kernel source (it's not too big, around
> > 3400 lines).
>
> If only a few platforms have this problem, we could instead include
> their .dtb files in the kernel source tree.

I've had it clarified that the recent qemu-ppc patches from Milton only 
require dtc to build the ROM image to boot qemu with.  The Linux kernel image 
you build hasn't got a device tree in it (although that means it needs one 
passed in from the rom image)...

Using some other patches that floated by, I did build a prep kernel a couple 
of weeks ago, which qemu happily handed control off to...  which then failed 
to boot because it couldn't parse the incomplete residual data left over from 
open hackware.  The solution the ppc list recommended?  Hardwire a device 
tree into said linux kernel using dtc...

>
> Segher

Rob
-- 
"One of my most productive days was throwing away 1000 lines of code."
  - Ken Thompson.

^ permalink raw reply

* Re: [PATCH 02/18] Add Kconfig macros for Xilinx Virtex support
From: Olof Johansson @ 2007-09-28 20:19 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev
In-Reply-To: <20070928181558.18608.23527.stgit@trillian.cg.shawcable.net>

On Fri, Sep 28, 2007 at 12:16:01PM -0600, Grant Likely wrote:
> From: Grant Likely <grant.likely@secretlab.ca>
> 
> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
> ---
> 
>  arch/powerpc/platforms/40x/Kconfig |   30 +++++++++++++++++-------------
>  1 files changed, 17 insertions(+), 13 deletions(-)
> 
> diff --git a/arch/powerpc/platforms/40x/Kconfig b/arch/powerpc/platforms/40x/Kconfig
> index c3dce3b..1aae0e6 100644
> --- a/arch/powerpc/platforms/40x/Kconfig
> +++ b/arch/powerpc/platforms/40x/Kconfig
> @@ -61,13 +61,14 @@ config WALNUT
>  	help
>  	  This option enables support for the IBM PPC405GP evaluation board.
>  
> -#config XILINX_ML300
> -#	bool "Xilinx-ML300"
> -#	depends on 40x
> -#	default y
> -#	select VIRTEX_II_PRO
> -#	help
> -#	  This option enables support for the Xilinx ML300 evaluation board.
> +config XILINX_VIRTEX_GENERIC_BOARD
> +	bool "Generic Xilinx Virtex board"
> +	depends on 40x
> +	default y
> +	select VIRTEX_II_PRO
> +	select VIRTEX_4_FX
> +	help
> +	  This option enables generic support for Xilinx Virtex based boards.

I would appreciate a bit verboser help text here, i.e. including what
boards are considered generic. Maybe something like "...including ML403,
<x>, <y>, and other 4FX/IIPro-based boards"?


-Olof

^ permalink raw reply

* Re: [PATCH] cpm: Describe multi-user ram in its own device node.
From: Vitaly Bordug @ 2007-09-28 20:25 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev
In-Reply-To: <46FD5FCB.4010908@freescale.com>

Hello Scott,

On Fri, 28 Sep 2007 15:10:51 -0500
Scott Wood wrote:

> Vitaly Bordug wrote:
> > Hello Scott,
> > 
> > Looks good, only one note:
> > 
> > On Fri, 28 Sep 2007 14:06:16 -0500
> > Scott Wood wrote:
> > 
> >> +	im_dprambase = cpm2_immr->im_dprambase;
> >> +
> >>  	/* Attach the usable dpmem area */
> >>  	/* XXX: This is actually crap. CPM_DATAONLY_BASE and
> >>  	 * CPM_DATAONLY_SIZE is only a subset of the available dpram. It
> >>  	 * varies with the processor and the microcode patches activated.
> >>  	 * But the following should be at least safe.
> >>  	 */
> >> -	rh_attach_region(&cpm_dpmem_info, 0, r.end - r.start + 1);
> >> +	rh_attach_region(&cpm_dpmem_info, CPM_MAP_ADDR + CPM_DATAONLY_BASE,
> >> +	                 CPM_DATAONLY_SIZE);
> >>  }
> >>  
>  >
> > Can we have something to address upper comment? I mean,any way to
> > have dpram beginning and size encoded in the device tree? We seem to
> > be adding new bus, and still pulling the information from the
> > defines. Maybe I miss something here, but it looks a bit odd.
> 
> This bit is #ifndef CONFIG_PPC_CPM_NEW_BINDING (and can come out once 
> all arch/powerpc boards are converted and tested -- I think it's just 
> mpc866ads and CPM mpc85xx left to go).  The new code in 
> arch/powerpc/sysdev/cpm_common.c does get it from the device tree.
> 
ok, sorry for the noise. If so, I'll try to test-n-fix upper two soon. Unfortunately,
there are many 8xx in ppc, that may depend on cpm (need to check).




-- 
Sincerely, Vitaly

^ permalink raw reply

* Re: [PATCH 03/18] Virtex: add xilinx interrupt controller driver
From: Grant Likely @ 2007-09-28 20:26 UTC (permalink / raw)
  To: Olof Johansson; +Cc: linuxppc-dev
In-Reply-To: <20070928201719.GA23749@lixom.net>

On 9/28/07, Olof Johansson <olof@lixom.net> wrote:
> On Fri, Sep 28, 2007 at 12:16:07PM -0600, Grant Likely wrote:
>
> > +/*
> > + * INTC Registers
> > + */
> > +#define ISR  0       /* Interrupt Status */
> > +#define IPR  4       /* Interrupt Pending */
> > +#define IER  8       /* Interrupt Enable */
> > +#define IAR  12      /* Interrupt Acknowledge */
> > +#define SIE  16      /* Set Interrupt Enable bits */
> > +#define CIE  20      /* Clear Interrupt Enable bits */
> > +#define IVR  24      /* Interrupt Vector */
> > +#define MER  28      /* Master Enable */
>
> The defines are fairly generic, I guess you haven't ran across cases
> where there's naming conflicts, but you might want to prefix them with
> something more unique just in case.

Will do

>
> > +static void xilinx_intc_ack(unsigned int virq)
> > +{
> > +     int irq = irq_map[virq].hwirq;
> > +     void * regs = get_irq_chip_data(virq);
> > +     pr_debug("ack: %d\n", irq);
> > +     out_be32(regs + IAR, 1 << irq);
> > +}
>
> I guess some of the above are open-coded instead of using virq_to_hw()
> for performance reasons, it could be useful to have comments regarding
> this so they aren't changed by some janitor down the road. Or, in case
> they're not performance-critical, change them to use virq_to_hw.

Or it was just that my example code from another driver wasn't using
virq_to_hw() either.  I'll fix this.

g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195

^ permalink raw reply

* Re: [PATCH 01/18] Virtex: Add uartlite bootwrapper driver
From: Josh Boyer @ 2007-09-28 20:26 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev, Arnd Bergmann
In-Reply-To: <fa686aa40709281304p62fe5e66k99ea934a4896d876@mail.gmail.com>

On Fri, 28 Sep 2007 14:04:04 -0600
"Grant Likely" <grant.likely@secretlab.ca> wrote:

> On 9/28/07, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Friday 28 September 2007, Grant Likely wrote:
> > > +static void uartlite_putc(unsigned char c)
> > > +{
> > > +while ((in_be32(reg_base + 0x8) & 0x08) != 0); /* spin */
> > > +out_be32(reg_base + 0x4, c);
> > > +}
> >
> > When coding a spin-loop, it's better to do a cpu_relax() between
> > each attempt.
> 
> Is cpu_relax even implemented in the bootwrapper?

No.  And it doesn't need to be :)

josh

^ permalink raw reply

* Re: [PATCH 06/18] [POWERPC] Fix UARTLITE reg io for little-endian architectures (ie. microblaze)
From: Olof Johansson @ 2007-09-28 20:31 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev
In-Reply-To: <20070928181704.18608.40317.stgit@trillian.cg.shawcable.net>

On Fri, Sep 28, 2007 at 12:17:13PM -0600, Grant Likely wrote:
> From: Grant Likely <grant.likely@secretlab.ca>
> 
> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
> Acked-by: John Williams <jwilliams@itee.uq.edu.au>
> ---
> 
>  arch/ppc/syslib/virtex_devices.c |    2 +-
>  drivers/serial/uartlite.c        |   32 ++++++++++++++++----------------
>  2 files changed, 17 insertions(+), 17 deletions(-)
> 
> diff --git a/arch/ppc/syslib/virtex_devices.c b/arch/ppc/syslib/virtex_devices.c
> index ace4ec0..270ad3a 100644
> --- a/arch/ppc/syslib/virtex_devices.c
> +++ b/arch/ppc/syslib/virtex_devices.c
> @@ -28,7 +28,7 @@
>  	.num_resources = 2, \
>  	.resource = (struct resource[]) { \
>  		{ \
> -			.start = XPAR_UARTLITE_##num##_BASEADDR + 3, \
> +			.start = XPAR_UARTLITE_##num##_BASEADDR, \
>  			.end = XPAR_UARTLITE_##num##_HIGHADDR, \
>  			.flags = IORESOURCE_MEM, \
>  		}, \
> diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c
> index f5051cf..59b674a 100644
> --- a/drivers/serial/uartlite.c
> +++ b/drivers/serial/uartlite.c
> @@ -61,7 +61,7 @@ static int ulite_receive(struct uart_port *port, int stat)
>  	/* stats */
>  	if (stat & ULITE_STATUS_RXVALID) {
>  		port->icount.rx++;
> -		ch = readb(port->membase + ULITE_RX);
> +		ch = in_be32((void*)port->membase + ULITE_RX);

Hmm, I see the start changed, and you're now reading/writing a full
32-bit word instead of individual bytes. Still, looks a little fishy to
me. Wouldn't it be more appropriate to change the ULITE_RX offset to be
3 higher and still read/write bytes?

Or are the registers defined as 32-bit ones? (I don't remember, it was
so long since I touched uartlite myself. :-)

(Same for the other functions below, but the general principle applies.)

Also, I'm not sure you need to cast port->membase to void*, do you? The
math will still be right since it's declared as char *.


-Olof

^ 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