summaryrefslogtreecommitdiff
path: root/cleopatre
diff options
context:
space:
mode:
authorYacine Belkadi2011-12-02 11:34:55 +0100
committerNicolas Schodet2012-05-09 10:41:14 +0200
commitd7eccf918c1b3f63e66464234e3b0582ad90a206 (patch)
tree9de09fbdb0f8b4b6758430e1f080537a6bbc51b5 /cleopatre
parent337b835607001b4df9b934c9088c79bdbbbd0399 (diff)
cleo/linux: add board spc300dini (1), refs #2759
Create a board file for spc300dini by copying the one from spr300. spr300 was chosen because, just like the spc300dini: - it has a Gigabit phy - it has a MEDIUM_1 flash (4MiB)
Diffstat (limited to 'cleopatre')
-rw-r--r--cleopatre/linux-2.6.25.10-spc300/arch/arm/mach-spc300/board-spc300dini.c244
1 files changed, 244 insertions, 0 deletions
diff --git a/cleopatre/linux-2.6.25.10-spc300/arch/arm/mach-spc300/board-spc300dini.c b/cleopatre/linux-2.6.25.10-spc300/arch/arm/mach-spc300/board-spc300dini.c
new file mode 100644
index 0000000000..fb59804c64
--- /dev/null
+++ b/cleopatre/linux-2.6.25.10-spc300/arch/arm/mach-spc300/board-spc300dini.c
@@ -0,0 +1,244 @@
+/*
+ * arch/arm/mach-spc300/board-spr300.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 = "m25p32",
+ .cs = 0,
+ .speed = 20000000,
+ .spimode = SPI_MODE_0,
+ .parts = spc300_flash_partitions,
+ .nb_parts = ARRAY_SIZE(spc300_flash_partitions),
+};
+struct spc300_afe_spi_dev afe_chip __initdata = {
+ .name = "ad986x",
+ .cs = 1,
+ .speed = 6250000, //PCLK/16
+ .spimode = SPI_3WIRE|SPI_MODE_0,
+};
+
+/**
+ * Initialize SPR300 GIC.
+ */
+static void spr300_init_irq(void)
+{
+ spc300_init_irq();
+}
+
+/**
+ * New mapping for IOs after MMU starting.
+ */
+static void __init spr300_map_io(void)
+{
+ spc300_map_io();
+}
+
+/**
+ * Second SPR300 initialisation,
+ * just before memory_init.
+ *
+ * \param desc machine descriptor.
+ * \param tags tag.
+ * \param cmdline command line.
+ * \param mi memory informations.
+ */
+static void __init spr300_fixup(struct machine_desc *desc, struct tag *tags, char **cmdline, struct meminfo *mi)
+{
+ spc300_fixup(desc, tags, cmdline, mi);
+}
+
+/**
+ * Initialize SPR300
+ */
+static void __init spr300_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, "SPR300 - 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 = spr300_fixup,
+ .map_io = spr300_map_io,
+ .timer = &spc300_timer,
+ .init_irq = spr300_init_irq,
+ .init_machine = spr300_init,
+MACHINE_END
+