3 * Marvell Semiconductor <www.marvell.com>
4 * Written-by: Prafulla Wadaskar <prafulla@marvell.com>
6 * See file CREDITS for list of people who contributed to this
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of
12 * the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
28 #include <asm/system.h>
32 #define KWGBE_PORT_SERIAL_CONTROL1_REG(_x) \
33 ((_x ? KW_EGIGA0_BASE : KW_EGIGA1_BASE) + 0x44c)
35 #define KW_REG_DEVICE_ID (KW_MPP_BASE + 0x34)
36 #define KW_REG_MPP_OUT_DRV_REG (KW_MPP_BASE + 0xE0)
51 KWCPU_TARGET_RESERVED,
53 KWCPU_TARGET_1RESERVED,
59 KWCPU_ATTR_SASRAM = 0x01,
60 KWCPU_ATTR_NANDFLASH = 0x2f,
61 KWCPU_ATTR_SPIFLASH = 0x1e,
62 KWCPU_ATTR_BOOTROM = 0x1d,
63 KWCPU_ATTR_PCIE_IO = 0xe0,
64 KWCPU_ATTR_PCIE_MEM = 0xe8
68 * Default Device Address MAP BAR values
70 #define KW_DEFADR_PCI_MEM 0x90000000
71 #define KW_DEFADR_PCI_IO 0xC0000000
72 #define KW_DEFADR_PCI_IO_REMAP 0xC0000000
73 #define KW_DEFADR_SASRAM 0xC8010000
74 #define KW_DEFADR_NANDF 0xD8000000
75 #define KW_DEFADR_SPIF 0xE8000000
76 #define KW_DEFADR_BOOTROM 0xF8000000
79 * read feroceon/sheeva core extra feature register
80 * using co-proc instruction
82 static inline unsigned int readfr_extra_feature_reg(void)
85 asm volatile ("mrc p15, 1, %0, c15, c1, 0 @ readfr exfr":"=r"
91 * write feroceon/sheeva core extra feature register
92 * using co-proc instruction
94 static inline void writefr_extra_feature_reg(unsigned int val)
96 asm volatile ("mcr p15, 1, %0, c15, c1, 0 @ writefr exfr"::"r"
102 * MBus-L to Mbus Bridge Registers
103 * Ref: Datasheet sec:A.3
105 struct kwwin_registers {
113 * CPU control and status Registers
114 * Ref: Datasheet sec:A.3.2
116 struct kwcpu_registers {
117 u32 config; /*0x20100 */
118 u32 ctrl_stat; /*0x20104 */
119 u32 rstoutn_mask; /* 0x20108 */
120 u32 sys_soft_rst; /* 0x2010C */
121 u32 ahb_mbus_cause_irq; /* 0x20110 */
122 u32 ahb_mbus_mask_irq; /* 0x20114 */
124 u32 ftdll_config; /* 0x20120 */
126 u32 l2_cfg; /* 0x20128 */
131 * Ref: Datasheet sec:A.19
133 struct kwgpio_registers {
147 void reset_cpu(unsigned long ignored);
148 unsigned char get_random_hex(void);
149 unsigned int kw_sdram_bar(enum memory_bank bank);
150 unsigned int kw_sdram_bs(enum memory_bank bank);
151 int kw_config_adr_windows(void);
152 void kw_config_gpio(unsigned int gpp0_oe_val, unsigned int gpp1_oe_val,
153 unsigned int gpp0_oe, unsigned int gpp1_oe);
154 int kw_config_mpp(unsigned int mpp0_7, unsigned int mpp8_15,
155 unsigned int mpp16_23, unsigned int mpp24_31,
156 unsigned int mpp32_39, unsigned int mpp40_47,
157 unsigned int mpp48_55);
158 #endif /* __ASSEMBLY__ */
159 #endif /* _KWCPU_H */