summaryrefslogtreecommitdiff
path: root/cleopatre/linux-2.6.25.10-spc300/arch/arm/mach-spc300/board-spk310.c
blob: a60ebccc0be7315d48a0a77407fb7dde9a855ec8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/*
 * 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
 */
struct spc300_flash_spi_dev flash_chip __initdata = {
    .name = "m25p64",
    .cs = 0,
    .speed = 20000000,
    .spimode = SPI_MODE_0,
};
struct spc300_afe_spi_dev afe_chip __initdata = {
    .name = "ad986x",
    .cs = 1,
    .speed = 6250000, //PCLK/16
    .spimode = SPI_3WIRE|SPI_MODE_0,
};

/**
 * Initialize SPK310 GIC.
 */
static void spk310_init_irq(void)
{
    spc300_init_irq();
}

/**
 * New mapping for IOs after MMU starting.
 */
static void __init spk310_map_io(void)
{
    spc300_map_io();
}

/**
 * Second SPK310 initialisation,
 * just before memory_init.
 *
 * \param  desc  machine descriptor.
 * \param  tags  tag.
 * \param  cmdline  command line.
 * \param  mi  memory informations.
 */
static void __init spk310_fixup(struct machine_desc *desc, struct tag *tags, char **cmdline, struct meminfo *mi)
{
    spc300_fixup(desc, tags, cmdline, mi);
}

/**
 * Initialize SPK310
 */
static void __init spk310_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, "SPK310 - 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        = spk310_fixup,
    .map_io       = spk310_map_io,
    .timer        = &spc300_timer,
    .init_irq     = spk310_init_irq,
    .init_machine = spk310_init,
MACHINE_END