"Das U-Boot" Source Tree
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

ram: rockchip: common: Fix cs_cap in sdram_detect_dbw

The currently existing cs_cap calculation converts to MB, but the values
compared to are in Byte.
Example: 8Gb DDR3, 32-bit (15 cols, 10 rows) == 0x400 (1024 MB)

Fix it.

Signed-off-by: Alex Bee <knaerzche@gmail.com>

authored by

Alex Bee and committed by
joshua stein
ae39917a 085a19a7

+6 -6
+6 -6
drivers/ram/rockchip/sdram_common.c
··· 301 301 bw = cap_info->bw; 302 302 cs_cap = (1 << (row + col + bk + bw - 20)); 303 303 if (bw == 2) { 304 - if (cs_cap <= 0x2000000) /* 256Mb */ 304 + if (cs_cap <= 0x20) /* 256Mb */ 305 305 die_bw_0 = (col < 9) ? 2 : 1; 306 - else if (cs_cap <= 0x10000000) /* 2Gb */ 306 + else if (cs_cap <= 0x100) /* 2Gb */ 307 307 die_bw_0 = (col < 10) ? 2 : 1; 308 - else if (cs_cap <= 0x40000000) /* 8Gb */ 308 + else if (cs_cap <= 0x400) /* 8Gb */ 309 309 die_bw_0 = (col < 11) ? 2 : 1; 310 310 else 311 311 die_bw_0 = (col < 12) ? 2 : 1; 312 312 if (cs > 1) { 313 313 row = cap_info->cs1_row; 314 314 cs_cap = (1 << (row + col + bk + bw - 20)); 315 - if (cs_cap <= 0x2000000) /* 256Mb */ 315 + if (cs_cap <= 0x20) /* 256Mb */ 316 316 die_bw_0 = (col < 9) ? 2 : 1; 317 - else if (cs_cap <= 0x10000000) /* 2Gb */ 317 + else if (cs_cap <= 0x100) /* 2Gb */ 318 318 die_bw_0 = (col < 10) ? 2 : 1; 319 - else if (cs_cap <= 0x40000000) /* 8Gb */ 319 + else if (cs_cap <= 0x400) /* 8Gb */ 320 320 die_bw_0 = (col < 11) ? 2 : 1; 321 321 else 322 322 die_bw_0 = (col < 12) ? 2 : 1;