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=sh4 --kernel=/home/hasebe/linux-2.4-wpa --ucc=sh4-linux-gcc

まあ適当。用があるのはcardmgr/のcardmgr, cardctl これをwapr01:/sbinにコピー

WPAR01の現状

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
# cardmgr -vf
cardmgr[524]: watching 1 socket
cardmgr[524]: starting, version is 3.2.8
cardmgr[524]: incs: unable to map card memory!
cs: unable to map card memory!
itializing socket 0
cardmgr[524]: unsupported card in socket 0
cardmgr[524]:   no product info available

Yenta改造

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

#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

だ。


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