This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DM8168 Linux DSA Drivers for Marvell 88E6097F switch chipset Problem

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);
   return rtn;
  }

The problem is that we are getting an error at the start of the process of registering the driver.

Distributed Switch Architecture driver version 0.1
dsa: probe of dsa.0 failed with error -22

The problem is that dsa_probe function (net/dsa/dsa.c) returns an error (-EINVAL) here:

if (dev == NULL)
   return -EINVAL;
It seems that Linux kernel does not consider emac1  as a network device.
Is there another struct that we should point to at .netdev in  struct dsa_platform_data except the struct device inside the struct platform_device ti816x_emac1_device ?
It seems to me that we are missing something here.
Thank you.

  • Hello,

    Are you using EZSDK 5.05.02.00?

    Here are some threads/links that might be in help:

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/t/221494.aspx

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/716/t/241392.aspx

    http://e2e.ti.com/support/embedded/linux/f/354/t/199983.aspx

    http://processors.wiki.ti.com/index.php/TI81xx_PSP_Porting_Guide#Ethernet_Driver_-_Adding_Custom_Ethernet_Phy

    BR,

    Pavel