19
Yet another Intel Chipset Internal SMBus device’s driver: ismt(4) ( と spdmem(4)) [email protected]

Yet another Intel Chipset Internal SMBus device’s driver: ismt(4)(and spdmem(4))

Embed Size (px)

Citation preview

Page 1: Yet another Intel Chipset Internal SMBus device’s driver: ismt(4)(and spdmem(4))

Yet another Intel Chipset Internal SMBus device’s driver: ismt(4)

( と spdmem(4))

[email protected]

Page 2: Yet another Intel Chipset Internal SMBus device’s driver: ismt(4)(and spdmem(4))

サーバ、ストレージ向け SoC

• S1200– Atom ベースのサーバ用で初の SoC

• C2000– 1G MAC x4 内蔵

• (Xeon-D)– 10G MAC x2 内蔵

Page 3: Yet another Intel Chipset Internal SMBus device’s driver: ismt(4)(and spdmem(4))

S1200 & C2000• S1200– Codename: Centerton– サーバ用途、ストレージ用途を想定– 6.1 - 14.1W– Release: Q4’12– 不遇の SoC

• C2000– Codename: Avoton, Rangeley– サーバ用途、ストレージ用途を想定– 6 – 20 W– Relase: Q3’13– おおはやり

Page 4: Yet another Intel Chipset Internal SMBus device’s driver: ismt(4)(and spdmem(4))

S1200

• 実際にこれを使った製品がほとんどない・・・– SuperMicro X9SBAA(-F)– 一部の NAS

• シリアルポートが puc(4) である– puc をシリアルコンソールにする問題– X9SBAA(-F) は別途 super IO がいてそこにも com ポートがある。

• ichsmb(4) および LPC bridge 内蔵の SMBus とは違う SMBus がいる

Page 5: Yet another Intel Chipset Internal SMBus device’s driver: ismt(4)(and spdmem(4))

C2000• Codename:– Avoton: for Storage• Turbo Boost がある。

– Rangeley: for Network• Turbo Boost はない• オプションで Quick Assist がある ( ハードウェア暗号化エンジン )

• シリアルは LPC の先• SMBus は S1200 で追加されたものも入っている

Page 6: Yet another Intel Chipset Internal SMBus device’s driver: ismt(4)(and spdmem(4))

そもそもなんでこういう違いがあるか• 組み込みを想定。軽くしたい– PCIe 経由して LPC の先の ISA bus とか無駄だろw• CPU cycle 数的に• 時間的に• 電力的に

– I2C, SMBus アクセスを軽くしたい• Enclosure センサーとかを実際に使うことを想定• データの読み書きは小さくても、実際に完了するまでに時間がかかる

Page 7: Yet another Intel Chipset Internal SMBus device’s driver: ismt(4)(and spdmem(4))

見えねぇ• SuperMicro X9SBAA-F に挿した DDR3

SODIMM の SPD memory が読めない– ichsmb(4) の先にはいない– LPC の先にもいない ( と思われる )

• SuperMicro A1SRi-2758F の ismt(4) に何か繋がっているかもしれない– SPD ROM は ichsmb(4) の先に存在する– 何かセンサーがあるなら見たい !

• SPD ROM の中身を見てニヤニヤするオタク

Page 8: Yet another Intel Chipset Internal SMBus device’s driver: ismt(4)(and spdmem(4))

spdmem(4)

ichsmb0 at pci0 dev 31 function 4: vendor 8086 product a123 (rev. 0x31)ichsmb0: interrupting at ioapic0 pin 16iic0 at ichsmb0: I2C busspdmem0 at iic0 addr 0x51: M378A1G43DB0-CPBspdmem0: DDR4 SDRAM (DDR4 UDIMM), no temp-sensor, 0.938ns cycle time (1066MHz), 8GB, 2132MHz (PC4-4300)spdmem0: 12 rows, 13 cols, 4 banks, 4 bank groupsspdmem0: tAA-tRCD-tRP-tRAS: 15-15-15-36

DDR4 の場合の例

Page 9: Yet another Intel Chipset Internal SMBus device’s driver: ismt(4)(and spdmem(4))

ismt(4)

• ichsmb(4) とはプログラミングインターフェースが全く違う• ディスクリプタリング +DMA– ディスクリプタに書いて実行– 結果はディスクリプタの先

