Monday, July 24, 2006

Linuxをポーティング!?

SuperH (SH-4A SH7780)に Linuxをポーティング!?



SH7780のSolutionEngine(型番:MS7780SE03)をいじって半年が経とうとしている。
自前のBIOSは、1ヶ月程度で動いたが、Linux BSPキットのベータ版は、たまに
原因不明のハングアップが発生していて、暫く放置されていた。


先日(7月上旬)、 正式版のLinux BSPキットが送られてきたので、色々弄っていたが、
1週間程度で、SII3114のSATAカードをrootにして起動できるようになった。
これに伴い、BIOSのコマンドも 拡張して、ROM以外にhdaからも起動できるように
変更した。

でもやっぱり、Linux BSP(Kernel 2.6.10)だと、翌日ハングアップしている場合が
ある。一応、カーネル以外は、debianパッケージをハードディスクに
入れてコンパイル環境も整えてみたが、放っておくと次のようなメッセージを
コンソールに出す場合もあった。
(SIIのSATAドライバもpci_ids.hとsii.cを修正して無理やり動かしたのが
いけないのかもしれないけど、 Solution Engine上の SII3512でもどうやら
同じなので、それだけの問題ではないようだ。)


masta@SH7780:~$ hda: dma_timer_expiry: dma status == 0x22
hda: DMA timeout error
hda: dma timeout error: status=0x58 { DriveReady SeekComplete DataRequest }

ide: failed opcode was: unknown
hda: status timeout: status=0xd8 { Busy }

ide: failed opcode was: unknown
ide0: reset phy, status=0x00000113, siimage_reset
hda: drive not ready for command
ide0: reset: success
hda: dma_intr: status=0x00 { }

ide: failed opcode was: unknown
hda: status timeout: status=0xfd { Busy }

ide: failed opcode was: unknown
hda: DMA disabled
ide0: reset phy, status=0xfd040104, siimage_reset
hda: drive not ready for command
ide0: reset phy dead, status=0xfd040104
ide0: host reset_poll failure for hda.
hda: status error: status=0xfd { Busy }

ide: failed opcode was: unknown
ide0: reset phy, status=0xfd040104, siimage_reset
hda: drive not ready for command
ide0: reset phy dead, status=0xfd040104
ide0: host reset_poll failure for hda.
hda: status error: status=0xfd { Busy }

ide: failed opcode was: unknown
end_request: I/O error, dev hda, sector 46434239
hda: drive not ready for command


そこで、他のLinuxのカーネルをSH7780用にコンパイルしてみることにした。
lantankのdebian化でお世話になったサイトからカーネルを
ダウンロードして、board定義などを適当に加えてコンパイルしてみた。
(ソースコードの構成を見ると昔のKernel 0.98とかと比べると、まったく別物だね。)

ポーティングというと新しいCPUに対応するところから行うというのが
普通だと思うが、今回は、SH7780のCPU部分は既にカーネルに含まれていたので
CPU周りはそのまま利用して、ボードの定義を追加してみた。

0 Comments:

Post a Comment

<< Home