19 Sep, 2020

1 commit

  • The FIPER3 (fixed interval period pulse generator) is supported on
    DPAA2 and ENETC network controller hardware. This patch is to support
    it in ptp_qoriq driver.

    Signed-off-by: Yangbo Lu
    Acked-by: Vladimir Oltean
    Signed-off-by: David S. Miller

    Yangbo Lu
     

17 Feb, 2020

1 commit

  • The alarm function hadn't been supported by PTP clock driver.
    The recommended solution PHC + phc2sys + nanosleep provides
    best performance. So drop the code of alarm in ptp_qoriq driver.

    Signed-off-by: Yangbo Lu
    Signed-off-by: David S. Miller

    Yangbo Lu
     

17 Dec, 2019

2 commits

  • Export extts_clean_up() function so that dpaa2-ptp
    driver is able to reuse it.

    Signed-off-by: Yangbo Lu
    Signed-off-by: David S. Miller

    Yangbo Lu
     
  • For PTP timer supporting external trigger timestamp FIFO,
    there is a valid bit in TMR_STAT register indicating the
    timestamp is available. For PTP timer without FIFO, there
    is not TMR_STAT register.
    This patch is to check the valid bit for the FIFO before
    reading timestamp, and to avoid operating TMR_STAT register
    for PTP timer without the FIFO.

    Signed-off-by: Yangbo Lu
    Signed-off-by: David S. Miller

    Yangbo Lu
     

03 Oct, 2019

1 commit

  • Because ptp_qoriq_settime is being called prior to spin_lock_init, the
    following stack trace can be seen at driver probe time:

    [ 2.269117] the code is fine but needs lockdep annotation.
    [ 2.274569] turning off the locking correctness validator.
    [ 2.280027] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 5.3.0-rc7-01478-g01eaa67a4797 #263
    [ 2.288073] Hardware name: Freescale LS1021A
    [ 2.292337] [] (unwind_backtrace) from [] (show_stack+0x10/0x14)
    [ 2.300045] [] (show_stack) from [] (dump_stack+0xcc/0xf8)
    [ 2.307235] [] (dump_stack) from [] (register_lock_class+0x730/0x73c)
    [ 2.315372] [] (register_lock_class) from [] (__lock_acquire+0x78/0x270c)
    [ 2.323856] [] (__lock_acquire) from [] (lock_acquire+0xe0/0x22c)
    [ 2.331649] [] (lock_acquire) from [] (_raw_spin_lock_irqsave+0x54/0x68)
    [ 2.340048] [] (_raw_spin_lock_irqsave) from [] (ptp_qoriq_settime+0x38/0x80)
    [ 2.348878] [] (ptp_qoriq_settime) from [] (ptp_qoriq_init+0x1f8/0x484)
    [ 2.357189] [] (ptp_qoriq_init) from [] (ptp_qoriq_probe+0xd0/0x184)
    [ 2.365243] [] (ptp_qoriq_probe) from [] (platform_drv_probe+0x48/0x9c)
    [ 2.373555] [] (platform_drv_probe) from [] (really_probe+0x1c4/0x400)
    [ 2.381779] [] (really_probe) from [] (driver_probe_device+0x78/0x1b8)
    [ 2.390003] [] (driver_probe_device) from [] (device_driver_attach+0x58/0x60)
    [ 2.398832] [] (device_driver_attach) from [] (__driver_attach+0xfc/0x160)
    [ 2.407402] [] (__driver_attach) from [] (bus_for_each_dev+0x68/0xb4)
    [ 2.415539] [] (bus_for_each_dev) from [] (bus_add_driver+0x104/0x20c)
    [ 2.423763] [] (bus_add_driver) from [] (driver_register+0x78/0x10c)
    [ 2.431815] [] (driver_register) from [] (do_one_initcall+0x8c/0x3ac)
    [ 2.439954] [] (do_one_initcall) from [] (kernel_init_freeable+0x468/0x548)
    [ 2.448610] [] (kernel_init_freeable) from [] (kernel_init+0x8/0x10c)
    [ 2.456745] [] (kernel_init) from [] (ret_from_fork+0x14/0x20)
    [ 2.464273] Exception stack(0xea89ffb0 to 0xea89fff8)
    [ 2.469297] ffa0: 00000000 00000000 00000000 00000000
    [ 2.477432] ffc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    [ 2.485566] ffe0: 00000000 00000000 00000000 00000000 00000013 00000000

    Fixes: ff54571a747b ("ptp_qoriq: convert to use ptp_qoriq_init/free")
    Signed-off-by: Vladimir Oltean
    Signed-off-by: David S. Miller

    Vladimir Oltean
     

24 May, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version this program is distributed in the
    hope that it will be useful but without any warranty without even
    the implied warranty of merchantability or fitness for a particular
    purpose see the gnu general public license for more details you
    should have received a copy of the gnu general public license along
    with this program if not write to the free software foundation inc
    675 mass ave cambridge ma 02139 usa

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 441 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Michael Ellerman (powerpc)
    Reviewed-by: Richard Fontana
    Reviewed-by: Allison Randal
    Reviewed-by: Kate Stewart
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190520071858.739733335@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

10 May, 2019

1 commit


20 Feb, 2019

1 commit

  • Passing the struct ptp_clock_info caps by parameter is passing over 130 bytes
    of data by value on the stack. Optimize this by passing it by reference instead.
    Also shinks the object code size:

    Before:
    text data bss dec hex filename
    12596 2160 64 14820 39e4 drivers/ptp/ptp_qoriq.o

    After:
    text data bss dec hex filename
    12567 2160 64 14791 39c7 drivers/ptp/ptp_qoriq.o

    Signed-off-by: Colin Ian King
    Signed-off-by: David S. Miller

    Colin Ian King
     

