From patchwork Tue May 29 14:52:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuanhong Guo X-Patchwork-Id: 922156 X-Patchwork-Delegate: blogic@openwrt.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="U3pYoajw"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="IHAzRJV4"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40wGtY10pnz9rxs for ; Wed, 30 May 2018 00:53:08 +1000 (AEST) 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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:Message-Id: Date: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=N9957mvax4xDSmHQ7wlWE0zDrCAK9y/R2LaisRzQsEY=; b=U3pYoajw39NiH3 WQswy61LyVIdjGPeQY8lac/7/PXIeHbbzUPLUyjiYjnxXtYTJex1ZWDyr/mj2EL1c0lMrvc1yVcqe Mos6qQeswO6DhgczJh+ymG2ClJ2fkjyEQ+DyShbeARdHdIyzvyv+VRTQKKab4v4OX/1iyAl9HBVRa sFmQZGi8xzaOZ5axMDXQMIAaW3rcbIpHqJdCb3juCg1NnqTdANGsqsEggz+c+6oDRxua6ThohJUfv 3yFaPjYQP1IxJkLr5TJIh8eunyIbsPn4xZro1G0Bn0Vgu7hrIUkzPVU9baKsjV1Y2sfY92wphaGsY vF9jncZbe5hdcAvuLa6Q==; 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 1fNfzQ-0003qs-QL; Tue, 29 May 2018 14:52:44 +0000 Received: from mail-pg0-x242.google.com ([2607:f8b0:400e:c05::242]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fNfzO-0003q5-HH for openwrt-devel@lists.openwrt.org; Tue, 29 May 2018 14:52:43 +0000 Received: by mail-pg0-x242.google.com with SMTP id w3-v6so6687849pgv.12 for ; Tue, 29 May 2018 07:52:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=ICME3w5YFz1rccb6f3GrdQ908dHns2eGoeWT72NUgkM=; b=IHAzRJV4xgfwAG/BmDcTddStmuSzVlVkgd8MUcfJ671qZyc5ZZTh4UB09qzzRMA0JH fSNkdwyHdxPhg2o6wmrK6I2E31zyHmvYM2Or/AYwd+VDIIEGcyh2ZQtbeoo9i4QVxtBB rwCTSKuapSkw2cXVGHqgNaGEFx+mm/EfcWNB3u6NSLglXOc8XlFH9SAvDFxScRKsfWQi RsIRLVM8jGX4wZ8bx5obX4+0AGSCFjs/qE9FsrFvg/9E+bpwTgdgPu2KEzUeVC1EFFz2 XXKIoWZBiyO1hyx2Z7faSAwJPxBsPWp/kKZwD2ozIgu4518+4GBviv3z/E7C1GzF95b6 /nqA== 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; bh=ICME3w5YFz1rccb6f3GrdQ908dHns2eGoeWT72NUgkM=; b=okqw96H4xort56FXlAs6BLq9DsJ/Xx9GsEGv7wrd1ZxmRQTZNLFEd7F86HCe1FKfU4 FDVx7oE958vdZtBgyQo2aneMuPIUU93nKS8vRZCwHiMkwVqj7PoDBBDJ9/im97fDQau5 DQpt1PTqi7VZ82zrlJ0x52cxiKnMiRSlaBmjDAnqS89x4CbklvRcW5IGT67GExl3Pp+0 1RWyRWiqi1wW5bLv0xzlCdRcuzznDjjUwZaredpmFOaIm9ApFZBM3IzAgKWMxB5C9U8b LzZiU3SrbCkdfXJmXO6YtpaPEe01fQd3Qbm5gGYW2y+ZFSmsyS6ZmwxzNSqPoJY+tSjV ydlg== X-Gm-Message-State: ALKqPwfjZ4p0sh/zf6oSvBwmipwuSHzgCaTe2UJ40FwxzQLCsgIMGqJ6 y2Gh9z2cMNv7oHaVCf4hcToK26Yw X-Google-Smtp-Source: AB8JxZquTglCi79sV3ZG/uwaYdtGCZS11IkTzZZQN3tbgAswrtbTCqILeb9PzLEzyou5/d9blzBrvQ== X-Received: by 2002:a63:9c01:: with SMTP id f1-v6mr14458738pge.223.1527605551556; Tue, 29 May 2018 07:52:31 -0700 (PDT) Received: from GuoGuo-OMEN.lan ([2001:250:3000:3c71:ca1:4353:9617:9781]) by smtp.gmail.com with ESMTPSA id m7-v6sm3887889pgr.5.2018.05.29.07.52.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 May 2018 07:52:30 -0700 (PDT) From: Chuanhong Guo To: openwrt-devel@lists.openwrt.org Date: Tue, 29 May 2018 22:52:15 +0800 Message-Id: <20180529145215.4087-1-gch981213@gmail.com> X-Mailer: git-send-email 2.17.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180529_075242_599360_B4937C6A X-CRM114-Status: GOOD ( 10.88 ) X-Spam-Score: 0.1 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:400e:c05:0:0:0:242 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (gch981213[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (gch981213[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -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 Subject: [OpenWrt-Devel] [PATCH] ath79: Add compatible strings for tp-link partition parser X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chuanhong Guo MIME-Version: 1.0 Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Signed-off-by: Chuanhong Guo --- PS: I tested this patch on ar9331-based pisen ts-d084 and it works correctly. But it seemed that I have no way to tell ethernet and wifi drivers about where mac address and ART data is. Is there any solution for this problem? .../ath79/files/drivers/mtd/tplinkpart.c | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/target/linux/ath79/files/drivers/mtd/tplinkpart.c b/target/linux/ath79/files/drivers/mtd/tplinkpart.c index 1b94163b83..8da5c4168e 100644 --- a/target/linux/ath79/files/drivers/mtd/tplinkpart.c +++ b/target/linux/ath79/files/drivers/mtd/tplinkpart.c @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -209,16 +210,36 @@ static int tplink_parse_64k_partitions(struct mtd_info *master, TPLINK_64K_KERNEL_OFFS); } +#ifdef CONFIG_OF +static const struct of_device_id parse_tplink_match_table[] = { + { .compatible = "tp-link" }, + {}, +}; +MODULE_DEVICE_TABLE(of, parse_tplink_match_table); + +static const struct of_device_id parse_tplink_64k_match_table[] = { + { .compatible = "tp-link-64k" }, + {}, +}; +MODULE_DEVICE_TABLE(of, parse_tplink_64k_match_table); +#endif + static struct mtd_part_parser tplink_parser = { .owner = THIS_MODULE, .parse_fn = tplink_parse_partitions, .name = "tp-link", +#ifdef CONFIG_OF + .of_match_table = parse_tplink_match_table, +#endif }; static struct mtd_part_parser tplink_64k_parser = { .owner = THIS_MODULE, .parse_fn = tplink_parse_64k_partitions, .name = "tp-link-64k", +#ifdef CONFIG_OF + .of_match_table = parse_tplink_64k_match_table, +#endif }; static int __init tplink_parser_init(void) @@ -233,3 +254,5 @@ module_init(tplink_parser_init); MODULE_LICENSE("GPL v2"); MODULE_AUTHOR("Gabor Juhos "); +MODULE_ALIAS("tp-link"); +MODULE_ALIAS("tp-link-64k");