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=-19.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT 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 BE076C4338F for ; Sun, 25 Jul 2021 16:14:56 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 105E160F38 for ; Sun, 25 Jul 2021 16:14:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 105E160F38 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D2D0282E05; Sun, 25 Jul 2021 18:14:30 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="UhdntF0C"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4C91C82C40; Sun, 25 Jul 2021 18:14:18 +0200 (CEST) Received: from mail-ot1-x333.google.com (mail-ot1-x333.google.com [IPv6:2607:f8b0:4864:20::333]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2010182AC8 for ; Sun, 25 Jul 2021 18:14:06 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-ot1-x333.google.com with SMTP id c2-20020a0568303482b029048bcf4c6bd9so6068597otu.8 for ; Sun, 25 Jul 2021 09:14:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3C0rBAClhFj99Uz/EL8CKPuqO6I/PXo37Qtbha3P7T4=; b=UhdntF0C4E1P1kikKV1PMAyojzhfltMlDGGfUS5+RhIH0IhV08GhabqXPCDeU6nV2y uZPQMxNR0ZBqyGcQBcDHvxqJbpK5ev7GV9g0vLkUyOh7arps0WT6DMMBKijB2jbgx0st rO8RD8wmgTZPs6fxepIrT4qdCg6uCQhKvpyjg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3C0rBAClhFj99Uz/EL8CKPuqO6I/PXo37Qtbha3P7T4=; b=duZ6wEeeMC7M4OgsG4VJ4oEXUx6gA1YQGtfgi/t4vpFzGSj82IemlsQyRoZoCVGZIx vrCUYkDa4KgE1+lvJ6RVkxGpCgTh4KajrzfmSp4VkrBCEWNHk2ECRfQpasJxogypjsQO 9mwI58udf+EGdx11pZyVfOgyOG2TYacRqdB5+gy7vEaXdKR9zlYqVrzBMc3LB1GU4jPI xM9mx0DVnvVyV8d/FkisqrvLubxU4Eij2bJg0sCKfmPvnQhbkvk46hY13nOxKFiRKIgZ HPhWygNAEbE8QMnVSUlO40aJC4sOq8rNfrHU0VODfFHKSw0HnnKr8WNqLngXKNIqXDgD OkhA== X-Gm-Message-State: AOAM532sWRyo4xPaviuML7tF5JOrhL1RH9IYB8oVqaiwFF1dcGEdh2ik Gay7sLKRz+zalELDGGyEd46POWLo+/c+Ag+g X-Google-Smtp-Source: ABdhPJwqhYcdUkG33zOgWEprtjYqbUbSFWPPsezusYW5ABXx7IeXFv6wBeWYS8zltTvgHhM5WIyvdA== X-Received: by 2002:a9d:2072:: with SMTP id n105mr9634782ota.132.1627229644396; Sun, 25 Jul 2021 09:14:04 -0700 (PDT) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id y61sm6778937ota.31.2021.07.25.09.14.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Jul 2021 09:14:04 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Joe Hershberger , Ramon Fried Subject: [PATCH v6 2/5] net: atheros: Add a check for OF_CONTROL Date: Sun, 25 Jul 2021 10:13:44 -0600 Message-Id: <20210725161347.457937-3-sjg@chromium.org> X-Mailer: git-send-email 2.32.0.432.gabb21c7263-goog In-Reply-To: <20210725161347.457937-1-sjg@chromium.org> References: <20210725161347.457937-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean This phy cannot be used when OF_CONTROL is not enabled. A few boards expect it to build, though, so add a runtime check for this case. Signed-off-by: Simon Glass --- Changes in v6: - Add new patch for atheros drivers/net/phy/atheros.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/net/phy/atheros.c b/drivers/net/phy/atheros.c index f922fecd6b5..cc772f3060f 100644 --- a/drivers/net/phy/atheros.c +++ b/drivers/net/phy/atheros.c @@ -7,6 +7,7 @@ * Copyright (c) 2019 Michael Walle */ #include +#include #include #include #include @@ -197,6 +198,16 @@ static int ar803x_of_init(struct phy_device *phydev) u32 strength, freq, min_uV, max_uV; int sel; + /* + * This driver requires OF_CONTROL but this is included on some boards + * that don't support it in SPL. Return an error so the board vendor + * can resolve this. + */ + if (!CONFIG_IS_ENABLED(OF_CONTROL)) { + log_err("atheros driver requires OF_CONTROL enabled"); + return -ENOSYS; + } + node = phy_get_ofnode(phydev); if (!ofnode_valid(node)) return -EINVAL; -- 2.32.0.432.gabb21c7263-goog