Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Maxim Shchetynin and committed by
Benjamin Herrenschmidt
8204cba7 9a23409b

+4 -1
+4 -1
arch/powerpc/sysdev/axonram.c
··· 150 150 struct axon_ram_bank *bank = device->bd_disk->private_data; 151 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 157 if (offset >= bank->size) { 155 158 dev_err(&bank->device->dev, "Access outside of address space\n"); 156 159 return -ERANGE;