1 1.6 kiyohara /* $NetBSD: pxa2x0var.h,v 1.6 2009/08/09 06:12:34 kiyohara Exp $ */ 2 1.1 bsh 3 1.1 bsh /* 4 1.1 bsh * Copyright (c) 2002 Genetec Corporation. All rights reserved. 5 1.1 bsh * Written by Hiroyuki Bessho for Genetec Corporation. 6 1.1 bsh * 7 1.1 bsh * Redistribution and use in source and binary forms, with or without 8 1.1 bsh * modification, are permitted provided that the following conditions 9 1.1 bsh * are met: 10 1.1 bsh * 1. Redistributions of source code must retain the above copyright 11 1.1 bsh * notice, this list of conditions and the following disclaimer. 12 1.1 bsh * 2. Redistributions in binary form must reproduce the above copyright 13 1.1 bsh * notice, this list of conditions and the following disclaimer in the 14 1.1 bsh * documentation and/or other materials provided with the distribution. 15 1.1 bsh * 3. All advertising materials mentioning features or use of this software 16 1.1 bsh * must display the following acknowledgement: 17 1.1 bsh * This product includes software developed for the NetBSD Project by 18 1.1 bsh * Genetec Corporation. 19 1.1 bsh * 4. The name of Genetec Corporation may not be used to endorse or 20 1.1 bsh * promote products derived from this software without specific prior 21 1.1 bsh * written permission. 22 1.1 bsh * 23 1.1 bsh * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``AS IS'' AND 24 1.1 bsh * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 25 1.1 bsh * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 26 1.1 bsh * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GENETEC CORPORATION 27 1.1 bsh * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 28 1.1 bsh * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 29 1.1 bsh * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 30 1.1 bsh * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 31 1.1 bsh * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 32 1.1 bsh * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 1.1 bsh * POSSIBILITY OF SUCH DAMAGE. 34 1.1 bsh */ 35 1.1 bsh 36 1.1 bsh 37 1.1 bsh #ifndef _ARM_XSCALE_PXA2X0VAR_H_ 38 1.1 bsh #define _ARM_XSCALE_PXA2X0VAR_H_ 39 1.1 bsh 40 1.1 bsh #include <arm/sa11x0/sa11x0_var.h> 41 1.1 bsh 42 1.2 scw /* PXA2X0's integrated peripheral bus. */ 43 1.1 bsh 44 1.1 bsh typedef int (* pxa2x0_irq_handler_t)(void *); 45 1.1 bsh 46 1.2 scw struct pxaip_attach_args { 47 1.1 bsh struct sa11x0_attach_args pxa_sa; 48 1.2 scw bus_dma_tag_t pxa_dmat; 49 1.1 bsh int pxa_index; /* to specify device by index number */ 50 1.1 bsh 51 1.6 kiyohara #define pxa_name pxa_sa.sa_name 52 1.1 bsh #define pxa_iot pxa_sa.sa_iot 53 1.1 bsh #define pxa_addr pxa_sa.sa_addr 54 1.1 bsh #define pxa_size pxa_sa.sa_size 55 1.1 bsh #define pxa_intr pxa_sa.sa_intr 56 1.1 bsh }; 57 1.1 bsh 58 1.1 bsh 59 1.1 bsh extern struct bus_space pxa2x0_bs_tag; 60 1.1 bsh extern struct arm32_bus_dma_tag pxa2x0_bus_dma_tag; 61 1.1 bsh extern struct bus_space pxa2x0_a4x_bs_tag; 62 1.1 bsh 63 1.1 bsh /* misc. */ 64 1.1 bsh extern void pxa2x0_fcs_init(void); 65 1.1 bsh extern void pxa2x0_freq_change(int); 66 1.1 bsh extern void pxa2x0_turbo_mode(int); 67 1.1 bsh extern int pxa2x0_i2c_master_tx( int, uint8_t *, int ); 68 1.1 bsh 69 1.2 scw /* 70 1.2 scw * Probe the memory controller to deterimine which SDRAM are 71 1.2 scw * populated, and what size of SDRAM is present in each bank. 72 1.2 scw * 73 1.2 scw * This routine should be called from a port's initarm() 74 1.2 scw * function, with the first parameter set to the address 75 1.2 scw * of the memory controller's registers. 76 1.2 scw */ 77 1.2 scw extern void pxa2x0_probe_sdram(vaddr_t, paddr_t *, psize_t *); 78 1.1 bsh 79 1.2 scw /* 80 1.4 peter * MEMCTL registers quick access functions. 81 1.4 peter */ 82 1.4 peter extern void pxa2x0_memctl_bootstrap(vaddr_t); 83 1.4 peter extern uint32_t pxa2x0_memctl_read(int); 84 1.4 peter extern void pxa2x0_memctl_write(int, uint32_t); 85 1.4 peter 86 1.4 peter /* 87 1.2 scw * Configure one or more clock enables in the Clock Manager's 88 1.2 scw * CKEN register. 89 1.2 scw */ 90 1.4 peter extern void pxa2x0_clkman_bootstrap(vaddr_t); 91 1.5 thorpej extern void pxa2x0_clkman_config(u_int, bool); 92 1.1 bsh 93 1.1 bsh #endif /* _ARM_XSCALE_PXA2X0VAR_H_ */ 94