Skip to content

Update Synopsys USB OTG driver to v2.94a #68

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
30 changes: 24 additions & 6 deletions drivers/mmc/host/sdhci-bcm2708.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@
#define POWER_LAZY_OFF 1
#define POWER_ON 2

#define REG_EXRDFIFO_EN 0x80
#define REG_EXRDFIFO_CFG 0x84

/*****************************************************************************\
* *
Expand Down Expand Up @@ -137,6 +139,7 @@ static inline unsigned long int since_ns(hptime_t t)
static bool allow_highspeed = 1;
static int emmc_clock_freq = BCM2708_EMMC_CLOCK_FREQ;
static bool sync_after_dma = 1;
static bool missing_status = 1;

#if 0
static void hptime_test(void)
Expand Down Expand Up @@ -653,7 +656,7 @@ sdhci_bcm2708_platdma_reset(struct sdhci_host *host, struct mmc_data *data)

BUG_ON(NULL == host);

spin_lock_irqsave(&host->lock, flags);
// spin_lock_irqsave(&host->lock, flags);

if (host_priv->dma_wanted) {
if (NULL == data) {
Expand Down Expand Up @@ -733,7 +736,7 @@ sdhci_bcm2708_platdma_reset(struct sdhci_host *host, struct mmc_data *data)
#endif
}

spin_unlock_irqrestore(&host->lock, flags);
// spin_unlock_irqrestore(&host->lock, flags);
}


Expand All @@ -750,7 +753,7 @@ static void sdhci_bcm2708_dma_complete_irq(struct sdhci_host *host,

BUG_ON(NULL == host);

spin_lock_irqsave(&host->lock, flags);
// spin_lock_irqsave(&host->lock, flags);
data = host->data;

#ifdef CHECK_DMA_USE
Expand All @@ -775,7 +778,7 @@ static void sdhci_bcm2708_dma_complete_irq(struct sdhci_host *host,

if (NULL == data) {
DBG("PDMA unused completion - status 0x%X\n", dma_cs);
spin_unlock_irqrestore(&host->lock, flags);
// spin_unlock_irqrestore(&host->lock, flags);
return;
}
sg = data->sg;
Expand Down Expand Up @@ -868,7 +871,7 @@ static void sdhci_bcm2708_dma_complete_irq(struct sdhci_host *host,
SDHCI_INT_SPACE_AVAIL);
}
}
spin_unlock_irqrestore(&host->lock, flags);
// spin_unlock_irqrestore(&host->lock, flags);
}

static irqreturn_t sdhci_bcm2708_dma_irq(int irq, void *dev_id)
Expand Down Expand Up @@ -967,10 +970,12 @@ static ssize_t attr_dma_store(struct device *_dev,
int on = simple_strtol(buf, NULL, 0);
if (on) {
host->flags |= SDHCI_USE_PLATDMA;
sdhci_bcm2708_writel(host, 1, REG_EXRDFIFO_EN);
printk(KERN_INFO "%s: DMA enabled\n",
mmc_hostname(host->mmc));
} else {
host->flags &= ~(SDHCI_USE_PLATDMA | SDHCI_REQ_USE_DMA);
sdhci_bcm2708_writel(host, 0, REG_EXRDFIFO_EN);
printk(KERN_INFO "%s: DMA disabled\n",
mmc_hostname(host->mmc));
}
Expand Down Expand Up @@ -1267,7 +1272,6 @@ static struct sdhci_ops sdhci_bcm2708_ops = {
.spurious_crc_acmd51 = sdhci_bcm2708_quirk_spurious_crc,
.voltage_broken = sdhci_bcm2708_quirk_voltage_broken,
.uhs_broken = sdhci_bcm2708_uhs_broken,
.missing_status = sdhci_bcm2708_missing_status,
};

/*****************************************************************************\
Expand Down Expand Up @@ -1306,6 +1310,9 @@ static int __devinit sdhci_bcm2708_probe(struct platform_device *pdev)
ret = PTR_ERR(host);
goto err;
}
if (missing_status) {
sdhci_bcm2708_ops.missing_status = sdhci_bcm2708_missing_status;
}

host->hw_name = "BCM2708_Arasan";
host->ops = &sdhci_bcm2708_ops;
Expand Down Expand Up @@ -1388,6 +1395,9 @@ static int __devinit sdhci_bcm2708_probe(struct platform_device *pdev)

if (allow_highspeed)
host->mmc->caps |= MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED;

/* single block writes cause data loss with some SD cards! */
host->mmc->caps2 |= MMC_CAP2_FORCE_MULTIBLOCK;
#endif