13 Feb, 2019

5 commits

  • The 1588 timer on eTSEC Ethernet controller uses different
    register memory map with DPAA Ethernet controller.
    Now the new ENETC Ethernet controller uses same reigster
    memory map with DPAA. To support ENETC, let's use register
    memory map of DPAA/ENETC in default.

    Signed-off-by: Yangbo Lu
    Signed-off-by: David S. Miller

    Yangbo Lu
     
  • There is QorIQ 1588 timer IP block on the new ENETC Ethernet
    controller. However it uses little endian mode which is different
    with before. This patch is to add little endian support for the
    driver by using "little-endian" dts node property.

    Signed-off-by: Yangbo Lu
    Signed-off-by: David S. Miller

    Yangbo Lu
     
  • Moved QorIQ PTP clock initialization/free into new functions
    ptp_qoriq_init()/ptp_qoriq_free(). These functions could also
    be reused by ENETC PTP drvier which is a PCI driver for same
    1588 timer IP block.

    Signed-off-by: Yangbo Lu
    Signed-off-by: David S. Miller

    Yangbo Lu
     
  • This patch is to make functions of ptp operations global,
    so that ENETC PTP driver which is a PCI driver for same
    1588 timer IP block could reuse them.

    Signed-off-by: Yangbo Lu
    Signed-off-by: David S. Miller

    Yangbo Lu
     
  • Strings containing "ptp_qoriq" or "qoriq_ptp" which were used for
    structure/function names were complained by users. Let's just use
    the unique "ptp_qoriq" to make these names more consistent.
    This patch is just to unify the names using "ptp_qoriq". It hasn't
    changed any functions.

    Signed-off-by: Yangbo Lu
    Signed-off-by: David S. Miller

    Yangbo Lu
     

23 Jan, 2019

3 commits

  • This patch is to add debugfs support for ptp_qoriq. Current debugfs
    supports to control fiper1/fiper2 loopback mode. If the loopback mode
    is enabled, the fiper1/fiper2 pulse is looped back into trigger1/
    trigger2 input. This is very useful for validating hardware and driver
    without external hardware. Below is an example to enable fiper1 loopback.

    echo 1 > /sys/kernel/debug/2d10e00.ptp_clock/fiper1-loopback

    Signed-off-by: Yangbo Lu
    Signed-off-by: David S. Miller

    Yangbo Lu
     
  • The external trigger stamp FIFO was introduced as a new feature
    for QorIQ 1588 timer IP block. This patch is to support it by
    adding a new dts property "fsl,extts-fifo". Any QorIQ 1588 timer
    supporting this feature is required to add this property in its
    dts node.

    In addition, the FIFO should be cleaned up before enabling external
    trigger interrupts. Otherwise, there will be interrupts immediately
    just after enabling external trigger interrupts.

    Signed-off-by: Yangbo Lu
    Signed-off-by: Vladimir Oltean
    Signed-off-by: David S. Miller

    Yangbo Lu
     
  • The tmr_tevent register would update event bits
    no matter tmr_temask bits were set or not. So we
    should get interrupts by tmr_tevent & tmr_temask,
    and clean up interrupts in tmr_tevent before
    enabling them.

    Signed-off-by: Yangbo Lu
    Signed-off-by: David S. Miller

    Yangbo Lu
     

07 Aug, 2018

1 commit

  • This is a fix-up patch for below build issue with multi_v7_defconfig.

    drivers/ptp/ptp_qoriq.o: In function `qoriq_ptp_probe':
    ptp_qoriq.c:(.text+0xd0c): undefined reference to `__aeabi_uldivmod'

    Fixes: 91305f281262 ("ptp_qoriq: support automatic configuration for ptp timer")
    Signed-off-by: Yangbo Lu
    Signed-off-by: David S. Miller

    Yangbo Lu
     

06 Aug, 2018

1 commit

  • This patch is to support automatic configuration for ptp timer.
    If required ptp dts properties are not provided, driver could
    try to calculate a set of default configurations to initialize
    the ptp timer. This makes the driver work for many boards which
    don't have the required ptp dts properties in current kernel.
    Also the users could set dts properties by themselves according
    to their requirement.

    Signed-off-by: Yangbo Lu
    Signed-off-by: David S. Miller

    Yangbo Lu
     

26 Jun, 2018

1 commit

  • This patch is to support DPAA (Data Path Acceleration Architecture)
    1588 timer by adding "fsl,fman-ptp-timer" compatible, sharing
    interrupt with FMan, adding FSL_DPAA_ETH dependency, and fixing
    up register offset.

    Signed-off-by: Yangbo Lu
    Acked-by: Richard Cochran
    Acked-by: Madalin Bucur
    Signed-off-by: David S. Miller

    Yangbo Lu
     

20 Jun, 2018

1 commit


29 May, 2018

2 commits

  • This patch is to move some definitions in ptp_qoriq.c
    to the header file.

    Signed-off-by: Yangbo Lu
    Signed-off-by: David S. Miller

    Yangbo Lu
     
  • gianfar_ptp was the PTP clock driver for 1588 timer
    module of Freescale QorIQ eTSEC (Enhanced Three-Speed
    Ethernet Controllers) platforms. Actually QorIQ DPAA
    (Data Path Acceleration Architecture) platforms is
    also using the same 1588 timer module in hardware.

    This patch is to rework gianfar_ptp as QorIQ common
    PTP driver to support both DPAA and eTSEC. Moved
    gianfar_ptp.c to drivers/ptp/, renamed it as
    ptp_qoriq.c, and renamed many variables. There were
    not any function changes.

    Signed-off-by: Yangbo Lu
    Acked-by: Richard Cochran
    Signed-off-by: David S. Miller

    Yangbo Lu