diff options
author | Lennert Buytenhek <buytenh@wantstofly.org> | 2008-03-27 14:51:39 -0400 |
---|---|---|
committer | Nicolas Pitre <nico@marvell.com> | 2008-03-27 14:51:39 -0400 |
commit | 15a32632d94011911497052a96cdbf3b905b325d (patch) | |
tree | 75d5d0c378157f19ccd12a1615a83c6aa2226689 /arch | |
parent | 92aecfa95523384923b52c8ddaf948fc02a53e82 (diff) |
sata_mv: mbus decode window support
Make it possible to pass mbus_dram_target_info to the sata_mv
driver via the platform data, make the sata_mv 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 SATA 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')
-rw-r--r-- | arch/arm/mach-orion/addr-map.c | 39 | ||||
-rw-r--r-- | arch/arm/mach-orion/common.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-orion/common.h | 1 |
3 files changed, 2 insertions, 42 deletions
diff --git a/arch/arm/mach-orion/addr-map.c b/arch/arm/mach-orion/addr-map.c index 40bcb986ab96..3de5de9ac656 100644 --- a/arch/arm/mach-orion/addr-map.c +++ b/arch/arm/mach-orion/addr-map.c | |||
@@ -103,13 +103,6 @@ | |||
103 | #define ETH_MAX_WIN 6 | 103 | #define ETH_MAX_WIN 6 |
104 | #define ETH_MAX_REMAP_WIN 4 | 104 | #define ETH_MAX_REMAP_WIN 4 |
105 | 105 | ||
106 | /* | ||
107 | * SATA Address Decode Windows registers | ||
108 | */ | ||
109 | #define SATA_WIN_CTRL(win) ORION_SATA_REG(0x30 + ((win) * 0x10)) | ||
110 | #define SATA_WIN_BASE(win) ORION_SATA_REG(0x34 + ((win) * 0x10)) | ||
111 | #define SATA_MAX_WIN 4 | ||
112 | |||
113 | 106 | ||
114 | struct mbus_dram_target_info orion_mbus_dram_info; | 107 | struct mbus_dram_target_info orion_mbus_dram_info; |
115 | 108 | ||
@@ -288,35 +281,3 @@ void __init orion_setup_eth_wins(void) | |||
288 | } | 281 | } |
289 | } | 282 | } |
290 | } | 283 | } |
291 | |||
292 | void __init orion_setup_sata_wins(void) | ||
293 | { | ||
294 | int i; | ||
295 | |||
296 | /* | ||
297 | * First, disable and clear windows | ||
298 | */ | ||
299 | for (i = 0; i < SATA_MAX_WIN; i++) { | ||
300 | orion_write(SATA_WIN_BASE(i), 0); | ||
301 | orion_write(SATA_WIN_CTRL(i), 0); | ||
302 | } | ||
303 | |||
304 | /* | ||
305 | * Setup windows for DDR banks. | ||
306 | */ | ||
307 | for (i = 0; i < DDR_MAX_CS; i++) { | ||
308 | u32 base, size; | ||
309 | size = orion_read(DDR_SIZE_CS(i)); | ||
310 | base = orion_read(DDR_BASE_CS(i)); | ||
311 | if (size & DDR_BANK_EN) { | ||
312 | base = DDR_REG_TO_BASE(base); | ||
313 | size = DDR_REG_TO_SIZE(size); | ||
314 | orion_write(SATA_WIN_CTRL(i), | ||
315 | ((size-1) & 0xffff0000) | | ||
316 | (ATTR_DDR_CS(i) << 8) | | ||
317 | (TARGET_DDR << 4) | WIN_EN); | ||
318 | orion_write(SATA_WIN_BASE(i), | ||
319 | base & 0xffff0000); | ||
320 | } | ||
321 | } | ||
322 | } | ||
diff --git a/arch/arm/mach-orion/common.c b/arch/arm/mach-orion/common.c index d33c01dfc3f2..a32fe8e108bc 100644 --- a/arch/arm/mach-orion/common.c +++ b/arch/arm/mach-orion/common.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/mbus.h> | 17 | #include <linux/mbus.h> |
18 | #include <linux/mv643xx_eth.h> | 18 | #include <linux/mv643xx_eth.h> |
19 | #include <linux/mv643xx_i2c.h> | 19 | #include <linux/mv643xx_i2c.h> |
20 | #include <linux/ata_platform.h> | ||
20 | #include <asm/page.h> | 21 | #include <asm/page.h> |
21 | #include <asm/setup.h> | 22 | #include <asm/setup.h> |
22 | #include <asm/timex.h> | 23 | #include <asm/timex.h> |
@@ -289,6 +290,7 @@ static struct platform_device orion_sata = { | |||
289 | 290 | ||
290 | void __init orion_sata_init(struct mv_sata_platform_data *sata_data) | 291 | void __init orion_sata_init(struct mv_sata_platform_data *sata_data) |
291 | { | 292 | { |
293 | sata_data->dram = &orion_mbus_dram_info; | ||
292 | orion_sata.dev.platform_data = sata_data; | 294 | orion_sata.dev.platform_data = sata_data; |
293 | platform_device_register(&orion_sata); | 295 | platform_device_register(&orion_sata); |
294 | } | 296 | } |
@@ -342,8 +344,6 @@ void __init orion_init(void) | |||
342 | */ | 344 | */ |
343 | orion_setup_cpu_wins(); | 345 | orion_setup_cpu_wins(); |
344 | orion_setup_eth_wins(); | 346 | orion_setup_eth_wins(); |
345 | if (dev == MV88F5182_DEV_ID) | ||
346 | orion_setup_sata_wins(); | ||
347 | 347 | ||
348 | /* | 348 | /* |
349 | * REgister devices | 349 | * REgister devices |
diff --git a/arch/arm/mach-orion/common.h b/arch/arm/mach-orion/common.h index c100355754f3..b676be0a4a86 100644 --- a/arch/arm/mach-orion/common.h +++ b/arch/arm/mach-orion/common.h | |||
@@ -33,7 +33,6 @@ extern struct mbus_dram_target_info orion_mbus_dram_info; | |||
33 | void orion_setup_cpu_win(enum orion_target target, u32 base, u32 size, int remap); | 33 | void orion_setup_cpu_win(enum orion_target target, u32 base, u32 size, int remap); |
34 | void orion_setup_cpu_wins(void); | 34 | void orion_setup_cpu_wins(void); |
35 | void orion_setup_eth_wins(void); | 35 | void orion_setup_eth_wins(void); |
36 | void orion_setup_sata_wins(void); | ||
37 | 36 | ||
38 | /* | 37 | /* |
39 | * Shared code used internally by other Orion core functions. | 38 | * Shared code used internally by other Orion core functions. |