aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-orion/addr-map.c
diff options
context:
space:
mode:
authorLennert Buytenhek <buytenh@wantstofly.org>2008-03-27 14:51:39 -0400
committerNicolas Pitre <nico@marvell.com>2008-03-27 14:51:39 -0400
commit92aecfa95523384923b52c8ddaf948fc02a53e82 (patch)
tree0bea3d5d3ee86b1540cecd5aeab9afa48919ee7d /arch/arm/mach-orion/addr-map.c
parent1f2223b12b62a97d66e39199db50ed3fae9222c0 (diff)
ehci-orion: mbus decode window support
Make it possible to pass mbus_dram_target_info to the ehci-orion driver via the platform data, make the ehci-orion driver program the window registers based on this data if it is passed in, and make the Orion platform setup code use this method instead of programming the EHCI mbus window registers by hand. Signed-off-by: Lennert Buytenhek <buytenh@marvell.com> Reviewed-by: Tzachi Perelstein <tzachi@marvell.com> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Nicolas Pitre <nico@marvell.com>
Diffstat (limited to 'arch/arm/mach-orion/addr-map.c')
-rw-r--r--arch/arm/mach-orion/addr-map.c49
1 files changed, 0 insertions, 49 deletions
diff --git a/arch/arm/mach-orion/addr-map.c b/arch/arm/mach-orion/addr-map.c
index 69cd0876f6b9..40bcb986ab96 100644
--- a/arch/arm/mach-orion/addr-map.c
+++ b/arch/arm/mach-orion/addr-map.c
@@ -104,15 +104,6 @@
104#define ETH_MAX_REMAP_WIN 4 104#define ETH_MAX_REMAP_WIN 4
105 105
106/* 106/*
107 * USB Address Decode Windows registers
108 */
109#define USB_WIN_CTRL(i, w) ((i == 0) ? ORION_USB0_REG(0x320 + ((w) << 4)) \
110 : ORION_USB1_REG(0x320 + ((w) << 4)))
111#define USB_WIN_BASE(i, w) ((i == 0) ? ORION_USB0_REG(0x324 + ((w) << 4)) \
112 : ORION_USB1_REG(0x324 + ((w) << 4)))
113#define USB_MAX_WIN 4
114
115/*
116 * SATA Address Decode Windows registers 107 * SATA Address Decode Windows registers
117 */ 108 */
118#define SATA_WIN_CTRL(win) ORION_SATA_REG(0x30 + ((win) * 0x10)) 109#define SATA_WIN_CTRL(win) ORION_SATA_REG(0x30 + ((win) * 0x10))
@@ -262,46 +253,6 @@ void __init orion_setup_cpu_wins(void)
262 orion_mbus_dram_info.num_cs = cs; 253 orion_mbus_dram_info.num_cs = cs;
263} 254}
264 255
265void __init orion_setup_usb_wins(void)
266{
267 int i;
268 u32 usb_if, dev, rev;
269 u32 max_usb_if = 1;
270
271 orion_pcie_id(&dev, &rev);
272 if (dev == MV88F5182_DEV_ID)
273 max_usb_if = 2;
274
275 for (usb_if = 0; usb_if < max_usb_if; usb_if++) {
276 /*
277 * First, disable and clear windows
278 */
279 for (i = 0; i < USB_MAX_WIN; i++) {
280 orion_write(USB_WIN_BASE(usb_if, i), 0);
281 orion_write(USB_WIN_CTRL(usb_if, i), 0);
282 }
283
284 /*
285 * Setup windows for DDR banks.
286 */
287 for (i = 0; i < DDR_MAX_CS; i++) {
288 u32 base, size;
289 size = orion_read(DDR_SIZE_CS(i));
290 base = orion_read(DDR_BASE_CS(i));
291 if (size & DDR_BANK_EN) {
292 base = DDR_REG_TO_BASE(base);
293 size = DDR_REG_TO_SIZE(size);
294 orion_write(USB_WIN_CTRL(usb_if, i),
295 ((size-1) & 0xffff0000) |
296 (ATTR_DDR_CS(i) << 8) |
297 (TARGET_DDR << 4) | WIN_EN);
298 orion_write(USB_WIN_BASE(usb_if, i),
299 base & 0xffff0000);
300 }
301 }
302 }
303}
304
305void __init orion_setup_eth_wins(void) 256void __init orion_setup_eth_wins(void)
306{ 257{
307 int i; 258 int i;