21 Disable RTC
21.1 Histroy
- 2014-08-07, rayoslee, release V0.0.3
- modify “disable for bootable SPI”
- add “miss case for bootable SPI”
- 2014-07-28, rayoslee, release V0.0.2
- add “verification”
- 2014-07-25, rayoslee, release V0.0.1
21.2 FAQ
How to disable RTC for bootable SD?(Target Name SDLoader_S605-32_192MHz)
Turn on DISABLE_RTC in Loader/SDLoader/SdLoader.c.
6 +++ #define __DISABLE_RTC__ 227 #ifndef __DISABLE_RTC__ 228 // RTC H/W Power Off Function Configuration */ 229 outp32(AER,0x0000a965); 230 while(1) 231 { 232 if((inp32(AER) & 0x10000) ==0x10000) 233 break; 234 } 235 outp32(PWRON, 0x60005); /* Press Power Key during 6 sec to Power off (0x'6'0005) */ 236 outp32(RIIR,0x4); 237 #endif 251 #ifdef __DISABLE_RTC__ 252 sysprintf("Disable RTC feature.\n"); 253 #endif
- Turn off Device Drivers -> Real Time Clock using make menuconfig in linux kernel.
./build sd to output kernel binary file.
How to disable RTC for bootable SPI?(Target Name NoLCM)
Turn on No_RTC in Loader/SpiLoader/SpiLoader_gzip/src/main.c
24 +++ #define __No_RTC__ 25 //#define __UPLL_240__ 26 #define __UPLL_192__ 336 #ifndef __No_RTC__ 337 outp32(AER,0x0000a965); 338 339 while(1) 340 { 341 if((inp32(AER) & 0x10000) ==0x10000) 342 break; 343 } 344 345 outp32(PWRON, 0x60005); /* Press Power Key during 6 sec to Power off (0x'6'0005) */ 346 outp32(RIIR,0x4); 347 #endif
Turn on
_S605_
in Loader/SpiLoader/SpiLoader_gzip/src/main.c#define _S605_ #ifdef _S605_ // support S605 chip //---------------------------------------------------------------------------- // Initail GPIO pins GPE10 and GPE11 to output mode for S605 module. //---------------------------------------------------------------------------- void S605_init_gpio() { sysprintf("Initial GPIO pins for S605 module.\n"); // initial GPE10 to output mode and pull low it. outpw(REG_GPEFUN, inpw(REG_GPEFUN) & (~MF_GPE10)); // set GPE10 as GPIO pin outpw(REG_GPIOE_PUEN, inpw(REG_GPIOE_PUEN) | BIT10); // set GPE10 internal resistor to pull up outpw(REG_GPIOE_DOUT, inpw(REG_GPIOE_DOUT) & (~BIT10)); // output 0 to GPE10 outpw(REG_GPIOE_OMD, inpw(REG_GPIOE_OMD) | BIT10); // set GPE10 to OUTPUT mode // initial GPE11 to output mode and pull low it. outpw(REG_GPEFUN, inpw(REG_GPEFUN) & (~MF_GPE11)); // set GPE11 as GPIO pin outpw(REG_GPIOE_PUEN, inpw(REG_GPIOE_PUEN) | BIT11); // set GPE11 internal resistor to pull up outpw(REG_GPIOE_DOUT, inpw(REG_GPIOE_DOUT) & (~BIT11)); // output 0 to GPE11 outpw(REG_GPIOE_OMD, inpw(REG_GPIOE_OMD) | BIT11); // set GPE11 to OUTPUT mode } //---------------------------------------------------------------------------- // Control GPE10 and GPE11 to power on S605 module. // When power on, pull low both RST (GPE10 pin) and PMU (GPE11 pin); // And then, pull high PMU; // Wait 3ms at least, pull high RST; // Keep status 12ms at least; //---------------------------------------------------------------------------- void S605_power_on() { UINT32 u32Delay; sysprintf("Power on S605 module.\n"); outpw(REG_GPIOE_DOUT, inpw(REG_GPIOE_DOUT) & (~BIT10)); // pull low RST outpw(REG_GPIOE_DOUT, inpw(REG_GPIOE_DOUT) & (~BIT11)); // pull low PMU u32Delay = 20000; while(u32Delay--); // delay 10000 loop ~= 5ms outpw(REG_GPIOE_DOUT, inpw(REG_GPIOE_DOUT) | BIT11); // pull high PMU u32Delay = 20000; while(u32Delay--); // delay 10000 loop ~= 5ms outpw(REG_GPIOE_DOUT, inpw(REG_GPIOE_DOUT) | BIT10); // pull hiigh RST u32Delay = 40000; while(u32Delay--); // delay 10000 loop ~= 5ms } #endif
- Turn off Device Drivers -> Real Time Clock using make menuconfig in linux kernel.
./build spi to output kernel binary file.
How to verify “disable RTC” function in HW side?
Check S605-32 demo kit
- PIN 41/RTC_1.8V is connected to independent 1.8V power source.
- PIN 42/RTC_PWEREN is not connected to independent 1.8V power source. (NC, open it)
- PIN 43/RTC_WKUP is not connected to switch. (NC, open it)
- Remove RTC 32.768 crystal from S605-32 demo kit.
Power on S605-32 and it can be booted up.
How to resolve “miss case” for bootable SPI without RTC ?
- If you meet “start WPS PBC mode”, you can choose three solutions to resolve it.
First,
- modify WPS_TRIG_KEY from POWER to HOME in yourjffs2folder/wifi/network_config.default and etc/network_config
- remake jffs2.summary
Second,
disable kpdin -t 2 (press key 2s) in yourBSP/initramfs/etc/profile_spi because kpdin will call RTC function.
if [ $WPS_TRIG_KEY != -99 ]; then echo "Enable WPS? Press <"$WPS_TRIG_KEY_STR"> key" > $MSGTOTERMINAL --- kpdin -t 2 if [ $? = $WPS_TRIG_KEY ]; then
rebuild kernel, ./build spi
Third,
- give state a default but not 1 or 0 in drivers/char/w55fa93_sysmgr.c. If state is 0, kpdin will set it as POWER key.
- rebuild kernel, ./build spi
Why does only SPI without RTC happens “miss case” but SD without RTC not?
This is a good question. Please see two logs, 20140806_201114.puttylog.sd and 20140806_201152.puttylog.spi