From patchwork Fri Nov 17 16:43:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 13459147 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ragnatech-se.20230601.gappssmtp.com header.i=@ragnatech-se.20230601.gappssmtp.com header.b="yc59Asu5" Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80875A4 for ; Fri, 17 Nov 2023 08:44:55 -0800 (PST) Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-32f78dcf036so2076488f8f.0 for ; Fri, 17 Nov 2023 08:44:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ragnatech-se.20230601.gappssmtp.com; s=20230601; t=1700239494; x=1700844294; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ViJzBZRjaGwQoSegbb0M2YrA8tvFsmfs+BtclsFM6Iw=; b=yc59Asu5dsxUDXwsCNPO2feuNhlmEkKtQFV3Nkyf/5dAVjlyTb2Y9dIfbHwdRQvQ3B 6Ei0ynY4CLUt9d5N83otKNQKmyxe8HIVgOI9EHS+tjOikFI0rDCc1vG2e9hlVsOw286b 48Su5hOIOlVAxMNdyVYrUCRbSUK49vKAfDM5SMdk4EJzdTDNxxEbcltwsTA4RhzJnp2p miWF32rG/3wXRmUkNJu9umD9aS3+i7tRchkcjudCixljYMMvgH/hvnRbYD3ktjcQ89tw 6d6z5xige0DaExYmSwy5djDSUFQr++l3euX3LD/j8e/D2MWIW5O2EMZOV+O6vSh2lYaE 6vwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700239494; x=1700844294; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ViJzBZRjaGwQoSegbb0M2YrA8tvFsmfs+BtclsFM6Iw=; b=jwz2EM+XXlccAbG11sclEcNRO4o54KhI4bIH1cO4g49NLTeRXjwtZmwBdjrzWJ2aIq so///lZdwRihohLzlzemJ/rEIND3EbcrkcUZL2IYawLVxfdki0etQQbzsuLz6pwgqDJg ZmA4wPxnRDOQbaAQZyfluF4SYB5pndXczVPAPxP3fUCW2EEW5D7xr7m+eWa7FUtt97I3 XrA26qvztxnjsu6OGvHhAfMZrfmo/hwETujveBmbrmluTV9L7XRpYNRzmeEAxNdHuRmT ue/POI25BBjlV+Dr2PRTili9wLmZ7BUKwJlJ/8KwAxn+aM3zeL3dTNFjhftIU60aaGaE WswQ== X-Gm-Message-State: AOJu0Yyjk/2jqt1GGq+uF1XVBEcVz9Vmr4f1PzOPNlbLfVtGl/lso82N s5PnSEWUaEbDu9OJNsCaCao4fg== X-Google-Smtp-Source: AGHT+IELqDZJhNF3w4cCSF7Pe3KNy3G2/C2ag2xOQm2boFEouK1cJqrXmqQKscXXkk/+QTrSuuJpjA== X-Received: by 2002:a5d:47ab:0:b0:31d:caae:982d with SMTP id 11-20020a5d47ab000000b0031dcaae982dmr5929283wrb.12.1700239494093; Fri, 17 Nov 2023 08:44:54 -0800 (PST) Received: from sleipner.berto.se (p4fcc8a96.dip0.t-ipconnect.de. [79.204.138.150]) by smtp.googlemail.com with ESMTPSA id y10-20020adfee0a000000b0032dcb08bf94sm2791947wrn.60.2023.11.17.08.44.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 08:44:53 -0800 (PST) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Richard Cochran , netdev@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, =?utf-8?q?Niklas_S=C3=B6derlund?= Subject: [net-next 1/5] net: ethernet: renesas: rcar_gen4_ptp: Remove incorrect comment Date: Fri, 17 Nov 2023 17:43:28 +0100 Message-ID: <20231117164332.354443-2-niklas.soderlund+renesas@ragnatech.se> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20231117164332.354443-1-niklas.soderlund+renesas@ragnatech.se> References: <20231117164332.354443-1-niklas.soderlund+renesas@ragnatech.se> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org The comments intent was to indicates which function uses the enum. While upstreaming rcar_gen4_ptp the function was renamed but this comment was left with the old function name. Instead of correcting the comment remove it, it adds little value. Signed-off-by: Niklas Söderlund Reviewed-by: Wolfram Sang --- drivers/net/ethernet/renesas/rcar_gen4_ptp.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/ethernet/renesas/rcar_gen4_ptp.h b/drivers/net/ethernet/renesas/rcar_gen4_ptp.h index b1bbea8d3a52..9f148110df66 100644 --- a/drivers/net/ethernet/renesas/rcar_gen4_ptp.h +++ b/drivers/net/ethernet/renesas/rcar_gen4_ptp.h @@ -13,7 +13,6 @@ #define RCAR_GEN4_PTP_CLOCK_S4 PTPTIVC_INIT #define RCAR_GEN4_GPTP_OFFSET_S4 0x00018000 -/* for rcar_gen4_ptp_init */ enum rcar_gen4_ptp_reg_layout { RCAR_GEN4_PTP_REG_LAYOUT_S4 }; From patchwork Fri Nov 17 16:43:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 13459148 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ragnatech-se.20230601.gappssmtp.com header.i=@ragnatech-se.20230601.gappssmtp.com header.b="f37EjEfk" Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C481D4B for ; Fri, 17 Nov 2023 08:44:56 -0800 (PST) Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-32d9effe314so1539831f8f.3 for ; Fri, 17 Nov 2023 08:44:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ragnatech-se.20230601.gappssmtp.com; s=20230601; t=1700239495; x=1700844295; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1ctuwvPDSa9uZCOLTfAErk4+6RVQpToW66kimL2TEOU=; b=f37EjEfkE2wE5wUT9b42TZ3b4S5lw9tQqiI9n/Qdsq4nkhdUGrZ8+GZLO75m/prkvb 2GOOFipeStAbRuqyTH3opTZZw4UXkuLhCYdDApddyeOofgYiA9k/p7S6b8caHxv2SH1N yXBff1U+AOcNsLF0K0bCHtUHBDe+3FJfxh9DjoB1LzZeQqRkuh8o3pu6lJEAcRGbBPgM pg48sJISzmAHtNO2orwmrb4MyHUREvv3fdtEQ/rjr5YzeH9c41rtzrUrocOB/VHif53H akOB79NDJaS2Wwg/xNLwte6xYBYcwsMayReT0G4ZxlU+wqA6rAw49t/9sJc42KafWlF6 WDbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700239495; x=1700844295; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1ctuwvPDSa9uZCOLTfAErk4+6RVQpToW66kimL2TEOU=; b=tY7qOvfooSzqw0+7eUgUIxlOGxNS6FhSHBHkL6eFzH5rXbJEHwPTv71TCSMQjzT1k0 HnQKBWS/A4NFm0vsOnLxz+LxheKpDnC1FTHLl7yUnCch5l2v1wJfjq09ZwW0z4oZ2tIg 7ldbcQzsl+/x6gJZTNktXVksn8CNtbuR8jFBOFKdeNULRzCACFovBdo1+w3fe8vt//Zf hxNdvcH0MzNh+lTulAs2rdhp9jXgzriDooxegixLsuCHz3LrB/YRZFPAeJKs4nMbx3Jt w3rPcv6l+sGFiq/gY5sk1L56shgbOR37fmyKFFp8FAf0JrKZy2KeohzY3a0cUwMRoEjx uudA== X-Gm-Message-State: AOJu0YyLm3h50cbrraMYgGAsx3qgxpFyVNy54qvvbQVyla9ebjERilhq ALL6s0sWYQucIN3uWR6nGQzNfg== X-Google-Smtp-Source: AGHT+IEki3Odc/z/NMe7thygFDWVaCnOECdby64FFzQDj/s/3i2E+SLxm5CPlx0cuO47pXuLEZtQgw== X-Received: by 2002:a5d:548f:0:b0:32f:88e8:b8d1 with SMTP id h15-20020a5d548f000000b0032f88e8b8d1mr12969140wrv.13.1700239494955; Fri, 17 Nov 2023 08:44:54 -0800 (PST) Received: from sleipner.berto.se (p4fcc8a96.dip0.t-ipconnect.de. [79.204.138.150]) by smtp.googlemail.com with ESMTPSA id y10-20020adfee0a000000b0032dcb08bf94sm2791947wrn.60.2023.11.17.08.44.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 08:44:54 -0800 (PST) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Richard Cochran , netdev@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, =?utf-8?q?Niklas_S=C3=B6derlund?= Subject: [net-next 2/5] net: ethernet: renesas: rcar_gen4_ptp: Fail on unknown register layout Date: Fri, 17 Nov 2023 17:43:29 +0100 Message-ID: <20231117164332.354443-3-niklas.soderlund+renesas@ragnatech.se> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20231117164332.354443-1-niklas.soderlund+renesas@ragnatech.se> References: <20231117164332.354443-1-niklas.soderlund+renesas@ragnatech.se> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Instead of printing a warning and proceeding with an unknown register layout return an error. The only call site is already prepared to propagate the error. Signed-off-by: Niklas Söderlund Reviewed-by: Wolfram Sang --- drivers/net/ethernet/renesas/rcar_gen4_ptp.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/renesas/rcar_gen4_ptp.c b/drivers/net/ethernet/renesas/rcar_gen4_ptp.c index c007e33c47e1..443ca5a18703 100644 --- a/drivers/net/ethernet/renesas/rcar_gen4_ptp.c +++ b/drivers/net/ethernet/renesas/rcar_gen4_ptp.c @@ -130,23 +130,30 @@ static struct ptp_clock_info rcar_gen4_ptp_info = { .enable = rcar_gen4_ptp_enable, }; -static void rcar_gen4_ptp_set_offs(struct rcar_gen4_ptp_private *ptp_priv, - enum rcar_gen4_ptp_reg_layout layout) +static int rcar_gen4_ptp_set_offs(struct rcar_gen4_ptp_private *ptp_priv, + enum rcar_gen4_ptp_reg_layout layout) { - WARN_ON(layout != RCAR_GEN4_PTP_REG_LAYOUT_S4); + if (layout != RCAR_GEN4_PTP_REG_LAYOUT_S4) + return -EINVAL; ptp_priv->offs = &s4_offs; + + return 0; } int rcar_gen4_ptp_register(struct rcar_gen4_ptp_private *ptp_priv, enum rcar_gen4_ptp_reg_layout layout, u32 clock) { + int ret; + if (ptp_priv->initialized) return 0; spin_lock_init(&ptp_priv->lock); - rcar_gen4_ptp_set_offs(ptp_priv, layout); + ret = rcar_gen4_ptp_set_offs(ptp_priv, layout); + if (ret) + return ret; ptp_priv->default_addend = clock; iowrite32(ptp_priv->default_addend, ptp_priv->addr + ptp_priv->offs->increment); From patchwork Fri Nov 17 16:43:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 13459149 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ragnatech-se.20230601.gappssmtp.com header.i=@ragnatech-se.20230601.gappssmtp.com header.b="ozSvtk17" Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CA37D5E for ; Fri, 17 Nov 2023 08:44:57 -0800 (PST) Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-32f70391608so1321392f8f.2 for ; Fri, 17 Nov 2023 08:44:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ragnatech-se.20230601.gappssmtp.com; s=20230601; t=1700239496; x=1700844296; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=OhPeJT65e+HlTL4GEJcknvOqJIOmP+OVNMnytUlHsfE=; b=ozSvtk17xBLXkMfBwC2qyJJk0GVjTJmr0wWomvIaoviYcwg8IlJ11FZOX6ZtP10K7q gXOC34Y62Y88RPBuNhazpUNJ2EVKID9Q/Y2gt1bs7eV2vzNtlzW0/ngh9IhSq+KtoOCj +2w92g0vDdbTwvy+8hSU1YB1WXHO8X9BX87+h7rb93swmBHeRvTfQmh/x2077IfT+OWs 6c9GMyqOokObymXWRF+aBAgFEPROMRm3mlvq3OOiufeWnuxRzhvLR+5nqai3pXwZEbpH xI9sWaDU91kccDDKaHN98rUdxWCiTiCSz0TLDds+DsAOKQir/iW1eS5ZwB6Xo1aMnpd7 TmyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700239496; x=1700844296; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OhPeJT65e+HlTL4GEJcknvOqJIOmP+OVNMnytUlHsfE=; b=tK9Ft7wsFMx72TL4uSQAXe/m03OgAsdCu9eHv+h5JOzJiPqcAAhVtj+Rwz0iUuiswq MXuxhJ74i7epx4248N6m/pgxD6UbDvuee1OqDyHYIRNe8PBUJfJH7qrtUY0YGg2rGZBC EAyc2ABviKtz/Gs/TDUi9gD0MHls+tu5hbPkz3PPPxIE9ukEy6cVrb1PIVdzU11ZDO4L pHHjOHErVVkdsXSLYK+xGIYGvaMpt+vB9/Cmu1ubcPQTE22To/NGRNRNS90v99VJoz3R 2FSpFLZFn+u/FjYsI7fmowxvhSeO24WjPdoyhUWXmsoAL9bROxMUrcM48S5irIzlrtb2 TD3g== X-Gm-Message-State: AOJu0YzRLj3dmeh2JhiEyIJlnGf6K5mqUOytJlF9vqgQH8O2BHjV83Q6 rWTx2KWIGRyDWjvMljSdfs2wCA== X-Google-Smtp-Source: AGHT+IG4Fo+rQkLIhotw1LTO6yBVUGA+K8V4fgVejBF7yALbeqscuO6QEm4badwj2b9vcfPRno2sDQ== X-Received: by 2002:a05:6000:1a8f:b0:319:8a66:f695 with SMTP id f15-20020a0560001a8f00b003198a66f695mr18194190wry.55.1700239495876; Fri, 17 Nov 2023 08:44:55 -0800 (PST) Received: from sleipner.berto.se (p4fcc8a96.dip0.t-ipconnect.de. [79.204.138.150]) by smtp.googlemail.com with ESMTPSA id y10-20020adfee0a000000b0032dcb08bf94sm2791947wrn.60.2023.11.17.08.44.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 08:44:55 -0800 (PST) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Richard Cochran , netdev@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, =?utf-8?q?Niklas_S=C3=B6derlund?= Subject: [net-next 3/5] net: ethernet: renesas: rcar_gen4_ptp: Prepare for shared register layout Date: Fri, 17 Nov 2023 17:43:30 +0100 Message-ID: <20231117164332.354443-4-niklas.soderlund+renesas@ragnatech.se> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20231117164332.354443-1-niklas.soderlund+renesas@ragnatech.se> References: <20231117164332.354443-1-niklas.soderlund+renesas@ragnatech.se> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org All know R-Car Gen4 SoC share the same register layout, rename the R-Car S4 specific identifiers so they can be shared with the upcoming R-Car V4H support. Signed-off-by: Niklas Söderlund Reviewed-by: Wolfram Sang --- drivers/net/ethernet/renesas/rcar_gen4_ptp.c | 6 +++--- drivers/net/ethernet/renesas/rcar_gen4_ptp.h | 4 ++-- drivers/net/ethernet/renesas/rswitch.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/renesas/rcar_gen4_ptp.c b/drivers/net/ethernet/renesas/rcar_gen4_ptp.c index 443ca5a18703..59f6351e9ae9 100644 --- a/drivers/net/ethernet/renesas/rcar_gen4_ptp.c +++ b/drivers/net/ethernet/renesas/rcar_gen4_ptp.c @@ -14,7 +14,7 @@ #include "rcar_gen4_ptp.h" #define ptp_to_priv(ptp) container_of(ptp, struct rcar_gen4_ptp_private, info) -static const struct rcar_gen4_ptp_reg_offset s4_offs = { +static const struct rcar_gen4_ptp_reg_offset gen4_offs = { .enable = PTPTMEC, .disable = PTPTMDC, .increment = PTPTIVC0, @@ -133,10 +133,10 @@ static struct ptp_clock_info rcar_gen4_ptp_info = { static int rcar_gen4_ptp_set_offs(struct rcar_gen4_ptp_private *ptp_priv, enum rcar_gen4_ptp_reg_layout layout) { - if (layout != RCAR_GEN4_PTP_REG_LAYOUT_S4) + if (layout != RCAR_GEN4_PTP_REG_LAYOUT) return -EINVAL; - ptp_priv->offs = &s4_offs; + ptp_priv->offs = &gen4_offs; return 0; } diff --git a/drivers/net/ethernet/renesas/rcar_gen4_ptp.h b/drivers/net/ethernet/renesas/rcar_gen4_ptp.h index 9f148110df66..35664d1dc472 100644 --- a/drivers/net/ethernet/renesas/rcar_gen4_ptp.h +++ b/drivers/net/ethernet/renesas/rcar_gen4_ptp.h @@ -14,7 +14,7 @@ #define RCAR_GEN4_GPTP_OFFSET_S4 0x00018000 enum rcar_gen4_ptp_reg_layout { - RCAR_GEN4_PTP_REG_LAYOUT_S4 + RCAR_GEN4_PTP_REG_LAYOUT }; /* driver's definitions */ @@ -27,7 +27,7 @@ enum rcar_gen4_ptp_reg_layout { #define PTPRO 0 -enum rcar_gen4_ptp_reg_s4 { +enum rcar_gen4_ptp_reg { PTPTMEC = PTPRO + 0x0010, PTPTMDC = PTPRO + 0x0014, PTPTIVC0 = PTPRO + 0x0020, diff --git a/drivers/net/ethernet/renesas/rswitch.c b/drivers/net/ethernet/renesas/rswitch.c index 43a7795d6591..e1e29a2caf22 100644 --- a/drivers/net/ethernet/renesas/rswitch.c +++ b/drivers/net/ethernet/renesas/rswitch.c @@ -1828,7 +1828,7 @@ static int rswitch_init(struct rswitch_private *priv) rswitch_fwd_init(priv); - err = rcar_gen4_ptp_register(priv->ptp_priv, RCAR_GEN4_PTP_REG_LAYOUT_S4, + err = rcar_gen4_ptp_register(priv->ptp_priv, RCAR_GEN4_PTP_REG_LAYOUT, RCAR_GEN4_PTP_CLOCK_S4); if (err < 0) goto err_ptp_register; From patchwork Fri Nov 17 16:43:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 13459150 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ragnatech-se.20230601.gappssmtp.com header.i=@ragnatech-se.20230601.gappssmtp.com header.b="aSgYT9J5" Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCB58D73 for ; Fri, 17 Nov 2023 08:44:58 -0800 (PST) Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-507a55302e0so3298649e87.0 for ; Fri, 17 Nov 2023 08:44:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ragnatech-se.20230601.gappssmtp.com; s=20230601; t=1700239497; x=1700844297; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XdcFTkjJJKdk2tWc8kj9ugAu+k+ZjoJk+1mRNKldi1E=; b=aSgYT9J5L7HzzuU/AEnOMWA1dxngjgQZBZjqEk8QZr9YVQsZahtX1h/xhYmlCSIb0z uhDupq+nnQaLTVQ/FSaWJwBW+zFoVGb2QDQMsx0Mb4XyqNZmJ5ggW0hy4NF9cxidZdi3 3iodB/uDpVriWXQWVPgylIpjNou+c/+kCnazVXtRuo/vnHbFslVdk/6yEarpGPJSkJSt DYcM7IdqhKAI3znLiUF4JWBPpFX8gquHS4AGeVzLo3QfmFJ0L7NqUfoHQo7GZTCIEpDP p6rp0pGxGxVLeMbjjLTfsFeh8kVO8fCA80l7BTlMaKPsPA75Kl0BJWiEb2+k9aRQy6t3 KA7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700239497; x=1700844297; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XdcFTkjJJKdk2tWc8kj9ugAu+k+ZjoJk+1mRNKldi1E=; b=qwxhsXoKRwraQJn3hTt1pqkP9ARkiEVQ4ctmEfROFSOLORmrFFZYzxmVpRDq7PoYxI 90pfPXiBIGVdVajMbZkQ35e1OQu77daTRjPzDOduqZv9mr4NoRfEQGFZ03PlR1963w67 EFQTx7yhD/5bwiyZxouq4IC3mHjj7l/gxDWuHqdbs84zHS2q2nA7v71Rtpwp0rJlia2P JQzV6xbjevkBcTr7CoEkhPio8G3V4OmuCMzm5hOgtc2choWPO0BzxE1Y4MynTmAh/7VP QvQxC/p1GiQdcsZRZT6w3hMqNIJ/36hK5SJcLrit653XYGWQ10duAASxXBgEXreme1/B HNqQ== X-Gm-Message-State: AOJu0YwYqYAcBmU1kml3EOnaxrJ4arGvCniBFJ7qeEH2NTkgnviZJ0Wl rf235ZNd2+SvS4NyUfjn+jxvZg== X-Google-Smtp-Source: AGHT+IElGFJq6FDin3q1ZNiLN21lTleD22/7v7lYF9GaOGz9+SBbC/qO6c8vYYQwfr8nmi5zNRCp4g== X-Received: by 2002:a05:6512:358f:b0:502:a4f4:ced9 with SMTP id m15-20020a056512358f00b00502a4f4ced9mr52784lfr.62.1700239496893; Fri, 17 Nov 2023 08:44:56 -0800 (PST) Received: from sleipner.berto.se (p4fcc8a96.dip0.t-ipconnect.de. [79.204.138.150]) by smtp.googlemail.com with ESMTPSA id y10-20020adfee0a000000b0032dcb08bf94sm2791947wrn.60.2023.11.17.08.44.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 08:44:56 -0800 (PST) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Richard Cochran , netdev@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, =?utf-8?q?Niklas_S=C3=B6derlund?= Subject: [net-next 4/5] net: ethernet: renesas: rcar_gen4_ptp: Add V4H clock setting Date: Fri, 17 Nov 2023 17:43:31 +0100 Message-ID: <20231117164332.354443-5-niklas.soderlund+renesas@ragnatech.se> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20231117164332.354443-1-niklas.soderlund+renesas@ragnatech.se> References: <20231117164332.354443-1-niklas.soderlund+renesas@ragnatech.se> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org The gPTP clock is different between R-Car S4 and R-Car V4H. In preparation of adding R-Car V4H support define the clock setting. Signed-off-by: Niklas Söderlund --- drivers/net/ethernet/renesas/rcar_gen4_ptp.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/renesas/rcar_gen4_ptp.h b/drivers/net/ethernet/renesas/rcar_gen4_ptp.h index 35664d1dc472..b83a209e9845 100644 --- a/drivers/net/ethernet/renesas/rcar_gen4_ptp.h +++ b/drivers/net/ethernet/renesas/rcar_gen4_ptp.h @@ -9,8 +9,12 @@ #include -#define PTPTIVC_INIT 0x19000000 /* 320MHz */ -#define RCAR_GEN4_PTP_CLOCK_S4 PTPTIVC_INIT +#define PTPTIVC_INIT_200MHZ 0x28000000 /* 200MHz */ +#define PTPTIVC_INIT_320MHZ 0x19000000 /* 320MHz */ + +#define RCAR_GEN4_PTP_CLOCK_S4 PTPTIVC_INIT_320MHZ +#define RCAR_GEN4_PTP_CLOCK_V4H PTPTIVC_INIT_200MHZ + #define RCAR_GEN4_GPTP_OFFSET_S4 0x00018000 enum rcar_gen4_ptp_reg_layout { From patchwork Fri Nov 17 16:43:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 13459152 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ragnatech-se.20230601.gappssmtp.com header.i=@ragnatech-se.20230601.gappssmtp.com header.b="fIHBhpor" Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DBE11AD for ; Fri, 17 Nov 2023 08:44:59 -0800 (PST) Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-4083f613275so18120025e9.2 for ; Fri, 17 Nov 2023 08:44:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ragnatech-se.20230601.gappssmtp.com; s=20230601; t=1700239497; x=1700844297; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tqhIDcxNEg81oFdPwx3lGmpDRXkd6s3pq6VAhH62Gxk=; b=fIHBhpor5yQBD4C3m5U//ND7jXmoWAORkbHKdDfgRq8qyNg9Mj5z3CcL8phF54xrnC lts/P8SqsrcQgKTjOHKDHuL2chKKfs0TWsLREca12lLDZgPuwurLxMRKiIyhkZGaUvxA /3l3NZYeiP74RFye8qi4iy9z0rxE+y0noNFG8qCKTqojXnfqknz2HvGzRMllnAlygq++ oyD8J7IuemIN1ZIfPh5YhrIUNHHCbEQnO8nvBrbXI/5Etxxtgzp3Fm0LzAZg5eHOP2lU kzVwS7YCFtQ33FFogYUmKrZp6Ef0JnVzRS+TJVR1RRMM1raau4Ratd5ehZdnQ7o9SUGj 7vvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700239497; x=1700844297; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tqhIDcxNEg81oFdPwx3lGmpDRXkd6s3pq6VAhH62Gxk=; b=m/MgVGoDqipAbfXRuPxG6uYFuIDEjV0vtih8t5QqGqK4z1gzzd1VMxtJlss5CuNyBx rEMTkTUdPdJt+Nx3PhQHK+tLkTgtRoVFS+IpzPVSGM1bpK0fmhp2wEc4MGFW+utmCWQo lBzegBEvXF7SUdrq2ew1+amvd3pAlbgz+1M07TVFaA14519lRfyOxQBWb++6Xtntgqj1 vtwVwyF23GfsGUOsHiaBWiVvHP6jCYO/UC69WH6Z+kuhL291uuAJsMO0uSeree8Ml2Gz RdAw3NgJKiGImsxQjxbcj6K7eSAiof90sJIjRXtmmZpi3deNI1VJgoxluWrEp+Cp/2bK Vmww== X-Gm-Message-State: AOJu0Ywm5vqgiVk9Hzdz8ROrxLUeyaPk6cQ0rmVoENVWFSOUAsIHiReP tztWeaJqgfMRQzaBz+/WYnVMgw== X-Google-Smtp-Source: AGHT+IG4p40+Ydg5HZ9PFgPm5Au1XiB/mFDgarAZ1T4T0SCPDn/lpNR+oL99K9Mf7CfiWoCzlKqsFQ== X-Received: by 2002:a5d:4085:0:b0:32f:b1ab:ee87 with SMTP id o5-20020a5d4085000000b0032fb1abee87mr12739258wrp.25.1700239497774; Fri, 17 Nov 2023 08:44:57 -0800 (PST) Received: from sleipner.berto.se (p4fcc8a96.dip0.t-ipconnect.de. [79.204.138.150]) by smtp.googlemail.com with ESMTPSA id y10-20020adfee0a000000b0032dcb08bf94sm2791947wrn.60.2023.11.17.08.44.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 08:44:57 -0800 (PST) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Richard Cochran , netdev@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, =?utf-8?q?Niklas_S=C3=B6derlund?= Subject: [net-next 5/5] net: ethernet: renesas: rcar_gen4_ptp: Break out to module Date: Fri, 17 Nov 2023 17:43:32 +0100 Message-ID: <20231117164332.354443-6-niklas.soderlund+renesas@ragnatech.se> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20231117164332.354443-1-niklas.soderlund+renesas@ragnatech.se> References: <20231117164332.354443-1-niklas.soderlund+renesas@ragnatech.se> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org The Gen3 gPTP support will be shared between the existing Renesas Ethernet Switch driver and the upcoming Renesas Ethernet-TSN driver. In preparation for this break out the gPTP support to its own module. Signed-off-by: Niklas Söderlund --- drivers/net/ethernet/renesas/Kconfig | 10 ++++++++++ drivers/net/ethernet/renesas/Makefile | 5 +++-- drivers/net/ethernet/renesas/rcar_gen4_ptp.c | 5 +++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/renesas/Kconfig b/drivers/net/ethernet/renesas/Kconfig index 8ef5b0241e64..4e7d8546abe2 100644 --- a/drivers/net/ethernet/renesas/Kconfig +++ b/drivers/net/ethernet/renesas/Kconfig @@ -44,7 +44,17 @@ config RENESAS_ETHER_SWITCH select CRC32 select MII select PHYLINK + select RENESAS_GEN4_PTP help Renesas Ethernet Switch device driver. +config RENESAS_GEN4_PTP + tristate "Renesas R-Car Gen4 gPTP support" + depends on ARCH_RENESAS || COMPILE_TEST + select CRC32 + select MII + select PHYLIB + help + Renesas R-Car Gen4 gPTP device driver. + endif # NET_VENDOR_RENESAS diff --git a/drivers/net/ethernet/renesas/Makefile b/drivers/net/ethernet/renesas/Makefile index e8fd85b5fe8f..9070acfd6aaf 100644 --- a/drivers/net/ethernet/renesas/Makefile +++ b/drivers/net/ethernet/renesas/Makefile @@ -8,5 +8,6 @@ obj-$(CONFIG_SH_ETH) += sh_eth.o ravb-objs := ravb_main.o ravb_ptp.o obj-$(CONFIG_RAVB) += ravb.o -rswitch_drv-objs := rswitch.o rcar_gen4_ptp.o -obj-$(CONFIG_RENESAS_ETHER_SWITCH) += rswitch_drv.o +obj-$(CONFIG_RENESAS_ETHER_SWITCH) += rswitch.o + +obj-$(CONFIG_RENESAS_GEN4_PTP) += rcar_gen4_ptp.o diff --git a/drivers/net/ethernet/renesas/rcar_gen4_ptp.c b/drivers/net/ethernet/renesas/rcar_gen4_ptp.c index 59f6351e9ae9..22552a8f5430 100644 --- a/drivers/net/ethernet/renesas/rcar_gen4_ptp.c +++ b/drivers/net/ethernet/renesas/rcar_gen4_ptp.c @@ -166,6 +166,7 @@ int rcar_gen4_ptp_register(struct rcar_gen4_ptp_private *ptp_priv, return 0; } +EXPORT_SYMBOL_GPL(rcar_gen4_ptp_register); int rcar_gen4_ptp_unregister(struct rcar_gen4_ptp_private *ptp_priv) { @@ -173,6 +174,7 @@ int rcar_gen4_ptp_unregister(struct rcar_gen4_ptp_private *ptp_priv) return ptp_clock_unregister(ptp_priv->clock); } +EXPORT_SYMBOL_GPL(rcar_gen4_ptp_unregister); struct rcar_gen4_ptp_private *rcar_gen4_ptp_alloc(struct platform_device *pdev) { @@ -186,3 +188,6 @@ struct rcar_gen4_ptp_private *rcar_gen4_ptp_alloc(struct platform_device *pdev) return ptp; } +EXPORT_SYMBOL_GPL(rcar_gen4_ptp_alloc); + +MODULE_LICENSE("GPL");