From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-20.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7955CC433B4 for ; Thu, 6 May 2021 02:27:57 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2AE58613B5 for ; Thu, 6 May 2021 02:27:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2AE58613B5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:33998 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leTk4-0001Gy-46 for qemu-devel@archiver.kernel.org; Wed, 05 May 2021 22:27:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34364) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leTiq-0008Uc-Kd; Wed, 05 May 2021 22:26:40 -0400 Received: from mail-oi1-x22c.google.com ([2607:f8b0:4864:20::22c]:40645) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1leTil-0000lV-4H; Wed, 05 May 2021 22:26:40 -0400 Received: by mail-oi1-x22c.google.com with SMTP id u16so4147105oiu.7; Wed, 05 May 2021 19:26:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:to:cc:references:from:subject:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=ZnY2dkL8b81cfCirToq00pKKe1qP9eFw7vBW4dzRYyE=; b=fU6kxbRElqdFeyOAa9HkXpUC0B7XdNrSCQEsmN4LmJBjFpqqpkf0/aPsbwFMxO4Itw UobLZMRpBwjt+3Mapj8dEAHqM38ZaP5YMzqjXHQpgqCEsO8f3eOZtnM8kkcxe0snKErs KMDhmDRfS9lw1ESJjh5MjcidNoZQ8fPrB45Y7jixodMTbEwYcSiMiziHA3p6LkJ0L/N1 zpELx+wXYtDFSBsi29aYT/AkNcDSXQeww0mXBfGG4NU28CBIZewmAvryjGRlF+d81vk6 X6EZPyzb241E/Rl9EWuwiUYnVffHmnQotZEIX32MclTB5YJ72Z+OHJfbcilubVOVhOH9 b77A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:to:cc:references:from:subject:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ZnY2dkL8b81cfCirToq00pKKe1qP9eFw7vBW4dzRYyE=; b=uPdim0C0KpQZnC5Sfi4qhIXtHySn59hJXx0wPos2X+EPeMTssvHjxa072CM/s/Poqg v1do874A78qYfJlr8B8mpWASZSG+oGjpzJDZtI9/H46trF57j9sUdtFHWy4gz91N0Mxn ijam3IlqLBAKGJ5/lRKvemzEtdRX7qij+JyRXJ8FJqzQsA8kNYizB9A7xYtETM7dBoSp rxetsVI4YSfhP1I6gMb1JLT2N6N2pxVHmi4AM1Dwien3ZeT5+brBkOZoy30kcapf6gGN +43JIid7+0egvGSzDzEdgZgXEp+WFu7D5hiXeKuaQhLVsp6XVBMADNBCeFmzP6Z+he8s 1OeA== X-Gm-Message-State: AOAM531E56bzu8U7Eugs/oBPVnPInqnKSfYbibOTmiGCW7h27XOjLqhY qeNgBqsNaVKQnI5Tu/ax0qM/8sJhuVE= X-Google-Smtp-Source: ABdhPJyeZWfkNDD31LHrb4Me++sNveIDEIRbXQ6Cqf1Jv9aEkKLCQ/oKIJ8wSOjwF7FKrtn2bDGgUA== X-Received: by 2002:a05:6808:10d0:: with SMTP id s16mr1382838ois.10.1620267992591; Wed, 05 May 2021 19:26:32 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id v19sm295224otq.35.2021.05.05.19.26.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 05 May 2021 19:26:32 -0700 (PDT) To: Bin Meng References: <20210504124140.1100346-1-linux@roeck-us.net> From: Guenter Roeck Subject: Re: [PATCH] hw/arm/xlnx: Fix PHY address for xilinx-zynq-a9 Message-ID: Date: Wed, 5 May 2021 19:26:30 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::22c; envelope-from=groeck7@gmail.com; helo=mail-oi1-x22c.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, NICE_REPLY_A=-0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Alistair Francis , Bin Meng , "qemu-devel@nongnu.org Developers" , qemu-arm , "Edgar E . Iglesias" Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 5/5/21 6:58 PM, Bin Meng wrote: > Hi Guenter, > > On Tue, May 4, 2021 at 8:41 PM Guenter Roeck wrote: >> >> Commit dfc388797cc4 ("hw/arm: xlnx: Set all boards' GEM 'phy-addr' >> property value to 23") configured the PHY address for xilinx-zynq-a9 >> to 23. When trying to boot xilinx-zynq-a9 with zynq-zc702.dtb or >> zynq-zc706.dtb, this results in the following error message when >> trying to use the Ethernet interface. >> >> macb e000b000.ethernet eth0: Could not attach PHY (-19) >> >> The devicetree files for ZC702 and ZC706 configure PHY address 7. The >> documentation for the ZC702 and ZC706 evaluation boards suggest that the >> PHY address is 7, not 23. Other boards use PHY address 0, 1, 3, or 7. >> I was unable to find a documentation or a devicetree file suggesting >> or using PHY address 23. > > I can't find one neither :( > >> The Ethernet interface starts working with >> zynq-zc702.dtb and zynq-zc706.dtb when setting the PHY address to 7, >> so let's use it. >> >> Cc: Bin Meng >> Signed-off-by: Guenter Roeck >> --- >> hw/arm/xilinx_zynq.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/hw/arm/xilinx_zynq.c b/hw/arm/xilinx_zynq.c >> index 8db6cfd47f..5ac0294f9e 100644 >> --- a/hw/arm/xilinx_zynq.c >> +++ b/hw/arm/xilinx_zynq.c >> @@ -119,7 +119,7 @@ static void gem_init(NICInfo *nd, uint32_t base, qemu_irq irq) >> qemu_check_nic_model(nd, TYPE_CADENCE_GEM); >> qdev_set_nic_properties(dev, nd); >> } >> - object_property_set_int(OBJECT(dev), "phy-addr", 23, &error_abort); >> + object_property_set_int(OBJECT(dev), "phy-addr", 7, &error_abort); >> s = SYS_BUS_DEVICE(dev); >> sysbus_realize_and_unref(s, &error_fatal); >> sysbus_mmio_map(s, 0, base); >> -- > > Reviewed-by: Bin Meng > > While we are here, could you please create a doc for the target you > are testing with Linux/U-Boot/etc? > > I was having a hard time booting upstream U-Boot/Linux on QEMU zynqmp before. > Everything I have is in my repository at https://github.com/groeck/linux-build-test My clone of qemu is at https://github.com/groeck/qemu The v6.0.0-local branch in the qemu repository is probably the most relevant. There are two caveats when trying to boot zynqmp images: - You may need commit 9bfbe02879 from that branch to boot Linux directly, ie without u-boot. That patch was rejected a long time ago (the argument, if I recall correctly, was that u-boot should set the clock rates as needed). - Booting zynqmp based images on arm64 with linux 5.6 and later doesn't work anymore. This is due to Linux commit 9c8a47b484ed ("arm64: dts: xilinx: Add the clock nodes for zynqmp"). Unfortunately, those clocks are tied to zynqmq firmware which is not emulated by qemu, so all the drivers needed to do anything useful in Linux won't load. Hope this helps, Guenter