[258] | 1 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 2 | // File : xcu_driver.h |
---|
| 3 | // Date : 01/11/2013 |
---|
| 4 | // Author : alain greiner |
---|
| 5 | // Copyright (c) UPMC-LIP6 |
---|
| 6 | /////////////////////////////////////////////////////////////////////////////////// |
---|
[295] | 7 | // The xcu_driver.c and xcu_driver.h files are part ot the GIET-VM nano-kernel. |
---|
| 8 | // This driver supports the SoCLib vci_xicu, that is a vectorised interrupt |
---|
| 9 | // controler supporting IPI (Inter Processor Interrupts) and integrated timers. |
---|
| 10 | // |
---|
| 11 | // It can exist several interrupt controller unit in the architecture |
---|
| 12 | // (one per cluster), and each one can contain several channels. |
---|
| 13 | // The number of XICU channels is equal to NB_PROCS_MAX, because there is |
---|
| 14 | // one private XICU channel per processor in a cluster. |
---|
| 15 | //////////////////////////////////////////////////////////////////////////////// |
---|
| 16 | // The virtual base address of the segment associated to the component is: |
---|
| 17 | // |
---|
| 18 | // seg_xcu_base + cluster_xy * vseg_cluster_increment |
---|
| 19 | // |
---|
| 20 | // The seg_xcu_base and vseg_cluster_increment values must be defined |
---|
| 21 | // in giet_vsegs.ld file. |
---|
| 22 | //////////////////////////////////////////////////////////////////////////////// |
---|
[258] | 23 | |
---|
| 24 | #ifndef _GIET_XCU_DRIVER_H_ |
---|
| 25 | #define _GIET_XCU_DRIVER_H_ |
---|
| 26 | |
---|
| 27 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 28 | // XICU registers offsets |
---|
| 29 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 30 | |
---|
| 31 | enum Xicu_registers |
---|
| 32 | { |
---|
| 33 | XICU_WTI_REG = 0, |
---|
| 34 | XICU_PTI_PER = 1, |
---|
| 35 | XICU_PTI_VAL = 2, |
---|
| 36 | XICU_PTI_ACK = 3, |
---|
| 37 | |
---|
| 38 | XICU_MSK_PTI = 4, |
---|
| 39 | XICU_MSK_PTI_ENABLE = 5, |
---|
| 40 | XICU_MSK_PTI_DISABLE = 6, |
---|
| 41 | XICU_PTI_ACTIVE = 6, |
---|
| 42 | |
---|
| 43 | XICU_MSK_HWI = 8, |
---|
| 44 | XICU_MSK_HWI_ENABLE = 9, |
---|
| 45 | XICU_MSK_HWI_DISABLE = 10, |
---|
| 46 | XICU_HWI_ACTIVE = 10, |
---|
| 47 | |
---|
| 48 | XICU_MSK_WTI = 12, |
---|
| 49 | XICU_MSK_WTI_ENABLE = 13, |
---|
| 50 | XICU_MSK_WTI_DISABLE = 14, |
---|
| 51 | XICU_WTI_ACTIVE = 14, |
---|
| 52 | |
---|
| 53 | XICU_PRIO = 15, |
---|
| 54 | }; |
---|
| 55 | |
---|
| 56 | #define XICU_REG(func, index) (((func)<<5)|(index)) |
---|
[263] | 57 | |
---|
[258] | 58 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 59 | // XICU access functions |
---|
| 60 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 61 | |
---|
[295] | 62 | extern void _xcu_set_mask( unsigned int cluster_xy, |
---|
| 63 | unsigned int channel, |
---|
| 64 | unsigned int mask, |
---|
| 65 | unsigned int irq_type ); |
---|
[258] | 66 | |
---|
[295] | 67 | extern void _xcu_get_index( unsigned int cluster_xy, |
---|
| 68 | unsigned int channel, |
---|
| 69 | unsigned int * index, |
---|
| 70 | unsigned int * irq_type ); |
---|
[258] | 71 | |
---|
[295] | 72 | extern void _xcu_send_wti( unsigned int cluster_xy, |
---|
| 73 | unsigned int wti_index, |
---|
| 74 | unsigned int wdata ); |
---|
[258] | 75 | |
---|
[295] | 76 | extern void _xcu_get_wti_value( unsigned int cluster_xy, |
---|
| 77 | unsigned int wti_index, |
---|
| 78 | unsigned int * value ); |
---|
[258] | 79 | |
---|
[295] | 80 | extern void _xcu_get_wti_address( unsigned int wti_index, |
---|
| 81 | unsigned int * address ); |
---|
[258] | 82 | |
---|
[295] | 83 | extern void _xcu_timer_start( unsigned int cluster_xy, |
---|
| 84 | unsigned int pti_index, |
---|
| 85 | unsigned int period ); |
---|
[258] | 86 | |
---|
[295] | 87 | extern void _xcu_timer_stop( unsigned int cluster_xy, |
---|
| 88 | unsigned int pti_index ); |
---|
[258] | 89 | |
---|
[295] | 90 | extern void _xcu_timer_reset_irq( unsigned int cluster_xy, |
---|
| 91 | unsigned int pti_index ); |
---|
| 92 | |
---|
| 93 | extern void _xcu_timer_reset_cpt( unsigned int cluster_xy, |
---|
| 94 | unsigned int pti_index ); |
---|
| 95 | |
---|
[258] | 96 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 97 | |
---|
| 98 | #endif |
---|
| 99 | |
---|
| 100 | // Local Variables: |
---|
| 101 | // tab-width: 4 |
---|
| 102 | // c-basic-offset: 4 |
---|
| 103 | // c-file-offsets:((innamespace . 0)(inline-open . 0)) |
---|
| 104 | // indent-tabs-mode: nil |
---|
| 105 | // End: |
---|
| 106 | // vim: filetype=c:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 |
---|
| 107 | |
---|