From: Johan Jonker <jbx6244@gmail.com>
To: kever.yang@rock-chips.com
Cc: sjg@chromium.org, philipp.tomsich@vrull.eu,
dario.binacchi@amarulasolutions.com,
michael@amarulasolutions.com, marex@denx.de,
u-boot@lists.denx.de
Subject: [PATCH v5 0/8] Add rkmtd command
Date: Wed, 18 Oct 2023 15:58:41 +0200 [thread overview]
Message-ID: <7fd0d9d1-2e93-a48b-edfd-6d4fec314a60@gmail.com> (raw)
The command rkmtd creates a virtual block device to transfer
Rockchip boot block data to and from NAND with block orientated
tools like "ums" and "rockusb".
It uses the Rockchip MTD driver to scan for boot blocks and copies
data from the first block in a GPT formatted virtual disk.
Data must be written in U-boot "idbloader.img" format and start at
partition "loader1" offset 64. The data header is parsed
for length and offset. When the last sector is received
it erases up to 5 erase blocks on NAND and writes boot blocks
in a pattern depending on the NAND ID. Data is then verified.
When a block turns out bad the block header is discarded.
Changed V5:
Add bounce buffer flag
Use devres_alloc in bind
Restyle
Changed V4:
Sort includes
Replace constant by define
Enable rkmtd command in sandbox defconfig
Fix minor things in test
Changed V3:
Add documetation
Add test
Split driver from command
Split header
Use devm_kzalloc
Remove out of memory debug
Restyle
Changed V2:
Rename to rkmtd
Johan Jonker (8):
mtd: nand: raw: rockchip_nfc: add NAND_SKIP_BBTSCAN option
rockchip: dm: prepare rkmtd UCLASS
rockchip: block: add rkmtd class and drivers
rockchip: block: blk-uclass: add bounce buffer flag to blk_desc
rockchip: cmd: add rkmtd command
rockchip: test: dm: add rkmtd test
rockchip: doc: add rkmtd.rst
rockchip: configs: sandbox: enable rkmtd command
cmd/Kconfig | 8 +
cmd/Makefile | 1 +
cmd/rkmtd.c | 204 +++++
configs/sandbox64_defconfig | 1 +
configs/sandbox_defconfig | 1 +
disk/part.c | 4 +
doc/board/rockchip/index.rst | 1 +
doc/board/rockchip/rkmtd.rst | 105 +++
drivers/block/Kconfig | 7 +
drivers/block/Makefile | 2 +
drivers/block/blk-uclass.c | 5 +-
drivers/block/rkmtd.c | 1152 +++++++++++++++++++++++++++
drivers/mtd/nand/raw/Kconfig | 9 +
drivers/mtd/nand/raw/rockchip_nfc.c | 3 +
drivers/scsi/scsi.c | 4 +
include/blk.h | 1 +
include/dm/uclass-id.h | 1 +
include/rkmtd.h | 191 +++++
test/dm/Makefile | 1 +
test/dm/rkmtd.c | 200 +++++
20 files changed, 1899 insertions(+), 2 deletions(-)
create mode 100644 cmd/rkmtd.c
create mode 100644 doc/board/rockchip/rkmtd.rst
create mode 100644 drivers/block/rkmtd.c
create mode 100644 include/rkmtd.h
create mode 100644 test/dm/rkmtd.c
--
2.39.2
next reply other threads:[~2023-10-18 13:58 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-18 13:58 Johan Jonker [this message]
2023-10-18 14:00 ` [PATCH v5 1/8] mtd: nand: raw: rockchip_nfc: add NAND_SKIP_BBTSCAN option Johan Jonker
2023-10-18 14:00 ` [PATCH v5 2/8] rockchip: dm: prepare rkmtd UCLASS Johan Jonker
2023-10-18 16:09 ` Simon Glass
2023-10-18 14:00 ` [PATCH v5 3/8] rockchip: block: add rkmtd class and drivers Johan Jonker
2023-10-18 14:01 ` [PATCH v5 4/8] rockchip: block: blk-uclass: add bounce buffer flag to blk_desc Johan Jonker
2023-10-18 16:10 ` Simon Glass
2023-10-23 8:22 ` Kever Yang
2023-10-18 14:01 ` [PATCH v5 5/8] rockchip: cmd: add rkmtd command Johan Jonker
2023-10-18 14:01 ` [PATCH v5 6/8] rockchip: test: dm: add rkmtd test Johan Jonker
2023-10-18 14:02 ` [PATCH v5 7/8] rockchip: doc: add rkmtd.rst Johan Jonker
2023-10-18 14:02 ` [PATCH v5 8/8] rockchip: configs: sandbox: enable rkmtd command Johan Jonker
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=7fd0d9d1-2e93-a48b-edfd-6d4fec314a60@gmail.com \
--to=jbx6244@gmail.com \
--cc=dario.binacchi@amarulasolutions.com \
--cc=kever.yang@rock-chips.com \
--cc=marex@denx.de \
--cc=michael@amarulasolutions.com \
--cc=philipp.tomsich@vrull.eu \
--cc=sjg@chromium.org \
--cc=u-boot@lists.denx.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox