Ignore:
Timestamp:
2011-07-20T15:26:21Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
efcebe1
Parents:
25bef0ff (diff), a701812 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/genarch/src/drivers/s3c24xx_uart/s3c24xx_uart.c

    r25bef0ff r6a44ee4  
    4444#include <arch/asm.h>
    4545#include <mm/slab.h>
     46#include <mm/page.h>
    4647#include <sysinfo/sysinfo.h>
    4748#include <str.h>
     
    5960}
    6061
    61 static void s3c24xx_uart_putchar(outdev_t *dev, wchar_t ch, bool silent)
     62static void s3c24xx_uart_putchar(outdev_t *dev, wchar_t ch)
    6263{
    63         if (!silent) {
     64        s3c24xx_uart_t *uart =
     65            (s3c24xx_uart_t *) dev->data;
     66       
     67        if ((!uart->parea.mapped) || (console_override)) {
    6468                if (!ascii_check(ch)) {
    6569                        s3c24xx_uart_sendb(dev, U_SPECIAL);
    6670                } else {
    67                         if (ch == '\n')
     71                        if (ch == '\n')
    6872                                s3c24xx_uart_sendb(dev, (uint8_t) '\r');
    6973                        s3c24xx_uart_sendb(dev, (uint8_t) ch);
     
    9397};
    9498
    95 outdev_t *s3c24xx_uart_init(s3c24xx_uart_io_t *io, inr_t inr)
     99outdev_t *s3c24xx_uart_init(uintptr_t paddr, inr_t inr)
    96100{
    97101        outdev_t *uart_dev = malloc(sizeof(outdev_t), FRAME_ATOMIC);
     
    109113        uart_dev->data = uart;
    110114
    111         uart->io = io;
     115        uart->io = (s3c24xx_uart_io_t *) hw_map(paddr, PAGE_SIZE);
    112116        uart->indev = NULL;
    113117
     
    127131        pio_write_32(&uart->io->ucon,
    128132            pio_read_32(&uart->io->ucon) & ~UCON_RX_INT_LEVEL);
    129 
     133       
     134        link_initialize(&uart->parea.link);
     135        uart->parea.pbase = paddr;
     136        uart->parea.frames = 1;
     137        uart->parea.unpriv = false;
     138        uart->parea.mapped = false;
     139        ddi_parea_register(&uart->parea);
     140       
    130141        if (!fb_exported) {
    131142                /*
    132                  * This is the necessary evil until the userspace driver is entirely
     143                 * This is the necessary evil until
     144                 * the userspace driver is entirely
    133145                 * self-sufficient.
    134146                 */
    135147                sysinfo_set_item_val("fb", NULL, true);
    136148                sysinfo_set_item_val("fb.kind", NULL, 3);
    137                 sysinfo_set_item_val("fb.address.physical", NULL, KA2PA(io));
     149                sysinfo_set_item_val("fb.address.physical", NULL, paddr);
    138150
    139151                fb_exported = true;
Note: See TracChangeset for help on using the changeset viewer.