From patchwork Mon Mar 20 21:54:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Titus Rwantare X-Patchwork-Id: 13181902 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) (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 9E34DC7619A for ; Mon, 20 Mar 2023 21:56:58 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1peNTa-0005Wk-5o; Mon, 20 Mar 2023 17:55:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <3UNYYZAYKCoc4t4532rzzrwp.nzx1px5-op6pwyzyry5.z2r@flex--titusr.bounces.google.com>) id 1peNTZ-0005WE-21 for qemu-devel@nongnu.org; Mon, 20 Mar 2023 17:55:33 -0400 Received: from mail-yw1-x1149.google.com ([2607:f8b0:4864:20::1149]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <3UNYYZAYKCoc4t4532rzzrwp.nzx1px5-op6pwyzyry5.z2r@flex--titusr.bounces.google.com>) id 1peNTW-0006Ye-Aa for qemu-devel@nongnu.org; Mon, 20 Mar 2023 17:55:32 -0400 Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-541a39df9f4so136424777b3.20 for ; Mon, 20 Mar 2023 14:55:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1679349329; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=Kl9Rnc3jC5wN7ou+/okayIAPmuVV14qj7WXT6LiSRPk=; b=Tyhvs+k/tPaFAgnWcIHKjCvZ2oKuT9qiO/B9VpGSyIbJzdKSzJe7C97tp2kLWTb46V UcsVaFVOM5dkj+/yglxK9fapRktqx537fXiVq+wywrhyrbNWSvT3b/0WXD3byFuscnEj Rw06GOQ5Z481IKLXCa9uXT3VmAvqAnG2VccNFVTqYXZidVYcvL1AzYaV+Z4T4RG7w7hf gG5ysnknOCqssPxIFedxpSgt12U3ErEakgYSU5TloKf4C8Yk5I9xBcZP7fwja7GLonoV e44Udl+Lz31BmyXL8l9UEIT3LgdO2/hG3NWHvE47b5X1UCL146aKg7P2yR4YMH8lCK19 vnaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679349329; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Kl9Rnc3jC5wN7ou+/okayIAPmuVV14qj7WXT6LiSRPk=; b=hpJ4ZcT0rvIwXDK8xkb/2YySO9gY7xT2vfcFnciGGZIqPffpD6WDuLP/4KKjqk8+KY SMB9YYM5NgQyAkMOYCnWeYdCSTnTqBcT3n8lPYSlXhIjvKMY18LK5tby0GsjI+//Q2p3 ps6di49kM0bO8VBGAjAU8Ie1zD4aqGdi5s4kxXmCmqRH4CQEr9pMgcsNwZFAL2g2gHx/ Au3vIuK4fYAzbYEmSdxKLqc7Qxl3KZ6KELVA6UNlt/6+K9pQksOB9DLPk8yUY1597l5r as6G55Eg4CUCsW3XIhEYtq4eqo/UnCKgUHMvC+5HP9aJSYXnJkftcAe5lho6/CSbD1eK z8dA== X-Gm-Message-State: AO0yUKWPHoJi9q4foon8VWzmcAK7WwlagxL2nh88xZUtgeLDEUsJ6Lpu 4N6O2T+1oJlIgYldfqaCvN/cT97wP44= X-Google-Smtp-Source: AK7set/V/uHhl42zcrnYa36qXYmGJq22yDUjNGdfoLxPngYGq33g6hs9zqG3qkSWFI7RtmSt4Oog4zkX1Ng= X-Received: from titusr.c.googlers.com ([fda3:e722:ac3:cc00:14:4d90:c0a8:22b8]) (user=titusr job=sendgmr) by 2002:a81:b663:0:b0:52b:fd10:4809 with SMTP id h35-20020a81b663000000b0052bfd104809mr11343138ywk.0.1679349328865; Mon, 20 Mar 2023 14:55:28 -0700 (PDT) Date: Mon, 20 Mar 2023 21:54:55 +0000 In-Reply-To: <20230320215500.722960-1-titusr@google.com> Mime-Version: 1.0 References: <20230320215500.722960-1-titusr@google.com> X-Mailer: git-send-email 2.40.0.rc1.284.g88254d51c5-goog Message-ID: <20230320215500.722960-2-titusr@google.com> Subject: [PATCH v3 1/5] bitops.h: add deposit16 function From: Titus Rwantare To: philmd@linaro.org, minyard@acm.org Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org, peter.maydell@linaro.org, Titus Rwantare Received-SPF: pass client-ip=2607:f8b0:4864:20::1149; envelope-from=3UNYYZAYKCoc4t4532rzzrwp.nzx1px5-op6pwyzyry5.z2r@flex--titusr.bounces.google.com; helo=mail-yw1-x1149.google.com X-Spam_score_int: -95 X-Spam_score: -9.6 X-Spam_bar: --------- X-Spam_report: (-9.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Makes it more explicit that 16 bit values are being used Signed-off-by: Titus Rwantare --- include/qemu/bitops.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/include/qemu/bitops.h b/include/qemu/bitops.h index 03213ce952..887b8f8ce8 100644 --- a/include/qemu/bitops.h +++ b/include/qemu/bitops.h @@ -446,6 +446,32 @@ static inline int64_t sextract64(uint64_t value, int start, int length) return ((int64_t)(value << (64 - length - start))) >> (64 - length); } +/** + * deposit16: + * @value: initial value to insert bit field into + * @start: the lowest bit in the bit field (numbered from 0) + * @length: the length of the bit field + * @fieldval: the value to insert into the bit field + * + * Deposit @fieldval into the 16 bit @value at the bit field specified + * by the @start and @length parameters, and return the modified + * @value. Bits of @value outside the bit field are not modified. + * Bits of @fieldval above the least significant @length bits are + * ignored. The bit field must lie entirely within the 16 bit word. + * It is valid to request that all 16 bits are modified (ie @length + * 16 and @start 0). + * + * Returns: the modified @value. + */ +static inline uint16_t deposit16(uint16_t value, int start, int length, + uint16_t fieldval) +{ + uint16_t mask; + assert(start >= 0 && length > 0 && length <= 16 - start); + mask = (~0U >> (16 - length)) << start; + return (value & ~mask) | ((fieldval << start) & mask); +} + /** * deposit32: * @value: initial value to insert bit field into From patchwork Mon Mar 20 21:54:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Titus Rwantare X-Patchwork-Id: 13181903 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) (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 C2A12C6FD1C for ; Mon, 20 Mar 2023 21:57:00 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1peNTd-0005ay-Cw; Mon, 20 Mar 2023 17:55:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <3UdYYZAYKCog5u5643s00sxq.o0y2qy6-pq7qxz0zsz6.03s@flex--titusr.bounces.google.com>) id 1peNTa-0005XU-Kd for qemu-devel@nongnu.org; Mon, 20 Mar 2023 17:55:34 -0400 Received: from mail-yw1-x114a.google.com ([2607:f8b0:4864:20::114a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <3UdYYZAYKCog5u5643s00sxq.o0y2qy6-pq7qxz0zsz6.03s@flex--titusr.bounces.google.com>) id 1peNTW-0006Yr-UF for qemu-devel@nongnu.org; Mon, 20 Mar 2023 17:55:34 -0400 Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-541888850d4so136872457b3.21 for ; Mon, 20 Mar 2023 14:55:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1679349329; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=7v9BBmW/hV7zJrGNIg4gLIF5VQ3yq0jB2Ae5FmH9ojY=; b=pVCN76odT3wEWMqF//2OOzW/wiS7Lk9wS1ta4POg3zNjFwFy8QedaGXuPnikWuqh9b MLlfbrwIvamz9v87EXmF/lTMzofr2LRM6zBqblUr+ubWCdb1xMKGZ6jkfU3AoMAC5AFz wft51RnWelE/3NSq7BX4QMdGJmG2DCkLz5INIt+b+L8kpMzWjCTc9ReAEWdyVa9bhr98 iTtY8gADTMRNIrN8rnXd2aeA4QQJYUQPcYrpP00KZirI5ROqV4m5Zd5WGlvU5BXxQpIs QDC2gEdzBQtcuPN55tISwGi6P13nLLScDN5wbU0msYRaBJhnCQ+gsf3HzDPG1Xd1hLbN uOPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679349329; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=7v9BBmW/hV7zJrGNIg4gLIF5VQ3yq0jB2Ae5FmH9ojY=; b=QUqJ60DEf4KioIVLOQKp1d2Q0LtSyS+mBKRn31Jpn4ToTCiiChdSxkrEbNoRTwBv4N yNvGmWAw6YQReUce9McnL12uI8c+X/62qSO801ILhecwRUSsrWvayDbEsRGhhIZrCwj/ B0Gim5tIqhQoLejY0EloOekKItgJUU27MeuqFMgOCEFWotkZmz/umPla1SXuFE14Z72e c4yMECtD1BQOil2E6XPfI0lwSjSmdFGzV5vsFTtxMOBD5gPglHBI9dQ6hsiksRmFtdII xV570kKQIYbt+RFkem/j4ujSong8CCAFqbnpWGFe8SotOhSXfdPHbKwilejxbzj3DTK0 PfrQ== X-Gm-Message-State: AO0yUKXX1OgUIVaryL4r4gYrqYqClyw+4BfsGHNccx1uXK1QXXNsQpBO 0H9DE3hK44PYEy6T3bXuJvJa38nwYd8= X-Google-Smtp-Source: AK7set/QaXtmlKY9dXL6THISQEZ7/x9YBlp1Q4MVq19ASjX6WtcOLy4uCJUb/xMgt5qwksMtalC8KB0FBwE= X-Received: from titusr.c.googlers.com ([fda3:e722:ac3:cc00:14:4d90:c0a8:22b8]) (user=titusr job=sendgmr) by 2002:a81:ca10:0:b0:544:6828:3c09 with SMTP id p16-20020a81ca10000000b0054468283c09mr11022246ywi.0.1679349329662; Mon, 20 Mar 2023 14:55:29 -0700 (PDT) Date: Mon, 20 Mar 2023 21:54:56 +0000 In-Reply-To: <20230320215500.722960-1-titusr@google.com> Mime-Version: 1.0 References: <20230320215500.722960-1-titusr@google.com> X-Mailer: git-send-email 2.40.0.rc1.284.g88254d51c5-goog Message-ID: <20230320215500.722960-3-titusr@google.com> Subject: [PATCH v3 2/5] hw/gpio: add PCA953x i2c GPIO expanders From: Titus Rwantare To: philmd@linaro.org, minyard@acm.org Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org, peter.maydell@linaro.org, Titus Rwantare , Hao Wu Received-SPF: pass client-ip=2607:f8b0:4864:20::114a; envelope-from=3UdYYZAYKCog5u5643s00sxq.o0y2qy6-pq7qxz0zsz6.03s@flex--titusr.bounces.google.com; helo=mail-yw1-x114a.google.com X-Spam_score_int: -95 X-Spam_score: -9.6 X-Spam_bar: --------- X-Spam_report: (-9.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org The PCA6416 is an i2c device with 16 GPIO pins, the PCA9538 has 8 pins. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Hao Wu Signed-off-by: Titus Rwantare --- hw/gpio/Kconfig | 5 + hw/gpio/meson.build | 1 + hw/gpio/pca_i2c_gpio.c | 392 ++++++++++++++++++++++++++++++++ hw/gpio/trace-events | 5 + include/hw/gpio/pca_i2c_gpio.h | 67 ++++++ roms/edk2 | 2 +- roms/openbios | 2 +- roms/opensbi | 2 +- roms/seabios | 2 +- tests/lcitool/libvirt-ci | 2 +- tests/qtest/meson.build | 1 + tests/qtest/pca_i2c_gpio-test.c | 188 +++++++++++++++ 12 files changed, 664 insertions(+), 5 deletions(-) create mode 100644 hw/gpio/pca_i2c_gpio.c create mode 100644 include/hw/gpio/pca_i2c_gpio.h create mode 100644 tests/qtest/pca_i2c_gpio-test.c diff --git a/hw/gpio/Kconfig b/hw/gpio/Kconfig index d2cf3accc8..80395af197 100644 --- a/hw/gpio/Kconfig +++ b/hw/gpio/Kconfig @@ -16,3 +16,8 @@ config GPIO_PWR config SIFIVE_GPIO bool + +config PCA_I2C_GPIO + bool + depends on I2C + default y if I2C_DEVICES diff --git a/hw/gpio/meson.build b/hw/gpio/meson.build index b726e6d27a..1e5b602002 100644 --- a/hw/gpio/meson.build +++ b/hw/gpio/meson.build @@ -12,3 +12,4 @@ softmmu_ss.add(when: 'CONFIG_OMAP', if_true: files('omap_gpio.c')) softmmu_ss.add(when: 'CONFIG_RASPI', if_true: files('bcm2835_gpio.c')) softmmu_ss.add(when: 'CONFIG_ASPEED_SOC', if_true: files('aspeed_gpio.c')) softmmu_ss.add(when: 'CONFIG_SIFIVE_GPIO', if_true: files('sifive_gpio.c')) +softmmu_ss.add(when: 'CONFIG_PCA_I2C_GPIO', if_true: files('pca_i2c_gpio.c')) diff --git a/hw/gpio/pca_i2c_gpio.c b/hw/gpio/pca_i2c_gpio.c new file mode 100644 index 0000000000..00ba343f95 --- /dev/null +++ b/hw/gpio/pca_i2c_gpio.c @@ -0,0 +1,392 @@ +/* + * NXP PCA I2C GPIO Expanders + * + * Low-voltage translating 16-bit I2C/SMBus GPIO expander with interrupt output, + * reset, and configuration registers + * + * Datasheet: https://www.nxp.com/docs/en/data-sheet/PCA6416A.pdf + * + * Copyright 2023 Google LLC + * + * SPDX-License-Identifier: GPL-2.0-or-later + * + * To assert some input pins before boot, use the following in the board file of + * the machine: + * object_property_set_uint(Object *obj, const char *name, + * uint64_t value, Error **errp); + * specifying name as "gpio_config" and the value as a bitfield of the inputs + * e.g. for the pca6416, a value of 0xFFF0, configures pins 0-3 as outputs and + * 4-15 as inputs. + * Then using name "gpio_input" with value "0x0F00" would raise GPIOs 8-11. + * + * This value can also be set at runtime through qmp externally, or by + * writing to the config register using i2c. The guest driver should generally + * control the config register, but exposing it via qmp allows external testing. + * + */ + +#include "qemu/osdep.h" +#include "hw/gpio/pca_i2c_gpio.h" +#include "hw/irq.h" +#include "hw/qdev-properties.h" +#include "migration/vmstate.h" +#include "qapi/visitor.h" +#include "qemu/log.h" +#include "qemu/module.h" +#include "qemu/bitops.h" +#include "trace.h" + +/* + * compare new_output to curr_output and update irq to match new_output + * + * The Input port registers (registers 0 and 1) reflect the incoming logic + * levels of the pins, regardless of whether the pin is defined as an input or + * an output by the Configuration register. + */ +static void pca_i2c_update_irqs(PCAGPIOState *ps) +{ + PCAGPIOClass *pc = PCA_I2C_GPIO_GET_CLASS(ps); + uint16_t out_diff = ps->new_output ^ ps->curr_output; + uint16_t in_diff = ps->new_input ^ ps->curr_input; + uint16_t mask, pin_i; + + if (in_diff || out_diff) { + for (int i = 0; i < pc->num_pins; i++) { + mask = BIT(i); + /* pin must be configured as an output to be set here */ + if (out_diff & ~ps->config & mask) { + pin_i = mask & ps->new_output; + qemu_set_irq(ps->output[i], pin_i > 0); + ps->curr_output &= ~mask; + ps->curr_output |= pin_i; + } + + if (in_diff & mask) { + ps->curr_input &= ~mask; + ps->curr_input |= mask & ps->new_input; + } + } + /* make diff = 0 */ + ps->new_input = ps->curr_input; + } +} + +static void pca_i2c_irq_handler(void *opaque, int n, int level) +{ + PCAGPIOState *ps = opaque; + PCAGPIOClass *pc = PCA_I2C_GPIO_GET_CLASS(opaque); + uint16_t mask = BIT(n); + + g_assert(n < pc->num_pins); + g_assert(n >= 0); + + ps->new_input &= ~mask; + + if (level > 0) { + ps->new_input |= BIT(n); + } + + pca_i2c_update_irqs(ps); +} + +/* slave to master */ +static uint8_t _pca953x_recv(I2CSlave *i2c, uint32_t shift) +{ + PCAGPIOState *ps = PCA_I2C_GPIO(i2c); + uint8_t data; + + switch (ps->command) { + case PCA953x_INPUT_PORT: + data = extract16(ps->curr_input, shift, 8); + break; + /* + * i2c reads to the output registers reflect the values written + * NOT the actual values of the gpios + */ + case PCA953x_OUTPUT_PORT: + data = extract16(ps->new_output, shift, 8); + break; + + case PCA953x_POLARITY_INVERSION_PORT: + data = extract16(ps->polarity_inv, shift, 8); + break; + + case PCA953x_CONFIGURATION_PORT: + data = extract16(ps->config, shift, 8); + break; + + default: + qemu_log_mask(LOG_GUEST_ERROR, + "%s: reading from unsupported register 0x%02x", + __func__, ps->command); + data = 0xFF; + break; + } + + trace_pca_i2c_recv(DEVICE(ps)->canonical_path, ps->command, shift, data); + return data; +} + +static uint8_t pca6416_recv(I2CSlave *i2c) +{ + PCAGPIOState *ps = PCA_I2C_GPIO(i2c); + uint32_t shift = ps->command & 1 ? 8 : 0; + + /* Transform command into 4 port equivalent */ + ps->command = ps->command >> 1; + + return _pca953x_recv(i2c, shift); +} + +static uint8_t pca953x_recv(I2CSlave *i2c) +{ + return _pca953x_recv(i2c, 0); +} + +/* master to slave */ +static int _pca953x_send(I2CSlave *i2c, uint32_t shift, uint8_t data) +{ + PCAGPIOState *ps = PCA_I2C_GPIO(i2c); + + if (ps->i2c_cmd) { + ps->command = data; + ps->i2c_cmd = false; + return 0; + } + + trace_pca_i2c_send(DEVICE(ps)->canonical_path, ps->command, shift, data); + + switch (ps->command) { + case PCA953x_INPUT_PORT: + qemu_log_mask(LOG_GUEST_ERROR, "%s: writing to read only reg: 0x%02x", + __func__, ps->command); + break; + case PCA953x_OUTPUT_PORT: + ps->new_output = deposit16(ps->new_output, shift, 8, data); + break; + + case PCA953x_POLARITY_INVERSION_PORT: + ps->polarity_inv = deposit16(ps->polarity_inv, shift, 8, data); + break; + + case PCA953x_CONFIGURATION_PORT: + ps->config = deposit16(ps->config, shift, 8, data); + break; + + default: + qemu_log_mask(LOG_GUEST_ERROR, + "%s: writing to unsupported register\n", + __func__); + return -1; + } + + pca_i2c_update_irqs(ps); + return 0; +} + +static int pca6416_send(I2CSlave *i2c, uint8_t data) +{ + PCAGPIOState *ps = PCA_I2C_GPIO(i2c); + uint32_t shift = ps->command & 1 ? 8 : 0; + + /* Transform command into 4 port equivalent */ + ps->command = ps->command >> 1; + + return _pca953x_send(i2c, shift, data); +} + +static int pca953x_send(I2CSlave *i2c, uint8_t data) +{ + return _pca953x_send(i2c, 0, data); +} + +static int pca_i2c_event(I2CSlave *i2c, enum i2c_event event) +{ + PCAGPIOState *ps = PCA_I2C_GPIO(i2c); + + switch (event) { + case I2C_START_RECV: + trace_pca_i2c_event(DEVICE(ps)->canonical_path, "START_RECV"); + break; + + case I2C_START_SEND: + trace_pca_i2c_event(DEVICE(ps)->canonical_path, "START_SEND"); + ps->i2c_cmd = true; + break; + + case I2C_FINISH: + trace_pca_i2c_event(DEVICE(ps)->canonical_path, "FINISH"); + break; + + case I2C_NACK: + trace_pca_i2c_event(DEVICE(ps)->canonical_path, "NACK"); + break; + + default: + qemu_log_mask(LOG_GUEST_ERROR, "%s: %s: unknown event 0x%x\n", + DEVICE(ps)->canonical_path, __func__, event); + return -1; + } + + return 0; +} + +static void pca_i2c_config_get(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) +{ + PCAGPIOState *ps = PCA_I2C_GPIO(obj); + visit_type_uint16(v, name, &ps->config, errp); +} + +static void pca_i2c_config_set(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) +{ + PCAGPIOState *ps = PCA_I2C_GPIO(obj); + if (!visit_type_uint16(v, name, &ps->config, errp)) { + return; + } + pca_i2c_update_irqs(ps); +} + + +static void pca_i2c_input_get(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) +{ + PCAGPIOState *ps = PCA_I2C_GPIO(obj); + visit_type_uint16(v, name, &ps->curr_input, errp); +} + +static void pca_i2c_input_set(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) +{ + PCAGPIOState *ps = PCA_I2C_GPIO(obj); + if (!visit_type_uint16(v, name, &ps->new_input, errp)) { + return; + } + pca_i2c_update_irqs(ps); +} + +static void pca_i2c_output_get(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) +{ + PCAGPIOState *ps = PCA_I2C_GPIO(obj); + visit_type_uint16(v, name, &ps->curr_output, errp); +} + +static void pca_i2c_output_set(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) +{ + PCAGPIOState *ps = PCA_I2C_GPIO(obj); + if (!visit_type_uint16(v, name, &ps->new_output, errp)) { + return; + } + pca_i2c_update_irqs(ps); +} + +static void pca_i2c_enter_reset(Object *obj, ResetType type) +{ + PCAGPIOState *ps = PCA_I2C_GPIO(obj); + + ps->polarity_inv = 0; + ps->config = 0; + ps->new_input = 0; + ps->new_output = 0; + ps->command = 0; + + pca_i2c_update_irqs(ps); +} + + +static const VMStateDescription vmstate_pca_i2c_gpio = { + .name = TYPE_PCA_I2C_GPIO, + .version_id = 0, + .minimum_version_id = 0, + .fields = (VMStateField[]) { + VMSTATE_I2C_SLAVE(parent, PCAGPIOState), + VMSTATE_UINT16(polarity_inv, PCAGPIOState), + VMSTATE_UINT16(config, PCAGPIOState), + VMSTATE_UINT16(curr_input, PCAGPIOState), + VMSTATE_UINT16(curr_output, PCAGPIOState), + VMSTATE_END_OF_LIST() + } +}; + +static void pca6416_gpio_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc = DEVICE_CLASS(klass); + I2CSlaveClass *k = I2C_SLAVE_CLASS(klass); + PCAGPIOClass *pc = PCA_I2C_GPIO_CLASS(klass); + + dc->desc = "PCA6416 16-bit I/O expander"; + pc->num_pins = PCA6416_NUM_PINS; + + k->recv = pca6416_recv; + k->send = pca6416_send; +} + +static void pca9538_gpio_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc = DEVICE_CLASS(klass); + I2CSlaveClass *k = I2C_SLAVE_CLASS(klass); + PCAGPIOClass *pc = PCA_I2C_GPIO_CLASS(klass); + + dc->desc = "PCA9538 8-bit I/O expander"; + pc->num_pins = PCA9538_NUM_PINS; + + k->recv = pca953x_recv; + k->send = pca953x_send; +} + +static void pca_i2c_gpio_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc = DEVICE_CLASS(klass); + I2CSlaveClass *k = I2C_SLAVE_CLASS(klass); + ResettableClass *rc = RESETTABLE_CLASS(klass); + + dc->vmsd = &vmstate_pca_i2c_gpio; + rc->phases.enter = pca_i2c_enter_reset; + k->event = pca_i2c_event; +} + +static void pca_i2c_gpio_init(Object *obj) +{ + PCAGPIOState *ps = PCA_I2C_GPIO(obj); + PCAGPIOClass *pc = PCA_I2C_GPIO_GET_CLASS(obj); + DeviceState *dev = DEVICE(obj); + + object_property_add(obj, "gpio_input", "uint16", + pca_i2c_input_get, + pca_i2c_input_set, NULL, NULL); + object_property_add(obj, "gpio_output", "uint16", + pca_i2c_output_get, + pca_i2c_output_set, NULL, NULL); + object_property_add(obj, "gpio_config", "uint16", + pca_i2c_config_get, + pca_i2c_config_set, NULL, NULL); + qdev_init_gpio_in(dev, pca_i2c_irq_handler, pc->num_pins); + qdev_init_gpio_out(dev, ps->output, pc->num_pins); +} + +static const TypeInfo pca_gpio_types[] = { + { + .name = TYPE_PCA_I2C_GPIO, + .parent = TYPE_I2C_SLAVE, + .instance_size = sizeof(PCAGPIOState), + .instance_init = pca_i2c_gpio_init, + .class_size = sizeof(PCAGPIOClass), + .class_init = pca_i2c_gpio_class_init, + .abstract = true, + }, + { + .name = TYPE_PCA6416_GPIO, + .parent = TYPE_PCA_I2C_GPIO, + .class_init = pca6416_gpio_class_init, + }, + { + .name = TYPE_PCA9538_GPIO, + .parent = TYPE_PCA_I2C_GPIO, + .class_init = pca9538_gpio_class_init, + }, +}; + +DEFINE_TYPES(pca_gpio_types); diff --git a/hw/gpio/trace-events b/hw/gpio/trace-events index 9736b362ac..af9f9acfb8 100644 --- a/hw/gpio/trace-events +++ b/hw/gpio/trace-events @@ -31,3 +31,8 @@ sifive_gpio_update_output_irq(int64_t line, int64_t value) "line %" PRIi64 " val # aspeed_gpio.c aspeed_gpio_read(uint64_t offset, uint64_t value) "offset: 0x%" PRIx64 " value 0x%" PRIx64 aspeed_gpio_write(uint64_t offset, uint64_t value) "offset: 0x%" PRIx64 " value 0x%" PRIx64 + +# pca_i2c_gpio.c +pca_i2c_event(const char *id, const char *event) "%s: %s" +pca_i2c_recv(const char *id, uint8_t cmd, uint32_t shift, uint8_t data) "%s cmd: 0x%" PRIx8 "shift: %" PRIi32 " data 0x%" PRIx8 +pca_i2c_send(const char *id, uint8_t cmd, uint32_t shift, uint8_t data) "%s cmd: 0x%" PRIx8 "shift: %" PRIi32 " data 0x%" PRIx8 diff --git a/include/hw/gpio/pca_i2c_gpio.h b/include/hw/gpio/pca_i2c_gpio.h new file mode 100644 index 0000000000..a4220105e8 --- /dev/null +++ b/include/hw/gpio/pca_i2c_gpio.h @@ -0,0 +1,67 @@ +/* + * NXP PCA6416A + * Low-voltage translating 16-bit I2C/SMBus GPIO expander with interrupt output, + * reset, and configuration registers + * + * Datasheet: https://www.nxp.com/docs/en/data-sheet/PCA6416A.pdf + * + * Note: Polarity inversion emulation not implemented + * + * Copyright 2021 Google LLC + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#ifndef PCA_I2C_GPIO_H +#define PCA_I2C_GPIO_H + +#include "hw/i2c/i2c.h" +#include "qom/object.h" + +#define PCA_I2C_MAX_PINS 16 +#define PCA6416_NUM_PINS 16 +#define PCA9538_NUM_PINS 8 + +typedef struct PCAGPIOClass { + I2CSlaveClass parent; + + uint8_t num_pins; +} PCAGPIOClass; + +typedef struct PCAGPIOState { + I2CSlave parent; + + uint16_t polarity_inv; + uint16_t config; + + /* the values of the gpio pins are mirrored in these integers */ + uint16_t curr_input; + uint16_t curr_output; + uint16_t new_input; + uint16_t new_output; + + /* + * Note that these outputs need to be consumed by some other input + * to be useful, qemu ignores writes to disconnected gpio pins + */ + qemu_irq output[PCA_I2C_MAX_PINS]; + + /* i2c transaction info */ + uint8_t command; + bool i2c_cmd; + +} PCAGPIOState; + +#define TYPE_PCA_I2C_GPIO "pca_i2c_gpio" +OBJECT_DECLARE_TYPE(PCAGPIOState, PCAGPIOClass, PCA_I2C_GPIO) + +#define PCA953x_INPUT_PORT 0x00 /* read */ +#define PCA953x_OUTPUT_PORT 0x01 /* read/write */ +#define PCA953x_POLARITY_INVERSION_PORT 0x02 /* read/write */ +#define PCA953x_CONFIGURATION_PORT 0x03 /* read/write */ + +#define PCA_I2C_CONFIG_DEFAULT 0 + +#define TYPE_PCA6416_GPIO "pca6416" +#define TYPE_PCA9538_GPIO "pca9538" + +#endif diff --git a/roms/edk2 b/roms/edk2 index f80f052277..b24306f15d 160000 --- a/roms/edk2 +++ b/roms/edk2 @@ -1 +1 @@ -Subproject commit f80f052277c88a67c55e107b550f504eeea947d3 +Subproject commit b24306f15daa2ff8510b06702114724b33895d3c diff --git a/roms/openbios b/roms/openbios index af97fd7af5..0e0afae657 160000 --- a/roms/openbios +++ b/roms/openbios @@ -1 +1 @@ -Subproject commit af97fd7af5e7c18f591a7b987291d3db4ffb28b5 +Subproject commit 0e0afae6579c1efe9f0d85505b75ffe989554133 diff --git a/roms/opensbi b/roms/opensbi index 6b5188ca14..4489876e93 160000 --- a/roms/opensbi +++ b/roms/opensbi @@ -1 +1 @@ -Subproject commit 6b5188ca14e59ce7bf71afe4e7d3d557c3d31bf8 +Subproject commit 4489876e933d8ba0d8bc6c64bae71e295d45faac diff --git a/roms/seabios b/roms/seabios index ea1b7a0733..3208b098f5 160000 --- a/roms/seabios +++ b/roms/seabios @@ -1 +1 @@ -Subproject commit ea1b7a0733906b8425d948ae94fba63c32b1d425 +Subproject commit 3208b098f51a9ef96d0dfa71d5ec3a3eaec88f0a diff --git a/tests/lcitool/libvirt-ci b/tests/lcitool/libvirt-ci index 232f41f160..e3eb28cf2e 160000 --- a/tests/lcitool/libvirt-ci +++ b/tests/lcitool/libvirt-ci @@ -1 +1 @@ -Subproject commit 232f41f160d4567b8c82dd52aa96c2bc3a5b75c1 +Subproject commit e3eb28cf2e17fbcf7fe7e19505ee432b8ec5bbb5 diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index 85ea4e8d99..68cd101f7a 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -244,6 +244,7 @@ qos_test_ss.add( 'ne2000-test.c', 'tulip-test.c', 'nvme-test.c', + 'pca_i2c_gpio-test.c', 'pca9552-test.c', 'pci-test.c', 'pcnet-test.c', diff --git a/tests/qtest/pca_i2c_gpio-test.c b/tests/qtest/pca_i2c_gpio-test.c new file mode 100644 index 0000000000..2bb4c6a664 --- /dev/null +++ b/tests/qtest/pca_i2c_gpio-test.c @@ -0,0 +1,188 @@ +/* + * QTest for PCA I2C GPIO expanders + * + * Copyright 2021 Google LLC + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "hw/gpio/pca_i2c_gpio.h" +#include "libqtest-single.h" +#include "libqos/i2c.h" +#include "qapi/qmp/qdict.h" +#include "qapi/qmp/qnum.h" +#include "qemu/bitops.h" + + +#define PCA6416_INPUT_PORT_0 0x00 /* read */ +#define PCA6416_INPUT_PORT_1 0x01 /* read */ +#define PCA6416_OUTPUT_PORT_0 0x02 /* read/write */ +#define PCA6416_OUTPUT_PORT_1 0x03 /* read/write */ +#define PCA6416_POLARITY_INVERSION_PORT_0 0x04 /* read/write */ +#define PCA6416_POLARITY_INVERSION_PORT_1 0x05 /* read/write */ +#define PCA6416_CONFIGURATION_PORT_0 0x06 /* read/write */ +#define PCA6416_CONFIGURATION_PORT_1 0x07 /* read/write */ + + +#define TEST_ID "pca_i2c_gpio-test" +#define PCA_CONFIG_BYTE 0x55 +#define PCA_CONFIG_BYTE_UPPER 0xAA +#define PCA_CONFIG_WORD 0xAA55 + +static uint16_t qmp_pca_gpio_get(const char *id, const char *property) +{ + QDict *response; + uint16_t ret; + response = qmp("{ 'execute': 'qom-get', 'arguments': { 'path': %s, " + "'property': %s } }", id, property); + g_assert(qdict_haskey(response, "return")); + ret = qnum_get_uint(qobject_to(QNum, qdict_get(response, "return"))); + qobject_unref(response); + return ret; +} + +static void qmp_pca_gpio_set(const char *id, const char *property, + uint16_t value) +{ + QDict *response; + + response = qmp("{ 'execute': 'qom-set', 'arguments': { 'path': %s, " + "'property': %s, 'value': %u } }", + id, property, value); + g_assert(qdict_haskey(response, "return")); + qobject_unref(response); +} + +static void test_set_input(void *obj, void *data, QGuestAllocator *alloc) +{ + QI2CDevice *i2cdev = (QI2CDevice *)obj; + uint8_t value; + uint16_t qmp_value; + /* configure pins to be inputs */ + i2c_set8(i2cdev, PCA6416_CONFIGURATION_PORT_0, 0xFF); + i2c_set8(i2cdev, PCA6416_CONFIGURATION_PORT_1, 0xFF); + + qmp_pca_gpio_set(TEST_ID, "gpio_input", 0xAAAA); + value = i2c_get8(i2cdev, PCA6416_INPUT_PORT_0); + g_assert_cmphex(value, ==, 0xAA); + value = i2c_get8(i2cdev, PCA6416_INPUT_PORT_1); + g_assert_cmphex(value, ==, 0xAA); + + qmp_value = qmp_pca_gpio_get(TEST_ID, "gpio_input"); + g_assert_cmphex(qmp_value, ==, 0xAAAA); +} +static void test_config(void *obj, void *data, QGuestAllocator *alloc) +{ + + QI2CDevice *i2cdev = (QI2CDevice *)obj; + uint8_t value; + uint16_t qmp_value; + /* configure half the pins to be inputs */ + i2c_set8(i2cdev, PCA6416_CONFIGURATION_PORT_0, PCA_CONFIG_BYTE); + i2c_set8(i2cdev, PCA6416_CONFIGURATION_PORT_1, PCA_CONFIG_BYTE_UPPER); + value = i2c_get8(i2cdev, PCA6416_CONFIGURATION_PORT_0); + g_assert_cmphex(value, ==, PCA_CONFIG_BYTE); + + value = i2c_get8(i2cdev, PCA6416_CONFIGURATION_PORT_1); + g_assert_cmphex(value, ==, PCA_CONFIG_BYTE_UPPER); + + /* the pins that match the config should be set, the rest are undef */ + qmp_pca_gpio_set(TEST_ID, "gpio_input", 0xFFFF); + value = i2c_get8(i2cdev, PCA6416_INPUT_PORT_0); + g_assert_cmphex(value & PCA_CONFIG_BYTE, ==, 0x55); + value = i2c_get8(i2cdev, PCA6416_INPUT_PORT_1); + g_assert_cmphex(value & PCA_CONFIG_BYTE_UPPER, ==, 0xAA); + qmp_value = qmp_pca_gpio_get(TEST_ID, "gpio_input"); + g_assert_cmphex(qmp_value & PCA_CONFIG_WORD, ==, 0xAA55); + + /* + * i2c will return the value written to the output register, not the values + * of the output pins, so we check only the configured pins + */ + qmp_pca_gpio_set(TEST_ID, "gpio_output", 0xFFFF); + value = i2c_get8(i2cdev, PCA6416_OUTPUT_PORT_0); + g_assert_cmphex(value & ~PCA_CONFIG_BYTE, ==, 0xAA); + value = i2c_get8(i2cdev, PCA6416_OUTPUT_PORT_1); + g_assert_cmphex(value & ~PCA_CONFIG_BYTE_UPPER, ==, 0x55); + + qmp_value = qmp_pca_gpio_get(TEST_ID, "gpio_output"); + g_assert_cmphex(qmp_value & ~PCA_CONFIG_WORD, ==, 0x55AA); +} + +static void test_set_output(void *obj, void *data, QGuestAllocator *alloc) +{ + QI2CDevice *i2cdev = (QI2CDevice *)obj; + uint8_t value; + uint16_t qmp_value; + /* configure pins to be outputs */ + i2c_set8(i2cdev, PCA6416_CONFIGURATION_PORT_0, 0); + i2c_set8(i2cdev, PCA6416_CONFIGURATION_PORT_1, 0); + + qmp_pca_gpio_set(TEST_ID, "gpio_output", 0xBB55); + value = i2c_get8(i2cdev, PCA6416_OUTPUT_PORT_0); + g_assert_cmphex(value, ==, 0x55); + value = i2c_get8(i2cdev, PCA6416_OUTPUT_PORT_1); + g_assert_cmphex(value, ==, 0xBB); + + qmp_value = qmp_pca_gpio_get(TEST_ID, "gpio_output"); + g_assert_cmphex(qmp_value, ==, 0xBB55); +} + +static void test_tx_rx(void *obj, void *data, QGuestAllocator *alloc) +{ + QI2CDevice *i2cdev = (QI2CDevice *)obj; + uint8_t value; + + i2c_set8(i2cdev, PCA6416_CONFIGURATION_PORT_0, 0xFF); + i2c_set8(i2cdev, PCA6416_CONFIGURATION_PORT_1, 0xFF); + i2c_set8(i2cdev, PCA6416_POLARITY_INVERSION_PORT_0, 0); + i2c_set8(i2cdev, PCA6416_POLARITY_INVERSION_PORT_1, 0); + + value = i2c_get8(i2cdev, PCA6416_CONFIGURATION_PORT_0); + g_assert_cmphex(value, ==, 0xFF); + + value = i2c_get8(i2cdev, PCA6416_CONFIGURATION_PORT_1); + g_assert_cmphex(value, ==, 0xFF); + + value = i2c_get8(i2cdev, PCA6416_POLARITY_INVERSION_PORT_0); + g_assert_cmphex(value, ==, 0); + + value = i2c_get8(i2cdev, PCA6416_POLARITY_INVERSION_PORT_1); + g_assert_cmphex(value, ==, 0); + + i2c_set8(i2cdev, PCA6416_CONFIGURATION_PORT_0, 0xAB); + value = i2c_get8(i2cdev, PCA6416_CONFIGURATION_PORT_0); + g_assert_cmphex(value, ==, 0xAB); + + i2c_set8(i2cdev, PCA6416_CONFIGURATION_PORT_1, 0xBC); + value = i2c_get8(i2cdev, PCA6416_CONFIGURATION_PORT_1); + g_assert_cmphex(value, ==, 0xBC); + + i2c_set8(i2cdev, PCA6416_POLARITY_INVERSION_PORT_0, 0xAB); + value = i2c_get8(i2cdev, PCA6416_POLARITY_INVERSION_PORT_0); + g_assert_cmphex(value, ==, 0xAB); + + i2c_set8(i2cdev, PCA6416_POLARITY_INVERSION_PORT_1, 0x7C); + value = i2c_get8(i2cdev, PCA6416_POLARITY_INVERSION_PORT_1); + g_assert_cmphex(value, ==, 0x7C); + +} + +static void pca_i2c_gpio_register_nodes(void) +{ + QOSGraphEdgeOptions opts = { + .extra_device_opts = "id=" TEST_ID ",address=0x78" + }; + add_qi2c_address(&opts, &(QI2CAddress) { 0x78 }); + g_test_set_nonfatal_assertions(); + + qos_node_create_driver("pca6416", i2c_device_create); + qos_node_consumes("pca6416", "i2c-bus", &opts); + + qos_add_test("tx-rx", "pca6416", test_tx_rx, NULL); + qos_add_test("set_output_gpio", "pca6416", test_set_output, NULL); + qos_add_test("set_input_gpio", "pca6416", test_set_input, NULL); + qos_add_test("follow_gpio_config", "pca6416", test_config, NULL); +} +libqos_init(pca_i2c_gpio_register_nodes); From patchwork Mon Mar 20 21:54:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Titus Rwantare X-Patchwork-Id: 13181899 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) (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 38797C6FD1D for ; Mon, 20 Mar 2023 21:56:32 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1peNTc-0005Z5-0O; Mon, 20 Mar 2023 17:55:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <3UtYYZAYKCok6v6754t11tyr.p1z3rz7-qr8ry010t07.14t@flex--titusr.bounces.google.com>) id 1peNTZ-0005Wg-Ud for qemu-devel@nongnu.org; Mon, 20 Mar 2023 17:55:33 -0400 Received: from mail-ua1-x94a.google.com ([2607:f8b0:4864:20::94a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <3UtYYZAYKCok6v6754t11tyr.p1z3rz7-qr8ry010t07.14t@flex--titusr.bounces.google.com>) id 1peNTY-0006Z4-5L for qemu-devel@nongnu.org; Mon, 20 Mar 2023 17:55:33 -0400 Received: by mail-ua1-x94a.google.com with SMTP id w24-20020ab00918000000b0075e9c7ffadfso5781554uag.13 for ; Mon, 20 Mar 2023 14:55:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1679349330; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=SkjeIjBf24fTWVjbXjCodVjSEoYMWjTjsoIFCGcOfx4=; b=AI9pbGhJAlwjWNMAdtIJKZ/+Ecsd5jdACKlpZsZM0mRz7KySerAq9gIYPUyBH6tfWi STZ7EUjy/6jHSPchL+rVo/ZbJxaXWUnU+GiCD2pAdLPB20kJh8MqvnPCOOSOwdJ+OPev Eca6SDKCv5MbEyFNde6dykrEyhfLqyqKjfrbOhscDepY/Q0qJYHIn50uQQxo1mW8D2GH DYnCw8AT6BfmwEEZXGRdWltaMl3YLXGZ7OBvz0bm937ZaL1nOmdKeq5fCzdqN4qTBnO2 OoIXGbOMJJtomQvGTHGH++cu+saUg2yNaM3frN5GvmOaEY4Hl1UzBJRMQ0YI8yI8zhvC qKCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679349330; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=SkjeIjBf24fTWVjbXjCodVjSEoYMWjTjsoIFCGcOfx4=; b=wXQiVbcoBDfeuAeOWqOi4ColfEHkZhoZMBP+B3HEYc5hCnJH6RJo/5uB84dChlkI+e vq68Q1/1109gEy5NkiAFRBkqN16fDsfS5KryYiuiKEHuU+UhkWYtNsMJIz56XrYsEZxS 8czVIpMsiMWzdfNcuV7T4Kdqfw9VoPDFT/5YjPxGotFr07GpSBtLGUKTTctH6vbJBD8b kQjBNeqEjjLjCRrcasTD1QXBo7HWQJxLapDEQkr6DF+xhJXU1tTWC43rswOUKEH4TT1H n688jVTcdJ8A/C9cqX+SNZJBnhnLxuvXwOv+eXK6sblRQ2gxU7/ML8QcifJm20iIk8VO Ey2A== X-Gm-Message-State: AAQBX9drQTwBk8rI8t3ZMfqAEe1oNSnK9Gml8YOTQsnLv4amEI8gu/OF OwGiAy+UzDfDWkWmrNzM+ToOllIOVLw= X-Google-Smtp-Source: AKy350ZEXRJuoMLl+ri1+AVn5Uw2ymN59XG+bjAyhljzTVQMapdkIOrQopbdgYVaCmjcepoMVzwk0qNqMEg= X-Received: from titusr.c.googlers.com ([fda3:e722:ac3:cc00:14:4d90:c0a8:22b8]) (user=titusr job=sendgmr) by 2002:ab0:6ca5:0:b0:75d:782c:f31b with SMTP id j5-20020ab06ca5000000b0075d782cf31bmr14342uaa.0.1679349330444; Mon, 20 Mar 2023 14:55:30 -0700 (PDT) Date: Mon, 20 Mar 2023 21:54:57 +0000 In-Reply-To: <20230320215500.722960-1-titusr@google.com> Mime-Version: 1.0 References: <20230320215500.722960-1-titusr@google.com> X-Mailer: git-send-email 2.40.0.rc1.284.g88254d51c5-goog Message-ID: <20230320215500.722960-4-titusr@google.com> Subject: [PATCH v3 3/5] hw/gpio: add PCA9536 i2c gpio expander From: Titus Rwantare To: philmd@linaro.org, minyard@acm.org Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org, peter.maydell@linaro.org, Titus Rwantare , Hao Wu Received-SPF: pass client-ip=2607:f8b0:4864:20::94a; envelope-from=3UtYYZAYKCok6v6754t11tyr.p1z3rz7-qr8ry010t07.14t@flex--titusr.bounces.google.com; helo=mail-ua1-x94a.google.com X-Spam_score_int: -95 X-Spam_score: -9.6 X-Spam_bar: --------- X-Spam_report: (-9.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org This device has the same register layout as the pca9538, but 4 fewer gpio pins. This commit lowers the number of pins initialised, and reuses the pca9538 logic. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Hao Wu Signed-off-by: Titus Rwantare --- hw/gpio/pca_i2c_gpio.c | 18 ++++++++++++++++++ include/hw/gpio/pca_i2c_gpio.h | 2 ++ tests/lcitool/libvirt-ci | 2 +- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/hw/gpio/pca_i2c_gpio.c b/hw/gpio/pca_i2c_gpio.c index 00ba343f95..14da58e5c4 100644 --- a/hw/gpio/pca_i2c_gpio.c +++ b/hw/gpio/pca_i2c_gpio.c @@ -337,6 +337,19 @@ static void pca9538_gpio_class_init(ObjectClass *klass, void *data) k->send = pca953x_send; } +static void pca9536_gpio_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc = DEVICE_CLASS(klass); + I2CSlaveClass *k = I2C_SLAVE_CLASS(klass); + PCAGPIOClass *pc = PCA_I2C_GPIO_CLASS(klass); + + dc->desc = "PCA9536 4-bit I/O expander"; + pc->num_pins = PCA9536_NUM_PINS; + + k->recv = pca953x_recv; + k->send = pca953x_send; +} + static void pca_i2c_gpio_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); @@ -387,6 +400,11 @@ static const TypeInfo pca_gpio_types[] = { .parent = TYPE_PCA_I2C_GPIO, .class_init = pca9538_gpio_class_init, }, + { + .name = TYPE_PCA9536_GPIO, + .parent = TYPE_PCA_I2C_GPIO, + .class_init = pca9536_gpio_class_init, + }, }; DEFINE_TYPES(pca_gpio_types); diff --git a/include/hw/gpio/pca_i2c_gpio.h b/include/hw/gpio/pca_i2c_gpio.h index a4220105e8..deb4528065 100644 --- a/include/hw/gpio/pca_i2c_gpio.h +++ b/include/hw/gpio/pca_i2c_gpio.h @@ -20,6 +20,7 @@ #define PCA_I2C_MAX_PINS 16 #define PCA6416_NUM_PINS 16 #define PCA9538_NUM_PINS 8 +#define PCA9536_NUM_PINS 4 typedef struct PCAGPIOClass { I2CSlaveClass parent; @@ -63,5 +64,6 @@ OBJECT_DECLARE_TYPE(PCAGPIOState, PCAGPIOClass, PCA_I2C_GPIO) #define TYPE_PCA6416_GPIO "pca6416" #define TYPE_PCA9538_GPIO "pca9538" +#define TYPE_PCA9536_GPIO "pca9536" #endif diff --git a/tests/lcitool/libvirt-ci b/tests/lcitool/libvirt-ci index e3eb28cf2e..232f41f160 160000 --- a/tests/lcitool/libvirt-ci +++ b/tests/lcitool/libvirt-ci @@ -1 +1 @@ -Subproject commit e3eb28cf2e17fbcf7fe7e19505ee432b8ec5bbb5 +Subproject commit 232f41f160d4567b8c82dd52aa96c2bc3a5b75c1 From patchwork Mon Mar 20 21:54:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Titus Rwantare X-Patchwork-Id: 13181900 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) (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 56175C7619A for ; Mon, 20 Mar 2023 21:56:32 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1peNTb-0005Yc-GR; Mon, 20 Mar 2023 17:55:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <3U9YYZAYKCoo7w7865u22uzs.q204s08-rs9sz121u18.25u@flex--titusr.bounces.google.com>) id 1peNTa-0005X0-D5 for qemu-devel@nongnu.org; Mon, 20 Mar 2023 17:55:34 -0400 Received: from mail-ua1-x949.google.com ([2607:f8b0:4864:20::949]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <3U9YYZAYKCoo7w7865u22uzs.q204s08-rs9sz121u18.25u@flex--titusr.bounces.google.com>) id 1peNTY-0006ZM-GY for qemu-devel@nongnu.org; Mon, 20 Mar 2023 17:55:34 -0400 Received: by mail-ua1-x949.google.com with SMTP id a6-20020ab03c86000000b00761dc4d3e30so2900954uax.5 for ; Mon, 20 Mar 2023 14:55:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1679349331; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=i6nuB1IuoNGeIVShStw0JikBLyXc87vR696JX/dK70I=; b=mMSVP1Ak1+3zj62Sy548BqNIS0GveTVxemOCYzBE6HvVq7KyH6pObeeb2c5ZDMr3Ba PpaKvQytCE4aYfWSYT5SDgu5epDPr9aaQ9vjs4HcW+JZBW8YrWMhC/nHunRSguIdJ2z0 7bvdpSw6P92yQ16jEwm+aqE3KBWdoIUbiBVM6bmUYjTKbUscxw5slkk/y9klWZm4dja5 fpxgbbOPjl2bpe4xpWGxs5avcINlSLnsVdyVCo5YBt5LJOBiytmZfhCXTWoJFua7NoCA GswDw+E6CJAQU7sKCvrMCNrD/o5cnpPMVn2/K2la85l1xKoxofY6ddSPQ+HutlN/XkgO lPOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679349331; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=i6nuB1IuoNGeIVShStw0JikBLyXc87vR696JX/dK70I=; b=CdPzrD/f/K5Ja+L0TLFa+oXrJZn56wC6EKeopvREKplWc2+rIxvM+V4lT/5DQI5hjA 07S5I+J5g9yPq1I9q7nDbpnvrkJHLXqusmEO3m4bpRqxv69QN6zQsN9lx8VyTkCMojs2 0Zut1tVUnIhF4bN21loRrCYhu3TzGVMMI6TUDhX4o1P7SnZf1yM/Qh09TUj0QGtI0Txf NXBGaer/+GOEbA9DCLUb8I3vV1QJ1LzusNfp75vWpE9NNrVWaGtXgRndratPzw3nHIe7 DNY4ZcQk6t0MrXUWfAbDaGdDguram/FArlUTd9R9x18zFCeNl/IOn0NFxEgWt7u0V+A8 2uWg== X-Gm-Message-State: AO0yUKWw/BNlTuK0fm+tIZtqHWCOcx1AQgbrZZVcsod2RRvqfoWckhs2 KELOMQ4E5qypZZaMOiqA3R+OzLiLuzY= X-Google-Smtp-Source: AK7set+QO0BqXppY61J8ekXjcmdiY7Hy1shW6ztHg5i9Erm1TdixYHhHVFld2K5g/MeBAae1T5eWa3Q+jh0= X-Received: from titusr.c.googlers.com ([fda3:e722:ac3:cc00:14:4d90:c0a8:22b8]) (user=titusr job=sendgmr) by 2002:a67:e04a:0:b0:425:f836:59ba with SMTP id n10-20020a67e04a000000b00425f83659bamr332395vsl.7.1679349331280; Mon, 20 Mar 2023 14:55:31 -0700 (PDT) Date: Mon, 20 Mar 2023 21:54:58 +0000 In-Reply-To: <20230320215500.722960-1-titusr@google.com> Mime-Version: 1.0 References: <20230320215500.722960-1-titusr@google.com> X-Mailer: git-send-email 2.40.0.rc1.284.g88254d51c5-goog Message-ID: <20230320215500.722960-5-titusr@google.com> Subject: [PATCH v3 4/5] hw/i2c: add canonical path to i2c event traces From: Titus Rwantare To: philmd@linaro.org, minyard@acm.org Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org, peter.maydell@linaro.org, Titus Rwantare Received-SPF: pass client-ip=2607:f8b0:4864:20::949; envelope-from=3U9YYZAYKCoo7w7865u22uzs.q204s08-rs9sz121u18.25u@flex--titusr.bounces.google.com; helo=mail-ua1-x949.google.com X-Spam_score_int: -95 X-Spam_score: -9.6 X-Spam_bar: --------- X-Spam_report: (-9.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Titus Rwantare --- hw/i2c/core.c | 8 +++++--- hw/i2c/trace-events | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/i2c/core.c b/hw/i2c/core.c index bed594fe59..896da359f5 100644 --- a/hw/i2c/core.c +++ b/hw/i2c/core.c @@ -161,7 +161,8 @@ static int i2c_do_start_transfer(I2CBus *bus, uint8_t address, start condition. */ if (sc->event) { - trace_i2c_event(event == I2C_START_SEND ? "start" : "start_async", + trace_i2c_event(DEVICE(s)->canonical_path, + event == I2C_START_SEND ? "start" : "start_async", s->address); rv = sc->event(s, event); if (rv && !bus->broadcast) { @@ -244,7 +245,7 @@ void i2c_end_transfer(I2CBus *bus) I2CSlave *s = node->elt; sc = I2C_SLAVE_GET_CLASS(s); if (sc->event) { - trace_i2c_event("finish", s->address); + trace_i2c_event(DEVICE(s)->canonical_path, "finish", s->address); sc->event(s, I2C_FINISH); } QLIST_REMOVE(node, next); @@ -321,7 +322,8 @@ void i2c_nack(I2CBus *bus) QLIST_FOREACH(node, &bus->current_devs, next) { sc = I2C_SLAVE_GET_CLASS(node->elt); if (sc->event) { - trace_i2c_event("nack", node->elt->address); + trace_i2c_event(DEVICE(node->elt)->canonical_path, + "nack", node->elt->address); sc->event(node->elt, I2C_NACK); } } diff --git a/hw/i2c/trace-events b/hw/i2c/trace-events index 8e88aa24c1..f42a1ff539 100644 --- a/hw/i2c/trace-events +++ b/hw/i2c/trace-events @@ -9,7 +9,7 @@ bitbang_i2c_data(unsigned dat, unsigned clk, unsigned old_out, unsigned new_out) # core.c -i2c_event(const char *event, uint8_t address) "%s(addr:0x%02x)" +i2c_event(const char *id, const char *event, uint8_t address) "%s: %s(addr:0x%02x)" i2c_send(uint8_t address, uint8_t data) "send(addr:0x%02x) data:0x%02x" i2c_send_async(uint8_t address, uint8_t data) "send_async(addr:0x%02x) data:0x%02x" i2c_recv(uint8_t address, uint8_t data) "recv(addr:0x%02x) data:0x%02x" From patchwork Mon Mar 20 21:54:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Titus Rwantare X-Patchwork-Id: 13181901 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) (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 09D7AC6FD1D for ; Mon, 20 Mar 2023 21:56:56 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1peNTd-0005ag-3W; Mon, 20 Mar 2023 17:55:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <3U9YYZAYKCoo7w7865u22uzs.q204s08-rs9sz121u18.25u@flex--titusr.bounces.google.com>) id 1peNTb-0005Yi-Ng for qemu-devel@nongnu.org; Mon, 20 Mar 2023 17:55:35 -0400 Received: from mail-yb1-xb4a.google.com ([2607:f8b0:4864:20::b4a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <3U9YYZAYKCoo7w7865u22uzs.q204s08-rs9sz121u18.25u@flex--titusr.bounces.google.com>) id 1peNTY-0006Zk-Ss for qemu-devel@nongnu.org; Mon, 20 Mar 2023 17:55:35 -0400 Received: by mail-yb1-xb4a.google.com with SMTP id n203-20020a25dad4000000b0091231592671so14189932ybf.1 for ; Mon, 20 Mar 2023 14:55:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1679349332; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=xWDH8xZN+wbOnKloxA2ukLD5YDlW0BiAiiHOL9dZ6QI=; b=IsI+IWTHtG3KiKxROEb+V0Fi46zoOpg8bCq2CC0Pceg09BrjYOBfr+5X9u1bV8ndnn Ui8XjPPRkqkDJAGWivAtTxxY59MQJyMoBLmBd6D53zb5lR6Q4sZFJ/kS4A7V+Q4dMyNA ZCHUf2tlNv+Nqc24LqqLdLqXUbdoABupxfhuGCg+H6mB3ff3adLvlT65MRNpZ5Ese2lA 6iBw5JGIi594DdhzxGVjt2A7J/rIn66Mge5h+uvY2fbuEzeR/pZZrCdsOJAqVWr3tHoM G3Few66YDpIpol0vGpJTnKwJ6rFIt0c0BIxz8TovZWW0K+0f0Yjk0WnjRDYwLi5yc5VE c19w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679349332; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=xWDH8xZN+wbOnKloxA2ukLD5YDlW0BiAiiHOL9dZ6QI=; b=i5WHL5m/Zbc/RSG90WzhQlDI1vD3l6ZL9f+wEtlkbvneUfn7cGJyj565Km4bw0CYzo /WlHLpxWm8RREkI573vLn8hdbcg34juMEfVpOoeTrx5QSK9Y18ugH5ZnufoU4+wwmh8y HRcl7TLC2kepNN2S6K5e3qbMcI0+crfCVn5mFl60mHIpvUYrMdj3t7/dEBCvuGtIiqSV zYxteuKip9yKa7LFehTrqsIOvLJgv34I+id5demMHdsUXydpwwoe/ylBZwZhKAEKM2vW ycnuln32P1NHqA71iNIjq2lCjpyhq2z9GwrZgl8f+ORsooEyXfRBLwfBNpGuP+FVHnwX Jy2w== X-Gm-Message-State: AAQBX9eZ4oXVwAj8cmokluIXcO8GuVQ02VAa5pMgB/aRQufVFMqt52Tt CUY5GRLxg2035667Mu9tluljl0+gpVo= X-Google-Smtp-Source: AKy350ZPUvUnfhRtsD+30fiS3kMUjPmJb2QrciN5mScylz2Jp6uWPwQ7UndWlFVP+zuZiFz8OqLtilKSteM= X-Received: from titusr.c.googlers.com ([fda3:e722:ac3:cc00:14:4d90:c0a8:22b8]) (user=titusr job=sendgmr) by 2002:a05:6902:2c3:b0:ad2:3839:f49 with SMTP id w3-20020a05690202c300b00ad238390f49mr905342ybh.5.1679349331993; Mon, 20 Mar 2023 14:55:31 -0700 (PDT) Date: Mon, 20 Mar 2023 21:54:59 +0000 In-Reply-To: <20230320215500.722960-1-titusr@google.com> Mime-Version: 1.0 References: <20230320215500.722960-1-titusr@google.com> X-Mailer: git-send-email 2.40.0.rc1.284.g88254d51c5-goog Message-ID: <20230320215500.722960-6-titusr@google.com> Subject: [PATCH v3 5/5] hw/arm: imply I2C_DEVICES on NPCM7xx From: Titus Rwantare To: philmd@linaro.org, minyard@acm.org Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org, peter.maydell@linaro.org, Titus Rwantare Received-SPF: pass client-ip=2607:f8b0:4864:20::b4a; envelope-from=3U9YYZAYKCoo7w7865u22uzs.q204s08-rs9sz121u18.25u@flex--titusr.bounces.google.com; helo=mail-yb1-xb4a.google.com X-Spam_score_int: -95 X-Spam_score: -9.6 X-Spam_bar: --------- X-Spam_report: (-9.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Titus Rwantare --- hw/arm/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig index b5aed4aff5..548c10d7fc 100644 --- a/hw/arm/Kconfig +++ b/hw/arm/Kconfig @@ -406,6 +406,7 @@ config XLNX_VERSAL config NPCM7XX bool + imply I2C_DEVICES select A9MPCORE select ADM1272 select ARM_GIC