diff options
author | Jonas Gorski <jogo@openwrt.org> | 2013-03-23 09:07:49 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2013-08-05 13:59:34 -0400 |
commit | d085eea16c05e5fecf258fc254059e9bc1e6db91 (patch) | |
tree | ef2a1dbfd13d9a94533b9e8a1d794adb8a201a13 /drivers/mtd/bcm63xxpart.c | |
parent | e60665c50f0d94c0f2696b19cad7d281b2bc00cf (diff) |
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 <jogo@openwrt.org>
Acked-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/bcm63xxpart.c')
-rw-r--r-- | drivers/mtd/bcm63xxpart.c | 6 |
1 files changed, 4 insertions, 2 deletions
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 @@ | |||
4 | * Copyright © 2006-2008 Florian Fainelli <florian@openwrt.org> | 4 | * Copyright © 2006-2008 Florian Fainelli <florian@openwrt.org> |
5 | * Mike Albon <malbon@openwrt.org> | 5 | * Mike Albon <malbon@openwrt.org> |
6 | * Copyright © 2009-2010 Daniel Dickinson <openwrt@cshore.neomailbox.net> | 6 | * Copyright © 2009-2010 Daniel Dickinson <openwrt@cshore.neomailbox.net> |
7 | * Copyright © 2011-2012 Jonas Gorski <jonas.gorski@gmail.com> | 7 | * Copyright © 2011-2013 Jonas Gorski <jonas.gorski@gmail.com> |
8 | * | 8 | * |
9 | * This program is free software; you can redistribute it and/or modify | 9 | * This program is free software; you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License as published by | 10 | * it under the terms of the GNU General Public License as published by |
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/mtd/mtd.h> | 33 | #include <linux/mtd/mtd.h> |
34 | #include <linux/mtd/partitions.h> | 34 | #include <linux/mtd/partitions.h> |
35 | 35 | ||
36 | #include <asm/mach-bcm63xx/bcm63xx_nvram.h> | ||
36 | #include <asm/mach-bcm63xx/bcm963xx_tag.h> | 37 | #include <asm/mach-bcm63xx/bcm963xx_tag.h> |
37 | #include <asm/mach-bcm63xx/board_bcm963xx.h> | 38 | #include <asm/mach-bcm63xx/board_bcm963xx.h> |
38 | 39 | ||
@@ -91,7 +92,8 @@ static int bcm63xx_parse_cfe_partitions(struct mtd_info *master, | |||
91 | BCM63XX_CFE_BLOCK_SIZE); | 92 | BCM63XX_CFE_BLOCK_SIZE); |
92 | 93 | ||
93 | cfelen = cfe_erasesize; | 94 | cfelen = cfe_erasesize; |
94 | nvramlen = cfe_erasesize; | 95 | nvramlen = bcm63xx_nvram_get_psi_size() * SZ_1K; |
96 | nvramlen = roundup(nvramlen, cfe_erasesize); | ||
95 | 97 | ||
96 | /* Allocate memory for buffer */ | 98 | /* Allocate memory for buffer */ |
97 | buf = vmalloc(sizeof(struct bcm_tag)); | 99 | buf = vmalloc(sizeof(struct bcm_tag)); |