Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 811cb897 authored by Cédric Le Goater's avatar Cédric Le Goater Committed by Cyrille Pitchen
Browse files

mtd: spi-nor: aspeed: set 4B setting for all chips



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: default avatarCédric Le Goater <clg@kaod.org>
Signed-off-by: default avatarCyrille Pitchen <cyrille.pitchen@wedev4u.fr>
parent eb353aaa
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -621,20 +621,19 @@ static void aspeed_smc_chip_set_type(struct aspeed_smc_chip *chip, int type)
}

/*
 * 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);
}
}

/*
 * The AST2400 SPI flash controller does not have a CE Control