diff options
author | Ioana Ciornei <ioana.ciornei@nxp.com> | 2023-02-09 18:07:03 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-05-05 13:41:55 -0400 |
commit | 3f1983d460d78a108d76315a4e0001add95754fa (patch) | |
tree | 68a393429cc7b97ad8664cc739b51ae1ce5507ba | |
parent | 1416b80de46ea6a194ad29a541a075ffba320927 (diff) | |
download | u-boot-3f1983d460d78a108d76315a4e0001add95754fa.zip u-boot-3f1983d460d78a108d76315a4e0001add95754fa.tar.gz u-boot-3f1983d460d78a108d76315a4e0001add95754fa.tar.bz2 |
drivers: net: ldpaa: export driver name and API to get DPMAC id
Export the ldpaa_eth_get_dpmac_id() function so that it can be used from
other drivers, especially by fsl-mc which will need it the next patch.
Also, create a macro for the Ethernet ldpaa driver name and export it as
well.
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
-rw-r--r-- | drivers/net/ldpaa_eth/ldpaa_eth.c | 7 | ||||
-rw-r--r-- | include/net/ldpaa_eth.h | 15 |
2 files changed, 19 insertions, 3 deletions
diff --git a/drivers/net/ldpaa_eth/ldpaa_eth.c b/drivers/net/ldpaa_eth/ldpaa_eth.c index 2485077..2cb6e9b 100644 --- a/drivers/net/ldpaa_eth/ldpaa_eth.c +++ b/drivers/net/ldpaa_eth/ldpaa_eth.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0+ /* * Copyright 2014-2016 Freescale Semiconductor, Inc. - * Copyright 2017 NXP + * Copyright 2017, 2023 NXP */ #include <common.h> @@ -21,6 +21,7 @@ #include <linux/compat.h> #include <linux/delay.h> #include <asm/global_data.h> +#include <net/ldpaa_eth.h> #include "ldpaa_eth.h" #ifdef CONFIG_PHYLIB @@ -995,7 +996,7 @@ static int ldpaa_eth_probe(struct udevice *dev) return 0; } -static uint32_t ldpaa_eth_get_dpmac_id(struct udevice *dev) +uint32_t ldpaa_eth_get_dpmac_id(struct udevice *dev) { int port_node = dev_of_offset(dev); @@ -1049,7 +1050,7 @@ static const struct udevice_id ldpaa_eth_of_ids[] = { }; U_BOOT_DRIVER(ldpaa_eth) = { - .name = "ldpaa_eth", + .name = LDPAA_ETH_DRIVER_NAME, .id = UCLASS_ETH, .of_match = ldpaa_eth_of_ids, .of_to_plat = ldpaa_eth_of_to_plat, diff --git a/include/net/ldpaa_eth.h b/include/net/ldpaa_eth.h new file mode 100644 index 0000000..7474bfa --- /dev/null +++ b/include/net/ldpaa_eth.h @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright 2023 NXP + */ + +#define LDPAA_ETH_DRIVER_NAME "ldpaa_eth" + +/** + * ldpaa_eth_get_dpmac_id() - Get the dpmac_id of a DPAA2 ethernet device + * + * @dev: DPAA2 ethernet udevice pointer + * Return: requested dpmac_id + */ + +uint32_t ldpaa_eth_get_dpmac_id(struct udevice *dev); |