From: Tom Rini <trini@konsulko.com>
To: AK Sharma <maskachoska@yahoo.com>
Cc: u-boot@lists.u-boot-project.org,
Christian Marangi <ansuelsmth@gmail.com>,
Daniel Schwierzeck <daniel.schwierzeck@gmail.com>,
Dario Binacchi <dario.binacchi@amarulasolutions.com>,
Frieder Schrempf <frieder.schrempf@kontron.de>,
Jerome Forissier <jerome.forissier@arm.com>,
Marek Vasut <marex@denx.de>,
Michael Trimarchi <michael@amarulasolutions.com>
Subject: Re: [PATCH v1 05/12] mtd: spi-nand: add EN75 BMT bad-block management support
Date: Tue, 25 Aug 2026 16:59:08 -0600 [thread overview]
Message-ID: <20260825225908.GG523975@bill-the-cat> (raw)
In-Reply-To: <20260825224330.713151-6-maskachoska@yahoo.com>
[-- Attachment #1: Type: text/plain, Size: 2914 bytes --]
On Wed, Aug 26, 2026 at 04:12:00AM +0530, AK Sharma wrote:
> Add read support for the EcoNet/Airoha BMT/BBT (bad-block management
> table) layout used by the EN75xx vendor bootloaders, so U-Boot maps the
> SPI-NAND logical blocks the same way as the vendor firmware.
>
> Signed-off-by: AK Sharma <maskachoska@yahoo.com>
> ---
> drivers/mtd/nand/spi/Kconfig | 8 +
> drivers/mtd/nand/spi/Makefile | 1 +
> drivers/mtd/nand/spi/core.c | 9 +-
> drivers/mtd/nand/spi/en75_bmt.c | 665 ++++++++++++++++++++++++++++++++
> drivers/mtd/nand/spi/en75_bmt.h | 24 ++
> 5 files changed, 706 insertions(+), 1 deletion(-)
> create mode 100644 drivers/mtd/nand/spi/en75_bmt.c
> create mode 100644 drivers/mtd/nand/spi/en75_bmt.h
>
> diff --git a/drivers/mtd/nand/spi/Kconfig b/drivers/mtd/nand/spi/Kconfig
> index 1124dada..09531914 100644
> --- a/drivers/mtd/nand/spi/Kconfig
> +++ b/drivers/mtd/nand/spi/Kconfig
> @@ -6,3 +6,11 @@ menuconfig MTD_SPI_NAND
> select SPI_MEM
> help
> This is the framework for the SPI NAND device drivers.
> +
> +config MTD_EN75_BMT
> + bool "EcoNet EN75xx vendor BMT/BBT translation (read-only)"
> + depends on MTD_SPI_NAND
> + help
> + Honour the EcoNet/Airoha factory BBT and BMT so logical NAND
> + addresses match the bootbase and Linux. Read-only: never rewrite
> + the tables.
> diff --git a/drivers/mtd/nand/spi/Makefile b/drivers/mtd/nand/spi/Makefile
> index a7a0b2cb..20aa718d 100644
> --- a/drivers/mtd/nand/spi/Makefile
> +++ b/drivers/mtd/nand/spi/Makefile
> @@ -1,6 +1,7 @@
> # SPDX-License-Identifier: GPL-2.0
>
> spinand-objs := core.o otp.o
> +spinand-objs += $(if $(CONFIG_MTD_EN75_BMT),en75_bmt.o)
> spinand-objs += alliancememory.o ato.o esmt.o fmsh.o foresee.o gigadevice.o macronix.o
> spinand-objs += micron.o paragon.o skyhigh.o toshiba.o winbond.o xtx.o
> obj-$(CONFIG_MTD_SPI_NAND) += spinand.o
> diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
> index 14af4264..29fdefe2 100644
> --- a/drivers/mtd/nand/spi/core.c
> +++ b/drivers/mtd/nand/spi/core.c
> @@ -33,6 +33,7 @@
> #include <linux/mtd/spinand.h>
> #include <linux/printk.h>
> #include <linux/delay.h>
> +#include "en75_bmt.h"
> #endif
>
> struct spinand_plat {
> @@ -1703,15 +1704,21 @@ static int spinand_probe(struct udevice *dev)
> #ifndef __UBOOT__
> ret = mtd_device_register(mtd, NULL, 0);
> #else
> + ret = en75_bmt_attach(mtd);
> + if (ret)
> + goto err_spinand_cleanup;
> +
> ret = add_mtd_device(mtd);
> #endif
> if (ret)
> - goto err_spinand_cleanup;
> + goto err_bmt_detach;
>
> plat->mtd = mtd;
>
> return 0;
>
> +err_bmt_detach:
> + en75_bmt_detach(mtd);
> err_spinand_cleanup:
> spinand_cleanup(spinand);
I am concerned about generic code path changes here, how is this handled
in the upstream kernel?
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2026-08-25 22:59 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260825224330.713151-1-maskachoska.ref@yahoo.com>
2026-08-25 22:41 ` [PATCH v1 00/12] mips: add EcoNet/Airoha EN75xx (EN7512/EN7528) SoC support AK Sharma
2026-08-25 22:41 ` [PATCH v1 01/12] mips: en75xx: add EcoNet/Airoha EN75xx " AK Sharma
2026-08-25 22:41 ` [PATCH v1 02/12] mips: en75xx: add TPL and SPL early boot stages AK Sharma
2026-08-25 22:53 ` Tom Rini
2026-08-25 22:41 ` [PATCH v1 03/12] serial: en75xx: add EcoNet/Airoha EN75xx UART driver AK Sharma
2026-08-25 22:41 ` [PATCH v1 04/12] spi: airoha-snfi: add EN7528 SPI-NAND controller support AK Sharma
2026-08-25 22:42 ` [PATCH v1 05/12] mtd: spi-nand: add EN75 BMT bad-block management support AK Sharma
2026-08-25 22:59 ` Tom Rini [this message]
2026-08-26 6:47 ` Frieder Schrempf
2026-08-25 22:42 ` [PATCH v1 06/12] net: airoha-eth: add EN7528 Ethernet support AK Sharma
2026-08-25 22:42 ` [PATCH v1 07/12] mtd: env, cmd: add EN75 NAND remap handling AK Sharma
2026-08-25 23:06 ` Tom Rini
2026-08-25 22:42 ` [PATCH v1 08/12] boot: image: add weak hooks for the decompression buffer and flush AK Sharma
2026-08-25 23:05 ` Tom Rini
2026-08-25 22:42 ` [PATCH v1 09/12] mips: dts: add EcoNet EN75xx device trees AK Sharma
2026-08-25 22:55 ` Tom Rini
2026-08-25 22:42 ` [PATCH v1 10/12] board: econet: add EN7512 reference board AK Sharma
2026-08-25 22:42 ` [PATCH v1 11/12] board: econet: add EN7528 board support AK Sharma
2026-08-25 22:57 ` Tom Rini
2026-08-25 23:00 ` Tom Rini
2026-08-25 22:42 ` [PATCH v1 12/12] doc: board: econet: add EN75xx documentation AK Sharma
2026-08-25 23:02 ` [PATCH v1 00/12] mips: add EcoNet/Airoha EN75xx (EN7512/EN7528) SoC support Tom Rini
2026-08-26 14:26 ` Matheus Sampaio Queiroga
2026-08-26 15:05 ` Tom Rini
2026-08-26 15:16 ` AK Sharma
2026-08-26 15:17 ` Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260825225908.GG523975@bill-the-cat \
--to=trini@konsulko.com \
--cc=ansuelsmth@gmail.com \
--cc=daniel.schwierzeck@gmail.com \
--cc=dario.binacchi@amarulasolutions.com \
--cc=frieder.schrempf@kontron.de \
--cc=jerome.forissier@arm.com \
--cc=marex@denx.de \
--cc=maskachoska@yahoo.com \
--cc=michael@amarulasolutions.com \
--cc=u-boot@lists.u-boot-project.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.