Re: [RFC PATCH 3/9] net: dsa: hellcreek: Add PTP clock support

2020-06-25 Thread Kurt Kanzenbach
Hi Richard, On Wed Jun 24 2020, Richard Cochran wrote: > On Thu, Jun 18, 2020 at 08:40:23AM +0200, Kurt Kanzenbach wrote: > >> diff --git a/drivers/net/dsa/hirschmann/hellcreek.h >> b/drivers/net/dsa/hirschmann/hellcreek.h >> index a08a10cb5ab7..2d4422fd2567 100644 >> --- a/drivers/net/dsa/hirsch

Re: [RFC PATCH 3/9] net: dsa: hellcreek: Add PTP clock support

2020-06-24 Thread Richard Cochran
On Thu, Jun 18, 2020 at 08:40:23AM +0200, Kurt Kanzenbach wrote: > diff --git a/drivers/net/dsa/hirschmann/hellcreek.h > b/drivers/net/dsa/hirschmann/hellcreek.h > index a08a10cb5ab7..2d4422fd2567 100644 > --- a/drivers/net/dsa/hirschmann/hellcreek.h > +++ b/drivers/net/dsa/hirschmann/hellcreek.h

Re: [RFC PATCH 3/9] net: dsa: hellcreek: Add PTP clock support

2020-06-22 Thread Kurt Kanzenbach
On Fri Jun 19 2020, Andrew Lunn wrote: > On Fri, Jun 19, 2020 at 10:26:44AM +0200, Kurt Kanzenbach wrote: >> Hi Andrew, >> >> On Thu Jun 18 2020, Andrew Lunn wrote: >> >> +static u64 __hellcreek_ptp_clock_read(struct hellcreek *hellcreek) >> >> +{ >> >> + u16 nsl, nsh, secl, secm, sech; >> >> + >>

Re: [RFC PATCH 3/9] net: dsa: hellcreek: Add PTP clock support

2020-06-19 Thread Andrew Lunn
On Fri, Jun 19, 2020 at 10:26:44AM +0200, Kurt Kanzenbach wrote: > Hi Andrew, > > On Thu Jun 18 2020, Andrew Lunn wrote: > >> +static u64 __hellcreek_ptp_clock_read(struct hellcreek *hellcreek) > >> +{ > >> + u16 nsl, nsh, secl, secm, sech; > >> + > >> + /* Take a snapshot */ > >> + hellcreek_p

Re: [RFC PATCH 3/9] net: dsa: hellcreek: Add PTP clock support

2020-06-19 Thread Kurt Kanzenbach
Hi Andrew, On Thu Jun 18 2020, Andrew Lunn wrote: >> +static u64 __hellcreek_ptp_clock_read(struct hellcreek *hellcreek) >> +{ >> +u16 nsl, nsh, secl, secm, sech; >> + >> +/* Take a snapshot */ >> +hellcreek_ptp_write(hellcreek, PR_COMMAND_C_SS, PR_COMMAND_C); >> + >> +/* The time

Re: [RFC PATCH 3/9] net: dsa: hellcreek: Add PTP clock support

2020-06-19 Thread Kurt Kanzenbach
Hi Jakub, On Thu Jun 18 2020, Jakub Kicinski wrote: > On Thu, 18 Jun 2020 08:40:23 +0200 Kurt Kanzenbach wrote: >> From: Kamil Alkhouri >> >> The switch has internal PTP hardware clocks. Add support for it. There are >> three >> clocks: >> >> * Synchronized >> * Syntonized >> * Free running

Re: [RFC PATCH 3/9] net: dsa: hellcreek: Add PTP clock support

2020-06-18 Thread Andrew Lunn
> +static u64 __hellcreek_ptp_clock_read(struct hellcreek *hellcreek) > +{ > + u16 nsl, nsh, secl, secm, sech; > + > + /* Take a snapshot */ > + hellcreek_ptp_write(hellcreek, PR_COMMAND_C_SS, PR_COMMAND_C); > + > + /* The time of the day is saved as 96 bits. However, due to hardwar

Re: [RFC PATCH 3/9] net: dsa: hellcreek: Add PTP clock support

2020-06-18 Thread Jakub Kicinski
On Thu, 18 Jun 2020 08:40:23 +0200 Kurt Kanzenbach wrote: > From: Kamil Alkhouri > > The switch has internal PTP hardware clocks. Add support for it. There are > three > clocks: > > * Synchronized > * Syntonized > * Free running > > Currently the synchronized clock is exported to user space

[RFC PATCH 3/9] net: dsa: hellcreek: Add PTP clock support

2020-06-17 Thread Kurt Kanzenbach
From: Kamil Alkhouri The switch has internal PTP hardware clocks. Add support for it. There are three clocks: * Synchronized * Syntonized * Free running Currently the synchronized clock is exported to user space which is a good default for the beginning. The free running clock might be expor