[PATCH 1/2] spi: aspeed: Use "jedec,spi-nor" compatible to count devices

Joel Stanley joel at jms.id.au
Wed Jun 8 16:22:43 AEST 2022


On Wed, 8 Jun 2022 at 06:15, Cédric Le Goater <clg at kaod.org> wrote:
>
> The SoC device trees use the "jedec,spi-nor" compatible property to
> describe the flash devices and the board device trees override this
> property with "spi-flash", "sst,w25q256". This comes from the initial
> driver which was first written when spi-nor support had not been
> merged in U-boot yet.
>
> "jedec,spi-nor" should be preferred since it is used by Linux and the
> latest U-boot. Use it to count devices. We will clean up the board
> device trees later.
>
> Cc: Chin-Ting Kuo <chin-ting_kuo at aspeedtech.com>
> Signed-off-by: Cédric Le Goater <clg at kaod.org>

Reviewed-by: Joel Stanley <joel at jms.id.au>

> ---
>  drivers/spi/aspeed_spi.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/spi/aspeed_spi.c b/drivers/spi/aspeed_spi.c
> index 65d69105e8e8..45f6a8dd6850 100644
> --- a/drivers/spi/aspeed_spi.c
> +++ b/drivers/spi/aspeed_spi.c
> @@ -1241,7 +1241,8 @@ static int aspeed_spi_count_flash_devices(struct udevice *bus)
>
>         dev_for_each_subnode(node, bus) {
>                 if (ofnode_is_available(node) &&
> -                   ofnode_device_is_compatible(node, "spi-flash"))
> +                   (ofnode_device_is_compatible(node, "spi-flash") ||
> +                    ofnode_device_is_compatible(node, "jedec,spi-nor")))
>                         count++;
>         }
>
> --
> 2.35.3
>


More information about the openbmc mailing list