355-MIPS-BCM63XX-allow-board-implementations-to-force-fl.patch 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. From 8a30097a899b975709f728666d5ad20c8b832d21 Mon Sep 17 00:00:00 2001
  2. From: Jonas Gorski <jogo@openwrt.org>
  3. Date: Sun, 9 Mar 2014 04:28:14 +0100
  4. Subject: [PATCH 43/44] MIPS: BCM63XX: allow board implementations to force
  5. flash address
  6. Allow board implementations to force the physmap address.
  7. Signed-off-by: Jonas Gorski <jogo@openwrt.org>
  8. ---
  9. arch/mips/bcm63xx/dev-flash.c | 19 ++++++++++++++-----
  10. .../mips/include/asm/mach-bcm63xx/bcm63xx_dev_flash.h | 2 ++
  11. 2 files changed, 16 insertions(+), 5 deletions(-)
  12. --- a/arch/mips/bcm63xx/dev-flash.c
  13. +++ b/arch/mips/bcm63xx/dev-flash.c
  14. @@ -58,6 +58,12 @@ static struct platform_device mtd_dev =
  15. },
  16. };
  17. +void __init bcm63xx_flash_force_phys_base_address(u32 start, u32 end)
  18. +{
  19. + mtd_resources[0].start = start;
  20. + mtd_resources[0].end = end;
  21. +}
  22. +
  23. static int __init bcm63xx_detect_flash_type(void)
  24. {
  25. u32 val;
  26. @@ -172,12 +178,15 @@ int __init bcm63xx_flash_register(void)
  27. switch (flash_type) {
  28. case BCM63XX_FLASH_TYPE_PARALLEL:
  29. - /* read base address of boot chip select (0) */
  30. - val = bcm_mpi_readl(MPI_CSBASE_REG(0));
  31. - val &= MPI_CSBASE_BASE_MASK;
  32. - mtd_resources[0].start = val;
  33. - mtd_resources[0].end = 0x1FFFFFFF;
  34. + if (!mtd_resources[0].start) {
  35. + /* read base address of boot chip select (0) */
  36. + val = bcm_mpi_readl(MPI_CSBASE_REG(0));
  37. + val &= MPI_CSBASE_BASE_MASK;
  38. +
  39. + mtd_resources[0].start = val;
  40. + mtd_resources[0].end = 0x1FFFFFFF;
  41. + }
  42. return platform_device_register(&mtd_dev);
  43. case BCM63XX_FLASH_TYPE_SERIAL:
  44. --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_flash.h
  45. +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_flash.h
  46. @@ -9,6 +9,8 @@ enum {
  47. void bcm63xx_flash_detect(void);
  48. +void bcm63xx_flash_force_phys_base_address(u32 start, u32 end);
  49. +
  50. int __init bcm63xx_flash_register(void);
  51. #endif /* __BCM63XX_FLASH_H */