forked from Imagelibrary/rtems
GRPCI: fixed build warnings
This commit is contained in:
@@ -39,6 +39,7 @@ EXTRA_DIST += shared/timer/tlib.c
|
|||||||
EXTRA_DIST += shared/timer/tlib_ckinit.c
|
EXTRA_DIST += shared/timer/tlib_ckinit.c
|
||||||
|
|
||||||
# PCI bus
|
# PCI bus
|
||||||
|
EXTRA_DIST += shared/include/grpci.h
|
||||||
EXTRA_DIST += shared/include/grpci2.h
|
EXTRA_DIST += shared/include/grpci2.h
|
||||||
EXTRA_DIST += shared/pci/grpci.c
|
EXTRA_DIST += shared/pci/grpci.c
|
||||||
EXTRA_DIST += shared/pci/grpci2.c
|
EXTRA_DIST += shared/pci/grpci2.c
|
||||||
|
|||||||
@@ -97,6 +97,7 @@ libbsp_a_SOURCES += ../../sparc/shared/timer/gptimer.c
|
|||||||
libbsp_a_SOURCES += ../../sparc/shared/timer/tlib.c
|
libbsp_a_SOURCES += ../../sparc/shared/timer/tlib.c
|
||||||
|
|
||||||
# PCI
|
# PCI
|
||||||
|
include_HEADERS += ../../sparc/shared/include/grpci.h
|
||||||
include_HEADERS += ../../sparc/shared/include/grpci2.h
|
include_HEADERS += ../../sparc/shared/include/grpci2.h
|
||||||
libbsp_a_SOURCES += ../../sparc/shared/pci/grpci2.c
|
libbsp_a_SOURCES += ../../sparc/shared/pci/grpci2.c
|
||||||
libbsp_a_SOURCES += ../../sparc/shared/pci/grpci.c
|
libbsp_a_SOURCES += ../../sparc/shared/pci/grpci.c
|
||||||
|
|||||||
@@ -117,6 +117,10 @@ $(PROJECT_INCLUDE)/tlib.h: ../../sparc/shared/include/tlib.h $(PROJECT_INCLUDE)/
|
|||||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/tlib.h
|
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/tlib.h
|
||||||
PREINSTALL_FILES += $(PROJECT_INCLUDE)/tlib.h
|
PREINSTALL_FILES += $(PROJECT_INCLUDE)/tlib.h
|
||||||
|
|
||||||
|
$(PROJECT_INCLUDE)/grpci.h: ../../sparc/shared/include/grpci.h $(PROJECT_INCLUDE)/$(dirstamp)
|
||||||
|
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/grpci.h
|
||||||
|
PREINSTALL_FILES += $(PROJECT_INCLUDE)/grpci.h
|
||||||
|
|
||||||
$(PROJECT_INCLUDE)/grpci2.h: ../../sparc/shared/include/grpci2.h $(PROJECT_INCLUDE)/$(dirstamp)
|
$(PROJECT_INCLUDE)/grpci2.h: ../../sparc/shared/include/grpci2.h $(PROJECT_INCLUDE)/$(dirstamp)
|
||||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/grpci2.h
|
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/grpci2.h
|
||||||
PREINSTALL_FILES += $(PROJECT_INCLUDE)/grpci2.h
|
PREINSTALL_FILES += $(PROJECT_INCLUDE)/grpci2.h
|
||||||
|
|||||||
@@ -106,6 +106,7 @@ libbsp_a_SOURCES += \
|
|||||||
../../shared/src/irq-shell.c
|
../../shared/src/irq-shell.c
|
||||||
|
|
||||||
# PCI
|
# PCI
|
||||||
|
include_HEADERS += ../../sparc/shared/include/grpci.h
|
||||||
include_HEADERS += ../../sparc/shared/include/grpci2.h
|
include_HEADERS += ../../sparc/shared/include/grpci2.h
|
||||||
libbsp_a_SOURCES += ../../sparc/shared/pci/grpci.c
|
libbsp_a_SOURCES += ../../sparc/shared/pci/grpci.c
|
||||||
libbsp_a_SOURCES += ../../sparc/shared/pci/grpci2.c
|
libbsp_a_SOURCES += ../../sparc/shared/pci/grpci2.c
|
||||||
|
|||||||
@@ -133,6 +133,10 @@ $(PROJECT_INCLUDE)/bsp/irq.h: include/bsp/irq.h $(PROJECT_INCLUDE)/bsp/$(dirstam
|
|||||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/irq.h
|
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/irq.h
|
||||||
PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/irq.h
|
PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/irq.h
|
||||||
|
|
||||||
|
$(PROJECT_INCLUDE)/grpci.h: ../../sparc/shared/include/grpci.h $(PROJECT_INCLUDE)/$(dirstamp)
|
||||||
|
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/grpci.h
|
||||||
|
PREINSTALL_FILES += $(PROJECT_INCLUDE)/grpci.h
|
||||||
|
|
||||||
$(PROJECT_INCLUDE)/grpci2.h: ../../sparc/shared/include/grpci2.h $(PROJECT_INCLUDE)/$(dirstamp)
|
$(PROJECT_INCLUDE)/grpci2.h: ../../sparc/shared/include/grpci2.h $(PROJECT_INCLUDE)/$(dirstamp)
|
||||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/grpci2.h
|
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/grpci2.h
|
||||||
PREINSTALL_FILES += $(PROJECT_INCLUDE)/grpci2.h
|
PREINSTALL_FILES += $(PROJECT_INCLUDE)/grpci2.h
|
||||||
|
|||||||
31
c/src/lib/libbsp/sparc/shared/include/grpci.h
Normal file
31
c/src/lib/libbsp/sparc/shared/include/grpci.h
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
#ifndef __GRPCI_H__
|
||||||
|
#define __GRPCI_H__
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Register the GRPCI driver to the Driver Manager */
|
||||||
|
extern void grpci_register_drv(void);
|
||||||
|
|
||||||
|
/* Transfer data using GRPCI DMA unit from AMBA to PCI space. Blocks until
|
||||||
|
* operation completes.
|
||||||
|
*/
|
||||||
|
int grpci_dma_to_pci(
|
||||||
|
unsigned int ahb_addr,
|
||||||
|
unsigned int pci_addr,
|
||||||
|
unsigned int len);
|
||||||
|
|
||||||
|
/* Transfer data using GRPCI DMA unit from PCI to AMBA space. Blocks until
|
||||||
|
* operation completes.
|
||||||
|
*/
|
||||||
|
int grpci_dma_from_pci(
|
||||||
|
unsigned int ahb_addr,
|
||||||
|
unsigned int pci_addr,
|
||||||
|
unsigned int len);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -29,6 +29,7 @@
|
|||||||
#include <drvmgr/ambapp_bus.h>
|
#include <drvmgr/ambapp_bus.h>
|
||||||
#include <ambapp.h>
|
#include <ambapp.h>
|
||||||
#include <drvmgr/pci_bus.h>
|
#include <drvmgr/pci_bus.h>
|
||||||
|
#include <grpci.h>
|
||||||
|
|
||||||
#define DMAPCI_ADDR 0x80000500
|
#define DMAPCI_ADDR 0x80000500
|
||||||
|
|
||||||
@@ -166,7 +167,7 @@ void grpci_register_drv(void)
|
|||||||
drvmgr_drv_register(&grpci_info.general);
|
drvmgr_drv_register(&grpci_info.general);
|
||||||
}
|
}
|
||||||
|
|
||||||
int grpci_cfg_r32(pci_dev_t dev, int ofs, uint32_t *val)
|
static int grpci_cfg_r32(pci_dev_t dev, int ofs, uint32_t *val)
|
||||||
{
|
{
|
||||||
struct grpci_priv *priv = grpcipriv;
|
struct grpci_priv *priv = grpcipriv;
|
||||||
volatile uint32_t *pci_conf;
|
volatile uint32_t *pci_conf;
|
||||||
@@ -216,7 +217,7 @@ int grpci_cfg_r32(pci_dev_t dev, int ofs, uint32_t *val)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int grpci_cfg_r16(pci_dev_t dev, int ofs, uint16_t *val)
|
static int grpci_cfg_r16(pci_dev_t dev, int ofs, uint16_t *val)
|
||||||
{
|
{
|
||||||
uint32_t v;
|
uint32_t v;
|
||||||
int retval;
|
int retval;
|
||||||
@@ -230,7 +231,7 @@ int grpci_cfg_r16(pci_dev_t dev, int ofs, uint16_t *val)
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
int grpci_cfg_r8(pci_dev_t dev, int ofs, uint8_t *val)
|
static int grpci_cfg_r8(pci_dev_t dev, int ofs, uint8_t *val)
|
||||||
{
|
{
|
||||||
uint32_t v;
|
uint32_t v;
|
||||||
int retval;
|
int retval;
|
||||||
@@ -242,7 +243,7 @@ int grpci_cfg_r8(pci_dev_t dev, int ofs, uint8_t *val)
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
int grpci_cfg_w32(pci_dev_t dev, int ofs, uint32_t val)
|
static int grpci_cfg_w32(pci_dev_t dev, int ofs, uint32_t val)
|
||||||
{
|
{
|
||||||
struct grpci_priv *priv = grpcipriv;
|
struct grpci_priv *priv = grpcipriv;
|
||||||
volatile uint32_t *pci_conf;
|
volatile uint32_t *pci_conf;
|
||||||
@@ -284,7 +285,7 @@ int grpci_cfg_w32(pci_dev_t dev, int ofs, uint32_t val)
|
|||||||
return PCISTS_OK;
|
return PCISTS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int grpci_cfg_w16(pci_dev_t dev, int ofs, uint16_t val)
|
static int grpci_cfg_w16(pci_dev_t dev, int ofs, uint16_t val)
|
||||||
{
|
{
|
||||||
uint32_t v;
|
uint32_t v;
|
||||||
int retval;
|
int retval;
|
||||||
@@ -301,7 +302,7 @@ int grpci_cfg_w16(pci_dev_t dev, int ofs, uint16_t val)
|
|||||||
return grpci_cfg_w32(dev, ofs & ~0x3, v);
|
return grpci_cfg_w32(dev, ofs & ~0x3, v);
|
||||||
}
|
}
|
||||||
|
|
||||||
int grpci_cfg_w8(pci_dev_t dev, int ofs, uint8_t val)
|
static int grpci_cfg_w8(pci_dev_t dev, int ofs, uint8_t val)
|
||||||
{
|
{
|
||||||
uint32_t v;
|
uint32_t v;
|
||||||
int retval;
|
int retval;
|
||||||
@@ -324,7 +325,7 @@ int grpci_cfg_w8(pci_dev_t dev, int ofs, uint8_t val)
|
|||||||
* Returns the "system IRQ" for the PCI INTA#..INTD# pin in irq_pin. Returns
|
* Returns the "system IRQ" for the PCI INTA#..INTD# pin in irq_pin. Returns
|
||||||
* 0xff if not assigned.
|
* 0xff if not assigned.
|
||||||
*/
|
*/
|
||||||
uint8_t grpci_bus0_irq_map(pci_dev_t dev, int irq_pin)
|
static uint8_t grpci_bus0_irq_map(pci_dev_t dev, int irq_pin)
|
||||||
{
|
{
|
||||||
uint8_t sysIrqNr = 0; /* not assigned */
|
uint8_t sysIrqNr = 0; /* not assigned */
|
||||||
int irq_group;
|
int irq_group;
|
||||||
@@ -339,7 +340,7 @@ uint8_t grpci_bus0_irq_map(pci_dev_t dev, int irq_pin)
|
|||||||
return sysIrqNr;
|
return sysIrqNr;
|
||||||
}
|
}
|
||||||
|
|
||||||
int grpci_translate(uint32_t *address, int type, int dir)
|
static int grpci_translate(uint32_t *address, int type, int dir)
|
||||||
{
|
{
|
||||||
uint32_t adr;
|
uint32_t adr;
|
||||||
struct grpci_priv *priv = grpcipriv;
|
struct grpci_priv *priv = grpcipriv;
|
||||||
@@ -427,7 +428,7 @@ struct pci_io_ops grpci_io_ops_be =
|
|||||||
_st_be32,
|
_st_be32,
|
||||||
};
|
};
|
||||||
|
|
||||||
int grpci_hw_init(struct grpci_priv *priv)
|
static int grpci_hw_init(struct grpci_priv *priv)
|
||||||
{
|
{
|
||||||
volatile unsigned int *mbar0, *page0;
|
volatile unsigned int *mbar0, *page0;
|
||||||
uint32_t data, addr, mbar0size;
|
uint32_t data, addr, mbar0size;
|
||||||
@@ -501,7 +502,7 @@ int grpci_hw_init(struct grpci_priv *priv)
|
|||||||
* -3 Error due to GRPCI hardware initialization
|
* -3 Error due to GRPCI hardware initialization
|
||||||
* -4 Error registering driver to PCI layer
|
* -4 Error registering driver to PCI layer
|
||||||
*/
|
*/
|
||||||
int grpci_init(struct grpci_priv *priv)
|
static int grpci_init(struct grpci_priv *priv)
|
||||||
{
|
{
|
||||||
struct ambapp_apb_info *apb;
|
struct ambapp_apb_info *apb;
|
||||||
struct ambapp_ahb_info *ahb;
|
struct ambapp_ahb_info *ahb;
|
||||||
@@ -673,7 +674,11 @@ int grpci_init1(struct drvmgr_dev *dev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* DMA functions which uses GRPCIs optional DMA controller (len in words) */
|
/* DMA functions which uses GRPCIs optional DMA controller (len in words) */
|
||||||
int grpci_dma_to_pci(unsigned int ahb_addr, unsigned int pci_addr, unsigned int len) {
|
int grpci_dma_to_pci(
|
||||||
|
unsigned int ahb_addr,
|
||||||
|
unsigned int pci_addr,
|
||||||
|
unsigned int len)
|
||||||
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
pcidma[0] = 0x82;
|
pcidma[0] = 0x82;
|
||||||
@@ -694,7 +699,11 @@ int grpci_dma_to_pci(unsigned int ahb_addr, unsigned int pci_addr, unsigned int
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int grpci_dma_from_pci(unsigned int ahb_addr, unsigned int pci_addr, unsigned int len) {
|
int grpci_dma_from_pci(
|
||||||
|
unsigned int ahb_addr,
|
||||||
|
unsigned int pci_addr,
|
||||||
|
unsigned int len)
|
||||||
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
pcidma[0] = 0x80;
|
pcidma[0] = 0x80;
|
||||||
|
|||||||
Reference in New Issue
Block a user