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.

Modify machine name into suspend can't wake up

Other Parts Discussed in Thread: AM3352

Hi, everyone

my platform AM3352, BSP SDK 6.0, i want to modify machine name, so modify moidfy linux/arch/arm/kernel/setup.c

Modify c_show() funtion:seq_printf(m, "Hardware\t: %s\n", machine_name); --->seq_printf(m, "Hardware\t: %s\n", "myplatform");

into system, cat /proc/cpuinfo, Hardware trun to myplatform, but produced a strange problem is into suspend cant't wake up, please give some idea, thank you very much for your help?

  • Hi,

    Are these the only changes you introduced to the kernel before the suspend/wake issue occurred? If there were more changes please try to revert some of them in order to pin down the exact modification that is causing the issue.

    Does the suspend/wake start working again if you revert your changes?

    Best regards,
    Miroslav

  • Hi,

    Before I modified this code on kernel the suspend/wake is OK, after I modified this code the suspend/wake issue occurred, now I revert my chages,the suspend/wake is OK

    Could it be the variable machine_name(static const char *machine_name)?

    but i try,there is no change ths issue

    There may be  others methods, such sa u-boot to kernel pass parameters.

    Thank you for your advice!

  • Hi, everyon

    it took me some time to study the code,discovered a phenomenon:

    seq_printf(m, "Hardware\t: %s\n", machine_name); -->seq_printf(m, "Hardware\t: %s\n", "am335xevm"); or seq_printf(m, "Hardware\t: %s\n", "AM335XEVM");  the suspend/wake up OK, So I think this is not where the problem lies

    Later, i modify linux-3.2.0-psp04.06.00.11/arch/arm/tools/mach-types

    am335xevm               MACH_AM335XEVM          AM335XEVM               3589

    my_platform               MACH_AM335XEVM          AM335XEVM               3589

    Simple modification and "am335xevm" related code, goto system ,cat /proc/cpuinfo, find Hardware change, but the susped/wake problem persists

    I hope to give some suggestions!

  • Hi,

    I'm not 100% sure that this will work, but try to add a new MACHINE_START entry for your platform inside <linux_dir>/arch/arm/mach-omap2/board-am335xevm.c. The MACHINE_START entries are at the bottom of the file:

    MACHINE_START(AM335XEVM, "am335xevm")
        /* Maintainer: Texas Instruments */
        .atag_offset    = 0x100,
        .map_io        = am335x_evm_map_io,
        .init_early    = am33xx_init_early,
        .init_irq    = ti81xx_init_irq,
        .handle_irq     = omap3_intc_handle_irq,
        .timer        = &omap3_am33xx_timer,
        .init_machine    = am335x_evm_init,
    MACHINE_END

    Best regards,
    Miroslav

  • Hi Miroslav,
       I am very sorry,these days I have something personal.
       I didn't add new platform,directly modify AM335X platform, ID use am335xevm
       Modify <linux_dir>/arch/arm/tools/mach-types
       myplatform  MACH_AM335XEVM  MYPLATFORM  3589
       Modify <linux_dir>/arch/arm/mach-omap2/board-am335xevm.c
       MACHINE_START(MYPLATFORM, "myplatform")
         /* Maintainer: Texas Instruments */
         .atag_offset    = 0x100,
         .map_io        = am335x_evm_map_io,
         .init_early    = am33xx_init_early,
         .init_irq    = ti81xx_init_irq,
         .handle_irq     = omap3_intc_handle_irq,
         .timer        = &omap3_am33xx_timer,
         .init_machine    = am335x_evm_init,
       MACHINE_END
       Modify am335xevm related code in the Kernel code(Ex. uncompress.h)
       But the problem remains unsolved(go to suspend, can't wake up)
       My idea is to modify the basis of AM335X platform, if you can then add a new platform

  • Ryan,

    I tested the following patch which changed the machine name and suspend/resume from uart still works.

    diff --git a/arch/arm/mach-omap2/board-am335xevm.c b/arch/arm/mach-omap2/board-am335xevm.c
    index 8f79e26..8d19ef8 100644
    --- a/arch/arm/mach-omap2/board-am335xevm.c
    +++ b/arch/arm/mach-omap2/board-am335xevm.c
    @@ -2721,7 +2721,7 @@ static void __init am335x_evm_map_io(void)
            omapam33xx_map_common_io();
     }
     
    -MACHINE_START(AM335XEVM, "am335xevm")
    +MACHINE_START(AM335XTEST, "am335xtest")
            /* Maintainer: Texas Instruments */
            .atag_offset    = 0x100,
            .map_io         = am335x_evm_map_io,
    diff --git a/arch/arm/plat-omap/include/plat/uncompress.h b/arch/arm/plat-omap/include/plat/uncompress.h
    index 8686776..e038466 100644
    --- a/arch/arm/plat-omap/include/plat/uncompress.h
    +++ b/arch/arm/plat-omap/include/plat/uncompress.h
    @@ -189,7 +189,7 @@ static inline void __arch_decomp_setup(unsigned long arch_id)
                    DEBUG_LL_TI81XX(1, ti8148evm);
     
                    /* AM33XX base boards using UART1 */
    -               DEBUG_LL_AM33XX(1, am335xevm);
    +               DEBUG_LL_AM33XX(1, am335xtest);
     
                    /* AM33XX IA boards using UART4 */
                    DEBUG_LL_AM33XX(4, am335xiaevm);
    diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
    index 217ea76..0493186 100644
    --- a/arch/arm/tools/mach-types
    +++ b/arch/arm/tools/mach-types
    @@ -1126,5 +1126,5 @@ atdgp318          MACH_ATDGP318           ATDGP318                3494
     m28evk                 MACH_M28EVK             M28EVK                  3613
     smdk4212               MACH_SMDK4212           SMDK4212                3638
     smdk4412               MACH_SMDK4412           SMDK4412                3765
    -am335xevm              MACH_AM335XEVM          AM335XEVM               3589
    +am335xtest             MACH_AM335XTEST         AM335XTEST              3589
     am335xiaevm            MACH_AM335XIAEVM        AM335XIAEVM             3684
    diff --git a/sound/soc/davinci/davinci-evm.c b/sound/soc/davinci/davinci-evm.c
    index fe1563c..e386571 100644
    --- a/sound/soc/davinci/davinci-evm.c
    +++ b/sound/soc/davinci/davinci-evm.c
    @@ -59,7 +59,7 @@ static int evm_hw_params(struct snd_pcm_substream *substream,
                                    machine_is_davinci_da850_evm())
                    sysclk = 24576000;
            /* On AM335X, CODEC gets MCLK from external Xtal (12MHz). */
    -       else if (machine_is_am335xevm())
    +       else if (machine_is_am335xtest())
     #ifdef CONFIG_MACH_AM335XEVM
                    if (am335x_evm_get_id() == EVM_SK)
                            sysclk = 24000000;
    @@ -349,7 +349,7 @@ static int __init evm_init(void)
            } else if (machine_is_davinci_da850_evm()) {
                    evm_snd_dev_data = &da850_snd_soc_card;
                    index = 0;
    -       } else if (machine_is_am335xevm()) {
    +       } else if (machine_is_am335xtest()) {
                    evm_snd_dev_data = &am335x_snd_soc_card;
     #ifdef CONFIG_MACH_AM335XEVM
                    if (am335x_evm_get_id() == EVM_SK)
    
    
  • Hi Bin,
        Sorry, the problem is still there
    Following shown:
    Code changes before:
    After code change:

  • Ryan,

    After recreated a fresh test environment, I am able to replicate the issue. For some reason, after machine name changed, 'cputype' command generates non-linefetch abort which causes pvr-init script failed to initialize. Please try the following patch for the root filesystem to see it works around the issue for you.

    --- etc/init.d/pvr-init.orig    2014-06-03 10:32:20.472930876 -0500
    +++ etc/init.d/pvr-init 2014-06-03 10:34:16.136927459 -0500
    @@ -13,8 +13,6 @@
     BITSPERPIXEL="$(fbset | grep geom | awk '{print $6}')"
     YRES="$(fbset | grep geom | awk '{print $3}')"
     
    -CPUTYPE="$(cputype)"
    -
     if [ "$1" = "" ]; then
            echo PVR-INIT: Please use start, stop, or restart.
            exit 1
    @@ -85,19 +83,6 @@
            if ! /usr/bin/pvrsrvctl --start --no-module; then return; fi 
     }
     
    -case $CPUTYPE in
    -"OMAP3530")
    -       sgxprepare
    -
    -       devmem2 0x48004B48 w 0x2 > /dev/null
    -       devmem2 0x48004B10 w 0x1 > /dev/null
    -       devmem2 0x48004B00 w 0x2 > /dev/null
    -
    -       ES_REVISION="$(devmem2 0x50000014 | sed -e s:0x00010205:5: -e s:0x00010201:3: -e s:0x00010003:2: | tail -n1 | awk -F': ' '{print $2}')"
    -
    -       sgxfinish
    -       ;;
    -"TI33XX")
            sgxprepare
     
            devmem2 0x44e01104 w 0x0 > /dev/null
    @@ -106,19 +91,3 @@
            ES_REVISION="$(devmem2 0x56000014 | sed -e s:0x00010205:8: | tail -n1 | awk -F': ' '{print $2}')"
     
            sgxfinish
    -       ;;
    -"TI816x")
    -       sgxprepare
    -
    -       devmem2 0x48180F04 w 0x0 > /dev/null
    -       devmem2 0x48180900 w 0x2 > /dev/null
    -       devmem2 0x48180920 w 0x2 > /dev/null
    -
    -       ES_REVISION="$(devmem2 0x56000014 | sed -e s:0x00010205:6: -e s:0x00010201:3: -e s:0x00010003:2: | tail -n1 | awk -F': ' '{print $2}')"
    -
    -       sgxfinish
    -       ;;
    -*)
    -       echo No SGX hardware, not starting PVR
    -       ;;
    -esac
    
  • Hey Ryan,

    I just realized the command '/usr/bin/cputype' is a shell script, which reads /proc/cpuinfo. Please ignore the above patch, and modify your cputype script Line 10 'elif [ "$(machine_id)" = "am335xevm" ] ; then' to match your new machine name.

  • Hi, Bin
         Thank you very much for you help, the problem has been solved.