Hi,

On 10/16/26 3:43 AM, Takahiro Kuwano via B4 Relay wrote:
The spi-nor-core.c contains optional logics like SFDP and manufcaturer
specific fixups. The spi-nor-ids.c has single large ID database. There
are many #ifdef directives in those files and that negatively affects
readability and maintainability.

This series, as the first step of cleanup, move SFDP logic, IDs, and
fixups to newly source files. Reworking, renaming, and reformating
existing code is not a scope of this series and further cleanup will be
taken place in follow-up patches.

Here is the code size impact when applying this series.
Measured by my AMD Zynq-7000 (ARM32) environment with SFDP and all
manufcaturers are enabled.

SPI-NOR:
             text    data     bss     dec     hex filename
BEFORE    720685   14084       0  734769   b3631 u-boot
AFTER     721827   14156       0  735983   b3aef u-boot
DELTA      +1142     +72

TINY:
             text    data     bss     dec     hex filename
BEFORE     77399    3128     248   80775   13b87 spl/u-boot-spl
AFTER      77589    3200     248   81037   13c8d spl/u-boot-spl
DELTA       +190     +72

I tested it on a PicoZed board with a Macronix flash (mx25uw51245g), it works like a charm.

FYI, below the size differences with only Macronix enabled:

SPI-NOR:
        text    data     bss     dec     hex   filename
BEFORE  931951   44980       0  976931   ee823 u-boot
AFTER   932523   44988       0  977511   eea67 u-boot
DELTA     +572      +8

TINY:
        text    data     bss     dec     hex   filename
BEFORE  91612    3252     248   95112   17388 spl/u-boot-spl
AFTER   91680    3264     248   95192   173d8 spl/u-boot-spl
DELTA     +68     +12

Tested-by: Bastien Curutchet <[email protected]> # mx25uw51245g


Best regards,
Bastien

Reply via email to