summaryrefslogtreecommitdiff
path: root/cleopatre/linux-2.6.25.10-spc300/arch
diff options
context:
space:
mode:
authorJean-Philippe SAVE2011-03-23 17:17:22 +0100
committerJean-Philippe SAVE2011-03-25 18:23:31 +0100
commite01c6270f365252c0d773f7ce1bcb71032bad3b8 (patch)
treed8bb4e9a2432d0989e6f18a424b650d5143bc7c5 /cleopatre/linux-2.6.25.10-spc300/arch
parent63ba4f8473f735f8aa92a32e0087b0221db59c35 (diff)
cleo/linux: add SPR310 board, closes #2417
Diffstat (limited to 'cleopatre/linux-2.6.25.10-spc300/arch')
-rw-r--r--cleopatre/linux-2.6.25.10-spc300/arch/arm/mach-spc300/Kconfig7
-rw-r--r--cleopatre/linux-2.6.25.10-spc300/arch/arm/mach-spc300/Makefile1
-rw-r--r--cleopatre/linux-2.6.25.10-spc300/arch/arm/mach-spc300/board-spr310.c244
3 files changed, 252 insertions, 0 deletions
diff --git a/cleopatre/linux-2.6.25.10-spc300/arch/arm/mach-spc300/Kconfig b/cleopatre/linux-2.6.25.10-spc300/arch/arm/mach-spc300/Kconfig
index 0a120fe4ef..1452e38aff 100644
--- a/cleopatre/linux-2.6.25.10-spc300/arch/arm/mach-spc300/Kconfig
+++ b/cleopatre/linux-2.6.25.10-spc300/arch/arm/mach-spc300/Kconfig
@@ -35,6 +35,12 @@ config MACH_SPR300
help
Include support for SPiDCOM spr300 reference design board platform.
+config MACH_SPR310
+ bool "Support SPR310 platform"
+ select SYNOP3504
+ help
+ Include support for SPiDCOM spr310 reference design board platform.
+
config MACH_ARIZONA
bool "Support spc300/Arizona platform"
help
@@ -54,6 +60,7 @@ choice
default MTD_SPC300_MAP_LARGE2 if MACH_SPK300G
default MTD_SPC300_MAP_LARGE2 if MACH_SPK310
default MTD_SPC300_MAP_LARGE2 if MACH_SPK300
+ default MTD_SPC300_MAP_LARGE2 if MACH_SPR310
default MTD_SPC300_MAP_MEDIUM1
config MTD_SPC300_MAP_SMALL
diff --git a/cleopatre/linux-2.6.25.10-spc300/arch/arm/mach-spc300/Makefile b/cleopatre/linux-2.6.25.10-spc300/arch/arm/mach-spc300/Makefile
index 7f02ffc41b..14eb66396c 100644
--- a/cleopatre/linux-2.6.25.10-spc300/arch/arm/mach-spc300/Makefile
+++ b/cleopatre/linux-2.6.25.10-spc300/arch/arm/mach-spc300/Makefile
@@ -9,3 +9,4 @@ obj-$(CONFIG_MACH_SPK300) += board-spk300.o
obj-$(CONFIG_MACH_SPK310) += board-spk310.o
obj-$(CONFIG_MACH_SCR310) += board-scr310.o
obj-$(CONFIG_MACH_SPR300) += board-spr300.o
+obj-$(CONFIG_MACH_SPR310) += board-spr310.o
diff --git a/cleopatre/linux-2.6.25.10-spc300/arch/arm/mach-spc300/board-spr310.c b/cleopatre/linux-2.6.25.10-spc300/arch/arm/mach-spc300/board-spr310.c
new file mode 100644
index 0000000000..8bae9788a1
--- /dev/null
+++ b/cleopatre/linux-2.6.25.10-spc300/arch/arm/mach-spc300/board-spr310.c
@@ -0,0 +1,244 @@
+/*
+ * arch/arm/mach-spc300/board-spr310.c
+ *
+ * (C) Copyright 2009 SPiDCOM Technologies
+ *
+ * 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/init.h>
+#include <linux/device.h>
+#include <asm/mach-types.h>
+#include <linux/mtd/partitions.h>
+#include <linux/spi/spi.h>
+
+#include "spc300.h"
+#include "spc300-devices.h"
+
+/**
+ * FLASH Device Structures
+ */
+
+#ifdef CONFIG_MTD_SPC300_MAP_SMALL
+static struct mtd_partition spc300_flash_partitions[] = {
+ {
+ .name = "u-boot",
+ .size = 0x00020000,
+ .offset = 0,
+ .mask_flags = 0,
+ }, {
+ .name = "nvram",
+ .size = 0x00010000,
+ .offset = MTDPART_OFS_APPEND,
+ .mask_flags = 0,
+ }, {
+ .name = "user-fs",
+ .size = 0x00100000,
+ .offset = MTDPART_OFS_APPEND,
+ .mask_flags = 0,
+ }, {
+ .name = "image 0",
+ .size = MTDPART_SIZ_FULL,
+ .offset = MTDPART_OFS_APPEND,
+ .mask_flags = 0,
+ }
+};
+
+#elif defined CONFIG_MTD_SPC300_MAP_MEDIUM1
+static struct mtd_partition spc300_flash_partitions[] = {
+ {
+ .name = "u-boot",
+ .size = 0x00020000,
+ .offset = 0,
+ .mask_flags = 0,
+ }, {
+ .name = "nvram",
+ .size = 0x00010000,
+ .offset = MTDPART_OFS_APPEND,
+ .mask_flags = 0,
+ }, {
+ .name = "user-fs",
+ .size = 0x00080000,
+ .offset = MTDPART_OFS_APPEND,
+ .mask_flags = 0,
+ }, {
+ .name = "image 0",
+ .size = MTDPART_SIZ_FULL,
+ .offset = MTDPART_OFS_APPEND,
+ .mask_flags = 0,
+ }
+};
+
+#elif defined CONFIG_MTD_SPC300_MAP_MEDIUM2
+static struct mtd_partition spc300_flash_partitions[] = {
+ {
+ .name = "u-boot",
+ .size = 0x00020000,
+ .offset = 0,
+ .mask_flags = 0,
+ }, {
+ .name = "nvram",
+ .size = 0x00010000,
+ .offset = MTDPART_OFS_APPEND,
+ .mask_flags = 0,
+ }, {
+ .name = "user-fs",
+ .size = 0x00080000,
+ .offset = MTDPART_OFS_APPEND,
+ .mask_flags = 0,
+ }, {
+ .name = "image 0",
+ .size = 0x001b0000,
+ .offset = MTDPART_OFS_APPEND,
+ .mask_flags = 0,
+ }, {
+ .name = "image 1",
+ .size = MTDPART_SIZ_FULL,
+ .offset = MTDPART_OFS_APPEND,
+ .mask_flags = 0,
+ }
+};
+
+#elif defined CONFIG_MTD_SPC300_MAP_LARGE1
+static struct mtd_partition spc300_flash_partitions[] = {
+ {
+ .name = "u-boot",
+ .size = 0x00030000,
+ .offset = 0,
+ .mask_flags = 0,
+ }, {
+ .name = "nvram",
+ .size = 0x00010000,
+ .offset = MTDPART_OFS_APPEND,
+ .mask_flags = 0,
+ }, {
+ .name = "user-fs",
+ .size = 0x00100000,
+ .offset = MTDPART_OFS_APPEND,
+ .mask_flags = 0,
+ }, {
+ .name = "image 0",
+ .size = MTDPART_SIZ_FULL,
+ .offset = MTDPART_OFS_APPEND,
+ .mask_flags = 0,
+ }
+};
+
+#elif defined CONFIG_MTD_SPC300_MAP_LARGE2
+static struct mtd_partition spc300_flash_partitions[] = {
+ {
+ .name = "u-boot",
+ .size = 0x00030000,
+ .offset = 0,
+ .mask_flags = 0,
+ }, {
+ .name = "nvram",
+ .size = 0x00010000,
+ .offset = MTDPART_OFS_APPEND,
+ .mask_flags = 0,
+ }, {
+ .name = "user-fs",
+ .size = 0x00100000,
+ .offset = MTDPART_OFS_APPEND,
+ .mask_flags = 0,
+ }, {
+ .name = "image 0",
+ .size = 0x00360000,
+ .offset = MTDPART_OFS_APPEND,
+ .mask_flags = 0,
+ }, {
+ .name = "image 1",
+ .size = MTDPART_SIZ_FULL,
+ .offset = MTDPART_OFS_APPEND,
+ .mask_flags = 0,
+ }
+};
+
+#else
+#error "SPC300 MTD flash mapping not defined !"
+#endif /* CONFIG_MTD_SPC300_MAP_SMALL */
+
+struct spc300_flash_spi_dev flash_chip __initdata = {
+ .name = "m25p64",
+ .cs = 0,
+ .speed = 12500000, //PCLK/8
+ .spimode = SPI_MODE_0,
+ .parts = spc300_flash_partitions,
+ .nb_parts = ARRAY_SIZE(spc300_flash_partitions),
+};
+struct spc300_afe_spi_dev afe_chip __initdata = {
+ .name = "ad9865",
+ .cs = 1,
+ .speed = 6250000, //PCLK/16
+ .spimode = SPI_3WIRE|SPI_MODE_0,
+};
+
+/**
+ * Initialize SPR310 GIC.
+ */
+static void spr310_init_irq(void)
+{
+ spc300_init_irq();
+}
+
+/**
+ * New mapping for IOs after MMU starting.
+ */
+static void __init spr310_map_io(void)
+{
+ spc300_map_io();
+}
+
+/**
+ * Second SPR310 initialisation,
+ * just before memory_init.
+ *
+ * \param desc machine descriptor.
+ * \param tags tag.
+ * \param cmdline command line.
+ * \param mi memory informations.
+ */
+static void __init spr310_fixup(struct machine_desc *desc, struct tag *tags, char **cmdline, struct meminfo *mi)
+{
+ spc300_fixup(desc, tags, cmdline, mi);
+}
+
+/**
+ * Initialize SPR310
+ */
+static void __init spr310_init(void)
+{
+ spc300_init();
+ spc300_add_device_uart0();
+ spc300_add_device_uart1();
+ spc300_add_device_spidevs(&flash_chip, &afe_chip);
+ spc300_add_device_spictrl();
+ spc300_add_device_ethernet();
+ spc300_add_device_gpio();
+ spc300_add_device_wdt();
+}
+
+MACHINE_START(SPC300, "SPR310 - ARM SPC300 based board")
+ /* Maintainer: SPiDCOM Technologies */
+ .phys_io = ARM_APB_BASE,
+ .io_pg_offst = ((IO_ADDRESS(ARM_APB_BASE)) >> 18) & 0xfffc,
+ .boot_params = SDRAM_BASE + 0x100,
+ .fixup = spr310_fixup,
+ .map_io = spr310_map_io,
+ .timer = &spc300_timer,
+ .init_irq = spr310_init_irq,
+ .init_machine = spr310_init,
+MACHINE_END
+