PCMCIA

#navi(contents-page-name): No such page: Wpa

CONTENTS


REFERENCES


WPAR01 Board でPCMCIA I/Fを動かす。

勉強

実験

pcmcia-cs-3.x.x.tar.gzを入手

./Configure --arch=sh --ucc=sh4-linux-gcc

まあ適当。用があるのはcardmgr/の

さらにetc/pcmcia以下をターゲットにコピー

# cat /proc/iomem
fd001000-fd001fff : PCI device 16f4:8000
fd002000-fd002fff : PCI device 16f4:8000
fd020000-fd03ffff : PCI device 16f4:8000
fd020000-fd03ffff : vw2010_0
fd100000-fd100fff : Texas Instruments PCI1510 PC card Cardbus Controller
fd400000-fd7fffff : PCI CardBus #01
fd800000-fdbfffff : PCI CardBus #01
# cat /proc/ioports
00004000-000040ff : PCI CardBus #01
00004400-000044ff : PCI CardBus #01
fe2001c0-fe2001c7 : PCI conf1
setup_arch : TI PCI1510 detect .

arch/sh/kernel/setup_wpar01.c

printk("setup_arch : TI PCI1510 detect .\n");

が出している。

PCI: Enabling device Texas Instruments PCI1510 PC card Cardbus Controller (0000 -> 0002)

arch/sh/kernel/pcibios.c

printk(KERN_INFO "PCI: Enabling device %s (%04x -> %04x)\n", dev->name, old_cmd, cmd);

が出してる。

Yenta IRQ list 0000, PCI irq8

drivers/pcmcia/yenta.c

printk("Yenta IRQ list %04x, PCI irq%d\n", socket->cap.irq_mask, socket->cb_irq);

が出している。

# cardctl status
Socket 0:
  5V 16-bit PC Card
  function 0: [ready], [wp]
# cardctl config
Socket 0:
  Vcc 5.0V  Vpp1 5.0V  Vpp2 5.0V
# cardctl ident
Socket 0:
cs: unable to map card memory!
cs: unable to map card memory!
  no prodcs: unable to map card memory!
cs: unable to map card memory!
cs: unable to map card memory!
cs: unable to map card memory!
uct info available

レジスタアドレス定数を上書き定義。

#if defined(CONFIG_SH_WPAR01)
#define PCI_CB_SYSTEM_CONTROL   0x80    /* System Control Register */
#define PCI_CB_MULTIFUNCTION    0x8c    /* Multifunction Routing Register */
#define PCI_CB_RETRY_STATUS     0x90    /* Retry Status Register */
#define PCI_CB_CARD_CONTROL     0x91    /* Card Control Register */
#define PCI_CB_DEVICE_CONTROL   0x92    /* Device Control Register */
#define PCI_CB_DIAGNOSTIC       0x93    /* Diagnostic Register */
#endif

懸念のIRQ8ですが,

Only probe "regular" interrupts, don't touch dangerous spots like the mouse irq, because there are mice that apparently get really confused if they get fondled too intimately.

だって。

static u32 isa_interrupts = 0x0ef8;

という変数が定義されている。

HEX: 0ef8 -> BIN: 111011111000

より

111011111000
11109876543210

だな。 8をmaskしてほしくないので

111111111000
11109876543210

としよう。

BIN: 111111111000 -> HEX: ff8

だから

static u32 isa_interrupts = 0x0ff8;

ということで。

yenta_config_initがかなりちがうなあ。 bridgeing stateの設定に追加処理をやってる。

#if defined(CONFIG_SH_WPAR01)
        exca_writeb(socket, I365_GBLCTL, I365_GBL_CSC_LEV | I365_GBL_IRQ_0_LEV);
        exca_writeb(socket, I365_INTCTL, I365_INTR_ENA);
#else
        exca_writeb(socket, I365_GBLCTL, 0x00);
#endif
        exca_writeb(socket, I365_GENCTL, 0x00);

        /* Redo card voltage interrogation */
        cb_writel(socket, CB_SOCKET_FORCE, CB_CVSTEST);

#if defined(CONFIG_SH_WPAR01)
        config_writel(socket, PCI_CB_SYSTEM_CONTROL, 0x28449060);
        config_writeb(socket, PCI_CB_RETRY_STATUS, 0x00);
        config_writeb(socket, PCI_CB_DEVICE_CONTROL, 0x62);
        config_writeb(socket, PCI_CB_DIAGNOSTIC, 0x40);
        config_writel(socket, PCI_CB_MULTIFUNCTION, 0x00001002);
#endif

Different cardbus controllers have slightly different initialization sequences etc details. List them here..

とおっしゃってるので

       { PD(TI,1510),  &ti_ops },

を挿入しておく。

PCI_DEVICE_ID_TI_1510を include/linux/pci_ids.h で定義しないといけない。 気前よく

#define PCI_DEVICE_ID_TI_1510		0xac56
#define PCI_DEVICE_ID_TI_1520		0xac55

だ。

SHなのでioportもiomemoryも当然ちがう。

/etc/pcmcia/config.opts

include port 0x000-0x0ff, port 0x400-0x4ff
include memory 0xfd000000-0xfdffffff

で。

# cardctl status
Socket 0:
  5V 16-bit PC Card
  function 0: [ready]
# cardctl config
Socket 0:
  Vcc 5.0V  Vpp1 0.0V  Vpp2 0.0V
  interface type is "memory and I/O"
  irq 8 [exclusive] [level]
  function 0:
    config base 0x0400
      option 0x60 status 0x00 copy 0x00
    io 0x0400-0x041f [auto]
# cardctl ident
Socket 0:
  product info: "corega", "FEther PCC-TXF"
  manfid: 0xc00f, 0x0000
  function: 6 (network)

ks29xx-linux

/etc/pcmcia/config

device "ks29xx_cs"
  class "network" module "net/ks29xx", "ks29xx_cs"

まああとはCVSでもみてください。で,

# cardctl status
 Socket 0:
  3.3V 16-bit PC Card
  function 0: [ready], [bat dead], [bat low]
# cardctl config
Socket 0:
  Vcc 3.3V  Vpp1 0.0V  Vpp2 0.0V
  interface type is "memory and I/O"
  irq 8 [exclusive] [level]
  function 0:
    config base 0x0200
      option 0x45 status 0x00 pin 0x00 copy 0x00 ext 0x00
    io 0x0400-0x043f [16bit]
# cardctl ident
Socket 0:
  product info: "KeyStream Corp.", "KS2970", "", ""
  manfid: 0x005b, 0xf002
  function: 6 (network)
# cardctl info
PRODID_1="KeyStream Corp."
PRODID_2="KS2970"
PRODID_3=""
PRODID_4=""
MANFID=005b,f002
FUNCID=6
# ifconfig eth0 192.168.103.98

すると,Dell INSPIRON 700m内蔵11b WLAN経由でsloginできました。

結局

  1. cardmgr copy
  2. pcmcia service 用設定ファイルのcopy
  3. module copy

トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS