/**************************************************************************** **************************************************************************** Program440GP : ****************************************************************************/ static BDI_InitTypeT initList440GP[] = { {BDI_INIT_PPC_WSPR, 8007, 0x00000032}, // Wake-up delay 50 ms {BDI_INIT_PPC_WTLB, 0xF0000095, 0x1F00003F}, // TLB: Map Boot Space 256MB {BDI_INIT_PPC_WTLB, 0x00000098, 0x0000003F}, // TLB: Map SDRAM 256MB @ 0x00000000 {BDI_INIT_PPC_WDCR, 18, 0x00000010}, // Select EBC0_B0AP {BDI_INIT_PPC_WDCR, 19, 0x9B015480}, // B0AP: Flash and SRAM {BDI_INIT_PPC_WDCR, 18, 0x00000000}, // Select EBC0_B0CR {BDI_INIT_PPC_WDCR, 19, 0xFFF18000}, // B0CR: 1MB at 0xFFF00000, r/w, 8bit {BDI_INIT_PPC_WDCR, 16, 0x00000082}, // Select SDRAM0_CLKTR {BDI_INIT_PPC_WDCR, 17, 0x40000000}, // CLKTR: Advance 90 degrees {BDI_INIT_PPC_WDCR, 16, 0x00000080}, // Select SDRAM0_TR0 {BDI_INIT_PPC_WDCR, 17, 0x41054009}, // TR0: {BDI_INIT_PPC_WDCR, 16, 0x00000081}, // Select SDRAM0_TR1 {BDI_INIT_PPC_WDCR, 17, 0x40400800}, // TR1: {BDI_INIT_PPC_WDCR, 16, 0x00000040}, // Select SDRAM0_B0CR {BDI_INIT_PPC_WDCR, 17, 0x000A4001}, // B0CR: {BDI_INIT_PPC_WDCR, 16, 0x00000030}, // Select SDRAM0_RTR {BDI_INIT_PPC_WDCR, 17, 0x06180000}, // RTR: {BDI_INIT_PPC_WDCR, 16, 0x00000020}, // Select SDRAM0_CFG0 {BDI_INIT_PPC_WDCR, 17, 0x06000000}, // CFG0: 64bit, PMU disable {BDI_INIT_PPC_WDCR, 17, 0x86000000} // CFG0: enable SDRAM }; static int Program440GP(void) { int result; DWORD errorAddr; result = BDI_FlashSetType(BDI_FLASH_AM29F0X0, 0x80000, 0, 8, 0x00001000); result = BDI_TargetStartup(100, // 100ms reset time (3<<8) | 1, // PPC440, 8.3 MHz JTAG clock sizeof initList440GP / sizeof initList440GP[0], initList440GP); /* erase flash */ printf("erasing ... "); if (result == BDI_OKAY) result = BDI_FlashEraseSector(0xfff80000); if (result == BDI_OKAY) result = BDI_FlashEraseSector(0xfff90000); if (result == BDI_OKAY) result = BDI_FlashEraseSector(0xfffa0000); if (result == BDI_OKAY) result = BDI_FlashEraseSector(0xfffb0000); if (result == BDI_OKAY) result = BDI_FlashEraseSector(0xfffc0000); if (result == BDI_OKAY) result = BDI_FlashEraseSector(0xfffd0000); if (result == BDI_OKAY) result = BDI_FlashEraseSector(0xfffe0000); if (result == BDI_OKAY) result = BDI_FlashEraseSector(0xffff0000); if (result != BDI_OKAY) return result; printf("passed\n"); printf("programming..."); result = BDI_FlashWriteFile("D:/abatron/bdi360/ppc400/pro/evb440gp.sss", &errorAddr); if (result != BDI_OKAY) return result; printf("passed\n"); printf("verifing... "); result = BDI_VerifyFile("D:/abatron/bdi360/ppc400/pro/evb440gp.sss", &errorAddr); printf("passed\n"); return result; } /* Program440GP */