Commit 65d4b471 authored by Martin Habets's avatar Martin Habets Committed by Jakub Kicinski

siena: Make MTD support specific for Siena

Add a Siena Kconfig option and use it in stead of the sfc one.
Signed-off-by: default avatarMartin Habets <habetsm.xilinx@gmail.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 75db72de
......@@ -32,7 +32,7 @@ config SFC
To compile this driver as a module, choose M here. The module
will be called sfc.
config SFC_MTD
bool "Solarflare SFC9000/SFC9100-family MTD support"
bool "Solarflare SFC9100-family MTD support"
depends on SFC && MTD && !(SFC=y && MTD=m)
default y
help
......
......@@ -10,3 +10,11 @@ config SFC_SIENA
To compile this driver as a module, choose M here. The module
will be called sfc-siena.
config SFC_SIENA_MTD
bool "Solarflare SFC9000-family MTD support"
depends on SFC_SIENA && MTD && !(SFC_SIENA=y && MTD=m)
default y
help
This exposes the on-board flash and/or EEPROM as MTD devices
(e.g. /dev/mtd1). This is required to update the firmware or
the boot configuration under Linux.
......@@ -5,7 +5,7 @@ sfc-siena-y += farch.o siena.o \
selftest.o ethtool.o ethtool_common.o ptp.o \
mcdi.o mcdi_port.o mcdi_port_common.o \
mcdi_mon.o
sfc-siena-$(CONFIG_SFC_MTD) += mtd.o
sfc-siena-$(CONFIG_SFC_SRIOV) += siena_sriov.o
sfc-siena-$(CONFIG_SFC_SIENA_MTD) += mtd.o
sfc-siena-$(CONFIG_SFC_SRIOV) += siena_sriov.o
obj-$(CONFIG_SFC_SIENA) += sfc-siena.o
......@@ -162,7 +162,7 @@ void efx_siena_get_irq_moderation(struct efx_nic *efx, unsigned int *tx_usecs,
void efx_siena_update_sw_stats(struct efx_nic *efx, u64 *stats);
/* MTD */
#ifdef CONFIG_SFC_MTD
#ifdef CONFIG_SFC_SIENA_MTD
int efx_siena_mtd_add(struct efx_nic *efx, struct efx_mtd_partition *parts,
size_t n_parts, size_t sizeof_part);
static inline int efx_mtd_probe(struct efx_nic *efx)
......
......@@ -997,7 +997,7 @@ int efx_siena_init_struct(struct efx_nic *efx,
INIT_LIST_HEAD(&efx->node);
INIT_LIST_HEAD(&efx->secondary_list);
spin_lock_init(&efx->biu_lock);
#ifdef CONFIG_SFC_MTD
#ifdef CONFIG_SFC_SIENA_MTD
INIT_LIST_HEAD(&efx->mtd_list);
#endif
INIT_WORK(&efx->reset_work, efx_reset_work);
......
......@@ -2014,7 +2014,7 @@ int efx_siena_mcdi_wol_filter_reset(struct efx_nic *efx)
return rc;
}
#ifdef CONFIG_SFC_MTD
#ifdef CONFIG_SFC_SIENA_MTD
#define EFX_MCDI_NVRAM_LEN_MAX 128
......@@ -2256,4 +2256,4 @@ void efx_siena_mcdi_mtd_rename(struct efx_mtd_partition *part)
efx->name, part->type_name, mcdi_part->fw_subtype);
}
#endif /* CONFIG_SFC_MTD */
#endif /* CONFIG_SFC_SIENA_MTD */
......@@ -373,7 +373,7 @@ static inline int efx_siena_mcdi_mon_probe(struct efx_nic *efx) { return 0; }
static inline void efx_siena_mcdi_mon_remove(struct efx_nic *efx) {}
#endif
#ifdef CONFIG_SFC_MTD
#ifdef CONFIG_SFC_SIENA_MTD
int efx_siena_mcdi_mtd_read(struct mtd_info *mtd, loff_t start, size_t len,
size_t *retlen, u8 *buffer);
int efx_siena_mcdi_mtd_erase(struct mtd_info *mtd, loff_t start, size_t len);
......
......@@ -1031,7 +1031,7 @@ struct efx_nic {
unsigned irq_level;
struct delayed_work selftest_work;
#ifdef CONFIG_SFC_MTD
#ifdef CONFIG_SFC_SIENA_MTD
struct list_head mtd_list;
#endif
......@@ -1411,7 +1411,7 @@ struct efx_nic_type {
bool (*filter_rfs_expire_one)(struct efx_nic *efx, u32 flow_id,
unsigned int index);
#endif
#ifdef CONFIG_SFC_MTD
#ifdef CONFIG_SFC_SIENA_MTD
int (*mtd_probe)(struct efx_nic *efx);
void (*mtd_rename)(struct efx_mtd_partition *part);
int (*mtd_read)(struct mtd_info *mtd, loff_t start, size_t len,
......
......@@ -830,7 +830,7 @@ static int siena_mcdi_poll_reboot(struct efx_nic *efx)
**************************************************************************
*/
#ifdef CONFIG_SFC_MTD
#ifdef CONFIG_SFC_SIENA_MTD
struct siena_nvram_type_info {
int port;
......@@ -954,7 +954,7 @@ static int siena_mtd_probe(struct efx_nic *efx)
return rc;
}
#endif /* CONFIG_SFC_MTD */
#endif /* CONFIG_SFC_SIENA_MTD */
static unsigned int siena_check_caps(const struct efx_nic *efx,
u8 flag, u32 offset)
......@@ -1058,7 +1058,7 @@ const struct efx_nic_type siena_a0_nic_type = {
#ifdef CONFIG_RFS_ACCEL
.filter_rfs_expire_one = efx_farch_filter_rfs_expire_one,
#endif
#ifdef CONFIG_SFC_MTD
#ifdef CONFIG_SFC_SIENA_MTD
.mtd_probe = siena_mtd_probe,
.mtd_rename = efx_siena_mcdi_mtd_rename,
.mtd_read = efx_siena_mcdi_mtd_read,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment