2013年8月18日 星期日

網樂通可以正常醒來了!


從之前弄好 EeePC 4GB ram 在 32bit 系統完整利用後就想把一些東西寫出來,
到現在終於動手了。

之前做好了用於VirtualBox 的CrossCompile環境後,
可以好好利用去上課時的電腦來編譯網樂通用 linux kernel,
節省編譯的時間。
不然用我手上最快的裝置 EeePC 1015B,
光kernel主檔案就要跑20分鐘啊。
上課用電腦2分鐘內解決。

至於上課,
我也不知道為什麼Android的課會上Office Access 。(Orz)
聽到table的規劃時,
突然有種回到大學最後在幫忙弄活動網站,
搞MySQL時的錯覺 。



今天最令人高興的是加上了power management 的項目後,
可以正常Standby 和 Suspend to RAM,
standby 耗電量1.2W,
Suspend to Ram 0W,
而且都還加上一個6CM風扇,
12V風扇降成5V用真是省電啊。

除了可以在 TTL console 介面輸入來喚醒外,
/dev/rtc0 也可以用來喚醒,
只是不知道是載入的哪個rtc裝置有正常驅動,
還要花時間再試試。

但是開機時載入stmfb時多了一堆錯誤,
看來是這次增加太多選項了。
像是一開始加入下面的就無法編譯:
== System type
==== Additional SuperH Device DriversPinmuxed GPIO

用最後面附的bashscript跑出來,
預設可啟動裝置狀態:
/sys/devices/platform/stm-usb.0/stm-ehci.0/usb1/power/wakeup    enabled
/sys/devices/platform/stm-usb.0/stm-ohci.0/usb2/power/wakeup    enabled
/sys/devices/platform/stm-usb.1/stm-ehci.1/usb3/power/wakeup    enabled
/sys/devices/platform/stm-usb.1/stm-ohci.1/usb4/power/wakeup    enabled
/sys/devices/platform/stmmaceth.0/power/wakeup    disabled
/sys/devices/platform/lirc-stm/power/wakeup    disabled
/sys/devices/platform/stm-asc.0/power/wakeup    enabled
/sys/devices/platform/stm-asc.0/tty/ttyAS0/power/wakeup    disabled
/sys/devices/platform/stm-rtc/power/wakeup    disabled


其中 stm-rtc 的wakeup要改成enabled才能用rtc0喚醒
紅外線裝置從kernel 2.6.23的 lirc 變成 lirc-stm後,
設定wakeup卻無效了。

相關檔案:

  1. VirtualBox 虛擬機器檔案:
    (CentOS 6.4 內裝STLinux 2.4 CrossCompile 環境)
    內含 網樂通改機俱樂部Chia-Cheng Huang 所釋出的 kernel 2.6.32.59
    http://sync.hamicloud.net/_oops/rexct/9zb
    ID: sh4twbox Password: sh4twbox
    /home/sh4twbox/ST_dev/make_kernel.sh
    /usr/sbin/zerofree
    130909版:http://rexct.blogspot.tw/2013/09/kerneluboot-virtualbox.html
  2.  下面選項中有標M的modules:
    http://sync.hamicloud.net/_oops/rexct/exv
  3. 載入stmfb會有錯誤的kernel:
    http://sync.hamicloud.net/_oops/rexct/7jp


目前在2.6.32.59預設上做了以下變動:

General setup -> Support for paging of anonymous memory (swap)
IO scheduler anticipatory to CFQ
==system type
====CPU Frequency Scaling: 
ondemand M
conservertive M
Heartbeat LED
 ==== Additional SuperH Device Drivers
Push switch support

==kernel feature
Timer Frequency: 250Hz to 300Hz (NTSC tvout) 
==Power management options
Power Management support
Run-time PM core functionality
CPU idle PM support
==Networking support
iptables
appletalk protocol support M
appletalk interfaces support M
====Networking option
The IPv6 protocol
======Network packet filtering framework
========IPv6: Netfilter Configuration
IP6 tables support
"ah" match support
"frag" Fragmentation header match support
"ipv6header" IPv6 Extension Headers Match
Packet filtering
Packet mangling
==newwork device support
Wireless Lan

==Device Drivers
Multimedia support M
Video For Linux M
DVB for Linux M
Load and attach frontend and tuner driver modules as need
V4L USB devices M
-Radio Adapters (這個應該沒用,就移除吧)
DVB/ATSC adapters M
====Graphic support
Enable firmware EDID
====Soundcard support
Advance Linux Sound Architecture M
USB Audio/MIDI driver M
STMicroelectronics SoCs support M
STx7105 and STx7106 support M
====GPIO Support
/sys/class/gpio/... (sysfs interface)
====LED Support
LED GPIO Trigger
====Real Time Clock
SuperH On-Chip RTC
STMicroelectronics LPC RTC device driver
==File systems
FUSE
Character device in userspace support
NFS server support M
NFS4 Client
NFS4 Server
Advanced partition selection
EFI GUID Partition support
==STM specific devices
STM coprocessor support
Power Management Scheme
PMS always checks the state group

找出可設定作為喚醒裝置的Bash script: 

寫bash script時,
鳥哥網站真是個參考的好地方,
只是我還是不太會使用or,
只好再多長出個elif。
#!/bin/bash
rec="/dev/shm/wakeup32.txt"
touch $rec
for i in `find /sys -name wakeup`;do
  state=`cat $i`
  if test $state = enabled;then
    echo -e $i"\t"$state >> $rec
  elif test $state = disabled;then
    echo -e $i"\t"$state >> $rec
  fi
done

沒有留言:

張貼留言