📄 pcifpga.h
字号:
/***************************************** Copyright (c) 2003-2004 Sigma Designs, Inc. All Rights Reserved Proprietary and Confidential *****************************************//* This file is part of the EM86XX boot loader *//* * pcifpga.c * * PCI through specially designed FPGA * * by Ho Lee 07/14/2003 */#ifndef __BOOTLOADER_PCIFPGA_H#define __BOOTLOADER_PCIFPGA_H#include "pcicommon.h"//// PCI FPGA specific// #define PCIFPGA_IDSEL_FIRST 0x00#define PCIFPGA_IDSEL_MAX 0x04#define PCIFPGA_BASE MEMORY_BASE_HOST_PB3// Registers#define PCIFPGA_ISR 0x00#define PCIFPGA_READADDR 0x04#define PCIFPGA_READLEN 0x08#define PCIFPGA_WRITEADDR 0x0c#define PCIFPGA_WRITELEN 0x10#define PCIFPGA_SCRATCH 0x14#define PCIFPGA_VERSION 0x18#define PCIFPGA_BYTEENABLE 0x1c#define PCIFPGA_MEMORYBASE 0x20#define PCIFPGA_MEMORYMASK 0x24#define PCIFPGA_IOBASE 0x28#define PCIFPGA_IOMASK 0x2c#define PCIFPGA_WRITEDWORDDATA 0x30#define PCIFPGA_WRITEDWORDCMD 0x34#define PCIFPGA_WRITEDWORDADDR 0x38#define PCIFPGA_IDEREADDATA 0x0100#define PCIFPGA_PCIREADRESPONSEDATA 0x0200#define PCIFPGA_PCIWRITEDATA 0x0300#define PCIFPGA_CONFIG_BASE_0 0x00001000#define PCIFPGA_CONFIG_BASE_1 0x00002000#define PCIFPGA_CONFIG_BASE_2 0x00003000#define PCIFPGA_CONFIG_BASE_3 0x00004000#define PCIFPGA_CONFIG_END 0x00005000#define PCIFPGA_IOBASE_ADDR 0x00080000#define PCIFPGA_IOBASE_VALID 0x01080000#define PCIFPGA_IOBASE_MASK 0x00f80000#define PCIFPGA_IOBASE_SIZE 0x00080000#define PCIFPGA_MEMORYBASE_ADDR 0x00200000#define PCIFPGA_MEMORYBASE_VALID 0x01200000#define PCIFPGA_MEMORYBASE_MASK 0x00f00000#define PCIFPGA_MEMORYBASE_SIZE 0x00300000#define PCIFPGA_IO_BASE (0xef000000 + PCIFPGA_IOBASE_ADDR)#define PCIFPGA_IO_END (PCIFPGA_IO_BASE + PCIFPGA_IOBASE_SIZE)#define PCIFPGA_MEMORY_BASE (0xef000000 + PCIFPGA_MEMORYBASE_ADDR)#define PCIFPGA_MEMORY_END (PCIFPGA_MEMORY_BASE + PCIFPGA_MEMORYBASE_SIZE)// PCIFPGA_ISR#define PCIFPGA_ISR_WRREQ 0x0001#define PCIFPGA_ISR_RDREQ 0x0002#define PCIFPGA_ISR_RDRESP 0x0004#define PCIFPGA_ISR_INTA 0x0008#define PCIFPGA_ISR_INTB 0x0010#define PCIFPGA_ISR_INTC 0x0020#define PCIFPGA_ISR_INTD 0x0040#define PCIFPGA_ISR_INTMASK 0x0078#define PCIFPGA_ISR_ERROR 0x0080#define PCIFPGA_ISR_MASTERABORT 0x0100//// global variables//struct my_pci_op g_pcifpga_op;//// function prototypes//// pci bus initializationint pcifpga_init(int verbose);int pcifpga_probe(void);// basic functionsint pcifpga_info(void);unsigned int pcifpga_pciio_base(int idsel);unsigned int pcifpga_pcimemory_base(int idsel);unsigned int pcifpga_select(int idsel);int pcifpga_wait_isr(int wait);// primitive PCI Config Accessunsigned int pcifpga_select(int idsel);int pcifpga_read_config_byte(unsigned int addr, unsigned char *data);int pcifpga_read_config_word(unsigned int addr, unsigned short *data);int pcifpga_read_config_dword(unsigned int addr, unsigned int *data);int pcifpga_write_config_byte(unsigned int data, unsigned int addr);int pcifpga_write_config_word(unsigned int data, unsigned int addr);int pcifpga_write_config_dword(unsigned int data, unsigned int addr);// primitive PCI I/O Accessunsigned char pcifpga_in_byte(unsigned int addr);unsigned short pcifpga_in_word(unsigned int addr);unsigned int pcifpga_in_dword(unsigned int addr);void pcifpga_out_byte(unsigned int data, unsigned int addr);void pcifpga_out_word(unsigned int data, unsigned int addr);void pcifpga_out_dword(unsigned int data, unsigned int addr);// primitive PCI Memory Accessunsigned char pcifpga_read_byte(unsigned int addr);unsigned short pcifpga_read_word(unsigned int addr);unsigned int pcifpga_read_dword(unsigned int addr);void pcifpga_write_byte(unsigned int data, unsigned int addr);void pcifpga_write_word(unsigned int data, unsigned int addr);void pcifpga_write_dword(unsigned int data, unsigned int addr);// pci bus testint pcifpga_test(int argc, char *argv[]);#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -