Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 68d8736 in mainline


Ignore:
Timestamp:
2019-03-31T13:30:01Z (22 months ago)
Author:
Jakub Jermar <jakub@…>
Branches:
master
Children:
f5dd4a1
Parents:
bbb99f82
Message:

Add kconsole input/output support to mips32/malta

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • HelenOS.config

    rbbb99f82 r68d8736  
    407407
    408408% Support for Intel i8259 PIC
    409 ! [PLATFORM=ia32|PLATFORM=amd64] CONFIG_I8259 (y)
     409! [PLATFORM=ia32|PLATFORM=amd64|(PLATFORM=mips32&MACHINE=bmalta)|(PLATFORM=mips32&MACHINE=lmalta)] CONFIG_I8259 (y)
    410410
    411411% Virtually indexed D-cache support
     
    489489! [(CONFIG_HID_IN=generic|CONFIG_HID_IN=serial)&PLATFORM=ia64&MACHINE=i460GX] CONFIG_NS16550 (y/n)
    490490
     491% Support for NS16550 controller
     492! [CONFIG_HID_IN=generic&PLATFORM=mips32&(MACHINE=lmalta|MACHINE=bmalta)] CONFIG_NS16550 (y)
     493
    491494% Support for PL011 UART
    492495! [(CONFIG_HID_OUT=generic|CONFIG_HID_OUT=serial)&PLATFORM=arm32&(MACHINE=integratorcp|MACHINE=raspberrypi)] CONFIG_PL011_UART (y/n)
     
    501504! [(CONFIG_HID_OUT=generic|CONFIG_HID_OUT=serial)&(PLATFORM=ia32|PLATFORM=amd64)&CONFIG_NS16550_KCON=y] CONFIG_NS16550_OUT (y)
    502505
     506% Use NS16550 controller as dummy serial output (kernel console)
     507! [CONFIG_HID_OUT=generic&PLATFORM=mips32&(MACHINE=lmalta|MACHINE=bmalta)] CONFIG_NS16550_OUT (y)
     508
    503509% Support for Samsung S3C24XX on-chip UART
    504510! [(CONFIG_HID_OUT=generic|CONFIG_HID_OUT=serial)&PLATFORM=arm32&MACHINE=gta02] CONFIG_S3C24XX_UART (y/n)
     
    535541
    536542% Serial line input module
    537 ! [CONFIG_DSRLNIN=y|(PLATFORM=arm32&MACHINE=gta02)|(PLATFORM=arm32&MACHINE=integratorcp&CONFIG_PL011_UART=y)|(PLATFORM=arm32&MACHINE=beaglebone&CONFIG_OMAP_UART=y)|(PLATFORM=arm32&MACHINE=beagleboardxm&CONFIG_OMAP_UART=y)|(PLATFORM=ia64&MACHINE=i460GX&CONFIG_NS16550=y)|(PLATFORM=ia64&MACHINE=ski)|(PLATFORM=sparc64&PROCESSOR=sun4v)|(PLATFORM=arm32&MACHINE=raspberrypi&CONFIG_PL011_UART=y)|(PLATFORM=ia32&CONFIG_NS16550=y)|(PLATFORM=amd64&CONFIG_NS16550=y)] CONFIG_SRLN (y)
     543! [CONFIG_DSRLNIN=y|(PLATFORM=arm32&MACHINE=gta02)|(PLATFORM=arm32&MACHINE=integratorcp&CONFIG_PL011_UART=y)|(PLATFORM=arm32&MACHINE=beaglebone&CONFIG_OMAP_UART=y)|(PLATFORM=arm32&MACHINE=beagleboardxm&CONFIG_OMAP_UART=y)|(PLATFORM=ia64&MACHINE=i460GX&CONFIG_NS16550=y)|(PLATFORM=ia64&MACHINE=ski)|(PLATFORM=sparc64&PROCESSOR=sun4v)|(PLATFORM=arm32&MACHINE=raspberrypi&CONFIG_PL011_UART=y)|(PLATFORM=ia32&CONFIG_NS16550=y)|(PLATFORM=amd64&CONFIG_NS16550=y)|(PLATFORM=mips32&CONFIG_NS16550=y)] CONFIG_SRLN (y)
    538544
    539545% EGA support
  • kernel/arch/mips32/include/arch/mach/malta/malta.h

    rbbb99f82 r68d8736  
    3838
    3939#include <arch/machine_func.h>
     40#include <arch/mm/page.h>
     41
     42#define MALTA_PCI_BASE          PA2KSEG1(0x18000000UL)
     43#define MALTA_GT64120_BASE      PA2KSEG1(0x1be00000UL)
     44
     45#define PIC0_BASE               (MALTA_PCI_BASE + 0x20)
     46#define PIC1_BASE               (MALTA_PCI_BASE + 0xa0)
     47
     48#define TTY_BASE                (MALTA_PCI_BASE + 0x3f8)
     49#define TTY_CPU_INT             2
     50#define TTY_ISA_IRQ             4
     51
     52#define GT64120_PCI0_INTACK     (MALTA_GT64120_BASE + 0xc34)
    4053
    4154extern struct mips32_machine_ops malta_machine_ops;
  • kernel/arch/mips32/include/arch/mm/page.h

    rbbb99f82 r68d8736  
    4343
    4444#ifndef __ASSEMBLER__
     45#       define PA2KSEG1(x)      (((uintptr_t) (x)) + 0xa0000000)
    4546#       define KA2PA(x) (((uintptr_t) (x)) - 0x80000000)
    4647#       define PA2KA(x) (((uintptr_t) (x)) + 0x80000000)
  • kernel/arch/mips32/src/exception.c

    rbbb99f82 r68d8736  
    189189                                 */
    190190                                irq->handler(irq);
     191                                if (irq->cir)
     192                                        irq->cir(irq->cir_arg, i);
    191193                                irq_spinlock_unlock(&irq->lock, false);
    192194                        } else {
  • kernel/arch/mips32/src/mach/malta/malta.c

    rbbb99f82 r68d8736  
    3838#include <console/chardev.h>
    3939#include <arch/mm/page.h>
     40#include <genarch/drivers/i8259/i8259.h>
     41#include <genarch/drivers/ns16550/ns16550.h>
     42#include <genarch/srln/srln.h>
     43#include <arch/interrupt.h>
    4044
    4145static void malta_init(void);
     
    5761};
    5862
     63#ifdef CONFIG_NS16550
     64static ns16550_instance_t *tty_instance;
     65#endif
     66#ifdef CONFIG_NS16550_OUT
     67static outdev_t *tty_out;
     68#endif
     69
     70#ifdef CONFIG_NS16550
     71static void tty_clear_interrupt(void *arg, inr_t inr)
     72{
     73        (void) pio_read_8((ioport8_t *) GT64120_PCI0_INTACK);
     74        pic_eoi();
     75}
     76#endif
     77
    5978void malta_init(void)
    6079{
     80        i8259_init((i8259_t *) PIC0_BASE, (i8259_t *) PIC1_BASE, 2, 0, 8);
     81
     82#if (defined(CONFIG_NS16550) || defined(CONFIG_NS16550_OUT))
     83#ifdef CONFIG_NS16550_OUT
     84        outdev_t **tty_out_ptr = &tty_out;
     85#else
     86        outdev_t **tty_out_ptr = NULL;
     87#endif
     88        tty_instance = ns16550_init((ioport8_t *) TTY_BASE, 0, TTY_CPU_INT,
     89            tty_clear_interrupt, NULL, tty_out_ptr);
     90#endif
    6191}
    6292
     
    73103}
    74104
    75 #define YAMON_SUBR_BASE         PA2KA(0x1fc00500)
    76 #define YAMON_SUBR_PRINT_COUNT  (YAMON_SUBR_BASE + 0x4)
    77 
    78 typedef void (**yamon_print_count_ptr_t)(uint32_t, const char *, uint32_t);
    79 
    80 yamon_print_count_ptr_t yamon_print_count =
    81     (yamon_print_count_ptr_t) YAMON_SUBR_PRINT_COUNT;
    82 
    83 static void yamon_putwchar(outdev_t *dev, const wchar_t wch)
    84 {
    85 
    86         const char ch = (char) wch;
    87 
    88         (*yamon_print_count)(0, &ch, 1);
    89 }
    90 
    91 static outdev_t yamon_outdev;
    92 static outdev_operations_t yamon_outdev_ops = {
    93         .write = yamon_putwchar,
    94         .redraw = NULL,
    95         .scroll_up = NULL,
    96         .scroll_down = NULL
    97 };
    98 
    99105void malta_output_init(void)
    100106{
    101         outdev_initialize("yamon", &yamon_outdev, &yamon_outdev_ops);
    102         stdout_wire(&yamon_outdev);
     107#ifdef CONFIG_NS16550_OUT
     108        if (tty_out)
     109                stdout_wire(tty_out);
     110#endif
    103111}
    104112
    105113void malta_input_init(void)
    106114{
    107         (void) stdin_wire();
     115#ifdef CONFIG_NS16550
     116        if (tty_instance) {
     117                srln_instance_t *srln_instance = srln_init();
     118                if (srln_instance) {
     119                        indev_t *sink = stdin_wire();
     120                        indev_t *srln = srln_wire(srln_instance, sink);
     121                        ns16550_wire(tty_instance, srln);
     122                        pic_enable_irqs(1 << TTY_ISA_IRQ);
     123                        cp0_unmask_int(TTY_CPU_INT);
     124                }
     125        }
     126#endif
    108127}
    109128
Note: See TracChangeset for help on using the changeset viewer.