From patchwork Wed Apr 10 09:29:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Th=C3=A9o_Lebrun?= X-Patchwork-Id: 13623971 Received: from mslow1.mail.gandi.net (mslow1.mail.gandi.net [217.70.178.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6A8311598F7; Wed, 10 Apr 2024 09:33:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.178.240 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712741588; cv=none; b=uPN1RkG1sQ4j2DF2zccooxSNp/txbc65cERLDriD7xVtuQeVdhnuQg/bpo9Ozz/MVfgXBZ4tD3gFxIbWfmOo3rJhRrq8eOluutdZuPKLLr/0zktQwfufS5ky2WkQ5eF3DjojDiwd3xzrEh17gFBdcUJyP2VqiWv+NOSacnLi9DA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712741588; c=relaxed/simple; bh=T1YIXNKOKmk0HCpf7gFyTxJ5Gf3Ca8L3mGSoUrehSd8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rKkIKv0LCGBGWuDwYULWJa/39/YOj5UDqfvMmv6Q/g48K+l16a3xlKNgWwWWmPXFaenACfkW/EtEmn4jSoeECmMMHT+19kcJFjpcHcfKvT9FNudM5qy0SqMepYqpDxbKo+BcAjDDp/851bxCIxPskzAM4LAxT6sact7LiN+qqwk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=dbCqCr3W; arc=none smtp.client-ip=217.70.178.240 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="dbCqCr3W" Received: from relay6-d.mail.gandi.net (unknown [IPv6:2001:4b98:dc4:8::226]) by mslow1.mail.gandi.net (Postfix) with ESMTP id 5C71CC5F28; Wed, 10 Apr 2024 09:29:13 +0000 (UTC) Received: by mail.gandi.net (Postfix) with ESMTPSA id 58193C0004; Wed, 10 Apr 2024 09:29:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1712741350; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rTF3tEOlEX8botUulcBFWhU0qypXrMI0sFEbs2/cCHs=; b=dbCqCr3WYuLwsnm50stbIfoYR6zbNOFVAl+n2GIVomYHvx2KnijqOd8s0YU62k4lMeDWop TisRWqFvUfD6JeYDubLZCpkXCkCziISk1rOuX4NW13D6VzQ/GGnvYcxIUh4nrLzktxFoiE Rcj7NPdlQui2t175YlHmtq9DBIwDoVUI3Vomvt/I4H6PxCzTSKF2AKpNMRH9ljcfhFsvey GdiXdRvXVh0N7d8I58bXQ8SbO4ShYPpPGRzcny5bRqvFmxPOLjLk/HIzILc5pvIXV4N575 R81vWnjT1GSI4lejITkWIAroxFQl6rwhAc6xsMHlqd7L4gZ8WUAdBsVlGBEI6w== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Wed, 10 Apr 2024 11:29:04 +0200 Subject: [PATCH v3 1/9] spi: dt-bindings: cdns,qspi-nor: sort compatibles alphabetically Precedence: bulk X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240410-cdns-qspi-mbly-v3-1-7b7053449cf7@bootlin.com> References: <20240410-cdns-qspi-mbly-v3-0-7b7053449cf7@bootlin.com> In-Reply-To: <20240410-cdns-qspi-mbly-v3-0-7b7053449cf7@bootlin.com> To: Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Vaishnav Achath , Thomas Bogendoerfer , Rob Herring Cc: linux-spi@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, Vladimir Kondratiev , Gregory CLEMENT , Thomas Petazzoni , Tawfik Bayouk , =?utf-8?q?Th=C3=A9o_Lebrun?= , Krzysztof Kozlowski X-Mailer: b4 0.13.0 X-GND-Sasl: theo.lebrun@bootlin.com Compatibles are ordered by date of addition. Switch to (deterministic) alphabetical ordering. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Théo Lebrun --- Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml b/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml index cca81f89e252..b865d4cc25cc 100644 --- a/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml +++ b/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml @@ -68,12 +68,12 @@ properties: - items: - enum: - amd,pensando-elba-qspi - - ti,k2g-qspi - - ti,am654-ospi - intel,lgm-qspi - - xlnx,versal-ospi-1.0 - intel,socfpga-qspi - starfive,jh7110-qspi + - ti,am654-ospi + - ti,k2g-qspi + - xlnx,versal-ospi-1.0 - const: cdns,qspi-nor - const: cdns,qspi-nor From patchwork Wed Apr 10 09:29:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Th=C3=A9o_Lebrun?= X-Patchwork-Id: 13623972 Received: from mslow1.mail.gandi.net (mslow1.mail.gandi.net [217.70.178.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6A8061598F2; Wed, 10 Apr 2024 09:33:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.178.240 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712741589; cv=none; b=YrSGMM68JIOiWad51sERr2sQeIke7744hYIs+5VHQVPvKx/7MuxGaTd+WdVOdrCSvNhPAavfcZz5CaidvX7jTkvkHTDEmO0tzQuhuTLIpczns14r+M2gnijRcqu3H8BECIDDrGQ62ZWJp30cKViMo5OfRs/f2XSxXHBmUZniVQ8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712741589; c=relaxed/simple; bh=1nSBf6bY6T/hjYzEOpJcKmCPuaUO6X4kXnC660BYQeA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XMefd/nAecj2kCLJFdqUHdMue0Zm+0CV5hWrPbX6Q0JGYen+mbg6HVxfA6ct2tPAE5S2VhO3baNjco3vYcRQXhZ7ml0vOqYEDTnITArsfZFIG/l8kHT7vtw1CfGkeaGtp1/p1oTbTgJYJOvYXt8ticio2N19Qtu6cP+/+gGn5NM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=QhsoV/B2; arc=none smtp.client-ip=217.70.178.240 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="QhsoV/B2" Received: from relay6-d.mail.gandi.net (unknown [217.70.183.198]) by mslow1.mail.gandi.net (Postfix) with ESMTP id 6AD28C5F49; Wed, 10 Apr 2024 09:29:13 +0000 (UTC) Received: by mail.gandi.net (Postfix) with ESMTPSA id 1E6EBC000D; Wed, 10 Apr 2024 09:29:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1712741350; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=334v5AxGG/MkJbS2JIrPuKDmglCIG0uO//Ytkag6OEg=; b=QhsoV/B2Q7n/q41p414iJ2q2qcE2w1F/o+9LMbL4tr1DYPJIhCy4HQjniVMGYH2pIBIqMD Wwcmf97aVc9f1HaFA30TmvUgZF6gtRS222HrRU9wvbmo2T7cS1f3RV6btln9uRPUiEYj1R LjYwSDXLlcEVkaf2nHVf9PkvgG+dvcA8bausiKuokZJy6fMq+qcI4Po2jPahKvHNV1mbnt aIshsZZY/D04Yk+Ql0e1hJt+5Jap0vfL/G/HwEaIVcwl320U65mDEN/lEVOQ2FVyzCEkwR UqE185WoQfqrdlVf3OTiJNnIGbJDsgi/IbfD8EV1a6QEocgWcRJ8rkaLiIKocg== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Wed, 10 Apr 2024 11:29:05 +0200 Subject: [PATCH v3 2/9] spi: dt-bindings: cdns,qspi-nor: add mobileye,eyeq5-ospi compatible Precedence: bulk X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240410-cdns-qspi-mbly-v3-2-7b7053449cf7@bootlin.com> References: <20240410-cdns-qspi-mbly-v3-0-7b7053449cf7@bootlin.com> In-Reply-To: <20240410-cdns-qspi-mbly-v3-0-7b7053449cf7@bootlin.com> To: Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Vaishnav Achath , Thomas Bogendoerfer , Rob Herring Cc: linux-spi@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, Vladimir Kondratiev , Gregory CLEMENT , Thomas Petazzoni , Tawfik Bayouk , =?utf-8?q?Th=C3=A9o_Lebrun?= , Krzysztof Kozlowski X-Mailer: b4 0.13.0 X-GND-Sasl: theo.lebrun@bootlin.com Add Mobileye EyeQ5 compatible. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Théo Lebrun --- Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml b/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml index b865d4cc25cc..587baf35e4e3 100644 --- a/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml +++ b/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml @@ -70,6 +70,7 @@ properties: - amd,pensando-elba-qspi - intel,lgm-qspi - intel,socfpga-qspi + - mobileye,eyeq5-ospi - starfive,jh7110-qspi - ti,am654-ospi - ti,k2g-qspi From patchwork Wed Apr 10 09:29:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Th=C3=A9o_Lebrun?= X-Patchwork-Id: 13623954 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 09E8D1552EF; Wed, 10 Apr 2024 09:29:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.198 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712741355; cv=none; b=aKX9TXgXEzWxJPIQsaAIsLv/sGAgHOViJmzjB2R5smyuuXAMHSz2TQa48hS5qm1d5YlN67AQMGkrLvB4QKgOcphxc/gHMrBoj95VZKJfoT4gEx2J9EMX2I8s9UeQnvGtQbpTDjECaFdPhOMcaEc+5kbwGK8HLV1ZbtjZIhTnx5o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712741355; c=relaxed/simple; bh=j7jp4MN+LYsXlZP8dNCi02N09LjgAISkwlJ4l3i8sX0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=c01EP8ZRMPFFAiIpFppMTVzMK9dfeciyyOenGDcHpxRbWPojdCPhxX24PERttt+HZLyWanpT9NouB/PI8ZCCHXMTTILlhBguZY6o1Wex9tE6EVFmtMGjO/29aL48ekmy+42/fJUEVZN5sY5CgAb3biQ/ieNzft4qPq60VpMWpgw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=ShY5u6HQ; arc=none smtp.client-ip=217.70.183.198 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="ShY5u6HQ" Received: by mail.gandi.net (Postfix) with ESMTPSA id D0E77C0012; Wed, 10 Apr 2024 09:29:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1712741351; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=P1LLm8lZtTD1zK+wyxxMiKmW0zGXnL2EmRjIXVJmlh0=; b=ShY5u6HQKpRjc9102JH/yeSKOKqNlzqtHFNDhJUmcL6DZxI7jY7CLMsSbKxXhGvJfGdceH A58Pot/m0M3MMrodrmWO/N8ROTyROR04/hvwSgY/Ah9kAjLpxtpey5UjQg5BlZZ0thqfqr 7CHxue0v3VWpH6KeADzxOy+BBYJlnwh5BVwCxQVkdyNB5lmzmNRIitBbbT5u2q4Pz589Qf W4B1WXvJXjxazWKSN9OtitzacjGIoB310anB4VyLiKLGYP+XhEGZqAfBdZ9UI4bxfSxN2l fa6ohyeNP1Y7exaFfezZ4kUQomnzGcbqqlM6rJ07sKzMeVA75laMfKfVdBZ+iw== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Wed, 10 Apr 2024 11:29:06 +0200 Subject: [PATCH v3 3/9] spi: dt-bindings: cdns,qspi-nor: make cdns,fifo-depth optional Precedence: bulk X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240410-cdns-qspi-mbly-v3-3-7b7053449cf7@bootlin.com> References: <20240410-cdns-qspi-mbly-v3-0-7b7053449cf7@bootlin.com> In-Reply-To: <20240410-cdns-qspi-mbly-v3-0-7b7053449cf7@bootlin.com> To: Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Vaishnav Achath , Thomas Bogendoerfer , Rob Herring Cc: linux-spi@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, Vladimir Kondratiev , Gregory CLEMENT , Thomas Petazzoni , Tawfik Bayouk , =?utf-8?q?Th=C3=A9o_Lebrun?= X-Mailer: b4 0.13.0 X-GND-Sasl: theo.lebrun@bootlin.com Make cdns,fifo-depth devicetree property optional. Value can be detected at runtime. Upper SRAMPARTITION register bits are read-only. Procedure to find FIFO depth is therefore to write 0xFFFFFFFF and read back to get amount of writeable bits. Signed-off-by: Théo Lebrun Acked-by: Rob Herring --- Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml b/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml index 587baf35e4e3..d48ecd6cd5ad 100644 --- a/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml +++ b/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml @@ -146,7 +146,6 @@ required: - reg - interrupts - clocks - - cdns,fifo-depth - cdns,fifo-width - cdns,trigger-address - '#address-cells' From patchwork Wed Apr 10 09:29:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Th=C3=A9o_Lebrun?= X-Patchwork-Id: 13623955 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 98C9F1552F9; Wed, 10 Apr 2024 09:29:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.198 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712741356; cv=none; b=sZ5OOXMj2vLWkg2Tye4oNKN5GBGNR/ncXnNY9CoMf8mAC8RwyWfVBjPmmAOz7HHjj2rg7G7VnWRN3fYommN3srzv4b3nowTSEvajp5/WVhlPfoNXIK9SXQ5LPn5wTE+QbVkW1dgidNTXP5fj75MKAf+oatF8bXrMaRBlLpCEvOo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712741356; c=relaxed/simple; bh=mvhdsulZewicd+LkZmV4JeCPpon1LTdEp97o824fgI0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=N6AEbVuQhCvecu2r/mRbpUfWiAbNcJxpc71pR+4mFaY9o9dDbJdpbXhG9idfGcKxy0e7K9CUEwv2wtmaitQw0tVOe+ITgZ0HOyLjuU8LXZ1msL31y8pjxnZPoDCjwuytqxJ6u/XPGkOO12NBRHXuu5a3G+8rjIBZAWDsEGs2KgY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=E+6gjx2n; arc=none smtp.client-ip=217.70.183.198 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="E+6gjx2n" Received: by mail.gandi.net (Postfix) with ESMTPSA id 739EAC0009; Wed, 10 Apr 2024 09:29:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1712741352; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9QcHeygYSqhOv8EePeVmyZmnPYQEFehYxee2vzIZ9EQ=; b=E+6gjx2n/iyBev1MHJsAAnndnpKg7NB7IRzI1DRSsdFi00QTtPbxVXDlQF0Is+BrOHkOGl 210KORfmjl4HtU4kED/rmn+WBeFEKlwMby07eK1nCFmtDD/pDKGTINGtGhgBFL2u/tOc2q 7YtwDkFvSmt+uR8eweHLapfZUAcbC6dnX4PjtqKYZ9cesbdHfVozOXivu0KCVNaLAeROVD L7IL9AZVHsMoAoIPrCS5ORHhETwznLrY5oMKaRBzWpE+exRHJQyl9Ufj0z+lRhtosikt4q DFoY4W0qIpPDrwGsVa1wJiSTR2cEpqq7+fDFWZmQ0QVxpqD0WHnkTS4QEASjzw== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Wed, 10 Apr 2024 11:29:07 +0200 Subject: [PATCH v3 4/9] spi: cadence-qspi: allow FIFO depth detection Precedence: bulk X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240410-cdns-qspi-mbly-v3-4-7b7053449cf7@bootlin.com> References: <20240410-cdns-qspi-mbly-v3-0-7b7053449cf7@bootlin.com> In-Reply-To: <20240410-cdns-qspi-mbly-v3-0-7b7053449cf7@bootlin.com> To: Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Vaishnav Achath , Thomas Bogendoerfer , Rob Herring Cc: linux-spi@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, Vladimir Kondratiev , Gregory CLEMENT , Thomas Petazzoni , Tawfik Bayouk , =?utf-8?q?Th=C3=A9o_Lebrun?= X-Mailer: b4 0.13.0 X-GND-Sasl: theo.lebrun@bootlin.com If FIFO depth DT property is provided, check it matches what hardware reports and warn otherwise. Else, use hardware provided value. Hardware exposes FIFO depth indirectly because CQSPI_REG_SRAMPARTITION is partially read-only. Move probe cqspi->ddata assignment prior to cqspi_of_get_pdata() call. Signed-off-by: Théo Lebrun --- drivers/spi/spi-cadence-quadspi.c | 39 ++++++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c index 9896e9fe7ffb..b499f2e5ec87 100644 --- a/drivers/spi/spi-cadence-quadspi.c +++ b/drivers/spi/spi-cadence-quadspi.c @@ -1503,6 +1503,7 @@ static int cqspi_of_get_flash_pdata(struct platform_device *pdev, static int cqspi_of_get_pdata(struct cqspi_st *cqspi) { + const struct cqspi_driver_platdata *ddata = cqspi->ddata; struct device *dev = &cqspi->pdev->dev; struct device_node *np = dev->of_node; u32 id[2]; @@ -1510,8 +1511,8 @@ static int cqspi_of_get_pdata(struct cqspi_st *cqspi) cqspi->is_decoded_cs = of_property_read_bool(np, "cdns,is-decoded-cs"); if (of_property_read_u32(np, "cdns,fifo-depth", &cqspi->fifo_depth)) { - dev_err(dev, "couldn't determine fifo-depth\n"); - return -ENXIO; + /* Zero signals FIFO depth should be runtime detected. */ + cqspi->fifo_depth = 0; } if (of_property_read_u32(np, "cdns,fifo-width", &cqspi->fifo_width)) { @@ -1541,8 +1542,6 @@ static void cqspi_controller_init(struct cqspi_st *cqspi) { u32 reg; - cqspi_controller_enable(cqspi, 0); - /* Configure the remap address register, no remap */ writel(0, cqspi->iobase + CQSPI_REG_REMAP); @@ -1576,8 +1575,30 @@ static void cqspi_controller_init(struct cqspi_st *cqspi) reg |= CQSPI_REG_CONFIG_DMA_MASK; writel(reg, cqspi->iobase + CQSPI_REG_CONFIG); } +} - cqspi_controller_enable(cqspi, 1); +static void cqspi_controller_detect_fifo_depth(struct cqspi_st *cqspi) +{ + const struct cqspi_driver_platdata *ddata = cqspi->ddata; + struct device *dev = &cqspi->pdev->dev; + u32 reg, fifo_depth; + + /* + * Bits N-1:0 are writable while bits 31:N are read as zero, with 2^N + * the FIFO depth. + */ + writel(U32_MAX, cqspi->iobase + CQSPI_REG_SRAMPARTITION); + reg = readl(cqspi->iobase + CQSPI_REG_SRAMPARTITION); + fifo_depth = reg + 1; + + /* FIFO depth of zero means no value from devicetree was provided. */ + if (cqspi->fifo_depth == 0) { + cqspi->fifo_depth = fifo_depth; + dev_dbg(dev, "using FIFO depth of %u\n", fifo_depth); + } else if (fifo_depth != cqspi->fifo_depth) { + dev_warn(dev, "detected FIFO depth (%u) different from config (%u)\n", + fifo_depth, cqspi->fifo_depth); + } } static int cqspi_request_mmap_dma(struct cqspi_st *cqspi) @@ -1730,6 +1751,7 @@ static int cqspi_probe(struct platform_device *pdev) cqspi->pdev = pdev; cqspi->host = host; cqspi->is_jh7110 = false; + cqspi->ddata = ddata = of_device_get_match_data(dev); platform_set_drvdata(pdev, cqspi); /* Obtain configuration from OF. */ @@ -1821,8 +1843,6 @@ static int cqspi_probe(struct platform_device *pdev) /* write completion is supported by default */ cqspi->wr_completion = true; - ddata = of_device_get_match_data(dev); - cqspi->ddata = ddata; if (ddata) { if (ddata->quirks & CQSPI_NEEDS_WR_DELAY) cqspi->wr_delay = 50 * DIV_ROUND_UP(NSEC_PER_SEC, @@ -1864,7 +1884,10 @@ static int cqspi_probe(struct platform_device *pdev) } cqspi_wait_idle(cqspi); + cqspi_controller_enable(cqspi, 0); + cqspi_controller_detect_fifo_depth(cqspi); cqspi_controller_init(cqspi); + cqspi_controller_enable(cqspi, 1); cqspi->current_cs = -1; cqspi->sclk = 0; @@ -1947,7 +1970,9 @@ static int cqspi_runtime_resume(struct device *dev) clk_prepare_enable(cqspi->clk); cqspi_wait_idle(cqspi); + cqspi_controller_enable(cqspi, 0); cqspi_controller_init(cqspi); + cqspi_controller_enable(cqspi, 1); cqspi->current_cs = -1; cqspi->sclk = 0; From patchwork Wed Apr 10 09:29:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Th=C3=A9o_Lebrun?= X-Patchwork-Id: 13623956 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 68B0813D2BC; Wed, 10 Apr 2024 09:29:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.198 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712741357; cv=none; b=F9iyg++h3gZXlRM6njqulEuT1ZAX9L+mmbvwAikb9RJG+IkHZLoXEXFWe91HndfoFiSzOHrccv7Xu38uiAe8xafUUJM/fgOMQw84Fihh1GfsZunPySruVAeQW3fdEcPaLM/qMrvxIRgrOB+pHTmg78/tKg7avEIC7S4cRVw9ImM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712741357; c=relaxed/simple; bh=XllhvdNXULIE3CImgSBufNbbReemMbchd9h8L7I837A=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=bhyquqH4OiUKY8HeYGlzhFjQvm2PgsGP7EeAfkQOIJH8DYCqfGj7rl5hcSrW0YTGCmGxnD8RjpH4jc+KZ1caNYiun71bM1KhC/wVCViYRSdl4XiVFnn2GaIkq5fL3Rv+BTs+8qlasVr4shGmhrxOa6CxIL1SOLtn/UIUUMJYWok= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=pFRsG+H4; arc=none smtp.client-ip=217.70.183.198 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="pFRsG+H4" Received: by mail.gandi.net (Postfix) with ESMTPSA id 2E23BC0002; Wed, 10 Apr 2024 09:29:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1712741352; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qT2L9De8YkW05zivGysH06k/sTuQS9j+DtTxCa88wj8=; b=pFRsG+H4vyr+tpo0uK0Zr/biVUnYkP/DFrU7kPN2jIbW5xI2MdNCCxYkvLdd1214/RIcrO 50bd/l53bmuI+S0wJiYq4cImG4DxKD436/AiWYKNxhPbCBg+IEehr9YUc5Je/VhcNBQ5+X EH5OItp5myteh3tIVOh7Zv03X9E0SJovHZ0F0VyU5SPDoY+T4qLKacRAYwBLF3OBjriuW6 zlM/jAGZJuoWbIZt12raR0yC5OXKIe2MRoCU5kMI00KE7k67t3nMuEVNo6GQizs35Kz2Fv dOk4d80RpdPemEbmM+GKAxhu0RVXpnW2xu5XSD/jAa1Dwa9cLVw5fn2tat2yzg== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Wed, 10 Apr 2024 11:29:08 +0200 Subject: [PATCH v3 5/9] spi: cadence-qspi: add no-IRQ mode to indirect reads Precedence: bulk X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240410-cdns-qspi-mbly-v3-5-7b7053449cf7@bootlin.com> References: <20240410-cdns-qspi-mbly-v3-0-7b7053449cf7@bootlin.com> In-Reply-To: <20240410-cdns-qspi-mbly-v3-0-7b7053449cf7@bootlin.com> To: Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Vaishnav Achath , Thomas Bogendoerfer , Rob Herring Cc: linux-spi@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, Vladimir Kondratiev , Gregory CLEMENT , Thomas Petazzoni , Tawfik Bayouk , =?utf-8?q?Th=C3=A9o_Lebrun?= X-Mailer: b4 0.13.0 X-GND-Sasl: theo.lebrun@bootlin.com Support reads through polling, without any IRQ. The main reason is performance; profiling shows that the first IRQ comes quickly on our specific hardware. Once this IRQ arrives, we poll until all data is retrieved. Avoid initial sleep to reduce IRQ count. Hide this behavior behind a quirk flag. This is confirmed through micro-benchmarks, but also end-to-end performance tests. Mobileye EyeQ5, octal flash, reading 235M on a UBIFS filesystem: - No optimizations, ~10.34s, ~22.7 MB/s, 199230 IRQs - CQSPI_SLOW_SRAM, ~10.34s, ~22.7 MB/s, 70284 IRQs - CQSPI_RD_NO_IRQ, ~9.37s, ~25.1 MB/s, 521 IRQs Signed-off-by: Théo Lebrun --- drivers/spi/spi-cadence-quadspi.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c index b499f2e5ec87..cde84d10678e 100644 --- a/drivers/spi/spi-cadence-quadspi.c +++ b/drivers/spi/spi-cadence-quadspi.c @@ -42,6 +42,7 @@ static_assert(CQSPI_MAX_CHIPSELECT <= SPI_CS_CNT_MAX); #define CQSPI_NO_SUPPORT_WR_COMPLETION BIT(3) #define CQSPI_SLOW_SRAM BIT(4) #define CQSPI_NEEDS_APB_AHB_HAZARD_WAR BIT(5) +#define CQSPI_RD_NO_IRQ BIT(6) /* Capabilities */ #define CQSPI_SUPPORTS_OCTAL BIT(0) @@ -702,6 +703,7 @@ static int cqspi_indirect_read_execute(struct cqspi_flash_pdata *f_pdata, const size_t n_rx) { struct cqspi_st *cqspi = f_pdata->cqspi; + bool use_irq = !(cqspi->ddata && cqspi->ddata->quirks & CQSPI_RD_NO_IRQ); struct device *dev = &cqspi->pdev->dev; void __iomem *reg_base = cqspi->iobase; void __iomem *ahb_base = cqspi->ahb_base; @@ -725,17 +727,20 @@ static int cqspi_indirect_read_execute(struct cqspi_flash_pdata *f_pdata, * all the read interrupts disabled for max performance. */ - if (!cqspi->slow_sram) + if (use_irq && cqspi->slow_sram) + writel(CQSPI_REG_IRQ_WATERMARK, reg_base + CQSPI_REG_IRQMASK); + else if (use_irq) writel(CQSPI_IRQ_MASK_RD, reg_base + CQSPI_REG_IRQMASK); else - writel(CQSPI_REG_IRQ_WATERMARK, reg_base + CQSPI_REG_IRQMASK); + writel(0, reg_base + CQSPI_REG_IRQMASK); reinit_completion(&cqspi->transfer_complete); writel(CQSPI_REG_INDIRECTRD_START_MASK, reg_base + CQSPI_REG_INDIRECTRD); while (remaining > 0) { - if (!wait_for_completion_timeout(&cqspi->transfer_complete, + if (use_irq && + !wait_for_completion_timeout(&cqspi->transfer_complete, msecs_to_jiffies(CQSPI_READ_TIMEOUT_MS))) ret = -ETIMEDOUT; @@ -777,7 +782,7 @@ static int cqspi_indirect_read_execute(struct cqspi_flash_pdata *f_pdata, bytes_to_read = cqspi_get_rd_sram_level(cqspi); } - if (remaining > 0) { + if (use_irq && remaining > 0) { reinit_completion(&cqspi->transfer_complete); if (cqspi->slow_sram) writel(CQSPI_REG_IRQ_WATERMARK, reg_base + CQSPI_REG_IRQMASK); From patchwork Wed Apr 10 09:29:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Th=C3=A9o_Lebrun?= X-Patchwork-Id: 13623957 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0ACBE15531D; Wed, 10 Apr 2024 09:29:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.198 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712741357; cv=none; b=g5p4o1Xd3DO4jnVilDGBDxj25UrivxLc6aLnBMeZmvIjnZ4FIwAGxGdIiM5PSvcaqUhEjXzLMZSjHzBCrKgPztysIBlUA1oDXgpgcKtCnvD6NaKcZH5vuGGa7nG3L4fC7NywXf/cLr5E0dJgKsKB7r2I18pSDkuTmVE1FsrNI3M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712741357; c=relaxed/simple; bh=yknB+7qTEVSApo7twiMZf9uswY1p1QPEpYLKQmR+whs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=j6QoNPt8g+RMbaAEDIvRQfg/1BsnLlUTVXxIkPhnaKKPUbzNYTWIEOqMbDNINa+cxLz+OslEYponvRbw0KRtD3cvhpcT0z39r89R9DjEZokvpScs1zGxaEvK+pNiY2yGGJaO7PY8/AiJD3mIjjaGEdayQlLl/+U3n644rzjqS18= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=KOU4JR8F; arc=none smtp.client-ip=217.70.183.198 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="KOU4JR8F" Received: by mail.gandi.net (Postfix) with ESMTPSA id D3354C0010; Wed, 10 Apr 2024 09:29:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1712741353; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Oqn8emte3xu2XqiT6+4r45XXMdjD8s3EgYSdiWO/wSE=; b=KOU4JR8Fv1K2+w6GWVB0nXsk81F1XTXMY5fPJUgAAb2xvaeqnv16riK98g/vCcReurUCgk d0z7LvSlRqBuHAB7i4lmcJNnsqedCSJ52ug57vVhBxyMSvLwodMbgCCdG42D7VLQjdlTRI QxlsDnfjtaraXnyg7UaL4JSNgUhsFpI1KACnTg5Bru+C4OXdkk1OubbIHxg+W8mB8mcSKr 9YM+efhdrVHSKS1tX+YT/OXxfED8F9op8P4cepmRtspa80hB+q70PlWNBkRmlTFjgGOrjo eyAz7ZRWqVAivIedZ3epFWI+1kA2m9h6B2gfHM8l8vKayh/KpqK+fBrS18oLQA== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Wed, 10 Apr 2024 11:29:09 +0200 Subject: [PATCH v3 6/9] spi: cadence-qspi: add early busywait to cqspi_wait_for_bit() Precedence: bulk X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240410-cdns-qspi-mbly-v3-6-7b7053449cf7@bootlin.com> References: <20240410-cdns-qspi-mbly-v3-0-7b7053449cf7@bootlin.com> In-Reply-To: <20240410-cdns-qspi-mbly-v3-0-7b7053449cf7@bootlin.com> To: Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Vaishnav Achath , Thomas Bogendoerfer , Rob Herring Cc: linux-spi@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, Vladimir Kondratiev , Gregory CLEMENT , Thomas Petazzoni , Tawfik Bayouk , =?utf-8?q?Th=C3=A9o_Lebrun?= X-Mailer: b4 0.13.0 X-GND-Sasl: theo.lebrun@bootlin.com Call readl_relaxed_poll_timeout() with no sleep at the start of cqspi_wait_for_bit(). If its short timeout expires, a sleeping readl_relaxed_poll_timeout() call takes the relay. The reason is to avoid hrtimer interrupts on the system. All read operations are expected to take less than 100µs. Signed-off-by: Théo Lebrun --- drivers/spi/spi-cadence-quadspi.c | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c index cde84d10678e..fecb76cfb932 100644 --- a/drivers/spi/spi-cadence-quadspi.c +++ b/drivers/spi/spi-cadence-quadspi.c @@ -120,6 +120,7 @@ struct cqspi_driver_platdata { /* Operation timeout value */ #define CQSPI_TIMEOUT_MS 500 #define CQSPI_READ_TIMEOUT_MS 10 +#define CQSPI_BUSYWAIT_TIMEOUT_US 500 /* Runtime_pm autosuspend delay */ #define CQSPI_AUTOSUSPEND_TIMEOUT 2000 @@ -298,13 +299,27 @@ struct cqspi_driver_platdata { #define CQSPI_REG_VERSAL_DMA_VAL 0x602 -static int cqspi_wait_for_bit(void __iomem *reg, const u32 mask, bool clr) +static int cqspi_wait_for_bit(const struct cqspi_driver_platdata *ddata, + void __iomem *reg, const u32 mask, bool clr, + bool busywait) { + u64 timeout_us = CQSPI_TIMEOUT_MS * USEC_PER_MSEC; u32 val; + if (busywait) { + int ret = readl_relaxed_poll_timeout(reg, val, + (((clr ? ~val : val) & mask) == mask), + 0, CQSPI_BUSYWAIT_TIMEOUT_US); + + if (ret != -ETIMEDOUT) + return ret; + + timeout_us -= CQSPI_BUSYWAIT_TIMEOUT_US; + } + return readl_relaxed_poll_timeout(reg, val, (((clr ? ~val : val) & mask) == mask), - 10, CQSPI_TIMEOUT_MS * 1000); + 10, timeout_us); } static bool cqspi_is_idle(struct cqspi_st *cqspi) @@ -434,8 +449,8 @@ static int cqspi_exec_flash_cmd(struct cqspi_st *cqspi, unsigned int reg) writel(reg, reg_base + CQSPI_REG_CMDCTRL); /* Polling for completion. */ - ret = cqspi_wait_for_bit(reg_base + CQSPI_REG_CMDCTRL, - CQSPI_REG_CMDCTRL_INPROGRESS_MASK, 1); + ret = cqspi_wait_for_bit(cqspi->ddata, reg_base + CQSPI_REG_CMDCTRL, + CQSPI_REG_CMDCTRL_INPROGRESS_MASK, 1, true); if (ret) { dev_err(&cqspi->pdev->dev, "Flash command execution timed out.\n"); @@ -790,8 +805,8 @@ static int cqspi_indirect_read_execute(struct cqspi_flash_pdata *f_pdata, } /* Check indirect done status */ - ret = cqspi_wait_for_bit(reg_base + CQSPI_REG_INDIRECTRD, - CQSPI_REG_INDIRECTRD_DONE_MASK, 0); + ret = cqspi_wait_for_bit(cqspi->ddata, reg_base + CQSPI_REG_INDIRECTRD, + CQSPI_REG_INDIRECTRD_DONE_MASK, 0, true); if (ret) { dev_err(dev, "Indirect read completion error (%i)\n", ret); goto failrd; @@ -1091,8 +1106,8 @@ static int cqspi_indirect_write_execute(struct cqspi_flash_pdata *f_pdata, } /* Check indirect done status */ - ret = cqspi_wait_for_bit(reg_base + CQSPI_REG_INDIRECTWR, - CQSPI_REG_INDIRECTWR_DONE_MASK, 0); + ret = cqspi_wait_for_bit(cqspi->ddata, reg_base + CQSPI_REG_INDIRECTWR, + CQSPI_REG_INDIRECTWR_DONE_MASK, 0, false); if (ret) { dev_err(dev, "Indirect write completion error (%i)\n", ret); goto failwr; From patchwork Wed Apr 10 09:29:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Th=C3=A9o_Lebrun?= X-Patchwork-Id: 13623958 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ED193155A21; Wed, 10 Apr 2024 09:29:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.198 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712741358; cv=none; b=qrPGYeH9pxQnrnayZhPb9px4jGZIpCppuWUEvhDjo4qYS2tZHo0zl100B66SPTVx54Keno1PIJAAMioZPbOYsFHfhLKNE+hcuajmKHoj9sGxVrwW1Ns0HSjyCQawAc9ggWm1YcV/TN24+yProQ/49p+Wa1NZnJSOU/5JmyjJEUE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712741358; c=relaxed/simple; bh=UqJ88SIv9Av9k1LZPkwfMWb06OliBDPxwdXSoyYMZsM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=oIa/5ctaLFFH0+S8hfHkLOmcA+k/DRF1kL0CNrVjuJuzHFHUxTgdFWPfFCPmjkZ3R+fnY9vqr3AtfpGpOqa1h4n3HgMYKVWTEx/FRZtzn1cZn2e7i1j2vtUM9doWbJC5A0llvcMQdbDDqg/WLuhHhLul6NKysGqUqC6iTUATP1M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=fSNdOaCF; arc=none smtp.client-ip=217.70.183.198 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="fSNdOaCF" Received: by mail.gandi.net (Postfix) with ESMTPSA id 8F06CC0014; Wed, 10 Apr 2024 09:29:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1712741354; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KYYUJbx9oUlZqWNgUsoI1rjk0Kzr1DDG33TmakwDi24=; b=fSNdOaCFH8h9WZA4uyt2JnHlOESCwKIZqzLQjLfBYXb3QPo57EAloBtzjlVZnON9OD8jgj jGeTdh/u2KVXXwtVvvK+HIimiXPcx2LW7D2USvYJkOvA3918axtZmwI3l9DuLcUDJoKES8 +APhV2oIQWeHCzdqrtTFbCt9k25kLE18FysR3eZWJp+lNJLgQI6a1ZHLN0YW4m4DcXaLsn Kc1tJug8E7kGWTAzit3mRN42/s3Iel5GXqqbL+YJvFwOYhFlVa9bEV/O8KWEq7zdowl/sk dN9/bqc62QKTghAeXdqAHU8divFnnim4JjODTRW7+WdE5z1TBrWBb8BYiXjiLg== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Wed, 10 Apr 2024 11:29:10 +0200 Subject: [PATCH v3 7/9] spi: cadence-qspi: add mobileye,eyeq5-ospi compatible Precedence: bulk X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240410-cdns-qspi-mbly-v3-7-7b7053449cf7@bootlin.com> References: <20240410-cdns-qspi-mbly-v3-0-7b7053449cf7@bootlin.com> In-Reply-To: <20240410-cdns-qspi-mbly-v3-0-7b7053449cf7@bootlin.com> To: Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Vaishnav Achath , Thomas Bogendoerfer , Rob Herring Cc: linux-spi@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, Vladimir Kondratiev , Gregory CLEMENT , Thomas Petazzoni , Tawfik Bayouk , =?utf-8?q?Th=C3=A9o_Lebrun?= X-Mailer: b4 0.13.0 X-GND-Sasl: theo.lebrun@bootlin.com Declare a new mobileye,eyeq5-ospi compatible. Signed-off-by: Théo Lebrun --- drivers/spi/spi-cadence-quadspi.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c index fecb76cfb932..7a287b329728 100644 --- a/drivers/spi/spi-cadence-quadspi.c +++ b/drivers/spi/spi-cadence-quadspi.c @@ -2057,6 +2057,12 @@ static const struct cqspi_driver_platdata pensando_cdns_qspi = { .quirks = CQSPI_NEEDS_APB_AHB_HAZARD_WAR | CQSPI_DISABLE_DAC_MODE, }; +static const struct cqspi_driver_platdata mobileye_eyeq5_ospi = { + .hwcaps_mask = CQSPI_SUPPORTS_OCTAL, + .quirks = CQSPI_DISABLE_DAC_MODE | CQSPI_NO_SUPPORT_WR_COMPLETION | + CQSPI_RD_NO_IRQ, +}; + static const struct of_device_id cqspi_dt_ids[] = { { .compatible = "cdns,qspi-nor", @@ -2090,6 +2096,10 @@ static const struct of_device_id cqspi_dt_ids[] = { .compatible = "amd,pensando-elba-qspi", .data = &pensando_cdns_qspi, }, + { + .compatible = "mobileye,eyeq5-ospi", + .data = &mobileye_eyeq5_ospi, + }, { /* end of table */ } }; From patchwork Wed Apr 10 09:29:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Th=C3=A9o_Lebrun?= X-Patchwork-Id: 13623959 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B324A156C67; Wed, 10 Apr 2024 09:29:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.198 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712741358; cv=none; b=dPeub1UboPJJSTS2pjoXTiuki4+gFm8uTzBdWtpuD3toqpWiUVZ6BvxBYaqCINJtv2Um4+3y6gGKOhb5ghqDSzldrSxzvr981dy41ikdHQ08XPcTkqJOEsfv8Yhz6BmRUrXnYMRbHvpMVRsy06igaqA43X+sAtGnWmC5HSZ5RuQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712741358; c=relaxed/simple; bh=vuFml2Tbieyo6tIWPbphQoCJOz5E27f346lkQPXpqDA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=htJ+kC9ArNxFWdXkkNapuxbyUU3R5EETk2kLEq18eJ8G18yIcE4DOcXcScNnBP1xbLgIqPWtdnkn7lUSw5+v0KII9p3QX9MOBCJLnGRaxx+YvtEVxtEmucN6obhTWEyIf2eqw7uv1g4u8+isYsRbJgdTnoLWGNig6B8eSm6HWjY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=DuEN1tE7; arc=none smtp.client-ip=217.70.183.198 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="DuEN1tE7" Received: by mail.gandi.net (Postfix) with ESMTPSA id 4F571C0015; Wed, 10 Apr 2024 09:29:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1712741354; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/Ysm4DbzpqSZj84XzesirmTyGQsD5pPgqx8ZXriQXW0=; b=DuEN1tE7IEmwzzZI41CG8Wl+2Q91FSN024Kmli244kCLZCdJ3w35RL8XTJat16WMIAVdN3 Uf+unyEXT7yYVJhu0zXL5gib5t//O1q5m6Q/9HdG/JX2fF1eKnV7mslRbcoKtbnM51ZUOL LZfaRqu/UDsss7gJb5LTuOEEb835LChQ2K/bFJmu31+Md/W9inFbnEK4IjkdxP0XmIhmjN 4ClCzHDNjPf1syt2qn1srXxqrgneneaL5otzFM/CYocVIqGRifrcUVq0ER0hbCApYrhDIc zQ5FsosqZNTyKu3pVT5hgjQvE9d4h0BNxyHn5MVlrwUIqbW1qcr5DCTyjievAg== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Wed, 10 Apr 2024 11:29:11 +0200 Subject: [PATCH v3 8/9] MIPS: mobileye: eyeq5: Add SPI-NOR controller node Precedence: bulk X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240410-cdns-qspi-mbly-v3-8-7b7053449cf7@bootlin.com> References: <20240410-cdns-qspi-mbly-v3-0-7b7053449cf7@bootlin.com> In-Reply-To: <20240410-cdns-qspi-mbly-v3-0-7b7053449cf7@bootlin.com> To: Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Vaishnav Achath , Thomas Bogendoerfer , Rob Herring Cc: linux-spi@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, Vladimir Kondratiev , Gregory CLEMENT , Thomas Petazzoni , Tawfik Bayouk , =?utf-8?q?Th=C3=A9o_Lebrun?= X-Mailer: b4 0.13.0 X-GND-Sasl: theo.lebrun@bootlin.com Add Cadence Quad SPI controller node to EyeQ5 SoC devicetree. Octal is supported. Signed-off-by: Théo Lebrun --- arch/mips/boot/dts/mobileye/eyeq5.dtsi | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/arch/mips/boot/dts/mobileye/eyeq5.dtsi b/arch/mips/boot/dts/mobileye/eyeq5.dtsi index 8d4f65ec912d..1543c2b9bcb6 100644 --- a/arch/mips/boot/dts/mobileye/eyeq5.dtsi +++ b/arch/mips/boot/dts/mobileye/eyeq5.dtsi @@ -158,6 +158,21 @@ timer { clocks = <&core0_clk>; }; }; + + ospi: spi@2100000 { + compatible = "mobileye,eyeq5-ospi", "cdns,qspi-nor"; + reg = <0 0x2100000 0x0 0x1000>, + <0 0x10000000 0x0 0x8000000>; + interrupt-parent = <&gic>; + interrupts = ; + clocks = <&clocks EQ5C_DIV_OSPI>; + assigned-clocks = <&clocks EQ5C_DIV_OSPI>; + assigned-clock-rates = <167000000>; + #address-cells = <1>; + #size-cells = <0>; + cdns,fifo-width = <4>; + cdns,trigger-address = <0x00000000>; + }; }; }; From patchwork Wed Apr 10 09:29:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Th=C3=A9o_Lebrun?= X-Patchwork-Id: 13623960 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 33660156F23; Wed, 10 Apr 2024 09:29:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.198 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712741359; cv=none; b=T7UVeHdXdAXm5fNZ8XqNetbNk82sCIIYSMNhPqC41mwOYUoXB6adXYvrs+1BRXjap5nwcH3jPjA3k/RooSosXW3//WRg4zpbp6x7qdbOIiTZpdVoNMnx3cxc2Cf5kqc0E2GG7ztKgR3kL/PrPJbeCQe8e9B1NJXfaWujKu14HoY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712741359; c=relaxed/simple; bh=F/9Yanst1hBH0HDc3LX9DP2jVFZb4lsc+NgoZKuU+jU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=GArxIlkx+LiQMoe5/tO8+GptALHNpd6iejWDmcYCSCsZ4dN9m71hKNEPie5Pbx89p5DzZloJsUZ4kR7CxezocgQKoFYOv+iNO2n+/AzdoqBgtmRF2oBxHsKdBEbIGYFDx0AtEsGLoPhrfPBLZl86YyW1vQGNZtJ+mxaR7AM4DUs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=CqnCNTKc; arc=none smtp.client-ip=217.70.183.198 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="CqnCNTKc" Received: by mail.gandi.net (Postfix) with ESMTPSA id 01BE9C000E; Wed, 10 Apr 2024 09:29:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1712741355; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0sXwCu/pnKjPhnbG0qZ+rGnft7Ztmr1z9mGamghTqGc=; b=CqnCNTKchCH3wuSZAEJsID231NfI+9qO5g+mJ82GrR4nktt2r2++b1n7g+XTbR+I9Rmcjr FjwL6hPJr2qTSpKf5j7iwkZL7J90xE/oXxiqg8vzaoMtJe0fu+5+0KbanUp4GbPzfZYfch lhOdccPax6vRL7KNxZYjsaqWcDDCirtzLs1r990MCv7/TJ3LC4g2JpO7RZYZu7SmitH8XS KfJOi0zYXGGhnRc3cIQjHDIli8Xh/CHqaOKoPuzZ9vrkG9rtNyFROvEW6Q/Bj6GJyaGITR pTdUkeer6SdJmzqvq5bsjepPO8qjyvBp0ybZJSEFkFQl2VtjQWWDfIxd60OViA== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Wed, 10 Apr 2024 11:29:12 +0200 Subject: [PATCH v3 9/9] MIPS: mobileye: eyeq5: add octal flash node to eval board DTS Precedence: bulk X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240410-cdns-qspi-mbly-v3-9-7b7053449cf7@bootlin.com> References: <20240410-cdns-qspi-mbly-v3-0-7b7053449cf7@bootlin.com> In-Reply-To: <20240410-cdns-qspi-mbly-v3-0-7b7053449cf7@bootlin.com> To: Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Vaishnav Achath , Thomas Bogendoerfer , Rob Herring Cc: linux-spi@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, Vladimir Kondratiev , Gregory CLEMENT , Thomas Petazzoni , Tawfik Bayouk , =?utf-8?q?Th=C3=A9o_Lebrun?= X-Mailer: b4 0.13.0 X-GND-Sasl: theo.lebrun@bootlin.com Add SPI-NOR octal flash node to evaluation board devicetree. Signed-off-by: Théo Lebrun --- arch/mips/boot/dts/mobileye/eyeq5-epm5.dts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/arch/mips/boot/dts/mobileye/eyeq5-epm5.dts b/arch/mips/boot/dts/mobileye/eyeq5-epm5.dts index 6898b2d8267d..0e5fee7b680c 100644 --- a/arch/mips/boot/dts/mobileye/eyeq5-epm5.dts +++ b/arch/mips/boot/dts/mobileye/eyeq5-epm5.dts @@ -21,3 +21,18 @@ memory@0 { <0x8 0x02000000 0x0 0x7E000000>; }; }; + +&ospi { + flash0: flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; /* chip select */ + + spi-max-frequency = <40000000>; + spi-rx-bus-width = <8>; + cdns,read-delay = <1>; + cdns,tshsl-ns = <400>; + cdns,tsd2d-ns = <400>; + cdns,tchsh-ns = <125>; + cdns,tslch-ns = <50>; + }; +};