From patchwork Tue Mar 17 14:09:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niel Fourie X-Patchwork-Id: 1256431 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=YEEWaMmo; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48hZn30bJrz9sTK for ; Wed, 18 Mar 2020 01:09:57 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9D6C6819AF; Tue, 17 Mar 2020 15:09:53 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1584454194; bh=peJQfC2E/2QRjbaaNlFXq2LjcfhXYyHGXOTp9+wJoX0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=YEEWaMmo7xQQEevnbIBPZlvJ/OOTHD574lJN1e/DqI/uGUAY103JSUefljq2+cpWM RpGVxBUp/hz6yHZb1Bg+4Q3pPwNCtvaWeGQP5LTwyG3PkNMtce5ywl1j0wH6thVRc+ gx8qTiHcnTTe308+IFGTlAqwARUO9+q63DNMLKvCxa568zcxbjZZNnffKGUyu5s9SJ ygiBRamQ04xbayzjOGrpuiR7OH1p5AQC690FyReetI0H4LE0zfs6fz3S4JE2CF7fpK ucnYyZSmwZ9SaQFQdDYscG0lfQMm+B1r45XB+pr02uOS+VeiArKo2adHD/UPFfaCNg gNQBlOPvvOb7w== Received: by phobos.denx.de (Postfix, from userid 109) id 2D41A819AB; Tue, 17 Mar 2020 15:09:49 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 96B1E819B3 for ; Tue, 17 Mar 2020 15:09:43 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=lusus@denx.de Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 48hZml08VVz1rsMt; Tue, 17 Mar 2020 15:09:43 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 48hZmk6xHKz1r0bl; Tue, 17 Mar 2020 15:09:42 +0100 (CET) Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id VaqJVok51-5F; Tue, 17 Mar 2020 15:09:41 +0100 (CET) X-Auth-Info: 8uB0T2yhphsT1G3bx/xSvx/G4oBfWsDV+JqrB1F0G9w= Received: from aldebaran.denx.de (unknown [62.91.23.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Tue, 17 Mar 2020 15:09:41 +0100 (CET) From: Niel Fourie To: u-boot@lists.denx.de Cc: sjg@chromium.org, Niel Fourie Subject: [PATCH 1/3] cmd: part: Add subcommand to list supported partition tables Date: Tue, 17 Mar 2020 15:09:04 +0100 Message-Id: <20200317140906.858558-2-lusus@denx.de> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200317140906.858558-1-lusus@denx.de> References: <20200317140906.858558-1-lusus@denx.de> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 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.102.2 at phobos.denx.de X-Virus-Status: Clean Add a subcommand "types" to the part command, which lists the supported partition table types. Signed-off-by: Niel Fourie CC: Simon Glass --- cmd/part.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/cmd/part.c b/cmd/part.c index 5e4e45ca6d..fae5df7b71 100644 --- a/cmd/part.c +++ b/cmd/part.c @@ -182,6 +182,26 @@ static int do_part_number(int argc, char * const argv[]) return do_part_info(argc, argv, CMD_PART_INFO_NUMBER); } +static int do_part_types(int argc, char * const argv[]) +{ + struct part_driver *drv = ll_entry_start(struct part_driver, + part_driver); + const int n_ents = ll_entry_count(struct part_driver, part_driver); + struct part_driver *entry; + int i = 0; + + puts("Supported partition tables"); + + for (entry = drv; entry != drv + n_ents; entry++) { + printf("%c %s", i ? ',' : ':', entry->name); + i++; + } + if (!i) + puts(": "); + puts("\n"); + return CMD_RET_SUCCESS; +} + static int do_part(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { if (argc < 2) @@ -197,7 +217,8 @@ static int do_part(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return do_part_size(argc - 2, argv + 2); else if (!strcmp(argv[1], "number")) return do_part_number(argc - 2, argv + 2); - + else if (!strcmp(argv[1], "types")) + return do_part_types(argc - 2, argv + 2); return CMD_RET_USAGE; } @@ -221,5 +242,7 @@ U_BOOT_CMD( " part can be either partition number or partition name\n" "part number \n" " - set environment variable to the partition number using the partition name\n" - " part must be specified as partition name" + " part must be specified as partition name\n" + "part types\n" + " - list supported partition table types" ); From patchwork Tue Mar 17 14:09:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niel Fourie X-Patchwork-Id: 1256434 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=sJJyoFNN; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48hZnK1MVlz9sSd for ; Wed, 18 Mar 2020 01:10:12 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 56393819BA; Tue, 17 Mar 2020 15:10:08 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1584454208; bh=aEEJGY/oIZYk4rDC803l/C5RgHSZiMTN3kV6KEDYYy8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=sJJyoFNNnYPY7NnamMRPNUL+OzUZoBF/c9btIWSY00trbwxaQuI76AqNy9Peh8Itd movyrZW+x1MQEh1H47It8FbyHQETfqWra3IMVB8rkztddbuNEC1MbzipLZT6R9kRsM I1hr4FTw1EfJAm6xtVVnJ2kpHz89sfo5K+yeRTTwr8YCijkN5Yc3rzLfGY73jLlgoB 2wHZURJavYqd8D1hOenhkGVWm8GFoRg8yJRR+nBfmsoGjBwrIFX2h4ZTUqPMpwgE+x GF/YsNUrROoJoxwQvHQ/loi8l3YT8gkFnsdLniLUsMY2KpffhLoNQwnUIacpkl5BSA GbsMZHu4MWQGg== Received: by phobos.denx.de (Postfix, from userid 109) id 86CC4819B0; Tue, 17 Mar 2020 15:10:00 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-out.m-online.net (mail-out.m-online.net [IPv6:2001:a60:0:28:0:1:25:1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 9F614819BA for ; Tue, 17 Mar 2020 15:09:54 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=lusus@denx.de Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 48hZmy0nzbz1rtkQ; Tue, 17 Mar 2020 15:09:54 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 48hZmy0Ydcz1r0bh; Tue, 17 Mar 2020 15:09:54 +0100 (CET) Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id 96rKH0ohOwJl; Tue, 17 Mar 2020 15:09:52 +0100 (CET) X-Auth-Info: WbjzOUA2Gf5HI7095OQRhYjcG6FQ14MXdGkCZgX8JxA= Received: from aldebaran.denx.de (unknown [62.91.23.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Tue, 17 Mar 2020 15:09:52 +0100 (CET) From: Niel Fourie To: u-boot@lists.denx.de Cc: sjg@chromium.org, Niel Fourie Subject: [PATCH 2/3] cmd: fs: Add command to list supported fs types Date: Tue, 17 Mar 2020 15:09:05 +0100 Message-Id: <20200317140906.858558-3-lusus@denx.de> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200317140906.858558-1-lusus@denx.de> References: <20200317140906.858558-1-lusus@denx.de> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 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.102.2 at phobos.denx.de X-Virus-Status: Clean Added command "fstypes" to list supported/included filesystems. Signed-off-by: Niel Fourie CC: Simon Glass --- cmd/fs.c | 11 +++++++++++ fs/fs.c | 20 ++++++++++++++++++++ include/fs.h | 5 +++++ 3 files changed, 36 insertions(+) diff --git a/cmd/fs.c b/cmd/fs.c index db74767b7b..26b47bd001 100644 --- a/cmd/fs.c +++ b/cmd/fs.c @@ -99,3 +99,14 @@ U_BOOT_CMD( "fstype : \n" "- set environment variable to filesystem type\n" ); + +static int do_fstypes_wrapper(cmd_tbl_t *cmdtp, int flag, int argc, + char * const argv[]) +{ + return do_fs_types(cmdtp, flag, argc, argv); +} + +U_BOOT_CMD( + fstypes, 1, 1, do_fstypes_wrapper, + "List supported filesystem types", "" +); diff --git a/fs/fs.c b/fs/fs.c index 0c66d60477..3e38b2e27a 100644 --- a/fs/fs.c +++ b/fs/fs.c @@ -900,3 +900,23 @@ int do_ln(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[], return 0; } + +int do_fs_types(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +{ + struct fstype_info *drv = fstypes; + const int n_ents = ARRAY_SIZE(fstypes); + struct fstype_info *entry; + int i = 0; + + puts("Supported filesystems"); + for (entry = drv; entry != drv + n_ents; entry++) { + if (entry->fstype != FS_TYPE_ANY) { + printf("%c %s", i ? ',' : ':', entry->name); + i++; + } + } + if (!i) + puts(": "); + puts("\n"); + return CMD_RET_SUCCESS; +} diff --git a/include/fs.h b/include/fs.h index 37e35c2120..b3fd0b179d 100644 --- a/include/fs.h +++ b/include/fs.h @@ -254,4 +254,9 @@ int do_fs_uuid(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[], */ int do_fs_type(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]); +/* + * List supported filesystems. + */ +int do_fs_types(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]); + #endif /* _FS_H */ From patchwork Tue Mar 17 14:09:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niel Fourie X-Patchwork-Id: 1256435 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=mlcJB5cb; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48hZnZ4x3xz9sSj for ; Wed, 18 Mar 2020 01:10:26 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AD35D819AD; Tue, 17 Mar 2020 15:10:22 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1584454223; bh=0hYxSWxmGO8nulCacFhnVNWpFp5yOu1c648yWUocrmQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=mlcJB5cbHfStUEP+QOmZFAw2JC4AeaZprQbzlbym8WF/bH+JYy0Ofrow2fxqwFx+y IKDvca5wE7qdpuhmEYWfJbnFZvkP5HMW7eG8Oc2OETnYZSg/ehyrXqry7Vj73eOuwy ZRjDH8VcIWyyZnklwbAIFVf4DX77OmABwB2N46Lc1yQPPjrLDKRzEs/y+baDJg0rXe LoA4QjPcfEqQmrmmr+P7HMvZnCElVgcWT/W4LS4nmPHfpwUK6ftoG25PudjKg9y9D5 khH3dfb+TAOO9Wdzgn+kTfqRdKwtlqjOjBfcwHB+DqJhXRDtTRyqmJ5NIdm/0k94YE MZNxngT2najVg== Received: by phobos.denx.de (Postfix, from userid 109) id D0663819C8; Tue, 17 Mar 2020 15:10:12 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-out.m-online.net (mail-out.m-online.net [IPv6:2001:a60:0:28:0:1:25:1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C7DFB819BF for ; Tue, 17 Mar 2020 15:09:59 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=lusus@denx.de Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 48hZn330kvz1rtyd; Tue, 17 Mar 2020 15:09:59 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 48hZn32gYqz1r0bj; Tue, 17 Mar 2020 15:09:59 +0100 (CET) Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id W5CGclVVHNLl; Tue, 17 Mar 2020 15:09:58 +0100 (CET) X-Auth-Info: SaXh5GLQ/fwfG0RwYU/HccJqpPGkOiWoNBTbCf0a5nw= Received: from aldebaran.denx.de (unknown [62.91.23.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Tue, 17 Mar 2020 15:09:58 +0100 (CET) From: Niel Fourie To: u-boot@lists.denx.de Cc: sjg@chromium.org, Niel Fourie Subject: [PATCH 3/3] cmd: dm: Fixed/Added DM driver listing subcommands Date: Tue, 17 Mar 2020 15:09:06 +0100 Message-Id: <20200317140906.858558-4-lusus@denx.de> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200317140906.858558-1-lusus@denx.de> References: <20200317140906.858558-1-lusus@denx.de> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 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.102.2 at phobos.denx.de X-Virus-Status: Clean Renamed dm "drivers" subcommand to "compat" (as it listed compatibility strings) and prevent it from segfaulting when drivers have no of_match populated. Added a new "drivers" subcommand to dump a list of all known DM drivers and for each, their uclass id, uclass driver and names of attached devices. Added a new "static" subcommand to dump a list of DM drivers with statically defined platform data. Signed-off-by: Niel Fourie CC: Simon Glass --- cmd/dm.c | 24 ++++++++++++++++-- drivers/core/dump.c | 60 ++++++++++++++++++++++++++++++++++++++++++++- include/dm/util.h | 6 +++++ 3 files changed, 87 insertions(+), 3 deletions(-) diff --git a/cmd/dm.c b/cmd/dm.c index 108707c298..a17ef6a1bb 100644 --- a/cmd/dm.c +++ b/cmd/dm.c @@ -48,11 +48,29 @@ static int do_dm_dump_drivers(cmd_tbl_t *cmdtp, int flag, int argc, return 0; } +static int do_dm_dump_driver_compat(cmd_tbl_t *cmdtp, int flag, int argc, + char * const argv[]) +{ + dm_dump_driver_compat(); + + return 0; +} + +static int do_dm_dump_static_driver_info(cmd_tbl_t *cmdtp, int flag, int argc, + char * const argv[]) +{ + dm_dump_static_driver_info(); + + return 0; +} + static cmd_tbl_t test_commands[] = { U_BOOT_CMD_MKENT(tree, 0, 1, do_dm_dump_all, "", ""), U_BOOT_CMD_MKENT(uclass, 1, 1, do_dm_dump_uclass, "", ""), U_BOOT_CMD_MKENT(devres, 1, 1, do_dm_dump_devres, "", ""), U_BOOT_CMD_MKENT(drivers, 1, 1, do_dm_dump_drivers, "", ""), + U_BOOT_CMD_MKENT(compat, 1, 1, do_dm_dump_driver_compat, "", ""), + U_BOOT_CMD_MKENT(static, 1, 1, do_dm_dump_static_driver_info, "", ""), }; static __maybe_unused void dm_reloc(void) @@ -91,8 +109,10 @@ static int do_dm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) U_BOOT_CMD( dm, 3, 1, do_dm, "Driver model low level access", - "tree Dump driver model tree ('*' = activated)\n" + "dm tree Dump driver model tree ('*' = activated)\n" "dm uclass Dump list of instances for each uclass\n" "dm devres Dump list of device resources for each device\n" - "dm drivers Dump list of drivers and their compatible strings\n" + "dm drivers Dump list of drivers with uclass and instances\n" + "dm compat Dump list of drivers with compatibility strings\n" + "dm static Dump list of drivers with static platform data\n" ); diff --git a/drivers/core/dump.c b/drivers/core/dump.c index e73ebeabcc..a42bfb577f 100644 --- a/drivers/core/dump.c +++ b/drivers/core/dump.c @@ -97,7 +97,7 @@ void dm_dump_uclass(void) } } -void dm_dump_drivers(void) +void dm_dump_driver_compat(void) { struct driver *d = ll_entry_start(struct driver, driver); const int n_ents = ll_entry_count(struct driver, driver); @@ -107,6 +107,9 @@ void dm_dump_drivers(void) puts("Driver Compatible\n"); puts("--------------------------------\n"); for (entry = d; entry < d + n_ents; entry++) { + if (!entry->of_match) { + continue; + } for (match = entry->of_match; match->compatible; match++) printf("%-20.20s %s\n", match == entry->of_match ? entry->name : "", @@ -115,3 +118,58 @@ void dm_dump_drivers(void) printf("%-20.20s\n", entry->name); } } + +void dm_dump_drivers(void) +{ + struct driver *d = ll_entry_start(struct driver, driver); + const int n_ents = ll_entry_count(struct driver, driver); + struct driver *entry; + struct udevice *udev; + struct uclass *uc; + int i; + + puts("Driver uid uclass Devices\n"); + for (i = 0; i < 77; i++) + putc('-'); + putc('\n'); + + for (entry = d; entry < d + n_ents; entry++) { + uclass_get(entry->id, &uc); + + printf("%-25.25s %-3.3d %-20.20s ", entry->name, entry->id, + uc ? uc->uc_drv->name : ""); + + if (!uc) { + puts("\n"); + continue; + } + + i = 0; + uclass_foreach_dev(udev, uc) { + if (udev->driver != entry) + continue; + if (i) + printf("%-51.51s", ""); + + printf("%-25.25s\n", udev->name); + i++; + } + if (!i) + puts("\n"); + } +} + +void dm_dump_static_driver_info(void) +{ + struct driver_info *drv = ll_entry_start(struct driver_info, + driver_info); + const int n_ents = ll_entry_count(struct driver_info, driver_info); + struct driver_info *entry; + + puts("Driver Address\n"); + puts("------------------------------\n"); + for (entry = drv; entry != drv + n_ents; entry++) { + printf("%-20.20s @%08lx\n", entry->name, + (ulong)map_to_sysmem(entry->platdata)); + } +} diff --git a/include/dm/util.h b/include/dm/util.h index 0ccb3fbadf..974347ce0b 100644 --- a/include/dm/util.h +++ b/include/dm/util.h @@ -42,6 +42,12 @@ static inline void dm_dump_devres(void) /* Dump out a list of drivers */ void dm_dump_drivers(void); +/* Dump out a list with each driver's compatibility strings */ +void dm_dump_driver_compat(void); + +/* Dump out a list of drivers with static platform data */ +void dm_dump_static_driver_info(void); + /** * Check if an of node should be or was bound before relocation. *