#include "opt_use_poll.h"
enum tx_chipset {
__TX391X,
__TX392X,
};
enum tx_attach_order {
ATTACH_FIRST = 3,
ATTACH_NORMAL = 2,
ATTACH_LAST = 1,
};
enum txio_group {
MFIO = 0,
IO,
BETTY,
SNOWBALL,
PLUM,
NTXIO_GROUP
};
struct hpcio_chip;
struct tx_chipset_tag {
enum tx_chipset tc_chipset;
void *tc_intrt;
void *tc_powert;
void *tc_clockt;
void *tc_soundt;
struct hpcio_chip *tc_iochip[NTXIO_GROUP];
void *tc_videot;
};
typedef struct tx_chipset_tag* tx_chipset_tag_t __attribute__((__unused__));
typedef u_int32_t txreg_t;
extern struct tx_chipset_tag tx_chipset;
#define tx_conf_get_tag() (&tx_chipset)
#if defined TX391X && defined TX392X
#define IS_TX391X(t) ((t)->tc_chipset == __TX391X)
#define IS_TX392X(t) ((t)->tc_chipset == __TX392X)
#elif defined TX391X
#define IS_TX391X(t) (1)
#define IS_TX392X(t) (0)
#elif defined TX392X
#define IS_TX391X(t) (0)
#define IS_TX392X(t) (1)
#endif
void tx_conf_register_intr(tx_chipset_tag_t, void *);
void tx_conf_register_power(tx_chipset_tag_t, void *);
void tx_conf_register_clock(tx_chipset_tag_t, void *);
void tx_conf_register_sound(tx_chipset_tag_t, void *);
void tx_conf_register_ioman(tx_chipset_tag_t, struct hpcio_chip *);
void tx_conf_register_video(tx_chipset_tag_t, void *);
#define TX39_SYSADDR_CONFIG_REG_KSEG1 0xb0c00000
#define tx_conf_read(t, reg) ( \
(*((volatile txreg_t *)(TX39_SYSADDR_CONFIG_REG_KSEG1 + (reg)))))
#define tx_conf_write(t, reg, val) ( \
(*((volatile txreg_t *)(TX39_SYSADDR_CONFIG_REG_KSEG1 + (reg))) \
= (val)))
struct txsimbus_attach_args {
char *tba_busname;
};
struct txsim_attach_args {
tx_chipset_tag_t ta_tc;
};
#define MAKEINTR(s, b) ((s) * 32 + (ffs(b) - 1))
void* tx_intr_establish(tx_chipset_tag_t, int, int, int, int (*)(void *),
void *);
void tx_intr_disestablish(tx_chipset_tag_t, void *);
#ifdef USE_POLL
void* tx39_poll_establish(tx_chipset_tag_t, int, int, int (*)(void *),
void *);
void tx39_poll_disestablish(tx_chipset_tag_t, void *);
#define POLL_CONT 0
#define POLL_END 1
#endif
u_int32_t tx_intr_status(tx_chipset_tag_t, int);
extern u_int32_t tx39intrvec;
void tx39power_suspend_cpu(void);
#define USE_HPC_DPRINTF
#define __DPRINTF_EXT