From ebc41cadc6bf9cdd092469c779557a40293b882e Mon Sep 17 00:00:00 2001 From: Dinesh Maniyam Date: Thu, 27 Feb 2025 00:18:17 +0800 Subject: drivers: mtd: nand: Add driver for Cadence Nand Enable driver for Cadence NAND for the family device agilex5. This driver is leveraged from the path /drivers/mtd/nand/raw/cadence-nand-controller.c from the stable version 6.11.2. Signed-off-by: Dinesh Maniyam --- include/linux/mtd/rawnand.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/linux') diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h index 2d85b392465..3bb0a3679f9 100644 --- a/include/linux/mtd/rawnand.h +++ b/include/linux/mtd/rawnand.h @@ -981,6 +981,7 @@ struct nand_chip { struct nand_bbt_descr *bbt_md; struct nand_bbt_descr *badblock_pattern; + int cur_cs; void *priv; -- cgit v1.2.3 From 597fe4098dabdd05c44ec1d68e990a61798cad38 Mon Sep 17 00:00:00 2001 From: Dinesh Maniyam Date: Thu, 27 Feb 2025 00:18:28 +0800 Subject: drivers: mtd: nand: base: Add support for Hardware ECC for check bad block Leverage linux code to support hardware ECC interface to verify nand bad block. Signed-off-by: Dinesh Maniyam --- include/linux/mtd/rawnand.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/linux') diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h index 3bb0a3679f9..3e80b134063 100644 --- a/include/linux/mtd/rawnand.h +++ b/include/linux/mtd/rawnand.h @@ -131,6 +131,17 @@ void nand_wait_ready(struct mtd_info *mtd); #define NAND_DATA_IFACE_CHECK_ONLY -1 +/* + * There are different places where the manufacturer stores the factory bad + * block markers. + * + * Position within the block: Each of these pages needs to be checked for a + * bad block marking pattern. + */ +#define NAND_BBM_FIRSTPAGE BIT(24) +#define NAND_BBM_SECONDPAGE BIT(25) +#define NAND_BBM_LASTPAGE BIT(26) + /* * Constants for ECC_MODES */ -- cgit v1.2.3 From 54a4c83b12ae81289df93c048c4dd6f62481d242 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 23 Mar 2025 16:58:32 +0100 Subject: clk: clk-mux: Use struct udevice instead of struct device Use U-Boot specific struct udevice instead of Linux compatibility struct device in clk-mux registration. Signed-off-by: Marek Vasut --- include/linux/clk-provider.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/linux') diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index 59f9c241b84..f27878ae6fa 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h @@ -242,7 +242,7 @@ struct clk *clk_register_divider(struct device *dev, const char *name, void __iomem *reg, u8 shift, u8 width, u8 clk_divider_flags); -struct clk *clk_register_mux(struct device *dev, const char *name, +struct clk *clk_register_mux(struct udevice *dev, const char *name, const char * const *parent_names, u8 num_parents, unsigned long flags, void __iomem *reg, u8 shift, u8 width, -- cgit v1.2.3 From aee51ad0d945cf3ffbad143adb76aba40f66ecb7 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 23 Mar 2025 16:58:36 +0100 Subject: clk: clk-gate: Use struct udevice instead of struct device Use U-Boot specific struct udevice instead of Linux compatibility struct device in clk-gate registration. Signed-off-by: Marek Vasut --- include/linux/clk-provider.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/linux') diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index f27878ae6fa..e282be12897 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h @@ -105,7 +105,7 @@ struct clk_gate { #define CLK_GATE_HIWORD_MASK BIT(1) extern const struct clk_ops clk_gate_ops; -struct clk *clk_register_gate(struct device *dev, const char *name, +struct clk *clk_register_gate(struct udevice *dev, const char *name, const char *parent_name, unsigned long flags, void __iomem *reg, u8 bit_idx, u8 clk_gate_flags, spinlock_t *lock); -- cgit v1.2.3 From 45c6b6a850895b58d39ca1906a741ebc8563f4bc Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 23 Mar 2025 16:58:42 +0100 Subject: clk: clk-composite: Use struct udevice instead of struct device Use U-Boot specific struct udevice instead of Linux compatibility struct device in clk-composite registration. Signed-off-by: Marek Vasut --- include/linux/clk-provider.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/linux') diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index e282be12897..d44ead53079 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h @@ -223,7 +223,7 @@ struct clk_composite { #define to_clk_composite(_clk) container_of(_clk, struct clk_composite, clk) -struct clk *clk_register_composite(struct device *dev, const char *name, +struct clk *clk_register_composite(struct udevice *dev, const char *name, const char * const *parent_names, int num_parents, struct clk *mux_clk, const struct clk_ops *mux_ops, struct clk *rate_clk, const struct clk_ops *rate_ops, -- cgit v1.2.3 From e14dd5c35aa8098b024257d9ee0073d1ba6e0281 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 23 Mar 2025 16:58:48 +0100 Subject: clk: clk-divider: Use struct udevice instead of struct device Use U-Boot specific struct udevice instead of Linux compatibility struct device in clk-divider clock registration. Signed-off-by: Marek Vasut --- include/linux/clk-provider.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/linux') diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index d44ead53079..198f3ff0e42 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h @@ -237,7 +237,7 @@ struct clk *clk_register_fixed_factor(struct device *dev, const char *name, const char *parent_name, unsigned long flags, unsigned int mult, unsigned int div); -struct clk *clk_register_divider(struct device *dev, const char *name, +struct clk *clk_register_divider(struct udevice *dev, const char *name, const char *parent_name, unsigned long flags, void __iomem *reg, u8 shift, u8 width, u8 clk_divider_flags); -- cgit v1.2.3 From 1987fa7b344bdde12e0b07194b462388fe562954 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 23 Mar 2025 16:58:51 +0100 Subject: clk: clk-fixed-factor: Use struct udevice instead of struct device Use U-Boot specific struct udevice instead of Linux compatibility struct device in clk-fixed-factor registration. Signed-off-by: Marek Vasut --- include/linux/clk-provider.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/linux') diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index 198f3ff0e42..5ea2171492e 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h @@ -233,7 +233,7 @@ struct clk *clk_register_composite(struct udevice *dev, const char *name, int clk_register(struct clk *clk, const char *drv_name, const char *name, const char *parent_name); -struct clk *clk_register_fixed_factor(struct device *dev, const char *name, +struct clk *clk_register_fixed_factor(struct udevice *dev, const char *name, const char *parent_name, unsigned long flags, unsigned int mult, unsigned int div); -- cgit v1.2.3 From be96ac51ec68fe669c33b1d0ffe5c1aed06afebe Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Mon, 17 Mar 2025 04:12:43 +0100 Subject: linux: Add generic struct stat {} Add generic implementation of struct stat {} imported from Linux 6.13.y commit 27560b371ab8 ("fs: pack struct kstat better"). This can be used by filesystem code imported from elsewhere. Now struct stat {} becomes available on all supported architectures. Signed-off-by: Marek Vasut --- include/linux/stat.h | 45 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 35 insertions(+), 10 deletions(-) (limited to 'include/linux') diff --git a/include/linux/stat.h b/include/linux/stat.h index 5eba6334e60..b65bff7e97d 100644 --- a/include/linux/stat.h +++ b/include/linux/stat.h @@ -65,9 +65,7 @@ struct stat { unsigned long __unused5; }; -#endif /* __PPC__ */ - -#if defined (__ARM__) || defined (__I386__) || defined (__M68K__) || defined (__bfin__) ||\ +#elif defined (__ARM__) || defined (__I386__) || defined (__M68K__) || defined (__bfin__) ||\ defined (__microblaze__) || defined (__nios2__) struct stat { @@ -93,9 +91,7 @@ struct stat { unsigned long __unused5; }; -#endif /* __ARM__ */ - -#if defined (__MIPS__) +#elif defined (__MIPS__) struct stat { dev_t st_dev; @@ -124,9 +120,7 @@ struct stat { long st_pad4[14]; }; -#endif /* __MIPS__ */ - -#if defined(__SH__) || defined(__XTENSA__) +#elif defined(__SH__) || defined(__XTENSA__) struct stat { unsigned long st_dev; @@ -149,7 +143,38 @@ struct stat { unsigned long __unused5; }; -#endif /* __SH__ || __XTENSA__ */ +#else + +/* + * Everybody gets this wrong and has to stick with it for all + * eternity. Hopefully, this version gets used by new architectures + * so they don't fall into the same traps. + * + */ +struct stat { + unsigned long st_dev; /* Device. */ + unsigned long st_ino; /* File serial number. */ + unsigned int st_mode; /* File mode. */ + unsigned int st_nlink; /* Link count. */ + unsigned int st_uid; /* User ID of the file's owner. */ + unsigned int st_gid; /* Group ID of the file's group. */ + unsigned long st_rdev; /* Device number, if device. */ + unsigned long __pad1; + long st_size; /* Size of file, in bytes. */ + int st_blksize; /* Optimal block size for I/O. */ + int __pad2; + long st_blocks; /* Number 512-byte blocks allocated. */ + long st_atime; /* Time of last access. */ + unsigned long st_atime_nsec; + long st_mtime; /* Time of last modification. */ + unsigned long st_mtime_nsec; + long st_ctime; /* Time of last status change. */ + unsigned long st_ctime_nsec; + unsigned int __unused4; + unsigned int __unused5; +}; + +#endif #ifdef __cplusplus } -- cgit v1.2.3