diff mbox

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

Message ID 1405975648-25375-3-git-send-email-jogo@openwrt.org
State Changes Requested
Headers show

Commit Message

Jonas Gorski July 21, 2014, 8:47 p.m. UTC
Similar to physmap_of, allow preventing unaligned accesses to physmap
also for non OF enabled platforms.

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

Patch

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__ */