[PATCH linux dev-4.10] mtd: spi-nor: aspeed: set 4B setting for all chips

Joel Stanley joel at jms.id.au
Tue Jul 25 13:51:52 AEST 2017


On Mon, Jul 24, 2017 at 7:10 PM, Cédric Le Goater <clg at kaod.org> wrote:
> The driver made the wrong assumption that the 4B setting was
> autodetected for all chips of the AST2500 FMC flash controller. This
> is only the case for the CS0.
>
> Signed-off-by: Cédric Le Goater <clg at kaod.org>

I tested this on a witherspoon and it appeared to work. I have applied
it to dev-4.10. Thanks for hunting it down!

root at spoon1-bmc:~# time flashcp /tmp/flash-witherspoon /dev/mtd6
real 3m44.212s
user 0m0.750s
sys 3m42.620s

Cheers,

Joel


> ---
>
>  To be noted that the speed setting of CS1 is quite low because the
>  HCLK/16 divider is used. It can be improved.
>
>  drivers/mtd/spi-nor/aspeed-smc.c |   13 ++++++-------
>  1 file changed, 6 insertions(+), 7 deletions(-)
>
> Index: linux-openbmc-4.10.git/drivers/mtd/spi-nor/aspeed-smc.c
> ===================================================================
> --- linux-openbmc-4.10.git.orig/drivers/mtd/spi-nor/aspeed-smc.c
> +++ linux-openbmc-4.10.git/drivers/mtd/spi-nor/aspeed-smc.c
> @@ -794,19 +794,18 @@ static void aspeed_smc_chip_set_type(str
>  }
>
>  /*
> - * The AST2500 FMC flash controller should be strapped by hardware, or
> - * autodetected, but the AST2500 SPI flash needs to be set.
> + * The first chip of the AST2500 FMC flash controller is strapped by
> + * hardware, or autodetected, but other chips need to be set. Enforce
> + * the 4B setting for all chips.
>   */
>  static void aspeed_smc_chip_set_4b(struct aspeed_smc_chip *chip)
>  {
>         struct aspeed_smc_controller *controller = chip->controller;
>         u32 reg;
>
> -       if (chip->controller->info == &spi_2500_info) {
> -               reg = readl(controller->regs + CE_CONTROL_REG);
> -               reg |= 1 << chip->cs;
> -               writel(reg, controller->regs + CE_CONTROL_REG);
> -       }
> +       reg = readl(controller->regs + CE_CONTROL_REG);
> +       reg |= 1 << chip->cs;
> +       writel(reg, controller->regs + CE_CONTROL_REG);
>  }
>
>  /*


More information about the openbmc mailing list