aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/sysdev
diff options
context:
space:
mode:
authorMaxim Shchetynin <maxim@de.ibm.com>2008-07-15 15:51:42 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2008-07-21 20:39:31 -0400
commit8204cba7fa0ca0752fdaec021dae2634788178aa (patch)
tree4cbaa53ba45a43af73014ccd7781ad8ada734e38 /arch/powerpc/sysdev
parent9a23409b69440e76d34dc23846cae44f46f60d98 (diff)
powerpc/axonram: Enable partitioning of the Axons DDR2 DIMMs
DDR2 memory DIMMs on the Axon could be accessed only as one partition when using file system drivers which are using the direct_access() method. This patch enables for such file system drivers to access Axon's DDR2 memory even if it is splitted in several partitions. Signed-off-by: Maxim Shchetynin <maxim@de.ibm.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/sysdev')
-rw-r--r--arch/powerpc/sysdev/axonram.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/powerpc/sysdev/axonram.c b/arch/powerpc/sysdev/axonram.c
index 9b639ede06da..9e105cbc5e5f 100644
--- a/arch/powerpc/sysdev/axonram.c
+++ b/arch/powerpc/sysdev/axonram.c
@@ -150,7 +150,10 @@ axon_ram_direct_access(struct block_device *device, sector_t sector,
150 struct axon_ram_bank *bank = device->bd_disk->private_data; 150 struct axon_ram_bank *bank = device->bd_disk->private_data;
151 loff_t offset; 151 loff_t offset;
152 152
153 offset = sector << AXON_RAM_SECTOR_SHIFT; 153 offset = sector;
154 if (device->bd_part != NULL)
155 offset += device->bd_part->start_sect;
156 offset <<= AXON_RAM_SECTOR_SHIFT;
154 if (offset >= bank->size) { 157 if (offset >= bank->size) {
155 dev_err(&bank->device->dev, "Access outside of address space\n"); 158 dev_err(&bank->device->dev, "Access outside of address space\n");
156 return -ERANGE; 159 return -ERANGE;