]> git.sur5r.net Git - u-boot/blobdiff - drivers/ns9750_serial.c
[PATCH] Clean up Katmai (440SPe) linker script
[u-boot] / drivers / ns9750_serial.c
index aced3dae8e26ebcdb59a9065c2e076a587cef047..02c0d3952099c58cf4a8034adf55ae4f51ea8877 100644 (file)
 #include "ns9750_bbus.h"       /* for GPIOs */
 #include "ns9750_ser.h"                /* for serial configuration */
 
+DECLARE_GLOBAL_DATA_PTR;
+
+#if !defined(CONFIG_CONS_INDEX)
+#error "No console index specified."
+#endif
+
 #define CONSOLE CONFIG_CONS_INDEX
 
 static unsigned int calcBitrateRegister( void );
@@ -183,8 +189,6 @@ void serial_setbrg( void )
 
 static unsigned int calcBitrateRegister( void )
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        return ( NS9750_SER_BITRATE_EBIT |
                 NS9750_SER_BITRATE_CLKMUX_BCLK |
                 NS9750_SER_BITRATE_TMODE |
@@ -204,8 +208,6 @@ static unsigned int calcBitrateRegister( void )
 
 static unsigned int calcRxCharGapRegister( void )
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        return NS9750_SER_RX_CHAR_TIMER_TRUN;
 }