cu824.c 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /*
  2. * (C) Copyright 2001
  3. * Rob Taylor, Flying Pig Systems. robt@flyingpig.com.
  4. *
  5. * (C) Copyright 2001, 2002
  6. * Wolfgang Denk, DENX Software Engineering, <wd@denx.de>
  7. * See file CREDITS for list of people who contributed to this
  8. * project.
  9. *
  10. * This program is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU General Public License as
  12. * published by the Free Software Foundation; either version 2 of
  13. * the License, or (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, write to the Free Software
  22. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  23. * MA 02111-1307 USA
  24. */
  25. #include <common.h>
  26. #include <mpc824x.h>
  27. #include <asm/processor.h>
  28. #include <pci.h>
  29. #define BOARD_REV_REG 0xFE80002B
  30. int checkboard (void)
  31. {
  32. DECLARE_GLOBAL_DATA_PTR;
  33. char revision = *(volatile char *)(BOARD_REV_REG);
  34. char buf[32];
  35. puts ("Board: CU824 ");
  36. printf("Revision %d ", revision);
  37. printf("Local Bus at %s MHz\n", strmhz(buf, gd->bus_clk));
  38. return 0;
  39. }
  40. long int initdram(int board_type)
  41. {
  42. long size;
  43. long new_bank0_end;
  44. long mear1;
  45. long emear1;
  46. size = get_ram_size(CFG_SDRAM_BASE, CFG_MAX_RAM_SIZE);
  47. new_bank0_end = size - 1;
  48. mear1 = mpc824x_mpc107_getreg(MEAR1);
  49. emear1 = mpc824x_mpc107_getreg(EMEAR1);
  50. mear1 = (mear1 & 0xFFFFFF00) |
  51. ((new_bank0_end & MICR_ADDR_MASK) >> MICR_ADDR_SHIFT);
  52. emear1 = (emear1 & 0xFFFFFF00) |
  53. ((new_bank0_end & MICR_ADDR_MASK) >> MICR_EADDR_SHIFT);
  54. mpc824x_mpc107_setreg(MEAR1, mear1);
  55. mpc824x_mpc107_setreg(EMEAR1, emear1);
  56. return (size);
  57. }
  58. /*
  59. * Initialize PCI Devices, report devices found.
  60. */
  61. #ifndef CONFIG_PCI_PNP
  62. static struct pci_config_table pci_sandpoint_config_table[] = {
  63. { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, 0x0f, PCI_ANY_ID,
  64. pci_cfgfunc_config_device, { PCI_ENET0_IOADDR,
  65. PCI_ENET0_MEMADDR,
  66. PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER }},
  67. { }
  68. };
  69. #endif
  70. struct pci_controller hose = {
  71. #ifndef CONFIG_PCI_PNP
  72. config_table: pci_sandpoint_config_table,
  73. #endif
  74. };
  75. void pci_init_board(void)
  76. {
  77. pci_mpc824x_init(&hose);
  78. }