musenki.c 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /*
  2. * (C) Copyright 2001
  3. * Rob Taylor, Flying Pig Systems. robt@flyingpig.com.
  4. *
  5. * See file CREDITS for list of people who contributed to this
  6. * project.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21. * MA 02111-1307 USA
  22. */
  23. #include <common.h>
  24. #include <mpc824x.h>
  25. #include <pci.h>
  26. #include <netdev.h>
  27. int checkboard (void)
  28. {
  29. ulong busfreq = get_bus_freq(0);
  30. char buf[32];
  31. printf("Board: MUSENKI Local Bus at %s MHz\n", strmhz(buf, busfreq));
  32. return 0;
  33. }
  34. #if 0 /* NOT USED */
  35. int checkflash (void)
  36. {
  37. /* TODO: XXX XXX XXX */
  38. printf ("## Test not implemented yet ##\n");
  39. return (0);
  40. }
  41. #endif
  42. phys_size_t initdram (int board_type)
  43. {
  44. long size;
  45. long new_bank0_end;
  46. long mear1;
  47. long emear1;
  48. size = get_ram_size(CONFIG_SYS_SDRAM_BASE, CONFIG_SYS_MAX_RAM_SIZE);
  49. new_bank0_end = size - 1;
  50. mear1 = mpc824x_mpc107_getreg(MEAR1);
  51. emear1 = mpc824x_mpc107_getreg(EMEAR1);
  52. mear1 = (mear1 & 0xFFFFFF00) |
  53. ((new_bank0_end & MICR_ADDR_MASK) >> MICR_ADDR_SHIFT);
  54. emear1 = (emear1 & 0xFFFFFF00) |
  55. ((new_bank0_end & MICR_ADDR_MASK) >> MICR_EADDR_SHIFT);
  56. mpc824x_mpc107_setreg(MEAR1, mear1);
  57. mpc824x_mpc107_setreg(EMEAR1, emear1);
  58. return (size);
  59. }
  60. /*
  61. * Initialize PCI Devices
  62. */
  63. #ifndef CONFIG_PCI_PNP
  64. static struct pci_config_table pci_sandpoint_config_table[] = {
  65. #if 0
  66. { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
  67. 0x0, 0x0, 0x0, /* unknown eth0 divice */
  68. pci_cfgfunc_config_device, { PCI_ENET0_IOADDR,
  69. PCI_ENET0_MEMADDR,
  70. PCI_COMMAND_IO |
  71. PCI_COMMAND_MEMORY |
  72. PCI_COMMAND_MASTER }},
  73. { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
  74. 0x0, 0x0, 0x0, /* unknown eth1 device */
  75. pci_cfgfunc_config_device, { PCI_ENET1_IOADDR,
  76. PCI_ENET1_MEMADDR,
  77. PCI_COMMAND_IO |
  78. PCI_COMMAND_MEMORY |
  79. PCI_COMMAND_MASTER }},
  80. #endif
  81. { }
  82. };
  83. #endif
  84. struct pci_controller hose = {
  85. #ifndef CONFIG_PCI_PNP
  86. config_table: pci_sandpoint_config_table,
  87. #endif
  88. };
  89. void pci_init_board(void)
  90. {
  91. pci_mpc824x_init(&hose);
  92. }
  93. int board_eth_init(bd_t *bis)
  94. {
  95. return pci_eth_init(bis);
  96. }