From patchwork Wed Feb 15 11:26:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 653697 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp280934wrr; Wed, 15 Feb 2023 03:29:17 -0800 (PST) X-Google-Smtp-Source: AK7set+bWXLzP17nfROFppB3n0bnOq/1ZdQLf+bCnQ1rIWr9RNvPdV6znRwhvmSB7MUZKpcZRc/h X-Received: by 2002:a05:6214:da2:b0:56e:9f19:71f9 with SMTP id h2-20020a0562140da200b0056e9f1971f9mr6032718qvh.17.1676460556913; Wed, 15 Feb 2023 03:29:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676460556; cv=none; d=google.com; s=arc-20160816; b=MiKJGWjd9JP2e70VDLNuwF0RZxE48IuXqdqU6L5Pw4A4AbgHLSVH+bhlVVz35QHUVq qxKfBatTG44t86pHMfiwqqDshLkU6ttRWXHPIKMBNPy9CC9Vs62yrDoF4neDnWYKx7mZ JmwjPX9B6rTjJRbxnd9Q0EHz9psBfR3NybjT0hmVimw++SyPEZOnuCLvPJEOPw8tcimq EVlAxeXGdIOHrZ+soazN+qNhkK0XcvB43SLePiiHqTwVuIMODAqRQ8vF8R9heM2hnzm8 f0sVbcJdMTbe+LjOzxdQV3XMsIIwXm2XH2T3vYOND3isuafzTPRoN42d5JiGjvJSyUyL 2JMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=pcrpa0k2mjPFukLVl7InavLwINVAMgzkQbQIjjMzSco=; b=qPqICbMA3w+gc1Zt8BzPmrQCfKtBB1eq95wnxrwXIBc0F3toJ96M1xe8WY5VQucVNB 8x3GgBcuq2h4CLEFdTJm+251PDkTDPj6zwvD5aI7vZkV6mjeBakVq3Lq4RyydwtRrRpk Ede3D45GG8w6oQlS06wBnOv538zms7YCLxElGYkvFwPY5YZLsdTIjppfXB8aCbIybP/2 1Pb7C7iE/1dG8x5fIpG9QU2Se9wRCmBJ6lktAlygE9g9r1E1H8izOSabKtYqX36dKWde Vz6/MGvqOywib2E9qBGhileVIJUD0APNG4V3hc4eoVF7VRt1+1iT1L5LuohwPIrNBW3H R2pQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kkYM04We; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id q10-20020a37f70a000000b00716641078e4si13224999qkj.508.2023.02.15.03.29.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Feb 2023 03:29:16 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kkYM04We; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSFwj-0008Lv-SA; Wed, 15 Feb 2023 06:27:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSFwi-0008Jh-43 for qemu-devel@nongnu.org; Wed, 15 Feb 2023 06:27:32 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pSFwg-0003SW-Fk for qemu-devel@nongnu.org; Wed, 15 Feb 2023 06:27:31 -0500 Received: by mail-wr1-x42d.google.com with SMTP id m14so18767070wrg.13 for ; Wed, 15 Feb 2023 03:27:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pcrpa0k2mjPFukLVl7InavLwINVAMgzkQbQIjjMzSco=; b=kkYM04WefneLGecV8N0yC6T/4+FE+sx95nO+tVIfg5M3mv9i/uhehUV2aNPHWC7utr /uxkkuPORN2LClCbG19ADd/nSH4mGeTpPLG0p2eUQB3oG0WYYAYyHN+HfZ+KavUEzlyL aOypXRWPMA+8EPmGOa13ag8MHPEmq2hRwFNKgq1PZVeWCEfGzFgClK6U0cXSyD/wdYTJ kBjT+Rgaqajy4Fu6tN7U7ddA9ot6npnDEqI7zbBxZjV/A54vDE0h31//EEuPfx0owj8O O0+O4B7S4mg6TnK6s2Bc6udsEoDc440HIpSyrKsZPm/kftmAFYrTQ+K32TiiC8BwkE5b Pddg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pcrpa0k2mjPFukLVl7InavLwINVAMgzkQbQIjjMzSco=; b=fYfqqypyucBknoQ3wIBhy6wNURdo/QznzJDt+vLhHldp3Ahkjn/L7IHrKT9cxrBOJP m88G9qhdVLZXaPRvuTFtM4OpvA7BioRnFeZRHA7Am6e1Qto6ArMQ7ih2l4MAW0HfhhzH GHalW/TjLjQ51i2u0WJNY5XwHXc0VETrKBQHQlU5nT0MrgZbE3T2m1bYEEGv6vSWGsoQ L716/yuQJRNVMwxHbm9Eykq7hAFg4uayvQp+4wQZti2HIweraVI/Oxy8dT7HInDIWK+i 8d3J/sX/dNI7NuxZdh0Miax1DQfAcswcOyQ2Ry38ZLG9nfqFFNJHMSSCFYpTLwnmxVpW L82g== X-Gm-Message-State: AO0yUKVf8daZuabwHLIiJjrftZYcczJqd2KJJ59OaWDc8QCQTJ7SnZOH BX8lC13DUzI10sovj0lK5EjRNtGqutw84XF2 X-Received: by 2002:adf:fec1:0:b0:2c5:6336:4bad with SMTP id q1-20020adffec1000000b002c563364badmr1214200wrs.15.1676460448740; Wed, 15 Feb 2023 03:27:28 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id y16-20020adff6d0000000b002c55521903bsm8458306wrp.51.2023.02.15.03.27.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Feb 2023 03:27:28 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Eduardo Habkost , John Snow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Yoshinori Sato , Magnus Damm Subject: [PATCH 03/20] hw/ide/mmio: Extract TYPE_MMIO_IDE declarations to 'hw/ide/mmio.h' Date: Wed, 15 Feb 2023 12:26:55 +0100 Message-Id: <20230215112712.23110-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230215112712.23110-1-philmd@linaro.org> References: <20230215112712.23110-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org "hw/ide.h" is a mixed bag of lost IDE declarations. Extract mmio_ide_init_drives() and the TYPE_MMIO_IDE QOM declarations to a new "hw/ide/mmio.h" header. Document the SysBus interface. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson --- hw/ide/mmio.c | 5 +---- hw/sh4/r2d.c | 2 +- include/hw/ide.h | 3 --- include/hw/ide/mmio.h | 26 ++++++++++++++++++++++++++ 4 files changed, 28 insertions(+), 8 deletions(-) create mode 100644 include/hw/ide/mmio.h diff --git a/hw/ide/mmio.c b/hw/ide/mmio.c index f1c6e1479b..5153d19ac6 100644 --- a/hw/ide/mmio.c +++ b/hw/ide/mmio.c @@ -29,9 +29,9 @@ #include "qemu/module.h" #include "sysemu/dma.h" +#include "hw/ide/mmio.h" #include "hw/ide/internal.h" #include "hw/qdev-properties.h" -#include "qom/object.h" /***********************************************************/ /* MMIO based ide port @@ -39,9 +39,6 @@ * dedicated ide controller, which is often seen on embedded boards. */ -#define TYPE_MMIO_IDE "mmio-ide" -OBJECT_DECLARE_SIMPLE_TYPE(MMIOIDEState, MMIO_IDE) - struct MMIOIDEState { /*< private >*/ SysBusDevice parent_obj; diff --git a/hw/sh4/r2d.c b/hw/sh4/r2d.c index 39fc4f19d9..b96c6a939a 100644 --- a/hw/sh4/r2d.c +++ b/hw/sh4/r2d.c @@ -38,7 +38,7 @@ #include "hw/qdev-properties.h" #include "net/net.h" #include "sh7750_regs.h" -#include "hw/ide.h" +#include "hw/ide/mmio.h" #include "hw/irq.h" #include "hw/loader.h" #include "hw/usb.h" diff --git a/include/hw/ide.h b/include/hw/ide.h index 60f1f4f714..5f8c36b2aa 100644 --- a/include/hw/ide.h +++ b/include/hw/ide.h @@ -8,9 +8,6 @@ ISADevice *isa_ide_init(ISABus *bus, int iobase, int iobase2, int isairq, DriveInfo *hd0, DriveInfo *hd1); -/* ide-mmio.c */ -void mmio_ide_init_drives(DeviceState *dev, DriveInfo *hd0, DriveInfo *hd1); - int ide_get_geometry(BusState *bus, int unit, int16_t *cyls, int8_t *heads, int8_t *secs); int ide_get_bios_chs_trans(BusState *bus, int unit); diff --git a/include/hw/ide/mmio.h b/include/hw/ide/mmio.h new file mode 100644 index 0000000000..d726a49848 --- /dev/null +++ b/include/hw/ide/mmio.h @@ -0,0 +1,26 @@ +/* + * QEMU IDE Emulation: mmio support (for embedded). + * + * Copyright (c) 2003 Fabrice Bellard + * Copyright (c) 2006 Openedhand Ltd. + * + * SPDX-License-Identifier: MIT + */ + +#ifndef HW_IDE_MMIO_H +#define HW_IDE_MMIO_H + +#include "qom/object.h" + +/* + * QEMU interface: + * + sysbus IRQ 0: asserted by the IDE channel + * + sysbus MMIO region 0: data registers + * + sysbus MMIO region 1: status & control registers + */ +#define TYPE_MMIO_IDE "mmio-ide" +OBJECT_DECLARE_SIMPLE_TYPE(MMIOIDEState, MMIO_IDE) + +void mmio_ide_init_drives(DeviceState *dev, DriveInfo *hd0, DriveInfo *hd1); + +#endif