Hi Cédric

> Subject: Re: [PATCH v2 8/8] hw/ssi/aspeed_smc: Add Data FIFO-based flash
> access support for AST2700
> 
> On 7/7/26 08:09, Jamin Lin wrote:
> > AST2700 supports a Data FIFO mode where flash accesses can be
> > performed directly through Data FIFO MMIO offsets. The Data FIFO start
> > offset increments by one for every 16MB of flash address space,
> > allowing the chip select (CS) to be decoded from the Data FIFO offset.
> >
> > This change adds Data FIFO support to the Aspeed SMC model and
> > introduces a class callback to translate Data FIFO offsets into CS
> > indices. For AST2700, the Data FIFO offset is matched against the
> > segment start address of each CS to determine the target flash device.
> >
> > The SMC register region size (nregs) is also extended dynamically
> > based on the number of supported chip selects to cover all possible
> > Data FIFO regions.
> >
> > Signed-off-by: Jamin Lin <[email protected]>
> > ---
> >   include/hw/ssi/aspeed_smc.h |   3 +-
> >   hw/ssi/aspeed_smc.c         | 113
> +++++++++++++++++++++++++++++++++---
> >   2 files changed, 107 insertions(+), 9 deletions(-)
> 
> I am looking for a way to test "Data FIFO-based flash access".
> A qtest extension of the ast2700 smc test would be nice to have.
> 
Will do.

> Is the latest SDK kernel using this feature ?
> 
Yes. Please try the following pre-built image:
https://github.com/AspeedTech-BMC/openbmc/releases/download/v11.02/ast2700-irot-obmc.tar.gz

The image-bmc file in the archive is smaller than 128 MB. Since the QEMU FMC 
flash model expects a 128 MB flash device, please resize it before using it:

jamin@JaminLin-PC:~/qemu-work/debug-qemu-ssp-review/ast2700-irot$ truncate 
--size 128M image-bmc

This pre-built image boots both the PSP and SSP.

After the system boots, log in to the Zephyr shell running on the SSP and use 
the following command to read the contents of the FMC CS0 flash:

ssp:~$ flash read fmc@0 0 100
00000000: 46 4c 53 48 01 00 11 00  aa 26 87 00 f9 64 80 79 |FLSH.... .&...d.y|
00000010: 01 00 00 00 dc 00 00 00  74 a6 01 00 02 00 00 00 |........ t.......|
00000020: 50 a7 01 00 84 3e 00 00  03 00 00 00 d4 e5 01 00 |P....>.. ........|
00000030: 60 ce 02 00 00 10 00 00  34 b4 04 00 d8 77 00 00 |`....... 4....w..|
00000040: 01 10 00 00 0c 2c 05 00  00 00 01 00 02 10 00 00 |.....,.. ........|
00000050: 0c 2c 06 00 b8 74 00 00  03 10 00 00 c4 a0 06 00 |.,...t.. ........|
00000060: 00 00 01 00 04 10 00 00  c4 a0 07 00 54 cf 00 00 |........ ....T...|
00000070: 05 10 00 00 18 70 08 00  00 00 01 00 06 10 00 00 |.....p.. ........|
00000080: 18 70 09 00 00 40 00 00  07 10 00 00 18 b0 09 00 |.p...@.. ........|
00000090: 00 a0 00 00 08 10 00 00  18 50 0a 00 6c 70 00 00 |........ .P..lp..|
000000A0: 09 10 00 00 84 c0 0a 00  90 ac 06 00 0a 10 00 00 |........ ........|
000000B0: 14 6d 11 00 58 82 0d 00  0b 10 00 00 6c ef 1e 00 |.m..X... ....l...|
000000C0: 6c 3e 03 00 0c 10 00 00  d8 2d 22 00 00 00 00 00 |l>...... .-".....|
000000D0: 0d 10 00 00 d8 2d 22 00  34 99 75 03 43 4d 41 4e |.....-". 4.u.CMAN|
000000E0: fc 16 00 00 5f 19 49 fc  a6 6a 8d 66 e6 26 80 87 |...._.I. .j.f.&..|
000000F0: e3 f0 48 2a 3b 01 b0 63  fe cf 0a a3 20 56 f1 62 |..H*;..c .... V.b|

You can then compare it with the beginning of the image-bmc file on the host:

jamin@JaminLin-PC:~/qemu-work/debug-qemu-ssp-review/ast2700-irot$ xxd image-bmc 
| head
00000000: 464c 5348 0100 1100 aa26 8700 f964 8079  FLSH.....&...d.y
00000010: 0100 0000 dc00 0000 74a6 0100 0200 0000  ........t.......
00000020: 50a7 0100 843e 0000 0300 0000 d4e5 0100  P....>..........
00000030: 60ce 0200 0010 0000 34b4 0400 d877 0000  `.......4....w..
00000040: 0110 0000 0c2c 0500 0000 0100 0210 0000  .....,..........
00000050: 0c2c 0600 b874 0000 0310 0000 c4a0 0600  .,...t..........
00000060: 0000 0100 0410 0000 c4a0 0700 54cf 0000  ............T...
00000070: 0510 0000 1870 0800 0000 0100 0610 0000  .....p..........
00000080: 1870 0900 0040 0000 0710 0000 18b0 0900  .p...@..........
00000090: 00a0 0000 0810 0000 1850 0a00 6c70 0000  .........P..lp..

The contents read from the emulated flash should match the corresponding data 
in image-bmc

Thanks,
Jamin

> Thanks,
> 
> C.

Reply via email to