Skip to contentSkip to conversation

cobalt: group UART definition into header

PATCH NAK Florian Fainelli 3 participants 4 messages Aug 21, 2008 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cobalt: group UART definition into header

This patch groups the UART base address definition into the cobalt.h header file making it easier to reuse this code.

---

arch/mips/cobalt/console.c +1 -1
index d1ba701..48e2094 100644
@@ -6,7 +6,7 @@
 
 #include <cobalt.h>
 
-#define UART_BASE	((void __iomem *)CKSEG1ADDR(0x1c800000))
+#define UART_BASE	((void __iomem *)CKSEG1ADDR(COBALT_UART_ADDR))
 
 void prom_putchar(char c)
 {
arch/mips/cobalt/serial.c +3 -3
index 53b8d0d..d12202e 100644
@@ -28,8 +28,8 @@
 
 static struct resource cobalt_uart_resource[] __initdata = {
 	{
-		.start	= 0x1c800000,
-		.end	= 0x1c800007,
+		.start	= COBALT_UART_ADDR,
+		.end	= COBALT_UART_ADDR + 0x7,
 		.flags	= IORESOURCE_MEM,
 	},
 	{
@@ -45,7 +45,7 @@ static struct plat_serial8250_port cobalt_serial8250_port[] = {
 		.uartclk	= 18432000,
 		.iotype		= UPIO_MEM,
 		.flags		= UPF_IOREMAP | UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
-		.mapbase	= 0x1c800000,
+		.mapbase	= COBALT_UART_ADDR,
 	},
 	{},
 };
include/asm-mips/mach-cobalt/cobalt.h +2 -0
index 5b9fce7..9bf9e94 100644
@@ -19,4 +19,6 @@ extern int cobalt_board_id;
 #define COBALT_BRD_ID_QUBE2    0x5
 #define COBALT_BRD_ID_RAQ2     0x6
 
+#define COBALT_UART_ADDR	0x1c800000
+
 #endif /* __ASM_COBALT_H */
#1 lore raw

Hi,

Quoted 48 lines · On Thu, 21 Aug 2008 13:03:44 +0200 Florian Fainelli <[email protected]> wrote:

This patch groups the UART base address definition into the cobalt.h header file making it easier to reuse this code.

---

arch/mips/cobalt/console.c +1 -1
index d1ba701..48e2094 100644
@@ -6,7 +6,7 @@
 
 #include <cobalt.h>
 
-#define UART_BASE	((void __iomem *)CKSEG1ADDR(0x1c800000))
+#define UART_BASE	((void __iomem *)CKSEG1ADDR(COBALT_UART_ADDR))
 
 void prom_putchar(char c)
 {
arch/mips/cobalt/serial.c +3 -3
index 53b8d0d..d12202e 100644
@@ -28,8 +28,8 @@
 
 static struct resource cobalt_uart_resource[] __initdata = {
 	{
-		.start	= 0x1c800000,
-		.end	= 0x1c800007,
+		.start	= COBALT_UART_ADDR,
+		.end	= COBALT_UART_ADDR + 0x7,
 		.flags	= IORESOURCE_MEM,
 	},
 	{
@@ -45,7 +45,7 @@ static struct plat_serial8250_port cobalt_serial8250_port[] = {
 		.uartclk	= 18432000,
 		.iotype		= UPIO_MEM,
 		.flags		= UPF_IOREMAP | UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
-		.mapbase	= 0x1c800000,
+		.mapbase	= COBALT_UART_ADDR,
 	},
 	{},
 };
include/asm-mips/mach-cobalt/cobalt.h +0 -0
index 5b9fce7..9bf9e94 100644

include/asm-mips/mach-cobalt/cobalt.h extern int cobalt_board_id; · line 23

Quoted 5 lines
include/asm-mips/mach-cobalt/cobalt.h +2 -0
@@ -19,4 +19,6 @@ extern int cobalt_board_id;
 #define COBALT_BRD_ID_QUBE2    0x5
 #define COBALT_BRD_ID_RAQ2     0x6
 
+#define COBALT_UART_ADDR	0x1c800000
+

NAK

This value is only used in serial.c.
Please define in serial.c.

Yoichi

#2 lore raw

Hi,

Le Thursday 21 August 2008 15:45:52 Yoichi Yuasa, vous avez écrit :

Quoted 4 lines

NAK

This value is only used in serial.c.
Please define in serial.c.

console.c also uses it, which was the rationale for my patch.

#3 lore raw
Quoted 10 lines · On Thu, 21 Aug 2008 15:55:12 +0200 Florian Fainelli <[email protected]> wrote:

Hi,

Le Thursday 21 August 2008 15:45:52 Yoichi Yuasa, vous avez écrit :

Quoted 4 lines

NAK

This value is only used in serial.c.
Please define in serial.c.

console.c also uses it, which was the rationale for my patch.

Sorry, it's my fault.

Yoichi