27 #define MHz (1000U*1000U)
28 #define GHz (1000U*MHz)
30 #define BOARD_MODEL "PrPMC2800"
31 #define BOARD_MODEL_MAX 32
33 #define EEPROM2_ADDR 0xa4
34 #define EEPROM3_ADDR 0xa8
38 static u8 *bridge_base;
99 .core_speed = 733*
MHz,
138 .core_speed = 733*
MHz,
203 .core_speed = 733*
MHz,
242 .core_speed = 733*
MHz,
268 .core_speed = 733*
MHz,
275 static struct prpmc2800_board_info *prpmc2800_get_board_info(
u8 *
vpd)
277 struct prpmc2800_board_info *bip;
280 for (i=0,bip=prpmc2800_board_info; i<
ARRAY_SIZE(prpmc2800_board_info);
290 static struct prpmc2800_board_info *prpmc2800_get_bip(
void)
292 struct prpmc2800_board_info *bip;
297 fatal(
"Error: Can't open i2c device\n\r");
300 memset(vpd, 0,
sizeof(vpd));
303 fatal(
"Error: Couldn't read eeprom2\n\r");
307 bip = prpmc2800_get_board_info(vpd);
309 printf(
"Error: Unsupported board or corrupted VPD:\n\r");
310 printf(
" 0x%x 0x%x 0x%x 0x%x 0x%x\n\r",
311 vpd[0], vpd[1], vpd[2], vpd[3], vpd[4]);
312 printf(
"Using device tree defaults...\n\r");
320 u32 i,
v[12], enables, acc_bits;
322 unsigned long cpu_base;
325 u8 *bridge_pbase, is_coherent;
347 devp = find_node_by_compatible(
NULL,
"marvell,mv64360-pci");
349 fatal(
"Error: Missing marvell,mv64360-pci"
350 " device tree node\n\r");
352 rc = getprop(devp,
"ranges", v,
sizeof(v));
354 fatal(
"Error: Can't find marvell,mv64360-pci ranges"
358 devp = find_node_by_compatible(
NULL,
"marvell,mv64360");
360 fatal(
"Error: Missing marvell,mv64360 device tree node\n\r");
363 enables |= 0x0007fe00;
366 for (i=0; i<12; i+=6) {
367 switch (v[i] & 0xff000000) {
378 pci_base_hi = v[i+1];
379 pci_base_lo = v[i+2];
387 fatal(
"Error: Can't translate PCI address 0x%x\n\r",
391 pci_base_lo, cpu_base, size, tbl);
394 enables &= ~0x00000600;
398 static void prpmc2800_fixups(
void)
404 struct prpmc2800_board_info *bip;
406 bip = prpmc2800_get_bip();
409 prpmc2800_bridge_setup(mem_size);
419 devp = finddevice(
"/");
421 fatal(
"Error: Missing '/' device tree node\n\r");
429 setprop(devp,
"model", model, l);
432 devp = find_node_by_prop_value_str(
NULL,
"device_type",
"cpu");
434 fatal(
"Error: Missing proper cpu device tree node\n\r");
436 setprop(devp,
"clock-frequency", &v[0],
sizeof(v[0]));
439 devp = finddevice(
"/memory");
441 fatal(
"Error: Missing /memory device tree node\n\r");
444 setprop(devp,
"reg", v,
sizeof(v));
448 devp = find_node_by_compatible(
NULL,
"marvell,mv64360");
450 fatal(
"Error: Missing marvell,mv64360"
451 " device tree node\n\r");
452 setprop(devp,
"model",
"mv64362",
strlen(
"mv64362") + 1);
456 devp = find_node_by_compatible(
NULL,
"direct-mapped");
458 fatal(
"Error: Missing User FLASH device tree node\n\r");
459 rc = getprop(devp,
"reg", v,
sizeof(v));
461 fatal(
"Error: Can't find User FLASH reg property\n\r");
463 setprop(devp,
"reg", v,
sizeof(v));
466 #define MV64x60_MPP_CNTL_0 0xf000
467 #define MV64x60_MPP_CNTL_2 0xf008
468 #define MV64x60_GPP_IO_CNTL 0xf100
469 #define MV64x60_GPP_LEVEL_CNTL 0xf110
470 #define MV64x60_GPP_VALUE_SET 0xf118
472 static void prpmc2800_reset(
void)
478 if (bridge_base != 0) {
510 #define HEAP_SIZE (16*MB)
514 unsigned long r6,
unsigned long r7)
517 char *heap_start, *dtb;
540 heap_start =
max(heap_start, (
char *)
_end);
550 memmove(dtb, _dtb_start, dt_size);
563 asm (
" .globl _zimage_start\n\
566 rlwinm 10,10,0,~(1<<15) /* Clear MSR_EE */\n\
570 b _zimage_start_lib\n\