Path: blob/master/arch/sh/include/mach-se/mach/mrshpc.h
15160 views
#ifndef __MACH_SE_MRSHPC_H1#define __MACH_SE_MRSHPC_H23#include <linux/io.h>45static inline void __init mrshpc_setup_windows(void)6{7if ((__raw_readw(MRSHPC_CSR) & 0x000c) != 0)8return; /* Not detected */910if ((__raw_readw(MRSHPC_CSR) & 0x0080) == 0) {11__raw_writew(0x0674, MRSHPC_CPWCR); /* Card Vcc is 3.3v? */12} else {13__raw_writew(0x0678, MRSHPC_CPWCR); /* Card Vcc is 5V */14}1516/*17* PC-Card window open18* flag == COMMON/ATTRIBUTE/IO19*/20/* common window open */21__raw_writew(0x8a84, MRSHPC_MW0CR1);22if((__raw_readw(MRSHPC_CSR) & 0x4000) != 0)23/* common mode & bus width 16bit SWAP = 1*/24__raw_writew(0x0b00, MRSHPC_MW0CR2);25else26/* common mode & bus width 16bit SWAP = 0*/27__raw_writew(0x0300, MRSHPC_MW0CR2);2829/* attribute window open */30__raw_writew(0x8a85, MRSHPC_MW1CR1);31if ((__raw_readw(MRSHPC_CSR) & 0x4000) != 0)32/* attribute mode & bus width 16bit SWAP = 1*/33__raw_writew(0x0a00, MRSHPC_MW1CR2);34else35/* attribute mode & bus width 16bit SWAP = 0*/36__raw_writew(0x0200, MRSHPC_MW1CR2);3738/* I/O window open */39__raw_writew(0x8a86, MRSHPC_IOWCR1);40__raw_writew(0x0008, MRSHPC_CDCR); /* I/O card mode */41if ((__raw_readw(MRSHPC_CSR) & 0x4000) != 0)42__raw_writew(0x0a00, MRSHPC_IOWCR2); /* bus width 16bit SWAP = 1*/43else44__raw_writew(0x0200, MRSHPC_IOWCR2); /* bus width 16bit SWAP = 0*/4546__raw_writew(0x2000, MRSHPC_ICR);47__raw_writeb(0x00, PA_MRSHPC_MW2 + 0x206);48__raw_writeb(0x42, PA_MRSHPC_MW2 + 0x200);49}5051#endif /* __MACH_SE_MRSHPC_H */525354