From f6eefaa4a08ec27c69485c2fc4db23247b84f8c9 Mon Sep 17 00:00:00 2001 From: Jonas Gorski Date: Tue, 1 May 2012 14:10:39 +0200 Subject: [PATCH v2 3/3] MTD: bcm63xxpart: use nvram for PSI size Read out the SPI size from nvram instead of defaulting to 64K - some vendors actually use values larger than the "max" value of 64. Signed-off-by: Jonas Gorski --- drivers/mtd/bcm63xxpart.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- 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 @@ -34,6 +34,7 @@ #include #include +#include #include #define BCM63XX_EXTENDED_SIZE 0xBFC00000 /* Extended flash address */ @@ -91,7 +92,8 @@ static int bcm63xx_parse_cfe_partitions( BCM63XX_CFE_BLOCK_SIZE); cfelen = cfe_erasesize; - nvramlen = cfe_erasesize; + nvramlen = bcm63xx_nvram_get_psi_size(); + nvramlen = roundup(nvramlen, cfe_erasesize); /* Allocate memory for buffer */ buf = vmalloc(sizeof(struct bcm_tag));