Received: from mail.onstor.com (66.201.51.107) by exch1.onstor.net
 (10.0.0.225) with Microsoft SMTP Server id 8.1.311.2; Wed, 8 Apr 2009
 17:47:44 -0700
Received: from psmtp.com ([64.18.0.130]) by mail.onstor.com with Microsoft
 SMTPSVC(6.0.3790.3959);	 Wed, 8 Apr 2009 17:47:44 -0700
Received: from source ([213.58.128.207]) by exprod5mx291.postini.com
 ([64.18.4.11]) with SMTP;	Wed, 08 Apr 2009 19:47:43 CDT
Received: from localhost.localdomain ([127.0.0.1]:27536 "EHLO
	ftp.linux-mips.org") by ftp.linux-mips.org with ESMTP	id S20025863AbZDHXha
 (ORCPT <rfc822;andy.sharp@onstor.com>);	Thu, 9 Apr 2009 00:37:30 +0100
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 09 Apr 2009 00:37:13
 +0100 (BST)
Received: from mx1.rmicorp.com ([12.239.216.72]:17511 "EHLO mx1.rmicorp.com")
	by ftp.linux-mips.org with ESMTP id S20029125AbZDHXgS (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 9 Apr 2009 00:36:18 +0100
Received: from sark.razamicroelectronics.com ([10.8.0.254]) by mx1.rmicorp.com
 with Microsoft SMTPSVC(6.0.3790.3959);	 Wed, 8 Apr 2009 16:36:09 -0700
Received: from localhost.localdomain (unknown [10.8.0.44])	by
 sark.razamicroelectronics.com (Postfix) with ESMTP id C76A37B7FC9;	Sat,  4
 Apr 2009 05:34:46 -0600 (CST)
From: Kevin Hickey <khickey@rmicorp.com>
To: "linux-mips@linux-mips.org" <linux-mips@linux-mips.org>,
	"ralf@linux-mips.org" <ralf@linux-mips.org>
CC: Kevin Hickey <khickey@rmicorp.com>
Sender: "linux-mips-bounce@linux-mips.org" <linux-mips-bounce@linux-mips.org>
Date: Wed, 8 Apr 2009 16:36:07 -0700
Subject: [PATCH v3 4/5] Alchemy: Au1300/DB1300 peripheral resource
 declarations
Thread-Topic: [PATCH v3 4/5] Alchemy: Au1300/DB1300 peripheral resource
 declarations
Thread-Index: Acm4rMvgXQ1N1rM4QEqf/s/U0xvBBA==
Message-ID: <1239233768-11927-5-git-send-email-khickey@rmicorp.com>
References: <> <1239233768-11927-1-git-send-email-khickey@rmicorp.com>
 <1239233768-11927-2-git-send-email-khickey@rmicorp.com>
 <1239233768-11927-3-git-send-email-khickey@rmicorp.com>
 <1239233768-11927-4-git-send-email-khickey@rmicorp.com>
In-Reply-To: <1239233768-11927-4-git-send-email-khickey@rmicorp.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Exchange-Organization-AuthAs: Internal
X-MS-Exchange-Organization-AuthMechanism: 0b
X-MS-Exchange-Organization-AuthSource: exch1.onstor.net
X-MS-Has-Attach:
X-Auto-Response-Suppress: All
X-MS-TNEF-Correlator:
x-originalarrivaltime: 08 Apr 2009 23:36:09.0384 (UTC)
 FILETIME=[CB6C1280:01C9B8A2]
errors-to: linux-mips-bounce@linux-mips.org
x-pstn-levels: (S:56.93671/99.90000 CV:99.9000 FC:95.5390 LC: 0.0000
 R:95.9108 P:95.9108 M:97.0282 C:98.6951 )
x-pstn-neptune: 2/1/0.50/68
x-ems-proccessed: 2K3Xl1OQTInXD6xxuA8z3Q==
x-ems-stamp: 8mbBDQDtXuXT66IHPFvG4w==
x-list: linux-mips
x-archive-position: 22281
x-ecartis-version: Ecartis v1.0.0
x-original-sender: khickey@rmicorp.com
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0

This adds some declarations for peripheral resouces for the first few suppo=
rted
peripherals.  This includes USB, LCD, IDE and MMC.

Signed-off-by: Kevin Hickey <khickey@rmicorp.com>
---
 arch/mips/alchemy/common/Makefile                |    1 +
 arch/mips/alchemy/common/au13xx_res.c            |  132 ++++++++++++++++++=
++++
 arch/mips/alchemy/common/dbdma.c                 |   46 ++++++++-
 arch/mips/include/asm/mach-au1x00/au1xxx_dbdma.h |   33 ++++++
 4 files changed, 211 insertions(+), 1 deletions(-)
 create mode 100644 arch/mips/alchemy/common/au13xx_res.c

diff --git a/arch/mips/alchemy/common/Makefile b/arch/mips/alchemy/common/M=
akefile
index faa6afd..4e533be 100644
--- a/arch/mips/alchemy/common/Makefile
+++ b/arch/mips/alchemy/common/Makefile
@@ -9,6 +9,7 @@ obj-y +=3D prom.o puts.o time.o reset.o \
 	clocks.o platform.o power.o setup.o \
 	sleeper.o dma.o dbdma.o gpio.o
=20
+obj-$(CONFIG_SOC_AU13XX) 	+=3D au13xx_res.o
 obj-$(CONFIG_PCI)		+=3D pci.o
=20
 obj-$(CONFIG_AU_GPIO_INT_CNTLR) +=3D gpio_int.o
diff --git a/arch/mips/alchemy/common/au13xx_res.c b/arch/mips/alchemy/comm=
on/au13xx_res.c
new file mode 100644
index 0000000..79b8fb4
--- /dev/null
+++ b/arch/mips/alchemy/common/au13xx_res.c
@@ -0,0 +1,132 @@
+/*
+ * Copyright 2003-2008 RMI Corporation. All rights reserved.
+ * Author: Kevin Hickey <khickey@rmicorp.com>
+ *
+ *  This program is free software; you can redistribute  it and/or modify =
it
+ *  under  the terms of  the GNU General  Public License as published by t=
he
+ *  Free Software Foundation;  either version 2 of the  License, or (at yo=
ur
+ *  option) any later version.
+ *
+ * THIS SOFTWARE IS PROVIDED BY RMI Corporation 'AS IS' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTI=
ES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.=
 IN
+ * NO EVENT SHALL RMI OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BU=
T
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF US=
E,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE O=
F
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *  You should have received a copy of the  GNU General Public License alo=
ng
+ *  with this program; if not, write  to the Free Software Foundation, Inc=
.,
+ *  675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <linux/platform_device.h>
+#include <linux/dma-mapping.h>
+#include <linux/init.h>
+
+#include <asm/mach-au1x00/au1000.h>
+#include <asm/mach-au1x00/au1xxx.h>
+#include <asm/mach-au1x00/au1100_mmc.h>
+
+/*
+ * USB Resources for Au13xx
+ */
+static struct resource au13xx_usb_ehci_resources[] =3D {
+	[0] =3D {
+		.start		=3D USB_EHCI_BASE,
+		.end		=3D USB_EHCI_BASE + USB_EHCI_LEN - 1,
+		.flags		=3D IORESOURCE_MEM,
+	},
+	[1] =3D {
+		.start		=3D AU1300_IRQ_USB + GPINT_LINUX_IRQ_OFFSET,
+		.end		=3D AU1300_IRQ_USB + GPINT_LINUX_IRQ_OFFSET,
+		.flags		=3D IORESOURCE_IRQ,
+	},
+};
+
+static u64 ehci_dmamask =3D DMA_32BIT_MASK;
+
+static struct platform_device au13xx_usb_ehci_device =3D {
+	.name		=3D "au13xx-ehci",
+	.id		=3D 0,
+	.dev =3D {
+		.dma_mask		=3D &ehci_dmamask,
+		.coherent_dma_mask	=3D DMA_32BIT_MASK,
+	},
+	.num_resources	=3D ARRAY_SIZE(au13xx_usb_ehci_resources),
+	.resource	=3D au13xx_usb_ehci_resources,
+};
+
+static struct resource au1200_lcd_resources[] =3D {
+	[0] =3D {
+		.start          =3D LCD_PHYS_ADDR,
+		.end            =3D LCD_PHYS_ADDR + 0x800 - 1,
+		.flags          =3D IORESOURCE_MEM,
+	},
+	[1] =3D {
+		.start          =3D AU1300_IRQ_LCD + 8,
+		.end            =3D AU1300_IRQ_LCD + 8,
+		.flags          =3D IORESOURCE_IRQ,
+	}
+};
+
+static u64 au1200_lcd_dmamask =3D DMA_32BIT_MASK;
+
+static struct platform_device au1200_lcd_device =3D {
+	.name           =3D "au1200-lcd",
+	.id             =3D 0,
+	.dev =3D {
+		.dma_mask               =3D &au1200_lcd_dmamask,
+		.coherent_dma_mask      =3D DMA_32BIT_MASK,
+	},
+	.num_resources  =3D ARRAY_SIZE(au1200_lcd_resources),
+	.resource       =3D au1200_lcd_resources,
+};
+
+extern struct platform_device au13xx_mmc1_device;
+
+extern struct au1xmmc_platform_data au1xmmc_platdata[2];
+static struct resource ide_resources[] =3D {
+	[0] =3D {
+		.start	=3D IDE_PHYS_ADDR,
+		.end 	=3D IDE_PHYS_ADDR + IDE_PHYS_LEN - 1,
+		.flags	=3D IORESOURCE_MEM
+	},
+	[1] =3D {
+		.start	=3D IDE_INT,
+		.end	=3D IDE_INT,
+		.flags	=3D IORESOURCE_IRQ
+	}
+};
+
+static u64 ide_dmamask =3D DMA_32BIT_MASK;
+
+static struct platform_device ide_device =3D {
+	.name		=3D "au1200-ide",
+	.id		=3D 0,
+	.dev =3D {
+		.dma_mask 		=3D &ide_dmamask,
+		.coherent_dma_mask	=3D DMA_32BIT_MASK,
+	},
+	.num_resources	=3D ARRAY_SIZE(ide_resources),
+	.resource	=3D ide_resources
+};
+
+static struct platform_device *au13xx_platform_devices[] __initdata =3D {
+	&au13xx_usb_ehci_device,
+	&au1200_lcd_device,
+	&ide_device,
+	&au13xx_mmc1_device,
+};
+
+
+static int __init au13xx_add_devices(void)
+{
+	return platform_add_devices(au13xx_platform_devices,
+			     ARRAY_SIZE(au13xx_platform_devices));
+}
+
+arch_initcall(au13xx_add_devices);
diff --git a/arch/mips/alchemy/common/dbdma.c b/arch/mips/alchemy/common/db=
dma.c
index 3ab6d80..7fda56b 100644
--- a/arch/mips/alchemy/common/dbdma.c
+++ b/arch/mips/alchemy/common/dbdma.c
@@ -38,7 +38,8 @@
 #include <asm/mach-au1x00/au1000.h>
 #include <asm/mach-au1x00/au1xxx_dbdma.h>
=20
-#if defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200)
+#if defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200) || \
+    defined(CONFIG_SOC_AU13XX)
=20
 /*
  * The Descriptor Based DMA supports up to 16 channels.
@@ -150,6 +151,47 @@ static dbdev_tab_t dbdev_tab[] =3D {
=20
 #endif /* CONFIG_SOC_AU1200 */
=20
+#ifdef CONFIG_SOC_AU13XX
+	{ DSCR_CMD0_UART0_TX, DEV_FLAGS_OUT, 0, 8,  0x10100004, 0, 0 },
+	{ DSCR_CMD0_UART0_RX, DEV_FLAGS_IN,  0, 8,  0x10100000, 0, 0 },
+	{ DSCR_CMD0_UART1_TX, DEV_FLAGS_OUT, 0, 8,  0x01011004, 0, 0 },
+	{ DSCR_CMD0_UART1_RX, DEV_FLAGS_IN,  0, 8,  0x10101000, 0, 0 },
+	{ DSCR_CMD0_UART2_TX, DEV_FLAGS_OUT, 0, 8,  0x01012004, 0, 0 },
+	{ DSCR_CMD0_UART2_RX, DEV_FLAGS_IN,  0, 8,  0x10102000, 0, 0 },
+	{ DSCR_CMD0_UART3_TX, DEV_FLAGS_OUT, 0, 8,  0x01013004, 0, 0 },
+	{ DSCR_CMD0_UART3_RX, DEV_FLAGS_IN,  0, 8,  0x10103000, 0, 0 },
+
+	{ DSCR_CMD0_SDMS_TX0, DEV_FLAGS_OUT, 4, 8,  0x10600000, 0, 0 },
+	{ DSCR_CMD0_SDMS_RX0, DEV_FLAGS_IN,  4, 8,  0x10600004, 0, 0 },
+	{ DSCR_CMD0_SDMS_TX1, DEV_FLAGS_OUT, 8, 8,  0x10601000, 0, 0 },
+	{ DSCR_CMD0_SDMS_RX1, DEV_FLAGS_IN,  8, 8,  0x10601004, 0, 0 },
+
+	{ DSCR_CMD0_AES_RX, DEV_FLAGS_IN ,   4, 32, 0x10300008, 0, 0 },
+	{ DSCR_CMD0_AES_TX, DEV_FLAGS_OUT,   4, 32, 0x10300004, 0, 0 },
+
+	{ DSCR_CMD0_PSC0_TX, DEV_FLAGS_OUT,  0, 16, 0x10a0001c, 0, 0 },
+	{ DSCR_CMD0_PSC0_RX, DEV_FLAGS_IN,   0, 16, 0x10a0001c, 0, 0 },
+	{ DSCR_CMD0_PSC1_TX, DEV_FLAGS_OUT,  0, 16, 0x10a0101c, 0, 0 },
+	{ DSCR_CMD0_PSC1_RX, DEV_FLAGS_IN,   0, 16, 0x10a0101c, 0, 0 },
+	{ DSCR_CMD0_PSC2_TX, DEV_FLAGS_OUT,  0, 16, 0x10a0201c, 0, 0 },
+	{ DSCR_CMD0_PSC2_RX, DEV_FLAGS_IN,   0, 16, 0x10a0201c, 0, 0 },
+	{ DSCR_CMD0_PSC3_TX, DEV_FLAGS_OUT,  0, 16, 0x10a0301c, 0, 0 },
+	{ DSCR_CMD0_PSC3_RX, DEV_FLAGS_IN,   0, 16, 0x10a0301c, 0, 0 },
+
+	{ DSCR_CMD0_LCD, DEV_FLAGS_ANYUSE,   0, 0,  0x00000000, 0, 0 },
+	{ DSCR_CMD0_NAND_FLASH, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 },
+
+	{ DSCR_CMD0_SDMS_TX2, DEV_FLAGS_OUT, 4, 8,  0x10602000, 0, 0 },
+	{ DSCR_CMD0_SDMS_RX2, DEV_FLAGS_IN,  4, 8,  0x10602004, 0, 0 },
+
+	{ DSCR_CMD0_CIM_SYNC, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 },
+
+	{ DSCR_CMD0_UDMA, DEV_FLAGS_ANYUSE,  0, 32, 0x14001810, 0, 0 },
+
+	{ DSCR_CMD0_DMA_REQ0, 0, 0, 0, 0x00000000, 0, 0 },
+	{ DSCR_CMD0_DMA_REQ1, 0, 0, 0, 0x00000000, 0, 0 },
+#endif /* CONFIG_SOC_AU13XX */
+
 	{ DSCR_CMD0_THROTTLE, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 },
 	{ DSCR_CMD0_ALWAYS, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 },
=20
@@ -881,6 +923,8 @@ static void au1xxx_dbdma_init(void)
 	irq_nr =3D AU1550_DDMA_INT;
 #elif defined(CONFIG_SOC_AU1200)
 	irq_nr =3D AU1200_DDMA_INT;
+#elif defined(CONFIG_SOC_AU13XX)
+	irq_nr =3D AU1300_IRQ_DDMA + GPINT_LINUX_IRQ_OFFSET;
 #else
 	#error Unknown Au1x00 SOC
 #endif
diff --git a/arch/mips/include/asm/mach-au1x00/au1xxx_dbdma.h b/arch/mips/i=
nclude/asm/mach-au1x00/au1xxx_dbdma.h
index 06f68f4..1c36b9f 100644
--- a/arch/mips/include/asm/mach-au1x00/au1xxx_dbdma.h
+++ b/arch/mips/include/asm/mach-au1x00/au1xxx_dbdma.h
@@ -195,6 +195,39 @@ typedef volatile struct au1xxx_ddma_desc {
 #define DSCR_CMD0_CIM_SYNC	26
 #endif /* CONFIG_SOC_AU1200 */
=20
+#ifdef CONFIG_SOC_AU13XX
+#define DSCR_CMD0_UART0_TX	0
+#define DSCR_CMD0_UART0_RX	1
+#define DSCR_CMD0_UART1_TX	2
+#define DSCR_CMD0_UART1_RX	3
+#define DSCR_CMD0_UART2_TX	4
+#define DSCR_CMD0_UART2_RX	5
+#define DSCR_CMD0_UART3_TX	6
+#define DSCR_CMD0_UART3_RX	7
+#define DSCR_CMD0_SDMS_TX0	8
+#define DSCR_CMD0_SDMS_RX0	9
+#define DSCR_CMD0_SDMS_TX1	10
+#define DSCR_CMD0_SDMS_RX1	11
+#define DSCR_CMD0_AES_TX	12
+#define DSCR_CMD0_AES_RX	13
+#define DSCR_CMD0_PSC0_TX	14
+#define DSCR_CMD0_PSC0_RX	15
+#define DSCR_CMD0_PSC1_TX	16
+#define DSCR_CMD0_PSC1_RX	17
+#define DSCR_CMD0_PSC2_TX	18
+#define DSCR_CMD0_PSC2_RX	19
+#define DSCR_CMD0_PSC3_TX	20
+#define DSCR_CMD0_PSC3_RX	21
+#define DSCR_CMD0_LCD		22
+#define DSCR_CMD0_NAND_FLASH	23
+#define DSCR_CMD0_SDMS_TX2	24
+#define DSCR_CMD0_SDMS_RX2	25
+#define DSCR_CMD0_CIM_SYNC	26
+#define DSCR_CMD0_UDMA		27
+#define DSCR_CMD0_DMA_REQ0	28
+#define DSCR_CMD0_DMA_REQ1	29
+#endif /* CONFIG_SOC_AU13XX */
+
 #define DSCR_CMD0_THROTTLE	30
 #define DSCR_CMD0_ALWAYS	31
 #define DSCR_NDEV_IDS		32
--=20
1.5.4.3


