pxa2x0var.h 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /* $OpenBSD: pxa2x0var.h,v 1.5 2005/05/27 21:10:05 uwe Exp $ */
  2. /* $NetBSD: pxa2x0var.h,v 1.2 2003/06/05 13:48:28 scw 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. #ifndef _ARM_XSCALE_PXA2X0VAR_H_
  36. #define _ARM_XSCALE_PXA2X0VAR_H_
  37. #include <arm/sa11x0/sa11x0_var.h>
  38. /* PXA2X0's integrated peripheral bus. */
  39. typedef int (* pxa2x0_irq_handler_t)(void *);
  40. struct pxaip_attach_args {
  41. struct sa11x0_attach_args pxa_sa;
  42. bus_dma_tag_t pxa_dmat;
  43. int pxa_index; /* to specify device by index number */
  44. #define pxa_iot pxa_sa.sa_iot
  45. #define pxa_addr pxa_sa.sa_addr
  46. #define pxa_size pxa_sa.sa_size
  47. #define pxa_intr pxa_sa.sa_intr
  48. };
  49. #define cf_addr cf_loc[0]
  50. #define cf_size cf_loc[1]
  51. #define cf_intr cf_loc[2]
  52. #define cf_index cf_loc[3]
  53. extern struct bus_space pxa2x0_bs_tag;
  54. extern struct arm32_bus_dma_tag pxa2x0_bus_dma_tag;
  55. extern struct bus_space pxa2x0_a4x_bs_tag;
  56. /* misc. */
  57. extern void pxa2x0_fcs_init(void);
  58. extern void pxa2x0_freq_change(int);
  59. extern void pxa2x0_turbo_mode(int);
  60. extern int pxa2x0_i2c_master_tx( int, uint8_t *, int );
  61. /*
  62. * Probe the memory controller to determine which SDRAM banks
  63. * are populated, and what size SDRAM is present in each bank.
  64. *
  65. * This routine should be called from a port's initarm()
  66. * function, with the first parameter set to the address
  67. * of the memory controller's registers.
  68. */
  69. extern void pxa2x0_probe_sdram(vaddr_t, paddr_t *, psize_t *);
  70. /*
  71. * Configure one or more clock enables in the Clock Manager's
  72. * CKEN register.
  73. */
  74. extern void pxa2x0_clkman_config(u_int, int);
  75. /*
  76. * Get/set the Real Time Clock's counter and alarm registers.
  77. */
  78. extern void pxa2x0_rtc_setalarm(u_int32_t);
  79. extern u_int32_t pxa2x0_rtc_getalarm(void);
  80. extern u_int32_t pxa2x0_rtc_getsecs(void);
  81. #endif /* _ARM_XSCALE_PXA2X0VAR_H_ */