From patchwork Sat Sep 23 16:02:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 13396842 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6B3F0CE7A89 for ; Sat, 23 Sep 2023 16:03:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=f5esRgEd6SffXM7Md+K1i016QqJb+N8efoLh3Kl2G5o=; b=UHZyxqNNDj222/ vVGjpcTaZHJhMO/HwizGTHRW3dRLyW466gOgxKDyY1n3MpeiakAf8cq4O08p6/ecbWkwXfog18YUY CiteThVmWhf1F3+nU7jc8lFJxi3TkeeKjpchfUrAk1rVvF6E7dKwp6FLL+R4U3ZOiIsHTwJacVznU RVImURdzI+Vw9DdkttcHN4EeirdUsIWvpiXcDdL5CEyJ/rF5sS2e5J83h5f/U1Y+MWyzMDGyfL5nq n7AtyajuEv94sW1TQMWxhVEi/2vSdu8jIkY9RMJyyhM89WOWRS9McLyJY3yvQ6BYLyvEcyWDlWCQY fqmnqwuDS2MGHhFrnqOQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qk55b-00BAaS-22; Sat, 23 Sep 2023 16:02:39 +0000 Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qk55Y-00BAZO-36 for linux-arm-kernel@lists.infradead.org; Sat, 23 Sep 2023 16:02:38 +0000 Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-504427aae4fso2256674e87.1 for ; Sat, 23 Sep 2023 09:02:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695484952; x=1696089752; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=+/S5F/94lzE+JzXRkckvi7oOP9RR2RmQ+CAb+mf1D9Y=; b=G8P362wdmrbBMK1E6tc6Yes8S5NWBHji7t8XrnLajYYXANyKlY2Ksb/qELXcQXYulI tuDKbeUTIPzQW3v7a3iKqVB2zZ1gVcmkw/7dhZZ9822tUBQdqVHZeDow8XRINJkfgbk9 vSjE3OqkBoN7bb5wySndX14mZMa3/OCZOqIe6BKD+FsRv63YEzb8OCYP8t4WjIr+vxHp Kj1PCkT1ZwmHRtT8WWl5LObTQzDvsK0VKfX3RxNikER/lN5V3QiEgrAAXEL6XvukH1yT o07o4s4tIHwzDxv8r7yOq1gojLoFLAXWePqIywU3Wzaty5jUfif8it31HVdzKs18tvqW 9lwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695484952; x=1696089752; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+/S5F/94lzE+JzXRkckvi7oOP9RR2RmQ+CAb+mf1D9Y=; b=M0MOFEMpG6OOy3xq//wkinqanoqoeam7KWpniABdR1J1FcJPHUXB6uYjLrqzi8aD2D gSm3hYPN2jfj/oFOkb/xoLB4OjnPhpw5NmIpBb/MYy8fZxYqFzzvP8RTiZ/+iy1bfrA1 /X1X7EoMJEn1+T5hwLQvtplKC+KuEqvU/74acq6sS0MOu2yRjNaY1oS+0wIhbWvkcEYd X3bIX28IIExwhgoGMt/hQCcE8FVcDW/nO/mc2PXJmJZpbGGSjRtHRdmDqZHX5qL4BAkN uSBkbNAmlGs5xcNTOSKTmZW4f5pM4JUkaniU2Leaxv5JMHlXxQa9o+0BeN/AAmQKlO7n VonA== X-Gm-Message-State: AOJu0Yyy8ncowNDRhRIO21Xnb+MARM4db4luqIzxXr2mZBGJtdd55UpQ JDn9AMQb4QxRBgE111RpI2Je5Pegh+lG0F7xaz4= X-Google-Smtp-Source: AGHT+IHz6zuqxUx2A42d7VY0KwoBvL6EpqxBR+yLkCltJIMjcWgRHY1UZ1qMsb4KvCjl6TcaPnwNbg== X-Received: by 2002:a05:6512:4019:b0:501:be4d:6dc5 with SMTP id br25-20020a056512401900b00501be4d6dc5mr2207584lfb.8.1695484952406; Sat, 23 Sep 2023 09:02:32 -0700 (PDT) Received: from [192.168.1.2] (c-05d8225c.014-348-6c756e10.bbcust.telenor.se. [92.34.216.5]) by smtp.gmail.com with ESMTPSA id v30-20020a056512049e00b004fdde1db756sm1132835lfq.26.2023.09.23.09.02.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Sep 2023 09:02:32 -0700 (PDT) From: Linus Walleij Date: Sat, 23 Sep 2023 18:02:28 +0200 Subject: [PATCH v3 1/2] gpio: Rewrite IXP4xx GPIO bindings in schema MIME-Version: 1.0 Message-Id: <20230923-ixp4xx-gpio-clocks-v3-1-66f8fe4e7f15@linaro.org> References: <20230923-ixp4xx-gpio-clocks-v3-0-66f8fe4e7f15@linaro.org> In-Reply-To: <20230923-ixp4xx-gpio-clocks-v3-0-66f8fe4e7f15@linaro.org> To: Linus Walleij , Imre Kaloz , Krzysztof Halasa , Bartosz Golaszewski , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, Linus Walleij , Rob Herring X-Mailer: b4 0.12.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230923_090236_998551_371E3F84 X-CRM114-Status: GOOD ( 20.82 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This rewrites the IXP4xx GPIO bindings to use YAML schema, and adds two new properties to enable fixed clock output on pins 14 and 15. Reviewed-by: Rob Herring Signed-off-by: Linus Walleij --- .../devicetree/bindings/gpio/intel,ixp4xx-gpio.txt | 38 ----------- .../bindings/gpio/intel,ixp4xx-gpio.yaml | 73 ++++++++++++++++++++++ MAINTAINERS | 2 +- 3 files changed, 74 insertions(+), 39 deletions(-) diff --git a/Documentation/devicetree/bindings/gpio/intel,ixp4xx-gpio.txt b/Documentation/devicetree/bindings/gpio/intel,ixp4xx-gpio.txt deleted file mode 100644 index 8dc41ed99685..000000000000 --- a/Documentation/devicetree/bindings/gpio/intel,ixp4xx-gpio.txt +++ /dev/null @@ -1,38 +0,0 @@ -Intel IXP4xx XScale Networking Processors GPIO - -This GPIO controller is found in the Intel IXP4xx processors. -It supports 16 GPIO lines. - -The interrupt portions of the GPIO controller is hierarchical: -the synchronous edge detector is part of the GPIO block, but the -actual enabling/disabling of the interrupt line is done in the -main IXP4xx interrupt controller which has a 1:1 mapping for -the first 12 GPIO lines to 12 system interrupts. - -The remaining 4 GPIO lines can not be used for receiving -interrupts. - -The interrupt parent of this GPIO controller must be the -IXP4xx interrupt controller. - -Required properties: - -- compatible : Should be - "intel,ixp4xx-gpio" -- reg : Should contain registers location and length -- gpio-controller : marks this as a GPIO controller -- #gpio-cells : Should be 2, see gpio/gpio.txt -- interrupt-controller : marks this as an interrupt controller -- #interrupt-cells : a standard two-cell interrupt, see - interrupt-controller/interrupts.txt - -Example: - -gpio0: gpio@c8004000 { - compatible = "intel,ixp4xx-gpio"; - reg = <0xc8004000 0x1000>; - gpio-controller; - #gpio-cells = <2>; - interrupt-controller; - #interrupt-cells = <2>; -}; diff --git a/Documentation/devicetree/bindings/gpio/intel,ixp4xx-gpio.yaml b/Documentation/devicetree/bindings/gpio/intel,ixp4xx-gpio.yaml new file mode 100644 index 000000000000..bfcb1f364c3a --- /dev/null +++ b/Documentation/devicetree/bindings/gpio/intel,ixp4xx-gpio.yaml @@ -0,0 +1,73 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/gpio/intel,ixp4xx-gpio.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Intel IXP4xx XScale Networking Processors GPIO Controller + +description: | + This GPIO controller is found in the Intel IXP4xx + processors. It supports 16 GPIO lines. + The interrupt portions of the GPIO controller is hierarchical. + The synchronous edge detector is part of the GPIO block, but the + actual enabling/disabling of the interrupt line is done in the + main IXP4xx interrupt controller which has a 1-to-1 mapping for + the first 12 GPIO lines to 12 system interrupts. + The remaining 4 GPIO lines can not be used for receiving + interrupts. + The interrupt parent of this GPIO controller must be the + IXP4xx interrupt controller. + GPIO 14 and 15 can be used as clock outputs rather than GPIO, + and this can be enabled by a special flag. + +maintainers: + - Linus Walleij + +properties: + compatible: + const: intel,ixp4xx-gpio + + reg: + maxItems: 1 + + gpio-controller: true + + "#gpio-cells": + const: 2 + + interrupt-controller: true + + "#interrupt-cells": + const: 2 + + intel,ixp4xx-gpio14-clkout: + description: If defined, enables clock output on GPIO 14 + instead of GPIO. + type: boolean + + intel,ixp4xx-gpio15-clkout: + description: If defined, enables clock output on GPIO 15 + instead of GPIO. + type: boolean + +required: + - compatible + - reg + - "#gpio-cells" + - interrupt-controller + - "#interrupt-cells" + +additionalProperties: false + +examples: + - | + #include + gpio@c8004000 { + compatible = "intel,ixp4xx-gpio"; + reg = <0xc8004000 0x1000>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; diff --git a/MAINTAINERS b/MAINTAINERS index 90f13281d297..4e216887eb76 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2215,7 +2215,7 @@ M: Krzysztof Halasa L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) S: Maintained F: Documentation/devicetree/bindings/arm/intel-ixp4xx.yaml -F: Documentation/devicetree/bindings/gpio/intel,ixp4xx-gpio.txt +F: Documentation/devicetree/bindings/gpio/intel,ixp4xx-gpio.yaml F: Documentation/devicetree/bindings/interrupt-controller/intel,ixp4xx-interrupt.yaml F: Documentation/devicetree/bindings/memory-controllers/intel,ixp4xx-expansion* F: Documentation/devicetree/bindings/timer/intel,ixp4xx-timer.yaml From patchwork Sat Sep 23 16:02:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 13396841 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 06E99CE7A89 for ; Sat, 23 Sep 2023 16:03:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=nN9dNXRP2JxturXQTBqZwZM5/M0blol90sqBqkk3m20=; b=rIQQ4IkHinEUL0 7biJYxOUfbFIjM9N3jO01AdfJLoidypRdK4t818lgwKPh6GM1EqagIybO6bvj/jTPjiT+gAcQ0fKi tFEzctgW2d4bjLeQi9k60LneDRS0EygO2KBShkY2KGQtClnXPdUdQpGgActRkbjr6WmLvUEbXOcJ9 k7T4awCUKwmO12t32Evn/UtjUVXrGU+lYJcKa8gm8KNIiYg5Qu5UA0eTN27i1l7CfEyjst6ntRe9B jggfJbiJrq8ae02+3mmwc4PaZcuSvOfBmTI1yxmwJQCPcNEsOokfi5EhiKwUiGs4gE9PGKSV1TGN9 kGCk+dclPmM1lw8rMnKA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qk55c-00BAb5-2P; Sat, 23 Sep 2023 16:02:40 +0000 Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qk55Z-00BAZR-0u for linux-arm-kernel@lists.infradead.org; Sat, 23 Sep 2023 16:02:39 +0000 Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2c147b96af8so24567531fa.0 for ; Sat, 23 Sep 2023 09:02:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695484953; x=1696089753; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=qT4V244MIYb7HC5hpsM98rjOj8T0H65YgdniWFrcK+Y=; b=ThaDNi31Pr4Gl54Esz9JOkkyqNN9U8E+2r29/1qgYpPXOMH1uT+oki3V+ya8VS61dW ROzEbrziY311mpCDMpdtvxt8QTHt12gTU/EcANkS3wutWV/pFB74V1XqjecJT8FYAQuC rLYCJlzjIcqe3fN4wkptGSNAdYCjV6vnWmDgKUgN5LWbq7U/WUNfxBTWcqB0Ztn0RtQ0 w3NLGJ2Jw6YlH/3zJQzXnCxB8SYl4uqxWOOSAsg+2fjpZAMvtq0Qn4ufg2Vnvf4Trlg4 E6blNKHmiTSRnl4D+5WoL1KO2C/ZRhwRAkUxYmsA8DnzpWMzCwEcNFqyDrSlr+B5sGaP /etg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695484953; x=1696089753; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qT4V244MIYb7HC5hpsM98rjOj8T0H65YgdniWFrcK+Y=; b=gOp0/P11Z1RVQ5GwdroVhwYyCSJ9iWPvsx5ji+VtF5MaJRie6QSLdIl0IxNTPXYCtt Z35aJiJAD2ZQwfssc5j9WARLwm0RhZAZuiCNNmbNTKO/41ZMZls6B7XiXH0IcO6vJHol v2UyflLiwmGcEGXrLCjctqdZVRmKrXnb+xk7ArXbckyPYIFqhfC1xDb9Tk1gZXqc6wFD E0iDE0/jqPDaCKkACnL3aa7cszcBdDGkwxZaOr6iBIOTK2ysh6ahcwhUoAHjREcoDJTF LcJIclTlmOMlEm6D5KzYuKtUlGGngvy1mBfraZRrJRwsoDz46M9l4afWQ29dPphmySYz /ZVA== X-Gm-Message-State: AOJu0YyxcgMWvxGL8GArMxCEZUYEgK/ZndS+X6GlqQr7tKWN8glnyVRM C7sXNMki69fC/sTBjgAn7ZH4uQ== X-Google-Smtp-Source: AGHT+IEKURJkGJhP0mJeakLX/wl7+J+oe8KSwlc2/02jmyzxZIWMc+9FCake5IJFQu/VzWEJmuYBCQ== X-Received: by 2002:a05:6512:251e:b0:502:a588:6609 with SMTP id be30-20020a056512251e00b00502a5886609mr2212028lfb.3.1695484953360; Sat, 23 Sep 2023 09:02:33 -0700 (PDT) Received: from [192.168.1.2] (c-05d8225c.014-348-6c756e10.bbcust.telenor.se. [92.34.216.5]) by smtp.gmail.com with ESMTPSA id v30-20020a056512049e00b004fdde1db756sm1132835lfq.26.2023.09.23.09.02.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Sep 2023 09:02:32 -0700 (PDT) From: Linus Walleij Date: Sat, 23 Sep 2023 18:02:29 +0200 Subject: [PATCH v3 2/2] gpio: ixp4xx: Handle clock output on pin 14 and 15 MIME-Version: 1.0 Message-Id: <20230923-ixp4xx-gpio-clocks-v3-2-66f8fe4e7f15@linaro.org> References: <20230923-ixp4xx-gpio-clocks-v3-0-66f8fe4e7f15@linaro.org> In-Reply-To: <20230923-ixp4xx-gpio-clocks-v3-0-66f8fe4e7f15@linaro.org> To: Linus Walleij , Imre Kaloz , Krzysztof Halasa , Bartosz Golaszewski , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, Linus Walleij X-Mailer: b4 0.12.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230923_090237_319919_6413E8B7 X-CRM114-Status: GOOD ( 20.47 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This makes it possible to provide basic clock output on pins 14 and 15. The clocks are typically used by random electronics, not modeled in the device tree, so they just need to be provided on request. In order to not disturb old systems that require that the hardware defaults are kept in the clock setting bits, we only manipulate these if either device tree property is present. Once we know a device needs one of the clocks we can set it in the device tree. Signed-off-by: Linus Walleij Reviewed-by: Andy Shevchenko --- drivers/gpio/gpio-ixp4xx.c | 49 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-ixp4xx.c b/drivers/gpio/gpio-ixp4xx.c index dde6cf3a5779..1ca3217d0aab 100644 --- a/drivers/gpio/gpio-ixp4xx.c +++ b/drivers/gpio/gpio-ixp4xx.c @@ -38,6 +38,18 @@ #define IXP4XX_GPIO_STYLE_MASK GENMASK(2, 0) #define IXP4XX_GPIO_STYLE_SIZE 3 +/* + * Clock output control register defines. + */ +#define IXP4XX_GPCLK_CLK0DC_SHIFT 0 +#define IXP4XX_GPCLK_CLK0TC_SHIFT 4 +#define IXP4XX_GPCLK_CLK0_MASK GENMASK(7, 0) +#define IXP4XX_GPCLK_MUX14 BIT(8) +#define IXP4XX_GPCLK_CLK1DC_SHIFT 16 +#define IXP4XX_GPCLK_CLK1TC_SHIFT 20 +#define IXP4XX_GPCLK_CLK1_MASK GENMASK(23, 16) +#define IXP4XX_GPCLK_MUX15 BIT(24) + /** * struct ixp4xx_gpio - IXP4 GPIO state container * @dev: containing device for this instance @@ -202,6 +214,8 @@ static int ixp4xx_gpio_probe(struct platform_device *pdev) struct ixp4xx_gpio *g; struct gpio_irq_chip *girq; struct device_node *irq_parent; + bool clk_14, clk_15; + u32 val; int ret; g = devm_kzalloc(dev, sizeof(*g), GFP_KERNEL); @@ -231,7 +245,40 @@ static int ixp4xx_gpio_probe(struct platform_device *pdev) */ if (of_machine_is_compatible("dlink,dsm-g600-a") || of_machine_is_compatible("iom,nas-100d")) - __raw_writel(0x0, g->base + IXP4XX_REG_GPCLK); + val = 0; + else + val = __raw_readl(g->base + IXP4XX_REG_GPCLK); + + /* + * If either clock output is enabled explicitly in the device tree + * we take full control of the clock by masking off all bits for + * the clock control and selectively enabling them. Otherwise + * we leave the hardware default settings. + * + * Enable clock outputs with default timings of requested clock. + * If you need control over TC and DC, add these to the device + * tree bindings and use them here. + */ + clk_14 = of_property_read_bool(np, "intel,ixp4xx-gpio14-clkout"); + clk_15 = of_property_read_bool(np, "intel,ixp4xx-gpio15-clkout"); + if (clk_14 || clk_15) { + val &= ~(IXP4XX_GPCLK_MUX14 | IXP4XX_GPCLK_MUX15); + val &= ~IXP4XX_GPCLK_CLK0_MASK; + val &= ~IXP4XX_GPCLK_CLK1_MASK; + if (clk_14) { + val |= (0 << IXP4XX_GPCLK_CLK0DC_SHIFT); + val |= (1 << IXP4XX_GPCLK_CLK0TC_SHIFT); + val |= IXP4XX_GPCLK_MUX14; + } + + if (clk_15) { + val |= (0 << IXP4XX_GPCLK_CLK1DC_SHIFT); + val |= (1 << IXP4XX_GPCLK_CLK1TC_SHIFT); + val |= IXP4XX_GPCLK_MUX15; + } + } + + __raw_writel(val, g->base + IXP4XX_REG_GPCLK); /* * This is a very special big-endian ARM issue: when the IXP4xx is