From patchwork Mon Aug 20 20:26:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Corey Minyard X-Patchwork-Id: 10570767 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5415F920 for ; Mon, 20 Aug 2018 20:34:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4285D28E23 for ; Mon, 20 Aug 2018 20:34:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 34D0E28E7A; Mon, 20 Aug 2018 20:34:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B474028E23 for ; Mon, 20 Aug 2018 20:34:38 +0000 (UTC) Received: from localhost ([::1]:49174 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1frqso-0000OV-1d for patchwork-qemu-devel@patchwork.kernel.org; Mon, 20 Aug 2018 16:34:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51614) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1frqlF-0002rI-0e for qemu-devel@nongnu.org; Mon, 20 Aug 2018 16:26:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1frql2-0002Wf-CJ for qemu-devel@nongnu.org; Mon, 20 Aug 2018 16:26:46 -0400 Received: from mail-oi0-x242.google.com ([2607:f8b0:4003:c06::242]:42156) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1frqky-0002M7-CS for qemu-devel@nongnu.org; Mon, 20 Aug 2018 16:26:34 -0400 Received: by mail-oi0-x242.google.com with SMTP id b16-v6so28173923oic.9 for ; Mon, 20 Aug 2018 13:26:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=ZsmQ2hvBLFdp+KRGnG27sGz3M2zpxvU0ctrBLKjEYS4=; b=TerUvU6XfVlVtj5j7uadn0qzOTQJ2mmjuQttzfel7Nifk0C117Ey7mEgc5r9csfWiN aoP+IDk+CWGD1aSVeXV9Y9LzR+KGZTcqT31oAwKKUQzLmY9BN5lORrpzxN7XJjCqkQsG NombJ7Wh89IO0eUJsZeYrw9fWcd5ZIYaBIWzhraNN53rFMKlsLC2CB2qxjxUfTaNpWiZ h1qVFNgy5eMHyFKzOqQRtGrUWoNC3UVWLJ5xdm07ARmitAUwjtuer5OVFnSg5FtgNj74 fmAvlh1iC+1ef/aM2MVybP+bPCncTlM/MmgH3IlBlLXD2luf5RkCGZe01V+kAJ+oMYcN I08w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=ZsmQ2hvBLFdp+KRGnG27sGz3M2zpxvU0ctrBLKjEYS4=; b=hF0yXx2itWI6n83CbVKopLTD0f7xca4jn0O/vj1KfkZl8IN6krBL88Bal5XentCRRJ ilxDrBTkBJ4erGknIMjg8S2auHHXpC+noEhBYY52tOOzj+hYkKr+SjbPoduZRpW4cw3v 2GV3/Gwm4x0KYBP6MYPrI8eW3+ObX3GRSo8IuhCFdjwr/vNy2ZxUizd3+3HJ9XQBK+FH 9yQbcAIyCxKtf4wmy6OLTIsDRaQE8J8hmaqQj7c7YUo3fvf/x4VnX9cuBAkujGc/KF9N NDRFzQRhCyWMMTY+JydI/vcXCIzU1i+G7pDr/aofwSfsH5grq5Qq4GTuf8UXdn8G6lSn ADNg== X-Gm-Message-State: AOUpUlH/YvS+XL59NbsDjk1tMdaOHsAJ4cyARkF1kxFnUoOoNs6+++7C CCUtq5gRpLBNb5FXNiOaAIRx0E8= X-Google-Smtp-Source: AA+uWPxst8Q63sJ+Da8FcpycZpstFn9pz6mgoTcM4VekfcIjFXsY+lCxCwazJlHfLVnM5w5tpYvvHw== X-Received: by 2002:aca:5754:: with SMTP id l81-v6mr16853421oib.100.1534796790548; Mon, 20 Aug 2018 13:26:30 -0700 (PDT) Received: from serve.minyard.net ([47.184.170.128]) by smtp.gmail.com with ESMTPSA id i132-v6sm9420368oif.20.2018.08.20.13.26.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Aug 2018 13:26:28 -0700 (PDT) Received: from t430.minyard.net (t430m.minyard.net [192.168.27.3]) by serve.minyard.net (Postfix) with ESMTPA id C236D13F5; Mon, 20 Aug 2018 15:26:24 -0500 (CDT) Received: by t430.minyard.net (Postfix, from userid 1000) id D0FA130010B; Mon, 20 Aug 2018 15:26:21 -0500 (CDT) From: minyard@acm.org To: Paolo Bonzini , qemu-devel@nongnu.org Date: Mon, 20 Aug 2018 15:26:08 -0500 Message-Id: <1534796770-10295-9-git-send-email-minyard@acm.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1534796770-10295-1-git-send-email-minyard@acm.org> References: <1534796770-10295-1-git-send-email-minyard@acm.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c06::242 Subject: [Qemu-devel] [PATCH v2 08/10] i2c:pm_smbus: Add the ability to force block transfer enable X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Corey Minyard , "Michael S . Tsirkin" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Corey Minyard The PIIX4 hardware has block transfer buffer always enabled in the hardware, but the i801 does not. Add a parameter to pm_smbus_init to force on the block transfer so the PIIX4 handler can enable this by default, as it was disabled by default before. Signed-off-by: Corey Minyard Cc: Michael S. Tsirkin Cc: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daudé --- hw/acpi/piix4.c | 2 +- hw/i2c/pm_smbus.c | 5 ++++- hw/i2c/smbus_ich9.c | 2 +- hw/isa/vt82c686.c | 2 +- include/hw/i2c/pm_smbus.h | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index f8d8d2e..313305f 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -513,7 +513,7 @@ static void piix4_pm_realize(PCIDevice *dev, Error **errp) pci_conf[0x90] = s->smb_io_base | 1; pci_conf[0x91] = s->smb_io_base >> 8; pci_conf[0xd2] = 0x09; - pm_smbus_init(DEVICE(dev), &s->smb); + pm_smbus_init(DEVICE(dev), &s->smb, true); memory_region_set_enabled(&s->smb.io, pci_conf[0xd2] & 1); memory_region_add_subregion(pci_address_space_io(dev), s->smb_io_base, &s->smb.io); diff --git a/hw/i2c/pm_smbus.c b/hw/i2c/pm_smbus.c index 10ba208..4d021bb 100644 --- a/hw/i2c/pm_smbus.c +++ b/hw/i2c/pm_smbus.c @@ -422,11 +422,14 @@ const VMStateDescription pmsmb_vmstate = { } }; -void pm_smbus_init(DeviceState *parent, PMSMBus *smb) +void pm_smbus_init(DeviceState *parent, PMSMBus *smb, bool force_aux_blk) { smb->op_done = true; smb->reset = pm_smbus_reset; smb->smbus = i2c_init_bus(parent, "i2c"); + if (force_aux_blk) { + smb->smb_auxctl |= AUX_BLK; + } memory_region_init_io(&smb->io, OBJECT(parent), &pm_smbus_ops, smb, "pm-smbus", 64); } diff --git a/hw/i2c/smbus_ich9.c b/hw/i2c/smbus_ich9.c index 316c2a4..5860fc9 100644 --- a/hw/i2c/smbus_ich9.c +++ b/hw/i2c/smbus_ich9.c @@ -88,7 +88,7 @@ static void ich9_smbus_realize(PCIDevice *d, Error **errp) pci_set_byte(d->config + ICH9_SMB_HOSTC, 0); /* TODO bar0, bar1: 64bit BAR support*/ - pm_smbus_init(&d->qdev, &s->smb); + pm_smbus_init(&d->qdev, &s->smb, false); pci_register_bar(d, ICH9_SMB_SMB_BASE_BAR, PCI_BASE_ADDRESS_SPACE_IO, &s->smb.io); } diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c index cff1946..7302f6d 100644 --- a/hw/isa/vt82c686.c +++ b/hw/isa/vt82c686.c @@ -370,7 +370,7 @@ static void vt82c686b_pm_realize(PCIDevice *dev, Error **errp) pci_conf[0x90] = s->smb_io_base | 1; pci_conf[0x91] = s->smb_io_base >> 8; pci_conf[0xd2] = 0x90; - pm_smbus_init(&s->dev.qdev, &s->smb); + pm_smbus_init(&s->dev.qdev, &s->smb, false); memory_region_add_subregion(get_system_io(), s->smb_io_base, &s->smb.io); apm_init(dev, &s->apm, NULL, s); diff --git a/include/hw/i2c/pm_smbus.h b/include/hw/i2c/pm_smbus.h index cfe596f..471345e 100644 --- a/include/hw/i2c/pm_smbus.h +++ b/include/hw/i2c/pm_smbus.h @@ -33,7 +33,7 @@ typedef struct PMSMBus { bool op_done; } PMSMBus; -void pm_smbus_init(DeviceState *parent, PMSMBus *smb); +void pm_smbus_init(DeviceState *parent, PMSMBus *smb, bool force_aux_blk); extern const VMStateDescription pmsmb_vmstate;