blob: eee3cbc5ec4f4d3a7bd9e0fcde4fc74e746c0454 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * linux/arch/arm/mach-sa1100/jornada720.c
3 */
4
5#include <linux/init.h>
6#include <linux/kernel.h>
7#include <linux/tty.h>
8#include <linux/delay.h>
9#include <linux/device.h>
10#include <linux/ioport.h>
11
12#include <asm/hardware.h>
13#include <asm/hardware/sa1111.h>
14#include <asm/irq.h>
15#include <asm/mach-types.h>
16#include <asm/setup.h>
17
18#include <asm/mach/arch.h>
19#include <asm/mach/map.h>
20#include <asm/mach/serial_sa1100.h>
21
22#include "generic.h"
23
24
25#define JORTUCR_VAL 0x20000400
26
27static struct resource sa1111_resources[] = {
28 [0] = {
29 .start = 0x40000000,
30 .end = 0x40001fff,
31 .flags = IORESOURCE_MEM,
32 },
33 [1] = {
34 .start = IRQ_GPIO1,
35 .end = IRQ_GPIO1,
36 .flags = IORESOURCE_IRQ,
37 },
38};
39
40static u64 sa1111_dmamask = 0xffffffffUL;
41
42static struct platform_device sa1111_device = {
43 .name = "sa1111",
44 .id = 0,
45 .dev = {
46 .dma_mask = &sa1111_dmamask,
47 .coherent_dma_mask = 0xffffffff,
48 },
49 .num_resources = ARRAY_SIZE(sa1111_resources),
50 .resource = sa1111_resources,
51};
52
53static struct platform_device *devices[] __initdata = {
54 &sa1111_device,
55};
56
57static int __init jornada720_init(void)
58{
59 int ret = -ENODEV;
60
61 if (machine_is_jornada720()) {
62 GPDR |= GPIO_GPIO20;
63 TUCR = JORTUCR_VAL; /* set the oscillator out to the SA-1101 */
64
65 GPSR = GPIO_GPIO20;
66 udelay(1);
67 GPCR = GPIO_GPIO20;
68 udelay(1);
69 GPSR = GPIO_GPIO20;
70 udelay(20);
71
72 /* LDD4 is speaker, LDD3 is microphone */
73 PPSR &= ~(PPC_LDD3 | PPC_LDD4);
74 PPDR |= PPC_LDD3 | PPC_LDD4;
75
76 ret = platform_add_devices(devices, ARRAY_SIZE(devices));
77 }
78 return ret;
79}
80
81arch_initcall(jornada720_init);
82
83static struct map_desc jornada720_io_desc[] __initdata = {
84 /* virtual physical length type */
85 { 0xf0000000, 0x48000000, 0x00100000, MT_DEVICE }, /* Epson registers */
86 { 0xf1000000, 0x48200000, 0x00100000, MT_DEVICE }, /* Epson frame buffer */
87 { 0xf4000000, 0x40000000, 0x00100000, MT_DEVICE } /* SA-1111 */
88};
89
90static void __init jornada720_map_io(void)
91{
92 sa1100_map_io();
93 iotable_init(jornada720_io_desc, ARRAY_SIZE(jornada720_io_desc));
94
95 sa1100_register_uart(0, 3);
96 sa1100_register_uart(1, 1);
97}
98
99MACHINE_START(JORNADA720, "HP Jornada 720")
Russell Kinge9dea0c2005-07-03 17:38:58 +0100100 .phys_ram = 0xc0000000,
101 .phys_io = 0x80000000,
102 .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc,
103 .boot_params = 0xc0000100,
104 .map_io = jornada720_map_io,
105 .init_irq = sa1100_init_irq,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700106 .timer = &sa1100_timer,
107MACHINE_END