armv7_a4x_space.c 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. /* $OpenBSD: armv7_a4x_space.c,v 1.2 2012/12/05 23:20:11 deraadt Exp $ */
  2. /* $NetBSD: armv7_a4x_space.c,v 1.2 2003/07/15 00:24:54 lukem Exp $ */
  3. /*
  4. * Copyright (c) 2002 Genetec Corporation. All rights reserved.
  5. * Written by Hiroyuki Bessho for Genetec Corporation.
  6. *
  7. * Redistribution and use in source and binary forms, with or without
  8. * modification, are permitted provided that the following conditions
  9. * are met:
  10. * 1. Redistributions of source code must retain the above copyright
  11. * notice, this list of conditions and the following disclaimer.
  12. * 2. Redistributions in binary form must reproduce the above copyright
  13. * notice, this list of conditions and the following disclaimer in the
  14. * documentation and/or other materials provided with the distribution.
  15. * 3. All advertising materials mentioning features or use of this software
  16. * must display the following acknowledgement:
  17. * This product includes software developed for the NetBSD Project by
  18. * Genetec Corporation.
  19. * 4. The name of Genetec Corporation may not be used to endorse or
  20. * promote products derived from this software without specific prior
  21. * written permission.
  22. *
  23. * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``AS IS'' AND
  24. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
  25. * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  26. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GENETEC CORPORATION
  27. * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  28. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  29. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  30. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  31. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  32. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  33. * POSSIBILITY OF SUCH DAMAGE.
  34. */
  35. /*
  36. * Bus space tag for 8/16-bit devices on 32-bit bus.
  37. * all registers are located at the address of multiple of 4.
  38. */
  39. #include <sys/param.h>
  40. #include <sys/systm.h>
  41. #include <uvm/uvm_extern.h>
  42. #include <machine/bus.h>
  43. /* Prototypes for all the bus_space structure functions */
  44. bs_protos(armv7);
  45. bs_protos(a4x);
  46. bs_protos(generic);
  47. bs_protos(generic_armv4);
  48. bs_protos(bs_notimpl);
  49. struct bus_space armv7_a4x_bs_tag = {
  50. /* cookie */
  51. (void *) 0,
  52. /* mapping/unmapping */
  53. armv7_bs_map,
  54. armv7_bs_unmap,
  55. armv7_bs_subregion,
  56. /* allocation/deallocation */
  57. armv7_bs_alloc, /* not implemented */
  58. armv7_bs_free, /* not implemented */
  59. /* get kernel virtual address */
  60. armv7_bs_vaddr,
  61. /* mmap */
  62. bs_notimpl_bs_mmap,
  63. /* barrier */
  64. armv7_bs_barrier,
  65. /* read (single) */
  66. a4x_bs_r_1,
  67. a4x_bs_r_2,
  68. a4x_bs_r_4,
  69. bs_notimpl_bs_r_8,
  70. /* read multiple */
  71. a4x_bs_rm_1,
  72. a4x_bs_rm_2,
  73. bs_notimpl_bs_rm_4,
  74. bs_notimpl_bs_rm_8,
  75. /* read region */
  76. bs_notimpl_bs_rr_1,
  77. bs_notimpl_bs_rr_2,
  78. bs_notimpl_bs_rr_4,
  79. bs_notimpl_bs_rr_8,
  80. /* write (single) */
  81. a4x_bs_w_1,
  82. a4x_bs_w_2,
  83. a4x_bs_w_4,
  84. bs_notimpl_bs_w_8,
  85. /* write multiple */
  86. a4x_bs_wm_1,
  87. a4x_bs_wm_2,
  88. bs_notimpl_bs_wm_4,
  89. bs_notimpl_bs_wm_8,
  90. /* write region */
  91. bs_notimpl_bs_wr_1,
  92. bs_notimpl_bs_wr_2,
  93. bs_notimpl_bs_wr_4,
  94. bs_notimpl_bs_wr_8,
  95. /* set multiple */
  96. bs_notimpl_bs_sm_1,
  97. bs_notimpl_bs_sm_2,
  98. bs_notimpl_bs_sm_4,
  99. bs_notimpl_bs_sm_8,
  100. /* set region */
  101. bs_notimpl_bs_sr_1,
  102. bs_notimpl_bs_sr_2,
  103. bs_notimpl_bs_sr_4,
  104. bs_notimpl_bs_sr_8,
  105. /* copy */
  106. bs_notimpl_bs_c_1,
  107. bs_notimpl_bs_c_2,
  108. bs_notimpl_bs_c_4,
  109. bs_notimpl_bs_c_8,
  110. };