Author: jim
Date: 2005-07-30 17:14:24 -0600 (Sat, 30 Jul 2005)
New Revision: 1047

Added:
   trunk/linux/linux-2.6.12.3-cobalt_fix-1.patch
Modified:
   trunk/
Log:
 [EMAIL PROTECTED]:  jim | 2005-07-30 16:07:52 -0700
 Added: linux-2.6.12.3-cobalt_fix-1.patch



Property changes on: trunk
___________________________________________________________________
Name: svk:merge
   - cc2644d5-6cf8-0310-b111-c40428001e49:/patches:1100
   + cc2644d5-6cf8-0310-b111-c40428001e49:/patches:1101

Added: trunk/linux/linux-2.6.12.3-cobalt_fix-1.patch
===================================================================
--- trunk/linux/linux-2.6.12.3-cobalt_fix-1.patch       2005-07-30 23:14:04 UTC 
(rev 1046)
+++ trunk/linux/linux-2.6.12.3-cobalt_fix-1.patch       2005-07-30 23:14:24 UTC 
(rev 1047)
@@ -0,0 +1,479 @@
+Submitted By: Jim Gifford (patches at jg555 dot com)
+Date: 2005-07-30
+Initial Package Version: 2.6.12.x
+Origin: Peter Horton and Linux-MIPS CVS
+Upstream Status: Not applied
+Description: Fixes Specific Issues Related to Cobalt based MIPS Servers
+ 
+diff -Naur linux-2.6.12.3.orig/arch/mips/configs/cobalt_defconfig 
linux-2.6.12.3/arch/mips/configs/cobalt_defconfig
+--- linux-2.6.12.3.orig/arch/mips/configs/cobalt_defconfig     2005-07-30 
18:34:59.000000000 +0000
++++ linux-2.6.12.3/arch/mips/configs/cobalt_defconfig  2005-07-30 
16:42:31.000000000 +0000
+@@ -46,7 +46,12 @@
+ #
+ # Loadable module support
+ #
+-# CONFIG_MODULES is not set
++CONFIG_MODULES=y
++# CONFIG_MODULE_UNLOAD is not set
++CONFIG_OBSOLETE_MODPARM=y
++# CONFIG_MODVERSIONS is not set
++# CONFIG_MODULE_SRCVERSION_ALL is not set
++CONFIG_KMOD=y
+ 
+ #
+ # Machine selection
+@@ -189,7 +194,7 @@
+ #
+ CONFIG_STANDALONE=y
+ CONFIG_PREVENT_FIRMWARE_BUILD=y
+-CONFIG_FW_LOADER=y
++# CONFIG_FW_LOADER is not set
+ 
+ #
+ # Memory Technology Devices (MTD)
+@@ -214,17 +219,14 @@
+ # CONFIG_BLK_DEV_DAC960 is not set
+ # CONFIG_BLK_DEV_UMEM is not set
+ # CONFIG_BLK_DEV_COW_COMMON is not set
+-CONFIG_BLK_DEV_LOOP=y
+-# CONFIG_BLK_DEV_CRYPTOLOOP is not set
++# CONFIG_BLK_DEV_LOOP is not set
+ # CONFIG_BLK_DEV_NBD is not set
+ # CONFIG_BLK_DEV_SX8 is not set
+ # CONFIG_BLK_DEV_RAM is not set
+ CONFIG_BLK_DEV_RAM_COUNT=16
+ CONFIG_INITRAMFS_SOURCE=""
+ # CONFIG_LBD is not set
+-CONFIG_CDROM_PKTCDVD=y
+-CONFIG_CDROM_PKTCDVD_BUFFERS=8
+-# CONFIG_CDROM_PKTCDVD_WCACHE is not set
++# CONFIG_CDROM_PKTCDVD is not set
+ 
+ #
+ # IO Schedulers
+@@ -233,7 +235,7 @@
+ CONFIG_IOSCHED_AS=y
+ CONFIG_IOSCHED_DEADLINE=y
+ CONFIG_IOSCHED_CFQ=y
+-CONFIG_ATA_OVER_ETH=y
++# CONFIG_ATA_OVER_ETH is not set
+ 
+ #
+ # ATA/ATAPI/MFM/RLL support
+@@ -256,9 +258,37 @@
+ # IDE chipset support/bugfixes
+ #
+ CONFIG_IDE_GENERIC=y
+-# CONFIG_BLK_DEV_IDEPCI is not set
++CONFIG_BLK_DEV_IDEPCI=y
++CONFIG_IDEPCI_SHARE_IRQ=y
++# CONFIG_BLK_DEV_OFFBOARD is not set
++# CONFIG_BLK_DEV_GENERIC is not set
++# CONFIG_BLK_DEV_OPTI621 is not set
++CONFIG_BLK_DEV_IDEDMA_PCI=y
++# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
++# CONFIG_IDEDMA_PCI_AUTO 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 is not set
++# CONFIG_BLK_DEV_SLC90E66 is not set
++# CONFIG_BLK_DEV_TRM290 is not set
++CONFIG_BLK_DEV_VIA82CXXX=y
+ # CONFIG_IDE_ARM is not set
+-# CONFIG_BLK_DEV_IDEDMA is not set
++CONFIG_BLK_DEV_IDEDMA=y
++# CONFIG_IDEDMA_IVB is not set
+ # CONFIG_IDEDMA_AUTO is not set
+ # CONFIG_BLK_DEV_HD is not set
+ 
+@@ -310,7 +340,7 @@
+ # CONFIG_INET_ESP is not set
+ # CONFIG_INET_IPCOMP is not set
+ CONFIG_INET_TUNNEL=y
+-CONFIG_IP_TCPDIAG=y
++# CONFIG_IP_TCPDIAG is not set
+ # CONFIG_IP_TCPDIAG_IPV6 is not set
+ # CONFIG_IPV6 is not set
+ # CONFIG_NETFILTER is not set
+@@ -344,8 +374,10 @@
+ # Network testing
+ #
+ # CONFIG_NET_PKTGEN is not set
+-# CONFIG_NETPOLL is not set
+-# CONFIG_NET_POLL_CONTROLLER is not set
++CONFIG_NETPOLL=y
++# CONFIG_NETPOLL_RX is not set
++# CONFIG_NETPOLL_TRAP is not set
++CONFIG_NET_POLL_CONTROLLER=y
+ # CONFIG_HAMRADIO is not set
+ # CONFIG_IRDA is not set
+ # CONFIG_BT is not set
+@@ -372,7 +404,15 @@
+ #
+ # Tulip family network device support
+ #
+-# CONFIG_NET_TULIP is not set
++CONFIG_NET_TULIP=y
++CONFIG_DE2104X=y
++CONFIG_TULIP=y
++# CONFIG_TULIP_MWI is not set
++# CONFIG_TULIP_MMIO is not set
++# CONFIG_TULIP_NAPI is not set
++# CONFIG_DE4X5 is not set
++# CONFIG_WINBOND_840 is not set
++# CONFIG_DM9102 is not set
+ # CONFIG_HP100 is not set
+ # CONFIG_NET_PCI is not set
+ 
+@@ -415,7 +455,7 @@
+ # CONFIG_PPP is not set
+ # CONFIG_SLIP is not set
+ # CONFIG_SHAPER is not set
+-# CONFIG_NETCONSOLE is not set
++CONFIG_NETCONSOLE=y
+ 
+ #
+ # ISDN subsystem
+@@ -546,12 +586,6 @@
+ # CONFIG_FB is not set
+ 
+ #
+-# Console display driver support
+-#
+-# CONFIG_VGA_CONSOLE is not set
+-CONFIG_DUMMY_CONSOLE=y
+-
+-#
+ # Sound
+ #
+ # CONFIG_SOUND is not set
+@@ -582,15 +616,13 @@
+ # File systems
+ #
+ CONFIG_EXT2_FS=y
+-CONFIG_EXT2_FS_XATTR=y
+-CONFIG_EXT2_FS_POSIX_ACL=y
+-CONFIG_EXT2_FS_SECURITY=y
+-# CONFIG_EXT3_FS is not set
+-# CONFIG_JBD is not set
+-CONFIG_FS_MBCACHE=y
++# CONFIG_EXT2_FS_XATTR is not set
++CONFIG_EXT3_FS=y
++# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_JBD=y
++# CONFIG_JBD_DEBUG is not set
+ # CONFIG_REISERFS_FS is not set
+ # CONFIG_JFS_FS is not set
+-CONFIG_FS_POSIX_ACL=y
+ 
+ #
+ # XFS support
+@@ -599,7 +631,7 @@
+ # CONFIG_MINIX_FS is not set
+ # CONFIG_ROMFS_FS is not set
+ # CONFIG_QUOTA is not set
+-CONFIG_DNOTIFY=y
++# CONFIG_DNOTIFY is not set
+ # CONFIG_AUTOFS_FS is not set
+ # CONFIG_AUTOFS4_FS is not set
+ 
+@@ -625,7 +657,8 @@
+ # CONFIG_DEVFS_FS is not set
+ CONFIG_DEVPTS_FS_XATTR=y
+ CONFIG_DEVPTS_FS_SECURITY=y
+-# CONFIG_TMPFS is not set
++CONFIG_TMPFS=y
++# CONFIG_TMPFS_XATTR is not set
+ # CONFIG_HUGETLB_PAGE is not set
+ CONFIG_RAMFS=y
+ 
+@@ -649,15 +682,8 @@
+ #
+ # 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_NFS_FS is not set
+ # CONFIG_NFSD is not set
+-CONFIG_LOCKD=y
+-CONFIG_SUNRPC=y
+-# CONFIG_RPCSEC_GSS_KRB5 is not set
+-# CONFIG_RPCSEC_GSS_SPKM3 is not set
+ # CONFIG_SMB_FS is not set
+ # CONFIG_CIFS is not set
+ # CONFIG_NCP_FS is not set
+@@ -686,14 +712,13 @@
+ # CONFIG_PRINTK_TIME is not set
+ # CONFIG_DEBUG_KERNEL is not set
+ CONFIG_LOG_BUF_SHIFT=14
+-CONFIG_CROSSCOMPILE=y
++# CONFIG_CROSSCOMPILE is not set
+ CONFIG_CMDLINE=""
+ 
+ #
+ # Security options
+ #
+-CONFIG_KEYS=y
+-CONFIG_KEYS_DEBUG_PROC_KEYS=y
++# CONFIG_KEYS is not set
+ # CONFIG_SECURITY is not set
+ 
+ #
+@@ -709,7 +734,7 @@
+ # Library routines
+ #
+ # CONFIG_CRC_CCITT is not set
+-# CONFIG_CRC32 is not set
++CONFIG_CRC32=y
+ # CONFIG_LIBCRC32C is not set
+ CONFIG_GENERIC_HARDIRQS=y
+ CONFIG_GENERIC_IRQ_PROBE=y
+diff -Naur linux-2.6.12.3.orig/arch/mips/kernel/setup.c 
linux-2.6.12.3/arch/mips/kernel/setup.c
+--- linux-2.6.12.3.orig/arch/mips/kernel/setup.c       2005-07-30 
18:35:00.000000000 +0000
++++ linux-2.6.12.3/arch/mips/kernel/setup.c    2005-07-30 16:42:31.000000000 
+0000
+@@ -277,7 +277,12 @@
+       /* Board specific code should have set up initrd_start and initrd_end */
+       ROOT_DEV = Root_RAM0;
+       if (parse_rd_cmdline(&initrd_start, &initrd_end)) {
++#ifndef CONFIG_MIPS_COBALT
++              /*
++               * Ugly! Cobalt boot loader CoLo places the initrd at the top 
of RAM
++               */
+               reserved_end = max(reserved_end, initrd_end);
++#endif
+               initrd_reserve_bootmem = 1;
+       } else {
+               unsigned long tmp;
+diff -Naur linux-2.6.12.3.orig/arch/mips/lib/Makefile 
linux-2.6.12.3/arch/mips/lib/Makefile
+--- linux-2.6.12.3.orig/arch/mips/lib/Makefile 2005-07-30 18:35:01.000000000 
+0000
++++ linux-2.6.12.3/arch/mips/lib/Makefile      2005-07-30 18:32:24.000000000 
+0000
+@@ -5,4 +5,6 @@
+ lib-y += csum_partial_copy.o dec_and_lock.o memcpy.o promlib.o strlen_user.o \
+          strncpy_user.o strnlen_user.o uncached.o
+ 
++obj-y += iomap.o
++
+ EXTRA_AFLAGS := $(CFLAGS)
+diff -Naur linux-2.6.12.3.orig/arch/mips/lib/iomap.c 
linux-2.6.12.3/arch/mips/lib/iomap.c
+--- linux-2.6.12.3.orig/arch/mips/lib/iomap.c  1970-01-01 00:00:00.000000000 
+0000
++++ linux-2.6.12.3/arch/mips/lib/iomap.c       2005-07-30 16:42:31.000000000 
+0000
+@@ -0,0 +1,78 @@
++/*
++ *  iomap.c, Memory Mapped I/O routines for MIPS architecture.
++ *
++ *  This code is based on lib/iomap.c, by Linus Torvalds.
++ *
++ *  Copyright (C) 2004-2005  Yoichi Yuasa <[EMAIL PROTECTED]>
++ *
++ *  This program is free software; you can redistribute it and/or modify
++ *  it under the terms of the GNU General Public License as published by
++ *  the Free Software Foundation; either version 2 of the License, or
++ *  (at your option) any later version.
++ *
++ *  This program is distributed in the hope that it will be useful,
++ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
++ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ *  GNU General Public License for more details.
++ *
++ *  You should have received a copy of the GNU General Public License
++ *  along with this program; if not, write to the Free Software
++ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
++ */
++#include <linux/ioport.h>
++#include <linux/module.h>
++#include <linux/pci.h>
++
++#include <asm/io.h>
++
++void __iomem *ioport_map(unsigned long port, unsigned int nr)
++{
++      unsigned long end;
++
++      end = port + nr - 1UL;
++      if (ioport_resource.start > port ||
++          ioport_resource.end < end || port > end)
++              return NULL;
++
++      return (void __iomem *)(mips_io_port_base + port);
++}
++
++void ioport_unmap(void __iomem *addr)
++{
++}
++EXPORT_SYMBOL(ioport_map);
++EXPORT_SYMBOL(ioport_unmap);
++
++void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen)
++{
++      unsigned long start, len, flags;
++
++      if (dev == NULL)
++              return NULL;
++
++      start = pci_resource_start(dev, bar);
++      len = pci_resource_len(dev, bar);
++      if (!start || !len)
++              return NULL;
++
++      if (maxlen != 0 && len > maxlen)
++              len = maxlen;
++
++      flags = pci_resource_flags(dev, bar);
++      if (flags & IORESOURCE_IO)
++              return ioport_map(start, len);
++      if (flags & IORESOURCE_MEM) {
++              if (flags & IORESOURCE_CACHEABLE)
++                      return ioremap_cacheable_cow(start, len);
++              return ioremap_nocache(start, len);
++      }
++
++      return NULL;
++}
++
++void pci_iounmap(struct pci_dev *dev, void __iomem *addr)
++{
++      iounmap(addr);
++}
++EXPORT_SYMBOL(pci_iomap);
++EXPORT_SYMBOL(pci_iounmap);
+diff -Naur linux-2.6.12.3.orig/include/asm-mips/cobalt/ide.h 
linux-2.6.12.3/include/asm-mips/cobalt/ide.h
+--- linux-2.6.12.3.orig/include/asm-mips/cobalt/ide.h  1970-01-01 
00:00:00.000000000 +0000
++++ linux-2.6.12.3/include/asm-mips/cobalt/ide.h       2005-07-30 
16:42:31.000000000 +0000
+@@ -0,0 +1,83 @@
++
++/*
++ * PIO "in" transfers can cause D-cache lines to be allocated
++ * to the data being read. If the target is the page cache then
++ * the kernel can create a user space mapping of the same page
++ * without flushing it from the D-cache. This has large potential
++ * to create cache aliases. The Cobalts seem to trigger this
++ * problem easily.
++ *
++ * MIPs doesn't have a flush_dcache_range() so we roll
++ * our own.
++ *
++ * -- pdh
++ */
++
++#define MAX_HWIFS                     2
++
++#include <asm/r4kcache.h>
++
++static inline void __flush_dcache(void)
++{
++      unsigned long dc_size, dc_line, addr, end;
++
++      dc_size = current_cpu_data.dcache.ways << 
current_cpu_data.dcache.waybit;
++      dc_line = current_cpu_data.dcache.linesz;
++
++      addr = CKSEG0;
++      end = addr + dc_size;
++
++      for (; addr < end; addr += dc_line)
++              flush_dcache_line_indexed(addr);
++}
++
++static inline void __flush_dcache_range(unsigned long start, unsigned long 
end)
++{
++      unsigned long dc_size, dc_line, addr;
++
++      dc_size = current_cpu_data.dcache.ways << 
current_cpu_data.dcache.waybit;
++      dc_line = current_cpu_data.dcache.linesz;
++
++      addr = start & ~(dc_line - 1);
++      end += dc_line - 1;
++
++      if (end - addr < dc_size)
++              for (; addr < end; addr += dc_line)
++                      flush_dcache_line(addr);
++      else
++              __flush_dcache();
++}
++
++static inline void __ide_insw(unsigned long port, void *addr, unsigned int 
count)
++{
++      insw(port, addr, count);
++
++      __flush_dcache_range((unsigned long) addr, (unsigned long) addr + count 
* 2);
++}
++
++static inline void __ide_insl(unsigned long port, void *addr, unsigned int 
count)
++{
++      insl(port, addr, count);
++
++      __flush_dcache_range((unsigned long) addr, (unsigned long) addr + count 
* 4);
++}
++
++static inline void __ide_mm_insw(volatile void __iomem *port, void *addr, 
unsigned int count)
++{
++      readsw(port, addr, count);
++
++      __flush_dcache_range((unsigned long) addr, (unsigned long) addr + count 
* 2);
++}
++
++static inline void __ide_mm_insl(volatile void __iomem *port, void *addr, 
unsigned int count)
++{
++      readsl(port, addr, count);
++
++      __flush_dcache_range((unsigned long) addr, (unsigned long) addr + count 
* 4);
++}
++
++#define insw                  __ide_insw
++#define insl                  __ide_insl
++
++#define __ide_mm_outsw                writesw
++#define __ide_mm_outsl                writesl
+diff -Naur linux-2.6.12.3.orig/include/asm-mips/io.h 
linux-2.6.12.3/include/asm-mips/io.h
+--- linux-2.6.12.3.orig/include/asm-mips/io.h  2005-07-30 18:35:04.000000000 
+0000
++++ linux-2.6.12.3/include/asm-mips/io.h       2005-07-30 16:42:31.000000000 
+0000
+@@ -519,6 +519,34 @@
+ #define memcpy_toio(a,b,c)    memcpy((void *)(a),(b),(c))
+ 
+ /*
++ * Memory Mapped I/O
++ */
++#define ioread8(addr)         readb(addr)
++#define ioread16(addr)                readw(addr)
++#define ioread32(addr)                readl(addr)
++
++#define iowrite8(b,addr)      writeb(b,addr)
++#define iowrite16(w,addr)     writew(w,addr)
++#define iowrite32(l,addr)     writel(l,addr)
++
++#define ioread8_rep(a,b,c)    readsb(a,b,c)
++#define ioread16_rep(a,b,c)   readsw(a,b,c)
++#define ioread32_rep(a,b,c)   readsl(a,b,c)
++
++#define iowrite8_rep(a,b,c)   writesb(a,b,c)
++#define iowrite16_rep(a,b,c)  writesw(a,b,c)
++#define iowrite32_rep(a,b,c)  writesl(a,b,c)
++
++/* Create a virtual mapping cookie for an IO port range */
++extern void __iomem *ioport_map(unsigned long port, unsigned int nr);
++extern void ioport_unmap(void __iomem *);
++
++/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */
++struct pci_dev;
++extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long 
max);
++extern void pci_iounmap(struct pci_dev *dev, void __iomem *);
++
++/*
+  * ISA space is 'always mapped' on currently supported MIPS systems, no need
+  * to explicitly ioremap() it. The fact that the ISA IO space is mapped
+  * to PAGE_OFFSET is pure coincidence - it does not mean ISA values

-- 
http://linuxfromscratch.org/mailman/listinfo/patches
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to