checking uart overrun and framing error flags in linux
I've read and written to registers in the past by writing a kernel module that creates an entry in the /proc filesytem. Then I can read the registers by doing cat /proc/lpc32xx_regcheck for example. 

This code might be garbage; It might be against "best practices" to do it this way. I'm not a Linux programmer by any means, but it worked for me for debugging. 

#include &lt;linux/init.h&gt;
#include &lt;linux/module.h&gt;
#include &lt;linux/device.h&gt;
#include &lt;linux/io.h&gt;
#include &lt;linux/kernel.h&gt;
#include &lt;linux/init.h&gt;
#include &lt;linux/fs.h&gt;
#include &lt;linux/proc_fs.h&gt;
#include &lt;linux/fb.h&gt;
#include &lt;linux/stat.h&gt;

#include &lt;mach/platform.h&gt;
#include &lt;mach/hardware.h&gt;
#include &lt;mach/i2s.h&gt;

struct proc_dir_entry *lpc32xx_regcheck = NULL;
static int my_proc_read(char *buf, char **start, off_t offset, int count, int *eof);

static int my_proc_read(char *buf, char **start, off_t offset, int count, int *eof)
{
    int len = 0;

    len += sprintf( buf + len, "LPC3250 I2S REGISTER DUMP:\n");
    len += sprintf( buf + len, "I2S0 RXFIFO     :0x%X\n", __raw_readl(io_p2v(0x2009400C)));
    len += sprintf( buf + len, "I2S1 RXFIFO     :0x%X\n", __raw_readl(io_p2v(0x2009C00C)));
    len += sprintf( buf + len, "I2S0 STATE      :0x%X\n", __raw_readl(io_p2v(0x20094010)));
    len += sprintf( buf + len, "I2S1 STATE      :0x%X\n", __raw_readl(io_p2v(0x2009C010)));
    len += sprintf( buf + len, "I2S0 DMA0       :0x%X\n", __raw_readl(io_p2v(0x20094014)));
    len += sprintf( buf + len, "I2S1 DMA0       :0x%X\n", __raw_readl(io_p2v(0x2009C014)));
    len += sprintf( buf + len, "I2S0 DMA1       :0x%X\n", __raw_readl(io_p2v(0x20094018)));
    len += sprintf( buf + len, "I2S1 DMA1       :0x%X\n", __raw_readl(io_p2v(0x2009C018)));
    len += sprintf( buf + len, "I2S0 IRQ        :0x%X\n", __raw_readl(io_p2v(0x2009401C)));
    len += sprintf( buf + len, "I2S1 IRQ        :0x%X\n", __raw_readl(io_p2v(0x2009C01C)));
    len += sprintf( buf + len, "I2S0 TXRATE     :0x%X\n", __raw_readl(io_p2v(0x20094020)));
    len += sprintf( buf + len, "I2S1 TXRATE     :0x%X\n", __raw_readl(io_p2v(0x2009C020)));
    len += sprintf( buf + len, "I2S0 RXRATE     :0x%X\n", __raw_readl(io_p2v(0x20094024)));
    len += sprintf( buf + len, "I2S1 RXRATE     :0x%X\n", __raw_readl(io_p2v(0x2009C024)));

     len += sprintf( buf + len, "\nWriting to P_MUX_CLR...\n");
    __raw_writel(0x1c,io_p2v(0x40028104));

    len += sprintf( buf + len, "NEW P_MUX STATE :0x%X\n", __raw_readl(io_p2v(0x40028108)));

    if(len &lt;= count + offset)
        *eof = 1;
    *start = buf + offset;

    len -= offset;

    if( len &gt; count)
        len = count;
    if( len &lt;0)
        len = 0;

    return len;
}


static int __init test_init(void)
{
    printk("Hello.\n");

    lpc32xx_regcheck = create_proc_entry("lpc32xx_regcheck", S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH, NULL);

    if (lpc32xx_regcheck)
    {
        lpc32xx_regcheck-&gt;read_proc = my_proc_read;
    }

    return 0;
}

static void __exit test_exit(void)
{
    printk("Goodbye.\n");
}

module_init(test_init);
module_exit(test_exit);

MODULE_AUTHOR("dext0rb");
MODULE_LICENSE("LOL");