xref: /netbsd-src/sys/arch/evbppc/include/pmppc.h (revision ce099b40997c43048fb78bd578195f81d2456523)
1 /*	$NetBSD: pmppc.h,v 1.3 2008/04/28 20:23:17 martin Exp $	*/
2 
3 /*
4  * Copyright (c) 2002 The NetBSD Foundation, Inc.
5  * All rights reserved.
6  *
7  * This code is derived from software contributed to The NetBSD Foundation
8  * by Lennart Augustsson (lennart@augustsson.net) at Sandburst Corp.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
13  * 1. Redistributions of source code must retain the above copyright
14  *    notice, this list of conditions and the following disclaimer.
15  * 2. Redistributions in binary form must reproduce the above copyright
16  *    notice, this list of conditions and the following disclaimer in the
17  *    documentation and/or other materials provided with the distribution.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29  * POSSIBILITY OF SUCH DAMAGE.
30  */
31 
32 /* SDRAM */
33 #define PMPPC_SDRAM_BASE	0x00000000
34 
35 /* Flash */
36 #define PMPPC_FLASH_BASE	0x70000000
37 
38 #define PMPPC_IO_START		0x7fe00000
39 
40 /* CS8900A ethernet */
41 #define PMPPC_CS_IO_BASE	0x7fe00000
42 #define PMPPC_CS_IO		0x7fe00c00
43 #define PMPPC_CS_MEM		0x7fe04000
44 
45 /* time-of-day clock */
46 #define PMPPC_RTC		0x7ff00000
47 #define PMPPC_RTC_SIZE		0x00002000
48 
49 /* board config regs */
50 #define PMPPC_CONFIG0		0x7ff40000
51 #define PMPPC_CONFIG1		0x7ff40001
52 #define PMPPC_LEDS		0x7ff40002
53 #define PMPPC_RESET		0x7ff40003
54 #define PMPPC_RESET_SEQ_STEP1		0xac
55 #define PMPPC_RESET_SEQ_STEP2		0x1d
56 #define PMPPC_INTR		0x7ff40004
57 
58 /* ROM */
59 #define PMPPC_ROM_BASE		0x7ff80000
60 
61 void setleds(int leds);
62 
63 /* Interrupts */
64 #define PMPPC_I_BPMC_INTA	CPC_IB_EXT0 /* PCI INTA */
65 #define PMPPC_I_BPMC_INTB	CPC_IB_EXT1 /* PCI INTB */
66 #define PMPPC_I_BPMC_INTC	CPC_IB_EXT2 /* PCI INTC */
67 #define PMPPC_I_BPMC_INTD	CPC_IB_EXT3 /* PCI INTD */
68 #define PMPPC_I_ETH_INT		CPC_IB_EXT4 /* ethernet */
69 #define PMPPC_I_RTC_INT		CPC_IB_EXT5 /* rtc */
70 
71 
72 /*
73  * The variables below are extracted from the config register located
74  * at PMPPC_CONFIG.
75  */
76 struct a_config {
77 	int a_boot_device;
78 #define A_BOOT_ROM 0
79 #define A_BOOT_FLASH 1
80 	int a_has_ecc;
81 	uint a_mem_size;		/* in bytes */
82 	uint a_l2_cache;
83 #define A_CACHE_PARITY 0
84 #define A_CACHE_NO_PARITY 1
85 #define A_CACHE_NONE 3
86 	uint a_bus_freq;		/* in hz */
87 	int a_is_monarch;
88 	int a_has_eth;
89 	int a_has_rtc;
90 	uint a_flash_size;		/* in bytes */
91 	uint a_flash_width;		/* in bits */
92 };
93 
94 extern struct a_config a_config;
95