Subversion Repositories HelenOS

Rev

Rev 3716 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3716 Rev 3908
Line 119... Line 119...
119
/**
119
/**
120
 * Initializes the SGCN serial driver.
120
 * Initializes the SGCN serial driver.
121
 */
121
 */
122
int sgcn_init(void)
122
int sgcn_init(void)
123
{
123
{
124
    sram_virt_addr = (uintptr_t) as_get_mappable_page(
124
    sram_virt_addr = (uintptr_t) as_get_mappable_page(sysinfo_value("sram.area.size"));
125
        sysinfo_value("sram.area.size"));
-
 
126
    int result = physmem_map(
-
 
-
 
125
   
127
        (void *) sysinfo_value("sram.address.physical"),
126
    if (physmem_map((void *) sysinfo_value("sram.address.physical"),
128
        (void *) sram_virt_addr,
-
 
129
        sysinfo_value("sram.area.size") / PAGE_SIZE,
127
        (void *) sram_virt_addr, sysinfo_value("sram.area.size") / PAGE_SIZE,
130
        AS_AREA_READ | AS_AREA_WRITE
128
        AS_AREA_READ | AS_AREA_WRITE) != 0)
131
        );
-
 
132
    if (result != 0) {
-
 
133
        printf("SGCN: uspace driver couldn't map physical memory: %d\n",
-
 
134
            result);
129
        return -1;
135
    }
-
 
136
   
130
   
137
    serial_console_init(sgcn_putc, WIDTH, HEIGHT);
131
    serial_console_init(sgcn_putc, WIDTH, HEIGHT);
138
   
132
   
139
    sram_buffer_offset = sysinfo_value("sram.buffer.offset");
133
    sram_buffer_offset = sysinfo_value("sram.buffer.offset");
140
   
134