[PATCH 1/3] Add Mindspeed Comcerto platform support
stanleymiao at gmail.com
stanleymiao at gmail.com
Thu Oct 14 04:38:07 EDT 2010
From: Stanley.Miao <stanley.miao at windriver.com>
Add Mindspeed Comcerto platform support. Now this patch includes only
Multifunction EVM board with Comcerto-1000 CPU.
Signed-off-by: Stanley.Miao <stanley.miao at windriver.com>
---
arch/arm/Kconfig | 11 ++
arch/arm/Makefile | 1 +
arch/arm/boot/compressed/Makefile | 4 +
arch/arm/boot/compressed/head-comcerto.S | 6 +
arch/arm/boot/compressed/head.S | 5 +
arch/arm/mach-comcerto/Kconfig | 32 +++++
arch/arm/mach-comcerto/Makefile | 10 ++
arch/arm/mach-comcerto/Makefile.boot | 2 +
arch/arm/mach-comcerto/board-c1kmfcn_evm.c | 88 ++++++++++++
arch/arm/mach-comcerto/comcerto-1000.c | 146 ++++++++++++++++++++
.../arm/mach-comcerto/include/mach/comcerto-1000.h | 91 ++++++++++++
arch/arm/mach-comcerto/include/mach/debug-macro.S | 46 ++++++
arch/arm/mach-comcerto/include/mach/entry-macro.S | 70 ++++++++++
arch/arm/mach-comcerto/include/mach/hardware.h | 37 +++++
arch/arm/mach-comcerto/include/mach/io.h | 32 +++++
arch/arm/mach-comcerto/include/mach/memory.h | 33 +++++
arch/arm/mach-comcerto/include/mach/system.h | 39 +++++
arch/arm/mach-comcerto/include/mach/timex.h | 28 ++++
arch/arm/mach-comcerto/include/mach/uncompress.h | 58 ++++++++
arch/arm/mach-comcerto/include/mach/vmalloc.h | 21 +++
20 files changed, 760 insertions(+), 0 deletions(-)
create mode 100644 arch/arm/boot/compressed/head-comcerto.S
create mode 100644 arch/arm/mach-comcerto/Kconfig
create mode 100644 arch/arm/mach-comcerto/Makefile
create mode 100644 arch/arm/mach-comcerto/Makefile.boot
create mode 100644 arch/arm/mach-comcerto/board-c1kmfcn_evm.c
create mode 100644 arch/arm/mach-comcerto/comcerto-1000.c
create mode 100644 arch/arm/mach-comcerto/include/mach/comcerto-1000.h
create mode 100644 arch/arm/mach-comcerto/include/mach/debug-macro.S
create mode 100644 arch/arm/mach-comcerto/include/mach/entry-macro.S
create mode 100644 arch/arm/mach-comcerto/include/mach/hardware.h
create mode 100644 arch/arm/mach-comcerto/include/mach/io.h
create mode 100644 arch/arm/mach-comcerto/include/mach/memory.h
create mode 100644 arch/arm/mach-comcerto/include/mach/system.h
create mode 100644 arch/arm/mach-comcerto/include/mach/timex.h
create mode 100644 arch/arm/mach-comcerto/include/mach/uncompress.h
create mode 100644 arch/arm/mach-comcerto/include/mach/vmalloc.h
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 88c97bc..ca6ccf7 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -334,6 +334,15 @@ config ARCH_EP93XX
help
This enables support for the Cirrus EP93xx series of CPUs.
+config ARCH_COMCERTO
+ bool "Mindspeed Comcerto"
+ select ZONE_DMA
+ select CPU_V6
+ help
+ This enables support for Mindspeed's Comcerto development boards.
+ If you would like to build your kernel to run on one of these boards
+ then you must say 'Y' here. Otherwise say 'N'
+
config ARCH_FOOTBRIDGE
bool "FootBridge"
select CPU_SA110
@@ -841,6 +850,8 @@ source "arch/arm/mach-clps711x/Kconfig"
source "arch/arm/mach-cns3xxx/Kconfig"
+source "arch/arm/mach-comcerto/Kconfig"
+
source "arch/arm/mach-davinci/Kconfig"
source "arch/arm/mach-dove/Kconfig"
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 59c1ce8..2daad67 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -141,6 +141,7 @@ machine-$(CONFIG_ARCH_INTEGRATOR) := integrator
machine-$(CONFIG_ARCH_IOP13XX) := iop13xx
machine-$(CONFIG_ARCH_IOP32X) := iop32x
machine-$(CONFIG_ARCH_IOP33X) := iop33x
+machine-$(CONFIG_ARCH_COMCERTO) := comcerto
machine-$(CONFIG_ARCH_IXP2000) := ixp2000
machine-$(CONFIG_ARCH_IXP23XX) := ixp23xx
machine-$(CONFIG_ARCH_IXP4XX) := ixp4xx
diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
index 65a7c1c..e8419db 100644
--- a/arch/arm/boot/compressed/Makefile
+++ b/arch/arm/boot/compressed/Makefile
@@ -33,6 +33,10 @@ ifeq ($(CONFIG_CPU_XSCALE),y)
OBJS += head-xscale.o
endif
+ifeq ($(CONFIG_ARCH_COMCERTO),y)
+OBJS += head-comcerto.o
+endif
+
ifeq ($(CONFIG_PXA_SHARPSL_DETECT_MACH_ID),y)
OBJS += head-sharpsl.o
endif
diff --git a/arch/arm/boot/compressed/head-comcerto.S b/arch/arm/boot/compressed/head-comcerto.S
new file mode 100644
index 0000000..60160f6
--- /dev/null
+++ b/arch/arm/boot/compressed/head-comcerto.S
@@ -0,0 +1,6 @@
+#include <asm/mach-types.h>
+
+ .section ".start", "ax"
+ ldr r7, mach_type
+
+mach_type: .word MACH_TYPE_COMCERTO
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
index 6825c34..8f38fbf 100644
--- a/arch/arm/boot/compressed/head.S
+++ b/arch/arm/boot/compressed/head.S
@@ -66,6 +66,11 @@ wait: mrc p14, 0, pc, c0, c1, 0
add \rb, \rb, #0x00010000 @ Ser1
#endif
.endm
+#elif defined(CONFIG_ARCH_COMCERTO)
+ .macro loadsp, rb, tmp
+ mov \rb, #0x10000000
+ orr \rb, \rb, #0x00090000
+ .endm
#elif defined(CONFIG_ARCH_S3C2410)
.macro loadsp, rb, tmp
mov \rb, #0x50000000
diff --git a/arch/arm/mach-comcerto/Kconfig b/arch/arm/mach-comcerto/Kconfig
new file mode 100644
index 0000000..a61a31a
--- /dev/null
+++ b/arch/arm/mach-comcerto/Kconfig
@@ -0,0 +1,32 @@
+if ARCH_COMCERTO
+
+menu "Comcerto Implementation Options"
+
+choice
+ prompt "Comcerto System Type"
+ default ARCH_M83XXX
+
+config ARCH_M83XXX
+ bool "M83xxx"
+ select GENERIC_TIME
+ select GENERIC_CLOCKEVENTS
+ help
+ Say Y here if you intend to run this kernel with a Comcerto1000 device.
+
+endchoice
+
+choice
+ prompt "Comcerto Board type"
+ default EVM_C1KMFCN_EVM
+
+config EVM_C1KMFCN_EVM
+ bool "C1KMFCN_EVM"
+ depends on ARCH_M83XXX
+ help
+ Say Y here if you intend to run this kernel with a C1K Multifunction EVM board.
+
+endchoice
+
+endmenu
+
+endif
diff --git a/arch/arm/mach-comcerto/Makefile b/arch/arm/mach-comcerto/Makefile
new file mode 100644
index 0000000..70aac61
--- /dev/null
+++ b/arch/arm/mach-comcerto/Makefile
@@ -0,0 +1,10 @@
+#
+# Makefile for the linux kernel.
+#
+
+# Object file lists.
+
+obj-y :=
+
+obj-$(CONFIG_ARCH_M83XXX) += comcerto-1000.o
+obj-$(CONFIG_EVM_C1KMFCN_EVM) += board-c1kmfcn_evm.o
diff --git a/arch/arm/mach-comcerto/Makefile.boot b/arch/arm/mach-comcerto/Makefile.boot
new file mode 100644
index 0000000..6262c4b
--- /dev/null
+++ b/arch/arm/mach-comcerto/Makefile.boot
@@ -0,0 +1,2 @@
+zreladdr-y := 0x80808000
+params_phys-y := 0x80800100
diff --git a/arch/arm/mach-comcerto/board-c1kmfcn_evm.c b/arch/arm/mach-comcerto/board-c1kmfcn_evm.c
new file mode 100644
index 0000000..74a7da3
--- /dev/null
+++ b/arch/arm/mach-comcerto/board-c1kmfcn_evm.c
@@ -0,0 +1,88 @@
+/*
+ * linux/arch/arm/mach-comcerto/board-c1kmfcn_evm.c
+ *
+ * Copyright (C) 2004,2008 Mindspeed Technologies, Inc.
+ * Copyright (c) 2010 Wind River Systems, Inc.
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#include <linux/sched.h>
+#include <linux/device.h>
+#include <linux/serial_8250.h>
+#include <asm/sizes.h>
+#include <asm/setup.h>
+#include <asm/mach-types.h>
+#include <asm/io.h>
+#include <asm/mach/arch.h>
+#include <mach/hardware.h>
+
+/* --------------------------------------------------------------------
+ * Serial interface
+ * -------------------------------------------------------------------- */
+static struct plat_serial8250_port comcerto_uart_data[] = {
+ {
+ .mapbase = COMCERTO_APB_UART0_BASE,
+ .membase = (void *)APB_VADDR(COMCERTO_APB_UART0_BASE),
+ .irq = IRQ_UART0,
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
+ .iotype = UPIO_MEM,
+ .regshift = 2,
+ .uartclk = COMCERTO_DEFAULTAHBCLK * 1000000,
+ },
+ {
+ .flags = 0,
+ },
+};
+
+static struct platform_device comcerto_uart = {
+ .name = "serial8250",
+ .id = PLAT8250_DEV_PLATFORM,
+ .dev = {
+ .platform_data = comcerto_uart_data,
+ },
+};
+
+static struct platform_device *comcerto_devices[] __initdata = {
+ &comcerto_uart,
+};
+
+/************************************************************************
+ * Machine definition
+ *
+ ************************************************************************/
+static void __init platform_map_io(void)
+{
+ device_map_io();
+}
+
+static void __init platform_irq_init(void)
+{
+}
+
+static void __init platform_init(void)
+{
+ platform_add_devices(comcerto_devices, ARRAY_SIZE(comcerto_devices));
+}
+
+MACHINE_START(COMCERTO, "Comcerto 1000 (Multifunction EVM)")
+ /* Mindspeed Technologies Inc. */
+ .phys_io = COMCERTO_AHB_APB_BASE,
+ .io_pg_offst = ((COMCERTO_AHB_APB_BASE) >> 18) & 0xfffc,
+ .boot_params = COMCERTO_SDRAM_BASE + 0x100,
+ .map_io = platform_map_io,
+ .init_irq = platform_irq_init,
+ .init_machine = platform_init,
+ .timer = &comcerto_timer,
+MACHINE_END
diff --git a/arch/arm/mach-comcerto/comcerto-1000.c b/arch/arm/mach-comcerto/comcerto-1000.c
new file mode 100644
index 0000000..09032ea
--- /dev/null
+++ b/arch/arm/mach-comcerto/comcerto-1000.c
@@ -0,0 +1,146 @@
+/*
+ * linux/arch/arm/mach-comcerto/comcerto-1000.c
+ *
+ * Copyright (C) 2004,2008 Mindspeed Technologies, Inc.
+ * Copyright (c) 2010 Wind River Systems, Inc.
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#include <linux/sched.h>
+#include <linux/mm.h>
+#include <linux/init.h>
+#include <asm/setup.h>
+#include <asm/mach-types.h>
+#include <asm/io.h>
+#include <asm/sizes.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <mach/hardware.h>
+
+/***********************************************************
+ * Virtual address Mapping *
+ * *
+ ***********************************************************/
+
+static struct map_desc comcerto_io_desc[] __initdata = {
+ {
+ .virtual = SDRAM_MSP_MEMORY_VADDR,
+ .pfn = __phys_to_pfn(SDRAM_MSP_MEMORY_PHY),
+ .length = SDRAM_MSP_MEMORY_SIZE,
+ .type = MT_DEVICE
+ },
+ {
+ .virtual = ARAM_MEMORY_VADDR,
+ .pfn = __phys_to_pfn(COMCERTO_AHB_ARAM_BASE),
+ .length = ARAM_MEMORY_SIZE,
+ .type = MT_DEVICE
+ },
+ {
+ .virtual = (ARAM_MEMORY_VADDR + 0x100000),
+ .pfn = __phys_to_pfn(COMCERTO_AHB_ARAM_BASE + 0x100000),
+ .length = ARAM_MEMORY_SIZE,
+ .type = MT_DEVICE
+ },
+ {
+ .virtual = ARAM_MEMORY_VADDR + 0x100000,
+ .pfn = __phys_to_pfn(COMCERTO_AHB_ARAM_BASE + 0x100000),
+ .length = ARAM_MEMORY_SIZE,
+ .type = MT_DEVICE
+ },
+ {
+ .virtual = APB_VADDR(COMCERTO_APB_TIMER_BASE),
+ .pfn = __phys_to_pfn(COMCERTO_APB_TIMER_BASE),
+ .length = SZ_64K,
+ .type = MT_DEVICE
+ },
+ {
+ .virtual = APB_VADDR(COMCERTO_APB_GPIO_BASE),
+ .pfn = __phys_to_pfn(COMCERTO_APB_GPIO_BASE),
+ .length = SZ_64K,
+ .type = MT_DEVICE
+ },
+ {
+ .virtual = APB_VADDR(COMCERTO_APB_UART0_BASE),
+ .pfn = __phys_to_pfn(COMCERTO_APB_UART0_BASE),
+ .length = SZ_64K,
+ .type = MT_DEVICE
+ },
+ {
+ .virtual = APB_VADDR(COMCERTO_APB_UART1_BASE),
+ .pfn = __phys_to_pfn(COMCERTO_APB_UART1_BASE),
+ .length = SZ_64K,
+ .type = MT_DEVICE
+ },
+ {
+ .virtual = APB_VADDR(COMCERTO_APB_SPI_BASE),
+ .pfn = __phys_to_pfn(COMCERTO_APB_SPI_BASE),
+ .length = SZ_64K,
+ .type = MT_DEVICE
+ },
+ {
+ .virtual = APB_VADDR(COMCERTO_APB_I2C_BASE),
+ .pfn = __phys_to_pfn(COMCERTO_APB_I2C_BASE),
+ .length = SZ_16K,
+ .type = MT_DEVICE
+ },
+ {
+ .virtual = APB_VADDR(COMCERTO_APB_INTC_BASE),
+ .pfn = __phys_to_pfn(COMCERTO_APB_INTC_BASE),
+ .length = SZ_64K,
+ .type = MT_DEVICE
+ },
+ {
+ .virtual = APB_VADDR(COMCERTO_APB_CLK_BASE),
+ .pfn = __phys_to_pfn(COMCERTO_APB_CLK_BASE),
+ .length = SZ_64K,
+ .type = MT_DEVICE
+ },
+ {
+ .virtual = APB_VADDR(COMCERTO_APB_EMAC0_BASE),
+ .pfn = __phys_to_pfn(COMCERTO_APB_EMAC0_BASE),
+ .length = SZ_64K,
+ .type = MT_DEVICE
+ },
+ {
+ .virtual = APB_VADDR(COMCERTO_APB_EMAC1_BASE),
+ .pfn = __phys_to_pfn(COMCERTO_APB_EMAC1_BASE),
+ .length = SZ_64K,
+ .type = MT_DEVICE
+ },
+ {
+ .virtual = APB_VADDR(COMCERTO_APB_ARAM_BASE),
+ .pfn = __phys_to_pfn(COMCERTO_APB_ARAM_BASE),
+ .length = SZ_4K,
+ .type = MT_DEVICE
+ },
+ {
+ .virtual = APB_VADDR(COMCERTO_APB_EXPBUS_BASE),
+ .pfn = __phys_to_pfn(COMCERTO_APB_EXPBUS_BASE),
+ .length = SZ_64K,
+ .type = MT_DEVICE
+ },
+ {
+ .virtual = COMCERTO_IPSEC_VADDR_BASE,
+ .pfn = __phys_to_pfn(COMCERTO_AHB_IPSEC_BASE),
+ .length = SZ_1M,
+ .type = MT_DEVICE
+ },
+};
+
+void __init device_map_io(void)
+{
+ iotable_init(comcerto_io_desc, ARRAY_SIZE(comcerto_io_desc));
+}
+
diff --git a/arch/arm/mach-comcerto/include/mach/comcerto-1000.h b/arch/arm/mach-comcerto/include/mach/comcerto-1000.h
new file mode 100644
index 0000000..f48ae34
--- /dev/null
+++ b/arch/arm/mach-comcerto/include/mach/comcerto-1000.h
@@ -0,0 +1,91 @@
+/*
+ * arch/arm/mach-comcerto/include/mach/comcerto-1000.h
+ *
+ * Copyright (C) 2008 Mindspeed Technologies, Inc.
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __ASM_ARCH_COMCERTO1000_H__
+#define __ASM_ARCH_COMCERTO1000_H__
+
+#define COMCERTO_DEFAULTAHBCLK 187 /* MHz */
+#define COMCERTO_PHYCLK 250 /* MHz */
+#define COMCERTO_ARMCLK 650 /* MHz */
+
+/***** Physical address of IO on APB Bus *****/
+
+/* 0x001F0000 Reserved*/
+#define COMCERTO_APB_MDMA_BASE 0x101E0000
+#define COMCERTO_APB_TDMA2_BASE 0x101D0000
+/* 0x101B0000 --> 0x101C0000 Reserved*/
+#define COMCERTO_APB_EXPBUS_BASE 0x101A0000
+#define COMCERTO_APB_EMAC1_BASE 0x10190000
+/* 0x10100000 --> 0x00180000 Reserved*/
+#define COMCERTO_APB_ARAM_BASE 0x100F0000
+/* 0x100E0000 Reserved*/
+#define COMCERTO_APB_EMAC0_BASE 0x100D0000
+/* 0x100C0000 Reserved*/
+#define COMCERTO_APB_CLK_BASE 0x100B0000
+#define COMCERTO_APB_INTC_BASE 0x100A0000
+#define COMCERTO_APB_I2C_BASE 0x1009C000
+#define COMCERTO_APB_SPI_BASE 0x10098000
+#define COMCERTO_APB_UART1_BASE 0x10094000
+#define COMCERTO_APB_UART0_BASE 0x10090000
+/* 0x10080000 Reserved*/
+#define COMCERTO_APB_GPIO_BASE 0x10070000
+#define COMCERTO_APB_PCIePHY_BASE 0x10060000
+#define COMCERTO_APB_TIMER_BASE 0x10050000
+#define COMCERTO_APB_AHB_BASE 0x10040000
+#define COMCERTO_APB_PCIe1_BASE 0x10030000
+#define COMCERTO_APB_TDMA_BASE 0x10020000
+#define COMCERTO_APB_PCIe0_BASE 0x10010000
+#define COMCERTO_APB_TDM_BASE 0x10000000
+
+/***** Physical address on AHB Bus *****/
+#define COMCERTO_AHB_HIGHMEMDDR_BASE 0xFFFF0000
+#define COMCERTO_AHB_DDR_BASE 0x80000000
+#define COMCERTO_AHB_PCIe1_BASE 0x50000000
+#define COMCERTO_AHB_PCIe0_BASE 0x40000000
+#define COMCERTO_AHB_EXP_BASE 0x20000000
+#define COMCERTO_AHB_PCIe1CMD_BASE 0x11410000
+#define COMCERTO_AHB_PCIe0CMD_BASE 0x11400000
+#define COMCERTO_AHB_IBR_BASE 0x11000000
+#define COMCERTO_AHB_APB_BASE 0x10000000
+#define COMCERTO_AHB_USB0_BASE 0x0F000000
+#define COMCERTO_AHB_IPSEC_BASE 0x0E000000
+#define COMCERTO_AHB_DDRCONFIG_BASE 0x0D000000
+#define COMCERTO_AHB_ARAM_BASE 0x0A000000
+
+/* Physical addresses of memories */
+#define COMCERTO_SDRAM_BASE (COMCERTO_AHB_DDR_BASE + SZ_8M)
+#define ARAM_MEMORY_SIZE SZ_128K
+#define SDRAM_MSP_MEMORY_PHY COMCERTO_AHB_DDR_BASE
+#define SDRAM_MSP_MEMORY_SIZE SZ_8M
+
+#define IO_SPACE_LIMIT 0
+
+/*
+ * Virtual address mapping
+ */
+#define SDRAM_MSP_MEMORY_VADDR 0xf0000000
+#define ARAM_MEMORY_VADDR 0xfa000000
+#define COMCERTO_PCIe0CMD_VADDR_BASE 0xfa020000
+#define COMCERTO_PCIe1CMD_VADDR_BASE 0xfa030000
+#define COMCERTO_IPSEC_VADDR_BASE 0xfb000000
+#define APB_VADDR_BASE 0xfc000000 /* VA of IO on APB bus */
+
+#define APB_VADDR(x) ((x) - COMCERTO_AHB_APB_BASE + APB_VADDR_BASE)
+#endif
diff --git a/arch/arm/mach-comcerto/include/mach/debug-macro.S b/arch/arm/mach-comcerto/include/mach/debug-macro.S
new file mode 100644
index 0000000..42bc5a0
--- /dev/null
+++ b/arch/arm/mach-comcerto/include/mach/debug-macro.S
@@ -0,0 +1,46 @@
+/*
+ * arch/arm/mach-comcerto/include/mach/debug-macro.S
+ *
+ * Copyright (C) 2004,2005 Mindspeed Technologies, Inc.
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#define UART_LSR 0x14
+
+ .macro addruart,rx, tmp
+ mrc p15, 0, \rx, c1, c0
+ tst \rx, #1 @ MMU enabled?
+ moveq \rx, #0x10000000 @ physical base address
+ movne \rx, #0xfc000000 @ virtual base
+ orr \rx, \rx, #0x00090000 @ UART0
+ .endm
+
+ .macro senduart,rd,rx
+ strb \rd, [\rx, #0x00]
+ .endm
+
+ .macro waituart,rd,rx
+1001: ldrb \rd, [\rx, #UART_LSR]
+ tst \rd, #0x20 @ wait for THRE
+ beq 1001b
+ .endm
+
+ .macro busyuart,rd,rx
+1001: ldrb \rd, [\rx, #UART_LSR]
+ and \rd, \rd, #0x60
+ teq \rd, #0x60 @ wait for TEMT and THRE
+ bne 1001b
+ .endm
diff --git a/arch/arm/mach-comcerto/include/mach/entry-macro.S b/arch/arm/mach-comcerto/include/mach/entry-macro.S
new file mode 100644
index 0000000..442ad92
--- /dev/null
+++ b/arch/arm/mach-comcerto/include/mach/entry-macro.S
@@ -0,0 +1,70 @@
+/*
+ * arch/arm/mach-comcerto/include/mach/entry-macro.S
+ *
+ * Copyright (C) 2004,2005 Mindspeed Technologies, Inc.
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#include <mach/hardware.h>
+
+#if defined(CONFIG_ARCH_COMCERTO)
+ .macro disable_fiq
+ .endm
+
+ .macro get_irqnr_preamble, base, tmp
+ .endm
+
+ .macro arch_ret_to_user, tmp1, tmp2
+ .endm
+
+ .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
+
+ mov \irqnr, #0
+ ldr \base, =COMCERTO_INTC_CSP_IRQ_WNR
+ ldr \tmp, [\base]
+ cmp \tmp, #0
+ beq 10011f
+ cmp \tmp, #32
+ movne \irqnr, \tmp
+ bne 1004f
+
+
+10011:
+ mov \irqnr, #0
+ ldr \base, =COMCERTO_INTC_STATUS_REG_1
+ ldr \tmp, =COMCERTO_INTC_CSP_IRQMASK_1
+ ldr \irqstat, [\base]
+ ldr \tmp, [\tmp]
+ ands \irqstat, \irqstat, \tmp
+ beq 1004f
+
+ tst \irqstat, #0x2000
+ movne \irqnr,#13
+ bne 1003f
+
+1001: tst \irqstat, #1
+ bne 1003f
+ add \irqnr, \irqnr, #1
+ mov \irqstat, \irqstat, lsr #1
+ cmp \irqnr, #32
+ bcc 1001b
+1003: add \irqnr, \irqnr, #32
+
+1004:
+ .endm
+
+ .macro irq_prio_table
+ .endm
+#endif
diff --git a/arch/arm/mach-comcerto/include/mach/hardware.h b/arch/arm/mach-comcerto/include/mach/hardware.h
new file mode 100644
index 0000000..577289d
--- /dev/null
+++ b/arch/arm/mach-comcerto/include/mach/hardware.h
@@ -0,0 +1,37 @@
+/*
+ * arch/arm/mach-comcerto/include/mach/hardware.h
+ *
+ * Copyright (C) 2006 Mindspeed Technologies, Inc.
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __ASM_ARCH_HARDWARE_H
+#define __ASM_ARCH_HARDWARE_H
+
+/***** Device *****/
+#if defined(CONFIG_ARCH_M83XXX)
+ #include <mach/comcerto-1000.h>
+#else
+ #error "mach/hardware.h : Unknown architecture"
+#endif
+
+#ifndef __ASSEMBLY__
+struct sys_timer;
+extern struct sys_timer comcerto_timer;
+extern void device_map_io(void);
+#endif
+
+#endif
diff --git a/arch/arm/mach-comcerto/include/mach/io.h b/arch/arm/mach-comcerto/include/mach/io.h
new file mode 100644
index 0000000..be3320f
--- /dev/null
+++ b/arch/arm/mach-comcerto/include/mach/io.h
@@ -0,0 +1,32 @@
+/*
+ * arch/arm/mach-comcerto/include/mach/io.h
+ *
+ * Copyright (C) 2004,2005 Mindspeed Technologies, Inc.
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#ifndef __ASM_ARCH_COMCERTO1000_IO_H
+#define __ASM_ARCH_COMCERTO1000_IO_H
+
+#include <asm/io.h>
+
+#if !defined(CONFIG_PCI)
+
+#define __io(a) ((void __iomem *)(a))
+#define __mem_pci(a) (a)
+
+#endif
+
+#endif /* __ASM_ARCH_COMCERTO1000_IO_H */
diff --git a/arch/arm/mach-comcerto/include/mach/memory.h b/arch/arm/mach-comcerto/include/mach/memory.h
new file mode 100644
index 0000000..6d42d06
--- /dev/null
+++ b/arch/arm/mach-comcerto/include/mach/memory.h
@@ -0,0 +1,33 @@
+/*
+ * arch/arm/mach-comcerto/include/mach/memory.h
+ *
+ * Copyright (C) 2006 Mindspeed Technologies, Inc.
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __ASM_ARCH_MEMORY_H
+#define __ASM_ARCH_MEMORY_H
+
+#include <mach/hardware.h>
+
+#define PHYS_OFFSET COMCERTO_SDRAM_BASE
+
+#define __virt_to_bus(x) __virt_to_phys(x)
+#define __bus_to_virt(x) __phys_to_virt(x)
+#define __pfn_to_bus(x) __pfn_to_phys(x)
+#define __bus_to_pfn(x) __phys_to_pfn(x)
+
+#endif
diff --git a/arch/arm/mach-comcerto/include/mach/system.h b/arch/arm/mach-comcerto/include/mach/system.h
new file mode 100644
index 0000000..364cc7e
--- /dev/null
+++ b/arch/arm/mach-comcerto/include/mach/system.h
@@ -0,0 +1,39 @@
+/*
+ * arch/arm/mach-comcerto/include/mach/system.h
+ *
+ * Copyright (C) 2004,2005 Mindspeed Technologies, Inc.
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#ifndef __ASM_ARCH_SYSTEM_H
+#define __ASM_ARCH_SYSTEM_H
+
+#include <mach/hardware.h>
+#include <asm/io.h>
+
+static inline void arch_idle(void)
+{
+ /*
+ * This should do all the clock switching
+ * and wait for interrupt tricks
+ */
+ cpu_do_idle();
+}
+
+static inline void arch_reset(char mode, const char *cmd)
+{
+}
+
+#endif /* __ASM_ARCH_SYSTEM_H */
diff --git a/arch/arm/mach-comcerto/include/mach/timex.h b/arch/arm/mach-comcerto/include/mach/timex.h
new file mode 100644
index 0000000..4ca125d
--- /dev/null
+++ b/arch/arm/mach-comcerto/include/mach/timex.h
@@ -0,0 +1,28 @@
+/*
+ * linux/include/asm-arm/arch-comcerto/timex.h
+ *
+ * Copyright (C) 2006 Mindspeed Technologies, Inc.
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __ASM_ARCH_TIMEX_H__
+#define __ASM_ARCH_TIMEX_H__
+
+#include <mach/hardware.h>
+
+#define CLOCK_TICK_RATE (COMCERTO_DEFAULTAHBCLK * 1000 * 1000)
+
+#endif
diff --git a/arch/arm/mach-comcerto/include/mach/uncompress.h b/arch/arm/mach-comcerto/include/mach/uncompress.h
new file mode 100644
index 0000000..e3e6938
--- /dev/null
+++ b/arch/arm/mach-comcerto/include/mach/uncompress.h
@@ -0,0 +1,58 @@
+/*
+ * arch/arm/mach-comcerto/include/mach/uncompress.h
+ *
+ * Copyright (C) 2004,2008 Mindspeed Technologies, Inc.
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#ifndef __ASM_ARCH_UNCOMPRESS_H
+#define __ASM_ARCH_UNCOMPRESS_H
+
+#define UART_DR (*(volatile unsigned long *)0x10090000)
+#define UART_LSR (*(volatile unsigned long *)0x10090014)
+
+static inline void putc(int c)
+{
+ while (!(UART_LSR & 0x20))
+ barrier();
+
+ UART_DR = c;
+}
+
+static void flush(void)
+{
+}
+static inline void puts(const char *ptr)
+{
+ char c;
+
+ while ((c = *ptr++) != '\0') {
+ if (c == '\n')
+ putc('\r');
+ putc(c);
+ }
+
+ flush();
+
+}
+
+/*
+ * nothing to do
+ */
+#define arch_decomp_setup()
+
+#define arch_decomp_wdog()
+
+#endif /* __ASM_ARCH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-comcerto/include/mach/vmalloc.h b/arch/arm/mach-comcerto/include/mach/vmalloc.h
new file mode 100644
index 0000000..f807501
--- /dev/null
+++ b/arch/arm/mach-comcerto/include/mach/vmalloc.h
@@ -0,0 +1,21 @@
+/*
+ * arch/arm/mach-comcerto/include/mach/vmalloc.h
+ *
+ * Copyright (C) 2004,2005 Mindspeed Technologies, Inc.
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#define VMALLOC_END (0xF0000000)
--
1.5.4.3
More information about the linux-arm-kernel
mailing list