]> git.sur5r.net Git - u-boot/commitdiff
sparc: leon3: Updated serial driver to use CONFIG_CONS_INDEX
authorFrancois Retief <fgretief@spaceteq.co.za>
Fri, 30 Oct 2015 11:23:41 +0000 (13:23 +0200)
committerFrancois Retief <fgretief@spaceteq.co.za>
Thu, 3 Dec 2015 11:15:48 +0000 (13:15 +0200)
Updated the LEON3 serial driver to make use of the CONFIG_CONS_INDEX
option to select which serial port the console will use.

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>
arch/sparc/cpu/leon3/serial.c

index 5348a78303b6ab9d96348341b4a1818f749764ae..bc6e7a172e5f010990eb0a00ea7b130bfc0f0b99 100644 (file)
@@ -17,8 +17,13 @@ DECLARE_GLOBAL_DATA_PTR;
 
 /* Select which UART that will become u-boot console */
 #ifndef CONFIG_SYS_GRLIB_APBUART_INDEX
+/* Try to use CONFIG_CONS_INDEX, if available, it is numbered from 1 */
+#ifdef CONFIG_CONS_INDEX
+#define CONFIG_SYS_GRLIB_APBUART_INDEX (CONFIG_CONS_INDEX - 1)
+#else
 #define CONFIG_SYS_GRLIB_APBUART_INDEX 0
 #endif
+#endif
 
 static unsigned apbuart_calc_scaler(unsigned apbuart_freq, unsigned baud)
 {