1 /*
2  *
3  *    Copyright (c) 1999 Grant Erickson <grant@lcse.umn.edu>
4  *
5  *    Module name: ibm4xx.h
6  *
7  *    Description:
8  *	A generic include file which pulls in appropriate include files
9  *      for specific board types based on configuration settings.
10  *
11  */
12 
13 #ifdef __KERNEL__
14 #ifndef __ASM_IBM4XX_H__
15 #define __ASM_IBM4XX_H__
16 
17 #include <linux/config.h>
18 #include <asm/types.h>
19 
20 #ifdef CONFIG_4xx
21 
22 #ifndef __ASSEMBLY__
23 /*
24  * The "residual" board information structure the boot loader passes
25  * into the kernel.
26  */
27 extern unsigned char __res[];
28 
29 /* Device Control Registers */
30 
31 #define stringify(s)	tostring(s)
32 #define tostring(s)	#s
33 
34 #define mfdcr_or_dflt(rn,default_rval) \
35 	({unsigned int rval;						\
36 	if (rn == 0)							\
37 		rval = default_rval;					\
38 	else								\
39 		asm volatile("mfdcr %0," stringify(rn) : "=r" (rval));	\
40 	rval;})
41 
42 /* R/W of indirect DCRs make use of standard naming conventions for DCRs */
43 
44 #define mfdcri(base, reg)			\
45 ({						\
46      mtdcr(base##_CFGADDR, base##_##reg);	\
47      mfdcr(base##_CFGDATA);			\
48 })
49 
50 #define mtdcri(base, reg, data)			\
51 do {						\
52      mtdcr(base##_CFGADDR, base##_##reg);	\
53      mtdcr(base##_CFGDATA, data);		\
54 } while (0)
55 #endif /* __ASSEMBLY__ */
56 
57 #endif /* CONFIG_4xx */
58 
59 #ifdef CONFIG_40x
60 
61 #if defined(CONFIG_CPCI405)
62 #include <platforms/cpci405.h>
63 #endif
64 
65 #if defined(CONFIG_EP405)
66 #include <platforms/ep405.h>
67 #endif
68 
69 #if defined(CONFIG_OAK)
70 #include <platforms/oak.h>
71 #endif
72 
73 #if defined(CONFIG_REDWOOD_5)
74 #include <platforms/redwood5.h>
75 #endif
76 
77 #if defined(CONFIG_REDWOOD_6)
78 #include <platforms/redwood6.h>
79 #endif
80 
81 #if defined(CONFIG_WALNUT)
82 #include <platforms/walnut.h>
83 #endif
84 
85 #ifndef PPC4xx_MACHINE_NAME
86 #define PPC4xx_MACHINE_NAME	"Unidentified 4xx class"
87 #endif
88 
89 /* IO_BASE is for PCI I/O.
90  * ISA not supported, just here to resolve copilation.
91  */
92 
93 #ifndef _IO_BASE
94 #define _IO_BASE	0xe8000000	/* The PCI address window */
95 #define _ISA_MEM_BASE	0
96 #define PCI_DRAM_OFFSET	0
97 #endif
98 
99 #elif CONFIG_44x
100 
101 #if defined(CONFIG_EBONY)
102 #include <platforms/ebony.h>
103 #endif
104 
105 #if defined(CONFIG_OCOTEA)
106 #include <platforms/ocotea.h>
107 #endif
108 
109 #endif /* CONFIG_40x */
110 
111 #ifndef __ASSEMBLY__
112 #if defined(EMAC_NUMS) && EMAC_NUMS > 0
113 /*
114  * Per EMAC map of PHY ids which should be probed by emac_probe.
115  * Different EMACs can have overlapping maps.
116  *
117  * Note, this map uses inverse logic for bits:
118  *  0 - id should be probed
119  *  1 - id should be ignored
120  *
121  * Default value of 0x00000000 - will result in usual
122  * auto-detection logic.
123  *
124  */
125 extern u32 emac_phy_map[EMAC_NUMS];
126 #endif
127 #endif /* __ASSEMBLY__ */
128 
129 #endif /* __ASM_IBM4XX_H__ */
130 #endif /* __KERNEL__ */
131