From patchwork Fri Dec 16 18:35:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hawkins, Nick" X-Patchwork-Id: 34049 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp1133672wrn; Fri, 16 Dec 2022 10:42:52 -0800 (PST) X-Google-Smtp-Source: AA0mqf6UlMaER3t5eeZQ2FnG8u0lryNCHbLIIGDQwyhwx2PMDg5rW3xBLbOUdlD20CG/RbBhKK25 X-Received: by 2002:aa7:c944:0:b0:467:75c6:4565 with SMTP id h4-20020aa7c944000000b0046775c64565mr25044419edt.9.1671216171817; Fri, 16 Dec 2022 10:42:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671216171; cv=none; d=google.com; s=arc-20160816; b=faa4LenWSHyjVshBpJV3WO6UwHEOfSXqjgyBsfPuV3pmzPNOllJejKdVnnnSKklvyN tEVav8b4gGxSGPUakARJJ5cw+P/LaixFdAZfTDB7fcr0O7To00mYmYMezOlUSdVY8UlD sOQbVi84d08HWStxWbpDWNBg0MFKmiC2snYKr+lR0iM+KtSEgslZKqp5qwKCBzteO4Zw 0imFvHp1x3kgwCjUvMXyuWX+W5wYNVtZmrimaT39kY+mALy81imj324n9Fh+sNtu1jFK 4dzGiV2EtuMcTDAh8a/gIBD0+5bjBIDaKfnt+NPvPmodSMsIu46yv6bkHy/N3+CZGls6 +Zqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :to:from:dkim-signature; bh=6j+P5rPMSR/V07V6V4yi3Apu55sbMKl2KWyLgzQ4qoo=; b=wynhjz3i9+HZPzlIj7TPuiSsISBQmx4vOKxffGzVSqFpWOTQ5op9v12xD8wJJMt6G3 IRRtptITjcBzZrmOv5ZMMJ1/1Kn/uLOiHzIQH0baHCMVw+seJ7RXTXjmO4OEo3BN8BPE dVkMmXLwk+f211THnrefwpHxHDP/TAtm0rGiApnD3TIGE/K7nsafJCgQoZnr0uqiAU04 n6/+DfqHpclfUQ2zKGNjwV3qIIFRy036fQRnLOWsjQVbDX1sw64fwiwfM83l/CJsLEab a9/4zI/eMv78h9jjV3T17zOrXrubRttxmDh3pDs8dOjW0Hz0NM/aU5dCw3WkOCE/pU9R RJgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hpe.com header.s=pps0720 header.b="C2si/ZN3"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hpe.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m20-20020aa7c2d4000000b00461f0d84ee1si2476697edp.228.2022.12.16.10.42.28; Fri, 16 Dec 2022 10:42:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@hpe.com header.s=pps0720 header.b="C2si/ZN3"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hpe.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231345AbiLPShw (ORCPT + 99 others); Fri, 16 Dec 2022 13:37:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231759AbiLPShd (ORCPT ); Fri, 16 Dec 2022 13:37:33 -0500 Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77A0A2B243; Fri, 16 Dec 2022 10:37:31 -0800 (PST) Received: from pps.filterd (m0134425.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BGFLFeN032457; Fri, 16 Dec 2022 18:37:07 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : subject : date : message-id : in-reply-to : references; s=pps0720; bh=6j+P5rPMSR/V07V6V4yi3Apu55sbMKl2KWyLgzQ4qoo=; b=C2si/ZN3/56eOcCuRdXfkhx8BbteGYb3jon1qu5L5rFAIInI08sYqkoKZpZv37atQKXr kP6+1CFlWYBBKGshCOg/zcFQi/ca755rSB5XCQ1g9z4qUMLoaL/ZpH6ykcKy6HNjIY4P zoRWM1FPdwg7Y/aW6bQYvovpZJx+hbf68tmPa8hhusmTm89Q1BdStmy27ncndCvTXQ+Y bBnTALazpNaqg/jr3hAbEUPwsG9W4hrylgyA1B/wtSa9moLkOZ6W4bYdjnHM5sFJpMxF 7i2q+BKoHbM3HqwOApeN6Bt3RbvPlz6UzatwJDyfcetaFOkIzyUAUlx/IOMYx9hlUbL7 eg== Received: from p1lg14879.it.hpe.com (p1lg14879.it.hpe.com [16.230.97.200]) by mx0b-002e3701.pphosted.com (PPS) with ESMTPS id 3mgu8898yq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 16 Dec 2022 18:37:06 +0000 Received: from p1lg14885.dc01.its.hpecorp.net (unknown [10.119.18.236]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by p1lg14879.it.hpe.com (Postfix) with ESMTPS id 0AB2C31096; Fri, 16 Dec 2022 18:37:06 +0000 (UTC) Received: from hpe.com (unknown [16.231.227.36]) by p1lg14885.dc01.its.hpecorp.net (Postfix) with ESMTP id 75B4D8048F9; Fri, 16 Dec 2022 18:37:05 +0000 (UTC) From: nick.hawkins@hpe.com To: verdun@hpe.com, nick.hawkins@hpe.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, lee@kernel.org, linux@armlinux.org.uk, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v1 1/6] i2c: hpe: Add GXP SoC I2C Controller Date: Fri, 16 Dec 2022 12:35:27 -0600 Message-Id: <20221216183532.78933-2-nick.hawkins@hpe.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221216183532.78933-1-nick.hawkins@hpe.com> References: <20221216183532.78933-1-nick.hawkins@hpe.com> X-Proofpoint-GUID: Qox2BWv_eBdfLo0M1YlV6jWMOxjcHCru X-Proofpoint-ORIG-GUID: Qox2BWv_eBdfLo0M1YlV6jWMOxjcHCru X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-16_12,2022-12-15_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 clxscore=1015 suspectscore=0 bulkscore=0 adultscore=0 impostorscore=0 lowpriorityscore=0 phishscore=0 priorityscore=1501 mlxscore=0 malwarescore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212160162 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752397168381444773?= X-GMAIL-MSGID: =?utf-8?q?1752397168381444773?= From: Nick Hawkins The GXP SoC supports 10 I2C engines. Each I2C engine is completely independent and can function both as an I2C master and I2C slave. The I2C master can operate in a multi master environment. The engines support a scalable speed from 8kHZ to 1.5 Mhz. Signed-off-by: Nick Hawkins --- drivers/i2c/busses/Kconfig | 7 + drivers/i2c/busses/Makefile | 1 + drivers/i2c/busses/i2c-gxp.c | 641 +++++++++++++++++++++++++++++++++++ 3 files changed, 649 insertions(+) create mode 100644 drivers/i2c/busses/i2c-gxp.c diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig index e50f9603d189..8b3951e0ca5c 100644 --- a/drivers/i2c/busses/Kconfig +++ b/drivers/i2c/busses/Kconfig @@ -1457,4 +1457,11 @@ config I2C_VIRTIO This driver can also be built as a module. If so, the module will be called i2c-virtio. +config I2C_GXP + tristate "GXP I2C Interface" + depends on ARCH_HPE_GXP || COMPILE_TEST + help + This enables support for GXP I2C interface. The I2C engines can be + either I2C master or I2C slaves. + endmenu diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile index e73cdb1d2b5a..dcc96eab6d68 100644 --- a/drivers/i2c/busses/Makefile +++ b/drivers/i2c/busses/Makefile @@ -127,6 +127,7 @@ obj-$(CONFIG_I2C_THUNDERX) += i2c-thunderx.o obj-$(CONFIG_I2C_XILINX) += i2c-xiic.o obj-$(CONFIG_I2C_XLP9XX) += i2c-xlp9xx.o obj-$(CONFIG_I2C_RCAR) += i2c-rcar.o +obj-$(CONFIG_I2C_GXP) += i2c-gxp.o # External I2C/SMBus adapter drivers obj-$(CONFIG_I2C_DIOLAN_U2C) += i2c-diolan-u2c.o diff --git a/drivers/i2c/busses/i2c-gxp.c b/drivers/i2c/busses/i2c-gxp.c new file mode 100644 index 000000000000..a67c0c4d7520 --- /dev/null +++ b/drivers/i2c/busses/i2c-gxp.c @@ -0,0 +1,641 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* Copyright (C) 2022 Hewlett-Packard Enterprise Development Company, L.P. */ + +#include +#include +#include +#include +#include +#include +#include + +#define GXP_MAX_I2C_ENGINE 10 +static const char * const gxp_i2c_name[] = { + "gxp-i2c0", "gxp-i2c1", "gxp-i2c2", "gxp-i2c3", + "gxp-i2c4", "gxp-i2c5", "gxp-i2c6", "gxp-i2c7", + "gxp-i2c8", "gxp-i2c9" }; + +/* Default value */ +#define GXP_I2C_BIT_RATE 100000 /* 100kHz */ + +/* GXP I2C Global interrupt status/enable register*/ +#define GXP_I2CINTSTAT 0x00 +#define GXP_I2CINTEN 0x04 + +/* GXP I2C registers */ +#define GXP_I2CSTAT 0x00 +#define MASK_STOP_EVENT 0x20 +#define MASK_ACK 0x08 +#define MASK_RW 0x04 +#define GXP_I2CEVTERR 0x01 +#define MASK_SLAVE_CMD_EVENT 0x01 +#define MASK_SLAVE_DATA_EVENT 0x02 +#define MASK_MASTER_EVENT 0x10 +#define GXP_I2CSNPDAT 0x02 +#define GXP_I2CMCMD 0x04 +#define GXP_I2CSCMD 0x06 +#define GXP_I2CSNPAA 0x09 +#define GXP_I2CADVFEAT 0x0A +#define GXP_I2COWNADR 0x0B +#define GXP_I2CFREQDIV 0x0C +#define GXP_I2CFLTFAIR 0x0D +#define GXP_I2CTMOEDG 0x0E +#define GXP_I2CCYCTIM 0x0F + +static bool i2c_global_init_done; + +enum { + GXP_I2C_IDLE = 0, + GXP_I2C_ADDR_PHASE, + GXP_I2C_RDATA_PHASE, + GXP_I2C_WDATA_PHASE, + GXP_I2C_ADDR_NACK, + GXP_I2C_DATA_NACK, + GXP_I2C_ERROR, + GXP_I2C_COMP +}; + +struct gxp_i2c_drvdata { + struct device *dev; + void __iomem *base; + u32 bus_frequency; + int engine; + int irq; + struct completion completion; + struct i2c_adapter adapter; + struct i2c_msg *curr_msg; + int msgs_remaining; + int msgs_num; + u8 *buf; + size_t buf_remaining; + unsigned char state; + struct i2c_client *slave; + unsigned char stopped; +}; + +static struct regmap *i2cg_map; + +static void gxp_i2c_start(struct gxp_i2c_drvdata *drvdata) +{ + void __iomem *base = drvdata->base; + u16 value; + + drvdata->buf = drvdata->curr_msg->buf; + drvdata->buf_remaining = drvdata->curr_msg->len; + + /* Note: Address in struct i2c_msg is 7 bits */ + value = drvdata->curr_msg->addr << 9; + + if (drvdata->curr_msg->flags & I2C_M_RD) { + /* Read */ + value |= 0x05; + } else { + /* Write */ + value |= 0x01; + } + + drvdata->state = GXP_I2C_ADDR_PHASE; + writew(value, base + GXP_I2CMCMD); +} + +static int gxp_i2c_master_xfer(struct i2c_adapter *adapter, + struct i2c_msg *msgs, int num) +{ + int ret; + struct gxp_i2c_drvdata *drvdata = i2c_get_adapdata(adapter); + unsigned long time_left; + + drvdata->msgs_remaining = num; + drvdata->curr_msg = msgs; + drvdata->msgs_num = num; + reinit_completion(&drvdata->completion); + + gxp_i2c_start(drvdata); + + time_left = wait_for_completion_timeout(&drvdata->completion, + adapter->timeout); + ret = num - drvdata->msgs_remaining; + if (time_left == 0) { + switch (drvdata->state) { + case GXP_I2C_WDATA_PHASE: + dev_err(drvdata->dev, + "gxp_i2c_start:write Data phase timeout at msg[%d]\n", + ret); + break; + case GXP_I2C_RDATA_PHASE: + dev_err(drvdata->dev, + "gxp_i2c_start:read Data phase timeout at msg[%d]\n", + ret); + break; + case GXP_I2C_ADDR_PHASE: + dev_err(drvdata->dev, + "gxp_i2c_start:Addr phase timeout\n"); + break; + default: + dev_err(drvdata->dev, + "gxp_i2c_start:i2c transfer timeout state=%d\n", + drvdata->state); + break; + } + return -ETIMEDOUT; + } + + if (drvdata->state == GXP_I2C_ADDR_NACK) { + dev_dbg(drvdata->dev, + "gxp_i2c_start:No ACK for address phase\n"); + return -EIO; + } else if (drvdata->state == GXP_I2C_DATA_NACK) { + dev_dbg(drvdata->dev, "gxp_i2c_start:No ACK for data phase\n"); + return -EIO; + } + + return ret; +} + +static u32 gxp_i2c_func(struct i2c_adapter *adap) +{ +#if IS_ENABLED(CONFIG_I2C_SLAVE) + return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL | I2C_FUNC_SLAVE; +#else + return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL; +#endif +} + +#if IS_ENABLED(CONFIG_I2C_SLAVE) +static int gxp_i2c_reg_slave(struct i2c_client *slave) +{ + struct gxp_i2c_drvdata *drvdata = i2c_get_adapdata(slave->adapter); + void __iomem *base = drvdata->base; + + pr_info("[%s] I2C engine%d addr:0x%02x\n", __func__, drvdata->engine, slave->addr); + if (drvdata->slave) + return -EBUSY; + + if (slave->flags & I2C_CLIENT_TEN) + return -EAFNOSUPPORT; + + drvdata->slave = slave; + + writeb(slave->addr << 1, base + GXP_I2COWNADR); + writeb(0x69, base + GXP_I2CSCMD); + + return 0; +} + +static int gxp_i2c_unreg_slave(struct i2c_client *slave) +{ + struct gxp_i2c_drvdata *drvdata = i2c_get_adapdata(slave->adapter); + void __iomem *base = drvdata->base; + + pr_info("[%s] I2C engine%d\n", __func__, drvdata->engine); + WARN_ON(!drvdata->slave); + + writeb(0x00, base + GXP_I2COWNADR); + writeb(0xF0, base + GXP_I2CSCMD); + + drvdata->slave = NULL; + + return 0; +} +#endif + +static const struct i2c_algorithm gxp_i2c_algo = { + .master_xfer = gxp_i2c_master_xfer, + .functionality = gxp_i2c_func, +#if IS_ENABLED(CONFIG_I2C_SLAVE) + .reg_slave = gxp_i2c_reg_slave, + .unreg_slave = gxp_i2c_unreg_slave, +#endif +}; + +static void gxp_i2c_stop(struct gxp_i2c_drvdata *drvdata) +{ + void __iomem *base = drvdata->base; + + /* Clear event and send stop */ + writeb(0x82, base + GXP_I2CMCMD); + + complete(&drvdata->completion); +} + +static void gxp_i2c_restart(struct gxp_i2c_drvdata *drvdata) +{ + void __iomem *base = drvdata->base; + u16 value; + + drvdata->buf = drvdata->curr_msg->buf; + drvdata->buf_remaining = drvdata->curr_msg->len; + + value = drvdata->curr_msg->addr << 9; + + if (drvdata->curr_msg->flags & I2C_M_RD) { + /* Read and clear master event */ + value |= 0x85; + } else { + /* Write and clear master event */ + value |= 0x81; + } + + drvdata->state = GXP_I2C_ADDR_PHASE; + + writew(value, base + GXP_I2CMCMD); +} + +static void gxp_i2c_chk_addr_ack(struct gxp_i2c_drvdata *drvdata) +{ + void __iomem *base = drvdata->base; + u16 value; + + value = readb(base + GXP_I2CSTAT); + if (!(value & MASK_ACK)) { + /* Got no ack, stop */ + drvdata->state = GXP_I2C_ADDR_NACK; + gxp_i2c_stop(drvdata); + return; + } + + if (drvdata->curr_msg->flags & I2C_M_RD) { + /* Start to read data from slave */ + if (drvdata->buf_remaining == 0) { + /* No more data to read, stop */ + drvdata->msgs_remaining--; + drvdata->state = GXP_I2C_COMP; + gxp_i2c_stop(drvdata); + return; + } + drvdata->state = GXP_I2C_RDATA_PHASE; + + if (drvdata->buf_remaining == 1) { + /* The last data, do not ack */ + writeb(0x84, base + GXP_I2CMCMD); + } else { + /* Read data and ack it */ + writeb(0x8C, base + GXP_I2CMCMD); + } + } else { + /* Start to write first data to slave */ + if (drvdata->buf_remaining == 0) { + /* No more data to write, stop */ + drvdata->msgs_remaining--; + drvdata->state = GXP_I2C_COMP; + gxp_i2c_stop(drvdata); + return; + } + value = *drvdata->buf; + value = value << 8; + /* Clear master event */ + value |= 0x80; + drvdata->buf++; + drvdata->buf_remaining--; + drvdata->state = GXP_I2C_WDATA_PHASE; + writew(value, base + GXP_I2CMCMD); + } +} + +static void gxp_i2c_ack_data(struct gxp_i2c_drvdata *drvdata) +{ + void __iomem *base = drvdata->base; + u8 value; + + /* Store the data returned */ + value = readb(base + GXP_I2CSNPDAT); + *drvdata->buf = value; + drvdata->buf++; + drvdata->buf_remaining--; + + if (drvdata->buf_remaining == 0) { + /* No more data, this message is completed. */ + drvdata->msgs_remaining--; + + if (drvdata->msgs_remaining == 0) { + /* No more messages, stop */ + drvdata->state = GXP_I2C_COMP; + gxp_i2c_stop(drvdata); + return; + } + /* Move to next message and start transfer */ + drvdata->curr_msg++; + gxp_i2c_restart(drvdata); + return; + } + + /* Ack the slave to make it send next byte */ + drvdata->state = GXP_I2C_RDATA_PHASE; + if (drvdata->buf_remaining == 1) { + /* The last data, do not ack */ + writeb(0x84, base + GXP_I2CMCMD); + } else { + /* Read data and ack it */ + writeb(0x8C, base + GXP_I2CMCMD); + } +} + +static void gxp_i2c_chk_data_ack(struct gxp_i2c_drvdata *drvdata) +{ + void __iomem *base = drvdata->base; + u16 value; + + value = readb(base + GXP_I2CSTAT); + if (!(value & MASK_ACK)) { + /* Received No ack, stop */ + drvdata->state = GXP_I2C_DATA_NACK; + gxp_i2c_stop(drvdata); + return; + } + + /* Got ack, check if there is more data to write */ + if (drvdata->buf_remaining == 0) { + /* No more data, this message is completed */ + drvdata->msgs_remaining--; + + if (drvdata->msgs_remaining == 0) { + /* No more messages, stop */ + drvdata->state = GXP_I2C_COMP; + gxp_i2c_stop(drvdata); + return; + } + /* Move to next message and start transfer */ + drvdata->curr_msg++; + gxp_i2c_restart(drvdata); + return; + } + + /* Write data to slave */ + value = *drvdata->buf; + value = value << 8; + + /* Clear master event */ + value |= 0x80; + drvdata->buf++; + drvdata->buf_remaining--; + drvdata->state = GXP_I2C_WDATA_PHASE; + writew(value, base + GXP_I2CMCMD); +} + +#if IS_ENABLED(CONFIG_I2C_SLAVE) +static bool gxp_i2c_slave_irq_handler(struct gxp_i2c_drvdata *drvdata) +{ + void __iomem *base = drvdata->base; + u16 value; + u8 buf; + int ret; + + value = readb(base + GXP_I2CEVTERR); + + /* Received start or stop event */ + if (value & MASK_SLAVE_CMD_EVENT) { + value = readb(base + GXP_I2CSTAT); + /* Master sent stop */ + if (value & MASK_STOP_EVENT) { + if (drvdata->stopped == 0) + i2c_slave_event(drvdata->slave, I2C_SLAVE_STOP, &buf); + writeb(0x69, base + GXP_I2CSCMD); + drvdata->stopped = 1; + } else { + /* Master sent start and wants to read */ + drvdata->stopped = 0; + if (value & MASK_RW) { + i2c_slave_event(drvdata->slave, + I2C_SLAVE_READ_REQUESTED, &buf); + value = buf << 8 | 0x61; + writew(value, base + GXP_I2CSCMD); + } else { + /* Master wants to write to us */ + ret = i2c_slave_event(drvdata->slave, + I2C_SLAVE_WRITE_REQUESTED, &buf); + if (!ret) { + /* Ack next byte from master */ + writeb(0x69, base + GXP_I2CSCMD); + } else { + /* Nack next byte from master */ + writeb(0x61, base + GXP_I2CSCMD); + } + } + } + } else if (value & MASK_SLAVE_DATA_EVENT) { + value = readb(base + GXP_I2CSTAT); + /* Master wants to read */ + if (value & MASK_RW) { + /* Master wants another byte */ + if (value & MASK_ACK) { + i2c_slave_event(drvdata->slave, + I2C_SLAVE_READ_PROCESSED, &buf); + value = buf << 8 | 0x61; + writew(value, base + GXP_I2CSCMD); + } else { + /* No more bytes needed */ + writew(0x69, base + GXP_I2CSCMD); + } + } else { + /* Master wants to write to us */ + value = readb(base + GXP_I2CSNPDAT); + buf = (uint8_t)value; + ret = i2c_slave_event(drvdata->slave, + I2C_SLAVE_WRITE_RECEIVED, &buf); + if (!ret) { + /* Ack next byte from master */ + writeb(0x69, base + GXP_I2CSCMD); + } else { + /* Nack next byte from master */ + writeb(0x61, base + GXP_I2CSCMD); + } + } + } else { + return false; + } + + return true; +} +#endif + +static irqreturn_t gxp_i2c_irq_handler(int irq, void *_drvdata) +{ + struct gxp_i2c_drvdata *drvdata = (struct gxp_i2c_drvdata *)_drvdata; + u32 value; + void __iomem *base = drvdata->base; + + regmap_read(i2cg_map, GXP_I2CINTSTAT, &value); + if (!(value & (1 << drvdata->engine))) + return IRQ_NONE; + + value = readb(base + GXP_I2CEVTERR); + + /* Error */ + if (value & ~(MASK_MASTER_EVENT | MASK_SLAVE_CMD_EVENT | + MASK_SLAVE_DATA_EVENT)) { + pr_alert("[%s] I2C Error, GXP_I2CEVTERR = 0x%x\n", __func__, + value); + + /* Clear all events */ + writeb(0x00, base + GXP_I2CEVTERR); + drvdata->state = GXP_I2C_ERROR; + gxp_i2c_stop(drvdata); + return IRQ_HANDLED; + } + +#if IS_ENABLED(CONFIG_I2C_SLAVE) + /* Slave mode */ + if (value & (MASK_SLAVE_CMD_EVENT | MASK_SLAVE_DATA_EVENT)) { + if (gxp_i2c_slave_irq_handler(drvdata)) + return IRQ_HANDLED; + pr_alert("[%s] I2C Error, GXP_I2CEVTERR = 0x%x\n", + __func__, value); + return IRQ_NONE; + } +#endif + + /* Master mode */ + switch (drvdata->state) { + case GXP_I2C_ADDR_PHASE: + gxp_i2c_chk_addr_ack(drvdata); + break; + + case GXP_I2C_RDATA_PHASE: + gxp_i2c_ack_data(drvdata); + break; + + case GXP_I2C_WDATA_PHASE: + gxp_i2c_chk_data_ack(drvdata); + break; + } + + return IRQ_HANDLED; +} + +static void gxp_i2c_init(struct gxp_i2c_drvdata *drvdata) +{ + void __iomem *base = drvdata->base; + + drvdata->state = GXP_I2C_IDLE; + writeb(2000000 / drvdata->bus_frequency, base + GXP_I2CFREQDIV); + writeb(0x32, base + GXP_I2CFLTFAIR); + writeb(0x0a, base + GXP_I2CTMOEDG); + writeb(0x00, base + GXP_I2CCYCTIM); + writeb(0x00, base + GXP_I2CSNPAA); + writeb(0x00, base + GXP_I2CADVFEAT); + writeb(0xF0, base + GXP_I2CSCMD); + writeb(0x80, base + GXP_I2CMCMD); + writeb(0x00, base + GXP_I2CEVTERR); + writeb(0x00, base + GXP_I2COWNADR); +} + +static int gxp_i2c_probe(struct platform_device *pdev) +{ + struct gxp_i2c_drvdata *drvdata; + int rc; + struct resource *res; + struct i2c_adapter *adapter; + + if (!i2c_global_init_done) { + pr_info("[%s] I2c global init\n", __func__); + i2cg_map = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, + "hpe,sysreg-phandle"); + if (IS_ERR(i2cg_map)) { + dev_err(&pdev->dev, "failed to map i2cg_handle\n"); + return -ENODEV; + } + + /* Disable interrupt */ + regmap_update_bits(i2cg_map, GXP_I2CINTEN, 0x00000FFF, 0); + i2c_global_init_done = true; + } + + drvdata = devm_kzalloc(&pdev->dev, sizeof(struct gxp_i2c_drvdata), + GFP_KERNEL); + if (!drvdata) + return -ENOMEM; + + platform_set_drvdata(pdev, drvdata); + drvdata->dev = &pdev->dev; + init_completion(&drvdata->completion); + + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + drvdata->base = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(drvdata->base)) + return PTR_ERR(drvdata->base); + + drvdata->engine = (res->start & 0xf00) >> 8; + pr_info("%s: i2c engine%d\n", __func__, drvdata->engine); + if (drvdata->engine >= GXP_MAX_I2C_ENGINE) { + dev_err(&pdev->dev, "i2c engine% is unsupported\n", + drvdata->engine); + return -EINVAL; + } + + rc = platform_get_irq(pdev, 0); + if (rc < 0) { + dev_err(&pdev->dev, "unable to obtain IRQ number\n"); + return rc; + } + + drvdata->irq = rc; + pr_info("[%s] i2c engine%d, rq = %d\n", __func__, drvdata->engine, + drvdata->irq); + + rc = devm_request_irq(&pdev->dev, drvdata->irq, gxp_i2c_irq_handler, + IRQF_SHARED, gxp_i2c_name[drvdata->engine], drvdata); + if (rc < 0) { + dev_err(&pdev->dev, "irq request failed\n"); + return rc; + } + + rc = of_property_read_u32(pdev->dev.of_node, + "hpe,i2c-max-bus-freq", &drvdata->bus_frequency); + if (rc < 0) { + dev_info(&pdev->dev, + "Could not read bus-frequency property, use default frequency:100000\n"); + drvdata->bus_frequency = GXP_I2C_BIT_RATE; + } + + gxp_i2c_init(drvdata); + + /* Enable interrupt */ + regmap_update_bits(i2cg_map, GXP_I2CINTEN, BIT(drvdata->engine), + BIT(drvdata->engine)); + + adapter = &drvdata->adapter; + i2c_set_adapdata(adapter, drvdata); + + adapter->owner = THIS_MODULE; + adapter->class = I2C_CLASS_DEPRECATED; + strscpy(adapter->name, "HPE GXP I2C adapter", sizeof(adapter->name)); + adapter->algo = &gxp_i2c_algo; + adapter->dev.parent = &pdev->dev; + adapter->dev.of_node = pdev->dev.of_node; + + rc = i2c_add_adapter(adapter); + if (rc) + dev_err(&pdev->dev, "i2c add adapter failed\n"); + + return rc; +} + +static int gxp_i2c_remove(struct platform_device *pdev) +{ + struct gxp_i2c_drvdata *drvdata = platform_get_drvdata(pdev); + + pr_info("[%s] drvdata engine %d\n", __func__, drvdata->engine); + i2c_del_adapter(&drvdata->adapter); + + return 0; +} + +static const struct of_device_id gxp_i2c_of_match[] = { + { .compatible = "hpe,gxp-i2c" }, + {}, +}; +MODULE_DEVICE_TABLE(of, gxp_i2c_of_match); + +static struct platform_driver gxp_i2c_driver = { + .probe = gxp_i2c_probe, + .remove = gxp_i2c_remove, + .driver = { + .name = "gxp-i2c", + .of_match_table = gxp_i2c_of_match, + }, +}; +module_platform_driver(gxp_i2c_driver); + +MODULE_AUTHOR("Nick Hawkins "); +MODULE_DESCRIPTION("HPE GXP I2C bus driver"); +MODULE_LICENSE("GPL"); From patchwork Fri Dec 16 18:35:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hawkins, Nick" X-Patchwork-Id: 34044 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp1132817wrn; Fri, 16 Dec 2022 10:40:43 -0800 (PST) X-Google-Smtp-Source: AA0mqf4h6enVDKq09AOLx77/OJHXnnWPh3nRaYlKbP/zYOApZeIIT/eXnsbzbwTaBiprYLAMmmtQ X-Received: by 2002:a17:907:9018:b0:7c0:e988:4157 with SMTP id ay24-20020a170907901800b007c0e9884157mr23201910ejc.40.1671216043509; Fri, 16 Dec 2022 10:40:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671216043; cv=none; d=google.com; s=arc-20160816; b=G0afCmaeg3RJOXpj6uATft8tXed2tLmMl26LGqlxXa7ooV9kCw/0FvrkkWDmLXZvYq 1YtcnX+A/ogPiXbYq7nOBKjYhM+7MfiSb9I1Ad3yLdttXf6+qADd9NT0l/JH34Pt787M w3OEs7ZxD9nIJLVHviXwdXlTIE4kGhRh2+Nt9+/3vR94VED7HUWUa+i0UKLxhrt+SUjF LcJ5iRRxIRc8Y0gM942yITKDPif9VeG/XSwbtYxSTQBL+sC6VlVoHIBIRje064qugXQW 9TW+mj9D9FrRNLJ8CoDqzF4BVX+QNXOb17z/RUBXN/S0jAKp/6lE2Hstf5oi4BA44e6r SOtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:to:from:dkim-signature; bh=adn195NCb1uZjLG8wFHLk0+CnYqQOfEgaJMZuHUP/Jg=; b=OwWI+2wrqrgtGg4QJ4CkbSdKZ9YDar+AQoKB8bieZ3m3x0lZIz298/J/vi0LIkuEPK nKiD1OHFic/HHhTXsTfRIoe10r9AZ81MWBKdfLXAqHKXtloG1fKoI5ILs5dgnoVjHyDL AiDCE8JwyUHpNeBmif7Hkhhugv3Xrehy4QiSBFzxnjwU1OGyWTJ4t+A4X1DYYMbDeOFY v04cUFoxjivqEEezljjJioPExu3bDOmTQKyn5vl1oHs1mob21bZRuvA4T2VRR4Jwahqp qJf22Q53QGRy8WJmE/k5um5/nnDn7ckLO7zBfM8c1S1scTElRxTSDVY0yS4kaGrbsYZz H9NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=FqGTAYJG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hpe.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g20-20020a1709065d1400b007c07d0dbe85si3558649ejt.463.2022.12.16.10.40.20; Fri, 16 Dec 2022 10:40:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=FqGTAYJG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hpe.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229627AbiLPSha (ORCPT + 99 others); Fri, 16 Dec 2022 13:37:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229742AbiLPSh1 (ORCPT ); Fri, 16 Dec 2022 13:37:27 -0500 Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21A652B243; Fri, 16 Dec 2022 10:37:27 -0800 (PST) Received: from pps.filterd (m0150242.ppops.net [127.0.0.1]) by mx0a-002e3701.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BGF2Ihk005981; Fri, 16 Dec 2022 18:37:07 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version; s=pps0720; bh=adn195NCb1uZjLG8wFHLk0+CnYqQOfEgaJMZuHUP/Jg=; b=FqGTAYJGeWalOZ7pHLhn4vJUE/34zoxEOMGH3gVtUs51H4Oya4PYO0ENijPyd+ctcJJz aNfFuxNRJdXEpo8MgKcFHM6FvigkVfQAiwJCaTAKvT3Po/hWnxT6aqqAjybYtjIg21xQ lywKq+5Ikha2N/hFmA5QjsbBOKJHdQ8Bt5JlA8d4mXk4e2L3NCe3MisK9AciyBhLpK3b eKuqk3gM9aHfuafU5tFZGJvb3w3XlDhlM/xSf1jL1/+xvqZ42pmbELHCfUYvL/Y6nTqE CIWqpeW5rx439Lbjtht0myoHIS+aLPXfjrPjaMyPe2u99dwH6nk9MjVlILAvaCqS9gbn Uw== Received: from p1lg14881.it.hpe.com (p1lg14881.it.hpe.com [16.230.97.202]) by mx0a-002e3701.pphosted.com (PPS) with ESMTPS id 3mgqmqudwg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 16 Dec 2022 18:37:07 +0000 Received: from p1lg14885.dc01.its.hpecorp.net (unknown [10.119.18.236]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by p1lg14881.it.hpe.com (Postfix) with ESMTPS id 9B438801707; Fri, 16 Dec 2022 18:37:06 +0000 (UTC) Received: from hpe.com (unknown [16.231.227.36]) by p1lg14885.dc01.its.hpecorp.net (Postfix) with ESMTP id 1830780619A; Fri, 16 Dec 2022 18:37:06 +0000 (UTC) From: nick.hawkins@hpe.com To: verdun@hpe.com, nick.hawkins@hpe.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, lee@kernel.org, linux@armlinux.org.uk, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v1 2/6] dt-bindings: i2c: hpe,gxp-i2c Date: Fri, 16 Dec 2022 12:35:28 -0600 Message-Id: <20221216183532.78933-3-nick.hawkins@hpe.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221216183532.78933-1-nick.hawkins@hpe.com> References: <20221216183532.78933-1-nick.hawkins@hpe.com> X-Proofpoint-ORIG-GUID: vG9MzKLuqemFIP0SeQINUPDUWETx9rBV X-Proofpoint-GUID: vG9MzKLuqemFIP0SeQINUPDUWETx9rBV X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-16_12,2022-12-15_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 spamscore=0 mlxscore=0 bulkscore=0 suspectscore=0 adultscore=0 clxscore=1015 phishscore=0 malwarescore=0 lowpriorityscore=0 mlxlogscore=999 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212160162 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752397033615041652?= X-GMAIL-MSGID: =?utf-8?q?1752397033615041652?= From: Nick Hawkins Document binding to support I2C controller in GXP. Signed-off-by: Nick Hawkins --- .../devicetree/bindings/i2c/hpe,gxp-i2c.yaml | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 Documentation/devicetree/bindings/i2c/hpe,gxp-i2c.yaml diff --git a/Documentation/devicetree/bindings/i2c/hpe,gxp-i2c.yaml b/Documentation/devicetree/bindings/i2c/hpe,gxp-i2c.yaml new file mode 100644 index 000000000000..fa378e991fdb --- /dev/null +++ b/Documentation/devicetree/bindings/i2c/hpe,gxp-i2c.yaml @@ -0,0 +1,63 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/i2c/hpe,gxp-i2c.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: HPE GXP SoC I2C Controller + +maintainers: + - Nick Hawkins + +allOf: + - $ref: /schemas/i2c/i2c-controller.yaml# + +properties: + compatible: + const: hpe,gxp-i2c + + '#address-cells': + const: 1 + + interrupts: + maxItems: 1 + + reg: + maxItems: 1 + + hpe,i2c-max-bus-freq: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Desired frequency in Hz of the bus. + default: 100000 + + hpe,sysreg-phandle: + $ref: /schemas/types.yaml#/definitions/phandle + description: Pandle to syscon used to control the system registers. + + '#size-cells': + const: 0 + +required: + - compatible + - reg + - interrupts + +unevaluatedProperties: false + +examples: + - | + i2c@2600 { + compatible = "hpe,gxp-i2c"; + reg = <0x2500 0x70>; + interrupts = <9>; + #address-cells = <1>; + #size-cells = <0>; + hpe,sysreg-phandle = <&sysreg_system_controller>; + hpe,i2c-max-bus-freq = <10000>; + + eeprom@50 { + compatible = "atmel,24c128"; + reg = <0x50>; + }; + }; From patchwork Fri Dec 16 18:35:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hawkins, Nick" X-Patchwork-Id: 34047 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp1133251wrn; Fri, 16 Dec 2022 10:41:49 -0800 (PST) X-Google-Smtp-Source: AA0mqf6hFgfuXJI60JANh9YTmOaJgzR1KAdcvjOaz3HRwaebgNI8RI7B+h/2nFxeQYrDk5wJUWjo X-Received: by 2002:a05:6402:446:b0:46a:3bd0:4784 with SMTP id p6-20020a056402044600b0046a3bd04784mr28806452edw.7.1671216109741; Fri, 16 Dec 2022 10:41:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671216109; cv=none; d=google.com; s=arc-20160816; b=wfN4eMZKYYsz+BkbXkUr1TjsqfVL4eXyb6eVe8M7vZGdr61jEwuGl2j2nOZTQ5Xtf/ SdwfNg57/BYC8+cvVVOW6wOw775I/e5HXAtumImYmvlC/D+rZ5q2/wj+KvKVH6QDCQ/a x5CMHtoW9m2VKMSZw965tZndgb0S5b9LXPckcWec8Z1PyxGFcDKcpjDHcEDln141PSdE Cu2eTOc9VuEY3lxYOoA5G9UX27u+mOoGl3y7jbRm5vVdwgHZ5EMH/4fElPJ8jmAXj6S6 E52UMDKnaPIHspmytYJWl4wR5rTB4JQi303JN8nfmV+2a2ei7I4mp8ziXtrexFFZld3c +73w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :to:from:dkim-signature; bh=57jMhzIY6ocGNR3ZkZzrIW51OdLQY115RWIYg4DbMFc=; b=lEiIRV2bu4u0HAFQxZLH2iyPwdWYoj4DIc4j8USIsfp2Swx/CsazKjGTX0iZyP9MR9 8j0ZXU8o5NzWBx503J3L0iicjR18Iv/66b7BGPqxECAvHw9IJTaHs48t9A3df0vndIe7 k6aV85dUyyTRHcf02AX8StMPDaUeIcO11+FBd5aq+dl12YNOgSppcu0owLZ7HyITHTvq n9c/0v7o3U04zRf1pDPIB9qVOZGABZ3pu/vHFu6fDrS9S+mUPdFHf2hGuyLW/OgAvuv1 kLS1A2AkcujLiEOMilIQNevAu9SUnqafI5JHEMM8nIMmfDSjN3d9SM1B4TQNGYtrMpdV Fklw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=HFUfN3Cn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hpe.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y7-20020a056402358700b0046b3055748csi3697360edc.75.2022.12.16.10.41.12; Fri, 16 Dec 2022 10:41:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=HFUfN3Cn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hpe.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231515AbiLPSho (ORCPT + 99 others); Fri, 16 Dec 2022 13:37:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231741AbiLPSha (ORCPT ); Fri, 16 Dec 2022 13:37:30 -0500 Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A39C31EF1; Fri, 16 Dec 2022 10:37:30 -0800 (PST) Received: from pps.filterd (m0134421.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BGCSiCI014754; Fri, 16 Dec 2022 18:37:08 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : subject : date : message-id : in-reply-to : references; s=pps0720; bh=57jMhzIY6ocGNR3ZkZzrIW51OdLQY115RWIYg4DbMFc=; b=HFUfN3Cnw26eawx/Fg3UuixB5Z3MESGRzV+HrlyAGnW6XzXHzX5epebKUR7GlO3KAu0E weu8xx5vRI7tg35kvdmzApo+7XHNNnyxlWv0Y8LnrZpF1L3O6Bg9bfCi1MiuQdqlUPmM Mx2FNQwndIivts0+dTpFZmqIgQMD2Ou5b7nFOGkzW2LIcjrtaQtoucUw9M4I2M3h50rC gL0z9aKui8gFpruUIrnPSEDd4TFAHf+N/aGgkSxSlTATn6/qRqZNUKYY6GWPieZ71kFP wTEHrzDVylZI3axRK+6QycToMZCZUdr9MEy33vcslJSwAMimZ+2D9juBOOSBC7tSKQAQ RQ== Received: from p1lg14880.it.hpe.com (p1lg14880.it.hpe.com [16.230.97.201]) by mx0b-002e3701.pphosted.com (PPS) with ESMTPS id 3mgnbrmj40-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 16 Dec 2022 18:37:07 +0000 Received: from p1lg14885.dc01.its.hpecorp.net (unknown [10.119.18.236]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by p1lg14880.it.hpe.com (Postfix) with ESMTPS id 496D8807120; Fri, 16 Dec 2022 18:37:07 +0000 (UTC) Received: from hpe.com (unknown [16.231.227.36]) by p1lg14885.dc01.its.hpecorp.net (Postfix) with ESMTP id A1900808065; Fri, 16 Dec 2022 18:37:06 +0000 (UTC) From: nick.hawkins@hpe.com To: verdun@hpe.com, nick.hawkins@hpe.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, lee@kernel.org, linux@armlinux.org.uk, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v1 3/6] dt-bindings: mfd: syscon: Document GXP register compatible Date: Fri, 16 Dec 2022 12:35:29 -0600 Message-Id: <20221216183532.78933-4-nick.hawkins@hpe.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221216183532.78933-1-nick.hawkins@hpe.com> References: <20221216183532.78933-1-nick.hawkins@hpe.com> X-Proofpoint-GUID: 2ALtkL1SVC_4BIdeDgr8aigbFxdDtKVH X-Proofpoint-ORIG-GUID: 2ALtkL1SVC_4BIdeDgr8aigbFxdDtKVH X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-16_12,2022-12-15_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 mlxlogscore=999 clxscore=1015 impostorscore=0 suspectscore=0 mlxscore=0 adultscore=0 malwarescore=0 phishscore=0 bulkscore=0 priorityscore=1501 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212160162 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752397103648311386?= X-GMAIL-MSGID: =?utf-8?q?1752397103648311386?= From: Nick Hawkins Document hpe,gxp-sysreg compatible for GXP registers. Signed-off-by: Nick Hawkins Acked-by: Krzysztof Kozlowski --- Documentation/devicetree/bindings/mfd/syscon.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/mfd/syscon.yaml b/Documentation/devicetree/bindings/mfd/syscon.yaml index 4e4baf53796d..a20f7bdfc5df 100644 --- a/Documentation/devicetree/bindings/mfd/syscon.yaml +++ b/Documentation/devicetree/bindings/mfd/syscon.yaml @@ -46,6 +46,7 @@ properties: - hisilicon,hi6220-sramctrl - hisilicon,pcie-sas-subctrl - hisilicon,peri-subctrl + - hpe,gxp-sysreg - intel,lgm-syscon - marvell,armada-3700-usb2-host-misc - mediatek,mt8135-pctl-a-syscfg From patchwork Fri Dec 16 18:35:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hawkins, Nick" X-Patchwork-Id: 34048 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp1133665wrn; Fri, 16 Dec 2022 10:42:51 -0800 (PST) X-Google-Smtp-Source: AA0mqf4qeUOWoK8gJhg6RYWIrm6RhweGgZQr4hwcumSCzmnIKlQOwHH770K4FZo3sjsGPHkukbCQ X-Received: by 2002:a17:906:af64:b0:7c4:fe3c:cb2a with SMTP id os4-20020a170906af6400b007c4fe3ccb2amr7744387ejb.56.1671216171013; Fri, 16 Dec 2022 10:42:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671216170; cv=none; d=google.com; s=arc-20160816; b=WW4e2G6m+TbRl0PJIjMzISMu3XhYSVthCj13pOirD3/GVusQuZLDKp3crv2kjBVCwc h9p+wU0gxIvZjt0c04d95e9lJ7Jazho7p/mxcj2lMmh2RXhvzy90FGqZmBUUbUxANEvG L3GGiHBRtsXBzcVQUlKkhzunVIGnk5BTXhrRTYBSTWsWKaCyi5P2KocPpkxUNMDCJhpR NMIzkOgIjk5pwEufEksu9CItwklmHmY4vBvtdVNp6/tESkSE/8r1A9D2hc0urVrEs0lW xdO6H9M2SatJKWncy1rziOA+yhjHyI6bfVNLzJ2LrCegQAjch7zX326A5jERi1YVoEC0 68Uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :to:from:dkim-signature; bh=oTeqjjiAHpLtb9RUFB/rzYZ1JdnjrblaJ1j/wIeCiIU=; b=P3It2lOgU+zW7VaT4bwL9SjMAbWCqlFajy3xkPtN25HzuKUP6TllVe8ReFLZlE9DF5 OSbhWJ8pdy4FwyRlm6zRocR8/7+DhOM9ijHES+ynqGK8u3dpETqOh1sV0ehzJSPkgIO5 kDed4GWqxYoGYHWccc86qvAxcMl2CCZlX4lbm2rgK+g1zkgA0iloRitjGoF9oxf2sSVc 7oIykdiLzqmAcPZGN7PVDNznVE0FEhRN7EWCeWptvuqII53CkBL4B4V4m3cd1VFY1ppw lhGlRHO0n/bjQHOpBIFm8tT49qfyrr41d83IS5/0FCqzpjtNjRnAmjf6yI5guL9H51G8 b/IQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hpe.com header.s=pps0720 header.b="AjrXYU/t"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hpe.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xe12-20020a170907318c00b00791994dfb9esi3711088ejb.491.2022.12.16.10.42.26; Fri, 16 Dec 2022 10:42:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@hpe.com header.s=pps0720 header.b="AjrXYU/t"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hpe.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231797AbiLPShq (ORCPT + 99 others); Fri, 16 Dec 2022 13:37:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231742AbiLPSha (ORCPT ); Fri, 16 Dec 2022 13:37:30 -0500 Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E17732DA9E; Fri, 16 Dec 2022 10:37:29 -0800 (PST) Received: from pps.filterd (m0150244.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BGDoR2n016164; Fri, 16 Dec 2022 18:37:08 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : subject : date : message-id : in-reply-to : references; s=pps0720; bh=oTeqjjiAHpLtb9RUFB/rzYZ1JdnjrblaJ1j/wIeCiIU=; b=AjrXYU/tBOnbaHUtXvmkZyCEw7y6gntvwDqGHIn8bG61KAYJPADZP0UVSpasZBfc/hF3 1TGM0hd1s1Rf5oClRG1bE2xHDH2pwVnQArBcfR2coNFOIC4+DIBdGlQzDBBifoIs6Vbx ncoA+h0q4iGnjCD5wK/t0+ydadF3GJu58/MPH6qVARViKX2QDtcdS09bhbkwfzufc67g TtXVrtxVKI5knCROZIznVoQF5/JZ3nm/qft8mD7+VcfnhlvCEe4vsij/IwYJ4/JN9j6B tQZmfzA8xqf3Nm6KKZfLaIVHrOlzBblvKrvT5XkDUP6cdHae+CCwaywTQ9UpPSHkmTRn 5w== Received: from p1lg14878.it.hpe.com (p1lg14878.it.hpe.com [16.230.97.204]) by mx0b-002e3701.pphosted.com (PPS) with ESMTPS id 3mgpjuk7f9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 16 Dec 2022 18:37:08 +0000 Received: from p1lg14885.dc01.its.hpecorp.net (unknown [10.119.18.236]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by p1lg14878.it.hpe.com (Postfix) with ESMTPS id D3DD43DE01; Fri, 16 Dec 2022 18:37:07 +0000 (UTC) Received: from hpe.com (unknown [16.231.227.36]) by p1lg14885.dc01.its.hpecorp.net (Postfix) with ESMTP id 4D027808993; Fri, 16 Dec 2022 18:37:07 +0000 (UTC) From: nick.hawkins@hpe.com To: verdun@hpe.com, nick.hawkins@hpe.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, lee@kernel.org, linux@armlinux.org.uk, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v1 4/6] ARM: dts: hpe: Add I2C Topology Date: Fri, 16 Dec 2022 12:35:30 -0600 Message-Id: <20221216183532.78933-5-nick.hawkins@hpe.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221216183532.78933-1-nick.hawkins@hpe.com> References: <20221216183532.78933-1-nick.hawkins@hpe.com> X-Proofpoint-ORIG-GUID: Q28Lt7dKPU3svft99C5DAVIETqGVGgGc X-Proofpoint-GUID: Q28Lt7dKPU3svft99C5DAVIETqGVGgGc X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-16_12,2022-12-15_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 bulkscore=0 mlxscore=0 lowpriorityscore=0 adultscore=0 mlxlogscore=695 spamscore=0 impostorscore=0 clxscore=1015 suspectscore=0 malwarescore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212160162 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752397167544755145?= X-GMAIL-MSGID: =?utf-8?q?1752397167544755145?= From: Nick Hawkins Add 9 I2C Engines, 2 MUXs, and a EEPROM to the device tree. Signed-off-by: Nick Hawkins --- arch/arm/boot/dts/hpe-bmc-dl360gen10.dts | 72 ++++++++++++++ arch/arm/boot/dts/hpe-gxp.dtsi | 115 +++++++++++++++++++++++ 2 files changed, 187 insertions(+) diff --git a/arch/arm/boot/dts/hpe-bmc-dl360gen10.dts b/arch/arm/boot/dts/hpe-bmc-dl360gen10.dts index 3a7382ce40ef..d9008e2cfed3 100644 --- a/arch/arm/boot/dts/hpe-bmc-dl360gen10.dts +++ b/arch/arm/boot/dts/hpe-bmc-dl360gen10.dts @@ -23,4 +23,76 @@ device_type = "memory"; reg = <0x40000000 0x20000000>; }; + + i2cmux@4 { + compatible = "i2c-mux-reg"; + i2c-parent = <&i2c4>; + reg = <0xd1000074 1>; + #address-cells = <1>; + #size-cells = <0>; + + i2c4@1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + }; + + i2c4@3 { + reg = <3>; + #address-cells = <1>; + #size-cells = <0>; + }; + + i2c4@4 { + reg = <4>; + #address-cells = <1>; + #size-cells = <0>; + }; + }; + + i2cmux@6 { + compatible = "i2c-mux-reg"; + i2c-parent = <&i2c6>; + reg = <0xd1000076 1>; + #address-cells = <1>; + #size-cells = <0>; + + i2c6@1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + }; + + i2c6@2 { + reg = <2>; + #address-cells = <1>; + #size-cells = <0>; + }; + + i2c6@3 { + reg = <3>; + #address-cells = <1>; + #size-cells = <0>; + }; + + i2c6@4 { + reg = <4>; + #address-cells = <1>; + #size-cells = <0>; + }; + + i2c6@5 { + reg = <5>; + #address-cells = <1>; + #size-cells = <0>; + }; + }; +}; + +&i2c2 { + eeprom@50 { + compatible = "atmel,24c02"; + pagesize = <8>; + reg = <0x50>; + }; }; diff --git a/arch/arm/boot/dts/hpe-gxp.dtsi b/arch/arm/boot/dts/hpe-gxp.dtsi index cf735b3c4f35..27e68932021c 100644 --- a/arch/arm/boot/dts/hpe-gxp.dtsi +++ b/arch/arm/boot/dts/hpe-gxp.dtsi @@ -122,6 +122,121 @@ interrupts = <6>; interrupt-parent = <&vic0>; }; + + sysreg_system_controller: syscon@f8 { + compatible = "hpe,gxp-sysreg", "syscon"; + reg = <0xf8 0x8>; + }; + + i2c0: i2c@2000 { + compatible = "hpe,gxp-i2c"; + reg = <0x2000 0x70>; + interrupts = <9>; + interrupt-parent = <&vic0>; + #address-cells = <1>; + #size-cells = <0>; + hpe,sysreg-phandle = <&sysreg_system_controller>; + hpe,i2c-max-bus-freq = <100000>; + }; + + i2c1: i2c@2100 { + compatible = "hpe,gxp-i2c"; + reg = <0x2100 0x70>; + interrupts = <9>; + interrupt-parent = <&vic0>; + #address-cells = <1>; + #size-cells = <0>; + hpe,sysreg-phandle = <&sysreg_system_controller>; + hpe,i2c-max-bus-freq = <100000>; + }; + + i2c2: i2c@2200 { + compatible = "hpe,gxp-i2c"; + reg = <0x2200 0x70>; + interrupts = <9>; + interrupt-parent = <&vic0>; + #address-cells = <1>; + #size-cells = <0>; + hpe,sysreg-phandle = <&sysreg_system_controller>; + hpe,i2c-max-bus-freq = <100000>; + }; + + i2c3: i2c@2300 { + compatible = "hpe,gxp-i2c"; + reg = <0x2300 0x70>; + interrupts = <9>; + interrupt-parent = <&vic0>; + #address-cells = <1>; + #size-cells = <0>; + hpe,sysreg-phandle = <&sysreg_system_controller>; + hpe,i2c-max-bus-freq = <100000>; + }; + + i2c4: i2c@2400 { + compatible = "hpe,gxp-i2c"; + reg = <0x2400 0x70>; + interrupts = <9>; + interrupt-parent = <&vic0>; + #address-cells = <1>; + #size-cells = <0>; + hpe,sysreg-phandle = <&sysreg_system_controller>; + hpe,i2c-max-bus-freq = <100000>; + }; + + i2c5: i2c@2500 { + compatible = "hpe,gxp-i2c"; + reg = <0x2500 0x70>; + interrupts = <9>; + interrupt-parent = <&vic0>; + #address-cells = <1>; + #size-cells = <0>; + hpe,sysreg-phandle = <&sysreg_system_controller>; + hpe,i2c-max-bus-freq = <100000>; + }; + + i2c6: i2c@2600 { + compatible = "hpe,gxp-i2c"; + reg = <0x2600 0x70>; + interrupts = <9>; + interrupt-parent = <&vic0>; + #address-cells = <1>; + #size-cells = <0>; + hpe,sysreg-phandle = <&sysreg_system_controller>; + hpe,i2c-max-bus-freq = <100000>; + }; + + i2c7: i2c@2700 { + compatible = "hpe,gxp-i2c"; + reg = <0x2700 0x70>; + interrupts = <9>; + interrupt-parent = <&vic0>; + #address-cells = <1>; + #size-cells = <0>; + hpe,sysreg-phandle = <&sysreg_system_controller>; + hpe,i2c-max-bus-freq = <100000>; + }; + + i2c8: i2c@2800 { + compatible = "hpe,gxp-i2c"; + reg = <0x2800 0x70>; + interrupts = <9>; + interrupt-parent = <&vic0>; + #address-cells = <1>; + #size-cells = <0>; + hpe,sysreg-phandle = <&sysreg_system_controller>; + hpe,i2c-max-bus-freq = <100000>; + }; + + i2c9: i2c@2900 { + compatible = "hpe,gxp-i2c"; + reg = <0x2900 0x70>; + interrupts = <9>; + interrupt-parent = <&vic0>; + #address-cells = <1>; + #size-cells = <0>; + hpe,sysreg-phandle = <&sysreg_system_controller>; + hpe,i2c-max-bus-freq = <100000>; + }; }; }; }; From patchwork Fri Dec 16 18:35:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hawkins, Nick" X-Patchwork-Id: 34045 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp1132856wrn; Fri, 16 Dec 2022 10:40:51 -0800 (PST) X-Google-Smtp-Source: AA0mqf63B1XzDPFb8c/3F4q0EI3vCKNeQGWNnli4L0HiFUnWkmPQqr1TJUH1f27H34/4QLlfeboG X-Received: by 2002:a17:906:7754:b0:78d:f455:b5c1 with SMTP id o20-20020a170906775400b0078df455b5c1mr28629992ejn.1.1671216051806; Fri, 16 Dec 2022 10:40:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671216051; cv=none; d=google.com; s=arc-20160816; b=d1PdbkTeA0AvRzEGSrznCA49571YcT0kNYGYPo/G/6N/lLjhpc9mAdL1N9ZsthaKRb GA5TrcCrNvSb6bYVjfEA98OqFh/guI5o8kgvFwd+nHq2Uo8qRPp+r5PnilQUdWPS2qWe e9OrR3KdJzvaYxlFOzptUtdC15zoF73mW9DVTATQfRnbUZZQkPKKxcCdHEZCGm2Fqlhv GJ7PdpRroXrANgh46nh0HnH+nIE464dopn5VFvQ3pTscCMfAq4/9QIxt8Hs1jB5gJIsG /RpCXk1kP3y7wx4/EqGd16C95k69ivlxzLLncMJMEBi0j4S0+Wkvm0OLnWaJ8OCVUYTV K8vQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :to:from:dkim-signature; bh=Fz5XTwBCb8LOB+OGCGAEKYrMx/I8DUIe2X3g73uMLug=; b=jXFLEMAWkG7vv5uhIi8N+B3QVgq2eXlfA2CKc/2HuZRTaNgthS8CgUEPzzpjPXRnzt /vl7ZOGoT1Hnl0oA4CXtPn2hGFcJhfp85XwzXoD5XLpb71UjuCaDIL3QBNmHJBbRyHtW Dz83a+vyBUVkxefbAGTq27y/n0buRAyHGjmr0rQUj7OguofRe+NB5sRXl5kDssFTOXg5 knDj+z6ELvY7zDRkqPnmoMZAKvEHUi41gQJldvu72XErwGHZjUanBbtJGKzT5oxQXADr og4SfwcQWKxfvYz4LUCZPZmuBk5jyO0qYB4xQ34T4dfrWy0cRcdmsWCZhncd6IPeksE1 FGgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=JyF91qSX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hpe.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v9-20020aa7d9c9000000b0047531b0169asi2581054eds.301.2022.12.16.10.40.28; Fri, 16 Dec 2022 10:40:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=JyF91qSX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hpe.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231124AbiLPShf (ORCPT + 99 others); Fri, 16 Dec 2022 13:37:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231334AbiLPSh2 (ORCPT ); Fri, 16 Dec 2022 13:37:28 -0500 Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB9F62B19B; Fri, 16 Dec 2022 10:37:27 -0800 (PST) Received: from pps.filterd (m0134425.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BGFLFui032462; Fri, 16 Dec 2022 18:37:09 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : subject : date : message-id : in-reply-to : references; s=pps0720; bh=Fz5XTwBCb8LOB+OGCGAEKYrMx/I8DUIe2X3g73uMLug=; b=JyF91qSXmsNC9kLoRPfbIdzMqil9c5Su21MSfCS2d/qmymJR95UeeFAyYgj2GMNfAIO4 2mzuJtf1V9MEG8ekNp9Lyw4EKO3k5lBxQSdesnqkwedptEwB93Ph9aYRhERux6ynmBu1 Bw5WqAvLN0J5CypAvlfWD4J6vzs+LOwucN34X3M8uc3Jh9VcZD0eLQMQ2P++ubUX93Cp rZ2K1gmGoHbvcrOJtKBDDZKTtiQ3+Wa9mFC2y4VirzJsoTfXtKiI1kr2Y9NmJyhM/Bgx IFVZqSoRxcckO5871aZeBuL7/c7vezVS6ZTweZkTjOrVjvq10pF04IY0NeXgrMYaYlei qw== Received: from p1lg14878.it.hpe.com (p1lg14878.it.hpe.com [16.230.97.204]) by mx0b-002e3701.pphosted.com (PPS) with ESMTPS id 3mgu8898yw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 16 Dec 2022 18:37:09 +0000 Received: from p1lg14885.dc01.its.hpecorp.net (unknown [10.119.18.236]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by p1lg14878.it.hpe.com (Postfix) with ESMTPS id 6EEB82FB3D; Fri, 16 Dec 2022 18:37:08 +0000 (UTC) Received: from hpe.com (unknown [16.231.227.36]) by p1lg14885.dc01.its.hpecorp.net (Postfix) with ESMTP id DA7948052FC; Fri, 16 Dec 2022 18:37:07 +0000 (UTC) From: nick.hawkins@hpe.com To: verdun@hpe.com, nick.hawkins@hpe.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, lee@kernel.org, linux@armlinux.org.uk, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v1 5/6] ARM: multi_v7_defconfig: add gxp i2c module Date: Fri, 16 Dec 2022 12:35:31 -0600 Message-Id: <20221216183532.78933-6-nick.hawkins@hpe.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221216183532.78933-1-nick.hawkins@hpe.com> References: <20221216183532.78933-1-nick.hawkins@hpe.com> X-Proofpoint-GUID: QwQXlsXOrKtpics1ySzbrSwIZvEmwL3t X-Proofpoint-ORIG-GUID: QwQXlsXOrKtpics1ySzbrSwIZvEmwL3t X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-16_12,2022-12-15_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=962 clxscore=1015 suspectscore=0 bulkscore=0 adultscore=0 impostorscore=0 lowpriorityscore=0 phishscore=0 priorityscore=1501 mlxscore=0 malwarescore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212160162 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752397042907391445?= X-GMAIL-MSGID: =?utf-8?q?1752397042907391445?= From: Nick Hawkins Add the CONFIG_I2C_GXP symbol to enable the GXP SoC I2C capabilities. Signed-off-by: Nick Hawkins --- arch/arm/configs/multi_v7_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig index b61b2e3d116b..8a19b1dc10d0 100644 --- a/arch/arm/configs/multi_v7_defconfig +++ b/arch/arm/configs/multi_v7_defconfig @@ -411,6 +411,7 @@ CONFIG_I2C_DAVINCI=y CONFIG_I2C_DESIGNWARE_PLATFORM=y CONFIG_I2C_DIGICOLOR=m CONFIG_I2C_EMEV2=m +CONFIG_I2C_GXP=m CONFIG_I2C_IMX=y CONFIG_I2C_MESON=y CONFIG_I2C_MV64XXX=y From patchwork Fri Dec 16 18:35:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hawkins, Nick" X-Patchwork-Id: 34046 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp1133124wrn; Fri, 16 Dec 2022 10:41:33 -0800 (PST) X-Google-Smtp-Source: AA0mqf6rTIhY5ChFq/nCMOReQ3CTQdecO/MJ5D23ebqzo28QkRybGsX/7poDAXVFR/g6gR/oKB4I X-Received: by 2002:aa7:cd78:0:b0:46c:be9f:7c3b with SMTP id ca24-20020aa7cd78000000b0046cbe9f7c3bmr27196492edb.19.1671216093241; Fri, 16 Dec 2022 10:41:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671216093; cv=none; d=google.com; s=arc-20160816; b=fko+5Qr4D9p+3Tmi1ekZkYWqLr9YUgxztJ2sBpstSvPjAf/pAmXwuZIif0Edt1QQxA WldhQCY0W1KuWxUFtZ+19ZezFhLGbkOpbzvujqgJ44YZCz92dx0e6zyH4EEagI5uLril ogsh0ojIj1/WnFgI77emaXbdd+lS2adqPMebHI7vxK1S7dwWn61x6EfQzYSPp8HpzWxx O15tppimDq4L3oTWY5fSh/BCGtzvPri4UVjtoFBG0J2CBJZ8SKIkARhp1azLIdhOlz/O vzjhxtti78KN3i6A9LHlnGdUKAt7UeEloXZEaAU7Y/1uF+nEOmxccBPlHKcnZAeHP+JX M43w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :to:from:dkim-signature; bh=Yn+EZ0eRx8hAEN6fe2DP4uMTvGLg+IpizCbA6rAV1rc=; b=xd0PMREozzOdDLTcnvzqBBeFyNecIJpFgYbKXLejypaOCEqxOiN7zaZLpwOKenuh/p Zc7am8fJmZRDaOND5m2Ju6KyU9RZunFk5un/9BFT+k7SUbCywFFIo2JkbWtgw1KAs20V /831UvV9Gc0vUbq9TKalKqcSzXxICSaBqYl7+mW5Mov7hukQAEXaGRjbiOX3LLiYyyAW oQYQTDSeAixNrcna4zVrh+UrWKR6igc/CP2DBdLa43TfmF0q52fSSVJpiPYVm7LarORD PpBLHGdpdnCC1kyzqkDQgVwkJ4ncUF4+UT84IG1YdQq3BWOu4oNIMZF/nuynQHz5lYxN /wdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=K4z9i4Qz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hpe.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nc30-20020a1709071c1e00b007be373ecc80si3725546ejc.16.2022.12.16.10.41.10; Fri, 16 Dec 2022 10:41:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=K4z9i4Qz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hpe.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231786AbiLPShm (ORCPT + 99 others); Fri, 16 Dec 2022 13:37:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231738AbiLPSha (ORCPT ); Fri, 16 Dec 2022 13:37:30 -0500 Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 310AE2B19B; Fri, 16 Dec 2022 10:37:29 -0800 (PST) Received: from pps.filterd (m0134420.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BGI24hg005349; Fri, 16 Dec 2022 18:37:09 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : subject : date : message-id : in-reply-to : references; s=pps0720; bh=Yn+EZ0eRx8hAEN6fe2DP4uMTvGLg+IpizCbA6rAV1rc=; b=K4z9i4QzRT+rVv7OTMtPyYFHzg/nYrOsgtlJ7D1flFaltUxZkePveBYNnhZ0qth1A98z wpe3pukCyDNVdf8j33KU3GXmslfSs3DaAyrsUbwTbXD4Ih7pZo/Wb9B0kfzt1J7ZhxIL VsvKgVDEM9I/jf1Z+sP3ewXw51pbzOjaS0Je3bd2FWsCKm6WCJTHt1UTL0nksz97dCgB HpfpfLVmO8C1Sc3uv/NN7jFn8IzDGtzRgJaGmYgueKrcxwD/8Wzim11g8GwaxaLCcs5V QB7PKfY5lVkxmAK+yokqkXbrMChnC96u/48pwW4CjSkOv+kXoIK3jZR/S9IXTke8urrS GQ== Received: from p1lg14881.it.hpe.com (p1lg14881.it.hpe.com [16.230.97.202]) by mx0b-002e3701.pphosted.com (PPS) with ESMTPS id 3mgusus8d9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 16 Dec 2022 18:37:09 +0000 Received: from p1lg14885.dc01.its.hpecorp.net (unknown [10.119.18.236]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by p1lg14881.it.hpe.com (Postfix) with ESMTPS id 0466680170B; Fri, 16 Dec 2022 18:37:08 +0000 (UTC) Received: from hpe.com (unknown [16.231.227.36]) by p1lg14885.dc01.its.hpecorp.net (Postfix) with ESMTP id 793EC80619A; Fri, 16 Dec 2022 18:37:08 +0000 (UTC) From: nick.hawkins@hpe.com To: verdun@hpe.com, nick.hawkins@hpe.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, lee@kernel.org, linux@armlinux.org.uk, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v1 6/6] MAINTAINERS: Add HPE GXP I2C Support Date: Fri, 16 Dec 2022 12:35:32 -0600 Message-Id: <20221216183532.78933-7-nick.hawkins@hpe.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221216183532.78933-1-nick.hawkins@hpe.com> References: <20221216183532.78933-1-nick.hawkins@hpe.com> X-Proofpoint-ORIG-GUID: XZMd4EUxk7MRyvR6I4HWqe69KoliQOp4 X-Proofpoint-GUID: XZMd4EUxk7MRyvR6I4HWqe69KoliQOp4 X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-16_12,2022-12-15_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 spamscore=0 malwarescore=0 suspectscore=0 lowpriorityscore=0 mlxlogscore=999 impostorscore=0 bulkscore=0 adultscore=0 phishscore=0 clxscore=1015 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212160162 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752397086309744203?= X-GMAIL-MSGID: =?utf-8?q?1752397086309744203?= From: Nick Hawkins Add the I2C controller source and bindings. Signed-off-by: Nick Hawkins --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 1daadaa4d48b..d671a8b6968e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2217,12 +2217,14 @@ M: Jean-Marie Verdun M: Nick Hawkins S: Maintained F: Documentation/devicetree/bindings/arm/hpe,gxp.yaml +F: Documentation/devicetree/bindings/i2c/hpe,gxp-i2c.yaml F: Documentation/devicetree/bindings/spi/hpe,gxp-spifi.yaml F: Documentation/devicetree/bindings/timer/hpe,gxp-timer.yaml F: arch/arm/boot/dts/hpe-bmc* F: arch/arm/boot/dts/hpe-gxp* F: arch/arm/mach-hpe/ F: drivers/clocksource/timer-gxp.c +F: drivers/i2c/busses/i2c-gxp.c F: drivers/spi/spi-gxp.c F: drivers/watchdog/gxp-wdt.c