Shutdown Issue: I want to shut down, but it reboots

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Shutdown Issue: I want to shut down, but it reboots

1,886 Views
snan1z
Contributor I

Hi all,

 

Firstly, i tried to use shutdown command but "command not found". then i tried poweroff command, however it reboots. Then i refer to my last chance , Google, and i saw a thread about this;

 

http://forums.freescale.com/t5/i-MX-Microprocessors/halt-command-reboots-on-i-MX23-and-i-MX28/td-p/6...

 

i applied the patch and everthing is normal without lcd. it kills all processes and at the end outputs "power down" message. but when i plug lcd; it is not stopped, just flickers.

 

Best Regards,

Sinan

Labels (1)
0 Kudos
6 Replies

1,161 Views
alex
Contributor I


   Thanks. I understand. The chapter11 (p907)in application processor reference manual,  when PSWITCH=1 or RTC alarm or AUTO_RESTART=1 or 5v_DETECT=1, it's a coolboot..

0 Kudos

1,161 Views
RoboTech
Contributor III

The MX28 does not power off if you have 5V. What I did to test it with the EVK is move S16 switch to USB 5V and leave USB disconnected, so that you prevent 5V to reach the MCU. Then attach a battery or use the onboard regulator to simulate a battery source and switch S1 accordingly. Also make sure switch S17 (jtag reset) is "disabled".

You can then simulate insertion/removal of 5V using the S16 switch, so that you run from batteries or not. Only when 5V are not present on the MCU it can power off itself. If 5V are present, the board will automatically power on after power off.

Best regards,
Paolo

alex said:

Hi Paolo:

   I have the same issue with you. I change pm with your patch, but it still reboot. Do you have any other change?  I put battery and 5v charger on mx28 board.

Your reply is appreciated.

Best Regards,

Alex

0 Kudos

1,161 Views
alex
Contributor I

Hi Paolo:

   I have the same issue with you. I change pm with your patch, but it still reboot. Do you have any other change?  I put battery and 5v charger on mx28 board.

Your reply is appreciated.

Best Regards,

Alex



Paolo Messina said:

I finally found a solution, thanks to Freescale support. There was a typo in the above code. I post it here, just modify "pm.c" this way:

#include <mach/regs-rtc.h>

#define REGS_RTC_BASE IO_ADDRESS(RTC_PHYS_ADDR)

static void mx28_pm_power_off(void)
{
    pr_info("poweroff - 1 rtc_persistent0=%08X \n",
        __raw_readl(REGS_RTC_BASE + HW_RTC_PERSISTENT0));

    __raw_writel(BM_RTC_PERSISTENT0_AUTO_RESTART,
        REGS_RTC_BASE + HW_RTC_PERSISTENT0_CLR); // disable auto-restart

    pr_info("poweroff - 2 rtc_persistent0=%08X \n",
        __raw_readl(REGS_RTC_BASE + HW_RTC_PERSISTENT0));

    pr_info("poweroff - 3 power_reset=%08X \n",
        __raw_readl(REGS_POWER_BASE + HW_POWER_RESET));

    __raw_writel(BF_POWER_RESET_UNLOCK(0x3e77),
        REGS_POWER_BASE + HW_POWER_RESET);

    pr_info("poweroff - 4 power_reset=%08X \n",
        __raw_readl(REGS_POWER_BASE + HW_POWER_RESET));

    __raw_writel(BF_POWER_RESET_UNLOCK(0x3e77) | BM_POWER_RESET_PWD,
        REGS_POWER_BASE + HW_POWER_RESET);

    pr_info("poweroff - 5 power_reset=%08X \n",
        __raw_readl(REGS_POWER_BASE + HW_POWER_RESET));
}

Best,
Paolo

0 Kudos

1,161 Views
RoboTech
Contributor III

I finally found a solution, thanks to Freescale support. There was a typo in the above code. I post it here, just modify "pm.c" this way:

#include <mach/regs-rtc.h>

#define REGS_RTC_BASE IO_ADDRESS(RTC_PHYS_ADDR)

