diff options
author | Atsushi Nemoto <anemo@mba.ocn.ne.jp> | 2008-07-18 12:51:41 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2008-07-20 09:38:21 -0400 |
commit | 255033a9bb900a06c9a7798908ce12557d24fb66 (patch) | |
tree | 9bb4b8a54d8737d2126fb6e00c2d1bbe99670a89 /include/asm-mips/txx9/tx4927.h | |
parent | b5d5accc7a2eb41f43ef346f3b258ba2f6342a1c (diff) |
[MIPS] TXx9: Cleanups for 64-bit support
* Unify (and fix) mem_tx4938.c and mem_tx4927.c
* Simplify prom_init
* Kill volatiles and unused definitions for tx4927.h and tx4938.h
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'include/asm-mips/txx9/tx4927.h')
-rw-r--r-- | include/asm-mips/txx9/tx4927.h | 48 |
1 files changed, 34 insertions, 14 deletions
diff --git a/include/asm-mips/txx9/tx4927.h b/include/asm-mips/txx9/tx4927.h index 46d60afc038b..c9212155f686 100644 --- a/include/asm-mips/txx9/tx4927.h +++ b/include/asm-mips/txx9/tx4927.h | |||
@@ -32,13 +32,20 @@ | |||
32 | #include <asm/txx9irq.h> | 32 | #include <asm/txx9irq.h> |
33 | #include <asm/txx9/tx4927pcic.h> | 33 | #include <asm/txx9/tx4927pcic.h> |
34 | 34 | ||
35 | #define TX4927_SDRAMC_REG 0xff1f8000 | 35 | #ifdef CONFIG_64BIT |
36 | #define TX4927_EBUSC_REG 0xff1f9000 | 36 | #define TX4927_REG_BASE 0xffffffffff1f0000UL |
37 | #define TX4927_PCIC_REG 0xff1fd000 | 37 | #else |
38 | #define TX4927_CCFG_REG 0xff1fe000 | 38 | #define TX4927_REG_BASE 0xff1f0000UL |
39 | #define TX4927_IRC_REG 0xff1ff600 | 39 | #endif |
40 | #define TX4927_REG_SIZE 0x00010000 | ||
41 | |||
42 | #define TX4927_SDRAMC_REG (TX4927_REG_BASE + 0x8000) | ||
43 | #define TX4927_EBUSC_REG (TX4927_REG_BASE + 0x9000) | ||
44 | #define TX4927_PCIC_REG (TX4927_REG_BASE + 0xd000) | ||
45 | #define TX4927_CCFG_REG (TX4927_REG_BASE + 0xe000) | ||
46 | #define TX4927_IRC_REG (TX4927_REG_BASE + 0xf600) | ||
40 | #define TX4927_NR_TMR 3 | 47 | #define TX4927_NR_TMR 3 |
41 | #define TX4927_TMR_REG(ch) (0xff1ff000 + (ch) * 0x100) | 48 | #define TX4927_TMR_REG(ch) (TX4927_REG_BASE + 0xf000 + (ch) * 0x100) |
42 | 49 | ||
43 | #define TX4927_IR_INT(n) (2 + (n)) | 50 | #define TX4927_IR_INT(n) (2 + (n)) |
44 | #define TX4927_IR_SIO(n) (8 + (n)) | 51 | #define TX4927_IR_SIO(n) (8 + (n)) |
@@ -49,15 +56,15 @@ | |||
49 | #define TX4927_IRC_INT 2 /* IP[2] in Status register */ | 56 | #define TX4927_IRC_INT 2 /* IP[2] in Status register */ |
50 | 57 | ||
51 | struct tx4927_sdramc_reg { | 58 | struct tx4927_sdramc_reg { |
52 | volatile unsigned long long cr[4]; | 59 | u64 cr[4]; |
53 | volatile unsigned long long unused0[4]; | 60 | u64 unused0[4]; |
54 | volatile unsigned long long tr; | 61 | u64 tr; |
55 | volatile unsigned long long unused1[2]; | 62 | u64 unused1[2]; |
56 | volatile unsigned long long cmd; | 63 | u64 cmd; |
57 | }; | 64 | }; |
58 | 65 | ||
59 | struct tx4927_ebusc_reg { | 66 | struct tx4927_ebusc_reg { |
60 | volatile unsigned long long cr[8]; | 67 | u64 cr[8]; |
61 | }; | 68 | }; |
62 | 69 | ||
63 | struct tx4927_ccfg_reg { | 70 | struct tx4927_ccfg_reg { |
@@ -160,12 +167,24 @@ struct tx4927_ccfg_reg { | |||
160 | #define TX4927_CLKCTR_SIO0RST 0x00000002 | 167 | #define TX4927_CLKCTR_SIO0RST 0x00000002 |
161 | #define TX4927_CLKCTR_SIO1RST 0x00000001 | 168 | #define TX4927_CLKCTR_SIO1RST 0x00000001 |
162 | 169 | ||
163 | #define tx4927_sdramcptr ((struct tx4927_sdramc_reg *)TX4927_SDRAMC_REG) | 170 | #define tx4927_sdramcptr \ |
171 | ((struct tx4927_sdramc_reg __iomem *)TX4927_SDRAMC_REG) | ||
164 | #define tx4927_pcicptr \ | 172 | #define tx4927_pcicptr \ |
165 | ((struct tx4927_pcic_reg __iomem *)TX4927_PCIC_REG) | 173 | ((struct tx4927_pcic_reg __iomem *)TX4927_PCIC_REG) |
166 | #define tx4927_ccfgptr \ | 174 | #define tx4927_ccfgptr \ |
167 | ((struct tx4927_ccfg_reg __iomem *)TX4927_CCFG_REG) | 175 | ((struct tx4927_ccfg_reg __iomem *)TX4927_CCFG_REG) |
168 | #define tx4927_ebuscptr ((struct tx4927_ebusc_reg *)TX4927_EBUSC_REG) | 176 | #define tx4927_ebuscptr \ |
177 | ((struct tx4927_ebusc_reg __iomem *)TX4927_EBUSC_REG) | ||
178 | |||
179 | #define TX4927_SDRAMC_CR(ch) __raw_readq(&tx4927_sdramcptr->cr[(ch)]) | ||
180 | #define TX4927_SDRAMC_BA(ch) ((TX4927_SDRAMC_CR(ch) >> 49) << 21) | ||
181 | #define TX4927_SDRAMC_SIZE(ch) \ | ||
182 | ((((TX4927_SDRAMC_CR(ch) >> 33) & 0x7fff) + 1) << 21) | ||
183 | |||
184 | #define TX4927_EBUSC_CR(ch) __raw_readq(&tx4927_ebuscptr->cr[(ch)]) | ||
185 | #define TX4927_EBUSC_BA(ch) ((TX4927_EBUSC_CR(ch) >> 48) << 20) | ||
186 | #define TX4927_EBUSC_SIZE(ch) \ | ||
187 | (0x00100000 << ((unsigned long)(TX4927_EBUSC_CR(ch) >> 8) & 0xf)) | ||
169 | 188 | ||
170 | /* utilities */ | 189 | /* utilities */ |
171 | static inline void txx9_clear64(__u64 __iomem *adr, __u64 bits) | 190 | static inline void txx9_clear64(__u64 __iomem *adr, __u64 bits) |
@@ -212,6 +231,7 @@ static inline void tx4927_ccfg_change(__u64 change, __u64 new) | |||
212 | &tx4927_ccfgptr->ccfg); | 231 | &tx4927_ccfgptr->ccfg); |
213 | } | 232 | } |
214 | 233 | ||
234 | unsigned int tx4927_get_mem_size(void); | ||
215 | int tx4927_report_pciclk(void); | 235 | int tx4927_report_pciclk(void); |
216 | int tx4927_pciclk66_setup(void); | 236 | int tx4927_pciclk66_setup(void); |
217 | void tx4927_irq_init(void); | 237 | void tx4927_irq_init(void); |