1*d2912cb1SThomas Gleixner // SPDX-License-Identifier: GPL-2.0-only
21da177e4SLinus Torvalds /*
31da177e4SLinus Torvalds * linux/arch/arm/mach-sa1100/jornada720.c
4408966b8SKristoffer Ericson *
5408966b8SKristoffer Ericson * HP Jornada720 init code
6408966b8SKristoffer Ericson *
7cc46f659SKristoffer Ericson * Copyright (C) 2007 Kristoffer Ericson <Kristoffer.Ericson@gmail.com>
8408966b8SKristoffer Ericson * Copyright (C) 2006 Filip Zyzniewski <filip.zyzniewski@tefnet.pl>
9408966b8SKristoffer Ericson * Copyright (C) 2005 Michael Gernoth <michael@gernoth.net>
101da177e4SLinus Torvalds */
111da177e4SLinus Torvalds
121da177e4SLinus Torvalds #include <linux/init.h>
131da177e4SLinus Torvalds #include <linux/kernel.h>
141da177e4SLinus Torvalds #include <linux/tty.h>
151da177e4SLinus Torvalds #include <linux/delay.h>
163521a0f0SRussell King #include <linux/gpio/machine.h>
176920b5a7SRussell King #include <linux/platform_data/sa11x0-serial.h>
18d052d1beSRussell King #include <linux/platform_device.h>
191da177e4SLinus Torvalds #include <linux/ioport.h>
20183e1a34SRussell King #include <linux/mtd/mtd.h>
21183e1a34SRussell King #include <linux/mtd/partitions.h>
22408966b8SKristoffer Ericson #include <video/s1d13xxxfb.h>
231da177e4SLinus Torvalds
241da177e4SLinus Torvalds #include <asm/hardware/sa1111.h>
259e54d33fSPaul Gortmaker #include <asm/page.h>
261da177e4SLinus Torvalds #include <asm/mach-types.h>
271da177e4SLinus Torvalds #include <asm/setup.h>
281da177e4SLinus Torvalds #include <asm/mach/arch.h>
29183e1a34SRussell King #include <asm/mach/flash.h>
301da177e4SLinus Torvalds #include <asm/mach/map.h>
311da177e4SLinus Torvalds
32f314f33bSRob Herring #include <mach/hardware.h>
33f314f33bSRob Herring #include <mach/irqs.h>
34f314f33bSRob Herring
351da177e4SLinus Torvalds #include "generic.h"
361da177e4SLinus Torvalds
37408966b8SKristoffer Ericson /*
38408966b8SKristoffer Ericson * HP Documentation referred in this file:
39408966b8SKristoffer Ericson * http://www.jlime.com/downloads/development/docs/jornada7xx/jornada720.txt
40408966b8SKristoffer Ericson */
411da177e4SLinus Torvalds
42408966b8SKristoffer Ericson /* line 110 of HP's doc */
43408966b8SKristoffer Ericson #define TUCR_VAL 0x20000400
44408966b8SKristoffer Ericson
45408966b8SKristoffer Ericson /* memory space (line 52 of HP's doc) */
46408966b8SKristoffer Ericson #define SA1111REGSTART 0x40000000
47cb5e2399SRussell King #define SA1111REGLEN 0x00002000
48408966b8SKristoffer Ericson #define EPSONREGSTART 0x48000000
49408966b8SKristoffer Ericson #define EPSONREGLEN 0x00100000
50408966b8SKristoffer Ericson #define EPSONFBSTART 0x48200000
51408966b8SKristoffer Ericson /* 512kB framebuffer */
52408966b8SKristoffer Ericson #define EPSONFBLEN 512*1024
53408966b8SKristoffer Ericson
54408966b8SKristoffer Ericson static struct s1d13xxxfb_regval s1d13xxxfb_initregs[] = {
55408966b8SKristoffer Ericson /* line 344 of HP's doc */
56408966b8SKristoffer Ericson {0x0001,0x00}, // Miscellaneous Register
57408966b8SKristoffer Ericson {0x01FC,0x00}, // Display Mode Register
58408966b8SKristoffer Ericson {0x0004,0x00}, // General IO Pins Configuration Register 0
59408966b8SKristoffer Ericson {0x0005,0x00}, // General IO Pins Configuration Register 1
60408966b8SKristoffer Ericson {0x0008,0x00}, // General IO Pins Control Register 0
61408966b8SKristoffer Ericson {0x0009,0x00}, // General IO Pins Control Register 1
62408966b8SKristoffer Ericson {0x0010,0x01}, // Memory Clock Configuration Register
63408966b8SKristoffer Ericson {0x0014,0x11}, // LCD Pixel Clock Configuration Register
64408966b8SKristoffer Ericson {0x0018,0x01}, // CRT/TV Pixel Clock Configuration Register
65408966b8SKristoffer Ericson {0x001C,0x01}, // MediaPlug Clock Configuration Register
66408966b8SKristoffer Ericson {0x001E,0x01}, // CPU To Memory Wait State Select Register
67408966b8SKristoffer Ericson {0x0020,0x00}, // Memory Configuration Register
68408966b8SKristoffer Ericson {0x0021,0x45}, // DRAM Refresh Rate Register
69408966b8SKristoffer Ericson {0x002A,0x01}, // DRAM Timings Control Register 0
70408966b8SKristoffer Ericson {0x002B,0x03}, // DRAM Timings Control Register 1
71408966b8SKristoffer Ericson {0x0030,0x1c}, // Panel Type Register
72408966b8SKristoffer Ericson {0x0031,0x00}, // MOD Rate Register
73408966b8SKristoffer Ericson {0x0032,0x4F}, // LCD Horizontal Display Width Register
74408966b8SKristoffer Ericson {0x0034,0x07}, // LCD Horizontal Non-Display Period Register
75408966b8SKristoffer Ericson {0x0035,0x01}, // TFT FPLINE Start Position Register
76408966b8SKristoffer Ericson {0x0036,0x0B}, // TFT FPLINE Pulse Width Register
77408966b8SKristoffer Ericson {0x0038,0xEF}, // LCD Vertical Display Height Register 0
78408966b8SKristoffer Ericson {0x0039,0x00}, // LCD Vertical Display Height Register 1
79408966b8SKristoffer Ericson {0x003A,0x13}, // LCD Vertical Non-Display Period Register
80408966b8SKristoffer Ericson {0x003B,0x0B}, // TFT FPFRAME Start Position Register
81408966b8SKristoffer Ericson {0x003C,0x01}, // TFT FPFRAME Pulse Width Register
82408966b8SKristoffer Ericson {0x0040,0x05}, // LCD Display Mode Register (2:4bpp,3:8bpp,5:16bpp)
83408966b8SKristoffer Ericson {0x0041,0x00}, // LCD Miscellaneous Register
84408966b8SKristoffer Ericson {0x0042,0x00}, // LCD Display Start Address Register 0
85408966b8SKristoffer Ericson {0x0043,0x00}, // LCD Display Start Address Register 1
86408966b8SKristoffer Ericson {0x0044,0x00}, // LCD Display Start Address Register 2
87408966b8SKristoffer Ericson {0x0046,0x80}, // LCD Memory Address Offset Register 0
88408966b8SKristoffer Ericson {0x0047,0x02}, // LCD Memory Address Offset Register 1
89408966b8SKristoffer Ericson {0x0048,0x00}, // LCD Pixel Panning Register
90408966b8SKristoffer Ericson {0x004A,0x00}, // LCD Display FIFO High Threshold Control Register
91408966b8SKristoffer Ericson {0x004B,0x00}, // LCD Display FIFO Low Threshold Control Register
92408966b8SKristoffer Ericson {0x0050,0x4F}, // CRT/TV Horizontal Display Width Register
93408966b8SKristoffer Ericson {0x0052,0x13}, // CRT/TV Horizontal Non-Display Period Register
94408966b8SKristoffer Ericson {0x0053,0x01}, // CRT/TV HRTC Start Position Register
95408966b8SKristoffer Ericson {0x0054,0x0B}, // CRT/TV HRTC Pulse Width Register
96408966b8SKristoffer Ericson {0x0056,0xDF}, // CRT/TV Vertical Display Height Register 0
97408966b8SKristoffer Ericson {0x0057,0x01}, // CRT/TV Vertical Display Height Register 1
98408966b8SKristoffer Ericson {0x0058,0x2B}, // CRT/TV Vertical Non-Display Period Register
99408966b8SKristoffer Ericson {0x0059,0x09}, // CRT/TV VRTC Start Position Register
100408966b8SKristoffer Ericson {0x005A,0x01}, // CRT/TV VRTC Pulse Width Register
101408966b8SKristoffer Ericson {0x005B,0x10}, // TV Output Control Register
102408966b8SKristoffer Ericson {0x0060,0x03}, // CRT/TV Display Mode Register (2:4bpp,3:8bpp,5:16bpp)
103408966b8SKristoffer Ericson {0x0062,0x00}, // CRT/TV Display Start Address Register 0
104408966b8SKristoffer Ericson {0x0063,0x00}, // CRT/TV Display Start Address Register 1
105408966b8SKristoffer Ericson {0x0064,0x00}, // CRT/TV Display Start Address Register 2
106408966b8SKristoffer Ericson {0x0066,0x40}, // CRT/TV Memory Address Offset Register 0
107408966b8SKristoffer Ericson {0x0067,0x01}, // CRT/TV Memory Address Offset Register 1
108408966b8SKristoffer Ericson {0x0068,0x00}, // CRT/TV Pixel Panning Register
109408966b8SKristoffer Ericson {0x006A,0x00}, // CRT/TV Display FIFO High Threshold Control Register
110408966b8SKristoffer Ericson {0x006B,0x00}, // CRT/TV Display FIFO Low Threshold Control Register
111408966b8SKristoffer Ericson {0x0070,0x00}, // LCD Ink/Cursor Control Register
112408966b8SKristoffer Ericson {0x0071,0x01}, // LCD Ink/Cursor Start Address Register
113408966b8SKristoffer Ericson {0x0072,0x00}, // LCD Cursor X Position Register 0
114408966b8SKristoffer Ericson {0x0073,0x00}, // LCD Cursor X Position Register 1
115408966b8SKristoffer Ericson {0x0074,0x00}, // LCD Cursor Y Position Register 0
116408966b8SKristoffer Ericson {0x0075,0x00}, // LCD Cursor Y Position Register 1
117408966b8SKristoffer Ericson {0x0076,0x00}, // LCD Ink/Cursor Blue Color 0 Register
118408966b8SKristoffer Ericson {0x0077,0x00}, // LCD Ink/Cursor Green Color 0 Register
119408966b8SKristoffer Ericson {0x0078,0x00}, // LCD Ink/Cursor Red Color 0 Register
120408966b8SKristoffer Ericson {0x007A,0x1F}, // LCD Ink/Cursor Blue Color 1 Register
121408966b8SKristoffer Ericson {0x007B,0x3F}, // LCD Ink/Cursor Green Color 1 Register
122408966b8SKristoffer Ericson {0x007C,0x1F}, // LCD Ink/Cursor Red Color 1 Register
123408966b8SKristoffer Ericson {0x007E,0x00}, // LCD Ink/Cursor FIFO Threshold Register
124408966b8SKristoffer Ericson {0x0080,0x00}, // CRT/TV Ink/Cursor Control Register
125408966b8SKristoffer Ericson {0x0081,0x01}, // CRT/TV Ink/Cursor Start Address Register
126408966b8SKristoffer Ericson {0x0082,0x00}, // CRT/TV Cursor X Position Register 0
127408966b8SKristoffer Ericson {0x0083,0x00}, // CRT/TV Cursor X Position Register 1
128408966b8SKristoffer Ericson {0x0084,0x00}, // CRT/TV Cursor Y Position Register 0
129408966b8SKristoffer Ericson {0x0085,0x00}, // CRT/TV Cursor Y Position Register 1
130408966b8SKristoffer Ericson {0x0086,0x00}, // CRT/TV Ink/Cursor Blue Color 0 Register
131408966b8SKristoffer Ericson {0x0087,0x00}, // CRT/TV Ink/Cursor Green Color 0 Register
132408966b8SKristoffer Ericson {0x0088,0x00}, // CRT/TV Ink/Cursor Red Color 0 Register
133408966b8SKristoffer Ericson {0x008A,0x1F}, // CRT/TV Ink/Cursor Blue Color 1 Register
134408966b8SKristoffer Ericson {0x008B,0x3F}, // CRT/TV Ink/Cursor Green Color 1 Register
135408966b8SKristoffer Ericson {0x008C,0x1F}, // CRT/TV Ink/Cursor Red Color 1 Register
136408966b8SKristoffer Ericson {0x008E,0x00}, // CRT/TV Ink/Cursor FIFO Threshold Register
137408966b8SKristoffer Ericson {0x0100,0x00}, // BitBlt Control Register 0
138408966b8SKristoffer Ericson {0x0101,0x00}, // BitBlt Control Register 1
139408966b8SKristoffer Ericson {0x0102,0x00}, // BitBlt ROP Code/Color Expansion Register
140408966b8SKristoffer Ericson {0x0103,0x00}, // BitBlt Operation Register
141408966b8SKristoffer Ericson {0x0104,0x00}, // BitBlt Source Start Address Register 0
142408966b8SKristoffer Ericson {0x0105,0x00}, // BitBlt Source Start Address Register 1
143408966b8SKristoffer Ericson {0x0106,0x00}, // BitBlt Source Start Address Register 2
144408966b8SKristoffer Ericson {0x0108,0x00}, // BitBlt Destination Start Address Register 0
145408966b8SKristoffer Ericson {0x0109,0x00}, // BitBlt Destination Start Address Register 1
146408966b8SKristoffer Ericson {0x010A,0x00}, // BitBlt Destination Start Address Register 2
147408966b8SKristoffer Ericson {0x010C,0x00}, // BitBlt Memory Address Offset Register 0
148408966b8SKristoffer Ericson {0x010D,0x00}, // BitBlt Memory Address Offset Register 1
149408966b8SKristoffer Ericson {0x0110,0x00}, // BitBlt Width Register 0
150408966b8SKristoffer Ericson {0x0111,0x00}, // BitBlt Width Register 1
151408966b8SKristoffer Ericson {0x0112,0x00}, // BitBlt Height Register 0
152408966b8SKristoffer Ericson {0x0113,0x00}, // BitBlt Height Register 1
153408966b8SKristoffer Ericson {0x0114,0x00}, // BitBlt Background Color Register 0
154408966b8SKristoffer Ericson {0x0115,0x00}, // BitBlt Background Color Register 1
155408966b8SKristoffer Ericson {0x0118,0x00}, // BitBlt Foreground Color Register 0
156408966b8SKristoffer Ericson {0x0119,0x00}, // BitBlt Foreground Color Register 1
157408966b8SKristoffer Ericson {0x01E0,0x00}, // Look-Up Table Mode Register
158408966b8SKristoffer Ericson {0x01E2,0x00}, // Look-Up Table Address Register
159408966b8SKristoffer Ericson /* not sure, wouldn't like to mess with the driver */
160408966b8SKristoffer Ericson {0x01E4,0x00}, // Look-Up Table Data Register
161408966b8SKristoffer Ericson /* jornada doc says 0x00, but I trust the driver */
162408966b8SKristoffer Ericson {0x01F0,0x10}, // Power Save Configuration Register
163408966b8SKristoffer Ericson {0x01F1,0x00}, // Power Save Status Register
164408966b8SKristoffer Ericson {0x01F4,0x00}, // CPU-to-Memory Access Watchdog Timer Register
165408966b8SKristoffer Ericson {0x01FC,0x01}, // Display Mode Register(0x01:LCD, 0x02:CRT, 0x03:LCD&CRT)
166408966b8SKristoffer Ericson };
167408966b8SKristoffer Ericson
168408966b8SKristoffer Ericson static struct s1d13xxxfb_pdata s1d13xxxfb_data = {
169408966b8SKristoffer Ericson .initregs = s1d13xxxfb_initregs,
170408966b8SKristoffer Ericson .initregssize = ARRAY_SIZE(s1d13xxxfb_initregs),
171408966b8SKristoffer Ericson .platform_init_video = NULL
172408966b8SKristoffer Ericson };
173408966b8SKristoffer Ericson
174408966b8SKristoffer Ericson static struct resource s1d13xxxfb_resources[] = {
175a181099eSRussell King [0] = DEFINE_RES_MEM(EPSONFBSTART, EPSONFBLEN),
176a181099eSRussell King [1] = DEFINE_RES_MEM(EPSONREGSTART, EPSONREGLEN),
177408966b8SKristoffer Ericson };
178408966b8SKristoffer Ericson
179408966b8SKristoffer Ericson static struct platform_device s1d13xxxfb_device = {
180408966b8SKristoffer Ericson .name = S1D_DEVICENAME,
181408966b8SKristoffer Ericson .id = 0,
182408966b8SKristoffer Ericson .dev = {
183408966b8SKristoffer Ericson .platform_data = &s1d13xxxfb_data,
184408966b8SKristoffer Ericson },
185408966b8SKristoffer Ericson .num_resources = ARRAY_SIZE(s1d13xxxfb_resources),
186408966b8SKristoffer Ericson .resource = s1d13xxxfb_resources,
187408966b8SKristoffer Ericson };
1881da177e4SLinus Torvalds
189b96e6c01SRussell King static struct gpiod_lookup_table jornada_pcmcia_gpiod_table = {
190b96e6c01SRussell King .dev_id = "1800",
191b96e6c01SRussell King .table = {
192b96e6c01SRussell King GPIO_LOOKUP("sa1111", 0, "s0-power", GPIO_ACTIVE_HIGH),
193b96e6c01SRussell King GPIO_LOOKUP("sa1111", 1, "s1-power", GPIO_ACTIVE_HIGH),
194b96e6c01SRussell King GPIO_LOOKUP("sa1111", 2, "s0-3v", GPIO_ACTIVE_HIGH),
195b96e6c01SRussell King GPIO_LOOKUP("sa1111", 3, "s1-3v", GPIO_ACTIVE_HIGH),
196b96e6c01SRussell King { },
197b96e6c01SRussell King },
198b96e6c01SRussell King };
199b96e6c01SRussell King
2001da177e4SLinus Torvalds static struct resource sa1111_resources[] = {
201a181099eSRussell King [0] = DEFINE_RES_MEM(SA1111REGSTART, SA1111REGLEN),
202a181099eSRussell King [1] = DEFINE_RES_IRQ(IRQ_GPIO1),
2031da177e4SLinus Torvalds };
2041da177e4SLinus Torvalds
20519851c58SEric Miao static struct sa1111_platform_data sa1111_info = {
20607be45f5SRussell King .disable_devs = SA1111_DEVID_PS2_MSE,
20719851c58SEric Miao };
20819851c58SEric Miao
2091da177e4SLinus Torvalds static u64 sa1111_dmamask = 0xffffffffUL;
2101da177e4SLinus Torvalds
2111da177e4SLinus Torvalds static struct platform_device sa1111_device = {
2121da177e4SLinus Torvalds .name = "sa1111",
2131da177e4SLinus Torvalds .id = 0,
2141da177e4SLinus Torvalds .dev = {
2151da177e4SLinus Torvalds .dma_mask = &sa1111_dmamask,
2161da177e4SLinus Torvalds .coherent_dma_mask = 0xffffffff,
21719851c58SEric Miao .platform_data = &sa1111_info,
2181da177e4SLinus Torvalds },
2191da177e4SLinus Torvalds .num_resources = ARRAY_SIZE(sa1111_resources),
2201da177e4SLinus Torvalds .resource = sa1111_resources,
2211da177e4SLinus Torvalds };
2221da177e4SLinus Torvalds
223cc46f659SKristoffer Ericson static struct platform_device jornada_ssp_device = {
224cc46f659SKristoffer Ericson .name = "jornada_ssp",
225408966b8SKristoffer Ericson .id = -1,
226408966b8SKristoffer Ericson };
227408966b8SKristoffer Ericson
2280f631d87SRussell King static struct resource jornada_kbd_resources[] = {
2290f631d87SRussell King DEFINE_RES_IRQ(IRQ_GPIO0),
2300f631d87SRussell King };
2310f631d87SRussell King
232b4e41129SKristoffer Ericson static struct platform_device jornada_kbd_device = {
233b4e41129SKristoffer Ericson .name = "jornada720_kbd",
234b4e41129SKristoffer Ericson .id = -1,
2350f631d87SRussell King .num_resources = ARRAY_SIZE(jornada_kbd_resources),
2360f631d87SRussell King .resource = jornada_kbd_resources,
237b4e41129SKristoffer Ericson };
238b4e41129SKristoffer Ericson
2393521a0f0SRussell King static struct gpiod_lookup_table jornada_ts_gpiod_table = {
2403521a0f0SRussell King .dev_id = "jornada_ts",
2413521a0f0SRussell King .table = {
2423521a0f0SRussell King GPIO_LOOKUP("gpio", 9, "penup", GPIO_ACTIVE_HIGH),
2433521a0f0SRussell King },
2443521a0f0SRussell King };
2453521a0f0SRussell King
246b4e41129SKristoffer Ericson static struct platform_device jornada_ts_device = {
247b4e41129SKristoffer Ericson .name = "jornada_ts",
248b4e41129SKristoffer Ericson .id = -1,
249b4e41129SKristoffer Ericson };
250b4e41129SKristoffer Ericson
2511da177e4SLinus Torvalds static struct platform_device *devices[] __initdata = {
2521da177e4SLinus Torvalds &sa1111_device,
253cc46f659SKristoffer Ericson &jornada_ssp_device,
254408966b8SKristoffer Ericson &s1d13xxxfb_device,
255b4e41129SKristoffer Ericson &jornada_kbd_device,
256b4e41129SKristoffer Ericson &jornada_ts_device,
2571da177e4SLinus Torvalds };
2581da177e4SLinus Torvalds
jornada720_init(void)2591da177e4SLinus Torvalds static int __init jornada720_init(void)
2601da177e4SLinus Torvalds {
2611da177e4SLinus Torvalds int ret = -ENODEV;
2621da177e4SLinus Torvalds
2631da177e4SLinus Torvalds if (machine_is_jornada720()) {
264cc46f659SKristoffer Ericson /* we want to use gpio20 as input to drive the clock of our uart 3 */
265cc46f659SKristoffer Ericson GPDR |= GPIO_GPIO20; /* Clear gpio20 pin as input */
266408966b8SKristoffer Ericson TUCR = TUCR_VAL;
267cc46f659SKristoffer Ericson GPSR = GPIO_GPIO20; /* start gpio20 pin */
2681da177e4SLinus Torvalds udelay(1);
269cc46f659SKristoffer Ericson GPCR = GPIO_GPIO20; /* stop gpio20 */
2701da177e4SLinus Torvalds udelay(1);
271cc46f659SKristoffer Ericson GPSR = GPIO_GPIO20; /* restart gpio20 */
272cc46f659SKristoffer Ericson udelay(20); /* give it some time to restart */
2731da177e4SLinus Torvalds
2743521a0f0SRussell King gpiod_add_lookup_table(&jornada_ts_gpiod_table);
275b96e6c01SRussell King gpiod_add_lookup_table(&jornada_pcmcia_gpiod_table);
2763521a0f0SRussell King
2771da177e4SLinus Torvalds ret = platform_add_devices(devices, ARRAY_SIZE(devices));
2781da177e4SLinus Torvalds }
279cc46f659SKristoffer Ericson
2801da177e4SLinus Torvalds return ret;
2811da177e4SLinus Torvalds }
2821da177e4SLinus Torvalds
2831da177e4SLinus Torvalds arch_initcall(jornada720_init);
2841da177e4SLinus Torvalds
2851da177e4SLinus Torvalds static struct map_desc jornada720_io_desc[] __initdata = {
28692519d82SDeepak Saxena { /* Epson registers */
28792519d82SDeepak Saxena .virtual = 0xf0000000,
288408966b8SKristoffer Ericson .pfn = __phys_to_pfn(EPSONREGSTART),
289408966b8SKristoffer Ericson .length = EPSONREGLEN,
29092519d82SDeepak Saxena .type = MT_DEVICE
29192519d82SDeepak Saxena }, { /* Epson frame buffer */
29292519d82SDeepak Saxena .virtual = 0xf1000000,
293408966b8SKristoffer Ericson .pfn = __phys_to_pfn(EPSONFBSTART),
294408966b8SKristoffer Ericson .length = EPSONFBLEN,
29592519d82SDeepak Saxena .type = MT_DEVICE
29692519d82SDeepak Saxena }
2971da177e4SLinus Torvalds };
2981da177e4SLinus Torvalds
jornada720_map_io(void)2991da177e4SLinus Torvalds static void __init jornada720_map_io(void)
3001da177e4SLinus Torvalds {
3011da177e4SLinus Torvalds sa1100_map_io();
3021da177e4SLinus Torvalds iotable_init(jornada720_io_desc, ARRAY_SIZE(jornada720_io_desc));
3031da177e4SLinus Torvalds
3041da177e4SLinus Torvalds sa1100_register_uart(0, 3);
3051da177e4SLinus Torvalds sa1100_register_uart(1, 1);
3061da177e4SLinus Torvalds }
3071da177e4SLinus Torvalds
308183e1a34SRussell King static struct mtd_partition jornada720_partitions[] = {
309183e1a34SRussell King {
310183e1a34SRussell King .name = "JORNADA720 boot firmware",
311183e1a34SRussell King .size = 0x00040000,
312183e1a34SRussell King .offset = 0,
313183e1a34SRussell King .mask_flags = MTD_WRITEABLE, /* force read-only */
314183e1a34SRussell King }, {
315183e1a34SRussell King .name = "JORNADA720 kernel",
316183e1a34SRussell King .size = 0x000c0000,
317183e1a34SRussell King .offset = 0x00040000,
318183e1a34SRussell King }, {
319183e1a34SRussell King .name = "JORNADA720 params",
320183e1a34SRussell King .size = 0x00040000,
321183e1a34SRussell King .offset = 0x00100000,
322183e1a34SRussell King }, {
323183e1a34SRussell King .name = "JORNADA720 initrd",
324183e1a34SRussell King .size = 0x00100000,
325183e1a34SRussell King .offset = 0x00140000,
326183e1a34SRussell King }, {
327183e1a34SRussell King .name = "JORNADA720 root cramfs",
328183e1a34SRussell King .size = 0x00300000,
329183e1a34SRussell King .offset = 0x00240000,
330183e1a34SRussell King }, {
331183e1a34SRussell King .name = "JORNADA720 usr cramfs",
332183e1a34SRussell King .size = 0x00800000,
333183e1a34SRussell King .offset = 0x00540000,
334183e1a34SRussell King }, {
335183e1a34SRussell King .name = "JORNADA720 usr local",
336183e1a34SRussell King .size = 0, /* will expand to the end of the flash */
337183e1a34SRussell King .offset = 0x00d00000,
338183e1a34SRussell King }
339183e1a34SRussell King };
340183e1a34SRussell King
jornada720_set_vpp(int vpp)341183e1a34SRussell King static void jornada720_set_vpp(int vpp)
342183e1a34SRussell King {
343183e1a34SRussell King if (vpp)
344408966b8SKristoffer Ericson /* enabling flash write (line 470 of HP's doc) */
345408966b8SKristoffer Ericson PPSR |= PPC_LDD7;
346183e1a34SRussell King else
347408966b8SKristoffer Ericson /* disabling flash write (line 470 of HP's doc) */
348408966b8SKristoffer Ericson PPSR &= ~PPC_LDD7;
349408966b8SKristoffer Ericson PPDR |= PPC_LDD7;
350183e1a34SRussell King }
351183e1a34SRussell King
352183e1a34SRussell King static struct flash_platform_data jornada720_flash_data = {
353183e1a34SRussell King .map_name = "cfi_probe",
354183e1a34SRussell King .set_vpp = jornada720_set_vpp,
355183e1a34SRussell King .parts = jornada720_partitions,
356183e1a34SRussell King .nr_parts = ARRAY_SIZE(jornada720_partitions),
357183e1a34SRussell King };
358183e1a34SRussell King
359a181099eSRussell King static struct resource jornada720_flash_resource =
360a181099eSRussell King DEFINE_RES_MEM(SA1100_CS0_PHYS, SZ_32M);
361183e1a34SRussell King
jornada720_mach_init(void)362183e1a34SRussell King static void __init jornada720_mach_init(void)
363183e1a34SRussell King {
3647a5b4e16SRussell King sa11x0_register_mtd(&jornada720_flash_data, &jornada720_flash_resource, 1);
365183e1a34SRussell King }
366183e1a34SRussell King
3671da177e4SLinus Torvalds MACHINE_START(JORNADA720, "HP Jornada 720")
368cc46f659SKristoffer Ericson /* Maintainer: Kristoffer Ericson <Kristoffer.Ericson@gmail.com> */
36917f4425dSNicolas Pitre .atag_offset = 0x100,
370e9dea0c6SRussell King .map_io = jornada720_map_io,
371f314f33bSRob Herring .nr_irqs = SA1100_NR_IRQS,
372e9dea0c6SRussell King .init_irq = sa1100_init_irq,
3736bb27d73SStephen Warren .init_time = sa1100_timer_init,
374183e1a34SRussell King .init_machine = jornada720_mach_init,
3757fea1ba5SShawn Guo .init_late = sa11x0_init_late,
376e9107ab6SNicolas Pitre #ifdef CONFIG_SA1111
377e9107ab6SNicolas Pitre .dma_zone_size = SZ_1M,
378e9107ab6SNicolas Pitre #endif
379d9ca5839SRussell King .restart = sa11x0_restart,
3801da177e4SLinus Torvalds MACHINE_END
381