Received: from mail.onstor.com ([66.201.51.107]) by onstor-exch02.onstor.net with Microsoft SMTPSVC(6.0.3790.1830);
	 Thu, 21 Aug 2008 04:06:00 -0700
Received: from dalesmta2-3.messageone.com ([129.41.169.249]) by mail.onstor.com with Microsoft SMTPSVC(6.0.3790.1830);
	 Thu, 21 Aug 2008 04:05:59 -0700
Received: from ftp.linux-mips.org (ftp.linux-mips.org [213.58.128.207])
	by dalesmta2-3.messageone.com (8.13.8/8.13.8) with ESMTP id m7LB5v6j002316
	for <andy.sharp@onstor.com>; Thu, 21 Aug 2008 06:05:58 -0500
Received: from localhost.localdomain ([127.0.0.1]:10220 "EHLO
	ftp.linux-mips.org") by ftp.linux-mips.org with ESMTP
	id S20031622AbYHULFL (ORCPT <rfc822;andy.sharp@onstor.com>);
	Thu, 21 Aug 2008 12:05:11 +0100
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 21 Aug 2008 12:04:54 +0100 (BST)
Received: from smtp4.int-evry.fr ([157.159.10.71]:39400 "EHLO
	smtp4.int-evry.fr") by ftp.linux-mips.org with ESMTP
	id S20031613AbYHULEs (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Thu, 21 Aug 2008 12:04:48 +0100
Received: from smtp2.int-evry.fr (smtp2.int-evry.fr [157.159.10.45])
	by smtp4.int-evry.fr (Postfix) with ESMTP id 3466AFE2D71;
	Thu, 21 Aug 2008 13:04:48 +0200 (CEST)
Received: from smtp-ext.int-evry.fr (smtp-ext.int-evry.fr [157.159.11.17])
	by smtp2.int-evry.fr (Postfix) with ESMTP id 742793EF9BC;
	Thu, 21 Aug 2008 13:03:47 +0200 (CEST)
Received: from [192.168.10.137] (headquarters.openpattern.org [82.240.17.188])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by smtp-ext.int-evry.fr (Postfix) with ESMTP id 89B4890004;
	Thu, 21 Aug 2008 13:03:47 +0200 (CEST)
From: Florian Fainelli <florian@openwrt.org>
Date: 	Thu, 21 Aug 2008 13:03:44 +0200
Subject: [PATCH] cobalt: group UART definition into header
MIME-Version: 1.0
X-UID: 	1113
X-Length: 2513
To: "linux-mips" <linux-mips@linux-mips.org>
Cc: ralf@linux-mips.org
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200808211303.44865.florian@openwrt.org>
X-INT-MailScanner-Information: Please contact the ISP for more information
X-MailScanner-ID: 742793EF9BC.3644B
X-INT-MailScanner: Found to be clean
X-INT-MailScanner-SpamCheck: 
X-INT-MailScanner-From: 	florian@openwrt.org
X-archive-position: 20300
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: florian@openwrt.org
Precedence: bulk
X-list: 	linux-mips
X-MessageOne-Virus-Version: vendor=fsecure engine=4.65.7161:2.4.4,1.2.40,4.0.164 definitions=2008-08-21_02:2008-08-20,2008-08-21,2008-08-21 signatures=0
X-MessageOne-Virus-Scanned: Clean
X-MessageOne-Envelope-Sender: linux-mips-bounce@linux-mips.org
X-MessageOne-Spam-Details: rule=m773emszm_notspam policy=m773emszm score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=3.1.0-0805090000 definitions=main-0808210043
X-MessageOne-Spam-Score: 0
X-MessageOne-Spam-Bar: 
Return-Path: linux-mips-bounce@linux-mips.org
X-OriginalArrivalTime: 21 Aug 2008 11:06:00.0135 (UTC) FILETIME=[E4CF3570:01C9037D]

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

Signed-off-by: Florian Fainelli <florian@openwrt.org>
---
diff --git a/arch/mips/cobalt/console.c b/arch/mips/cobalt/console.c
index d1ba701..48e2094 100644
--- a/arch/mips/cobalt/console.c
+++ b/arch/mips/cobalt/console.c
@@ -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)
 {
diff --git a/arch/mips/cobalt/serial.c b/arch/mips/cobalt/serial.c
index 53b8d0d..d12202e 100644
--- a/arch/mips/cobalt/serial.c
+++ b/arch/mips/cobalt/serial.c
@@ -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,
 	},
 	{},
 };
diff --git a/include/asm-mips/mach-cobalt/cobalt.h b/include/asm-mips/mach-cobalt/cobalt.h
index 5b9fce7..9bf9e94 100644
--- a/include/asm-mips/mach-cobalt/cobalt.h
+++ b/include/asm-mips/mach-cobalt/cobalt.h
@@ -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 */

