Changeset 4cb04f2 in rtems


Ignore:
Timestamp:
Sep 6, 2007, 12:03:16 AM (12 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
3d0d969
Parents:
5982921
Message:

2007-09-05 Daniel Hellstrom <daniel@…>

  • include/bsp.h, startup/bspstart.c: LEON2 and LEON3 Data cache snooping detection on startup, for drivers. (LEON2,3 are configurable processors, they can be with or without DCache snooping. Caches without snooping needs the drivers to flush cache or use the sparc instruction lda to force cache miss...)
Location:
c/src/lib/libbsp/sparc/leon3
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/sparc/leon3/ChangeLog

    r5982921 r4cb04f2  
     12007-09-05      Daniel Hellstrom <daniel@gaisler.com>
     2
     3        * include/bsp.h, startup/bspstart.c: LEON2 and LEON3 Data cache
     4        snooping detection on startup, for drivers. (LEON2,3 are configurable
     5        processors, they can be with or without DCache snooping. Caches
     6        without snooping needs the drivers to flush cache or use the sparc
     7        instruction lda to force cache miss...)
     8
    192007-09-05      Daniel Hellstrom <daniel@gaisler.com>
    210
  • c/src/lib/libbsp/sparc/leon3/include/bsp.h

    r5982921 r4cb04f2  
    8484
    8585#define delay( microseconds ) Clock_delay(microseconds)
     86extern int   CPU_SPARC_HAS_SNOOPING;
     87
    8688
    8789/* Constants */
  • c/src/lib/libbsp/sparc/leon3/startup/bspstart.c

    r5982921 r4cb04f2  
    4343extern uint32_t rdb_start;
    4444
     45/*
     46 * Tells us if data cache snooping is available
     47 */
     48
     49int CPU_SPARC_HAS_SNOOPING;
     50
    4551void bsp_postdriver_hook(void);
    4652void bsp_libc_init( void *, uint32_t, int );
    4753extern void bsp_spurious_initialize();
     54
     55/*
     56 * set_snooping
     57 *
     58 * Read the data cache configuration register to determine if
     59 * bus snooping is available. This is needed for some drivers so
     60 * that they can select the most efficient copy routines. 
     61 *
     62 */
     63
     64static inline int set_snooping(void)
     65{
     66        int tmp;       
     67        asm(" lda [%1] 2, %0 "
     68            : "=r"(tmp)
     69            : "r"(0xC)
     70        );
     71        return (tmp >> 27) & 1;
     72}
    4873
    4974/*
     
    113138
    114139  BSP_Configuration.work_space_start = work_space_start;
     140 
     141  CPU_SPARC_HAS_SNOOPING = set_snooping();
    115142}
Note: See TracChangeset for help on using the changeset viewer.