I'm trying to write a frame buffer device driver who communicate with
the VGA-controller using serial port 2 on my Fox Board. For the first
step I have tried to send out some data on the port but there is no
activity at all on the tx-pin. I'm using the following code compiled
and loaded as a kernel module. I have turned off serial port 2 in the
kernelconfig and compiled a new kernel image and downloaded it to the
Foxboard so there are probably no conflict with the normal serial driver.

Please, any help I can get it to work well be fine.

/Lars

test.c
-----------------------------------
#include <asm/types.h>
#include <linux/kernel.h>
#include <linux/module.h>

MODULE_LICENSE("GPL");
MODULE_VERSION("1.2");

int init_uVGA(void) {

   *R_SERIAL2_REC_CTRL = 0x20;
   *R_SERIAL2_TR_CTRL = 0x40;
   *R_SERIAL2_BAUD = 0x99;

   while (!(*R_SERIAL2_STATUS && 0x20)) {}
   *R_SERIAL2_TR_DATA = 'U';

   printk("<1>Status: %x\n",*R_SERIAL2_STATUS);

   while (!(*R_SERIAL2_STATUS && 0x20)) {}
   printk("<1>Auto Baud ready!\n");

   *R_SERIAL2_TR_DATA = 0x56;

   while (!(*R_SERIAL2_STATUS && 0x20)) {}
   *R_SERIAL2_TR_DATA = 0x01;   
   while (!(*R_SERIAL2_STATUS && 0x20)) {}

   printk("<1>Device Info Request ready!\n");

   return 0;
}

void cleanup_uVGA(void) {
   printk("<1>Goodbye world\n");
}

module_init(init_uVGA);
module_exit(cleanup_uVGA);

Makefile:
-------------------------
MODULE = uvga.o
uvga-y = test.o

EXTRA_CFLAGS += -DNOKERNEL $(USER_OPT)

PREVENT_RECURSIVE_INCLUDE = 1
include $(AXIS_TOP_DIR)/modules/rules.build_modules
-------------------------


Reply via email to