All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] Update register/bit definitions in the EtherAVB driver
@ 2021-01-06 20:30 Sergey Shtylyov
  2021-01-06 20:31 ` [PATCH net-next 1/2] ravb: remove APSR_DM Sergey Shtylyov
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Sergey Shtylyov @ 2021-01-06 20:30 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski, netdev; +Cc: linux-renesas-soc

Here are 2 patches against DaveM's 'net-next' repo. I'm updating the driver to match
the recent R-Car gen2/3 manuals...

[1/2] ravb: remove APSR_DM
[2/2] ravb: update "undocumented" annotations

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH net-next 1/2] ravb: remove APSR_DM
  2021-01-06 20:30 [PATCH net-next 0/2] Update register/bit definitions in the EtherAVB driver Sergey Shtylyov
@ 2021-01-06 20:31 ` Sergey Shtylyov
  2021-01-07  9:37   ` Geert Uytterhoeven
  2021-01-06 20:32 ` [PATCH net-next 2/2] ravb: update "undocumented" annotations Sergey Shtylyov
  2021-01-09  2:40 ` [PATCH net-next 0/2] Update register/bit definitions in the EtherAVB driver Jakub Kicinski
  2 siblings, 1 reply; 5+ messages in thread
From: Sergey Shtylyov @ 2021-01-06 20:31 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski, netdev; +Cc: linux-renesas-soc

According to the R-Car Series, 3rd Generation User's Manual: Hardware,
Rev. 1.50, there's no APSR.DM field, instead therea are 2 independent
RX/TX clock internal delay bits.  Follow the suit: remove #define APSR_DM
and rename #define's APSR_DM_{R|T}DM to APSR_{R|T}DM.

While at it, do several more things to the declaration of *enum* APSR_BIT:
- remove superfluous indentation;
- annotate APSR_MEMS as undocumented;
- annotate APSR as R-Car Gen3 only.

Fixes: 61fccb2d6274 ("ravb: Add tx and rx clock internal delays mode of APSR")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omprussia.ru>

---
 drivers/net/ethernet/renesas/ravb.h      |   11 +++++------
 drivers/net/ethernet/renesas/ravb_main.c |    6 +++---
 2 files changed, 8 insertions(+), 9 deletions(-)

Index: net-next/drivers/net/ethernet/renesas/ravb.h
===================================================================
--- net-next.orig/drivers/net/ethernet/renesas/ravb.h
+++ net-next/drivers/net/ethernet/renesas/ravb.h
@@ -241,13 +241,12 @@ enum ESR_BIT {
 	ESR_EIL		= 0x00001000,
 };
 
-/* APSR */
+/* APSR (R-Car Gen3 only) */
 enum APSR_BIT {
-	APSR_MEMS		= 0x00000002,
-	APSR_CMSW		= 0x00000010,
-	APSR_DM			= 0x00006000,	/* Undocumented? */
-	APSR_DM_RDM		= 0x00002000,
-	APSR_DM_TDM		= 0x00004000,
+	APSR_MEMS	= 0x00000002,	/* Undocumented */
+	APSR_CMSW	= 0x00000010,
+	APSR_RDM	= 0x00002000,
+	APSR_TDM	= 0x00004000,
 };
 
 /* RCR */
Index: net-next/drivers/net/ethernet/renesas/ravb_main.c
===================================================================
--- net-next.orig/drivers/net/ethernet/renesas/ravb_main.c
+++ net-next/drivers/net/ethernet/renesas/ravb_main.c
@@ -2034,10 +2034,10 @@ static void ravb_set_delay_mode(struct n
 	u32 set = 0;
 
 	if (priv->rxcidm)
-		set |= APSR_DM_RDM;
+		set |= APSR_RDM;
 	if (priv->txcidm)
-		set |= APSR_DM_TDM;
-	ravb_modify(ndev, APSR, APSR_DM, set);
+		set |= APSR_TDM;
+	ravb_modify(ndev, APSR, APSR_RDM | APSR_TDM, set);
 }
 
 static int ravb_probe(struct platform_device *pdev)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH net-next 2/2] ravb: update "undocumented" annotations
  2021-01-06 20:30 [PATCH net-next 0/2] Update register/bit definitions in the EtherAVB driver Sergey Shtylyov
  2021-01-06 20:31 ` [PATCH net-next 1/2] ravb: remove APSR_DM Sergey Shtylyov
