driver: usb: enable usb2.0 on intel_s1000

Change-Id: I59091c465e84f1d6ba64433b7320182d83ff9589
Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Savinay Dharmappa 2018-03-13 19:25:51 +05:30 committed by Anas Nashif
parent 46d6ba4674
commit 5060f4bd14
3 changed files with 21 additions and 2 deletions

View file

@ -42,6 +42,9 @@
#define CAVS_ICTL_3_IRQ 0x00000010
#define CAVS_ICTL_3_IRQ_FLAGS 0
#define IOAPIC_EDGE 0
#define IOAPIC_HIGH 0
/* DW interrupt controller */
#define DW_ICTL_BASE_ADDR 0x00081800
#define DW_ICTL_IRQ 0x00000706
@ -117,6 +120,8 @@
#define SUE_DSP_RES_ALLOC_REG_BASE 0x00071A60
#define SUE_DSPIOPO_REG (SUE_DSP_RES_ALLOC_REG_BASE + 0x08)
#define I2S_OWNSEL(x) (0x1 << (8 + (x)))
#define USB_DW_BASE 0x000A0000
#define USB_DW_IRQ 0x00000806
extern void _soc_irq_enable(u32_t irq);
extern void _soc_irq_disable(u32_t irq);

View file

@ -66,6 +66,15 @@ config HEAP_MEM_POOL_SIZE
endif # DMA_CAVS
if USB
config USB_DW
def_bool y
config USB_DW_IRQ_PRI
default 3
config USB_PHY_2
def_bool y
endif # USB
if UART_NS16550
config UART_NS16550_PORT_0

View file

@ -14,13 +14,13 @@
* level control routines to deal directly with the hardware.
*/
#include <soc.h>
#include <string.h>
#include <stdio.h>
#include <misc/byteorder.h>
#include <usb/usb_dc.h>
#include <usb/usb_device.h>
#include "usb_dw_registers.h"
#include <soc.h>
#ifdef CONFIG_QMSI
#include "clk.h"
#endif
@ -44,7 +44,7 @@
struct usb_ep_ctrl_prv {
u8_t ep_ena;
u8_t fifo_num;
u8_t fifo_size;
u32_t fifo_size;
u16_t mps; /* Max ep pkt size */
usb_dc_ep_callback cb;/* Endpoint callback function */
u32_t data_len;
@ -527,7 +527,12 @@ static int usb_dw_init(void)
}
/* Set device speed to FS */
#ifdef USB_PHY_2
USB_DW->dcfg &= ~USB_DW_DCFG_DEV_SPD_FS;
USB_DW->dcfg |= 0x01;
#else
USB_DW->dcfg |= USB_DW_DCFG_DEV_SPD_FS;
#endif
/* Set NAK for all OUT EPs */
for (ep = 0; ep < USB_DW_OUT_EP_NUM; ep++) {