From patchwork Fri Jan 19 21:52:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Mayer X-Patchwork-Id: 13524208 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1503EC47DB7 for ; Fri, 19 Jan 2024 21:54:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MrYs66XaqkFwxuANtuSBijDY4mJr0aEN+YzOfNi79O8=; b=wIgtXJCTlTCwKa klOjdKPoby27p3Nw3fPi32HkYprh93VPTMscVOHmPewXDKgncpL0ppRWZtidDefmioEDz0JsuYSac P5/verL2SPsTiJQlCWgeFojJ8tIrkiXijhYSkc8av0wR0oFUkEVPV8F8rsn8NkUj+PXTd158OliFY ZHuweIcEUyjwPJiRwsH0XUy6fcjS8m5vnpHFRFbM/WyKy/Xap/MsgyGahErld3HDqiTAzO9r3/ei9 lHvPMFZ7cl3mwdBLqZbFzgDUVj7/ISVioUm/XWvi7p+EeNc/DSJsQtF7irsa+f3jWUIPu+OWaSavK Y788PMbgJrYYuAOrCy1w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQwnw-006iHQ-2x; Fri, 19 Jan 2024 21:53:36 +0000 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQwnt-006iE4-19 for linux-arm-kernel@lists.infradead.org; Fri, 19 Jan 2024 21:53:34 +0000 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1d3ae9d1109so2152745ad.0 for ; Fri, 19 Jan 2024 13:53:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1705701207; x=1706306007; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4foceVJeKU3mOZhwsqt+SDrGA8I9pAkcPI2DCqgKfW8=; b=eydyxTt08c7chF8NqSpmx33ZlRnyHY090vgDBKB7c4aTQr86X77G0+CIEsuEvdLdXu RF8ul/jBb0v5AX6mZoKKsegNxRM0/gZd42BV3JCkDnomhii7NppuWNnijQxQM2OvY4QI REvIdgm3eEQsIWg2zlHJceLNjLnzqO1a56aqc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705701207; x=1706306007; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4foceVJeKU3mOZhwsqt+SDrGA8I9pAkcPI2DCqgKfW8=; b=Zfd/07owHiquEaws0gsnzaFhzfPnuXpGicbcb7u9W7wH33XJhwj79HU6POWWnS+Gle bkhmveIJD9MTb2KGlTVKd3E630OcA6T2YfgO6zXp/B2+5oG9jn6lCaXrzCJl1U3ZF7lu ifCMmZzPLJp2i0L0asAU+k4KQ58JmRd74OtZRCl8PX0nFa0arwlvApBtk4YNgV437s7q z+iYiStYAvkTxF+maJElUdLQVJn8yA7VpZe0WeOvbUZeJhTXQXV4Oyu7a+2cho/pAkhM kDxKbZ0+U9m0g0rdHNu+tJFF3eL/ZlNLQgE41sHhodD7K4Ytyhd6Usbq8FI9hNb8ThGY fXwQ== X-Gm-Message-State: AOJu0YyzqhSoPy5E9PWwJcIkQ//TN60YNjkYGwHk6u7VZcubfuzPGgTw Mv5tqCIOLEJjJdS2GSevLV8fIm9TffIrFegrS+letaarj8pVjIU6OILsS0Y9QA== X-Google-Smtp-Source: AGHT+IEPlEjeWnPqgsDAVLeQmSjXW6eI+DLozLXQSMdK1MKkz1OHDLdAaeP0RQjOtee5AAJ7UJmZmA== X-Received: by 2002:a05:6a20:439f:b0:19a:efad:f1c3 with SMTP id i31-20020a056a20439f00b0019aefadf1c3mr1075337pzl.4.1705701206901; Fri, 19 Jan 2024 13:53:26 -0800 (PST) Received: from lbrmn-mmayer.ric.broadcom.net ([192.19.161.248]) by smtp.gmail.com with ESMTPSA id e11-20020a63f54b000000b005b92e60cf57sm3932995pgk.56.2024.01.19.13.53.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 13:53:26 -0800 (PST) Received: by lbrmn-mmayer.ric.broadcom.net (Postfix, from userid 1000) id B163E89A; Fri, 19 Jan 2024 13:53:25 -0800 (PST) From: Markus Mayer To: Krzysztof Kozlowski , Florian Fainelli , Rob Herring , Conor Dooley Cc: Markus Mayer , Linux ARM Kernel List , Device Tree Mailing List Subject: [PATCH v2 5/5] memory: brcmstb_dpfe: support DPFE API v4 Date: Fri, 19 Jan 2024 13:52:28 -0800 Message-ID: <20240119215231.758844-6-mmayer@broadcom.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240119215231.758844-1-mmayer@broadcom.com> References: <20240119215231.758844-1-mmayer@broadcom.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240119_135333_394661_1B85DC7F X-CRM114-Status: GOOD ( 16.29 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add support for version 4 of the DPFE API. This new version is largely identical to version 3. The main difference is that all commands now take the MHS version number as the first argument. Any other arguments have been pushed down by one (i.e. what used to be arg0 in v3 is arg1 in v4). Signed-off-by: Markus Mayer --- drivers/memory/brcmstb_dpfe.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/drivers/memory/brcmstb_dpfe.c b/drivers/memory/brcmstb_dpfe.c index a44a70d028f6..97dcb3762666 100644 --- a/drivers/memory/brcmstb_dpfe.c +++ b/drivers/memory/brcmstb_dpfe.c @@ -37,6 +37,9 @@ #define DRVNAME "brcmstb-dpfe" +/* Generic constants */ +#define MHS_VERSION 0x04000000 + /* DCPU register offsets */ #define REG_DCPU_RESET 0x0 #define REG_TO_DCPU_MBOX 0x10 @@ -301,6 +304,28 @@ static const struct dpfe_api dpfe_api_v3 = { }, }; +/* API v4 firmware commands */ +static struct dpfe_api dpfe_api_v4 = { + .version = 4, + .fw_name = NULL, /* We expect the firmware to have been downloaded! */ + .sysfs_attrs = dpfe_v3_groups, /* Same as v3 */ + .command = { + [DPFE_CMD_GET_INFO] = { + [MSG_HEADER] = DPFE_MSG_TYPE_COMMAND, + [MSG_COMMAND] = 0x0101, + [MSG_ARG_COUNT] = 2, + [MSG_ARG0] = MHS_VERSION, + [MSG_ARG0 + 1] = 1, /* Now the 2nd argument */ + }, + [DPFE_CMD_GET_REFRESH] = { + [MSG_HEADER] = DPFE_MSG_TYPE_COMMAND, + [MSG_COMMAND] = 0x0202, + [MSG_ARG_COUNT] = 1, + [MSG_ARG0] = MHS_VERSION, + }, + }, +}; + static const char *get_error_text(unsigned int i) { static const char * const error_text[] = { @@ -932,6 +957,7 @@ static const struct of_device_id brcmstb_dpfe_of_match[] = { { .compatible = "brcm,dpfe-cpu-v1", .data = &dpfe_api_old_v2 }, { .compatible = "brcm,dpfe-cpu-v2", .data = &dpfe_api_new_v2 }, { .compatible = "brcm,dpfe-cpu-v3", .data = &dpfe_api_v3 }, + { .compatible = "brcm,dpfe-cpu-v4", .data = &dpfe_api_v4 }, /* * This "default" compatible string should no longer be used. It has