Skip to content
Snippets Groups Projects
Select Git revision
  • master default protected
  • early-display
  • variant-emmc-nvme-boot
  • 2023-01-25
  • v3
  • variant-emmc-nvme-boot
  • 2020-06-01
7 results

pcnet.c

Forked from Reform / reform-boundary-uboot
Source project has a limited visibility.
  • Paul Burton's avatar
    f1ae382d
    pcnet: access descriptor rings & init block uncached · f1ae382d
    Paul Burton authored
    
    The prior accesses to the descriptor rings & init block via cached
    memory had a few issues:
    
      - The memory needs cache flushes or invalidation at the appropriate
        times, but was not necessarily aligned on cache line boundaries.
        This could lead to data being incorrectly lost or written back to
        RAM at the wrong time.
    
      - There are points where ordering of writes to the memory is
        important, but because it's cached memory the pcnet controller
        would see cache lines written back ordered by address. This could
        occasionally lead to hardware seeing descriptors in an incorrect
        state.
    
      - Flushing the cache constantly is inefficient.
    
    So, to avoid all of those issues simply access the descriptors & init
    block via uncached memory. The MIPS-specific UNCACHED_SDRAM macro is
    used to do this (retrieving an address in kseg1) as I could see no
    existing generic solution. Since the MIPS Malta board is the only user
    of the pcnet driver, hopefully this doesn't matter.
    
    Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
    f1ae382d
    History
    pcnet: access descriptor rings & init block uncached
    Paul Burton authored
    
    The prior accesses to the descriptor rings & init block via cached
    memory had a few issues:
    
      - The memory needs cache flushes or invalidation at the appropriate
        times, but was not necessarily aligned on cache line boundaries.
        This could lead to data being incorrectly lost or written back to
        RAM at the wrong time.
    
      - There are points where ordering of writes to the memory is
        important, but because it's cached memory the pcnet controller
        would see cache lines written back ordered by address. This could
        occasionally lead to hardware seeing descriptors in an incorrect
        state.
    
      - Flushing the cache constantly is inefficient.
    
    So, to avoid all of those issues simply access the descriptors & init
    block via uncached memory. The MIPS-specific UNCACHED_SDRAM macro is
    used to do this (retrieving an address in kseg1) as I could see no
    existing generic solution. Since the MIPS Malta board is the only user
    of the pcnet driver, hopefully this doesn't matter.
    
    Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>