From nobody Sun Nov 16 02:44:14 2025 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=quarantine dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1762269747; cv=none; d=zohomail.com; s=zohoarc; b=gG9tlDVb47hZW2Cyrap6dqrxFTgRTfQQJNqHOaGp5i+TgWOWeRzTmJMt2TskBNiIDtlbVM3IKIEj5bxWZW2oxGHGsvlpSkIdABJa01Dhx/QCRqwQvTVt2nisYAnPkDlYXq5hnqYHdjrTptC2zQtSI5ZEKPw1mNlDEio/UsdrGT8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1762269747; 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=6Plrz6WYrVDRjlRfoDY+KPLNGbbBb6YfNR7QMn2ZFvE=; b=iGevz94XSLob0Y5LriiMvu1SIWtnnkRE6baKt8nC67b10wLk1JhQVrUq1D9lrPCng4rvKOsMrFyBTuK2jewimVov15x2484s+p+M9/Bu/Mc9ikkXnpG/pF7yV+NpWGBwyPHRP4bcsyyInJft60ksVewUH+S1IC7DTV692Sjfbds= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1762269747126303.53331618166555; Tue, 4 Nov 2025 07:22:27 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vGIrV-0002Jx-Ox; Tue, 04 Nov 2025 10:22:21 -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 1vGIrU-0002If-Cf for qemu-devel@nongnu.org; Tue, 04 Nov 2025 10:22:20 -0500 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vGIrS-0003xv-1X for qemu-devel@nongnu.org; Tue, 04 Nov 2025 10:22:19 -0500 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id CE5DB43994; Tue, 4 Nov 2025 15:22:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 71E87C116B1; Tue, 4 Nov 2025 15:22:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762269729; bh=5Re0U0XtnMK1OnF1RE48DGzPOaGJ227PY7sND6BN3mA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ng5PFzjE2TqkOdwdrd6lhnahqlOZEiOXh2T9W4YwRpuvhvYdE4GUUME81GcUIbfOS tg9NjaRpA94DHtF6qdW5GUWtI9kixm+9y2jZQH396zYROe0ZGxiwlqriEr2csWj0Es mTYuoCXtWHK+pAb/EHT9jojwSWA6VEMT27DOxAdqssX9UdOzPP2fgeP+0R83vN9rqV pfkGaxTYXEUk39YvyLaiB2e3ZLlo3X5hownyFm9oHZ70kta9xhMIBTaRTqitBNtiUy tHylnIsZ+hy5qUxrI2EL7J5nz3cTh+R9fIs1+A+4EMAmDvVAzZX9WU3wrYU15zFMyc fjdXQ5KURd2bA== From: deller@kernel.org To: qemu-devel@nongnu.org, Richard Henderson Cc: Helge Deller , Jason Wang , Soumyajyotii Ssarkar Subject: [PULL v2 1/3] hw/hppa: Enable LASI i82596 network on 715 machine Date: Tue, 4 Nov 2025 16:22:02 +0100 Message-ID: <20251104152204.6261-2-deller@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251104152204.6261-1-deller@kernel.org> References: <20251104152204.6261-1-deller@kernel.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=2600:3c0a:e001:78e:0:1991:8:25; envelope-from=deller@kernel.org; helo=sea.source.kernel.org X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.788, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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 @kernel.org) X-ZM-MESSAGEID: 1762269752499158500 Content-Type: text/plain; charset="utf-8" From: Helge Deller Enable the i82596 network chip which is included in the LASI multi I/O chip. Since LASI has different start addresses on the various machines, always initialize the LASI components by their offsets. Tested-by: Guenter Roeck Signed-off-by: Soumyajyotii Ssarkar Signed-off-by: Helge Deller --- hw/hppa/hppa_hardware.h | 10 ++-------- hw/hppa/machine.c | 31 +++++++++++++++++-------------- hw/net/lasi_i82596.c | 30 +++++++----------------------- include/hw/net/lasi_82596.h | 3 --- 4 files changed, 26 insertions(+), 48 deletions(-) diff --git a/hw/hppa/hppa_hardware.h b/hw/hppa/hppa_hardware.h index d422af0429..0a89c3ed52 100644 --- a/hw/hppa/hppa_hardware.h +++ b/hw/hppa/hppa_hardware.h @@ -21,14 +21,6 @@ #define DINO_SCSI_HPA 0xfff8c000 #define LASI_HPA_715 0xf0100000 #define LASI_HPA 0xffd00000 -#define LASI_UART_HPA 0xffd05000 -#define LASI_SCSI_HPA 0xffd06000 -#define LASI_LAN_HPA 0xffd07000 -#define LASI_RTC_HPA 0xffd09000 -#define LASI_LPT_HPA 0xffd02000 -#define LASI_AUDIO_HPA 0xffd04000 -#define LASI_PS2KBD_HPA 0xffd08000 -#define LASI_PS2MOU_HPA 0xffd08100 #define LASI_GFX_HPA 0xf8000000 #define ARTIST_FB_ADDR 0xf9000000 #define CPU_HPA 0xfffb0000 @@ -44,6 +36,8 @@ =20 #define SCSI_HPA 0xf1040000 /* emulated SCSI, needs to be in f= region */ =20 +#define HPA_DISABLED_DEVICE 1 /* add to HPA to disable */ + /* offsets to DINO HPA: */ #define DINO_PCI_ADDR 0x064 #define DINO_CONFIG_DATA 0x068 diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index cbca0026ab..8c66eed5a2 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -50,8 +50,6 @@ struct HppaMachineState { #define HPA_POWER_BUTTON (FIRMWARE_END - 0x10) static hwaddr soft_power_reg; =20 -#define enable_lasi_lan() 0 - static DeviceState *lasi_dev; =20 static void hppa_powerdown_req(Notifier *n, void *opaque) @@ -376,13 +374,6 @@ static void machine_HP_common_init_tail(MachineState *= machine, PCIBus *pci_bus, } } =20 - /* Network setup. */ - if (lasi_dev) { - lasi_82596_init(addr_space, translate(NULL, LASI_LAN_HPA), - qdev_get_gpio_in(lasi_dev, LASI_IRQ_LAN_HPA), - enable_lasi_lan()); - } - if (pci_bus) { pci_init_nic_devices(pci_bus, mc->default_nic); =20 @@ -595,6 +586,17 @@ static void machine_HP_715_init(MachineState *machine) lasi_ncr710_handle_legacy_cmdline(dev); } =20 + /* LASI i82596 network */ + dev =3D qemu_create_nic_device(TYPE_LASI_82596, true, "lasi"); + if (dev) { + sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); + sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, + qdev_get_gpio_in(lasi_dev, LASI_IRQ_LAN_HPA)); + memory_region_add_subregion(addr_space, + translate(NULL, LASI_HPA_715 + LASI_LA= N), + sysbus_mmio_get_region(SYS_BUS_DEVICE(= dev), 0)); + } + /* Add NICs, graphics & load firmware */ machine_HP_common_init_tail(machine, NULL, translate); } @@ -638,7 +640,7 @@ static void machine_HP_B160L_init(MachineState *machine) assert(isa_bus); =20 /* Serial ports: Lasi and Dino use a 7.272727 MHz clock. */ - serial_mm_init(addr_space, translate(NULL, LASI_UART_HPA + 0x800), 0, + serial_mm_init(addr_space, translate(NULL, LASI_HPA + LASI_UART + 0x80= 0), 0, qdev_get_gpio_in(lasi_dev, LASI_IRQ_UART_HPA), 7272727 / 16, serial_hd(0), DEVICE_BIG_ENDIAN); =20 @@ -647,7 +649,8 @@ static void machine_HP_B160L_init(MachineState *machine) serial_hd(1), DEVICE_BIG_ENDIAN); =20 /* Parallel port */ - parallel_mm_init(addr_space, translate(NULL, LASI_LPT_HPA + 0x800), 0, + parallel_mm_init(addr_space, + translate(NULL, LASI_HPA + LASI_LPT + 0x800), 0, qdev_get_gpio_in(lasi_dev, LASI_IRQ_LPT_HPA), parallel_hds[0]); =20 @@ -657,11 +660,11 @@ static void machine_HP_B160L_init(MachineState *machi= ne) sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, qdev_get_gpio_in(lasi_dev, LASI_IRQ_PS2KBD_HPA)); memory_region_add_subregion(addr_space, - translate(NULL, LASI_PS2KBD_HPA), + translate(NULL, LASI_HPA + LASI_PS2), sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 0)); memory_region_add_subregion(addr_space, - translate(NULL, LASI_PS2KBD_HPA + 0x100), + translate(NULL, LASI_HPA + LASI_PS2 + 0x10= 0), sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 1)); =20 @@ -832,7 +835,7 @@ static void HP_715_machine_init_class_init(ObjectClass = *oc, const void *data) /* can only support up to max. 8 CPUs due inventory major numbers */ mc->max_cpus =3D MIN_CONST(HPPA_MAX_CPUS, 8); mc->default_ram_size =3D 256 * MiB; - mc->default_nic =3D NULL; + mc->default_nic =3D TYPE_LASI_82596; } =20 =20 diff --git a/hw/net/lasi_i82596.c b/hw/net/lasi_i82596.c index 9e1dd21546..b87cea411a 100644 --- a/hw/net/lasi_i82596.c +++ b/hw/net/lasi_i82596.c @@ -115,30 +115,10 @@ static void lasi_82596_realize(DeviceState *dev, Erro= r **errp) memory_region_init_io(&s->mmio, OBJECT(d), &lasi_82596_mem_ops, d, "lasi_82596-mmio", PA_GET_MACADDR + 4); =20 - i82596_common_init(dev, s, &net_lasi_82596_info); -} + sysbus_init_irq(SYS_BUS_DEVICE(dev), &s->irq); + sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->mmio); =20 -SysBusI82596State *lasi_82596_init(MemoryRegion *addr_space, hwaddr hpa, - qemu_irq lan_irq, gboolean match_defaul= t) -{ - DeviceState *dev; - SysBusI82596State *s; - static const MACAddr HP_MAC =3D { - .a =3D { 0x08, 0x00, 0x09, 0xef, 0x34, 0xf6 } }; - - dev =3D qemu_create_nic_device(TYPE_LASI_82596, match_default, "lasi"); - if (!dev) { - return NULL; - } - - s =3D SYSBUS_I82596(dev); - s->state.irq =3D lan_irq; - sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); - s->state.conf.macaddr =3D HP_MAC; /* set HP MAC prefix */ - - /* LASI 82596 ports in main memory. */ - memory_region_add_subregion(addr_space, hpa, &s->state.mmio); - return s; + i82596_common_init(dev, s, &net_lasi_82596_info); } =20 static void lasi_82596_reset(DeviceState *dev) @@ -152,6 +132,10 @@ static void lasi_82596_instance_init(Object *obj) { SysBusI82596State *d =3D SYSBUS_I82596(obj); I82596State *s =3D &d->state; + static const MACAddr HP_MAC =3D { + .a =3D { 0x08, 0x00, 0x09, 0xef, 0x34, 0xf6 } }; + + s->conf.macaddr =3D HP_MAC; =20 device_add_bootindex_property(obj, &s->conf.bootindex, "bootindex", "/ethernet-phy@0", diff --git a/include/hw/net/lasi_82596.h b/include/hw/net/lasi_82596.h index 439356ec19..c46a4a137e 100644 --- a/include/hw/net/lasi_82596.h +++ b/include/hw/net/lasi_82596.h @@ -25,7 +25,4 @@ struct SysBusI82596State { int val_index:1; }; =20 -SysBusI82596State *lasi_82596_init(MemoryRegion *addr_space, hwaddr hpa, - qemu_irq irq, gboolean match_default); - #endif --=20 2.51.0