From: Jonas Gorski Date: Sat, 23 Mar 2013 13:07:49 +0000 (+0100) Subject: mtd: bcm63xxpart: use nvram for PSI size X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=d085eea16c05e5fecf258fc254059e9bc1e6db91;p=linux-beck.git mtd: bcm63xxpart: use nvram for PSI size Read out the SPI size from nvram instead of defaulting to 64KiB — some vendors actually use values larger than the "max" value of 64. Signed-off-by: Jonas Gorski Acked-by: Florian Fainelli Signed-off-by: Artem Bityutskiy Signed-off-by: David Woodhouse --- diff --git a/drivers/mtd/bcm63xxpart.c b/drivers/mtd/bcm63xxpart.c index fc3d7d00656d..5c813907661c 100644 --- a/drivers/mtd/bcm63xxpart.c +++ b/drivers/mtd/bcm63xxpart.c @@ -4,7 +4,7 @@ * Copyright © 2006-2008 Florian Fainelli * Mike Albon * Copyright © 2009-2010 Daniel Dickinson - * Copyright © 2011-2012 Jonas Gorski + * Copyright © 2011-2013 Jonas Gorski * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -33,6 +33,7 @@ #include #include +#include #include #include @@ -91,7 +92,8 @@ static int bcm63xx_parse_cfe_partitions(struct mtd_info *master, BCM63XX_CFE_BLOCK_SIZE); cfelen = cfe_erasesize; - nvramlen = cfe_erasesize; + nvramlen = bcm63xx_nvram_get_psi_size() * SZ_1K; + nvramlen = roundup(nvramlen, cfe_erasesize); /* Allocate memory for buffer */ buf = vmalloc(sizeof(struct bcm_tag));