From nobody Wed May 15 21:02:40 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1678892076188698.9278822752319; Wed, 15 Mar 2023 07:54:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pcSV8-0003dc-8K; Wed, 15 Mar 2023 10:53:14 -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 1pcSUw-0003aJ-QS; Wed, 15 Mar 2023 10:53:02 -0400 Received: from mail-il1-x136.google.com ([2607:f8b0:4864:20::136]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pcSUu-0002pv-DB; Wed, 15 Mar 2023 10:53:02 -0400 Received: by mail-il1-x136.google.com with SMTP id j6so6016640ilr.7; Wed, 15 Mar 2023 07:52:56 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id a10-20020a92c70a000000b00318ad12246fsm1658860ilp.1.2023.03.15.07.52.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Mar 2023 07:52:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678891975; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=UqO73fu1QzAYLZc/W3Tc5v4+ufqBgz+jIwZ324r1rM0=; b=h4mJ1pU9784qm5wIqTjpnUnrcSauMt0zOLWTVayWRxn7VB0bfAlAGU6UDGggnnsQ/R 2NK9gnwzH+suqgk7HPucMILnCUwcnIBEKZuuz4+Hk5c1wBiMWVx5W58HPevOD7BH+cdn zA4icbM4+LQLotMsbcqhqWWoe6sI4wSnPSGTL7mR0InB8grmEI6uaz81c1DJnCthmzt+ yFVDGD5odHcTmRl1PI7yLZO6j/guFnZb+A78WyfosuPXYNyAvEltd6seZteA1bUz8qA1 A9OnWDmbgei+Ls81Ff3GywnRaU+zvOlg1u8aCELTPjxHDSeCfe+dAQ40Ji/7s9mLWfs6 I/bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678891975; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=UqO73fu1QzAYLZc/W3Tc5v4+ufqBgz+jIwZ324r1rM0=; b=irZ9AGBizNa8Z8/Y4USKX1K/3C8dJChH48WnKu6WehfVfFFjQPncRfCczZpLW7ZW8x 5BooWexIjcgHl7yjWmT0Hcf81Y5OUXzRnauId9vPdx4u0NMOYvIvJ/afMK6iAJ0KyMWo O0V/Zo0wohWLf3XK0SbOK7r5t20B1u74fE9Lk+Uhx5P7k1R9FKgdQI8UC5VjyTrNm5RC B9+ETGXO6gZ4aI/IXlVTbZvetXzZ1GA+4YxmM1R2AUn9ztU2yQgLRs4xMj09Qxf6Sa7M wt39+sJz2YeamRAV641WTJIfpOnYS7Qw+gKHpqWaCP9qxpMc//hkMggEJT2hoJVug1mb 4U1g== X-Gm-Message-State: AO0yUKWksOj7Wdd47k7myMHjUVli84xW2twiapJ2tkMQm7ovoERKvJ27 L0YOnMlZrKhEc2mEev/+vog= X-Google-Smtp-Source: AK7set9hv3gJPlJrqies0/dG1TDi7dC8G4S1ckeds/xiLpEOdqK2Nh8/6qunDctE7J3+AC5sO9B8pQ== X-Received: by 2002:a92:dac7:0:b0:318:8674:bf3 with SMTP id o7-20020a92dac7000000b0031886740bf3mr4693071ilq.19.1678891975439; Wed, 15 Mar 2023 07:52:55 -0700 (PDT) From: Guenter Roeck To: Jean-Christophe Dubois Cc: Andrey Smirnov , Peter Maydell , Jason Wang , qemu-arm@nongnu.org, qemu-devel@nongnu.org, Guenter Roeck Subject: [PATCH 1/5] hw/net/imx_fec: Support two Ethernet interfaces connected to single MDIO bus Date: Wed, 15 Mar 2023 07:52:44 -0700 Message-Id: <20230315145248.1639364-2-linux@roeck-us.net> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230315145248.1639364-1-linux@roeck-us.net> References: <20230315145248.1639364-1-linux@roeck-us.net> 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=2607:f8b0:4864:20::136; envelope-from=groeck7@gmail.com; helo=mail-il1-x136.google.com X-Spam_score_int: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: fail (Header signature does not verify) X-ZM-MESSAGEID: 1678892077220100001 Content-Type: text/plain; charset="utf-8" The SOC on i.MX6UL and i.MX7 has 2 Ethernet interfaces. The PHY on each may be connected to separate MDIO busses, or both may be connected on the same MDIO bus using different PHY addresses. Commit 461c51ad4275 ("Add a phy-num property to the i.MX FEC emulator") added support for specifying PHY addresses, but it did not provide support for linking the second PHY on a given MDIO bus to the other Ethernet interface. To be able to support two PHY instances on a single MDIO bus, two properties are needed: First, there needs to be a flag indicating if the MDIO bus on a given Ethernet interface is connected. If not, attempts to read from this bus must always return 0xffff. Implement this property as phy-connected. Second, if the MDIO bus on an interface is active, it needs a link to the consumer interface to be able to provide PHY access for it. Implement this property as phy-consumer. Signed-off-by: Guenter Roeck --- hw/net/imx_fec.c | 27 +++++++++++++++++++++++---- include/hw/net/imx_fec.h | 2 ++ 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/hw/net/imx_fec.c b/hw/net/imx_fec.c index c862d96593..5d1f1f104c 100644 --- a/hw/net/imx_fec.c +++ b/hw/net/imx_fec.c @@ -282,11 +282,19 @@ static uint32_t imx_phy_read(IMXFECState *s, int reg) uint32_t val; uint32_t phy =3D reg / 32; =20 - if (phy !=3D s->phy_num) { - trace_imx_phy_read_num(phy, s->phy_num); + if (!s->phy_connected) { return 0xffff; } =20 + if (phy !=3D s->phy_num) { + if (s->phy_consumer && phy =3D=3D s->phy_consumer->phy_num) { + s =3D s->phy_consumer; + } else { + trace_imx_phy_read_num(phy, s->phy_num); + return 0xffff; + } + } + reg %=3D 32; =20 switch (reg) { @@ -343,11 +351,19 @@ static void imx_phy_write(IMXFECState *s, int reg, ui= nt32_t val) { uint32_t phy =3D reg / 32; =20 - if (phy !=3D s->phy_num) { - trace_imx_phy_write_num(phy, s->phy_num); + if (!s->phy_connected) { return; } =20 + if (phy !=3D s->phy_num) { + if (s->phy_consumer && phy =3D=3D s->phy_consumer->phy_num) { + s =3D s->phy_consumer; + } else { + trace_imx_phy_write_num(phy, s->phy_num); + return; + } + } + reg %=3D 32; =20 trace_imx_phy_write(val, phy, reg); @@ -1327,6 +1343,9 @@ static Property imx_eth_properties[] =3D { DEFINE_NIC_PROPERTIES(IMXFECState, conf), DEFINE_PROP_UINT32("tx-ring-num", IMXFECState, tx_ring_num, 1), DEFINE_PROP_UINT32("phy-num", IMXFECState, phy_num, 0), + DEFINE_PROP_BOOL("phy-connected", IMXFECState, phy_connected, true), + DEFINE_PROP_LINK("phy-consumer", IMXFECState, phy_consumer, TYPE_IMX_F= EC, + IMXFECState *), DEFINE_PROP_END_OF_LIST(), }; =20 diff --git a/include/hw/net/imx_fec.h b/include/hw/net/imx_fec.h index e3a8755db9..2d13290c78 100644 --- a/include/hw/net/imx_fec.h +++ b/include/hw/net/imx_fec.h @@ -270,6 +270,8 @@ struct IMXFECState { uint32_t phy_int; uint32_t phy_int_mask; uint32_t phy_num; + bool phy_connected; + struct IMXFECState *phy_consumer; =20 bool is_fec; =20 --=20 2.39.2 From nobody Wed May 15 21:02:40 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1678892059511205.07936354499157; Wed, 15 Mar 2023 07:54:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pcSV5-0003cm-IJ; Wed, 15 Mar 2023 10:53:11 -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 1pcSUw-0003aI-Pu; Wed, 15 Mar 2023 10:53:02 -0400 Received: from mail-il1-x12a.google.com ([2607:f8b0:4864:20::12a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pcSUu-0002q3-E5; Wed, 15 Mar 2023 10:53:02 -0400 Received: by mail-il1-x12a.google.com with SMTP id j6so6016680ilr.7; Wed, 15 Mar 2023 07:52:57 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id p4-20020a02b384000000b00406101d2dcbsm1177830jan.125.2023.03.15.07.52.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Mar 2023 07:52:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678891977; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=AgrNnzU6fXbTM2E8uxqk9fSw2ZeUOdZlwQa83wFMx2M=; b=eNu8jtTWimXimMsY0B3a8z6ev1u2cXnu7k8wcKx5jIEj75fIgEkHE1jocQGU6sgwMp 7QLgGGmMh6U9xz0Y1y7GoTRr2utwJxrCu5RVqv2T2xmr1mVkucKASeoGAYxS8YVPb/ip VJfKkdMym3BMD6hnk3WdqVj6Kl4YM++M9+qEd5h17AvO3dbNJQzUTeFMSa+4aoCUVqU1 WGFR+OsEIiN8wEdJs8j9avnDDTG26wLkARXbaL6AzypNisefj/DJKQwLc/sX0t6wxjSu 3YKNJO71hP0aFF/ypw2CJp0s4GCgK6HZARJ6j/XLjXPg0+R650oeqeLyALb6UxCJpmFi eveA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678891977; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=AgrNnzU6fXbTM2E8uxqk9fSw2ZeUOdZlwQa83wFMx2M=; b=nv5eFtD61TOHZLrpidjO7DpJzCc6qbFBvUFQqJ7+jq4IEniW013R8vFrZhZgQQJwuQ BMnfRIf/fBeQaXFyLhO1OFC6Z0pBdfNih7HtwCDjda307gjNXvf+TDAnxI3x+VHWEzrz iUlkT0OyDrqcdaM5u5SFm0G3GO1LD8s/VkkD3A5N10vR4yLmVGfUrps1TOYVFudiSb/p EXtGb+6UaCwtAHhx2oHd3Sj8CiKnNuTAQV1PzNSq5KiHkw+rSi7pG6fR/3pYX57xdX4r d77Svew2i3abrtr388MCQpKKO4vE3NotKZGq25F2qwi8gSGNSuADjMH9Ye2AruOJKG6q PHmw== X-Gm-Message-State: AO0yUKXI0Lm/qEc8Rs0kHANIUOomZN1tSuLu6T9TM9L4g1lVQ17I3Nrc I03D9GC74daY8aLj3WzmwJo= X-Google-Smtp-Source: AK7set+ePOxYwtgv4x/zaKMX1GGOen7fmHJ+rZHnwOQtGkKBuo4kWZbwk4dvAy2dW4E33a6IdsXnuw== X-Received: by 2002:a92:ccc3:0:b0:319:2bf:54b2 with SMTP id u3-20020a92ccc3000000b0031902bf54b2mr4677963ilq.5.1678891977076; Wed, 15 Mar 2023 07:52:57 -0700 (PDT) From: Guenter Roeck To: Jean-Christophe Dubois Cc: Andrey Smirnov , Peter Maydell , Jason Wang , qemu-arm@nongnu.org, qemu-devel@nongnu.org, Guenter Roeck Subject: [PATCH 2/5] fsl-imx6ul: Add fec[12]-phy-connected properties Date: Wed, 15 Mar 2023 07:52:45 -0700 Message-Id: <20230315145248.1639364-3-linux@roeck-us.net> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230315145248.1639364-1-linux@roeck-us.net> References: <20230315145248.1639364-1-linux@roeck-us.net> 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=2607:f8b0:4864:20::12a; envelope-from=groeck7@gmail.com; helo=mail-il1-x12a.google.com X-Spam_score_int: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: fail (Header signature does not verify) X-ZM-MESSAGEID: 1678892061367100003 Content-Type: text/plain; charset="utf-8" Add fec[12]-phy-connected properties and use it to set phy-connected and phy-consumer properties for imx_fec. Signed-off-by: Guenter Roeck --- hw/arm/fsl-imx6ul.c | 20 ++++++++++++++++++++ include/hw/arm/fsl-imx6ul.h | 1 + 2 files changed, 21 insertions(+) diff --git a/hw/arm/fsl-imx6ul.c b/hw/arm/fsl-imx6ul.c index d88d6cc1c5..2189dcbb72 100644 --- a/hw/arm/fsl-imx6ul.c +++ b/hw/arm/fsl-imx6ul.c @@ -407,7 +407,23 @@ static void fsl_imx6ul_realize(DeviceState *dev, Error= **errp) =20 /* * Ethernet + * + * We must use two loops since phy_connected affects the other interfa= ce + * and we have to set all properties before calling sysbus_realize(). */ + for (i =3D 0; i < FSL_IMX6UL_NUM_ETHS; i++) { + object_property_set_bool(OBJECT(&s->eth[i]), "phy-connected", + s->phy_connected[i], &error_abort); + /* + * If the MDIO bus on this controller is not connected, assume the + * other controller provides support for it. + */ + if (!s->phy_connected[i]) { + object_property_set_link(OBJECT(&s->eth[1 - i]), "phy-consumer= ", + OBJECT(&s->eth[i]), &error_abort); + } + } + for (i =3D 0; i < FSL_IMX6UL_NUM_ETHS; i++) { static const hwaddr FSL_IMX6UL_ENETn_ADDR[FSL_IMX6UL_NUM_ETHS] =3D= { FSL_IMX6UL_ENET1_ADDR, @@ -620,6 +636,10 @@ static void fsl_imx6ul_realize(DeviceState *dev, Error= **errp) static Property fsl_imx6ul_properties[] =3D { DEFINE_PROP_UINT32("fec1-phy-num", FslIMX6ULState, phy_num[0], 0), DEFINE_PROP_UINT32("fec2-phy-num", FslIMX6ULState, phy_num[1], 1), + DEFINE_PROP_BOOL("fec1-phy-connected", FslIMX6ULState, phy_connected[0= ], + true), + DEFINE_PROP_BOOL("fec2-phy-connected", FslIMX6ULState, phy_connected[1= ], + true), DEFINE_PROP_END_OF_LIST(), }; =20 diff --git a/include/hw/arm/fsl-imx6ul.h b/include/hw/arm/fsl-imx6ul.h index 1952cb984d..9ee15ae38d 100644 --- a/include/hw/arm/fsl-imx6ul.h +++ b/include/hw/arm/fsl-imx6ul.h @@ -89,6 +89,7 @@ struct FslIMX6ULState { MemoryRegion ocram_alias; =20 uint32_t phy_num[FSL_IMX6UL_NUM_ETHS]; + bool phy_connected[FSL_IMX6UL_NUM_ETHS]; }; =20 enum FslIMX6ULMemoryMap { --=20 2.39.2 From nobody Wed May 15 21:02:40 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1678892021328389.4251359293271; Wed, 15 Mar 2023 07:53:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pcSUz-0003ax-8v; Wed, 15 Mar 2023 10:53: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 1pcSUw-0003a5-8e; Wed, 15 Mar 2023 10:53:02 -0400 Received: from mail-il1-x136.google.com ([2607:f8b0:4864:20::136]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pcSUu-0002qB-Cx; Wed, 15 Mar 2023 10:53:01 -0400 Received: by mail-il1-x136.google.com with SMTP id y12so6263228ilq.4; Wed, 15 Mar 2023 07:52:59 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id h11-20020a02c4cb000000b003eebde09a10sm520886jaj.157.2023.03.15.07.52.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Mar 2023 07:52:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678891978; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=rk4/ofnxCKOhROEy7poEJfMyyq0LPhjFdcbCi+gcDY8=; b=Fh8IAPzqTL5wwnVwTSeiNxQnwEX5EEsSN1pYGWy+OZHcPkcVZKdtHbKZ5vt1CbueSh IgKzrDv5LJwlArC342flaYmHZ2x7r7X6Cs2Vwcfm9IoYPAxQtjtYFSrJYgvTKQNEh9fi 5GmtcMgQ4rMwpoSkHeOa0HCiioRV7QKvsZQIJ0cqOV1oMpiEzwi2IvLzfN7jqPMIoAnG br3eVG+b9+4RIdWO6Ho7bFIhom8RpBaHfbTdp8ONcdX+3NhZoaym55wOocyI+9Do44hf YWULvdnFpUx8IFq0HeYHoMA9REH7NZfQwbhhrbiGXcnmUonppEavRnRCQzsHzglrV3tG AVdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678891978; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=rk4/ofnxCKOhROEy7poEJfMyyq0LPhjFdcbCi+gcDY8=; b=ZM794uJ3aap8R18HjRKzFNG4I+kG7oNAst1En/kcNsXKV7ckqmFvrRMwEB1TwSGc8B frVRCu691LyWUqjq8vrJqVWpnZg9g02lw7bE47oihqXO/wwVOxhJeo75Eo7kVJeZMM24 48kc5jD3ahTSDjHPCrVMXYsaQS5YHYaeCVmpezEuwXIPJtaDTfS/ASjx1XgyQOMk9B/7 AffJjteaNaA6yBplLbNiVBVcvrrn4Uj0T48iDLbppJh7Ubp8IJot1OZG8oJGO4v6obIa 1iZYqwmszHHNVMJgZcH/u3xHCmCVpaC0sQRI7cN7XAxdLjwZYJmk/wyMtDk7BmeK+yBz Ckug== X-Gm-Message-State: AO0yUKWgVBVmqHjhHRyyLEXTbgPNBe/Gh2YxeBT595q8QNYcPYNoeNZk Sj39CAIl9Lx6NMfy7YBKdVE= X-Google-Smtp-Source: AK7set9v5IrjHnsuZq7YcXnnSJHojTNhfb6y0jouy7oOJm5gnuAIeOJoonW5i/zk9xPtv5s1eJZ3jA== X-Received: by 2002:a05:6e02:1a2c:b0:319:6826:5577 with SMTP id g12-20020a056e021a2c00b0031968265577mr5697367ile.23.1678891978637; Wed, 15 Mar 2023 07:52:58 -0700 (PDT) From: Guenter Roeck To: Jean-Christophe Dubois Cc: Andrey Smirnov , Peter Maydell , Jason Wang , qemu-arm@nongnu.org, qemu-devel@nongnu.org, Guenter Roeck Subject: [PATCH 3/5] arm/mcimx6ul-evk: Set fec1-phy-connected property to false Date: Wed, 15 Mar 2023 07:52:46 -0700 Message-Id: <20230315145248.1639364-4-linux@roeck-us.net> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230315145248.1639364-1-linux@roeck-us.net> References: <20230315145248.1639364-1-linux@roeck-us.net> 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=2607:f8b0:4864:20::136; envelope-from=groeck7@gmail.com; helo=mail-il1-x136.google.com X-Spam_score_int: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: fail (Header signature does not verify) X-ZM-MESSAGEID: 1678892023984100005 Content-Type: text/plain; charset="utf-8" On mcimx6ul-evk, the MDIO bus is connected to the second Ethernet interface. Set fec1-phy-connected to false to reflect this. Signed-off-by: Guenter Roeck --- hw/arm/mcimx6ul-evk.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/arm/mcimx6ul-evk.c b/hw/arm/mcimx6ul-evk.c index d83c3c380e..3ac1e2ea9b 100644 --- a/hw/arm/mcimx6ul-evk.c +++ b/hw/arm/mcimx6ul-evk.c @@ -41,6 +41,8 @@ static void mcimx6ul_evk_init(MachineState *machine) object_property_add_child(OBJECT(machine), "soc", OBJECT(s)); object_property_set_uint(OBJECT(s), "fec1-phy-num", 2, &error_fatal); object_property_set_uint(OBJECT(s), "fec2-phy-num", 1, &error_fatal); + object_property_set_bool(OBJECT(s), "fec1-phy-connected", false, + &error_fatal); qdev_realize(DEVICE(s), NULL, &error_fatal); =20 memory_region_add_subregion(get_system_memory(), FSL_IMX6UL_MMDC_ADDR, --=20 2.39.2 From nobody Wed May 15 21:02:40 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16788920214411005.4460948662695; Wed, 15 Mar 2023 07:53:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pcSVH-0003fK-TT; Wed, 15 Mar 2023 10:53:24 -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 1pcSUx-0003as-JA; Wed, 15 Mar 2023 10:53:04 -0400 Received: from mail-il1-x12f.google.com ([2607:f8b0:4864:20::12f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pcSUv-0002qT-Qd; Wed, 15 Mar 2023 10:53:03 -0400 Received: by mail-il1-x12f.google.com with SMTP id j6so6016771ilr.7; Wed, 15 Mar 2023 07:53:01 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id u15-20020a92600f000000b003230864f757sm1625327ilb.68.2023.03.15.07.52.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Mar 2023 07:53:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678891980; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=5PnGZtY31aXe2GrzxKEjapHT5JLsmRDhcXFx6YyQDfs=; b=Ile5HKm0X+R2UqK5rFcJcnr6KDKhvBL4W6sf83gXMY2uKk+aZnuClUP9rvcyZaIdS8 osAvq7086x4pdcHqwTcNkWP7qd/8hBzLXnah5114ow4WWthZxk47daUE2aIjKV9t2PRI fHQfy3lZR1RMyxm/SwGPQWuzE96udfqD5iYFlwx/Iut1Cgwmqga98cYZkRtO8ytoJU3O TI1J7IDPicmrE0FCy4Jx8zf2AE87eT+WeiwL9q8Zlba7hDgjAzIhASCKfB2Ofp7vBS0R wthg5SioLChEv4UkPq5lwJHaBQRpopw9q2cRf0Tf3NFfZTgf/wvQQrEhI29326VHdjo8 mcjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678891980; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=5PnGZtY31aXe2GrzxKEjapHT5JLsmRDhcXFx6YyQDfs=; b=nEq1yOraVK29fAdLahjbiknTWZirRpSU0ZvxW1zu+Q64zeNB+tXn3N+x0boudRmJiQ iuSSGujoH5x1QOjZvf4B2uC/PJT3qNUSp2NLHxGxCaBEaUGxLFZoSnmEoRioasE2IWBU WiWPk8sO+s6kFiFEPKcxUWX6d84/k2KlNaIAOyLBlP/7MQWF2q6E/ksfc3Kp3kKHV51Z fqHXQu0DLqEiIbI79PJDax2+84MBrEkuC+qo36td72cA72J6b4qBklay5xkk1mweZcrP BwhubGk3A+X9nFaOYE/QI4Y0c/JweWjr3+NrxYaY4A6zOg5sQRsknVWgPjapR+pTrpja jsaQ== X-Gm-Message-State: AO0yUKXnDoAPqCIVY9Ogz0bVxjmw1qwy8kdJqQDPAZ04ys3YsA8TiEcI 5eN00nPJZ9Mtvafe+hhCzNs= X-Google-Smtp-Source: AK7set8esn6aA6jNoaJvvhAJZMcqTP4m1k+xZDGJfM6AF42Fls6hgDNLGLOWVjn834oewmcF+BiYKg== X-Received: by 2002:a05:6e02:10c1:b0:317:c80f:b416 with SMTP id s1-20020a056e0210c100b00317c80fb416mr4584998ilj.20.1678891980316; Wed, 15 Mar 2023 07:53:00 -0700 (PDT) From: Guenter Roeck To: Jean-Christophe Dubois Cc: Andrey Smirnov , Peter Maydell , Jason Wang , qemu-arm@nongnu.org, qemu-devel@nongnu.org, Guenter Roeck Subject: [PATCH 4/5] fsl-imx7: Add fec[12]-phy-connected properties Date: Wed, 15 Mar 2023 07:52:47 -0700 Message-Id: <20230315145248.1639364-5-linux@roeck-us.net> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230315145248.1639364-1-linux@roeck-us.net> References: <20230315145248.1639364-1-linux@roeck-us.net> 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=2607:f8b0:4864:20::12f; envelope-from=groeck7@gmail.com; helo=mail-il1-x12f.google.com X-Spam_score_int: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: fail (Header signature does not verify) X-ZM-MESSAGEID: 1678892023988100006 Content-Type: text/plain; charset="utf-8" Add fec[12]-phy-connected properties and use it to set phy-connected and phy-consumer properties for imx_fec. Signed-off-by: Guenter Roeck --- hw/arm/fsl-imx7.c | 20 ++++++++++++++++++++ include/hw/arm/fsl-imx7.h | 1 + 2 files changed, 21 insertions(+) diff --git a/hw/arm/fsl-imx7.c b/hw/arm/fsl-imx7.c index afc7480799..9e41d4b677 100644 --- a/hw/arm/fsl-imx7.c +++ b/hw/arm/fsl-imx7.c @@ -395,7 +395,23 @@ static void fsl_imx7_realize(DeviceState *dev, Error *= *errp) =20 /* * Ethernet + * + * We must use two loops since phy_connected affects the other interfa= ce + * and we have to set all properties before calling sysbus_realize(). */ + for (i =3D 0; i < FSL_IMX7_NUM_ETHS; i++) { + object_property_set_bool(OBJECT(&s->eth[i]), "phy-connected", + s->phy_connected[i], &error_abort); + /* + * If the MDIO bus on this controller is not connected, assume the + * other controller provides support for it. + */ + if (!s->phy_connected[i]) { + object_property_set_link(OBJECT(&s->eth[1 - i]), "phy-consumer= ", + OBJECT(&s->eth[i]), &error_abort); + } + } + for (i =3D 0; i < FSL_IMX7_NUM_ETHS; i++) { static const hwaddr FSL_IMX7_ENETn_ADDR[FSL_IMX7_NUM_ETHS] =3D { FSL_IMX7_ENET1_ADDR, @@ -601,6 +617,10 @@ static void fsl_imx7_realize(DeviceState *dev, Error *= *errp) static Property fsl_imx7_properties[] =3D { DEFINE_PROP_UINT32("fec1-phy-num", FslIMX7State, phy_num[0], 0), DEFINE_PROP_UINT32("fec2-phy-num", FslIMX7State, phy_num[1], 1), + DEFINE_PROP_BOOL("fec1-phy-connected", FslIMX7State, phy_connected[0], + true), + DEFINE_PROP_BOOL("fec2-phy-connected", FslIMX7State, phy_connected[1], + true), DEFINE_PROP_END_OF_LIST(), }; =20 diff --git a/include/hw/arm/fsl-imx7.h b/include/hw/arm/fsl-imx7.h index 355bd8ea83..54ea2f0890 100644 --- a/include/hw/arm/fsl-imx7.h +++ b/include/hw/arm/fsl-imx7.h @@ -82,6 +82,7 @@ struct FslIMX7State { ChipideaState usb[FSL_IMX7_NUM_USBS]; DesignwarePCIEHost pcie; uint32_t phy_num[FSL_IMX7_NUM_ETHS]; + bool phy_connected[FSL_IMX7_NUM_ETHS]; }; =20 enum FslIMX7MemoryMap { --=20 2.39.2 From nobody Wed May 15 21:02:40 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1678892067888295.29909289127386; Wed, 15 Mar 2023 07:54:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pcSVP-0003h9-WE; Wed, 15 Mar 2023 10:53:32 -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 1pcSUz-0003bJ-0Y; Wed, 15 Mar 2023 10:53:05 -0400 Received: from mail-io1-xd36.google.com ([2607:f8b0:4864:20::d36]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pcSUx-0002qx-C9; Wed, 15 Mar 2023 10:53:04 -0400 Received: by mail-io1-xd36.google.com with SMTP id bf15so7921372iob.7; Wed, 15 Mar 2023 07:53:02 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id a22-20020a02ac16000000b003ed8808d450sm1686369jao.161.2023.03.15.07.53.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Mar 2023 07:53:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678891982; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=yJFWehCA11brbTrRUqSDJJtjVUTS8uqYWPz8CgZG0N0=; b=j/4Npo6x81I9s7rz6D1yuUN+gSYxckOE+bLEc9PAWES967rn7Yr7BJIgMTLuwSiVKA biakefkXUIjmiPi7zHYH3wF4QWXZNhARitImkZvK73M3VBWHkR45Fiw+xKiDshFGg12q wLbB7YT+mjZUlVoZktu5EVWlwfNUxsZQNiLO0TV832XFIyQ5PXm+3lQIn3Khz8Gi+Gf3 I7zXtT847/AfQwhmA/CaEUgi5xQxL2x0t+A5G+JCa0/AeSqF4CumkbZF9raQebkJ04Za hTAES3Yh9jZzvNzk1w9/3E3juP8CP7PjGka0/i0YkCWfq7IUSyeOT2e8NtPQDHlXqW02 KIOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678891982; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=yJFWehCA11brbTrRUqSDJJtjVUTS8uqYWPz8CgZG0N0=; b=Hi2s/m17VVrpSEyfMWj1EILY7diVOAAo8wNXbOcMgN81doDgegMBcJ+aY46g47Izm9 XI2u7zt7FSTLM3YBB4MP96hWWu7v4l7B0I1z/kFbSiGOycPFpH18W1HR5UETCl7Z4k6p HxJEDNY4HZuHxKIXEgb2wFaQwRsSXC1AwH3MwNHMASBj9nlhcP8hHXCwoPNgX2cvsPWO VrEJ5Vj5VF4/vl2i4GhJuoNFvCe1d9L7U5HFO5FA85w7+rmBtvFJySnLEkyExb1T5SXd SeXo62wkcTD4rUNXGuwncJjAtBMWhB4d+ZET2sNciZQqkHz7ntN+MeaF6stETnlBF8h+ 4u4A== X-Gm-Message-State: AO0yUKVGNrV+DBpMHwLyzjXtwq56mpT5/Pk3IFlKIFYy2SU3vo/GrXsX Y9W5Hb63VU0hf6AtY6lkHw8= X-Google-Smtp-Source: AK7set8eUFQ9JsIIWgSZBfcz3YZM++B7wVdKnPQpo7d7kwTvEN2Ax4y0IBLuTzdokDBZknDESqiKsQ== X-Received: by 2002:a6b:3c04:0:b0:74c:e1a5:c5e3 with SMTP id k4-20020a6b3c04000000b0074ce1a5c5e3mr25785424iob.0.1678891981872; Wed, 15 Mar 2023 07:53:01 -0700 (PDT) From: Guenter Roeck To: Jean-Christophe Dubois Cc: Andrey Smirnov , Peter Maydell , Jason Wang , qemu-arm@nongnu.org, qemu-devel@nongnu.org, Guenter Roeck Subject: [PATCH 5/5] arm/mcimx7d-sabre: Set fec2-phy-connected property to false Date: Wed, 15 Mar 2023 07:52:48 -0700 Message-Id: <20230315145248.1639364-6-linux@roeck-us.net> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230315145248.1639364-1-linux@roeck-us.net> References: <20230315145248.1639364-1-linux@roeck-us.net> 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=2607:f8b0:4864:20::d36; envelope-from=groeck7@gmail.com; helo=mail-io1-xd36.google.com X-Spam_score_int: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: fail (Header signature does not verify) X-ZM-MESSAGEID: 1678892069197100001 Content-Type: text/plain; charset="utf-8" On mcimx7d-sabre, the MDIO bus is connected to the first Ethernet interface. Set fec2-phy-connected to false to reflect this. Signed-off-by: Guenter Roeck --- hw/arm/mcimx7d-sabre.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/arm/mcimx7d-sabre.c b/hw/arm/mcimx7d-sabre.c index 6182b15f19..d1778122b6 100644 --- a/hw/arm/mcimx7d-sabre.c +++ b/hw/arm/mcimx7d-sabre.c @@ -41,6 +41,8 @@ static void mcimx7d_sabre_init(MachineState *machine) =20 s =3D FSL_IMX7(object_new(TYPE_FSL_IMX7)); object_property_add_child(OBJECT(machine), "soc", OBJECT(s)); + object_property_set_bool(OBJECT(s), "fec2-phy-connected", false, + &error_fatal); qdev_realize(DEVICE(s), NULL, &error_fatal); =20 memory_region_add_subregion(get_system_memory(), FSL_IMX7_MMDC_ADDR, --=20 2.39.2