From patchwork Wed Oct 28 21:40:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lukasz Stelmach X-Patchwork-Id: 11863217 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8792C4363A for ; Wed, 28 Oct 2020 21:42:08 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 26A4D24724 for ; Wed, 28 Oct 2020 21:42:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="vB5F2sc4"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="sdb+Nwqq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 26A4D24724 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=samsung.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References: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:List-Owner; bh=sahc/rKAnYi6lsAwMiTS4Ly15oKc2V1/Cp/qektVV4Y=; b=vB5F2sc41sVtDOc6mqcNq1c0i awY2IcyiLUCDuSPVEbQ3Kg2w9Qlhenkzr71Tf8GW2IAyQWOaBpNwhjtIPE9vrTdvA5kBQlqj77dFh nL1QYI91OAWmAB2MKYnAlP9p/uKpxapE/exiQAnlhsdpLuMsIoFflob5CA7Os/RNWY2FlSfrgl9qB cII/CGFQz4opqleaq16UKavSs42/CXwllIWjiBA0AsZYONFJymk+efVCiRKFXtk/WAOQCqisej6BP +MBJpn0KCtHm0+RsHzna9ISFX2calz/BDDpHRpjCAql2ZTuyBby0K5yDemsrit5JJVmqNgpAa2mBd POEq606LQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXtCG-0006xP-U0; Wed, 28 Oct 2020 21:41:32 +0000 Received: from mailout1.w1.samsung.com ([210.118.77.11]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXtBa-0006mn-76 for linux-arm-kernel@lists.infradead.org; Wed, 28 Oct 2020 21:40:58 +0000 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20201028214034euoutp01703dcc2a8ad487b95415a8266dba790c~CRd1efEE-3240832408euoutp01q for ; Wed, 28 Oct 2020 21:40:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20201028214034euoutp01703dcc2a8ad487b95415a8266dba790c~CRd1efEE-3240832408euoutp01q DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1603921234; bh=wGXPKJVb69pqXKx2ZIgRaFvmKeW6gzHu0+eGvJQYRIQ=; h=From:To:Cc:Subject:Date:References:From; b=sdb+NwqqHPQ0RAvvT1p7mvgy4ivKPwpy2siXYk9xINntJVFLjVJFwlgzodhE7LYX8 PCHXYHNvpjRPs084X1ZYeco6sHhwy9zIHYiL8Q6LF2jJV1j4MTKFiKFHBfil+1Vl7a cKCIJJ3fDZ3io660JXSrXFqxnAQwXL+91UX3Ln8U= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20201028214018eucas1p1c7366cff1bed104e95a7926d5941091f~CRdm-pLh_2052320523eucas1p1V; Wed, 28 Oct 2020 21:40:18 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id F0.8F.06456.245E99F5; Wed, 28 Oct 2020 21:40:18 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20201028214017eucas1p21a93b489acce80ff8a2fd1adfc9c1649~CRdl0RlxO2075420754eucas1p2h; Wed, 28 Oct 2020 21:40:17 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20201028214017eusmtrp20aa630ac5af1f94ca829c4a5eea6a5f4~CRdlzgVSt3218532185eusmtrp2i; Wed, 28 Oct 2020 21:40:17 +0000 (GMT) X-AuditID: cbfec7f2-7efff70000001938-fd-5f99e5425717 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 5F.8E.06314.F35E99F5; Wed, 28 Oct 2020 21:40:15 +0000 (GMT) Received: from localhost (unknown [106.120.51.46]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20201028214015eusmtip23525b6aea39a22a94207c9a0fa86248f~CRdkAn-cQ2585225852eusmtip2c; Wed, 28 Oct 2020 21:40:15 +0000 (GMT) From: =?utf-8?q?=C5=81ukasz_Stelmach?= To: Andrew Lunn , jim.cromie@gmail.com, Heiner Kallweit , "David S. Miller" , Jakub Kicinski , Rob Herring , Kukjin Kim , Krzysztof Kozlowski , Russell King , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH v4 0/5] AX88796C SPI Ethernet Adapter Date: Wed, 28 Oct 2020 22:40:07 +0100 Message-Id: <20201028214012.9712-1-l.stelmach@samsung.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Organization: Samsung R&D Institute Poland X-Brightmail-Tracker: H4sIAAAAAAAAA02SfUhTYRTGe3fv3W7W9LosDxqTRl8KatIHb5+kFlyhP6IgIrA128UiN2PL WkVallnit6bbFAyztJEfrbWapsQyy0qnraxMK1IJFftaSSpZbtfI/55zzu95z3PgpQnJeyqA Pqg+wmnUigSZ0Iu0tow5QqMGDPIVDbmh2NFrJ/BNfS2FSx3nSFzW3E7h8i96CneN9FA4p2+Y wA5HnQh3WLMp/MZehbC5r4vCzvpSIdY7mgTYfqkR4ermXhFuubwApzU2izb7ss6uToK1XH8j YG3GXhFrNl0UsrcqUljbXZeAzbaYEOsyS7fTe7w2KLmEg0c5TfimfV4HJrvT0OFRqa4mtwKd RgbIQLNpYFZBd/VnQQbyoiVMFYIrdWkEX/xAMDBYJOILFwLLnfvon8VkMlD8oBJBY8vEtOUT gsmLDyg3JWQiIefqYw/lx7wjoDb9A3IXBNOEwPaukHBT85jVUFNZT7o1ySyBlx15Hi1m1oFl Ypjg9wVBeuUdId/3hVZDv4fxYULgRuorjyammLO3SzwxgPktgl8PGwS8eQtk3SqbDj4Phh5Z RLxeCH9sZVMMPaVToCB/De/NRGAt/UXyzHroaR8XuhmCCYba+nC+HQmDw4+FvNUbXo/48hG8 Id9aTPBtMVw4L+HpxVCTc2/6wQDIGqqaDsOC8VoBkYsWGWccZpxxjPH/3suIMCF/Lkmriue0 EW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JJanZqakFqUUwfUwcnFINjE2TPKslrVliNjNcshXbts3xpH3z/xULjm32s14u61qS 1TxlxVfOVctFlnWd8BT+9OTZ9i0BTU7bN0Z89vji2LDn3dUJW5f9DVJxqPZh3xX+wGFH0JsP h2U+VwScuF3HM5sjiMFp3j2Gjz/Kxfk/9/PvZJmsFnPrYdCf3SGnz/za7V11/9/rO5ZKLMUZ iYZazEXFiQBr3XV56QIAAA== X-CMS-MailID: 20201028214017eucas1p21a93b489acce80ff8a2fd1adfc9c1649 X-Msg-Generator: CA X-RootMTR: 20201028214017eucas1p21a93b489acce80ff8a2fd1adfc9c1649 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201028214017eucas1p21a93b489acce80ff8a2fd1adfc9c1649 References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201028_174051_025842_683E49F7 X-CRM114-Status: GOOD ( 22.11 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marek Szyprowski , =?utf-8?q?=C5=81ukasz_Stelm?= =?utf-8?q?ach?= , =?utf-8?q?Bart=C5=82omiej_=C5=BBo?= =?utf-8?q?lnierkiewicz?= Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This is a driver for AX88796C Ethernet Adapter connected in SPI mode as found on ARTIK5 evaluation board. The driver has been ported from a v3.10.9 vendor kernel for ARTIK5 board. Changes in v4: - fixed compilation problems in asix,ax88796c.yaml and in ax88796c_main.c introduced in v3 Changes in v3: - modify vendor-prefixes.yaml in a separate patch - fix several problems in the dt binding - removed unnecessary descriptions and properties - changed the order of entries - fixed problems with missing defines in the example - change (1 << N) to BIT(N), left a few (0 << N) - replace ax88796c_get_link(), ax88796c_get_link_ksettings(), ax88796c_set_link_ksettings(), ax88796c_nway_reset(), ax88796c_set_mac_address() with appropriate kernel functions. - disable PHY auto-polling in MAC and use PHYLIB to track the state of PHY and configure MAC - propagate return values instead of returning constants in several places - add WARN_ON() for unlocked mutex - remove local work queue and use the system_wq - replace phy_connect_direct() with phy_connect() and move devm_register_netdev() to the end of ax88796c_probe() (Unlike phy_connect_direct() phy_connect() does not crash if the network device isn't registered yet.) - remove error messages on ENOMEM - move free_irq() to the end of ax88796c_close() to avoid race condition - implement flow-control Changes in v2: - use phylib - added DT bindings - moved #includes to *.c files - used mutex instead of a semaphore for locking - renamed some constants - added error propagation for several functions - used ethtool for dumping registers - added control over checksum offloading - remove vendor specific PM - removed macaddr module parameter and added support for reading a MAC address from platform data (e.g. DT) - removed dependency on SPI from NET_VENDOR_ASIX - added an entry in the MAINTAINERS file - simplified logging with appropriate netif_* and netdev_* helpers - lots of style fixes Ɓukasz Stelmach (5): dt-bindings: vendor-prefixes: Add asix prefix dt-bindings: net: Add bindings for AX88796C SPI Ethernet Adapter net: ax88796c: ASIX AX88796C SPI Ethernet Adapter Driver ARM: dts: exynos: Add Ethernet to Artik 5 board ARM: defconfig: Enable ax88796c driver .../bindings/net/asix,ax88796c.yaml | 69 + .../devicetree/bindings/vendor-prefixes.yaml | 2 + MAINTAINERS | 6 + arch/arm/boot/dts/exynos3250-artik5-eval.dts | 29 + arch/arm/configs/exynos_defconfig | 2 + arch/arm/configs/multi_v7_defconfig | 2 + drivers/net/ethernet/Kconfig | 1 + drivers/net/ethernet/Makefile | 1 + drivers/net/ethernet/asix/Kconfig | 22 + drivers/net/ethernet/asix/Makefile | 6 + drivers/net/ethernet/asix/ax88796c_ioctl.c | 197 +++ drivers/net/ethernet/asix/ax88796c_ioctl.h | 26 + drivers/net/ethernet/asix/ax88796c_main.c | 1144 +++++++++++++++++ drivers/net/ethernet/asix/ax88796c_main.h | 578 +++++++++ drivers/net/ethernet/asix/ax88796c_spi.c | 111 ++ drivers/net/ethernet/asix/ax88796c_spi.h | 69 + 16 files changed, 2265 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/asix,ax88796c.yaml create mode 100644 drivers/net/ethernet/asix/Kconfig create mode 100644 drivers/net/ethernet/asix/Makefile create mode 100644 drivers/net/ethernet/asix/ax88796c_ioctl.c create mode 100644 drivers/net/ethernet/asix/ax88796c_ioctl.h create mode 100644 drivers/net/ethernet/asix/ax88796c_main.c create mode 100644 drivers/net/ethernet/asix/ax88796c_main.h create mode 100644 drivers/net/ethernet/asix/ax88796c_spi.c create mode 100644 drivers/net/ethernet/asix/ax88796c_spi.h