hns - 日記自動生成システム - Version 2.19.9

先月 2005年10月 来月
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31
Namazu for hns による簡易全文検索
詳しくは 詳細指定/ヘルプを参照して下さい
検索式:

2005年10月03日(月) 旧暦 [n年日記] [更新:"2005/10/13 19:15:48"]

#1 [NetBSD][if_tl.c] tl0: unable to map device registers

と言われることがあって、多分 src/sys/dev/pci/if_tl.c の中の pa->pa_flags が 0 なのが問題だというところまでは追いかけました。 で、それは何故かと調べていて、 src/sys/dev/pci/pci.c の中の、次の部分ですが、
289         /*
290          * Set up memory, I/O enable, and PCI command flags
291          * as appropriate. 
292          */
293         pa.pa_flags = sc->sc_flags;
294         printf("  ** (pci.c 294) sc->sc_flags(%x) csr(%x)\n", sc->sc_flags, csr);
295         if ((csr & PCI_COMMAND_IO_ENABLE) == 0)
296                 pa.pa_flags &= ~PCI_FLAGS_IO_ENABLED;
297         if ((csr & PCI_COMMAND_MEM_ENABLE) == 0)
298                 pa.pa_flags &= ~PCI_FLAGS_MEM_ENABLED;
299         printf("  ** (pci.c 299) pa.pa_flags(%x)\n", pa.pa_flags);
青い行は追加したもので、そのため行番号は原文よりも、数行ずれています。
pci1: i/o space, memory space enabled
  ** (pci.c 294) sc->sc_flags(3) csr(2800000)
  ** (pci.c 299) pa.pa_flags(0)
  ** (pci.c 307) pa.pa_flags(0)
 *** PCI_VENDOR(e11) , tv_vendor(e11)
このように 294 行目では 3 なのに、299 行目では 0 になっています。 それは csr の下位 2 bit が 0 であるためです。
pcireg.h:#define        PCI_COMMAND_IO_ENABLE                   0x00000001
pcireg.h:#define        PCI_COMMAND_MEM_ENABLE                  0x00000002
csr って ?
267         csr = pci_conf_read(pc, tag, PCI_COMMAND_STATUS_REG);
これか。きょうはここまで。 (以下翌朝追記) src/sys/dev/pci/pci.c:
267         csr = pci_conf_read(pc, tag, PCI_COMMAND_STATUS_REG);
ということなので、これはどこを呼んいるか探す:
src/sys/arch/macppc/pci/pci_machdep.c
162 pcireg_t
163 pci_conf_read(pc, tag, reg)
164         pci_chipset_tag_t pc;
165         pcitag_t tag;
166         int reg;
167 {
168
169         return (*pc->conf_read)(pc, tag, reg);
例えば bandit なら、src/sys/arch/macppc/pci/bandit.c で、
 72 bandit_attach(parent, self, aux)
    ...
102         pc->conf_read = bandit_conf_read;
しかし、src/sys/dev/pci/ppb.c の
 69 ppbattach(struct device *parent, struct device *self, void *aux)
には、そういう部分がない ..



最近の日記
2024年03月10日
停電 (瞬電)
2024年03月03日
the second try on bare-metal
useradd
2024年02月29日
opendkim and senmail
2024年01月24日
chat/iam 0.0.8
2024年01月21日
uselocale vs setlocale (textproc/R-readxl)
以上、1 日分です。
タイトル一覧
カテゴリ分類
Powered by hns-2.19.9, HyperNikkiSystem Project

Count.cgi (since 2000/02/05)