uClinux usb host support

Hello,

I have an LPC2478STK purchased from Olimex. This comes together with an uClinux distribution, cross compiler and bootloader.

Now I want to use the usb controller to use an Bluetooth dongle on my board. The goal of my project is to create a Bluetooth connection from the board.

Within the kernel (2.6.24.2) of the distribution I have enable the USB-support (in device drivers) and the I have enabled then Support for Host-side USB. That is required to use the Bluetooth dongle of the pc.

However when I exit the menuconfig of the kernel and issue a make in the uClinux distribution I get the following error:

##########################################################################

:1365:2: warning: #warning syscall epoll_pwait not implemented

CHK include/linux/compile.h

LD drivers/usb/built-in.o

LD drivers/built-in.o

LD vmlinux.o

MODPOST vmlinux.o

GEN .version

CHK include/linux/compile.h

UPD include/linux/compile.h

CC init/version.o

LD init/built-in.o

LD vmlinux

drivers/built-in.o: In function `dma_map_sg’:

include/asm/dma-mapping.h:281: undefined reference to `dma_cache_maint’

drivers/built-in.o: In function `dma_map_single’:

include/asm/dma-mapping.h:168: undefined reference to `dma_cache_maint’

include/asm/dma-mapping.h:168: undefined reference to `dma_cache_maint’

make[1]: *** [vmlinux] Error 1

make[1]: Leaving directory `/home/user/lpc-2478-uclinux/uClinux-dist-lpc_2478_stk/linux-2.6.24.2-lpc2478-patched’

make: *** [linux] Error 1

#######################################################################

That is the only thing I have changed instead of the default configuration.

Does anybody have any idea how to solve this ??

Thanks in advance,

Erwin

I have the same problem. I found dma_cache_maint defined here:

linux-2.6.24.2-lpc2478-patched/arch/arm/mm/consistent.c:483:void dma_cache_maint(const void *start, size_t size, int direction)

linux-2.6.x/arch/arm/mm/consistent.c:483:void dma_cache_maint(const void *start, size_t size, int direction)

I included the MMU in the kernel menuconfig options and it compiled, but it would hang when trying to startup uClinux. I did a make clean and removed the MMU option from my config and it would still hang. I had to unpack the src code into another folder and rebuild the image from scratch (without MMU and USB host) to get uClinux to boot again.

That uClinux not boot looks logical because our processor (lpc 2478) has no mmu.

I’ve looked deeper into the problem.

within dmamapping.h there is an prototype:

extern void dma_cache_maint(const void *kaddr, size_t size, int rw);

that is the one being called.

Within the same file there is also an include to <mm.h> and when you look in the folder:

uClinux-dist-lpc_2478_stk/linux-2.6.24.2-lpc2478-patched/arch/arm/mm

there is a makefile which has the following content:

obj-$(CONFIG_MMU) += fault-armv.o flush.o ioremap.o mmap.o \

pgd.o mmu.o consistent.o

ifneq ($(CONFIG_MMU),y)

obj-y += nommu.o consistent-nommu.o

endif

Within this folder the nommu.o and the consistent-nommu.o is being linked and the function that dmamapping.h is looking is within consistent.o which is not being linked.

However within the file consistent-nommu.c there is a function called:

void consistent_sync(const void *start, size_t size, int direction)

It looks like this function is the replacement of

void dma_cache_maint(const void *start, size_t size, int direction) within consistent.c

The solution might be to replace the dma_cache_maint to consistent_sync and hopes it works. I will try it out and post if I have news.

Kind regards,

Erwin

Hello,

I’ve done the following:

Within the file /include/asm/dma-mapping.h:

On rule 20:

//extern void dma_cache_maint(const void *kaddr, size_t size, int rw);

extern void consistent_sync(const void *start, size_t size, int direction);

Further on within the same file, everywhere dma_cache_maint is called, I call the method consistent_sync.

For example:

consistent_sync(cpu_addr, size, dir);

//dma_cache_maint(cpu_addr, size, dir);

Afterwards I have run a “make” command in de uClinux distribution and everything builds. Afterwards booted the board and no problems.

Then I’ve configured the kernel to support my usb bluetooth dongle.

The following configuration:

In Device Drivers->USB support:

  • Support for Host-side USB

  • USB verbose debug messages

  • USB device filesystem

  • USB device class-devices (DEPRECATED)

  • ISP116X HCD support

ISP1362 HCD support

  • SL811HS HCD support

  • R8A66597 HCD support

  • USB Mass Storage support

In Networking →

  • Bluetooth subsystem support —>

  • L2CAP protocol support

  • SCO links support

  • RFCOMM protocol support

  • RFCOMM TTY support

  • BNEP protocol support

  • Multicast filter support

  • Protocol filter support

  • HIDP protocol support

Bluetooth device drivers —>

  • HCI USB driver

  • SCO (voice) support

  • HCI UART driver

  • UART (H4) protocol support

  • BCSP protocol support

HCILL protocol support

  • HCI BCM203x USB driver

  • HCI BPA10x USB driver

  • HCI BlueFRITZ! USB driver

  • HCI VHCI (Virtual HCI device) driver

If afterwards I try to open the device, I get the message that there is no such device.

It looks like the usb dongle is not connected.

Within the boot messages of the board I can see a lot of drivers loaded however I can’t find anywhere that a usb device has been connected. How can I verify if a device has been connected and what do I have to change to make the device work.

I hope anyone can help.

Regards

Erwin