From patchwork Sat Nov 10 20:01:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 150745 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1367317ljp; Sat, 10 Nov 2018 12:02:24 -0800 (PST) X-Google-Smtp-Source: AJdET5dbs9K5lP6XIJw/XxXRRdZfnau/+Hn03+2uQwaaWclMlhMyaZKSuphc2MFZ25bV/3yWdUhb X-Received: by 2002:a63:65c7:: with SMTP id z190mr12020600pgb.249.1541880144008; Sat, 10 Nov 2018 12:02:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541880144; cv=none; d=google.com; s=arc-20160816; b=0OPcKEkKdDXvSxq3+oBp6WZ1FgZswquX18rKcHYNopx2G7xAGZ5Cy4TP1VU/izsOi2 YTJMCD6nzrE8+Lt6D5PZO0ujOcnD1RVnd8plvNPM9TZcd8auOflDOlwQT00GnkrIyjsX uKJOevcNPYHwOci7QBZo3uWSgFSL5EcqvmLnrJY2VXwBHAExk2LqRpWCMVnb7Mzqb3Mx R39RSSdummGYyskEyxhGIuDc75XSJWS9c9tqUZeNQQcgU5TX84pFvUrm6jN7ZNDjpB7K p3UfCyyviFJDDdpXM7OV0RIDDCHWkbR4AF9/Q0uNt7gwcvYIx76IeWWBjQ0S8NeIev8P sctA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:message-id:date:subject:to:from :dkim-signature:dkim-signature; bh=hL2A9X3pe6od/zJcQnY4mwiVwUYG0XAgx0yRfMDGiZc=; b=yDqrCymPEvFBdXnI1lVIqYAAFD2bPXSDdAPFF4QXJ8LK6nU+HibwpqAbb3g2impz/0 LfqdVA7yAVzWr2qZJdlrVks+p8Q5fFvHLSZ0VWmx1AQCJ0fCSmLA0Yqpa7CkLJJ2FqDl y+8sTOHY3O4avBO97fF+yL8X8PPwsKUM9HpUhGP/J0cKOj32RQT+YhE6+v7tSuAHhBqE mxC3Flsn/49qVTvmavrcQJDT1MUH1anLwL+dzryKIP8wEKYorfHeOrXafLbNlsjRTaxF 6NCMGdhcFq6nktBDOX5xLfpKVZbMewMqRIKql7ZPmzABmXohQLJ4dFtDxTEFFrTe1XVp vWVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=rkMMvgQb; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=RW2bdfw0; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id f22si1862091pgm.81.2018.11.10.12.02.23 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Nov 2018 12:02:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=rkMMvgQb; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=RW2bdfw0; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=hL2A9X3pe6od/zJcQnY4mwiVwUYG0XAgx0yRfMDGiZc=; b=rkMMvgQbK0Msox HhPNoxjeIy/gclU9huEVJSwpj5s5U7zooFUog+Yb3xtxezlj++X72OTNbHVN/eGAMzWAPxtI97kPO lmVlvo7ZT8A3vmJrmewiUjhbJjYzuNGd9Ke1efq5Onu9hvu3oAuoLAgJqsj8Moco1D1rgTw30dVwo dJrCDoji/DRuZeqZcNw0vsIunFdn0dKYVXPpQ73vINc7e3TPePBfHu7Tf1baXlAiSXW9P5DVTjflB mD6tKXlfZ1m20jdJaFL1lTPaXOUdP8zcJiAC3HGTR390S3SPcTOl3RiLdZh1r810lBNjhW58gMJJa 5ZZKs+pdgsJ8KVXwus2g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gLZSK-000898-3j; Sat, 10 Nov 2018 20:02:08 +0000 Received: from mail-lj1-x243.google.com ([2a00:1450:4864:20::243]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gLZS2-000887-GS for linux-mtd@lists.infradead.org; Sat, 10 Nov 2018 20:01:52 +0000 Received: by mail-lj1-x243.google.com with SMTP id u6-v6so4389319ljd.1 for ; Sat, 10 Nov 2018 12:01:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=9bhYEXDohJCV7Hp7nDLyA0Lvi50vflNn7VkpAavDDTk=; b=RW2bdfw0TYb6JP+FRlEkuNgUwX4S2VTglAs4L0R/YRirSRJtWC7MZp5IJ4PhwgAkxf 1KDAl63sr/bwnqDdI7WdnKxqNbOxu5X+8qGZwjB/q9Hl52Mab34otyzCeB7N/UJv6WLI 7OwDx72p0+QqVBwgRi9o1NGXX8JmcbxjujuwY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=9bhYEXDohJCV7Hp7nDLyA0Lvi50vflNn7VkpAavDDTk=; b=fsN5nolBfi2VEQgW6Nk1O6u74ekiXE+qzkPLz0XGv1g80+gallQh+I+Q5vORLG78+T YLt4Pz1srp5uL44EWXaks1MyLsaLfk9PUZZETga+v9hT2TkMysC2++1C0j5hxxo3UJrt xKEvjRkfZsPiGXzNjxTa/r9wgo4RYLN06Qm1v6u83YVkzl2nleqQrKRt/lqQj/XVhnNw eaT6C0F+K8MnKdjnxFT6U8ykfjvINiC63U/OOOz6NzbMsMiTlq5TLCYPbW1zw3H96G7f g+VDSt7l3VBziHQo4Ua47wObU6Quqb31XSlsm/n5JTnQ/RsCtvLKG4txYqnQDTBYiuhG ZCgA== X-Gm-Message-State: AGRZ1gLyMzW2w6jS1ZdkYzJDNCiA3VrkOaGGHXMl9LKn7jlnVdaYi/Cb 1uJ/M4SI7IUlS48fyIrNa7conQ== X-Received: by 2002:a2e:302:: with SMTP id 2-v6mr8585869ljd.152.1541880097867; Sat, 10 Nov 2018 12:01:37 -0800 (PST) Received: from localhost.bredbandsbolaget (c-ae7b71d5.014-348-6c756e10.bbcust.telenor.se. [213.113.123.174]) by smtp.gmail.com with ESMTPSA id 75-v6sm2234606ljs.50.2018.11.10.12.01.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Nov 2018 12:01:36 -0800 (PST) From: Linus Walleij To: David Woodhouse , Brian Norris , Boris Brezillon , Marek Vasut , Richard Weinberger , linux-mtd@lists.infradead.org Subject: [PATCH 1/3 v2] mtd: Move Redboot partition parser Date: Sat, 10 Nov 2018 21:01:25 +0100 Message-Id: <20181110200127.13847-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181110_120150_546729_EDC76078 X-CRM114-Status: GOOD ( 18.82 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:243 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linus Walleij Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org This moves the Redboot partition parser down to the parsers subdirectory. Signed-off-by: Linus Walleij --- ChangeLog v1->v2: - Rebased on linux-mtd-next for v4.21 --- drivers/mtd/Kconfig | 50 ----------------------------- drivers/mtd/Makefile | 1 - drivers/mtd/parsers/Kconfig | 50 +++++++++++++++++++++++++++++ drivers/mtd/parsers/Makefile | 1 + drivers/mtd/{ => parsers}/redboot.c | 0 5 files changed, 51 insertions(+), 51 deletions(-) rename drivers/mtd/{ => parsers}/redboot.c (100%) -- 2.19.1 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig index a7736c1947e7..1e18c9639c3e 100644 --- a/drivers/mtd/Kconfig +++ b/drivers/mtd/Kconfig @@ -22,56 +22,6 @@ config MTD_TESTS WARNING: some of the tests will ERASE entire MTD device which they test. Do not use these tests unless you really know what you do. -config MTD_REDBOOT_PARTS - tristate "RedBoot partition table parsing" - help - RedBoot is a ROM monitor and bootloader which deals with multiple - 'images' in flash devices by putting a table one of the erase - blocks on the device, similar to a partition table, which gives - the offsets, lengths and names of all the images stored in the - flash. - - If you need code which can detect and parse this table, and register - MTD 'partitions' corresponding to each image in the table, enable - this option. - - You will still need the parsing functions to be called by the driver - for your particular device. It won't happen automatically. The - SA1100 map driver (CONFIG_MTD_SA1100) has an option for this, for - example. - -if MTD_REDBOOT_PARTS - -config MTD_REDBOOT_DIRECTORY_BLOCK - int "Location of RedBoot partition table" - default "-1" - help - This option is the Linux counterpart to the - CYGNUM_REDBOOT_FIS_DIRECTORY_BLOCK RedBoot compile time - option. - - The option specifies which Flash sectors holds the RedBoot - partition table. A zero or positive value gives an absolute - erase block number. A negative value specifies a number of - sectors before the end of the device. - - For example "2" means block number 2, "-1" means the last - block and "-2" means the penultimate block. - -config MTD_REDBOOT_PARTS_UNALLOCATED - bool "Include unallocated flash regions" - help - If you need to register each unallocated flash region as a MTD - 'partition', enable this option. - -config MTD_REDBOOT_PARTS_READONLY - bool "Force read-only for RedBoot system images" - help - If you need to force read-only for 'RedBoot', 'RedBoot Config' and - 'FIS directory' images, enable this option. - -endif # MTD_REDBOOT_PARTS - config MTD_CMDLINE_PARTS tristate "Command line partition table parsing" depends on MTD diff --git a/drivers/mtd/Makefile b/drivers/mtd/Makefile index 93473d215a38..58fc327a5276 100644 --- a/drivers/mtd/Makefile +++ b/drivers/mtd/Makefile @@ -8,7 +8,6 @@ obj-$(CONFIG_MTD) += mtd.o mtd-y := mtdcore.o mtdsuper.o mtdconcat.o mtdpart.o mtdchar.o obj-$(CONFIG_MTD_OF_PARTS) += ofpart.o -obj-$(CONFIG_MTD_REDBOOT_PARTS) += redboot.o obj-$(CONFIG_MTD_CMDLINE_PARTS) += cmdlinepart.o obj-$(CONFIG_MTD_AFS_PARTS) += afs.o obj-$(CONFIG_MTD_AR7_PARTS) += ar7part.o diff --git a/drivers/mtd/parsers/Kconfig b/drivers/mtd/parsers/Kconfig index ee5ab994132f..fccf1950e92d 100644 --- a/drivers/mtd/parsers/Kconfig +++ b/drivers/mtd/parsers/Kconfig @@ -14,3 +14,53 @@ config MTD_SHARPSL_PARTS This provides the read-only FTL logic necessary to read the partition table from the NAND flash of Sharp SL Series (Zaurus) and the MTD partition parser using this code. + +config MTD_REDBOOT_PARTS + tristate "RedBoot partition table parsing" + help + RedBoot is a ROM monitor and bootloader which deals with multiple + 'images' in flash devices by putting a table one of the erase + blocks on the device, similar to a partition table, which gives + the offsets, lengths and names of all the images stored in the + flash. + + If you need code which can detect and parse this table, and register + MTD 'partitions' corresponding to each image in the table, enable + this option. + + You will still need the parsing functions to be called by the driver + for your particular device. It won't happen automatically. The + SA1100 map driver (CONFIG_MTD_SA1100) has an option for this, for + example. + +if MTD_REDBOOT_PARTS + +config MTD_REDBOOT_DIRECTORY_BLOCK + int "Location of RedBoot partition table" + default "-1" + help + This option is the Linux counterpart to the + CYGNUM_REDBOOT_FIS_DIRECTORY_BLOCK RedBoot compile time + option. + + The option specifies which Flash sectors holds the RedBoot + partition table. A zero or positive value gives an absolute + erase block number. A negative value specifies a number of + sectors before the end of the device. + + For example "2" means block number 2, "-1" means the last + block and "-2" means the penultimate block. + +config MTD_REDBOOT_PARTS_UNALLOCATED + bool "Include unallocated flash regions" + help + If you need to register each unallocated flash region as a MTD + 'partition', enable this option. + +config MTD_REDBOOT_PARTS_READONLY + bool "Force read-only for RedBoot system images" + help + If you need to force read-only for 'RedBoot', 'RedBoot Config' and + 'FIS directory' images, enable this option. + +endif # MTD_REDBOOT_PARTS diff --git a/drivers/mtd/parsers/Makefile b/drivers/mtd/parsers/Makefile index 5b1bcc3d90d9..d8418bf6804a 100644 --- a/drivers/mtd/parsers/Makefile +++ b/drivers/mtd/parsers/Makefile @@ -1,2 +1,3 @@ obj-$(CONFIG_MTD_PARSER_TRX) += parser_trx.o obj-$(CONFIG_MTD_SHARPSL_PARTS) += sharpslpart.o +obj-$(CONFIG_MTD_REDBOOT_PARTS) += redboot.o diff --git a/drivers/mtd/redboot.c b/drivers/mtd/parsers/redboot.c similarity index 100% rename from drivers/mtd/redboot.c rename to drivers/mtd/parsers/redboot.c