@ 2021-01-06 20:32 ` Sergey Shtylyov
  2021-01-09  2:40 ` [PATCH net-next 0/2] Update register/bit definitions in the EtherAVB driver Jakub Kicinski
  2 siblings, 0 replies; 5+ messages in thread
From: Sergey Shtylyov @ 2021-01-06 20:32 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski, netdev; +Cc: linux-renesas-soc

The "undocumented" annotations in the EtherAVB driver were done against
the R-Car gen2 manuals; most of these registers/bits were then described
in the R-Car gen3 manuals -- reflect  this fact in the annotations (note
that ECSIPR.LCHNGIP was documented in the recent R-Car gen2 manual)...

Signed-off-by: Sergey Shtylyov <s.shtylyov@omprussia.ru>

---
 drivers/net/ethernet/renesas/ravb.h |   26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

Index: net-next/drivers/net/ethernet/renesas/ravb.h
===================================================================
--- net-next.orig/drivers/net/ethernet/renesas/ravb.h
+++ net-next/drivers/net/ethernet/renesas/ravb.h
@@ -165,7 +165,7 @@ enum ravb_reg {
 	GTO2	= 0x03A8,
 	GIC	= 0x03AC,
 	GIS	= 0x03B0,
-	GCPT	= 0x03B4,	/* Undocumented? */
+	GCPT	= 0x03B4,	/* Documented for R-Car Gen3 only */
 	GCT0	= 0x03B8,
 	GCT1	= 0x03BC,
 	GCT2	= 0x03C0,
@@ -225,7 +225,7 @@ enum CSR_BIT {
 	CSR_OPS_RESET	= 0x00000001,
 	CSR_OPS_CONFIG	= 0x00000002,
 	CSR_OPS_OPERATION = 0x00000004,
-	CSR_OPS_STANDBY	= 0x00000008,	/* Undocumented? */
+	CSR_OPS_STANDBY	= 0x00000008,	/* Documented for R-Car Gen3 only */
 	CSR_DTS		= 0x00000100,
 	CSR_TPO0	= 0x00010000,
 	CSR_TPO1	= 0x00020000,
@@ -529,16 +529,16 @@ enum RIS2_BIT {
 
 /* TIC */
 enum TIC_BIT {
-	TIC_FTE0	= 0x00000001,	/* Undocumented? */
-	TIC_FTE1	= 0x00000002,	/* Undocumented? */
+	TIC_FTE0	= 0x00000001,	/* Documented for R-Car Gen3 only */
+	TIC_FTE1	= 0x00000002,	/* Documented for R-Car Gen3 only */
 	TIC_TFUE	= 0x00000100,
 	TIC_TFWE	= 0x00000200,
 };
 
 /* TIS */
 enum TIS_BIT {
-	TIS_FTF0	= 0x00000001,	/* Undocumented? */
-	TIS_FTF1	= 0x00000002,	/* Undocumented? */
+	TIS_FTF0	= 0x00000001,	/* Documented for R-Car Gen3 only */
+	TIS_FTF1	= 0x00000002,	/* Documented for R-Car Gen3 only */
 	TIS_TFUF	= 0x00000100,
 	TIS_TFWF	= 0x00000200,
 	TIS_RESERVED	= (GENMASK(31, 20) | GENMASK(15, 12) | GENMASK(7, 4))
@@ -546,8 +546,8 @@ enum TIS_BIT {
 
 /* ISS */
 enum ISS_BIT {
-	ISS_FRS		= 0x00000001,	/* Undocumented? */
-	ISS_FTS		= 0x00000004,	/* Undocumented? */
+	ISS_FRS		= 0x00000001,	/* Documented for R-Car Gen3 only */
+	ISS_FTS		= 0x00000004,	/* Documented for R-Car Gen3 only */
 	ISS_ES		= 0x00000040,
 	ISS_MS		= 0x00000080,
 	ISS_TFUS	= 0x00000100,
@@ -607,13 +607,13 @@ enum GTI_BIT {
 
 /* GIC */
 enum GIC_BIT {
-	GIC_PTCE	= 0x00000001,	/* Undocumented? */
+	GIC_PTCE	= 0x00000001,	/* Documented for R-Car Gen3 only */
 	GIC_PTME	= 0x00000004,
 };
 
 /* GIS */
 enum GIS_BIT {
-	GIS_PTCF	= 0x00000001,	/* Undocumented? */
+	GIS_PTCF	= 0x00000001,	/* Documented for R-Car Gen3 only */
 	GIS_PTMF	= 0x00000004,
 	GIS_RESERVED	= GENMASK(15, 10),
 };
@@ -807,10 +807,10 @@ enum ECMR_BIT {
 	ECMR_TE		= 0x00000020,
 	ECMR_RE		= 0x00000040,
 	ECMR_MPDE	= 0x00000200,
-	ECMR_TXF	= 0x00010000,	/* Undocumented? */
+	ECMR_TXF	= 0x00010000,	/* Documented for R-Car Gen3 only */
 	ECMR_RXF	= 0x00020000,
 	ECMR_PFR	= 0x00040000,
-	ECMR_ZPF	= 0x00080000,	/* Undocumented? */
+	ECMR_ZPF	= 0x00080000,	/* Documented for R-Car Gen3 only */
 	ECMR_RZPF	= 0x00100000,
 	ECMR_DPAD	= 0x00200000,
 	ECMR_RCSC	= 0x00800000,
@@ -829,7 +829,7 @@ enum ECSR_BIT {
 enum ECSIPR_BIT {
 	ECSIPR_ICDIP	= 0x00000001,
 	ECSIPR_MPDIP	= 0x00000002,
-	ECSIPR_LCHNGIP	= 0x00000004,	/* Undocumented? */
+	ECSIPR_LCHNGIP	= 0x00000004,
 };
 
 /* PIR */

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next 1/2] ravb: remove APSR_DM
  2021-01-06 20:31 ` [PATCH net-next 1/2] ravb: remove APSR_DM Sergey Shtylyov
@ 2021-01-07  9:37   ` Geert Uytterhoeven
  0 siblings, 0 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2021-01-07  9:37 UTC (permalink / raw)
  To: Sergey Shtylyov; +Cc: David S. Miller, Jakub Kicinski, netdev, Linux-Renesas

On Wed, Jan 6, 2021 at 9:43 PM Sergey Shtylyov <s.shtylyov@omprussia.ru> wrote:
> According to the R-Car Series, 3rd Generation User's Manual: Hardware,
> Rev. 1.50, there's no APSR.DM field, instead therea are 2 independent

there

> RX/TX clock internal delay bits.  Follow the suit: remove #define APSR_DM
> and rename #define's APSR_DM_{R|T}DM to APSR_{R|T}DM.
>
> While at it, do several more things to the declaration of *enum* APSR_BIT:
> - remove superfluous indentation;
> - annotate APSR_MEMS as undocumented;
> - annotate APSR as R-Car Gen3 only.
>
> Fixes: 61fccb2d6274 ("ravb: Add tx and rx clock internal delays mode of APSR")
> Signed-off-by: Sergey Shtylyov <s.shtylyov@omprussia.ru>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next 0/2] Update register/bit definitions in the EtherAVB driver
  2021-01-06 20:30 [PATCH net-next 0/2] Update register/bit definitions in the EtherAVB driver Sergey Shtylyov
  2021-01-06 20:31 ` [PATCH net-next 1/2] ravb: remove APSR_DM Sergey Shtylyov
  2021-01-06 20:32 ` [PATCH net-next 2/2] ravb: update "undocumented" annotations Sergey Shtylyov
@ 2021-01-09  2:40 ` Jakub Kicinski
  2 siblings, 0 replies; 5+ messages in thread
From: Jakub Kicinski @ 2021-01-09  2:40 UTC (permalink / raw)
  To: Sergey Shtylyov; +Cc: David S. Miller, netdev, linux-renesas-soc

On Wed, 6 Jan 2021 23:30:42 +0300 Sergey Shtylyov wrote:
> Here are 2 patches against DaveM's 'net-next' repo. I'm updating the driver to match
> the recent R-Car gen2/3 manuals...

Applied, thanks, but I dropped the Fixes tag from patch 1.
Patch which makes no functional changes can't be fixing things.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-01-09  2:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-06 20:30 [PATCH net-next 0/2] Update register/bit definitions in the EtherAVB driver Sergey Shtylyov
2021-01-06 20:31 ` [PATCH net-next 1/2] ravb: remove APSR_DM Sergey Shtylyov
2021-01-07  9:37   ` Geert Uytterhoeven
2021-01-06 20:32 ` [PATCH net-next 2/2] ravb: update "undocumented" annotations Sergey Shtylyov
2021-01-09  2:40 ` [PATCH net-next 0/2] Update register/bit definitions in the EtherAVB driver Jakub Kicinski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.