diff --git a/src/target/firmware/apps/loader/main.c b/src/target/firmware/apps/loader/main.c
index b849090..13c3989 100644
--- a/src/target/firmware/apps/loader/main.c
+++ b/src/target/firmware/apps/loader/main.c
@@ -39,6 +39,7 @@
 #include <rf/trf6151.h>
 
 #include <comm/sercomm.h>
+#include <board.h>
 
 #include <calypso/clock.h>
 #include <calypso/tpu.h>
@@ -66,7 +67,7 @@ static void flush_uart(void)
 {
 	unsigned i;
 	for (i = 0; i < 500; i++) {
-		uart_poll(SERCOMM_UART_NR);
+		uart_poll(get_sercomm_uart_nr());
 		delay_ms(1);
 	}
 }
@@ -145,8 +146,8 @@ int main(void)
 	bl_level(50);
 
 	/* Initialize UART without interrupts */
-	uart_init(SERCOMM_UART_NR, 0);
-	uart_baudrate(SERCOMM_UART_NR, UART_115200);
+	uart_init(get_sercomm_uart_nr(), 0);
+	uart_baudrate(get_sercomm_uart_nr(), UART_115200);
 
 	/* Initialize HDLC subsystem */
 	sercomm_init();
@@ -189,7 +190,7 @@ int main(void)
 	/* Wait for events */
 	while (1) {
 		keypad_poll();
-		uart_poll(SERCOMM_UART_NR);
+		uart_poll(get_sercomm_uart_nr());
 	}
 
 	/* NOT REACHED */
diff --git a/src/target/firmware/board/compal_e86/init.c b/src/target/firmware/board/compal_e86/init.c
index 2d463cb..2a705d4 100644
--- a/src/target/firmware/board/compal_e86/init.c
+++ b/src/target/firmware/board/compal_e86/init.c
@@ -52,6 +52,18 @@
 #define IO_CNTL_REG	0xfffe4804
 #define ASIC_CONF_REG	0xfffef008
 