• FreeBSD と Linux にはドライバがある– 作者は Intel の人

Page 10: Yet another Intel Chipset Internal SMBus device’s driver: ismt(4)(and spdmem(4))

FreeBSD -> NetBSD への移植• 移植は基本的に機械的作業– ドライバのデータ構造 ( いわゆる softc) の調整– DMA 関連の API の調整– 割り込み回りの調整

Page 11: Yet another Intel Chipset Internal SMBus device’s driver: ismt(4)(and spdmem(4))

サクッと割り込み来たぜー

Page 12: Yet another Intel Chipset Internal SMBus device’s driver: ismt(4)(and spdmem(4))

なんか、いつも見てるアドレスと違うような・・・

Page 13: Yet another Intel Chipset Internal SMBus device’s driver: ismt(4)(and spdmem(4))

わからん!• データシート見てもわからない• 困ったときは Linux のソース

そして・・・

Page 14: Yet another Intel Chipset Internal SMBus device’s driver: ismt(4)(and spdmem(4))

キター

Page 15: Yet another Intel Chipset Internal SMBus device’s driver: ismt(4)(and spdmem(4))

dmesgismt0 at pci0 dev 19 function 0: vendor 8086 product 0c59 (rev. 0x01)ismt0: interrupting at msi2 vec 0iic0 at ismt0: I2C busspdmem0 at iic0 addr 0x50: SMD-N8G28ECAP-16KLspdmem0: DDR3 SDRAM, ECC, temp-sensor, 8GB, 1600MHz (PC3-12800)spdmem0: 13 rows, 13 cols, 8 log. banks, 2 phys. banks, 1.250ns cycle timespdmem0: tAA-tRCD-tRP-tRAS: 10-10-10-28spdmem0: 1.5V 1.35V operablespdmem0: 0x00: 92 12 0b 08 04 21 02 09 0b 52 01 08 0a 00 fe 00spdmem0: 0x10: 69 78 69 30 69 11 18 81 20 08 3c 3c 00 f0 83 01spdmem0: 0x20: 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00spdmem0: 0x30: 00 00 00 00 00 00 00 00 00 00 00 00 0f 11 03 00spdmem0: 0x40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00spdmem0: 0x50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00spdmem0: 0x60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00spdmem0: 0x70: 00 00 00 00 00 86 e9 00 00 00 00 00 00 00 8f f5spdmem0: 0x80: 53 4d 44 2d 4e 38 47 32 38 45 43 41 50 2d 31 36spdmem0: 0x90: 4b 4c 00 00 00 00 00 00 00 00 00 00 00 00 00 00spdmem0: 0xa0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

verbose 出力

Page 16: Yet another Intel Chipset Internal SMBus device’s driver: ismt(4)(and spdmem(4))

diff--- ismt.c 2014-07-03 13:03:04.000000000 +0900+++ ismt.c.new 2016-01-05 02:19:27.000000000 +0900@@ -72,7 +72,7 @@ #define ISMT_DESC_LPR 0x80 /* Large Packet Received */ /* Macros */-#define ISMT_DESC_ADDR_RW(addr, is_read) ((addr) | (is_read))+#define ISMT_DESC_ADDR_RW(addr, is_read) ((addr << 1) | (is_read)) /* iSMT General Register address offsets (SMBBAR + <addr>) */ #define ISMT_GR_GCTRL 0x000 /* General Control */

Page 17: Yet another Intel Chipset Internal SMBus device’s driver: ismt(4)(and spdmem(4))

ちょ• てか、 FreeBSD はどうやって動作確認したんだよ・・・• Linux のドライバと FreeBSD のドライバは基本同じで、しかも FreeBSD のほうが後なんですけど。 Linux は最初っから正しいんですけど・・・。

Page 18: Yet another Intel Chipset Internal SMBus device’s driver: ismt(4)(and spdmem(4))

マージされました(^-^)

Page 19: Yet another Intel Chipset Internal SMBus device’s driver: ismt(4)(and spdmem(4))

Q

• FreeBSD の i2C (SMBus) 系のドライバ一覧とかはどこかにあるの?– NetBSD と OpenBSD は sys/dev/i2c の下を見ればわかる