From patchwork Thu Nov 29 22:25:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= X-Patchwork-Id: 1005691 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="TCHh0UEG"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 435XD902Hzz9s9G for ; Fri, 30 Nov 2018 09:26:00 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id A7B9EC224EE; Thu, 29 Nov 2018 22:25:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id A82A7C2249C; Thu, 29 Nov 2018 22:25:52 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id C9C0FC2249C; Thu, 29 Nov 2018 22:25:51 +0000 (UTC) Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by lists.denx.de (Postfix) with ESMTPS id 719F3C223CE for ; Thu, 29 Nov 2018 22:25:51 +0000 (UTC) Received: by mail-wm1-f66.google.com with SMTP id z18so3893983wmc.4 for ; Thu, 29 Nov 2018 14:25:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GtFMOL6LD85bp///RZSTVpqXsYrycimRpeEZUNyx8c4=; b=TCHh0UEGST6ed8ckfeshLJW+dZ9TeCF3gPltiINySpfddOh+6nYs9gsRdaLtiUCU2F d41e1LhpFFwx21CFq008pt9aqLs72OPbfKEt6FUDV9FXZE6gT3JBZnNICNHbWSvVbHD0 poIl6youk3o2HyPhgSRaNiZwvv8ZbR2+sxdtui0hJWRoBdHkJ4hbE/r+xlOj3PXTp/Yc w1hM64niB2Wz6dHomt1m765AWW2wrJnZbX6+4vRAc0VXSQ1W+eAEyhenkqPFZBwdLd7I 9ImS/zMEpmhPXERkh0kqIJSuM89v8WiagWb8g2s4FETPWoop8ejTwtzxmrsVjP1p0TP7 wVxg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=GtFMOL6LD85bp///RZSTVpqXsYrycimRpeEZUNyx8c4=; b=UytboWjZ7UHVIYowHxCqQM128UB5Z0MgeD9VW+3y5P4THCMb01anitWXdb4ErsRXPr 5hXibxZunmcVbmZzGtvcJqfpr+OsDkxpC96fjgBoA/8lDApxZ4cV8G5YeFuHehe+EcdK aCeUueQlNY5Sv3oAKH4P/M7O8tblogAB3anuNSey6KZJamWS/yQE6sPqUvf4SN7F8qPp I5yhKvTBEvo9oWJsuTfItZCMx8L3l1kkEcGVuStQNsZBfrsgFGXqPsXlzkn/OIYzJdzp w/5foJkbyWyZteHefQRMUKQkEbCMa3xgwYc2VVR8FOSoHo/w/TKjcvBeOqbv8cd4LYRp S/0w== X-Gm-Message-State: AA+aEWbAlR18a5olltoefRaxV09jOrFEwQXndVjF0RlKqbk192b8CCAd NQGecy6OLK2LkJPXD4/0MNbWe1BE X-Google-Smtp-Source: AFSGD/VCRvoWnJHXbPxUTrXor1yFCLi36+cu0Fp5TYtKj2mF31A2duHg+jJYctHNJXFN4r20SGZIXA== X-Received: by 2002:a1c:2007:: with SMTP id g7mr3198829wmg.79.1543530350807; Thu, 29 Nov 2018 14:25:50 -0800 (PST) Received: from skynet.lan (8.red-88-1-21.dynamicip.rima-tde.net. [88.1.21.8]) by smtp.gmail.com with ESMTPSA id y13sm2022043wrw.85.2018.11.29.14.25.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Nov 2018 14:25:50 -0800 (PST) From: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= To: u-boot@lists.denx.de, grygorii.strashko@ti.com, joe.hershberger@ni.com, lokeshvutla@ti.com, trini@konsulko.com, sjg@chromium.org, jagan@openedev.com, daniel.schwierzeck@gmail.com, vigneshr@ti.com Date: Thu, 29 Nov 2018 23:25:18 +0100 Message-Id: <20181129222546.24977-1-noltari@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181128182349.10330-1-noltari@gmail.com> References: <20181128182349.10330-1-noltari@gmail.com> MIME-Version: 1.0 Subject: [U-Boot] [PATCH v10 00/28] bmips: add iudma/enet support X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" In order to add bcm6348-enet support, dma-uclass must be extended to support dma channels and reworked to operate like the other dm uclass (clk, reset...). v10: Introduce changes suggested by Daniel Schwierzeck: - Fix license identifiers. bcm6348-iudma: - Move DMAD_ST defines out of dma desc struct definition. - Remove unneded aigned attribute from dma desc struct definition. - Fill dma ring from consumer driver instead of allocating a new buffer. - Correctly check clock/reset errors while probing. - Switch to live DM live tree. bcm6348-enet: - Remove packet queue. - Move dma_prepare_rcv_buf to free_pkt. - Switch to live DM live tree. bcm6368-enet: - Remove packet queue. - Move dma_prepare_rcv_buf to free_pkt. - Pad packets smaller than ETH_ZLEN. - Switch to live DM live tree. v9: Separate generic dma channels support from bmips enet support bcm6348-iudma: - bcm6348_iudma_chan_stop: switch to mdelay when resetting channel. - bcm6348_iudma_receive: track dirty dma descriptors and no longer trigger dma rx channel. - bcm6348_iudma_send: reorder to properly flush cache and set dma descriptor config. - bcm6348_iudma_prepare_rcv_buf: implemented to clear dirty dma descriptors. bcm6348-enet: - bcm6348_eth_recv: clear dirty dma descriptors only when packets are copied from rx dma. - bcm6348_eth_send: remove dma rx channel reset when sending packet. bcm6368-enet: - introduce rx packets caching functionality from bcm6348-eth to fix flow control issues. - code style fixes. v8: Introduce bcm6368-enet driver support. v5: Fix issues reported by Grygorii Strashko and other fixes: - Remove unused bcm6348-iudma defines. - Increment bcm6348-iudma rx descriptors. - Fix bcm6348-iudma flow control issues. - bcm6348-iudma error checking now depends on hw. - Remove unneeded bcm6348-iudma interrupts. - Receive as much packets as possible from bcm6348-eth and cache them in net_rx_packets. This is needed in order to fix flow control issues. v4: Fix issues reported by Grygorii Strashko and other fixes: - Remove usage of net_rx_packets as buffer from bcm6348-iudma. - Allocate dynamic rx buffer on bcm6348-iudma. - Copy received dma buffer to net_rx_packets in order to avoid possible dma overwrites. - Check dma errors and discard invalid packets. - Reset dma rx channel when sending a new packet to prevent flow control issues. - Fix packet casting on bcm6348_eth_recv/send. v3: Switch to live tree API. v2: Fix bcm6348-iudma rx burst config. Álvaro Fernández Rojas (28): dma: add bcm6348-iudma support bmips: bcm6338: add bcm6348-iudma support bmips: bcm6348: add bcm6348-iudma support bmips: bcm6358: add bcm6348-iudma support bmips: bcm6368: add bcm6348-iudma support bmips: bcm6328: add bcm6348-iudma support bmips: bcm6362: add bcm6348-iudma support bmips: bcm63268: add bcm6348-iudma support bmips: bcm6318: add bcm6348-iudma support net: add support for bcm6348-enet bmips: bcm6338: add support for bcm6348-enet bmips: enable f@st1704 enet support bmips: bcm6348: add support for bcm6348-enet bmips: enable ct-5361 enet support bmips: bcm6358: add support for bcm6348-enet bmips: enable hg556a enet support bmips: enable nb4-ser enet support net: add support for bcm6368-enet bmips: bcm6368: add support for bcm6368-enet bmips: enable wap-5813n enet support bmips: bcm6328: add support for bcm6368-enet bmips: enable ar-5387un enet support bmips: bcm6362: add support for bcm6368-enet bmips: enable dgnd3700v2 enet support bmips: bcm63268: add support for bcm6368-enet bmips: enable vr-3032u enet support bmips: bcm6318: add support for bcm6368-enet bmips: enable ar-5315u enet support arch/mips/dts/brcm,bcm6318.dtsi | 38 ++ arch/mips/dts/brcm,bcm63268.dtsi | 38 ++ arch/mips/dts/brcm,bcm6328.dtsi | 30 ++ arch/mips/dts/brcm,bcm6338.dtsi | 29 ++ arch/mips/dts/brcm,bcm6348.dtsi | 42 ++ arch/mips/dts/brcm,bcm6358.dtsi | 46 +++ arch/mips/dts/brcm,bcm6362.dtsi | 32 ++ arch/mips/dts/brcm,bcm6368.dtsi | 32 ++ arch/mips/dts/comtrend,ar-5315u.dts | 32 ++ arch/mips/dts/comtrend,ar-5387un.dts | 32 ++ arch/mips/dts/comtrend,ct-5361.dts | 12 + arch/mips/dts/comtrend,vr-3032u.dts | 32 ++ arch/mips/dts/comtrend,wap-5813n.dts | 14 + arch/mips/dts/huawei,hg556a.dts | 12 + arch/mips/dts/netgear,dgnd3700v2.dts | 14 + arch/mips/dts/sagem,f@st1704.dts | 12 + arch/mips/dts/sfr,nb4-ser.dts | 24 ++ configs/comtrend_ar5315u_ram_defconfig | 7 +- configs/comtrend_ar5387un_ram_defconfig | 7 +- configs/comtrend_ct5361_ram_defconfig | 8 +- configs/comtrend_vr3032u_ram_defconfig | 7 +- configs/comtrend_wap5813n_ram_defconfig | 8 +- configs/huawei_hg556a_ram_defconfig | 8 +- configs/netgear_dgnd3700v2_ram_defconfig | 8 +- configs/sagem_f@st1704_ram_defconfig | 8 +- configs/sfr_nb4-ser_ram_defconfig | 8 +- drivers/dma/Kconfig | 9 + drivers/dma/Makefile | 1 + drivers/dma/bcm6348-iudma.c | 642 ++++++++++++++++++++++++++++++ drivers/net/Kconfig | 18 + drivers/net/Makefile | 2 + drivers/net/bcm6348-eth.c | 537 +++++++++++++++++++++++++ drivers/net/bcm6368-eth.c | 625 +++++++++++++++++++++++++++++ include/configs/bmips_common.h | 6 +- include/dt-bindings/clock/bcm6318-clock.h | 11 + include/dt-bindings/dma/bcm6318-dma.h | 14 + include/dt-bindings/dma/bcm63268-dma.h | 14 + include/dt-bindings/dma/bcm6328-dma.h | 14 + include/dt-bindings/dma/bcm6338-dma.h | 14 + include/dt-bindings/dma/bcm6348-dma.h | 16 + include/dt-bindings/dma/bcm6358-dma.h | 16 + include/dt-bindings/dma/bcm6362-dma.h | 14 + include/dt-bindings/dma/bcm6368-dma.h | 14 + 43 files changed, 2497 insertions(+), 10 deletions(-) create mode 100644 drivers/dma/bcm6348-iudma.c create mode 100644 drivers/net/bcm6348-eth.c create mode 100644 drivers/net/bcm6368-eth.c create mode 100644 include/dt-bindings/dma/bcm6318-dma.h create mode 100644 include/dt-bindings/dma/bcm63268-dma.h create mode 100644 include/dt-bindings/dma/bcm6328-dma.h create mode 100644 include/dt-bindings/dma/bcm6338-dma.h create mode 100644 include/dt-bindings/dma/bcm6348-dma.h create mode 100644 include/dt-bindings/dma/bcm6358-dma.h create mode 100644 include/dt-bindings/dma/bcm6362-dma.h create mode 100644 include/dt-bindings/dma/bcm6368-dma.h