= GIET_VM / Peripherals Drivers = [[PageOutline]] The GIET_VM supports two types of peripheral components: '''External peripherals''' are located in one single cluster (called ''cluster_io'', and identified by the ''X_IO,Y_IO'' variables). '''Internal peripherals''' (such as XCU, or MMC) are replicated in all clusters. Each driver xxx_driver define two low-level functions ''_xxx_get_register()'' and ''_xxx_set_register()'' to access the peripheral addressable registers. These functions are in charge to compute the peripheral registers addresses, taking into account the peripheral base address, the register index, and the cluster coordinates: * '''External peripherals''': All accesses use virtual addresses if the MMU (Memory management Unit) is activated, or physical addresses if it is not. In this case, the physical address is computed as pbase = SEG_XXX_BASE + cluster_io << 32. * '''Internal peripherals''': All accesses use virtual addresses, and the MMU must be activated. The peripheral virtual base address is computed as vbase = SEG_XXX_BASE + cluster_xy * PERI_CLUSTER_INCREMENT. The X_IO, Y_IO, and PERI_CLUSTER_INCREMENT variables must be defined in the ''hard_config.h" file. == Shared and private peripherals == Some peripherals (such as BDV, SDC, FBF) deliver an unique service, and are shared by all applications under the kernel supervision. Some peripherals (TTY, TIM, NIC, CMA) are multi-channels peripherals: Each channel provide an independent set of addressable registers, and each channel can be seen as an independent hardware resource. For multi-channels peripherals, the GIET_VM allows an user application to dynamically allocate a ''private'' peripheral channel, that cannot be used by other applications. The corresponding channel index is stored in the calling thread context. * For TIM, the private timer index is hidden, and can only be used by the thread making the allocation. * For TTY, the private channel index is hidden, but the the thread making the allocation can ask a totally private terminal, or a partially shared terminal usable by all threads in the same vspace. * For NIC, the channel index is returned to the thread making allocation, and can be used by all threads in the same vspace. === [wiki:bdv_driver BDV (Block Device controller)] === [wiki:cma_driver CMA (Chained Buffer DMA controller)] === [wiki:dma_driver DMA (Multi-Channels DMA controller)] === [wiki:hba_driver HBA (AHCI Disk controller)] === [wiki:iob_driver IOB (I/O Bridge controller)] === [wiki:ioc_driver IOC (Generic I/O controller)] === [wiki:mmc_driver MMC (Memory Cache controller)] === [wiki:mnc_driver MNC (Master Network Controller)] === [wiki:mwr_driver MWR (MWMR_DMA controller)] === [wiki:nic_driver NIC (Multi Network controller)] === [wiki:pic_driver PIC (External Peripherals Interrupt controller)] === [wiki:rdk_driver RDK (RamDisk)] === [wiki:sim_driver SIM (Monitor controller)] === [wiki:sdc_driver SDC (SDC Disk controller)] === [wiki:tim_driver TIM (Multi Timers controller)] === [wiki:tty_driver TTY (Multi Terminals TTY controller)] === [wiki:xcu_driver XCU (Extended Interrupt controller)]