Changeset e2cc9a0 in mainline for kernel/arch/sparc64/include


Ignore:
Timestamp:
2006-10-06T22:37:15Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
33b1903
Parents:
233af8c5
Message:

Add support for interrupt mapping in the Sabre PCI controller.
Add support for PCI and EBUS interrupt mapping via the OpenFirmware device tree.
Unfortunatelly, the code is not capable enough to earn single ns16550 interrupt.
I suspect something needs to be enabled in the EBUS registers.

Location:
kernel/arch/sparc64/include
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/sparc64/include/asm.h

    r233af8c5 re2cc9a0  
    325325        uint64_t v;
    326326       
    327         __asm__ volatile ("ldxa [%1] %2, %0\n" : "=r" (v) : "r" (va), "i" (asi));
     327        __asm__ volatile ("ldxa [%1] %2, %0\n" : "=r" (v) : "r" (va), "i" ((unsigned) asi));
    328328       
    329329        return v;
     
    338338static inline void asi_u64_write(asi_t asi, uintptr_t va, uint64_t v)
    339339{
    340         __asm__ volatile ("stxa %0, [%1] %2\n" : :  "r" (v), "r" (va), "i" (asi) : "memory");
     340        __asm__ volatile ("stxa %0, [%1] %2\n" : :  "r" (v), "r" (va), "i" ((unsigned) asi) : "memory");
    341341}
    342342
  • kernel/arch/sparc64/include/drivers/ns16550.h

    r233af8c5 re2cc9a0  
    3939#include <arch/drivers/kbd.h>
    4040
     41/* NS16550 registers */
    4142#define RBR_REG         0       /** Receiver Buffer Register. */
    4243#define IER_REG         1       /** Interrupt Enable Register. */
     44#define IIR_REG         2       /** Interrupt Ident Register (read). */
     45#define FCR_REG         2       /** FIFO control register (write). */
     46#define LCR_REG         3       /** Line Control register. */
    4347#define LSR_REG         5       /** Line Status Register. */
     48
     49#define IER_ERBFI       0x01    /** Enable Receive Buffer Full Interrupt. */
     50
     51#define LCR_DLAB        0x80    /** Divisor Latch Access bit. */
    4452
    4553static inline uint8_t ns16550_rbr_read(void)
     
    5866}
    5967
     68static inline uint8_t ns16550_iir_read(void)
     69{
     70        return kbd_virt_address[IIR_REG];
     71}
     72
     73static inline void ns16550_fcr_write(uint8_t v)
     74{
     75        kbd_virt_address[FCR_REG] = v;
     76}
     77
     78static inline uint8_t ns16550_lcr_read(void)
     79{
     80        return kbd_virt_address[LCR_REG];
     81}
     82
     83static inline void ns16550_lcr_write(uint8_t v)
     84{
     85        kbd_virt_address[LCR_REG] = v;
     86}
     87
    6088static inline uint8_t ns16550_lsr_read(void)
    6189{
  • kernel/arch/sparc64/include/trap/interrupt.h

    r233af8c5 re2cc9a0  
    4040#include <arch/trap/trap_table.h>
    4141#include <arch/stack.h>
     42
     43/* IMAP register bits */
     44#define IGN_MASK        0x7c0
     45#define INO_MASK        0x1f
     46#define IMAP_V_MASK     (1ULL<<31)
     47
     48#define IGN_SHIFT       6
     49
    4250
    4351/* Interrupt ASI registers. */
Note: See TracChangeset for help on using the changeset viewer.