Changeset 30a8915 in rtems


Ignore:
Timestamp:
Sep 6, 2007, 3:22:42 PM (12 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
f752c24
Parents:
226455f
Message:

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

  • amba/amba.c: Add missing part of previous patch.
  • clock/ckinit.c: Update previous patch.
Location:
c/src/lib/libbsp/sparc/leon3
Files:
3 edited

Legend:

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

    r226455f r30a8915  
     12007-09-06      Daniel Hellstrom <daniel@gaisler.com>
     2
     3        * amba/amba.c: Add missing part of previous patch.
     4        * clock/ckinit.c: Update previous patch.
     5
    162007-09-06      Daniel Hellstrom <daniel@gaisler.com>
    27
  • c/src/lib/libbsp/sparc/leon3/amba/amba.c

    r226455f r30a8915  
    2323
    2424int LEON3_Cpu_Index = 0;
    25 static int apb_init = 0;
    2625
    2726/*
     
    4241    "mov %asr17, %o0\n"
    4342);
    44    
    45      
     43
     44
    4645extern rtems_configuration_table Configuration;
    4746
    4847void bsp_leon3_predriver_hook(void)
    4948{
    50   unsigned int iobar, conf;
    5149  int i;
    5250  unsigned int tmp;
     51  amba_apb_device dev;
    5352       
    5453        /* Scan the AMBA Plug&Play info at the default LEON3 area */
     
    5655
    5756  /* Find LEON3 Interrupt controler */
    58   i = 0;
    59   while (i < amba_conf.apbslv.devnr)
    60   {
    61     conf = amba_get_confword(amba_conf.apbslv, i, 0);
    62     if ((amba_vendor(conf) == VENDOR_GAISLER) && (amba_device(conf) == GAISLER_IRQMP))
    63     {
    64       iobar = amba_apb_get_membar(amba_conf.apbslv, i);
    65       LEON3_IrqCtrl_Regs = (volatile LEON3_IrqCtrl_Regs_Map *) amba_iobar_start(amba_conf.apbslv.apbmst[i], iobar);
    66       /* asm("mov %%asr17, %0": : "r" (tmp)); */
    67       if (Configuration.User_multiprocessing_table != NULL)
    68       {
    69               tmp = getasr17();
    70         LEON3_Cpu_Index = (tmp >> 28) & 3;
    71       }
    72       break;
     57  i = amba_find_apbslv(&amba_conf,VENDOR_GAISLER,GAISLER_IRQMP,&dev);
     58  if ( i > 0 ){
     59    /* Found APB IRQ_MP Interrupt Controller */
     60    LEON3_IrqCtrl_Regs = (volatile LEON3_IrqCtrl_Regs_Map *) dev.start;
     61    if (Configuration.User_multiprocessing_table != NULL) {     
     62            tmp = getasr17();
     63        LEON3_Cpu_Index = (tmp >> 28) & 3;
    7364    }
    74     i++;
    7565  }
     66 
    7667  /* find GP Timer */
    77   i = 0;
    78  while (i < amba_conf.apbslv.devnr)
    79   {
    80     conf = amba_get_confword(amba_conf.apbslv, i, 0);
    81     if ((amba_vendor(conf) == VENDOR_GAISLER) &&
    82        (amba_device(conf) == GAISLER_GPTIMER)) {
    83       iobar = amba_apb_get_membar(amba_conf.apbslv, i);     
    84       LEON3_Timer_Regs = (volatile LEON3_Timer_Regs_Map *)
    85       amba_iobar_start(amba_conf.apbslv.apbmst[i], iobar);
    86       break;
    87     }
    88     i++;
     68  i = amba_find_apbslv(&amba_conf,VENDOR_GAISLER,GAISLER_GPTIMER,&dev);
     69  if ( i > 0 ){
     70    LEON3_Timer_Regs = (volatile LEON3_Timer_Regs_Map *) dev.start;
    8971  }
    9072
  • c/src/lib/libbsp/sparc/leon3/clock/ckinit.c

    r226455f r30a8915  
    4949    amba_apb_device dev; \
    5050    \
    51     /* Find LEON3 Interrupt controler */ \
    52     cnt = amba_find_apbslv(&amba_conf,VENDOR_GAISLER,GAISLER_IRQMP,&dev); \
     51    /* Find LEON3 GP Timer */ \
     52    cnt = amba_find_apbslv(&amba_conf,VENDOR_GAISLER,GAISLER_GPTIMER,&dev); \
    5353    if ( cnt > 0 ){ \
    54       /* Found APB IRQ_MP Interrupt Controller */ \
    55       LEON3_IrqCtrl_Regs = (volatile LEON3_IrqCtrl_Regs_Map *) dev.start; \
     54      /* Found APB GPTIMER Timer */ \
     55      LEON3_Timer_Regs = (volatile LEON3_Timer_Regs_Map *) dev.start; \
    5656      clkirq = (LEON3_Timer_Regs->status & 0xfc) >> 3; \
    5757      \
Note: See TracChangeset for help on using the changeset viewer.