Changeset 9f058fb in rtems


Ignore:
Timestamp:
May 8, 2014, 3:08:04 PM (5 years ago)
Author:
Daniel Cederman <cederman@…>
Branches:
4.11, master
Children:
8fcafdd5
Parents:
c903fc2
git-author:
Daniel Cederman <cederman@…> (05/08/14 15:08:04)
git-committer:
Daniel Hellstrom <daniel@…> (05/27/14 07:46:30)
Message:

bsps/sparc: Change tabs to spaces.

Location:
c/src/lib/libbsp/sparc
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/sparc/erc32/clock/ckinit.c

    rc903fc2 r9f058fb  
    8383    \
    8484    ERC32_MEC_Set_Real_Time_Clock_Timer_Control( \
    85       ERC32_MEC_TIMER_COUNTER_ENABLE_COUNTING | \
    86         ERC32_MEC_TIMER_COUNTER_LOAD_SCALER | \
    87             ERC32_MEC_TIMER_COUNTER_LOAD_COUNTER \
     85        ERC32_MEC_TIMER_COUNTER_ENABLE_COUNTING | \
     86        ERC32_MEC_TIMER_COUNTER_LOAD_SCALER | \
     87        ERC32_MEC_TIMER_COUNTER_LOAD_COUNTER \
    8888    ); \
    8989    \
    9090    ERC32_MEC_Set_Real_Time_Clock_Timer_Control( \
    91       ERC32_MEC_TIMER_COUNTER_ENABLE_COUNTING | \
    92             ERC32_MEC_TIMER_COUNTER_RELOAD_AT_ZERO \
     91        ERC32_MEC_TIMER_COUNTER_ENABLE_COUNTING | \
     92        ERC32_MEC_TIMER_COUNTER_RELOAD_AT_ZERO \
    9393    ); \
    9494    _SPARC_Counter_initialize( \
  • c/src/lib/libbsp/sparc/erc32/console/erc32_console.c

    rc903fc2 r9f058fb  
    149149#if (CONSOLE_USE_INTERRUPTS)
    150150static ssize_t erc32_console_write_support_int(
    151                 int minor, const char *buf, size_t len)
     151    int minor, const char *buf, size_t len)
    152152{
    153153  if (len > 0) {
     
    265265      ++i;
    266266    }
    267     if ( i ) 
     267    if ( i )
    268268      rtems_termios_enqueue_raw_characters(cd->termios_data, buf, i);
    269269
  • c/src/lib/libbsp/sparc/erc32/erc32sonic/erc32sonic.c

    rc903fc2 r9f058fb  
    113113
    114114  ERC32_MEC.IO_Configuration |=
    115                   (0x15 << (((SONIC_BASE_ADDRESS >> 24) & 0x3) * 8));
     115      (0x15 << (((SONIC_BASE_ADDRESS >> 24) & 0x3) * 8));
    116116  ERC32_MEC.Control &= ~0x60001; /* Disable DMA time-out, parity & power-down */
    117   ERC32_MEC.Control |= 0x10000;                 /* Enable DMA */
     117  ERC32_MEC.Control |= 0x10000;  /* Enable DMA */
    118118  ERC32_MEC.Interrupt_Mask &= ~(1 << (SONIC_VECTOR - 0x10));
    119119  return(rtems_sonic_driver_attach( config, &erc32_sonic_configuration ));
  • c/src/lib/libbsp/sparc/erc32/include/bsp.h

    rc903fc2 r9f058fb  
    6464  struct rtems_bsdnet_ifconfig *config
    6565);
    66 #define RTEMS_BSP_NETWORK_DRIVER_NAME   "sonic1"
    67 #define RTEMS_BSP_NETWORK_DRIVER_ATTACH rtems_erc32_sonic_driver_attach
     66#define RTEMS_BSP_NETWORK_DRIVER_NAME   "sonic1"
     67#define RTEMS_BSP_NETWORK_DRIVER_ATTACH rtems_erc32_sonic_driver_attach
    6868
    6969/* Constants */
  • c/src/lib/libbsp/sparc/erc32/startup/spurious.c

    rc903fc2 r9f058fb  
    161161     */
    162162
    163      if (( trap == 5 || trap == 6 ) ||
    164         (( trap >= 0x11 ) && ( trap <= 0x1f )) ||
    165         (( trap >= 0x70 ) && ( trap <= 0x83 )))
     163    if (( trap == 5 || trap == 6 ) ||
     164        (( trap >= 0x11 ) && ( trap <= 0x1f )) ||
     165        (( trap >= 0x70 ) && ( trap <= 0x83 )))
    166166      continue;
    167167
  • c/src/lib/libbsp/sparc/leon2/cchip/cchip.c

    rc903fc2 r9f058fb  
    5151#define READ_REG(address) _READ_REG((unsigned int)address)
    5252static __inline__ unsigned int _READ_REG(unsigned int addr) {
    53         unsigned int tmp;
    54         __asm__ ("lda [%1]1, %0 "
    55           : "=r"(tmp)
    56           : "r"(addr)
    57         );
    58         return tmp;
     53  unsigned int tmp;
     54  __asm__ ("lda [%1]1, %0 "
     55    : "=r"(tmp)
     56    : "r"(addr)
     57  );
     58  return tmp;
    5959}
    6060
    6161/* PCI bride reg layout on AMBA side */
    6262typedef struct {
    63         unsigned int bar0;
    64         unsigned int bar1;
    65         unsigned int bar2;
    66         unsigned int bar3;
    67         unsigned int bar4;/* 0x10 */
    68 
    69         unsigned int unused[4*3-1];
    70 
    71         unsigned int ambabars[1]; /* 0x40 */
     63  unsigned int bar0;
     64  unsigned int bar1;
     65  unsigned int bar2;
     66  unsigned int bar3;
     67  unsigned int bar4;/* 0x10 */
     68
     69  unsigned int unused[4*3-1];
     70
     71  unsigned int ambabars[1]; /* 0x40 */
    7272} amba_bridge_regs;
    7373
    7474/* PCI bride reg layout on PCI side */
    7575typedef struct {
    76         unsigned int bar0;
    77         unsigned int bar1;
    78         unsigned int bar2;
    79         unsigned int bar3;
    80         unsigned int bar4; /* 0x10 */
    81 
    82         unsigned int ilevel;
    83         unsigned int ipend;
    84         unsigned int iforce;
    85         unsigned int istatus;
    86         unsigned int iclear;
    87         unsigned int imask;
     76  unsigned int bar0;
     77  unsigned int bar1;
     78  unsigned int bar2;
     79  unsigned int bar3;
     80  unsigned int bar4; /* 0x10 */
     81
     82  unsigned int ilevel;
     83  unsigned int ipend;
     84  unsigned int iforce;
     85  unsigned int istatus;
     86  unsigned int iclear;
     87  unsigned int imask;
    8888} pci_bridge_regs;
    8989
    9090typedef struct {
    91         pci_bridge_regs  *pcib;
    92         amba_bridge_regs *ambab;
    93 
    94         /* AT697 PCI */
    95         unsigned int bars[5];
    96         int bus, dev, fun;
    97 
    98         /* AMBA bus */
    99         struct ambapp_bus amba_bus;
    100         struct ambapp_mmap amba_maps[2];
    101 
    102         /* FT AHB SRAM */
    103         int ftsram_size; /* kb */
    104         unsigned int ftsram_start;
    105         unsigned int ftsram_end;
     91  pci_bridge_regs  *pcib;
     92  amba_bridge_regs *ambab;
     93
     94  /* AT697 PCI */
     95  unsigned int bars[5];
     96  int bus, dev, fun;
     97
     98  /* AMBA bus */
     99  struct ambapp_bus amba_bus;
     100  struct ambapp_mmap amba_maps[2];
     101
     102  /* FT AHB SRAM */
     103  int ftsram_size; /* kb */
     104  unsigned int ftsram_start;
     105  unsigned int ftsram_end;
    106106
    107107} cchip1;
     
    110110
    111111int init_pcif(void){
    112         unsigned int com1;
    113         int i,bus,dev,fun;
    114         pci_bridge_regs *pcib;
    115         amba_bridge_regs *ambab;
    116         struct ambapp_bus *abus;
     112  unsigned int com1;
     113  int i,bus,dev,fun;
     114  pci_bridge_regs *pcib;
     115  amba_bridge_regs *ambab;
     116  struct ambapp_bus *abus;
    117117
    118118  if ( BSP_pciFindDevice(0x1AC8, 0x0701, 0, &bus, &dev, &fun) == 0 ) {
     
    127127  /* found Companionship PCI board, Set it up: */
    128128
    129         pci_read_config_dword(bus, dev, fun, 0x10, &cc1.bars[0]);
    130         pci_read_config_dword(bus, dev, fun, 0x14, &cc1.bars[1]);
    131         pci_read_config_dword(bus, dev, fun, 0x18, &cc1.bars[2]);
    132         pci_read_config_dword(bus, dev, fun, 0x1c, &cc1.bars[3]);
    133         pci_read_config_dword(bus, dev, fun, 0x20, &cc1.bars[4]);
     129  pci_read_config_dword(bus, dev, fun, 0x10, &cc1.bars[0]);
     130  pci_read_config_dword(bus, dev, fun, 0x14, &cc1.bars[1]);
     131  pci_read_config_dword(bus, dev, fun, 0x18, &cc1.bars[2]);
     132  pci_read_config_dword(bus, dev, fun, 0x1c, &cc1.bars[3]);
     133  pci_read_config_dword(bus, dev, fun, 0x20, &cc1.bars[4]);
    134134
    135135#ifdef DEBUG
    136         for(i=0; i<5; i++){
    137                 printk("PCI: BAR%d: 0x%x\n\r",i,cc1.bars[i]);
    138         }
    139 #endif
    140 
    141         /* Set up PCI ==> AMBA */
    142         pcib = (void *)cc1.bars[0];
    143         pcib->bar0 = 0xfc000000;
    144 /*      pcib->bar1 = 0xff000000;*/
     136  for(i=0; i<5; i++){
     137    printk("PCI: BAR%d: 0x%x\n\r",i,cc1.bars[i]);
     138  }
     139#endif
     140
     141  /* Set up PCI ==> AMBA */
     142  pcib = (void *)cc1.bars[0];
     143  pcib->bar0 = 0xfc000000;
     144  /*  pcib->bar1 = 0xff000000;*/
    145145#ifdef BOARD_INFO
    146         printk("Found CCHIP1 Board at 0x%lx\n\r",(unsigned int)pcib);
    147 #endif
    148 
    149         /* AMBA MAP cc1.bars[1] (in CPU) ==> 0xf0000000(remote amba address) */
    150         cc1.amba_maps[0].size = 0x04000000;
    151         cc1.amba_maps[0].local_adr = cc1.bars[1];
    152         cc1.amba_maps[0].remote_adr = 0xfc000000;
    153 
    154         /* Mark end of table */
    155         cc1.amba_maps[1].size=0;
    156         cc1.amba_maps[1].local_adr = 0;
    157         cc1.amba_maps[1].remote_adr = 0;
    158 
    159         /* Enable I/O and Mem accesses */
    160         pci_read_config_dword(bus, dev, fun, 0x4, &com1);
    161         com1 |= 0x3;
    162         pci_write_config_dword(bus, dev, fun, 0x4, com1);
    163         pci_read_config_dword(bus, dev, fun, 0x4, &com1);
    164 
    165         /* Set up AMBA Masters ==> PCI */
    166         ambab = (void *)(cc1.bars[1]+0x400);
     146  printk("Found CCHIP1 Board at 0x%lx\n\r",(unsigned int)pcib);
     147#endif
     148
     149  /* AMBA MAP cc1.bars[1] (in CPU) ==> 0xf0000000(remote amba address) */
     150  cc1.amba_maps[0].size = 0x04000000;
     151  cc1.amba_maps[0].local_adr = cc1.bars[1];
     152  cc1.amba_maps[0].remote_adr = 0xfc000000;
     153
     154  /* Mark end of table */
     155  cc1.amba_maps[1].size=0;
     156  cc1.amba_maps[1].local_adr = 0;
     157  cc1.amba_maps[1].remote_adr = 0;
     158
     159  /* Enable I/O and Mem accesses */
     160  pci_read_config_dword(bus, dev, fun, 0x4, &com1);
     161  com1 |= 0x3;
     162  pci_write_config_dword(bus, dev, fun, 0x4, com1);
     163  pci_read_config_dword(bus, dev, fun, 0x4, &com1);
     164
     165  /* Set up AMBA Masters ==> PCI */
     166  ambab = (void *)(cc1.bars[1]+0x400);
    167167#ifdef DEBUG
    168         printk("AMBA: PCIBAR[%d]: 0x%x, 0x%x\n\r",0,ambab->bar0,pcib->bar0);
    169         printk("AMBA: PCIBAR[%d]: 0x%x, 0x%x\n\r",1,ambab->bar1,pcib->bar1);
    170         printk("AMBA: PCIBAR[%d]: 0x%x, 0x%x\n\r",2,ambab->bar2,pcib->bar2);
    171 #endif
    172         /* 0xe0000000(AMBA) ==> 0x40000000(PCI) ==> 0x40000000(AT697 AMBA) */
    173         ambab->ambabars[0] = 0x40000000;
    174 
    175         /* Scan bus for AMBA devices */
    176         abus = &cc1.amba_bus;
    177         memset(abus,0,sizeof(*abus));
    178         ambapp_scan(abus, cc1.bars[1]+0x3f00000, NULL, &cc1.amba_maps[0]);
    179 
    180         /* Init all msters, max 16 */
    181         for(i=1; i<16; i++) {
    182                 ambab->ambabars[i] = 0x40000000;
    183                 if (READ_REG(&ambab->ambabars[i]) != 0x40000000)
    184                         break;
    185         }
    186 
    187         /* Enable PCI Master */
     168  printk("AMBA: PCIBAR[%d]: 0x%x, 0x%x\n\r",0,ambab->bar0,pcib->bar0);
     169  printk("AMBA: PCIBAR[%d]: 0x%x, 0x%x\n\r",1,ambab->bar1,pcib->bar1);
     170  printk("AMBA: PCIBAR[%d]: 0x%x, 0x%x\n\r",2,ambab->bar2,pcib->bar2);
     171#endif
     172  /* 0xe0000000(AMBA) ==> 0x40000000(PCI) ==> 0x40000000(AT697 AMBA) */
     173  ambab->ambabars[0] = 0x40000000;
     174
     175  /* Scan bus for AMBA devices */
     176  abus = &cc1.amba_bus;
     177  memset(abus,0,sizeof(*abus));
     178  ambapp_scan(abus, cc1.bars[1]+0x3f00000, NULL, &cc1.amba_maps[0]);
     179
     180  /* Init all msters, max 16 */
     181  for(i=1; i<16; i++) {
     182    ambab->ambabars[i] = 0x40000000;
     183    if (READ_REG(&ambab->ambabars[i]) != 0x40000000)
     184      break;
     185  }
     186
     187  /* Enable PCI Master */
    188188   pci_read_config_dword(bus, dev, fun, 0x4, &com1);
    189189   com1 |= 0x4;
     
    191191   pci_read_config_dword(bus, dev, fun, 0x4, &com1);
    192192
    193         cc1.pcib  = pcib;
    194         cc1.ambab = ambab;
    195         cc1.bus = bus;
    196         cc1.dev = dev;
    197         cc1.fun = fun;
    198 
    199         return 0;
     193  cc1.pcib  = pcib;
     194  cc1.ambab = ambab;
     195  cc1.bus = bus;
     196  cc1.dev = dev;
     197  cc1.fun = fun;
     198
     199  return 0;
    200200}
    201201
     
    204204#endif
    205205int init_onboard_sram(void){
    206         struct ambapp_ahb_info ahb;
    207         struct ambapp_apb_info apb;
    208         unsigned int conf, size;
    209 
    210         /* Find SRAM controller
    211         * 1. AHB slave interface
    212         * 2. APB slave interface
    213         */
    214         if ( ambapp_find_apbslv(&cc1.amba_bus, VENDOR_GAISLER, GAISLER_FTAHBRAM,
    215                                 &apb) != 1 ){
    216                 printk("On Board FT SRAM not found (APB)\n");
    217                 return -1;
    218         }
    219 
    220         if ( ambapp_find_ahbslv(&cc1.amba_bus, VENDOR_GAISLER, GAISLER_FTAHBRAM,
    221                                 &ahb) != 1 ){
    222                 printk("On Board FT SRAM not found (AHB)\n");
    223                 return -1;
    224         }
    225 
    226         /* We have found the controller.
    227         * Get it going.
    228         *
    229         * Get size of SRAM
    230         */
    231         conf = *(unsigned int *)apb.start;
    232         size = (conf >>10) & 0x7;
    233 
    234         /* 2^x kb */
    235         cc1.ftsram_size = 1<<size;
    236         cc1.ftsram_start = ahb.start[0];
    237         cc1.ftsram_end = size*1024 + cc1.ftsram_start;
     206  struct ambapp_ahb_info ahb;
     207  struct ambapp_apb_info apb;
     208  unsigned int conf, size;
     209
     210  /* Find SRAM controller
     211  * 1. AHB slave interface
     212  * 2. APB slave interface
     213  */
     214  if ( ambapp_find_apbslv(&cc1.amba_bus, VENDOR_GAISLER,
     215      GAISLER_FTAHBRAM, &apb) != 1 ){
     216    printk("On Board FT SRAM not found (APB)\n");
     217    return -1;
     218  }
     219
     220  if ( ambapp_find_ahbslv(&cc1.amba_bus, VENDOR_GAISLER,
     221      GAISLER_FTAHBRAM, &ahb) != 1 ){
     222    printk("On Board FT SRAM not found (AHB)\n");
     223    return -1;
     224  }
     225
     226  /* We have found the controller.
     227  * Get it going.
     228  *
     229  * Get size of SRAM
     230  */
     231  conf = *(unsigned int *)apb.start;
     232  size = (conf >>10) & 0x7;
     233
     234  /* 2^x kb */
     235  cc1.ftsram_size = 1<<size;
     236  cc1.ftsram_start = ahb.start[0];
     237  cc1.ftsram_end = size*1024 + cc1.ftsram_start;
    238238#ifdef BOARD_INFO
    239         printk("Found FT AHB SRAM %dkb at 0x%lx\n",cc1.ftsram_size,cc1.ftsram_start);
    240 #endif
    241         return 0;
     239  printk("Found FT AHB SRAM %dkb at 0x%lx\n",cc1.ftsram_size,cc1.ftsram_start);
     240#endif
     241  return 0;
    242242}
    243243
    244244int cchip1_register(void){
    245245
    246         /* Init AT697 PCI Controller */
    247         init_pci();
    248 
    249         /* Find & init CChip board .
    250         * Also scan AMBA Plug&Play info for us.
    251         */
    252         if ( init_pcif() ){
    253                 printk("Failed to initialize CCHIP board\n\r");
    254                 return -1;
    255         }
    256 
    257         /* Set interrupt common board stuff */
    258         cchip1_irq_init();
    259 
    260         /* Find on board SRAM */
    261         if ( init_onboard_sram() ){
    262                 printk("Failed to register On Board SRAM. It is needed by b1553BRM\n");
    263                 return -1;
    264         }
    265 
    266         /* Register interrupt install functions */
    267         b1553brm_pci_int_reg = cchip1_set_isr;
    268         occan_pci_int_reg = cchip1_set_isr;
    269         grspw_pci_int_reg = cchip1_set_isr;
    270         apbuart_pci_int_reg = cchip1_set_isr;
    271 
    272         /* register the BRM PCI driver, use 16k FTSRAM... */
    273         if ( b1553brm_pci_register(&cc1.amba_bus,0,0,3,cc1.ftsram_start,0xffa00000) ){
    274                 printk("Failed to register BRM PCI driver\n");
    275                 return -1;
    276         }
    277 
    278         /* register the BRM PCI driver, no DMA memory... */
    279         if ( occan_pci_register(&cc1.amba_bus) ){
    280                 printk("Failed to register OC_CAN PCI driver\n");
    281                 return -1;
    282         }
    283 
    284         /* register the GRSPW PCI driver, use malloc... */
    285         if ( grspw_pci_register(&cc1.amba_bus,0,0xe0000000) ){
    286                 printk("Failed to register GRSPW PCI driver\n");
    287                 return -1;
    288         }
    289 
    290         /* register the APBUART PCI driver, no DMA memory */
    291         if ( apbuart_pci_register(&cc1.amba_bus) ){
    292                 printk("Failed to register APBUART PCI driver\n");
    293                 return -1;
    294         }
    295 
    296         return 0;
     246  /* Init AT697 PCI Controller */
     247  init_pci();
     248
     249  /* Find & init CChip board .
     250  * Also scan AMBA Plug&Play info for us.
     251  */
     252  if ( init_pcif() ){
     253    printk("Failed to initialize CCHIP board\n\r");
     254    return -1;
     255  }
     256
     257  /* Set interrupt common board stuff */
     258  cchip1_irq_init();
     259
     260  /* Find on board SRAM */
     261  if ( init_onboard_sram() ){
     262    printk("Failed to register On Board SRAM. It is needed by b1553BRM\n");
     263    return -1;
     264  }
     265
     266  /* Register interrupt install functions */
     267  b1553brm_pci_int_reg = cchip1_set_isr;
     268  occan_pci_int_reg = cchip1_set_isr;
     269  grspw_pci_int_reg = cchip1_set_isr;
     270  apbuart_pci_int_reg = cchip1_set_isr;
     271
     272  /* register the BRM PCI driver, use 16k FTSRAM... */
     273  if ( b1553brm_pci_register(&cc1.amba_bus,0,0,3,cc1.ftsram_start,0xffa00000) ){
     274    printk("Failed to register BRM PCI driver\n");
     275    return -1;
     276  }
     277
     278  /* register the BRM PCI driver, no DMA memory... */
     279  if ( occan_pci_register(&cc1.amba_bus) ){
     280    printk("Failed to register OC_CAN PCI driver\n");
     281    return -1;
     282  }
     283
     284  /* register the GRSPW PCI driver, use malloc... */
     285  if ( grspw_pci_register(&cc1.amba_bus,0,0xe0000000) ){
     286    printk("Failed to register GRSPW PCI driver\n");
     287    return -1;
     288  }
     289
     290  /* register the APBUART PCI driver, no DMA memory */
     291  if ( apbuart_pci_register(&cc1.amba_bus) ){
     292    printk("Failed to register APBUART PCI driver\n");
     293    return -1;
     294  }
     295
     296  return 0;
    297297}
    298298
     
    301301
    302302typedef struct {
    303         unsigned int (*handler)(int irqno, void *arg);
    304         void *arg;
     303  unsigned int (*handler)(int irqno, void *arg);
     304  void *arg;
    305305} int_handler;
    306306
     
    309309void cchip1_irq_init(void){
    310310
    311         /* Configure AT697 ioport bit 7 to input pci irq */
     311  /* Configure AT697 ioport bit 7 to input pci irq */
    312312  regs->PIO_Direction &= ~(1<<7);
    313313  regs->PIO_Interrupt  = 0x87;          /* level sensitive */
    314314
    315315  /* Set up irq controller (mask all IRQs) */
    316         cc1.pcib->imask = 0x0000;
    317         cc1.pcib->ipend = 0;
    318         cc1.pcib->iclear = 0xffff;
    319         cc1.pcib->iforce = 0;
    320         cc1.pcib->ilevel = 0x0;
    321 
    322         memset(int_handlers,0,sizeof(int_handlers));
    323 
    324         /* Reset spurious counter */
    325         cchip1_spurious_cnt = 0;
    326 
    327         /* Register interrupt handler */
    328         set_vector(cchip1_interrupt_dispatcher,LEON_TRAP_TYPE(CCHIP_IRQ),1);
     316  cc1.pcib->imask = 0x0000;
     317  cc1.pcib->ipend = 0;
     318  cc1.pcib->iclear = 0xffff;
     319  cc1.pcib->iforce = 0;
     320  cc1.pcib->ilevel = 0x0;
     321
     322  memset(int_handlers,0,sizeof(int_handlers));
     323
     324  /* Reset spurious counter */
     325  cchip1_spurious_cnt = 0;
     326
     327  /* Register interrupt handler */
     328  set_vector(cchip1_interrupt_dispatcher,LEON_TRAP_TYPE(CCHIP_IRQ),1);
    329329}
    330330
    331331void cchip1_set_isr(void *handler, int irqno, void *arg){
    332         int_handlers[irqno].handler = handler;
    333         int_handlers[irqno].arg = arg;
     332  int_handlers[irqno].handler = handler;
     333  int_handlers[irqno].arg = arg;
    334334#ifdef DEBUG
    335         printk("Registering IRQ %d to 0x%lx(%d,0x%lx)\n\r",
    336                         irqno,(unsigned int)handler,irqno,(unsigned int)arg);
    337 #endif
    338         cc1.pcib->imask |= 1<<irqno; /* Enable the registered IRQ */
     335  printk("Registering IRQ %d to 0x%lx(%d,0x%lx)\n\r",
     336      irqno,(unsigned int)handler,irqno,(unsigned int)arg);
     337#endif
     338  cc1.pcib->imask |= 1<<irqno; /* Enable the registered IRQ */
    339339}
    340340
    341341static rtems_isr cchip1_interrupt_dispatcher(rtems_vector_number v){
    342         unsigned int pending = READ_REG(&cc1.pcib->ipend);
    343         unsigned int (*handler)(int irqno, void *arg);
    344         unsigned int clr = pending;
    345         int irq=1;
    346 
    347         if ( !pending ){
     342  unsigned int pending = READ_REG(&cc1.pcib->ipend);
     343  unsigned int (*handler)(int irqno, void *arg);
     344  unsigned int clr = pending;
     345  int irq=1;
     346
     347  if ( !pending ){
    348348#ifdef PRINT_SPURIOUS
    349                 printk("Spurious IRQ %d: %d\n",v,cchip1_spurious_cnt);
    350 #endif
    351                 cchip1_spurious_cnt++;
    352                 return;
    353         }
     349    printk("Spurious IRQ %d: %d\n",v,cchip1_spurious_cnt);
     350#endif
     351    cchip1_spurious_cnt++;
     352    return;
     353  }
    354354#ifdef DEBUG_IRQS
    355355  printk("CCIRQ: 0x%x\n",(unsigned int)pending);
    356356#endif
    357         /* IRQ 0 doesn't exist */
    358         irq=1;
    359         pending = pending>>1;
    360 
    361         while ( pending ){
    362                 if ( (pending & 1) && (handler=int_handlers[irq].handler) ){
    363                         handler(irq,int_handlers[irq].arg);
    364                 }
    365                 irq++;
    366                 pending = pending>>1;
    367         }
    368 
    369         cc1.pcib->iclear = clr;
    370 
    371         /*LEON_Clear_interrupt( brd->irq );*/
    372 }
     357  /* IRQ 0 doesn't exist */
     358  irq=1;
     359  pending = pending>>1;
     360
     361  while ( pending ){
     362    if ( (pending & 1) && (handler=int_handlers[irq].handler) ){
     363      handler(irq,int_handlers[irq].arg);
     364    }
     365    irq++;
     366    pending = pending>>1;
     367  }
     368
     369  cc1.pcib->iclear = clr;
     370
     371  /*LEON_Clear_interrupt( brd->irq );*/
     372}
  • c/src/lib/libbsp/sparc/leon2/clock/ckinit.c

    rc903fc2 r9f058fb  
    4848  do { \
    4949    LEON_REG.Timer_Reload_1 = \
    50                 rtems_configuration_get_microseconds_per_tick() - 1; \
     50        rtems_configuration_get_microseconds_per_tick() - 1; \
    5151    \
    5252    LEON_REG.Timer_Control_1 = ( \
  • c/src/lib/libbsp/sparc/leon2/console/console.c

    rc903fc2 r9f058fb  
    323323  LEON_REG.UART_Control_1 |= LEON_REG_UART_CTRL_RE | LEON_REG_UART_CTRL_TE;
    324324  LEON_REG.UART_Control_2 |= LEON_REG_UART_CTRL_RE | LEON_REG_UART_CTRL_TE |
    325         LEON_REG_UART_CTRL_RI;  /* rx irq default enable for remote debugger */
     325      LEON_REG_UART_CTRL_RI;  /* rx irq default enable for remote debugger */
    326326  LEON_REG.UART_Status_1 = 0;
    327327  LEON_REG.UART_Status_2 = 0;
  • c/src/lib/libbsp/sparc/leon2/include/bsp.h

    rc903fc2 r9f058fb  
    7070  struct rtems_bsdnet_ifconfig *config
    7171);
    72 #define RTEMS_BSP_NETWORK_DRIVER_NAME   "open_eth1"
     72#define RTEMS_BSP_NETWORK_DRIVER_NAME "open_eth1"
    7373#define RTEMS_BSP_NETWORK_DRIVER_ATTACH_OPENETH \
    7474          rtems_leon_open_eth_driver_attach
  • c/src/lib/libbsp/sparc/leon2/include/leon.h

    rc903fc2 r9f058fb  
    103103
    104104typedef struct {
    105         volatile unsigned int Memory_Config_1;
    106         volatile unsigned int Memory_Config_2;
    107         volatile unsigned int Edac_Control;
    108         volatile unsigned int Failed_Address;
    109         volatile unsigned int Memory_Status;
    110         volatile unsigned int Cache_Control;
    111         volatile unsigned int Power_Down;
    112         volatile unsigned int Write_Protection_1;
    113         volatile unsigned int Write_Protection_2;
    114         volatile unsigned int Leon_Configuration;
    115         volatile unsigned int dummy2;
    116         volatile unsigned int dummy3;
    117         volatile unsigned int dummy4;
    118         volatile unsigned int dummy5;
    119         volatile unsigned int dummy6;
    120         volatile unsigned int dummy7;
    121         volatile unsigned int Timer_Counter_1;
    122         volatile unsigned int Timer_Reload_1;
    123         volatile unsigned int Timer_Control_1;
    124         volatile unsigned int Watchdog;
    125         volatile unsigned int Timer_Counter_2;
    126         volatile unsigned int Timer_Reload_2;
    127         volatile unsigned int Timer_Control_2;
    128         volatile unsigned int dummy8;
    129         volatile unsigned int Scaler_Counter;
    130         volatile unsigned int Scaler_Reload;
    131         volatile unsigned int dummy9;
    132         volatile unsigned int dummy10;
    133         volatile unsigned int UART_Channel_1;
    134         volatile unsigned int UART_Status_1;
    135         volatile unsigned int UART_Control_1;
    136         volatile unsigned int UART_Scaler_1;
    137         volatile unsigned int UART_Channel_2;
    138         volatile unsigned int UART_Status_2;
    139         volatile unsigned int UART_Control_2;
    140         volatile unsigned int UART_Scaler_2;
    141         volatile unsigned int Interrupt_Mask;
    142         volatile unsigned int Interrupt_Pending;
    143         volatile unsigned int Interrupt_Force;
    144         volatile unsigned int Interrupt_Clear;
    145         volatile unsigned int PIO_Data;
    146         volatile unsigned int PIO_Direction;
    147         volatile unsigned int PIO_Interrupt;
     105  volatile unsigned int Memory_Config_1;
     106  volatile unsigned int Memory_Config_2;
     107  volatile unsigned int Edac_Control;
     108  volatile unsigned int Failed_Address;
     109  volatile unsigned int Memory_Status;
     110  volatile unsigned int Cache_Control;
     111  volatile unsigned int Power_Down;
     112  volatile unsigned int Write_Protection_1;
     113  volatile unsigned int Write_Protection_2;
     114  volatile unsigned int Leon_Configuration;
     115  volatile unsigned int dummy2;
     116  volatile unsigned int dummy3;
     117  volatile unsigned int dummy4;
     118  volatile unsigned int dummy5;
     119  volatile unsigned int dummy6;
     120  volatile unsigned int dummy7;
     121  volatile unsigned int Timer_Counter_1;
     122  volatile unsigned int Timer_Reload_1;
     123  volatile unsigned int Timer_Control_1;
     124  volatile unsigned int Watchdog;
     125  volatile unsigned int Timer_Counter_2;
     126  volatile unsigned int Timer_Reload_2;
     127  volatile unsigned int Timer_Control_2;
     128  volatile unsigned int dummy8;
     129  volatile unsigned int Scaler_Counter;
     130  volatile unsigned int Scaler_Reload;
     131  volatile unsigned int dummy9;
     132  volatile unsigned int dummy10;
     133  volatile unsigned int UART_Channel_1;
     134  volatile unsigned int UART_Status_1;
     135  volatile unsigned int UART_Control_1;
     136  volatile unsigned int UART_Scaler_1;
     137  volatile unsigned int UART_Channel_2;
     138  volatile unsigned int UART_Status_2;
     139  volatile unsigned int UART_Control_2;
     140  volatile unsigned int UART_Scaler_2;
     141  volatile unsigned int Interrupt_Mask;
     142  volatile unsigned int Interrupt_Pending;
     143  volatile unsigned int Interrupt_Force;
     144  volatile unsigned int Interrupt_Clear;
     145  volatile unsigned int PIO_Data;
     146  volatile unsigned int PIO_Direction;
     147  volatile unsigned int PIO_Interrupt;
    148148} LEON_Register_Map;
    149149
     
    397397static inline unsigned int leon_r32_no_cache(uintptr_t addr)
    398398{
    399         unsigned int tmp;
    400         __asm__ volatile (" lda [%1] 1, %0\n" : "=r"(tmp) : "r"(addr));
    401         return tmp;
     399  unsigned int tmp;
     400  __asm__ volatile (" lda [%1] 1, %0\n" : "=r"(tmp) : "r"(addr));
     401  return tmp;
    402402}
    403403
  • c/src/lib/libbsp/sparc/leon2/include/rasta.h

    rc903fc2 r9f058fb  
    101101
    102102void uart_register(unsigned int baseaddr);
    103 rtems_device_driver uart_initialize(rtems_device_major_number  major,
    104                 rtems_device_minor_number  minor, void *arg);
     103rtems_device_driver uart_initialize(rtems_device_major_number major,
     104    rtems_device_minor_number  minor, void *arg);
    105105rtems_device_driver uart_open(rtems_device_major_number major,
    106                 rtems_device_minor_number minor, void *arg);
     106    rtems_device_minor_number minor, void *arg);
    107107rtems_device_driver uart_close(rtems_device_major_number major,
    108                 rtems_device_minor_number minor, void *arg);
     108    rtems_device_minor_number minor, void *arg);
    109109rtems_device_driver uart_read(rtems_device_major_number major,
    110                 rtems_device_minor_number minor, void *arg);
     110    rtems_device_minor_number minor, void *arg);
    111111rtems_device_driver uart_write(rtems_device_major_number major,
    112                 rtems_device_minor_number minor, void *arg);
     112    rtems_device_minor_number minor, void *arg);
    113113rtems_device_driver uart_control(rtems_device_major_number major,
    114                 rtems_device_minor_number minor, void *arg);
     114    rtems_device_minor_number minor, void *arg);
    115115
    116116
  • c/src/lib/libbsp/sparc/leon2/rasta/rasta.c

    rc903fc2 r9f058fb  
    346346    /* register the BRM RASTA driver, use 128k on RASTA SRAM... */
    347347    b1553brm_rasta_int_reg=rasta_interrrupt_register;
    348           if ( b1553brm_rasta_register(&abus,2,0,3,bar1,0x40000000) ){
     348    if ( b1553brm_rasta_register(&abus,2,0,3,bar1,0x40000000) ){
    349349      printk("Failed to register BRM RASTA driver\n");
    350350      return -1;
  • c/src/lib/libbsp/sparc/leon2/startup/spurious.c

    rc903fc2 r9f058fb  
    149149
    150150    if (( trap == 5 || trap == 6 ) ||
    151         (( trap >= 0x11 ) && ( trap <= 0x1f )) ||
    152         (( trap >= 0x70 ) && ( trap <= 0x83 )))
     151        (( trap >= 0x11 ) && ( trap <= 0x1f )) ||
     152        (( trap >= 0x70 ) && ( trap <= 0x83 )))
    153153      continue;
    154154
  • c/src/lib/libbsp/sparc/leon3/include/bsp.h

    rc903fc2 r9f058fb  
    8080);
    8181
    82 #define RTEMS_BSP_NETWORK_DRIVER_NAME_OPENETH   "open_eth1"
    83 #define RTEMS_BSP_NETWORK_DRIVER_ATTACH_OPENETH  \
     82#define RTEMS_BSP_NETWORK_DRIVER_NAME_OPENETH "open_eth1"
     83#define RTEMS_BSP_NETWORK_DRIVER_ATTACH_OPENETH  \
    8484    rtems_leon_open_eth_driver_attach
    85 #define RTEMS_BSP_NETWORK_DRIVER_NAME_SMC91111  "smc_eth1"
     85#define RTEMS_BSP_NETWORK_DRIVER_NAME_SMC91111 "smc_eth1"
    8686#define RTEMS_BSP_NETWORK_DRIVER_ATTACH_SMC91111 \
    8787    rtems_smc91111_driver_attach_leon3
    88 #define RTEMS_BSP_NETWORK_DRIVER_NAME_GRETH      "gr_eth1"
     88#define RTEMS_BSP_NETWORK_DRIVER_NAME_GRETH "gr_eth1"
    8989#define RTEMS_BSP_NETWORK_DRIVER_ATTACH_GRETH \
    9090    rtems_leon_greth_driver_attach
  • c/src/lib/libbsp/sparc/leon3/include/leon.h

    rc903fc2 r9f058fb  
    288288static inline unsigned int leon_r32_no_cache(uintptr_t addr)
    289289{
    290         unsigned int tmp;
    291         __asm__ volatile (" lda [%1] 1, %0\n" : "=r"(tmp) : "r"(addr));
    292         return tmp;
     290  unsigned int tmp;
     291  __asm__ volatile (" lda [%1] 1, %0\n" : "=r"(tmp) : "r"(addr));
     292  return tmp;
    293293}
    294294
  • c/src/lib/libbsp/sparc/leon3/leon_smc91111/leon_smc91111.c

    rc903fc2 r9f058fb  
    3737int
    3838rtems_smc91111_driver_attach_leon3 (struct rtems_bsdnet_ifconfig *config,
    39                                     int attach)
     39    int attach)
    4040{
    4141  unsigned long addr_mctrl = 0;
     
    7171  io = (struct grgpio_regs *) apbpio.start;
    7272
    73   printk(
    74         "Activating Leon3 io port for smsc_lan91cxx (pio:%x mctrl:%x)\n",
    75         (unsigned int)io,
    76         (unsigned int)addr_mctrl);
     73  printk("Activating Leon3 io port for smsc_lan91cxx (pio:%x mctrl:%x)\n",
     74      (unsigned int)io, (unsigned int)addr_mctrl);
    7775
    7876  /* Setup PIO IRQ */
     
    8482  /* Setup memory controller I/O waitstates */
    8583  *((volatile unsigned int *) addr_mctrl) |=
    86                   0x10f80000;   /* enable I/O area access */
     84      0x10f80000; /* enable I/O area access */
    8785
    8886  return _rtems_smc91111_driver_attach(config, &leon_scmv91111_configuration);
  • c/src/lib/libbsp/sparc/leon3/shmsupp/lock.c

    rc903fc2 r9f058fb  
    4545    ".text\n"
    4646    ".align 4\n"
    47 "LEON3_Atomic_Swap:\n"
    48 "       retl\n"
    49 "       swapa [%o1] 1, %o0\n"
     47    "LEON3_Atomic_Swap:\n"
     48    "  retl\n"
     49    "  swapa [%o1] 1, %o0\n"
    5050);
    5151
  • c/src/lib/libbsp/sparc/leon3/startup/spurious.c

    rc903fc2 r9f058fb  
    153153
    154154    if (( trap == 5 || trap == 6 ) ||
    155         (( trap >= 0x11 ) && ( trap <= 0x1f )) ||
    156         (( trap >= 0x70 ) && ( trap <= 0x83 )))
     155        (( trap >= 0x11 ) && ( trap <= 0x1f )) ||
     156        (( trap >= 0x70 ) && ( trap <= 0x83 )))
    157157      continue;
    158158
Note: See TracChangeset for help on using the changeset viewer.