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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. From 83131acbfb59760a19f3711c09526e191c8aad54 Mon Sep 17 00:00:00 2001
  2. From: Jonas Gorski <[email protected]>
  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 <[email protected]>
  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. @@ -63,6 +63,7 @@ static struct board_info __initdata boar
  18. .has_pci = 1,
  19. .has_uart0 = 1,
  20. + .use_fallback_sprom = 1,
  21. .has_usbd = 0,
  22. .usbd = {
  23. @@ -213,6 +214,7 @@ static struct board_info __initdata boar
  24. .has_pci = 1,
  25. .has_uart0 = 1,
  26. + .use_fallback_sprom = 1,
  27. .has_enet0 = 1,
  28. .enet0 = {
  29. @@ -259,6 +261,7 @@ static struct board_info __initdata boar
  30. .has_pccard = 1,
  31. .has_pci = 1,
  32. .has_uart0 = 1,
  33. + .use_fallback_sprom = 1,
  34. .has_enet0 = 1,
  35. .enet0 = {
  36. @@ -310,6 +313,7 @@ static struct board_info __initdata boar
  37. .has_pccard = 1,
  38. .has_pci = 1,
  39. .has_uart0 = 1,
  40. + .use_fallback_sprom = 1,
  41. .has_enet0 = 1,
  42. .enet0 = {
  43. @@ -360,6 +364,7 @@ static struct board_info __initdata boar
  44. .has_ohci0 = 1,
  45. .has_pci = 1,
  46. .has_uart0 = 1,
  47. + .use_fallback_sprom = 1,
  48. .has_enet0 = 1,
  49. .enet0 = {
  50. @@ -411,6 +416,7 @@ static struct board_info __initdata boar
  51. .has_pccard = 1,
  52. .has_pci = 1,
  53. .has_uart0 = 1,
  54. + .use_fallback_sprom = 1,
  55. .has_enet0 = 1,
  56. .enet0 = {
  57. @@ -430,6 +436,7 @@ static struct board_info __initdata boar
  58. .expected_cpu_id = 0x6348,
  59. .has_pci = 1,
  60. + .use_fallback_sprom = 1,
  61. .has_enet0 = 1,
  62. .enet0 = {
  63. @@ -451,6 +458,7 @@ static struct board_info __initdata boar
  64. .has_ohci0 = 1,
  65. .has_pci = 1,
  66. .has_uart0 = 1,
  67. + .use_fallback_sprom = 1,
  68. .has_enet0 = 1,
  69. .enet0 = {
  70. @@ -472,6 +480,7 @@ static struct board_info __initdata boar
  71. .has_ohci0 = 1,
  72. .has_pci = 1,
  73. .has_uart0 = 1,
  74. + .use_fallback_sprom = 1,
  75. .has_enet0 = 1,
  76. .enet0 = {
  77. @@ -500,6 +509,7 @@ static struct board_info __initdata boar
  78. .has_pccard = 1,
  79. .has_pci = 1,
  80. .has_uart0 = 1,
  81. + .use_fallback_sprom = 1,
  82. .has_enet0 = 1,
  83. .enet0 = {
  84. @@ -551,6 +561,7 @@ static struct board_info __initdata boar
  85. .has_pccard = 1,
  86. .has_pci = 1,
  87. .has_uart0 = 1,
  88. + .use_fallback_sprom = 1,
  89. .has_enet0 = 1,
  90. .enet0 = {
  91. @@ -617,6 +628,7 @@ static struct board_info __initdata boar
  92. .has_ehci0 = 1,
  93. .has_ohci0 = 1,
  94. .has_pci = 1,
  95. + .use_fallback_sprom = 1,
  96. .has_enet0 = 1,
  97. .enet0 = {
  98. --- a/arch/mips/bcm63xx/boards/board_common.c
  99. +++ b/arch/mips/bcm63xx/boards/board_common.c
  100. @@ -183,8 +183,9 @@ int __init board_register_devices(void)
  101. * do this after registering enet devices
  102. */
  103. - if (board_get_mac_address(board.fallback_sprom.mac_addr) ||
  104. - bcm63xx_register_fallback_sprom(&board.fallback_sprom))
  105. + if (board.use_fallback_sprom &&
  106. + (board_get_mac_address(board.fallback_sprom.mac_addr) ||
  107. + bcm63xx_register_fallback_sprom(&board.fallback_sprom)))
  108. pr_err(PFX "failed to register fallback SPROM\n");
  109. bcm63xx_spi_register();
  110. --- a/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
  111. +++ b/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
  112. @@ -33,6 +33,7 @@ struct board_info {
  113. unsigned int has_usbd:1;
  114. unsigned int has_uart0:1;
  115. unsigned int has_uart1:1;
  116. + unsigned int use_fallback_sprom:1;
  117. /* ethernet config */
  118. struct bcm63xx_enet_platform_data enet0;