r7780mp.c 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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 <netdev.h>
  26. #include "r7780mp.h"
  27. int checkboard(void)
  28. {
  29. #if defined(CONFIG_R7780MP)
  30. puts("BOARD: Renesas Solutions R7780MP\n");
  31. #else
  32. puts("BOARD: Renesas Solutions R7780RP\n");
  33. #endif
  34. return 0;
  35. }
  36. int board_init(void)
  37. {
  38. /* SCIF Enable */
  39. writew(0x0, PHCR);
  40. return 0;
  41. }
  42. int dram_init(void)
  43. {
  44. DECLARE_GLOBAL_DATA_PTR;
  45. gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
  46. gd->bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE;
  47. printf("DRAM: %dMB\n", CONFIG_SYS_SDRAM_SIZE / (1024 * 1024));
  48. return 0;
  49. }
  50. void led_set_state(unsigned short value)
  51. {
  52. }
  53. void ide_set_reset(int idereset)
  54. {
  55. /* if reset = 1 IDE reset will be asserted */
  56. if (idereset) {
  57. writew(0x432, FPGA_CFCTL);
  58. #if defined(CONFIG_R7780MP)
  59. writew(inw(FPGA_CFPOW)|0x01, FPGA_CFPOW);
  60. #else
  61. writew(inw(FPGA_CFPOW)|0x02, FPGA_CFPOW);
  62. #endif
  63. writew(0x01, FPGA_CFCDINTCLR);
  64. }
  65. }
  66. static struct pci_controller hose;
  67. void pci_init_board(void)
  68. {
  69. pci_sh7780_init(&hose);
  70. }
  71. int board_eth_init(bd_t *bis)
  72. {
  73. return pci_eth_init(bis);
  74. }