ppmc7xx.c 2.2 KB

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