From patchwork Mon May 14 17:42:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 159099 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 1A7BEB702E for ; Tue, 15 May 2012 03:52:36 +1000 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1STzQI-0007Kz-OM; Mon, 14 May 2012 17:51:06 +0000 Received: from bombadil.infradead.org ([2001:4830:2446:ff00:4687:fcff:fea6:5117]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1STzQE-0007Ju-PF for linux-mtd@merlin.infradead.org; Mon, 14 May 2012 17:51:03 +0000 Received: from [2a01:4f8:131:30e2::2] (helo=nbd.name) by bombadil.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1STzQC-0005WN-FN for linux-mtd@lists.infradead.org; Mon, 14 May 2012 17:51:01 +0000 From: John Crispin To: Ralf Baechle Subject: [RESEND PATCH V2 14/17] MTD: MIPS: lantiq: verify that the NOR interface is available on falcon soc Date: Mon, 14 May 2012 19:42:40 +0200 Message-Id: <1337017363-14424-14-git-send-email-blogic@openwrt.org> X-Mailer: git-send-email 1.7.9.1 In-Reply-To: <1337017363-14424-1-git-send-email-blogic@openwrt.org> References: <1337017363-14424-1-git-send-email-blogic@openwrt.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20120514_135100_710759_82725B81 X-CRM114-Status: GOOD ( 10.01 ) X-Spam-Score: -1.1 (-) X-Spam-Report: SpamAssassin version 3.3.2 on bombadil.infradead.org summary: Content analysis details: (-1.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.8 RDNS_NONE Delivered to internal network by a host with no rDNS Cc: linux-mips@linux-mips.org, linux-mtd@lists.infradead.org, John Crispin X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.14 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-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org When running on a FALC-ON SoC, we need to check the bootstrap options to see if NOR is available. Signed-off-by: John Crispin Cc: linux-mtd@lists.infradead.org Acked-by: Artem Bityutskiy --- This patch is part of a series moving the mips/lantiq target to OF and clkdev support. The patch, once Acked, should go upstream via Ralf's MIPS tree. drivers/mtd/maps/lantiq-flash.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/drivers/mtd/maps/lantiq-flash.c b/drivers/mtd/maps/lantiq-flash.c index aefa111..c03456f 100644 --- a/drivers/mtd/maps/lantiq-flash.c +++ b/drivers/mtd/maps/lantiq-flash.c @@ -19,6 +19,7 @@ #include #include #include +#include #include @@ -116,6 +117,12 @@ ltq_mtd_probe(struct platform_device *pdev) struct cfi_private *cfi; int err; + if (of_machine_is_compatible("lantiq,falcon") && + (ltq_boot_select() != BS_FLASH)) { + dev_err(&pdev->dev, "invalid bootstrap options\n"); + return -ENODEV; + } + ltq_mtd = kzalloc(sizeof(struct ltq_mtd), GFP_KERNEL); platform_set_drvdata(pdev, ltq_mtd);