r7780mp.c 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. * Copyright (C) 2007,2008 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
  3. * Copyright (C) 2008 Yusuke Goda <goda.yusuke@renesas.com>
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License as
  7. * published by the Free Software Foundation; either version 2 of
  8. * the License, or (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  18. * MA 02111-1307 USA
  19. */
  20. #include <common.h>
  21. #include <ide.h>
  22. #include <asm/processor.h>
  23. #include <asm/io.h>
  24. #include <asm/pci.h>
  25. #include "r7780mp.h"
  26. int checkboard(void)
  27. {
  28. #if defined(CONFIG_R7780MP)
  29. puts("BOARD: Renesas Solutions R7780MP\n");
  30. #else
  31. puts("BOARD: Renesas Solutions R7780RP\n");
  32. #endif
  33. return 0;
  34. }
  35. int board_init(void)
  36. {
  37. /* SCIF Enable */
  38. *(vu_short*)PHCR = 0x0000;
  39. return 0;
  40. }
  41. int dram_init (void)
  42. {
  43. DECLARE_GLOBAL_DATA_PTR;
  44. gd->bd->bi_memstart = CFG_SDRAM_BASE;
  45. gd->bd->bi_memsize = CFG_SDRAM_SIZE;
  46. printf("DRAM: %dMB\n", CFG_SDRAM_SIZE / (1024 * 1024));
  47. return 0;
  48. }
  49. void led_set_state (unsigned short value)
  50. {
  51. }
  52. void ide_set_reset (int idereset)
  53. {
  54. /* if reset = 1 IDE reset will be asserted */
  55. if (idereset){
  56. (*(vu_short *)FPGA_CFCTL) = 0x432;
  57. #if defined(CONFIG_R7780MP)
  58. (*(vu_short *)FPGA_CFPOW) |= 0x01;
  59. #else
  60. (*(vu_short *)FPGA_CFPOW) |= 0x02;
  61. #endif
  62. (*(vu_short *)FPGA_CFCDINTCLR) = 0x01;
  63. }
  64. }
  65. #if defined(CONFIG_PCI)
  66. static struct pci_controller hose;
  67. void pci_init_board(void)
  68. {
  69. pci_sh7780_init( &hose );
  70. }
  71. #endif