FIQDBG_PORTHUB = (1 << 3),
};
+#ifdef CONFIG_ARM64
+
+typedef spinlock_t fiq_lock_t;
+
+#else
+
typedef struct {
union {
uint32_t slock;
};
} fiq_lock_t;
+#endif
+
struct fiq_state;
extern void _fiq_print (enum fiq_debug_level dbg_lvl, volatile struct fiq_state *state, char *fmt, ...);
struct fiq_channel_state channel[0];
};
+#ifdef CONFIG_ARM64
+
+#ifdef local_fiq_enable
+#undef local_fiq_enable
+#endif
+
+#ifdef local_fiq_disable
+#undef local_fiq_disable
+#endif
+
+extern void local_fiq_enable(void);
+
+extern void local_fiq_disable(void);
+
+#endif
+
extern void fiq_fsm_spin_lock(fiq_lock_t *lock);
extern void fiq_fsm_spin_unlock(fiq_lock_t *lock);
#include <linux/dma-mapping.h>
#include <linux/version.h>
#include <asm/io.h>
+#ifdef CONFIG_ARM
#include <asm/fiq.h>
+#endif
#include <linux/usb.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)
#include <../drivers/usb/core/hcd.h>
#include "dwc_otg_driver.h"
#include "dwc_otg_hcd.h"
+#ifndef __virt_to_bus
+#define __virt_to_bus __virt_to_phys
+#define __bus_to_virt __phys_to_virt
+#define __pfn_to_bus(x) __pfn_to_phys(x)
+#define __bus_to_pfn(x) __phys_to_pfn(x)
+#endif
+
extern unsigned char _dwc_otg_fiq_stub, _dwc_otg_fiq_stub_end;
/**
.get_b_hnp_enable = _get_b_hnp_enable,
};
+#ifdef CONFIG_ARM64
+
+static int simfiq_irq = -1;
+
+void local_fiq_enable(void)
+{
+ if (simfiq_irq >= 0)
+ enable_irq(simfiq_irq);
+}
+
+void local_fiq_disable(void)
+{
+ if (simfiq_irq >= 0)
+ disable_irq(simfiq_irq);
+}
+
+irqreturn_t fiq_irq_handler(int irq, void *dev_id)
+{
+ dwc_otg_hcd_t *dwc_otg_hcd = (dwc_otg_hcd_t *)dev_id;
+
+ if (fiq_fsm_enable)
+ dwc_otg_fiq_fsm(dwc_otg_hcd->fiq_state, dwc_otg_hcd->core_if->core_params->host_channels);
+ else
+ dwc_otg_fiq_nop(dwc_otg_hcd->fiq_state);
+
+ return IRQ_HANDLED;
+}
+
+#else
static struct fiq_handler fh = {
.name = "usb_fiq",
};
+#endif
+
static void hcd_init_fiq(void *cookie)
{
dwc_otg_device_t *otg_dev = cookie;
dwc_otg_hcd_t *dwc_otg_hcd = otg_dev->hcd;
+#ifdef CONFIG_ARM64
+ int retval = 0;
+ int irq;
+#else
struct pt_regs regs;
int irq;
// __show_regs(®s);
set_fiq_regs(®s);
+#endif
//Set the mphi periph to the required registers
dwc_otg_hcd->fiq_state->mphi_regs.base = otg_dev->os_dep.mphi_base;
DWC_WARN("MPHI periph has NOT been enabled");
#endif
// Enable FIQ interrupt from USB peripheral
+#ifdef CONFIG_ARM64
+ irq = platform_get_irq(otg_dev->os_dep.platformdev, 1);
+
+ if (irq < 0) {
+ DWC_ERROR("Can't get SIM-FIQ irq");
+ return;
+ }
+
+ retval = request_irq(irq, fiq_irq_handler, 0, "dwc_otg_sim-fiq", dwc_otg_hcd);
+
+ if (retval < 0) {
+ DWC_ERROR("Unable to request SIM-FIQ irq\n");
+ return;
+ }
+
+ simfiq_irq = irq;
+#else
#ifdef CONFIG_MULTI_IRQ_HANDLER
irq = platform_get_irq(otg_dev->os_dep.platformdev, 1);
#else
}
enable_fiq(irq);
local_fiq_enable();
+#endif
+
}
/**
otg_dev->hcd = dwc_otg_hcd;
otg_dev->hcd->otg_dev = otg_dev;
+#ifdef CONFIG_ARM64
+ if (dwc_otg_hcd_init(dwc_otg_hcd, otg_dev->core_if))
+ goto error2;
+
+ if (fiq_enable)
+ hcd_init_fiq(otg_dev);
+#else
if (dwc_otg_hcd_init(dwc_otg_hcd, otg_dev->core_if)) {
goto error2;
}
smp_call_function_single(0, hcd_init_fiq, otg_dev, 1);
}
}
+#endif
hcd->self.otg_port = dwc_otg_hcd_otg_port(dwc_otg_hcd);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33) //don't support for LM(with 2.6.20.1 kernel)