source: rtems/bsps/powerpc/shared/vme/README.porting @ 814eccb4

5
Last change on this file since 814eccb4 was 814eccb4, checked in by Sebastian Huber <sebastian.huber@…>, on 04/03/18 at 14:41:16

bsps: Move VME support to bsps

The VME support is only used by powerpc BSPs.

This patch is a part of the BSP source reorganization.

Update #3285.

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