Changeset c47e1a8 in mainline for uspace/srv/hw


Ignore:
Timestamp:
2010-05-21T07:50:04Z (16 years ago)
Author:
Lenka Trochtova <trochtova.lenka@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d51ee2b
Parents:
cf8cc36 (diff), 15b592b (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 (rev. 451)

Location:
uspace/srv/hw
Files:
9 added
9 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hw/bus/cuda_adb/Makefile

    rcf8cc36 rc47e1a8  
    2828
    2929USPACE_PREFIX = ../../../..
    30 LIBS = $(LIBC_PREFIX)/libc.a
    31 
    32 OUTPUT = cuda_adb
     30BINARY = cuda_adb
    3331
    3432SOURCES = \
    3533        cuda_adb.c
    3634
    37 include ../../../Makefile.common
    38 
     35include $(USPACE_PREFIX)/Makefile.common
  • uspace/srv/hw/bus/cuda_adb/cuda_adb.c

    rcf8cc36 rc47e1a8  
    5555static void cuda_connection(ipc_callid_t iid, ipc_call_t *icall);
    5656static int cuda_init(void);
    57 static int cuda_claim(void);
    5857static void cuda_irq_handler(ipc_callid_t iid, ipc_call_t *call);
    5958
     
    255254static int cuda_init(void)
    256255{
     256        if (sysinfo_get_value("cuda.address.physical", &(instance->cuda_physical)) != EOK)
     257                return -1;
     258       
     259        if (sysinfo_get_value("cuda.address.kernel", &(instance->cuda_kernel)) != EOK)
     260                return -1;
     261       
    257262        void *vaddr;
    258 
    259         instance->cuda_physical = sysinfo_value("cuda.address.physical");
    260         instance->cuda_kernel = sysinfo_value("cuda.address.kernel");
    261 
    262263        if (pio_enable((void *) instance->cuda_physical, sizeof(cuda_t), &vaddr) != 0)
    263264                return -1;
     265       
    264266        dev = vaddr;
    265267
  • uspace/srv/hw/bus/pci/Makefile

    rcf8cc36 rc47e1a8  
    2929
    3030USPACE_PREFIX = ../../../..
    31 LIBS = $(LIBPCI_PREFIX)/libpci.a $(LIBC_PREFIX)/libc.a
     31LIBS = $(LIBPCI_PREFIX)/libpci.a
    3232EXTRA_CFLAGS = -I$(LIBPCI_PREFIX)
    33 
    34 OUTPUT = pci
     33BINARY = pci
    3534
    3635SOURCES = \
    3736        pci.c
    3837
    39 include ../../../Makefile.common
     38include $(USPACE_PREFIX)/Makefile.common
  • uspace/srv/hw/char/i8042/Makefile

    rcf8cc36 rc47e1a8  
    2929
    3030USPACE_PREFIX = ../../../..
    31 LIBS = $(LIBC_PREFIX)/libc.a
    32 
    33 OUTPUT = i8042
     31BINARY = i8042
    3432
    3533SOURCES = \
    3634        i8042.c
    3735
    38 include ../../../Makefile.common
     36include $(USPACE_PREFIX)/Makefile.common
  • uspace/srv/hw/char/i8042/i8042.c

    rcf8cc36 rc47e1a8  
    6868#define i8042_KBD_TRANSLATE     0x40
    6969
    70 /* Mouse constants */
    71 #define MOUSE_OUT_INIT  0xf4
    72 #define MOUSE_ACK       0xfa
    7370
    7471enum {
     
    167164static int i8042_init(void)
    168165{
     166        if (sysinfo_get_value("i8042.address.physical", &i8042_physical) != EOK)
     167                return -1;
     168       
     169        if (sysinfo_get_value("i8042.address.kernel", &i8042_kernel) != EOK)
     170                return -1;
     171       
    169172        void *vaddr;
    170 
    171         i8042_physical = sysinfo_value("i8042.address.physical");
    172         i8042_kernel = sysinfo_value("i8042.address.kernel");
    173173        if (pio_enable((void *) i8042_physical, sizeof(i8042_t), &vaddr) != 0)
    174174                return -1;
     175       
    175176        i8042 = vaddr;
    176 
     177       
     178        sysarg_t inr_a;
     179        sysarg_t inr_b;
     180       
     181        if (sysinfo_get_value("i8042.inr_a", &inr_a) != EOK)
     182                return -1;
     183       
     184        if (sysinfo_get_value("i8042.inr_b", &inr_b) != EOK)
     185                return -1;
     186       
    177187        async_set_interrupt_received(i8042_irq_handler);
    178 
    179         /* Disable kbd, enable mouse */
     188       
     189        /* Disable kbd and aux */
     190        wait_ready();
    180191        pio_write_8(&i8042->status, i8042_CMD_WRITE_CMDB);
    181192        wait_ready();
    182         pio_write_8(&i8042->status, i8042_CMD_WRITE_CMDB);
    183         wait_ready();
    184         pio_write_8(&i8042->data, i8042_KBD_DISABLE);
    185         wait_ready();
     193        pio_write_8(&i8042->data, i8042_KBD_DISABLE | i8042_AUX_DISABLE);
    186194
    187195        /* Flush all current IO */
     
    189197                (void) pio_read_8(&i8042->data);
    190198
    191         i8042_port_write(DEVID_AUX, MOUSE_OUT_INIT);
    192 
    193199        i8042_kbd.cmds[0].addr = (void *) &((i8042_t *) i8042_kernel)->status;
    194200        i8042_kbd.cmds[3].addr = (void *) &((i8042_t *) i8042_kernel)->data;
    195         ipc_register_irq(sysinfo_value("i8042.inr_a"), device_assign_devno(), 0, &i8042_kbd);
    196         ipc_register_irq(sysinfo_value("i8042.inr_b"), device_assign_devno(), 0, &i8042_kbd);
    197 
     201        ipc_register_irq(inr_a, device_assign_devno(), 0, &i8042_kbd);
     202        ipc_register_irq(inr_b, device_assign_devno(), 0, &i8042_kbd);
     203        printf("%s: registered for interrupts %d and %d\n", NAME, inr_a, inr_b);
     204
     205        wait_ready();
    198206        pio_write_8(&i8042->status, i8042_CMD_WRITE_CMDB);
    199207        wait_ready();
    200208        pio_write_8(&i8042->data, i8042_KBD_IE | i8042_KBD_TRANSLATE |
    201209            i8042_AUX_IE);
    202         wait_ready();
    203210
    204211        return 0;
     
    271278{
    272279        if (devid == DEVID_AUX) {
     280                wait_ready();
    273281                pio_write_8(&i8042->status, i8042_CMD_WRITE_AUX);
    274                 wait_ready();
    275         }
     282        }
     283        wait_ready();
    276284        pio_write_8(&i8042->data, data);
    277         wait_ready();
    278285}
    279286
  • uspace/srv/hw/cir/fhc/Makefile

    rcf8cc36 rc47e1a8  
    2929
    3030USPACE_PREFIX = ../../../..
    31 LIBS = $(LIBC_PREFIX)/libc.a
    32 
    33 OUTPUT = fhc
     31BINARY = fhc
    3432
    3533SOURCES = \
    3634        fhc.c
    3735
    38 include ../../../Makefile.common
     36include $(USPACE_PREFIX)/Makefile.common
  • uspace/srv/hw/cir/fhc/fhc.c

    rcf8cc36 rc47e1a8  
    109109static bool fhc_init(void)
    110110{
    111         ipcarg_t phonead;
     111        sysarg_t paddr;
    112112
    113         fhc_uart_size = sysinfo_value("fhc.uart.size");
    114         fhc_uart_phys = (void *) sysinfo_value("fhc.uart.physical");
    115        
    116         if (!fhc_uart_size) {
     113        if ((sysinfo_get_value("fhc.uart.physical", &paddr) != EOK)
     114            || (sysinfo_get_value("fhc.uart.size", &fhc_uart_size) != EOK)) {
    117115                printf(NAME ": no FHC UART registers found\n");
    118116                return false;
    119117        }
    120 
     118       
     119        fhc_uart_phys = (void *) paddr;
    121120        fhc_uart_virt = as_get_mappable_page(fhc_uart_size);
    122121       
     
    132131        printf(NAME ": FHC UART registers at %p, %d bytes\n", fhc_uart_phys,
    133132            fhc_uart_size);
    134 
     133       
    135134        async_set_client_connection(fhc_connection);
     135        ipcarg_t phonead;
    136136        ipc_connect_to_me(PHONE_NS, SERVICE_FHC, 0, 0, &phonead);
    137137       
  • uspace/srv/hw/cir/obio/Makefile

    rcf8cc36 rc47e1a8  
    2929
    3030USPACE_PREFIX = ../../../..
    31 LIBS = $(LIBC_PREFIX)/libc.a
    32 
    33 OUTPUT = obio
     31BINARY = obio
    3432
    3533SOURCES = \
    3634        obio.c
    3735
    38 include ../../../Makefile.common
     36include $(USPACE_PREFIX)/Makefile.common
  • uspace/srv/hw/cir/obio/obio.c

    rcf8cc36 rc47e1a8  
    112112static bool obio_init(void)
    113113{
    114         ipcarg_t phonead;
    115 
    116         base_phys = (void *) sysinfo_value("obio.base.physical");
     114        sysarg_t paddr;
    117115       
    118         if (!base_phys) {
     116        if (sysinfo_get_value("obio.base.physical", &paddr) != EOK) {
    119117                printf(NAME ": no OBIO registers found\n");
    120118                return false;
    121119        }
    122 
     120       
     121        base_phys = (void *) paddr;
    123122        base_virt = as_get_mappable_page(OBIO_SIZE);
    124123       
     
    133132       
    134133        printf(NAME ": OBIO registers with base at %p\n", base_phys);
    135 
     134       
    136135        async_set_client_connection(obio_connection);
     136        ipcarg_t phonead;
    137137        ipc_connect_to_me(PHONE_NS, SERVICE_OBIO, 0, 0, &phonead);
    138138       
Note: See TracChangeset for help on using the changeset viewer.