summaryrefslogtreecommitdiff
path: root/arch/ppc/platforms/ev64260.h
blob: 44d90d56745a53d852965443e1266577c13156fd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
/*
 * Definitions for Marvell/Galileo EV-64260-BP Evaluation Board.
 *
 * Author: Mark A. Greer <mgreer@mvista.com>
 *
 * 2001-2002 (c) MontaVista, Software, Inc.  This file is licensed under
 * the terms of the GNU General Public License version 2.  This program
 * is licensed "as is" without any warranty of any kind, whether express
 * or implied.
 */

/*
 * The MV64x60 has 2 PCI buses each with 1 window from the CPU bus to
 * PCI I/O space and 4 windows from the CPU bus to PCI MEM space.
 * We'll only use one PCI MEM window on each PCI bus.
 *
 * This is the CPU physical memory map (windows must be at least 1MB and start
 * on a boundary that is a multiple of the window size):
 *
 * 	0xfc000000-0xffffffff		- External FLASH on device module
 * 	0xfbf00000-0xfbffffff		- Embedded (on board) FLASH
 * 	0xfbe00000-0xfbefffff		- GT64260 Registers (preferably)
 * 					  but really a config option
 * 	0xfbd00000-0xfbdfffff		- External SRAM on device module
 * 	0xfbc00000-0xfbcfffff		- TODC chip on device module
 * 	0xfbb00000-0xfbbfffff		- External UART on device module
 * 	0xa2000000-0xfbafffff		- <hole>
 * 	0xa1000000-0xa1ffffff		- PCI 1 I/O (defined in gt64260.h)
 * 	0xa0000000-0xa0ffffff		- PCI 0 I/O (defined in gt64260.h)
 * 	0x90000000-0x9fffffff		- PCI 1 MEM (defined in gt64260.h)
 * 	0x80000000-0x8fffffff		- PCI 0 MEM (defined in gt64260.h)
 */

#ifndef __PPC_PLATFORMS_EV64260_H
#define __PPC_PLATFORMS_EV64260_H

/* PCI mappings */
#define	EV64260_PCI0_IO_CPU_BASE	0xa0000000
#define	EV64260_PCI0_IO_PCI_BASE	0x00000000
#define	EV64260_PCI0_IO_SIZE		0x01000000

#define	EV64260_PCI0_MEM_CPU_BASE	0x80000000
#define	EV64260_PCI0_MEM_PCI_BASE	0x80000000
#define	EV64260_PCI0_MEM_SIZE		0x10000000

#define	EV64260_PCI1_IO_CPU_BASE	(EV64260_PCI0_IO_CPU_BASE + \
						EV64260_PCI0_IO_SIZE)
#define	EV64260_PCI1_IO_PCI_BASE	(EV64260_PCI0_IO_PCI_BASE + \
						EV64260_PCI0_IO_SIZE)
#define	EV64260_PCI1_IO_SIZE		0x01000000

#define	EV64260_PCI1_MEM_CPU_BASE	(EV64260_PCI0_MEM_CPU_BASE + \
						EV64260_PCI0_MEM_SIZE)
#define	EV64260_PCI1_MEM_PCI_BASE	(EV64260_PCI0_MEM_PCI_BASE + \
						EV64260_PCI0_MEM_SIZE)
#define	EV64260_PCI1_MEM_SIZE		0x10000000

/* CPU Physical Memory Map setup (other than PCI) */
#define	EV64260_EXT_FLASH_BASE		0xfc000000
#define	EV64260_EMB_FLASH_BASE		0xfbf00000
#define	EV64260_EXT_SRAM_BASE		0xfbd00000
#define	EV64260_TODC_BASE		0xfbc00000
#define	EV64260_UART_BASE		0xfbb00000

#define	EV64260_EXT_FLASH_SIZE_ACTUAL	0x04000000  /* <= 64MB Extern FLASH */
#define	EV64260_EMB_FLASH_SIZE_ACTUAL	0x00080000  /* 512KB of Embed FLASH */
#define	EV64260_EXT_SRAM_SIZE_ACTUAL	0x00100000  /* 1MB SDRAM */
#define	EV64260_TODC_SIZE_ACTUAL	0x00000020  /* 32 bytes for TODC */
#define	EV64260_UART_SIZE_ACTUAL	0x00000040  /* 64 bytes for DUART */

#define	EV64260_EXT_FLASH_SIZE		max(GT64260_WINDOW_SIZE_MIN,	\
						EV64260_EXT_FLASH_SIZE_ACTUAL)
#define	EV64260_EMB_FLASH_SIZE		max(GT64260_WINDOW_SIZE_MIN,	\
						EV64260_EMB_FLASH_SIZE_ACTUAL)
#define	EV64260_EXT_SRAM_SIZE		max(GT64260_WINDOW_SIZE_MIN,	\
						EV64260_EXT_SRAM_SIZE_ACTUAL)
#define	EV64260_TODC_SIZE		max(GT64260_WINDOW_SIZE_MIN,	\
						EV64260_TODC_SIZE_ACTUAL)
/* Assembler in bootwrapper blows up if 'max' is used */
#define	EV64260_UART_SIZE		GT64260_WINDOW_SIZE_MIN
#define	EV64260_UART_END		((EV64260_UART_BASE +		\
					EV64260_UART_SIZE - 1) & 0xfff00000)

/* Board-specific IRQ info */
#define	EV64260_UART_0_IRQ		85
#define	EV64260_UART_1_IRQ		86
#define	EV64260_PCI_0_IRQ		91
#define	EV64260_PCI_1_IRQ		93

/* Serial port setup */
#define	EV64260_DEFAULT_BAUD		115200

#if defined(CONFIG_SERIAL_MPSC_CONSOLE)
#define SERIAL_PORT_DFNS

#define	EV64260_MPSC_CLK_SRC		8		/* TCLK */
#define	EV64260_MPSC_CLK_FREQ		100000000	/* 100MHz clk */
#else
#define EV64260_SERIAL_0		(EV64260_UART_BASE + 0x20)
#define EV64260_SERIAL_1		EV64260_UART_BASE

#define BASE_BAUD	(EV64260_DEFAULT_BAUD * 2)

#ifdef CONFIG_SERIAL_MANY_PORTS
#define RS_TABLE_SIZE	64
#else
#define RS_TABLE_SIZE	2
#endif

#ifdef CONFIG_SERIAL_DETECT_IRQ
#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_SKIP_TEST|ASYNC_AUTO_IRQ)
#else
#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_SKIP_TEST)
#endif

/* Required for bootloader's ns16550.c code */
#define STD_SERIAL_PORT_DFNS 						\
        { 0, BASE_BAUD, EV64260_SERIAL_0, EV64260_UART_0_IRQ, STD_COM_FLAGS, \
	iomem_base: (u8 *)EV64260_SERIAL_0,	/* ttyS0 */		\
	iomem_reg_shift: 2,						\
	io_type: SERIAL_IO_MEM },

#define SERIAL_PORT_DFNS \
        STD_SERIAL_PORT_DFNS
#endif
#endif /* __PPC_PLATFORMS_EV64260_H */