Pcmcia
#navi(contents-page-name): No such page: WpaCONTENTS
REFERENCES
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にコピー
b | w | l |
8bit | 16bit | 32bit |
# 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)
printk(KERN_INFO "PCI: Enabling device %s (%04x -> %04x)\n", dev->name, old_cmd, cmd);
が出してる。
Yenta IRQ list 0000, PCI irq8
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
レジスタアドレス定数を上書き定義。
#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.
- Default to 11, 10, 9, 7, 6, 5, 4, 3.
だって。
static u32 isa_interrupts = 0x0ef8;
という変数が定義されている。
HEX: 0ef8 -> BIN: 111011111000
より
1 | 1 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 |
11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
だな。 8をmaskしてほしくないので
1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 |
11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
としよう。
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
だ。