s3c2410 RTCÇý¶¯¿ò¼ÜlinuxÄÚºËÔ´Âë·ÖÎö
ʵÔÚÎÞÁÄÖоͽ«ÔÀ´µÄһЩ¶«Î÷ÕûÀíÁËһϣ¬×Ô¼ºÊǸö¼ÇÐÔ²»ºÃµÄÈË£¬¸ô¶Ïʱ¼äÕûÀí×Ô¼º£¬Í¬Ê±Ò²Ï£Íû¿ÉÒÔ·½±ãËûÈË¡£
----------------------------------------------------------------------------------------------------------------------------------------
/**//*********************************************************************************************************
* @Description:s3c2410µÄrtcÇý¶¯µÄʵÏÖ£¬rtc(real time clock)ʵʱʱÖÓµÄÇý¶¯ÊǸöºÜºÃµÄ
* Àí½âÈç¹û±àдÇý¶¯µÄÓ²¼þ£¬Ëü°üÀ¨ÁË×î»ù±¾µÄÓ²Öжϣ¬ÈíÖжϵĵײã»úÖÆ£»
* s3c2410µÄRTCÇý¶¯µÄʵÏÖ¸öÈËÈÏΪ¸üÊǶÔlinuxÉ豸Çý¶¯Ò»¸öºÜºÃµÄÀý×Ó£¬ËûÊÇͨ¹ý¶þ²ã½á¹¹À´
* ʵÏÖµÄÒ»¸öÇý¶¯£¬ÉϲãÊÇÒ»¸öarm commonµÄ¹«¹²²ã£¬¶ÔÉÏÌṩ±ê×¼µÄͨÓõÄRTC²Ù×÷½Ó¿Ú£¬Ï²ãÓÉ
* ÎÒÃÇÀ´ÊµÏÖÕë¶Ô×Ô¼ºµÄchipºÍ×Ô¼ºÒªÌṩµÄ¹¦ÄÜÀ´ÊµÏÖµÄÒ»²ãÇý¶¯£»
*
* @FileTree:
**********************************************************************************************************
linux-2.6.14.6
|
|--arch
| |
| |--arm
| | |--mach-s3c2410
| | | |-devs.c //°üº¬Á˶Ը÷¸ö²¿¼þµÄresourceµÄ·ÖÅäºÍ¶¨Ò壬ÔÚÕâ¿´rtcµÄ×ÊÔ´£»
| | |--common
| | | |-rtctime.c //Ò»¸öarmƽ̨µÄͨÓÃrtcº¯Êý²ã£¬Ëü¶ÔÉÏÒþ²ØÁ˸÷ÖÖsocµÄrtc driverµÄÇø±ð£»
| | |--kernel
| | | |-time.c //Äں˵ijõʼ»¯Àý³Ìtime_init()»áµ÷ÓõÄxxx_cmos_xxxº¯ÊýµÄʵÏÖ£»¶¨ÒåÁËÈ«¾Ö×ÔÐýËørtc_lockÓÃÀ´´®Ðл¯ËùÓÐCPU¶ÔRTCµÄ²Ù×÷
|
|--drivers
| |--char
| | |-s3c2410-rtc.c //¾ßÌåµÄs3c2410ÉϵÄrtc chipµÄÇý¶¯ÊµÏÖ,Èç¹ûÐèÒªÔÚarmƽ
Ïà¹ØÎĵµ£º
±¾ÎÄÒÔ¼Ó·¨ÎªÀý£º[code]
//----------------------------------------------------
//adder.c
//---------------------------------------------------
void adder(int a, int b, int *sum)
{
*sum = a + b;
}
[/code][size=3]
[/size]
HLS¹¤¾ß£¨AutoPilot£©×ÛºÏÖ®ºóµÄ½á¹ ......
ÒÔϵÄ×ö·¨ÕûÀí×ÔÂÛ̳ÉϵÄÌû×Ó¡£
ÈçºÎcreate´óÎļþ
Òª´ó¾Í·Ç³£´ó£¬1T°É¡£
ÓÐÁ½ÖÖ·½·¨£º
Ò».dd
dd if=/dev/zero of=1T.img bs=1G seek=1024 count=0
bs=1G±íʾÿһ´Î¶Áд1GÊý¾Ý£¬count=0±íʾ¶Áд0´Î£¬seek=1024±íʾÂÔ¹ý1024¸öBlock²»Ð´£¬Ç°Ãæblock sizeÊÇ1G£¬ËùÒÔ¹²ÂÔ¹ý1T£¡
ÕâÊÇ´´½¨´óÐÍsparseÎļþ×î¼ ......
ÔÚlinuxÏÂһЩ³£ÓõĹػú/ÖØÆôÃüÁîÓÐshutdown¡¢halt¡¢reboot¡¢¼°init£¬ËüÃǶ¼¿ÉÒÔ´ïµ½ÖØÆôϵͳµÄÄ¿µÄ£¬µ«Ã¿¸öÃüÁîµÄÄÚ²¿¹¤×÷¹ý³ÌÊDz»Í¬µÄ£¬Í¨¹ý±¾ÎĵĽéÉÜ£¬Ï£ÍûÄã¿ÉÒÔ¸ü¼ÓÁé»îµÄÔËÓø÷ÖֹػúÃüÁî¡£
¡¡¡¡ 1.shutdown
shutdownÃüÁȫµØ½«ÏµÍ³¹Ø»ú¡£ ÓÐЩÓû§»áʹÓÃÖ±½Ó¶ÏµôµçÔ´µÄ·½Ê½À´¹Ø±Õlinux£¬ÕâÊÇÊ®·Ö ......
¹¦ÄÜ×îÇ¿Ôڵıà¼Æ÷——vi
¹¦ÄÜ×îÇ¿Ôڵıà¼Æ÷——vi
viÊÇËùÓÐUNIXϵͳ¶¼»áÌṩµÄÆÁÄ»±à¼Æ÷£¬ËüÌṩÁËÒ»¸öÊÓ´°É豸£¬Í¨¹ýËü¿ÉÒÔ±à¼Îļþ¡£µ±È»£¬¶ÔUNIXϵͳÂÔÓÐËùÖªµÄÈË£¬
»ò¶à»òÉÙ¶¼¾õµÃvi³¬¼¶ÄÑÓ㬵«viÊÇ×î»ù±¾µÄ±à¼Æ÷£¬ËùÒÔÏ£Íû¶ÁÕßÄܺúðÑËüѧÆðÀ´£¬ÒÔºóÔÚUNIXÊÀ½çÀï±Ø ......