linux spiÇý¶¯
linux spiÇý¶¯
Äں˰汾£ºlinux-2.6.29
Ö÷ÒªµÄ¼¸¸ö½á¹¹
platform_device platform_driver s3c24xx_spi spi_master spi_bitbang spi_device spi_driver spidev_data s3c_spi_info
µÚÒ»²½£º×¢²áplatform_device
ÔÚarch/arm/mach-s3c2410/mach-qt2410.c ÖÐ×¢²áplatform_device £¬ÆäÖÐs3c2410_spi_info ×÷Ϊplatform_device.private_data. platform_device.name Ϊ"s3c2410-spi".
ͬʱÔÚmach-qt2410.c ÖÐ×¢²áspi_board_info, ÆäÖÐspi_board_info.bus_num=0, Óës2c2410_spi_info ÖеÄbus_num Ïàͬ, ÒÔºó»áͨ¹ýbus_num ±È¶ÔÀ´Æ¥Åä¡£
µÚ¶þ²½£º×¢²áplatform_driver
ÔÚdriver/spi/spi_s3c24xx.c ÖÐ×¢²áplatform_driver (s3c24xx_spi_driver) £¬Õâ¸öplatform_driver µÄÃû×ÖΪ"s3c2410-spi" £¬ÕâÑùÃû×ÖÓëplatform_device µÄÏàͬ£¬ÔÚ×¢²áµÄʱºò»áÆ¥Åäµ½Ò»Æð¡£²¢µ÷ÓÃs3c24xx_spi_driver.probe º¯Êýs3c24xx_spi_probe ¡£
µÚÈý²½£º×¢²áspi_device
ÔÚ.probe º¯ÊýÖд´½¨s3c24xx_spi £¬¸Ã½á¹¹ÖаüÀ¨ÁËÒ»¸öspi_bitbang, Ò»¸öspi_master £¬
ÅäÖÃÁËһЩ»¥Ïà¹ØÁªµÄÏîÒÔºó( ½«3c2410_spi_info.bus_num ×÷Ϊspi_master.bus_num) £¬¼´É¨Ãè×¢²áµÄspi_board_info Á´±í£¬²éÕÒËùÓÐspi_board_info.bus_num Óëspi_master.bus_num ÏàµÈµÄÏ²¢ÎªÃ¿Ò»Ïî×¢²áspi_device £¬ÆäÖÐspi_device µÄÃû×ÖΪspi_board_info. Modalias ¡£
µÚËIJ½£º×¢²á×Ö·ûÉ豸£¬×¢²áspi_driver
ÔÚdriver/spi/spidev.c ÖУ¬ÏÈ×¢²á ÁËÒÔSPIDEV_MAJOR ΪÖ÷É豸ºÅ£¬spidev_ops ΪÎļþ²Ù×÷¼¯µÄ×Ö·ûÉ豸 ¡£
×¢²áspi_driver . ÔÚdriver/spi/spidev.c ÖУ¬ÆäÖÐspi_driver µÄÃû×ÖΪ”spidev” £¬ÕâÑùÓë¸Õ²Å×¢²áµÄspi_device ÏàÆ¥Å䣬ÔÚspi_driver.probe ²¢ÎªÃ¿¸öÆ¥ÅäµÄspi_device ´´½¨ÁËÒ»¸öspidev_data £¬²¢ÔÚsys ϵͳÖÐ×¢²áÒ»¸ö´øÓÐÒÔSPIDEV_MAJOR ΪÖ÷É豸ºÅ£¬ÒÔ£°¿ªÊ¼µÄµÝÔöµÄÊý×ÖΪ¸±É豸ºÅµÄÉ豸µã£¬ÕâÑùÈç¹ûÓÐudev ÔËÐеĻ°»áÔÚ/dev ÏÂÃæ½Úµã¡£
ºÃÁË£¬ËùÓеŤ×÷×¼±¸¾ÍÐ÷ÁË£¬Óû§¿ÉÒÔͨ¹ý·ÃÎÊ/dev/ ϵĽڵãÀ´Ê¹ÓÃÕâ¸öÇý¶¯ÁË¡£
Ïà¹ØÎĵµ£º
Íز¨±ü³Ð²»¶Ï¿ªÍؽøÈ¡µÄ¾«Éñ£¬ÔÚ¼¼ÊõÑз¢ºÍÖ§³ÖÉϲ»¶ÏµÄͶÈëÈËÁ¦ÎïÁ¦£¬Á¦ÇóÔÚ²»¶Ï±ä»¯µÄÊг¡ÐèÇóÖУ¬´ïµ½100%µÄ¿Í»§ÂúÒâ¶È¡£ÔÚ¸Õ¸Õ̤Èë2010Ä꣬¸ù¾Ý¹ýÍùµÄÊг¡µ÷²é£¬½áºÏ¿Í»§µÄÐèÇóºÍ½¨Ò飬Íز¨ÓʼþϵͳÍƳöÁËLinux_°²ÌÚ°æ±¾£¬×÷ΪдºË͸ø¹ã´ó¿Í»§µÄµÚÒ»·ÝÀñÎï¡£
°²ÌÚ´¦ÀíÆ÷ÊÇ×î½üÊ®Äê²ÅÖð½¥·¢Õ¹ÆðÀ´µ ......
1.1 Óï·¨»ù±¾½éÉÜ
1.1.1 ¿ªÍ·
³ÌÐò±ØÐëÒÔÏÂÃæµÄÐпªÊ¼£¨±ØÐë·½ÔÚÎļþµÄµÚÒ»ÐУ©£º
#!/bin/sh
·ûºÅ#!ÓÃÀ´¸æËßϵͳËüºóÃæµÄ²ÎÊýÊÇÓÃÀ´Ö´ÐиÃÎļþµÄ³ÌÐò¡£ÔÚÕâ¸öÀý×ÓÖÐÎÒÃÇʹÓÃ/bin/shÀ´Ö´ÐгÌÐò¡£
µ±±à¼ºÃ½Å±¾Ê±£¬Èç¹ûÒªÖ´Ðиýű¾£¬»¹±ØÐëʹÆä¿ÉÖ´ÐС£
Ҫʹ½Å±¾¿ÉÖ´ÐУº
±àÒë chmod +x filename ÕâÑù²ÅÄÜÓÃ./filena ......
1.CPU&½ø³Ì
1.1 topÃüÁî
top - 20:07:00 up 186 days, 3:47, 3 users, load average: 0.01, 0.02, 0.00
Tasks: 82 total, 1 running, 80 sleeping, 1 stopped, 0 zombie
Cpu(s): 3.7% us, 0.0% sy, 0.0% ni, ......
/*
* 2010-1-21
* ¸ÃÎļþʱÄÚºËÖÐÓйØÈÎÎñµ÷¶ÈµÄº¯Êý³ÌÐò£¬ÆäÖаüº¬»ù±¾º¯Êýsleep_on£¬
* wakeup£¬scheduleµÈ£¬ÒÔ¼°Ò»Ð©¼òµ¥µÄϵͳµ÷Óá£Í¬Ê±½«ÈíÅ̵ļ¸¸ö²Ù×÷
* º¯ÊýÒ²·ÅÖÃÔÚÕâÀï¡£
*
* scheduleº¯ÊýÊ×ÏȶÔËùÓеÄÈÎÎñ¼ì²é£¬»½ÐÑÈκÎÒ»¸öÒѾµÃµ½ÐźŵÄÈÎÎñ£¬
* ......