Re: [PATCH v2 2/3] dm: prepare rkmtd UCLASS

2023-10-12 Thread Simon Glass
Hi Johan,

On Thu, 12 Oct 2023 at 04:19, Johan Jonker  wrote:
>
>
>
> On 10/2/23 03:16, Simon Glass wrote:
> > Hi Johan,
> >
> > On Thu, 28 Sept 2023 at 12: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(+)
> >>
> >
> > A new uclass should have a sandbox test and a header file or some
> > other docs describing it.
>
> Hi Simon, Mark,
>
> Found by git bisect. This serie worked fine till this patch was applied:
>
> blk: Add bounce buffer support to read/write operations
> https://source.denx.de/u-boot/u-boot/-/commit/75191f75bce45f3b9aff607c88f17778d3805c61
>
> On Rockchip boards CONFIG_BOUNCE_BUFFER is selected by CONFIG_MMC_DW.
> These DW controllers have there own DMA interface.
> However Rockchip boards CONFIG_DM_DMA is not enabled.
> A virtual disk driver doesn't work with that extra buffer.
>
> This patch is there. What route should we take to get rid of it.

This rkmtd driver should depend on !BOUNCE_BUFFER perhaps? Or if the
bounce buffer is needed by rockchip, then perhaps we need to be able
to enable/disable it at runtime for different uclasses / devices?

Regards,
Simon


Re: [PATCH v2 2/3] dm: prepare rkmtd UCLASS

2023-10-12 Thread Johan Jonker



On 10/2/23 03:16, Simon Glass wrote:
> Hi Johan,
> 
> On Thu, 28 Sept 2023 at 12: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(+)
>>
> 
> A new uclass should have a sandbox test and a header file or some
> other docs describing it.

Hi Simon, Mark,

Found by git bisect. This serie worked fine till this patch was applied:

blk: Add bounce buffer support to read/write operations
https://source.denx.de/u-boot/u-boot/-/commit/75191f75bce45f3b9aff607c88f17778d3805c61

On Rockchip boards CONFIG_BOUNCE_BUFFER is selected by CONFIG_MMC_DW.
These DW controllers have there own DMA interface.
However Rockchip boards CONFIG_DM_DMA is not enabled.
A virtual disk driver doesn't work with that extra buffer.

This patch is there. What route should we take to get rid of it.

Please advise,

Johan



> 
> REgards,
> Simon


Re: [PATCH v2 2/3] dm: prepare rkmtd UCLASS

2023-10-01 Thread Simon Glass
Hi Johan,

On Thu, 28 Sept 2023 at 12: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(+)
>

A new uclass should have a sandbox test and a header file or some
other docs describing it.

REgards,
Simon


[PATCH v2 2/3] dm: prepare rkmtd UCLASS

2023-09-28 Thread Johan Jonker
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(+)

diff --git a/disk/part.c b/disk/part.c
index 186ee965006e..a65f9df5dd29 100644
--- a/disk/part.c
+++ b/disk/part.c
@@ -170,6 +170,7 @@ void dev_print(struct blk_desc *dev_desc)
case UCLASS_PVBLOCK:
case UCLASS_HOST:
case UCLASS_BLKMAP:
+   case UCLASS_RKMTD:
printf ("Vendor: %s Rev: %s Prod: %s\n",
dev_desc->vendor,
dev_desc->revision,
@@ -303,6 +304,9 @@ static void print_part_header(const char *type, struct 
blk_desc *dev_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 614b975e25c2..6bad2719e729 100644
--- a/drivers/block/blk-uclass.c
+++ b/drivers/block/blk-uclass.c
@@ -34,6 +34,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 307ad6931ca7..99a411429a2f 100644
--- a/include/dm/uclass-id.h
+++ b/include/dm/uclass-id.h
@@ -113,6 +113,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