Commit 724812d8 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'IXP46x-PTP-Timer'



Linus Walleij says:

====================
IXP46x PTP Timer clean-up and DT

ChangeLog v2->v3:

- Dropped the patch enabling compile tests: we are still dependent
  on some machine-specific headers. The plan is to get rid of this
  after device tree conversion. We include one of the compile testing
  fixes anyway, because it is nice to have fixed.

- Rebased on the latest net-next
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 27c77943 e9e50622
Loading
Loading
Loading
Loading
+54 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
# Copyright 2018 Linaro Ltd.
%YAML 1.2
---
$id: "http://devicetree.org/schemas/net/intel,ixp46x-ptp-timer.yaml#"
$schema: "http://devicetree.org/meta-schemas/core.yaml#"

title: Intel IXP46x PTP Timer (TSYNC)

maintainers:
  - Linus Walleij <linus.walleij@linaro.org>

description: |
  The Intel IXP46x PTP timer is known in the manual as IEEE1588 Hardware
  Assist and Time Synchronization Hardware Assist TSYNC provides a PTP
  timer. It exists in the Intel IXP45x and IXP46x XScale SoCs.

properties:
  compatible:
    const: intel,ixp46x-ptp-timer

  reg:
    maxItems: 1

  interrupts:
    items:
      - description: Interrupt to trigger master mode snapshot from the
          PRP timer, usually a GPIO interrupt.
      - description: Interrupt to trigger slave mode snapshot from the
          PRP timer, usually a GPIO interrupt.

  interrupt-names:
    items:
      - const: master
      - const: slave

required:
  - compatible
  - reg
  - interrupts
  - interrupt-names

additionalProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/irq.h>
    ptp-timer@c8010000 {
        compatible = "intel,ixp46x-ptp-timer";
        reg = <0xc8010000 0x1000>;
        interrupt-parent = <&gpio0>;
        interrupts = <8 IRQ_TYPE_EDGE_FALLING>, <7 IRQ_TYPE_EDGE_FALLING>;
        interrupt-names = "master", "slave";
    };
+14 −0
Original line number Diff line number Diff line
@@ -268,9 +268,23 @@ static struct platform_device ixp46x_i2c_controller = {
	.resource	= ixp46x_i2c_resources
};

static struct resource ixp46x_ptp_resources[] = {
	DEFINE_RES_MEM(IXP4XX_TIMESYNC_BASE_PHYS, SZ_4K),
	DEFINE_RES_IRQ_NAMED(IRQ_IXP4XX_GPIO8, "master"),
	DEFINE_RES_IRQ_NAMED(IRQ_IXP4XX_GPIO7, "slave"),
};

static struct platform_device ixp46x_ptp = {
	.name		= "ptp-ixp46x",
	.id		= -1,
	.resource	= ixp46x_ptp_resources,
	.num_resources	= ARRAY_SIZE(ixp46x_ptp_resources),
};

static struct platform_device *ixp46x_devices[] __initdata = {
	&ixp46x_hwrandom_device,
	&ixp46x_i2c_controller,
	&ixp46x_ptp,
};

unsigned long ixp4xx_exp_bus_size;
+2 −2
Original line number Diff line number Diff line
@@ -29,9 +29,9 @@ config IXP4XX_ETH
	  on IXP4xx processor.

config PTP_1588_CLOCK_IXP46X
	tristate "Intel IXP46x as PTP clock"
	bool "Intel IXP46x as PTP clock"
	depends on IXP4XX_ETH
	depends on PTP_1588_CLOCK
	depends on PTP_1588_CLOCK=y || PTP_1588_CLOCK=IXP4XX_ETH
	default y
	help
	  This driver adds support for using the IXP46X as a PTP
+5 −1
Original line number Diff line number Diff line
@@ -3,5 +3,9 @@
# Makefile for the Intel XScale IXP device drivers.
#

# Keep this link order to avoid deferred probing
ifdef CONFIG_PTP_1588_CLOCK_IXP46X
obj-$(CONFIG_IXP4XX_ETH)		+= ptp_ixp46x.o
endif

obj-$(CONFIG_IXP4XX_ETH)		+= ixp4xx_eth.o
obj-$(CONFIG_PTP_1588_CLOCK_IXP46X)	+= ptp_ixp46x.o
+11 −2
Original line number Diff line number Diff line
@@ -62,7 +62,16 @@ struct ixp46x_ts_regs {
#define TX_SNAPSHOT_LOCKED (1<<0)
#define RX_SNAPSHOT_LOCKED (1<<1)

/* The ptp_ixp46x module will set this variable */
extern int ixp46x_phc_index;
#if IS_ENABLED(CONFIG_PTP_1588_CLOCK_IXP46X)
int ixp46x_ptp_find(struct ixp46x_ts_regs *__iomem *regs, int *phc_index);
#else
static inline int ixp46x_ptp_find(struct ixp46x_ts_regs *__iomem *regs, int *phc_index)
{
	*regs = NULL;
	*phc_index = -1;

	return -ENODEV;
}
#endif

#endif
Loading