From patchwork Fri Aug 13 22:00:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 496577 Delivered-To: patch@linaro.org Received: by 2002:a02:cf8a:0:0:0:0:0 with SMTP id w10csp973712jar; Fri, 13 Aug 2021 15:02:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBXp5PNwak9+sy8W5zLm3WBSO2UtdTvo5nikCiPvMVtre3+Cw+6MNTG0nOaX2ZaYLeEo/P X-Received: by 2002:a17:906:d52:: with SMTP id r18mr4557318ejh.47.1628892160293; Fri, 13 Aug 2021 15:02:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628892160; cv=none; d=google.com; s=arc-20160816; b=kYlHTgc1t7z+Mk/Q023J56dDJzfD/Iy3POfVN0LuRmcs4udbfa1M4w84VH8UXCL9ol nZ1gObIT59wOZIBISMnoinm6HNic61Pzl50Aw65QV6zkTtsFc23r9oid1m8af4xFMs0h YsAbyTFlrdS0+Wzm/DrVb60JS0dujr2TAKi/i7YJie9FGswsa64w2fFzYgQRWPLy0Sno mZC3wHj6ZLlePHZ0CXST1EA1LW9qtYMW0v7iLrYnWBgmvCQePb0sW0DE4YfaM1KpgY7K T2ztc9n2xJVToWcaNmn7TySwDCiII75DnQyeF7wyDPYTL6WYArhYlr2jsUgGRI1eQ4zP e+1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=HJYaIJiWLIhMl/1yez9NfO52hMkbZOCzfqOKurRdjQ4=; b=Tfgmdjpwuxezz2wQ2bQo/wtPZf6kJW/mZTiz8uKvI2kV6TJZfD1Uxz01oHbhIsx7Te CVFgCefDjgbV4QwKiwOVJXQC+NsbkWSHRDiaTkZoJgZTf3vI48rF4D3RPWVsIdVn2HsM Hkodi0v1INP5tm30SE0JeCRIdPHnxc6SWccpqjTZvNVsOAX7iwX0K8R0B60ykeL8tm59 gYOxZAuR8J7oErNMJUmHYAhn2qxpUvWsnABuZ/CoNl4CDzqpcUEffV5vq+qjmXkcaKvS rrM1ib/hGprDJstl3j5BOT+KHjvblU6CiQ7WqWrs/vBwGEnzob2JSHKWGMsJOtJbgEBc A3wQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xIUMiAn9; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s18si3299982eji.591.2021.08.13.15.02.40; Fri, 13 Aug 2021 15:02:40 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xIUMiAn9; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235147AbhHMWDG (ORCPT + 8 others); Fri, 13 Aug 2021 18:03:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234831AbhHMWDF (ORCPT ); Fri, 13 Aug 2021 18:03:05 -0400 Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F153C061756 for ; Fri, 13 Aug 2021 15:02:38 -0700 (PDT) Received: by mail-lj1-x235.google.com with SMTP id x7so17681237ljn.10 for ; Fri, 13 Aug 2021 15:02:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HJYaIJiWLIhMl/1yez9NfO52hMkbZOCzfqOKurRdjQ4=; b=xIUMiAn9UmQAgJeTQBFojAggHmUSrPdMGhXbwBQcu62ENI1mYv8SA39/WwK2J0OM6r jfA2PKJNzc+fsE3iINY5rYfY6/KsCIEtRlpDufxnPKPIVIs2dgWlRo0E8y0Y8d3JCTJ7 8A0vX8L38kEPW8H5OPanB3i/whZJZbByIo4W6d8L47xULfiXxZhmh7VbO2NRkuM/hxxH t9uapSKwkvAk/e67ExB/8Sn7gRaYQl3picYk+KrNQoHtQ/7gmIg9MI1ePlXMzzlvrS/q wPgJ/lGppgS4zF4iFnA4c2Q55G4Goy+TPMg7xxCgztHZDfNtXfofb8wEb3bFpMJ5KHPQ p1vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HJYaIJiWLIhMl/1yez9NfO52hMkbZOCzfqOKurRdjQ4=; b=huXOAlWtVjov5iXtq9Q49ouRTar3cfkrZxgZ76dEEEYFlnjLwWRfP0S/ySypPfaTC4 ae4RTTH29CoyYd13UX3ypXaceac5JqS6Jb0ucbdnynjxFvu2++2Eln1Kk+5B4FW6Nyex eOW0+Vhh4/tHRFk38GJqA5bYZbwBUfJIHmynwPhszEGswtieMJLU46tj/PiC65eKpith ad1uIMozc5DZIAuh9w2aUn4oqtMT/pkA4X2DqfhoKzgqd2SuawvgLGe6es3ja3bZYvMR zpy1stkXSLmJ4G1ztBL1p/J7AvXnIsxS99kYp9eknnJEqrDmYuvHHo24hBV0ddNgrSnP QNDQ== X-Gm-Message-State: AOAM533pIUOVRbzA80VrerZi83oyPfDPg5bhRfFIn3DRQsN4Ra8idTw0 qglcPdiQi0yyRluKzeZsCuIPtjALISH+rQ== X-Received: by 2002:a2e:b8cd:: with SMTP id s13mr3277090ljp.433.1628892156242; Fri, 13 Aug 2021 15:02:36 -0700 (PDT) Received: from localhost.localdomain (c-fdcc225c.014-348-6c756e10.bbcust.telenor.se. [92.34.204.253]) by smtp.gmail.com with ESMTPSA id s17sm274912ljp.61.2021.08.13.15.02.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Aug 2021 15:02:35 -0700 (PDT) From: Linus Walleij To: netdev@vger.kernel.org, "David S . Miller" , Jakub Kicinski Cc: Imre Kaloz , Krzysztof Halasa , Arnd Bergmann , Linus Walleij Subject: [PATCH net-next 1/6 v2] ixp4xx_eth: make ptp support a platform driver Date: Sat, 14 Aug 2021 00:00:06 +0200 Message-Id: <20210813220011.921211-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210813220011.921211-1-linus.walleij@linaro.org> References: <20210813220011.921211-1-linus.walleij@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Arnd Bergmann After the recent ixp4xx cleanups, the ptp driver has gained a build failure in some configurations: drivers/net/ethernet/xscale/ptp_ixp46x.c: In function 'ptp_ixp_init': drivers/net/ethernet/xscale/ptp_ixp46x.c:290:51: error: 'IXP4XX_TIMESYNC_BASE_VIRT' undeclared (first use in this function) Avoid the last bit of hardcoded constants from platform headers by turning the ptp driver bit into a platform driver and passing the IRQ and MMIO address as resources. This is a bit tricky: - The interface between the two drivers is now the new ixp46x_ptp_find() function, replacing the global ixp46x_phc_index variable. The call is done as late as possible, in hwtstamp_set(), to ensure that the ptp device is fully probed. - As the ptp driver is now called by the network driver, the link dependency is reversed, which in turn requires a small Makefile hack - The GPIO number is still left hardcoded. This is clearly not great, but it can be addressed later. Note that commit 98ac0cc270b7 ("ARM: ixp4xx: Convert to MULTI_IRQ_HANDLER") changed the IRQ number to something meaningless. Passing the correct IRQ in a resource fixes this. - When the PTP driver is disabled, ethtool .get_ts_info() now correctly lists only software timestamping regardless of the hardware. Signed-off-by: Arnd Bergmann [Fix a missing include] Signed-off-by: Linus Walleij --- arch/arm/mach-ixp4xx/common.c | 14 ++++++ drivers/net/ethernet/xscale/Kconfig | 4 +- drivers/net/ethernet/xscale/Makefile | 6 ++- drivers/net/ethernet/xscale/ixp46x_ts.h | 13 ++++- drivers/net/ethernet/xscale/ixp4xx_eth.c | 28 +++++++---- drivers/net/ethernet/xscale/ptp_ixp46x.c | 61 ++++++++++++++++-------- 6 files changed, 92 insertions(+), 34 deletions(-) -- 2.31.1 diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c index b5eadd70d903..cdc720f54daa 100644 --- a/arch/arm/mach-ixp4xx/common.c +++ b/arch/arm/mach-ixp4xx/common.c @@ -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; diff --git a/drivers/net/ethernet/xscale/Kconfig b/drivers/net/ethernet/xscale/Kconfig index 468ffe3d1707..0e878fa6e322 100644 --- a/drivers/net/ethernet/xscale/Kconfig +++ b/drivers/net/ethernet/xscale/Kconfig @@ -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 diff --git a/drivers/net/ethernet/xscale/Makefile b/drivers/net/ethernet/xscale/Makefile index 607f91b1e878..e935f2a2979f 100644 --- a/drivers/net/ethernet/xscale/Makefile +++ b/drivers/net/ethernet/xscale/Makefile @@ -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 diff --git a/drivers/net/ethernet/xscale/ixp46x_ts.h b/drivers/net/ethernet/xscale/ixp46x_ts.h index d792130e27b0..ee9b93ded20a 100644 --- a/drivers/net/ethernet/xscale/ixp46x_ts.h +++ b/drivers/net/ethernet/xscale/ixp46x_ts.h @@ -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 diff --git a/drivers/net/ethernet/xscale/ixp4xx_eth.c b/drivers/net/ethernet/xscale/ixp4xx_eth.c index ff50305d6e13..0bd22beb83ed 100644 --- a/drivers/net/ethernet/xscale/ixp4xx_eth.c +++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c @@ -169,6 +169,8 @@ struct eth_regs { struct port { struct eth_regs __iomem *regs; + struct ixp46x_ts_regs __iomem *timesync_regs; + int phc_index; struct npe *npe; struct net_device *netdev; struct napi_struct napi; @@ -295,7 +297,7 @@ static void ixp_rx_timestamp(struct port *port, struct sk_buff *skb) ch = PORT2CHANNEL(port); - regs = (struct ixp46x_ts_regs __iomem *) IXP4XX_TIMESYNC_BASE_VIRT; + regs = port->timesync_regs; val = __raw_readl(®s->channel[ch].ch_event); @@ -340,7 +342,7 @@ static void ixp_tx_timestamp(struct port *port, struct sk_buff *skb) ch = PORT2CHANNEL(port); - regs = (struct ixp46x_ts_regs __iomem *) IXP4XX_TIMESYNC_BASE_VIRT; + regs = port->timesync_regs; /* * This really stinks, but we have to poll for the Tx time stamp. @@ -375,6 +377,7 @@ static int hwtstamp_set(struct net_device *netdev, struct ifreq *ifr) struct hwtstamp_config cfg; struct ixp46x_ts_regs *regs; struct port *port = netdev_priv(netdev); + int ret; int ch; if (copy_from_user(&cfg, ifr->ifr_data, sizeof(cfg))) @@ -383,8 +386,12 @@ static int hwtstamp_set(struct net_device *netdev, struct ifreq *ifr) if (cfg.flags) /* reserved for future extensions */ return -EINVAL; + ret = ixp46x_ptp_find(&port->timesync_regs, &port->phc_index); + if (ret) + return ret; + ch = PORT2CHANNEL(port); - regs = (struct ixp46x_ts_regs __iomem *) IXP4XX_TIMESYNC_BASE_VIRT; + regs = port->timesync_regs; if (cfg.tx_type != HWTSTAMP_TX_OFF && cfg.tx_type != HWTSTAMP_TX_ON) return -ERANGE; @@ -988,25 +995,27 @@ static void ixp4xx_get_drvinfo(struct net_device *dev, strlcpy(info->bus_info, "internal", sizeof(info->bus_info)); } -int ixp46x_phc_index = -1; -EXPORT_SYMBOL_GPL(ixp46x_phc_index); - static int ixp4xx_get_ts_info(struct net_device *dev, struct ethtool_ts_info *info) { - if (!cpu_is_ixp46x()) { + struct port *port = netdev_priv(dev); + + if (port->phc_index < 0) + ixp46x_ptp_find(&port->timesync_regs, &port->phc_index); + + info->phc_index = port->phc_index; + + if (info->phc_index < 0) { info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE | SOF_TIMESTAMPING_RX_SOFTWARE | SOF_TIMESTAMPING_SOFTWARE; - info->phc_index = -1; return 0; } info->so_timestamping = SOF_TIMESTAMPING_TX_HARDWARE | SOF_TIMESTAMPING_RX_HARDWARE | SOF_TIMESTAMPING_RAW_HARDWARE; - info->phc_index = ixp46x_phc_index; info->tx_types = (1 << HWTSTAMP_TX_OFF) | (1 << HWTSTAMP_TX_ON); @@ -1481,6 +1490,7 @@ static int ixp4xx_eth_probe(struct platform_device *pdev) port = netdev_priv(ndev); port->netdev = ndev; port->id = plat->npe; + port->phc_index = -1; /* Get the port resource and remap */ port->regs = devm_platform_get_and_ioremap_resource(pdev, 0, NULL); diff --git a/drivers/net/ethernet/xscale/ptp_ixp46x.c b/drivers/net/ethernet/xscale/ptp_ixp46x.c index a6fb88fd42f7..466f233edd21 100644 --- a/drivers/net/ethernet/xscale/ptp_ixp46x.c +++ b/drivers/net/ethernet/xscale/ptp_ixp46x.c @@ -5,6 +5,7 @@ * Copyright (C) 2010 OMICRON electronics GmbH */ #include +#include #include #include #include @@ -13,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -22,9 +24,7 @@ #define DRIVER "ptp_ixp46x" #define N_EXT_TS 2 #define MASTER_GPIO 8 -#define MASTER_IRQ 25 #define SLAVE_GPIO 7 -#define SLAVE_IRQ 24 struct ixp_clock { struct ixp46x_ts_regs *regs; @@ -32,9 +32,11 @@ struct ixp_clock { struct ptp_clock_info caps; int exts0_enabled; int exts1_enabled; + int slave_irq; + int master_irq; }; -DEFINE_SPINLOCK(register_lock); +static DEFINE_SPINLOCK(register_lock); /* * Register access functions @@ -275,21 +277,36 @@ static int setup_interrupt(int gpio) return irq; } -static void __exit ptp_ixp_exit(void) +int ixp46x_ptp_find(struct ixp46x_ts_regs *__iomem *regs, int *phc_index) { - free_irq(MASTER_IRQ, &ixp_clock); - free_irq(SLAVE_IRQ, &ixp_clock); - ixp46x_phc_index = -1; - ptp_clock_unregister(ixp_clock.ptp_clock); + *regs = ixp_clock.regs; + *phc_index = ptp_clock_index(ixp_clock.ptp_clock); + + if (!ixp_clock.ptp_clock) + return -EPROBE_DEFER; + + return 0; } +EXPORT_SYMBOL_GPL(ixp46x_ptp_find); -static int __init ptp_ixp_init(void) +static int ptp_ixp_remove(struct platform_device *pdev) { - if (!cpu_is_ixp46x()) - return -ENODEV; + free_irq(ixp_clock.master_irq, &ixp_clock); + free_irq(ixp_clock.slave_irq, &ixp_clock); + ptp_clock_unregister(ixp_clock.ptp_clock); + ixp_clock.ptp_clock = NULL; - ixp_clock.regs = - (struct ixp46x_ts_regs __iomem *) IXP4XX_TIMESYNC_BASE_VIRT; + return 0; +} + +static int ptp_ixp_probe(struct platform_device *pdev) +{ + ixp_clock.regs = devm_platform_ioremap_resource(pdev, 0); + ixp_clock.master_irq = platform_get_irq(pdev, 0); + ixp_clock.slave_irq = platform_get_irq(pdev, 1); + if (IS_ERR(ixp_clock.regs) || + !ixp_clock.master_irq || !ixp_clock.slave_irq) + return -ENXIO; ixp_clock.caps = ptp_ixp_caps; @@ -298,32 +315,36 @@ static int __init ptp_ixp_init(void) if (IS_ERR(ixp_clock.ptp_clock)) return PTR_ERR(ixp_clock.ptp_clock); - ixp46x_phc_index = ptp_clock_index(ixp_clock.ptp_clock); - __raw_writel(DEFAULT_ADDEND, &ixp_clock.regs->addend); __raw_writel(1, &ixp_clock.regs->trgt_lo); __raw_writel(0, &ixp_clock.regs->trgt_hi); __raw_writel(TTIPEND, &ixp_clock.regs->event); - if (MASTER_IRQ != setup_interrupt(MASTER_GPIO)) { + if (ixp_clock.master_irq != setup_interrupt(MASTER_GPIO)) { pr_err("failed to setup gpio %d as irq\n", MASTER_GPIO); goto no_master; } - if (SLAVE_IRQ != setup_interrupt(SLAVE_GPIO)) { + if (ixp_clock.slave_irq != setup_interrupt(SLAVE_GPIO)) { pr_err("failed to setup gpio %d as irq\n", SLAVE_GPIO); goto no_slave; } return 0; no_slave: - free_irq(MASTER_IRQ, &ixp_clock); + free_irq(ixp_clock.master_irq, &ixp_clock); no_master: ptp_clock_unregister(ixp_clock.ptp_clock); + ixp_clock.ptp_clock = NULL; return -ENODEV; } -module_init(ptp_ixp_init); -module_exit(ptp_ixp_exit); +static struct platform_driver ptp_ixp_driver = { + .driver.name = "ptp-ixp46x", + .driver.suppress_bind_attrs = true, + .probe = ptp_ixp_probe, + .remove = ptp_ixp_remove, +}; +module_platform_driver(ptp_ixp_driver); MODULE_AUTHOR("Richard Cochran "); MODULE_DESCRIPTION("PTP clock using the IXP46X timer"); From patchwork Fri Aug 13 22:00:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 496578 Delivered-To: patch@linaro.org Received: by 2002:a02:cf8a:0:0:0:0:0 with SMTP id w10csp973725jar; Fri, 13 Aug 2021 15:02:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwdz2YqzQvk/WaXAwpyBh/hd6yXQOCTW4I7R/Cj9JE8/Q/h2t73mUU8YPvFHGg3lhhdQu9 X-Received: by 2002:a17:906:c085:: with SMTP id f5mr4680146ejz.250.1628892161481; Fri, 13 Aug 2021 15:02:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628892161; cv=none; d=google.com; s=arc-20160816; b=MXx4HQcpDuxVp4SHtWuNiyu8O9eNcwXSUbcdXJb+Z11DoUOJzXjm/MCs7JBj0T3Aaf ClpCCCWnSmQkLH1V3NILeU9INYjIskzyGyvgvG52cGhgGW8qgDt5cX0b9UrYJ6AwXH/c c0HgtiTGkNzrUV0/Ms/wJeXlTuQoqDNEpJN7Hudfuh96Rwo3Gu37FpSs6/iX7YXTmFB9 I9AQ94VIjn8l13t8BAf4eyYoHus/8odCJ8qQpRZ1AsgZ3wd1P3ZwU7vkGc9HIRqCYkk9 nNqTlFYLYnCDILBwWB+Vcckgk1I8JP4v6Z24bWpr1EmH8AKDGE4dZ5V7S9kUTEOU++EL iHZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=D7ibt3Lae3RXcE7WOmyu3z09/xMR6Le2PSBAAAdLFdU=; b=UWDSrB+KjfP3WYP3v3163CozFssv+SXr960T2AHb0PZ6ZU100/YTub2+UPdB/8B2wR mny//0lr41nE3DRz9Rz8RmYkYSIUdCxNbhovtN8/QJgdABkKlqrvTnXTueqRVkycfxNj fXTQ4WWxQLja41ojV3sDSn6/LSoJrjxjQesyvGegrP8foX00ih42M7LRMynsFolbUDDS qbsh5KT/yx3nPwcGEsatjCcZFyy6EwgQNdvNJpa8cnZ7GHet/NlkDYGvQA4vAXjd3aV3 j9k4glOirYGRNul818H4lFe4azqSGlcAAt7SvA1pPjNAehlqh0qz0xwt0kD545zK2YoA ni0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hVKB29Td; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s18si3299982eji.591.2021.08.13.15.02.41; Fri, 13 Aug 2021 15:02:41 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hVKB29Td; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235170AbhHMWDH (ORCPT + 8 others); Fri, 13 Aug 2021 18:03:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235144AbhHMWDG (ORCPT ); Fri, 13 Aug 2021 18:03:06 -0400 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 233EBC061756 for ; Fri, 13 Aug 2021 15:02:39 -0700 (PDT) Received: by mail-lf1-x130.google.com with SMTP id d4so22438595lfk.9 for ; Fri, 13 Aug 2021 15:02:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=D7ibt3Lae3RXcE7WOmyu3z09/xMR6Le2PSBAAAdLFdU=; b=hVKB29Tdp9LzYodfipQgUNFoTQLBDI66LWsSnsKsthXwH/23aVidLzeYKKHAnhxWfF qylJUEcmwpbDttYGuNTxegmFzQLLYhwhi5LnnOQ4BQimumIO6ikoezX7NCLJsSNpPg+I j2aFbJUNNU5l4J4JRVeO2D7UOoQ2Zml9NaUZL7EWAIhf7Zo2AEQQK79NK7NN86gjCvPH b4Cqj1yzwi3mig3ORx1LqvLVxYX34wFwoQtfknra6wWbESRhUqmapKQvvT8nsvsmKh+L NAjb4CNNexYGHqJZ/2WRxS7OFEK78o+QSTKD6VqGz7M7a06guyf10AqFnOlvoG3Lu2W4 S4cA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=D7ibt3Lae3RXcE7WOmyu3z09/xMR6Le2PSBAAAdLFdU=; b=jCPf43IS4CUqDc9vofdWuilqcVKL4dIKlizxpKaLkzBEbk868h4IuKhUjjJK2VxVKd yyUX4VtZTr9PW9IkiKBze5PPZcw9j5VgnGDiYGrQxOv04+Qb0TwwC0s0wn1miq3aTdfp RtARcBq2gI1ZIJ54t1UdadKHS13QSvksLYKZv4aHzDAmnV2u8LB/EZl6yUXiqtHEpbJ+ 0buhB01haW2U/cLJ+M0vHNtac3puBGLUQV6RdjTF+JAWj9ukVLJLwVLTUq/tmWo/Sj5n PPpgQ7vNMVn5/mWlLzLCcj+am4Oy8pfglSpoZwa+jf90JykahC2BdcpJe3DJeZxgjVce ieOw== X-Gm-Message-State: AOAM531gFG25ka6v+PACWpumwmNIYrppclSNzXrxfxt7wt8M76088BzB uLz8NimVy4IoLa3R/QLY/JosCFrV861PEg== X-Received: by 2002:a05:6512:1295:: with SMTP id u21mr3259433lfs.384.1628892157401; Fri, 13 Aug 2021 15:02:37 -0700 (PDT) Received: from localhost.localdomain (c-fdcc225c.014-348-6c756e10.bbcust.telenor.se. [92.34.204.253]) by smtp.gmail.com with ESMTPSA id s17sm274912ljp.61.2021.08.13.15.02.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Aug 2021 15:02:37 -0700 (PDT) From: Linus Walleij To: netdev@vger.kernel.org, "David S . Miller" , Jakub Kicinski Cc: Imre Kaloz , Krzysztof Halasa , Arnd Bergmann , Linus Walleij Subject: [PATCH net-next 2/6 v2] ixp4xx_eth: fix compile-testing Date: Sat, 14 Aug 2021 00:00:07 +0200 Message-Id: <20210813220011.921211-3-linus.walleij@linaro.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210813220011.921211-1-linus.walleij@linaro.org> References: <20210813220011.921211-1-linus.walleij@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Arnd Bergmann Change the driver to use portable integer types to avoid warnings during compile testing, including: drivers/net/ethernet/xscale/ixp4xx_eth.c:721:21: error: cast to 'u32 *' (aka 'unsigned int *') from smaller integer type 'int' [-Werror,-Wint-to-pointer-cast] memcpy_swab32(mem, (u32 *)((int)skb->data & ~3), bytes / 4); ^ drivers/net/ethernet/xscale/ixp4xx_eth.c:963:12: error: incompatible pointer types passing 'u32 *' (aka 'unsigned int *') to parameter of type 'dma_addr_t *' (aka 'unsigned long long *') [-Werror,-Wincompatible-pointer-types] &port->desc_tab_phys))) ^~~~~~~~~~~~~~~~~~~~ include/linux/dmapool.h:27:20: note: passing argument to parameter 'handle' here dma_addr_t *handle); ^ Signed-off-by: Arnd Bergmann Signed-off-by: Linus Walleij --- drivers/net/ethernet/xscale/ixp4xx_eth.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) -- 2.31.1 diff --git a/drivers/net/ethernet/xscale/ixp4xx_eth.c b/drivers/net/ethernet/xscale/ixp4xx_eth.c index 0bd22beb83ed..931494cc1c39 100644 --- a/drivers/net/ethernet/xscale/ixp4xx_eth.c +++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c @@ -37,7 +37,6 @@ #include #include #include -#include #include #include "ixp46x_ts.h" @@ -177,7 +176,7 @@ struct port { struct eth_plat_info *plat; buffer_t *rx_buff_tab[RX_DESCS], *tx_buff_tab[TX_DESCS]; struct desc *desc_tab; /* coherent */ - u32 desc_tab_phys; + dma_addr_t desc_tab_phys; int id; /* logical port ID */ int speed, duplex; u8 firmware[4]; @@ -857,14 +856,14 @@ static int eth_xmit(struct sk_buff *skb, struct net_device *dev) bytes = len; mem = skb->data; #else - offset = (int)skb->data & 3; /* keep 32-bit alignment */ + offset = (uintptr_t)skb->data & 3; /* keep 32-bit alignment */ bytes = ALIGN(offset + len, 4); if (!(mem = kmalloc(bytes, GFP_ATOMIC))) { dev_kfree_skb(skb); dev->stats.tx_dropped++; return NETDEV_TX_OK; } - memcpy_swab32(mem, (u32 *)((int)skb->data & ~3), bytes / 4); + memcpy_swab32(mem, (u32 *)((uintptr_t)skb->data & ~3), bytes / 4); #endif phys = dma_map_single(&dev->dev, mem, bytes, DMA_TO_DEVICE); From patchwork Fri Aug 13 22:00:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 496579 Delivered-To: patch@linaro.org Received: by 2002:a02:cf8a:0:0:0:0:0 with SMTP id w10csp973737jar; Fri, 13 Aug 2021 15:02:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxl3lm05ohZ92FJ+VWUpnrVhVODsfc+KrdTyDOxK56GWowWMLZ9Oy9uldo7elgbYevPxNs5 X-Received: by 2002:a17:906:a98e:: with SMTP id jr14mr4587399ejb.450.1628892162711; Fri, 13 Aug 2021 15:02:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628892162; cv=none; d=google.com; s=arc-20160816; b=lZMJdkR55UzQ4pGoOy9CcXw4nu5QVHrgC7H3Yd6uT3+nG0+I0Ty4lbVt0zVvz1WxNq EQ95S8Mwi6dMT+rwgSsi9TZ4OGxfL4EWrXj2tR1nfaeYPFcX8dwPkrIEZYYHTIi+kDZi nvqk2EYPRlMH4rlzBe+ISgJ5nS+4qy2EHV90FY6cf03YPETQLeolFMxs6CO/nuMckU2+ qaLa8ICc4njwAX6nteObvqYJv8yKr2u3htPmRdGQ3lFE6lMYdLmftlcBzEGScRBRF2NC 9+e7yoqwcfnmwrwwRvmsD6SHlH33S3KcWeTX05E6DPWqkgbPOnaoBqxYvPpD1PdGqq8l aYqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=XwiTSMLrZkuBiZd1olOJbf+y/nxUHybnrS+ax6rMLQ8=; b=PJ0GC5mYER8hgXnXG/YFJYaGr3Upp+oUpHSQBA/Ae7wmbQuFEzSruMkTp1SUW03xRd i8nnXJK8HYUn30xs44yLFpkk4YymafSdIwtanh5AFNoIpOhWfbEeung5bU7kVO7Mu/f/ JskuyZdWEDUvCgDeMscFQFEcmNEztLSgK/isLhy7Vm2fRN9I6PBr87xNYAmrKsBBB46I G/RxpdcgWcujIrTkMCkN9U1OM8mEVKatKJ9EeLiuBPSk/LeQ8sHJaIXrx93WcCtTa0tQ 6tjAcyB577R7MKQ4+ADSNAYNr1eUJO4t0/PwL/TitiWNXXkHaq5YLFJOKw7M+/XG2WOP v6dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FVvLdWHg; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s18si3299982eji.591.2021.08.13.15.02.42; Fri, 13 Aug 2021 15:02:42 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FVvLdWHg; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235210AbhHMWDI (ORCPT + 8 others); Fri, 13 Aug 2021 18:03:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235172AbhHMWDH (ORCPT ); Fri, 13 Aug 2021 18:03:07 -0400 Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28643C061756 for ; Fri, 13 Aug 2021 15:02:40 -0700 (PDT) Received: by mail-lj1-x229.google.com with SMTP id n6so17664154ljp.9 for ; Fri, 13 Aug 2021 15:02:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XwiTSMLrZkuBiZd1olOJbf+y/nxUHybnrS+ax6rMLQ8=; b=FVvLdWHg1BJXQya3T61vQkPb+D2GERvdd8JZMxz0oOcjGxuG7B8q6DABA/wmAVL8EA XHdMUW9Rfuan2qILdIGML8DLx41X6krzeT3ZaXheCXRYs38W34bobEO6WBs0QmV7ZVLk 0F0/i0mMY95mEDREiHlJ5pD/iEYJwMGfVU0uoIpA1m2ZTMjPuiP8/4+nuufCXkdj6d2A V2OVXJ1PnWMjAFsF21uPP3mTQ0I6N+fIlLH8lH03Ev1wR8dHUUKYBmuK0ezUcBzy0h1W mfiScCHeEGtAScxgB/ohLML1N7InjkVn4zJzcAJ5QWIxG6x5ggouf0NUAByNwm8PE0+m B3XA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XwiTSMLrZkuBiZd1olOJbf+y/nxUHybnrS+ax6rMLQ8=; b=FF0xXTyLMt6R3y0AJFILEMlU2rSFXs7WPoj8ljPru2uEggCelvkNl8JJj1BWCvP4OY f9+IAIKSnN2rMlCp/vHB3HLSf13ANidP6YG+k3/o0eVzak4TNHNIDb0AgrDPEno8IWTB xa2rJB10N/240y/PrcJIj73PwOfFYYGBIN6j8Se8L1dKI0qvLYQpG+lgR2NjHRlyQ6hD jYIB32L3XXhmv/vwNu9TKCjmFfA3OFr9/We9Y9vMj3eOnfilXnTNhQ0rZdHjC+DsQumK 0b6dsVMmVWz77wMpdyU+mp9rWw+ORGKd3hUtMpyJYTasCIYQHqJv+2cQJ9gI6rv1lWQY 6H9A== X-Gm-Message-State: AOAM531rDsQL0/naERpa2yK+qTkpT/n9WG9dH+CyXrgGvzhljfVusokl D9g3fM5cHT0h/BKUS1dKV/6ilFJYP58JUw== X-Received: by 2002:a2e:8688:: with SMTP id l8mr3264380lji.157.1628892158399; Fri, 13 Aug 2021 15:02:38 -0700 (PDT) Received: from localhost.localdomain (c-fdcc225c.014-348-6c756e10.bbcust.telenor.se. [92.34.204.253]) by smtp.gmail.com with ESMTPSA id s17sm274912ljp.61.2021.08.13.15.02.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Aug 2021 15:02:38 -0700 (PDT) From: Linus Walleij To: netdev@vger.kernel.org, "David S . Miller" , Jakub Kicinski Cc: Imre Kaloz , Krzysztof Halasa , Arnd Bergmann , Linus Walleij Subject: [PATCH net-next 3/6 v2] ixp4xx_eth: enable compile testing Date: Sat, 14 Aug 2021 00:00:08 +0200 Message-Id: <20210813220011.921211-4-linus.walleij@linaro.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210813220011.921211-1-linus.walleij@linaro.org> References: <20210813220011.921211-1-linus.walleij@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Arnd Bergmann The driver is now independent of machine specific header files and should build on all architectures, so enable building with CONFIG_COMPILE_TEST. Signed-off-by: Arnd Bergmann Signed-off-by: Linus Walleij --- drivers/net/ethernet/xscale/Kconfig | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- 2.31.1 diff --git a/drivers/net/ethernet/xscale/Kconfig b/drivers/net/ethernet/xscale/Kconfig index 0e878fa6e322..b93e88422a13 100644 --- a/drivers/net/ethernet/xscale/Kconfig +++ b/drivers/net/ethernet/xscale/Kconfig @@ -6,8 +6,8 @@ config NET_VENDOR_XSCALE bool "Intel XScale IXP devices" default y - depends on NET_VENDOR_INTEL && (ARM && ARCH_IXP4XX && \ - IXP4XX_NPE && IXP4XX_QMGR) + depends on NET_VENDOR_INTEL && IXP4XX_NPE && IXP4XX_QMGR + depends on ARCH_IXP4XX || COMPILE_TEST help If you have a network (Ethernet) card belonging to this class, say Y. @@ -20,7 +20,8 @@ if NET_VENDOR_XSCALE config IXP4XX_ETH tristate "Intel IXP4xx Ethernet support" - depends on ARM && ARCH_IXP4XX && IXP4XX_NPE && IXP4XX_QMGR + depends on IXP4XX_NPE && IXP4XX_QMGR + depends on ARCH_IXP4XX || COMPILE_TEST select PHYLIB select OF_MDIO if OF select NET_PTP_CLASSIFY From patchwork Fri Aug 13 22:00:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 496580 Delivered-To: patch@linaro.org Received: by 2002:a02:cf8a:0:0:0:0:0 with SMTP id w10csp973832jar; Fri, 13 Aug 2021 15:02:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoToZVYQ+FD2ZnOzBTdeIklXqma8nF19TWQYusZ5AXQEjbeKgZE/LpCWnO0a2HRtofizAG X-Received: by 2002:a17:907:9705:: with SMTP id jg5mr4548330ejc.462.1628892169282; Fri, 13 Aug 2021 15:02:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628892169; cv=none; d=google.com; s=arc-20160816; b=TWi4MkAQPgecfV3kTcspKF+qdkIZgHh6VbUcflYeXAQGRpiZz6HQ/V+lOpo7Z/Lozq VUQftTM2sjhGhAKJm2A2WYIRtFLmDnILrbNozD3nTlQTqY967u+Y2eN9+1im3UcRpxEE ZtmoqqzU5PcRr8Xy6SOHUzLTjmdJGPWAMSVEDEI64fRnsZxbOo7TwbBymfNEpKTf6Jhf ybpJbz5T3vBb95zW9QRtXVflw7IgvYLOMn/aXnwvFY9YF6q9GF1vVxV3Zd5gJ8ItclzG 3hC1YA+RYMFkDYT7UDvUTVqmgP9hKzloy2XuBumT+bP0zuPKgw9bvqpidYP4KfLYR5M4 7jtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ZXI2en2FpO56VmbTeLm1+JipCE8ULCAYjbhwip5qLZ0=; b=tYljPp00+m4t4nMMnmbr9O31Ph4zh8bCwyXiWVVUOkV7+vVexGjpXG1lp/zLyID2fi GwkBNEEXZh//ONU+Wu4IZ48YkD8jXY/G8kIIqC8XHkb/IrNIydrpoFKNPAA+D62P0UtS +Kxj3eu+4747jtK6hBz6UOpsSBWUrtbaK4i8LmyPw5tqsa4cdrE9/nq8luKI0FQYKEdE vXLtHNxkG82sILeg3z3u6srrH08+fp73hJwaG5pWrcbUpaKz6NN0+UVyKd6oefcUVsCK S/khaA+W0IXhVuapV3P9xzHzJW3awYYGMGFK8wJlIkL9DkEBZBWE1krl/zESHnEtF/tp NBNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uwLJ1Rww; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s18si3299982eji.591.2021.08.13.15.02.49; Fri, 13 Aug 2021 15:02:49 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uwLJ1Rww; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235234AbhHMWDP (ORCPT + 8 others); Fri, 13 Aug 2021 18:03:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235211AbhHMWDI (ORCPT ); Fri, 13 Aug 2021 18:03:08 -0400 Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A4C3C061756 for ; Fri, 13 Aug 2021 15:02:41 -0700 (PDT) Received: by mail-lj1-x233.google.com with SMTP id h9so17686739ljq.8 for ; Fri, 13 Aug 2021 15:02:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZXI2en2FpO56VmbTeLm1+JipCE8ULCAYjbhwip5qLZ0=; b=uwLJ1Rww/4GGWF+JXBqePCvIfwXYogT6ALqeIq1uMQx6LuEg02J7F6zL7ZgwaV6+kv qINkV3vVllpsUPs0J7AyE/8k6AuJn4C+nsoFF28mRg91+cGUGDc1oYacH0iOCTLRrd2T DGjEBtPmXkITKgx0ZEzR5u/WEeD+tx5OSIJ3THdwfAnTFqNVPC+UqfxubqQnATg6YjoV mGj7+Zk4giOSL32z4iSvK7fqOWE68gH4kThyl6OT2LlZCa4DLNNdkU13kDfflaPNCdBu IOGZTnepAUosWJmfru0+lkfm/L8RJ/9PfEYHx1ZfyooLLbymukvtCqLr9++M/IqmlBeo nfzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZXI2en2FpO56VmbTeLm1+JipCE8ULCAYjbhwip5qLZ0=; b=pF0urIFW5kv1iOqLnbEluEOU22ps89G5QoyDVg1GaVCKQ7eO70FV92Ky8OVBl0avQ6 e4Z40Z97fRXMgHkNplUrswiJ3aIwxBaOW82MKb3RqAkYOiro8Bb51qVlIquHJtxtGWe0 YByC/8NRoW96P0eyfOXPVVZVFrgXn1gUxmATGd6Fo1PzvpS35sbTq/nbXOYmcnKCrKV5 DgzHXkU3kSAdHs9mqu2lTCubr4dnH17GUZow3H+NbwdnKbKFbgKd5gq+RrPfSTpP364v 75SbGoBS5KnfGJElpp5J+nFo6mxhKpTNRKHtDHMA9xFE2BhHkT052ooD+Zo2ZvoMr5QX yxVQ== X-Gm-Message-State: AOAM532X88R4f4AvsZI2BqSul+OP+t7DtX3W/oMC98XpxTxpDmSUO40U 7ttrDHF0gpds82ZkGHZe2PVDxqRsn7xUyw== X-Received: by 2002:a05:651c:4d4:: with SMTP id e20mr3328842lji.130.1628892159509; Fri, 13 Aug 2021 15:02:39 -0700 (PDT) Received: from localhost.localdomain (c-fdcc225c.014-348-6c756e10.bbcust.telenor.se. [92.34.204.253]) by smtp.gmail.com with ESMTPSA id s17sm274912ljp.61.2021.08.13.15.02.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Aug 2021 15:02:39 -0700 (PDT) From: Linus Walleij To: netdev@vger.kernel.org, "David S . Miller" , Jakub Kicinski Cc: Imre Kaloz , Krzysztof Halasa , Linus Walleij , Arnd Bergmann Subject: [PATCH net-next 4/6 v2] ixp4xx_eth: Stop referring to GPIOs Date: Sat, 14 Aug 2021 00:00:09 +0200 Message-Id: <20210813220011.921211-5-linus.walleij@linaro.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210813220011.921211-1-linus.walleij@linaro.org> References: <20210813220011.921211-1-linus.walleij@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The driver is being passed interrupts, then looking up the same interrupts as GPIOs a second time to convert them into interrupts and set properties on them. This is pointless: the GPIO and irqchip APIs of a GPIO chip are orthogonal. Just request the interrupts and be done with it, drop reliance on any GPIO functions or definitions. Use devres-managed functions and add a small devress quirk to unregister the clock as well and we can rely on devres to handle all the resources and cut down a bunch of boilerplate in the process. Cc: Arnd Bergmann Signed-off-by: Linus Walleij --- drivers/net/ethernet/xscale/ptp_ixp46x.c | 84 ++++++++---------------- 1 file changed, 28 insertions(+), 56 deletions(-) -- 2.31.1 diff --git a/drivers/net/ethernet/xscale/ptp_ixp46x.c b/drivers/net/ethernet/xscale/ptp_ixp46x.c index 466f233edd21..c7ff150bf23f 100644 --- a/drivers/net/ethernet/xscale/ptp_ixp46x.c +++ b/drivers/net/ethernet/xscale/ptp_ixp46x.c @@ -7,7 +7,6 @@ #include #include #include -#include #include #include #include @@ -23,8 +22,6 @@ #define DRIVER "ptp_ixp46x" #define N_EXT_TS 2 -#define MASTER_GPIO 8 -#define SLAVE_GPIO 7 struct ixp_clock { struct ixp46x_ts_regs *regs; @@ -245,38 +242,6 @@ static const struct ptp_clock_info ptp_ixp_caps = { static struct ixp_clock ixp_clock; -static int setup_interrupt(int gpio) -{ - int irq; - int err; - - err = gpio_request(gpio, "ixp4-ptp"); - if (err) - return err; - - err = gpio_direction_input(gpio); - if (err) - return err; - - irq = gpio_to_irq(gpio); - if (irq < 0) - return irq; - - err = irq_set_irq_type(irq, IRQF_TRIGGER_FALLING); - if (err) { - pr_err("cannot set trigger type for irq %d\n", irq); - return err; - } - - err = request_irq(irq, isr, 0, DRIVER, &ixp_clock); - if (err) { - pr_err("request_irq failed for irq %d\n", irq); - return err; - } - - return irq; -} - int ixp46x_ptp_find(struct ixp46x_ts_regs *__iomem *regs, int *phc_index) { *regs = ixp_clock.regs; @@ -289,18 +254,20 @@ int ixp46x_ptp_find(struct ixp46x_ts_regs *__iomem *regs, int *phc_index) } EXPORT_SYMBOL_GPL(ixp46x_ptp_find); -static int ptp_ixp_remove(struct platform_device *pdev) +/* Called from the registered devm action */ +static void ptp_ixp_unregister_action(void *d) { - free_irq(ixp_clock.master_irq, &ixp_clock); - free_irq(ixp_clock.slave_irq, &ixp_clock); - ptp_clock_unregister(ixp_clock.ptp_clock); - ixp_clock.ptp_clock = NULL; + struct ptp_clock *ptp_clock = d; - return 0; + ptp_clock_unregister(ptp_clock); + ixp_clock.ptp_clock = NULL; } static int ptp_ixp_probe(struct platform_device *pdev) { + struct device *dev = &pdev->dev; + int ret; + ixp_clock.regs = devm_platform_ioremap_resource(pdev, 0); ixp_clock.master_irq = platform_get_irq(pdev, 0); ixp_clock.slave_irq = platform_get_irq(pdev, 1); @@ -315,34 +282,39 @@ static int ptp_ixp_probe(struct platform_device *pdev) if (IS_ERR(ixp_clock.ptp_clock)) return PTR_ERR(ixp_clock.ptp_clock); + ret = devm_add_action_or_reset(dev, ptp_ixp_unregister_action, + ixp_clock.ptp_clock); + if (ret) { + dev_err(dev, "failed to install clock removal handler\n"); + return ret; + } + __raw_writel(DEFAULT_ADDEND, &ixp_clock.regs->addend); __raw_writel(1, &ixp_clock.regs->trgt_lo); __raw_writel(0, &ixp_clock.regs->trgt_hi); __raw_writel(TTIPEND, &ixp_clock.regs->event); - if (ixp_clock.master_irq != setup_interrupt(MASTER_GPIO)) { - pr_err("failed to setup gpio %d as irq\n", MASTER_GPIO); - goto no_master; - } - if (ixp_clock.slave_irq != setup_interrupt(SLAVE_GPIO)) { - pr_err("failed to setup gpio %d as irq\n", SLAVE_GPIO); - goto no_slave; - } + ret = devm_request_irq(dev, ixp_clock.master_irq, isr, + 0, DRIVER, &ixp_clock); + if (ret) + return dev_err_probe(dev, ret, + "request_irq failed for irq %d\n", + ixp_clock.master_irq); + + ret = devm_request_irq(dev, ixp_clock.slave_irq, isr, + 0, DRIVER, &ixp_clock); + if (ret) + return dev_err_probe(dev, ret, + "request_irq failed for irq %d\n", + ixp_clock.slave_irq); return 0; -no_slave: - free_irq(ixp_clock.master_irq, &ixp_clock); -no_master: - ptp_clock_unregister(ixp_clock.ptp_clock); - ixp_clock.ptp_clock = NULL; - return -ENODEV; } static struct platform_driver ptp_ixp_driver = { .driver.name = "ptp-ixp46x", .driver.suppress_bind_attrs = true, .probe = ptp_ixp_probe, - .remove = ptp_ixp_remove, }; module_platform_driver(ptp_ixp_driver); From patchwork Fri Aug 13 22:00:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 496934 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A518BC4338F for ; Fri, 13 Aug 2021 22:02:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8EB2560232 for ; Fri, 13 Aug 2021 22:02:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235172AbhHMWDS (ORCPT ); Fri, 13 Aug 2021 18:03:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235144AbhHMWDM (ORCPT ); Fri, 13 Aug 2021 18:03:12 -0400 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE9C4C0613A4 for ; Fri, 13 Aug 2021 15:02:42 -0700 (PDT) Received: by mail-lf1-x131.google.com with SMTP id r9so13061996lfn.3 for ; Fri, 13 Aug 2021 15:02:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zdoJvRdg/wiFMUqCvkYyo5RNQaUscCsPcncLCMhtPj8=; b=f8XsZ752SQAycow7/iB1RfXwOm+G3Zp1Tz6qAUMBy1R6O2FZ9qoZ22yYdqZBOZyxI5 v3G4fUbh1rqqvN0qM0LRurSHXB2l8P7hv7TZMN7RWpSX3vg4fT7qmMPSZ39ySSJKgCIW zh0+qsnpHTjybYQ3emFBesytEPSiPLomOk4WZXeUhPXg7xMDJr9+NHnSschXrogQNu5N 77WWZPs6lfHmzNq54qZN0YjSYLmR9rmbF3K0Fo2aMcIyQKTIaHj/SLjEi3pg6/KSlvZx ljYhoxKherijbquT7IqBSmIQaeVMhPNxIXhfLLXjGWkgkaNWo67yeVYHxLWob2WT+y2H tdVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zdoJvRdg/wiFMUqCvkYyo5RNQaUscCsPcncLCMhtPj8=; b=CKrGc8ayhZBpOFUxmA52ef2MkXQVKjeFbzPv//VV0YlmsubGM7onxNHRN0N3CI2wyH u7OuVCixxBx57ghCcohQszJPzBie+CIsMLu5RJxfU4IlYTFUPD6apY/C8PNU4TOt0ysr BMLkwt8nxSyzGzRVrSGBw2pjF25gpbqrRWAcuf+X4YSI3P0UXmJRcYTpGkNCUh82CWFe BON8+0Xq45+xAx64vCxTds29ZR4lMdaxUBiiUVgfuIoV1BisKSEL4KAj4DYBUub6KaFA 75EC1apksJJQxDjzwJS943yODUGSeDiDFjr04VcVmzuRR/b+513Np5ttDJZ6y2sQyU6j FP3w== X-Gm-Message-State: AOAM532Hn9c0c5FworOrE5EvrCUPpjHs15G8JlAJm3N3mhTmnOWB8Io0 kfZYrs4ApwCMTqFIBhZulfRFgrPolshjcw== X-Google-Smtp-Source: ABdhPJxe0oddE+SnbYcUknKoKmvFBnFFiwpK0p+40INIEZBanyAowK9scIelaK+O/i9oOfhCzlKfAg== X-Received: by 2002:ac2:5496:: with SMTP id t22mr3086990lfk.445.1628892160938; Fri, 13 Aug 2021 15:02:40 -0700 (PDT) Received: from localhost.localdomain (c-fdcc225c.014-348-6c756e10.bbcust.telenor.se. [92.34.204.253]) by smtp.gmail.com with ESMTPSA id s17sm274912ljp.61.2021.08.13.15.02.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Aug 2021 15:02:40 -0700 (PDT) From: Linus Walleij To: netdev@vger.kernel.org, "David S . Miller" , Jakub Kicinski Cc: Imre Kaloz , Krzysztof Halasa , Linus Walleij , devicetree@vger.kernel.org, Arnd Bergmann , Rob Herring Subject: [PATCH net-next 5/6 v2] ixp4xx_eth: Add devicetree bindings Date: Sat, 14 Aug 2021 00:00:10 +0200 Message-Id: <20210813220011.921211-6-linus.walleij@linaro.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210813220011.921211-1-linus.walleij@linaro.org> References: <20210813220011.921211-1-linus.walleij@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This adds device tree bindings for the IXP46x PTP Timer, a companion to the IXP4xx ethernet in newer platforms. Cc: devicetree@vger.kernel.org Cc: Arnd Bergmann Reviewed-by: Rob Herring Signed-off-by: Linus Walleij --- .../bindings/net/intel,ixp46x-ptp-timer.yaml | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/intel,ixp46x-ptp-timer.yaml diff --git a/Documentation/devicetree/bindings/net/intel,ixp46x-ptp-timer.yaml b/Documentation/devicetree/bindings/net/intel,ixp46x-ptp-timer.yaml new file mode 100644 index 000000000000..8b9b3f915d92 --- /dev/null +++ b/Documentation/devicetree/bindings/net/intel,ixp46x-ptp-timer.yaml @@ -0,0 +1,54 @@ +# 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 + +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 + 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"; + }; From patchwork Fri Aug 13 22:00:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 496581 Delivered-To: patch@linaro.org Received: by 2002:a02:cf8a:0:0:0:0:0 with SMTP id w10csp973852jar; Fri, 13 Aug 2021 15:02:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyP0NaPXiFvpZeIG61jmG1K2ZO/pMRQwlCoTa5Ksqq3BccGV8c966eOtDHP91iK1SwJvoMx X-Received: by 2002:a17:906:3ada:: with SMTP id z26mr4509373ejd.404.1628892170564; Fri, 13 Aug 2021 15:02:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628892170; cv=none; d=google.com; s=arc-20160816; b=D4zh+n3Itm4WCijZSZhZcCnPAe41v/NtMvRNvRSKsM4ocqpLREXWCP5/sAsqbqzfUd c/wkYKIDwoZGyhGUrwQGMaurODa9RE5U5zF0ZAoNkl3Xcd3M9HSSYDps9reoo1izv/r8 ByrMqCBpJzAq/bRteBRq9oWkrt2F61K6Mc7QKuDIRPsKUbVfnFIV4p1pCfiBecGRrAX+ NZrwTEbp6mROHZ7z51UjneFn2z8/2LGqSTrL53uWhtZ0FMhqwbYUxNNAIil0ThI+BBfm ooRQz9AEvaBqd0M3w+vbDPppYUbQBe+2kaQQnk/8Zn3V2BMqILZdMflTBHNnf9neYKEp 9iYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Nj5RTF35gQsW0AqxyNE0lXSMA9c7c05/wwrJgBCDQ4U=; b=Ftn/Ffsz0Uu5YdDnrQXqLL9Yu3PsOp4hgS1vyNIsDZtp3WmAU8+Ok/1P+lAU+aD134 l+94c8SluDL4Tb+FYYf7ZxvvGUCaXvn5un+ZZDNxZ+YQuAQIbYC/EwosfIem7kmd9NnS j8dcgWpoVJL7tyeT0ySlh2Qped7mYM/epfkfDLMSph32QN3INTzWbRRy8dw91h59kISu gxblbXKm/KIpnQhPaZ/W9ds6GR8A0AtBMTs8kSd7l194jIRhLVRq2T7WeR1C+ez6hLHV n43yWSSs+0Gt27l4x2nrM9nWhh5Ke5STFVPcsO5xOXCLWjzIeSwSmMopb0TawYg3Nnt/ p+sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oib6oA8E; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s18si3299982eji.591.2021.08.13.15.02.50; Fri, 13 Aug 2021 15:02:50 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oib6oA8E; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234869AbhHMWDQ (ORCPT + 8 others); Fri, 13 Aug 2021 18:03:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235246AbhHMWDM (ORCPT ); Fri, 13 Aug 2021 18:03:12 -0400 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF33FC06129D for ; Fri, 13 Aug 2021 15:02:43 -0700 (PDT) Received: by mail-lf1-x129.google.com with SMTP id n17so22432957lft.13 for ; Fri, 13 Aug 2021 15:02:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Nj5RTF35gQsW0AqxyNE0lXSMA9c7c05/wwrJgBCDQ4U=; b=oib6oA8EaW2M8z2hR0IrRBmSmBQ9PIGW9IK/vqwp9Eo6k1+FUphjHMx4QaVQeiSAGb b2kfVEa7/XznTL07vUYqpcZKW57fhTUsrK2j3M7MWqyaBMJRRhoQniBfL62/VLxaL23P HOVKUxy86dxVKxlsLRdhSB10rAD5fhAhX/yiKvwejiaLDNAAzeA2l+bcWGTnWCV+egsX DQU7h5A8E76P7TfWqzvmUQr8JdSxVwuRvbTAxSwaiWMXLzOF0XXIt8VKzE6zanCF0gat tKGCn0Y/gDWLK7uK+w2dWD7zRBGMm+6iQofxciolKSA52hVe2yfMWuwZAHAogc7ppxvZ XAeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Nj5RTF35gQsW0AqxyNE0lXSMA9c7c05/wwrJgBCDQ4U=; b=BKPOPwSUiir47rjp19dtnLe1WJrAxZPj+wPVuCjPjoBxCjBEt0r7QJFeuC32n/MZAZ d5tjDmsVZBainWkG0UtO+dtJ3M9ARr4iTAa2vbXraVVUriVy/FI0plZYjYYgpvzIY/2x 0ZPmxUHegNcIFcbI2BziMCuFMIdmorsWrxaCFVQGEm5LX0kJYvzZM+36ErAUGX4+/K5a uQCAHZI7T8NIUcH8qQvKuHm9TWulEir68cki7I/4L3yQZJDyIVkzIE7YSJiiVaawkkAx 7ufxtZpXTDX8Rq6ugI95o/JOywPklfygC4tVhO+TLB1X2k/JaQzM/FxY1vAescZvzkDY TyMw== X-Gm-Message-State: AOAM533aNKBE7Uv8iRxmM6qVJGBVJ+4tGK6kRIvcmgTnlorRZWHO4gyD mLOky08Sl2RVQhF7gNqVdHK9Q0hhFThqSg== X-Received: by 2002:ac2:5503:: with SMTP id j3mr3042988lfk.397.1628892162061; Fri, 13 Aug 2021 15:02:42 -0700 (PDT) Received: from localhost.localdomain (c-fdcc225c.014-348-6c756e10.bbcust.telenor.se. [92.34.204.253]) by smtp.gmail.com with ESMTPSA id s17sm274912ljp.61.2021.08.13.15.02.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Aug 2021 15:02:41 -0700 (PDT) From: Linus Walleij To: netdev@vger.kernel.org, "David S . Miller" , Jakub Kicinski Cc: Imre Kaloz , Krzysztof Halasa , Linus Walleij , Arnd Bergmann Subject: [PATCH net-next 6/6 v2] ixp4xx_eth: Probe the PTP module from the device tree Date: Sat, 14 Aug 2021 00:00:11 +0200 Message-Id: <20210813220011.921211-7-linus.walleij@linaro.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210813220011.921211-1-linus.walleij@linaro.org> References: <20210813220011.921211-1-linus.walleij@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This adds device tree probing support for the PTP module adjacent to the ethernet module. It is pretty straight forward, all resources are in the device tree as they come to the platform device. Cc: Arnd Bergmann Signed-off-by: Linus Walleij --- drivers/net/ethernet/xscale/ptp_ixp46x.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) -- 2.31.1 diff --git a/drivers/net/ethernet/xscale/ptp_ixp46x.c b/drivers/net/ethernet/xscale/ptp_ixp46x.c index c7ff150bf23f..ecece21315c3 100644 --- a/drivers/net/ethernet/xscale/ptp_ixp46x.c +++ b/drivers/net/ethernet/xscale/ptp_ixp46x.c @@ -6,6 +6,7 @@ */ #include #include +#include #include #include #include @@ -311,9 +312,19 @@ static int ptp_ixp_probe(struct platform_device *pdev) return 0; } +static const struct of_device_id ptp_ixp_match[] = { + { + .compatible = "intel,ixp46x-ptp-timer", + }, + { }, +}; + static struct platform_driver ptp_ixp_driver = { - .driver.name = "ptp-ixp46x", - .driver.suppress_bind_attrs = true, + .driver = { + .name = "ptp-ixp46x", + .of_match_table = ptp_ixp_match, + .suppress_bind_attrs = true, + }, .probe = ptp_ixp_probe, }; module_platform_driver(ptp_ixp_driver);