123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234 |
- #ifndef _NS87308_H_
- #define _NS87308_H_
- #include <asm/pci_io.h>
- void initialise_ns87308(void);
- struct GPIO
- {
- unsigned char dta1;
- unsigned char dir1;
- unsigned char out1;
- unsigned char puc1;
- unsigned char dta2;
- unsigned char dir2;
- unsigned char out2;
- unsigned char puc2;
- };
- #define PWM_FER1 0
- #define PWM_FER2 1
- #define PWM_PMC1 2
- #define PWM_PMC2 3
- #define PWM_PMC3 4
- #define PWM_WDTO 5
- #define PWM_WDCF 6
- #define PWM_WDST 7
- #define IO_INDEX_OFFSET_0x 0x0279
- #define IO_INDEX_OFFSET_10 0x015C
- #define IO_INDEX_OFFSET_11 0x002E
- #define IO_DATA_OFFSET_0x 0x0A79
- #define IO_DATA_OFFSET_10 0x015D
- #define IO_DATA_OFFSET_11 0x002F
- #if defined(CONFIG_SYS_NS87308_BADDR_0x)
- #define IO_INDEX (CONFIG_SYS_ISA_IO + IO_INDEX_OFFSET_0x)
- #define IO_DATA (CONFIG_SYS_ISA_IO + IO_DATA_OFFSET_0x)
- #elif defined(CONFIG_SYS_NS87308_BADDR_10)
- #define IO_INDEX (CONFIG_SYS_ISA_IO + IO_INDEX_OFFSET_10)
- #define IO_DATA (CONFIG_SYS_ISA_IO + IO_DATA_OFFSET_10)
- #elif defined(CONFIG_SYS_NS87308_BADDR_11)
- #define IO_INDEX (CONFIG_SYS_ISA_IO + IO_INDEX_OFFSET_11)
- #define IO_DATA (CONFIG_SYS_ISA_IO + IO_DATA_OFFSET_11)
- #endif
- #define SET_RD_DATA_PORT 0x00
- #define SERIAL_ISOLATION 0x01
- #define CONFIG_CONTROL 0x02
- #define WAKE_CSN 0x03
- #define RES_DATA 0x04
- #define STATUS 0x05
- #define SET_CSN 0x06
- #define LOGICAL_DEVICE 0x07
- #define SID_REG 0x20
- #define SUPOERIO_CONF1 0x21
- #define SUPOERIO_CONF2 0x22
- #define PGCS_INDEX 0x23
- #define PGCS_DATA 0x24
- #define ACTIVATE 0x30
- #define ACTIVATE_OFF 0x00
- #define ACTIVATE_ON 0x01
- #define BASE_ADDR_HIGH 0x60
- #define BASE_ADDR_LOW 0x61
- #define LUN_CONFIG_REG 0xF0
- #define DBASE_HIGH 0x60
- #define DBASE_LOW 0x61
- #define CBASE_HIGH 0x62
- #define CBASE_LOW 0x63
- #define LDEV_KBC1 0x00
- #define LDEV_KBC2 0x01
- #define LDEV_MOUSE 0x01
- #define LDEV_RTC_APC 0x02
- #define LDEV_FDC 0x03
- #define LDEV_PARP 0x04
- #define LDEV_UART2 0x05
- #define LDEV_UART1 0x06
- #define LDEV_GPIO 0x07
- #define LDEV_POWRMAN 0x08
- #define CONFIG_SYS_NS87308_KBC1 (1 << LDEV_KBC1)
- #define CONFIG_SYS_NS87308_KBC2 (1 << LDEV_KBC2)
- #define CONFIG_SYS_NS87308_MOUSE (1 << LDEV_MOUSE)
- #define CONFIG_SYS_NS87308_RTC_APC (1 << LDEV_RTC_APC)
- #define CONFIG_SYS_NS87308_FDC (1 << LDEV_FDC)
- #define CONFIG_SYS_NS87308_PARP (1 << LDEV_PARP)
- #define CONFIG_SYS_NS87308_UART2 (1 << LDEV_UART2)
- #define CONFIG_SYS_NS87308_UART1 (1 << LDEV_UART1)
- #define CONFIG_SYS_NS87308_GPIO (1 << LDEV_GPIO)
- #define CONFIG_SYS_NS87308_POWRMAN (1 << LDEV_POWRMAN)
- static inline void read_pnp_config(unsigned char index, unsigned char *data)
- {
- pci_writeb(index,IO_INDEX);
- pci_readb(IO_DATA, *data);
- }
- static inline void write_pnp_config(unsigned char index, unsigned char data)
- {
- pci_writeb(index,IO_INDEX);
- pci_writeb(data, IO_DATA);
- }
- static inline void pnp_set_device(unsigned char dev)
- {
- write_pnp_config(LOGICAL_DEVICE, dev);
- }
- static inline void write_pm_reg(unsigned short base, unsigned char index, unsigned char data)
- {
- pci_writeb(index, CONFIG_SYS_ISA_IO + base);
- eieio();
- pci_writeb(data, CONFIG_SYS_ISA_IO + base + 1);
- }
- #define PNP_SET_DEVICE_BASE(dev,base) \
- pnp_set_device(dev); \
- write_pnp_config(ACTIVATE, ACTIVATE_OFF); \
- write_pnp_config(BASE_ADDR_HIGH, ((base) >> 8) & 0xff ); \
- write_pnp_config(BASE_ADDR_LOW, (base) &0xff); \
- write_pnp_config(ACTIVATE, ACTIVATE_ON);
- #define PNP_ACTIVATE_DEVICE(dev) \
- pnp_set_device(dev); \
- write_pnp_config(ACTIVATE, ACTIVATE_ON);
- #define PNP_DEACTIVATE_DEVICE(dev) \
- pnp_set_device(dev); \
- write_pnp_config(ACTIVATE, ACTIVATE_OFF);
- static inline void write_pgcs_config(unsigned char index, unsigned char data)
- {
- write_pnp_config(PGCS_INDEX, index);
- write_pnp_config(PGCS_DATA, data);
- }
- #define PGCS_CS_ASSERT_ON_WRITE 0x10
- #define PGCS_CS_ASSERT_ON_READ 0x20
- #define PNP_PGCS_CSLINE_BASE(cs, base) \
- write_pgcs_config((cs) << 2, ((base) >> 8) & 0xff ); \
- write_pgcs_config(((cs) << 2) + 1, (base) & 0xff );
- #define PNP_PGCS_CSLINE_CONF(cs, conf) \
- write_pgcs_config(((cs) << 2) + 2, (conf) );
- #define MCR_MDSL_MSK 0xe0
- #define MCR_MDSL_UART 0x00
- #define MCR_MDSL_SHRPIR 0x02
- #define MCR_MDSL_SIR 0x03
- #define MCR_MDSL_CIR 0x06
- #define FCR_TXFTH0 0x10
- #define FCR_TXFTH1 0x20
- #ifndef CONFIG_SYS_NS87308_KBC1_BASE
- #define CONFIG_SYS_NS87308_KBC1_BASE 0x0060
- #endif
- #ifndef CONFIG_SYS_NS87308_RTC_BASE
- #define CONFIG_SYS_NS87308_RTC_BASE 0x0070
- #endif
- #ifndef CONFIG_SYS_NS87308_FDC_BASE
- #define CONFIG_SYS_NS87308_FDC_BASE 0x03F0
- #endif
- #ifndef CONFIG_SYS_NS87308_LPT_BASE
- #define CONFIG_SYS_NS87308_LPT_BASE 0x0278
- #endif
- #ifndef CONFIG_SYS_NS87308_UART1_BASE
- #define CONFIG_SYS_NS87308_UART1_BASE 0x03F8
- #endif
- #ifndef CONFIG_SYS_NS87308_UART2_BASE
- #define CONFIG_SYS_NS87308_UART2_BASE 0x02F8
- #endif
- #endif
|