/**************************************************************************** **************************************************************************** ProgramMPC860 : INPUT : - OUTPUT : RETURN error code ****************************************************************************/ #define MPC860_CLOCK 20000000 #define MPC860_WORKSPACE 0x02202000 static BDI_InitTypeT mpc860InitList[] = { {BDI_INIT_PPC_WSPR, 638, 0x02200000}, // IMMR : internal memory at 0x02200000 {BDI_INIT_PPC_WSPR, 158, 0x00000007}, // ICTRL: {BDI_INIT_PPC_WM32, 0x02200000, 0x01632440}, // SIUMCR {BDI_INIT_PPC_WM32, 0x02200004, 0xFFFFFF88}, // SYPCR {BDI_INIT_PPC_WM32, 0x02200200, 0xFFE00D34}, // OR0 : 2MB, all accesses, CS early negate, 6ws, time relax {BDI_INIT_PPC_WM32, 0x02200320, 0x02800001}, // BR0 }; static int ProgramMPC860(void) { int result; DWORD errorAddr; result = BDI_FlashSetType(BDI_FLASH_AM29FX00W, 0x800000, 0, 32, MPC860_WORKSPACE); result = BDI_TargetStartup(0, MPC860_CLOCK, sizeof mpc860InitList / sizeof mpc860InitList[0], mpc860InitList); result = BDI_FlashEraseSector(0x02800000); result = BDI_FlashEraseSector(0x02840000); result = BDI_FlashEraseSector(0x02880000); result = BDI_FlashEraseSector(0x028c0000); result = BDI_FlashWriteFile("e:/temp/mydata.sss", &errorAddr); result = BDI_VerifyFile("e:/temp/mydata.sss", &errorAddr); return result; } /* ProgramMPC860 */ /**************************************************************************** **************************************************************************** ProgramTQM855 : INPUT : - OUTPUT : RETURN error code ****************************************************************************/ #define TQM855_CLOCK 80000000 #define TQM855_WORKSPACE 0xFFF02000 static BDI_InitTypeT tqm855InitList[] = { {BDI_INIT_PPC_WSPR, 27, 0x00001002}, // SRR1 : ME,RI {BDI_INIT_PPC_WSPR, 638, 0xFFF00000}, // IMMR : internal memory at 0xFFF00000 {BDI_INIT_PPC_WSPR, 158, 0x00000007}, // ICTRL: {BDI_INIT_PPC_WM32, 0xFFF00000, 0x01610400}, // SIUMCR {BDI_INIT_PPC_WM32, 0xFFF00004, 0xFFFFFF88}, // SYPCR {BDI_INIT_PPC_WM32, 0xFFF00104, 0xFFC00F52}, // OR0: Flash 4MB, all accesses, CS early negate, 5ws, extended hold {BDI_INIT_PPC_WM32, 0xFFF00100, 0x00000001}, // BR0: Flash at 0x0000000, 32bit, R/W, no parity, use GPCM }; static int ProgramTQM855(void) { int result; DWORD errorAddr; result = BDI_FlashSetType(BDI_FLASH_AM29BX16, 0x200000, 0, 32, TQM855_WORKSPACE); if (result != BDI_OKAY) return result; result = BDI_TargetStartup(0, TQM855_CLOCK, sizeof tqm855InitList / sizeof tqm855InitList[0], tqm855InitList); if (result != BDI_OKAY) return result; printf("erasing ..."); result = BDI_FlashEraseSector(0x00000000); if (result != BDI_OKAY) return result; result = BDI_FlashEraseSector(0x00008000); if (result != BDI_OKAY) return result; result = BDI_FlashEraseSector(0x0000c000); if (result != BDI_OKAY) return result; result = BDI_FlashEraseSector(0x00010000); if (result != BDI_OKAY) return result; result = BDI_FlashEraseSector(0x00020000); if (result != BDI_OKAY) return result; result = BDI_FlashEraseSector(0x00040000); if (result != BDI_OKAY) return result; result = BDI_FlashEraseSector(0x00060000); if (result != BDI_OKAY) return result; result = BDI_FlashEraseSector(0x00080000); if (result != BDI_OKAY) return result; result = BDI_FlashEraseSector(0x000A0000); if (result != BDI_OKAY) return result; result = BDI_FlashEraseSector(0x000C0000); if (result != BDI_OKAY) return result; result = BDI_FlashEraseSector(0x000E0000); if (result != BDI_OKAY) return result; printf("passed\n"); printf("programming..."); result = BDI_FlashWriteFile("D:/abatron/bdi360/ppc/pro/tqm855.sss", &errorAddr); if (result != BDI_OKAY) return result; printf("passed\n"); printf("verifing ..."); result = BDI_VerifyFile("D:/abatron/bdi360/ppc/pro/tqm855.sss", &errorAddr); if (result != BDI_OKAY) return result; printf("passed\n"); return result; } /* ProgramTQM855 */