pd67290.c 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /* pd67290.c - system configuration module for SPD67290
  2. *
  3. * See file CREDITS for list of people who contributed to this
  4. * project.
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License as
  8. * published by the Free Software Foundation; either version 2 of
  9. * the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  19. * MA 02111-1307 USA
  20. *
  21. * (C) 2004 DENX Software Engineering, Heiko Schocher <hs@denx.de>
  22. */
  23. #include <common.h>
  24. #include <malloc.h>
  25. #include <net.h>
  26. #include <asm/io.h>
  27. #include <pci.h>
  28. /* imports */
  29. #include <mpc824x.h>
  30. static struct pci_device_id supported[] = {
  31. {PCI_VENDOR_ID_CIRRUS, PCI_DEVICE_ID_CIRRUS_6729},
  32. {}
  33. };
  34. /***************************************************************************
  35. *
  36. * SPD67290Init -
  37. *
  38. * RETURNS: -1 on error, 0 if OK
  39. */
  40. int SPD67290Init (void)
  41. {
  42. pci_dev_t devno;
  43. int idx = 0; /* general index */
  44. ulong membaseCsr; /* base address of device memory space */
  45. /* find PD67290 device */
  46. if ((devno = pci_find_devices (supported, idx++)) < 0) {
  47. printf ("No PD67290 device found !!\n");
  48. return -1;
  49. }
  50. /* - 0xfe000000 see MPC 8245 Users Manual Adress Map B */
  51. membaseCsr = PCMCIA_IO_BASE - 0xfe000000;
  52. /* set base address */
  53. pci_write_config_dword (devno, PCI_BASE_ADDRESS_0, membaseCsr);
  54. /* enable mapped memory and IO addresses */
  55. pci_write_config_dword (devno,
  56. PCI_COMMAND,
  57. PCI_COMMAND_MEMORY |
  58. PCI_COMMAND_IO | PCI_COMMAND_WAIT);
  59. return 0;
  60. }