From 05ce8bd51bc36d8c6527af2ab309512519ba1889 Mon Sep 17 00:00:00 2001 From: Daniel Hellstrom Date: Tue, 10 Feb 2015 08:32:42 +0100 Subject: AT697PCI: fix build warnings --- c/src/lib/libbsp/sparc/leon2/Makefile.am | 1 + c/src/lib/libbsp/sparc/leon2/include/at697_pci.h | 26 ++++++++++++++++++++++++ c/src/lib/libbsp/sparc/leon2/pci/at697_pci.c | 24 +++++++++++----------- c/src/lib/libbsp/sparc/leon2/preinstall.am | 4 ++++ 4 files changed, 43 insertions(+), 12 deletions(-) create mode 100644 c/src/lib/libbsp/sparc/leon2/include/at697_pci.h (limited to 'c/src') diff --git a/c/src/lib/libbsp/sparc/leon2/Makefile.am b/c/src/lib/libbsp/sparc/leon2/Makefile.am index 7f1a19fa30..3f2cd9fc88 100644 --- a/c/src/lib/libbsp/sparc/leon2/Makefile.am +++ b/c/src/lib/libbsp/sparc/leon2/Makefile.am @@ -101,6 +101,7 @@ libbsp_a_SOURCES += ../../sparc/shared/timer/tlib.c include_HEADERS += ../../sparc/shared/include/grpci.h include_HEADERS += ../../sparc/shared/include/grpci2.h include_HEADERS += ../../sparc/shared/include/pcif.h +include_HEADERS += include/at697_pci.h libbsp_a_SOURCES += ../../sparc/shared/pci/grpci2.c libbsp_a_SOURCES += ../../sparc/shared/pci/grpci.c libbsp_a_SOURCES += ../../sparc/shared/pci/pcif.c diff --git a/c/src/lib/libbsp/sparc/leon2/include/at697_pci.h b/c/src/lib/libbsp/sparc/leon2/include/at697_pci.h new file mode 100644 index 0000000000..d114db7e84 --- /dev/null +++ b/c/src/lib/libbsp/sparc/leon2/include/at697_pci.h @@ -0,0 +1,26 @@ +/* AT697 PCI host bridge driver + * + * COPYRIGHT (c) 2015. + * Cobham Gaisler. + * + * The license and distribution terms for this file may be + * found in found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + * + */ + +#ifndef __AT697PCI_H__ +#define __AT697PCI_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Register AT697 PCI host bridge driver to Driver Manager */ +void at697pci_register_drv(void); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/c/src/lib/libbsp/sparc/leon2/pci/at697_pci.c b/c/src/lib/libbsp/sparc/leon2/pci/at697_pci.c index 423fadaa34..bfa7f13829 100644 --- a/c/src/lib/libbsp/sparc/leon2/pci/at697_pci.c +++ b/c/src/lib/libbsp/sparc/leon2/pci/at697_pci.c @@ -43,6 +43,7 @@ #include #include +#include #include /* Configuration options */ @@ -217,7 +218,7 @@ void at697pci_register_drv(void) * AT697 pci controller to be able access all slots */ -int at697pci_cfg_r32(pci_dev_t dev, int offset, uint32_t *val) +static int at697pci_cfg_r32(pci_dev_t dev, int offset, uint32_t *val) { struct at697pci_regs *regs; volatile unsigned int data = 0; @@ -268,7 +269,7 @@ int at697pci_cfg_r32(pci_dev_t dev, int offset, uint32_t *val) return retval; } -int at697pci_cfg_r16(pci_dev_t dev, int ofs, uint16_t *val) +static int at697pci_cfg_r16(pci_dev_t dev, int ofs, uint16_t *val) { uint32_t v; int retval; @@ -282,7 +283,7 @@ int at697pci_cfg_r16(pci_dev_t dev, int ofs, uint16_t *val) return retval; } -int at697pci_cfg_r8(pci_dev_t dev, int ofs, uint8_t *val) +static int at697pci_cfg_r8(pci_dev_t dev, int ofs, uint8_t *val) { uint32_t v; int retval; @@ -294,7 +295,7 @@ int at697pci_cfg_r8(pci_dev_t dev, int ofs, uint8_t *val) return retval; } -int at697pci_cfg_w32(pci_dev_t dev, int offset, uint32_t val) +static int at697pci_cfg_w32(pci_dev_t dev, int offset, uint32_t val) { struct at697pci_regs *regs; volatile unsigned int tmp_val = val; @@ -340,7 +341,7 @@ int at697pci_cfg_w32(pci_dev_t dev, int offset, uint32_t val) return retval; } -int at697pci_cfg_w16(pci_dev_t dev, int ofs, uint16_t val) +static int at697pci_cfg_w16(pci_dev_t dev, int ofs, uint16_t val) { uint32_t v; int retval; @@ -357,7 +358,7 @@ int at697pci_cfg_w16(pci_dev_t dev, int ofs, uint16_t val) return at697pci_cfg_w32(dev, ofs & ~0x3, v); } -int at697pci_cfg_w8(pci_dev_t dev, int ofs, uint8_t val) +static int at697pci_cfg_w8(pci_dev_t dev, int ofs, uint8_t val) { uint32_t v; @@ -377,7 +378,7 @@ int at697pci_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 * 0xff if not assigned. */ -uint8_t at697pci_bus0_irq_map(pci_dev_t dev, int irq_pin) +static uint8_t at697pci_bus0_irq_map(pci_dev_t dev, int irq_pin) { uint8_t sysIrqNr = 0; /* not assigned */ int irq_group; @@ -392,7 +393,7 @@ uint8_t at697pci_bus0_irq_map(pci_dev_t dev, int irq_pin) return sysIrqNr; } -int at697pci_translate(uint32_t *address, int type, int dir) +static int at697pci_translate(uint32_t *address, int type, int dir) { /* No address translation implmented at this point */ return 0; @@ -401,7 +402,7 @@ int at697pci_translate(uint32_t *address, int type, int dir) extern struct pci_memreg_ops pci_memreg_sparc_be_ops; /* AT697 Big-Endian PCI access routines */ -struct pci_access_drv at697pci_access_drv = { +static struct pci_access_drv at697pci_access_drv = { .cfg = { at697pci_cfg_r8, @@ -428,11 +429,10 @@ struct pci_access_drv at697pci_access_drv = { /* Initializes the AT697PCI core hardware * */ -int at697pci_hw_init(struct at697pci_priv *priv) +static int at697pci_hw_init(struct at697pci_priv *priv) { struct at697pci_regs *regs = priv->regs; unsigned short vendor = regs->pciid1 >> 16; - pci_dev_t host = PCI_DEV(0, 0, 0); /* Must match ATMEL or ESA ID */ if ( !((vendor == 0x1202) || (vendor == 0x1E0F)) ) { @@ -477,7 +477,7 @@ int at697pci_hw_init(struct at697pci_priv *priv) * 0 Successful initalization * -1 Error during initialization. */ -int at697pci_init(struct at697pci_priv *priv) +static int at697pci_init(struct at697pci_priv *priv) { int pin; union drvmgr_key_value *value; diff --git a/c/src/lib/libbsp/sparc/leon2/preinstall.am b/c/src/lib/libbsp/sparc/leon2/preinstall.am index 8ea53e0809..cf5515b282 100644 --- a/c/src/lib/libbsp/sparc/leon2/preinstall.am +++ b/c/src/lib/libbsp/sparc/leon2/preinstall.am @@ -133,6 +133,10 @@ $(PROJECT_INCLUDE)/pcif.h: ../../sparc/shared/include/pcif.h $(PROJECT_INCLUDE)/ $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/pcif.h PREINSTALL_FILES += $(PROJECT_INCLUDE)/pcif.h +$(PROJECT_INCLUDE)/at697_pci.h: include/at697_pci.h $(PROJECT_INCLUDE)/$(dirstamp) + $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/at697_pci.h +PREINSTALL_FILES += $(PROJECT_INCLUDE)/at697_pci.h + $(PROJECT_INCLUDE)/gr_701.h: ../../sparc/shared/include/gr_701.h $(PROJECT_INCLUDE)/$(dirstamp) $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/gr_701.h PREINSTALL_FILES += $(PROJECT_INCLUDE)/gr_701.h -- cgit v1.2.3