diff --git a/drivers/mtd/nand/raw_nand.c b/drivers/mtd/nand/raw_nand.c index 1fb5facaf..021e30b3b 100644 --- a/drivers/mtd/nand/raw_nand.c +++ b/drivers/mtd/nand/raw_nand.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020, STMicroelectronics - All Rights Reserved + * Copyright (c) 2019-2022, STMicroelectronics - All Rights Reserved * * SPDX-License-Identifier: BSD-3-Clause */ @@ -8,13 +8,13 @@ #include #include -#include - #include #include #include #include +#include + #define ONFI_SIGNATURE_ADDR 0x20U /* CRC calculation */ @@ -24,9 +24,6 @@ /* Status register */ #define NAND_STATUS_READY BIT(6) -#define SZ_128M 0x08000000U -#define SZ_512 0x200U - static struct rawnand_device rawnand_dev; #pragma weak plat_get_raw_nand_data diff --git a/include/plat/common/common_def.h b/include/plat/common/common_def.h index 632f1229c..1d3ac15f4 100644 --- a/include/plat/common/common_def.h +++ b/include/plat/common/common_def.h @@ -1,17 +1,48 @@ /* - * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2015-2022, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ #ifndef COMMON_DEF_H #define COMMON_DEF_H -#include - #include #include #include +#include + +#define SZ_32 U(0x00000020) +#define SZ_64 U(0x00000040) +#define SZ_128 U(0x00000080) +#define SZ_256 U(0x00000100) +#define SZ_512 U(0x00000200) + +#define SZ_1K U(0x00000400) +#define SZ_2K U(0x00000800) +#define SZ_4K U(0x00001000) +#define SZ_8K U(0x00002000) +#define SZ_16K U(0x00004000) +#define SZ_32K U(0x00008000) +#define SZ_64K U(0x00010000) +#define SZ_128K U(0x00020000) +#define SZ_256K U(0x00040000) +#define SZ_512K U(0x00080000) + +#define SZ_1M U(0x00100000) +#define SZ_2M U(0x00200000) +#define SZ_4M U(0x00400000) +#define SZ_8M U(0x00800000) +#define SZ_16M U(0x01000000) +#define SZ_32M U(0x02000000) +#define SZ_64M U(0x04000000) +#define SZ_128M U(0x08000000) +#define SZ_256M U(0x10000000) +#define SZ_512M U(0x20000000) + +#define SZ_1G U(0x40000000) +#define SZ_2G U(0x80000000) + /****************************************************************************** * Required platform porting definitions that are expected to be common to * all platforms diff --git a/plat/st/stm32mp1/stm32mp1_boot_device.c b/plat/st/stm32mp1/stm32mp1_boot_device.c index 714ab80c5..27dbf4ed2 100644 --- a/plat/st/stm32mp1/stm32mp1_boot_device.c +++ b/plat/st/stm32mp1/stm32mp1_boot_device.c @@ -14,9 +14,6 @@ #include #include -#define SZ_512 0x200U -#define SZ_64M 0x4000000U - #if STM32MP_RAW_NAND || STM32MP_SPI_NAND static int get_data_from_otp(struct nand_device *nand_dev, bool is_slc) {