358-MIPS-BCM63XX-make-fallback-sprom-optional.patch 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. From 83131acbfb59760a19f3711c09526e191c8aad54 Mon Sep 17 00:00:00 2001
  2. From: Jonas Gorski <jogo@openwrt.org>
  3. Date: Tue, 29 Jul 2014 21:52:56 +0200
  4. Subject: [PATCH 03/10] MIPS: BCM63XX: make fallback sprom optional
  5. Some devices do not provide enough mac addresses to populate wifi in
  6. addition to ethernet.
  7. Use having pci enabled as a rough heuristic which boards should have it
  8. enabled.
  9. Signed-off-by: Jonas Gorski <jogo@openwrt.org>
  10. ---
  11. arch/mips/bcm63xx/boards/board_bcm963xx.c | 12 ++++++++++++
  12. arch/mips/bcm63xx/boards/board_common.c | 5 +++--
  13. arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h | 1 +
  14. 3 files changed, 16 insertions(+), 2 deletions(-)
  15. --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
  16. +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
  17. @@ -74,6 +74,7 @@ static struct board_info __initdata boar
  18. .has_uart0 = 1,
  19. .has_pci = 1,
  20. .has_usbd = 0,
  21. + .use_fallback_sprom = 1,
  22. .usbd = {
  23. .use_fullspeed = 0,
  24. @@ -223,6 +224,7 @@ static struct board_info __initdata boar
  25. .has_uart0 = 1,
  26. .has_enet0 = 1,
  27. .has_pci = 1,
  28. + .use_fallback_sprom = 1,
  29. .enet0 = {
  30. .has_phy = 1,
  31. @@ -268,6 +270,7 @@ static struct board_info __initdata boar
  32. .has_enet0 = 1,
  33. .has_enet1 = 1,
  34. .has_pci = 1,
  35. + .use_fallback_sprom = 1,
  36. .enet0 = {
  37. .has_phy = 1,
  38. @@ -328,6 +331,7 @@ static struct board_info __initdata boar
  39. .has_enet0 = 1,
  40. .has_enet1 = 1,
  41. .has_pci = 1,
  42. + .use_fallback_sprom = 1,
  43. .enet0 = {
  44. .has_phy = 1,
  45. @@ -382,6 +386,7 @@ static struct board_info __initdata boar
  46. .has_enet0 = 1,
  47. .has_enet1 = 1,
  48. .has_pci = 1,
  49. + .use_fallback_sprom = 1,
  50. .enet0 = {
  51. .has_phy = 1,
  52. @@ -440,6 +445,7 @@ static struct board_info __initdata boar
  53. .has_enet0 = 1,
  54. .has_enet1 = 1,
  55. .has_pci = 1,
  56. + .use_fallback_sprom = 1,
  57. .enet0 = {
  58. .has_phy = 1,
  59. @@ -463,6 +469,7 @@ static struct board_info __initdata boar
  60. .has_enet0 = 1,
  61. .has_enet1 = 1,
  62. .has_pci = 1,
  63. + .use_fallback_sprom = 1,
  64. .enet0 = {
  65. .has_phy = 1,
  66. @@ -481,6 +488,7 @@ static struct board_info __initdata boar
  67. .has_uart0 = 1,
  68. .has_pci = 1,
  69. + .use_fallback_sprom = 1,
  70. .has_ohci0 = 1,
  71. .has_enet0 = 1,
  72. @@ -503,6 +511,7 @@ static struct board_info __initdata boar
  73. .has_enet0 = 1,
  74. .has_enet1 = 1,
  75. .has_pci = 1,
  76. + .use_fallback_sprom = 1,
  77. .enet0 = {
  78. .has_phy = 1,
  79. @@ -529,6 +538,7 @@ static struct board_info __initdata boar
  80. .has_enet0 = 1,
  81. .has_enet1 = 1,
  82. .has_pci = 1,
  83. + .use_fallback_sprom = 1,
  84. .enet0 = {
  85. .has_phy = 1,
  86. @@ -581,6 +591,7 @@ static struct board_info __initdata boar
  87. .has_enet0 = 1,
  88. .has_enet1 = 1,
  89. .has_pci = 1,
  90. + .use_fallback_sprom = 1,
  91. .enet0 = {
  92. .has_phy = 1,
  93. @@ -652,6 +663,7 @@ static struct board_info __initdata boar
  94. .has_enet0 = 1,
  95. .has_enet1 = 1,
  96. .has_pci = 1,
  97. + .use_fallback_sprom = 1,
  98. .enet0 = {
  99. .has_phy = 1,
  100. --- a/arch/mips/bcm63xx/boards/board_common.c
  101. +++ b/arch/mips/bcm63xx/boards/board_common.c
  102. @@ -202,8 +202,9 @@ int __init board_register_devices(void)
  103. * do this after registering enet devices
  104. */
  105. - if (board_get_mac_address(board.fallback_sprom.mac_addr) ||
  106. - bcm63xx_register_fallback_sprom(&board.fallback_sprom))
  107. + if (board.use_fallback_sprom &&
  108. + (board_get_mac_address(board.fallback_sprom.mac_addr) ||
  109. + bcm63xx_register_fallback_sprom(&board.fallback_sprom)))
  110. pr_err(PFX "failed to register fallback SPROM\n");
  111. bcm63xx_spi_register();
  112. --- a/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
  113. +++ b/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
  114. @@ -35,6 +35,7 @@ struct board_info {
  115. unsigned int has_dsp:1;
  116. unsigned int has_uart0:1;
  117. unsigned int has_uart1:1;
  118. + unsigned int use_fallback_sprom:1;
  119. /* ethernet config */
  120. struct bcm63xx_enet_platform_data enet0;