X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=drivers%2Fusb%2Fhost%2Fohci.h;h=db0924c943a19fab809449035313febc9cdbb217;hb=f2465934b46235287e07473fa4919035ba1a2b68;hp=3f9869b6a887de6b1b3a4d81989f3cb56561bdd7;hpb=58b4048f64072ae543de96d850cc8967c32bc901;p=u-boot diff --git a/drivers/usb/host/ohci.h b/drivers/usb/host/ohci.h index 3f9869b6a8..db0924c943 100644 --- a/drivers/usb/host/ohci.h +++ b/drivers/usb/host/ohci.h @@ -10,15 +10,18 @@ /* * e.g. PCI controllers need this */ + +#include + #ifdef CONFIG_SYS_OHCI_SWAP_REG_ACCESS -# define ohci_readl(a) __swap_32(*((volatile u32 *)(a))) -# define ohci_writel(a, b) (*((volatile u32 *)(b)) = __swap_32((volatile u32)a)) +# define ohci_readl(a) __swap_32(readl(a)) +# define ohci_writel(v, a) writel(__swap_32(v), a) #else -# define ohci_readl(a) (*((volatile u32 *)(a))) -# define ohci_writel(a, b) (*((volatile u32 *)(b)) = ((volatile u32)a)) +# define ohci_readl(a) readl(a) +# define ohci_writel(v, a) writel(v, a) #endif /* CONFIG_SYS_OHCI_SWAP_REG_ACCESS */ -#if defined CONFIG_DM_USB && ARCH_DMA_MINALIGN > 16 +#if ARCH_DMA_MINALIGN > 16 #define ED_ALIGNMENT ARCH_DMA_MINALIGN #else #define ED_ALIGNMENT 16 @@ -367,10 +370,13 @@ typedef struct #define NUM_TD 64 /* we need more TDs than EDs */ +#define NUM_INT_DEVS 8 /* num of ohci_dev structs for int endpoints */ + typedef struct ohci_device { ed_t ed[NUM_EDS] __aligned(ED_ALIGNMENT); td_t tds[NUM_TD] __aligned(TD_ALIGNMENT); int ed_cnt; + int devnum; } ohci_dev_t; /* @@ -384,6 +390,7 @@ typedef struct ohci_device { typedef struct ohci { /* this allocates EDs for all possible endpoints */ struct ohci_device ohci_dev __aligned(TD_ALIGNMENT); + struct ohci_device int_dev[NUM_INT_DEVS] __aligned(TD_ALIGNMENT); struct ohci_hcca *hcca; /* hcca */ /*dma_addr_t hcca_dma;*/