c2cf7e25 | 01-Mar-2024 |
William Zhang <william.zhang@broadcom.com> |
mtd: rawnand: brcmnand: Add support for getting ecc setting from strap
BCMBCA broadband SoC based board design does not specify ecc setting in dts but rather use the SoC NAND strap info to obtain th
mtd: rawnand: brcmnand: Add support for getting ecc setting from strap
BCMBCA broadband SoC based board design does not specify ecc setting in dts but rather use the SoC NAND strap info to obtain the ecc strength and spare area size setting. Add brcm,nand-ecc-use-strap dts propety for this purpose and update driver to support this option. However these two options can not be used at the same time.
Signed-off-by: William Zhang <william.zhang@broadcom.com> Reviewed-by: David Regan <dregan@broadcom.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20240301173308.226004-1-william.zhang@broadcom.com
show more ...
|
29d53c54 | 27-Feb-2024 |
William Zhang <william.zhang@broadcom.com> |
mtd: rawnand: brcmnand: fix sparse warnings
Fix the following sparse warnings: sparse warnings: (new ones prefixed by >>) >> drivers/mtd/nand/raw/brcmnand/bcmbca_nand.c:79:41: sparse: sparse: cast r
mtd: rawnand: brcmnand: fix sparse warnings
Fix the following sparse warnings: sparse warnings: (new ones prefixed by >>) >> drivers/mtd/nand/raw/brcmnand/bcmbca_nand.c:79:41: sparse: sparse: cast removes address space '__iomem' of expression drivers/mtd/nand/raw/brcmnand/bcmbca_nand.c:80:17: sparse: sparse: cast removes address space '__iomem' of expression drivers/mtd/nand/raw/brcmnand/bcmbca_nand.c:80:17: sparse: sparse: cast removes address space '__iomem' of expression drivers/mtd/nand/raw/brcmnand/bcmbca_nand.c:80:17: sparse: sparse: cast removes address space '__iomem' of expression
Fixes: c52c16d1bee5 ("mtd: rawnand: brcmnand: Add BCMBCA read data bus interface") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202402270940.gmVLVRg0-lkp@intel.com/ Signed-off-by: William Zhang <william.zhang@broadcom.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20240227190258.200929-1-william.zhang@broadcom.com
show more ...
|
8e7daa85 | 23-Feb-2024 |
William Zhang <william.zhang@broadcom.com> |
mtd: rawnand: brcmnand: Support write protection setting from dts
The write protection feature is controlled by the module parameter wp_on with default set to enabled. But not all the board use this
mtd: rawnand: brcmnand: Support write protection setting from dts
The write protection feature is controlled by the module parameter wp_on with default set to enabled. But not all the board use this feature especially in BCMBCA broadband board. And module parameter is not sufficient as different board can have different option. Add a device tree property and allow this feature to be configured through the board dts on per board basis.
Signed-off-by: William Zhang <william.zhang@broadcom.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Reviewed-by: Kamal Dasu <kamal.dasu@broadcom.com> Reviewed-by: David Regan <dregan@broadcom.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20240223034758.13753-14-william.zhang@broadcom.com
show more ...
|
546e4259 | 23-Feb-2024 |
William Zhang <william.zhang@broadcom.com> |
mtd: rawnand: brcmnand: Add BCMBCA read data bus interface
The BCMBCA broadband SoC integrates the NAND controller differently than STB, iProc and other SoCs. It has different endianness for NAND c
mtd: rawnand: brcmnand: Add BCMBCA read data bus interface
The BCMBCA broadband SoC integrates the NAND controller differently than STB, iProc and other SoCs. It has different endianness for NAND cache data.
Add a SoC read data bus shim for BCMBCA to meet the specific SoC need and performance improvement using the optimized memcpy function on NAND cache memory.
Signed-off-by: William Zhang <william.zhang@broadcom.com> Reviewed-by: David Regan <dregan@broadcom.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20240223034758.13753-12-william.zhang@broadcom.com
show more ...
|
5542164b | 23-Feb-2024 |
David Regan <dregan@broadcom.com> |
mtd: rawnand: brcmnand: update log level messages
Update log level messages so that more critical messages can be logged to console and help the troubleshooting with field devices.
Signed-off-by: D
mtd: rawnand: brcmnand: update log level messages
Update log level messages so that more critical messages can be logged to console and help the troubleshooting with field devices.
Signed-off-by: David Regan <dregan@broadcom.com> Signed-off-by: William Zhang <william.zhang@broadcom.com> Reviewed-by: William Zhang <william.zhang@broadcom.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20240223034758.13753-4-william.zhang@broadcom.com
show more ...
|
8e6070e5 | 23-Feb-2024 |
William Zhang <william.zhang@broadcom.com> |
mtd: rawnand: brcmnand: fix style issues
Fix various style issues.
Signed-off-by: David Regan <dregan@broadcom.com> Signed-off-by: William Zhang <william.zhang@broadcom.com> Reviewed-by: William Zh
mtd: rawnand: brcmnand: fix style issues
Fix various style issues.
Signed-off-by: David Regan <dregan@broadcom.com> Signed-off-by: William Zhang <william.zhang@broadcom.com> Reviewed-by: William Zhang <william.zhang@broadcom.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20240223034758.13753-3-william.zhang@broadcom.com
show more ...
|
3c8260ce | 25-Nov-2023 |
David Regan <dregan@broadcom.com> |
mtd: rawnand: brcmnand: exec_op implementation
exec_op implementation for Broadcom STB, Broadband and iProc SoC This adds exec_op and removes the legacy interface. Based on changes proposed by Boris
mtd: rawnand: brcmnand: exec_op implementation
exec_op implementation for Broadcom STB, Broadband and iProc SoC This adds exec_op and removes the legacy interface. Based on changes proposed by Boris Brezillon.
Link: https://github.com/bbrezillon/linux/commit/4ec6f8d8d83f5aaca5d1877f02d48da96d41fcba Link: https://github.com/bbrezillon/linux/commit/11b4acffd761c4928652d7028d19fcd6f45e4696 Signed-off-by: David Regan <dregan@broadcom.com> [Miquel Raynal: Misc style fixes] Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20231125012438.15191-4-dregan@broadcom.com
show more ...
|
c86b63b8 | 25-Nov-2023 |
David Regan <dregan@broadcom.com> |
mtd: rawnand: brcmnand: pass host struct to bcmnand_ctrl_poll_status
Pass host struct to bcmnand_ctrl_poll_status instead of ctrl struct since real time status requires host, and ctrl is a member of
mtd: rawnand: brcmnand: pass host struct to bcmnand_ctrl_poll_status
Pass host struct to bcmnand_ctrl_poll_status instead of ctrl struct since real time status requires host, and ctrl is a member of host. Real time status is required for low level commands vs cached status since the NAND controller will not do an automatic status read at the end of a low level command as it would with a high level command.
Signed-off-by: David Regan <dregan@broadcom.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20231125012438.15191-3-dregan@broadcom.com
show more ...
|
f504551b | 08-Aug-2023 |
Ruan Jinjie <ruanjinjie@huawei.com> |
mtd: rawnand: Propagate error and simplify ternary operators for brcmstb_nand_wait_for_completion()
As bcmnand_ctrl_poll_status() return negative errno, so return true if sts < 0. The < 0 case does
mtd: rawnand: Propagate error and simplify ternary operators for brcmstb_nand_wait_for_completion()
As bcmnand_ctrl_poll_status() return negative errno, so return true if sts < 0. The < 0 case does not exist for wait_for_completion_timeout(), so return true if sts = 0 and zero otherwise. Both of the true return of them can be considered as a -ETIMEDOUT err, so return -ETIMEDOUT if err is true to propagate err from its caller.
Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com> Reviewed-by: William Zhang <william.zhang@broadcom.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20230808032943.3890545-1-ruanjinjie@huawei.com
show more ...
|
31cbe3a7 | 02-Aug-2023 |
Li Zetao <lizetao1@huawei.com> |
mtd: rawnand: brcmnand: Use devm_platform_ioremap_resource_byname()
Convert platform_get_resource_byname() + devm_ioremap_resource() to a single call to devm_platform_ioremap_resource_byname(), as t
mtd: rawnand: brcmnand: Use devm_platform_ioremap_resource_byname()
Convert platform_get_resource_byname() + devm_ioremap_resource() to a single call to devm_platform_ioremap_resource_byname(), as this is exactly what this function does.
Signed-off-by: Li Zetao <lizetao1@huawei.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20230802013500.1030853-1-lizetao1@huawei.com
show more ...
|
60177390 | 06-Jul-2023 |
William Zhang <william.zhang@broadcom.com> |
mtd: rawnand: brcmnand: Fix mtd oobsize
brcmnand controller can only access the flash spare area up to certain bytes based on the ECC level. It can be less than the actual flash spare area size. For
mtd: rawnand: brcmnand: Fix mtd oobsize
brcmnand controller can only access the flash spare area up to certain bytes based on the ECC level. It can be less than the actual flash spare area size. For example, for many NAND chip supporting ECC BCH-8, it has 226 bytes spare area. But controller can only uses 218 bytes. So brcmand driver overrides the mtd oobsize with the controller's accessible spare area size. When the nand base driver utilizes the nand_device object, it resets the oobsize back to the actual flash spare aprea size from nand_memory_organization structure and controller may not able to access all the oob area as mtd advises.
This change fixes the issue by overriding the oobsize in the nand_memory_organization structure to the controller's accessible spare area size.
Fixes: a7ab085d7c16 ("mtd: rawnand: Initialize the nand_device object") Signed-off-by: William Zhang <william.zhang@broadcom.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20230706182909.79151-6-william.zhang@broadcom.com
show more ...
|
5d532441 | 06-Jul-2023 |
William Zhang <william.zhang@broadcom.com> |
mtd: rawnand: brcmnand: Fix potential out-of-bounds access in oob write
When the oob buffer length is not in multiple of words, the oob write function does out-of-bounds read on the oob source buffe
mtd: rawnand: brcmnand: Fix potential out-of-bounds access in oob write
When the oob buffer length is not in multiple of words, the oob write function does out-of-bounds read on the oob source buffer at the last iteration. Fix that by always checking length limit on the oob buffer read and fill with 0xff when reaching the end of the buffer to the oob registers.
Fixes: 27c5b17cd1b1 ("mtd: nand: add NAND driver "library" for Broadcom STB NAND controller") Signed-off-by: William Zhang <william.zhang@broadcom.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Cc: stable@vger.kernel.org Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20230706182909.79151-5-william.zhang@broadcom.com
show more ...
|
e66dd317 | 06-Jul-2023 |
William Zhang <william.zhang@broadcom.com> |
mtd: rawnand: brcmnand: Fix crash during the panic_write
When executing a NAND command within the panic write path, wait for any pending command instead of calling BUG_ON to avoid crashing while alr
mtd: rawnand: brcmnand: Fix crash during the panic_write
When executing a NAND command within the panic write path, wait for any pending command instead of calling BUG_ON to avoid crashing while already crashing.
Fixes: 27c5b17cd1b1 ("mtd: nand: add NAND driver "library" for Broadcom STB NAND controller") Signed-off-by: William Zhang <william.zhang@broadcom.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Reviewed-by: Kursad Oney <kursad.oney@broadcom.com> Reviewed-by: Kamal Dasu <kamal.dasu@broadcom.com> Cc: stable@vger.kernel.org Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20230706182909.79151-4-william.zhang@broadcom.com
show more ...
|
9cc0a598 | 06-Jul-2023 |
William Zhang <william.zhang@broadcom.com> |
mtd: rawnand: brcmnand: Fix potential false time out warning
If system is busy during the command status polling function, the driver may not get the chance to poll the status register till the end
mtd: rawnand: brcmnand: Fix potential false time out warning
If system is busy during the command status polling function, the driver may not get the chance to poll the status register till the end of time out and return the premature status. Do a final check after time out happens to ensure reading the correct status.
Fixes: 9d2ee0a60b8b ("mtd: nand: brcmnand: Check flash #WP pin status before nand erase/program") Signed-off-by: William Zhang <william.zhang@broadcom.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Cc: stable@vger.kernel.org Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20230706182909.79151-3-william.zhang@broadcom.com
show more ...
|
c4c85b51 | 12-Jul-2022 |
Florian Fainelli <f.fainelli@gmail.com> |
mtd: rawnand: brcmnand: Add individual glue driver selection
Allow each platform to define a dedicated Kconfig entry for its glue driver such that we can decide on a per-platfomr basis whether to bu
mtd: rawnand: brcmnand: Add individual glue driver selection
Allow each platform to define a dedicated Kconfig entry for its glue driver such that we can decide on a per-platfomr basis whether to build it or not. This allows for a finer grained control over the resulting kernel image or set of modules.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20220711222323.4048197-3-f.fainelli@gmail.com
show more ...
|