source: rtems/c/src/lib/libbsp/shared/vmeUniverse/README.porting @ 6600424d

4.104.114.84.95
Last change on this file since 6600424d was 6600424d, checked in by Ralf Corsepius <ralf.corsepius@…>, on 03/11/03 at 11:00:20

Merger from rtems-4-6-branch.

  • Property mode set to 100644
File size: 3.8 KB
Line 
1#
2# $Id$
3#
4
5The vmeUniverse driver needs some support from the BSP for
6
7a) PCI configuration space access
8b) PCI interrupt acknowledgement
9c) PCI interrupt handler installation
10
11The driver was developed using the powerpc/shared/ BSP
12(it also supports vxWorks) and by default uses that BSP's
13a) PCI access API
14b,c) irq handling API (AKA 'new' style BSP_install_rtems_irq_handler()
15   API).
16
17Some hooks exist in the driver to ease porting to other BSPs.
18The following information has been assembled when answering a
19question regarding a ppcn_60x BSP port:
20
21I looked through the ppcn_60x BSP. Here's what I found:
22
23 - this BSP does NOT adhere to neither the 'old' nor the 'new' API
24   but provides its own (startup/setvec.c: set_vector()).
25 - the BSP has a 'driver' for vmeUniverse although mine is far more
26   complete (including support for VME interrupts, DMA etc.).
27 - Porting my driver to your BSP should not be too hard:
28 
29   1) vmeUniverse needs PCI configuration space support from the
30      BSP:
31        a) a routine 'pciFindDevice' (need to be macro-aliased
32           to the proper routine/wrapper of your BSP) who scans
33           PCI config space for the universe bridge.
34           You could add 'libbsp/powerpc/shared/pci/pcifinddevice.c'
35           to your BSP substituting the pci_read_config_xxx calls
36           by the ones present on your BSP (see step 2))
37        b) routines to read PCI config registers (byte and longword)
38           [on your BSP these are PCIConfigRead32/PCIConfigRead8;
39           hence you could replace the macros on top with
40            #define pciConfigInLong PCIConfigRead32
41   2) vmeUniverse needs to know how to acknowledge a PCI interrupt
42      In your case, nothing needs to be done
43            #define BSP_PIC_DO_EOI do {} while (0)
44   3) Install the VME ISR dispatcher: replace the 'new' style
45      interrupt installer (BSP_install_rtems_irq_handler()) by
46      a proper call to 'set_vector()'
47   4) I might have missed something...
48
49I attach the latest version of the vmeUniverse driver in case you want
50to try to do the port (should be easy).
51
52For the sake of ease of maintenance, I just added a few hooks making it
53possible to override some things without having to modify the driver code.
54
55 1,2) PCI config space access macros may be overriden via CFLAGS
56      when compiling vmeUniverse.c, hence:
57      CFLAGS += -DBSP_PIC_DO_EOI=do{}while(0)
58      CFLAGS += -DBSP_PCI_CONFIG_IN_LONG=PCIConfigRead32
59      CFLAGS += -DBSP_PCI_CONFIG_IN_BYTE=PCIConfigRead8
60      (you still need to supply BSP_pciFindDevice)
61 3)   create your own version of vmeUniverseInstallIrqMgr():
62      copy to a separate file and replace   
63      BSP_rtems_install_irq_handler() by a proper call to set_vector.
64 
65 4)   Send me email :-)
66
67USAGE NOTE: To fully initialize the driver, the following steps can/must
68be performed:
69
70 vmeUniverseInit();  /* MANDATORY: Driver Initialization */
71 vmeUniverseReset(); /* OPTIONAL: Reset most registers to a known state;
72                      * if this step is omitted, firmware setup is
73                      * preserved
74                      */
75 vmeUniverseMasterPortCfg(...); /* OPTIONAL: setup the master windows
76                                 * (current setup preserved if omitted)
77                                 */
78 vmeUniverseSlavePortCfg(...);  /* OPTIONAL: setup the slave windows
79                                 * (current setup preserved if omitted)
80                                 */
81 vmeUniverseInstallIrqMgr();    /* NEEDED FOR VME INTERRUPT SUPPRORT
82                                 * initialize the interrupt manager.
83                                 * NOTE: you need to call your own
84                                 * version of this routine here
85                                 */
86
87For an example of init/setup, consult libbsp/powerpc/shared/vme/vmeconfig.c
88
Note: See TracBrowser for help on using the repository browser.