From patchwork Tue Aug 21 17:02:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 144776 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp5578518ljj; Tue, 21 Aug 2018 11:03:03 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzH7PxXh7Ojno5waMZJ91J2rtkONBGHV0PFKpnxYIv6iHyztasJMpCawp0Dl/fcYh872SjP X-Received: by 2002:ac8:3492:: with SMTP id w18-v6mr20026088qtb.239.1534874583424; Tue, 21 Aug 2018 11:03:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534874583; cv=none; d=google.com; s=arc-20160816; b=Tm3a+GGeCnEcPgDXUw8SOud2gnh/7X3ANAYH/ZXW2HQ6swyw6Wj9aRGp00ASTb5abI /bboCdMiYRAIuFfM+0eSxN/uHMQWRbuMfRPyx24nCA8Y3OzuwOAh7X4DodoGhKvspmz5 pD17i/KV5Agc8wJ2n4u7kR/PsrTnX1K5G9XSKwVfxfPfGmRFCn0A727mADjrkYPImekz k/fTqDcW5+r513UMRs0d1rmmouq6Eh1ydLaEzMex/Gfdv02lImAZkxODRv+sGyWDG21B q3apuyb3RTy9zmJgj65Qt/LBawnQY57BxXE+92biXuxV6Urny64VD7stJddgkP3zynmT xLgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=z8jk9MS8UwK1p+60JIxWOmieKXqcCKUHVXdjtGI1AVA=; b=Jg7yY7/F3kWMEdQeXQMME8MTQZqZlZiXx87mA60SuGcUrKeiqPVk3ElMgDvZOFxlxS kMEuhxiLFgrOY5pIihq+mrOLDjwasaGyZivq9W5ak2OXCDk+49+U8J95yAyx2DSvu9EZ l6PWmgOKYUXCF3Q4bGP2vX5NUMAvG52owqUXG1btF8OQKkiH+A4SPxJZ3eXO1gJgqG87 qCACziKr2h0cJI2bMRRCx1jkv/g/z4pufzHVPkq8wvc6NVj18MbfEdK1z/Fm9hatPNFE SXcX53RptUbIgGg3hAJOrp97qu8WT88o7LYAWdkmDsQxdOJzf5W7oq/Py7ScZppITnF2 rc5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=YSCWwKq+; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 12-v6si6865945qtx.7.2018.08.21.11.03.03 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 21 Aug 2018 11:03:03 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=YSCWwKq+; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1]:55265 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fsAze-0004MN-SS for patch@linaro.org; Tue, 21 Aug 2018 14:03:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34067) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fsA56-0002a6-Vh for qemu-devel@nongnu.org; Tue, 21 Aug 2018 13:04:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fsA4o-0007Cn-D6 for qemu-devel@nongnu.org; Tue, 21 Aug 2018 13:04:31 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:38828) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fsA4n-00078P-Jl for qemu-devel@nongnu.org; Tue, 21 Aug 2018 13:04:18 -0400 Received: by mail-wm0-x243.google.com with SMTP id t25-v6so3485128wmi.3 for ; Tue, 21 Aug 2018 10:04:16 -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=z8jk9MS8UwK1p+60JIxWOmieKXqcCKUHVXdjtGI1AVA=; b=YSCWwKq+fUP9MlvJB9jk2iiOl+neXld8lFJb4MZ+skQSpA7ecciCqwPC/9uki+NKNn tDRWB6Wn9ER4zECUQhXeyntUp8Cr3RSQQbryzNuF0f1jufbfUB/8CsH06cbB1Ud7GAlM N2JETgHjze6W3AidAAOK3J9YXPXjLgmINLyPDxrsi/b6DeFnOdzjZGM5D6W/EwOsJPTc v9TBFtl+Ospmdb8IbofyquanZQRRqEl1AxOuTvkpPwz/xBeHZwLkR2A6P+9GKCPj6EKx 9Y2kxh4fXldzrnrN04g4GYuh6u9tCBUa95ak3wXDsLqr6gKymBeMHR3nTWbSMT7zO07R /X6Q== 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=z8jk9MS8UwK1p+60JIxWOmieKXqcCKUHVXdjtGI1AVA=; b=pXONFstYlqGyExnJ0q9dqBEShaM+pWV6Gd8f+x0Ge29jPYXx1Q1b56jjygVZ6327MV 20qHRHSb9aK++JBCs0O/+ruirEPeCgadBnDA4N4ZTCyOE12aZTZ+eqI9PHkY8uHoRDv1 NbreKFJvl2VCrfjveGZWX09GLMECtO6Fr8E1AmdxOvbdYly2HWkV/n0WydioxQTmIiuT q9EV0UbNPzbRfr6gigeQ5kA2wM0VC5rkznXKzSNPqvFkbUa/RlvAxgVdMw+oaUbHs5HA tg1C5OAaz8GFt7REQ3h2o2d2o+S86t80+0do/w6bdn58YJobQ5ZsIQb7vuHW93mddtuf N5CQ== X-Gm-Message-State: APzg51A6zrzFUvhDPY7flA9S8CRw3fE9AjqvTDoHk0iN0vD/z9w3wMnD TZTNFqSnXbFBKA4kiVi2upEeSaDp X-Received: by 2002:a1c:cc1a:: with SMTP id h26-v6mr159637wmb.112.1534871055235; Tue, 21 Aug 2018 10:04:15 -0700 (PDT) Received: from 640k.lan (dynamic-adsl-78-12-184-244.clienti.tiscali.it. [78.12.184.244]) by smtp.gmail.com with ESMTPSA id v6-v6sm2608955wmc.43.2018.08.21.10.04.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Aug 2018 10:04:14 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 21 Aug 2018 19:02:40 +0200 Message-Id: <1534870966-9287-69-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1534870966-9287-1-git-send-email-pbonzini@redhat.com> References: <1534870966-9287-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::243 Subject: [Qemu-devel] [PULL 68/74] 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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 Message-Id: <1534796770-10295-9-git-send-email-minyard@acm.org> Signed-off-by: Paolo Bonzini --- 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(-) -- 1.8.3.1 diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index 6404af5..e330f24 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -512,7 +512,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 91ee444..685a237 100644 --- a/hw/i2c/pm_smbus.c +++ b/hw/i2c/pm_smbus.c @@ -402,11 +402,14 @@ static const MemoryRegionOps pm_smbus_ops = { .endianness = DEVICE_LITTLE_ENDIAN, }; -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 522a703..2a8b49e 100644 --- a/hw/i2c/smbus_ich9.c +++ b/hw/i2c/smbus_ich9.c @@ -86,7 +86,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 1afa3cf..060d3c6 100644 --- a/include/hw/i2c/pm_smbus.h +++ b/include/hw/i2c/pm_smbus.h @@ -33,6 +33,6 @@ 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); #endif /* PM_SMBUS_H */