diff options
Diffstat (limited to 'drivers/mtd/bcm63xxpart.c')
-rw-r--r-- | drivers/mtd/bcm63xxpart.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/mtd/bcm63xxpart.c b/drivers/mtd/bcm63xxpart.c index 6eeb84c81bc2..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 |
@@ -27,17 +27,19 @@ | |||
27 | #include <linux/crc32.h> | 27 | #include <linux/crc32.h> |
28 | #include <linux/module.h> | 28 | #include <linux/module.h> |
29 | #include <linux/kernel.h> | 29 | #include <linux/kernel.h> |
30 | #include <linux/sizes.h> | ||
30 | #include <linux/slab.h> | 31 | #include <linux/slab.h> |
31 | #include <linux/vmalloc.h> | 32 | #include <linux/vmalloc.h> |
32 | #include <linux/mtd/mtd.h> | 33 | #include <linux/mtd/mtd.h> |
33 | #include <linux/mtd/partitions.h> | 34 | #include <linux/mtd/partitions.h> |
34 | 35 | ||
36 | #include <asm/mach-bcm63xx/bcm63xx_nvram.h> | ||
35 | #include <asm/mach-bcm63xx/bcm963xx_tag.h> | 37 | #include <asm/mach-bcm63xx/bcm963xx_tag.h> |
36 | #include <asm/mach-bcm63xx/board_bcm963xx.h> | 38 | #include <asm/mach-bcm63xx/board_bcm963xx.h> |
37 | 39 | ||
38 | #define BCM63XX_EXTENDED_SIZE 0xBFC00000 /* Extended flash address */ | 40 | #define BCM63XX_EXTENDED_SIZE 0xBFC00000 /* Extended flash address */ |
39 | 41 | ||
40 | #define BCM63XX_CFE_BLOCK_SIZE 0x10000 /* always at least 64KiB */ | 42 | #define BCM63XX_CFE_BLOCK_SIZE SZ_64K /* always at least 64KiB */ |
41 | 43 | ||
42 | #define BCM63XX_CFE_MAGIC_OFFSET 0x4e0 | 44 | #define BCM63XX_CFE_MAGIC_OFFSET 0x4e0 |
43 | 45 | ||
@@ -90,7 +92,8 @@ static int bcm63xx_parse_cfe_partitions(struct mtd_info *master, | |||
90 | BCM63XX_CFE_BLOCK_SIZE); | 92 | BCM63XX_CFE_BLOCK_SIZE); |
91 | 93 | ||
92 | cfelen = cfe_erasesize; | 94 | cfelen = cfe_erasesize; |
93 | nvramlen = cfe_erasesize; | 95 | nvramlen = bcm63xx_nvram_get_psi_size() * SZ_1K; |
96 | nvramlen = roundup(nvramlen, cfe_erasesize); | ||
94 | 97 | ||
95 | /* Allocate memory for buffer */ | 98 | /* Allocate memory for buffer */ |
96 | buf = vmalloc(sizeof(struct bcm_tag)); | 99 | buf = vmalloc(sizeof(struct bcm_tag)); |