Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hw/irc/obio/obio.c

    rdf01d303 r3e6a98c5  
    4545#include <ipc/irc.h>
    4646#include <ns.h>
     47#include <sysinfo.h>
    4748#include <as.h>
    4849#include <ddi.h>
     
    6869#define INO_MASK        0x1f
    6970
    70 static uintptr_t base_phys;
    71 static volatile uint64_t *base_virt = (volatile uint64_t *) AS_AREA_ANY;
     71static void *base_phys;
     72static volatile uint64_t *base_virt;
    7273
    7374/** Handle one connection to obio.
     
    9394                switch (IPC_GET_IMETHOD(call)) {
    9495                case IRC_ENABLE_INTERRUPT:
    95                         inr = IPC_GET_ARG1(call);
    96                         base_virt[OBIO_IMR(inr & INO_MASK)] |= (1UL << 31);
     96                        /* Noop */
    9797                        async_answer_0(callid, EOK);
    9898                        break;
     
    111111/** Initialize the OBIO driver.
    112112 *
    113  * In the future, the OBIO driver should be integrated with the sun4u platform driver.
     113 * So far, the driver heavily depends on information provided by the kernel via
     114 * sysinfo. In the future, there should be a standalone OBIO driver.
    114115 */
    115116static bool obio_init(void)
    116117{
    117         base_phys = (uintptr_t) 0x1fe00000000ULL;
     118        sysarg_t paddr;
     119       
     120        if (sysinfo_get_value("obio.base.physical", &paddr) != EOK) {
     121                printf("%s: No OBIO registers found\n", NAME);
     122                return false;
     123        }
     124       
     125        base_phys = (void *) paddr;
    118126       
    119127        int flags = AS_AREA_READ | AS_AREA_WRITE;
     
    127135        }
    128136       
    129         printf("%s: OBIO registers with base at %lx\n", NAME, base_phys);
     137        printf("%s: OBIO registers with base at %p\n", NAME, base_phys);
    130138       
    131         async_set_fallback_port_handler(obio_connection, NULL);
     139        async_set_client_connection(obio_connection);
    132140        service_register(SERVICE_IRC);
    133141       
Note: See TracChangeset for help on using the changeset viewer.