Thomas Gleixner | 09c434b | 2019-05-19 13:08:20 +0100 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0-only |
Florian Fainelli | 98cd155 | 2017-03-30 18:43:21 -0700 | [diff] [blame] | 2 | #include <linux/kernel.h> |
| 3 | #include <linux/init.h> |
| 4 | #include <linux/phy.h> |
| 5 | #include <net/dsa.h> |
| 6 | |
| 7 | #include "dsa_loop.h" |
| 8 | |
| 9 | static struct dsa_loop_pdata dsa_loop_pdata = { |
| 10 | .cd = { |
| 11 | .port_names[0] = "lan1", |
| 12 | .port_names[1] = "lan2", |
| 13 | .port_names[2] = "lan3", |
| 14 | .port_names[3] = "lan4", |
| 15 | .port_names[DSA_LOOP_CPU_PORT] = "cpu", |
| 16 | }, |
| 17 | .name = "DSA mockup driver", |
| 18 | .enabled_ports = 0x1f, |
| 19 | .netdev = "eth0", |
| 20 | }; |
| 21 | |
| 22 | static const struct mdio_board_info bdinfo = { |
| 23 | .bus_id = "fixed-0", |
| 24 | .modalias = "dsa-loop", |
| 25 | .mdio_addr = 31, |
| 26 | .platform_data = &dsa_loop_pdata, |
| 27 | }; |
| 28 | |
| 29 | static int __init dsa_loop_bdinfo_init(void) |
| 30 | { |
| 31 | return mdiobus_register_board_info(&bdinfo, 1); |
| 32 | } |
| 33 | arch_initcall(dsa_loop_bdinfo_init) |
| 34 | |
| 35 | MODULE_LICENSE("GPL"); |