From patchwork Mon Jul 21 20:47:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Gorski X-Patchwork-Id: 372199 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 2D103140146 for ; Tue, 22 Jul 2014 06:49:29 +1000 (EST) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1X9KV9-0008R0-2J; Mon, 21 Jul 2014 20:48:03 +0000 Received: from arrakis.dune.hu ([78.24.191.176]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1X9KV7-0008OO-92 for linux-mtd@lists.infradead.org; Mon, 21 Jul 2014 20:48:01 +0000 Received: from localhost (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 238F3281621; Mon, 21 Jul 2014 22:45:24 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.3.2 X-Virus-Scanned: at arrakis.dune.hu Received: from ixxyvirt.lan (dslb-088-073-029-079.pools.arcor-ip.net [88.73.29.79]) by arrakis.dune.hu (Postfix) with ESMTPSA id 8A867280062; Mon, 21 Jul 2014 22:45:18 +0200 (CEST) From: Jonas Gorski To: linux-mtd@lists.infradead.org Subject: [PATCH 2/3] mtd: physmap: allow setting no_unaligned_access for !OF Date: Mon, 21 Jul 2014 22:47:27 +0200 Message-Id: <1405975648-25375-3-git-send-email-jogo@openwrt.org> X-Mailer: git-send-email 2.0.0 In-Reply-To: <1405975648-25375-1-git-send-email-jogo@openwrt.org> References: <1405975648-25375-1-git-send-email-jogo@openwrt.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140721_134801_492802_2D7E5C8A X-CRM114-Status: GOOD ( 14.31 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- Cc: Artem Bityutskiy , Kevin Cernekee , Gregory Fong , Maxime Bizon , Stefan Roese , David Woodhouse , Florian Fainelli X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Similar to physmap_of, allow preventing unaligned accesses to physmap also for non OF enabled platforms. Signed-off-by: Jonas Gorski --- 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__ */