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

login
register
mail settings
Submitter Jonas Gorski
Date July 21, 2014, 8:47 p.m.
Message ID <1405975648-25375-3-git-send-email-jogo@openwrt.org>
Download mbox | patch
Permalink /patch/372199/
State New
Headers show

Comments

Jonas Gorski - July 21, 2014, 8:47 p.m.
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(+)

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