aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Arlott <simon@fire.lp0.eu>2015-12-13 17:47:55 -0500
committerRalf Baechle <ralf@linux-mips.org>2016-01-23 21:48:43 -0500
commit1f29cb19cb7c3bea870d7da02ec23823af9d636e (patch)
treedd156aee6145a374f4083999e29a1597e2087fe8
parent8fce60b8d0c62363c29d64efb0cceb98519f0350 (diff)
MIPS: bcm963xx: Move extended flash address to bcm_tag header file
The extended flash address needs to be subtracted from bcm_tag flash image offsets. Move this value to the bcm_tag header file. Renamed define name to consistently use bcm963xx for flash layout which should be considered a property of the board and not the SoC (i.e. bcm63xx could theoretically be used on a board without CFE or any flash). Signed-off-by: Simon Arlott <simon@fire.lp0.eu> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Brian Norris <computersforpeace@gmail.com> Cc: Kevin Cernekee <cernekee@gmail.com> Cc: Florian Fainelli <f.fainelli@gmail.com> Cc: Jonas Gorski <jogo@openwrt.org> Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org> Cc: MIPS Mailing List <linux-mips@linux-mips.org> Cc: MTD Maling List <linux-mtd@lists.infradead.org> Patchwork: https://patchwork.linux-mips.org/patch/11833/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r--drivers/mtd/bcm63xxpart.c6
-rw-r--r--include/linux/bcm963xx_tag.h5
2 files changed, 7 insertions, 4 deletions
diff --git a/drivers/mtd/bcm63xxpart.c b/drivers/mtd/bcm63xxpart.c
index 8b86ed69522e..0aa66c378c9f 100644
--- a/drivers/mtd/bcm63xxpart.c
+++ b/drivers/mtd/bcm63xxpart.c
@@ -37,8 +37,6 @@
37#include <asm/mach-bcm63xx/bcm63xx_nvram.h> 37#include <asm/mach-bcm63xx/bcm63xx_nvram.h>
38#include <asm/mach-bcm63xx/board_bcm963xx.h> 38#include <asm/mach-bcm63xx/board_bcm963xx.h>
39 39
40#define BCM63XX_EXTENDED_SIZE 0xBFC00000 /* Extended flash address */
41
42#define BCM63XX_CFE_BLOCK_SIZE SZ_64K /* always at least 64KiB */ 40#define BCM63XX_CFE_BLOCK_SIZE SZ_64K /* always at least 64KiB */
43 41
44#define BCM63XX_CFE_MAGIC_OFFSET 0x4e0 42#define BCM63XX_CFE_MAGIC_OFFSET 0x4e0
@@ -123,8 +121,8 @@ static int bcm63xx_parse_cfe_partitions(struct mtd_info *master,
123 pr_info("CFE boot tag found with version %s and board type %s\n", 121 pr_info("CFE boot tag found with version %s and board type %s\n",
124 tagversion, boardid); 122 tagversion, boardid);
125 123
126 kerneladdr = kerneladdr - BCM63XX_EXTENDED_SIZE; 124 kerneladdr = kerneladdr - BCM963XX_EXTENDED_SIZE;
127 rootfsaddr = rootfsaddr - BCM63XX_EXTENDED_SIZE; 125 rootfsaddr = rootfsaddr - BCM963XX_EXTENDED_SIZE;
128 spareaddr = roundup(totallen, master->erasesize) + cfelen; 126 spareaddr = roundup(totallen, master->erasesize) + cfelen;
129 127
130 if (rootfsaddr < kerneladdr) { 128 if (rootfsaddr < kerneladdr) {
diff --git a/include/linux/bcm963xx_tag.h b/include/linux/bcm963xx_tag.h
index f389dace6d95..08e0133820ed 100644
--- a/include/linux/bcm963xx_tag.h
+++ b/include/linux/bcm963xx_tag.h
@@ -28,6 +28,11 @@
28 "DWV-S0", \ 28 "DWV-S0", \
29} 29}
30 30
31/* Extended flash address, needs to be subtracted
32 * from bcm_tag flash image offsets.
33 */
34#define BCM963XX_EXTENDED_SIZE 0xBFC00000
35
31/* 36/*
32 * The broadcom firmware assumes the rootfs starts the image, 37 * The broadcom firmware assumes the rootfs starts the image,
33 * therefore uses the rootfs start (flash_image_address) 38 * therefore uses the rootfs start (flash_image_address)