From nobody Wed Nov 27 02:29:42 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1702002959; cv=none; d=zohomail.com; s=zohoarc; b=Wj90LTXwZ+9GjTOGr7Gm2t0uqhtptP4xyNOcty+5nmcMQyDxo7P9AfzTIs72rdZ/undEi9/oc0OrS3aE7Ejg2oR8snmbTMB2CZ0TJAbGimOU6NGFAdi/eIyHDXWtAxJkMkLejHRQNSmnWzmcSVAqpn2Ib6bJwpkOa6B7aVs49go= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1702002959; 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=FgtBxKk/YnE0/ZchwODTjsH1Cpkh2DZnmTE8Tpp7q3Y=; b=C7crnKNe3kF1oblF43TgkcErE+FNVvKo3LJ0t9/U02umTg5h49xO+GT/ahHRuABwoR400hRATuv8A+73TnvL3TCaXxy+OklVy//SKs8lSMgMtCRNQW0ijRxQfrDH2DwdRXF0xIzgJIm8MW8lm7DiypsYgfYkKRtgc5Mx7zRyvFA= 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 1702002959052251.7181440491837; Thu, 7 Dec 2023 18:35:59 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rBQgc-0007Fm-Oe; Thu, 07 Dec 2023 21:33:54 -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 1rBQga-0006uW-Kf; Thu, 07 Dec 2023 21:33:52 -0500 Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rBQgX-0002gQ-Fg; Thu, 07 Dec 2023 21:33:52 -0500 Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-50c0f6b1015so1701749e87.3; Thu, 07 Dec 2023 18:33:48 -0800 (PST) Received: from localhost.localdomain ([185.200.240.39]) by smtp.gmail.com with ESMTPSA id r1-20020a2e94c1000000b002c9e6cbf78esm99062ljh.19.2023.12.07.18.33.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 18:33:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702002827; x=1702607627; 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=FgtBxKk/YnE0/ZchwODTjsH1Cpkh2DZnmTE8Tpp7q3Y=; b=fFuhSMWBQmaEVE6C3pLxgKA1k6bQXkLM6bT7EmzS7kyZ1P6PrEOWjbIzsDzQYkFO8K 8rxuGXa0tm+OzgAJBX0kxdhca2UX1x0ld5ozeK4Ckr6pqf1SmlZxxVaxGzPI2L38WZIb 9r1zoAgUDP+ssc8jf1ecFRUigKdsqGn0wXwRJB3M82CXiKBphUOgWAa8qiyJkkntEKqL Kp4fMiQlo1NpQfy6gxVxwJLWYzSTYEmfnqhUcJ2tHgWDCOBGy3b6i9PHxm75n/8dsww9 axp6XjkiWARNnkgzLkR/jsjeSfhagIS7ZWIpJJddFyZw6sU+LSTkEqhql6BYBW6QnjTb ATdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702002827; x=1702607627; 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=FgtBxKk/YnE0/ZchwODTjsH1Cpkh2DZnmTE8Tpp7q3Y=; b=UdJpYpD8ZijFUE9AxSn75qHJ+u9n5BiwaVuwSm4aCaHEu0IOpIqiTwfF3lnAywJVBx NFipN4xRjbHFESAmOMLbfj/3Itu4zblAj35/r4C/x/+K3n0r97eAFoijuTcGVY4MDGFR 0KcOP6SdmQv0y02PouZq7vnZmzgm6+sjcoqPhRNXCatcH17Tu/dArvS5jjg6E6NAtYQl YKv6/9Yzs5OBueEuUwNqo69TeKzmo7pyNdY0rUv/8pmvOc2V89cfEmcX3APFTkDP3V+N TOUeOw5kYrSAmLG7U/rXYC2bxVPLi6peeNDj4G/q7bT1PEGlA3j+6jbJmQ+5EL44936P xcTQ== X-Gm-Message-State: AOJu0YztDSJJqvU+UJbnm8p69stStcGamI8V34SQS+E34K0zZ6RgRnoG et1uFcQWMezgwyiWGlcIZ89uWVJmlX3+JA== X-Google-Smtp-Source: AGHT+IFe3MjgxvJ3vT7fFnGKzYjzyeVWdaifCOzwlNw3WZI+rEg1So2Y+PdOKLeDudtTtLApxnRt0Q== X-Received: by 2002:a2e:a0d5:0:b0:2c9:f7fe:928f with SMTP id f21-20020a2ea0d5000000b002c9f7fe928fmr1832063ljm.93.1702002827009; Thu, 07 Dec 2023 18:33:47 -0800 (PST) From: Sergey Kambalin X-Google-Original-From: Sergey Kambalin To: qemu-arm@nongnu.org Cc: qemu-devel@nongnu.org, Sergey Kambalin Subject: [PATCH v4 32/45] Enable BCM2838 GENET controller Date: Thu, 7 Dec 2023 20:31:32 -0600 Message-Id: <20231208023145.1385775-33-sergey.kambalin@auriga.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231208023145.1385775-1-sergey.kambalin@auriga.com> References: <20231208023145.1385775-1-sergey.kambalin@auriga.com> 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::12c; envelope-from=serg.oker@gmail.com; helo=mail-lf1-x12c.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 @gmail.com) X-ZM-MESSAGEID: 1702002959310100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Sergey Kambalin Reviewed-by: Peter Maydell --- hw/arm/bcm2838_peripherals.c | 16 ++++++++++++++++ hw/arm/raspi4b.c | 17 ----------------- include/hw/arm/bcm2838_peripherals.h | 2 ++ 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/hw/arm/bcm2838_peripherals.c b/hw/arm/bcm2838_peripherals.c index 65a659c15c..d962999daf 100644 --- a/hw/arm/bcm2838_peripherals.c +++ b/hw/arm/bcm2838_peripherals.c @@ -47,6 +47,15 @@ static void bcm2838_peripherals_init(Object *obj) object_initialize_child(obj, "pcie-host", &s->pcie_host, TYPE_BCM2838_PCIE_HOST); =20 + /* Gigabit Ethernet */ + object_initialize_child(obj, "genet", &s->genet, TYPE_BCM2838_GENET); + for (int i =3D 0; i < nb_nics; i++) { + if ((nd_table[i].used && nd_table[i].model) && !strcmp(nd_table[i]= .model, "bcmgenet")) { + qdev_set_nic_properties(DEVICE(&s->genet), &nd_table[i]); + break; + } + } + /* Extended Mass Media Controller 2 */ object_initialize_child(obj, "emmc2", &s->emmc2, TYPE_SYSBUS_SDHCI); =20 @@ -231,6 +240,13 @@ static void bcm2838_peripherals_realize(DeviceState *d= ev, Error **errp) memory_region_add_subregion(get_system_memory(), PCIE_MMIO_ARM_OFFSET, &s->pcie_mmio_alias); =20 + /* Gigabit Ethernet */ + if (!sysbus_realize(SYS_BUS_DEVICE(&s->genet), errp)) { + return; + } + regs_mr =3D sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->genet), 0); + memory_region_add_subregion(&s->peri_low_mr, GENET_OFFSET, regs_mr); + create_unimp(s_base, &s->clkisp, "bcm2835-clkisp", CLOCK_ISP_OFFSET, CLOCK_ISP_SIZE); =20 diff --git a/hw/arm/raspi4b.c b/hw/arm/raspi4b.c index fda27d36cb..8aa8dfb087 100644 --- a/hw/arm/raspi4b.c +++ b/hw/arm/raspi4b.c @@ -64,23 +64,6 @@ static int raspi_add_memory_node(void *fdt, hwaddr mem_b= ase, hwaddr mem_len) =20 static void raspi4_modify_dtb(const struct arm_boot_info *info, void *fdt) { - - /* Temporarily disable following devices until they are implemented*/ - const char *to_be_removed_from_dt_as_wa[] =3D { - "brcm,bcm2711-genet-v5", - }; - - for (int i =3D 0; i < ARRAY_SIZE(to_be_removed_from_dt_as_wa); i++) { - const char *dev_str =3D to_be_removed_from_dt_as_wa[i]; - - int offset =3D fdt_node_offset_by_compatible(fdt, -1, dev_str); - if (offset >=3D 0) { - if (!fdt_nop_node(fdt, offset)) { - warn_report("bcm2711 dtc: %s has been disabled!", dev_str); - } - } - } - uint64_t ram_size =3D board_ram_size(info->board_id); =20 if (info->ram_size > UPPER_RAM_BASE) { diff --git a/include/hw/arm/bcm2838_peripherals.h b/include/hw/arm/bcm2838_= peripherals.h index 20b7d1eb67..1cfcf5dcce 100644 --- a/include/hw/arm/bcm2838_peripherals.h +++ b/include/hw/arm/bcm2838_peripherals.h @@ -13,6 +13,7 @@ #include "hw/misc/bcm2838_rng200.h" #include "hw/misc/bcm2838_thermal.h" #include "hw/arm/bcm2838_pcie.h" +#include "hw/net/bcm2838_genet.h" #include "hw/sd/sdhci.h" #include "hw/gpio/bcm2838_gpio.h" =20 @@ -73,6 +74,7 @@ struct BCM2838PeripheralState { UnimplementedDeviceState clkisp; BCM2838PcieHostState pcie_host; BCM2838GpioState gpio; + BCM2838GenetState genet; =20 OrIRQState mmc_irq_orgate; OrIRQState dma_7_8_irq_orgate; --=20 2.34.1