return ret;
}
+static void fman_if_vsp_init(struct __fman_if *__if)
+{
+ const phandle *prop;
+ int cell_index;
+ const struct device_node *dev;
+ size_t lenp;
+ const uint8_t mac_idx[] = {-1, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1};
+
+ if (__if->__if.mac_type == fman_mac_1g) {
+ for_each_compatible_node(dev, NULL,
+ "fsl,fman-port-1g-rx-extended-args") {
+ prop = of_get_property(dev, "cell-index", &lenp);
+ if (prop) {
+ cell_index = of_read_number(
+ &prop[0],
+ lenp / sizeof(phandle));
+ if (cell_index == mac_idx[__if->__if.mac_idx]) {
+ prop = of_get_property(
+ dev,
+ "vsp-window", &lenp);
+ if (prop) {
+ __if->__if.num_profiles =
+ of_read_number(
+ &prop[0], 1);
+ __if->__if.base_profile_id =
+ of_read_number(
+ &prop[1], 1);
+ }
+ }
+ }
+ }
+ } else if (__if->__if.mac_type == fman_mac_10g) {
+ for_each_compatible_node(dev, NULL,
+ "fsl,fman-port-10g-rx-extended-args") {
+ prop = of_get_property(dev, "cell-index", &lenp);
+ if (prop) {
+ cell_index = of_read_number(
+ &prop[0], lenp / sizeof(phandle));
+ if (cell_index == mac_idx[__if->__if.mac_idx]) {
+ prop = of_get_property(
+ dev, "vsp-window", &lenp);
+ if (prop) {
+ __if->__if.num_profiles =
+ of_read_number(
+ &prop[0], 1);
+ __if->__if.base_profile_id =
+ of_read_number(
+ &prop[1], 1);
+ }
+ }
+ }
+ }
+ }
+}
+
static int
fman_if_init(const struct device_node *dpa_node)
{
if (is_shared)
__if->__if.is_shared_mac = 1;
+ fman_if_vsp_init(__if);
+
/* Parsing of the network interface is complete, add it to the list */
DPAA_BUS_LOG(DEBUG, "Found %s, Tx Channel = %x, FMAN = %x,"
"Port ID = %x",