728d5ba5466bfdd2c3fe90654777ea9331b94e85
[librecmc/librecmc.git] / target / linux / brcm63xx / patches / 001-bcm963xx.patch
1 diff -urN linux-2.6.24/arch/mips/Kconfig linux-2.6.24.new/arch/mips/Kconfig
2 --- linux-2.6.24/arch/mips/Kconfig      2008-01-24 23:58:37.000000000 +0100
3 +++ linux-2.6.24.new/arch/mips/Kconfig  2008-02-13 16:20:49.000000000 +0100
4 @@ -67,6 +67,17 @@
5         help
6          Support for BCM47XX based boards
7  
8 +config BCM963XX
9 +       bool "Support for Broadcom BCM963xx SoC"
10 +       select SYS_SUPPORTS_32BIT_KERNEL
11 +       select SYS_SUPPORTS_BIG_ENDIAN
12 +       select SYS_HAS_CPU_MIPS32_R1
13 +       select HW_HAS_PCI
14 +       select DMA_NONCOHERENT
15 +       select IRQ_CPU
16 +       help
17 +         This is a fmaily of boards based on the Broadcom MIPS32
18 +
19  config MIPS_COBALT
20         bool "Cobalt Server"
21         select CEVT_R4K
22 diff -urN linux-2.6.24/arch/mips/kernel/cpu-probe.c linux-2.6.24.new/arch/mips/kernel/cpu-probe.c
23 --- linux-2.6.24/arch/mips/kernel/cpu-probe.c   2008-01-24 23:58:37.000000000 +0100
24 +++ linux-2.6.24.new/arch/mips/kernel/cpu-probe.c       2008-02-13 16:23:21.000000000 +0100
25 @@ -796,6 +796,18 @@
26         case PRID_IMP_BCM4710:
27                 c->cputype = CPU_BCM4710;
28                 break;
29 +//     case PRID_IMP_BCM6338:
30 +//             c->cputype = CPU_BCM6338;
31 +//             break;
32 +       case PRID_IMP_BCM6345:
33 +               c->cputype = CPU_BCM6345;
34 +               break;
35 +       case PRID_IMP_BCM6348:
36 +               c->cputype = CPU_BCM6348;
37 +               break;
38 +       case PRID_IMP_BCM6358:
39 +               c->cputype = CPU_BCM6358;
40 +               break;
41         default:
42                 c->cputype = CPU_UNKNOWN;
43                 break;
44 @@ -878,6 +890,10 @@
45         case CPU_SR71000:       name = "Sandcraft SR71000"; break;
46         case CPU_BCM3302:       name = "Broadcom BCM3302"; break;
47         case CPU_BCM4710:       name = "Broadcom BCM4710"; break;
48 +       case CPU_BCM6338:       name = "Broadcom BCM6338"; break;
49 +       case CPU_BCM6345:       name = "Broadcom BCM6345"; break;
50 +       case CPU_BCM6348:       name = "Broadcom BCM6348"; break;
51 +       case CPU_BCM6358:       name = "Broadcom BCM6358"; break;
52         case CPU_PR4450:        name = "Philips PR4450"; break;
53         case CPU_LOONGSON2:     name = "ICT Loongson-2"; break;
54         default:
55 diff -urN linux-2.6.24/arch/mips/Makefile linux-2.6.24.new/arch/mips/Makefile
56 --- linux-2.6.24/arch/mips/Makefile     2008-01-24 23:58:37.000000000 +0100
57 +++ linux-2.6.24.new/arch/mips/Makefile 2008-02-13 16:21:21.000000000 +0100
58 @@ -543,6 +543,10 @@
59  cflags-$(CONFIG_BCM47XX)       += -Iinclude/asm-mips/mach-bcm47xx
60  load-$(CONFIG_BCM47XX)         := 0xffffffff80001000
61  
62 +core-$(CONFIG_BCM963XX)                += arch/mips/bcm963xx/
63 +cflags-$(CONFIG_BCM963XX)      += -Iinclude/asm-mips/mach-bcm963xx
64 +load-$(CONFIG_BCM963XX)                := 0xffffffff8001000
65 +
66  #
67  # SNI RM
68  #
69 diff -urN linux-2.6.24/arch/mips/mm/c-r4k.c linux-2.6.24.new/arch/mips/mm/c-r4k.c
70 --- linux-2.6.24/arch/mips/mm/c-r4k.c   2008-01-24 23:58:37.000000000 +0100
71 +++ linux-2.6.24.new/arch/mips/mm/c-r4k.c       2008-02-13 16:24:29.000000000 +0100
72 @@ -878,6 +878,13 @@
73                 if (!(config & MIPS_CONF_M))
74                         panic("Don't know how to probe P-caches on this cpu.");
75  
76 +               if (c->cputype == CPU_BCM6338 || c->cputype == CPU_BCM6345 || c->cputype == CPU_BCM6348 || c->cputype == CPU_BCM6358)
77 +               {
78 +                       printk("bcm963xx: enabling icache and dcache...\n");
79 +                       /* Enable caches */
80 +                       write_c0_diag(read_c0_diag() | 0xC0000000);
81 +               }
82 +
83                 /*
84                  * So we seem to be a MIPS32 or MIPS64 CPU
85                  * So let's probe the I-cache ...
86 diff -urN linux-2.6.24/arch/mips/mm/tlbex.c linux-2.6.24.new/arch/mips/mm/tlbex.c
87 --- linux-2.6.24/arch/mips/mm/tlbex.c   2008-01-24 23:58:37.000000000 +0100
88 +++ linux-2.6.24.new/arch/mips/mm/tlbex.c       2008-02-13 16:25:08.000000000 +0100
89 @@ -910,6 +910,10 @@
90         case CPU_25KF:
91         case CPU_BCM3302:
92         case CPU_BCM4710:
93 +//     case CPU_BCM6338:
94 +       case CPU_BCM6345:
95 +       case CPU_BCM6348:
96 +       case CPU_BCM6358:
97         case CPU_LOONGSON2:
98                 if (m4kc_tlbp_war())
99                         i_nop(p);
100 diff -urN linux-2.6.24/arch/mips/pci/Makefile linux-2.6.24.new/arch/mips/pci/Makefile
101 --- linux-2.6.24/arch/mips/pci/Makefile 2008-01-24 23:58:37.000000000 +0100
102 +++ linux-2.6.24.new/arch/mips/pci/Makefile     2008-02-13 16:27:33.000000000 +0100
103 @@ -48,3 +48,4 @@
104  obj-$(CONFIG_VICTOR_MPC30X)    += fixup-mpc30x.o
105  obj-$(CONFIG_ZAO_CAPCELLA)     += fixup-capcella.o
106  obj-$(CONFIG_WR_PPMC)          += fixup-wrppmc.o
107 +obj-$(CONFIG_BCM963XX)         += fixup-bcm96348.o pci-bcm96348.o ops-bcm96348.o
108 diff -urN linux-2.6.24/include/asm-mips/bootinfo.h linux-2.6.24.new/include/asm-mips/bootinfo.h
109 --- linux-2.6.24/include/asm-mips/bootinfo.h    2008-01-24 23:58:37.000000000 +0100
110 +++ linux-2.6.24.new/include/asm-mips/bootinfo.h        2008-02-13 16:26:05.000000000 +0100
111 @@ -197,6 +197,10 @@
112   */
113  #define MACH_GROUP_BRCM                23      /* Broadcom                     */
114  #define  MACH_BCM47XX          1       /* Broadcom BCM47XX             */
115 +#define  MACH_BCM96338          2
116 +#define  MACH_BCM96345          3
117 +#define  MACH_BCM96348          4
118 +#define  MACH_BCM96358          5
119  
120  #define CL_SIZE                        COMMAND_LINE_SIZE
121  
122 diff -urN linux-2.6.24/include/asm-mips/cpu.h linux-2.6.24.new/include/asm-mips/cpu.h
123 --- linux-2.6.24/include/asm-mips/cpu.h 2008-01-24 23:58:37.000000000 +0100
124 +++ linux-2.6.24.new/include/asm-mips/cpu.h     2008-02-13 16:27:13.000000000 +0100
125 @@ -111,6 +111,10 @@
126  
127  #define PRID_IMP_BCM4710       0x4000
128  #define PRID_IMP_BCM3302       0x9000
129 +//#define PRID_IMP_BCM6338        0x9000
130 +#define PRID_IMP_BCM6345        0x8000
131 +#define PRID_IMP_BCM6348        0x9100
132 +#define PRID_IMP_BCM6358        0xA000
133  
134  /*
135   * Definitions for 7:0 on legacy processors
136 @@ -196,7 +200,8 @@
137          */
138         CPU_4KC, CPU_4KEC, CPU_4KSC, CPU_24K, CPU_34K, CPU_74K, CPU_AU1000,
139         CPU_AU1100, CPU_AU1200, CPU_AU1500, CPU_AU1550, CPU_PR4450,
140 -       CPU_BCM3302, CPU_BCM4710,
141 +       CPU_BCM3302, CPU_BCM4710, CPU_BCM6338, CPU_BCM6345, CPU_BCM6348,
142 +       CPU_BCM6358,
143  
144         /*
145          * MIPS64 class processors