Transaction-Level Modeling Framework for Space Applications
Classes | |
struct | ehccoreregs |
struct | ehcauxregs |
struct | ehc_itd |
struct | ehc_qtd |
struct | ehc_qh |
struct | uhcregs |
struct | uhc_td |
struct | uhc_qh |
Macros | |
#define | byte_swap(x) |
#define | cond_bswap(x, be) (be ? (x) : byte_swap(x)) |
#define | hword_swap(x) ((((x) >> 16) & 0xffff) | ((x) << 16)) |
#define | EHC_USBCMD_ITHRES (0xff << 16) |
#define | EHC_USBCMD_ITHRES_P 16 |
#define | EHC_USBCMD_PMODE (1 << 11) |
#define | EHC_USBCMD_PMODECNT (3 << 8) |
#define | EHC_USBCMD_LHCRESET (1 << 7) |
#define | EHC_USBCMD_AS_ADV_INT (1 << 6) |
#define | EHC_USBCMD_AS_SCHED_EN (1 << 5) |
#define | EHC_USBCMD_PER_SCHED_EN (1 << 4) |
#define | EHC_USBCMD_FLSIZE (3 << 2) |
#define | EHC_USBCMD_HCRESET (1 << 1) |
#define | EHC_USBCMD_RUNSTOP (1 << 0) |
#define | EHC_USBSTS_ASSTAT (1 << 15) |
#define | EHC_USBSTS_PERSTAT (1 << 14) |
#define | EHC_USBSTS_RECL (1 << 13) |
#define | EHC_USBSTS_HCHALTED (1 << 12) |
#define | EHC_USBSTS_ASADV (1 << 5) |
#define | EHC_USBSTS_HSERR (1 << 4) |
#define | EHC_USBSTS_FLROLL (1 << 3) |
#define | EHC_USBSTS_PCHANGE_DETECT (1 << 2) |
#define | EHC_USBSTS_USBERRINT (1 << 1) |
#define | EHC_USBSTS_USBINT (1 << 0) |
#define | EHC_CONFIGFLAG_CF (1 << 0) |
#define | EHC_PORTSC_WKOC_E (1 << 22) |
#define | EHC_PORTSC_WKDSCNNT_E (1 << 21) |
#define | EHC_PORTSC_WKCNNT_E (1 << 20) |
#define | EHC_PORTSC_POWNER (1 << 13) |
#define | EHC_PORTSC_PP (1 << 12) |
#define | EHC_PORTSC_LS_P 10 |
#define | EHC_PORTSC_PRESET (1 << 8) |
#define | EHC_PORTSC_PSUSPEND (1 << 7) |
#define | EHC_PORTSC_PRESUME (1 << 6) |
#define | EHC_PORTSC_OC_CHANGE (1 << 5) |
#define | EHC_PORTSC_OC_ACTIVE (1 << 4) |
#define | EHC_PORTSC_PEN_CHANGE (1 << 3) |
#define | EHC_PORTSC_PEN (1 << 2) |
#define | EHC_PORTSC_CNNTSTAT_CHANGE (1 << 1) |
#define | EHC_PORTSC_CNNTSTAT (1 << 0) |
#define | EHC_JSTATE 0x2 |
#define | EHC_AUXREGS_OFF 0x54 |
#define | EHC_USBCMD_RESVAL(aspm) (aspm ? 0x00080b00 : 0x00080000) |
#define | EHC_USBSTS_RESVAL 0x00001000 |
#define | EHC_USBINTR_RESVAL 0x00000000 |
#define | EHC_FRINDEX_RESVAL 0x00000000 |
#define | EHC_CTRLDSSEGMENT_RESVAL 0x00000000 |
#define | EHC_CONFIGFLAG_RESVAL 0x00000000 |
#define | EHC_PORTSC_RESVAL(ppc) (ppc ? 0x00002000 : 0x00003000) |
#define | EHC_HCSPARAMS_NPORTS(x) (x & 0xf) |
#define | EHC_HCSPARAMS_PPC(x) (x & 0x10) |
#define | EHC_HCCPARAMS_ASPM(x) (x & 0x4) |
#define | EHC_TYP_iTD 0x00 |
#define | EHC_TYP_QH 0x02 |
#define | EHC_T (1 << 0) |
#define | EHC_HS 2 |
#define | iTD_STATUS_P 28 |
#define | iTD_ACTIVE (1 << 3) |
#define | iTD_TLEN_P 16 |
#define | iTD_IOC (1 << 15) |
#define | iTD_IO (1 << 11) |
#define | QH_RL_P 28 |
#define | QH_C (1 << 27) |
#define | QH_MAXP_P 16 |
#define | QH_H (1 << 15) |
#define | QH_DTC (1 << 14) |
#define | QH_EPS_P 12 |
#define | QH_ENDPT_P 8 |
#define | QH_MULT_P 30 |
#define | qTD_DT (1 << 31) |
#define | qTD_TOTALB_P 16 |
#define | qTD_IOC (1 << 15) |
#define | qTD_PID_P 8 |
#define | qTD_ACTIVE 0x80 |
#define | qTD_HALTBABXACT 0x58 |
#define | qTD_OUT 0 |
#define | qTD_IN 1 |
#define | qTD_SETUP 10 |
#define | MASK_UFRAME0 0x01 |
#define | MASK_UFRAME1 0x02 |
#define | UHC_USBCMD_UMAXP (1 << 7) |
#define | UHC_USBCMD_UCF (1 << 6) |
#define | UHC_USBCMD_SWDBG (1 << 5) |
#define | UHC_USBCMD_FGR (1 << 4) |
#define | UHC_USBCMD_EGSM (1 << 3) |
#define | UHC_USBCMD_GRESET (1 << 2) |
#define | UHC_USBCMD_HCRESET (1 << 1) |
#define | UHC_USBCMD_RUNSTOP (1 << 0) |
#define | UHC_USBSTS_HCHALTED (1 << 5) |
#define | UHC_USBSTS_HCP (1 << 4) |
#define | UHC_USBSTS_HCERROR (1 << 3) |
#define | UHC_USBSTS_RSDETECT (1 << 2) |
#define | UHC_USBSTS_USBERRINT (1 << 1) |
#define | UHC_USBSTS_USBINT (1 << 0) |
#define | UHC_PORTSC_SUSPEND (1 << 12) |
#define | UHC_PORTSC_PRESET (1 << 9) |
#define | UHC_PORTSC_LS (1 << 8) |
#define | UHC_PORTSC_RES (1 << 7) |
#define | UHC_PORTSC_RSDETECT (1 << 6) |
#define | UHC_PORTSC_LINESTATUS (3 << 4) |
#define | UHC_PORTSC_PEN_CHANGE (1 << 3) |
#define | UHC_PORTSC_PEN (1 << 2) |
#define | UHC_PORTSC_CNNTSTATC (1 << 1) |
#define | UHC_PORTSC_CNNTSTAT (1 << 0) |
#define | UHC_USBCMD_RESVAL 0x0000 |
#define | UHC_USBSTS_RESVAL 0x0020 |
#define | UHC_USBINT_RESVAL 0x0000 |
#define | UHC_FRNUM_RESVAL 0x0000 |
#define | UHC_SOFMOD_RESVAL(b) (b ? 0x4000 : 0x40) |
#define | UHC_PORTSC_RESVAL 0x0083 |
#define | TD_VF (1 << 2) |
#define | TD_Q (1 << 1) |
#define | TD_T (1 << 0) |
#define | TD_SPD (1 << 29) |
#define | TD_CERR_P 27 |
#define | TD_LS (1 << 26) |
#define | TD_ISO (1 << 25) |
#define | TD_IOC (1 << 24) |
#define | TD_STATUS (255 << 16) |
#define | TD_STATUS_P 16 |
#define | TD_STATUS_ACTIVE 0x80 |
#define | TD_ACTIVE (TD_STATUS_ACTIVE << TD_STATUS_P) |
#define | TD_MAXLEN_P 21 |
#define | TD_ENDPT_P 15 |
#define | TD_D (1 << 19) |
#define | TD_PID_IN 0x69 |
#define | TD_PID_OUT 0xE1 |
#define | TD_PID_SETUP 0x2D |
#define | get_lhw(x) ((x >> 16) & 0xffff) |
#define | get_hhw(x) (x & 0xffff) |
#define | fix_end(x) (beregs ? x : hword_swap(byte_swap(x))) |
#define | cond_regswap(x) (beregs ? x : byte_swap(hword_swap(x))) |
#define | get_usbcmd(x) get_lhw(fix_end(x->usbcmdsts)) |
#define | get_usbsts(x) get_hhw(fix_end(x->usbcmdsts)) |
#define | get_usbint(x) get_lhw(fix_end(x->usbintfrnum)) |
#define | get_frnum(x) get_hhw(fix_end(x->usbintfrnum)) |
#define | get_fladdr(x) byte_swap(x->fladdr) |
#define | get_sofmod(x) get_lhw(fix_end(x->sofmod)) |
#define | get_portsc(x, i) (i % 2 ? get_hhw(fix_end(x->portsc[i/2])) : get_lhw(fix_end(x->portsc[i/2]))) |
Functions | |
int * | build_frame_list (int nelem, int bedesc) |
void | ehc_check_opresvals (struct ehccoreregs *c, struct ehcauxregs *a, int beregs) |
int | ehc_test (int addr, int bedesc, int beregs) |
void | uhc_check_resvals (struct uhcregs *regs, int beregs) |
int | uhc_test (int addr, int bedesc, int beregs) |
int | grusbhc_test (int ehc_addr, int uhc_addr, int bedesc, int beregs) |
#define byte_swap | ( | x | ) |
Referenced by ehc_check_opresvals(), ehc_test(), and uhc_test().
#define cond_regswap | ( | x | ) | (beregs ? x : byte_swap(hword_swap(x))) |
Referenced by uhc_test().
#define EHC_AUXREGS_OFF 0x54 |
Referenced by ehc_test().
#define EHC_CONFIGFLAG_CF (1 << 0) |
Referenced by ehc_test().
#define EHC_CONFIGFLAG_RESVAL 0x00000000 |
Referenced by ehc_check_opresvals().
#define EHC_CTRLDSSEGMENT_RESVAL 0x00000000 |
Referenced by ehc_check_opresvals().
#define EHC_FRINDEX_RESVAL 0x00000000 |
Referenced by ehc_check_opresvals().
Referenced by ehc_check_opresvals().
Referenced by ehc_check_opresvals().
Referenced by ehc_check_opresvals(), and ehc_test().
#define EHC_HS 2 |
Referenced by ehc_test().
#define EHC_JSTATE 0x2 |
Referenced by ehc_test().
#define EHC_PORTSC_CNNTSTAT (1 << 0) |
Referenced by ehc_test().
#define EHC_PORTSC_CNNTSTAT_CHANGE (1 << 1) |
Referenced by ehc_test().
#define EHC_PORTSC_LS_P 10 |
Referenced by ehc_test().
#define EHC_PORTSC_OC_ACTIVE (1 << 4) |
#define EHC_PORTSC_OC_CHANGE (1 << 5) |
#define EHC_PORTSC_PEN (1 << 2) |
Referenced by ehc_test().
#define EHC_PORTSC_PEN_CHANGE (1 << 3) |
#define EHC_PORTSC_POWNER (1 << 13) |
#define EHC_PORTSC_PP (1 << 12) |
Referenced by ehc_test().
#define EHC_PORTSC_PRESET (1 << 8) |
Referenced by ehc_test().
#define EHC_PORTSC_PRESUME (1 << 6) |
#define EHC_PORTSC_PSUSPEND (1 << 7) |
#define EHC_PORTSC_RESVAL | ( | ppc | ) | (ppc ? 0x00002000 : 0x00003000) |
Referenced by ehc_check_opresvals().
#define EHC_PORTSC_WKCNNT_E (1 << 20) |
#define EHC_PORTSC_WKDSCNNT_E (1 << 21) |
#define EHC_PORTSC_WKOC_E (1 << 22) |
#define EHC_T (1 << 0) |
Referenced by ehc_test().
#define EHC_TYP_iTD 0x00 |
#define EHC_TYP_QH 0x02 |
Referenced by ehc_test().
#define EHC_USBCMD_AS_ADV_INT (1 << 6) |
#define EHC_USBCMD_AS_SCHED_EN (1 << 5) |
Referenced by ehc_test().
#define EHC_USBCMD_FLSIZE (3 << 2) |
#define EHC_USBCMD_HCRESET (1 << 1) |
Referenced by ehc_test().
#define EHC_USBCMD_ITHRES (0xff << 16) |
#define EHC_USBCMD_ITHRES_P 16 |
Referenced by ehc_test().
#define EHC_USBCMD_LHCRESET (1 << 7) |
#define EHC_USBCMD_PER_SCHED_EN (1 << 4) |
Referenced by ehc_test().
#define EHC_USBCMD_PMODE (1 << 11) |
#define EHC_USBCMD_PMODECNT (3 << 8) |
#define EHC_USBCMD_RESVAL | ( | aspm | ) | (aspm ? 0x00080b00 : 0x00080000) |
Referenced by ehc_check_opresvals().
#define EHC_USBCMD_RUNSTOP (1 << 0) |
Referenced by ehc_test().
#define EHC_USBINTR_RESVAL 0x00000000 |
Referenced by ehc_check_opresvals().
#define EHC_USBSTS_ASADV (1 << 5) |
#define EHC_USBSTS_ASSTAT (1 << 15) |
Referenced by ehc_test().
#define EHC_USBSTS_FLROLL (1 << 3) |
#define EHC_USBSTS_HCHALTED (1 << 12) |
Referenced by ehc_test().
#define EHC_USBSTS_HSERR (1 << 4) |
#define EHC_USBSTS_PCHANGE_DETECT (1 << 2) |
#define EHC_USBSTS_PERSTAT (1 << 14) |
Referenced by ehc_test().
#define EHC_USBSTS_RECL (1 << 13) |
#define EHC_USBSTS_RESVAL 0x00001000 |
Referenced by ehc_check_opresvals().
#define EHC_USBSTS_USBERRINT (1 << 1) |
Referenced by ehc_test().
#define EHC_USBSTS_USBINT (1 << 0) |
Referenced by ehc_test().
#define fix_end | ( | x | ) | (beregs ? x : hword_swap(byte_swap(x))) |
Referenced by uhc_check_resvals().
#define get_portsc | ( | x, | |
i | |||
) | (i % 2 ? get_hhw(fix_end(x->portsc[i/2])) : get_lhw(fix_end(x->portsc[i/2]))) |
Referenced by uhc_check_resvals().
Referenced by uhc_check_resvals().
Referenced by uhc_check_resvals(), and uhc_test().
Referenced by uhc_check_resvals().
Referenced by uhc_check_resvals(), and uhc_test().
#define iTD_ACTIVE (1 << 3) |
Referenced by ehc_test().
#define iTD_IO (1 << 11) |
Referenced by ehc_test().
#define iTD_IOC (1 << 15) |
#define iTD_STATUS_P 28 |
Referenced by ehc_test().
#define iTD_TLEN_P 16 |
Referenced by ehc_test().
#define MASK_UFRAME0 0x01 |
Referenced by ehc_test().
#define MASK_UFRAME1 0x02 |
#define QH_C (1 << 27) |
#define QH_DTC (1 << 14) |
Referenced by ehc_test().
#define QH_ENDPT_P 8 |
Referenced by ehc_test().
#define QH_EPS_P 12 |
Referenced by ehc_test().
#define QH_H (1 << 15) |
Referenced by ehc_test().
#define QH_MAXP_P 16 |
Referenced by ehc_test().
#define QH_MULT_P 30 |
Referenced by ehc_test().
#define QH_RL_P 28 |
#define qTD_ACTIVE 0x80 |
Referenced by ehc_test().
#define qTD_DT (1 << 31) |
Referenced by ehc_test().
#define qTD_HALTBABXACT 0x58 |
Referenced by ehc_test().
#define qTD_IN 1 |
Referenced by ehc_test().
#define qTD_IOC (1 << 15) |
Referenced by ehc_test().
#define qTD_OUT 0 |
Referenced by ehc_test().
#define qTD_PID_P 8 |
Referenced by ehc_test().
#define qTD_SETUP 10 |
#define qTD_TOTALB_P 16 |
Referenced by ehc_test().
#define TD_ACTIVE (TD_STATUS_ACTIVE << TD_STATUS_P) |
Referenced by uhc_test().
#define TD_CERR_P 27 |
#define TD_D (1 << 19) |
#define TD_ENDPT_P 15 |
Referenced by uhc_test().
#define TD_IOC (1 << 24) |
Referenced by uhc_test().
#define TD_ISO (1 << 25) |
Referenced by uhc_test().
#define TD_LS (1 << 26) |
#define TD_MAXLEN_P 21 |
Referenced by uhc_test().
#define TD_PID_IN 0x69 |
Referenced by uhc_test().
#define TD_PID_OUT 0xE1 |
Referenced by uhc_test().
#define TD_PID_SETUP 0x2D |
Referenced by uhc_test().
#define TD_Q (1 << 1) |
Referenced by uhc_test().
#define TD_SPD (1 << 29) |
#define TD_STATUS (255 << 16) |
#define TD_STATUS_ACTIVE 0x80 |
#define TD_STATUS_P 16 |
#define TD_T (1 << 0) |
Referenced by uhc_test().
#define TD_VF (1 << 2) |
#define UHC_FRNUM_RESVAL 0x0000 |
Referenced by uhc_check_resvals().
#define UHC_PORTSC_CNNTSTAT (1 << 0) |
#define UHC_PORTSC_CNNTSTATC (1 << 1) |
#define UHC_PORTSC_LINESTATUS (3 << 4) |
#define UHC_PORTSC_LS (1 << 8) |
#define UHC_PORTSC_PEN (1 << 2) |
Referenced by uhc_test().
#define UHC_PORTSC_PEN_CHANGE (1 << 3) |
#define UHC_PORTSC_PRESET (1 << 9) |
#define UHC_PORTSC_RES (1 << 7) |
Referenced by uhc_check_resvals().
#define UHC_PORTSC_RESVAL 0x0083 |
Referenced by uhc_check_resvals().
#define UHC_PORTSC_RSDETECT (1 << 6) |
#define UHC_PORTSC_SUSPEND (1 << 12) |
#define UHC_SOFMOD_RESVAL | ( | b | ) | (b ? 0x4000 : 0x40) |
Referenced by uhc_check_resvals().
#define UHC_USBCMD_EGSM (1 << 3) |
#define UHC_USBCMD_FGR (1 << 4) |
#define UHC_USBCMD_GRESET (1 << 2) |
#define UHC_USBCMD_HCRESET (1 << 1) |
Referenced by uhc_test().
#define UHC_USBCMD_RESVAL 0x0000 |
Referenced by uhc_check_resvals().
#define UHC_USBCMD_RUNSTOP (1 << 0) |
Referenced by uhc_test().
#define UHC_USBCMD_SWDBG (1 << 5) |
#define UHC_USBCMD_UCF (1 << 6) |
#define UHC_USBCMD_UMAXP (1 << 7) |
#define UHC_USBINT_RESVAL 0x0000 |
Referenced by uhc_check_resvals().
#define UHC_USBSTS_HCERROR (1 << 3) |
#define UHC_USBSTS_HCHALTED (1 << 5) |
Referenced by uhc_test().
#define UHC_USBSTS_HCP (1 << 4) |
#define UHC_USBSTS_RESVAL 0x0020 |
Referenced by uhc_check_resvals().
#define UHC_USBSTS_RSDETECT (1 << 2) |
#define UHC_USBSTS_USBERRINT (1 << 1) |
#define UHC_USBSTS_USBINT (1 << 0) |
Referenced by uhc_test().
References i.
Referenced by ehc_test(), and uhc_test().
void ehc_check_opresvals | ( | struct ehccoreregs * | c, |
struct ehcauxregs * | a, | ||
int | beregs | ||
) |
References cond_bswap, ehcauxregs::configflag, ehccoreregs::ctrldssegment, EHC_CONFIGFLAG_RESVAL, EHC_CTRLDSSEGMENT_RESVAL, EHC_FRINDEX_RESVAL, EHC_HCCPARAMS_ASPM, EHC_HCSPARAMS_NPORTS, EHC_HCSPARAMS_PPC, EHC_PORTSC_RESVAL, EHC_USBCMD_RESVAL, EHC_USBINTR_RESVAL, EHC_USBSTS_RESVAL, fail, ehccoreregs::frindex, ehccoreregs::hccparams, ehccoreregs::hcsparams, i, ehcauxregs::portsc, ehccoreregs::usbcmd, ehccoreregs::usbintr, and ehccoreregs::usbsts.
Referenced by ehc_test().
References ehccoreregs::alistaddr, ehc_qtd::anext, ehc_itd::buf, ehc_qtd::bufp, build_frame_list(), ehc_qh::cap, ehc_qh::chr, cond_bswap, ehcauxregs::configflag, ehc_qh::curr, EHC_AUXREGS_OFF, ehc_check_opresvals(), EHC_CONFIGFLAG_CF, EHC_HCSPARAMS_PPC, EHC_HS, EHC_JSTATE, EHC_PORTSC_CNNTSTAT, EHC_PORTSC_CNNTSTAT_CHANGE, EHC_PORTSC_LS_P, EHC_PORTSC_PEN, EHC_PORTSC_PP, EHC_PORTSC_PRESET, EHC_T, EHC_TYP_QH, EHC_USBCMD_AS_SCHED_EN, EHC_USBCMD_HCRESET, EHC_USBCMD_ITHRES_P, EHC_USBCMD_PER_SCHED_EN, EHC_USBCMD_RUNSTOP, EHC_USBSTS_ASSTAT, EHC_USBSTS_HCHALTED, EHC_USBSTS_PERSTAT, EHC_USBSTS_USBERRINT, EHC_USBSTS_USBINT, fail, ehccoreregs::hcsparams, i, iTD_ACTIVE, iTD_IO, iTD_STATUS_P, iTD_TLEN_P, ehc_itd::lp, ehc_qh::lp, MASK_UFRAME0, ehc_qtd::next, ehccoreregs::perlistbase, ehcauxregs::portsc, QH_DTC, QH_ENDPT_P, QH_EPS_P, QH_H, QH_MAXP_P, QH_MULT_P, ehc_qh::qtd, qTD_ACTIVE, qTD_DT, qTD_HALTBABXACT, qTD_IN, qTD_IOC, qTD_OUT, qTD_PID_P, qTD_TOTALB_P, report_device(), report_subtest(), ehc_itd::status, ehc_qtd::token, ehccoreregs::usbcmd, and ehccoreregs::usbsts.
Referenced by grusbhc_test().
References fail, get_frnum, get_portsc, get_sofmod, get_usbcmd, get_usbint, get_usbsts, i, UHC_FRNUM_RESVAL, UHC_PORTSC_RES, UHC_PORTSC_RESVAL, UHC_SOFMOD_RESVAL, UHC_USBCMD_RESVAL, UHC_USBINT_RESVAL, and UHC_USBSTS_RESVAL.
Referenced by uhc_test().
References uhc_td::bufp, build_frame_list(), cond_bswap, cond_regswap, uhc_qh::elp, fail, uhcregs::fladdr, get_usbcmd, get_usbsts, i, uhc_td::lp, uhc_qh::lp, uhcregs::portsc, report_device(), report_subtest(), uhc_td::stat, TD_ACTIVE, TD_ENDPT_P, TD_IOC, TD_ISO, TD_MAXLEN_P, TD_PID_IN, TD_PID_OUT, TD_PID_SETUP, TD_Q, TD_T, uhc_td::token, uhc_check_resvals(), UHC_PORTSC_PEN, UHC_USBCMD_HCRESET, UHC_USBCMD_RUNSTOP, UHC_USBSTS_HCHALTED, UHC_USBSTS_USBINT, and uhcregs::usbcmdsts.
Referenced by grusbhc_test().