ppmc7xx.c 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /*
  2. * ppmc7xx.c
  3. * ---------
  4. *
  5. * Main board-specific routines for Wind River PPMC 7xx/74xx board.
  6. *
  7. * By Richard Danter (richard.danter@windriver.com)
  8. * Copyright (C) 2005 Wind River Systems
  9. */
  10. #include <common.h>
  11. #include <command.h>
  12. /* Define some MPC107 (memory controller) registers */
  13. #define MPC107_EUMB_GCR 0xfce41020
  14. #define MPC107_EUMB_IACKR 0xfce600a0
  15. /* Function prototypes */
  16. extern void unlock_ram_in_cache( void );
  17. extern void _start_warm(void);
  18. /*
  19. * initdram()
  20. *
  21. * This function normally initialises the (S)DRAM of the system. For this board
  22. * the SDRAM was already initialised by board_asm_init (see init.S) so we just
  23. * return the size of RAM.
  24. */
  25. long initdram( int board_type )
  26. {
  27. return CFG_SDRAM_SIZE;
  28. }
  29. /*
  30. * after_reloc()
  31. *
  32. * This is called after U-Boot has been copied from Flash/ROM to RAM. It gives
  33. * us an opportunity to do some additional setup before the rest of the system
  34. * is initialised. We don't need to do anything, so we just call board_init_r()
  35. * which should never return.
  36. */
  37. void after_reloc( ulong dest_addr, gd_t* gd )
  38. {
  39. /* Jump to the main U-Boot board init code */
  40. board_init_r( gd, dest_addr );
  41. }
  42. /*
  43. * checkboard()
  44. *
  45. * We could do some board level checks here, such as working out what version
  46. * it is, but for this board we simply display it's name (on the console).
  47. */
  48. int checkboard( void )
  49. {
  50. puts( "Board: Wind River PPMC 7xx/74xx\n" );
  51. return 0;
  52. }
  53. /*
  54. * misc_init_r
  55. *
  56. * Used for other setup which needs to be done late in the bring-up phase.
  57. */
  58. int misc_init_r( void )
  59. {
  60. /* Reset the EPIC and clear pending interrupts */
  61. out32r(MPC107_EUMB_GCR, 0xa0000000);
  62. while( in32r( MPC107_EUMB_GCR ) & 0x80000000 );
  63. out32r( MPC107_EUMB_GCR, 0x20000000 );
  64. while( in32r( MPC107_EUMB_IACKR ) != 0xff );
  65. /* Enable the I-Cache */
  66. icache_enable();
  67. return 0;
  68. }
  69. /*
  70. * do_reset()
  71. *
  72. * Shell command to reset the board.
  73. */
  74. void do_reset( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[] )
  75. {
  76. printf( "Resetting...\n" );
  77. /* Disabe and invalidate cache */
  78. icache_disable();
  79. dcache_disable();
  80. /* Jump to warm start (in RAM) */
  81. _start_warm();
  82. /* Should never get here */
  83. while(1);
  84. }