This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM4372: patch migration from 4.19 to 6.1 kernel

Part Number: AM4372

Tool/software:

We are working on custom board based on am437x-gp-evm which is in production with 4.19 kernel.

There are some patches which need to be ported to 6.1 kernel.  Some source files related to the changes are missing in 6.1 kernel and

some files source code was overhauled. 

Need ur help in doing these changes.

patch-1: omap_hwmod_43xx_data.c file is missing in 6.1 kernel.

From a675fbeac38457a5b7ffe275bbf6a24ea899aa88 Mon Sep 17 00:00:00 2001
From: Mohammad Jamal Mohiuddin <JamalMohiuddin.Mohammad@carrier.com>
Date: Thu, 25 Feb 2021 05:14:06 +0000
Subject: [PATCH] PIC6.1 Changes

---
 arch/arm/mach-omap2/omap_hwmod_43xx_data.c | 4 ++--
 drivers/tty/serial/omap-serial.c           | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_43xx_data.c b/arch/arm/mach-omap2/omap_hwmod_43xx_data.c
index aa271ac..8903ae6 100644
--- a/arch/arm/mach-omap2/omap_hwmod_43xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_43xx_data.c
@@ -1006,8 +1006,8 @@ int __init am43xx_hwmod_init(void)
 	omap_hwmod_init();
 	ret = omap_hwmod_register_links(am43xx_hwmod_ocp_ifs);
 
-	if (!ret && of_machine_is_compatible("ti,am4372"))
-		ret = omap_hwmod_register_links(am43xx_rtc_hwmod_ocp_ifs);
+//	if (!ret && of_machine_is_compatible("ti,am4372"))
+//		ret = omap_hwmod_register_links(am43xx_rtc_hwmod_ocp_ifs);
 
 	return ret;
 }
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index 0f4f41e..a439f6f 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -1903,6 +1903,7 @@ static const struct dev_pm_ops serial_omap_dev_pm_ops = {
 
 #if defined(CONFIG_OF)
 static const struct of_device_id omap_serial_of_match[] = {
+	{ .compatible = "ti,omap2-uart-pic61" },
 	{ .compatible = "ti,omap2-uart" },
 	{ .compatible = "ti,omap3-uart" },
 	{ .compatible = "ti,omap4-uart" },
-- 
2.7.4

patch-2

From f1c096776ccaec48ad65ae8ca705a49a2dd07f3e Mon Sep 17 00:00:00 2001
From: Sathish potla <Sathish.Potla@carrier.com>
Date: Sun, 28 Jul 2024 11:30:47 +0530
Subject: [PATCH] Disabled 100mbps as TI phy not working in 100mbps.

---
 drivers/net/phy/phy_device.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index cde6c242326a..66a5a310c636 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -1680,10 +1680,13 @@ int genphy_config_init(struct phy_device *phydev)
 	if (val & BMSR_ANEGCAPABLE)
 		features |= SUPPORTED_Autoneg;
 
+/*For TI phy Generic phy driver used, TI Phy not working properly in 100mbps speed so disabled to work around 100mbps issue*/
+#if 0
 	if (val & BMSR_100FULL)
 		features |= SUPPORTED_100baseT_Full;
 	if (val & BMSR_100HALF)
 		features |= SUPPORTED_100baseT_Half;
+#endif
 	if (val & BMSR_10FULL)
 		features |= SUPPORTED_10baseT_Full;
 	if (val & BMSR_10HALF)
-- 
2.17.1

  • Hi Siva,

    For patch-1, hwmod has been replaced by a completely different framework called sysc. By the way, driver omap-serial.c is no longer maintained in kernel v6.1, you should consider move to driver 8250/8250_omap.c.

    I am not an ethernet expert, but I believe the following kernel patch for 6.1 should be equivalent to your patch-2.

    diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
    index f25b0d338ca8..8ae156f0021a 100644
    --- a/drivers/net/phy/phy_device.c
    +++ b/drivers/net/phy/phy_device.c
    @@ -2582,10 +2582,12 @@ int genphy_read_abilities(struct phy_device *phydev)
            linkmode_mod_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, phydev->supported,
                             val & BMSR_ANEGCAPABLE);
     
    +#if 0
            linkmode_mod_bit(ETHTOOL_LINK_MODE_100baseT_Full_BIT, phydev->supported,
                             val & BMSR_100FULL);
            linkmode_mod_bit(ETHTOOL_LINK_MODE_100baseT_Half_BIT, phydev->supported,
                             val & BMSR_100HALF);
    +#endif
            linkmode_mod_bit(ETHTOOL_LINK_MODE_10baseT_Full_BIT, phydev->supported,
                             val & BMSR_10FULL);
            linkmode_mod_bit(ETHTOOL_LINK_MODE_10baseT_Half_BIT, phydev->supported,

  • For patch-1, hwmod has been replaced by a completely different framework called sysc.

    please point me to the exact file to look for changes.

  • hwmod and sysc are different frameworks, please beware your patch-1 is unlikely directly applicable to sysc. But here is the location of the sysc driver in kernel:

    drivers/bus/ti-sysc.c