From patchwork Sat Feb 17 14:00:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 128667 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp1621184ljc; Sat, 17 Feb 2018 06:06:08 -0800 (PST) X-Google-Smtp-Source: AH8x224UO6N08HevBciRLtUzUIUEc979ivVZaHskBeHuCcx1ytOctEvZkl4kklipXNDlJNZGowg+ X-Received: by 10.37.172.200 with SMTP id x8mr7037372ybd.442.1518876368513; Sat, 17 Feb 2018 06:06:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518876368; cv=none; d=google.com; s=arc-20160816; b=K8aCTu+QQswb9xc6NxRGMpRSkxGUHf8yiUKqdoAFNfdnxhJnYhXqXHyBgxImlykWGj rZ1m4u48WQ6deQ5HoikKok8eRarvZ7rvshOp3p6vFIOXoJESRDhb6JOnBqodXFaWkLQ1 nX8k+jp3h82sCzDy0i0x8MPzWdqAXo2UA3Xl2S+fDyioHv4kfMkYdN/BDxF3AzPsbCD2 P63lCu2EW4Wd5ftXZ2RhSKm/njkLCgseeEm+sDsOMKF6WE4naI8lf6cZ8PRQ1byRErea ztedRmV0pDpjNoPYg0NDNrMHQ1UZuSOCVVkE+OjeEZvpAz16f+qbqW+JeY4FDpbuoDn8 9TAQ== 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=ZbjmdgIp5MAF0MP+wTHNPXFmSV6vmH4D940DliqjBxc=; b=iiMVKKkf4n6idPwsTmhFcAS9MZ3WaWXuwOnRtXb/sQELkTLpFb7jg5LFtiLBINPLgv ytJbjTiTBRwVwR9yzNpKME/nsM3LLwfqglrSGJXb6b6LTTWsFR+VqWdNhR46PAbPOXlb ol+j6sNg5uLf0LAyExYDwLj3ub3OJgkcs0Uw/6KPcwZd237exdjSRGbe57eddlyvoqc2 czsNIHAB94YOECdy4rBVLFUzVDzRrUZ/ULZ+E/cgH64bctx7Hiil2i3evOyZK73w9oMT wcO8v4PSvTVIsCAAhaP7E8gePxPR5Raj1PBlpuGIvrn55kAos8HbY6kThF5tXOhQXRhJ ebAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=dL/OsS2q; 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=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 189si725494ybr.433.2018.02.17.06.06.08 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 17 Feb 2018 06:06:08 -0800 (PST) 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=@linaro.org header.s=google header.b=dL/OsS2q; 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=linaro.org Received: from localhost ([::1]:53288 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1en37v-0007r6-UB for patch@linaro.org; Sat, 17 Feb 2018 09:06:07 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46393) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1en362-0006bU-81 for qemu-devel@nongnu.org; Sat, 17 Feb 2018 09:04:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1en35x-00049R-V8 for qemu-devel@nongnu.org; Sat, 17 Feb 2018 09:04:10 -0500 Received: from mail-lf0-x243.google.com ([2a00:1450:4010:c07::243]:43542) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1en35x-00048k-OJ for qemu-devel@nongnu.org; Sat, 17 Feb 2018 09:04:05 -0500 Received: by mail-lf0-x243.google.com with SMTP id q69so7577081lfi.10 for ; Sat, 17 Feb 2018 06:04:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ZbjmdgIp5MAF0MP+wTHNPXFmSV6vmH4D940DliqjBxc=; b=dL/OsS2qX422zBwmlNmMCaeYzXo2GW+FPqKyzq6YlVICO/nR9gW/jQn/dfF8wmlBtM AUNVAVFmtr4Ax7I3/GKouaqiBROYN5Q4dNNmohNtYcrQ9LJhy2N2qKaDr9dK/SbYJoMV m/GNB2TLImFF6mSdn0JD9B4oIvvjQ5sFi5w+Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ZbjmdgIp5MAF0MP+wTHNPXFmSV6vmH4D940DliqjBxc=; b=Xs4OnZvJSPeOEczl8L/eAaBSyuMSGCH+rq2XF8uv71z26FBmholmmNOeOCgNFKN8xy iW8VSqDXLY48COPWRNYhO81CSceVKy1wFvzKRRwNXE2R6+PHEZTRWm1yF3KUME67+Q8D 81/Wzby0Pgk9DhFtnu4M+veJzklg/tJHFatFvLu7LsosLlEbO7WqQ95Ug2cadHSXNLkC GXBJxecpMgQudlqh5Ll15HZzy6xgLfVoWS4yv/79wS/mEz82O7mZwR3MMbTZgZ3W4qUN Ned5U6m9q7jG2e3HvlbRMwuV0Df2t+7lZ6wjPU2LVVEghDAZhbm9hpvAvywmli4/vmRm jEIg== X-Gm-Message-State: APf1xPAezjYzBURvTMVCdchqfQ67X1qjQ8EtliTrXL6EwZGWS29xicoN yhUip9FXTOu+iPirAGxKiMbckBjxf+s= X-Received: by 10.25.210.11 with SMTP id j11mr6590274lfg.42.1518876244181; Sat, 17 Feb 2018 06:04:04 -0800 (PST) Received: from localhost.localdomain (c-cb7471d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.116.203]) by smtp.gmail.com with ESMTPSA id w204sm122054lff.29.2018.02.17.06.04.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 17 Feb 2018 06:04:03 -0800 (PST) From: Linus Walleij To: qemu-devel@nongnu.org Date: Sat, 17 Feb 2018 15:00:51 +0100 Message-Id: <20180217140051.22731-3-linus.walleij@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180217140051.22731-1-linus.walleij@linaro.org> References: <20180217140051.22731-1-linus.walleij@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::243 Subject: [Qemu-devel] [PATCH 3/3] arm/vexpress: Add proper display connector emulation 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: Linus Walleij , qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This adds the SiI9022 and EDID I2C devices to the ARM Versatile Express machine, and selects the two I2C devices necessary in the arm-softmmy.mak configuration so everything will build smoothly. I am implementing proper handling of the graphics in the Linux kernel and adding proper emulation of SiI9022 and EDID makes the driver probe as nicely as before, retrieveing the resolutions supported by the "QEMU monitor" and overall just working nice. The assignment of the SiI9022 at address 0x39 and the EDID DDC I2C at address 0x50 is not strictly correct: the DDC I2C is there all the time but in the actual component it only appears once activated inside the SiI9022, so ideally it should be added and removed to the bus by the SiI9022. However for this purpose it works fine to just have it around. Signed-off-by: Linus Walleij --- default-configs/arm-softmmu.mak | 2 ++ hw/arm/vexpress.c | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) -- 2.14.3 diff --git a/default-configs/arm-softmmu.mak b/default-configs/arm-softmmu.mak index ca34cf446242..54f855d07206 100644 --- a/default-configs/arm-softmmu.mak +++ b/default-configs/arm-softmmu.mak @@ -21,6 +21,8 @@ CONFIG_STELLARIS_INPUT=y CONFIG_STELLARIS_ENET=y CONFIG_SSD0303=y CONFIG_SSD0323=y +CONFIG_DDC=y +CONFIG_SII9022=y CONFIG_ADS7846=y CONFIG_MAX111X=y CONFIG_SSI=y diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index dc5928ae1ab5..d6c912c97684 100644 --- a/hw/arm/vexpress.c +++ b/hw/arm/vexpress.c @@ -29,6 +29,7 @@ #include "hw/arm/arm.h" #include "hw/arm/primecell.h" #include "hw/devices.h" +#include "hw/i2c/i2c.h" #include "net/net.h" #include "sysemu/sysemu.h" #include "hw/boards.h" @@ -537,6 +538,7 @@ static void vexpress_common_init(MachineState *machine) uint32_t sys_id; DriveInfo *dinfo; pflash_t *pflash0; + I2CBus *i2c; ram_addr_t vram_size, sram_size; MemoryRegion *sysmem = get_system_memory(); MemoryRegion *vram = g_new(MemoryRegion, 1); @@ -628,7 +630,10 @@ static void vexpress_common_init(MachineState *machine) sysbus_create_simple("sp804", map[VE_TIMER01], pic[2]); sysbus_create_simple("sp804", map[VE_TIMER23], pic[3]); - /* VE_SERIALDVI: not modelled */ + dev = sysbus_create_simple("versatile_i2c", map[VE_SERIALDVI], NULL); + i2c = (I2CBus *)qdev_get_child_bus(dev, "i2c"); + i2c_create_slave(i2c, "sii9022", 0x39); + i2c_create_slave(i2c, "i2c-ddc", 0x50); sysbus_create_simple("pl031", map[VE_RTC], pic[4]); /* RTC */