Skip to content

Commit

Permalink
MIPS: bcm963xx: Move extended flash address to bcm_tag header file
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: David Woodhouse <[email protected]>
Cc: Brian Norris <[email protected]>
Cc: Kevin Cernekee <[email protected]>
Cc: Florian Fainelli <[email protected]>
Cc: Jonas Gorski <[email protected]>
Cc: Linux Kernel Mailing List <[email protected]>
Cc: MIPS Mailing List <[email protected]>
Cc: MTD Maling List <[email protected]>
Patchwork: https://patchwork.linux-mips.org/patch/11833/
Signed-off-by: Ralf Baechle <[email protected]>
  • Loading branch information
nomis authored and ralfbaechle committed Jan 24, 2016
1 parent 8fce60b commit 1f29cb1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/mtd/bcm63xxpart.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
#include <asm/mach-bcm63xx/bcm63xx_nvram.h>
#include <asm/mach-bcm63xx/board_bcm963xx.h>

#define BCM63XX_EXTENDED_SIZE 0xBFC00000 /* Extended flash address */

#define BCM63XX_CFE_BLOCK_SIZE SZ_64K /* always at least 64KiB */

#define BCM63XX_CFE_MAGIC_OFFSET 0x4e0
Expand Down Expand Up @@ -123,8 +121,8 @@ static int bcm63xx_parse_cfe_partitions(struct mtd_info *master,
pr_info("CFE boot tag found with version %s and board type %s\n",
tagversion, boardid);

kerneladdr = kerneladdr - BCM63XX_EXTENDED_SIZE;
rootfsaddr = rootfsaddr - BCM63XX_EXTENDED_SIZE;
kerneladdr = kerneladdr - BCM963XX_EXTENDED_SIZE;
rootfsaddr = rootfsaddr - BCM963XX_EXTENDED_SIZE;
spareaddr = roundup(totallen, master->erasesize) + cfelen;

if (rootfsaddr < kerneladdr) {
Expand Down
5 changes: 5 additions & 0 deletions include/linux/bcm963xx_tag.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
"DWV-S0", \
}

/* Extended flash address, needs to be subtracted
* from bcm_tag flash image offsets.
*/
#define BCM963XX_EXTENDED_SIZE 0xBFC00000

/*
* The broadcom firmware assumes the rootfs starts the image,
* therefore uses the rootfs start (flash_image_address)
Expand Down

0 comments on commit 1f29cb1

Please sign in to comment.