1 /* SPDX-License-Identifier: GPL-2.0-only */
4 #define CONSOLE_SPI_H 1
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
);
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
,
41 struct em100_msg_header
{
44 uint8_t em100_command
;
45 uint32_t msg_signature
;
51 struct em100_msg_header header
;
52 char data
[MAX_MSG_LENGTH
];
55 #endif /* CONSOLE_SPI_H */