Changeset d830414e in rtems


Ignore:
Timestamp:
Dec 7, 2015, 3:59:35 PM (4 years ago)
Author:
Pavel Pisa <pisa@…>
Branches:
4.11
Children:
ea41bcc
Parents:
9d09f497
git-author:
Pavel Pisa <pisa@…> (12/07/15 15:59:35)
git-committer:
Pavel Pisa <pisa@…> (10/02/16 09:31:18)
Message:

bsp/tms570: include complete peripheral initialization to SCI driver.

Signed-off-by: Pavel Pisa <pisa@…>

File:
1 edited

Legend:

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

    r9d09f497 rd830414e  
    9696  ) {
    9797    tms570_sci_context *ctx = &driver_context_table[minor];
     98    uint32_t rx_pin = 1 << 1;
     99    uint32_t tx_pin = 1 << 2;
     100
     101    /* Resec SCI peripheral */
     102    ctx->regs->GCR0 = TMS570_SCI_GCR0_RESET * 0;
     103    ctx->regs->GCR0 = TMS570_SCI_GCR0_RESET * 1;
     104
     105    /* Clear all interrupt sources */
     106    ctx->regs->CLEARINT = 0xffffffff;
     107
     108    /* Map all interrupts to SCI INT0 line */
     109    ctx->regs->CLEARINTLVL = 0xffffffff;
     110
     111    ctx->regs->GCR1 = TMS570_SCI_GCR1_TXENA * 0 |
     112                      TMS570_SCI_GCR1_RXENA * 0 |
     113                      TMS570_SCI_GCR1_CONT * 0 | /* continue operation when debugged */
     114                      TMS570_SCI_GCR1_LOOP_BACK * 0 |
     115                      TMS570_SCI_GCR1_POWERDOWN * 0 |
     116                      TMS570_SCI_GCR1_SLEEP * 0 |
     117                      TMS570_SCI_GCR1_SWnRST * 0 | /* reset state */
     118                      TMS570_SCI_GCR1_CLOCK * 1 | /* internal clock */
     119                      TMS570_SCI_GCR1_TIMING_MODE * 1 |
     120                      TMS570_SCI_GCR1_COMM_MODE * 0;
     121
     122    /* Setup connection of SCI peripheral Rx and Tx  pins */
     123    ctx->regs->PIO0 = rx_pin * 1 | tx_pin * 1; /* Rx and Tx pins are not GPIO */
     124    ctx->regs->PIO3 = rx_pin * 0 | tx_pin * 0; /* Default output low  */
     125    ctx->regs->PIO1 = rx_pin * 0 | tx_pin * 0; /* Input when not used by SCI */
     126    ctx->regs->PIO6 = rx_pin * 0 | tx_pin * 0; /* No open drain */
     127    ctx->regs->PIO7 = rx_pin * 0 | tx_pin * 0; /* Pull-up/down enabled */
     128    ctx->regs->PIO8 = rx_pin * 1 | tx_pin * 1; /* Select pull-up */
     129
     130    /* Bring device out of software reset */
     131    ctx->regs->GCR1 |= TMS570_SCI_GCR1_SWnRST;
    98132
    99133    /*
     
    108142        minor,
    109143        handler,
    110         NULL,
     144        NULL,
    111145        &ctx->base
    112146    );
     
    474508    return false;
    475509  }
    476   ctx->regs->SETINTLVL = 0;
     510
    477511  /* Register Interrupt handler */
    478512  sc = rtems_interrupt_handler_install(ctx->irq,
Note: See TracChangeset for help on using the changeset viewer.