blob: 65f63a4571300085a2a90838c6259f6b84249dc5 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * linux/arch/m68k/amiga/config.c
3 *
4 * Copyright (C) 1993 Hamish Macdonald
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file COPYING in the main directory of this archive
8 * for more details.
9 */
10
11/*
12 * Miscellaneous Amiga stuff
13 */
14
Linus Torvalds1da177e2005-04-16 15:20:36 -070015#include <linux/types.h>
16#include <linux/kernel.h>
17#include <linux/mm.h>
Alexey Dobriyan813dcf72008-10-03 22:42:36 +040018#include <linux/seq_file.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070019#include <linux/tty.h>
20#include <linux/console.h>
21#include <linux/rtc.h>
22#include <linux/init.h>
23#include <linux/vt_kern.h>
24#include <linux/delay.h>
25#include <linux/interrupt.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070026#include <linux/zorro.h>
Adrian Bunk8b169fa2008-02-04 22:30:25 -080027#include <linux/module.h>
Geert Uytterhoeven39d2d992008-10-13 21:58:53 +020028#include <linux/keyboard.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070029
30#include <asm/bootinfo.h>
Geert Uytterhoeven4c3c5222013-10-02 11:37:33 +020031#include <asm/bootinfo-amiga.h>
Geert Uytterhoevenbd9ba8f2013-10-04 09:38:53 +020032#include <asm/byteorder.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070033#include <asm/setup.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070034#include <asm/pgtable.h>
35#include <asm/amigahw.h>
36#include <asm/amigaints.h>
37#include <asm/irq.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070038#include <asm/machdep.h>
39#include <asm/io.h>
40
Adrian Bunk0795dbc2008-07-17 21:16:23 +020041static unsigned long amiga_model;
Adrian Bunk8b169fa2008-02-04 22:30:25 -080042
Linus Torvalds1da177e2005-04-16 15:20:36 -070043unsigned long amiga_eclock;
Adrian Bunk8b169fa2008-02-04 22:30:25 -080044EXPORT_SYMBOL(amiga_eclock);
45
Linus Torvalds1da177e2005-04-16 15:20:36 -070046unsigned long amiga_colorclock;
Adrian Bunk8b169fa2008-02-04 22:30:25 -080047EXPORT_SYMBOL(amiga_colorclock);
48
Linus Torvalds1da177e2005-04-16 15:20:36 -070049unsigned long amiga_chipset;
Adrian Bunk8b169fa2008-02-04 22:30:25 -080050EXPORT_SYMBOL(amiga_chipset);
51
Linus Torvalds1da177e2005-04-16 15:20:36 -070052unsigned char amiga_vblank;
Adrian Bunk8468afc2008-07-17 21:16:21 +020053EXPORT_SYMBOL(amiga_vblank);
54
Adrian Bunk0795dbc2008-07-17 21:16:23 +020055static unsigned char amiga_psfreq;
Adrian Bunk8b169fa2008-02-04 22:30:25 -080056
Linus Torvalds1da177e2005-04-16 15:20:36 -070057struct amiga_hw_present amiga_hw_present;
Adrian Bunk8b169fa2008-02-04 22:30:25 -080058EXPORT_SYMBOL(amiga_hw_present);
Linus Torvalds1da177e2005-04-16 15:20:36 -070059
60static char s_a500[] __initdata = "A500";
61static char s_a500p[] __initdata = "A500+";
62static char s_a600[] __initdata = "A600";
63static char s_a1000[] __initdata = "A1000";
64static char s_a1200[] __initdata = "A1200";
65static char s_a2000[] __initdata = "A2000";
66static char s_a2500[] __initdata = "A2500";
67static char s_a3000[] __initdata = "A3000";
68static char s_a3000t[] __initdata = "A3000T";
69static char s_a3000p[] __initdata = "A3000+";
70static char s_a4000[] __initdata = "A4000";
71static char s_a4000t[] __initdata = "A4000T";
72static char s_cdtv[] __initdata = "CDTV";
73static char s_cd32[] __initdata = "CD32";
74static char s_draco[] __initdata = "Draco";
75static char *amiga_models[] __initdata = {
Roman Zippel6ff58012007-05-01 22:32:43 +020076 [AMI_500-AMI_500] = s_a500,
77 [AMI_500PLUS-AMI_500] = s_a500p,
78 [AMI_600-AMI_500] = s_a600,
79 [AMI_1000-AMI_500] = s_a1000,
80 [AMI_1200-AMI_500] = s_a1200,
81 [AMI_2000-AMI_500] = s_a2000,
82 [AMI_2500-AMI_500] = s_a2500,
83 [AMI_3000-AMI_500] = s_a3000,
84 [AMI_3000T-AMI_500] = s_a3000t,
85 [AMI_3000PLUS-AMI_500] = s_a3000p,
86 [AMI_4000-AMI_500] = s_a4000,
87 [AMI_4000T-AMI_500] = s_a4000t,
88 [AMI_CDTV-AMI_500] = s_cdtv,
89 [AMI_CD32-AMI_500] = s_cd32,
90 [AMI_DRACO-AMI_500] = s_draco,
Linus Torvalds1da177e2005-04-16 15:20:36 -070091};
92
93static char amiga_model_name[13] = "Amiga ";
94
David Howells40220c12006-10-09 12:19:47 +010095static void amiga_sched_init(irq_handler_t handler);
Linus Torvalds1da177e2005-04-16 15:20:36 -070096static void amiga_get_model(char *model);
Alexey Dobriyan813dcf72008-10-03 22:42:36 +040097static void amiga_get_hardware_list(struct seq_file *m);
Linus Torvalds1da177e2005-04-16 15:20:36 -070098/* amiga specific timer functions */
Stephen Warrenc8d5ba12012-11-08 11:34:55 -070099static u32 amiga_gettimeoffset(void);
Roman Zippel6ff58012007-05-01 22:32:43 +0200100extern void amiga_mksound(unsigned int count, unsigned int ticks);
101static void amiga_reset(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700102extern void amiga_init_sound(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700103static void amiga_mem_console_write(struct console *co, const char *b,
104 unsigned int count);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700105#ifdef CONFIG_HEARTBEAT
106static void amiga_heartbeat(int on);
107#endif
108
109static struct console amiga_console_driver = {
Roman Zippel6ff58012007-05-01 22:32:43 +0200110 .name = "debug",
111 .flags = CON_PRINTBUFFER,
112 .index = -1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700113};
114
115
116 /*
117 * Motherboard Resources present in all Amiga models
118 */
119
120static struct {
Roman Zippel6ff58012007-05-01 22:32:43 +0200121 struct resource _ciab, _ciaa, _custom, _kickstart;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700122} mb_resources = {
Roman Zippel6ff58012007-05-01 22:32:43 +0200123 ._ciab = {
124 .name = "CIA B", .start = 0x00bfd000, .end = 0x00bfdfff
125 },
126 ._ciaa = {
127 .name = "CIA A", .start = 0x00bfe000, .end = 0x00bfefff
128 },
129 ._custom = {
130 .name = "Custom I/O", .start = 0x00dff000, .end = 0x00dfffff
131 },
132 ._kickstart = {
133 .name = "Kickstart ROM", .start = 0x00f80000, .end = 0x00ffffff
134 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700135};
136
Linus Torvalds1da177e2005-04-16 15:20:36 -0700137static struct resource ram_resource[NUM_MEMINFO];
138
139
140 /*
141 * Parse an Amiga-specific record in the bootinfo
142 */
143
Geert Uytterhoevena4df02a2013-06-25 21:15:24 +0200144int __init amiga_parse_bootinfo(const struct bi_record *record)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700145{
Roman Zippel6ff58012007-05-01 22:32:43 +0200146 int unknown = 0;
Geert Uytterhoevenabe48102013-10-04 11:41:24 +0200147 const void *data = record->data;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700148
Geert Uytterhoevenabe48102013-10-04 11:41:24 +0200149 switch (be16_to_cpu(record->tag)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700150 case BI_AMIGA_MODEL:
Geert Uytterhoevenabe48102013-10-04 11:41:24 +0200151 amiga_model = be32_to_cpup(data);
Roman Zippel6ff58012007-05-01 22:32:43 +0200152 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700153
154 case BI_AMIGA_ECLOCK:
Geert Uytterhoevenabe48102013-10-04 11:41:24 +0200155 amiga_eclock = be32_to_cpup(data);
Roman Zippel6ff58012007-05-01 22:32:43 +0200156 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700157
158 case BI_AMIGA_CHIPSET:
Geert Uytterhoevenabe48102013-10-04 11:41:24 +0200159 amiga_chipset = be32_to_cpup(data);
Roman Zippel6ff58012007-05-01 22:32:43 +0200160 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700161
162 case BI_AMIGA_CHIP_SIZE:
Geert Uytterhoevenabe48102013-10-04 11:41:24 +0200163 amiga_chip_size = be32_to_cpup(data);
Roman Zippel6ff58012007-05-01 22:32:43 +0200164 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700165
166 case BI_AMIGA_VBLANK:
Geert Uytterhoevenabe48102013-10-04 11:41:24 +0200167 amiga_vblank = *(const __u8 *)data;
Roman Zippel6ff58012007-05-01 22:32:43 +0200168 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700169
170 case BI_AMIGA_PSFREQ:
Geert Uytterhoevenabe48102013-10-04 11:41:24 +0200171 amiga_psfreq = *(const __u8 *)data;
Roman Zippel6ff58012007-05-01 22:32:43 +0200172 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700173
174 case BI_AMIGA_AUTOCON:
175#ifdef CONFIG_ZORRO
Roman Zippel6ff58012007-05-01 22:32:43 +0200176 if (zorro_num_autocon < ZORRO_NUM_AUTO) {
Geert Uytterhoevenabe48102013-10-04 11:41:24 +0200177 const struct ConfigDev *cd = data;
Geert Uytterhoevenc2937382013-06-29 10:40:20 +0200178 struct zorro_dev_init *dev = &zorro_autocon_init[zorro_num_autocon++];
Roman Zippel6ff58012007-05-01 22:32:43 +0200179 dev->rom = cd->cd_Rom;
Geert Uytterhoevenbd9ba8f2013-10-04 09:38:53 +0200180 dev->slotaddr = be16_to_cpu(cd->cd_SlotAddr);
181 dev->slotsize = be16_to_cpu(cd->cd_SlotSize);
182 dev->boardaddr = be32_to_cpu(cd->cd_BoardAddr);
183 dev->boardsize = be32_to_cpu(cd->cd_BoardSize);
Roman Zippel6ff58012007-05-01 22:32:43 +0200184 } else
Fabian Frederickf2964012014-05-10 12:38:00 +0200185 pr_warn("amiga_parse_bootinfo: too many AutoConfig devices\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700186#endif /* CONFIG_ZORRO */
Roman Zippel6ff58012007-05-01 22:32:43 +0200187 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700188
189 case BI_AMIGA_SERPER:
Roman Zippel6ff58012007-05-01 22:32:43 +0200190 /* serial port period: ignored here */
191 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700192
193 default:
Roman Zippel6ff58012007-05-01 22:32:43 +0200194 unknown = 1;
195 }
196 return unknown;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700197}
198
199 /*
200 * Identify builtin hardware
201 */
202
203static void __init amiga_identify(void)
204{
Roman Zippel6ff58012007-05-01 22:32:43 +0200205 /* Fill in some default values, if necessary */
206 if (amiga_eclock == 0)
207 amiga_eclock = 709379;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700208
Roman Zippel6ff58012007-05-01 22:32:43 +0200209 memset(&amiga_hw_present, 0, sizeof(amiga_hw_present));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700210
Fabian Frederickf2964012014-05-10 12:38:00 +0200211 pr_info("Amiga hardware found: ");
Roman Zippel6ff58012007-05-01 22:32:43 +0200212 if (amiga_model >= AMI_500 && amiga_model <= AMI_DRACO) {
Fabian Frederickf2964012014-05-10 12:38:00 +0200213 pr_cont("[%s] ", amiga_models[amiga_model-AMI_500]);
Roman Zippel6ff58012007-05-01 22:32:43 +0200214 strcat(amiga_model_name, amiga_models[amiga_model-AMI_500]);
215 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700216
Roman Zippel6ff58012007-05-01 22:32:43 +0200217 switch (amiga_model) {
218 case AMI_UNKNOWN:
219 goto Generic;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700220
Roman Zippel6ff58012007-05-01 22:32:43 +0200221 case AMI_600:
222 case AMI_1200:
223 AMIGAHW_SET(A1200_IDE);
224 AMIGAHW_SET(PCMCIA);
225 case AMI_500:
226 case AMI_500PLUS:
227 case AMI_1000:
228 case AMI_2000:
229 case AMI_2500:
230 AMIGAHW_SET(A2000_CLK); /* Is this correct for all models? */
231 goto Generic;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700232
Roman Zippel6ff58012007-05-01 22:32:43 +0200233 case AMI_3000:
234 case AMI_3000T:
235 AMIGAHW_SET(AMBER_FF);
236 AMIGAHW_SET(MAGIC_REKICK);
237 /* fall through */
238 case AMI_3000PLUS:
239 AMIGAHW_SET(A3000_SCSI);
240 AMIGAHW_SET(A3000_CLK);
241 AMIGAHW_SET(ZORRO3);
242 goto Generic;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700243
Roman Zippel6ff58012007-05-01 22:32:43 +0200244 case AMI_4000T:
245 AMIGAHW_SET(A4000_SCSI);
246 /* fall through */
247 case AMI_4000:
248 AMIGAHW_SET(A4000_IDE);
249 AMIGAHW_SET(A3000_CLK);
250 AMIGAHW_SET(ZORRO3);
251 goto Generic;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700252
Roman Zippel6ff58012007-05-01 22:32:43 +0200253 case AMI_CDTV:
254 case AMI_CD32:
255 AMIGAHW_SET(CD_ROM);
256 AMIGAHW_SET(A2000_CLK); /* Is this correct? */
257 goto Generic;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700258
Roman Zippel6ff58012007-05-01 22:32:43 +0200259 Generic:
260 AMIGAHW_SET(AMI_VIDEO);
261 AMIGAHW_SET(AMI_BLITTER);
262 AMIGAHW_SET(AMI_AUDIO);
263 AMIGAHW_SET(AMI_FLOPPY);
264 AMIGAHW_SET(AMI_KEYBOARD);
265 AMIGAHW_SET(AMI_MOUSE);
266 AMIGAHW_SET(AMI_SERIAL);
267 AMIGAHW_SET(AMI_PARALLEL);
268 AMIGAHW_SET(CHIP_RAM);
269 AMIGAHW_SET(PAULA);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700270
Roman Zippel6ff58012007-05-01 22:32:43 +0200271 switch (amiga_chipset) {
272 case CS_OCS:
273 case CS_ECS:
274 case CS_AGA:
275 switch (amiga_custom.deniseid & 0xf) {
276 case 0x0c:
277 AMIGAHW_SET(DENISE_HR);
278 break;
279 case 0x08:
280 AMIGAHW_SET(LISA);
281 break;
282 }
283 break;
284 default:
285 AMIGAHW_SET(DENISE);
286 break;
287 }
288 switch ((amiga_custom.vposr>>8) & 0x7f) {
289 case 0x00:
290 AMIGAHW_SET(AGNUS_PAL);
291 break;
292 case 0x10:
293 AMIGAHW_SET(AGNUS_NTSC);
294 break;
295 case 0x20:
296 case 0x21:
297 AMIGAHW_SET(AGNUS_HR_PAL);
298 break;
299 case 0x30:
300 case 0x31:
301 AMIGAHW_SET(AGNUS_HR_NTSC);
302 break;
303 case 0x22:
304 case 0x23:
305 AMIGAHW_SET(ALICE_PAL);
306 break;
307 case 0x32:
308 case 0x33:
309 AMIGAHW_SET(ALICE_NTSC);
310 break;
311 }
312 AMIGAHW_SET(ZORRO);
313 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700314
Roman Zippel6ff58012007-05-01 22:32:43 +0200315 case AMI_DRACO:
316 panic("No support for Draco yet");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700317
Roman Zippel6ff58012007-05-01 22:32:43 +0200318 default:
319 panic("Unknown Amiga Model");
320 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700321
Roman Zippel6ff58012007-05-01 22:32:43 +0200322#define AMIGAHW_ANNOUNCE(name, str) \
323 if (AMIGAHW_PRESENT(name)) \
Fabian Frederickf2964012014-05-10 12:38:00 +0200324 pr_cont(str)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700325
Roman Zippel6ff58012007-05-01 22:32:43 +0200326 AMIGAHW_ANNOUNCE(AMI_VIDEO, "VIDEO ");
327 AMIGAHW_ANNOUNCE(AMI_BLITTER, "BLITTER ");
328 AMIGAHW_ANNOUNCE(AMBER_FF, "AMBER_FF ");
329 AMIGAHW_ANNOUNCE(AMI_AUDIO, "AUDIO ");
330 AMIGAHW_ANNOUNCE(AMI_FLOPPY, "FLOPPY ");
331 AMIGAHW_ANNOUNCE(A3000_SCSI, "A3000_SCSI ");
332 AMIGAHW_ANNOUNCE(A4000_SCSI, "A4000_SCSI ");
333 AMIGAHW_ANNOUNCE(A1200_IDE, "A1200_IDE ");
334 AMIGAHW_ANNOUNCE(A4000_IDE, "A4000_IDE ");
335 AMIGAHW_ANNOUNCE(CD_ROM, "CD_ROM ");
336 AMIGAHW_ANNOUNCE(AMI_KEYBOARD, "KEYBOARD ");
337 AMIGAHW_ANNOUNCE(AMI_MOUSE, "MOUSE ");
338 AMIGAHW_ANNOUNCE(AMI_SERIAL, "SERIAL ");
339 AMIGAHW_ANNOUNCE(AMI_PARALLEL, "PARALLEL ");
340 AMIGAHW_ANNOUNCE(A2000_CLK, "A2000_CLK ");
341 AMIGAHW_ANNOUNCE(A3000_CLK, "A3000_CLK ");
342 AMIGAHW_ANNOUNCE(CHIP_RAM, "CHIP_RAM ");
343 AMIGAHW_ANNOUNCE(PAULA, "PAULA ");
344 AMIGAHW_ANNOUNCE(DENISE, "DENISE ");
345 AMIGAHW_ANNOUNCE(DENISE_HR, "DENISE_HR ");
346 AMIGAHW_ANNOUNCE(LISA, "LISA ");
347 AMIGAHW_ANNOUNCE(AGNUS_PAL, "AGNUS_PAL ");
348 AMIGAHW_ANNOUNCE(AGNUS_NTSC, "AGNUS_NTSC ");
349 AMIGAHW_ANNOUNCE(AGNUS_HR_PAL, "AGNUS_HR_PAL ");
350 AMIGAHW_ANNOUNCE(AGNUS_HR_NTSC, "AGNUS_HR_NTSC ");
351 AMIGAHW_ANNOUNCE(ALICE_PAL, "ALICE_PAL ");
352 AMIGAHW_ANNOUNCE(ALICE_NTSC, "ALICE_NTSC ");
353 AMIGAHW_ANNOUNCE(MAGIC_REKICK, "MAGIC_REKICK ");
354 AMIGAHW_ANNOUNCE(PCMCIA, "PCMCIA ");
355 if (AMIGAHW_PRESENT(ZORRO))
Fabian Frederickf2964012014-05-10 12:38:00 +0200356 pr_cont("ZORRO%s ", AMIGAHW_PRESENT(ZORRO3) ? "3" : "");
357 pr_cont("\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700358
359#undef AMIGAHW_ANNOUNCE
360}
361
Geert Uytterhoeven50190ed2013-10-18 13:16:06 +0200362
363static unsigned long amiga_random_get_entropy(void)
364{
365 /* VPOSR/VHPOSR provide at least 17 bits of data changing at 1.79 MHz */
366 return *(unsigned long *)&amiga_custom.vposr;
367}
368
369
Linus Torvalds1da177e2005-04-16 15:20:36 -0700370 /*
371 * Setup the Amiga configuration info
372 */
373
374void __init config_amiga(void)
375{
Roman Zippel6ff58012007-05-01 22:32:43 +0200376 int i;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700377
Roman Zippel6ff58012007-05-01 22:32:43 +0200378 amiga_identify();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700379
Roman Zippel6ff58012007-05-01 22:32:43 +0200380 /* Yuk, we don't have PCI memory */
381 iomem_resource.name = "Memory";
382 for (i = 0; i < 4; i++)
383 request_resource(&iomem_resource, &((struct resource *)&mb_resources)[i]);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700384
Roman Zippel6ff58012007-05-01 22:32:43 +0200385 mach_sched_init = amiga_sched_init;
386 mach_init_IRQ = amiga_init_IRQ;
387 mach_get_model = amiga_get_model;
388 mach_get_hardware_list = amiga_get_hardware_list;
Stephen Warrenc8d5ba12012-11-08 11:34:55 -0700389 arch_gettimeoffset = amiga_gettimeoffset;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700390
Roman Zippel6ff58012007-05-01 22:32:43 +0200391 /*
392 * default MAX_DMA=0xffffffff on all machines. If we don't do so, the SCSI
393 * code will not be able to allocate any mem for transfers, unless we are
394 * dealing with a Z2 mem only system. /Jes
395 */
396 mach_max_dma_address = 0xffffffff;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700397
Roman Zippel6ff58012007-05-01 22:32:43 +0200398 mach_reset = amiga_reset;
Geert Uytterhoevena1a9e882016-09-05 13:18:15 +0200399#if IS_ENABLED(CONFIG_INPUT_M68K_BEEP)
Roman Zippel6ff58012007-05-01 22:32:43 +0200400 mach_beep = amiga_mksound;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700401#endif
402
403#ifdef CONFIG_HEARTBEAT
Roman Zippel6ff58012007-05-01 22:32:43 +0200404 mach_heartbeat = amiga_heartbeat;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700405#endif
406
Geert Uytterhoeven50190ed2013-10-18 13:16:06 +0200407 mach_random_get_entropy = amiga_random_get_entropy;
408
Adrian Bunk0795dbc2008-07-17 21:16:23 +0200409 /* Fill in the clock value (based on the 700 kHz E-Clock) */
Roman Zippel6ff58012007-05-01 22:32:43 +0200410 amiga_colorclock = 5*amiga_eclock; /* 3.5 MHz */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700411
Roman Zippel6ff58012007-05-01 22:32:43 +0200412 /* clear all DMA bits */
413 amiga_custom.dmacon = DMAF_ALL;
414 /* ensure that the DMA master bit is set */
415 amiga_custom.dmacon = DMAF_SETCLR | DMAF_MASTER;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700416
Roman Zippel6ff58012007-05-01 22:32:43 +0200417 /* don't use Z2 RAM as system memory on Z3 capable machines */
418 if (AMIGAHW_PRESENT(ZORRO3)) {
419 int i, j;
420 u32 disabled_z2mem = 0;
421
422 for (i = 0; i < m68k_num_memory; i++) {
423 if (m68k_memory[i].addr < 16*1024*1024) {
424 if (i == 0) {
425 /* don't cut off the branch we're sitting on */
Fabian Frederickf2964012014-05-10 12:38:00 +0200426 pr_warn("Warning: kernel runs in Zorro II memory\n");
Roman Zippel6ff58012007-05-01 22:32:43 +0200427 continue;
428 }
429 disabled_z2mem += m68k_memory[i].size;
430 m68k_num_memory--;
431 for (j = i; j < m68k_num_memory; j++)
432 m68k_memory[j] = m68k_memory[j+1];
433 i--;
434 }
435 }
436 if (disabled_z2mem)
Fabian Frederickf2964012014-05-10 12:38:00 +0200437 pr_info("%dK of Zorro II memory will not be used as system memory\n",
438 disabled_z2mem>>10);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700439 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700440
Roman Zippel6ff58012007-05-01 22:32:43 +0200441 /* request all RAM */
442 for (i = 0; i < m68k_num_memory; i++) {
443 ram_resource[i].name =
444 (m68k_memory[i].addr >= 0x01000000) ? "32-bit Fast RAM" :
445 (m68k_memory[i].addr < 0x00c00000) ? "16-bit Fast RAM" :
446 "16-bit Slow RAM";
447 ram_resource[i].start = m68k_memory[i].addr;
448 ram_resource[i].end = m68k_memory[i].addr+m68k_memory[i].size-1;
449 request_resource(&iomem_resource, &ram_resource[i]);
450 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700451
Roman Zippel6ff58012007-05-01 22:32:43 +0200452 /* initialize chipram allocator */
453 amiga_chip_init();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700454
Roman Zippel6ff58012007-05-01 22:32:43 +0200455 /* our beloved beeper */
456 if (AMIGAHW_PRESENT(AMI_AUDIO))
457 amiga_init_sound();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700458
Roman Zippel6ff58012007-05-01 22:32:43 +0200459 /*
460 * if it is an A3000, set the magic bit that forces
461 * a hard rekick
462 */
463 if (AMIGAHW_PRESENT(MAGIC_REKICK))
464 *(unsigned char *)ZTWO_VADDR(0xde0002) |= 0x80;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700465}
466
467static unsigned short jiffy_ticks;
468
David Howells40220c12006-10-09 12:19:47 +0100469static void __init amiga_sched_init(irq_handler_t timer_routine)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700470{
471 static struct resource sched_res = {
Roman Zippel6ff58012007-05-01 22:32:43 +0200472 .name = "timer", .start = 0x00bfd400, .end = 0x00bfd5ff,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700473 };
Julia Lawall1a0caf42009-08-02 10:47:47 +0200474 jiffy_ticks = DIV_ROUND_CLOSEST(amiga_eclock, HZ);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700475
476 if (request_resource(&mb_resources._ciab, &sched_res))
Fabian Frederickf2964012014-05-10 12:38:00 +0200477 pr_warn("Cannot allocate ciab.ta{lo,hi}\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700478 ciab.cra &= 0xC0; /* turn off timer A, continuous mode, from Eclk */
479 ciab.talo = jiffy_ticks % 256;
480 ciab.tahi = jiffy_ticks / 256;
481
482 /* install interrupt service routine for CIAB Timer A
483 *
484 * Please don't change this to use ciaa, as it interferes with the
485 * SCSI code. We'll have to take a look at this later
486 */
Geert Uytterhoeven66acd252008-12-30 14:00:34 +0100487 if (request_irq(IRQ_AMIGA_CIAB_TA, timer_routine, 0, "timer", NULL))
488 pr_err("Couldn't register timer interrupt\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700489 /* start timer */
490 ciab.cra |= 0x11;
491}
492
493#define TICK_SIZE 10000
494
495/* This is always executed with interrupts disabled. */
Stephen Warrenc8d5ba12012-11-08 11:34:55 -0700496static u32 amiga_gettimeoffset(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700497{
498 unsigned short hi, lo, hi2;
Stephen Warrenc8d5ba12012-11-08 11:34:55 -0700499 u32 ticks, offset = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700500
501 /* read CIA B timer A current value */
502 hi = ciab.tahi;
503 lo = ciab.talo;
504 hi2 = ciab.tahi;
505
506 if (hi != hi2) {
507 lo = ciab.talo;
508 hi = hi2;
509 }
510
511 ticks = hi << 8 | lo;
512
513 if (ticks > jiffy_ticks / 2)
514 /* check for pending interrupt */
515 if (cia_set_irq(&ciab_base, 0) & CIA_ICR_TA)
516 offset = 10000;
517
518 ticks = jiffy_ticks - ticks;
519 ticks = (10000 * ticks) / jiffy_ticks;
520
Stephen Warrenc8d5ba12012-11-08 11:34:55 -0700521 return (ticks + offset) * 1000;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700522}
523
Joe Perchesff2d8b12012-01-12 17:17:21 -0800524static void amiga_reset(void) __noreturn;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700525
Roman Zippel6ff58012007-05-01 22:32:43 +0200526static void amiga_reset(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700527{
Roman Zippel6ff58012007-05-01 22:32:43 +0200528 unsigned long jmp_addr040 = virt_to_phys(&&jmp_addr_label040);
529 unsigned long jmp_addr = virt_to_phys(&&jmp_addr_label);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700530
Roman Zippel6ff58012007-05-01 22:32:43 +0200531 local_irq_disable();
532 if (CPU_IS_040_OR_060)
533 /* Setup transparent translation registers for mapping
534 * of 16 MB kernel segment before disabling translation
535 */
536 asm volatile ("\n"
537 " move.l %0,%%d0\n"
538 " and.l #0xff000000,%%d0\n"
539 " or.w #0xe020,%%d0\n" /* map 16 MB, enable, cacheable */
540 " .chip 68040\n"
541 " movec %%d0,%%itt0\n"
542 " movec %%d0,%%dtt0\n"
543 " .chip 68k\n"
544 " jmp %0@\n"
545 : /* no outputs */
546 : "a" (jmp_addr040)
547 : "d0");
548 else
549 /* for 680[23]0, just disable translation and jump to the physical
550 * address of the label
551 */
552 asm volatile ("\n"
553 " pmove %%tc,%@\n"
554 " bclr #7,%@\n"
555 " pmove %@,%%tc\n"
556 " jmp %0@\n"
557 : /* no outputs */
558 : "a" (jmp_addr));
559jmp_addr_label040:
560 /* disable translation on '040 now */
561 asm volatile ("\n"
562 " moveq #0,%%d0\n"
563 " .chip 68040\n"
564 " movec %%d0,%%tc\n" /* disable MMU */
565 " .chip 68k\n"
566 : /* no outputs */
567 : /* no inputs */
568 : "d0");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700569
Roman Zippel6ff58012007-05-01 22:32:43 +0200570 jmp_addr_label:
571 /* pickup reset address from AmigaOS ROM, reset devices and jump
572 * to reset address
573 */
574 asm volatile ("\n"
575 " move.w #0x2700,%sr\n"
576 " lea 0x01000000,%a0\n"
577 " sub.l %a0@(-0x14),%a0\n"
578 " move.l %a0@(4),%a0\n"
579 " subq.l #2,%a0\n"
580 " jra 1f\n"
581 /* align on a longword boundary */
582 " " __ALIGN_STR "\n"
583 "1:\n"
584 " reset\n"
585 " jmp %a0@");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700586
Roman Zippel6ff58012007-05-01 22:32:43 +0200587 for (;;)
588 ;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700589}
590
591
592 /*
593 * Debugging
594 */
595
596#define SAVEKMSG_MAXMEM 128*1024
597
598#define SAVEKMSG_MAGIC1 0x53415645 /* 'SAVE' */
599#define SAVEKMSG_MAGIC2 0x4B4D5347 /* 'KMSG' */
600
601struct savekmsg {
Roman Zippel6ff58012007-05-01 22:32:43 +0200602 unsigned long magic1; /* SAVEKMSG_MAGIC1 */
603 unsigned long magic2; /* SAVEKMSG_MAGIC2 */
604 unsigned long magicptr; /* address of magic1 */
605 unsigned long size;
606 char data[0];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700607};
608
609static struct savekmsg *savekmsg;
610
611static void amiga_mem_console_write(struct console *co, const char *s,
612 unsigned int count)
613{
Roman Zippel6ff58012007-05-01 22:32:43 +0200614 if (savekmsg->size + count <= SAVEKMSG_MAXMEM-sizeof(struct savekmsg)) {
615 memcpy(savekmsg->data + savekmsg->size, s, count);
616 savekmsg->size += count;
617 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700618}
619
Roman Zippeld6713b42007-05-01 22:32:45 +0200620static int __init amiga_savekmsg_setup(char *arg)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700621{
Geert Uytterhoeven8a09cec2013-12-01 11:14:51 +0100622 bool registered;
623
Roman Zippeld6713b42007-05-01 22:32:45 +0200624 if (!MACH_IS_AMIGA || strcmp(arg, "mem"))
Geert Uytterhoeven5df1abd2011-01-07 13:25:29 +0100625 return 0;
Roman Zippeld6713b42007-05-01 22:32:45 +0200626
Geert Uytterhoeven5df1abd2011-01-07 13:25:29 +0100627 if (amiga_chip_size < SAVEKMSG_MAXMEM) {
628 pr_err("Not enough chipram for debugging\n");
629 return -ENOMEM;
Roman Zippeld6713b42007-05-01 22:32:45 +0200630 }
631
Geert Uytterhoeven5df1abd2011-01-07 13:25:29 +0100632 /* Just steal the block, the chipram allocator isn't functional yet */
633 amiga_chip_size -= SAVEKMSG_MAXMEM;
Geert Uytterhoeven6112ea02011-01-09 11:03:43 +0100634 savekmsg = ZTWO_VADDR(CHIP_PHYSADDR + amiga_chip_size);
Roman Zippel6ff58012007-05-01 22:32:43 +0200635 savekmsg->magic1 = SAVEKMSG_MAGIC1;
636 savekmsg->magic2 = SAVEKMSG_MAGIC2;
637 savekmsg->magicptr = ZTWO_PADDR(savekmsg);
638 savekmsg->size = 0;
Roman Zippeld6713b42007-05-01 22:32:45 +0200639
Geert Uytterhoeven8a09cec2013-12-01 11:14:51 +0100640 registered = !!amiga_console_driver.write;
Roman Zippeld6713b42007-05-01 22:32:45 +0200641 amiga_console_driver.write = amiga_mem_console_write;
Geert Uytterhoeven8a09cec2013-12-01 11:14:51 +0100642 if (!registered)
643 register_console(&amiga_console_driver);
Roman Zippeld6713b42007-05-01 22:32:45 +0200644 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700645}
646
Roman Zippeld6713b42007-05-01 22:32:45 +0200647early_param("debug", amiga_savekmsg_setup);
648
Linus Torvalds1da177e2005-04-16 15:20:36 -0700649static void amiga_serial_putc(char c)
650{
Roman Zippel6ff58012007-05-01 22:32:43 +0200651 amiga_custom.serdat = (unsigned char)c | 0x100;
652 while (!(amiga_custom.serdatr & 0x2000))
653 ;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700654}
655
Adrian Bunk0795dbc2008-07-17 21:16:23 +0200656static void amiga_serial_console_write(struct console *co, const char *s,
657 unsigned int count)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700658{
Roman Zippel6ff58012007-05-01 22:32:43 +0200659 while (count--) {
660 if (*s == '\n')
661 amiga_serial_putc('\r');
662 amiga_serial_putc(*s++);
663 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700664}
665
Adrian Bunk0795dbc2008-07-17 21:16:23 +0200666#if 0
Linus Torvalds1da177e2005-04-16 15:20:36 -0700667void amiga_serial_puts(const char *s)
668{
Roman Zippel6ff58012007-05-01 22:32:43 +0200669 amiga_serial_console_write(NULL, s, strlen(s));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700670}
671
672int amiga_serial_console_wait_key(struct console *co)
673{
Roman Zippel6ff58012007-05-01 22:32:43 +0200674 int ch;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700675
Roman Zippel6ff58012007-05-01 22:32:43 +0200676 while (!(amiga_custom.intreqr & IF_RBF))
677 barrier();
678 ch = amiga_custom.serdatr & 0xff;
679 /* clear the interrupt, so that another character can be read */
680 amiga_custom.intreq = IF_RBF;
681 return ch;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700682}
683
684void amiga_serial_gets(struct console *co, char *s, int len)
685{
Roman Zippel6ff58012007-05-01 22:32:43 +0200686 int ch, cnt = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700687
Roman Zippel6ff58012007-05-01 22:32:43 +0200688 while (1) {
689 ch = amiga_serial_console_wait_key(co);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700690
Roman Zippel6ff58012007-05-01 22:32:43 +0200691 /* Check for backspace. */
692 if (ch == 8 || ch == 127) {
693 if (cnt == 0) {
694 amiga_serial_putc('\007');
695 continue;
696 }
697 cnt--;
698 amiga_serial_puts("\010 \010");
699 continue;
700 }
701
702 /* Check for enter. */
703 if (ch == 10 || ch == 13)
704 break;
705
706 /* See if line is too long. */
707 if (cnt >= len + 1) {
708 amiga_serial_putc(7);
709 cnt--;
710 continue;
711 }
712
713 /* Store and echo character. */
714 s[cnt++] = ch;
715 amiga_serial_putc(ch);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700716 }
Roman Zippel6ff58012007-05-01 22:32:43 +0200717 /* Print enter. */
718 amiga_serial_puts("\r\n");
719 s[cnt] = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700720}
721#endif
722
Roman Zippeld6713b42007-05-01 22:32:45 +0200723static int __init amiga_debug_setup(char *arg)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700724{
Geert Uytterhoeven8a09cec2013-12-01 11:14:51 +0100725 bool registered;
726
727 if (!MACH_IS_AMIGA || strcmp(arg, "ser"))
728 return 0;
729
730 /* no initialization required (?) */
731 registered = !!amiga_console_driver.write;
732 amiga_console_driver.write = amiga_serial_console_write;
733 if (!registered)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700734 register_console(&amiga_console_driver);
Roman Zippeld6713b42007-05-01 22:32:45 +0200735 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700736}
737
Roman Zippeld6713b42007-05-01 22:32:45 +0200738early_param("debug", amiga_debug_setup);
739
Linus Torvalds1da177e2005-04-16 15:20:36 -0700740#ifdef CONFIG_HEARTBEAT
741static void amiga_heartbeat(int on)
742{
Roman Zippel6ff58012007-05-01 22:32:43 +0200743 if (on)
744 ciaa.pra &= ~2;
745 else
746 ciaa.pra |= 2;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700747}
748#endif
749
750 /*
751 * Amiga specific parts of /proc
752 */
753
754static void amiga_get_model(char *model)
755{
Roman Zippel6ff58012007-05-01 22:32:43 +0200756 strcpy(model, amiga_model_name);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700757}
758
759
Alexey Dobriyan813dcf72008-10-03 22:42:36 +0400760static void amiga_get_hardware_list(struct seq_file *m)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700761{
Roman Zippel6ff58012007-05-01 22:32:43 +0200762 if (AMIGAHW_PRESENT(CHIP_RAM))
Alexey Dobriyan813dcf72008-10-03 22:42:36 +0400763 seq_printf(m, "Chip RAM:\t%ldK\n", amiga_chip_size>>10);
764 seq_printf(m, "PS Freq:\t%dHz\nEClock Freq:\t%ldHz\n",
Roman Zippel6ff58012007-05-01 22:32:43 +0200765 amiga_psfreq, amiga_eclock);
766 if (AMIGAHW_PRESENT(AMI_VIDEO)) {
767 char *type;
768 switch (amiga_chipset) {
769 case CS_OCS:
770 type = "OCS";
771 break;
772 case CS_ECS:
773 type = "ECS";
774 break;
775 case CS_AGA:
776 type = "AGA";
777 break;
778 default:
779 type = "Old or Unknown";
780 break;
781 }
Alexey Dobriyan813dcf72008-10-03 22:42:36 +0400782 seq_printf(m, "Graphics:\t%s\n", type);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700783 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700784
785#define AMIGAHW_ANNOUNCE(name, str) \
Roman Zippel6ff58012007-05-01 22:32:43 +0200786 if (AMIGAHW_PRESENT(name)) \
Alexey Dobriyan813dcf72008-10-03 22:42:36 +0400787 seq_printf (m, "\t%s\n", str)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700788
Markus Elfringf2a0c532016-10-23 22:55:03 +0200789 seq_puts(m, "Detected hardware:\n");
Roman Zippel6ff58012007-05-01 22:32:43 +0200790 AMIGAHW_ANNOUNCE(AMI_VIDEO, "Amiga Video");
791 AMIGAHW_ANNOUNCE(AMI_BLITTER, "Blitter");
792 AMIGAHW_ANNOUNCE(AMBER_FF, "Amber Flicker Fixer");
793 AMIGAHW_ANNOUNCE(AMI_AUDIO, "Amiga Audio");
794 AMIGAHW_ANNOUNCE(AMI_FLOPPY, "Floppy Controller");
795 AMIGAHW_ANNOUNCE(A3000_SCSI, "SCSI Controller WD33C93 (A3000 style)");
796 AMIGAHW_ANNOUNCE(A4000_SCSI, "SCSI Controller NCR53C710 (A4000T style)");
797 AMIGAHW_ANNOUNCE(A1200_IDE, "IDE Interface (A1200 style)");
798 AMIGAHW_ANNOUNCE(A4000_IDE, "IDE Interface (A4000 style)");
799 AMIGAHW_ANNOUNCE(CD_ROM, "Internal CD ROM drive");
800 AMIGAHW_ANNOUNCE(AMI_KEYBOARD, "Keyboard");
801 AMIGAHW_ANNOUNCE(AMI_MOUSE, "Mouse Port");
802 AMIGAHW_ANNOUNCE(AMI_SERIAL, "Serial Port");
803 AMIGAHW_ANNOUNCE(AMI_PARALLEL, "Parallel Port");
804 AMIGAHW_ANNOUNCE(A2000_CLK, "Hardware Clock (A2000 style)");
805 AMIGAHW_ANNOUNCE(A3000_CLK, "Hardware Clock (A3000 style)");
806 AMIGAHW_ANNOUNCE(CHIP_RAM, "Chip RAM");
807 AMIGAHW_ANNOUNCE(PAULA, "Paula 8364");
808 AMIGAHW_ANNOUNCE(DENISE, "Denise 8362");
809 AMIGAHW_ANNOUNCE(DENISE_HR, "Denise 8373");
810 AMIGAHW_ANNOUNCE(LISA, "Lisa 8375");
811 AMIGAHW_ANNOUNCE(AGNUS_PAL, "Normal/Fat PAL Agnus 8367/8371");
812 AMIGAHW_ANNOUNCE(AGNUS_NTSC, "Normal/Fat NTSC Agnus 8361/8370");
813 AMIGAHW_ANNOUNCE(AGNUS_HR_PAL, "Fat Hires PAL Agnus 8372");
814 AMIGAHW_ANNOUNCE(AGNUS_HR_NTSC, "Fat Hires NTSC Agnus 8372");
815 AMIGAHW_ANNOUNCE(ALICE_PAL, "PAL Alice 8374");
816 AMIGAHW_ANNOUNCE(ALICE_NTSC, "NTSC Alice 8374");
817 AMIGAHW_ANNOUNCE(MAGIC_REKICK, "Magic Hard Rekick");
818 AMIGAHW_ANNOUNCE(PCMCIA, "PCMCIA Slot");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700819#ifdef CONFIG_ZORRO
Roman Zippel6ff58012007-05-01 22:32:43 +0200820 if (AMIGAHW_PRESENT(ZORRO))
Alexey Dobriyan813dcf72008-10-03 22:42:36 +0400821 seq_printf(m, "\tZorro II%s AutoConfig: %d Expansion "
Roman Zippel6ff58012007-05-01 22:32:43 +0200822 "Device%s\n",
823 AMIGAHW_PRESENT(ZORRO3) ? "I" : "",
824 zorro_num_autocon, zorro_num_autocon == 1 ? "" : "s");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700825#endif /* CONFIG_ZORRO */
826
827#undef AMIGAHW_ANNOUNCE
Linus Torvalds1da177e2005-04-16 15:20:36 -0700828}
Geert Uytterhoeven39d2d992008-10-13 21:58:53 +0200829
830/*
831 * The Amiga keyboard driver needs key_maps, but we cannot export it in
832 * drivers/char/defkeymap.c, as it is autogenerated
833 */
834#ifdef CONFIG_HW_CONSOLE
835EXPORT_SYMBOL_GPL(key_maps);
836#endif