ChangeSet 1.2217.6.34, 2005/03/25 21:06:29+00:00, [EMAIL PROTECTED](none)

        [ARM PATCH] 2507/1: work around ixp2400 erratum #66
        
        Patch from Lennert Buytenhek
        
        Intel's ixp2400 can occasionally corrupt writes to its on-chip
        registers, leading to system crashes.  The suggested workaround for
        this is to map in those registers using XCB=101 instead of XCB=000.
        Patch 2491/1 makes all mappings of ixp2000 on-chip I/O regions use
        section mappings.  This patch makes all iotable section mappings use
        XCB=101.  This patch depends on 2491/1.
        Kernel iotable mappings that are not 1MB-aligned, ioremap(), and
        userspace mappings using mmap() on /dev/mem will still generate
        XCB=000 mappings, which can trigger erratum #66 quite easily.
        For this, an extra patch (to arch/arm/mm/proc-xscale.S) is needed,
        which is maintained out-of-tree because it has been rejected in
        the past.  See http://ixp2xxx.sourceforge.net/kernel/ and look
        for 'ixp2000-erratum66-ptes.diff'.
        2.6.11-rc4 with 2491/1 plus this patch survives a week of heavy
        testing on my ENP-2611, while 2.6.11-rc4 vanilla doesn't stand a
        chance and crashes within 30 minutes under the same workload.
        
        Signed-off-by: Lennert BuytenhekSigned-off-by: Deepak Saxena
        Signed-off-by: Russell King



 arch/arm/mach-ixp2000/core.c                |   16 ++++++++++++++++
 arch/arm/mm/mm-armv.c                       |    9 +++++++++
 include/asm-arm/arch-ixp2000/ixp2000-regs.h |    3 ++-
 include/asm-arm/mach/map.h                  |   15 ++++++++-------
 4 files changed, 35 insertions(+), 8 deletions(-)


diff -Nru a/arch/arm/mach-ixp2000/core.c b/arch/arm/mach-ixp2000/core.c
--- a/arch/arm/mach-ixp2000/core.c      2005-03-26 11:28:38 -08:00
+++ b/arch/arm/mach-ixp2000/core.c      2005-03-26 11:28:38 -08:00
@@ -133,6 +133,22 @@
 
 void __init ixp2000_map_io(void)
 {
+       extern unsigned int processor_id;
+
+       /*
+        * On IXP2400 CPUs we need to use MT_IXP2000_DEVICE for
+        * tweaking the PMDs so XCB=101. On IXP2800s we use the normal
+        * PMD flags.
+        */
+       if ((processor_id & 0xfffffff0) == 0x69054190) {
+               int i;
+
+               printk(KERN_INFO "Enabling IXP2400 erratum #66 workaround\n");
+
+               for(i=0;i<ARRAY_SIZE(ixp2000_io_desc);i++)
+                       ixp2000_io_desc[i].type = MT_IXP2000_DEVICE;
+       }
+
        iotable_init(ixp2000_io_desc, ARRAY_SIZE(ixp2000_io_desc));
        early_serial_setup(&ixp2000_serial_port);
 
diff -Nru a/arch/arm/mm/mm-armv.c b/arch/arm/mm/mm-armv.c
--- a/arch/arm/mm/mm-armv.c     2005-03-26 11:28:38 -08:00
+++ b/arch/arm/mm/mm-armv.c     2005-03-26 11:28:38 -08:00
@@ -356,6 +356,15 @@
        [MT_ROM] = {
                .prot_sect = PMD_TYPE_SECT,
                .domain    = DOMAIN_KERNEL,
+       },
+       [MT_IXP2000_DEVICE] = { /* IXP2400 requires XCB=101 for on-chip I/O */
+               .prot_pte  = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY |
+                               L_PTE_WRITE,
+               .prot_l1   = PMD_TYPE_TABLE,
+               .prot_sect = PMD_TYPE_SECT | PMD_SECT_UNCACHED |
+                               PMD_SECT_AP_WRITE | PMD_SECT_BUFFERABLE |
+                               PMD_SECT_TEX(1),
+               .domain    = DOMAIN_IO,
        }
 };
 
diff -Nru a/include/asm-arm/arch-ixp2000/ixp2000-regs.h 
b/include/asm-arm/arch-ixp2000/ixp2000-regs.h
--- a/include/asm-arm/arch-ixp2000/ixp2000-regs.h       2005-03-26 11:28:38 
-08:00
+++ b/include/asm-arm/arch-ixp2000/ixp2000-regs.h       2005-03-26 11:28:38 
-08:00
@@ -29,7 +29,8 @@
  * 1) We use only one TLB entry for large number of on-chip I/O devices.
  *
  * 2) We can easily set the Section attributes to XCB=101 on the IXP2400
- *    as required per erratum #66.
+ *    as required per erratum #66.  We accomplish this by using a
+ *    new MT_IXP2000_DEVICE memory type with the bits set as required.
  *
  * CAP stands for CSR Access Proxy
  */
diff -Nru a/include/asm-arm/mach/map.h b/include/asm-arm/mach/map.h
--- a/include/asm-arm/mach/map.h        2005-03-26 11:28:38 -08:00
+++ b/include/asm-arm/mach/map.h        2005-03-26 11:28:38 -08:00
@@ -18,13 +18,14 @@
 
 struct meminfo;
 
-#define MT_DEVICE      0
-#define MT_CACHECLEAN  1
-#define MT_MINICLEAN   2
-#define MT_LOW_VECTORS 3
-#define MT_HIGH_VECTORS        4
-#define MT_MEMORY      5
-#define MT_ROM         6
+#define MT_DEVICE              0
+#define MT_CACHECLEAN          1
+#define MT_MINICLEAN           2
+#define MT_LOW_VECTORS         3
+#define MT_HIGH_VECTORS                4
+#define MT_MEMORY              5
+#define MT_ROM                 6
+#define MT_IXP2000_DEVICE      7
 
 extern void create_memmap_holes(struct meminfo *);
 extern void memtable_init(struct meminfo *);
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to