bus_space_rmi.c revision 204131
11541Srgrimes/*- 21541Srgrimes * Copyright (c) 2009 RMI Corporation 31541Srgrimes * All rights reserved. 41541Srgrimes * 51541Srgrimes * Redistribution and use in source and binary forms, with or without 61541Srgrimes * modification, are permitted provided that the following conditions 71541Srgrimes * are met: 81541Srgrimes * 1. Redistributions of source code must retain the above copyright 91541Srgrimes * notice, this list of conditions and the following disclaimer. 101541Srgrimes * 2. Redistributions in binary form must reproduce the above copyright 111541Srgrimes * notice, this list of conditions and the following disclaimer in the 121541Srgrimes * documentation and/or other materials provided with the distribution. 131541Srgrimes * 141541Srgrimes * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 151541Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 161541Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 171541Srgrimes * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 181541Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 191541Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 201541Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 211541Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 221541Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 231541Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 241541Srgrimes * SUCH DAMAGE. 251541Srgrimes * 261541Srgrimes * $FreeBSD: head/sys/mips/rmi/bus_space_rmi.c 204131 2010-02-20 16:32:33Z rrs $ 271541Srgrimes */ 281541Srgrimes#include <sys/cdefs.h> 291541Srgrimes__FBSDID("$FreeBSD: head/sys/mips/rmi/bus_space_rmi.c 204131 2010-02-20 16:32:33Z rrs $"); 301541Srgrimes 311541Srgrimes#include <sys/param.h> 321541Srgrimes#include <sys/systm.h> 331541Srgrimes#include <sys/bus.h> 341541Srgrimes#include <sys/kernel.h> 351541Srgrimes#include <sys/endian.h> 361541Srgrimes#include <sys/malloc.h> 371541Srgrimes#include <sys/ktr.h> 3822521Sdyson 3945773Sdcs#include <vm/vm.h> 401541Srgrimes#include <vm/pmap.h> 411541Srgrimes#include <vm/vm_kern.h> 421541Srgrimes#include <vm/vm_extern.h> 431541Srgrimes 441541Srgrimes#include <machine/bus.h> 451541Srgrimes#include <machine/cache.h> 461541Srgrimes 471541Srgrimesstatic int 485651Sjoergrmi_bus_space_map(void *t, bus_addr_t addr, 495651Sjoerg bus_size_t size, int flags, 505651Sjoerg bus_space_handle_t * bshp); 515651Sjoerg 525651Sjoergstatic void 531541Srgrimesrmi_bus_space_unmap(void *t, bus_space_handle_t bsh, 541541Srgrimes bus_size_t size); 551541Srgrimes 561541Srgrimesstatic int 5745773Sdcsrmi_bus_space_subregion(void *t, 581541Srgrimes bus_space_handle_t bsh, 591541Srgrimes bus_size_t offset, bus_size_t size, 601541Srgrimes bus_space_handle_t * nbshp); 615651Sjoerg 621541Srgrimesstatic u_int8_t 635651Sjoergrmi_bus_space_read_1(void *t, 645651Sjoerg bus_space_handle_t handle, 651541Srgrimes bus_size_t offset); 665651Sjoerg 675651Sjoergstatic u_int16_t 685651Sjoergrmi_bus_space_read_2(void *t, 695651Sjoerg bus_space_handle_t handle, 701541Srgrimes bus_size_t offset); 711541Srgrimes 721541Srgrimesstatic u_int32_t 731541Srgrimesrmi_bus_space_read_4(void *t, 741541Srgrimes bus_space_handle_t handle, 751541Srgrimes bus_size_t offset); 761541Srgrimes 771541Srgrimesstatic void 781541Srgrimesrmi_bus_space_read_multi_1(void *t, 791541Srgrimes bus_space_handle_t handle, 801541Srgrimes bus_size_t offset, u_int8_t * addr, 811541Srgrimes size_t count); 821541Srgrimes 831541Srgrimesstatic void 841541Srgrimesrmi_bus_space_read_multi_2(void *t, 851541Srgrimes bus_space_handle_t handle, 861541Srgrimes bus_size_t offset, u_int16_t * addr, 871541Srgrimes size_t count); 881541Srgrimes 891541Srgrimesstatic void 901541Srgrimesrmi_bus_space_read_multi_4(void *t, 911541Srgrimes bus_space_handle_t handle, 921541Srgrimes bus_size_t offset, u_int32_t * addr, 931541Srgrimes size_t count); 941541Srgrimes 951541Srgrimesstatic void 961541Srgrimesrmi_bus_space_read_region_1(void *t, 971541Srgrimes bus_space_handle_t bsh, 981541Srgrimes bus_size_t offset, u_int8_t * addr, 991541Srgrimes size_t count); 1001541Srgrimes 1011541Srgrimesstatic void 10245773Sdcsrmi_bus_space_read_region_2(void *t, 10345773Sdcs bus_space_handle_t bsh, 10445773Sdcs bus_size_t offset, u_int16_t * addr, 10545773Sdcs size_t count); 10645773Sdcs 10745773Sdcsstatic void 10845773Sdcsrmi_bus_space_read_region_4(void *t, 10945773Sdcs bus_space_handle_t bsh, 11045773Sdcs bus_size_t offset, u_int32_t * addr, 11145773Sdcs size_t count); 11245773Sdcs 11345773Sdcsstatic void 11445773Sdcsrmi_bus_space_write_1(void *t, 11545773Sdcs bus_space_handle_t handle, 11645773Sdcs bus_size_t offset, u_int8_t value); 11745773Sdcs 11845773Sdcsstatic void 11945773Sdcsrmi_bus_space_write_2(void *t, 12045773Sdcs bus_space_handle_t handle, 12145773Sdcs bus_size_t offset, u_int16_t value); 12245773Sdcs 12345773Sdcsstatic void 12445773Sdcsrmi_bus_space_write_4(void *t, 12545773Sdcs bus_space_handle_t handle, 12645773Sdcs bus_size_t offset, u_int32_t value); 12745773Sdcs 12845773Sdcsstatic void 12945773Sdcsrmi_bus_space_write_multi_1(void *t, 13045773Sdcs bus_space_handle_t handle, 13145773Sdcs bus_size_t offset, 13245773Sdcs const u_int8_t * addr, 13345773Sdcs size_t count); 13445773Sdcs 13545773Sdcsstatic void 13645773Sdcsrmi_bus_space_write_multi_2(void *t, 13745773Sdcs bus_space_handle_t handle, 13845773Sdcs bus_size_t offset, 13945773Sdcs const u_int16_t * addr, 14045773Sdcs size_t count); 14145773Sdcs 14245773Sdcsstatic void 1435651Sjoergrmi_bus_space_write_multi_4(void *t, 1445651Sjoerg bus_space_handle_t handle, 1455651Sjoerg bus_size_t offset, 1465651Sjoerg const u_int32_t * addr, 1475651Sjoerg size_t count); 1485651Sjoerg 1495651Sjoergstatic void 1505651Sjoergrmi_bus_space_write_region_2(void *t, 1515651Sjoerg bus_space_handle_t bsh, 1525651Sjoerg bus_size_t offset, 1535651Sjoerg const u_int16_t * addr, 1545651Sjoerg size_t count); 1555651Sjoerg 1565651Sjoergstatic void 1575651Sjoergrmi_bus_space_write_region_4(void *t, 1585651Sjoerg bus_space_handle_t bsh, 1595651Sjoerg bus_size_t offset, 1605651Sjoerg const u_int32_t * addr, 1615651Sjoerg size_t count); 1625651Sjoerg 1635651Sjoerg 1645651Sjoergstatic void 1655651Sjoergrmi_bus_space_set_region_2(void *t, 1665651Sjoerg bus_space_handle_t bsh, 1675651Sjoerg bus_size_t offset, u_int16_t value, 1685651Sjoerg size_t count); 1695651Sjoergstatic void 1705651Sjoergrmi_bus_space_set_region_4(void *t, 1715651Sjoerg bus_space_handle_t bsh, 1725651Sjoerg bus_size_t offset, u_int32_t value, 1735651Sjoerg size_t count); 1745651Sjoerg 1755651Sjoergstatic void 1765651Sjoergrmi_bus_space_barrier(void *tag __unused, bus_space_handle_t bsh __unused, 1775651Sjoerg bus_size_t offset __unused, bus_size_t len __unused, int flags); 1785651Sjoerg 1795651Sjoergstatic void 1801541Srgrimesrmi_bus_space_copy_region_2(void *t, 1811541Srgrimes bus_space_handle_t bsh1, 1821541Srgrimes bus_size_t off1, 18322521Sdyson bus_space_handle_t bsh2, 18422521Sdyson bus_size_t off2, size_t count); 1851541Srgrimes 1861541Srgrimesu_int8_t 1871541Srgrimesrmi_bus_space_read_stream_1(void *t, bus_space_handle_t handle, 1881541Srgrimes bus_size_t offset); 1891541Srgrimes 1901541Srgrimesstatic u_int16_t 19122521Sdysonrmi_bus_space_read_stream_2(void *t, bus_space_handle_t handle, 1921541Srgrimes bus_size_t offset); 1931541Srgrimes 1941541Srgrimesstatic u_int32_t 1951541Srgrimesrmi_bus_space_read_stream_4(void *t, bus_space_handle_t handle, 1961541Srgrimes bus_size_t offset); 1971541Srgrimesstatic void 19822521Sdysonrmi_bus_space_read_multi_stream_1(void *t, 19922521Sdyson bus_space_handle_t handle, 20022521Sdyson bus_size_t offset, u_int8_t * addr, 2011541Srgrimes size_t count); 2021541Srgrimes 2031541Srgrimesstatic void 2041541Srgrimesrmi_bus_space_read_multi_stream_2(void *t, 2051541Srgrimes bus_space_handle_t handle, 2061541Srgrimes bus_size_t offset, u_int16_t * addr, 20722521Sdyson size_t count); 2081541Srgrimes 2091541Srgrimesstatic void 2101541Srgrimesrmi_bus_space_read_multi_stream_4(void *t, 2111541Srgrimes bus_space_handle_t handle, 2121541Srgrimes bus_size_t offset, u_int32_t * addr, 21322521Sdyson size_t count); 2141541Srgrimes 2151541Srgrimesvoid 21625531Sjoergrmi_bus_space_write_stream_1(void *t, bus_space_handle_t bsh, 21725531Sjoerg bus_size_t offset, u_int8_t value); 2181541Srgrimesstatic void 2195651Sjoergrmi_bus_space_write_stream_2(void *t, bus_space_handle_t handle, 22045773Sdcs bus_size_t offset, u_int16_t value); 2211541Srgrimes 2221541Srgrimesstatic void 2231541Srgrimesrmi_bus_space_write_stream_4(void *t, bus_space_handle_t handle, 2241541Srgrimes bus_size_t offset, u_int32_t value); 2251541Srgrimes 2261541Srgrimesstatic void 2271541Srgrimesrmi_bus_space_write_multi_stream_1(void *t, 2281541Srgrimes bus_space_handle_t handle, 2291541Srgrimes bus_size_t offset, 2301541Srgrimes const u_int8_t * addr, 2311541Srgrimes size_t count); 2321541Srgrimesstatic void 2331541Srgrimesrmi_bus_space_write_multi_stream_2(void *t, 2341541Srgrimes bus_space_handle_t handle, 2351541Srgrimes bus_size_t offset, 2368876Srgrimes const u_int16_t * addr, 2371541Srgrimes size_t count); 2381541Srgrimes 2398876Srgrimesstatic void 2401541Srgrimesrmi_bus_space_write_multi_stream_4(void *t, 2411541Srgrimes bus_space_handle_t handle, 2421541Srgrimes bus_size_t offset, 2435651Sjoerg const u_int32_t * addr, 2448876Srgrimes size_t count); 2451541Srgrimes 2461541Srgrimes#define TODO() printf("XLR memory bus space function '%s' unimplemented\n", __func__) 24745773Sdcs 24845773Sdcsstatic struct bus_space local_rmi_bus_space = { 2491541Srgrimes /* cookie */ 2501541Srgrimes (void *)0, 2511541Srgrimes 2521541Srgrimes /* mapping/unmapping */ 25322521Sdyson rmi_bus_space_map, 25422521Sdyson rmi_bus_space_unmap, 25522521Sdyson rmi_bus_space_subregion, 25622521Sdyson 2571541Srgrimes /* allocation/deallocation */ 25822521Sdyson NULL, 25922521Sdyson NULL, 26022521Sdyson 26122521Sdyson /* barrier */ 26222521Sdyson rmi_bus_space_barrier, 2631541Srgrimes 26412158Sbde /* read (single) */ 26522521Sdyson rmi_bus_space_read_1, 26622521Sdyson rmi_bus_space_read_2, 2671541Srgrimes rmi_bus_space_read_4, 26845773Sdcs NULL, 26945773Sdcs 27045773Sdcs /* read multiple */ 27125531Sjoerg rmi_bus_space_read_multi_1, 27225531Sjoerg rmi_bus_space_read_multi_2, 27325531Sjoerg rmi_bus_space_read_multi_4, 27425531Sjoerg NULL, 27525531Sjoerg 27625531Sjoerg /* read region */ 27725531Sjoerg rmi_bus_space_read_region_1, 27825531Sjoerg rmi_bus_space_read_region_2, 27925531Sjoerg rmi_bus_space_read_region_4, 28022521Sdyson NULL, 28122521Sdyson 2821541Srgrimes /* write (single) */ 28322521Sdyson rmi_bus_space_write_1, 2841541Srgrimes rmi_bus_space_write_2, 2851541Srgrimes rmi_bus_space_write_4, 2861541Srgrimes NULL, 2871541Srgrimes 28822521Sdyson /* write multiple */ 28922521Sdyson rmi_bus_space_write_multi_1, 2901541Srgrimes rmi_bus_space_write_multi_2, 2911541Srgrimes rmi_bus_space_write_multi_4, 2921541Srgrimes NULL, 2931541Srgrimes 2941541Srgrimes /* write region */ 2951541Srgrimes NULL, 29622521Sdyson rmi_bus_space_write_region_2, 29722521Sdyson rmi_bus_space_write_region_4, 29822521Sdyson NULL, 29922521Sdyson 30022521Sdyson /* set multiple */ 30122521Sdyson NULL, 3021541Srgrimes NULL, 30322521Sdyson NULL, 3041541Srgrimes NULL, 3051541Srgrimes 30622521Sdyson /* set region */ 30722521Sdyson NULL, 30822521Sdyson rmi_bus_space_set_region_2, 30922521Sdyson rmi_bus_space_set_region_4, 3101541Srgrimes NULL, 31122521Sdyson 3121541Srgrimes /* copy */ 3131541Srgrimes NULL, 31422521Sdyson rmi_bus_space_copy_region_2, 31522521Sdyson NULL, 31622521Sdyson NULL, 31722521Sdyson 31822521Sdyson /* read (single) stream */ 3191541Srgrimes rmi_bus_space_read_stream_1, 32022521Sdyson rmi_bus_space_read_stream_2, 3211541Srgrimes rmi_bus_space_read_stream_4, 32222521Sdyson NULL, 3231541Srgrimes 3241541Srgrimes /* read multiple stream */ 32522521Sdyson rmi_bus_space_read_multi_stream_1, 32622521Sdyson rmi_bus_space_read_multi_stream_2, 32722521Sdyson rmi_bus_space_read_multi_stream_4, 3281541Srgrimes NULL, 32922521Sdyson 3301541Srgrimes /* read region stream */ 3311541Srgrimes rmi_bus_space_read_region_1, 33222521Sdyson rmi_bus_space_read_region_2, 33322521Sdyson rmi_bus_space_read_region_4, 33422521Sdyson NULL, 33522521Sdyson 33622521Sdyson /* write (single) stream */ 33722521Sdyson rmi_bus_space_write_stream_1, 33822521Sdyson rmi_bus_space_write_stream_2, 3391541Srgrimes rmi_bus_space_write_stream_4, 34022521Sdyson NULL, 3411541Srgrimes 3421541Srgrimes /* write multiple stream */ 34322521Sdyson rmi_bus_space_write_multi_stream_1, 3441541Srgrimes rmi_bus_space_write_multi_stream_2, 34522521Sdyson rmi_bus_space_write_multi_stream_4, 3461541Srgrimes NULL, 34722521Sdyson 3481541Srgrimes /* write region stream */ 3491541Srgrimes NULL, 35022521Sdyson rmi_bus_space_write_region_2, 3511541Srgrimes rmi_bus_space_write_region_4, 35222521Sdyson NULL, 35322521Sdyson}; 3541541Srgrimes 3551541Srgrimes/* generic bus_space tag */ 3561541Srgrimesbus_space_tag_t rmi_bus_space = &local_rmi_bus_space; 3571541Srgrimes 358/* 359 * Map a region of device bus space into CPU virtual address space. 360 */ 361static int 362rmi_bus_space_map(void *t __unused, bus_addr_t addr, 363 bus_size_t size __unused, int flags __unused, 364 bus_space_handle_t * bshp) 365{ 366 367 *bshp = addr; 368 return (0); 369} 370 371/* 372 * Unmap a region of device bus space. 373 */ 374static void 375rmi_bus_space_unmap(void *t __unused, bus_space_handle_t bsh __unused, 376 bus_size_t size __unused) 377{ 378} 379 380/* 381 * Get a new handle for a subregion of an already-mapped area of bus space. 382 */ 383 384static int 385rmi_bus_space_subregion(void *t __unused, bus_space_handle_t bsh, 386 bus_size_t offset, bus_size_t size __unused, 387 bus_space_handle_t * nbshp) 388{ 389 *nbshp = bsh + offset; 390 return (0); 391} 392 393/* 394 * Read a 1, 2, 4, or 8 byte quantity from bus space 395 * described by tag/handle/offset. 396 */ 397 398static u_int8_t 399rmi_bus_space_read_1(void *tag, bus_space_handle_t handle, 400 bus_size_t offset) 401{ 402 return (u_int8_t) (*(volatile u_int32_t *)(handle + offset)); 403} 404 405static u_int16_t 406rmi_bus_space_read_2(void *tag, bus_space_handle_t handle, 407 bus_size_t offset) 408{ 409 return (u_int16_t)(*(volatile u_int32_t *)(handle + offset)); 410} 411 412static u_int32_t 413rmi_bus_space_read_4(void *tag, bus_space_handle_t handle, 414 bus_size_t offset) 415{ 416 return (*(volatile u_int32_t *)(handle + offset)); 417} 418 419 420/* 421 * Read `count' 1, 2, 4, or 8 byte quantities from bus space 422 * described by tag/handle/offset and copy into buffer provided. 423 */ 424static void 425rmi_bus_space_read_multi_1(void *tag, bus_space_handle_t handle, 426 bus_size_t offset, u_int8_t * addr, size_t count) 427{ 428 TODO(); 429} 430 431static void 432rmi_bus_space_read_multi_2(void *tag, bus_space_handle_t handle, 433 bus_size_t offset, u_int16_t * addr, size_t count) 434{ 435 TODO(); 436} 437 438static void 439rmi_bus_space_read_multi_4(void *tag, bus_space_handle_t handle, 440 bus_size_t offset, u_int32_t * addr, size_t count) 441{ 442 TODO(); 443} 444 445/* 446 * Write the 1, 2, 4, or 8 byte value `value' to bus space 447 * described by tag/handle/offset. 448 */ 449 450static void 451rmi_bus_space_write_1(void *tag, bus_space_handle_t handle, 452 bus_size_t offset, u_int8_t value) 453{ 454 *(volatile u_int32_t *)(handle + offset) = (u_int32_t)value; 455} 456 457static void 458rmi_bus_space_write_2(void *tag, bus_space_handle_t handle, 459 bus_size_t offset, u_int16_t value) 460{ 461 *(volatile u_int32_t *)(handle + offset) = (u_int32_t)value; 462} 463 464static void 465rmi_bus_space_write_4(void *tag, bus_space_handle_t handle, 466 bus_size_t offset, u_int32_t value) 467{ 468 *(volatile u_int32_t *)(handle + offset) = value; 469} 470 471 472/* 473 * Write `count' 1, 2, 4, or 8 byte quantities from the buffer 474 * provided to bus space described by tag/handle/offset. 475 */ 476 477 478static void 479rmi_bus_space_write_multi_1(void *tag, bus_space_handle_t handle, 480 bus_size_t offset, const u_int8_t * addr, size_t count) 481{ 482 TODO(); 483} 484 485static void 486rmi_bus_space_write_multi_2(void *tag, bus_space_handle_t handle, 487 bus_size_t offset, const u_int16_t * addr, size_t count) 488{ 489 TODO(); 490} 491 492static void 493rmi_bus_space_write_multi_4(void *tag, bus_space_handle_t handle, 494 bus_size_t offset, const u_int32_t * addr, size_t count) 495{ 496 TODO(); 497} 498 499/* 500 * Write `count' 1, 2, 4, or 8 byte value `val' to bus space described 501 * by tag/handle starting at `offset'. 502 */ 503 504static void 505rmi_bus_space_set_region_2(void *t, bus_space_handle_t bsh, 506 bus_size_t offset, u_int16_t value, size_t count) 507{ 508 bus_addr_t addr = bsh + offset; 509 510 for (; count != 0; count--, addr += 2) 511 (*(volatile u_int32_t *)(addr)) = value; 512} 513 514static void 515rmi_bus_space_set_region_4(void *t, bus_space_handle_t bsh, 516 bus_size_t offset, u_int32_t value, size_t count) 517{ 518 bus_addr_t addr = bsh + offset; 519 520 for (; count != 0; count--, addr += 4) 521 (*(volatile u_int32_t *)(addr)) = value; 522} 523 524 525/* 526 * Copy `count' 1, 2, 4, or 8 byte values from bus space starting 527 * at tag/bsh1/off1 to bus space starting at tag/bsh2/off2. 528 */ 529static void 530rmi_bus_space_copy_region_2(void *t, bus_space_handle_t bsh1, 531 bus_size_t off1, bus_space_handle_t bsh2, 532 bus_size_t off2, size_t count) 533{ 534 printf("bus_space_copy_region_2 - unimplemented\n"); 535} 536 537/* 538 * Read `count' 1, 2, 4, or 8 byte quantities from bus space 539 * described by tag/handle/offset and copy into buffer provided. 540 */ 541 542u_int8_t 543rmi_bus_space_read_stream_1(void *t, bus_space_handle_t handle, 544 bus_size_t offset) 545{ 546 547 return *((volatile u_int8_t *)(handle + offset)); 548} 549 550 551static u_int16_t 552rmi_bus_space_read_stream_2(void *t, bus_space_handle_t handle, 553 bus_size_t offset) 554{ 555 return *(volatile u_int16_t *)(handle + offset); 556} 557 558 559static u_int32_t 560rmi_bus_space_read_stream_4(void *t, bus_space_handle_t handle, 561 bus_size_t offset) 562{ 563 return (*(volatile u_int32_t *)(handle + offset)); 564} 565 566 567static void 568rmi_bus_space_read_multi_stream_1(void *tag, bus_space_handle_t handle, 569 bus_size_t offset, u_int8_t * addr, size_t count) 570{ 571 TODO(); 572} 573 574static void 575rmi_bus_space_read_multi_stream_2(void *tag, bus_space_handle_t handle, 576 bus_size_t offset, u_int16_t * addr, size_t count) 577{ 578 TODO(); 579} 580 581static void 582rmi_bus_space_read_multi_stream_4(void *tag, bus_space_handle_t handle, 583 bus_size_t offset, u_int32_t * addr, size_t count) 584{ 585 TODO(); 586} 587 588 589/* 590 * Read `count' 1, 2, 4, or 8 byte quantities from bus space 591 * described by tag/handle and starting at `offset' and copy into 592 * buffer provided. 593 */ 594void 595rmi_bus_space_read_region_1(void *t, bus_space_handle_t bsh, 596 bus_size_t offset, u_int8_t * addr, size_t count) 597{ 598 TODO(); 599} 600 601void 602rmi_bus_space_read_region_2(void *t, bus_space_handle_t bsh, 603 bus_size_t offset, u_int16_t * addr, size_t count) 604{ 605 TODO(); 606} 607 608void 609rmi_bus_space_read_region_4(void *t, bus_space_handle_t bsh, 610 bus_size_t offset, u_int32_t * addr, size_t count) 611{ 612 bus_addr_t baddr = bsh + offset; 613 614 while (count--) { 615 *addr++ = (*(volatile u_int32_t *)(baddr)); 616 baddr += 4; 617 } 618} 619 620void 621rmi_bus_space_write_stream_1(void *t, bus_space_handle_t handle, 622 bus_size_t offset, u_int8_t value) 623{ 624 TODO(); 625} 626 627 628static void 629rmi_bus_space_write_stream_2(void *t, bus_space_handle_t handle, 630 bus_size_t offset, u_int16_t value) 631{ 632 TODO(); 633} 634 635 636static void 637rmi_bus_space_write_stream_4(void *t, bus_space_handle_t handle, 638 bus_size_t offset, u_int32_t value) 639{ 640 TODO(); 641} 642 643 644static void 645rmi_bus_space_write_multi_stream_1(void *tag, bus_space_handle_t handle, 646 bus_size_t offset, const u_int8_t * addr, size_t count) 647{ 648 TODO(); 649} 650 651static void 652rmi_bus_space_write_multi_stream_2(void *tag, bus_space_handle_t handle, 653 bus_size_t offset, const u_int16_t * addr, size_t count) 654{ 655 TODO(); 656} 657 658static void 659rmi_bus_space_write_multi_stream_4(void *tag, bus_space_handle_t handle, 660 bus_size_t offset, const u_int32_t * addr, size_t count) 661{ 662 TODO(); 663} 664 665void 666rmi_bus_space_write_region_2(void *t, 667 bus_space_handle_t bsh, 668 bus_size_t offset, 669 const u_int16_t * addr, 670 size_t count) 671{ 672 TODO(); 673} 674 675void 676rmi_bus_space_write_region_4(void *t, bus_space_handle_t bsh, 677 bus_size_t offset, const u_int32_t * addr, size_t count) 678{ 679 TODO(); 680} 681 682static void 683rmi_bus_space_barrier(void *tag __unused, bus_space_handle_t bsh __unused, 684 bus_size_t offset __unused, bus_size_t len __unused, int flags) 685{ 686} 687