* [PATCH 0/2] ethtool: stmmac: Fix DMA register dump
@ 2017-06-27 21:51 thor.thayer
2017-06-27 21:51 ` [PATCH 1/2] ethtool: stmmac: Fix Designware ethtool " thor.thayer
2017-06-27 21:51 ` [PATCH 2/2] ethtool: stmmac: Add DMA HW Feature Register thor.thayer
0 siblings, 2 replies; 5+ messages in thread
From: thor.thayer @ 2017-06-27 21:51 UTC (permalink / raw)
To: linville, peppe.cavallaro; +Cc: netdev, Thor Thayer
From: Thor Thayer <thor.thayer@linux.intel.com>
The DMA register dump structure changed which requires this
change to the indexing of the DMA registers.
Also dump the DMA HW Feature Register.
Thor Thayer (2):
ethtool: stmmac: Fix Designware ethtool register dump
ethtool: stmmac: Add DMA HW Feature Register
stmmac.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
--
2.7.4
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] ethtool: stmmac: Fix Designware ethtool register dump
2017-06-27 21:51 [PATCH 0/2] ethtool: stmmac: Fix DMA register dump thor.thayer
@ 2017-06-27 21:51 ` thor.thayer
2017-06-27 21:51 ` [PATCH 2/2] ethtool: stmmac: Add DMA HW Feature Register thor.thayer
1 sibling, 0 replies; 5+ messages in thread
From: thor.thayer @ 2017-06-27 21:51 UTC (permalink / raw)
To: linville, peppe.cavallaro; +Cc: netdev, Thor Thayer
From: Thor Thayer <thor.thayer@linux.intel.com>
The commit fbf68229ffe7 ("net: stmmac: unify registers dumps methods")
modified the register dump to store the DMA registers at the DMA register
offset (0x1000) but ethtool (stmmac.c) looks for the DMA registers after
the MAC registers which is offset 12.
This patch adds the DMA register offset so that indexing is correct.
Signed-off-by: Thor Thayer <thor.thayer@linux.intel.com>
---
stmmac.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/stmmac.c b/stmmac.c
index fb69bfe..e1bb291 100644
--- a/stmmac.c
+++ b/stmmac.c
@@ -14,6 +14,9 @@
#include <string.h>
#include "internal.h"
+/* The DMA Registers start at offset 0x1000 in the DW IP */
+#define DMA_REG_OFFSET (0x1000 / 4)
+
int st_mac100_dump_regs(struct ethtool_drvinfo *info,
struct ethtool_regs *regs)
{
@@ -36,6 +39,7 @@ int st_mac100_dump_regs(struct ethtool_drvinfo *info,
fprintf(stdout, "\n");
fprintf(stdout, "DMA Registers\n");
+ stmmac_reg = (unsigned int *)regs->data + DMA_REG_OFFSET;
for (i = 0; i < 9; i++)
fprintf(stdout, "CSR%d 0x%08X\n", i, *stmmac_reg++);
@@ -59,6 +63,7 @@ int st_gmac_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
fprintf(stdout, "\n");
fprintf(stdout, "DMA Registers\n");
+ stmmac_reg = (unsigned int *)regs->data + DMA_REG_OFFSET;
for (i = 0; i < 22; i++)
fprintf(stdout, "Reg%d 0x%08X\n", i, *stmmac_reg++);
--
2.7.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] ethtool: stmmac: Add DMA HW Feature Register
2017-06-27 21:51 [PATCH 0/2] ethtool: stmmac: Fix DMA register dump thor.thayer
2017-06-27 21:51 ` [PATCH 1/2] ethtool: stmmac: Fix Designware ethtool " thor.thayer
@ 2017-06-27 21:51 ` thor.thayer
2017-06-28 9:03 ` Giuseppe CAVALLARO
1 sibling, 1 reply; 5+ messages in thread
From: thor.thayer @ 2017-06-27 21:51 UTC (permalink / raw)
To: linville, peppe.cavallaro; +Cc: netdev, Thor Thayer
From: Thor Thayer <thor.thayer@linux.intel.com>
This patch adds the DMA HW Feature Register which is at the end
of the DMA registers and is documented in Version 3.70a.
Signed-off-by: Thor Thayer <thor.thayer@linux.intel.com>
---
stmmac.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/stmmac.c b/stmmac.c
index e1bb291..7d7bebd 100644
--- a/stmmac.c
+++ b/stmmac.c
@@ -64,7 +64,7 @@ int st_gmac_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
fprintf(stdout, "\n");
fprintf(stdout, "DMA Registers\n");
stmmac_reg = (unsigned int *)regs->data + DMA_REG_OFFSET;
- for (i = 0; i < 22; i++)
+ for (i = 0; i < 23; i++)
fprintf(stdout, "Reg%d 0x%08X\n", i, *stmmac_reg++);
return 0;
--
2.7.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] ethtool: stmmac: Add DMA HW Feature Register
2017-06-27 21:51 ` [PATCH 2/2] ethtool: stmmac: Add DMA HW Feature Register thor.thayer
@ 2017-06-28 9:03 ` Giuseppe CAVALLARO
2017-06-28 13:25 ` Thor Thayer
0 siblings, 1 reply; 5+ messages in thread
From: Giuseppe CAVALLARO @ 2017-06-28 9:03 UTC (permalink / raw)
To: thor.thayer, linville; +Cc: netdev
On 6/27/2017 11:51 PM, thor.thayer@linux.intel.com wrote:
> From: Thor Thayer <thor.thayer@linux.intel.com>
>
> This patch adds the DMA HW Feature Register which is at the end
> of the DMA registers and is documented in Version 3.70a.
>
> Signed-off-by: Thor Thayer <thor.thayer@linux.intel.com>
> ---
> stmmac.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/stmmac.c b/stmmac.c
> index e1bb291..7d7bebd 100644
> --- a/stmmac.c
> +++ b/stmmac.c
> @@ -64,7 +64,7 @@ int st_gmac_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
> fprintf(stdout, "\n");
> fprintf(stdout, "DMA Registers\n");
> stmmac_reg = (unsigned int *)regs->data + DMA_REG_OFFSET;
> - for (i = 0; i < 22; i++)
> + for (i = 0; i < 23; i++)
thx Thor for these changes, I wonder if you could add a macro instead 23
while doing this kind of changes
Sorry if I didn't it in the past.
the, you can send the series with my Acked-by: Giuseppe Cavallaro
<peppe.cavallaro@st.com>
Regards
peppe
> fprintf(stdout, "Reg%d 0x%08X\n", i, *stmmac_reg++);
>
> return 0;
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] ethtool: stmmac: Add DMA HW Feature Register
2017-06-28 9:03 ` Giuseppe CAVALLARO
@ 2017-06-28 13:25 ` Thor Thayer
0 siblings, 0 replies; 5+ messages in thread
From: Thor Thayer @ 2017-06-28 13:25 UTC (permalink / raw)
To: Giuseppe CAVALLARO, linville; +Cc: netdev
On 06/28/2017 04:03 AM, Giuseppe CAVALLARO wrote:
> On 6/27/2017 11:51 PM, thor.thayer@linux.intel.com wrote:
>> From: Thor Thayer <thor.thayer@linux.intel.com>
>>
>> This patch adds the DMA HW Feature Register which is at the end
>> of the DMA registers and is documented in Version 3.70a.
>>
>> Signed-off-by: Thor Thayer <thor.thayer@linux.intel.com>
>> ---
>> stmmac.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/stmmac.c b/stmmac.c
>> index e1bb291..7d7bebd 100644
>> --- a/stmmac.c
>> +++ b/stmmac.c
>> @@ -64,7 +64,7 @@ int st_gmac_dump_regs(struct ethtool_drvinfo *info,
>> struct ethtool_regs *regs)
>> fprintf(stdout, "\n");
>> fprintf(stdout, "DMA Registers\n");
>> stmmac_reg = (unsigned int *)regs->data + DMA_REG_OFFSET;
>> - for (i = 0; i < 22; i++)
>> + for (i = 0; i < 23; i++)
>
> thx Thor for these changes, I wonder if you could add a macro instead 23
> while doing this kind of changes
>
> Sorry if I didn't it in the past.
>
> the, you can send the series with my Acked-by: Giuseppe Cavallaro
> <peppe.cavallaro@st.com>
>
> Regards
>
> peppe
>
Sure. I'll also add a macro for the # of main registers too (55). Some
maintainers prefer the macros while others prefer the number to reduce
the space.
Thanks for the quick review!
Thor
>
>> fprintf(stdout, "Reg%d 0x%08X\n", i, *stmmac_reg++);
>> return 0;
>
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-06-28 13:22 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-27 21:51 [PATCH 0/2] ethtool: stmmac: Fix DMA register dump thor.thayer
2017-06-27 21:51 ` [PATCH 1/2] ethtool: stmmac: Fix Designware ethtool " thor.thayer
2017-06-27 21:51 ` [PATCH 2/2] ethtool: stmmac: Add DMA HW Feature Register thor.thayer
2017-06-28 9:03 ` Giuseppe CAVALLARO
2017-06-28 13:25 ` Thor Thayer
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.