VIAのデュアルコア Nano X2 U4025搭載 ZBOX nano VD01 (4)
さて、ZBOX nano VD01の起動しない問題、続々々編です。
前回の時点で、panic処理に至るまでの挙動がぼんやりとつかめましたが、いかんせん先が見えない状況になってしまいました。
手がかりをつかむため、kernelのconfigにDEBUGを追加して様子を見ることにしました。今思うと、最初に追加すべきoptionsだったような。
先のメッセージを出している部分は564行目です。pci_modeを判定するためにレジスタへの書き込みと読み込みを行い、読み込み結果が正しければpci_modeが1になり、そうでなければ567行目のgoto文のnot1というラベル名からもわかるとおりpci_modeは1じゃない処理に進みます。
pci_modeが1だろうと2だろうと、正しく動けばどっちでもいいなと思いながらも、なんとなく引っかかります。
また、mode 1とmode 2のコメントを見比べてみると、mode 1はがっちりチェック、mode 2はテキトーチェック、という風に読めます。
そもそも、2011年後半に発売されたマシンでmode 2っていうのがそもそもおかしくって、mode 1で動くべきなんじゃないのと。というより、ハードウェアとしてはmode 1で動いているつもりなんじゃないのかなと。
そう考えると、pci_make_tagでdeviceが16未満チェックに引っかかってpanicしているのも辻褄が合います。pci_make_tagのmode 1のチェックはdeviceに対して16未満チェックよりも広い32未満でチェックしています。
じゃぁ、強制的にmode 1で動作させてみたらどうだろう、ということで567行目のgoto not1;をコメントアウトしてみました。
どうやら、ビンゴのようです。一気にマルチユーザで起動しました。記念のdmesgを貼付けておきます。options DEBUGをつけているので冗長ですね。
前回の時点で、panic処理に至るまでの挙動がぼんやりとつかめましたが、いかんせん先が見えない状況になってしまいました。
手がかりをつかむため、kernelのconfigにDEBUGを追加して様子を見ることにしました。今思うと、最初に追加すべきoptionsだったような。
options DEBUG # expensive debugging checks/supportすると、panicする前に次のようなメッセージが追加されました。
pci_mode_detect: mode 1 enable failed (0)pci_mode_detectはsys/arch/x86/pci/pci_machdep.cにある関数で、pci_modeを判断する役割を担っているようです。
先のメッセージを出している部分は564行目です。pci_modeを判定するためにレジスタへの書き込みと読み込みを行い、読み込み結果が正しければpci_modeが1になり、そうでなければ567行目のgoto文のnot1というラベル名からもわかるとおりpci_modeは1じゃない処理に進みます。
518 pci_mode_detect(void) 519 { 中略 553 /* 554 * Strong check for standard compliant mode 1: 555 * 1. bit 31 ("enable") can be set 556 * 2. byte/word access does not affect register 557 */ 558 outl(PCI_MODE1_ADDRESS_REG, PCI_MODE1_ENABLE); 559 outb(PCI_MODE1_ADDRESS_REG + 3, 0); 560 outw(PCI_MODE1_ADDRESS_REG + 2, 0); 561 val = inl(PCI_MODE1_ADDRESS_REG); 562 if ((val & 0x80fffffc) != PCI_MODE1_ENABLE) { 563 #ifdef DEBUG 564 printf("pci_mode_detect: mode 1 enable failed (%x)\n", 565 val); 566 #endif 567 goto not1; 568 } 中略 593 }そういえば、pci_make_tagでもswich文でpci_modeを判別していました。たしかにpci_modeが2で動作して(そしてpanicして)いるみたいですね。
pci_modeが1だろうと2だろうと、正しく動けばどっちでもいいなと思いながらも、なんとなく引っかかります。
また、mode 1とmode 2のコメントを見比べてみると、mode 1はがっちりチェック、mode 2はテキトーチェック、という風に読めます。
553 /* 554 * Strong check for standard compliant mode 1: 555 * 1. bit 31 ("enable") can be set 556 * 2. byte/word access does not affect register 557 */ 577 /* 578 * This mode 2 check is quite weak (and known to give false 579 * positives on some Compaq machines). 580 * However, this doesn't matter, because this is the 581 * last test, and simply no PCI devices will be found if 582 * this happens. 583 */コメントから読み取れるのチェックの力の入れっぷりと、最初にmode 1を試して、ダメならしぶしぶmode 2を試すというfallbackっぽいロジックになっていることから、pci_modeはフツーmode 1であるべきで、まれなケースでmode 2ということなんじゃないかと。
そもそも、2011年後半に発売されたマシンでmode 2っていうのがそもそもおかしくって、mode 1で動くべきなんじゃないのと。というより、ハードウェアとしてはmode 1で動いているつもりなんじゃないのかなと。
そう考えると、pci_make_tagでdeviceが16未満チェックに引っかかってpanicしているのも辻褄が合います。pci_make_tagのmode 1のチェックはdeviceに対して16未満チェックよりも広い32未満でチェックしています。
じゃぁ、強制的にmode 1で動作させてみたらどうだろう、ということで567行目のgoto not1;をコメントアウトしてみました。
どうやら、ビンゴのようです。一気にマルチユーザで起動しました。記念のdmesgを貼付けておきます。options DEBUGをつけているので冗長ですね。
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 The NetBSD Foundation, Inc. All rights reserved. Copyright (c) 1982, 1986, 1989, 1991, 1993 The Regents of the University of California. All rights reserved. NetBSD 5.99.59 (ZBOX) #14: Sat Jan 21 04:44:23 UTC 2012 root@ideapad:/usr/home/tokuda/tmp/201112290510Z/source/usr/src/sys/arch/i386/compile/obj/ZBOX total memory = 3327 MB avail memory = 3259 MB timecounter: Timecounters tick every 10.000 msec timecounter: Timecounter "i8254" frequency 1193182 Hz quality 100 To Be Filled By O.E.M. To Be Filled By O.E.M. (To Be Filled By O.E.M.) mainbus0 (root) pci_mode_detect: mode 1 enable failed (0) pci_mode_detect: mode1 force enable Parsing all Control Methods: Table [DSDT](id 0001) - 739 Objects with 71 Devices 179 Methods 48 Regions Parsing all Control Methods: Table [SSDT](id 0002) - 37 Objects with 0 Devices 23 Methods 0 Regions tbxface-0560 [02] TbLoadNamespace : ACPI Tables successfully acquired evxfevnt-0102 [02] Enable : Transition to ACPI mode successful cpu0 at mainbus0 apid 0: VIA Nano X2 U4025 @ 1.2 GHz, id 0x6fc cpu1 at mainbus0 apid 2: VIA Nano X2 U4025 @ 1.2 GHz, id 0x6fc ioapic0 at mainbus0 apid 3: pa 0xfec00000, version 3, 24 pins ioapic1 at mainbus0 apid 4: pa 0xfecc0000, version 3, 24 pins acpi0 at mainbus0: Intel ACPICA 20110623 acpi0: X/RSDT: OemId <083011,XSDT0920,20110830>, AslId <MSFT,00000097> evxfevnt-0088 [02] Enable : System is already in ACPI mode evgpeblk-0449 [-2] EvCreateGpeBlock : GPE 00 to 0F [_GPE] 2 regs on int 0x9 evgpeblk-0449 [-2] EvCreateGpeBlock : GPE 10 to 1F [_GPE] 2 regs on int 0x9 nseval-0454 [-3] NsExecModuleCode : Executed module-level code at 0xce0225ec Completing Region/Field/Buffer/Package initialization:.............................................................................................................................................. Initialized 38/48 Regions 44/44 Fields 32/32 Buffers 28/38 Packages (787 nodes) Initializing Device/Processor/Thermal objects by executing _INI methods:. Executed 1 _INI methods requiring 0 _STA executions (examined 77 objects) acpi0: SCI interrupting at int 9 timecounter: Timecounter "ACPI-Fast" frequency 3579545 Hz quality 1000 hpet0 at acpi0: high precision event timer (mem 0xfed00000-0xfed00400) timecounter: Timecounter "hpet0" frequency 14318180 Hz quality 2000 NBPE (PNP0C01) at acpi0 not configured acpivga0 at acpi0 (VUMA): ACPI Display Adapter acpiout0 at acpivga0 (CRT, 0x0100): ACPI Display Output Device acpiout1 at acpivga0 (LCD, 0x0110): ACPI Display Output Device acpiout1: brightness levels: 20 30 40 50 60 80 90 100 acpiout2 at acpivga0 (TV, 0x0200): ACPI Display Output Device acpiout3 at acpivga0 (DVI, 0x0120): ACPI Display Output Device acpivga0: connected output devices: acpivga0: 0x0100 (acpiout0): Ext. Monitor, head 0, bios detect acpivga0: 0x0110 (acpiout1): LCD Panel, head 0, bios detect acpivga0: 0x0120 (acpiout3): Unknown Output Device, head 0, bios detect acpivga0: 0x0200 (acpiout2): TV, head 0, bios detect acpiacad0 at acpi0 (ACDP, ACPI0003): ACPI AC Adapter attimer1 at acpi0 (TMR, PNP0100): io 0x40-0x43 pcppi1 at acpi0 (SPKR, PNP0800): io 0x61 midi0 at pcppi1: PC speaker sysbeep0 at pcppi1 npx1 at acpi0 (COPR, PNP0C04): io 0xf0-0xff irq 13 npx1: reported by CPUID; using exception 16 CIR (ITE8704) at acpi0 not configured SIOR (PNP0C02) at acpi0 not configured RMSC (PNP0C02) at acpi0 not configured OMSC (PNP0C02) at acpi0 not configured PCIE (PNP0C02) at acpi0 not configured acpibut0 at acpi0 (SLPB, PNP0C0E): ACPI Sleep Button RMEM (PNP0C01) at acpi0 not configured acpibut1 at acpi0 (PWRB, PNP0C0C-170): ACPI Power Button apm0 at acpi0: Power Management spec V1.2 evgpeblk-0541 [-3] EvInitializeGpeBlock : Enabled 3 GPEs in this block attimer1: attached to pcppi1 pci0 at mainbus0 bus 0: configuration mode 1 pci0: i/o space, memory space enabled, rd/line, rd/mult, wr/inv ok pchb0 at pci0 dev 0 function 0: vendor 0x1106 product 0x0410 (rev. 0x80) pchb1 at pci0 dev 0 function 1: vendor 0x1106 product 0x1410 (rev. 0x00) pchb2 at pci0 dev 0 function 2: vendor 0x1106 product 0x2410 (rev. 0x00) pchb3 at pci0 dev 0 function 3: vendor 0x1106 product 0x3410 (rev. 0x00) pchb4 at pci0 dev 0 function 4: vendor 0x1106 product 0x4410 (rev. 0x00) pchb5 at pci0 dev 0 function 5: vendor 0x1106 product 0x5410 (rev. 0x00) pchb6 at pci0 dev 0 function 6: vendor 0x1106 product 0x6410 (rev. 0x00) pchb7 at pci0 dev 0 function 7: vendor 0x1106 product 0x7410 (rev. 0x00) vga1 at pci0 dev 1 function 0: vendor 0x1106 product 0x7122 (rev. 0x00) wsdisplay0 at vga1 kbdmux 1: console (80x25, vt100 emulation) wsmux1: connecting to wsdisplay0 drm at vga1 not configured hdaudio0 at pci0 dev 1 function 1: HD Audio Controller hdaudio0: interrupting at ioapic1 pin 17 hdafg0 at hdaudio0: VIA product 9f80 hdafg0: HDMI00 2ch: Digital Out [Jack] hdafg0: 2ch/0ch 32000Hz 44100Hz 48000Hz PCM16 PCM24 AC3 ppb0 at pci0 dev 3 function 0: vendor 0x1106 product 0xa410 (rev. 0x00) ppb0: PCI Express 2.0 <Root Port of PCI-E Root Complex> pci1 at ppb0 bus 1 pci1: i/o space, memory space enabled, rd/line, wr/inv ok ppb1 at pci0 dev 3 function 1: vendor 0x1106 product 0xb410 (rev. 0x00) ppb1: PCI Express 2.0 <Root Port of PCI-E Root Complex> pci2 at ppb1 bus 2 pci2: i/o space, memory space enabled, rd/line, wr/inv ok ath0 at pci2 dev 0 function 0: Atheros 9285 ath0: interrupting at ioapic1 pin 4 ath0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps ath0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps ath0: mac 192.2 phy 14.0 radio 12.0 ppb2 at pci0 dev 3 function 2: vendor 0x1106 product 0xc410 (rev. 0x00) ppb2: PCI Express 2.0 <Root Port of PCI-E Root Complex> pci3 at ppb2 bus 3 pci3: i/o space, memory space enabled, rd/line, wr/inv ok vge0 at pci3 dev 0 function 0: VIA VT612X Gigabit Ethernet (rev. 0x82) vge0: interrupting at ioapic1 pin 8 vge0: Ethernet address: ZZ:ZZ:ZZ:ZZ:ZZ:ZZ ukphy0 at vge0 phy 22: OUI 0x0009c3, model 0x0019, rev. 0 ukphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-FDX, auto ppb3 at pci0 dev 3 function 3: vendor 0x1106 product 0xd410 (rev. 0x00) ppb3: PCI Express 2.0 <Root Port of PCI-E Root Complex> pci4 at ppb3 bus 4 pci4: i/o space, memory space enabled, rd/line, wr/inv ok vendor 0x1106 product 0x3432 (USB serial bus, interface 0x30, revision 0x02) at pci4 dev 0 function 0 not configured pchb8 at pci0 dev 3 function 4: vendor 0x1106 product 0xe410 (rev. 0x00) pciide0 at pci0 dev 15 function 0: vendor 0x1106 product 0x9001 (rev. 0x00) pciide0: bus-master DMA support present, but unused (no driver support) pciide0: primary channel configured to native-PCI mode pciide0: using ioapic0 pin 21 for native-PCI interrupt atabus0 at pciide0 channel 0 pciide0: secondary channel configured to native-PCI mode atabus1 at pciide0 channel 1 uhci0 at pci0 dev 16 function 0: vendor 0x1106 product 0x3038 (rev. 0xa0) uhci0: interrupting at ioapic0 pin 20 usb0 at uhci0: USB revision 1.0 uhci1 at pci0 dev 16 function 1: vendor 0x1106 product 0x3038 (rev. 0xa0) uhci1: interrupting at ioapic0 pin 22 usb1 at uhci1: USB revision 1.0 uhci2 at pci0 dev 16 function 2: vendor 0x1106 product 0x3038 (rev. 0xa0) uhci2: interrupting at ioapic0 pin 21 usb2 at uhci2: USB revision 1.0 uhci3 at pci0 dev 16 function 3: vendor 0x1106 product 0x3038 (rev. 0xa0) uhci3: interrupting at ioapic0 pin 23 usb3 at uhci3: USB revision 1.0 ehci0 at pci0 dev 16 function 4: vendor 0x1106 product 0x3104 (rev. 0x90) ehci0: interrupting at ioapic0 pin 23 ehci0: dropped intr workaround enabled ehci0: EHCI version 1.0 ehci0: companion controllers, 2 ports each: uhci0 uhci1 uhci2 uhci3 usb4 at ehci0: USB revision 2.0 pcib0 at pci0 dev 17 function 0: vendor 0x1106 product 0x8410 (rev. 0x00) pchb9 at pci0 dev 17 function 7: vendor 0x1106 product 0xa353 (rev. 0x00) ppb4 at pci0 dev 19 function 0: vendor 0x1106 product 0xb353 (rev. 0x00) pci5 at ppb4 bus 5 pci5: i/o space, memory space enabled hdaudio1 at pci0 dev 20 function 0: HD Audio Controller hdaudio1: interrupting at ioapic0 pin 17 hdafg1 at hdaudio1: VIA VT1708S hdafg1: DAC00 2ch: Speaker [Jack], HP Out [Jack] hdafg1: ADC01 2ch: Mic In [Jack] hdafg1: 2ch/2ch 48000Hz PCM16* audio0 at hdafg1: full duplex, playback, capture, independent isa0 at pcib0 pckbc0 at isa0 port 0x60-0x64 acpicpu0 at cpu0: ACPI CPU acpicpu0: C1: FFH, lat 1 us, pow 1000 mW acpicpu0: P0: FFH, lat 20 us, pow 0 mW, 1200 MHz acpicpu0: P1: FFH, lat 20 us, pow 0 mW, 1067 MHz viac7temp0 at cpu0: VIA C7 temperature sensor acpicpu1 at cpu1: ACPI CPU viac7temp1 at cpu1: VIA C7 temperature sensor timecounter: Timecounter "clockinterrupt" frequency 100 Hz quality 0 acpiacad0: AC adapter online. wd0 at atabus0 drive 0 wd0: <WDC WD1600BEVT-24A23T0> wd0: drive supports 16-sector PIO transfers, LBA48 addressing wd0: 149 GB, 310101 cyl, 16 head, 63 sec, 512 bytes/sect x 312581808 sectors uhub0 at usb0: vendor 0x1106 UHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub0: 2 ports with 2 removable, self powered uhub1 at usb1: vendor 0x1106 UHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub1: 2 ports with 2 removable, self powered uhub2 at usb2: vendor 0x1106 UHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub2: 2 ports with 2 removable, self powered uhub3 at usb3: vendor 0x1106 UHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub3: 2 ports with 2 removable, self powered uhub4 at usb4: vendor 0x1106 EHCI root hub, class 9/0, rev 2.00/1.00, addr 1 uhub4: 8 ports with 8 removable, self powered wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 6 (Ultra/133) umass0 at uhub4 port 3 configuration 1 interface 0 umass0: Generic USB2.0-CRW, rev 2.00/38.82, addr 2 umass0: using SCSI over Bulk-Only scsibus0 at umass0: 2 targets, 1 lun per target sd0 at scsibus0 target 0 lun 0: <Generic-, Multi-Card, 1.00> disk removable ehci0: handing over full speed device on port 4 to uhci1 sd0: fabricating a geometry sd0: 15326 MB, 15326 cyl, 64 head, 32 sec, 512 bytes/sect x 31388672 sectors sd0: fabricating a geometry ehci0: handing over full speed device on port 7 to uhci3 Kernelized RAIDframe activated boot device: sd0 root on sd0a dumps on sd0b root file system type: ffs warning: no /dev/console uhub5 at uhub1 port 2: Chicony Generic USB Hub, class 9/0, rev 1.10/1.00, addr 2 uhub5: 3 ports with 2 removable, bus powered aubtfwl0 at uhub3 port 1 aubtfwl0: ath3k-1.fw open fail 2 uhidev0 at uhub5 port 1 configuration 1 interface 0 uhidev0: Chicony PFU-65 USB Keyboard, rev 1.10/1.00, addr 3, iclass 3/1 ukbd0 at uhidev0: 8 modifier keys, 6 key codes wskbd0 at ukbd0: console keyboard, using wsdisplay0uname -aの結果もついでに。#14ってことで14回もkernelコンパイルしたんですね。
sdhc16g# uname -a NetBSD sdhc16g 5.99.59 NetBSD 5.99.59 (ZBOX) #14: Sat Jan 21 04:44:23 UTC 2012 root@ideapad:/usr/home/tokuda/tmp/201112290510Z/source/usr/src/sys/arch/i386/compile/obj/ZBOX i386
コメント(0件)
- TB-URL http://www.tokuda.net/diary/0765/tb/