Ignore:
Timestamp:
Jan 31, 2014, 2:37:38 PM (10 years ago)
Author:
cfuguet
Message:

Modification of comments format on SPI-SDCARD driver to respect
GIET-VM format

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branch/giet_vm_ioc_drivers/giet_drivers/bdv_driver.c

    r283 r284  
    11///////////////////////////////////////////////////////////////////////////////////
    2 // File     : ioc_driver.c
    3 // Date     : 23/05/2013
    4 // Author   : alain greiner
     2// File      : bdv_driver.c
     3// Date      : 23/05/2013
     4// Author    : alain greiner
     5// Maintainer: cesar fuguet
    56// Copyright (c) UPMC-LIP6
    67///////////////////////////////////////////////////////////////////////////////////
    7 // The ioc_driver.c and ioc_driver.h files are part ot the GIET-VM kernel.
     8// The bdv_driver.c and bdv_driver.h files are part ot the GIET-VM kernel.
    89// This driver supports the SocLib vci_block_device component, that is
    910// a single channel, block oriented, external storage contrÃŽler.
     
    1415// that is always blocking, but can be called in 4 modes:
    1516//
    16 // - In BOOT_PA mode, the _bdv_access() function use the buffer virtual address
    17 //   as a physical address (as the page tables are not build) and use a polling
    18 //   policy on the IOC_STATUS register to detect transfer completion, as
    19 //   hardware interrupts are not activated. This mode is used by the
    20 //   boot code to load the map.bin file into memory.
    21 //
    22 // - In BOOT_VA mode, the _bdv_access() function makes a V2P translation to
    23 //   compute the buffer physical address, and use a polling policy on IOC_STATUS
    24 //   register to detect transfer completion. This mode is used by the boot code
    25 //   to load the various .elf files into memory.
    26 //
    27 // - In KERNEL mode, the _bdv_access() function makes a V2P translation to
    28 //   compute the buffer physical address, and use a descheduling strategy:
    29 //   The ISR executed when transfer completes should restart the calling task.
    30 //   There is no checking of user access right to the memory buffer.
    31 //   This mode must be used to access IOC, for an "open" system call.
    32 //
    33 // - In USER mode, the _bdv_access() function makes a V2P translation to
    34 //   compute the buffer physical address, and use a descheduling strategy:
     17// - In BOOT_PA mode, the _bdv_access() function uses a polling policy on the
     18//   IOC_STATUS register to detect transfer completion, as hardware interrupts
     19//   are not activated. This mode is used by the boot code to load the map.bin
     20//   file into memory.
     21//
     22// - In BOOT_VA mode, the _bdv_access() function uses a polling policy on
     23//   IOC_STATUS register to detect transfer completion. This mode is used by
     24//   the boot code to load the various .elf files into memory.
     25//
     26// - In KERNEL mode, the _bdv_access() function uses a descheduling strategy:
     27//   The ISR executed when transfer completes should restart the calling task.
     28//   There is no checking of user access right to the memory buffer. This mode
     29//   must be used to access IOC, for an "open" system call.
     30//
     31// - In USER mode, the _bdv_access() function uses a descheduling strategy:
    3532//   The ISR executed when transfer completes should restart the calling task,
    3633//   The user access right to the memory buffer must be checked.
    3734//   This mode must be used to access IOC, for a "read/write" system call.
    3835//
    39 // As the IOC component can be used by several programs running in parallel,
     36// As the BDV component can be used by several programs running in parallel,
    4037// the _ioc_lock variable guaranties exclusive access to the device.  The
    4138// _bdv_read() and _bdv_write() functions use atomic LL/SC to get the lock.
    42 //
    43 // The IOMMU can be activated or not:
    44 //
    45 // 1) When the IOMMU is used, a fixed size 2Mbytes vseg is allocated to
    46 // the IOC peripheral, in the I/O virtual space, and the user buffer is
    47 // dynamically remapped in the IOMMU page table. The corresponding entry
    48 // in the IOMMU PT1 is defined by the kernel _ioc_iommu_ix1 variable.
    49 // The number of pages to be unmapped is stored in the _ioc_npages variable.
    50 // The number of PT2 entries is dynamically computed and stored in the
    51 // kernel _ioc_iommu_npages variable. It cannot be larger than 512.
    52 // The user buffer is unmapped by the _ioc_completed() function when
    53 // the transfer is completed.
    54 //
    55 // 2/ If the IOMMU is not used, we check that  the user buffer is mapped to a
    56 // contiguous physical buffer (this is generally true because the user space
    57 // page tables are statically constructed to use contiguous physical memory).
    5839//
    5940// Finally, the memory buffer must fulfill the following conditions:
Note: See TracChangeset for help on using the changeset viewer.