summaryrefslogtreecommitdiff
path: root/cleopatre/linux-2.6.25.10-spc300/arch
diff options
context:
space:
mode:
authorlefranc2009-12-28 10:49:00 +0000
committerlefranc2009-12-28 10:49:00 +0000
commit263c252871a0af34fcdcf120e66376945d65fab0 (patch)
tree804f250b9a2136ab208c4112ef3b6227621b9fed /cleopatre/linux-2.6.25.10-spc300/arch
parent28369d9e991eb91cffec61dcf4e190e15c7464ac (diff)
cleo/{linux,buildroot,tools/genNVRAM}: add new SPK310 platform
git-svn-id: svn+ssh://pessac/svn/cesar/trunk@6578 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cleopatre/linux-2.6.25.10-spc300/arch')
-rw-r--r--cleopatre/linux-2.6.25.10-spc300/arch/arm/configs/spc300_defconfig1
-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-spk310.c219
4 files changed, 228 insertions, 0 deletions
diff --git a/cleopatre/linux-2.6.25.10-spc300/arch/arm/configs/spc300_defconfig b/cleopatre/linux-2.6.25.10-spc300/arch/arm/configs/spc300_defconfig
index 2c1cc3e210..e6fc9e8078 100644
--- a/cleopatre/linux-2.6.25.10-spc300/arch/arm/configs/spc300_defconfig
+++ b/cleopatre/linux-2.6.25.10-spc300/arch/arm/configs/spc300_defconfig
@@ -177,6 +177,7 @@ CONFIG_ARCH_SPC300=y
#
# CONFIG_MACH_ARIZONA is not set
CONFIG_MACH_SPK300G=y
+# CONFIG_MACH_SPK310 is not set
# CONFIG_MACH_SCR310 is not set
#
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 0f046a7266..9d1e151aad 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
@@ -11,6 +11,12 @@ config MACH_SPK300G
help
Include support for SPiDCOM spk300-g reference design board platform.
+config MACH_SPK310
+ bool "Support SPK310 platform"
+ select SYNOP3504
+ help
+ Include support for SPiDCOM spk310 reference design board platform.
+
config MACH_SCR310
bool "Support SCR310 platform"
select SYNOP3504
@@ -34,6 +40,7 @@ config SPK300G_ON_FCM3
choice
prompt "SPC300 flash mapping"
default MTD_SPC300_MAP_LARGE if MACH_SPK300G
+ default MTD_SPC300_MAP_LARGE if MACH_SPK310
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 4747aa1955..87b3b4c467 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
@@ -5,4 +5,5 @@
obj-y := spc300.o spc300-devices.o spc300-device-wdt.o spc300-device-gpio.o
obj-$(CONFIG_MACH_ARIZONA) += board-arizona.o
obj-$(CONFIG_MACH_SPK300G) += board-spk300g.o
+obj-$(CONFIG_MACH_SPK310) += board-spk310.o
obj-$(CONFIG_MACH_SCR310) += board-scr310.o
diff --git a/cleopatre/linux-2.6.25.10-spc300/arch/arm/mach-spc300/board-spk310.c b/cleopatre/linux-2.6.25.10-spc300/arch/arm/mach-spc300/board-spk310.c
new file mode 100644
index 0000000000..29570128d6
--- /dev/null
+++ b/cleopatre/linux-2.6.25.10-spc300/arch/arm/mach-spc300/board-spk310.c
@@ -0,0 +1,219 @@
+/*
+ * arch/arm/mach-spc300/board-spk310.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_LARGE
+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 "SPK300-G 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 SPK300-G GIC.
+ */
+static void spk300g_init_irq(void)
+{
+ spc300_init_irq();
+}
+
+/**
+ * New mapping for IOs after MMU starting.
+ */
+static void __init spk300g_map_io(void)
+{
+ spc300_map_io();
+}
+
+/**
+ * Second SPK300-G initialisation,
+ * just before memory_init.
+ *
+ * \param desc machine descriptor.
+ * \param tags tag.
+ * \param cmdline command line.
+ * \param mi memory informations.
+ */
+static void __init spk300g_fixup(struct machine_desc *desc, struct tag *tags, char **cmdline, struct meminfo *mi)
+{
+ spc300_fixup(desc, tags, cmdline, mi);
+}
+
+/**
+ * Initialize SPK300-G.
+ */
+static void __init spk300g_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, "SPK300-G - 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 = spk300g_fixup,
+ .map_io = spk300g_map_io,
+ .timer = &spc300_timer,
+ .init_irq = spk300g_init_irq,
+ .init_machine = spk300g_init,
+MACHINE_END
+