Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/jwboyer/powerpc-4xx into merge

+44 -14
+1 -1
MAINTAINERS
··· 3375 M: mporter@kernel.crashing.org 3376 W: http://www.penguinppc.org/ 3377 L: linuxppc-dev@ozlabs.org 3378 - T: git git://git.kernel.org/pub/scm/linux/kernel/git/jwboyer/powerpc.git 3379 S: Maintained 3380 3381 LINUX FOR POWERPC EMBEDDED XILINX VIRTEX
··· 3375 M: mporter@kernel.crashing.org 3376 W: http://www.penguinppc.org/ 3377 L: linuxppc-dev@ozlabs.org 3378 + T: git git://git.kernel.org/pub/scm/linux/kernel/git/jwboyer/powerpc-4xx.git 3379 S: Maintained 3380 3381 LINUX FOR POWERPC EMBEDDED XILINX VIRTEX
+43 -13
arch/powerpc/boot/4xx.c
··· 158 159 #define DDR_GET_VAL(val, mask, shift) (((val) >> (shift)) & (mask)) 160 161 void ibm4xx_denali_fixup_memsize(void) 162 { 163 u32 val, max_cs, max_col, max_row; ··· 213 max_col = DDR_GET_VAL(val, DDR_MAX_COL_REG, DDR_MAX_COL_REG_SHIFT); 214 max_row = DDR_GET_VAL(val, DDR_MAX_ROW_REG, DDR_MAX_ROW_REG_SHIFT); 215 216 - /* get CS value */ 217 - val = SDRAM0_READ(DDR0_10); 218 - 219 - val = DDR_GET_VAL(val, DDR_CS_MAP, DDR_CS_MAP_SHIFT); 220 - cs = 0; 221 - while (val) { 222 - if (val & 0x1) 223 - cs++; 224 - val = val >> 1; 225 - } 226 - 227 if (!cs) 228 fatal("No memory installed\n"); 229 if (cs > max_cs) ··· 223 val = SDRAM0_READ(DDR0_14); 224 225 if (DDR_GET_VAL(val, DDR_REDUC, DDR_REDUC_SHIFT)) 226 - dpath = 8; /* 64 bits */ 227 - else 228 dpath = 4; /* 32 bits */ 229 230 /* get address pins (rows) */ 231 val = SDRAM0_READ(DDR0_42);
··· 158 159 #define DDR_GET_VAL(val, mask, shift) (((val) >> (shift)) & (mask)) 160 161 + /* 162 + * Some U-Boot versions set the number of chipselects to two 163 + * for Sequoia/Rainier boards while they only have one chipselect 164 + * hardwired. Hardcode the number of chipselects to one 165 + * for sequioa/rainer board models or read the actual value 166 + * from the memory controller register DDR0_10 otherwise. 167 + */ 168 + static inline u32 ibm4xx_denali_get_cs(void) 169 + { 170 + void *devp; 171 + char model[64]; 172 + u32 val, cs; 173 + 174 + devp = finddevice("/"); 175 + if (!devp) 176 + goto read_cs; 177 + 178 + if (getprop(devp, "model", model, sizeof(model)) <= 0) 179 + goto read_cs; 180 + 181 + model[sizeof(model)-1] = 0; 182 + 183 + if (!strcmp(model, "amcc,sequoia") || 184 + !strcmp(model, "amcc,rainier")) 185 + return 1; 186 + 187 + read_cs: 188 + /* get CS value */ 189 + val = SDRAM0_READ(DDR0_10); 190 + 191 + val = DDR_GET_VAL(val, DDR_CS_MAP, DDR_CS_MAP_SHIFT); 192 + cs = 0; 193 + while (val) { 194 + if (val & 0x1) 195 + cs++; 196 + val = val >> 1; 197 + } 198 + return cs; 199 + } 200 + 201 void ibm4xx_denali_fixup_memsize(void) 202 { 203 u32 val, max_cs, max_col, max_row; ··· 173 max_col = DDR_GET_VAL(val, DDR_MAX_COL_REG, DDR_MAX_COL_REG_SHIFT); 174 max_row = DDR_GET_VAL(val, DDR_MAX_ROW_REG, DDR_MAX_ROW_REG_SHIFT); 175 176 + cs = ibm4xx_denali_get_cs(); 177 if (!cs) 178 fatal("No memory installed\n"); 179 if (cs > max_cs) ··· 193 val = SDRAM0_READ(DDR0_14); 194 195 if (DDR_GET_VAL(val, DDR_REDUC, DDR_REDUC_SHIFT)) 196 dpath = 4; /* 32 bits */ 197 + else 198 + dpath = 8; /* 64 bits */ 199 200 /* get address pins (rows) */ 201 val = SDRAM0_READ(DDR0_42);