sonata: now using a macro to set default baud rate This will allow the default baud rate to be set from the board configuration.
diff --git a/sdk/boards/sonata-0.2.json b/sdk/boards/sonata-0.2.json index 6faa442..308904a 100644 --- a/sdk/boards/sonata-0.2.json +++ b/sdk/boards/sonata-0.2.json
@@ -71,6 +71,7 @@ "SUNBURST", "SUNBURST_SHADOW_BASE=0x30000000", "SUNBURST_SHADOW_SIZE=0x4000", + "DEFAULT_UART_BAUD_RATE=115200", "ipconfigDRIVER_INCLUDED_RX_IP_CHECKSUM=1", "ipconfigDRIVER_INCLUDED_TX_IP_CHECKSUM=1" ],
diff --git a/sdk/include/platform/sunburst/platform-uart.hh b/sdk/include/platform/sunburst/platform-uart.hh index 8ac457b..09f217d 100644 --- a/sdk/include/platform/sunburst/platform-uart.hh +++ b/sdk/include/platform/sunburst/platform-uart.hh
@@ -4,6 +4,10 @@ #include_next <platform-uart.hh> #pragma pop_macro("CHERIOT_PLATFORM_CUSTOM_UART") +#ifndef DEFAULT_UART_BAUD_RATE +# define DEFAULT_UART_BAUD_RATE 921'600 +#endif + /** * OpenTitan UART * @@ -236,7 +240,7 @@ interruptEnable = interruptEnable & ~interrupt; } - void init(unsigned baudRate = 115'200) volatile + void init(unsigned baudRate = DEFAULT_UART_BAUD_RATE) volatile { // Nco = 2^20 * baud rate / cpu frequency const uint32_t Nco =