[Driver module について] ●HT2020ドライバー (ht2020.tgz) 梅澤無線電機株式会社製Opt-Isolatedボード向けのArmadillo用ドライバーです。 一般的なキャラクタデバイスドライバとなっています。 sourceディレクトリ化の「ht2020_sample.tgz」が使用例となるサンプルコードと なっていますので、併せてご参照下さい。 ●HT3060ドライバー (ht3060-xxx.tgz) 梅澤無線電機株式会社製Ethernet 10BaseT I/Fボード向けの Armadillo用ドライバーです。 いわゆるNE2000互換とされるEthernet対応のドライバーとなっています。 ※2004/06/08追記 新たに、RTL8019ASなどNE2000系16bitチップ搭載ボードの 8bit接続に対応しました。 CQ出版社「インターフェース 2002年11月号」および 同社「TECH I Vol.18 ARMプロセッサ入門」掲載記事  「ARM720T搭載PC/104バス対応 CPUボード活用法」時点より加えた変更点は、 以下のとおりです。 [8390.h] clps711x系では8bitIO連続リード/ライトマクロreadsbおよびwritesbに 非対応であるため、inline関数内でのループ処理に置き換えます。 (12行目〜) ----------------------------------------------------------------------------- #include #include +#ifdef CONFIG_ARCH_ARMADILLO +#undef outb +#define outb(v,p) __raw_writeb(v,__io(ISAIO8_BASE+p)) +#undef inb +#define inb(p) __raw_readb(__io(ISAIO8_BASE+p)) +#undef outsb +//#define outsb(p,d,l) __raw_writesb(__io(ISAIO8_BASE+p),d,l) +static inline void outsb(int p, const void *d, int l) +{ + int i; + for (i = 0; i < l; i++) { + outb(*((const unsigned char *)d + i), p); + } +} +#undef outsw +#define outsw(p,d,l) __raw_writesw(__io(ISAIO16_BASE+p),d,l) +#undef insb +//#define insb(p,d,l) __raw_readsb(__io(ISAIO8_BASE+p),d,l) +static inline void insb(int p, void *d, int l) +{ + int i; + for (i = 0; i < l; i++) { + *((unsigned char *)d + i) = inb(p); + } +} +#undef insw +#define insw(p,d,l) __raw_readsw(__io(ISAIO16_BASE+p),d,l) + #define TX_2X_PAGES 12 #define TX_1X_PAGES 6 ----------------------------------------------------------------------------- [ne.c] 16bitチップに対するデータポート8bitアクセスを実現するために、 新たなチップID認識(SA_prom[14]及びSA_prom[15]がともに0x42)を追加、 ローカル変数iowordlengthを用意して、 チップのバス幅と実際にアクセスするバス幅を別管理します。 (233行目〜) ----------------------------------------------------------------------------- int i; unsigned char SA_prom[32]; int wordlength = 2; + int iowordlength = 2; const char *name = NULL; int start_page, stop_page; int neX000, ctron, copam, bad_card; ----------------------------------------------------------------------------- (342行目〜) ----------------------------------------------------------------------------- start_page = NESM_START_PG; stop_page = NESM_STOP_PG; } else { + iowordlength = 1; start_page = NE1SM_START_PG; stop_page = NE1SM_STOP_PG; } ----------------------------------------------------------------------------- (349行目〜) ----------------------------------------------------------------------------- neX000 = (SA_prom[14] == 0x57 && SA_prom[15] == 0x57); ctron = (SA_prom[0] == 0x00 && SA_prom[1] == 0x00 && SA_prom[2] == 0x1d); copam = (SA_prom[14] == 0x49 && SA_prom[15] == 0x00); + if (wordlength == 2 && SA_prom[14] == 0x42 && SA_prom[15] == 0x42) { + iowordlength = 1; + neX000 = 1; + } /* Set up the rest of the parameters. */ if (neX000 || bad_card || copam) { ----------------------------------------------------------------------------- (446行目〜) ----------------------------------------------------------------------------- ei_status.name = name; ei_status.tx_start_page = start_page; ei_status.stop_page = stop_page; - ei_status.word16 = (wordlength == 2); + ei_status.word16 = (iowordlength == 2); ei_status.rx_start_page = start_page + TX_PAGES; #ifdef PACKETBUF_MEMSIZE -----------------------------------------------------------------------------