3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5 * See file CREDITS for list of people who contributed to this
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.
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.
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,
33 u32 pcippc2_fpga0_phys
;
34 u32 pcippc2_fpga1_phys
;
36 void pcippc2_fpga_init (void)
38 pci_dev_t bdf
= pci_find_device(FPGA_VENDOR_ID
, FPGA_DEVICE_ID
, 0);
44 puts("Unable to find FPGA !\n");
48 pci_read_config_word(bdf
, PCI_COMMAND
, &cmd
);
49 if ((cmd
& (PCI_COMMAND_MEMORY
| PCI_COMMAND_IO
)) != (PCI_COMMAND_MEMORY
| PCI_COMMAND_IO
))
51 puts("FPGA is not configured !\n");
55 pci_read_config_dword(bdf
, PCI_BASE_ADDRESS_0
, &addr
);
60 pcippc2_fpga0_phys
= pci_io_to_phys(bdf
, addr
& 0xfffffffc);
66 pcippc2_fpga0_phys
= pci_mem_to_phys(bdf
, addr
& 0xfffffff0);
69 pci_read_config_dword(bdf
, PCI_BASE_ADDRESS_1
, &addr
);
74 pcippc2_fpga1_phys
= pci_io_to_phys(bdf
, addr
& 0xfffffffc);
80 pcippc2_fpga1_phys
= pci_mem_to_phys(bdf
, addr
& 0xfffffff0);
83 /* Interrupts are not used
85 out32(FPGA(INT
, INTR_MASK
), 0xffffffff);