Rev 4341 | Rev 4344 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 4341 | Rev 4343 | ||
|---|---|---|---|
| Line 159... | Line 159... | ||
| 159 | 159 | ||
| 160 | /** SGCN character device */ |
160 | /** SGCN character device */ |
| 161 | chardev_t sgcn_io; |
161 | chardev_t sgcn_io; |
| 162 | 162 | ||
| 163 | /** |
163 | /** |
| 164 | * Registers the physical area of the SRAM so that the userspace SGCN |
164 | * Set some sysinfo values (SRAM address and SRAM size). |
| 165 | * driver can map it. Moreover, it sets some sysinfo values (SRAM address |
- | |
| 166 | * and SRAM size). |
- | |
| 167 | */ |
165 | */ |
| 168 | static void register_sram_parea(uintptr_t sram_begin_physical) |
166 | static void register_sram(uintptr_t sram_begin_physical) |
| 169 | { |
167 | { |
| 170 | static parea_t sram_parea; |
- | |
| 171 | sram_parea.pbase = sram_begin_physical; |
- | |
| 172 | sram_parea.vbase = (uintptr_t) sram_begin; |
- | |
| 173 | sram_parea.frames = MAPPED_AREA_SIZE / FRAME_SIZE; |
- | |
| 174 | sram_parea.cacheable = false; |
- | |
| 175 | ddi_parea_register(&sram_parea); |
- | |
| 176 | - | ||
| 177 | sysinfo_set_item_val("sram.area.size", NULL, MAPPED_AREA_SIZE); |
168 | sysinfo_set_item_val("sram.area.size", NULL, MAPPED_AREA_SIZE); |
| 178 | sysinfo_set_item_val("sram.address.physical", NULL, |
169 | sysinfo_set_item_val("sram.address.physical", NULL, |
| 179 | sram_begin_physical); |
170 | sram_begin_physical); |
| 180 | } |
171 | } |
| 181 | 172 | ||
| Line 209... | Line 200... | ||
| 209 | 200 | ||
| 210 | sram_begin_physical = SBBC_START + SBBC_SRAM_OFFSET |
201 | sram_begin_physical = SBBC_START + SBBC_SRAM_OFFSET |
| 211 | + *((uint32_t *) iosram_toc->value); |
202 | + *((uint32_t *) iosram_toc->value); |
| 212 | sram_begin = hw_map(sram_begin_physical, MAPPED_AREA_SIZE); |
203 | sram_begin = hw_map(sram_begin_physical, MAPPED_AREA_SIZE); |
| 213 | 204 | ||
| 214 | register_sram_parea(sram_begin_physical); |
205 | register_sram(sram_begin_physical); |
| 215 | } |
206 | } |
| 216 | 207 | ||
| 217 | /** |
208 | /** |
| 218 | * Initializes the starting address of the SGCN buffer. |
209 | * Initializes the starting address of the SGCN buffer. |
| 219 | * |
210 | * |
| Line 317... | Line 308... | ||
| 317 | } |
308 | } |
| 318 | 309 | ||
| 319 | /** |
310 | /** |
| 320 | * The driver works in polled mode, so no interrupt should be handled by it. |
311 | * The driver works in polled mode, so no interrupt should be handled by it. |
| 321 | */ |
312 | */ |
| 322 | static irq_ownership_t sgcn_claim(void) |
313 | static irq_ownership_t sgcn_claim(void *instance) |
| 323 | { |
314 | { |
| 324 | return IRQ_DECLINE; |
315 | return IRQ_DECLINE; |
| 325 | } |
316 | } |
| 326 | 317 | ||
| 327 | /** |
318 | /** |
| 328 | * The driver works in polled mode, so no interrupt should be handled by it. |
319 | * The driver works in polled mode, so no interrupt should be handled by it. |
| 329 | */ |
320 | */ |
| 330 | static void sgcn_irq_handler(irq_t *irq, void *arg, ...) |
321 | static void sgcn_irq_handler(irq_t *irq) |
| 331 | { |
322 | { |
| 332 | panic("Not yet implemented, SGCN works in polled mode."); |
323 | panic("Not yet implemented, SGCN works in polled mode."); |
| 333 | } |
324 | } |
| 334 | 325 | ||
| 335 | /** |
326 | /** |