Changeset 0a36af04 in rtems


Ignore:
Timestamp:
Dec 14, 2014, 10:45:08 PM (5 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, master
Children:
1ae7baf
Parents:
93546b8
git-author:
Joel Sherrill <joel.sherrill@…> (12/14/14 22:45:08)
git-committer:
Joel Sherrill <joel.sherrill@…> (01/04/15 19:44:56)
Message:

pc386: Add BSP_ENABLE_COM1_COM4 BSP option

This allows the support for the legacy COM1-COM4 serial ports
to be completely disabled. It is needed to prevent hangs on some
hardware. In particular, the Intel Edison where it is not present.

Location:
c/src/lib/libbsp/i386/pc386
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/i386/pc386/configure.ac

    r93546b8 r0a36af04  
    2222[Set if the VGA and keyboard console support is enabled.])
    2323AM_CONDITIONAL(RTEMS_VGA,[test "$BSP_ENABLE_VGA" = "1"])
     24
     25RTEMS_BSPOPTS_SET([BSP_ENABLE_COM1_COM4],[*],[1])
     26RTEMS_BSPOPTS_HELP([BSP_ENABLE_COM1_COM4],
     27[Set if COM1..COM4 support is enabled.])
     28AM_CONDITIONAL(RTEMS_VGA,[test "$BSP_ENABLE_COM1_COM4" = "1"])
    2429
    2530RTEMS_BSPOPTS_SET([BSP_ENABLE_IDE],[*],[1])
  • c/src/lib/libbsp/i386/pc386/console/conscfg.c

    r93546b8 r0a36af04  
    3030#endif
    3131
    32 #if 0
    33 #define COM_CONSOLE_FUNCTIONS  &ns16550_fns_polled
    34 #else
    35 #define COM_CONSOLE_FUNCTIONS  &ns16550_fns
     32#if BSP_ENABLE_COM1_COM4
     33  #if 0
     34  #define COM_CONSOLE_FUNCTIONS  &ns16550_fns_polled
     35  #else
     36  #define COM_CONSOLE_FUNCTIONS  &ns16550_fns
     37  #endif
     38
     39  /*
     40   * Base IO for UART
     41   */
     42  #define COM1_BASE_IO  0x3F8
     43  #define COM2_BASE_IO  0x3E8
     44  #define COM3_BASE_IO  0x2F8
     45  #define COM4_BASE_IO  0x2E8
     46
     47  #define CLOCK_RATE     (115200 * 16)
     48
     49  static uint8_t com_get_register(uint32_t addr, uint8_t i)
     50  {
     51    register uint8_t val;
     52 
     53    inport_byte( (addr + i),val );
     54    return val;
     55  }
     56
     57  static void com_set_register(uint32_t addr, uint8_t i, uint8_t val)
     58  {
     59    outport_byte( (addr + i),val );
     60  }
    3661#endif
    37 
    38 /*
    39  * Base IO for UART
    40  */
    41 #define COM1_BASE_IO  0x3F8
    42 #define COM2_BASE_IO  0x3E8
    43 #define COM3_BASE_IO  0x2F8
    44 #define COM4_BASE_IO  0x2E8
    45 
    46 #define CLOCK_RATE     (115200 * 16)
    47 
    48 static uint8_t com_get_register(uint32_t addr, uint8_t i)
    49 {
    50   register uint8_t val;
    51  
    52   inport_byte( (addr + i),val );
    53   return val;
    54 }
    55 
    56 static void com_set_register(uint32_t addr, uint8_t i, uint8_t val)
    57 {
    58   outport_byte( (addr + i),val );
    59 }
    6062
    6163console_tbl     Console_Configuration_Ports[] = {
     
    8183  },
    8284#endif
     85#if BSP_ENABLE_COM1_COM4
    8386  {
    8487    "/dev/com1",                           /* sDeviceName */
     
    159162    BSP_UART_COM4_IRQ                      /* ulIntVector -- base for port */
    160163  },
     164#endif
    161165
    162166};
  • c/src/lib/libbsp/i386/pc386/console/printk_support.c

    r93546b8 r0a36af04  
    3030rtems_device_minor_number         BSPPrintkPort = 0;
    3131
    32 int ns16550_inbyte_nonblocking_polled(
    33   int minor
    34 );
     32#if BSP_ENABLE_COM1_COM4
     33int ns16550_inbyte_nonblocking_polled( int minor );
     34#endif
    3535
    3636void BSP_outch(char ch);
     
    5353int BSP_inch(void)
    5454{
    55   int           result;
     55  int           result = -1;
    5656
    5757  #if BSP_ENABLE_VGA
     
    6060    } else
    6161  #endif
     62  #if BSP_ENABLE_COM1_COM4
    6263    {
    6364      do {
     
    6566      } while (result == -1);
    6667    }
     68  #endif
    6769  return result;
    6870}
Note: See TracChangeset for help on using the changeset viewer.