+/* We want the console on UART 0 (IRDA UART) */
+uint8_t get_uart_nr(void)
+{
+	return 0;
+}
+
+/* SERCOMM layer on UART1 (modem UART) */
+uint8_t get_sercomm_uart_nr(void)
+{
+	return 1;
+}
+
 static void board_io_init(void)
 {
 	uint16_t reg;
@@ -108,13 +120,13 @@ void board_init(void)
 	irq_init();
 
 	/* initialize MODEM UART to be used for sercomm*/
-	uart_init(SERCOMM_UART_NR, 1);
-	uart_baudrate(SERCOMM_UART_NR, UART_115200);
+	uart_init(get_sercomm_uart_nr(), 1);
+	uart_baudrate(get_sercomm_uart_nr(), UART_115200);
 
 	/* initialize IRDA UART to be used for old-school console code.
 	 * note: IRDA uart only accessible on C115 and C117 PCB */
-	uart_init(CONS_UART_NR, 1);
-	uart_baudrate(CONS_UART_NR, UART_115200);
+	uart_init(get_uart_nr(), 1);
+	uart_baudrate(get_uart_nr(), UART_115200);
 
 	/* Initialize hardware timers */
 	hwtimer_init();
diff --git a/src/target/firmware/board/compal_e88/init.c b/src/target/firmware/board/compal_e88/init.c
index 2e95731..94f07c0 100755
--- a/src/target/firmware/board/compal_e88/init.c
+++ b/src/target/firmware/board/compal_e88/init.c
@@ -51,6 +51,18 @@
 #define IO_CNTL_REG	0xfffe4804
 #define ASIC_CONF_REG	0xfffef008
 
+/* We want the console on UART 0 (IRDA UART) */
+uint8_t get_uart_nr(void)
+{
+	return 0;
+}
+
+/* SERCOMM layer on UART1 (modem UART) */
+uint8_t get_sercomm_uart_nr(void)
+{
+	return 1;
+}
+
 static void board_io_init(void)
 {
 	uint16_t reg;
@@ -103,13 +115,13 @@ void board_init(void)
 	irq_init();
 
 	/* initialize MODEM UART to be used for sercomm*/
-	uart_init(SERCOMM_UART_NR, 1);
-	uart_baudrate(SERCOMM_UART_NR, UART_115200);
+	uart_init(get_sercomm_uart_nr(), 1);
+	uart_baudrate(get_sercomm_uart_nr(), UART_115200);
 
 	/* Initialize IRDA UART to be used for old-school console code.
 	 * note: IRDA uart only accessible on C115 and C117 PCB */
-	uart_init(CONS_UART_NR, 1);
-	uart_baudrate(CONS_UART_NR, UART_115200);
+	uart_init(get_uart_nr(), 1);
+	uart_baudrate(get_uart_nr(), UART_115200);
 
 	/* Initialize hardware timers */
 	hwtimer_init();
diff --git a/src/target/firmware/board/compal_e99/init.c b/src/target/firmware/board/compal_e99/init.c
index 31eb978..653f300 100644
--- a/src/target/firmware/board/compal_e99/init.c
+++ b/src/target/firmware/board/compal_e99/init.c
@@ -52,6 +52,18 @@
 #define IO_CNTL_REG	0xfffe4804
 #define ASIC_CONF_REG	0xfffef008
 
+/* We want the console on UART 0 (IRDA UART) */
+uint8_t get_uart_nr(void)
+{
+	return 0;
+}
+
+/* SERCOMM layer on UART1 (modem UART) */
+uint8_t get_sercomm_uart_nr(void)
+{
+	return 1;
+}
+
 static void board_io_init(void)
 {
 	uint16_t reg;
@@ -108,13 +120,13 @@ void board_init(void)
 	irq_init();
 
 	/* initialize MODEM UART to be used for sercomm*/
-	uart_init(SERCOMM_UART_NR, 1);
-	uart_baudrate(SERCOMM_UART_NR, UART_115200);
+	uart_init(get_sercomm_uart_nr(), 1);
+	uart_baudrate(get_sercomm_uart_nr(), UART_115200);
 
 	/* initialize IRDA UART to be used for old-school console code.
 	 * note: IRDA uart only accessible on C115 and C117 PCB */
-	uart_init(CONS_UART_NR, 1);
-	uart_baudrate(CONS_UART_NR, UART_115200);
+	uart_init(get_uart_nr(), 1);
+	uart_baudrate(get_uart_nr(), UART_115200);
 
 	/* Initialize hardware timers */
 	hwtimer_init();
diff --git a/src/target/firmware/board/gta0x/init.c b/src/target/firmware/board/gta0x/init.c
index d125e15..240f81a 100644
--- a/src/target/firmware/board/gta0x/init.c
+++ b/src/target/firmware/board/gta0x/init.c
@@ -49,6 +49,18 @@
 #define IO_CNTL_REG	0xfffe4804
 #define ASIC_CONF_REG	0xfffef008
 
+/* We want the console on UART 0 (IRDA UART) */
+uint8_t get_uart_nr(void)
+{
+	return 0;
+}
+
+/* SERCOMM layer on UART1 (modem UART) */
+uint8_t get_sercomm_uart_nr(void)
+{
+	return 1;
+}
+
 static void board_io_init(void)
 {
 	uint16_t reg;
@@ -101,13 +113,13 @@ void board_init(void)
 	irq_init();
 
 	/* initialize MODEM UART to be used for sercomm*/
-	uart_init(SERCOMM_UART_NR, 1);
-	uart_baudrate(SERCOMM_UART_NR, UART_115200);
+	uart_init(get_sercomm_uart_nr(), 1);
+	uart_baudrate(get_sercomm_uart_nr(), UART_115200);
 
 	/* Initialize IRDA UART to be used for old-school console code.
 	 * note: IRDA uart only accessible on C115 and C117 PCB */
-	uart_init(CONS_UART_NR, 1);
-	uart_baudrate(CONS_UART_NR, UART_115200);
+	uart_init(get_uart_nr(), 1);
+	uart_baudrate(get_uart_nr(), UART_115200);
 
 	/* Initialize hardware timers */
 	hwtimer_init();
diff --git a/src/target/firmware/board/mediatek/uart.c b/src/target/firmware/board/mediatek/uart.c
index 8e86b20..28ce96f 100644
--- a/src/target/firmware/board/mediatek/uart.c
+++ b/src/target/firmware/board/mediatek/uart.c
@@ -35,6 +35,7 @@
 #include <console.h>
 
 #include <comm/sercomm.h>
+#include <board.h>
 
 /* MT622x */
 #if 0
@@ -191,7 +192,7 @@ static uint8_t uart_reg_read(int uart, enum uart_reg reg)
 
 static void uart_irq_handler_cons(__unused int irqnr)
 {
-	const uint8_t uart = CONS_UART_NR;
+	const uint8_t uart = get_uart_nr();
 	uint8_t iir;
 
 	//uart_putchar_nb(uart, 'U');
@@ -274,7 +275,7 @@ void uart_init(uint8_t uart, __unused uint8_t interrupts)
 	/* no interrupts, only polling so far */
 
 	uart_reg_write(uart, IER, 0x00);
-	if (uart == CONS_UART_NR) {
+	if (uart == get_uart_nr()) {
 		cons_init();
 	} else {
 		sercomm_init();
@@ -301,7 +302,7 @@ void uart_init(uint8_t uart, __unused uint8_t interrupts)
 }
 
 void uart_poll(uint8_t uart) {
-	if(uart == CONS_UART_NR) {
+	if(uart == get_uart_nr()) {
 		uart_irq_handler_cons(0);
 	} else {
 		uart_irq_handler_sercomm(0);
diff --git a/src/target/firmware/board/mt62xx/init.c b/src/target/firmware/board/mt62xx/init.c
index 3f68375..53c13e9 100644
--- a/src/target/firmware/board/mt62xx/init.c
+++ b/src/target/firmware/board/mt62xx/init.c
@@ -41,6 +41,18 @@
 #include <mtk/mt6235.h>
 #include <mtk/system.h>
 
+/* We want the console on UART 0 (IRDA UART) */
+uint8_t get_uart_nr(void)
+{
+	return 0;
+}
+
+/* SERCOMM layer on UART1 (modem UART) */
+uint8_t get_sercomm_uart_nr(void)
+{
+	return 1;
+}
+
 void pll_init(void)
 {
 	/* Power on PLL */
@@ -134,6 +146,6 @@ void board_init(void)
 	memory_init();
 
 	/* Initialize UART without interrupts */
-	uart_init(SERCOMM_UART_NR, 0);
-	uart_baudrate(SERCOMM_UART_NR, UART_115200);
+	uart_init(get_sercomm_uart_nr(), 0);
+	uart_baudrate(get_sercomm_uart_nr(), UART_115200);
 }
diff --git a/src/target/firmware/board/pirelli_dpl10/init.c b/src/target/firmware/board/pirelli_dpl10/init.c
index ef18403..c988ac8 100644
--- a/src/target/firmware/board/pirelli_dpl10/init.c
+++ b/src/target/firmware/board/pirelli_dpl10/init.c
@@ -53,6 +53,18 @@
 #define ASIC_CONF_REG	0xfffef008
 #define IO_CONF_REG	0xfffef00a
 
+/* We want the console on UART 1 (IRDA UART) */
+uint8_t get_uart_nr(void)
+{
+	return 1;
+}
+
+/* SERCOMM layer on UART0 (modem UART) */
+uint8_t get_sercomm_uart_nr(void)
+{
+	return 0;
+}
+
 static void board_io_init(void)
 {
 	uint16_t reg;
@@ -112,13 +124,13 @@ void board_init(void)
 	irq_init();
 
 	/* initialize MODEM UART to be used for sercomm*/
-	uart_init(SERCOMM_UART_NR, 1);
-	uart_baudrate(SERCOMM_UART_NR, UART_115200);
+	uart_init(get_sercomm_uart_nr(), 1);
+	uart_baudrate(get_sercomm_uart_nr(), UART_115200);
 
 	/* Initialize IRDA UART to be used for old-school console code.
 	 * note: IRDA uart only accessible on C115 and C117 PCB */
-	uart_init(CONS_UART_NR, 1);
-	uart_baudrate(CONS_UART_NR, UART_115200);
+	uart_init(get_uart_nr(), 1);
+	uart_baudrate(get_uart_nr(), UART_115200);
 
 	/* Initialize hardware timers */
 	hwtimer_init();
diff --git a/src/target/firmware/board/se_j100/init.c b/src/target/firmware/board/se_j100/init.c
index 2a3de0e..7e2c64c 100644
--- a/src/target/firmware/board/se_j100/init.c
+++ b/src/target/firmware/board/se_j100/init.c
@@ -52,6 +52,18 @@
 #define IO_CNTL_REG	0xfffe4804
 #define ASIC_CONF_REG	0xfffef008
 
+/* We want the console on UART 0 (IRDA UART) */
+uint8_t get_uart_nr(void)
+{
+	return 0;
+}
+
+/* SERCOMM layer on UART1 (modem UART) */
+uint8_t get_sercomm_uart_nr(void)
+{
+	return 1;
+}
+
 static void board_io_init(void)
 {
 	uint16_t reg;
@@ -108,13 +120,13 @@ void board_init(void)
 	irq_init();
 
 	/* initialize MODEM UART to be used for sercomm*/
-	uart_init(SERCOMM_UART_NR, 1);
-	uart_baudrate(SERCOMM_UART_NR, UART_115200);
+	uart_init(get_sercomm_uart_nr(), 1);
+	uart_baudrate(get_sercomm_uart_nr(), UART_115200);
 
 	/* initialize IRDA UART to be used for old-school console code.
 	 * note: IRDA uart only accessible on C115 and C117 PCB */
-	uart_init(CONS_UART_NR, 1);
-	uart_baudrate(CONS_UART_NR, UART_115200);
+	uart_init(get_uart_nr(), 1);
+	uart_baudrate(get_uart_nr(), UART_115200);
 
 	/* Initialize hardware timers */
 	hwtimer_init();
diff --git a/src/target/firmware/calypso/uart.c b/src/target/firmware/calypso/uart.c
index bcb56bd..69b3af2 100644
--- a/src/target/firmware/calypso/uart.c
+++ b/src/target/firmware/calypso/uart.c
@@ -34,6 +34,7 @@
 
 #include <calypso/irq.h>
 #include <uart.h>
+#include <board.h>
 
 #define BASE_ADDR_UART_MODEM	0xffff5000
 #define OFFSET_IRDA		0x800
@@ -193,7 +194,7 @@ static uint8_t uart_reg_read(int uart, enum uart_reg reg)
 
 static void uart_irq_handler_cons(__unused enum irq_nr irqnr)
 {
-	const uint8_t uart = CONS_UART_NR;
+	const uint8_t uart = get_uart_nr();
 	uint8_t iir;
 
 	//uart_putchar_nb(uart, 'U');
@@ -226,7 +227,7 @@ static void uart_irq_handler_cons(__unused enum irq_nr irqnr)
 
 static void uart_irq_handler_sercomm(__unused enum irq_nr irqnr)
 {
-	const uint8_t uart = SERCOMM_UART_NR;
+	const uint8_t uart = get_sercomm_uart_nr();
 	uint8_t iir, ch;
 
 	//uart_putchar_nb(uart, 'U');
@@ -281,7 +282,7 @@ void uart_init(uint8_t uart, uint8_t interrupts)
 	uint8_t irq = uart2irq[uart];
 
 	uart_reg_write(uart, IER, 0x00);
-	if (uart == CONS_UART_NR) {
+	if (uart == get_uart_nr()) {
 		cons_init();
 		if(interrupts) {
 			irq_register_handler(irq, &uart_irq_handler_cons);
@@ -331,7 +332,7 @@ void uart_init(uint8_t uart, uint8_t interrupts)
 }
 
 void uart_poll(uint8_t uart) {
-	if(uart == CONS_UART_NR) {
+	if(uart == get_uart_nr()) {
 		uart_irq_handler_cons(0);
 	} else {
 		uart_irq_handler_sercomm(0);
diff --git a/src/target/firmware/comm/sercomm.c b/src/target/firmware/comm/sercomm.c
index ddc852c..5686862 100644
--- a/src/target/firmware/comm/sercomm.c
+++ b/src/target/firmware/comm/sercomm.c
@@ -56,6 +56,7 @@ static inline void sercomm_unlock(unsigned long *flags)
 
 # include <comm/sercomm.h>
 # include <uart.h>
+# include <board.h>
 
 #endif
 
@@ -127,7 +128,7 @@ void sercomm_sendmsg(uint8_t dlci, struct msgb *msg)
 
 #ifndef HOST_BUILD
 	/* tell UART that we have something to send */
-	uart_irq_enable(SERCOMM_UART_NR, UART_IRQ_TX_EMPTY, 1);
+	uart_irq_enable(get_sercomm_uart_nr(), UART_IRQ_TX_EMPTY, 1);
 #endif
 }
 
diff --git a/src/target/firmware/comm/sercomm_cons.c b/src/target/firmware/comm/sercomm_cons.c
index a0dca40..546f0ae 100644
--- a/src/target/firmware/comm/sercomm_cons.c
+++ b/src/target/firmware/comm/sercomm_cons.c
@@ -41,7 +41,7 @@ static void raw_puts(const char *s)
 {
 	int i = strlen(s);
 	while (i--)
-		uart_putchar_wait(SERCOMM_UART_NR, *s++);
+		uart_putchar_wait(get_sercomm_uart_nr(), *s++);
 }
 
 #ifdef DEBUG
diff --git a/src/target/firmware/include/board.h b/src/target/firmware/include/board.h
index 9783ef3..50957cd 100644
--- a/src/target/firmware/include/board.h
+++ b/src/target/firmware/include/board.h
@@ -4,5 +4,7 @@
 extern const char *target_board;
 
 void board_init(void);
+/* We want the console on UART (IRDA UART) */
+uint8_t get_uart_nr(void);
 
 #endif /* _BOARD_H */
diff --git a/src/target/firmware/include/console.h b/src/target/firmware/include/console.h
index 7146e99..b5a83f5 100644
--- a/src/target/firmware/include/console.h
+++ b/src/target/firmware/include/console.h
@@ -11,9 +11,6 @@ int cons_putchar(char c);
 int cons_rb_flush(void);
 void cons_init(void);
 
-/* We want the console on UART 0 (IRDA UART) */
-#define CONS_UART_NR	0
-
 /* Size of the static ring-buffer that we keep for console print messages */
 #define CONS_RB_SIZE	4096
 
diff --git a/src/target/firmware/lib/console.c b/src/target/firmware/lib/console.c
index 7135ae2..8a1ad25 100644
--- a/src/target/firmware/lib/console.c
+++ b/src/target/firmware/lib/console.c
@@ -24,6 +24,7 @@
 #include <string.h>
 #include <console.h>
 #include <uart.h>
+#include <board.h>
 
 #include <asm/system.h>
 
@@ -89,19 +90,19 @@ static void __rb_flush_wait(void)
 {
 	char ch;
 	while (cons_rb_pull(&ch) >= 0)
-		uart_putchar_wait(CONS_UART_NR, ch);
+		uart_putchar_wait(get_uart_nr(), ch);
 }
 
 /* returns if everything was flushed (1) or if there's more to flush (0) */
 static int __rb_flush(void)
 {
-	while (!uart_tx_busy(CONS_UART_NR)) {
+	while (!uart_tx_busy(get_uart_nr())) {
 		char ch;
 		if (cons_rb_pull(&ch) < 0) {
 			/* no more data to write, disable interest in Tx FIFO interrupts */
 			return 1;
 		}
-		uart_putchar_nb(CONS_UART_NR, ch);
+		uart_putchar_nb(get_uart_nr(), ch);
 	}
 
 	/* if we reach here, UART Tx FIFO is busy again */
@@ -158,7 +159,7 @@ int cons_rb_append(const char *data, int len)
 	__cons_rb_append(data_cur, len);
 
 	/* we want to get Tx FIFO interrupts */
-	uart_irq_enable(CONS_UART_NR, UART_IRQ_TX_EMPTY, 1);
+	uart_irq_enable(get_uart_nr(), UART_IRQ_TX_EMPTY, 1);
 
 	local_irq_restore(flags);
 
@@ -173,7 +174,7 @@ int cons_puts(const char *s)
 		/* if the console is not active yet, we need to fall back */
 		int i = strlen(s);
 		while (i--)
-			uart_putchar_wait(CONS_UART_NR, *s++);
+			uart_putchar_wait(get_uart_nr(), *s++);
 		return i;
 	}
 }
@@ -184,7 +185,7 @@ int cons_putchar(char c)
 		return cons_rb_append(&c, 1);
 	else {
 		/* if the console is not active yet, we need to fall back */
-		uart_putchar_wait(CONS_UART_NR, c);
+		uart_putchar_wait(get_uart_nr(), c);
 		return 0;
 	}
 }
