Re: [PATCH 8/8] qapi: remove "Example" doc section

2024-07-09 Thread Markus Armbruster
John Snow writes: > On Tue, Jul 9, 2024 at 6:52 AM Markus Armbruster wrote: > >> John Snow writes: >> >> > Fully eliminate the "Example" sections in QAPI doc blocks now that they >> > have all been converted to arbitrary rST syntax using the >> > ".. qmp-example::" directive. Update tests to

[PATCH v2] hw/ufs: Fix mcq register range check logic

2024-07-09 Thread Jeuk Kim
The function ufs_is_mcq_reg() and ufs_is_mcq_op_reg() only evaluated the range of the mcq_reg and mcq_op_reg offset, which is defined as a constant. Therefore, it was possible for them to return true even though the ufs device is configured to not support the mcq. This could cause

Re: [PATCH v47 00/19] hw/sd/sdcard: Add eMMC support

2024-07-09 Thread Cédric Le Goater
On 7/9/24 11:39 PM, Philippe Mathieu-Daudé wrote: On 9/7/24 17:58, Cédric Le Goater wrote: On 7/9/24 5:25 PM, Philippe Mathieu-Daudé wrote: Since v42: - Stick to spec v4.3 (re-simplified EXT_CSD register & migrate) - Fill CID register - Few changes to CSD register - Implement 'boot-mode' reset

Re: [PATCH 4/8] docs/sphinx: add CSS styling for qmp-example directive

2024-07-09 Thread Markus Armbruster
John Snow writes: > On Tue, Jul 9, 2024 at 6:34 AM Markus Armbruster wrote: > >> John Snow writes: >> >> > From: Harmonie Snow >> > >> > Add CSS styling for qmp-example directives to increase readability and >> > consistently style all example blocks. >> > >> > Signed-off-by: Harmonie Snow

Re: [PATCH 8/8] qapi: remove "Example" doc section

2024-07-09 Thread John Snow
On Tue, Jul 9, 2024 at 6:52 AM Markus Armbruster wrote: > John Snow writes: > > > Fully eliminate the "Example" sections in QAPI doc blocks now that they > > have all been converted to arbitrary rST syntax using the > > ".. qmp-example::" directive. Update tests to match. > > > > Migrating to

Re: [PATCH 7/8] qapi: convert "Example" sections with longer prose

2024-07-09 Thread John Snow
On Tue, Jul 9, 2024 at 7:35 AM Markus Armbruster wrote: > John Snow writes: > > > These examples require longer explanations or have explanations that > > require markup to look reasonable when rendered and so use the longer > > form of the ".. qmp-example::" directive. > > > > By using the

Re: [PATCH 4/8] docs/sphinx: add CSS styling for qmp-example directive

2024-07-09 Thread John Snow
On Tue, Jul 9, 2024 at 6:34 AM Markus Armbruster wrote: > John Snow writes: > > > From: Harmonie Snow > > > > Add CSS styling for qmp-example directives to increase readability and > > consistently style all example blocks. > > > > Signed-off-by: Harmonie Snow > > Signed-off-by: John Snow >

Re: [PATCH 3/8] docs/qapidoc: add QMP highlighting to annotated qmp-example blocks

2024-07-09 Thread John Snow
On Tue, Jul 9, 2024 at 6:33 AM Markus Armbruster wrote: > John Snow writes: > > > For any code literal blocks inside of a qmp-example directive, apply and > > enforce the QMP lexer/highlighter to those blocks. > > > > This way, you won't need to write: > > > > ``` > > .. qmp-example:: > >

Re: [PATCH v47 00/19] hw/sd/sdcard: Add eMMC support

2024-07-09 Thread Philippe Mathieu-Daudé
On 9/7/24 17:58, Cédric Le Goater wrote: On 7/9/24 5:25 PM, Philippe Mathieu-Daudé wrote: Since v42: - Stick to spec v4.3 (re-simplified EXT_CSD register & migrate) - Fill CID register - Few changes to CSD register - Implement 'boot-mode' reset timing - Add 'boot-size' property Change required

Re: [PATCH v47 12/19] hw/sd/sdcard: Simplify EXT_CSD values for spec v4.3

2024-07-09 Thread Philippe Mathieu-Daudé
On 9/7/24 17:43, Cédric Le Goater wrote: On 7/9/24 5:25 PM, Philippe Mathieu-Daudé wrote: - Set some keys to not defined / implemented:    . EXT_CSD_HPI_FEATURES    . EXT_CSD_BKOPS_SUPPORT    . EXT_CSD_SEC_FEATURE_SUPPORT    . EXT_CSD_ERASE_TIMEOUT_MULT    . EXT_CSD_PART_SWITCH_TIME    .

