]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
sandbox64: add support for NVMXIP QSPI
authorAbdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Mon, 17 Apr 2023 09:11:55 +0000 (10:11 +0100)
committerTom Rini <trini@konsulko.com>
Thu, 27 Apr 2023 21:01:14 +0000 (17:01 -0400)
enable NVMXIP QSPI for sandbox 64-bit

Adding two NVM XIP QSPI storage devices.

Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
arch/sandbox/dts/sandbox64.dts
arch/sandbox/dts/test.dts
configs/sandbox64_defconfig
doc/develop/driver-model/nvmxip.rst
doc/device-tree-bindings/nvmxip/nvmxip_qspi.txt
drivers/mtd/nvmxip/nvmxip-uclass.c

index f21fc181f37bdfd440c0d407c3bbbb884568c6e4..195365580a7a785fac05370ccf547fc536459f9d 100644 (file)
                cs-gpios = <0>, <&gpio_a 0>;
        };
 
+       nvmxip-qspi1@08000000 {
+               compatible = "nvmxip,qspi";
+               reg = /bits/ 64 <0x08000000 0x00200000>;
+               lba_shift = <9>;
+               lba = <4096>;
+       };
+
+       nvmxip-qspi2@08200000 {
+               compatible = "nvmxip,qspi";
+               reg = /bits/ 64 <0x08200000 0x00100000>;
+               lba_shift = <9>;
+               lba = <2048>;
+       };
 };
 
 #include "sandbox.dtsi"
index 7c1ee71cb7c22ffdd708661a70cc8ed1b22f96e5..bcdea0b8e7b282ec8487183df8684906df4657d4 100644 (file)
                compatible = "u-boot,fwu-mdata-gpt";
                fwu-mdata-store = <&mmc0>;
        };
+
+       nvmxip-qspi1@08000000 {
+               compatible = "nvmxip,qspi";
+               reg = <0x08000000 0x00200000>;
+               lba_shift = <9>;
+               lba = <4096>;
+       };
+
+       nvmxip-qspi2@08200000 {
+               compatible = "nvmxip,qspi";
+               reg = <0x08200000 0x00100000>;
+               lba_shift = <9>;
+               lba = <2048>;
+       };
 };
 
 #include "sandbox_pmic.dtsi"
index af2c56ad4c6ee95786133d9ee9c127ebe17f9d51..bb877b6a58751da94ba256c053bb747b8535cd3b 100644 (file)
@@ -260,3 +260,4 @@ CONFIG_FWU_MULTI_BANK_UPDATE=y
 CONFIG_UNIT_TEST=y
 CONFIG_UT_TIME=y
 CONFIG_UT_DM=y
+CONFIG_NVMXIP_QSPI=y
index 09afdbcccf5bb7da629f119cd30843d126360e20..e85dc220b9ce3839142eeaf5b0a83a454ee8ec0b 100644 (file)
@@ -56,7 +56,7 @@ The implementation is generic and can be used by different platforms.
 Supported hardware
 --------------------------------
 
-Any 64-bit plaform.
+Any plaform supporting readq().
 
 Configuration
 ----------------------
index cc60e9efdcd02e06228a9a791f52e92ce2ca3d91..882728d541361e8cf7290f29e6a99353f35e4a50 100644 (file)
@@ -16,7 +16,7 @@ If a platform has its own driver, please provide your own compatible
 string.
 
 2)
-               reg = <0x0 0x08000000 0x0 0x00200000>;
+               reg = /bits/ 64 <0x08000000 0x00200000>;
 
 The start address and size of the flash device. The values give here are an
 example (when the cell size is 2).
@@ -43,14 +43,14 @@ Example of multiple flash devices
 
        nvmxip-qspi1@08000000 {
                compatible = "nvmxip,qspi";
-               reg = <0x0 0x08000000 0x0 0x00200000>;
+               reg = /bits/ 64 <0x08000000 0x00200000>;
                lba_shift = <9>;
                lba = <4096>;
        };
 
        nvmxip-qspi2@08200000 {
                compatible = "nvmxip,qspi";
-               reg = <0x0 0x08200000 0x0 0x00100000>;
+               reg = /bits/ 64 <0x08200000 0x00100000>;
                lba_shift = <9>;
                lba = <2048>;
        };
index 9f96041e3d8dcfed9f79b4512d78d757bd904d93..6d8eb177b500c63a47e12f2b7302443caea5271b 100644 (file)
@@ -9,6 +9,9 @@
 #include <common.h>
 #include <dm.h>
 #include <log.h>
+#if CONFIG_IS_ENABLED(SANDBOX64)
+#include <asm/test.h>
+#endif
 #include <linux/bitops.h>
 #include "nvmxip.h"
 
@@ -36,6 +39,10 @@ static int nvmxip_post_bind(struct udevice *udev)
        char bdev_name[NVMXIP_BLKDEV_NAME_SZ + 1];
        int devnum;
 
+#if CONFIG_IS_ENABLED(SANDBOX64)
+       sandbox_set_enable_memio(true);
+#endif
+
        devnum = uclass_id_count(UCLASS_NVMXIP);
        snprintf(bdev_name, NVMXIP_BLKDEV_NAME_SZ, "blk#%d", devnum);