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: 10244773 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1C23A60208 for ; Tue, 27 Feb 2018 10:55:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 13282286E3 for ; Tue, 27 Feb 2018 10:55:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0771628753; Tue, 27 Feb 2018 10:55:00 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, 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 35759286E3 for ; Tue, 27 Feb 2018 10:54:59 +0000 (UTC) Received: from localhost ([::1]:36195 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eqcuQ-00026X-8A for patchwork-qemu-devel@patchwork.kernel.org; Tue, 27 Feb 2018 05:54:58 -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-Google-Smtp-Source: AG47ELsVWOSI+VS6dUC4dEiE1QVCe2mH8/wNqrC8g+JGCpJ1LKS/oFXJfTf0PdI9au6eORrOrhZUMA== 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=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Philippe Mathieu-Daudé --- 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(-) 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 */