[PATCH v1 3/6] sandbox64: add support for NVMXIP QSPI
Simon Glass
sjg at chromium.org
Tue Feb 7 05:02:38 CET 2023
On Mon, 16 Jan 2023 at 10:28, <abdellatif.elkhlifi at arm.com> wrote:
>
> From: Abdellatif El Khlifi <abdellatif.elkhlifi at arm.com>
>
> enable NVMXIP QSPI for sandbox 64-bit
>
> Adding two NVM XIP QSPI storage devices.
>
> Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi at arm.com>
> ---
> arch/sandbox/dts/sandbox64.dts | 13 +++++++++++++
> arch/sandbox/dts/test.dts | 14 ++++++++++++++
> configs/sandbox64_defconfig | 1 +
> drivers/nvmxip/nvmxip.c | 4 ++++
> drivers/nvmxip/nvmxip.h | 3 +++
> 5 files changed, 35 insertions(+)
Reviewed-by: Simon Glass <sjg at chromium.org>
Nit below
>
> diff --git a/arch/sandbox/dts/sandbox64.dts b/arch/sandbox/dts/sandbox64.dts
> index a9cd7908f8..aed3801af8 100644
> --- a/arch/sandbox/dts/sandbox64.dts
> +++ b/arch/sandbox/dts/sandbox64.dts
> @@ -89,6 +89,19 @@
> cs-gpios = <0>, <&gpio_a 0>;
> };
>
> + nvmxip-qspi1 at 08000000 {
> + compatible = "nvmxip,qspi";
> + reg = <0x0 0x08000000 0x0 0x00200000>;
> + lba_shift = <9>;
> + lba = <4096>;
> + };
> +
> + nvmxip-qspi2 at 08200000 {
> + compatible = "nvmxip,qspi";
> + reg = <0x0 0x08200000 0x0 0x00100000>;
> + lba_shift = <9>;
> + lba = <2048>;
> + };
> };
>
> #include "sandbox.dtsi"
> diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts
> index dffe10adbf..c3ba0a225e 100644
> --- a/arch/sandbox/dts/test.dts
> +++ b/arch/sandbox/dts/test.dts
> @@ -1745,6 +1745,20 @@
> compatible = "u-boot,fwu-mdata-gpt";
> fwu-mdata-store = <&mmc0>;
> };
> +
> + nvmxip-qspi1 at 08000000 {
> + compatible = "nvmxip,qspi";
> + reg = <0x08000000 0x00200000>;
> + lba_shift = <9>;
> + lba = <4096>;
> + };
> +
> + nvmxip-qspi2 at 08200000 {
> + compatible = "nvmxip,qspi";
> + reg = <0x08200000 0x00100000>;
> + lba_shift = <9>;
> + lba = <2048>;
> + };
> };
>
> #include "sandbox_pmic.dtsi"
> diff --git a/configs/sandbox64_defconfig b/configs/sandbox64_defconfig
> index ba45ac0b71..cd4dadb190 100644
> --- a/configs/sandbox64_defconfig
> +++ b/configs/sandbox64_defconfig
> @@ -259,3 +259,4 @@ CONFIG_FWU_MULTI_BANK_UPDATE=y
> CONFIG_UNIT_TEST=y
> CONFIG_UT_TIME=y
> CONFIG_UT_DM=y
> +CONFIG_NVMXIP_QSPI=y
> \ No newline at end of file
> diff --git a/drivers/nvmxip/nvmxip.c b/drivers/nvmxip/nvmxip.c
> index c276fb147e..ea9b9bfa48 100644
> --- a/drivers/nvmxip/nvmxip.c
> +++ b/drivers/nvmxip/nvmxip.c
> @@ -87,6 +87,10 @@ int nvmxip_init(struct udevice *udev)
> priv_data->udev = udev;
> priv_data->plat_data = plat_data;
>
> +#if CONFIG_IS_ENABLED(SANDBOX64)
if (IS_ENABLED(CONFIG_SANDBOX64))
> + sandbox_set_enable_memio(true);
> +#endif
> +
> nvmxip_bdev_max_devs++;
>
> snprintf(bdev_name, NVMXIP_BLKDEV_NAME_SZ, "nvmxip-blk#%d", nvmxip_bdev_max_devs);
> diff --git a/drivers/nvmxip/nvmxip.h b/drivers/nvmxip/nvmxip.h
> index 47ae3bd8ab..0cb8e511f0 100644
> --- a/drivers/nvmxip/nvmxip.h
> +++ b/drivers/nvmxip/nvmxip.h
> @@ -10,6 +10,9 @@
> #define __DRIVER_NVMXIP_H__
>
> #include <asm/io.h>
> +#if CONFIG_IS_ENABLED(SANDBOX64)
> +#include <asm/test.h>
> +#endif
> #include <blk.h>
> #include <linux/bitops.h>
> #include <linux/compat.h>
> --
> 2.17.1
>
More information about the U-Boot
mailing list