2 * linux/arch/arm/mach-clps711x/p720t.c
4 * Copyright (C) 2000-2001 Deep Blue Solutions Ltd
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.
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.
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
20 #include <linux/kernel.h>
21 #include <linux/init.h>
22 #include <linux/types.h>
23 #include <linux/string.h>
26 #include <linux/slab.h>
27 #include <linux/leds.h>
29 #include <mach/hardware.h>
30 #include <asm/pgtable.h>
32 #include <asm/setup.h>
33 #include <asm/sizes.h>
34 #include <asm/mach-types.h>
35 #include <asm/mach/arch.h>
36 #include <asm/mach/map.h>
37 #include <mach/syspld.h>
42 * Map the P720T system PLD. It occupies two address spaces:
43 * 0x10000000 and 0x10400000. We map both regions as one.
45 static struct map_desc p720t_io_desc[] __initdata = {
47 .virtual = SYSPLD_VIRT_BASE,
48 .pfn = __phys_to_pfn(SYSPLD_PHYS_BASE),
55 fixup_p720t(struct tag *tag, char **cmdline, struct meminfo *mi)
58 * Our bootloader doesn't setup any tags (yet).
60 if (tag->hdr.tag != ATAG_CORE) {
61 tag->hdr.tag = ATAG_CORE;
62 tag->hdr.size = tag_size(tag_core);
63 tag->u.core.flags = 0;
64 tag->u.core.pagesize = PAGE_SIZE;
65 tag->u.core.rootdev = 0x0100;
68 tag->hdr.tag = ATAG_MEM;
69 tag->hdr.size = tag_size(tag_mem32);
70 tag->u.mem.size = 4096;
71 tag->u.mem.start = PHYS_OFFSET;
74 tag->hdr.tag = ATAG_NONE;
79 static void __init p720t_map_io(void)
82 iotable_init(p720t_io_desc, ARRAY_SIZE(p720t_io_desc));
85 static void __init p720t_init_early(void)
88 * Power down as much as possible in case we don't
89 * have the drivers loaded.
92 PLD_PWR &= ~(PLD_S4_ON|PLD_S3_ON|PLD_S2_ON|PLD_S1_ON);
100 if (!IS_ENABLED(CONFIG_DEBUG_LL)) {
107 * LED controled by CPLD
109 #if defined(CONFIG_NEW_LEDS) && defined(CONFIG_LEDS_CLASS)
110 static void p720t_led_set(struct led_classdev *cdev,
111 enum led_brightness b)
113 u8 reg = clps_readb(PDDR);
120 clps_writeb(reg, PDDR);
123 static enum led_brightness p720t_led_get(struct led_classdev *cdev)
125 u8 reg = clps_readb(PDDR);
127 return (reg & 0x1) ? LED_FULL : LED_OFF;
130 static int __init p720t_leds_init(void)
133 struct led_classdev *cdev;
136 if (!machine_is_p720t())
139 cdev = kzalloc(sizeof(*cdev), GFP_KERNEL);
143 cdev->name = "p720t:0";
144 cdev->brightness_set = p720t_led_set;
145 cdev->brightness_get = p720t_led_get;
146 cdev->default_trigger = "heartbeat";
148 ret = led_classdev_register(NULL, cdev);
158 * Since we may have triggers on any subsystem, defer registration
159 * until after subsystem_init.
161 fs_initcall(p720t_leds_init);
164 MACHINE_START(P720T, "ARM-Prospector720T")
165 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
166 .atag_offset = 0x100,
167 .fixup = fixup_p720t,
168 .init_early = p720t_init_early,
169 .map_io = p720t_map_io,
170 .init_irq = clps711x_init_irq,
171 .timer = &clps711x_timer,
172 .restart = clps711x_restart,