summaryrefslogtreecommitdiff
path: root/drivers/mtd/bcm63xxpart.c
AgeCommit message (Collapse)AuthorFilesLines
2014-01-03mtd: make register_mtd_parser return voidAxel Lin1-1/+2
register_mtd_parser never fails; hence make it return void. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2013-08-05mtd: bcm63xxpart: use nvram for PSI sizeJonas Gorski1-2/+4
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>
2013-08-05mtd: bcm63xxpart: use size macro for CFE block sizeJonas Gorski1-1/+2
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>
2012-11-21mtd: bcm63xxpart: use correct printk format for partitionsJonas Gorski1-3/+2
Use ll to be able to remove the casts. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> Reviewed-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-11-21mtd: bcm63xxpart: move the last curpart++ to its correct placeJonas Gorski1-1/+1
The line belongs above the comment, not below it. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> Reviewed-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-11-21mtd: bcm63xxpart: make fixed part length calculation more genericJonas Gorski1-4/+7
The CFE does not use 4K sectors even if the flash supports it, so for the fixed partitions like CFE itself or NVRAM the erase block size is always 64k or bigger. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> Reviewed-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-11-21mtd: bcm63xxpart: merge sparelen calculationJonas Gorski1-2/+1
The length of the spare part is calculated the same way in both branches so move to a common place. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> Reviewed-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-11-21mtd: bcm63xxpart: remove unused variableJonas Gorski1-8/+3
namelen is never used, so drop it. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> Reviewed-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-05-14mtd: bcm63xxpart: handle Broadcom partition orderJonas Gorski1-11/+30
The original Broadcom partition order has the root fs in front of the kernel, which resulted in miscalculated partition sizes. Detect when such an image is on the flash and also reorder the partitions accordingly. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> 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>
2012-01-09mtd: introduce mtd_read interfaceArtem Bityutskiy1-6/+6
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: bcm63xxpart: check the image tag's crc32Jonas Gorski1-16/+29
Only use the values from the image tag if it is valid. Always create the CFE, NVRAM and linux partitions, to allow flashing a new image even if the old is invalid without overwriting CFE or NVRAM. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: bcm63xxpart: don't assume NVRAM is always the fourth partitionJonas Gorski1-2/+2
Instead of referencing the sizes of fixed partitions, use the precomputed CFE/NVRAM lengths. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: bcm63xxpart: make sure CFE and NVRAM partitions are at least 64KiBJonas Gorski1-7/+15
The CFE boot loader on BCM63XX platforms assumes itself and the NVRAM partition to be 64 KiB (or erase block sized, if larger). Ensure this assumption is also met when creating the partitions to prevent accidential erasure of CFE or NVRAM. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: bcm63xxpart: check version marker string for newer CFEsJonas Gorski1-5/+17
Recent CFEs do not contain the CFE1CFE1 magic anymore, so check for the "cfe-v" version marker string instead. As very old CFEs do not have this string, leave the CFE1CFE1 magic as a fallback for detection. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: maps: bcm963xx-flash: make CFE partition parsing an mtd parserJonas Gorski1-0/+189
Recent BCM63XX devices support a variety of flash types (parallel, SPI, NAND) and share the partition layout. To prevent code duplication make the CFE partition parsing code a stand alone mtd parser to allow SPI or NAND flash drivers to use it. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> 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>