031-05-MIPS-BCM47xx-Move-NVRAM-header-to-the-include-linux.patch 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. From 138173d4e826587da66c7d321da1a91283222536 Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
  3. Date: Mon, 1 Dec 2014 07:58:18 +0100
  4. Subject: [PATCH] MIPS: BCM47xx: Move NVRAM header to the include/linux/.
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. There are two reasons for having this header in the common place:
  9. 1) Simplifying drivers that read NVRAM entries. We will be able to
  10. safely call bcm47xx_nvram_* functions without #ifdef-s.
  11. 2) Getting NVRAM driver out of MIPS arch code. This is needed to support
  12. BCM5301X arch which also requires this NVRAM driver. Patch for that
  13. will follow once we get is reviewed.
  14. Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
  15. Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
  16. Cc: linux-mips@linux-mips.org
  17. Cc: Arnd Bergmann <arnd@arndb.de>
  18. Cc: Paul Walmsley <paul@pwsan.com>
  19. Cc: linux-soc@vger.kernel.org
  20. Patchwork: https://patchwork.linux-mips.org/patch/8619/
  21. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  22. ---
  23. arch/mips/bcm47xx/board.c | 2 +-
  24. arch/mips/bcm47xx/nvram.c | 2 +-
  25. arch/mips/bcm47xx/setup.c | 1 -
  26. arch/mips/bcm47xx/sprom.c | 1 -
  27. arch/mips/bcm47xx/time.c | 1 -
  28. arch/mips/include/asm/mach-bcm47xx/bcm47xx.h | 1 +
  29. arch/mips/include/asm/mach-bcm47xx/bcm47xx_nvram.h | 21 -------------
  30. drivers/bcma/driver_mips.c | 2 +-
  31. drivers/net/ethernet/broadcom/b44.c | 2 +-
  32. drivers/net/ethernet/broadcom/bgmac.c | 2 +-
  33. drivers/ssb/driver_chipcommon_pmu.c | 2 +-
  34. drivers/ssb/driver_mipscore.c | 2 +-
  35. include/linux/bcm47xx_nvram.h | 34 ++++++++++++++++++++++
  36. 13 files changed, 42 insertions(+), 31 deletions(-)
  37. delete mode 100644 arch/mips/include/asm/mach-bcm47xx/bcm47xx_nvram.h
  38. create mode 100644 include/linux/bcm47xx_nvram.h
  39. --- a/arch/mips/bcm47xx/board.c
  40. +++ b/arch/mips/bcm47xx/board.c
  41. @@ -1,8 +1,8 @@
  42. #include <linux/errno.h>
  43. #include <linux/export.h>
  44. #include <linux/string.h>
  45. +#include <bcm47xx.h>
  46. #include <bcm47xx_board.h>
  47. -#include <bcm47xx_nvram.h>
  48. struct bcm47xx_board_type {
  49. const enum bcm47xx_board board;
  50. --- a/arch/mips/bcm47xx/nvram.c
  51. +++ b/arch/mips/bcm47xx/nvram.c
  52. @@ -16,7 +16,7 @@
  53. #include <linux/kernel.h>
  54. #include <linux/string.h>
  55. #include <linux/mtd/mtd.h>
  56. -#include <bcm47xx_nvram.h>
  57. +#include <linux/bcm47xx_nvram.h>
  58. #define NVRAM_MAGIC 0x48534C46 /* 'FLSH' */
  59. #define NVRAM_SPACE 0x8000
  60. --- a/arch/mips/bcm47xx/setup.c
  61. +++ b/arch/mips/bcm47xx/setup.c
  62. @@ -42,7 +42,6 @@
  63. #include <asm/reboot.h>
  64. #include <asm/time.h>
  65. #include <bcm47xx.h>
  66. -#include <bcm47xx_nvram.h>
  67. #include <bcm47xx_board.h>
  68. union bcm47xx_bus bcm47xx_bus;
  69. --- a/arch/mips/bcm47xx/sprom.c
  70. +++ b/arch/mips/bcm47xx/sprom.c
  71. @@ -27,7 +27,6 @@
  72. */
  73. #include <bcm47xx.h>
  74. -#include <bcm47xx_nvram.h>
  75. #include <linux/if_ether.h>
  76. #include <linux/etherdevice.h>
  77. --- a/arch/mips/bcm47xx/time.c
  78. +++ b/arch/mips/bcm47xx/time.c
  79. @@ -27,7 +27,6 @@
  80. #include <linux/ssb/ssb.h>
  81. #include <asm/time.h>
  82. #include <bcm47xx.h>
  83. -#include <bcm47xx_nvram.h>
  84. #include <bcm47xx_board.h>
  85. void __init plat_time_init(void)
  86. --- a/arch/mips/include/asm/mach-bcm47xx/bcm47xx.h
  87. +++ b/arch/mips/include/asm/mach-bcm47xx/bcm47xx.h
  88. @@ -22,6 +22,7 @@
  89. #include <linux/ssb/ssb.h>
  90. #include <linux/bcma/bcma.h>
  91. #include <linux/bcma/bcma_soc.h>
  92. +#include <linux/bcm47xx_nvram.h>
  93. enum bcm47xx_bus_type {
  94. #ifdef CONFIG_BCM47XX_SSB
  95. --- a/arch/mips/include/asm/mach-bcm47xx/bcm47xx_nvram.h
  96. +++ b/arch/mips/include/asm/mach-bcm47xx/bcm47xx_nvram.h
  97. @@ -1,21 +1 @@
  98. -/*
  99. - * Copyright (C) 2005, Broadcom Corporation
  100. - * Copyright (C) 2006, Felix Fietkau <nbd@openwrt.org>
  101. - *
  102. - * This program is free software; you can redistribute it and/or modify it
  103. - * under the terms of the GNU General Public License as published by the
  104. - * Free Software Foundation; either version 2 of the License, or (at your
  105. - * option) any later version.
  106. - */
  107. -
  108. -#ifndef __BCM47XX_NVRAM_H
  109. -#define __BCM47XX_NVRAM_H
  110. -
  111. -#include <linux/types.h>
  112. -#include <linux/kernel.h>
  113. -
  114. -int bcm47xx_nvram_init_from_mem(u32 base, u32 lim);
  115. -int bcm47xx_nvram_getenv(const char *name, char *val, size_t val_len);
  116. -int bcm47xx_nvram_gpio_pin(const char *name);
  117. -
  118. -#endif /* __BCM47XX_NVRAM_H */
  119. +#include <linux/bcm47xx_nvram.h>
  120. --- a/drivers/bcma/driver_mips.c
  121. +++ b/drivers/bcma/driver_mips.c
  122. @@ -21,7 +21,7 @@
  123. #include <linux/serial_reg.h>
  124. #include <linux/time.h>
  125. #ifdef CONFIG_BCM47XX
  126. -#include <bcm47xx_nvram.h>
  127. +#include <linux/bcm47xx_nvram.h>
  128. #endif
  129. enum bcma_boot_dev {
  130. --- a/drivers/net/ethernet/broadcom/b44.c
  131. +++ b/drivers/net/ethernet/broadcom/b44.c
  132. @@ -400,7 +400,7 @@ static void b44_set_flow_ctrl(struct b44
  133. }
  134. #ifdef CONFIG_BCM47XX
  135. -#include <bcm47xx_nvram.h>
  136. +#include <linux/bcm47xx_nvram.h>
  137. static void b44_wap54g10_workaround(struct b44 *bp)
  138. {
  139. char buf[20];
  140. --- a/drivers/net/ethernet/broadcom/bgmac.c
  141. +++ b/drivers/net/ethernet/broadcom/bgmac.c
  142. @@ -18,7 +18,7 @@
  143. #include <linux/interrupt.h>
  144. #include <linux/dma-mapping.h>
  145. #include <linux/platform_data/b53.h>
  146. -#include <bcm47xx_nvram.h>
  147. +#include <linux/bcm47xx_nvram.h>
  148. static const struct bcma_device_id bgmac_bcma_tbl[] = {
  149. BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_4706_MAC_GBIT, BCMA_ANY_REV, BCMA_ANY_CLASS),
  150. --- a/drivers/ssb/driver_chipcommon_pmu.c
  151. +++ b/drivers/ssb/driver_chipcommon_pmu.c
  152. @@ -14,7 +14,7 @@
  153. #include <linux/delay.h>
  154. #include <linux/export.h>
  155. #ifdef CONFIG_BCM47XX
  156. -#include <bcm47xx_nvram.h>
  157. +#include <linux/bcm47xx_nvram.h>
  158. #endif
  159. #include "ssb_private.h"
  160. --- a/drivers/ssb/driver_mipscore.c
  161. +++ b/drivers/ssb/driver_mipscore.c
  162. @@ -16,7 +16,7 @@
  163. #include <linux/serial_reg.h>
  164. #include <linux/time.h>
  165. #ifdef CONFIG_BCM47XX
  166. -#include <bcm47xx_nvram.h>
  167. +#include <linux/bcm47xx_nvram.h>
  168. #endif
  169. #include "ssb_private.h"