Ignore:
Timestamp:
Jul 6, 2012, 10:13:16 AM (12 years ago)
Author:
alain
Message:

Introducing support for IOMMU

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/sys/kernel_init.c

    r165 r166  
    2222#include <mips32_registers.h>
    2323#include <irq_handler.h>
     24#include <vm_handler.h>
    2425#include <hwr_mapping.h>
    2526#include <mwmr_channel.h>
     
    523524
    524525////////////////////////////////////////////////////////////////////////////////
    525 // This function intializes the external periherals such as the TTY controller,
    526 // the IOC (external disk controller), the NIC (external network controller),
    527 // the FBDMA (frame buffer controller), etc.
     526// This function intializes the external periherals such as the IOB component
     527// (I/O bridge, containing the IOMMU, the IOC (external disk controller),
     528// the NIC (external network controller), the FBDMA (frame buffer controller),
    528529////////////////////////////////////////////////////////////////////////////////
    529530in_kinit void _kernel_peripherals_init()
    530531{
     532    // IOC peripheral initialisation
     533    // we simply activate the IOC interrupts...
     534    unsigned int*       ioc_address = (unsigned int*)&seg_ioc_base;
     535
     536    ioc_address[BLOCK_DEVICE_IRQ_ENABLE] = 1;
     537   
     538    // IOB peripheral
     539    if ( GIET_IOMMU_ACTIVE )
     540    {
     541        unsigned int*   iob_address = (unsigned int*)&seg_iob_base;
     542        unsigned int    icu_address = (unsigned int)&seg_icu_base;
     543
     544        // define IPI address mapping the IOC interrupt ...TODO...
     545
     546        // set IOMMU page table address
     547        iob_address[IOB_IOMMU_PTPR] = (unsigned int)(&_iommu_ptab);   
     548
     549        // activate IOMMU
     550        iob_address[IOB_IOMMU_ACTIVE] = 1;   
     551    }
     552
    531553    _puts("\n[INIT] Peripherals initialisation completed at cycle ");
    532554    _putw( _proctime() );
     
    536558
    537559////////////////////////////////////////////////////////////////////////////////
    538 // This function intialises the centralised interrupt vector,
    539 // and the ICUs mask registers for all processors in all clusters.
     560// This function intialises the interrupt vector, and initialises
     561// the ICU mask registers for all processors in all clusters.
    540562// It strongly depends on the actual peripheral hardware wiring.
    541563// In this peculiar version, all clusters are identical,
Note: See TracChangeset for help on using the changeset viewer.