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.2 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, URIBL_BLOCKED,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 AFE81C07E95 for ; Sun, 4 Jul 2021 18:21:26 +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 3024961364 for ; Sun, 4 Jul 2021 18:21:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3024961364 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BD04382C05; Sun, 4 Jul 2021 20:20:29 +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="iUzRWMtI"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D973282BE5; Sun, 4 Jul 2021 20:20:22 +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 A972282BD3 for ; Sun, 4 Jul 2021 20:20:07 +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 r4-20020a0568301204b029047d1030ef5cso9014341otp.12 for ; Sun, 04 Jul 2021 11:20:07 -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=ex11kaKi2RvY/teAKH+F07oz8rZVeLnetR1VB4k7Jro=; b=iUzRWMtIHS7jFTw6R7x+TjIZ801Dug4HyuhX55xqLv4mWN+9UpmHe0SCUbGW6TjLZa vmPRiaeBA6FjKQs29Z/nZJ/B7Osc5uNKpFmev2aV/ZRiqpU9+VwP2MeXpSUYq6KRjX+W hRFJKQS8qV7FoCMxbAhHXCTXDh8Rvucl7r37w= 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=ex11kaKi2RvY/teAKH+F07oz8rZVeLnetR1VB4k7Jro=; b=NL1kHHMFL0hAMTzH6+aVsOxKXl1kR6isJ9/+FJxfDbSTXRhGxFy3CnG+BrE2Wx2GJB uZiOv2hCi4Z90vU/rbgiIz5LL6RW4abIJRXHfAoiZNQ61jqEKpSsaPIdRuGEgG0J4YIl I/yRduxZY3LG59IaPBD6GTTub1hTTZV1iHfs4fPGxkDIRvVFJntmVCR8wdv0MzIveTBP aPHz4vlR0MVWtcKEFHwb/tnDNmp072Kp1S5qn/I0ZZ4XEebS6zLbvsoDV6L2qj4RF0t+ vAybBdd4KqyAY/2rxUtx1Ul0EsFsO7fWUzvhT/c1/zkAjOeOJ4Utb2WbVa/l+CvrE/0D OP/A== X-Gm-Message-State: AOAM530yynJhRhGCxUjqb9YVRh57hReoLPHf0TdSsfJlzaN+5ii60rmr WtfSB27EGZQn4NK3AsicWLQUj3A2MTW/pefl X-Google-Smtp-Source: ABdhPJyNFiXzrC4EdY4yXc6dBNbimmAqKXvBdAdaE7pi/GqyqrzcQ0x/Kre+8S+d+WK/YjQDgHquxw== X-Received: by 2002:a9d:3c4:: with SMTP id f62mr5264398otf.57.1625422806101; Sun, 04 Jul 2021 11:20:06 -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 z2sm2092953otm.2.2021.07.04.11.20.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Jul 2021 11:20:05 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Johan Jonker , Simon Glass , Walter Lozano Subject: [PATCH 8/8] dtoc: Update documentation to cover warnings in more detail Date: Sun, 4 Jul 2021 12:19:50 -0600 Message-Id: <20210704181950.1917106-9-sjg@chromium.org> X-Mailer: git-send-email 2.32.0.93.g670b81a890-goog In-Reply-To: <20210704181950.1917106-1-sjg@chromium.org> References: <20210704181950.1917106-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 When things go wrong it can be confusing to figure out what to change. Add a few more details to the documentation. Fix a 'make htmldocs' warning while we are here. Signed-off-by: Simon Glass --- doc/develop/driver-model/of-plat.rst | 53 ++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/doc/develop/driver-model/of-plat.rst b/doc/develop/driver-model/of-plat.rst index 74f1932473b..e2763965839 100644 --- a/doc/develop/driver-model/of-plat.rst +++ b/doc/develop/driver-model/of-plat.rst @@ -597,6 +597,59 @@ as a macro included in the driver definition:: +Problems +-------- + +In some cases you will you see something like this:: + + WARNING: the driver rockchip_rk3188_grf was not found in the driver list + +The driver list is a list of drivers, each with a name. The name is in the +U_BOOT_DRIVER() declaration, repeated twice, one in brackets and once as the +.name member. For example, in the following declaration the driver name is +`rockchip_rk3188_grf`:: + + U_BOOT_DRIVER(rockchip_rk3188_grf) = { + .name = "rockchip_rk3188_grf", + .id = UCLASS_SYSCON, + .of_match = rk3188_syscon_ids + 1, + .bind = rk3188_syscon_bind_of_plat, + }; + +The first name U_BOOT_DRIVER(xx) is used to create a linker symbol so that the +driver can be accessed at build-time without any overhead. The second one +(.name = "xx") is used at runtime when something wants to print out the driver +name. + +The dtoc tool expects to be able to find a driver for each compatible string in +the devicetree. For example, if the devicetree has:: + + grf: grf@20008000 { + compatible = "rockchip,rk3188-grf", "syscon"; + reg = <0x20008000 0x200>; + u-boot,dm-spl; + }; + +then dtoc looks at the first compatible string ("rockchip,rk3188-grf"), +converts that to a C identifier (rockchip_rk3188_grf) and then looks for that. + +Various things can cause dtoc to fail to find the driver and it tries to +warn about these. For example: + + rockchip_rk3188_uart: Missing .compatible in drivers/serial/serial_rockchip.c + : WARNING: the driver rockchip_rk3188_uart was not found in the driver list + +Without a compatible string a driver cannot be used by dtoc, even if the +compatible string is not actually needed at runtime. + +If the problem is simply that there are multiple compatible strings, the +DM_DRIVER_ALIAS() macro can be used to tell dtoc about this and avoid a problem. + +Checks are also made the referenced driver has a .compatible member and a .id +member. The first provides the array of compatible strings and the second +provides the uclass ID. + + Caveats ------- -- 2.32.0.93.g670b81a890-goog