From nobody Sat Nov 23 22:39:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1727964210; cv=none; d=zohomail.com; s=zohoarc; b=GexsYTwJAsXYfCTbFdCgtOH8ok6YvQMw+I3oDLrdB3XXyq4V6cuxIizPnLx+3bN3om98umOKowyfZdTCrkzpWU7Z/5poRt9hYhRo6cM26NDP+qI2NHaCMCLiEZQ9KfTw9Vb/LIRrYd1hZm3eqboWZEzhd9V5f+G4PX1NOW6BYck= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727964210; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=3Ok18kr1nMkw/0rVgIWp/xbgbnOWA7nawrP/P6cDv6w=; b=FXGKOsFrqjIgWS77TBM2t2G01QLFimoZrbstDIWi/ULhHpK73+b+ubiAp0xphRAfPzVB3MP1IZTCLUzye+VWJbCQ/UaGH+2XEF9m2l/bvmygD5Zjxd/31PSbnXzuV1Hp5g0uYzF1ew7PnHzzDWR4dPDBkBZIW2OCBYiuI6Bgw08= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1727964210654688.3781314704665; Thu, 3 Oct 2024 07:03:30 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1swMNx-00049x-30; Thu, 03 Oct 2024 10:00:53 -0400 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 1swMNQ-00046y-Jy for qemu-devel@nongnu.org; Thu, 03 Oct 2024 10:00:25 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1swMNL-0002qk-1i for qemu-devel@nongnu.org; Thu, 03 Oct 2024 10:00:18 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-42f6bec84b5so9845375e9.1 for ; Thu, 03 Oct 2024 07:00:14 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d0822bc38sm1340255f8f.45.2024.10.03.07.00.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 07:00:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727964013; x=1728568813; darn=nongnu.org; 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=3Ok18kr1nMkw/0rVgIWp/xbgbnOWA7nawrP/P6cDv6w=; b=vH6qJZMeRpJFQuMCeeRbLN8k6DyA/WzBHZ4ffLRirgJrD8cnEfT9wLUklfaQFOXohA n5rvrJ6+oKX+VEF/x7J17Q+Qe58X9lFmo3j6V9bFfYa+czvJFm+qTDC/QxfnL8cwpoRF wmBR57pc47okkcCGXImzQNBHxhZSZROeLYx3c5FJ1F/XcBMUm6Yvk+W79WgbohwkMEMk vsfAnZg3fCHTKmMcpEAe7MP4FBDS5ads/fQDOoTRHwWfM7N/VN6QtnKzHkZ9vS5WRd8E zbOREtCZMPVBHF1X237dFgJlSx/077xRcGhw1wsLmFvRUKq1W3EAiirLjyLfQzXTIl/R z9jA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727964013; x=1728568813; 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=3Ok18kr1nMkw/0rVgIWp/xbgbnOWA7nawrP/P6cDv6w=; b=iSzz6pLOXMLqYd663NRjYLPLy/VpA/VlY6SVkC78V0E0PhkMT58lNN2H3yVqXIqyfA brp9J9xANgIC45xi7YqOfEMLfbRHzA/BrRtzr28vLOgMoPg9QW4kWIZguVrLgzjaIP0F DmIPyaVAw42Qm3BUoI7LNIVgWAS33Zt3AhpR57rZRcU523fADkC6LAFxmnBUAmmHlQ9T EjT4ygw47xRMC6wN8M0cjjulXpIWRUKB46v362howEJy/gCL/Cj/VM5f3F7wl5szuFFN sfRqlD/Pz/hYzzxA4Jart3zNcGwfSuqIsPd7fvOXri65erMEyf9Pc+1wh1uSwzXi9Mys bQlg== X-Forwarded-Encrypted: i=1; AJvYcCUVn+Z8S6JJvhd7jjuHCOT404xWgOK/BIA8amDKCAVwxLvgqpGlI8Lmb+kLYgDF1drC4qz0vBh4kJxM@nongnu.org X-Gm-Message-State: AOJu0YzWQJIOOAQc8VzmPJ/6KP+JEVRGFaox7RS3/7cwGKUZpqo5n5Sp nHz4MN/9sFJgCD270yLojv/ym+QRnp/UkCx9VFo0UXN9j0VOS1DIyTlXPyQ3Z/Q0duRsYv/spLD M X-Google-Smtp-Source: AGHT+IHpske8n3hvEQn1cGEXNY1S9AanOLZy5w+O54y6Hf7mAdWJ+CUSVeYVkl+fE38CInhQwmpq3Q== X-Received: by 2002:adf:e643:0:b0:374:c847:852 with SMTP id ffacd0b85a97d-37cfb9d024cmr4686638f8f.29.1727964012887; Thu, 03 Oct 2024 07:00:12 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Guenter Roeck , Paolo Bonzini Subject: [PATCH v2 1/6] hw/adc: Remove MAX111X device Date: Thu, 3 Oct 2024 15:00:05 +0100 Message-Id: <20241003140010.1653808-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241003140010.1653808-1-peter.maydell@linaro.org> References: <20241003140010.1653808-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32b.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=ham 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1727964211963116600 Content-Type: text/plain; charset="utf-8" The MAX111X ADC device was used only by the XScale-based Zaurus machine types. Now they have all been removed, we can drop this device model too. Because this device is an SSI device, in theory it could be created by users on the command line for boards with a different SSI controller, but we don't believe users are doing this -- it would be impossible on the command line to connect up the GPIO inputs which correspond to ADC inputs, or the GPIO output which is an interrupt line. The only example a web search produces for "device max1111" or "device max1110" is our own bug report https://gitlab.com/qemu-project/qemu/-/issues/2228 where it's used as an example of a bogus command that causes an assertion in an aspeed machine type that wasn't expecting anything other than flash devices on its SMC bus. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- include/hw/adc/max111x.h | 56 ---------- hw/adc/max111x.c | 236 --------------------------------------- hw/adc/Kconfig | 3 - hw/adc/meson.build | 1 - 4 files changed, 296 deletions(-) delete mode 100644 include/hw/adc/max111x.h delete mode 100644 hw/adc/max111x.c diff --git a/include/hw/adc/max111x.h b/include/hw/adc/max111x.h deleted file mode 100644 index beff59c815d..00000000000 --- a/include/hw/adc/max111x.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Maxim MAX1110/1111 ADC chip emulation. - * - * Copyright (c) 2006 Openedhand Ltd. - * Written by Andrzej Zaborowski - * - * This code is licensed under the GNU GPLv2. - * - * Contributions after 2012-01-13 are licensed under the terms of the - * GNU GPL, version 2 or (at your option) any later version. - */ - -#ifndef HW_MISC_MAX111X_H -#define HW_MISC_MAX111X_H - -#include "hw/ssi/ssi.h" -#include "qom/object.h" - -/* - * This is a model of the Maxim MAX1110/1111 ADC chip, which for QEMU - * is an SSI slave device. It has either 4 (max1110) or 8 (max1111) - * 8-bit ADC channels. - * - * QEMU interface: - * + GPIO inputs 0..3 (for max1110) or 0..7 (for max1111): set the value - * of each ADC input, as an unsigned 8-bit value - * + GPIO output 0: interrupt line - * + Properties "input0" to "input3" (max1110) or "input0" to "input7" - * (max1111): initial reset values for ADC inputs. - * - * Known bugs: - * + the interrupt line is not correctly implemented, and will never - * be lowered once it has been asserted. - */ -struct MAX111xState { - SSIPeripheral parent_obj; - - qemu_irq interrupt; - /* Values of inputs at system reset (settable by QOM property) */ - uint8_t reset_input[8]; - - uint8_t tb1, rb2, rb3; - int cycle; - - uint8_t input[8]; - int inputs, com; -}; - -#define TYPE_MAX_111X "max111x" - -OBJECT_DECLARE_SIMPLE_TYPE(MAX111xState, MAX_111X) - -#define TYPE_MAX_1110 "max1110" -#define TYPE_MAX_1111 "max1111" - -#endif diff --git a/hw/adc/max111x.c b/hw/adc/max111x.c deleted file mode 100644 index aa51e47245d..00000000000 --- a/hw/adc/max111x.c +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Maxim MAX1110/1111 ADC chip emulation. - * - * Copyright (c) 2006 Openedhand Ltd. - * Written by Andrzej Zaborowski - * - * This code is licensed under the GNU GPLv2. - * - * Contributions after 2012-01-13 are licensed under the terms of the - * GNU GPL, version 2 or (at your option) any later version. - */ - -#include "qemu/osdep.h" -#include "hw/adc/max111x.h" -#include "hw/irq.h" -#include "migration/vmstate.h" -#include "qemu/module.h" -#include "hw/qdev-properties.h" - -/* Control-byte bitfields */ -#define CB_PD0 (1 << 0) -#define CB_PD1 (1 << 1) -#define CB_SGL (1 << 2) -#define CB_UNI (1 << 3) -#define CB_SEL0 (1 << 4) -#define CB_SEL1 (1 << 5) -#define CB_SEL2 (1 << 6) -#define CB_START (1 << 7) - -#define CHANNEL_NUM(v, b0, b1, b2) \ - ((((v) >> (2 + (b0))) & 4) | \ - (((v) >> (3 + (b1))) & 2) | \ - (((v) >> (4 + (b2))) & 1)) - -static uint32_t max111x_read(MAX111xState *s) -{ - if (!s->tb1) - return 0; - - switch (s->cycle ++) { - case 1: - return s->rb2; - case 2: - return s->rb3; - } - - return 0; -} - -/* Interpret a control-byte */ -static void max111x_write(MAX111xState *s, uint32_t value) -{ - int measure, chan; - - /* Ignore the value if START bit is zero */ - if (!(value & CB_START)) - return; - - s->cycle =3D 0; - - if (!(value & CB_PD1)) { - s->tb1 =3D 0; - return; - } - - s->tb1 =3D value; - - if (s->inputs =3D=3D 8) - chan =3D CHANNEL_NUM(value, 1, 0, 2); - else - chan =3D CHANNEL_NUM(value & ~CB_SEL0, 0, 1, 2); - - if (value & CB_SGL) - measure =3D s->input[chan] - s->com; - else - measure =3D s->input[chan] - s->input[chan ^ 1]; - - if (!(value & CB_UNI)) - measure ^=3D 0x80; - - s->rb2 =3D (measure >> 2) & 0x3f; - s->rb3 =3D (measure << 6) & 0xc0; - - /* FIXME: When should the IRQ be lowered? */ - qemu_irq_raise(s->interrupt); -} - -static uint32_t max111x_transfer(SSIPeripheral *dev, uint32_t value) -{ - MAX111xState *s =3D MAX_111X(dev); - max111x_write(s, value); - return max111x_read(s); -} - -static const VMStateDescription vmstate_max111x =3D { - .name =3D "max111x", - .version_id =3D 1, - .minimum_version_id =3D 1, - .fields =3D (const VMStateField[]) { - VMSTATE_SSI_PERIPHERAL(parent_obj, MAX111xState), - VMSTATE_UINT8(tb1, MAX111xState), - VMSTATE_UINT8(rb2, MAX111xState), - VMSTATE_UINT8(rb3, MAX111xState), - VMSTATE_INT32_EQUAL(inputs, MAX111xState, NULL), - VMSTATE_INT32(com, MAX111xState), - VMSTATE_ARRAY_INT32_UNSAFE(input, MAX111xState, inputs, - vmstate_info_uint8, uint8_t), - VMSTATE_END_OF_LIST() - } -}; - -static void max111x_input_set(void *opaque, int line, int value) -{ - MAX111xState *s =3D MAX_111X(opaque); - - assert(line >=3D 0 && line < s->inputs); - s->input[line] =3D value; -} - -static int max111x_init(SSIPeripheral *d, int inputs) -{ - DeviceState *dev =3D DEVICE(d); - MAX111xState *s =3D MAX_111X(dev); - - qdev_init_gpio_out(dev, &s->interrupt, 1); - qdev_init_gpio_in(dev, max111x_input_set, inputs); - - s->inputs =3D inputs; - - return 0; -} - -static void max1110_realize(SSIPeripheral *dev, Error **errp) -{ - max111x_init(dev, 8); -} - -static void max1111_realize(SSIPeripheral *dev, Error **errp) -{ - max111x_init(dev, 4); -} - -static void max111x_reset(DeviceState *dev) -{ - MAX111xState *s =3D MAX_111X(dev); - int i; - - for (i =3D 0; i < s->inputs; i++) { - s->input[i] =3D s->reset_input[i]; - } - s->com =3D 0; - s->tb1 =3D 0; - s->rb2 =3D 0; - s->rb3 =3D 0; - s->cycle =3D 0; -} - -static Property max1110_properties[] =3D { - /* Reset values for ADC inputs */ - DEFINE_PROP_UINT8("input0", MAX111xState, reset_input[0], 0xf0), - DEFINE_PROP_UINT8("input1", MAX111xState, reset_input[1], 0xe0), - DEFINE_PROP_UINT8("input2", MAX111xState, reset_input[2], 0xd0), - DEFINE_PROP_UINT8("input3", MAX111xState, reset_input[3], 0xc0), - DEFINE_PROP_END_OF_LIST(), -}; - -static Property max1111_properties[] =3D { - /* Reset values for ADC inputs */ - DEFINE_PROP_UINT8("input0", MAX111xState, reset_input[0], 0xf0), - DEFINE_PROP_UINT8("input1", MAX111xState, reset_input[1], 0xe0), - DEFINE_PROP_UINT8("input2", MAX111xState, reset_input[2], 0xd0), - DEFINE_PROP_UINT8("input3", MAX111xState, reset_input[3], 0xc0), - DEFINE_PROP_UINT8("input4", MAX111xState, reset_input[4], 0xb0), - DEFINE_PROP_UINT8("input5", MAX111xState, reset_input[5], 0xa0), - DEFINE_PROP_UINT8("input6", MAX111xState, reset_input[6], 0x90), - DEFINE_PROP_UINT8("input7", MAX111xState, reset_input[7], 0x80), - DEFINE_PROP_END_OF_LIST(), -}; - -static void max111x_class_init(ObjectClass *klass, void *data) -{ - SSIPeripheralClass *k =3D SSI_PERIPHERAL_CLASS(klass); - DeviceClass *dc =3D DEVICE_CLASS(klass); - - k->transfer =3D max111x_transfer; - device_class_set_legacy_reset(dc, max111x_reset); - dc->vmsd =3D &vmstate_max111x; - set_bit(DEVICE_CATEGORY_MISC, dc->categories); -} - -static const TypeInfo max111x_info =3D { - .name =3D TYPE_MAX_111X, - .parent =3D TYPE_SSI_PERIPHERAL, - .instance_size =3D sizeof(MAX111xState), - .class_init =3D max111x_class_init, - .abstract =3D true, -}; - -static void max1110_class_init(ObjectClass *klass, void *data) -{ - SSIPeripheralClass *k =3D SSI_PERIPHERAL_CLASS(klass); - DeviceClass *dc =3D DEVICE_CLASS(klass); - - k->realize =3D max1110_realize; - device_class_set_props(dc, max1110_properties); -} - -static const TypeInfo max1110_info =3D { - .name =3D TYPE_MAX_1110, - .parent =3D TYPE_MAX_111X, - .class_init =3D max1110_class_init, -}; - -static void max1111_class_init(ObjectClass *klass, void *data) -{ - SSIPeripheralClass *k =3D SSI_PERIPHERAL_CLASS(klass); - DeviceClass *dc =3D DEVICE_CLASS(klass); - - k->realize =3D max1111_realize; - device_class_set_props(dc, max1111_properties); -} - -static const TypeInfo max1111_info =3D { - .name =3D TYPE_MAX_1111, - .parent =3D TYPE_MAX_111X, - .class_init =3D max1111_class_init, -}; - -static void max111x_register_types(void) -{ - type_register_static(&max111x_info); - type_register_static(&max1110_info); - type_register_static(&max1111_info); -} - -type_init(max111x_register_types) diff --git a/hw/adc/Kconfig b/hw/adc/Kconfig index a825bd3d343..25d2229fb83 100644 --- a/hw/adc/Kconfig +++ b/hw/adc/Kconfig @@ -1,5 +1,2 @@ config STM32F2XX_ADC bool - -config MAX111X - bool diff --git a/hw/adc/meson.build b/hw/adc/meson.build index a4f85b7d468..7f7acc16196 100644 --- a/hw/adc/meson.build +++ b/hw/adc/meson.build @@ -2,4 +2,3 @@ system_ss.add(when: 'CONFIG_STM32F2XX_ADC', if_true: files(= 'stm32f2xx_adc.c')) system_ss.add(when: 'CONFIG_ASPEED_SOC', if_true: files('aspeed_adc.c')) system_ss.add(when: 'CONFIG_NPCM7XX', if_true: files('npcm7xx_adc.c')) system_ss.add(when: 'CONFIG_ZYNQ', if_true: files('zynq-xadc.c')) -system_ss.add(when: 'CONFIG_MAX111X', if_true: files('max111x.c')) --=20 2.34.1 From nobody Sat Nov 23 22:39:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1727964120; cv=none; d=zohomail.com; s=zohoarc; b=E1RcF9XUKKsfIXx2dcL5cAtgQo7zFb4wU74akdFrDAv0Vn80LefXr3eDWUY0Um6U82uevSNFhAszc3jfQy6bZ3J6OssKpjzas9AgSUHSUakZl3L07oYoLBpep2UpnCj0wfFnqeyM0pzEz6S6ucfrbvf4UfSC8u1S3YmyU89vQqQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727964120; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=GbrP9MmrJ0+K+HvI7PXjyGE5YoOWjRR/6vqiaVbTMdM=; b=HRiYogiWAzHL6wC6psmqcQCjPXEfbadHh8b8FutizqG3QLP42q1FM4Y7mQBoXrTEucIXVFy4nTd2ZQQI1LGUcOsXkd35Mr/h3Gim8rDRYvapOtu7Ae6a+QMlKiF1GnFVNipP+99NTy1zcwqml9iEu3/8a8GkpMbMH78SVPSVsmU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1727964120881474.95602587875476; Thu, 3 Oct 2024 07:02:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1swMO7-0004Eu-Jn; Thu, 03 Oct 2024 10:01:03 -0400 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 1swMNQ-00046x-Jb for qemu-devel@nongnu.org; Thu, 03 Oct 2024 10:00:25 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1swMNM-0002qr-P5 for qemu-devel@nongnu.org; Thu, 03 Oct 2024 10:00:18 -0400 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-37ccfbbd467so857406f8f.0 for ; Thu, 03 Oct 2024 07:00:14 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d0822bc38sm1340255f8f.45.2024.10.03.07.00.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 07:00:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727964014; x=1728568814; darn=nongnu.org; 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=GbrP9MmrJ0+K+HvI7PXjyGE5YoOWjRR/6vqiaVbTMdM=; b=Bda4ATXeYCa0rgPOiGPzxlfkgvxo5RWqayLxF+4dN1MYBeEMnPTaXyrIi+iBTEIrM5 4mp4ndwagFO+uA+/Atlw1TDqychVrYNxOfjwpMhaC9aLiShBcIFkv/kY5TCRPEWeHIWn f9wofnxAje5SF2IoSeQvOVKs1TpcfkO0LjOabMYwrLi8duzUweknLtDDBj/pZPEmpFog yGcwPp6wX84niAoyIxDaDlExID44BBckgSM3FIpJrTZq1D3J02J32/UX/1lZU/avakSi IPT/6E3ZUHkzAcabdhrt1E+CWNo2gqO9YEaAC8+GqYHApi92V0WsB8sDY2VFV4M8kjXv G1mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727964014; x=1728568814; 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=GbrP9MmrJ0+K+HvI7PXjyGE5YoOWjRR/6vqiaVbTMdM=; b=pwdfg6LMl2ERciYwKIq6kzc1XlHpz+4Ec2s3/1OdKB/orOo404432VskxBBpYWDGk/ 65l3fPHzBRhSRZgvae7L7oaTvRsmlmfHBcSXf5rtbcAZDBNZpGI594wtCCITLK8nw0xr McmAyH72GlbLUlnGVU9wrjOYA6Mpj7FqolhcMd+I4eLR0VX56gO+eMuC/wwCz3npCdM4 oqVeLLlkkqPCwOxTy1fMDcSwHjyAnK5qOL+vgk56arYVMLBJN2isu3EM6SOGzDScfqo4 Q8m2cI2tPnI6iKte7MSZJrtGkJgrgPTqcXEJuSylebr6yzhLrCJIqRduT4vLMTOrFLuf QWLA== X-Forwarded-Encrypted: i=1; AJvYcCVv5mpnTwJ16jf0pfkRP7F0ty8lszyVCsvQ+WWWpzGvQMQCFTX4WiHEnnuxKFfarRhrd/54I/BA/zeR@nongnu.org X-Gm-Message-State: AOJu0Yzzs6cB8EkSvdPC2k4JhYaQFQd8oYgwv3dTwWmXEv/ikZeW2nOB wbTgRgPCieDGWX8D21ykFgTTKu3DvF//JamIZi7n0xx3nM6px9ZVAT8t7JLAk9o= X-Google-Smtp-Source: AGHT+IEf1wqv7MQTo/JQx/bXJaMVL1+VHsrfDQSySpTcKREzY6fKdFU930TTZJGewrKpgpr3+YIE3w== X-Received: by 2002:adf:a2de:0:b0:37c:c5fc:89f4 with SMTP id ffacd0b85a97d-37cfba139a9mr4222227f8f.51.1727964013556; Thu, 03 Oct 2024 07:00:13 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Guenter Roeck , Paolo Bonzini Subject: [PATCH v2 2/6] hw/gpio: Remove MAX7310 device Date: Thu, 3 Oct 2024 15:00:06 +0100 Message-Id: <20241003140010.1653808-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241003140010.1653808-1-peter.maydell@linaro.org> References: <20241003140010.1653808-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x431.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1727964123901116600 Content-Type: text/plain; charset="utf-8" The MAX7310 GPIO controller was used only by the XScale-based Zaurus machine types. Now they have been removed we can remove this device model as well. Because this device is an I2C device, in theory it could be created by users on the command line for boards with a different I2c controller, but we don't believe users are doing this -- it would be impossible on the command line to connect up the GPIO inputs/outputs. The only example a web search produces for "device max7310" is a user trying to create this because they didn't realize that there was no way to manipulate the GPIO lines. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- hw/gpio/max7310.c | 217 -------------------------------------------- hw/gpio/Kconfig | 4 - hw/gpio/meson.build | 1 - 3 files changed, 222 deletions(-) delete mode 100644 hw/gpio/max7310.c diff --git a/hw/gpio/max7310.c b/hw/gpio/max7310.c deleted file mode 100644 index 43a92b8db97..00000000000 --- a/hw/gpio/max7310.c +++ /dev/null @@ -1,217 +0,0 @@ -/* - * MAX7310 8-port GPIO expansion chip. - * - * Copyright (c) 2006 Openedhand Ltd. - * Written by Andrzej Zaborowski - * - * This file is licensed under GNU GPL. - */ - -#include "qemu/osdep.h" -#include "hw/i2c/i2c.h" -#include "hw/irq.h" -#include "migration/vmstate.h" -#include "qemu/log.h" -#include "qemu/module.h" -#include "qom/object.h" - -#define TYPE_MAX7310 "max7310" -OBJECT_DECLARE_SIMPLE_TYPE(MAX7310State, MAX7310) - -struct MAX7310State { - I2CSlave parent_obj; - - int i2c_command_byte; - int len; - - uint8_t level; - uint8_t direction; - uint8_t polarity; - uint8_t status; - uint8_t command; - qemu_irq handler[8]; - qemu_irq *gpio_in; -}; - -static void max7310_reset(DeviceState *dev) -{ - MAX7310State *s =3D MAX7310(dev); - - s->level &=3D s->direction; - s->direction =3D 0xff; - s->polarity =3D 0xf0; - s->status =3D 0x01; - s->command =3D 0x00; -} - -static uint8_t max7310_rx(I2CSlave *i2c) -{ - MAX7310State *s =3D MAX7310(i2c); - - switch (s->command) { - case 0x00: /* Input port */ - return s->level ^ s->polarity; - - case 0x01: /* Output port */ - return s->level & ~s->direction; - - case 0x02: /* Polarity inversion */ - return s->polarity; - - case 0x03: /* Configuration */ - return s->direction; - - case 0x04: /* Timeout */ - return s->status; - - case 0xff: /* Reserved */ - return 0xff; - - default: - qemu_log_mask(LOG_UNIMP, "%s: Unsupported register 0x02%" PRIx8 "\= n", - __func__, s->command); - break; - } - return 0xff; -} - -static int max7310_tx(I2CSlave *i2c, uint8_t data) -{ - MAX7310State *s =3D MAX7310(i2c); - uint8_t diff; - int line; - - if (s->len ++ > 1) { -#ifdef VERBOSE - printf("%s: message too long (%i bytes)\n", __func__, s->len); -#endif - return 1; - } - - if (s->i2c_command_byte) { - s->command =3D data; - s->i2c_command_byte =3D 0; - return 0; - } - - switch (s->command) { - case 0x01: /* Output port */ - for (diff =3D (data ^ s->level) & ~s->direction; diff; - diff &=3D ~(1 << line)) { - line =3D ctz32(diff); - if (s->handler[line]) - qemu_set_irq(s->handler[line], (data >> line) & 1); - } - s->level =3D (s->level & s->direction) | (data & ~s->direction); - break; - - case 0x02: /* Polarity inversion */ - s->polarity =3D data; - break; - - case 0x03: /* Configuration */ - s->level &=3D ~(s->direction ^ data); - s->direction =3D data; - break; - - case 0x04: /* Timeout */ - s->status =3D data; - break; - - case 0x00: /* Input port - ignore writes */ - break; - default: - qemu_log_mask(LOG_UNIMP, "%s: Unsupported register 0x02%" PRIx8 "\= n", - __func__, s->command); - return 1; - } - - return 0; -} - -static int max7310_event(I2CSlave *i2c, enum i2c_event event) -{ - MAX7310State *s =3D MAX7310(i2c); - s->len =3D 0; - - switch (event) { - case I2C_START_SEND: - s->i2c_command_byte =3D 1; - break; - case I2C_FINISH: -#ifdef VERBOSE - if (s->len =3D=3D 1) - printf("%s: message too short (%i bytes)\n", __func__, s->len); -#endif - break; - default: - break; - } - - return 0; -} - -static const VMStateDescription vmstate_max7310 =3D { - .name =3D "max7310", - .version_id =3D 0, - .minimum_version_id =3D 0, - .fields =3D (const VMStateField[]) { - VMSTATE_INT32(i2c_command_byte, MAX7310State), - VMSTATE_INT32(len, MAX7310State), - VMSTATE_UINT8(level, MAX7310State), - VMSTATE_UINT8(direction, MAX7310State), - VMSTATE_UINT8(polarity, MAX7310State), - VMSTATE_UINT8(status, MAX7310State), - VMSTATE_UINT8(command, MAX7310State), - VMSTATE_I2C_SLAVE(parent_obj, MAX7310State), - VMSTATE_END_OF_LIST() - } -}; - -static void max7310_gpio_set(void *opaque, int line, int level) -{ - MAX7310State *s =3D (MAX7310State *) opaque; - assert(line >=3D 0 && line < ARRAY_SIZE(s->handler)); - - if (level) - s->level |=3D s->direction & (1 << line); - else - s->level &=3D ~(s->direction & (1 << line)); -} - -/* MAX7310 is SMBus-compatible (can be used with only SMBus protocols), - * but also accepts sequences that are not SMBus so return an I2C device. = */ -static void max7310_realize(DeviceState *dev, Error **errp) -{ - MAX7310State *s =3D MAX7310(dev); - - qdev_init_gpio_in(dev, max7310_gpio_set, ARRAY_SIZE(s->handler)); - qdev_init_gpio_out(dev, s->handler, ARRAY_SIZE(s->handler)); -} - -static void max7310_class_init(ObjectClass *klass, void *data) -{ - DeviceClass *dc =3D DEVICE_CLASS(klass); - I2CSlaveClass *k =3D I2C_SLAVE_CLASS(klass); - - dc->realize =3D max7310_realize; - k->event =3D max7310_event; - k->recv =3D max7310_rx; - k->send =3D max7310_tx; - device_class_set_legacy_reset(dc, max7310_reset); - dc->vmsd =3D &vmstate_max7310; -} - -static const TypeInfo max7310_info =3D { - .name =3D TYPE_MAX7310, - .parent =3D TYPE_I2C_SLAVE, - .instance_size =3D sizeof(MAX7310State), - .class_init =3D max7310_class_init, -}; - -static void max7310_register_types(void) -{ - type_register_static(&max7310_info); -} - -type_init(max7310_register_types) diff --git a/hw/gpio/Kconfig b/hw/gpio/Kconfig index 843630d4f5f..c423e10f59f 100644 --- a/hw/gpio/Kconfig +++ b/hw/gpio/Kconfig @@ -1,7 +1,3 @@ -config MAX7310 - bool - depends on I2C - config PL061 bool =20 diff --git a/hw/gpio/meson.build b/hw/gpio/meson.build index 089b24802ef..74840619c01 100644 --- a/hw/gpio/meson.build +++ b/hw/gpio/meson.build @@ -1,7 +1,6 @@ system_ss.add(when: 'CONFIG_GPIO_KEY', if_true: files('gpio_key.c')) system_ss.add(when: 'CONFIG_GPIO_MPC8XXX', if_true: files('mpc8xxx.c')) system_ss.add(when: 'CONFIG_GPIO_PWR', if_true: files('gpio_pwr.c')) -system_ss.add(when: 'CONFIG_MAX7310', if_true: files('max7310.c')) system_ss.add(when: 'CONFIG_PCA9552', if_true: files('pca9552.c')) system_ss.add(when: 'CONFIG_PCA9554', if_true: files('pca9554.c')) system_ss.add(when: 'CONFIG_PL061', if_true: files('pl061.c')) --=20 2.34.1 From nobody Sat Nov 23 22:39:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1727964139; cv=none; d=zohomail.com; s=zohoarc; b=gcDzmIoCuk+d19O0VVcrE0iQN7Wo0gvbPCbSCzYyWgfuukKIOR8djZCFV9Ygv2O+z6GngjYE8Gr7uS+sLeIWmNo9KVX1AzcW97ICPaIjR0wjk+Dq0+liss0ByKRGNmYNZcJNHSBsVaJD6flTHldWN8cl0qOvj/LYWrWuaZ2opWw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727964139; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=5YfeG5jC30ICdEmD4L7YfElHyWYG3PKB3Jupds5FC1o=; b=I2Lnqet29Mw4tPtzE+KRyDOUbDKfiSWEaPCLQseySl7A+C9J99QITnUSIu4vKusaS4WoM/lqRt4r8ik/3PiGUCaY6xYnWOeVMe3hd/e8hrx77VaYxSntlenquxvP+F96pKfbK+42DNt++7IH5L8VYtsf/cFejYr62Ok6fOOUvqs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1727964139147320.84729216916185; Thu, 3 Oct 2024 07:02:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1swMOC-0004L6-Bn; Thu, 03 Oct 2024 10:01:08 -0400 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 1swMNS-00047I-Mt for qemu-devel@nongnu.org; Thu, 03 Oct 2024 10:00:26 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1swMNN-0002r5-40 for qemu-devel@nongnu.org; Thu, 03 Oct 2024 10:00:21 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-42cb57f8b41so13165935e9.0 for ; Thu, 03 Oct 2024 07:00:15 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d0822bc38sm1340255f8f.45.2024.10.03.07.00.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 07:00:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727964014; x=1728568814; darn=nongnu.org; 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=5YfeG5jC30ICdEmD4L7YfElHyWYG3PKB3Jupds5FC1o=; b=iotOYRgltHSsyVND6gb9eZYE9Xch+RK0uvEoNj3CgQQ/4U2E0LoGlzg20nMXpyM2hB R1wm2UD8TJCXLdEj9RG7q3fgNE+tKqa3BR/ZFWRuebBXxcqCn4eZFYdAVyGu+deMmM30 XJGtoodCakD83sm71kn3gbalCmeq0gzqvkP0C09KvVAW7p6d6J9Bkg1XnwWRUwsyN7V2 QZ2IqKGWQ5gDLWlo9flQR7okzdfU7Jf41ySA1ggeBUMxwZEPMN+Tv5WKtDdPtF2ZYuIu 0VncuO0jQZhkKchvWODnZcS3d/xuc9TRIsgiJm6Z95MBwBcZvLLZWADHNeISAFV6QToz ZMjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727964014; x=1728568814; 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=5YfeG5jC30ICdEmD4L7YfElHyWYG3PKB3Jupds5FC1o=; b=nokzcuKpOY966ayQjpxyRDbbD2vEevGuT/ZmXyA5AjC3Qlr4WcNCneFwPHqf5gR5i3 9asqm+6XfFPBxht/2vJthI7lTU2L+IND0kRTfQ/Q8FX+WR/07uK+PDtnocfSk3P890WP Ty1CFBSocky6VQew5bdB6Ib6N233L0TY16XSDtITvveJoieZ1mxvhOIat43Lr1D0F3at lXjagibBDS4L5IEbil6i5dHuop+VCvXzRbSS6k+rDtcliX/3wHdKFIRxQYYCzWW934Cx jrdv42TsCZW4x/raBkLQ491O/o8qOnMykGqELn5Wren0ljpur5rgs7aaXSudUBmJmnKm 6SnQ== X-Forwarded-Encrypted: i=1; AJvYcCUhX+uZiR0FqLkTCLSnYEVvG/DnPmU9RYmd/0vQ7c5hv+KPzRM1zONh5J9okBX4iDkSCaKqtnIVXeCn@nongnu.org X-Gm-Message-State: AOJu0Yz3Zt43cto7d8KE97mvqBVVIOxR0LsfgW5NDrJLModXLXBWRUob P5fXdiXw6+co6isDmb5RDphJhMp8U/DR+VbGmIm73xn1ojDBBwgZjg8JaHfC0Cj5yb8Cb5LaBtM L X-Google-Smtp-Source: AGHT+IE/sv8GRtlv0PCGGb4sL907KVQj1ARXfFZWHKH16CCja2L51NMaw10gc6oMZsPiAKx5P+vAng== X-Received: by 2002:a5d:58d2:0:b0:37c:cea2:826f with SMTP id ffacd0b85a97d-37cfb8b562bmr5642691f8f.2.1727964014263; Thu, 03 Oct 2024 07:00:14 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Guenter Roeck , Paolo Bonzini Subject: [PATCH v2 3/6] hw/ide: Remove DSCM-1XXXX microdrive device model Date: Thu, 3 Oct 2024 15:00:07 +0100 Message-Id: <20241003140010.1653808-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241003140010.1653808-1-peter.maydell@linaro.org> References: <20241003140010.1653808-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32f.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=ham 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1727964139625116600 Content-Type: text/plain; charset="utf-8" The DSCM-1XXXX microdrive device model was used only by the XScale-based Zaurus machine types. Now they have been removed, we can delete this device too. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- include/hw/pcmcia.h | 3 - hw/ide/microdrive.c | 644 -------------------------------------------- hw/ide/Kconfig | 6 - hw/ide/meson.build | 1 - 4 files changed, 654 deletions(-) delete mode 100644 hw/ide/microdrive.c diff --git a/include/hw/pcmcia.h b/include/hw/pcmcia.h index ab268027511..6c08ad616a5 100644 --- a/include/hw/pcmcia.h +++ b/include/hw/pcmcia.h @@ -60,7 +60,4 @@ struct PCMCIACardClass { #define CISTPL_END 0xff /* Tuple End */ #define CISTPL_ENDMARK 0xff =20 -/* dscm1xxxx.c */ -PCMCIACardState *dscm1xxxx_init(DriveInfo *bdrv); - #endif diff --git a/hw/ide/microdrive.c b/hw/ide/microdrive.c deleted file mode 100644 index 5475d599788..00000000000 --- a/hw/ide/microdrive.c +++ /dev/null @@ -1,644 +0,0 @@ -/* - * QEMU IDE Emulation: microdrive (CF / PCMCIA) - * - * Copyright (c) 2003 Fabrice Bellard - * Copyright (c) 2006 Openedhand Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a= copy - * of this software and associated documentation files (the "Software"), t= o deal - * in the Software without restriction, including without limitation the r= ights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or se= ll - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included= in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS= OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OT= HER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING= FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS = IN - * THE SOFTWARE. - */ - -#include "qemu/osdep.h" -#include "hw/pcmcia.h" -#include "migration/vmstate.h" -#include "qapi/error.h" -#include "qemu/module.h" -#include "sysemu/dma.h" -#include "hw/irq.h" - -#include "qom/object.h" -#include "ide-internal.h" - -#define TYPE_MICRODRIVE "microdrive" -OBJECT_DECLARE_SIMPLE_TYPE(MicroDriveState, MICRODRIVE) - -/***********************************************************/ -/* CF-ATA Microdrive */ - -#define METADATA_SIZE 0x20 - -/* DSCM-1XXXX Microdrive hard disk with CF+ II / PCMCIA interface. */ - -struct MicroDriveState { - /*< private >*/ - PCMCIACardState parent_obj; - /*< public >*/ - - IDEBus bus; - uint32_t attr_base; - uint32_t io_base; - - /* Card state */ - uint8_t opt; - uint8_t stat; - uint8_t pins; - - uint8_t ctrl; - uint16_t io; - uint8_t cycle; -}; - -/* Register bitfields */ -enum md_opt { - OPT_MODE_MMAP =3D 0, - OPT_MODE_IOMAP16 =3D 1, - OPT_MODE_IOMAP1 =3D 2, - OPT_MODE_IOMAP2 =3D 3, - OPT_MODE =3D 0x3f, - OPT_LEVIREQ =3D 0x40, - OPT_SRESET =3D 0x80, -}; -enum md_cstat { - STAT_INT =3D 0x02, - STAT_PWRDWN =3D 0x04, - STAT_XE =3D 0x10, - STAT_IOIS8 =3D 0x20, - STAT_SIGCHG =3D 0x40, - STAT_CHANGED =3D 0x80, -}; -enum md_pins { - PINS_MRDY =3D 0x02, - PINS_CRDY =3D 0x20, -}; -enum md_ctrl { - CTRL_IEN =3D 0x02, - CTRL_SRST =3D 0x04, -}; - -static inline void md_interrupt_update(MicroDriveState *s) -{ - PCMCIACardState *card =3D PCMCIA_CARD(s); - - if (card->slot =3D=3D NULL) { - return; - } - - qemu_set_irq(card->slot->irq, - !(s->stat & STAT_INT) && /* Inverted */ - !(s->ctrl & (CTRL_IEN | CTRL_SRST)) && - !(s->opt & OPT_SRESET)); -} - -static void md_set_irq(void *opaque, int irq, int level) -{ - MicroDriveState *s =3D opaque; - - if (level) { - s->stat |=3D STAT_INT; - } else { - s->stat &=3D ~STAT_INT; - } - - md_interrupt_update(s); -} - -static void md_reset(DeviceState *dev) -{ - MicroDriveState *s =3D MICRODRIVE(dev); - - s->opt =3D OPT_MODE_MMAP; - s->stat =3D 0; - s->pins =3D 0; - s->cycle =3D 0; - s->ctrl =3D 0; - ide_bus_reset(&s->bus); -} - -static uint8_t md_attr_read(PCMCIACardState *card, uint32_t at) -{ - MicroDriveState *s =3D MICRODRIVE(card); - PCMCIACardClass *pcc =3D PCMCIA_CARD_GET_CLASS(card); - - if (at < s->attr_base) { - if (at < pcc->cis_len) { - return pcc->cis[at]; - } else { - return 0x00; - } - } - - at -=3D s->attr_base; - - switch (at) { - case 0x00: /* Configuration Option Register */ - return s->opt; - case 0x02: /* Card Configuration Status Register */ - if (s->ctrl & CTRL_IEN) { - return s->stat & ~STAT_INT; - } else { - return s->stat; - } - case 0x04: /* Pin Replacement Register */ - return (s->pins & PINS_CRDY) | 0x0c; - case 0x06: /* Socket and Copy Register */ - return 0x00; -#ifdef VERBOSE - default: - printf("%s: Bad attribute space register %02x\n", __func__, at); -#endif - } - - return 0; -} - -static void md_attr_write(PCMCIACardState *card, uint32_t at, uint8_t valu= e) -{ - MicroDriveState *s =3D MICRODRIVE(card); - - at -=3D s->attr_base; - - switch (at) { - case 0x00: /* Configuration Option Register */ - s->opt =3D value & 0xcf; - if (value & OPT_SRESET) { - device_cold_reset(DEVICE(s)); - } - md_interrupt_update(s); - break; - case 0x02: /* Card Configuration Status Register */ - if ((s->stat ^ value) & STAT_PWRDWN) { - s->pins |=3D PINS_CRDY; - } - s->stat &=3D 0x82; - s->stat |=3D value & 0x74; - md_interrupt_update(s); - /* Word 170 in Identify Device must be equal to STAT_XE */ - break; - case 0x04: /* Pin Replacement Register */ - s->pins &=3D PINS_CRDY; - s->pins |=3D value & PINS_MRDY; - break; - case 0x06: /* Socket and Copy Register */ - break; - default: - printf("%s: Bad attribute space register %02x\n", __func__, at); - } -} - -static uint16_t md_common_read(PCMCIACardState *card, uint32_t at) -{ - MicroDriveState *s =3D MICRODRIVE(card); - IDEState *ifs; - uint16_t ret; - at -=3D s->io_base; - - switch (s->opt & OPT_MODE) { - case OPT_MODE_MMAP: - if ((at & ~0x3ff) =3D=3D 0x400) { - at =3D 0; - } - break; - case OPT_MODE_IOMAP16: - at &=3D 0xf; - break; - case OPT_MODE_IOMAP1: - if ((at & ~0xf) =3D=3D 0x3f0) { - at -=3D 0x3e8; - } else if ((at & ~0xf) =3D=3D 0x1f0) { - at -=3D 0x1f0; - } - break; - case OPT_MODE_IOMAP2: - if ((at & ~0xf) =3D=3D 0x370) { - at -=3D 0x368; - } else if ((at & ~0xf) =3D=3D 0x170) { - at -=3D 0x170; - } - } - - switch (at) { - case 0x0: /* Even RD Data */ - case 0x8: - return ide_data_readw(&s->bus, 0); - - /* TODO: 8-bit accesses */ - if (s->cycle) { - ret =3D s->io >> 8; - } else { - s->io =3D ide_data_readw(&s->bus, 0); - ret =3D s->io & 0xff; - } - s->cycle =3D !s->cycle; - return ret; - case 0x9: /* Odd RD Data */ - return s->io >> 8; - case 0xd: /* Error */ - return ide_ioport_read(&s->bus, 0x1); - case 0xe: /* Alternate Status */ - ifs =3D ide_bus_active_if(&s->bus); - if (ifs->blk) { - return ifs->status; - } else { - return 0; - } - case 0xf: /* Device Address */ - ifs =3D ide_bus_active_if(&s->bus); - return 0xc2 | ((~ifs->select << 2) & 0x3c); - default: - return ide_ioport_read(&s->bus, at); - } - - return 0; -} - -static void md_common_write(PCMCIACardState *card, uint32_t at, uint16_t v= alue) -{ - MicroDriveState *s =3D MICRODRIVE(card); - at -=3D s->io_base; - - switch (s->opt & OPT_MODE) { - case OPT_MODE_MMAP: - if ((at & ~0x3ff) =3D=3D 0x400) { - at =3D 0; - } - break; - case OPT_MODE_IOMAP16: - at &=3D 0xf; - break; - case OPT_MODE_IOMAP1: - if ((at & ~0xf) =3D=3D 0x3f0) { - at -=3D 0x3e8; - } else if ((at & ~0xf) =3D=3D 0x1f0) { - at -=3D 0x1f0; - } - break; - case OPT_MODE_IOMAP2: - if ((at & ~0xf) =3D=3D 0x370) { - at -=3D 0x368; - } else if ((at & ~0xf) =3D=3D 0x170) { - at -=3D 0x170; - } - } - - switch (at) { - case 0x0: /* Even WR Data */ - case 0x8: - ide_data_writew(&s->bus, 0, value); - break; - - /* TODO: 8-bit accesses */ - if (s->cycle) { - ide_data_writew(&s->bus, 0, s->io | (value << 8)); - } else { - s->io =3D value & 0xff; - } - s->cycle =3D !s->cycle; - break; - case 0x9: - s->io =3D value & 0xff; - s->cycle =3D !s->cycle; - break; - case 0xd: /* Features */ - ide_ioport_write(&s->bus, 0x1, value); - break; - case 0xe: /* Device Control */ - s->ctrl =3D value; - if (value & CTRL_SRST) { - device_cold_reset(DEVICE(s)); - } - md_interrupt_update(s); - break; - default: - if (s->stat & STAT_PWRDWN) { - s->pins |=3D PINS_CRDY; - s->stat &=3D ~STAT_PWRDWN; - } - ide_ioport_write(&s->bus, at, value); - } -} - -static const VMStateDescription vmstate_microdrive =3D { - .name =3D "microdrive", - .version_id =3D 3, - .minimum_version_id =3D 0, - .fields =3D (const VMStateField[]) { - VMSTATE_UINT8(opt, MicroDriveState), - VMSTATE_UINT8(stat, MicroDriveState), - VMSTATE_UINT8(pins, MicroDriveState), - VMSTATE_UINT8(ctrl, MicroDriveState), - VMSTATE_UINT16(io, MicroDriveState), - VMSTATE_UINT8(cycle, MicroDriveState), - VMSTATE_IDE_BUS(bus, MicroDriveState), - VMSTATE_IDE_DRIVES(bus.ifs, MicroDriveState), - VMSTATE_END_OF_LIST() - } -}; - -static const uint8_t dscm1xxxx_cis[0x14a] =3D { - [0x000] =3D CISTPL_DEVICE, /* 5V Device Information */ - [0x002] =3D 0x03, /* Tuple length =3D 4 bytes */ - [0x004] =3D 0xdb, /* ID: DTYPE_FUNCSPEC, non WP, DSPEED_15= 0NS */ - [0x006] =3D 0x01, /* Size =3D 2K bytes */ - [0x008] =3D CISTPL_ENDMARK, - - [0x00a] =3D CISTPL_DEVICE_OC, /* Additional Device Information */ - [0x00c] =3D 0x04, /* Tuple length =3D 4 byest */ - [0x00e] =3D 0x03, /* Conditions: Ext =3D 0, Vcc 3.3V, MWAI= T =3D 1 */ - [0x010] =3D 0xdb, /* ID: DTYPE_FUNCSPEC, non WP, DSPEED_15= 0NS */ - [0x012] =3D 0x01, /* Size =3D 2K bytes */ - [0x014] =3D CISTPL_ENDMARK, - - [0x016] =3D CISTPL_JEDEC_C, /* JEDEC ID */ - [0x018] =3D 0x02, /* Tuple length =3D 2 bytes */ - [0x01a] =3D 0xdf, /* PC Card ATA with no Vpp required */ - [0x01c] =3D 0x01, - - [0x01e] =3D CISTPL_MANFID, /* Manufacture ID */ - [0x020] =3D 0x04, /* Tuple length =3D 4 bytes */ - [0x022] =3D 0xa4, /* TPLMID_MANF =3D 00a4 (IBM) */ - [0x024] =3D 0x00, - [0x026] =3D 0x00, /* PLMID_CARD =3D 0000 */ - [0x028] =3D 0x00, - - [0x02a] =3D CISTPL_VERS_1, /* Level 1 Version */ - [0x02c] =3D 0x12, /* Tuple length =3D 23 bytes */ - [0x02e] =3D 0x04, /* Major Version =3D JEIDA 4.2 / PCMCIA = 2.1 */ - [0x030] =3D 0x01, /* Minor Version =3D 1 */ - [0x032] =3D 'I', - [0x034] =3D 'B', - [0x036] =3D 'M', - [0x038] =3D 0x00, - [0x03a] =3D 'm', - [0x03c] =3D 'i', - [0x03e] =3D 'c', - [0x040] =3D 'r', - [0x042] =3D 'o', - [0x044] =3D 'd', - [0x046] =3D 'r', - [0x048] =3D 'i', - [0x04a] =3D 'v', - [0x04c] =3D 'e', - [0x04e] =3D 0x00, - [0x050] =3D CISTPL_ENDMARK, - - [0x052] =3D CISTPL_FUNCID, /* Function ID */ - [0x054] =3D 0x02, /* Tuple length =3D 2 bytes */ - [0x056] =3D 0x04, /* TPLFID_FUNCTION =3D Fixed Disk */ - [0x058] =3D 0x01, /* TPLFID_SYSINIT: POST =3D 1, ROM =3D 0= */ - - [0x05a] =3D CISTPL_FUNCE, /* Function Extension */ - [0x05c] =3D 0x02, /* Tuple length =3D 2 bytes */ - [0x05e] =3D 0x01, /* TPLFE_TYPE =3D Disk Device Interface = */ - [0x060] =3D 0x01, /* TPLFE_DATA =3D PC Card ATA Interface = */ - - [0x062] =3D CISTPL_FUNCE, /* Function Extension */ - [0x064] =3D 0x03, /* Tuple length =3D 3 bytes */ - [0x066] =3D 0x02, /* TPLFE_TYPE =3D Basic PC Card ATA Inte= rface */ - [0x068] =3D 0x08, /* TPLFE_DATA: Rotating, Unique, Single = */ - [0x06a] =3D 0x0f, /* TPLFE_DATA: Sleep, Standby, Idle, Aut= o */ - - [0x06c] =3D CISTPL_CONFIG, /* Configuration */ - [0x06e] =3D 0x05, /* Tuple length =3D 5 bytes */ - [0x070] =3D 0x01, /* TPCC_RASZ =3D 2 bytes, TPCC_RMSZ =3D = 1 byte */ - [0x072] =3D 0x07, /* TPCC_LAST =3D 7 */ - [0x074] =3D 0x00, /* TPCC_RADR =3D 0200 */ - [0x076] =3D 0x02, - [0x078] =3D 0x0f, /* TPCC_RMSK =3D 200, 202, 204, 206 */ - - [0x07a] =3D CISTPL_CFTABLE_ENTRY, /* 16-bit PC Card Configuration */ - [0x07c] =3D 0x0b, /* Tuple length =3D 11 bytes */ - [0x07e] =3D 0xc0, /* TPCE_INDX =3D Memory Mode, Default, I= face */ - [0x080] =3D 0xc0, /* TPCE_IF =3D Memory, no BVDs, no WP, R= EADY */ - [0x082] =3D 0xa1, /* TPCE_FS =3D Vcc only, no I/O, Memory,= Misc */ - [0x084] =3D 0x27, /* NomV =3D 1, MinV =3D 1, MaxV =3D 1, P= eakl =3D 1 */ - [0x086] =3D 0x55, /* NomV: 5.0 V */ - [0x088] =3D 0x4d, /* MinV: 4.5 V */ - [0x08a] =3D 0x5d, /* MaxV: 5.5 V */ - [0x08c] =3D 0x4e, /* Peakl: 450 mA */ - [0x08e] =3D 0x08, /* TPCE_MS =3D 1 window, 1 byte, Host ad= dress */ - [0x090] =3D 0x00, /* Window descriptor: Window length =3D = 0 */ - [0x092] =3D 0x20, /* TPCE_MI: support power down mode, RW = */ - - [0x094] =3D CISTPL_CFTABLE_ENTRY, /* 16-bit PC Card Configuration */ - [0x096] =3D 0x06, /* Tuple length =3D 6 bytes */ - [0x098] =3D 0x00, /* TPCE_INDX =3D Memory Mode, no Default= */ - [0x09a] =3D 0x01, /* TPCE_FS =3D Vcc only, no I/O, no Memo= ry */ - [0x09c] =3D 0x21, /* NomV =3D 1, MinV =3D 0, MaxV =3D 0, P= eakl =3D 1 */ - [0x09e] =3D 0xb5, /* NomV: 3.3 V */ - [0x0a0] =3D 0x1e, - [0x0a2] =3D 0x3e, /* Peakl: 350 mA */ - - [0x0a4] =3D CISTPL_CFTABLE_ENTRY, /* 16-bit PC Card Configuration */ - [0x0a6] =3D 0x0d, /* Tuple length =3D 13 bytes */ - [0x0a8] =3D 0xc1, /* TPCE_INDX =3D I/O and Memory Mode, De= fault */ - [0x0aa] =3D 0x41, /* TPCE_IF =3D I/O and Memory, no BVD, n= o WP */ - [0x0ac] =3D 0x99, /* TPCE_FS =3D Vcc only, I/O, Interrupt,= Misc */ - [0x0ae] =3D 0x27, /* NomV =3D 1, MinV =3D 1, MaxV =3D 1, P= eakl =3D 1 */ - [0x0b0] =3D 0x55, /* NomV: 5.0 V */ - [0x0b2] =3D 0x4d, /* MinV: 4.5 V */ - [0x0b4] =3D 0x5d, /* MaxV: 5.5 V */ - [0x0b6] =3D 0x4e, /* Peakl: 450 mA */ - [0x0b8] =3D 0x64, /* TPCE_IO =3D 16-byte boundary, 16/8 ac= cesses */ - [0x0ba] =3D 0xf0, /* TPCE_IR =3D MASK, Level, Pulse, Shar= e */ - [0x0bc] =3D 0xff, /* IRQ0..IRQ7 supported */ - [0x0be] =3D 0xff, /* IRQ8..IRQ15 supported */ - [0x0c0] =3D 0x20, /* TPCE_MI =3D support power down mode */ - - [0x0c2] =3D CISTPL_CFTABLE_ENTRY, /* 16-bit PC Card Configuration */ - [0x0c4] =3D 0x06, /* Tuple length =3D 6 bytes */ - [0x0c6] =3D 0x01, /* TPCE_INDX =3D I/O and Memory Mode */ - [0x0c8] =3D 0x01, /* TPCE_FS =3D Vcc only, no I/O, no Memo= ry */ - [0x0ca] =3D 0x21, /* NomV =3D 1, MinV =3D 0, MaxV =3D 0, P= eakl =3D 1 */ - [0x0cc] =3D 0xb5, /* NomV: 3.3 V */ - [0x0ce] =3D 0x1e, - [0x0d0] =3D 0x3e, /* Peakl: 350 mA */ - - [0x0d2] =3D CISTPL_CFTABLE_ENTRY, /* 16-bit PC Card Configuration */ - [0x0d4] =3D 0x12, /* Tuple length =3D 18 bytes */ - [0x0d6] =3D 0xc2, /* TPCE_INDX =3D I/O Primary Mode */ - [0x0d8] =3D 0x41, /* TPCE_IF =3D I/O and Memory, no BVD, n= o WP */ - [0x0da] =3D 0x99, /* TPCE_FS =3D Vcc only, I/O, Interrupt,= Misc */ - [0x0dc] =3D 0x27, /* NomV =3D 1, MinV =3D 1, MaxV =3D 1, P= eakl =3D 1 */ - [0x0de] =3D 0x55, /* NomV: 5.0 V */ - [0x0e0] =3D 0x4d, /* MinV: 4.5 V */ - [0x0e2] =3D 0x5d, /* MaxV: 5.5 V */ - [0x0e4] =3D 0x4e, /* Peakl: 450 mA */ - [0x0e6] =3D 0xea, /* TPCE_IO =3D 1K boundary, 16/8 access,= Range */ - [0x0e8] =3D 0x61, /* Range: 2 fields, 2 bytes addr, 1 byte= len */ - [0x0ea] =3D 0xf0, /* Field 1 address =3D 0x01f0 */ - [0x0ec] =3D 0x01, - [0x0ee] =3D 0x07, /* Address block length =3D 8 */ - [0x0f0] =3D 0xf6, /* Field 2 address =3D 0x03f6 */ - [0x0f2] =3D 0x03, - [0x0f4] =3D 0x01, /* Address block length =3D 2 */ - [0x0f6] =3D 0xee, /* TPCE_IR =3D IRQ E, Level, Pulse, Shar= e */ - [0x0f8] =3D 0x20, /* TPCE_MI =3D support power down mode */ - - [0x0fa] =3D CISTPL_CFTABLE_ENTRY, /* 16-bit PC Card Configuration */ - [0x0fc] =3D 0x06, /* Tuple length =3D 6 bytes */ - [0x0fe] =3D 0x02, /* TPCE_INDX =3D I/O Primary Mode, no De= fault */ - [0x100] =3D 0x01, /* TPCE_FS =3D Vcc only, no I/O, no Memo= ry */ - [0x102] =3D 0x21, /* NomV =3D 1, MinV =3D 0, MaxV =3D 0, P= eakl =3D 1 */ - [0x104] =3D 0xb5, /* NomV: 3.3 V */ - [0x106] =3D 0x1e, - [0x108] =3D 0x3e, /* Peakl: 350 mA */ - - [0x10a] =3D CISTPL_CFTABLE_ENTRY, /* 16-bit PC Card Configuration */ - [0x10c] =3D 0x12, /* Tuple length =3D 18 bytes */ - [0x10e] =3D 0xc3, /* TPCE_INDX =3D I/O Secondary Mode, Def= ault */ - [0x110] =3D 0x41, /* TPCE_IF =3D I/O and Memory, no BVD, n= o WP */ - [0x112] =3D 0x99, /* TPCE_FS =3D Vcc only, I/O, Interrupt,= Misc */ - [0x114] =3D 0x27, /* NomV =3D 1, MinV =3D 1, MaxV =3D 1, P= eakl =3D 1 */ - [0x116] =3D 0x55, /* NomV: 5.0 V */ - [0x118] =3D 0x4d, /* MinV: 4.5 V */ - [0x11a] =3D 0x5d, /* MaxV: 5.5 V */ - [0x11c] =3D 0x4e, /* Peakl: 450 mA */ - [0x11e] =3D 0xea, /* TPCE_IO =3D 1K boundary, 16/8 access,= Range */ - [0x120] =3D 0x61, /* Range: 2 fields, 2 byte addr, 1 byte = len */ - [0x122] =3D 0x70, /* Field 1 address =3D 0x0170 */ - [0x124] =3D 0x01, - [0x126] =3D 0x07, /* Address block length =3D 8 */ - [0x128] =3D 0x76, /* Field 2 address =3D 0x0376 */ - [0x12a] =3D 0x03, - [0x12c] =3D 0x01, /* Address block length =3D 2 */ - [0x12e] =3D 0xee, /* TPCE_IR =3D IRQ E, Level, Pulse, Shar= e */ - [0x130] =3D 0x20, /* TPCE_MI =3D support power down mode */ - - [0x132] =3D CISTPL_CFTABLE_ENTRY, /* 16-bit PC Card Configuration */ - [0x134] =3D 0x06, /* Tuple length =3D 6 bytes */ - [0x136] =3D 0x03, /* TPCE_INDX =3D I/O Secondary Mode */ - [0x138] =3D 0x01, /* TPCE_FS =3D Vcc only, no I/O, no Memo= ry */ - [0x13a] =3D 0x21, /* NomV =3D 1, MinV =3D 0, MaxV =3D 0, P= eakl =3D 1 */ - [0x13c] =3D 0xb5, /* NomV: 3.3 V */ - [0x13e] =3D 0x1e, - [0x140] =3D 0x3e, /* Peakl: 350 mA */ - - [0x142] =3D CISTPL_NO_LINK, /* No Link */ - [0x144] =3D 0x00, /* Tuple length =3D 0 bytes */ - - [0x146] =3D CISTPL_END, /* Tuple End */ -}; - -#define TYPE_DSCM1XXXX "dscm1xxxx" - -static int dscm1xxxx_attach(PCMCIACardState *card) -{ - MicroDriveState *md =3D MICRODRIVE(card); - PCMCIACardClass *pcc =3D PCMCIA_CARD_GET_CLASS(card); - - md->attr_base =3D pcc->cis[0x74] | (pcc->cis[0x76] << 8); - md->io_base =3D 0x0; - - device_cold_reset(DEVICE(md)); - md_interrupt_update(md); - - return 0; -} - -static int dscm1xxxx_detach(PCMCIACardState *card) -{ - MicroDriveState *md =3D MICRODRIVE(card); - - device_cold_reset(DEVICE(md)); - return 0; -} - -PCMCIACardState *dscm1xxxx_init(DriveInfo *dinfo) -{ - MicroDriveState *md; - - md =3D MICRODRIVE(object_new(TYPE_DSCM1XXXX)); - qdev_realize(DEVICE(md), NULL, &error_fatal); - - if (dinfo !=3D NULL) { - ide_bus_create_drive(&md->bus, 0, dinfo); - } - md->bus.ifs[0].drive_kind =3D IDE_CFATA; - md->bus.ifs[0].mdata_size =3D METADATA_SIZE; - md->bus.ifs[0].mdata_storage =3D g_malloc0(METADATA_SIZE); - - return PCMCIA_CARD(md); -} - -static void dscm1xxxx_class_init(ObjectClass *oc, void *data) -{ - PCMCIACardClass *pcc =3D PCMCIA_CARD_CLASS(oc); - DeviceClass *dc =3D DEVICE_CLASS(oc); - - pcc->cis =3D dscm1xxxx_cis; - pcc->cis_len =3D sizeof(dscm1xxxx_cis); - - pcc->attach =3D dscm1xxxx_attach; - pcc->detach =3D dscm1xxxx_detach; - /* Reason: Needs to be wired-up in code, see dscm1xxxx_init() */ - dc->user_creatable =3D false; -} - -static const TypeInfo dscm1xxxx_type_info =3D { - .name =3D TYPE_DSCM1XXXX, - .parent =3D TYPE_MICRODRIVE, - .class_init =3D dscm1xxxx_class_init, -}; - -static void microdrive_realize(DeviceState *dev, Error **errp) -{ - MicroDriveState *md =3D MICRODRIVE(dev); - - ide_bus_init_output_irq(&md->bus, qemu_allocate_irq(md_set_irq, md, 0)= ); -} - -static void microdrive_init(Object *obj) -{ - MicroDriveState *md =3D MICRODRIVE(obj); - - ide_bus_init(&md->bus, sizeof(md->bus), DEVICE(obj), 0, 1); -} - -static void microdrive_class_init(ObjectClass *oc, void *data) -{ - DeviceClass *dc =3D DEVICE_CLASS(oc); - PCMCIACardClass *pcc =3D PCMCIA_CARD_CLASS(oc); - - pcc->attr_read =3D md_attr_read; - pcc->attr_write =3D md_attr_write; - pcc->common_read =3D md_common_read; - pcc->common_write =3D md_common_write; - pcc->io_read =3D md_common_read; - pcc->io_write =3D md_common_write; - - dc->realize =3D microdrive_realize; - device_class_set_legacy_reset(dc, md_reset); - dc->vmsd =3D &vmstate_microdrive; -} - -static const TypeInfo microdrive_type_info =3D { - .name =3D TYPE_MICRODRIVE, - .parent =3D TYPE_PCMCIA_CARD, - .instance_size =3D sizeof(MicroDriveState), - .instance_init =3D microdrive_init, - .abstract =3D true, - .class_init =3D microdrive_class_init, -}; - -static void microdrive_register_types(void) -{ - type_register_static(µdrive_type_info); - type_register_static(&dscm1xxxx_type_info); -} - -type_init(microdrive_register_types) diff --git a/hw/ide/Kconfig b/hw/ide/Kconfig index 6dfc5a21292..2e22b677da3 100644 --- a/hw/ide/Kconfig +++ b/hw/ide/Kconfig @@ -43,12 +43,6 @@ config IDE_VIA bool select IDE_PCI =20 -config MICRODRIVE - bool - select IDE_BUS - select IDE_DEV - depends on PCMCIA - config AHCI bool select IDE_BUS diff --git a/hw/ide/meson.build b/hw/ide/meson.build index d09705cac03..90ea8614233 100644 --- a/hw/ide/meson.build +++ b/hw/ide/meson.build @@ -13,4 +13,3 @@ system_ss.add(when: 'CONFIG_IDE_PCI', if_true: files('pci= .c')) system_ss.add(when: 'CONFIG_IDE_PIIX', if_true: files('piix.c', 'ioport.c'= )) system_ss.add(when: 'CONFIG_IDE_SII3112', if_true: files('sii3112.c')) system_ss.add(when: 'CONFIG_IDE_VIA', if_true: files('via.c')) -system_ss.add(when: 'CONFIG_MICRODRIVE', if_true: files('microdrive.c')) --=20 2.34.1 From nobody Sat Nov 23 22:39:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1727964167; cv=none; d=zohomail.com; s=zohoarc; b=m0O0XpgMo7mnIJ0RMvU+Zd7Q4YOl6qEmBQwaXsXVI2o+kqhslsfeCbB44SWU/y+2FwbvBEEwvPD7cIYFfmKTPFAl1i99raeTM7irpwnfSIS2KSYEYfiZwRWq7stmFkQu+sokI+1G4YZ0gweJ5kY7Q3fFp5UcSwp+APyCEkK2JQw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727964167; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Em52MAkD+Yby6Vik40PbgLdJ9+Dl1OUfHlmPxxRRT14=; b=i9Zy2ylfFyQMqHT1KgGRUVohh8GhQo7PcjwkD8HzPBnBWMGDXWZ7VjdzZ3x0qUSZwxBCMk6fziISMJRHscnlrhShP4hSQVF1RDRRqoqG7BGDXVBi69XlymE+6i27UnM12aKujw9N5dc9bnboumDPX3qEmYwtcgglD8+4x+Mn2W4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 172796416703440.91333030499766; Thu, 3 Oct 2024 07:02:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1swMNy-0004CA-02; Thu, 03 Oct 2024 10:00:54 -0400 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 1swMNQ-00046v-Ha for qemu-devel@nongnu.org; Thu, 03 Oct 2024 10:00:25 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1swMNN-0002rN-5C for qemu-devel@nongnu.org; Thu, 03 Oct 2024 10:00:18 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-42e82f7f36aso8917605e9.0 for ; Thu, 03 Oct 2024 07:00:16 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d0822bc38sm1340255f8f.45.2024.10.03.07.00.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 07:00:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727964015; x=1728568815; darn=nongnu.org; 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=Em52MAkD+Yby6Vik40PbgLdJ9+Dl1OUfHlmPxxRRT14=; b=pFfbfhQYzGmlgqxBbT7lJXGxLH+daErznLZNrunVGKQmKS7InU/4ETCyywrvRcsn2t 35HajqC9ghVLfZEAsJjyyHEGYqI7OFQimE0RnqnXdrUXFHAOAv90lnmRq0hHLu57r5ck ooy8qiK1YM4NfdHy5HyeIaC0MOkAxBzruOL+yb8aKPxAJsqfsRZI+LL56N9L0TNVwjqk LzFA1GKV0dU9wOhUE91k6rTy+Y71R5LY3beJxGzr4jgsgBofQQluRvaoAXoQeRSm51i1 asLygn37JB3ODmKGZXyT5qNMRNzXEJddJVOPQ09QYu5x83Bo8RiFlhTN9jHaj99D+x9n MIMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727964015; x=1728568815; 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=Em52MAkD+Yby6Vik40PbgLdJ9+Dl1OUfHlmPxxRRT14=; b=bvcMzk9Vg58u0WJY3B97mXwzIisTT83+/qR8Tb9S/kCgR90sSflTMwi7XAMPto6eM5 hbjN1pUGJ6zmr5RtiuGcyLHt3ythlmD/G26dn54Kg3XuLWvfz3wDI2hZ7C4LQpbRRv17 EkrGN06RioGc+DrynBv9bUqbOJc2Brpb+qKsDCGirVQTjDCYVTIWTpwZSvmH+QGM0iDt n2gbLvo4Qji8USm83Cjo+a3zqMYrAi0YAn5Xy0j3BsTK4i54SVRmbSur29Ea2vJyhcrg Oj7kEq+TKlJfsKVubiZN1bvqR04ZQdzGnoVqxK77AjYYBioBq7sd9mvRYffxE0kaIXFT IfGw== X-Forwarded-Encrypted: i=1; AJvYcCX7X9iF5rlNjW+hlQdr3C/9B3HCrTCdL2+tKI4/Dcg34ZCLI3xduDvqjfRTDHbJvt9BlEe0NVuaKCfI@nongnu.org X-Gm-Message-State: AOJu0YyWa1KHXQPUzJ4Y8Qv/UHI22ilHXQrOR7kRvOyXzucYxGNhJBet RlmpTWGBbCUgrYgGahK6eRKEAjEo8ioYzybA87nxX6Uhq7DWcndCzlgFpcu3uwU= X-Google-Smtp-Source: AGHT+IFgnblJ9IOPG22PgA+NACNlSXqR+nUR+ELaK5XQOtVAfByIaVfyFNcygOi+SH15xWZP9jHJDg== X-Received: by 2002:adf:978a:0:b0:37c:ce45:96f2 with SMTP id ffacd0b85a97d-37cfba07a8emr3648176f8f.50.1727964015485; Thu, 03 Oct 2024 07:00:15 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Guenter Roeck , Paolo Bonzini Subject: [PATCH v2 4/6] hw: Remove PCMCIA subsystem Date: Thu, 3 Oct 2024 15:00:08 +0100 Message-Id: <20241003140010.1653808-5-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241003140010.1653808-1-peter.maydell@linaro.org> References: <20241003140010.1653808-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x331.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=ham 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1727964167779116600 The only PCMCIA subsystem was the PXA2xx SoC and the machines using it, which have now been removed. Although in theory we have a few machine types which have PCMCIA (e.g. kzm, the strongarm machines, sh4's sh7750), none of those machines implement their PCMCIA controller, and they're all old and no longer very interesting machine types. Rather than keeping all the PCMCIA code in-tree without any active users of it, delete it. If we need PCMCIA in future we can always resurrect it. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- include/hw/pcmcia.h | 63 ------------------------------------------- hw/pcmcia/pcmcia.c | 24 ----------------- hw/Kconfig | 1 - hw/meson.build | 1 - hw/pcmcia/Kconfig | 2 -- hw/pcmcia/meson.build | 1 - 6 files changed, 92 deletions(-) delete mode 100644 include/hw/pcmcia.h delete mode 100644 hw/pcmcia/pcmcia.c delete mode 100644 hw/pcmcia/Kconfig delete mode 100644 hw/pcmcia/meson.build diff --git a/include/hw/pcmcia.h b/include/hw/pcmcia.h deleted file mode 100644 index 6c08ad616a5..00000000000 --- a/include/hw/pcmcia.h +++ /dev/null @@ -1,63 +0,0 @@ -#ifndef HW_PCMCIA_H -#define HW_PCMCIA_H - -/* PCMCIA/Cardbus */ - -#include "hw/qdev-core.h" -#include "qom/object.h" - -typedef struct PCMCIASocket { - qemu_irq irq; - bool attached; -} PCMCIASocket; - -#define TYPE_PCMCIA_CARD "pcmcia-card" -OBJECT_DECLARE_TYPE(PCMCIACardState, PCMCIACardClass, PCMCIA_CARD) - -struct PCMCIACardState { - /*< private >*/ - DeviceState parent_obj; - /*< public >*/ - - PCMCIASocket *slot; -}; - -struct PCMCIACardClass { - /*< private >*/ - DeviceClass parent_class; - /*< public >*/ - - int (*attach)(PCMCIACardState *state); - int (*detach)(PCMCIACardState *state); - - const uint8_t *cis; - int cis_len; - - /* Only valid if attached */ - uint8_t (*attr_read)(PCMCIACardState *card, uint32_t address); - void (*attr_write)(PCMCIACardState *card, uint32_t address, uint8_t va= lue); - uint16_t (*common_read)(PCMCIACardState *card, uint32_t address); - void (*common_write)(PCMCIACardState *card, - uint32_t address, uint16_t value); - uint16_t (*io_read)(PCMCIACardState *card, uint32_t address); - void (*io_write)(PCMCIACardState *card, uint32_t address, uint16_t val= ue); -}; - -#define CISTPL_DEVICE 0x01 /* 5V Device Information Tuple */ -#define CISTPL_NO_LINK 0x14 /* No Link Tuple */ -#define CISTPL_VERS_1 0x15 /* Level 1 Version Tuple */ -#define CISTPL_JEDEC_C 0x18 /* JEDEC ID Tuple */ -#define CISTPL_JEDEC_A 0x19 /* JEDEC ID Tuple */ -#define CISTPL_CONFIG 0x1a /* Configuration Tuple */ -#define CISTPL_CFTABLE_ENTRY 0x1b /* 16-bit PCCard Configuration */ -#define CISTPL_DEVICE_OC 0x1c /* Additional Device Information */ -#define CISTPL_DEVICE_OA 0x1d /* Additional Device Information */ -#define CISTPL_DEVICE_GEO 0x1e /* Additional Device Information */ -#define CISTPL_DEVICE_GEO_A 0x1f /* Additional Device Information */ -#define CISTPL_MANFID 0x20 /* Manufacture ID Tuple */ -#define CISTPL_FUNCID 0x21 /* Function ID Tuple */ -#define CISTPL_FUNCE 0x22 /* Function Extension Tuple */ -#define CISTPL_END 0xff /* Tuple End */ -#define CISTPL_ENDMARK 0xff - -#endif diff --git a/hw/pcmcia/pcmcia.c b/hw/pcmcia/pcmcia.c deleted file mode 100644 index 03d13e7d670..00000000000 --- a/hw/pcmcia/pcmcia.c +++ /dev/null @@ -1,24 +0,0 @@ -/* - * PCMCIA emulation - * - * Copyright 2013 SUSE LINUX Products GmbH - */ - -#include "qemu/osdep.h" -#include "qemu/module.h" -#include "hw/pcmcia.h" - -static const TypeInfo pcmcia_card_type_info =3D { - .name =3D TYPE_PCMCIA_CARD, - .parent =3D TYPE_DEVICE, - .instance_size =3D sizeof(PCMCIACardState), - .abstract =3D true, - .class_size =3D sizeof(PCMCIACardClass), -}; - -static void pcmcia_register_types(void) -{ - type_register_static(&pcmcia_card_type_info); -} - -type_init(pcmcia_register_types) diff --git a/hw/Kconfig b/hw/Kconfig index 6fdaff1b1be..1b4e9bb07f7 100644 --- a/hw/Kconfig +++ b/hw/Kconfig @@ -27,7 +27,6 @@ source nvme/Kconfig source nvram/Kconfig source pci-bridge/Kconfig source pci-host/Kconfig -source pcmcia/Kconfig source pci/Kconfig source remote/Kconfig source rtc/Kconfig diff --git a/hw/meson.build b/hw/meson.build index e86badc5417..b827c82c5d7 100644 --- a/hw/meson.build +++ b/hw/meson.build @@ -27,7 +27,6 @@ subdir('nvram') subdir('pci') subdir('pci-bridge') subdir('pci-host') -subdir('pcmcia') subdir('rtc') subdir('scsi') subdir('sd') diff --git a/hw/pcmcia/Kconfig b/hw/pcmcia/Kconfig deleted file mode 100644 index 41f2df91366..00000000000 --- a/hw/pcmcia/Kconfig +++ /dev/null @@ -1,2 +0,0 @@ -config PCMCIA - bool diff --git a/hw/pcmcia/meson.build b/hw/pcmcia/meson.build deleted file mode 100644 index edcb7f5d263..00000000000 --- a/hw/pcmcia/meson.build +++ /dev/null @@ -1 +0,0 @@ -system_ss.add(when: 'CONFIG_PCMCIA', if_true: files('pcmcia.c')) --=20 2.34.1 From nobody Sat Nov 23 22:39:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1727964120; cv=none; d=zohomail.com; s=zohoarc; b=d40GXLex/4a9b1iklWRdwK4I1Qcb5B5CrrVUUixFKupvQWVDFSPZZTfg/l9bb97+U08mPAr89zr60yQG1eTy5diJ824R1GTphwRdSO9gn9lqknDTXH231/v3xFtVYAfGWa5gm9hV4RwxRsB2lxgzgTVisp3BbE+HNyyMzgRiRA8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727964120; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=LPD0ziR8yfL/HjZu6b/yEmmqErN3Sv3BQp33o6QEumo=; b=EKskD7nFXvJ0Tr49/nceAxFHHtcC86yzfBVCU8LKDVDrYmpKQBhwgsp6RjVB8EaYeHLqo17RyqCnEtofoMsq70L3l3Fi+3ocUFJKDEMLN0XXZ1MxduWseK3gISVtGwTxT3iFOIQk/PjiAYOge35Afs4UZS8/QPMinf2RcsCnZJs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1727964120706158.54886915569682; Thu, 3 Oct 2024 07:02:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1swMOC-0004Lf-EN; Thu, 03 Oct 2024 10:01:08 -0400 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 1swMNQ-000471-NU for qemu-devel@nongnu.org; Thu, 03 Oct 2024 10:00:25 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1swMNO-0002rV-Af for qemu-devel@nongnu.org; Thu, 03 Oct 2024 10:00:20 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-37ccd81de57so617229f8f.0 for ; Thu, 03 Oct 2024 07:00:17 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d0822bc38sm1340255f8f.45.2024.10.03.07.00.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 07:00:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727964016; x=1728568816; darn=nongnu.org; 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=LPD0ziR8yfL/HjZu6b/yEmmqErN3Sv3BQp33o6QEumo=; b=paSZkejcLJehhIKtxeAm7c6dbsEA+0qHftsZSbuKCTOOt2h23ReqjdvnTr459qqFas TJ6RFkql2+9bZs3+AwImySZZr4kuZsGUwxzVR/ikY5yQTCpHeWhbyT4dpu4+FFt06Gfx 8GYfOy4/eeL1b48CCoJbucAl/E1aDZOQPB+7eQsF8qUbnjOCbkv/oUPGcljLXUwQ0mmo 0Lh+S1A2ZKwGgVJMDVz8BQuki+EYEdUa3kaLzsdySnBhoIckdR7do1RKoh8MYcb2lszJ ZKUrXRfb/JhFB/Fy8XJ64qxVrQhVaUb76T20iiTqGOAdi9Bs46yFJTmmQW3NptT1RIkX qcyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727964016; x=1728568816; 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=LPD0ziR8yfL/HjZu6b/yEmmqErN3Sv3BQp33o6QEumo=; b=cjkHQ7Jx6flfQLZON+hbs52XsIM3sKXaunGjnhVt+0GvAftLeLUcC3eYxdNe6vOwD+ IpJUImSrabxkJYoFtUiaTLLzvyttyR8MbdsU7CVoPRSqDRLsBLTbdfWqd6OeQOWxi8+r w4ethW1ClEL0yG624enIPJDujiax8xI8PmXG5Ds9Kdlu85D/OZcdMbZ4mkE3dqJ75p8H kcLC1YgWGLwFRIi1ka/kkuWqCdfYrkDYNXFistfmDmTG9nD/hdUjdFgSR3dOsLOLo7U7 ZBNQHrc+bYa0lUHxXU33okhuN543NfEl1BOh9nEGFeoxTeMqzWQdquf0DP1aeJUaDEVW P/VQ== X-Forwarded-Encrypted: i=1; AJvYcCVKO71mNCBpQ6qo8AM3s3odT4B0M/YtXVSoa/v/NgY8+W4kP7mwnE52v2mY+YDW1v7Zdsh4pa9JwZzZ@nongnu.org X-Gm-Message-State: AOJu0Yx9n0Mb9/lcBk80LGRdKIhFuZ7BA908flw2eFBAsiTM+/H63CN/ B2GJ4QxkbqVxbJIw93Vhc3KKQyJB/r5FHs86xi1mXtkHeY7Vboila6g7ydRjRck= X-Google-Smtp-Source: AGHT+IH5Z0RKAGC5X2uA0/Qz4r3miR4YAsUlg8Gozod07a36v2WxqNiXC10l952fNrLtXzgkADKkLw== X-Received: by 2002:adf:a30d:0:b0:37c:f561:1130 with SMTP id ffacd0b85a97d-37d04a04aa2mr2286429f8f.18.1727964016185; Thu, 03 Oct 2024 07:00:16 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Guenter Roeck , Paolo Bonzini Subject: [PATCH v2 5/6] hw/block: Remove ecc Date: Thu, 3 Oct 2024 15:00:09 +0100 Message-Id: <20241003140010.1653808-6-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241003140010.1653808-1-peter.maydell@linaro.org> References: <20241003140010.1653808-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42e.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=ham 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1727964123899116600 Content-Type: text/plain; charset="utf-8" The ecc.c code was used only by the PXA2xx and OMAP2 SoC devices, which we have removed, so it is now completely unused. Note that hw/misc/eccmemctl.c does not in fact use any of the code frome ecc.c, so that KConfig dependency was incorrect. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- include/hw/block/flash.h | 11 ----- hw/block/ecc.c | 91 ---------------------------------------- hw/arm/Kconfig | 1 - hw/block/Kconfig | 3 -- hw/block/meson.build | 1 - hw/misc/Kconfig | 1 - 6 files changed, 108 deletions(-) delete mode 100644 hw/block/ecc.c diff --git a/include/hw/block/flash.h b/include/hw/block/flash.h index b985c825a01..5fd67f5bb79 100644 --- a/include/hw/block/flash.h +++ b/include/hw/block/flash.h @@ -62,17 +62,6 @@ uint32_t nand_getbuswidth(DeviceState *dev); #define NAND_MFR_HYNIX 0xad #define NAND_MFR_MICRON 0x2c =20 -/* ecc.c */ -typedef struct { - uint8_t cp; /* Column parity */ - uint16_t lp[2]; /* Line parity */ - uint16_t count; -} ECCState; - -uint8_t ecc_digest(ECCState *s, uint8_t sample); -void ecc_reset(ECCState *s); -extern const VMStateDescription vmstate_ecc_state; - /* m25p80.c */ =20 #define TYPE_M25P80 "m25p80-generic" diff --git a/hw/block/ecc.c b/hw/block/ecc.c deleted file mode 100644 index ed889a4184f..00000000000 --- a/hw/block/ecc.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Calculate Error-correcting Codes. Used by NAND Flash controllers - * (not by NAND chips). - * - * Copyright (c) 2006 Openedhand Ltd. - * Written by Andrzej Zaborowski - * - * This code is licensed under the GNU GPL v2. - * - * Contributions after 2012-01-13 are licensed under the terms of the - * GNU GPL, version 2 or (at your option) any later version. - */ - -#include "qemu/osdep.h" -#include "migration/vmstate.h" -#include "hw/block/flash.h" - -/* - * Pre-calculated 256-way 1 byte column parity. Table borrowed from Linux. - */ -static const uint8_t nand_ecc_precalc_table[] =3D { - 0x00, 0x55, 0x56, 0x03, 0x59, 0x0c, 0x0f, 0x5a, - 0x5a, 0x0f, 0x0c, 0x59, 0x03, 0x56, 0x55, 0x00, - 0x65, 0x30, 0x33, 0x66, 0x3c, 0x69, 0x6a, 0x3f, - 0x3f, 0x6a, 0x69, 0x3c, 0x66, 0x33, 0x30, 0x65, - 0x66, 0x33, 0x30, 0x65, 0x3f, 0x6a, 0x69, 0x3c, - 0x3c, 0x69, 0x6a, 0x3f, 0x65, 0x30, 0x33, 0x66, - 0x03, 0x56, 0x55, 0x00, 0x5a, 0x0f, 0x0c, 0x59, - 0x59, 0x0c, 0x0f, 0x5a, 0x00, 0x55, 0x56, 0x03, - 0x69, 0x3c, 0x3f, 0x6a, 0x30, 0x65, 0x66, 0x33, - 0x33, 0x66, 0x65, 0x30, 0x6a, 0x3f, 0x3c, 0x69, - 0x0c, 0x59, 0x5a, 0x0f, 0x55, 0x00, 0x03, 0x56, - 0x56, 0x03, 0x00, 0x55, 0x0f, 0x5a, 0x59, 0x0c, - 0x0f, 0x5a, 0x59, 0x0c, 0x56, 0x03, 0x00, 0x55, - 0x55, 0x00, 0x03, 0x56, 0x0c, 0x59, 0x5a, 0x0f, - 0x6a, 0x3f, 0x3c, 0x69, 0x33, 0x66, 0x65, 0x30, - 0x30, 0x65, 0x66, 0x33, 0x69, 0x3c, 0x3f, 0x6a, - 0x6a, 0x3f, 0x3c, 0x69, 0x33, 0x66, 0x65, 0x30, - 0x30, 0x65, 0x66, 0x33, 0x69, 0x3c, 0x3f, 0x6a, - 0x0f, 0x5a, 0x59, 0x0c, 0x56, 0x03, 0x00, 0x55, - 0x55, 0x00, 0x03, 0x56, 0x0c, 0x59, 0x5a, 0x0f, - 0x0c, 0x59, 0x5a, 0x0f, 0x55, 0x00, 0x03, 0x56, - 0x56, 0x03, 0x00, 0x55, 0x0f, 0x5a, 0x59, 0x0c, - 0x69, 0x3c, 0x3f, 0x6a, 0x30, 0x65, 0x66, 0x33, - 0x33, 0x66, 0x65, 0x30, 0x6a, 0x3f, 0x3c, 0x69, - 0x03, 0x56, 0x55, 0x00, 0x5a, 0x0f, 0x0c, 0x59, - 0x59, 0x0c, 0x0f, 0x5a, 0x00, 0x55, 0x56, 0x03, - 0x66, 0x33, 0x30, 0x65, 0x3f, 0x6a, 0x69, 0x3c, - 0x3c, 0x69, 0x6a, 0x3f, 0x65, 0x30, 0x33, 0x66, - 0x65, 0x30, 0x33, 0x66, 0x3c, 0x69, 0x6a, 0x3f, - 0x3f, 0x6a, 0x69, 0x3c, 0x66, 0x33, 0x30, 0x65, - 0x00, 0x55, 0x56, 0x03, 0x59, 0x0c, 0x0f, 0x5a, - 0x5a, 0x0f, 0x0c, 0x59, 0x03, 0x56, 0x55, 0x00, -}; - -/* Update ECC parity count. */ -uint8_t ecc_digest(ECCState *s, uint8_t sample) -{ - uint8_t idx =3D nand_ecc_precalc_table[sample]; - - s->cp ^=3D idx & 0x3f; - if (idx & 0x40) { - s->lp[0] ^=3D ~s->count; - s->lp[1] ^=3D s->count; - } - s->count ++; - - return sample; -} - -/* Reinitialise the counters. */ -void ecc_reset(ECCState *s) -{ - s->lp[0] =3D 0x0000; - s->lp[1] =3D 0x0000; - s->cp =3D 0x00; - s->count =3D 0; -} - -/* Save/restore */ -const VMStateDescription vmstate_ecc_state =3D { - .name =3D "ecc-state", - .version_id =3D 0, - .minimum_version_id =3D 0, - .fields =3D (const VMStateField[]) { - VMSTATE_UINT8(cp, ECCState), - VMSTATE_UINT16_ARRAY(lp, ECCState, 2), - VMSTATE_UINT16(count, ECCState), - VMSTATE_END_OF_LIST(), - }, -}; diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig index a70ceff504b..7b19a9559f6 100644 --- a/hw/arm/Kconfig +++ b/hw/arm/Kconfig @@ -146,7 +146,6 @@ config OMAP bool select FRAMEBUFFER select I2C - select ECC select NAND select PFLASH_CFI01 select SD diff --git a/hw/block/Kconfig b/hw/block/Kconfig index e67a6fd8af7..a898e04f03b 100644 --- a/hw/block/Kconfig +++ b/hw/block/Kconfig @@ -22,9 +22,6 @@ config PFLASH_CFI01 config PFLASH_CFI02 bool =20 -config ECC - bool - config VIRTIO_BLK bool default y diff --git a/hw/block/meson.build b/hw/block/meson.build index 999a93d900f..16a51bf8e21 100644 --- a/hw/block/meson.build +++ b/hw/block/meson.build @@ -3,7 +3,6 @@ system_ss.add(files( 'cdrom.c', 'hd-geometry.c' )) -system_ss.add(when: 'CONFIG_ECC', if_true: files('ecc.c')) system_ss.add(when: 'CONFIG_FDC', if_true: files('fdc.c')) system_ss.add(when: 'CONFIG_FDC_ISA', if_true: files('fdc-isa.c')) system_ss.add(when: 'CONFIG_FDC_SYSBUS', if_true: files('fdc-sysbus.c')) diff --git a/hw/misc/Kconfig b/hw/misc/Kconfig index 1e08785b832..8568aaa2293 100644 --- a/hw/misc/Kconfig +++ b/hw/misc/Kconfig @@ -74,7 +74,6 @@ config IVSHMEM_DEVICE =20 config ECCMEMCTL bool - select ECC =20 config IMX bool --=20 2.34.1 From nobody Sat Nov 23 22:39:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1727964158; cv=none; d=zohomail.com; s=zohoarc; b=J3kg/qRE4Lf2/sQMpsxJZFIO7oEhUDr+lWb8Lv7SD7Bju15APV0si0CC/G6JAnvWuakG3kaN/kFwUzFYchs9pN5rfORGOgJ8FhR1JfNB6R5YbGafl+9YX9GjHUubUqHBGH/Gqrj8iK+IM9Xuvjm+6FRSM1b3v2r8cqhiTGmioj4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727964158; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=/NdtSVHO79et12wC7mRevKMLx4j9u2HZmS8+HJMur2g=; b=GLl+wqz7ifo1n7i0r4PxmxMRBGgZmT9FB1qctnw2eZfC/ahOtdgLj/AHg8jQOcI45ro7BBqJFom35tuLKc4D+hX5j6ck8+urpYA6NsErVJSiOLuUyo3m+R6VB8iDMilVQzubjPa+1cnO4hiYviysxANdtx+CQak25LTp7PHP1kA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1727964158571444.4276105231936; Thu, 3 Oct 2024 07:02:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1swMO8-0004HR-0Y; Thu, 03 Oct 2024 10:01:04 -0400 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 1swMNS-00047E-M7 for qemu-devel@nongnu.org; Thu, 03 Oct 2024 10:00:25 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1swMNQ-0002rn-5l for qemu-devel@nongnu.org; Thu, 03 Oct 2024 10:00:21 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-42cba6cdf32so10200095e9.1 for ; Thu, 03 Oct 2024 07:00:18 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d0822bc38sm1340255f8f.45.2024.10.03.07.00.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 07:00:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727964017; x=1728568817; darn=nongnu.org; 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=/NdtSVHO79et12wC7mRevKMLx4j9u2HZmS8+HJMur2g=; b=Fik2p2y4e8bfjLBLZoePIJA+OcBr5qffo7kBeyD2APPYg19agQI22883QKHqHZg42T F8TK1u7Pq8t6tZbpdTqpuuYzrErmW3O1+BX4jCWrUA1uswWZhuG0MNsjzON+aF/NAXV+ joXjViGMmuNvEd1aauhcnGRK7lQ+xnN0reLBOWx6GOJ91LPSZD3nFnD98dD8MrSSjB6B 85e84d69BVCQmsfSjoCxGveig83QhybmC99UkQYBH4RebJedGfwfaVC/IUC/tYqy7Is0 YxZuiGJmr/We5MMMA4ka07mqScE5o1rNWspAnZJw31nuarBFjjQPu3FLhyP3ZV3R9+C2 eDMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727964017; x=1728568817; 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=/NdtSVHO79et12wC7mRevKMLx4j9u2HZmS8+HJMur2g=; b=OyVfgnLEWCJ9DOHKf2qyu/NkglAzyUPMGD6iqeJmCfNQBvGgxFZTLsw5otTUCM+As3 vu+U2kfjTh96jKLcXy4DBscSj2dfQR2hzGbThpAZaRzzuJFQ0CC0WLydcu8/gXARNNGp yGCq79j+C5mhzy22PMT3stJUk2XzCpBWLdZbJdC3k4zBXBH4F+XzbpaMFQQEQcOiO+k6 4aBJBoOnDX6C0MNn7WcAvV+qpqmyi2pxQAWW3KwOIBMbO5pd2Q6y+80Gsz8rdxFlhR+Z iXZUv2wlsENfKL6wgLbu3h7a8cSu+jg6iGm/I/6dcVp5s6clAtz3tGsrNziUTMppAA3W xmSA== X-Forwarded-Encrypted: i=1; AJvYcCWlHp+H45oWWl3x+/vCjCM+yI0OzOYQzGSpMn6J836XMAfsskiUf+cmIUK2Nt59FXGyZcAqD63GsAK9@nongnu.org X-Gm-Message-State: AOJu0YxvzIzL7COQhxAJdqmvTHBybO/b4xVCpJY42gg5CMiAEYSodt4p ywu34h+Jv3L/zmZ0O7mD8RGrzBX5z0adcLuxkOPRuePbEyIC3H9d9QvEc45gcRY= X-Google-Smtp-Source: AGHT+IGswXIv1ZrcC8pf6aHiyeaC3qhby2ON4qMxtTiQHZn+uCHwdqJEtrpobrH+wIj702j3S5WLLw== X-Received: by 2002:a05:600c:4f10:b0:42c:b5f1:4508 with SMTP id 5b1f17b1804b1-42f778f360emr45374425e9.23.1727964016820; Thu, 03 Oct 2024 07:00:16 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Guenter Roeck , Paolo Bonzini Subject: [PATCH v2 6/6] vl.c: Remove pxa2xx-specific -portrait and -rotate options Date: Thu, 3 Oct 2024 15:00:10 +0100 Message-Id: <20241003140010.1653808-7-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241003140010.1653808-1-peter.maydell@linaro.org> References: <20241003140010.1653808-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x329.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1727964159691116600 Content-Type: text/plain; charset="utf-8" The ``-portrait`` and ``-rotate`` options were documented as only working with the PXA LCD device, and all the machine types using that display device were removed in 9.2. These options were intended to simulate a mobile device being rotated by the user, and had three effects: * the display output was rotated by 90, 180 or 270 degrees (implemented in the PXA display device models) * the mouse/trackpad input was rotated the opposite way (implemented in generic code) * the machine model would signal to the guest about its orientation (implemented by e.g. the spitz machine model) Of these three things, the input-rotation was coded without being restricted to boards which supported the full set of device-rotation handling, so in theory the options were usable on other machine models with odd effects (rotating input but not display output). But this was never intended or documented behaviour, so we can reasonably drop these command line arguments without a formal deprecate-and-drop cycle for them. Remove the options, and their implementation and documentation. Describe the removal in removed-features.rst. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- docs/about/removed-features.rst | 22 ++++++++++++++++++++ include/sysemu/sysemu.h | 1 - system/globals.c | 1 - system/vl.c | 11 ---------- ui/input.c | 36 --------------------------------- qemu-options.hx | 16 --------------- 6 files changed, 22 insertions(+), 65 deletions(-) diff --git a/docs/about/removed-features.rst b/docs/about/removed-features.= rst index 6e96cd067fa..567e653e1d3 100644 --- a/docs/about/removed-features.rst +++ b/docs/about/removed-features.rst @@ -517,6 +517,28 @@ The virtio-blk SCSI passthrough feature is a legacy VI= RTIO feature. VIRTIO 1.0 and later do not support it because the virtio-scsi device was introduced = for full SCSI support. Use virtio-scsi instead when SCSI passthrough is requi= red. =20 +``-portrait`` and ``-rotate`` (since 9.2) +''''''''''''''''''''''''''''''''''''''''' + +The ``-portrait`` and ``-rotate`` options were documented as only +working with the PXA LCD device, and all the machine types using +that display device were removed in 9.2, so these options also +have been dropped. + +These options were intended to simulate a mobile device being +rotated by the user, and had three effects: + +* the display output was rotated by 90, 180 or 270 degrees +* the mouse/trackpad input was rotated the opposite way +* the machine model would signal to the guest about its + orientation + +Of these three things, the input-rotation was coded without being +restricted to boards which supported the full set of device-rotation +handling, so in theory the options were usable on other machine models +to produce an odd effect (rotating input but not display output). But +this was never intended or documented behaviour, so we have dropped +the options along with the machine models they were intended for. =20 User-mode emulator command line arguments ----------------------------------------- diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 5b4397eeb80..7ec419ce132 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -41,7 +41,6 @@ extern int graphic_height; extern int graphic_depth; extern int display_opengl; extern const char *keyboard_layout; -extern int graphic_rotate; extern int old_param; extern uint8_t *boot_splash_filedata; extern bool enable_mlock; diff --git a/system/globals.c b/system/globals.c index d602a04fa28..84ce943ac96 100644 --- a/system/globals.c +++ b/system/globals.c @@ -40,7 +40,6 @@ int autostart =3D 1; int vga_interface_type =3D VGA_NONE; bool vga_interface_created; Chardev *parallel_hds[MAX_PARALLEL_PORTS]; -int graphic_rotate; QEMUOptionRom option_rom[MAX_OPTION_ROMS]; int nb_option_roms; int old_param; diff --git a/system/vl.c b/system/vl.c index fe547ca47c2..e83b3b2608b 100644 --- a/system/vl.c +++ b/system/vl.c @@ -2910,17 +2910,6 @@ void qemu_init(int argc, char **argv) nographic =3D true; dpy.type =3D DISPLAY_TYPE_NONE; break; - case QEMU_OPTION_portrait: - graphic_rotate =3D 90; - break; - case QEMU_OPTION_rotate: - graphic_rotate =3D strtol(optarg, (char **) &optarg, 10); - if (graphic_rotate !=3D 0 && graphic_rotate !=3D 90 && - graphic_rotate !=3D 180 && graphic_rotate !=3D 270) { - error_report("only 90, 180, 270 deg rotation is availa= ble"); - exit(1); - } - break; case QEMU_OPTION_kernel: qdict_put_str(machine_opts_dict, "kernel", optarg); break; diff --git a/ui/input.c b/ui/input.c index dc745860f48..7ddefebc439 100644 --- a/ui/input.c +++ b/ui/input.c @@ -174,37 +174,6 @@ void qmp_input_send_event(const char *device, qemu_input_event_sync(); } =20 -static int qemu_input_transform_invert_abs_value(int value) -{ - return (int64_t)INPUT_EVENT_ABS_MAX - value + INPUT_EVENT_ABS_MIN; -} - -static void qemu_input_transform_abs_rotate(InputEvent *evt) -{ - InputMoveEvent *move =3D evt->u.abs.data; - switch (graphic_rotate) { - case 90: - if (move->axis =3D=3D INPUT_AXIS_X) { - move->axis =3D INPUT_AXIS_Y; - } else if (move->axis =3D=3D INPUT_AXIS_Y) { - move->axis =3D INPUT_AXIS_X; - move->value =3D qemu_input_transform_invert_abs_value(move->va= lue); - } - break; - case 180: - move->value =3D qemu_input_transform_invert_abs_value(move->value); - break; - case 270: - if (move->axis =3D=3D INPUT_AXIS_X) { - move->axis =3D INPUT_AXIS_Y; - move->value =3D qemu_input_transform_invert_abs_value(move->va= lue); - } else if (move->axis =3D=3D INPUT_AXIS_Y) { - move->axis =3D INPUT_AXIS_X; - } - break; - } -} - static void qemu_input_event_trace(QemuConsole *src, InputEvent *evt) { const char *name; @@ -340,11 +309,6 @@ void qemu_input_event_send_impl(QemuConsole *src, Inpu= tEvent *evt) =20 qemu_input_event_trace(src, evt); =20 - /* pre processing */ - if (graphic_rotate && (evt->type =3D=3D INPUT_EVENT_KIND_ABS)) { - qemu_input_transform_abs_rotate(evt); - } - /* send event */ s =3D qemu_input_find_handler(1 << evt->type, src); if (!s) { diff --git a/qemu-options.hx b/qemu-options.hx index d94e2cbbaeb..d013742e4a3 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -2377,22 +2377,6 @@ SRST pick the first available. (Since 2.9) ERST =20 -DEF("portrait", 0, QEMU_OPTION_portrait, - "-portrait rotate graphical output 90 deg left (only PXA LCD)\n", - QEMU_ARCH_ALL) -SRST -``-portrait`` - Rotate graphical output 90 deg left (only PXA LCD). -ERST - -DEF("rotate", HAS_ARG, QEMU_OPTION_rotate, - "-rotate rotate graphical output some deg left (only PXA LCD)\= n", - QEMU_ARCH_ALL) -SRST -``-rotate deg`` - Rotate graphical output some deg left (only PXA LCD). -ERST - DEF("vga", HAS_ARG, QEMU_OPTION_vga, "-vga [std|cirrus|vmware|qxl|xenfb|tcx|cg3|virtio|none]\n" " select video card type\n", QEMU_ARCH_ALL) --=20 2.34.1