Re: [PATCH v3 06/17] hw/sd/sdcard: Do not store vendor data on block drive (CMD56)

2024-07-09 Thread Peter Xu
On Tue, Jul 09, 2024 at 05:38:54PM -0300, Fabiano Rosas wrote: > Philippe Mathieu-Daudé writes: > > > "General command" (GEN_CMD, CMD56) is described as: > > > > GEN_CMD is the same as the single block read or write > > commands (CMD24 or CMD17). The difference is that [...] > > the data

Re: [PATCH v3 06/17] hw/sd/sdcard: Do not store vendor data on block drive (CMD56)

2024-07-09 Thread Fabiano Rosas
Philippe Mathieu-Daudé writes: > "General command" (GEN_CMD, CMD56) is described as: > > GEN_CMD is the same as the single block read or write > commands (CMD24 or CMD17). The difference is that [...] > the data block is not a memory payload data but has a > vendor specific format and

Re: [PATCH 0/8] qapi: convert example sections to qmp-example rST directives

2024-07-09 Thread Markus Armbruster
You achieved a clean & consistent look for notes and examples in the browser. Love it!

Re: [Aspeed PATCH v47 18/19] hw/sd/sdcard: Add boot config support

2024-07-09 Thread Philippe Mathieu-Daudé
On 9/7/24 17:52, Cédric Le Goater wrote: On 7/9/24 5:25 PM, Philippe Mathieu-Daudé wrote: From: Joel Stanley With this correctly set we can use the enable bit to detect if partition support is enabled. Signed-off-by: Joel Stanley Signed-off-by: Cédric Le Goater Signed-off-by: Philippe

Re: [PATCH v47 00/19] hw/sd/sdcard: Add eMMC support

2024-07-09 Thread Cédric Le Goater
On 7/9/24 5:25 PM, Philippe Mathieu-Daudé wrote: Since v42: - Stick to spec v4.3 (re-simplified EXT_CSD register & migrate) - Fill CID register - Few changes to CSD register - Implement 'boot-mode' reset timing - Add 'boot-size' property Change required for aspeed branch: -- >8 -- diff --git

Re: [Aspeed PATCH v47 18/19] hw/sd/sdcard: Add boot config support

2024-07-09 Thread Cédric Le Goater
On 7/9/24 5:25 PM, Philippe Mathieu-Daudé wrote: From: Joel Stanley With this correctly set we can use the enable bit to detect if partition support is enabled. Signed-off-by: Joel Stanley Signed-off-by: Cédric Le Goater Signed-off-by: Philippe Mathieu-Daudé --- Also squash? where is the

Re: [Aspeed PATCH v47 16/19] hw/sd/sdcard: Support boot area in emmc image

2024-07-09 Thread Cédric Le Goater
On 7/9/24 5:25 PM, Philippe Mathieu-Daudé wrote: From: Joel Stanley This assumes a specially constructed image: dd if=/dev/zero of=mmc-bootarea.img count=2 bs=1M dd if=u-boot-spl.bin of=mmc-bootarea.img conv=notrunc dd if=u-boot.bin of=mmc-bootarea.img conv=notrunc count=64 bs=1K

Re: [PATCH v47 11/19] hw/sd/sdcard: Add eMMC 'boot-size' property

2024-07-09 Thread Cédric Le Goater
On 7/9/24 5:25 PM, Philippe Mathieu-Daudé wrote: Avoid hardcoding 1MiB boot size in EXT_CSD_BOOT_MULT, expose it as QOM property. By default, do not use any size. Board is responsible to set the boot size property. Signed-off-by: Philippe Mathieu-Daudé I would move this patch at the end

Re: [PATCH v47 12/19] hw/sd/sdcard: Simplify EXT_CSD values for spec v4.3

2024-07-09 Thread Cédric Le Goater
On 7/9/24 5:25 PM, Philippe Mathieu-Daudé wrote: - Set some keys to not defined / implemented: . EXT_CSD_HPI_FEATURES . EXT_CSD_BKOPS_SUPPORT . EXT_CSD_SEC_FEATURE_SUPPORT . EXT_CSD_ERASE_TIMEOUT_MULT . EXT_CSD_PART_SWITCH_TIME . EXT_CSD_OUT_OF_INTERRUPT_TIME - Simplify: .

Re: [PATCH v47 19/19] hw/sd/sdcard: Enable TYPE_EMMC card model

