Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: BCM47xx: Move NVRAM header to the include/linux/.

There are two reasons for having this header in the common place:
1) Simplifying drivers that read NVRAM entries. We will be able to
safely call bcm47xx_nvram_* functions without #ifdef-s.
2) Getting NVRAM driver out of MIPS arch code. This is needed to support
BCM5301X arch which also requires this NVRAM driver. Patch for that
will follow once we get is reviewed.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
Cc: linux-mips@linux-mips.org
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Paul Walmsley <paul@pwsan.com>
Cc: linux-soc@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/8619/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Rafał Miłecki and committed by
Ralf Baechle
138173d4 5ae03b12

+24 -13
+1 -1
arch/mips/bcm47xx/board.c
··· 1 1 #include <linux/errno.h> 2 2 #include <linux/export.h> 3 3 #include <linux/string.h> 4 + #include <bcm47xx.h> 4 5 #include <bcm47xx_board.h> 5 - #include <bcm47xx_nvram.h> 6 6 7 7 struct bcm47xx_board_type { 8 8 const enum bcm47xx_board board;
+1 -1
arch/mips/bcm47xx/nvram.c
··· 16 16 #include <linux/kernel.h> 17 17 #include <linux/string.h> 18 18 #include <linux/mtd/mtd.h> 19 - #include <bcm47xx_nvram.h> 19 + #include <linux/bcm47xx_nvram.h> 20 20 21 21 #define NVRAM_MAGIC 0x48534C46 /* 'FLSH' */ 22 22 #define NVRAM_SPACE 0x8000
-1
arch/mips/bcm47xx/setup.c
··· 42 42 #include <asm/reboot.h> 43 43 #include <asm/time.h> 44 44 #include <bcm47xx.h> 45 - #include <bcm47xx_nvram.h> 46 45 #include <bcm47xx_board.h> 47 46 48 47 union bcm47xx_bus bcm47xx_bus;
-1
arch/mips/bcm47xx/sprom.c
··· 27 27 */ 28 28 29 29 #include <bcm47xx.h> 30 - #include <bcm47xx_nvram.h> 31 30 #include <linux/if_ether.h> 32 31 #include <linux/etherdevice.h> 33 32
-1
arch/mips/bcm47xx/time.c
··· 27 27 #include <linux/ssb/ssb.h> 28 28 #include <asm/time.h> 29 29 #include <bcm47xx.h> 30 - #include <bcm47xx_nvram.h> 31 30 #include <bcm47xx_board.h> 32 31 33 32 void __init plat_time_init(void)
+1
arch/mips/include/asm/mach-bcm47xx/bcm47xx.h
··· 22 22 #include <linux/ssb/ssb.h> 23 23 #include <linux/bcma/bcma.h> 24 24 #include <linux/bcma/bcma_soc.h> 25 + #include <linux/bcm47xx_nvram.h> 25 26 26 27 enum bcm47xx_bus_type { 27 28 #ifdef CONFIG_BCM47XX_SSB
+16 -3
arch/mips/include/asm/mach-bcm47xx/bcm47xx_nvram.h include/linux/bcm47xx_nvram.h
··· 1 1 /* 2 - * Copyright (C) 2005, Broadcom Corporation 3 - * Copyright (C) 2006, Felix Fietkau <nbd@openwrt.org> 4 - * 5 2 * This program is free software; you can redistribute it and/or modify it 6 3 * under the terms of the GNU General Public License as published by the 7 4 * Free Software Foundation; either version 2 of the License, or (at your ··· 11 14 #include <linux/types.h> 12 15 #include <linux/kernel.h> 13 16 17 + #ifdef CONFIG_BCM47XX 14 18 int bcm47xx_nvram_init_from_mem(u32 base, u32 lim); 15 19 int bcm47xx_nvram_getenv(const char *name, char *val, size_t val_len); 16 20 int bcm47xx_nvram_gpio_pin(const char *name); 21 + #else 22 + static inline int bcm47xx_nvram_init_from_mem(u32 base, u32 lim) 23 + { 24 + return -ENOTSUPP; 25 + }; 26 + static inline int bcm47xx_nvram_getenv(const char *name, char *val, 27 + size_t val_len) 28 + { 29 + return -ENOTSUPP; 30 + }; 31 + static inline int bcm47xx_nvram_gpio_pin(const char *name) 32 + { 33 + return -ENOTSUPP; 34 + }; 35 + #endif 17 36 18 37 #endif /* __BCM47XX_NVRAM_H */
+1 -1
drivers/bcma/driver_mips.c
··· 21 21 #include <linux/serial_reg.h> 22 22 #include <linux/time.h> 23 23 #ifdef CONFIG_BCM47XX 24 - #include <bcm47xx_nvram.h> 24 + #include <linux/bcm47xx_nvram.h> 25 25 #endif 26 26 27 27 enum bcma_boot_dev {
+1 -1
drivers/net/ethernet/broadcom/b44.c
··· 400 400 } 401 401 402 402 #ifdef CONFIG_BCM47XX 403 - #include <bcm47xx_nvram.h> 403 + #include <linux/bcm47xx_nvram.h> 404 404 static void b44_wap54g10_workaround(struct b44 *bp) 405 405 { 406 406 char buf[20];
+1 -1
drivers/net/ethernet/broadcom/bgmac.c
··· 16 16 #include <linux/phy.h> 17 17 #include <linux/interrupt.h> 18 18 #include <linux/dma-mapping.h> 19 - #include <bcm47xx_nvram.h> 19 + #include <linux/bcm47xx_nvram.h> 20 20 21 21 static const struct bcma_device_id bgmac_bcma_tbl[] = { 22 22 BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_4706_MAC_GBIT, BCMA_ANY_REV, BCMA_ANY_CLASS),
+1 -1
drivers/ssb/driver_chipcommon_pmu.c
··· 14 14 #include <linux/delay.h> 15 15 #include <linux/export.h> 16 16 #ifdef CONFIG_BCM47XX 17 - #include <bcm47xx_nvram.h> 17 + #include <linux/bcm47xx_nvram.h> 18 18 #endif 19 19 20 20 #include "ssb_private.h"
+1 -1
drivers/ssb/driver_mipscore.c
··· 16 16 #include <linux/serial_reg.h> 17 17 #include <linux/time.h> 18 18 #ifdef CONFIG_BCM47XX 19 - #include <bcm47xx_nvram.h> 19 + #include <linux/bcm47xx_nvram.h> 20 20 #endif 21 21 22 22 #include "ssb_private.h"