From: Ioana Ciornei <ioana.ciornei@nxp.com> To: davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org Cc: kishon@ti.com, vkoul@kernel.org, robh+dt@kernel.org, leoyang.li@nxp.com, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux@armlinux.org.uk, shawnguo@kernel.org, hongxing.zhu@nxp.com, Ioana Ciornei <ioana.ciornei@nxp.com> Subject: [PATCH net-next v3 4/8] dpaa2-mac: add the MC API for reconfiguring the protocol Date: Thu, 10 Mar 2022 16:51:56 +0200 [thread overview] Message-ID: <20220310145200.3645763-5-ioana.ciornei@nxp.com> (raw) In-Reply-To: <20220310145200.3645763-1-ioana.ciornei@nxp.com> The MC firmware gained recently a new command which can reconfigure the running protocol on the underlying MAC. Add this new command which will be used in the next patches in order to do a major reconfig on the interface. Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com> --- Changes in v2: - none Changes in v3: - none .../net/ethernet/freescale/dpaa2/dpmac-cmd.h | 5 ++++ drivers/net/ethernet/freescale/dpaa2/dpmac.c | 23 +++++++++++++++++++ drivers/net/ethernet/freescale/dpaa2/dpmac.h | 3 +++ 3 files changed, 31 insertions(+) diff --git a/drivers/net/ethernet/freescale/dpaa2/dpmac-cmd.h b/drivers/net/ethernet/freescale/dpaa2/dpmac-cmd.h index e1e06b21110d..e9ac2ecef3be 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpmac-cmd.h +++ b/drivers/net/ethernet/freescale/dpaa2/dpmac-cmd.h @@ -26,6 +26,8 @@ #define DPMAC_CMDID_GET_COUNTER DPMAC_CMD(0x0c4) +#define DPMAC_CMDID_SET_PROTOCOL DPMAC_CMD(0x0c7) + /* Macros for accessing command fields smaller than 1byte */ #define DPMAC_MASK(field) \ GENMASK(DPMAC_##field##_SHIFT + DPMAC_##field##_SIZE - 1, \ @@ -77,4 +79,7 @@ struct dpmac_rsp_get_api_version { __le16 minor; }; +struct dpmac_cmd_set_protocol { + u8 eth_if; +}; #endif /* _FSL_DPMAC_CMD_H */ diff --git a/drivers/net/ethernet/freescale/dpaa2/dpmac.c b/drivers/net/ethernet/freescale/dpaa2/dpmac.c index d348a7567d87..f440a4c3b70c 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpmac.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpmac.c @@ -212,3 +212,26 @@ int dpmac_get_api_version(struct fsl_mc_io *mc_io, u32 cmd_flags, return 0; } + +/** + * dpmac_set_protocol() - Reconfigure the DPMAC protocol + * @mc_io: Pointer to opaque I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPMAC object + * @protocol: New protocol for the DPMAC to be reconfigured in. + * + * Return: '0' on Success; Error code otherwise. + */ +int dpmac_set_protocol(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token, + enum dpmac_eth_if protocol) +{ + struct dpmac_cmd_set_protocol *cmd_params; + struct fsl_mc_command cmd = { 0 }; + + cmd.header = mc_encode_cmd_header(DPMAC_CMDID_SET_PROTOCOL, + cmd_flags, token); + cmd_params = (struct dpmac_cmd_set_protocol *)cmd.params; + cmd_params->eth_if = protocol; + + return mc_send_command(mc_io, &cmd); +} diff --git a/drivers/net/ethernet/freescale/dpaa2/dpmac.h b/drivers/net/ethernet/freescale/dpaa2/dpmac.h index b580fb4164b5..17488819ef68 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpmac.h +++ b/drivers/net/ethernet/freescale/dpaa2/dpmac.h @@ -207,4 +207,7 @@ int dpmac_get_counter(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token, int dpmac_get_api_version(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 *major_ver, u16 *minor_ver); + +int dpmac_set_protocol(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token, + enum dpmac_eth_if protocol); #endif /* __FSL_DPMAC_H */ -- 2.33.1 -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy
WARNING: multiple messages have this Message-ID (diff)
From: Ioana Ciornei <ioana.ciornei@nxp.com> To: davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org Cc: kishon@ti.com, vkoul@kernel.org, robh+dt@kernel.org, leoyang.li@nxp.com, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux@armlinux.org.uk, shawnguo@kernel.org, hongxing.zhu@nxp.com, Ioana Ciornei <ioana.ciornei@nxp.com> Subject: [PATCH net-next v3 4/8] dpaa2-mac: add the MC API for reconfiguring the protocol Date: Thu, 10 Mar 2022 16:51:56 +0200 [thread overview] Message-ID: <20220310145200.3645763-5-ioana.ciornei@nxp.com> (raw) In-Reply-To: <20220310145200.3645763-1-ioana.ciornei@nxp.com> The MC firmware gained recently a new command which can reconfigure the running protocol on the underlying MAC. Add this new command which will be used in the next patches in order to do a major reconfig on the interface. Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com> --- Changes in v2: - none Changes in v3: - none .../net/ethernet/freescale/dpaa2/dpmac-cmd.h | 5 ++++ drivers/net/ethernet/freescale/dpaa2/dpmac.c | 23 +++++++++++++++++++ drivers/net/ethernet/freescale/dpaa2/dpmac.h | 3 +++ 3 files changed, 31 insertions(+) diff --git a/drivers/net/ethernet/freescale/dpaa2/dpmac-cmd.h b/drivers/net/ethernet/freescale/dpaa2/dpmac-cmd.h index e1e06b21110d..e9ac2ecef3be 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpmac-cmd.h +++ b/drivers/net/ethernet/freescale/dpaa2/dpmac-cmd.h @@ -26,6 +26,8 @@ #define DPMAC_CMDID_GET_COUNTER DPMAC_CMD(0x0c4) +#define DPMAC_CMDID_SET_PROTOCOL DPMAC_CMD(0x0c7) + /* Macros for accessing command fields smaller than 1byte */ #define DPMAC_MASK(field) \ GENMASK(DPMAC_##field##_SHIFT + DPMAC_##field##_SIZE - 1, \ @@ -77,4 +79,7 @@ struct dpmac_rsp_get_api_version { __le16 minor; }; +struct dpmac_cmd_set_protocol { + u8 eth_if; +}; #endif /* _FSL_DPMAC_CMD_H */ diff --git a/drivers/net/ethernet/freescale/dpaa2/dpmac.c b/drivers/net/ethernet/freescale/dpaa2/dpmac.c index d348a7567d87..f440a4c3b70c 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpmac.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpmac.c @@ -212,3 +212,26 @@ int dpmac_get_api_version(struct fsl_mc_io *mc_io, u32 cmd_flags, return 0; } + +/** + * dpmac_set_protocol() - Reconfigure the DPMAC protocol + * @mc_io: Pointer to opaque I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPMAC object + * @protocol: New protocol for the DPMAC to be reconfigured in. + * + * Return: '0' on Success; Error code otherwise. + */ +int dpmac_set_protocol(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token, + enum dpmac_eth_if protocol) +{ + struct dpmac_cmd_set_protocol *cmd_params; + struct fsl_mc_command cmd = { 0 }; + + cmd.header = mc_encode_cmd_header(DPMAC_CMDID_SET_PROTOCOL, + cmd_flags, token); + cmd_params = (struct dpmac_cmd_set_protocol *)cmd.params; + cmd_params->eth_if = protocol; + + return mc_send_command(mc_io, &cmd); +} diff --git a/drivers/net/ethernet/freescale/dpaa2/dpmac.h b/drivers/net/ethernet/freescale/dpaa2/dpmac.h index b580fb4164b5..17488819ef68 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpmac.h +++ b/drivers/net/ethernet/freescale/dpaa2/dpmac.h @@ -207,4 +207,7 @@ int dpmac_get_counter(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token, int dpmac_get_api_version(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 *major_ver, u16 *minor_ver); + +int dpmac_set_protocol(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token, + enum dpmac_eth_if protocol); #endif /* __FSL_DPMAC_H */ -- 2.33.1
next prev parent reply other threads:[~2022-03-10 14:52 UTC|newest] Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-03-10 14:51 [PATCH net-next v3 0/8] dpaa2-mac: add support for changing the protocol at runtime Ioana Ciornei 2022-03-10 14:51 ` Ioana Ciornei 2022-03-10 14:51 ` [PATCH net-next v3 1/8] phy: add support for the Layerscape SerDes 28G Ioana Ciornei 2022-03-10 14:51 ` Ioana Ciornei 2022-03-10 14:51 ` [PATCH net-next v3 2/8] dt-bindings: phy: add the "fsl, lynx-28g" compatible Ioana Ciornei 2022-03-10 14:51 ` [PATCH net-next v3 2/8] dt-bindings: phy: add the "fsl,lynx-28g" compatible Ioana Ciornei 2022-03-10 16:47 ` Krzysztof Kozlowski 2022-03-10 16:47 ` [PATCH net-next v3 2/8] dt-bindings: phy: add the "fsl, lynx-28g" compatible Krzysztof Kozlowski 2022-03-10 17:32 ` [PATCH net-next v3 2/8] dt-bindings: phy: add the "fsl,lynx-28g" compatible Ioana Ciornei 2022-03-10 17:32 ` [PATCH net-next v3 2/8] dt-bindings: phy: add the "fsl, lynx-28g" compatible Ioana Ciornei 2022-03-10 21:19 ` [PATCH net-next v3 2/8] dt-bindings: phy: add the "fsl,lynx-28g" compatible Krzysztof Kozlowski 2022-03-10 21:19 ` [PATCH net-next v3 2/8] dt-bindings: phy: add the "fsl, lynx-28g" compatible Krzysztof Kozlowski 2022-03-10 17:58 ` [PATCH net-next v3 2/8] dt-bindings: phy: add the "fsl,lynx-28g" compatible Russell King (Oracle) 2022-03-10 17:58 ` [PATCH net-next v3 2/8] dt-bindings: phy: add the "fsl, lynx-28g" compatible Russell King (Oracle) 2022-03-10 19:06 ` [PATCH net-next v3 2/8] dt-bindings: phy: add the "fsl,lynx-28g" compatible Ioana Ciornei 2022-03-10 19:06 ` [PATCH net-next v3 2/8] dt-bindings: phy: add the "fsl, lynx-28g" compatible Ioana Ciornei 2022-03-10 14:51 ` [PATCH net-next v3 3/8] dpaa2-mac: add the MC API for retrieving the version Ioana Ciornei 2022-03-10 14:51 ` Ioana Ciornei 2022-03-10 14:51 ` Ioana Ciornei [this message] 2022-03-10 14:51 ` [PATCH net-next v3 4/8] dpaa2-mac: add the MC API for reconfiguring the protocol Ioana Ciornei 2022-03-10 14:51 ` [PATCH net-next v3 5/8] dpaa2-mac: retrieve API version and detect features Ioana Ciornei 2022-03-10 14:51 ` Ioana Ciornei 2022-03-10 14:51 ` [PATCH net-next v3 6/8] dpaa2-mac: move setting up supported_interfaces into a function Ioana Ciornei 2022-03-10 14:51 ` Ioana Ciornei 2022-03-10 14:51 ` [PATCH net-next v3 7/8] dpaa2-mac: configure the SerDes phy on a protocol change Ioana Ciornei 2022-03-10 14:51 ` Ioana Ciornei 2022-03-10 15:05 ` Russell King (Oracle) 2022-03-10 15:05 ` Russell King (Oracle) 2022-03-10 15:57 ` Ioana Ciornei 2022-03-10 15:57 ` Ioana Ciornei 2022-03-10 14:52 ` [PATCH net-next v3 8/8] arch: arm64: dts: lx2160a: describe the SerDes block #1 Ioana Ciornei 2022-03-10 14:52 ` Ioana Ciornei
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220310145200.3645763-5-ioana.ciornei@nxp.com \ --to=ioana.ciornei@nxp.com \ --cc=davem@davemloft.net \ --cc=devicetree@vger.kernel.org \ --cc=hongxing.zhu@nxp.com \ --cc=kishon@ti.com \ --cc=kuba@kernel.org \ --cc=leoyang.li@nxp.com \ --cc=linux-phy@lists.infradead.org \ --cc=linux@armlinux.org.uk \ --cc=netdev@vger.kernel.org \ --cc=robh+dt@kernel.org \ --cc=shawnguo@kernel.org \ --cc=vkoul@kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.