soc/intel/xeon_sp/spr: Drop microcode constraints
[coreboot2.git] / src / include / console / spi.h
blob2eff0a890375a38cf0ac518e2e092e26224b5c68
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #ifndef CONSOLE_SPI_H
4 #define CONSOLE_SPI_H 1
6 #include <stdint.h>
8 void spiconsole_init(void);
9 void spiconsole_tx_byte(unsigned char c);
11 #define __CONSOLE_SPI_ENABLE__ (CONFIG(EM100PRO_SPI_CONSOLE) && \
12 (ENV_RAMSTAGE || (ENV_SMM && CONFIG(DEBUG_SMI))))
14 #if __CONSOLE_SPI_ENABLE__
15 static inline void __spiconsole_init(void) { spiconsole_init(); }
16 static inline void __spiconsole_tx_byte(u8 data)
18 spiconsole_tx_byte(data);
20 #else
21 static inline void __spiconsole_init(void) {}
22 static inline void __spiconsole_tx_byte(u8 data) {}
23 #endif /* __CONSOLE_SPI_ENABLE__ */
25 #define MAX_MSG_LENGTH 128
27 #define EM100_DEDICATED_CMD 0x11
28 #define EM100_UFIFO_CMD 0xC0
29 #define EM100_MSG_SIGNATURE 0x47364440
31 enum em100_message_types {
32 EM100_MSG_CHECKPOINT_1B = 0x01,
33 EM100_MSG_CHECKPOINT_2B,
34 EM100_MSG_CHECKPOINT_4B,
35 EM100_MSG_HEX,
36 EM100_MSG_ASCII,
37 EM100_MSG_TIMESTAMP,
38 EM100_MSG_LOOKUP
41 struct em100_msg_header {
42 uint8_t spi_command;
43 uint8_t reserved;
44 uint8_t em100_command;
45 uint32_t msg_signature;
46 uint8_t msg_type;
47 uint8_t msg_length;
48 } __packed;
50 struct em100_msg {
51 struct em100_msg_header header;
52 char data[MAX_MSG_LENGTH];
53 } __packed;
55 #endif /* CONSOLE_SPI_H */