drivers: usb: sam0: Remove defines from dts_fixup.h

Move SAM0 flash to use the raw defines generated from the DTS
parsing.

Signed-off-by: Derek Hageman <hageman@inthat.cloud>
This commit is contained in:
Derek Hageman 2019-04-30 20:21:11 -06:00 committed by Maureen Helm
commit 07d18e3f52
3 changed files with 7 additions and 16 deletions

View file

@ -21,8 +21,8 @@ LOG_MODULE_REGISTER(usb_dc_sam0);
#define USB_SAM0_IN_EP 0x80
#define REGS ((Usb *)DT_USB_DC_SAM0_BASE_ADDRESS)
#define USB_NUM_ENDPOINTS DT_USB_DC_SAM0_NUM_BIDIR_ENDPOINTS
#define REGS ((Usb *)DT_ATMEL_SAM0_USB_0_BASE_ADDRESS)
#define USB_NUM_ENDPOINTS DT_ATMEL_SAM0_USB_0_NUM_BIDIR_ENDPOINTS
struct usb_sam0_data {
UsbDeviceDescriptor descriptors[USB_NUM_ENDPOINTS];
@ -203,9 +203,10 @@ int usb_dc_attach(void)
regs->INTENSET.reg = USB_DEVICE_INTENSET_EORST;
/* Connect and enable the interrupt */
IRQ_CONNECT(DT_USB_DC_SAM0_IRQ, DT_USB_DC_SAM0_IRQ_PRIORITY,
IRQ_CONNECT(DT_ATMEL_SAM0_USB_0_IRQ_0,
DT_ATMEL_SAM0_USB_0_IRQ_0_PRIORITY,
usb_sam0_isr, 0, 0);
irq_enable(DT_USB_DC_SAM0_IRQ);
irq_enable(DT_ATMEL_SAM0_USB_0_IRQ_0);
/* Enable and attach */
regs->CTRLA.bit.ENABLE = 1;
@ -231,7 +232,7 @@ int usb_dc_reset(void)
{
UsbDevice *regs = &REGS->DEVICE;
irq_disable(DT_USB_DC_SAM0_IRQ);
irq_disable(DT_ATMEL_SAM0_USB_0_IRQ_0);
regs->CTRLA.bit.SWRST = 1;
usb_sam0_wait_syncbusy();
@ -267,7 +268,7 @@ int usb_dc_ep_check_cap(const struct usb_dc_ep_cfg_data * const cfg)
return -1;
}
if (ep_idx > DT_USB_DC_SAM0_NUM_BIDIR_ENDPOINTS) {
if (ep_idx > USB_NUM_ENDPOINTS) {
LOG_ERR("endpoint index/address too high");
return -1;
}

View file

@ -96,11 +96,6 @@
#define CONFIG_WDT_0_NAME DT_ATMEL_SAM0_WATCHDOG_0_LABEL
#define DT_USB_DC_SAM0_BASE_ADDRESS DT_ATMEL_SAM0_USB_41005000_BASE_ADDRESS
#define DT_USB_DC_SAM0_IRQ DT_ATMEL_SAM0_USB_41005000_IRQ_0
#define DT_USB_DC_SAM0_IRQ_PRIORITY DT_ATMEL_SAM0_USB_41005000_IRQ_0_PRIORITY
#define DT_USB_DC_SAM0_NUM_BIDIR_ENDPOINTS DT_ATMEL_SAM0_USB_41005000_NUM_BIDIR_ENDPOINTS
#define DT_NUM_IRQ_PRIO_BITS DT_ARM_V6M_NVIC_E000E100_ARM_NUM_IRQ_PRIORITY_BITS
/* End of SoC Level DTS fixup file */

View file

@ -100,11 +100,6 @@
#define CONFIG_WDT_0_NAME DT_ATMEL_SAM0_WATCHDOG_0_LABEL
#define DT_USB_DC_SAM0_BASE_ADDRESS DT_ATMEL_SAM0_USB_41005000_BASE_ADDRESS
#define DT_USB_DC_SAM0_IRQ DT_ATMEL_SAM0_USB_41005000_IRQ_0
#define DT_USB_DC_SAM0_IRQ_PRIORITY DT_ATMEL_SAM0_USB_41005000_IRQ_0_PRIORITY
#define DT_USB_DC_SAM0_NUM_BIDIR_ENDPOINTS DT_ATMEL_SAM0_USB_41005000_NUM_BIDIR_ENDPOINTS
#define DT_NUM_IRQ_PRIO_BITS DT_ARM_V6M_NVIC_E000E100_ARM_NUM_IRQ_PRIORITY_BITS
/* End of SoC Level DTS fixup file */