2024-07-09 Thread Cédric Le Goater
On 7/9/24 5:25 PM, Philippe Mathieu-Daudé wrote: Now than the implementation is functional, allow to instantiate it. Signed-off-by: Philippe Mathieu-Daudé I don't think this is necessary. emmc should be functional once patch 1-15 are merged. The boot part is an extension. Thanks, C.

[Aspeed PATCH v47 18/19] hw/sd/sdcard: Add boot config support

2024-07-09 Thread Philippe Mathieu-Daudé
From: Joel Stanley With this correctly set we can use the enable bit to detect if partition support is enabled. Signed-off-by: Joel Stanley Signed-off-by: Cédric Le Goater Signed-off-by: Philippe Mathieu-Daudé --- Also squash? --- hw/sd/sd.c | 6 ++ 1 file changed, 6 insertions(+) diff

[PATCH v47 13/19] hw/sd/sdcard: Migrate ExtCSD 'modes' register

2024-07-09 Thread Philippe Mathieu-Daudé
Spec v4.3, chapter 8.4 "Extended CSD register": The Extended CSD register defines the card properties and selected modes. It is 512 bytes long. The most significant 320 bytes are the Properties segment, which defines the card capabilities and cannot be modified by the host. The lower

[Aspeed PATCH v47 16/19] hw/sd/sdcard: Support boot area in emmc image

2024-07-09 Thread Philippe Mathieu-Daudé
From: Joel Stanley This assumes a specially constructed image: dd if=/dev/zero of=mmc-bootarea.img count=2 bs=1M dd if=u-boot-spl.bin of=mmc-bootarea.img conv=notrunc dd if=u-boot.bin of=mmc-bootarea.img conv=notrunc count=64 bs=1K cat mmc-bootarea.img obmc-phosphor-image.wic > mmc.img

[PATCH v47 19/19] hw/sd/sdcard: Enable TYPE_EMMC card model

2024-07-09 Thread Philippe Mathieu-Daudé
Now than the implementation is functional, allow to instantiate it. Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sd.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 6aa83251f7..4a6e9cc035 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -2941,7 +2941,6 @@ static

[PATCH v47 05/19] hw/sd/sdcard: Implement emmc_set_csd()

2024-07-09 Thread Philippe Mathieu-Daudé
eMMC CSD register is very similar to SD one. Most notable change: the version announced is v4.3. Signed-off-by: Philippe Mathieu-Daudé --- TODO: comment magic values? --- hw/sd/sd.c | 39 +++ 1 file changed, 39 insertions(+) diff --git a/hw/sd/sd.c

[PATCH v47 10/19] hw/sd/sdcard: Add emmc_cmd_SEND_EXT_CSD handler (CMD8)

2024-07-09 Thread Philippe Mathieu-Daudé
From: Vincent Palatin The parameters mimick a real 4GB eMMC, but it can be set to various sizes. Initially from Vincent Palatin eMMC CSD is similar to SD with an option to refer EXT_CSD for larger devices. Signed-off-by: Vincent Palatin Signed-off-by: Cédric Le Goater Signed-off-by: Sai

[PATCH v47 15/19] hw/sd/sdcard: Implement eMMC 'boot-mode'

2024-07-09 Thread Philippe Mathieu-Daudé
Spec v4.3 chapter 7.2.2 "Boot operation": If the CMD line is held LOW for 74 clock cycles and more after power-up before the first command is issued, the slave recognizes that boot mode is being initiated and starts preparing boot data internally. Track uptime since last reset, add the

[PATCH v47 14/19] hw/sd/sdcard: Add mmc SWITCH function support (CMD6)

2024-07-09 Thread Philippe Mathieu-Daudé
From: Sai Pavan Boddu switch operation in mmc cards, updated the ext_csd register to request changes in card operations. Here we implement similar sequence but requests are mostly dummy and make no change. Implement SWITCH_ERROR if the write operation offset goes beyond length of ext_csd.

[PATCH v47 11/19] hw/sd/sdcard: Add eMMC 'boot-size' property

2024-07-09 Thread Philippe Mathieu-Daudé
Avoid hardcoding 1MiB boot size in EXT_CSD_BOOT_MULT, expose it as QOM property. By default, do not use any size. Board is responsible to set the boot size property. Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sd.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git

[PATCH v47 07/19] hw/sd/sdcard: Fix SET_BLOCK_COUNT command argument on eMMC (CMD23)

2024-07-09 Thread Philippe Mathieu-Daudé
From: Cédric Le Goater The number of blocks is defined in the lower bits [15:0]. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Cédric Le Goater Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20240628070216.92609-88-phi...@linaro.org> --- hw/sd/sd.c | 3 +++ 1 file changed, 3

