[PATCH 2/3] mtd: physmap: allow setting no_unaligned_access for !OF

Jonas Gorski jogo at openwrt.org
Mon Jul 21 13:47:27 PDT 2014


Similar to physmap_of, allow preventing unaligned accesses to physmap
also for non OF enabled platforms.

Signed-off-by: Jonas Gorski <jogo at openwrt.org>
---
 drivers/mtd/maps/physmap.c  | 3 +++
 include/linux/mtd/physmap.h | 1 +
 2 files changed, 4 insertions(+)

diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c
index f73cd46..410190c 100644
--- a/drivers/mtd/maps/physmap.c
+++ b/drivers/mtd/maps/physmap.c
@@ -153,6 +153,9 @@ static int physmap_flash_probe(struct platform_device *dev)
 
 		simple_map_init(&info->map[i]);
 
+		if (physmap_data->no_unaligned_access)
+			info->map[i].phys = NO_XIP;
+
 		probe_type = rom_probe_types;
 		if (physmap_data->probe_type == NULL) {
 			for (; info->mtd[i] == NULL && *probe_type != NULL; probe_type++)
diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h
index aa6a263..719889d 100644
--- a/include/linux/mtd/physmap.h
+++ b/include/linux/mtd/physmap.h
@@ -31,6 +31,7 @@ struct physmap_flash_data {
 	char                    *probe_type;
 	struct mtd_partition	*parts;
 	const char * const	*part_probe_types;
+	int			no_unaligned_access;
 };
 
 #endif /* __LINUX_MTD_PHYSMAP__ */
-- 
2.0.0



More information about the linux-mtd mailing list