static void mx28_pm_power_off(void)
{
    pr_info("poweroff - 1 rtc_persistent0=%08X \n",
        __raw_readl(REGS_RTC_BASE + HW_RTC_PERSISTENT0));

    __raw_writel(BM_RTC_PERSISTENT0_AUTO_RESTART,
        REGS_RTC_BASE + HW_RTC_PERSISTENT0_CLR); // disable auto-restart

    pr_info("poweroff - 2 rtc_persistent0=%08X \n",
        __raw_readl(REGS_RTC_BASE + HW_RTC_PERSISTENT0));

    pr_info("poweroff - 3 power_reset=%08X \n",
        __raw_readl(REGS_POWER_BASE + HW_POWER_RESET));

    __raw_writel(BF_POWER_RESET_UNLOCK(0x3e77),
        REGS_POWER_BASE + HW_POWER_RESET);

    pr_info("poweroff - 4 power_reset=%08X \n",
        __raw_readl(REGS_POWER_BASE + HW_POWER_RESET));

    __raw_writel(BF_POWER_RESET_UNLOCK(0x3e77) | BM_POWER_RESET_PWD,
        REGS_POWER_BASE + HW_POWER_RESET);

    pr_info("poweroff - 5 power_reset=%08X \n",
        __raw_readl(REGS_POWER_BASE + HW_POWER_RESET));
}

Best,
Paolo

0 Kudos

1,161 Views
RoboTech
Contributor III

I also have this issue with MX28EVK. I tried modifying the "pm.c" source as suggested elsewhere:

static void mx28_pm_power_off(void)
{
    pr_info("poweroff - 1 rtc_persistent0=%08X \n",
        __raw_readl(REGS_POWER_BASE + HW_RTC_PERSISTENT0));

    __raw_writel(__raw_readl(REGS_POWER_BASE + HW_RTC_PERSISTENT0) & ~BM_RTC_PERSISTENT0_AUTO_RESTART,
        REGS_POWER_BASE + HW_RTC_PERSISTENT0); // disable auto-restart

    pr_info("poweroff - 2 rtc_persistent0=%08X \n",
        __raw_readl(REGS_POWER_BASE + HW_RTC_PERSISTENT0));

    pr_info("poweroff - 3 power_reset=%08X \n",
        __raw_readl(REGS_POWER_BASE + HW_POWER_RESET));

    __raw_writel(BF_POWER_RESET_UNLOCK(0x3e77) | BM_POWER_RESET_PWD,
        REGS_POWER_BASE + HW_POWER_RESET);

    pr_info("poweroff - 4 power_reset=%08X \n",
        __raw_readl(REGS_POWER_BASE + HW_POWER_RESET));
}

And the output I get is:

release pswitch to power down
pswitch power down
poweroff - 1 rtc_persistent0=00002608
poweroff - 2 rtc_persistent0=00002608
poweroff - 3 power_reset=00000000
HTLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLFLC
PowerPrep start initialize power...
Battery Voltage = 4.24V
5v source detected.Valid battery                                voltage detected.Booting from battery                             voltage source.
LLLCJun 16 201108:30:22
FRAC 0x92925552
memory type is DDR2
                   Wait for ddr ready 1power 0x00820616
Frac 0x92925552
start change cpu freq
hbus 0x00000003
cpu 0x00010001
start test memory accress
ddr2 0x40000000
finish simple test
LLLLLLLFLCLLJUncompressing Linux... done, booting the kernel.

So the AUTO_RESTART bit is not even set before powering down. This is not the reason for reset. What else is going on?

The PSWITCH is released before the message "pswitch power down" is printed, so it cannot retrigger power on afterwards.

How come nobody got this issue already? No one is trying to power off using PSWITCH?

Regards,
Paolo

0 Kudos

1,161 Views
AhmetYUCE
Contributor II
PSWITCH pin can power up iMX28 automatically depending on OTP bits. Did you check out iMX28 reference manual and your schematics if there is such an HW issue ? Regards Ahmet
0 Kudos