Changeset dd8abfc in rtems


Ignore:
Timestamp:
Feb 11, 2015, 11:40:17 AM (5 years ago)
Author:
Daniel Hellstrom <daniel@…>
Branches:
4.11, master
Children:
103bbde
Parents:
90fd587
git-author:
Daniel Hellstrom <daniel@…> (02/11/15 11:40:17)
git-committer:
Daniel Hellstrom <daniel@…> (04/16/15 23:10:25)
Message:

GR-RASTA-TMTC: fix build warnings

Location:
c/src/lib/libbsp/sparc/shared
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/sparc/shared/include/gr_rasta_tmtc.h

    r90fd587 rdd8abfc  
    7979 * AMBA bus.
    8080 *
    81  * The array is defined weak, and defualts to no resources.
     81 * The array is defined weak, and defaults to no resources. The array must be
     82 * terminated with a NULL resource.
    8283 */
    8384extern struct drvmgr_bus_res *gr_rasta_tmtc_resources[];
     
    8788#define RASTA_TMTC_OPTIONS_IRQ    0x02 /* Print current IRQ setup */
    8889
    89 /* Print information about GR-RASTA-TMTC PCI board */
     90/* Print information about GR-RASTA-TMTC PCI boards */
    9091void gr_rasta_tmtc_print(int options);
     92
     93/* Print information about a GR-RASTA-TMTC PCI boards */
     94void gr_rasta_tmtc_print_dev(struct drvmgr_dev *dev, int options);
    9195
    9296/* Register GR-RASTA-TMTC driver */
  • c/src/lib/libbsp/sparc/shared/pci/gr_rasta_tmtc.c

    r90fd587 rdd8abfc  
    3131#include <drvmgr/ambapp_bus.h>
    3232#include <drvmgr/pci_bus.h>
     33#include <drvmgr/bspcommon.h>
    3334#include <genirq.h>
    3435
     
    6263int gr_rasta_tmtc_init1(struct drvmgr_dev *dev);
    6364int gr_rasta_tmtc_init2(struct drvmgr_dev *dev);
     65void gr_rasta_tmtc_isr (void *arg);
    6466
    6567struct grpci_regs {
     
    211213        NULL,
    212214};
    213 int gr_rasta_tmtc_resources_cnt = 0;
    214215
    215216void gr_rasta_tmtc_register_drv(void)
     
    248249 * common stuff between rev0 and rev1.
    249250 */
    250 int gr_rasta_tmtc_hw_init_common(struct gr_rasta_tmtc_priv *priv)
     251static int gr_rasta_tmtc_hw_init_common(struct gr_rasta_tmtc_priv *priv)
    251252{
    252253        struct ambapp_dev *tmp;
     
    260261
    261262        /* Find IRQ controller, Clear all current IRQs */
    262         tmp = (void *)ambapp_for_each(&priv->abus,
     263        tmp = (struct ambapp_dev *)ambapp_for_each(&priv->abus,
    263264                                        (OPTIONS_ALL|OPTIONS_APB_SLVS),
    264265                                        VENDOR_GAISLER, GAISLER_IRQMP,
     
    274275
    275276        /* Find First GPIO controller */
    276         tmp = (void *)ambapp_for_each(&priv->abus,
     277        tmp = (struct ambapp_dev *)ambapp_for_each(&priv->abus,
    277278                                        (OPTIONS_ALL|OPTIONS_APB_SLVS),
    278279                                        VENDOR_GAISLER, GAISLER_GPIO,
     
    310311
    311312/* PCI Hardware (Revision 0) initialization */
    312 int gr_rasta_tmtc0_hw_init(struct gr_rasta_tmtc_priv *priv)
     313static int gr_rasta_tmtc0_hw_init(struct gr_rasta_tmtc_priv *priv)
    313314{
    314315        unsigned int *page0 = NULL;
     
    382383
    383384        /* Find GRPCI controller */
    384         tmp = (void *)ambapp_for_each(&priv->abus,
     385        tmp = (struct ambapp_dev *)ambapp_for_each(&priv->abus,
    385386                                        (OPTIONS_ALL|OPTIONS_APB_SLVS),
    386387                                        VENDOR_GAISLER, GAISLER_PCIFBRG,
     
    428429
    429430/* PCI Hardware (Revision 1) initialization */
    430 int gr_rasta_tmtc1_hw_init(struct gr_rasta_tmtc_priv *priv)
     431static int gr_rasta_tmtc1_hw_init(struct gr_rasta_tmtc_priv *priv)
    431432{
    432433        int i;
     
    508509
    509510        /* Find GRPCI2 controller AHB Slave interface */
    510         tmp = (void *)ambapp_for_each(&priv->abus,
     511        tmp = (struct ambapp_dev *)ambapp_for_each(&priv->abus,
    511512                                        (OPTIONS_ALL|OPTIONS_AHB_SLVS),
    512513                                        VENDOR_GAISLER, GAISLER_GRPCI2,
     
    524525
    525526        /* Find GRPCI2 controller APB Slave interface */
    526         tmp = (void *)ambapp_for_each(&priv->abus,
     527        tmp = (struct ambapp_dev *)ambapp_for_each(&priv->abus,
    527528                                        (OPTIONS_ALL|OPTIONS_APB_SLVS),
    528529                                        VENDOR_GAISLER, GAISLER_GRPCI2,
     
    549550}
    550551
    551 void gr_rasta_tmtc_hw_init2(struct gr_rasta_tmtc_priv *priv)
     552static void gr_rasta_tmtc_hw_init2(struct gr_rasta_tmtc_priv *priv)
    552553{
    553554        /* Enable DMA by enabling PCI target as master */
     
    565566        uint32_t bar0, bar1, bar0_size, bar1_size;
    566567        union drvmgr_key_value *value;
     568        int resources_cnt;
    567569
    568570        priv = dev->priv;
     
    572574
    573575        /* Determine number of configurations */
    574         if ( gr_rasta_tmtc_resources_cnt == 0 ) {
    575                 while ( gr_rasta_tmtc_resources[gr_rasta_tmtc_resources_cnt] )
    576                         gr_rasta_tmtc_resources_cnt++;
    577         }
     576        resources_cnt = get_resarray_count(gr_rasta_tmtc_resources);
    578577
    579578        /* Generate Device prefix */
     
    646645        priv->config.maps_up = &priv->bus_maps_up[0];
    647646        priv->config.maps_down = &priv->bus_maps_down[0];
    648         if ( priv->dev->minor_drv < gr_rasta_tmtc_resources_cnt ) {
     647        if ( priv->dev->minor_drv < resources_cnt ) {
    649648                priv->config.resources = gr_rasta_tmtc_resources[priv->dev->minor_drv];
    650649        } else {
Note: See TracChangeset for help on using the changeset viewer.