From patchwork Tue Feb 27 10:49:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 129765 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp1247547lja; Tue, 27 Feb 2018 02:54:25 -0800 (PST) X-Google-Smtp-Source: AG47ELu6/ItWZ7DjoSMtzwdNy1S9imRubaocknEN+tD2RAfUctSnoyaHR5IuNaOmN1H/sBw8P8vf X-Received: by 2002:a25:aaea:: with SMTP id t97-v6mr9099330ybi.328.1519728865722; Tue, 27 Feb 2018 02:54:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519728865; cv=none; d=google.com; s=arc-20160816; b=Iz32tbEMEQnJ+VX7wAdec6Ux1v5gK3PrEgq4QNmqzU19TaubuL4NggYRYf+3Q2lzrR LBQh4JK2BOi6blaa/KxmkDxwRnu8el4wr91y7H50UkLWjTEPnE6QcuIacn0rT+M46s0l EnaRNzjIcwJVcc4exwXim2j0vOslie2k6njd2Y/uqqgZ0/34u+JXfe1pGafIUL86KdQ8 Nh7dyd1mASn2vg0227byQrRQdQtY2GR0NArExiob/QF1j8yCPrkSpFOWV7nl+vOCDr+Z LcgriNYHkru3hnOo0fHgpcQ0uMkZzXHew5THMfoZhDggd5ja7tcDec0CdZnWpkI7VFux aIZQ== 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=B3h3ngm0OffOmfESZWBoAmx9C3pRmKhosswAThUpbIU=; b=EU/y4WvBkMMmOCQhH1IOljFtg+0BEkyW10z9OOQ1w/C+ZD4QP1L2yWrNhnh7qOS7BD y1p/VFnT7W+d8Ig2kZvHrYfmaqnc9IDJ8wiAP3WEYhaFRNDHI02LOs83q0XkHd5h4XMk +Y/TwYcRezndLi+EMJQ1GgP1dUiGca7JD6G1rWlGl65L41aTWWbillHLzagysrKOwyJH YgBc7I+8ZY5ZAuUN0nsbxoUQR4cElRaGpc2UUQMGniU/SAZClg1pX+GxPjNtrQGKrMUN iR2gvXsYSooThOX1KygaIsyA/CCNlySz+4NwKOQO6GtEagmRNtdjcc1V4rrSaGbcbb4p tC3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=jzIh9rUc; 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 q62si1862743ywc.232.2018.02.27.02.54.25 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 27 Feb 2018 02:54:25 -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=jzIh9rUc; 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]:36193 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eqctt-0001Z8-6x for patch@linaro.org; Tue, 27 Feb 2018 05:54:25 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54804) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eqcoz-0006Q5-Qk for qemu-devel@nongnu.org; Tue, 27 Feb 2018 05:49:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eqcox-0004El-1Q for qemu-devel@nongnu.org; Tue, 27 Feb 2018 05:49:21 -0500 Received: from mail-lf0-x243.google.com ([2a00:1450:4010:c07::243]:39074) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eqcow-0004Do-QZ for qemu-devel@nongnu.org; Tue, 27 Feb 2018 05:49:18 -0500 Received: by mail-lf0-x243.google.com with SMTP id f75so21788873lfg.6 for ; Tue, 27 Feb 2018 02:49:18 -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=B3h3ngm0OffOmfESZWBoAmx9C3pRmKhosswAThUpbIU=; b=jzIh9rUcL3FhJchz31Dvo+GGKt9uVzm1K0LoeoDuq1KtiAAHvn6ypRaWeubj96cP5n LJspgHzdxRviIbBEMpzj1vzZKIJCY8W/9tJy8PPFAlHj5pqToK8u3oZii6M98mxCkAC2 BCaruBWdnqUz9/W2sJy7NtQ2Qf1unMYl2136Y= 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=B3h3ngm0OffOmfESZWBoAmx9C3pRmKhosswAThUpbIU=; b=i9JHP3rsvWGMuo7We3UKfVkam4wkOokeoWBcJfe3grjvEiFMjWrrg7GWdXw4gd6uF+ wAvYlHAXQc9sgflfVYip6uYvbkHfXlWRT+p4J8kcqdJbD8lQIiZJ+3NmtRbXM6huT6k5 sUKzjkYGvfHg9fkZiWg5QCXRCfZgz5Uwyj3GclORjArpdx1aV5pB9WeLhfRAjtHy9AI8 stkbzZbLHUe7KX9bCUaz0cmefirl+T0lgOmCZkPluZqxAtoEsDradPltnDDHX6TZ/G0i +yhfUWaZqNLkOeYsZxnzY0fNRlBZsgY0tj5Pm5tAKhS606bHMOK3KvmqMgekPKzlhzCL DiJA== X-Gm-Message-State: APf1xPAKwsSH7oDKGvciok+ESz7ZZO1acK0MKz/26AF7d+pQuDQJs4wq d/98MERpRogIBiWgtBkKBuoG+9SSlYc= X-Received: by 10.46.23.68 with SMTP id l65mr9791189lje.56.1519728557120; Tue, 27 Feb 2018 02:49:17 -0800 (PST) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id 74sm2484148ljq.32.2018.02.27.02.49.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Feb 2018 02:49:16 -0800 (PST) From: Linus Walleij To: qemu-devel@nongnu.org, Peter Maydell Date: Tue, 27 Feb 2018 11:49:03 +0100 Message-Id: <20180227104903.21353-6-linus.walleij@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180227104903.21353-1-linus.walleij@linaro.org> References: <20180227104903.21353-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 5/5] 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: Corey Minyard , Linus Walleij , qemu-arm@nongnu.org, =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= 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. Cc: Peter Maydell Signed-off-by: Linus Walleij --- ChangeLog v1->v2: - Only add the SII9022 now that it will by itself realize the DDCI2C as part of the bridge. --- default-configs/arm-softmmu.mak | 2 ++ hw/arm/vexpress.c | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) -- 2.14.3 Reviewed-by: Philippe Mathieu-Daudé 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..9fad79177a19 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,9 @@ 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); sysbus_create_simple("pl031", map[VE_RTC], pic[4]); /* RTC */