418-MIPS-BCM63XX-pass-caldata-info-to-flash.patch 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. From 977f8a30103b9c4992cab8f49357fe0d4274004f Mon Sep 17 00:00:00 2001
  2. From: Jonas Gorski <jonas.gorski@gmail.com>
  3. Date: Thu, 3 May 2012 14:55:26 +0200
  4. Subject: [PATCH 69/80] MIPS: BCM63XX: pass caldata info to flash
  5. ---
  6. arch/mips/bcm63xx/boards/board_common.c | 2 +-
  7. arch/mips/bcm63xx/dev-flash.c | 9 ++++++++-
  8. arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_flash.h | 4 +++-
  9. 3 files changed, 12 insertions(+), 3 deletions(-)
  10. --- a/arch/mips/bcm63xx/boards/board_common.c
  11. +++ b/arch/mips/bcm63xx/boards/board_common.c
  12. @@ -269,7 +269,7 @@ int __init board_register_devices(void)
  13. if (board.num_spis)
  14. spi_register_board_info(board.spis, board.num_spis);
  15. - bcm63xx_flash_register();
  16. + bcm63xx_flash_register(board.has_caldata, board.caldata);
  17. /* count number of LEDs defined by this device */
  18. while (led_count < ARRAY_SIZE(board.leds) && board.leds[led_count].name)
  19. --- a/arch/mips/bcm63xx/dev-flash.c
  20. +++ b/arch/mips/bcm63xx/dev-flash.c
  21. @@ -38,12 +38,15 @@ static struct mtd_partition mtd_partitio
  22. }
  23. };
  24. +static struct mtd_part_parser_data bcm63xx_parser_data;
  25. +
  26. static const char *bcm63xx_part_types[] = { "bcm63xxpart", "RedBoot", NULL };
  27. static struct physmap_flash_data flash_data = {
  28. .width = 2,
  29. .parts = mtd_partitions,
  30. .part_probe_types = bcm63xx_part_types,
  31. + .pp_data = &bcm63xx_parser_data,
  32. };
  33. static struct resource mtd_resources[] = {
  34. @@ -71,6 +74,7 @@ void __init bcm63xx_flash_force_phys_bas
  35. static struct flash_platform_data bcm63xx_flash_data = {
  36. .part_probe_types = bcm63xx_part_types,
  37. + .pp_data = &bcm63xx_parser_data,
  38. };
  39. static struct spi_board_info bcm63xx_spi_flash_info[] = {
  40. @@ -211,9 +215,13 @@ void __init bcm63xx_flash_detect(void)
  41. }
  42. }
  43. -int __init bcm63xx_flash_register(void)
  44. +int __init bcm63xx_flash_register(int num_caldata, struct ath9k_caldata *caldata)
  45. {
  46. u32 val;
  47. + unsigned int i;
  48. +
  49. + for (i = 0; i < num_caldata; i++)
  50. + bcm63xx_parser_data.caldata[i] = caldata[i].caldata_offset;
  51. switch (flash_type) {
  52. case BCM63XX_FLASH_TYPE_PARALLEL:
  53. --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_flash.h
  54. +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_flash.h
  55. @@ -1,6 +1,8 @@
  56. #ifndef __BCM63XX_FLASH_H
  57. #define __BCM63XX_FLASH_H
  58. +#include <board_bcm963xx.h>
  59. +
  60. enum {
  61. BCM63XX_FLASH_TYPE_PARALLEL,
  62. BCM63XX_FLASH_TYPE_SERIAL,
  63. @@ -11,7 +13,7 @@ void bcm63xx_flash_detect(void);
  64. void bcm63xx_flash_force_phys_base_address(u32 start, u32 end);
  65. -int __init bcm63xx_flash_register(void);
  66. +int __init bcm63xx_flash_register(int num_caldata, struct ath9k_caldata *caldata);
  67. int bcm63xx_flash_get_type(void);