We have a custom board with DM8168 davinci CPU. The Davinci CPU has 2 EMACs. The second EMAC is connected to a Micrel PHY chipset and works perferctly.
We need to attach a Marvell 88E6097F switch chpset to the first EMAC. For this reason we decided to use the Linux DSA drivers.
The actual code that we used is the following:
static struct dsa_chip_data ses_dsa_data[] = {
/* Marvell 88E6097F 10/100 Switch */
{
.mii_bus = &ti816x_mdio_device.dev,
.sw_addr = 31,
.port_names = {
"sw%d", // 0
"sw%d", // 1
"sw%d", // 2
"sw%d", // 3
"sw%d", // 4
"sw%d", // 5
"sw%d", // 6
"sw%d", // 7
"dsa", // 8
"dsa", // 9
"cpu", // 10
},
.rtable = (s8 []){9, -1, 8}
},
};
static struct dsa_platform_data ses_dsa_platform_data = {
.nr_chips = 1,
.netdev = &ti816x_emac1_device.dev,
.chip = &ses_dsa_data,
};
static struct platform_device ses_switch_device = {
.name = "dsa",
.id = 0,
.num_resources = 0,
.dev.platform_data = &ses_dsa_platform_data,
};
int ses_switch_init(void)
{
int rtn;
rtn = platform_device_register(&ses_switch_device);
The problem is that we are getting an error at the start of the process of registering the driver.
The problem is that dsa_probe function (net/dsa/dsa.c) returns an error (-EINVAL) here: