summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-nomadik/8815.c
blob: 8598f14efa8668a9933a50d9f478abf65c71c178 (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
/*
 * Copyright (C) 2009 Jean-Christophe PLAGNIOL-VILLARD <plagnio@jcrosoft.com>
 *
 * 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; version 2 of
 * the License.
 *
 * 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 <common.h>
#include <init.h>
#include <asm/hardware.h>
#include <mach/hardware.h>
#include <asm/armlinux.h>
#include <asm/mach-types.h>

#include "clock.h"

static struct clk st8815_clk_48 = {
       .rate = 48 * 1000 * 1000,
};

static struct memory_platform_data ram_pdata = {
	.name = "ram0",
	.flags = DEVFS_RDWR,
};

static struct device_d sdram_dev = {
	.name = "mem",
	.map_base = 0x00000000,
	.platform_data = &ram_pdata,
};

void st8815_add_device_sdram(u32 size)
{
	sdram_dev.size = size;
	register_device(&sdram_dev);
	armlinux_add_dram(&sdram_dev);
}

static struct device_d uart0_serial_device = {
	.name = "uart-pl011",
	.map_base = NOMADIK_UART0_BASE,
	.size = 4096,
};

static struct device_d uart1_serial_device = {
	.name = "uart-pl011",
	.map_base = NOMADIK_UART1_BASE,
	.size = 4096,
};

void st8815_register_uart(unsigned id)
{
	switch (id) {
	case 0:
		nmdk_clk_create(&st8815_clk_48, uart0_serial_device.name);
		register_device(&uart0_serial_device);
		break;
	case 1:
		nmdk_clk_create(&st8815_clk_48, uart1_serial_device.name);
		register_device(&uart1_serial_device);
		break;
	}
}