From 8d2cbc639c96862d44626f0cecd3d1f602b1edaf Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Tue, 2 Aug 2022 13:29:36 -0500 Subject: [PATCH] flash: nios2_qspi: Add dts binding and nodes for NIOS2 QSPI flash Add dts bindings for the NIOS2 QSPI controller and flash device and add nodes to the dts files for these devices as well. Signed-off-by: Kumar Gala --- boards/nios2/altera_max10/altera_max10.dts | 10 ++++++++++ .../flash_controller/altr,nios2-qspi-nor.yaml | 17 +++++++++++++++++ dts/bindings/qspi/altr,nios2-qspi.yaml | 14 ++++++++++++++ dts/nios2/intel/nios2f.dtsi | 10 ++++++++++ 4 files changed, 51 insertions(+) create mode 100644 dts/bindings/flash_controller/altr,nios2-qspi-nor.yaml create mode 100644 dts/bindings/qspi/altr,nios2-qspi.yaml diff --git a/boards/nios2/altera_max10/altera_max10.dts b/boards/nios2/altera_max10/altera_max10.dts index 55efcf6a660..9b258bda273 100644 --- a/boards/nios2/altera_max10/altera_max10.dts +++ b/boards/nios2/altera_max10/altera_max10.dts @@ -2,6 +2,7 @@ /dts-v1/; +#include #include / { @@ -29,3 +30,12 @@ status = "okay"; clock-frequency = ; }; + +&qspi { + status = "okay"; + n25q512ax3: n25q512ax3@0 { + compatible = "altr,nios2-qspi-nor"; + size = ; /* in bits */ + reg = <0>; + }; +}; diff --git a/dts/bindings/flash_controller/altr,nios2-qspi-nor.yaml b/dts/bindings/flash_controller/altr,nios2-qspi-nor.yaml new file mode 100644 index 00000000000..31a1b4bfa76 --- /dev/null +++ b/dts/bindings/flash_controller/altr,nios2-qspi-nor.yaml @@ -0,0 +1,17 @@ +# Copyright (c) 2020, Linaro limited +# SPDX-License-Identifier: Apache-2.0 + +description: Altera NIOS2 QSPI Flash controller supporting the JEDEC CFI interface + +compatible: "altr,nios2-qspi-nor" + +include: ["flash-controller.yaml", "jedec,jesd216.yaml"] + +on-bus: qspi + +properties: + reg: + required: true + size: + required: true + description: Flash Memory size in bits diff --git a/dts/bindings/qspi/altr,nios2-qspi.yaml b/dts/bindings/qspi/altr,nios2-qspi.yaml new file mode 100644 index 00000000000..48cfe6deef2 --- /dev/null +++ b/dts/bindings/qspi/altr,nios2-qspi.yaml @@ -0,0 +1,14 @@ +# Copyright (c) 2022, Kumar Gala +# SPDX-License-Identifier: Apache-2.0 + +description: Altera NIOS2 QSPI + +compatible: "altr,nios2-qspi" + +include: [base.yaml] + +bus: qspi + +properties: + reg: + required: true diff --git a/dts/nios2/intel/nios2f.dtsi b/dts/nios2/intel/nios2f.dtsi index ac193a67288..955d6663125 100644 --- a/dts/nios2/intel/nios2f.dtsi +++ b/dts/nios2/intel/nios2f.dtsi @@ -65,5 +65,15 @@ interrupts = <3 3>; #dma-cells = <0>; }; + + + qspi: qspi@100240 { + compatible = "altr,nios2-qspi"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x100240 0x40>, <0x8000000 0x4000000>; + reg-names = "qspi", "qspi_mm"; + status = "disabled"; + }; }; };