bcm63xx: add support for linux 3.8
[openwrt.git] / target / linux / brcm63xx / patches-3.8 / 430-MTD-bcm63xxpart-use-nvram-for-PSI-size.patch
1 From 658afad639a9456e1bb6fe5bba0032f3c0c3f699 Mon Sep 17 00:00:00 2001
2 From: Jonas Gorski <jonas.gorski@gmail.com>
3 Date: Tue, 1 May 2012 14:10:39 +0200
4 Subject: [PATCH 62/79] MTD: bcm63xxpart: use nvram for PSI size
5
6 ---
7  drivers/mtd/bcm63xxpart.c |    4 +++-
8  1 file changed, 3 insertions(+), 1 deletion(-)
9
10 --- a/drivers/mtd/bcm63xxpart.c
11 +++ b/drivers/mtd/bcm63xxpart.c
12 @@ -32,6 +32,7 @@
13  #include <linux/mtd/mtd.h>
14  #include <linux/mtd/partitions.h>
15  
16 +#include <asm/mach-bcm63xx/bcm63xx_nvram.h>
17  #include <linux/bcm963xx_tag.h>
18  #include <asm/mach-bcm63xx/board_bcm963xx.h>
19  
20 @@ -90,7 +91,8 @@ static int bcm63xx_parse_cfe_partitions(
21                               BCM63XX_CFE_BLOCK_SIZE);
22  
23         cfelen = cfe_erasesize;
24 -       nvramlen = cfe_erasesize;
25 +       nvramlen = bcm63xx_nvram_get_psi_size() * 1024;
26 +       nvramlen = roundup(nvramlen, cfe_erasesize);
27  
28         /* Allocate memory for buffer */
29         buf = vmalloc(sizeof(struct bcm_tag));