blob: 42ee8f33eafbaf7421c6db5b5dd0630971fc660b [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * linux/arch/arm/mach-clps711x/p720t.c
3 *
4 * Copyright (C) 2000-2001 Deep Blue Solutions Ltd
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070020#include <linux/kernel.h>
21#include <linux/init.h>
22#include <linux/types.h>
23#include <linux/string.h>
24#include <linux/mm.h>
Russell Kingfced80c2008-09-06 12:10:45 +010025#include <linux/io.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070026
Russell Kinga09e64f2008-08-05 16:14:15 +010027#include <mach/hardware.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070028#include <asm/pgtable.h>
29#include <asm/page.h>
30#include <asm/setup.h>
Deepak Saxenaf10083f2005-10-28 15:19:05 +010031#include <asm/sizes.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070032#include <asm/mach-types.h>
33#include <asm/mach/arch.h>
34#include <asm/mach/map.h>
Russell Kinga09e64f2008-08-05 16:14:15 +010035#include <mach/syspld.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070036
37#include "common.h"
38
39/*
40 * Map the P720T system PLD. It occupies two address spaces:
41 * SYSPLD_PHYS_BASE and SYSPLD_PHYS_BASE + 0x00400000
42 * We map both here.
43 */
44static struct map_desc p720t_io_desc[] __initdata = {
Deepak Saxenaf10083f2005-10-28 15:19:05 +010045 {
46 .virtual = SYSPLD_VIRT_BASE,
47 .pfn = __phys_to_pfn(SYSPLD_PHYS_BASE),
48 .length = SZ_1M,
49 .type = MT_DEVICE
50 }, {
51 .virtual = 0xfe400000,
52 .pfn = __phys_to_pfn(0x10400000),
53 .length = SZ_1M,
54 .type = MT_DEVICE
55 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070056};
57
58static void __init
Russell King0744a3e2010-12-20 10:37:50 +000059fixup_p720t(struct tag *tag, char **cmdline, struct meminfo *mi)
Linus Torvalds1da177e2005-04-16 15:20:36 -070060{
61 /*
62 * Our bootloader doesn't setup any tags (yet).
63 */
64 if (tag->hdr.tag != ATAG_CORE) {
65 tag->hdr.tag = ATAG_CORE;
66 tag->hdr.size = tag_size(tag_core);
67 tag->u.core.flags = 0;
68 tag->u.core.pagesize = PAGE_SIZE;
69 tag->u.core.rootdev = 0x0100;
70
71 tag = tag_next(tag);
72 tag->hdr.tag = ATAG_MEM;
73 tag->hdr.size = tag_size(tag_mem32);
74 tag->u.mem.size = 4096;
75 tag->u.mem.start = PHYS_OFFSET;
76
77 tag = tag_next(tag);
78 tag->hdr.tag = ATAG_NONE;
79 tag->hdr.size = 0;
80 }
81}
82
83static void __init p720t_map_io(void)
84{
85 clps711x_map_io();
86 iotable_init(p720t_io_desc, ARRAY_SIZE(p720t_io_desc));
87}
88
89MACHINE_START(P720T, "ARM-Prospector720T")
Russell Kinge9dea0c2005-07-03 17:38:58 +010090 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
Nicolas Pitre6244fa92011-07-05 22:38:11 -040091 .atag_offset = 0x100,
Russell Kinge9dea0c2005-07-03 17:38:58 +010092 .fixup = fixup_p720t,
93 .map_io = p720t_map_io,
94 .init_irq = clps711x_init_irq,
Linus Torvalds1da177e2005-04-16 15:20:36 -070095 .timer = &clps711x_timer,
Russell King6c000712011-11-05 17:41:52 +000096 .restart = clps711x_restart,
Linus Torvalds1da177e2005-04-16 15:20:36 -070097MACHINE_END
98
99static int p720t_hw_init(void)
100{
101 /*
102 * Power down as much as possible in case we don't
103 * have the drivers loaded.
104 */
105 PLD_LCDEN = 0;
106 PLD_PWR &= ~(PLD_S4_ON|PLD_S3_ON|PLD_S2_ON|PLD_S1_ON);
107
108 PLD_KBD = 0;
109 PLD_IO = 0;
110 PLD_IRDA = 0;
111 PLD_CODEC = 0;
112 PLD_TCH = 0;
113 PLD_SPI = 0;
114#ifndef CONFIG_DEBUG_LL
115 PLD_COM2 = 0;
116 PLD_COM1 = 0;
117#endif
118
119 return 0;
120}
121
122__initcall(p720t_hw_init);
123