ret = sdhci_add_host(host);
Expand All @@ -1399,6 +1409,12 @@ static int __devinit sdhci_bcm2708_probe(struct platform_device *pdev)
ret = device_create_file(&pdev->dev, &dev_attr_dma_wait);
ret = device_create_file(&pdev->dev, &dev_attr_status);

#ifdef CONFIG_MMC_SDHCI_BCM2708_DMA
/* enable extension fifo for paced DMA transfers */
sdhci_bcm2708_writel(host, 1, REG_EXRDFIFO_EN);
sdhci_bcm2708_writel(host, 4, REG_EXRDFIFO_CFG);
#endif

printk(KERN_INFO "%s: BCM2708 SDHC host at 0x%08llx DMA %d IRQ %d\n",
mmc_hostname(host->mmc), (unsigned long long)iomem->start,
host_priv->dma_chan, host_priv->dma_irq);
Expand Down Expand Up @@ -1496,6 +1512,7 @@ module_exit(sdhci_drv_exit);
module_param(allow_highspeed, bool, 0444);
module_param(emmc_clock_freq, int, 0444);
module_param(sync_after_dma, bool, 0444);
module_param(missing_status, bool, 0444);

MODULE_DESCRIPTION("Secure Digital Host Controller Interface platform driver");
MODULE_AUTHOR("Broadcom <[email protected]>");
Expand All @@ -1505,5 +1522,6 @@ MODULE_ALIAS("platform:"DRIVER_NAME);
MODULE_PARM_DESC(allow_highspeed, "Allow high speed transfers modes");
MODULE_PARM_DESC(emmc_clock_freq, "Specify the speed of emmc clock");
MODULE_PARM_DESC(sync_after_dma, "Block in driver until dma complete");
MODULE_PARM_DESC(missing_status, "Use the missing status quirk");


38 changes: 25 additions & 13 deletions drivers/usb/host/dwc_common_port/Makefile
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,47 @@

ifneq ($(KERNELRELEASE),)

#CPPFLAGS += -DDEBUG_MEMORY
EXTRA_CFLAGS += -DDWC_LINUX
EXTRA_CFLAGS += -DDEBUG
#EXTRA_CFLAGS += -DDWC_DEBUG_REGS
#EXTRA_CFLAGS += -DDWC_DEBUG_MEMORY

ifeq ($(CONFIG_USB_DEBUG),y)
CPPFLAGS += -DDEBUG
endif
CPPFLAGS += -DDWC_LINUX
EXTRA_CFLAGS += -DDWC_LIBMODULE
EXTRA_CFLAGS += -DDWC_CCLIB
EXTRA_CFLAGS += -DDWC_CRYPTOLIB
EXTRA_CFLAGS += -DDWC_NOTIFYLIB
EXTRA_CFLAGS += -DDWC_UTFLIB

obj-$(CONFIG_USB_DWCOTG) += dwc_common_port_lib.o
dwc_common_port_lib-objs := dwc_cc.o dwc_modpow.o dwc_dh.o \
dwc_crypto.o dwc_notifier.o \
dwc_common_linux.o dwc_mem.o
dwc_common_port_lib-objs := dwc_cc.o dwc_modpow.o dwc_dh.o \
dwc_crypto.o dwc_notifier.o \
dwc_common_linux.o dwc_mem.o

kernrelwd := $(subst ., ,$(KERNELRELEASE))
kernrel3 := $(word 1,$(kernrelwd)).$(word 2,$(kernrelwd)).$(word 3,$(kernrelwd))

ifneq ($(kernrel3),2.6.20)
# grayg - I only know that we use EXTRA_CFLAGS in 2.6.31 actually
EXTRA_CFLAGS += $(CPPFLAGS)
endif

else

ifeq ($(KDIR),)
$(error Must give "KDIR=/path/to/kernel/source" on command line or in environment)
endif

ifeq ($(ARCH),)
$(error Must give "ARCH=<arch>" on command line or in environment. Also, if \
cross-compiling, must give "CROSS_COMPILE=/path/to/compiler/plus/tool-prefix-")
endif

