3 * Stefan Roese, DENX Software Engineering, sr@denx.de.
5 * Based on original work by
6 * Roel Loeffen, (C) Copyright 2006 Prodrive B.V.
7 * Josh Huber, (C) Copyright 2001 Mission Critical Linux, Inc.
9 * SPDX-License-Identifier: GPL-2.0+
11 * modifications for the DB64360 eval board based by Ingo.Assmus@keymile.com
12 * modifications for the cpci750 by reinhard.arlt@esd-electronics.com
13 * modifications for the P3M750 by roel.loeffen@prodrive.nl
17 * p3m750.c - main board support/init for the Prodrive p3m750/p3m7448.
22 #include "../../Marvell/include/memory.h"
23 #include "../../Marvell/include/pci.h"
24 #include "../../Marvell/include/mv_gen_reg.h"
34 DECLARE_GLOBAL_DATA_PTR;
41 #endif /* of CONFIG_PCI */
49 extern flash_info_t flash_info[];
51 /* ------------------------------------------------------------------------- */
53 /* this is the current GT register space location */
54 /* it starts at CONFIG_SYS_DFL_GT_REGS but moves later to CONFIG_SYS_GT_REGS */
56 /* Unfortunately, we cant change it while we are in flash, so we initialize it
57 * to the "final" value. This means that any debug_led calls before
58 * board_early_init_f wont work right (like in cpu_init_f).
59 * See also my_remap_gt_regs below. (NTL)
62 void board_prebootm_init (void);
63 unsigned int INTERNAL_REG_BASE_ADDR = CONFIG_SYS_GT_REGS;
64 int display_mem_map (void);
67 /* ------------------------------------------------------------------------- */
70 * This is a version of the GT register space remapping function that
71 * doesn't touch globals (meaning, it's ok to run from flash.)
73 * Unfortunately, this has the side effect that a writable
74 * INTERNAL_REG_BASE_ADDR is impossible. Oh well.
77 void my_remap_gt_regs (u32 cur_loc, u32 new_loc)
81 /* check and see if it's already moved */
82 temp = in_le32 ((u32 *) (new_loc + INTERNAL_SPACE_DECODE));
83 if ((temp & 0xffff) == new_loc >> 16)
86 temp = (in_le32 ((u32 *) (cur_loc + INTERNAL_SPACE_DECODE)) &
87 0xffff0000) | (new_loc >> 16);
89 out_le32 ((u32 *) (cur_loc + INTERNAL_SPACE_DECODE), temp);
91 while (GTREGREAD (INTERNAL_SPACE_DECODE) != temp);
96 static void gt_pci_config (void)
99 unsigned int val = 0x00fff864; /* DINK32: BusNum 23:16, DevNum 15:11, */
100 /* FuncNum 10:8, RegNum 7:2 */
103 * In PCIX mode devices provide their own bus and device numbers.
104 * We query the Discovery II's
105 * config registers by writing ones to the bus and device.
106 * We then update the Virtual register with the correct value for the
109 if ((GTREGREAD (PCI_0_MODE) & (BIT4 | BIT5)) != 0) { /* if PCI-X */
110 GT_REG_WRITE (PCI_0_CONFIG_ADDR, BIT31 | val);
112 GT_REG_READ (PCI_0_CONFIG_DATA_VIRTUAL_REG, &stat);
114 GT_REG_WRITE (PCI_0_CONFIG_ADDR, BIT31 | val);
115 GT_REG_WRITE (PCI_0_CONFIG_DATA_VIRTUAL_REG,
116 (stat & 0xffff0000) | CONFIG_SYS_PCI_IDSEL);
119 if ((GTREGREAD (PCI_1_MODE) & (BIT4 | BIT5)) != 0) { /* if PCI-X */
120 GT_REG_WRITE (PCI_1_CONFIG_ADDR, BIT31 | val);
121 GT_REG_READ (PCI_1_CONFIG_DATA_VIRTUAL_REG, &stat);
123 GT_REG_WRITE (PCI_1_CONFIG_ADDR, BIT31 | val);
124 GT_REG_WRITE (PCI_1_CONFIG_DATA_VIRTUAL_REG,
125 (stat & 0xffff0000) | CONFIG_SYS_PCI_IDSEL);
129 PCI_MASTER_ENABLE (0, SELF);
130 PCI_MASTER_ENABLE (1, SELF);
132 /* Enable PCI0/1 Mem0 and IO 0 disable all others */
133 GT_REG_READ (BASE_ADDR_ENABLE, &stat);
134 stat |= (1 << 11) | (1 << 12) | (1 << 13) | (1 << 16) | (1 << 17) |
136 stat &= ~((1 << 9) | (1 << 10) | (1 << 14) | (1 << 15));
137 GT_REG_WRITE (BASE_ADDR_ENABLE, stat);
140 * add write to pci remap registers for 64460.
141 * in 64360 when writing to pci base go and overide remap automaticaly,
142 * in 64460 it doesn't
144 GT_REG_WRITE (PCI_0_IO_BASE_ADDR, CONFIG_SYS_PCI0_IO_SPACE >> 16);
145 GT_REG_WRITE (PCI_0I_O_ADDRESS_REMAP, CONFIG_SYS_PCI0_IO_SPACE_PCI >> 16);
146 GT_REG_WRITE (PCI_0_IO_SIZE, (CONFIG_SYS_PCI0_IO_SIZE - 1) >> 16);
148 GT_REG_WRITE (PCI_0_MEMORY0_BASE_ADDR, CONFIG_SYS_PCI0_MEM_BASE >> 16);
149 GT_REG_WRITE (PCI_0MEMORY0_ADDRESS_REMAP, CONFIG_SYS_PCI0_MEM_BASE >> 16);
150 GT_REG_WRITE (PCI_0_MEMORY0_SIZE, (CONFIG_SYS_PCI0_MEM_SIZE - 1) >> 16);
152 GT_REG_WRITE (PCI_1_IO_BASE_ADDR, CONFIG_SYS_PCI1_IO_SPACE >> 16);
153 GT_REG_WRITE (PCI_1I_O_ADDRESS_REMAP, CONFIG_SYS_PCI1_IO_SPACE_PCI >> 16);
154 GT_REG_WRITE (PCI_1_IO_SIZE, (CONFIG_SYS_PCI1_IO_SIZE - 1) >> 16);
156 GT_REG_WRITE (PCI_1_MEMORY0_BASE_ADDR, CONFIG_SYS_PCI1_MEM_BASE >> 16);
157 GT_REG_WRITE (PCI_1MEMORY0_ADDRESS_REMAP, CONFIG_SYS_PCI1_MEM_BASE >> 16);
158 GT_REG_WRITE (PCI_1_MEMORY0_SIZE, (CONFIG_SYS_PCI1_MEM_SIZE - 1) >> 16);
160 /* PCI interface settings */
161 /* Timeout set to retry forever */
162 GT_REG_WRITE (PCI_0TIMEOUT_RETRY, 0x0);
163 GT_REG_WRITE (PCI_1TIMEOUT_RETRY, 0x0);
165 /* ronen - enable only CS0 and Internal reg!! */
166 GT_REG_WRITE (PCI_0BASE_ADDRESS_REGISTERS_ENABLE, 0xfffffdfe);
167 GT_REG_WRITE (PCI_1BASE_ADDRESS_REGISTERS_ENABLE, 0xfffffdfe);
170 * update the pci internal registers base address.
173 for (stat = 0; stat <= PCI_HOST1; stat++)
174 pciWriteConfigReg (stat,
175 PCI_INTERNAL_REGISTERS_MEMORY_MAPPED_BASE_ADDRESS,
176 SELF, CONFIG_SYS_GT_REGS);
182 /* Setup CPU interface paramaters */
183 static void gt_cpu_config (void)
185 cpu_t cpu = get_cpu_type ();
188 /* cpu configuration register */
189 tmp = GTREGREAD (CPU_CONFIGURATION);
190 /* set the SINGLE_CPU bit see MV64460 */
191 #ifndef CONFIG_SYS_GT_DUAL_CPU /* SINGLE_CPU seems to cause JTAG problems */
192 tmp |= CPU_CONF_SINGLE_CPU;
194 tmp &= ~CPU_CONF_AACK_DELAY_2;
195 tmp |= CPU_CONF_DP_VALID;
196 tmp |= CPU_CONF_AP_VALID;
197 tmp |= CPU_CONF_PIPELINE;
198 GT_REG_WRITE (CPU_CONFIGURATION, tmp); /* Marvell (VXWorks) writes 0x20220FF */
200 /* CPU master control register */
201 tmp = GTREGREAD (CPU_MASTER_CONTROL);
202 tmp |= CPU_MAST_CTL_ARB_EN;
204 if ((cpu == CPU_7400) ||
205 (cpu == CPU_7410) || (cpu == CPU_7455) || (cpu == CPU_7450)) {
207 tmp |= CPU_MAST_CTL_CLEAN_BLK;
208 tmp |= CPU_MAST_CTL_FLUSH_BLK;
211 /* cleanblock must be cleared for CPUs
212 * that do not support this command (603e, 750)
214 tmp &= ~CPU_MAST_CTL_CLEAN_BLK;
215 tmp &= ~CPU_MAST_CTL_FLUSH_BLK;
217 GT_REG_WRITE (CPU_MASTER_CONTROL, tmp);
221 * board_early_init_f.
223 * set up gal. device mappings, etc.
225 int board_early_init_f (void)
227 /* set up the GT the way the kernel wants it
228 * the call to move the GT register space will obviously
229 * fail if it has already been done, but we're going to assume
230 * that if it's not at the power-on location, it's where we put
231 * it last time. (huber)
233 my_remap_gt_regs (CONFIG_SYS_DFL_GT_REGS, CONFIG_SYS_GT_REGS);
238 /* mask all external interrupt sources */
239 GT_REG_WRITE (CPU_INTERRUPT_MASK_REGISTER_LOW, 0);
240 GT_REG_WRITE (CPU_INTERRUPT_MASK_REGISTER_HIGH, 0);
241 /* new in >MV6436x */
242 GT_REG_WRITE (CPU_INTERRUPT_1_MASK_REGISTER_LOW, 0);
243 GT_REG_WRITE (CPU_INTERRUPT_1_MASK_REGISTER_HIGH, 0);
244 /* --------------------- */
245 GT_REG_WRITE (PCI_0INTERRUPT_CAUSE_MASK_REGISTER_LOW, 0);
246 GT_REG_WRITE (PCI_0INTERRUPT_CAUSE_MASK_REGISTER_HIGH, 0);
247 GT_REG_WRITE (PCI_1INTERRUPT_CAUSE_MASK_REGISTER_LOW, 0);
248 GT_REG_WRITE (PCI_1INTERRUPT_CAUSE_MASK_REGISTER_HIGH, 0);
250 /* Device and Boot bus settings
252 memoryMapDeviceSpace(DEVICE0, 0, 0);
253 GT_REG_WRITE(DEVICE_BANK0PARAMETERS, 0);
254 memoryMapDeviceSpace(DEVICE1, 0, 0);
255 GT_REG_WRITE(DEVICE_BANK1PARAMETERS, 0);
256 memoryMapDeviceSpace(DEVICE2, 0, 0);
257 GT_REG_WRITE(DEVICE_BANK2PARAMETERS, 0);
258 memoryMapDeviceSpace(DEVICE3, 0, 0);
259 GT_REG_WRITE(DEVICE_BANK3PARAMETERS, 0);
261 GT_REG_WRITE(DEVICE_BOOT_BANK_PARAMETERS, CONFIG_SYS_BOOT_PAR);
266 GT_REG_WRITE (MPP_CONTROL0, CONFIG_SYS_MPP_CONTROL_0);
267 GT_REG_WRITE (MPP_CONTROL1, CONFIG_SYS_MPP_CONTROL_1);
268 GT_REG_WRITE (MPP_CONTROL2, CONFIG_SYS_MPP_CONTROL_2);
269 GT_REG_WRITE (MPP_CONTROL3, CONFIG_SYS_MPP_CONTROL_3);
271 GT_REG_WRITE (GPP_LEVEL_CONTROL, CONFIG_SYS_GPP_LEVEL_CONTROL);
278 /* various things to do after relocation */
294 * Enable trickle changing in RTC upon powerup
295 * No diode, 250 ohm series resistor
298 i2c_write(CONFIG_SYS_I2C_RTC_ADDR, 8, 1, &val, 1);
303 void after_reloc (ulong dest_addr, gd_t * gd)
305 memoryMapDeviceSpace (BOOT_DEVICE, CONFIG_SYS_BOOT_SPACE, CONFIG_SYS_BOOT_SIZE);
307 /* display_mem_map(); */
309 /* now, jump to the main U-Boot board init code */
311 board_init_r (gd, dest_addr);
316 * Check Board Identity:
317 * right now, assume borad type. (there is just one...after all)
320 int checkboard (void)
323 int i = getenv_f("serial#", buf, sizeof(buf));
325 printf("Board: %s", CONFIG_SYS_BOARD_NAME);
336 void set_led(int col)
342 /* Program Mpp[22] as Gpp[22]
343 * Program Mpp[23] as Gpp[23]
345 tmp = GTREGREAD(MPP_CONTROL2);
347 GT_REG_WRITE(MPP_CONTROL2,tmp);
349 /* Program Gpp[22] and Gpp[23] as output
351 tmp = GTREGREAD(GPP_IO_CONTROL);
353 GT_REG_WRITE(GPP_IO_CONTROL, tmp);
355 /* Program Gpp[22] and Gpp[23] as active high
357 tmp = GTREGREAD(GPP_LEVEL_CONTROL);
359 GT_REG_WRITE(GPP_LEVEL_CONTROL, tmp);
365 off_pin = ((1 << 23) | (1 << 22));
376 on_pin = ((1 << 23) | (1 << 22));
381 /* Set output Gpp[22] and Gpp[23]
383 tmp = GTREGREAD(GPP_VALUE);
386 GT_REG_WRITE(GPP_VALUE, tmp);
389 int display_mem_map (void)
392 unsigned int base, size, width;
398 printf ("SD (DDR) RAM\n");
399 for (i = 0; i <= BANK3; i++) {
400 base = memoryGetBankBaseAddress (i);
401 size = memoryGetBankSize (i);
403 printf ("BANK%d: base - 0x%08x\tsize - %dM bytes\n",
404 i, base, size >> 20);
407 /* CPU's PCI windows */
408 for (i = 0; i <= PCI_HOST1; i++) {
409 printf ("\nCPU's PCI %d windows\n", i);
410 base = pciGetSpaceBase (i, PCI_IO);
411 size = pciGetSpaceSize (i, PCI_IO);
412 printf (" IO: base - 0x%08x\tsize - %dM bytes\n", base,
414 /* ronen currently only first PCI MEM is used 3 */
415 for (j = 0; j <= PCI_REGION0; j++) {
416 base = pciGetSpaceBase (i, j);
417 size = pciGetSpaceSize (i, j);
418 printf ("MEMORY %d: base - 0x%08x\tsize - %dM bytes\n",
419 j, base, size >> 20);
422 #endif /* of CONFIG_PCI */
425 base = memoryGetDeviceBaseAddress (BOOT_DEVICE); /* Boot */
426 size = memoryGetDeviceSize (BOOT_DEVICE);
427 width = memoryGetDeviceWidth (BOOT_DEVICE) * 8;
428 printf (" BOOT: base - 0x%08x size - %dM bytes\twidth - %d bits\t- FLASH\n",
429 base, size >> 20, width);
434 /* DRAM check routines copied from gw8260 */
436 #if defined (CONFIG_SYS_DRAM_TEST)
438 /*********************************************************************/
439 /* NAME: move64() - moves a double word (64-bit) */
442 /* this function performs a double word move from the data at */
443 /* the source pointer to the location at the destination pointer. */
446 /* unsigned long long *src - pointer to data to move */
449 /* unsigned long long *dest - pointer to locate to move data */
454 /* RESTRICTIONS/LIMITATIONS: */
455 /* May cloober fr0. */
457 /*********************************************************************/
458 static void move64 (unsigned long long *src, unsigned long long *dest)
460 asm ("lfd 0, 0(3)\n\t" /* fpr0 = *scr */
461 "stfd 0, 0(4)" /* *dest = fpr0 */
462 : : : "fr0"); /* Clobbers fr0 */
467 #if defined (CONFIG_SYS_DRAM_TEST_DATA)
469 unsigned long long pattern[] = {
470 0xaaaaaaaaaaaaaaaaULL,
471 0xccccccccccccccccULL,
472 0xf0f0f0f0f0f0f0f0ULL,
473 0xff00ff00ff00ff00ULL,
474 0xffff0000ffff0000ULL,
475 0xffffffff00000000ULL,
476 0x00000000ffffffffULL,
477 0x0000ffff0000ffffULL,
478 0x00ff00ff00ff00ffULL,
479 0x0f0f0f0f0f0f0f0fULL,
480 0x3333333333333333ULL,
481 0x5555555555555555ULL
484 /*********************************************************************/
485 /* NAME: mem_test_data() - test data lines for shorts and opens */
488 /* Tests data lines for shorts and opens by forcing adjacent data */
489 /* to opposite states. Because the data lines could be routed in */
490 /* an arbitrary manner the must ensure test patterns ensure that */
491 /* every case is tested. By using the following series of binary */
492 /* patterns every combination of adjacent bits is test regardless */
495 /* ...101010101010101010101010 */
496 /* ...110011001100110011001100 */
497 /* ...111100001111000011110000 */
498 /* ...111111110000000011111111 */
500 /* Carrying this out, gives us six hex patterns as follows: */
502 /* 0xaaaaaaaaaaaaaaaa */
503 /* 0xcccccccccccccccc */
504 /* 0xf0f0f0f0f0f0f0f0 */
505 /* 0xff00ff00ff00ff00 */
506 /* 0xffff0000ffff0000 */
507 /* 0xffffffff00000000 */
509 /* The number test patterns will always be given by: */
511 /* log(base 2)(number data bits) = log2 (64) = 6 */
513 /* To test for short and opens to other signals on our boards. we */
515 /* test with the 1's complemnt of the paterns as well. */
518 /* Displays failing test pattern */
521 /* 0 - Passed test */
522 /* 1 - Failed test */
524 /* RESTRICTIONS/LIMITATIONS: */
525 /* Assumes only one one SDRAM bank */
527 /*********************************************************************/
528 int mem_test_data (void)
530 unsigned long long *pmem = (unsigned long long *) CONFIG_SYS_MEMTEST_START;
531 unsigned long long temp64 = 0;
532 int num_patterns = sizeof (pattern) / sizeof (pattern[0]);
536 for (i = 0; i < num_patterns; i++) {
537 move64 (&(pattern[i]), pmem);
538 move64 (pmem, &temp64);
540 /* hi = (temp64>>32) & 0xffffffff; */
541 /* lo = temp64 & 0xffffffff; */
542 /* printf("\ntemp64 = 0x%08x%08x", hi, lo); */
544 hi = (pattern[i] >> 32) & 0xffffffff;
545 lo = pattern[i] & 0xffffffff;
546 /* printf("\npattern[%d] = 0x%08x%08x", i, hi, lo); */
548 if (temp64 != pattern[i]) {
549 printf ("\n Data Test Failed, pattern 0x%08x%08x",
557 #endif /* CONFIG_SYS_DRAM_TEST_DATA */
559 #if defined (CONFIG_SYS_DRAM_TEST_ADDRESS)
560 /*********************************************************************/
561 /* NAME: mem_test_address() - test address lines */
564 /* This function performs a test to verify that each word im */
565 /* memory is uniquly addressable. The test sequence is as follows: */
567 /* 1) write the address of each word to each word. */
568 /* 2) verify that each location equals its address */
571 /* Displays failing test pattern and address */
574 /* 0 - Passed test */
575 /* 1 - Failed test */
577 /* RESTRICTIONS/LIMITATIONS: */
580 /*********************************************************************/
581 int mem_test_address (void)
583 volatile unsigned int *pmem =
584 (volatile unsigned int *) CONFIG_SYS_MEMTEST_START;
585 const unsigned int size = (CONFIG_SYS_MEMTEST_END - CONFIG_SYS_MEMTEST_START) / 4;
588 /* write address to each location */
589 for (i = 0; i < size; i++)
592 /* verify each loaction */
593 for (i = 0; i < size; i++) {
595 printf ("\n Address Test Failed at 0x%x", i);
601 #endif /* CONFIG_SYS_DRAM_TEST_ADDRESS */
603 #if defined (CONFIG_SYS_DRAM_TEST_WALK)
604 /*********************************************************************/
605 /* NAME: mem_march() - memory march */
608 /* Marches up through memory. At each location verifies rmask if */
609 /* read = 1. At each location write wmask if write = 1. Displays */
610 /* failing address and pattern. */
613 /* volatile unsigned long long * base - start address of test */
614 /* unsigned int size - number of dwords(64-bit) to test */
615 /* unsigned long long rmask - read verify mask */
616 /* unsigned long long wmask - wrtie verify mask */
617 /* short read - verifies rmask if read = 1 */
618 /* short write - writes wmask if write = 1 */
621 /* Displays failing test pattern and address */
624 /* 0 - Passed test */
625 /* 1 - Failed test */
627 /* RESTRICTIONS/LIMITATIONS: */
630 /*********************************************************************/
631 int mem_march (volatile unsigned long long *base,
633 unsigned long long rmask,
634 unsigned long long wmask, short read, short write)
637 unsigned long long temp = 0;
638 unsigned int hitemp, lotemp, himask, lomask;
640 for (i = 0; i < size; i++) {
642 /* temp = base[i]; */
643 move64 ((unsigned long long *) &(base[i]), &temp);
645 hitemp = (temp >> 32) & 0xffffffff;
646 lotemp = temp & 0xffffffff;
647 himask = (rmask >> 32) & 0xffffffff;
648 lomask = rmask & 0xffffffff;
650 printf ("\n Walking one's test failed: address = 0x%08x," "\n\texpected 0x%08x%08x, found 0x%08x%08x", i << 3, himask, lomask, hitemp, lotemp);
655 /* base[i] = wmask; */
656 move64 (&wmask, (unsigned long long *) &(base[i]));
661 #endif /* CONFIG_SYS_DRAM_TEST_WALK */
663 /*********************************************************************/
664 /* NAME: mem_test_walk() - a simple walking ones test */
667 /* Performs a walking ones through entire physical memory. The */
668 /* test uses as series of memory marches, mem_march(), to verify */
669 /* and write the test patterns to memory. The test sequence is as */
671 /* 1) march writing 0000...0001 */
672 /* 2) march verifying 0000...0001 , writing 0000...0010 */
673 /* 3) repeat step 2 shifting masks left 1 bit each time unitl */
674 /* the write mask equals 1000...0000 */
675 /* 4) march verifying 1000...0000 */
676 /* The test fails if any of the memory marches return a failure. */
679 /* Displays which pass on the memory test is executing */
682 /* 0 - Passed test */
683 /* 1 - Failed test */
685 /* RESTRICTIONS/LIMITATIONS: */
688 /*********************************************************************/
689 int mem_test_walk (void)
691 unsigned long long mask;
692 volatile unsigned long long *pmem =
693 (volatile unsigned long long *) CONFIG_SYS_MEMTEST_START;
694 const unsigned long size = (CONFIG_SYS_MEMTEST_END - CONFIG_SYS_MEMTEST_START) / 8;
700 printf ("Initial Pass");
701 mem_march (pmem, size, 0x0, 0x1, 0, 1);
703 printf ("\b\b\b\b\b\b\b\b\b\b\b\b");
706 printf ("\b\b\b\b\b\b\b\b\b\b\b\b");
708 for (i = 0; i < 63; i++) {
709 printf ("Pass %2d", i + 2);
710 if (mem_march (pmem, size, mask, mask << 1, 1, 1) != 0) {
711 /*printf("mask: 0x%x, pass: %d, ", mask, i); */
715 printf ("\b\b\b\b\b\b\b");
718 printf ("Last Pass");
719 if (mem_march (pmem, size, 0, mask, 0, 1) != 0) {
720 /* printf("mask: 0x%x", mask); */
723 printf ("\b\b\b\b\b\b\b\b\b");
725 printf ("\b\b\b\b\b\b\b\b\b");
730 /*********************************************************************/
731 /* NAME: testdram() - calls any enabled memory tests */
734 /* Runs memory tests if the environment test variables are set to */
738 /* testdramdata - If set to 'y', data test is run. */
739 /* testdramaddress - If set to 'y', address test is run. */
740 /* testdramwalk - If set to 'y', walking ones test is run */
746 /* 0 - Passed test */
747 /* 1 - Failed test */
749 /* RESTRICTIONS/LIMITATIONS: */
752 /*********************************************************************/
759 #ifdef CONFIG_SYS_DRAM_TEST_DATA
760 rundata = getenv_yesno("testdramdata") == 1;
762 #ifdef CONFIG_SYS_DRAM_TEST_ADDRESS
763 runaddress = getenv_yesno("testdramaddress") == 1;
765 #ifdef CONFIG_SYS_DRAM_TEST_WALK
766 runwalk = getenv_yesno("testdramwalk") == 1;
769 if ((rundata == 1) || (runaddress == 1) || (runwalk == 1))
770 printf ("Testing RAM from 0x%08x to 0x%08x ... "
771 "(don't panic... that will take a moment !!!!)\n",
772 CONFIG_SYS_MEMTEST_START, CONFIG_SYS_MEMTEST_END);
773 #ifdef CONFIG_SYS_DRAM_TEST_DATA
775 printf ("Test DATA ... ");
776 if (mem_test_data () == 1) {
777 printf ("failed \n");
783 #ifdef CONFIG_SYS_DRAM_TEST_ADDRESS
784 if (runaddress == 1) {
785 printf ("Test ADDRESS ... ");
786 if (mem_test_address () == 1) {
787 printf ("failed \n");
793 #ifdef CONFIG_SYS_DRAM_TEST_WALK
795 printf ("Test WALKING ONEs ... ");
796 if (mem_test_walk () == 1) {
797 printf ("failed \n");
803 if ((rundata == 1) || (runaddress == 1) || (runwalk == 1))
808 #endif /* CONFIG_SYS_DRAM_TEST */
810 /* ronen - the below functions are used by the bootm function */
811 /* - we map the base register to fbe00000 (same mapping as in the LSP) */
812 /* - we turn off the RX gig dmas - to prevent the dma from overunning */
813 /* the kernel data areas. */
814 /* - we diable and invalidate the icache and dcache. */
815 void my_remap_gt_regs_bootm (u32 cur_loc, u32 new_loc)
819 temp = in_le32 ((u32 *) (new_loc + INTERNAL_SPACE_DECODE));
820 if ((temp & 0xffff) == new_loc >> 16)
823 temp = (in_le32 ((u32 *) (cur_loc + INTERNAL_SPACE_DECODE)) &
824 0xffff0000) | (new_loc >> 16);
826 out_le32 ((u32 *) (cur_loc + INTERNAL_SPACE_DECODE), temp);
828 while ((WORD_SWAP (*((volatile unsigned int *) (NONE_CACHEABLE |
830 (INTERNAL_SPACE_DECODE)))))
835 int board_eth_init(bd_t *bis)
837 return mv6446x_eth_initialize(bis);