From patchwork Wed Dec 15 08:18:33 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 75630 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from canuck.infradead.org (canuck.infradead.org [134.117.69.58]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 05E2EB6EE9 for ; Wed, 15 Dec 2010 19:21:03 +1100 (EST) Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1PSmZL-0005qG-OH; Wed, 15 Dec 2010 08:18:39 +0000 Received: from mail-fx0-f48.google.com ([209.85.161.48]) by canuck.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1PSmZH-0005pU-Gk for linux-mtd@lists.infradead.org; Wed, 15 Dec 2010 08:18:36 +0000 Received: by fxm2 with SMTP id 2so1727091fxm.21 for ; Wed, 15 Dec 2010 00:18:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type; bh=saRhFLzEDgSKyErOCVu1JrBq74qyEvTtKxmjnwpJOnY=; b=h+KbMIQQ6NxvlDo6tJV4gFqVtDGEcv7VDTCKYjlVLX9MRDOm19DAoCuevGixEuNJf0 BSWWUGUPWLto7IYqxPVj/f3aSIT/hZ0TclzsMBDUEhgqj/KBhXs46T6haDkvElyOx/gt g0DDpdttZ0dI6rqQpkmToNGM9C2gYv4vTWjPU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=i+gzQmN1NatM+lLv0CDPTwKrG2vJN/BquM/mF3MA6JvVH86XK9GkIVwBECQGga/2KB ZghYh0eNpWE+Hyoda8Wv8bMUdCQfLzvZUH3W+SgT1slSzRMDpXA6+uXcO5+e5wZG37CM MCm0ij+H4Tvw0spfaTd49mnY67vJt701osHGU= MIME-Version: 1.0 Received: by 10.223.101.195 with SMTP id d3mr129735fao.96.1292401113590; Wed, 15 Dec 2010 00:18:33 -0800 (PST) Received: by 10.223.73.194 with HTTP; Wed, 15 Dec 2010 00:18:33 -0800 (PST) In-Reply-To: <20101215011904.GA24292@falooley.org> References: <22c797d00709272118i33d32b9dy93d5f5ec8f8edd30@mail.gmail.com> <20101214195124.GA6010@falooley.org> <1292356893.29257.1.camel@koala> <201012141849.03926.rob@landley.net> <20101215011904.GA24292@falooley.org> Date: Wed, 15 Dec 2010 09:18:33 +0100 X-Google-Sender-Auth: nD_uiXq7b8o9H_Frnu-T8SffS_g Message-ID: Subject: Re: [PATCH] mtd: allow mtd and jffs2 when ARCH=um From: Geert Uytterhoeven To: Jason Lunz X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20101215_031835_847161_E6ABDC68 X-CRM114-Status: GOOD ( 22.39 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.161.48 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is freemail (geert.uytterhoeven[at]gmail.com) 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: atom ota , user-mode-linux-devel@lists.sourceforge.net, dedekind1@gmail.com, richard -rw- weinberger , Sam Ravnborg , Jeff Dike , lkml , linux-mtd@lists.infradead.org, Rob Landley , David Woodhouse X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org On Wed, Dec 15, 2010 at 02:19, Jason Lunz wrote: > On Tue, Dec 14, 2010 at 06:49:02PM -0600, Rob Landley wrote: >> The problem is that jffs2 is a filesystem, and thus something people would >> really like to be able to loopback mount, but it's hardwired to assume it's >> only ever stored on a certain type of hardware, and thus requies incestuous >> knowledge of the erase granularity of the flash layer in order to function. > > I assume you can turn your jffs2 image file into a block dev using > losetup, then turn the corresponding loop device into an mtd device > using block2mtd, at which point you ought to be able to mount it with > jffs2. I've never tried it. And block2mtd is part of mtd, so you have to get mtd compiled first. BTW, the patch I used in the past was less intrusive than yours. I attached it, as I can't send it inline from here. Note that it was against 2.6.31-rc4. Gr{oetje,eeting}s,                         Geert --- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.                                 -- Linus Torvalds commit 57fce0f17f497583266a26328690f40f33af08c5 Author: Geert Uytterhoeven Date: Mon Dec 15 15:21:15 2008 +0100 UML: Enable MTD, by moving the dependency on HAS_IOMEM Signed-off-by: Geert Uytterhoeven diff --git a/arch/um/Kconfig.rest b/arch/um/Kconfig.rest index 0ccad0f..e34f399 100644 --- a/arch/um/Kconfig.rest +++ b/arch/um/Kconfig.rest @@ -28,9 +28,7 @@ source "drivers/scsi/Kconfig" source "drivers/md/Kconfig" -if BROKEN - source "drivers/mtd/Kconfig" -endif +source "drivers/mtd/Kconfig" source "drivers/leds/Kconfig" diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig index b8e35a0..052b00c 100644 --- a/drivers/mtd/Kconfig +++ b/drivers/mtd/Kconfig @@ -1,6 +1,5 @@ menuconfig MTD tristate "Memory Technology Device (MTD) support" - depends on HAS_IOMEM help Memory Technology Devices are flash, RAM and similar chips, often used for solid state file systems on embedded devices. This option @@ -315,15 +314,17 @@ config MTD_OOPS To use, add console=ttyMTDx to the kernel command line, where x is the MTD device number to use. -source "drivers/mtd/chips/Kconfig" - -source "drivers/mtd/maps/Kconfig" +if HAS_IOMEM + source "drivers/mtd/chips/Kconfig" + source "drivers/mtd/maps/Kconfig" +endif source "drivers/mtd/devices/Kconfig" -source "drivers/mtd/nand/Kconfig" - -source "drivers/mtd/onenand/Kconfig" +if HAS_IOMEM + source "drivers/mtd/nand/Kconfig" + source "drivers/mtd/onenand/Kconfig" +endif source "drivers/mtd/lpddr/Kconfig" diff --git a/drivers/mtd/Makefile b/drivers/mtd/Makefile index 82d1e4d..09fb548 100644 --- a/drivers/mtd/Makefile +++ b/drivers/mtd/Makefile @@ -29,6 +29,7 @@ obj-$(CONFIG_MTD_OOPS) += mtdoops.o nftl-objs := nftlcore.o nftlmount.o inftl-objs := inftlcore.o inftlmount.o -obj-y += chips/ lpddr/ maps/ devices/ nand/ onenand/ tests/ +obj-y += devices/ tests/ +obj-$(CONFIG_HAS_IOMEM) += chips/ lpddr/ maps/ nand/ onenand/ obj-$(CONFIG_MTD_UBI) += ubi/ diff --git a/drivers/mtd/devices/Kconfig b/drivers/mtd/devices/Kconfig index 325fab9..88937d6 100644 --- a/drivers/mtd/devices/Kconfig +++ b/drivers/mtd/devices/Kconfig @@ -106,6 +106,7 @@ config M25PXX_USE_FAST_READ config MTD_SLRAM tristate "Uncached system RAM" + depends on HAS_IOMEM help If your CPU cannot cache all of the physical memory in your machine, you can still use it for storage or swap by using this driver to @@ -113,6 +114,7 @@ config MTD_SLRAM config MTD_PHRAM tristate "Physical system RAM" + depends on HAS_IOMEM help This is a re-implementation of the slram driver above. @@ -179,6 +181,7 @@ config MTD_BLOCK2MTD Testing MTD users (eg JFFS2) on large media and media that might be removed during a write (using the floppy drive). +if HAS_IOMEM comment "Disk-On-Chip Device Drivers" config MTD_DOC2000 @@ -297,5 +300,6 @@ config MTD_DOCPROBE_55AA LinuxBIOS or if you need to recover a DiskOnChip Millennium on which you have managed to wipe the first block. +endif endmenu