[PATCH v47 06/19] hw/sd/sdcard: Add emmc_cmd_SET_RELATIVE_ADDR handler (CMD3)

2024-07-09 Thread Philippe Mathieu-Daudé
From: Cédric Le Goater Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Cédric Le Goater Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20240628070216.92609-86-phi...@linaro.org> --- hw/sd/sd.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/hw/sd/sd.c b/hw/sd/sd.c

[Aspeed PATCH v47 17/19] hw/sd/sdcard: Subtract bootarea size from blk

2024-07-09 Thread Philippe Mathieu-Daudé
From: Joel Stanley The userdata size is derived from the file the user passes on the command line, but we must take into account the boot areas. Signed-off-by: Joel Stanley Signed-off-by: Cédric Le Goater Signed-off-by: Philippe Mathieu-Daudé --- Squash in previous? --- hw/sd/sd.c | 4

[PATCH v47 12/19] hw/sd/sdcard: Simplify EXT_CSD values for spec v4.3

2024-07-09 Thread Philippe Mathieu-Daudé
- Set some keys to not defined / implemented: . EXT_CSD_HPI_FEATURES . EXT_CSD_BKOPS_SUPPORT . EXT_CSD_SEC_FEATURE_SUPPORT . EXT_CSD_ERASE_TIMEOUT_MULT . EXT_CSD_PART_SWITCH_TIME . EXT_CSD_OUT_OF_INTERRUPT_TIME - Simplify: . EXT_CSD_ACC_SIZE (6 -> 1) 16KB of super_page_size ->

[PATCH v47 09/19] hw/sd/sdcard: Implement eMMC sleep state (CMD5)

2024-07-09 Thread Philippe Mathieu-Daudé
From: Luc Michel The JEDEC standards specifies a sleep state where the eMMC won't answer any command appart from RESET and WAKEUP and go to low power state. Implement this state and the corresponding command number 5. Signed-off-by: Luc Michel Signed-off-by: Francisco Iglesias Signed-off-by:

[PATCH v47 02/19] hw/sd/sdcard: Register generic command handlers

2024-07-09 Thread Philippe Mathieu-Daudé
Tested-by: Cédric Le Goater Reviewed-by: Cédric Le Goater Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20240628070216.92609-84-phi...@linaro.org> --- hw/sd/sd.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index

[PATCH v47 04/19] hw/sd/sdcard: Implement emmc_set_cid()

2024-07-09 Thread Philippe Mathieu-Daudé
eMMC CID register is slightly different from SD: - One extra PNM (5 -> 6) - MDT is only 1 byte (2 -> 1). Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sd.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 097c9cc61f..2d737a836f 100644 ---

[PATCH v47 03/19] hw/sd/sdcard: Register unimplemented command handlers

2024-07-09 Thread Philippe Mathieu-Daudé
Per the spec v4.3 these commands are mandatory, but we don't implement them. Reviewed-by: Cédric Le Goater Tested-by: Cédric Le Goater Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20240628070216.92609-85-phi...@linaro.org> --- hw/sd/sd.c | 9 + 1 file changed, 9 insertions(+)

[PATCH v47 08/19] hw/sd/sdcard: Add mmc_cmd_PROGRAM_CID handler (CMD26)

2024-07-09 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé Tested-by: Cédric Le Goater Reviewed-by: Cédric Le Goater Message-Id: <20240628070216.92609-89-phi...@linaro.org> --- hw/sd/sd.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index

[PATCH v47 01/19] hw/sd/sdcard: Basis for eMMC support

2024-07-09 Thread Philippe Mathieu-Daudé
From: Philippe Mathieu-Daudé Add basis for supporting eMMC. Since eMMC are soldered on boards, it is not user-creatable. Currently TYPE_EMMC is just a stub, so disabled (marked abstract). RCA register is initialized to 1, per spec v4.3, chapter 8.5 "RCA register": The default value of the

[PATCH v47 00/19] hw/sd/sdcard: Add eMMC support

2024-07-09 Thread Philippe Mathieu-Daudé
Since v42: - Stick to spec v4.3 (re-simplified EXT_CSD register & migrate) - Fill CID register - Few changes to CSD register - Implement 'boot-mode' reset timing - Add 'boot-size' property Change required for aspeed branch: -- >8 -- diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index

Re: [PATCH 7/8] qapi: convert "Example" sections with longer prose

2024-07-09 Thread Markus Armbruster
John Snow writes: > These examples require longer explanations or have explanations that > require markup to look reasonable when rendered and so use the longer > form of the ".. qmp-example::" directive. > > By using the :annotated: option, the content in the example block is > assumed *not* to

