| | 1 | = GIET_VM / MMC Driver = |
| | 2 | |
| | 3 | [[PageOutline]] |
| | 4 | |
| | 5 | |
| | 6 | The [source:soft/giet_vm/giet_drivers/mmc_driver.c mmc_driver.c] and [source:soft/giet_vm/giet_drivers/mmc_driver.h mmc_driver.h] files define the MMC driver. |
| | 7 | |
| | 8 | The ''vci_mem_cache'' component is a L2 cache controller specifically designed for the TSAR architecture. |
| | 9 | It contains several addressable registers that can be used to support software based cache coherence between L2 and L3 caches. |
| | 10 | |
| | 11 | The MMC component is a replicated peripheral, as it exist one L2 cache per cluster. |
| | 12 | |
| | 13 | The virtual base address of the segment associated to the component is: |
| | 14 | vbase = SEG_MMC_BASE + cluster_xy * PERI_CLUSTER_INCREMENT |
| | 15 | |
| | 16 | The SEG_MMC_BASE and PERI_CLUSTER_INCREMENT variables must be defined in the hard_config.h file. |
| | 17 | |
| | 18 | The addressable registers map and command codes are defined [source:soft/giet_vm/giet_drivers/mmc_driver.h here]. |
| | 19 | |
| | 20 | |
| | 21 | === void '''_mmc_inval'''( unsigned long long buf_paddr, unsigned int buf_length ) === |
| | 22 | This function invalidates all cache lines covering a memory buffer defined by the physical base address, and the length. The buffer address MSB are used to compute the cluster index. |
| | 23 | |
| | 24 | === void '''_mmc_sync'''( unsigned long long buf_paddr, unsigned int buf_length) === |
| | 25 | This function copies to external RAM all cache lines covering a memory buffer defined by the physical base address, and the length, if they are dirty. The buffer address MSB are used to compute the cluster index. |
| | 26 | |
| | 27 | === void '''_mmc_isr'''( unsigned int irq_type, unsigned int irq_id, unsigned int channel ) === |
| | 28 | This Interrupt Service Routine access the vci_mem_cache component to get |
| | 29 | the faulty physical address and the associated SRCID. It acknowledges the IRQ. |
| | 30 | Not implemented yet... |
| | 31 | |