mv88e6352.c 3.7 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
/*
 * net/dsa/mv88e6352.c - Marvell 88e6352 switch chip support
 *
 * Copyright (c) 2014 Guenter Roeck
 *
 * Derived from mv88e6123_61_65.c
 * Copyright (c) 2008-2009 Marvell Semiconductor
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 */

#include <linux/delay.h>
#include <linux/jiffies.h>
#include <linux/list.h>
#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/platform_device.h>
#include <linux/phy.h>
#include <net/dsa.h>
#include "mv88e6xxx.h"

25 26 27
static const struct mv88e6xxx_info mv88e6352_table[] = {
	{
		.prod_num = PORT_SWITCH_ID_PROD_NUM_6320,
28
		.family = MV88E6XXX_FAMILY_6320,
29
		.name = "Marvell 88E6320",
30
		.num_databases = 4096,
31
		.num_ports = 7,
32
		.flags = MV88E6XXX_FLAGS_FAMILY_6320,
33 34
	}, {
		.prod_num = PORT_SWITCH_ID_PROD_NUM_6321,
35
		.family = MV88E6XXX_FAMILY_6320,
36
		.name = "Marvell 88E6321",
37
		.num_databases = 4096,
38
		.num_ports = 7,
39
		.flags = MV88E6XXX_FLAGS_FAMILY_6320,
40 41
	}, {
		.prod_num = PORT_SWITCH_ID_PROD_NUM_6172,
42
		.family = MV88E6XXX_FAMILY_6352,
43
		.name = "Marvell 88E6172",
44
		.num_databases = 4096,
45
		.num_ports = 7,
46
		.flags = MV88E6XXX_FLAGS_FAMILY_6352,
47 48
	}, {
		.prod_num = PORT_SWITCH_ID_PROD_NUM_6176,
49
		.family = MV88E6XXX_FAMILY_6352,
50
		.name = "Marvell 88E6176",
51
		.num_databases = 4096,
52
		.num_ports = 7,
53
		.flags = MV88E6XXX_FLAGS_FAMILY_6352,
54 55
	}, {
		.prod_num = PORT_SWITCH_ID_PROD_NUM_6240,
56
		.family = MV88E6XXX_FAMILY_6352,
57
		.name = "Marvell 88E6240",
58
		.num_databases = 4096,
59
		.num_ports = 7,
60
		.flags = MV88E6XXX_FLAGS_FAMILY_6352,
61 62
	}, {
		.prod_num = PORT_SWITCH_ID_PROD_NUM_6352,
63
		.family = MV88E6XXX_FAMILY_6352,
64
		.name = "Marvell 88E6352",
65
		.num_databases = 4096,
66
		.num_ports = 7,
67
		.flags = MV88E6XXX_FLAGS_FAMILY_6352,
68
	}
69 70
};

V
Vivien Didelot 已提交
71 72 73
static const char *mv88e6352_drv_probe(struct device *dsa_dev,
				       struct device *host_dev, int sw_addr,
				       void **priv)
74
{
75 76 77
	return mv88e6xxx_drv_probe(dsa_dev, host_dev, sw_addr, priv,
				   mv88e6352_table,
				   ARRAY_SIZE(mv88e6352_table));
78 79 80 81
}

struct dsa_switch_driver mv88e6352_switch_driver = {
	.tag_protocol		= DSA_TAG_PROTO_EDSA,
82
	.probe			= mv88e6352_drv_probe,
83
	.setup			= mv88e6xxx_setup,
84
	.set_addr		= mv88e6xxx_set_addr,
85 86
	.phy_read		= mv88e6xxx_phy_read,
	.phy_write		= mv88e6xxx_phy_write,
87 88 89
	.get_strings		= mv88e6xxx_get_strings,
	.get_ethtool_stats	= mv88e6xxx_get_ethtool_stats,
	.get_sset_count		= mv88e6xxx_get_sset_count,
90
	.adjust_link		= mv88e6xxx_adjust_link,
91 92
	.set_eee		= mv88e6xxx_set_eee,
	.get_eee		= mv88e6xxx_get_eee,
93
#ifdef CONFIG_NET_DSA_HWMON
94 95 96 97
	.get_temp		= mv88e6xxx_get_temp,
	.get_temp_limit		= mv88e6xxx_get_temp_limit,
	.set_temp_limit		= mv88e6xxx_set_temp_limit,
	.get_temp_alarm		= mv88e6xxx_get_temp_alarm,
98
#endif
99 100
	.get_eeprom		= mv88e6xxx_get_eeprom,
	.set_eeprom		= mv88e6xxx_set_eeprom,
101 102
	.get_regs_len		= mv88e6xxx_get_regs_len,
	.get_regs		= mv88e6xxx_get_regs,
103 104
	.port_bridge_join	= mv88e6xxx_port_bridge_join,
	.port_bridge_leave	= mv88e6xxx_port_bridge_leave,
105
	.port_stp_state_set	= mv88e6xxx_port_stp_state_set,
106
	.port_vlan_filtering	= mv88e6xxx_port_vlan_filtering,
107
	.port_vlan_prepare	= mv88e6xxx_port_vlan_prepare,
108
	.port_vlan_add		= mv88e6xxx_port_vlan_add,
109
	.port_vlan_del		= mv88e6xxx_port_vlan_del,
110
	.port_vlan_dump		= mv88e6xxx_port_vlan_dump,
V
Vivien Didelot 已提交
111
	.port_fdb_prepare	= mv88e6xxx_port_fdb_prepare,
112 113
	.port_fdb_add		= mv88e6xxx_port_fdb_add,
	.port_fdb_del		= mv88e6xxx_port_fdb_del,
114
	.port_fdb_dump		= mv88e6xxx_port_fdb_dump,
115 116
};

117
MODULE_ALIAS("platform:mv88e6172");
118 119 120 121
MODULE_ALIAS("platform:mv88e6176");
MODULE_ALIAS("platform:mv88e6320");
MODULE_ALIAS("platform:mv88e6321");
MODULE_ALIAS("platform:mv88e6352");