HelenOS sources
#ifndef AMDM37x_USBTLL_H
#define AMDM37x_USBTLL_H
#include <macros.h>
#include <ddi.h>
#define AMDM37x_USBTLL_BASE_ADDRESS 0x48062000
#define AMDM37x_USBTLL_SIZE 4096
typedef struct {
const ioport32_t revision;
#define TLL_REVISION_MINOR_MASK 0x0f
#define TLL_REVISION_MAJOR_MASK 0xf0
PADD32(3);
ioport32_t sysconfig;
#define TLL_SYSCONFIG_AUTOIDLE_FLAG (1 << 0)
#define TLL_SYSCONFIG_SOFTRESET_FLAG (1 << 1)
#define TLL_SYSCONFIG_ENWAKEUP_FLAG (1 << 2)
#define TLL_SYSCONFIG_SIDLE_MODE_MASK (0x3 << 3)
#define TLL_SYSCONFIG_SIDLE_MODE_FORCE (0x0 << 3)
#define TLL_SYSCONFIG_SIDLE_MODE_NO (0x1 << 3)
#define TLL_SYSCONFIG_SIDLE_MODE_SMART (0x2 << 3)
#define TLL_SYSCONFIG_CLOCKACTIVITY_FLAG (1 << 8)
const ioport32_t sysstatus;
#define TLL_SYSSTATUS_RESET_DONE_FLAG (1 << 0)
const ioport32_t irqstatus;
#define TLL_IRQSTATUS_FCLK_START_FLAG (1 << 0)
#define TLL_IRQSTATUS_FCLK_END_FLAG (1 << 1)
#define TLL_IRQSTATUS_ACCESS_ERROR_FLAG (1 << 2)
ioport32_t irqenable;
#define TLL_IRQSTATUS_FCLK_START_EN_FLAG (1 << 0)
#define TLL_IRQSTATUS_FCLK_END_EN_FLAG (1 << 1)
#define TLL_IRQSTATUS_ACCESS_ERROR_EN_FLAG (1 << 2)
PADD32(4);
ioport32_t shared_conf;
#define TLL_SHARED_CONF_FCLK_IS_ON_FLAG (1 << 0)
#define TLL_SHARED_CONF_FCLK_REQ_FLAG (1 << 1)
#define TLL_SHARED_CONF_USB_DIVRATIO_MASK (0x7 << 2)
#define TLL_SHARED_CONF_USB_DIVRATIO(x) (((x) & 0x7) << 2)
#define TLL_SHARED_CONF_USB_180D_SDR_EN_FLAG (1 << 5)
#define TLL_SHARED_CONF_USB_90D_DDR_EN_FLAG (1 << 6)
PADD32(3);
ioport32_t channel_conf[3];
#define TLL_CHANNEL_CONF_CHANEN_FLAG (1 << 0)
#define TLL_CHANNEL_CONF_CHANMODE_MASK (0x3 << 1)
#define TLL_CHANNEL_CONF_CHANMODE_UTMI_ULPI_MODE (0x0 << 1)
#define TLL_CHANNEL_CONF_CHANMODE_UTMI_SERIAL_MODE (0x1 << 1)
#define TLL_CHANNEL_CONF_CHANMODE_UTMI_TRANS_MODE (0x2 << 1)
#define TLL_CHANNEL_CONF_CHANMODE_NO_MODE (0x3 << 1)
#define TLL_CHANNEL_CONF_UTMIISADEV_FLAG (1 << 3)
#define TLL_CHANNEL_CONF_TLLATTACH_FLAG (1 << 4)
#define TLL_CHANNEL_CONF_TLLCONNECT_FLAG (1 << 5)
#define TLL_CHANNEL_CONF_TLLFULLSPEED_FLAG (1 << 6)
#define TLL_CHANNEL_CONF_ULPIOUTCLKMODE_FLAG (1 << 7)
#define TLL_CHANNEL_CONF_ULPIDDRMODE_FLAG (1 << 8)
#define TLL_CHANNEL_CONF_UTMIAUTOIDLE_FLAG (1 << 9)
#define TLL_CHANNEL_CONF_ULPIAUTOIDLE_FLAG (1 << 10)
#define TLL_CHANNEL_CONF_ULPINOBITSTUFF_FLAG (1 << 11)
#define TLL_CHANNEL_CONF_CHRGVBUS_FLAG (1 << 15)
#define TLL_CHANNEL_CONF_DRVVBUS_FLAG (1 << 16)
#define TLL_CHANNEL_CONF_TESTEN_FLAG (1 << 17)
#define TLL_CHANNEL_CONF_TESTTXEN_FLAG (1 << 18)
#define TLL_CHANNEL_CONF_TESTTXDAT_FLAG (1 << 19)
#define TLL_CHANNEL_CONF_TESTTXSE0_FLAG (1 << 20)
#define TLL_CHANNEL_CONF_FSLSMODE_MASK (0xf << 24)
#define TLL_CHANNEL_CONF_FSLSMODE_6PIN_UNI_PHY_TX_DATSE0 (0x0 << 24)
#define TLL_CHANNEL_CONF_FSLSMODE_6PIN_UNI_PHY_TX_DPDM (0x1 << 24)
#define TLL_CHANNEL_CONF_FSLSMODE_3PIN_BIDI_PHY (0x2 << 24)
#define TLL_CHANNEL_CONF_FSLSMODE_4PIN_BIDI_PHY (0x3 << 24)
#define TLL_CHANNEL_CONF_FSLSMODE_6PIN_UNI_TLL_TX_DATSE0 (0x4 << 24)
#define TLL_CHANNEL_CONF_FSLSMODE_6PIN_UNI_TLL_TX_DPDM (0x5 << 24)
#define TLL_CHANNEL_CONF_FSLSMODE_3PIN_BIDI_TLL (0x6 << 24)
#define TLL_CHANNEL_CONF_FSLSMODE_4PIN_BIDI_TLL (0x7 << 24)
#define TLL_CHANNEL_CONF_FSLSMODE_2PIN_BIDI_TLL_DATSE0 (0xa << 24)
#define TLL_CHANNEL_CONF_FSLSMODE_2PIN_BIDI_TLL_DPDM (0xb << 24)
#define TLL_CHANNEL_CONF_FSLSLINESTATE_MASK (0x3 << 28)
#define TLL_CHANNEL_CONF_FSLSLINESTATE_SE0 (0x0 << 28)
#define TLL_CHANNEL_CONF_FSLSLINESTATE_FS_J (0x1 << 28)
#define TLL_CHANNEL_CONF_FSLSLINESTATE_FS_K (0x2 << 28)
#define TLL_CHANNEL_CONF_FSLSLINESTATE_SE1 (0x3 << 28)
} tll_regs_t;
#endif
HelenOS homepage, sources at GitHub