Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp818190ybb; Sat, 28 Mar 2020 10:52:53 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtHwer8z7KddX7/ACL2pQDYBBIVETr5Do0P1d2ay5CLT9ZvS1Iy8tZchlm/cdh/39wyg34/ X-Received: by 2002:a54:478a:: with SMTP id o10mr2992317oic.45.1585417973580; Sat, 28 Mar 2020 10:52:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585417973; cv=none; d=google.com; s=arc-20160816; b=BSsf50vOixwpqFlRRXgHFzNg7pM01BuiAQk2tJa7ndccizvofIp6DJ+ENWY3YJ4uOz caKsm/R+erSkai2HgauZjCm1bW2j7nNXmOkt4sCvEKCyWUFGAX6/JnU0dmM7TZ40QlHM fueIEIjdRLUkKpXbLeQ8bC3oGFNGsXPxZU/OtgbXClQhvSpqe0mtXUxonjNaAYgjkpGr X7mr+HeCH7hGQK6/HX9vvOH277FqOYJMd4dQHEX+vStMlw2uFXGO6wipH8Quxrbl29mx U6jQ6p7dmvEIXtthbw++Z3UMg2wvAkuspOuUH65b/ZSxr1GvMJblXLow4za133aUmP0u De+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=Ftm92ZR7oTW0PwVqWCy4L1jjNlWwPl21GDwU+9zStfE=; b=dKixSRMT1/pkGSxLEnDX3D4FlNJ9ktIj7dcH09UBZLQ2ux2/FzpTPtL1bNRoNTD229 3Bet+efHgI5KZ5nK6GzCaZCRiZ+H4gxNQlQdl4cKaXzGMej8rLFcH2DQBic+orb40FQ1 XqOOTpK2+0+i/n2iG8PdOWKI3nxvd3yM9Je3zJAcaq4ctgvxdpKkzs18l2xbbsZiOu5V Y2xO/vB4KnQGJQGa8lGTKhV/KEK6D4EMeXBsOhj5IKOzs6GEvH2rcgJCupxbUAHLq87N ZLTaxBUWbFtKGGTGwfK1YGxQxXWAN93zeX1kAeg+V4eAurijeUVOUQnmYRc0qUs/DUgM KbRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="F1fop/lS"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x2si3637657oix.42.2020.03.28.10.52.40; Sat, 28 Mar 2020 10:52:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="F1fop/lS"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726518AbgC1RwD (ORCPT + 99 others); Sat, 28 Mar 2020 13:52:03 -0400 Received: from mail-wm1-f43.google.com ([209.85.128.43]:54560 "EHLO mail-wm1-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725807AbgC1RwC (ORCPT ); Sat, 28 Mar 2020 13:52:02 -0400 Received: by mail-wm1-f43.google.com with SMTP id c81so15003164wmd.4 for ; Sat, 28 Mar 2020 10:52:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=Ftm92ZR7oTW0PwVqWCy4L1jjNlWwPl21GDwU+9zStfE=; b=F1fop/lStF2alQhaMJfpJWhSRIoodJQaeOKy+xYUEPB6KgbmOol5KlHaC3BFDoc7ak fch8TfUf7gGinBAAkt11rVwpJBArTbfgcy9KoPRwGLRzEuPE3arbYv9GctAFSSNljWk9 sN9tlawb4SexQdmydywsMdDxu/uz+yPlctxhffMy6iZCwbHBbSv0IZdxdYQmvvcOg1Xt NNMsKgEpsOiY68s9JCiCmvIGBVZYpk+HHrQPDBqFBVpAoi93f5FrzdyBSQiS3F/VeEC+ JKA+hPAT4xStGNXqbMZAxw2N+wQJ1+Gqes0H0/fFMh0xPbrdgxD5o73VUVXaOrb7cMxp AV1w== 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; bh=Ftm92ZR7oTW0PwVqWCy4L1jjNlWwPl21GDwU+9zStfE=; b=KPxKQX4vlV6wyYeQNrye9+/B5VOG5H1JAT6vfOFuVgYSYmr4SS/3ViyFZpZo87Eitx VBfFAmKfe1ffmpsoY/6uk1/Yflf7zK+5pvkgvNvfDpPZdN9jZpcvlOVMghS3RAPWhRLm dRYpYy7P8vovjsNMBz9aG38ZBFAq+HfzT6nTHw9H6W2SyC2blBq8QpJjWTduh8UoRjU3 tuFPRipbOVbryIKkIIPxcfdPDk+OqMis29LW5cj5vpWHKU3kHrFWFAcM0EMODHQWsGMe 7cjOM6GUpGDZyX758uPAfN98LPyE0rrujQNt9Zwynfhw3OLVQsTUSONO6nYQBfp8svhy Fgkw== X-Gm-Message-State: ANhLgQ2J6wILNQ8mdn6EISSknWTYXrCHL+Rr3ZSRwab3cbNABfwZQJYy 1DTBwSllGOL5RXzs5acHF3QxtuK5iDc= X-Received: by 2002:a7b:c92d:: with SMTP id h13mr4499150wml.120.1585417919606; Sat, 28 Mar 2020 10:51:59 -0700 (PDT) Received: from ogabbay-VM.habana-labs.com ([31.154.190.6]) by smtp.gmail.com with ESMTPSA id a186sm13043789wmh.33.2020.03.28.10.51.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Mar 2020 10:51:58 -0700 (PDT) From: Oded Gabbay To: linux-kernel@vger.kernel.org, oshpigelman@habana.ai, ttayar@habana.ai Cc: gregkh@linuxfoundation.org Subject: [PATCH] habanalabs: update firmware definitions Date: Sat, 28 Mar 2020 20:51:57 +0300 Message-Id: <20200328175157.29308-1-oded.gabbay@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add comments for the various errors and states of the firmware during boot. Add a mapping of a new register that will tell the driver whether the firmware executed the request from the driver or if it has encountered an error. Add a new enum for the possible values of this register. Signed-off-by: Oded Gabbay --- .../habanalabs/include/goya/goya_reg_map.h | 1 + drivers/misc/habanalabs/include/hl_boot_if.h | 51 +++++++++++++++++-- 2 files changed, 49 insertions(+), 3 deletions(-) diff --git a/drivers/misc/habanalabs/include/goya/goya_reg_map.h b/drivers/misc/habanalabs/include/goya/goya_reg_map.h index 08061282cd9c..844a6ff5929a 100644 --- a/drivers/misc/habanalabs/include/goya/goya_reg_map.h +++ b/drivers/misc/habanalabs/include/goya/goya_reg_map.h @@ -22,6 +22,7 @@ #define mmCPU_CQ_BASE_ADDR_LOW mmPSOC_GLOBAL_CONF_SCRATCHPAD_8 #define mmCPU_CQ_BASE_ADDR_HIGH mmPSOC_GLOBAL_CONF_SCRATCHPAD_9 #define mmCPU_CQ_LENGTH mmPSOC_GLOBAL_CONF_SCRATCHPAD_10 +#define mmCPU_CMD_STATUS_TO_HOST mmPSOC_GLOBAL_CONF_SCRATCHPAD_23 #define mmCPU_BOOT_ERR0 mmPSOC_GLOBAL_CONF_SCRATCHPAD_24 #define mmCPU_BOOT_ERR1 mmPSOC_GLOBAL_CONF_SCRATCHPAD_25 #define mmUPD_STS mmPSOC_GLOBAL_CONF_SCRATCHPAD_26 diff --git a/drivers/misc/habanalabs/include/hl_boot_if.h b/drivers/misc/habanalabs/include/hl_boot_if.h index 107482fb45a4..660550604362 100644 --- a/drivers/misc/habanalabs/include/hl_boot_if.h +++ b/drivers/misc/habanalabs/include/hl_boot_if.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0 * - * Copyright 2018 HabanaLabs, Ltd. + * Copyright 2018-2020 HabanaLabs, Ltd. * All Rights Reserved. * */ @@ -10,7 +10,43 @@ #define LKD_HARD_RESET_MAGIC 0xED7BD694 -/* CPU error bits in BOOT_ERROR registers */ +/* + * CPU error bits in BOOT_ERROR registers + * + * CPU_BOOT_ERR0_DRAM_INIT_FAIL DRAM initialization failed. + * DRAM is not reliable to use. + * + * CPU_BOOT_ERR0_FIT_CORRUPTED FIT data integrity verification of the + * image provided by the host has failed. + * + * CPU_BOOT_ERR0_TS_INIT_FAIL Thermal Sensor initialization failed. + * Boot continues as usual, but keep in + * mind this is a warning. + * + * CPU_BOOT_ERR0_DRAM_SKIPPED DRAM initialization has been skipped. + * Skipping DRAM initialization has been + * requested (e.g. strap, command, etc.) + * and FW skipped the DRAM initialization. + * Host can initialize the DRAM. + * + * CPU_BOOT_ERR0_BMC_WAIT_SKIPPED Waiting for BMC data will be skipped. + * Meaning the BMC data might not be + * available until reset. + * + * CPU_BOOT_ERR0_NIC_DATA_NOT_RDY NIC data from BMC is not ready. + * BMC has not provided the NIC data yet. + * Once provided this bit will be cleared. + * + * CPU_BOOT_ERR0_NIC_FW_FAIL NIC FW loading failed. + * The NIC FW loading and initialization + * failed. This means NICs are not usable. + * + * CPU_BOOT_ERR0_ENABLED Error registers enabled. + * This is a main indication that the + * running FW populates the error + * registers. Meaning the error bits are + * not garbage, but actual error statuses. + */ #define CPU_BOOT_ERR0_DRAM_INIT_FAIL (1 << 0) #define CPU_BOOT_ERR0_FIT_CORRUPTED (1 << 1) #define CPU_BOOT_ERR0_TS_INIT_FAIL (1 << 2) @@ -27,15 +63,18 @@ enum cpu_boot_status { CPU_BOOT_STATUS_SRAM_AVAIL = 3, CPU_BOOT_STATUS_IN_BTL = 4, /* BTL is H/W FSM */ CPU_BOOT_STATUS_IN_PREBOOT = 5, - CPU_BOOT_STATUS_IN_SPL = 6, + CPU_BOOT_STATUS_IN_SPL, /* deprecated - not reported */ CPU_BOOT_STATUS_IN_UBOOT = 7, CPU_BOOT_STATUS_DRAM_INIT_FAIL, /* deprecated - will be removed */ CPU_BOOT_STATUS_FIT_CORRUPTED, /* deprecated - will be removed */ + /* U-Boot console prompt activated, commands are not processed */ CPU_BOOT_STATUS_UBOOT_NOT_READY = 10, + /* Finished NICs init, reported after DRAM and NICs */ CPU_BOOT_STATUS_NIC_FW_RDY = 11, CPU_BOOT_STATUS_TS_INIT_FAIL, /* deprecated - will be removed */ CPU_BOOT_STATUS_DRAM_SKIPPED, /* deprecated - will be removed */ CPU_BOOT_STATUS_BMC_WAITING_SKIPPED, /* deprecated - will be removed */ + /* Last boot loader progress status, ready to receive commands */ CPU_BOOT_STATUS_READY_TO_BOOT = 15, }; @@ -46,4 +85,10 @@ enum kmd_msg { KMD_MSG_SKIP_BMC, }; +enum cpu_msg_status { + CPU_MSG_CLR = 0, + CPU_MSG_OK, + CPU_MSG_ERR, +}; + #endif /* HL_BOOT_IF_H */ -- 2.17.1