[U-Boot-Users] How to add a driver

Alex Parkinson okalex at gmail.com
Thu May 17 00:02:56 CEST 2007


Hey everyone,

I've written a very simple driver for an HD44780-compatible LCD which
I'd like to include into U-Boot to print a welcome screen while Linux
is booting on my AT91SAM9260EK board.  I've managed to get the driver
working, but only if I put all of my code into
board/at91sam9260ek/at91sam9260ek.c.  Obviously, this is terrible
form, and I'd like to have my code in separate files, hd44780.c and
hd44780.h, but I haven't been able to get U-Boot to compile when I do
this.  I #include <hd44780.h> into at91sam9260ek.c, where I'm calling
the hd44780_init() function, and I also added hd44780.o to COBJS in
board/at91sam9260ek/Makefile.

However, when I compile, I get an error stating that there is an
undefined reference to hd44780_init() in board_late_init() of
at91sam9260ek.c.  So my question is, what's the proper way to add a
driver to U-Boot, and where is the best place to initialize that
driver.  I've been searching the web for some information on the
subject, but have so far been able to find any.

Cheers,
Alex




More information about the U-Boot mailing list