Ignore:
Timestamp:
Jul 16, 2015, 12:14:32 PM (5 years ago)
Author:
Premysl Houdek <kom541000@…>
Branches:
4.11, master
Children:
7e14385
Parents:
602e395
git-author:
Premysl Houdek <kom541000@…> (07/16/15 12:14:32)
git-committer:
Joel Sherrill <joel.sherrill@…> (07/16/15 18:15:52)
Message:

bsp/tms570: source changes reflecting new headers.

Signed-off-by: Premysl Houdek <kom541000@…>

Location:
c/src/lib/libbsp/arm/tms570/console
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/arm/tms570/console/printk-support.c

    r602e395 r069560a  
    4242
    4343  rtems_interrupt_disable(level);
    44   while ( ( driver_context_table[0].regs->SCIFLR & 0x100 ) == 0) {
     44  while ( ( driver_context_table[0].regs->FLR & 0x100 ) == 0) {
    4545    rtems_interrupt_flash(level);
    4646  }
    47   driver_context_table[0].regs->SCITD = ch;
     47  driver_context_table[0].regs->TD = ch;
    4848  rtems_interrupt_enable(level);
    4949}
     
    7575static int tms570_uart_input( void )
    7676{
    77   if ( driver_context_table[0].regs->SCIFLR & (1<<9) ) {
    78       return driver_context_table[0].regs->SCIRD;
     77  if ( driver_context_table[0].regs->FLR & (1<<9) ) {
     78      return driver_context_table[0].regs->RD;
    7979  } else {
    8080      return -1;
  • c/src/lib/libbsp/arm/tms570/console/tms570-sci.c

    r602e395 r069560a  
    4545    .base = RTEMS_TERMIOS_DEVICE_CONTEXT_INITIALIZER("TMS570 SCI1"),
    4646    .device_name = "/dev/console",
    47     .regs = &TMS570_SCI,
     47    /* TMS570 UART peripheral use subset of LIN registers which are equivalent
     48     * to SCI ones
     49     */
     50    .regs = (volatile tms570_sci_t *) &TMS570_LIN,
    4851    .irq = TMS570_IRQ_SCI_LEVEL_0,
    4952  },
     
    5154    .base = RTEMS_TERMIOS_DEVICE_CONTEXT_INITIALIZER("TMS570 SCI2"),
    5255    .device_name = "/dev/ttyS1",
    53     .regs = &TMS570_SCI2,
     56    .regs = &TMS570_SCI,
    5457    .irq = TMS570_IRQ_SCI2_LEVEL_0,
    5558  }
     
    135138    return 0;
    136139  }
    137   if ( ctx->regs->SCIRD != 0 ) {
    138      buf[0] = ctx->regs->SCIRD;
     140  if ( ctx->regs->RD != 0 ) {
     141     buf[0] = ctx->regs->RD;
    139142    return 1;
    140143  }
     
    153156static void tms570_sci_enable_interrupts(tms570_sci_context * ctx)
    154157{
    155   ctx->regs->SCISETINT = (1<<9);
     158  ctx->regs->SETINT = (1<<9);
    156159}
    157160
     
    167170static void tms570_sci_disable_interrupts(tms570_sci_context * ctx)
    168171{
    169   ctx->regs->SCICLEARINT = (1<<9);
     172  ctx->regs->CLEARINT = (1<<9);
    170173}
    171174
     
    214217  rtems_termios_device_lock_acquire(base, &lock_context);
    215218
    216   ctx->regs->SCIGCR1 &= ~( (1<<7) | (1<<25) | (1<<24) );
    217 
    218   ctx->regs->SCIGCR1 &= ~(1<<4);    /*one stop bit*/
    219   ctx->regs->SCIFORMAT = 0x7;
     219  ctx->regs->GCR1 &= ~( (1<<7) | (1<<25) | (1<<24) );
     220
     221  ctx->regs->GCR1 &= ~(1<<4);    /*one stop bit*/
     222  ctx->regs->FORMAT = 0x7;
    220223
    221224  switch ( t->c_cflag & ( PARENB|PARODD ) ) {
    222225    case ( PARENB|PARODD ):
    223226      /* Odd parity */
    224       ctx->regs->SCIGCR1 &= ~(1<<3);
    225       ctx->regs->SCIGCR1 |= (1<<2);
     227      ctx->regs->GCR1 &= ~(1<<3);
     228      ctx->regs->GCR1 |= (1<<2);
    226229      break;
    227230
    228231    case PARENB:
    229232      /* Even parity */
    230       ctx->regs->SCIGCR1 |= (1<<3);
    231       ctx->regs->SCIGCR1 |= (1<<2);
     233      ctx->regs->GCR1 |= (1<<3);
     234      ctx->regs->GCR1 |= (1<<2);
    232235      break;
    233236
     
    236239    case PARODD:
    237240      /* No Parity */
    238       ctx->regs->SCIGCR1 &= ~(1<<2);
     241      ctx->regs->GCR1 &= ~(1<<2);
    239242  }
    240243
     
    245248  ctx->regs->BRS = bauddiv;
    246249
    247   ctx->regs->SCIGCR1 |= (1<<7) | (1<<25) | (1<<24);
     250  ctx->regs->GCR1 |= (1<<7) | (1<<25) | (1<<24);
    248251
    249252  rtems_termios_device_lock_release(base, &lock_context);
     
    272275   * Check if we have received something.
    273276   */
    274    if ( (ctx->regs->SCIFLR & (1<<9) ) == (1<<9) ) {
     277   if ( (ctx->regs->FLR & (1<<9) ) == (1<<9) ) {
    275278      n = tms570_sci_read_received_chars(ctx, buf, TMS570_SCI_BUFFER_SIZE);
    276279      if ( n > 0 ) {
     
    282285   * Check if we have something transmitted.
    283286   */
    284   if ( (ctx->regs->SCIFLR & (1<<8) ) == (1<<8) ) {
     287  if ( (ctx->regs->FLR & (1<<8) ) == (1<<8) ) {
    285288    n = tms570_sci_transmitted_chars(ctx);
    286289    if ( n > 0 ) {
     
    317320  if ( len > 0 ) {
    318321    /* start UART TX, this will result in an interrupt when done */
    319     ctx->regs->SCITD = *buf;
     322    ctx->regs->TD = *buf;
    320323    /* character written - raise count*/
    321324    ctx->tx_chars_in_hw = 1;
    322325    /* Enable TX interrupt (interrupt is edge-triggered) */
    323     ctx->regs->SCISETINT = (1<<8);
     326    ctx->regs->SETINT = (1<<8);
    324327
    325328  } else {
    326329    /* No more to send, disable TX interrupts */
    327     ctx->regs->SCICLEARINT = (1<<8);
     330    ctx->regs->CLEARINT = (1<<8);
    328331    /* Tell close that we sent everything */
    329332  }
     
    353356
    354357  for ( i = 0; i < n; ++i ) {
    355     while ( (ctx->regs->SCIFLR & (1<<11) ) == 0) {
     358    while ( (ctx->regs->FLR & (1<<11) ) == 0) {
    356359      ;
    357360    }
    358     ctx->regs->SCITD = buf[i];
     361    ctx->regs->TD = buf[i];
    359362  }
    360363}
     
    373376)
    374377{
    375   return ctx->regs->SCIFLR & (1<<9);
     378  return ctx->regs->FLR & (1<<9);
    376379}
    377380
     
    388391)
    389392{
    390   return ctx->regs->SCIRD;
     393  return ctx->regs->RD;
    391394}
    392395
     
    469472    return false;
    470473  }
    471   ctx->regs->SCISETINTLVL = 0;
     474  ctx->regs->SETINTLVL = 0;
    472475  /* Register Interrupt handler */
    473476  sc = rtems_interrupt_handler_install(ctx->irq,
     
    528531
    529532  /* Flush device */
    530   while ( ( ctx->regs->SCIFLR & (1<<11) ) > 0 ) {
     533  while ( ( ctx->regs->FLR & (1<<11) ) > 0 ) {
    531534    ;/* Wait until all data has been sent */
    532535  }
Note: See TracChangeset for help on using the changeset viewer.