How to add support for an intel c2000 soc device?

Hi, I got a device with intel c2358 soc, 2g ram and 8g emmc. It has two sfp port with an i350 chip, two gigabit rj45 wan port with the soc's intergrated i354 mac and 88e1514 phy. The two intergrated i354 mac left is connecting to two 88e6176 switch for totally 8 gigabit rj45 lan port.

For now, I have the working kernel source code from the manufacturer and get all the ports work under Debian. I want to know how to add support for this device in openwrt correctly?

Hello,
I'm not familiar with these CPUs but have you tried the generic x86_64 image? You shouldn't have any problems with that.
https://downloads.openwrt.org/releases/21.02.0/targets/x86/64/

ulpian

Hi, thanks for your reply. I don’t think the generic x86_64 image will work. Because under generic Linux distribution, without the proper platform device/driver(something like i2c/mdio), only sfp ports from I350 chip is working, other ports from integrated MACs with PHYs/switch chips are not working.

ulpian via OpenWrt Forum <mail@forum.openwrt.org>于2021年10月7日 周四23:41写道:

For new or 'exotic' (in OpenWrt's realm) devices, you might have to install additional kernel modules or add certain features to the default x86_64 kernel configuration, but the aim is to use a single kernel- and firmware image for all x86/ x86_64 devices. In case a stock debian kernel can get your device fully working, then OpenWrt could as well, if all the necessary bits and pieces are enabled in the kernel config.

In my working version of kernel source code, I found out that some i2c buses, dsa-core and igb driver were modified to get the intergrated MACs and the switch chip work. For other architecture like mips and arm, I know we use dts to define some necessary information to get the hardware work. But how can I do this in x86_64? By defining a platform device? Is there any example code?

For x86/ x86_64, it's very unlikely that custom patches or special images would be accepted, these really must go through upstream (and then backported, if necessary).

I think the patches is not necessary. Maybe the manufacturer patched these drivers for some specific reasion. From my working kernel code, I can get the information of i2c/mdio registers and so on, I think I can manage to get things done with these information. I just not familiar with the kernel.

I am using this commit drivers: platform: x86: ZII RaveAP as example, trying to adapt my device.

Am I right about this?