aboutsummaryrefslogtreecommitdiffstats
path: root/Platforms/AMD/Styx/Binary/AmdModulePkg/Common/UartLineSettings.h
blob: 36df53426b52963869631c6c651614b5d16e8684 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/**
 * @file
 *
 * Generic UART line setting values. These are shared between UEFI and the SCP.
 *
 * @xrefitem bom "File Content Label" "Release Content"
 * @e project:      STYX
 * @e sub-project:  (TBD)
 * @e \$Revision$        @e  \$Date$
 *
 **/
/*****************************************************************************
 *
 *  Copyright 2015 - 2016 ADVANCED MICRO DEVICES, INC.  All Rights Reserved.
 *
 *  This program and the accompanying materials are licensed and made available
 *  under the terms and conditions of the BSD License which accompanies this
 *  distribution. The full text of the license may be found at
 *  http://opensource.org/licenses/bsd-license.php
 *
 *  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR
 *  IMPLIED.
 *
 * ***************************************************************************
 **/

#ifndef _UART_LINE_SETTINGS_H_
#define _UART_LINE_SETTINGS_H_

//#########################################################################
//#########################################################################
//#########################################################################
//        NOTE: This file shared between SCP and UEFI, make sure all     //
//              changes are reflected in both copies.                    //
//#########################################################################
//#########################################################################
//#########################################################################


/// UART Baudrate enum
typedef enum {
  /// This subset is defined/used in UEFI
  UART_BAUDRATE_9600    = 9600,       ///< 9600 Baudrate
  UART_BAUDRATE_19200   = 19200,      ///< 19200 Baudrate
  UART_BAUDRATE_38400   = 38400,      ///< 38400 Baudrate
  UART_BAUDRATE_57600   = 57600,      ///< 57600 Baudrate
  UART_BAUDRATE_115200  = 115200,     ///< 115200 Baudrate

  /// These could be used within the SCP.
  UART_BAUDRATE_110     = 110,        ///< 110 Baudrate
  UART_BAUDRATE_300     = 300,        ///< 300 Baudrate
  UART_BAUDRATE_600     = 600,        ///< 600 Baudrate
  UART_BAUDRATE_1200    = 1200,       ///< 1200 Baudrate
  UART_BAUDRATE_2400    = 2400,       ///< 2400 Baudrate
  UART_BAUDRATE_4800    = 4800,       ///< 4800 Baudrate
  UART_BAUDRATE_14400   = 14400,      ///< 14400 Baudrate
  UART_BAUDRATE_230400  = 230400,     ///< 230400 Baudrate
  UART_BAUDRATE_460800  = 460800,     ///< 460800 Baudrate
  UART_BAUDRATE_921600  = 921600,     ///< 921600 Baudrate
} UART_BAUDRATE;

/// UART Parity enum
typedef enum {
  DEFAULT_PARITY = 0,                 ///< Default Parity
  NO_PARITY,                          ///< No Parity
  EVEN_PARITY,                        ///< Even Parity
  ODD_PARITY,                         ///< Odd Parity
  MARK_PARITY,                        ///< Mark Parity
  SPACE_PARITY                        ///< Space Parity
} UART_PARITY;

/// UART Stop Bit enum
typedef enum {
  UART_STOP_BIT_0 = 0,                 ///< No Stop Bits
  UART_STOP_BIT_1,                     ///< One Stop Bit
  UART_STOP_BIT_1_5,                   ///< One and One Half Stop bits
  UART_STOP_BIT_2                      ///< Two Stop Bits
} UART_STOP_BITS;

/// UART Data Length enum
typedef enum {
  UART_DATA_BITS_5 = 5,                ///< Five Data Bits
  UART_DATA_BITS_6,                    ///< Six Data Bits
  UART_DATA_BITS_7,                    ///< Seven Data Bits
  UART_DATA_BITS_8,                    ///< Eight Data Bits
} UART_DATA_BITS;

/// UART Line Settings structure
typedef struct _UART_LINE_SETTINGS {
  UART_BAUDRATE   BaudRate;            ///< UART Baudrate
  UART_DATA_BITS  DataBits;            ///< UART Data Bits
  UART_PARITY     Parity;              ///< UART Parity
  UART_STOP_BITS  StopBits;            ///< UART Stop Bits
} UART_LINE_SETTINGS;

#endif /* _UART_LINE_SETTINGS_H_ */