On 10/13/23 18:57, Simon Glass wrote:
> Hi Johan,
>
> On Thu, 12 Oct 2023 at 13:51, Johan Jonker wrote:
>>
>> Prepare a rkmtd UCLASS in use for writing Rockchip boot blocks
>> in combination with existing userspace tools and rockusb command.
>>
>> Signed-off-by: Johan Jonker
>> Reviewed-by: Kever Yang
>> ---
>> disk/part.c| 4
>> drivers/block/blk-uclass.c | 1 +
>> include/dm/uclass-id.h | 1 +
>> 3 files changed, 6 insertions(+)
>
> Do you have a sandbox test for this somewhere?
Maybe have a look at:
[PATCH v3 6/7] rockchip: test: dm: add rkmtd test
The CONFIG_SANDBOX is used to select as much of the driver functionality for
testing without MTD driver hardware.
Config CMD_RKMTD will select RKMTD, but is not added to a sandbox_defconfig
file yet.
Not sure what is preferred. Please advise what patch I should produce.
Johan
>
>>
>> diff --git a/disk/part.c b/disk/part.c
>> index 85244b09f359..36b88205eca7 100644
>> --- a/disk/part.c
>> +++ b/disk/part.c
>> @@ -197,6 +197,7 @@ void dev_print(struct blk_desc *desc)
>> case UCLASS_PVBLOCK:
>> case UCLASS_HOST:
>> case UCLASS_BLKMAP:
>> + case UCLASS_RKMTD:
>> printf ("Vendor: %s Rev: %s Prod: %s\n",
>> desc->vendor,
>> desc->revision,
>> @@ -330,6 +331,9 @@ static void print_part_header(const char *type, struct
>> blk_desc *desc)
>> case UCLASS_PVBLOCK:
>> puts("PV BLOCK");
>> break;
>> + case UCLASS_RKMTD:
>> + puts("RKMTD");
>> + break;
>> case UCLASS_VIRTIO:
>> puts("VirtIO");
>> break;
>> diff --git a/drivers/block/blk-uclass.c b/drivers/block/blk-uclass.c
>> index f126547cc7e6..30ad5bbb0024 100644
>> --- a/drivers/block/blk-uclass.c
>> +++ b/drivers/block/blk-uclass.c
>> @@ -36,6 +36,7 @@ static struct {
>> { UCLASS_VIRTIO, "virtio" },
>> { UCLASS_PVBLOCK, "pvblock" },
>> { UCLASS_BLKMAP, "blkmap" },
>> + { UCLASS_RKMTD, "rkmtd" },
>> };
>>
>> static enum uclass_id uclass_name_to_iftype(const char *uclass_idname)
>> diff --git a/include/dm/uclass-id.h b/include/dm/uclass-id.h
>> index 0432c95c9edc..2fc672df0a3a 100644
>> --- a/include/dm/uclass-id.h
>> +++ b/include/dm/uclass-id.h
>> @@ -120,6 +120,7 @@ enum uclass_id {
>> UCLASS_REGULATOR, /* Regulator device */
>> UCLASS_REMOTEPROC, /* Remote Processor device */
>> UCLASS_RESET, /* Reset controller device */
>> + UCLASS_RKMTD, /* Rockchip MTD device */
>> UCLASS_RNG, /* Random Number Generator */
>> UCLASS_RTC, /* Real time clock device */
>> UCLASS_SCMI_AGENT, /* Interface with an SCMI server */
>> --
>> 2.39.2
>>
>
> Regards,
> Simon