| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * Setup pointers to hardware-dependent routines. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * This file is subject to the terms and conditions of the GNU General Public | 
					
						
							|  |  |  |  * License.  See the file "COPYING" in the main directory of this archive | 
					
						
							|  |  |  |  * for more details. | 
					
						
							|  |  |  |  * | 
					
						
							| 
									
										
										
										
											2008-07-31 13:08:14 +01:00
										 |  |  |  * Copyright (C) 1996, 1997, 1998, 2001, 07, 08 by Ralf Baechle | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  |  * Copyright (C) 2001 MIPS Technologies, Inc. | 
					
						
							| 
									
										
										
										
											2007-08-25 11:01:50 +02:00
										 |  |  |  * Copyright (C) 2007 by Thomas Bogendoerfer | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  |  */ | 
					
						
							|  |  |  | #include <linux/eisa.h>
 | 
					
						
							|  |  |  | #include <linux/init.h>
 | 
					
						
							|  |  |  | #include <linux/ioport.h>
 | 
					
						
							|  |  |  | #include <linux/console.h>
 | 
					
						
							| 
									
										
										
										
											2006-10-08 19:35:00 +01:00
										 |  |  | #include <linux/screen_info.h>
 | 
					
						
							| 
									
										
										
										
											2007-08-25 11:01:50 +02:00
										 |  |  | #include <linux/platform_device.h>
 | 
					
						
							|  |  |  | #include <linux/serial_8250.h>
 | 
					
						
							| 
									
										
										
										
											2006-01-18 17:37:07 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | #include <asm/jazz.h>
 | 
					
						
							|  |  |  | #include <asm/jazzdma.h>
 | 
					
						
							|  |  |  | #include <asm/reboot.h>
 | 
					
						
							|  |  |  | #include <asm/pgtable.h>
 | 
					
						
							| 
									
										
										
										
											2011-11-28 16:11:28 +00:00
										 |  |  | #include <asm/tlbmisc.h>
 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | extern asmlinkage void jazz_handle_int(void); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | extern void jazz_machine_restart(char *command); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static struct resource jazz_io_resources[] = { | 
					
						
							| 
									
										
										
										
											2006-10-08 19:19:11 +01:00
										 |  |  | 	{ | 
					
						
							|  |  |  | 		.start	= 0x00, | 
					
						
							|  |  |  | 		.end	= 0x1f, | 
					
						
							|  |  |  | 		.name	= "dma1", | 
					
						
							|  |  |  | 		.flags	= IORESOURCE_BUSY | 
					
						
							|  |  |  | 	}, { | 
					
						
							|  |  |  | 		.start	= 0x40, | 
					
						
							|  |  |  | 		.end	= 0x5f, | 
					
						
							|  |  |  | 		.name	= "timer", | 
					
						
							| 
									
										
										
										
											2007-06-27 14:10:06 -07:00
										 |  |  | 		.flags	= IORESOURCE_BUSY | 
					
						
							| 
									
										
										
										
											2006-10-08 19:19:11 +01:00
										 |  |  | 	}, { | 
					
						
							|  |  |  | 		.start	= 0x80, | 
					
						
							|  |  |  | 		.end	= 0x8f, | 
					
						
							|  |  |  | 		.name	= "dma page reg", | 
					
						
							|  |  |  | 		.flags	= IORESOURCE_BUSY | 
					
						
							|  |  |  | 	}, { | 
					
						
							|  |  |  | 		.start	= 0xc0, | 
					
						
							|  |  |  | 		.end	= 0xdf, | 
					
						
							|  |  |  | 		.name	= "dma2", | 
					
						
							|  |  |  | 		.flags	= IORESOURCE_BUSY | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-06-18 01:32:22 +01:00
										 |  |  | void __init plat_mem_setup(void) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | { | 
					
						
							|  |  |  | 	int i; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* Map 0xe0000000 -> 0x0:800005C0, 0xe0010000 -> 0x1:30000580 */ | 
					
						
							| 
									
										
										
										
											2007-10-11 23:46:15 +01:00
										 |  |  | 	add_wired_entry(0x02000017, 0x03c00017, 0xe0000000, PM_64K); | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	/* Map 0xe2000000 -> 0x0:900005C0, 0xe3010000 -> 0x0:910005C0 */ | 
					
						
							| 
									
										
										
										
											2007-10-11 23:46:15 +01:00
										 |  |  | 	add_wired_entry(0x02400017, 0x02440017, 0xe2000000, PM_16M); | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	/* Map 0xe4000000 -> 0x0:600005C0, 0xe4100000 -> 400005C0 */ | 
					
						
							| 
									
										
										
										
											2007-10-11 23:46:15 +01:00
										 |  |  | 	add_wired_entry(0x01800017, 0x01000017, 0xe4000000, PM_4M); | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	set_io_port_base(JAZZ_PORT_BASE); | 
					
						
							|  |  |  | #ifdef CONFIG_EISA
 | 
					
						
							| 
									
										
										
										
											2008-07-14 15:11:40 +02:00
										 |  |  | 	EISA_bus = 1; | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* request I/O space for devices used on all i[345]86 PCs */ | 
					
						
							|  |  |  | 	for (i = 0; i < ARRAY_SIZE(jazz_io_resources); i++) | 
					
						
							|  |  |  | 		request_resource(&ioport_resource, jazz_io_resources + i); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* The RTC is outside the port address space */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	_machine_restart = jazz_machine_restart; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-08-25 11:01:50 +02:00
										 |  |  | #ifdef CONFIG_VT
 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	screen_info = (struct screen_info) { | 
					
						
							| 
									
										
										
										
											2010-04-21 22:36:47 +02:00
										 |  |  | 		.orig_video_cols	= 160, | 
					
						
							|  |  |  | 		.orig_video_lines	= 64, | 
					
						
							|  |  |  | 		.orig_video_points	= 16, | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	}; | 
					
						
							| 
									
										
										
										
											2007-08-25 11:01:50 +02:00
										 |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-08-25 11:01:50 +02:00
										 |  |  | 	add_preferred_console("ttyS", 0, "9600"); | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2007-08-25 11:01:50 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | #ifdef CONFIG_OLIVETTI_M700
 | 
					
						
							|  |  |  | #define UART_CLK  1843200
 | 
					
						
							|  |  |  | #else
 | 
					
						
							|  |  |  | /* Some Jazz machines seem to have an 8MHz crystal clock but I don't know
 | 
					
						
							|  |  |  |    exactly which ones ... XXX */ | 
					
						
							|  |  |  | #define UART_CLK (8000000 / 16) /* ( 3072000 / 16) */
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define MEMPORT(_base, _irq)				\
 | 
					
						
							|  |  |  | 	{						\ | 
					
						
							|  |  |  | 		.mapbase	= (_base),		\ | 
					
						
							|  |  |  | 		.membase	= (void *)(_base),	\ | 
					
						
							|  |  |  | 		.irq		= (_irq),		\ | 
					
						
							|  |  |  | 		.uartclk	= UART_CLK,		\ | 
					
						
							|  |  |  | 		.iotype		= UPIO_MEM,		\ | 
					
						
							|  |  |  | 		.flags		= UPF_BOOT_AUTOCONF,	\ | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static struct plat_serial8250_port jazz_serial_data[] = { | 
					
						
							|  |  |  | 	MEMPORT(JAZZ_SERIAL1_BASE, JAZZ_SERIAL1_IRQ), | 
					
						
							|  |  |  | 	MEMPORT(JAZZ_SERIAL2_BASE, JAZZ_SERIAL2_IRQ), | 
					
						
							|  |  |  | 	{ }, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static struct platform_device jazz_serial8250_device = { | 
					
						
							|  |  |  | 	.name			= "serial8250", | 
					
						
							|  |  |  | 	.id			= PLAT8250_DEV_PLATFORM, | 
					
						
							|  |  |  | 	.dev			= { | 
					
						
							|  |  |  | 		.platform_data	= jazz_serial_data, | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static struct resource jazz_esp_rsrc[] = { | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		.start = JAZZ_SCSI_BASE, | 
					
						
							|  |  |  | 		.end   = JAZZ_SCSI_BASE + 31, | 
					
						
							|  |  |  | 		.flags = IORESOURCE_MEM | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		.start = JAZZ_SCSI_DMA, | 
					
						
							|  |  |  | 		.end   = JAZZ_SCSI_DMA, | 
					
						
							|  |  |  | 		.flags = IORESOURCE_MEM | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		.start = JAZZ_SCSI_IRQ, | 
					
						
							|  |  |  | 		.end   = JAZZ_SCSI_IRQ, | 
					
						
							|  |  |  | 		.flags = IORESOURCE_IRQ | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static struct platform_device jazz_esp_pdev = { | 
					
						
							| 
									
										
										
										
											2013-01-22 12:59:30 +01:00
										 |  |  | 	.name		= "jazz_esp", | 
					
						
							|  |  |  | 	.num_resources	= ARRAY_SIZE(jazz_esp_rsrc), | 
					
						
							|  |  |  | 	.resource	= jazz_esp_rsrc | 
					
						
							| 
									
										
										
										
											2007-08-25 11:01:50 +02:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static struct resource jazz_sonic_rsrc[] = { | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		.start = JAZZ_ETHERNET_BASE, | 
					
						
							|  |  |  | 		.end   = JAZZ_ETHERNET_BASE + 0xff, | 
					
						
							|  |  |  | 		.flags = IORESOURCE_MEM | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		.start = JAZZ_ETHERNET_IRQ, | 
					
						
							|  |  |  | 		.end   = JAZZ_ETHERNET_IRQ, | 
					
						
							|  |  |  | 		.flags = IORESOURCE_IRQ | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static struct platform_device jazz_sonic_pdev = { | 
					
						
							| 
									
										
										
										
											2013-01-22 12:59:30 +01:00
										 |  |  | 	.name		= "jazzsonic", | 
					
						
							|  |  |  | 	.num_resources	= ARRAY_SIZE(jazz_sonic_rsrc), | 
					
						
							|  |  |  | 	.resource	= jazz_sonic_rsrc | 
					
						
							| 
									
										
										
										
											2007-08-25 11:01:50 +02:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static struct resource jazz_cmos_rsrc[] = { | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		.start = 0x70, | 
					
						
							|  |  |  | 		.end   = 0x71, | 
					
						
							|  |  |  | 		.flags = IORESOURCE_IO | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		.start = 8, | 
					
						
							|  |  |  | 		.end   = 8, | 
					
						
							|  |  |  | 		.flags = IORESOURCE_IRQ | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static struct platform_device jazz_cmos_pdev = { | 
					
						
							| 
									
										
										
										
											2013-01-22 12:59:30 +01:00
										 |  |  | 	.name		= "rtc_cmos", | 
					
						
							|  |  |  | 	.num_resources	= ARRAY_SIZE(jazz_cmos_rsrc), | 
					
						
							|  |  |  | 	.resource	= jazz_cmos_rsrc | 
					
						
							| 
									
										
										
										
											2007-08-25 11:01:50 +02:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-01-29 10:14:57 +00:00
										 |  |  | static struct platform_device pcspeaker_pdev = { | 
					
						
							| 
									
										
										
										
											2013-01-22 12:59:30 +01:00
										 |  |  | 	.name		= "pcspkr", | 
					
						
							| 
									
										
										
										
											2008-01-29 10:14:57 +00:00
										 |  |  | 	.id		= -1, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-08-25 11:01:50 +02:00
										 |  |  | static int __init jazz_setup_devinit(void) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	platform_device_register(&jazz_serial8250_device); | 
					
						
							|  |  |  | 	platform_device_register(&jazz_esp_pdev); | 
					
						
							|  |  |  | 	platform_device_register(&jazz_sonic_pdev); | 
					
						
							|  |  |  | 	platform_device_register(&jazz_cmos_pdev); | 
					
						
							| 
									
										
										
										
											2008-01-29 10:14:57 +00:00
										 |  |  | 	platform_device_register(&pcspeaker_pdev); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-08-25 11:01:50 +02:00
										 |  |  | 	return 0; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | device_initcall(jazz_setup_devinit); |