sdram_init.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662
  1. /*
  2. * (C) Copyright 2001
  3. * Josh Huber <huber@mclx.com>, Mission Critical Linux, Inc.
  4. *
  5. * See file CREDITS for list of people who contributed to this
  6. * project.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21. * MA 02111-1307 USA
  22. */
  23. /* sdram_init.c - automatic memory sizing */
  24. #include <common.h>
  25. #include <74xx_7xx.h>
  26. #include <galileo/memory.h>
  27. #include <galileo/pci.h>
  28. #include <galileo/gt64260R.h>
  29. #include <net.h>
  30. #include "eth.h"
  31. #include "mpsc.h"
  32. #include "i2c.h"
  33. #include "64260.h"
  34. /* #define DEBUG */
  35. #define MAP_PCI
  36. #ifdef DEBUG
  37. #define DP(x) x
  38. #else
  39. #define DP(x)
  40. #endif
  41. #define GB (1 << 30)
  42. /* structure to store the relevant information about an sdram bank */
  43. typedef struct sdram_info {
  44. uchar drb_size;
  45. uchar registered, ecc;
  46. uchar tpar;
  47. uchar tras_clocks;
  48. uchar burst_len;
  49. uchar banks, slot;
  50. int size; /* detected size, not from I2C but from dram_size() */
  51. } sdram_info_t;
  52. #ifdef DEBUG
  53. void dump_dimm_info (struct sdram_info *d)
  54. {
  55. static const char *ecc_legend[] = { "", " Parity", " ECC" };
  56. printf ("dimm%s %sDRAM: %dMibytes:\n",
  57. ecc_legend[d->ecc],
  58. d->registered ? "R" : "", (d->size >> 20));
  59. printf (" drb=%d tpar=%d tras=%d burstlen=%d banks=%d slot=%d\n",
  60. d->drb_size, d->tpar, d->tras_clocks, d->burst_len,
  61. d->banks, d->slot);
  62. }
  63. #endif
  64. static int
  65. memory_map_bank (unsigned int bankNo,
  66. unsigned int bankBase, unsigned int bankLength)
  67. {
  68. #ifdef DEBUG
  69. if (bankLength > 0) {
  70. printf ("mapping bank %d at %08x - %08x\n",
  71. bankNo, bankBase, bankBase + bankLength - 1);
  72. } else {
  73. printf ("unmapping bank %d\n", bankNo);
  74. }
  75. #endif
  76. memoryMapBank (bankNo, bankBase, bankLength);
  77. return 0;
  78. }
  79. #ifdef MAP_PCI
  80. static int
  81. memory_map_bank_pci (unsigned int bankNo,
  82. unsigned int bankBase, unsigned int bankLength)
  83. {
  84. PCI_HOST host;
  85. for (host = PCI_HOST0; host <= PCI_HOST1; host++) {
  86. const int features =
  87. PREFETCH_ENABLE |
  88. DELAYED_READ_ENABLE |
  89. AGGRESSIVE_PREFETCH |
  90. READ_LINE_AGGRESSIVE_PREFETCH |
  91. READ_MULTI_AGGRESSIVE_PREFETCH |
  92. MAX_BURST_4 | PCI_NO_SWAP;
  93. pciMapMemoryBank (host, bankNo, bankBase, bankLength);
  94. pciSetRegionSnoopMode (host, bankNo, PCI_SNOOP_WB, bankBase,
  95. bankLength);
  96. pciSetRegionFeatures (host, bankNo, features, bankBase,
  97. bankLength);
  98. }
  99. return 0;
  100. }
  101. #endif
  102. /* ------------------------------------------------------------------------- */
  103. /* much of this code is based on (or is) the code in the pip405 port */
  104. /* thanks go to the authors of said port - Josh */
  105. /*
  106. * translate ns.ns/10 coding of SPD timing values
  107. * into 10 ps unit values
  108. */
  109. static inline unsigned short NS10to10PS (unsigned char spd_byte)
  110. {
  111. unsigned short ns, ns10;
  112. /* isolate upper nibble */
  113. ns = (spd_byte >> 4) & 0x0F;
  114. /* isolate lower nibble */
  115. ns10 = (spd_byte & 0x0F);
  116. return (ns * 100 + ns10 * 10);
  117. }
  118. /*
  119. * translate ns coding of SPD timing values
  120. * into 10 ps unit values
  121. */
  122. static inline unsigned short NSto10PS (unsigned char spd_byte)
  123. {
  124. return (spd_byte * 100);
  125. }
  126. #ifdef CONFIG_ZUMA_V2
  127. static int check_dimm (uchar slot, sdram_info_t * info)
  128. {
  129. /* assume 2 dimms, 2 banks each 256M - we dont have an
  130. * dimm i2c so rely on the detection routines later */
  131. memset (info, 0, sizeof (*info));
  132. info->slot = slot;
  133. info->banks = 2; /* Detect later */
  134. info->registered = 0;
  135. info->drb_size = 32; /* 16 - 256MBit, 32 - 512MBit
  136. but doesn't matter, both do same
  137. thing in setup_sdram() */
  138. info->tpar = 3;
  139. info->tras_clocks = 5;
  140. info->burst_len = 4;
  141. #ifdef CONFIG_ECC
  142. info->ecc = 0; /* Detect later */
  143. #endif /* CONFIG_ECC */
  144. return 0;
  145. }
  146. #elif defined(CONFIG_P3G4)
  147. static int check_dimm (uchar slot, sdram_info_t * info)
  148. {
  149. memset (info, 0, sizeof (*info));
  150. if (slot)
  151. return 0;
  152. info->slot = slot;
  153. info->banks = 1;
  154. info->registered = 0;
  155. info->drb_size = 4;
  156. info->tpar = 3;
  157. info->tras_clocks = 6;
  158. info->burst_len = 4;
  159. #ifdef CONFIG_ECC
  160. info->ecc = 2;
  161. #endif
  162. return 0;
  163. }
  164. #else /* ! CONFIG_ZUMA_V2 && ! CONFIG_P3G4 */
  165. /* This code reads the SPD chip on the sdram and populates
  166. * the array which is passed in with the relevant information */
  167. static int check_dimm (uchar slot, sdram_info_t * info)
  168. {
  169. DECLARE_GLOBAL_DATA_PTR;
  170. uchar addr = slot == 0 ? DIMM0_I2C_ADDR : DIMM1_I2C_ADDR;
  171. int ret;
  172. uchar rows, cols, sdram_banks, supp_cal, width, cal_val;
  173. ulong tmemclk;
  174. uchar trp_clocks, trcd_clocks;
  175. uchar data[128];
  176. get_clocks ();
  177. tmemclk = 1000000000 / (gd->bus_clk / 100); /* in 10 ps units */
  178. #ifdef CONFIG_EVB64260_750CX
  179. if (0 != slot) {
  180. printf ("check_dimm: The EVB-64260-750CX only has 1 DIMM,");
  181. printf (" called with slot=%d insetad!\n", slot);
  182. return 0;
  183. }
  184. #endif
  185. DP (puts ("before i2c read\n"));
  186. ret = i2c_read (addr, 0, 128, data, 0);
  187. DP (puts ("after i2c read\n"));
  188. /* zero all the values */
  189. memset (info, 0, sizeof (*info));
  190. if (ret) {
  191. DP (printf ("No DIMM in slot %d [err = %x]\n", slot, ret));
  192. return 0;
  193. }
  194. /* first, do some sanity checks */
  195. if (data[2] != 0x4) {
  196. printf ("Not SDRAM in slot %d\n", slot);
  197. return 0;
  198. }
  199. /* get various information */
  200. rows = data[3];
  201. cols = data[4];
  202. info->banks = data[5];
  203. sdram_banks = data[17];
  204. width = data[13] & 0x7f;
  205. DP (printf
  206. ("sdram_banks: %d, banks: %d\n", sdram_banks, info->banks));
  207. /* check if the memory is registered */
  208. if (data[21] & (BIT1 | BIT4))
  209. info->registered = 1;
  210. #ifdef CONFIG_ECC
  211. /* check for ECC/parity [0 = none, 1 = parity, 2 = ecc] */
  212. info->ecc = (data[11] & 2) >> 1;
  213. #endif
  214. /* bit 1 is CL2, bit 2 is CL3 */
  215. supp_cal = (data[18] & 0x6) >> 1;
  216. /* compute the relevant clock values */
  217. trp_clocks = (NSto10PS (data[27]) + (tmemclk - 1)) / tmemclk;
  218. trcd_clocks = (NSto10PS (data[29]) + (tmemclk - 1)) / tmemclk;
  219. info->tras_clocks = (NSto10PS (data[30]) + (tmemclk - 1)) / tmemclk;
  220. DP (printf ("trp = %d\ntrcd_clocks = %d\ntras_clocks = %d\n",
  221. trp_clocks, trcd_clocks, info->tras_clocks));
  222. /* try a CAS latency of 3 first... */
  223. cal_val = 0;
  224. if (supp_cal & 3) {
  225. if (NS10to10PS (data[9]) <= tmemclk)
  226. cal_val = 3;
  227. }
  228. /* then 2... */
  229. if (supp_cal & 2) {
  230. if (NS10to10PS (data[23]) <= tmemclk)
  231. cal_val = 2;
  232. }
  233. DP (printf ("cal_val = %d\n", cal_val));
  234. /* bummer, did't work... */
  235. if (cal_val == 0) {
  236. DP (printf ("Couldn't find a good CAS latency\n"));
  237. return 0;
  238. }
  239. /* get the largest delay -- these values need to all be the same
  240. * see Res#6 */
  241. info->tpar = cal_val;
  242. if (trp_clocks > info->tpar)
  243. info->tpar = trp_clocks;
  244. if (trcd_clocks > info->tpar)
  245. info->tpar = trcd_clocks;
  246. DP (printf ("tpar set to: %d\n", info->tpar));
  247. #ifdef CFG_BROKEN_CL2
  248. if (info->tpar == 2) {
  249. info->tpar = 3;
  250. DP (printf ("tpar fixed-up to: %d\n", info->tpar));
  251. }
  252. #endif
  253. /* compute the module DRB size */
  254. info->drb_size =
  255. (((1 << (rows + cols)) * sdram_banks) * width) / _16M;
  256. DP (printf ("drb_size set to: %d\n", info->drb_size));
  257. /* find the burst len */
  258. info->burst_len = data[16] & 0xf;
  259. if ((info->burst_len & 8) == 8) {
  260. info->burst_len = 1;
  261. } else if ((info->burst_len & 4) == 4) {
  262. info->burst_len = 0;
  263. } else {
  264. return 0;
  265. }
  266. info->slot = slot;
  267. return 0;
  268. }
  269. #endif /* ! CONFIG_ZUMA_V2 */
  270. static int setup_sdram_common (sdram_info_t info[2])
  271. {
  272. ulong tmp;
  273. int tpar = 2, tras_clocks = 5, registered = 1, ecc = 2;
  274. if (!info[0].banks && !info[1].banks)
  275. return 0;
  276. if (info[0].banks) {
  277. if (info[0].tpar > tpar)
  278. tpar = info[0].tpar;
  279. if (info[0].tras_clocks > tras_clocks)
  280. tras_clocks = info[0].tras_clocks;
  281. if (!info[0].registered)
  282. registered = 0;
  283. if (info[0].ecc != 2)
  284. ecc = 0;
  285. }
  286. if (info[1].banks) {
  287. if (info[1].tpar > tpar)
  288. tpar = info[1].tpar;
  289. if (info[1].tras_clocks > tras_clocks)
  290. tras_clocks = info[1].tras_clocks;
  291. if (!info[1].registered)
  292. registered = 0;
  293. if (info[1].ecc != 2)
  294. ecc = 0;
  295. }
  296. /* SDRAM configuration */
  297. tmp = GTREGREAD (SDRAM_CONFIGURATION);
  298. /* Turn on physical interleave if both DIMMs
  299. * have even numbers of banks. */
  300. if ((info[0].banks == 0 || info[0].banks == 2) &&
  301. (info[1].banks == 0 || info[1].banks == 2)) {
  302. /* physical interleave on */
  303. tmp &= ~(1 << 15);
  304. } else {
  305. /* physical interleave off */
  306. tmp |= (1 << 15);
  307. }
  308. tmp |= (registered << 17);
  309. /* Use buffer 1 to return read data to the CPU
  310. * See Res #12 */
  311. tmp |= (1 << 26);
  312. GT_REG_WRITE (SDRAM_CONFIGURATION, tmp);
  313. DP (printf ("SDRAM config: %08x\n", GTREGREAD (SDRAM_CONFIGURATION)));
  314. /* SDRAM timing */
  315. tmp = (((tpar == 3) ? 2 : 1) |
  316. (((tpar == 3) ? 2 : 1) << 2) |
  317. (((tpar == 3) ? 2 : 1) << 4) | (tras_clocks << 8));
  318. #ifdef CONFIG_ECC
  319. /* Setup ECC */
  320. if (ecc == 2)
  321. tmp |= 1 << 13;
  322. #endif /* CONFIG_ECC */
  323. GT_REG_WRITE (SDRAM_TIMING, tmp);
  324. DP (printf ("SDRAM timing: %08x (%d,%d,%d,%d)\n",
  325. GTREGREAD (SDRAM_TIMING), tpar, tpar, tpar, tras_clocks));
  326. /* SDRAM address decode register */
  327. /* program this with the default value */
  328. GT_REG_WRITE (SDRAM_ADDRESS_DECODE, 0x2);
  329. DP (printf ("SDRAM decode: %08x\n",
  330. GTREGREAD (SDRAM_ADDRESS_DECODE)));
  331. return 0;
  332. }
  333. /* sets up the GT properly with information passed in */
  334. static int setup_sdram (sdram_info_t * info)
  335. {
  336. ulong tmp, check;
  337. ulong *addr = 0;
  338. int i;
  339. /* sanity checking */
  340. if (!info->banks)
  341. return 0;
  342. /* ---------------------------- */
  343. /* Program the GT with the discovered data */
  344. /* bank parameters */
  345. tmp = (0xf << 16); /* leave all virt bank pages open */
  346. DP (printf ("drb_size: %d\n", info->drb_size));
  347. switch (info->drb_size) {
  348. case 1:
  349. tmp |= (1 << 14);
  350. break;
  351. case 4:
  352. case 8:
  353. tmp |= (2 << 14);
  354. break;
  355. case 16:
  356. case 32:
  357. tmp |= (3 << 14);
  358. break;
  359. default:
  360. printf ("Error in dram size calculation\n");
  361. return 1;
  362. }
  363. /* SDRAM bank parameters */
  364. /* the param registers for slot 1 (banks 2+3) are offset by 0x8 */
  365. GT_REG_WRITE (SDRAM_BANK0PARAMETERS + (info->slot * 0x8), tmp);
  366. GT_REG_WRITE (SDRAM_BANK1PARAMETERS + (info->slot * 0x8), tmp);
  367. DP (printf
  368. ("SDRAM bankparam slot %d (bank %d+%d): %08lx\n", info->slot,
  369. info->slot * 2, (info->slot * 2) + 1, tmp));
  370. /* set the SDRAM configuration for each bank */
  371. for (i = info->slot * 2; i < ((info->slot * 2) + info->banks); i++) {
  372. DP (printf ("*** Running a MRS cycle for bank %d ***\n", i));
  373. /* map the bank */
  374. memory_map_bank (i, 0, GB / 4);
  375. /* set SDRAM mode */
  376. GT_REG_WRITE (SDRAM_OPERATION_MODE, 0x3);
  377. check = GTREGREAD (SDRAM_OPERATION_MODE);
  378. /* dummy write */
  379. *addr = 0;
  380. /* wait for the command to complete */
  381. while ((GTREGREAD (SDRAM_OPERATION_MODE) & (1 << 31)) == 0);
  382. /* switch back to normal operation mode */
  383. GT_REG_WRITE (SDRAM_OPERATION_MODE, 0);
  384. check = GTREGREAD (SDRAM_OPERATION_MODE);
  385. /* unmap the bank */
  386. memory_map_bank (i, 0, 0);
  387. DP (printf ("*** MRS cycle for bank %d done ***\n", i));
  388. }
  389. return 0;
  390. }
  391. /*
  392. * Check memory range for valid RAM. A simple memory test determines
  393. * the actually available RAM size between addresses `base' and
  394. * `base + maxsize'. Some (not all) hardware errors are detected:
  395. * - short between address lines
  396. * - short between data lines
  397. */
  398. static long int dram_size (long int *base, long int maxsize)
  399. {
  400. volatile long int *addr, *b = base;
  401. long int cnt, val, save1, save2;
  402. #define STARTVAL (1<<20) /* start test at 1M */
  403. for (cnt = STARTVAL / sizeof (long); cnt < maxsize / sizeof (long);
  404. cnt <<= 1) {
  405. addr = base + cnt; /* pointer arith! */
  406. save1 = *addr; /* save contents of addr */
  407. save2 = *b; /* save contents of base */
  408. *addr = cnt; /* write cnt to addr */
  409. *b = 0; /* put null at base */
  410. /* check at base address */
  411. if ((*b) != 0) {
  412. *addr = save1; /* restore *addr */
  413. *b = save2; /* restore *b */
  414. return (0);
  415. }
  416. val = *addr; /* read *addr */
  417. *addr = save1;
  418. *b = save2;
  419. if (val != cnt) {
  420. /* fix boundary condition.. STARTVAL means zero */
  421. if (cnt == STARTVAL / sizeof (long))
  422. cnt = 0;
  423. return (cnt * sizeof (long));
  424. }
  425. }
  426. return maxsize;
  427. }
  428. /* ------------------------------------------------------------------------- */
  429. /* U-Boot interface function to SDRAM init - this is where all the
  430. * controlling logic happens */
  431. long int initdram (int board_type)
  432. {
  433. ulong checkbank[4] = {[0 ... 3] = 0 };
  434. int bank_no;
  435. ulong total;
  436. int nhr;
  437. sdram_info_t dimm_info[2];
  438. /* first, use the SPD to get info about the SDRAM */
  439. /* check the NHR bit and skip mem init if it's already done */
  440. nhr = get_hid0 () & (1 << 16);
  441. if (nhr) {
  442. printf ("Skipping SDRAM setup due to NHR bit being set\n");
  443. } else {
  444. /* DIMM0 */
  445. check_dimm (0, &dimm_info[0]);
  446. /* DIMM1 */
  447. #ifndef CONFIG_EVB64260_750CX /* EVB64260_750CX has only 1 DIMM */
  448. check_dimm (1, &dimm_info[1]);
  449. #else /* CONFIG_EVB64260_750CX */
  450. memset (&dimm_info[1], 0, sizeof (sdram_info_t));
  451. #endif
  452. /* unmap all banks */
  453. memory_map_bank (0, 0, 0);
  454. memory_map_bank (1, 0, 0);
  455. memory_map_bank (2, 0, 0);
  456. memory_map_bank (3, 0, 0);
  457. /* Now, program the GT with the correct values */
  458. if (setup_sdram_common (dimm_info)) {
  459. printf ("Setup common failed.\n");
  460. }
  461. if (setup_sdram (&dimm_info[0])) {
  462. printf ("Setup for DIMM1 failed.\n");
  463. }
  464. if (setup_sdram (&dimm_info[1])) {
  465. printf ("Setup for DIMM2 failed.\n");
  466. }
  467. /* set the NHR bit */
  468. set_hid0 (get_hid0 () | (1 << 16));
  469. }
  470. /* next, size the SDRAM banks */
  471. total = 0;
  472. if (dimm_info[0].banks > 0)
  473. checkbank[0] = 1;
  474. if (dimm_info[0].banks > 1)
  475. checkbank[1] = 1;
  476. if (dimm_info[0].banks > 2)
  477. printf ("Error, SPD claims DIMM1 has >2 banks\n");
  478. if (dimm_info[1].banks > 0)
  479. checkbank[2] = 1;
  480. if (dimm_info[1].banks > 1)
  481. checkbank[3] = 1;
  482. if (dimm_info[1].banks > 2)
  483. printf ("Error, SPD claims DIMM2 has >2 banks\n");
  484. /* Generic dram sizer: works even if we don't have i2c DIMMs,
  485. * as long as the timing settings are more or less correct */
  486. /*
  487. * pass 1: size all the banks, using first bat (0-256M)
  488. * limitation: we only support 256M per bank due to
  489. * us only having 1 BAT for all DRAM
  490. */
  491. for (bank_no = 0; bank_no < CFG_DRAM_BANKS; bank_no++) {
  492. /* skip over banks that are not populated */
  493. if (!checkbank[bank_no])
  494. continue;
  495. DP (printf ("checking bank %d\n", bank_no));
  496. memory_map_bank (bank_no, 0, GB / 4);
  497. checkbank[bank_no] = dram_size (NULL, GB / 4);
  498. memory_map_bank (bank_no, 0, 0);
  499. DP (printf ("bank %d %08lx\n", bank_no, checkbank[bank_no]));
  500. }
  501. /*
  502. * pass 2: contiguously map each bank into physical address
  503. * space.
  504. */
  505. dimm_info[0].banks = dimm_info[1].banks = 0;
  506. for (bank_no = 0; bank_no < CFG_DRAM_BANKS; bank_no++) {
  507. if (!checkbank[bank_no])
  508. continue;
  509. dimm_info[bank_no / 2].banks++;
  510. dimm_info[bank_no / 2].size += checkbank[bank_no];
  511. memory_map_bank (bank_no, total, checkbank[bank_no]);
  512. #ifdef MAP_PCI
  513. memory_map_bank_pci (bank_no, total, checkbank[bank_no]);
  514. #endif
  515. total += checkbank[bank_no];
  516. }
  517. #ifdef CONFIG_ECC
  518. #ifdef CONFIG_ZUMA_V2
  519. /*
  520. * We always enable ECC when bank 2 and 3 are unpopulated
  521. * If we 2 or 3 are populated, we CAN'T support ECC.
  522. * (Zuma boards only support ECC in banks 0 and 1; assume that
  523. * in that configuration, ECC chips are mounted, even for stacked
  524. * chips)
  525. */
  526. if (checkbank[2] == 0 && checkbank[3] == 0) {
  527. dimm_info[0].ecc = 2;
  528. GT_REG_WRITE (SDRAM_TIMING,
  529. GTREGREAD (SDRAM_TIMING) | (1 << 13));
  530. /* TODO: do we have to run MRS cycles again? */
  531. }
  532. #endif /* CONFIG_ZUMA_V2 */
  533. if (GTREGREAD (SDRAM_TIMING) & (1 << 13)) {
  534. puts ("[ECC] ");
  535. }
  536. #endif /* CONFIG_ECC */
  537. #ifdef DEBUG
  538. dump_dimm_info (&dimm_info[0]);
  539. dump_dimm_info (&dimm_info[1]);
  540. #endif
  541. /* TODO: return at MOST 256M? */
  542. /* return total > GB/4 ? GB/4 : total; */
  543. return total;
  544. }