Re: [PATCH 6/8] qapi: convert "Example" sections with titles

2024-07-09 Thread Markus Armbruster
John Snow writes: > When an Example section has a brief explanation, convert it to a > qmp-example:: section using the :title: option. > > Rule of thumb: If the title can fit on a single line and requires no rST > markup, it's a good candidate for using the :title: option of > qmp-example. > >

Re: [PATCH 5/8] qapi: convert "Example" sections without titles

2024-07-09 Thread Markus Armbruster
John Snow writes: > On Sat, Jul 6, 2024, 10:42 AM Markus Armbruster wrote: > >> John Snow writes: >> >> > Use the no-option form of ".. qmp-example::" to convert any Examples >> > that do not have any form of caption or explanation whatsoever. Note >> > that in a few cases, example sections

Re: [PATCH 8/8] qapi: remove "Example" doc section

2024-07-09 Thread Markus Armbruster
John Snow writes: > Fully eliminate the "Example" sections in QAPI doc blocks now that they > have all been converted to arbitrary rST syntax using the > ".. qmp-example::" directive. Update tests to match. > > Migrating to the new syntax > --- > > The old "Example:" or

Re: [PATCH 4/8] docs/sphinx: add CSS styling for qmp-example directive

2024-07-09 Thread Markus Armbruster
John Snow writes: > From: Harmonie Snow > > Add CSS styling for qmp-example directives to increase readability and > consistently style all example blocks. > > Signed-off-by: Harmonie Snow > Signed-off-by: John Snow Same sadness as for the previous patch. Acked-by: Markus Armbruster

Re: [PATCH 3/8] docs/qapidoc: add QMP highlighting to annotated qmp-example blocks

2024-07-09 Thread Markus Armbruster
John Snow writes: > For any code literal blocks inside of a qmp-example directive, apply and > enforce the QMP lexer/highlighter to those blocks. > > This way, you won't need to write: > > ``` > .. qmp-example:: >:annotated: > >Blah blah > >.. code-block:: QMP > > -> { "lorem":

Re: [PATCH 2/8] docs/qapidoc: create qmp-example directive

2024-07-09 Thread Markus Armbruster
John Snow writes: > This is a directive that creates a syntactic sugar for creating > "Example" boxes very similar to the ones already used in the bitmaps.rst > document, please see e.g. > https://www.qemu.org/docs/master/interop/bitmaps.html#creation-block-dirty-bitmap-add > > In its simplest

Re: [PATCH 1/8] docs/qapidoc: factor out do_parse()

2024-07-09 Thread Markus Armbruster
John Snow writes: > On Sat, Jul 6, 2024, 10:47 AM Markus Armbruster wrote: > >> John Snow writes: >> >> > Factor out the compatibility parser helper into a base class, so it can >> > be shared by other directives. >> > >> > Signed-off-by: John Snow >> >> R-by stands. > > Assuming true even if

Re: [PATCH v3 0/8] support AST2700 network

2024-07-09 Thread Cédric Le Goater
On 7/4/24 10:29 AM, Jamin Lin wrote: change from v1: - ftgmac100 - fix coding style - support 64 bits dma dram address for AST2700 change from v2: - ftgmac100: update memory region size to 0x200. - ftgmac100: introduce a new class(ftgmac100_high), class attribute and memop handlers,

Re: [PATCH v2 06/15] ppc/vof: Fix unaligned FDT property access

2024-07-09 Thread David Gibson
On Mon, Jul 08, 2024 at 04:59:30PM +0100, Peter Maydell wrote: > On Mon, 8 Jul 2024 at 08:49, Nicholas Piggin wrote: > > > > On Sun Jul 7, 2024 at 9:46 AM AEST, David Gibson wrote: > > > On Sat, Jul 06, 2024 at 11:37:08AM +0100, Peter Maydell wrote: > > > > On Fri, 5 Jul 2024 at 06:13, David

Re: [PATCH v2 06/15] ppc/vof: Fix unaligned FDT property access

2024-07-09 Thread David Gibson
On Mon, Jul 08, 2024 at 05:49:32PM +1000, Nicholas Piggin wrote: > On Sun Jul 7, 2024 at 9:46 AM AEST, David Gibson wrote: > > On Sat, Jul 06, 2024 at 11:37:08AM +0100, Peter Maydell wrote: > > > On Fri, 5 Jul 2024 at 06:13, David Gibson > > > wrote: > > > > > > > > On Fri, Jul 05, 2024 at