ifeq ($(DOXYGEN),)
DOXYGEN := $(DOXYGEN)
DOXYGEN := doxygen
endif

default:
$(MAKE) -C$(KDIR) M=$(PWD) modules
$(MAKE) -C$(KDIR) M=$(PWD) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) modules

docs: $(wildcard *.[hc]) doc/doxygen.cfg
$(DOXYGEN) doc/doxygen.cfg
Expand All @@ -42,5 +55,4 @@ tags: $(wildcard *.[hc])
endif

clean:
rm -rf *.o *.ko .*cmd *.mod.c .tmp_versions Module.symvers

rm -rf *.o *.ko .*.cmd *.mod.c .*.o.d .*.o.tmp modules.order Module.markers Module.symvers .tmp_versions/
17 changes: 17 additions & 0 deletions drivers/usb/host/dwc_common_port/Makefile.fbsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
CFLAGS += -I/sys/i386/compile/GENERIC -I/sys/i386/include -I/usr/include
CFLAGS += -DDWC_FREEBSD
CFLAGS += -DDEBUG
#CFLAGS += -DDWC_DEBUG_REGS
#CFLAGS += -DDWC_DEBUG_MEMORY

#CFLAGS += -DDWC_LIBMODULE
#CFLAGS += -DDWC_CCLIB
#CFLAGS += -DDWC_CRYPTOLIB
#CFLAGS += -DDWC_NOTIFYLIB
#CFLAGS += -DDWC_UTFLIB

KMOD = dwc_common_port_lib
SRCS = dwc_cc.c dwc_modpow.c dwc_dh.c dwc_crypto.c dwc_notifier.c \
dwc_common_fbsd.c dwc_mem.c

.include <bsd.kmod.mk>
39 changes: 26 additions & 13 deletions drivers/usb/host/dwc_common_port/Makefile.linux
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,39 @@
#
ifneq ($(KERNELRELEASE),)

#CPPFLAGS += -DDEBUG_MEMORY

#CPPFLAGS += -DDEBUG
CPPFLAGS += -DDWC_LINUX

obj-m := dwc_common_port_lib.o
dwc_common_port_lib-objs := dwc_cc.o dwc_modpow.o dwc_dh.o \
dwc_crypto.o dwc_notifier.o \
dwc_common_linux.o dwc_mem.o
EXTRA_CFLAGS += -DDWC_LINUX
#EXTRA_CFLAGS += -DDEBUG
#EXTRA_CFLAGS += -DDWC_DEBUG_REGS
#EXTRA_CFLAGS += -DDWC_DEBUG_MEMORY

EXTRA_CFLAGS += -DDWC_LIBMODULE
EXTRA_CFLAGS += -DDWC_CCLIB
EXTRA_CFLAGS += -DDWC_CRYPTOLIB
EXTRA_CFLAGS += -DDWC_NOTIFYLIB
EXTRA_CFLAGS += -DDWC_UTFLIB

obj-m := dwc_common_port_lib.o
dwc_common_port_lib-objs := dwc_cc.o dwc_modpow.o dwc_dh.o \
dwc_crypto.o dwc_notifier.o \
dwc_common_linux.o dwc_mem.o

else

ifeq ($(KDIR),)
$(error Must give "KDIR=/path/to/kernel/source" on command line or in environment)
endif

ifeq ($(ARCH),)
$(error Must give "ARCH=<arch>" on command line or in environment. Also, if \
cross-compiling, must give "CROSS_COMPILE=/path/to/compiler/plus/tool-prefix-")
endif

ifeq ($(DOXYGEN),)
DOXYGEN := $(DOXYGEN)
DOXYGEN := doxygen
endif

default:
$(MAKE) -C$(KDIR) M=$(PWD) modules
$(MAKE) -C$(KDIR) M=$(PWD) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) modules

docs: $(wildcard *.[hc]) doc/doxygen.cfg
$(DOXYGEN) doc/doxygen.cfg
Expand All @@ -32,5 +46,4 @@ tags: $(wildcard *.[hc])
endif

clean:
rm -rf *.o *.ko .*cmd *.mod.c .tmp_versions Module.symvers

rm -rf *.o *.ko .*.cmd *.mod.c .*.o.d .*.o.tmp modules.order Module.markers Module.symvers .tmp_versions/
Loading