AT91EB55.setup 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*********************************************************************
  2. *
  3. * JLink setup file - Generated by J-Flash ARM V2.16b
  4. *
  5. * Syntax:
  6. * SetJTAGSpeed(x); // Sets the JTAG speed, x = speed in kHz (0 = Auto)
  7. * Delay(x); // Waits a given time, x = delay in milliseconds
  8. * DisableMMU(); // Disables the MMU
  9. * Go(); // Starts the ARM core
  10. * Halt(); // Halts the ARM core
  11. * Reset(x); // Resets the target, x = delay in milliseconds
  12. * ResetBP0(x); // Resets the target using breakpoint at address 0
  13. * ResetADI(x); // Resets the target using ADI software reset
  14. * Read8(Addr); // Reads a 8/16/32 bit value,
  15. * Read16(Addr); // Addr = address to read (as hex value)
  16. * Read32(Addr);
  17. * Verify8(Addr, Data); // Verifies a 8/16/32 bit value,
  18. * Verify16(Addr, Data); // Addr = address to verify (as hex value)
  19. * Verify32(Addr, Data); // Data = data to verify (as hex value)
  20. * Write8(Addr, Data); // Writes a 8/16/32 bit value,
  21. * Write16(Addr, Data); // Addr = address to write (as hex value)
  22. * Write32(Addr, Data); // Data = data to write (as hex value)
  23. * WriteVerify8(Addr, Data); // Writes and verifies a 8/16/32 bit value,
  24. * WriteVerify16(Addr, Data); // Addr = address to write (as hex value)
  25. * WriteVerify32(Addr, Data); // Data = data to write (as hex value)
  26. * WriteRegister(Reg, Data); // Writes a register
  27. * WriteJTAG_IR(Cmd); // Writes the JTAG instruction register
  28. * WriteJTAG_DR(nBits, Data); // Writes the JTAG data register
  29. *
  30. **********************************************************************
  31. */
  32. SetJTAGSpeed(30);
  33. //Reset(0); // Reset target
  34. Write32(0xFFFF4020, 0x002F0002); // MOSCEN = 1, OSCOUNT = 47
  35. Delay(20); // Wait for PLL
  36. Write32(0xFFFF4020, 0x032F4002); // Setup PLL to 16MHz
  37. Delay(20); // Wait for PLL
  38. Write32(0xFFFF4020, 0x032F4102); // Setup PLL to 16MHz
  39. Delay(20); // Wait for PLL
  40. Write32(0xFFFF4020, 0x032F8102); // 16Mhz -> 32MHz
  41. Delay(20); // Wait for PLL
  42. Write32(0xFFE00018, 0x27A80020); // AIC set to protected mode
  43. Write32(0xFFE00000, 0x01002529); // Set up CS0 (Flash)
  44. Write32(0xFFE00004, 0x02002121); // Set up CS1 (RAM)
  45. Write32(0xFFE00020, 0x00000001); // Remap internal RAM
  46. Write32(0xffe00024, 0x00000006); // 2M bytes per Chip Select
  47. SetJTAGSpeed(4000);