From: Maxime Chevallier <maxime.chevallier@bootlin.com>
To: parvathi <parvathi@couthit.com>
Cc: danishanwar@ti.com, rogerq@kernel.org, andrew+netdev@lunn.ch,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, nm@ti.com, ssantosh@kernel.org,
richardcochran@gmail.com, basharath@couthit.com,
schnelle@linux.ibm.com, diogo.ivo@siemens.com,
m-karicheri2@ti.com, horms@kernel.org, jacob.e.keller@intel.com,
m-malladi@ti.com, javier.carrasco.cruz@gmail.com, afd@ti.com,
s-anna@ti.com, linux-arm-kernel@lists.infradead.org,
netdev@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, pratheesh@ti.com, prajith@ti.com,
vigneshr@ti.com, praneeth@ti.com, srk@ti.com, rogerq@ti.com,
krishna@couthit.com, pmohan@couthit.com, mohan@couthit.com
Subject: Re: [PATCH net-next v3 04/10] net: ti: prueth: Adds link detection, RX and TX support.
Date: Fri, 14 Feb 2025 16:44:22 +0100 [thread overview]
Message-ID: <20250214164422.1bb58a89@fedora.home> (raw)
In-Reply-To: <20250214073757.1076778-5-parvathi@couthit.com>
Hello,
On Fri, 14 Feb 2025 13:07:51 +0530
parvathi <parvathi@couthit.com> wrote:
> From: Roger Quadros <rogerq@ti.com>
>
> Changes corresponding to link configuration such as speed and duplexity.
> IRQ and handler initializations are performed for packet reception.Firmware
> receives the packet from the wire and stores it into OCMC queue. Next, it
> notifies the CPU via interrupt. Upon receiving the interrupt CPU will
> service the IRQ and packet will be processed by pushing the newly allocated
> SKB to upper layers.
>
> When the user application want to transmit a packet, it will invoke
> sys_send() which will inturn invoke the PRUETH driver, then it will write
> the packet into OCMC queues. PRU firmware will pick up the packet and
> transmit it on to the wire.
>
> Signed-off-by: Roger Quadros <rogerq@ti.com>
> Signed-off-by: Andrew F. Davis <afd@ti.com>
> Signed-off-by: Basharath Hussain Khaja <basharath@couthit.com>
> Signed-off-by: Parvathi Pudi <parvathi@couthit.com>
> +/* update phy/port status information for firmware */
> +static void icssm_emac_update_phystatus(struct prueth_emac *emac)
> +{
> + struct prueth *prueth = emac->prueth;
> + u32 phy_speed, port_status = 0;
> + enum prueth_mem region;
> + u32 delay;
> +
> + region = emac->dram;
> + phy_speed = emac->speed;
> + icssm_prueth_write_reg(prueth, region, PHY_SPEED_OFFSET, phy_speed);
> +
> + delay = TX_CLK_DELAY_100M;
> +
> + delay = delay << PRUSS_MII_RT_TXCFG_TX_CLK_DELAY_SHIFT;
> +
> + if (emac->port_id) {
> + regmap_update_bits(prueth->mii_rt,
> + PRUSS_MII_RT_TXCFG1,
> + PRUSS_MII_RT_TXCFG_TX_CLK_DELAY_MASK,
> + delay);
> + } else {
> + regmap_update_bits(prueth->mii_rt,
> + PRUSS_MII_RT_TXCFG0,
> + PRUSS_MII_RT_TXCFG_TX_CLK_DELAY_MASK,
> + delay);
> + }
> +
> + if (emac->link)
> + port_status |= PORT_LINK_MASK;
> +
> + writeb(port_status, prueth->mem[region].va + PORT_STATUS_OFFSET);
> +}
> +
> /* called back by PHY layer if there is change in link state of hw port*/
> static void icssm_emac_adjust_link(struct net_device *ndev)
> {
> @@ -369,6 +426,8 @@ static void icssm_emac_adjust_link(struct net_device *ndev)
> emac->link = 0;
> }
>
> + icssm_emac_update_phystatus(emac);
> +
It looks to me like emac->link, emac->speed and emac->duplex are only
used in icssm_emac_update_phystatus(). If you consider either passing
these as parameters to the above function, or simply merge
icssm_emac_update_phystatus() into your adjust_link callback, you can get
rid of these 3 attributes entirely. It even looks like emac->duplex is
simply unused.
Thanks,
Maxime
next prev parent reply other threads:[~2025-02-14 15:44 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-14 5:46 [PATCH net-next v3 00/10] PRU-ICSSM Ethernet Driver parvathi
2025-02-14 5:46 ` [PATCH net-next v3 01/10] dt-bindings: net: ti: Adds DUAL-EMAC mode support on PRU-ICSS2 for AM57xx SOCs parvathi
2025-02-19 22:51 ` Rob Herring
2025-02-21 12:32 ` Parvathi Pudi
2025-02-14 5:46 ` [PATCH net-next v3 02/10] net: ti: prueth: Adds ICSSM Ethernet driver parvathi
2025-02-20 9:19 ` Ratheesh Kannoth
2025-02-21 12:35 ` Parvathi Pudi
2025-02-14 5:46 ` [PATCH net-next v3 03/10] net: ti: prueth: Adds PRUETH HW and SW configuration parvathi
2025-02-14 7:37 ` [PATCH net-next v3 04/10] net: ti: prueth: Adds link detection, RX and TX support parvathi
2025-02-14 15:44 ` Maxime Chevallier [this message]
2025-02-18 9:58 ` Parvathi Pudi
2025-02-14 7:37 ` [PATCH net-next v3 05/10] net: ti: prueth: Adds ethtool support for ICSSM PRUETH Driver parvathi
2025-02-14 7:37 ` [PATCH net-next v3 06/10] net: ti: prueth: Adds HW timestamping support for PTP using PRU-ICSS IEP module parvathi
2025-02-14 7:37 ` [PATCH net-next v3 07/10] net: ti: prueth: Adds support for network filters for traffic control supported by PRU-ICSS parvathi
2025-02-14 8:53 ` [PATCH net-next v3 08/10] net: ti: prueth: Adds support for RX interrupt coalescing/pacing parvathi
2025-02-14 8:53 ` [PATCH net-next v3 09/10] net: ti: prueth: Adds power management support for PRU-ICSS parvathi
2025-02-14 8:53 ` [PATCH net-next v3 10/10] soc: ti: PRUSS OCP configuration parvathi
2025-02-15 1:02 ` [PATCH net-next v3 00/10] PRU-ICSSM Ethernet Driver Jakub Kicinski
2025-02-18 10:06 ` Parvathi Pudi
2025-02-18 14:40 ` Jakub Kicinski
2025-02-24 6:56 ` MD Danish Anwar
2025-02-28 10:55 ` Parvathi Pudi
2025-02-26 18:44 ` Nishanth Menon
2025-02-28 10:58 ` Parvathi Pudi
2025-03-06 13:43 ` Parvathi Pudi
2025-03-07 19:47 ` Nishanth Menon
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=20250214164422.1bb58a89@fedora.home \
--to=maxime.chevallier@bootlin.com \
--cc=afd@ti.com \
--cc=andrew+netdev@lunn.ch \
--cc=basharath@couthit.com \
--cc=conor+dt@kernel.org \
--cc=danishanwar@ti.com \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=diogo.ivo@siemens.com \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jacob.e.keller@intel.com \
--cc=javier.carrasco.cruz@gmail.com \
--cc=krishna@couthit.com \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m-karicheri2@ti.com \
--cc=m-malladi@ti.com \
--cc=mohan@couthit.com \
--cc=netdev@vger.kernel.org \
--cc=nm@ti.com \
--cc=pabeni@redhat.com \
--cc=parvathi@couthit.com \
--cc=pmohan@couthit.com \
--cc=prajith@ti.com \
--cc=praneeth@ti.com \
--cc=pratheesh@ti.com \
--cc=richardcochran@gmail.com \
--cc=robh@kernel.org \
--cc=rogerq@kernel.org \
--cc=rogerq@ti.com \
--cc=s-anna@ti.com \
--cc=schnelle@linux.ibm.com \
--cc=srk@ti.com \
--cc=ssantosh@kernel.org \
--cc=vigneshr@ti.com \
/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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).