From patchwork Mon Mar 15 11:29:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 12138981 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=-8.7 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 E6DA6C433DB for ; Mon, 15 Mar 2021 11:36:00 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 7DF2F64E61 for ; Mon, 15 Mar 2021 11:36:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7DF2F64E61 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.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=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc: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=SjfHNbMayTLKPcmOQj1JV6wEAqtoTuyofVCvDzBFgSE=; b=mJwHXGsDT9j08BcZpqIxqNjO99 5dyeCnz+a31G+0nBGcsvICI1j82mfxOXUtgroIMHXVjJXh9zUr2fSroBG3w1fez3Ll2V32qhAOHk0 MStM52sxgsP1p+a8wxRsfx6qeXC6hz74jWeDnTNNHlLi3lElJv9BrS22VUx44ZJvrZZuvig9qkZSu sMhcVocaVvEybMYEH7wD9ePSwc71Br/Lzdz7N8twwo9IZVZQiOyXBnL/BoLAJLP3YQ07EjGbuyv2L go7jZL++uTjmw1KAB9ofqaHs+HeG7UwxsjaE8lCrztfkjAzMUD5tCXz1TDnxxieuzOa3LgrWEIbQL F9kU+DQA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lLlRd-00FfcR-3n; Mon, 15 Mar 2021 11:31:33 +0000 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lLlPa-00FfLP-9p; Mon, 15 Mar 2021 11:29:32 +0000 Received: by mail-ed1-x52f.google.com with SMTP id h13so16850852eds.5; Mon, 15 Mar 2021 04:29:21 -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:mime-version :content-transfer-encoding; bh=rGW6cctDZoxABCsL4nhXCJwptF8+bYgkqPIEjnnUAYE=; b=mR+um3ko28cgPbFRVeDD5k3WaH0Enn8IRarFjH9efZ8D4VpVOiPN1BSi7f9e0+tpYC moBg5EQsiZBW5RMP1ia6sJOPQ/f/cTZdpI1cix8ALgyCVNs0kr1KBc0pCZXlh9ExfbiD ATcFdDjWWNkkWEm6Z/meUUXZIOLgsZfMlZm0lcT/HKpsY8WkZgxowTrssM/nxtYP+hkf yTXaFlGHxhV80FkReVab6tkXGAbE1TQMEHd0xZT5ruWHFLQkfDRYcIZoDumG8hvCjTaH qH+pSQ2BkA2F1R3JNhpDUUproOSczjcjisISPRsl2IQpgmToXc823hxlOeSoMND6H9lU Kmrg== 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=rGW6cctDZoxABCsL4nhXCJwptF8+bYgkqPIEjnnUAYE=; b=XpHs40bnwvK9kS4/Qoqh+af+oQ+1w1ioc+S9gNKYUXI0LR5dDGxRRqFV4bHPRLIziF xzgSjIWxKDspYsPjYVlTMqnV69WoLq65MWOxOevR6kxnitA52/jeAA8x68+HBGhd+s+o iJ0lYevTeq67kp78MdA1rj3hidmXvH2SxUX8Bcz2kdX8uAA+MB8B5Gjl+g4RHF7oEOin RMn7J6g01++dLAnm5frwOZHYUzjFn8hsq5gKqdPiE/9gqy0TJNzYYWatHPUSqSPv2o2N qp8O0e3JDdFhbsgT8ZAzjUy5lkT0Z1sDEw7d27hZdV3OQvxopthNiPpX1OJTOtoJ1PBA 0svQ== X-Gm-Message-State: AOAM532FbWR9312IT+YFf9aVh4q0AtmU85HJHgGvAKLss9Y980+SaCsN CqOfaozgEFJKUuOxRpyVWfs= X-Google-Smtp-Source: ABdhPJySTUuRdpTPNyo+Tq2X7aniRxhHUl89LTEuEgh+8jCpVdcnSjxEEWCugKU6hXJTdxpwyXV25w== X-Received: by 2002:aa7:c14a:: with SMTP id r10mr28301174edp.132.1615807761453; Mon, 15 Mar 2021 04:29:21 -0700 (PDT) Received: from localhost.localdomain ([188.24.140.160]) by smtp.gmail.com with ESMTPSA id q25sm3921423edt.51.2021.03.15.04.29.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Mar 2021 04:29:20 -0700 (PDT) From: Cristian Ciocaltea To: "David S. Miller" , Andrew Lunn , Jakub Kicinski , Rob Herring , =?utf-8?q?Andreas_F=C3=A4rber?= , Manivannan Sadhasivam , Philipp Zabel Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-actions@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 0/3] Add support for Actions Semi Owl Ethernet MAC Date: Mon, 15 Mar 2021 13:29:15 +0200 Message-Id: X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210315_112927_963314_21466130 X-CRM114-Status: GOOD ( 20.16 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This patch series adds support for the Ethernet MAC found on the Actions Semi Owl family of SoCs. For the moment I have only tested the driver on RoseapplePi SBC, which is based on the S500 SoC variant. It might work on S900 as well, but I cannot tell for sure since the S900 datasheet I currently have doesn't provide any information regarding the MAC registers - so I couldn't check the compatibility with S500. Similar story for S700: the datasheet I own is incomplete, but it seems the MAC is advertised with Gigabit capabilities. For that reason most probably we need to extend the current implementation in order to support this SoC variant as well. Please note that for testing the driver it is also necessary to update the S500 clock subsystem: https://lore.kernel.org/lkml/cover.1615221459.git.cristian.ciocaltea@gmail.com/ The DTS changes for the S500 SBCs will be provided separately. Thanks, Cristi Changes in v2: * According to Philipp's review - Requested exclusive control over serial line via devm_reset_control_get_exclusive() - Optimized error handling by using dev_err_probe() * According to Andrew's review - Dropped the inline keywords - Applied Reverse Christmas Tree format to local variable declarations - Renamed owl_emac_phy_config() to owl_emac_update_link_state() - Documented the purpose of the special descriptor used in the context of owl_emac_setup_frame_xmit() - Updated comment inside owl_emac_mdio_clock_enable() regarding the MDC clock divider setup - Indicated MAC support for symmetric pause via phy_set_sym_pause() in owl_emac_phy_init() - Changed the MAC addr generation algorithm in owl_emac_generate_mac_addr() by setting the locally administered bit in byte 0 and replacing bytes 1 & 2 with additional entries from enc_sn - Moved devm_add_action_or_reset() before clk_set_rate() in owl_emac_probe() * Other - Added SMII interface support: updated owl_emac_core_sw_reset(), added owl_emac_clk_set_rate(), updated description in the YAML binding - Changed OWL_EMAC_TX_TIMEOUT from 0.05*HZ to 2*HZ - Rebased patchset on v5.12-rc3 Cristian Ciocaltea (3): dt-bindings: net: Add Actions Semi Owl Ethernet MAC binding net: ethernet: actions: Add Actions Semi Owl Ethernet MAC driver MAINTAINERS: Add entries for Actions Semi Owl Ethernet MAC .../bindings/net/actions,owl-emac.yaml | 92 + MAINTAINERS | 2 + drivers/net/ethernet/Kconfig | 1 + drivers/net/ethernet/Makefile | 1 + drivers/net/ethernet/actions/Kconfig | 39 + drivers/net/ethernet/actions/Makefile | 6 + drivers/net/ethernet/actions/owl-emac.c | 1703 +++++++++++++++++ drivers/net/ethernet/actions/owl-emac.h | 280 +++ 8 files changed, 2124 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/actions,owl-emac.yaml create mode 100644 drivers/net/ethernet/actions/Kconfig create mode 100644 drivers/net/ethernet/actions/Makefile create mode 100644 drivers/net/ethernet/actions/owl-emac.c create mode 100644 drivers/net/ethernet/actions/owl-emac.h