MCPcopy Create free account
hub / github.com/F-Stack/f-stack / fman_init

Function fman_init

dpdk/drivers/bus/dpaa/base/fman/fman.c:692–728  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

690}
691
692int
693fman_init(void)
694{
695 const struct device_node *dpa_node, *parent_node;
696 int _errno;
697
698 /* If multiple dependencies try to initialise the Fman driver, don't
699 * panic.
700 */
701 if (fman_ccsr_map_fd != -1)
702 return 0;
703
704 fman_ccsr_map_fd = open(FMAN_DEVICE_PATH, O_RDWR);
705 if (unlikely(fman_ccsr_map_fd < 0)) {
706 DPAA_BUS_LOG(ERR, "Unable to open (/dev/mem)");
707 return fman_ccsr_map_fd;
708 }
709
710 parent_node = of_find_compatible_node(NULL, NULL, "fsl,dpaa");
711 if (!parent_node) {
712 DPAA_BUS_LOG(ERR, "Unable to find fsl,dpaa node");
713 return -ENODEV;
714 }
715
716 for_each_child_node(parent_node, dpa_node) {
717 _errno = fman_if_init(dpa_node);
718 if (_errno) {
719 FMAN_ERR(_errno, "if_init(%s)\n", dpa_node->full_name);
720 goto err;
721 }
722 }
723
724 return 0;
725err:
726 fman_finish();
727 return _errno;
728}
729
730void
731fman_finish(void)

Callers 1

netcfg_acquireFunction · 0.85

Calls 3

of_find_compatible_nodeFunction · 0.85
fman_if_initFunction · 0.85
fman_finishFunction · 0.85

Tested by

no test coverage detected