mbox series

[0/3] spi: sophgo: add Sophgo SPI NOR controller driver

Message ID 20250224101213.26003-1-looong.bin@gmail.com
Headers show
Series spi: sophgo: add Sophgo SPI NOR controller driver | expand

Message

Longbin Li Feb. 24, 2025, 10:11 a.m. UTC
Add SPI NOR driver for Sophgo, including read, write operations.
This driver is only suitable for NOR flash.

Longbin Li (3):
  dt-bindings: spi: add Sophgo SPI NOR controller driver
  spi: sophgo: add Sophgo SPI NOR controller driver
  riscv: dts: sophgo: add Sophgo SPI NOR controller driver

 .../bindings/spi/spi-sophgo-nor.yaml          |  52 ++
 .../boot/dts/sophgo/sg2044-sophgo-sd3-10.dts  |  18 +
 arch/riscv/boot/dts/sophgo/sg2044.dtsi        |  24 +
 drivers/spi/Kconfig                           |   9 +
 drivers/spi/Makefile                          |   1 +
 drivers/spi/spi-sophgo-nor.c                  | 501 ++++++++++++++++++
 6 files changed, 605 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/spi/spi-sophgo-nor.yaml
 create mode 100644 drivers/spi/spi-sophgo-nor.c

--
2.48.1

Comments

Rob Herring (Arm) Feb. 24, 2025, 8:28 p.m. UTC | #1
On Mon, 24 Feb 2025 18:12:00 +0800, Longbin Li wrote:
> Add SPI NOR driver for Sophgo, including read, write operations.
> 
> Signed-off-by: Longbin Li <looong.bin@gmail.com>
> ---
>  .../bindings/spi/spi-sophgo-nor.yaml          | 52 +++++++++++++++++++
>  1 file changed, 52 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/spi/spi-sophgo-nor.yaml
> 

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Chen Wang Feb. 25, 2025, 12:23 a.m. UTC | #2
On 2025/2/24 18:12, Longbin Li wrote:
> Add SPI NOR device node for Sophgo.
>
> Signed-off-by: Longbin Li <looong.bin@gmail.com>
> ---
>   .../boot/dts/sophgo/sg2044-sophgo-sd3-10.dts  | 18 ++++++++++++++
>   arch/riscv/boot/dts/sophgo/sg2044.dtsi        | 24 +++++++++++++++++++
>   2 files changed, 42 insertions(+)
>
> diff --git a/arch/riscv/boot/dts/sophgo/sg2044-sophgo-sd3-10.dts b/arch/riscv/boot/dts/sophgo/sg2044-sophgo-sd3-10.dts
> index c50e61a50013..9c634920f37e 100644
> --- a/arch/riscv/boot/dts/sophgo/sg2044-sophgo-sd3-10.dts
> +++ b/arch/riscv/boot/dts/sophgo/sg2044-sophgo-sd3-10.dts
> @@ -80,6 +80,24 @@ &sd {
>   	status = "okay";
>   };
>
> +&spifmc0 {
> +	status = "okay";
> +
> +	flash@0 {
> +		compatible = "jedec,spi-nor";
> +		reg = <0>;
> +	};
> +};
> +
> +&spifmc1 {
> +	status = "okay";
> +
> +	flash@0 {
> +		compatible = "jedec,spi-nor";
> +		reg = <0>;
> +	};
> +};
> +
>   &uart1 {
>   	status = "okay";
>   };

What is your baseline? I can't see "sg2044-sophgo-sd3-10.dts " on the 
latest mainline yet.

BTW,  the name "sg2044-sophgo-sd3-10" seems a bit redundant. Wouldn't 
"sg2044-sd3-10" be better?

[......]
Chen Wang Feb. 25, 2025, 12:58 a.m. UTC | #3
hi, Longbin,

sg2044.dtsi  seems also does not exist on the master yet, please double 
check.

Regards,

Chen

On 2025/2/25 8:23, Chen Wang wrote:
>
> On 2025/2/24 18:12, Longbin Li wrote:
>> Add SPI NOR device node for Sophgo.
>>
>> Signed-off-by: Longbin Li <looong.bin@gmail.com>
>> ---
>>   .../boot/dts/sophgo/sg2044-sophgo-sd3-10.dts  | 18 ++++++++++++++
>>   arch/riscv/boot/dts/sophgo/sg2044.dtsi        | 24 +++++++++++++++++++
>>   2 files changed, 42 insertions(+)
>>
>> diff --git a/arch/riscv/boot/dts/sophgo/sg2044-sophgo-sd3-10.dts 
>> b/arch/riscv/boot/dts/sophgo/sg2044-sophgo-sd3-10.dts
>> index c50e61a50013..9c634920f37e 100644
>> --- a/arch/riscv/boot/dts/sophgo/sg2044-sophgo-sd3-10.dts
>> +++ b/arch/riscv/boot/dts/sophgo/sg2044-sophgo-sd3-10.dts
>> @@ -80,6 +80,24 @@ &sd {
>>       status = "okay";
>>   };
>>
>> +&spifmc0 {
>> +    status = "okay";
>> +
>> +    flash@0 {
>> +        compatible = "jedec,spi-nor";
>> +        reg = <0>;
>> +    };
>> +};
>> +
>> +&spifmc1 {
>> +    status = "okay";
>> +
>> +    flash@0 {
>> +        compatible = "jedec,spi-nor";
>> +        reg = <0>;
>> +    };
>> +};
>> +
>>   &uart1 {
>>       status = "okay";
>>   };
>
> What is your baseline? I can't see "sg2044-sophgo-sd3-10.dts " on the 
> latest mainline yet.
>
> BTW,  the name "sg2044-sophgo-sd3-10" seems a bit redundant. Wouldn't 
> "sg2044-sd3-10" be better?
>
> [......]
>
>