1 /*
2  * Copyright 2004 PMC-Sierra
3  * Author: Manish Lachwani (lachwani@pmc-sierra.com)
4  *
5  * Board specific definititions for the PMC-Sierra Stretch
6  *
7  * This program is free software; you can redistribute  it and/or modify it
8  * under  the terms of  the GNU General  Public License as published by the
9  * Free Software Foundation;  either version 2 of the  License, or (at your
10  * option) any later version.
11  */
12 
13 #ifndef __SETUP_H__
14 #define __SETUP_H__
15 
16 /*
17  * Define for the base addreses
18  */
19 
20 #define	PMC_STRETCH_BASE			(0x1A000000 + KSEG1) /* FIXME */
21 
22 /*
23  * PCI defines
24  */
25 #define	PMC_STRETCH_PCI_BASE			(0x1A000000 + KSEG1) /* FIXME */
26 
27 #define	PMC_STRETCH_READ_DATA(ofs)				\
28 	*(volatile u32 *)(PMC_STRETCH_PCI_BASE + ofs)
29 
30 /*
31  * PCI Config space accesses
32  */
33 #define	PMC_STRETCH_PCI_0_CONFIG_ADDRESS	0x678
34 #define	PMC_STRETCH_PCI_0_DATA_ADDRESS		0x6fc
35 
36 #define	PMC_STRETCH_WRITE(ofs, data)				\
37 	*(volatile u32 *)(PMC_STRETCH_PCI_BASE + ofs) = data
38 
39 #define	PMC_STRETCH_READ(ofs, data)				\
40 	*(data) = *(volatile u32 *)(PMC_STRETCH_PCI_BASE + ofs)
41 
42 #define	PMC_STRETCH_WRITE_16(ofs, data)				\
43 	*(volatile u16 *)(PMC_STRETCH_PCI_BASE + ofs) = data
44 
45 #define	PMC_STRETCH_READ_16(ofs, data)				\
46 	*(data) =  *(volatile u16 *)(PMC_STRETCH_PCI_BASE + ofs)
47 
48 #define	PMC_STRETCH_WRITE_8(ofs, data)				\
49 	*(volatile u8 *)(PMC_STRETCH_PCI_BASE + ofs) = data
50 
51 #define	PMC_STRETCH_READ_8(ofs, data)				\
52 	*(data) = *(volatile u8 *)(PMC_STRETCH_PCI_BASE + ofs)
53 
54 /*
55  * RTC/NVRAM
56  */
57 #define	PMC_STRETCH_NVRAM_BASE	0xfc800000	/* FIXME */
58 
59 #endif /* __SETUP_H__ */
60