Home | History | Annotate | Line # | Download | only in booke
e500var.h revision 1.3
      1  1.3  matt /*	$NetBSD: e500var.h,v 1.3 2011/06/05 16:52:25 matt Exp $	*/
      2  1.2  matt /*-
      3  1.2  matt  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
      4  1.2  matt  * All rights reserved.
      5  1.2  matt  *
      6  1.2  matt  * This code is derived from software contributed to The NetBSD Foundation
      7  1.2  matt  * by Raytheon BBN Technologies Corp and Defense Advanced Research Projects
      8  1.2  matt  * Agency and which was developed by Matt Thomas of 3am Software Foundry.
      9  1.2  matt  *
     10  1.2  matt  * This material is based upon work supported by the Defense Advanced Research
     11  1.2  matt  * Projects Agency and Space and Naval Warfare Systems Center, Pacific, under
     12  1.2  matt  * Contract No. N66001-09-C-2073.
     13  1.2  matt  * Approved for Public Release, Distribution Unlimited
     14  1.2  matt  *
     15  1.2  matt  * Redistribution and use in source and binary forms, with or without
     16  1.2  matt  * modification, are permitted provided that the following conditions
     17  1.2  matt  * are met:
     18  1.2  matt  * 1. Redistributions of source code must retain the above copyright
     19  1.2  matt  *    notice, this list of conditions and the following disclaimer.
     20  1.2  matt  * 2. Redistributions in binary form must reproduce the above copyright
     21  1.2  matt  *    notice, this list of conditions and the following disclaimer in the
     22  1.2  matt  *    documentation and/or other materials provided with the distribution.
     23  1.2  matt  *
     24  1.2  matt  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     25  1.2  matt  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     26  1.2  matt  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     27  1.2  matt  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     28  1.2  matt  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     29  1.2  matt  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     30  1.2  matt  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     31  1.2  matt  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     32  1.2  matt  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     33  1.2  matt  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     34  1.2  matt  * POSSIBILITY OF SUCH DAMAGE.
     35  1.2  matt  */
     36  1.2  matt 
     37  1.2  matt #ifndef _POWERPC_BOOKE_E500VAR_H_
     38  1.2  matt #define _POWERPC_BOOKE_E500VAR_H_
     39  1.2  matt 
     40  1.2  matt #ifdef _KERNEL
     41  1.2  matt 
     42  1.2  matt #include <sys/device.h>
     43  1.2  matt #include <sys/extent.h>
     44  1.2  matt 
     45  1.2  matt #ifdef _KERNEL_OPT
     46  1.2  matt #include "locators.h"
     47  1.2  matt #endif
     48  1.2  matt 
     49  1.2  matt #define	E500_CLOCK_TIMER	0	/* could be 0..3 */
     50  1.2  matt 
     51  1.2  matt extern const struct intrsw e500_intrsw;
     52  1.2  matt struct extent *pcimem_ex;
     53  1.2  matt struct extent *pciio_ex;
     54  1.2  matt void	e500_device_register(device_t, void *);
     55  1.2  matt int	e500_clock_intr(void *);
     56  1.2  matt void	e500_cpu_start(void);
     57  1.2  matt void	e500_tlb_init(vaddr_t, psize_t);
     58  1.2  matt bool	e500_device_disabled_p(uint32_t);
     59  1.2  matt 
     60  1.2  matt struct e500_truthtab {
     61  1.2  matt 	uint16_t tt_svrhi;
     62  1.2  matt 	uint16_t tt_instance;
     63  1.2  matt 	uint32_t tt_mask;
     64  1.2  matt 	uint32_t tt_value;
     65  1.2  matt 	u_int tt_result;
     66  1.2  matt };
     67  1.2  matt 
     68  1.2  matt #define	TRUTH_ENCODE(svr, inst, mask, value, result)	\
     69  1.2  matt 	{						\
     70  1.2  matt 		.tt_svrhi = (svr) >> 16,		\
     71  1.2  matt 		.tt_instance = (inst),			\
     72  1.2  matt 		.tt_mask = (mask),			\
     73  1.2  matt 		.tt_value = (value),			\
     74  1.2  matt 		.tt_result = (result),			\
     75  1.2  matt 	}
     76  1.2  matt 
     77  1.2  matt u_int	e500_truth_decode(u_int, uint32_t, const struct e500_truthtab *,
     78  1.2  matt 	    size_t, u_int);
     79  1.2  matt uint16_t e500_get_svr(void);
     80  1.2  matt #ifdef _KERNEL_OPT
     81  1.2  matt int	e500_cpunode_submatch(device_t, cfdata_t, const char *, void *);
     82  1.2  matt #endif
     83  1.2  matt 
     84  1.3  matt /*
     85  1.3  matt  * Used by MP hatch code to fetch the TLB1 entries so they be setup on the
     86  1.3  matt  * just hatched CPU.
     87  1.3  matt  */
     88  1.3  matt void   *e500_tlb1_fetch(size_t);
     89  1.3  matt void	e500_tlb1_sync(void);
     90  1.3  matt void	e500_ipi_halt(void);
     91  1.3  matt 
     92  1.2  matt void	pq3gpio_attach(device_t, device_t, void *);
     93  1.2  matt 
     94  1.3  matt /*
     95  1.3  matt  * For a lack of a better place, define this u-boot structure here.
     96  1.3  matt  */
     97  1.3  matt 
     98  1.3  matt struct uboot_spinup_entry {
     99  1.3  matt 	uint64_t entry_addr;
    100  1.3  matt 	uint64_t entry_r3;
    101  1.3  matt 	uint32_t entry__rsvd;
    102  1.3  matt 	uint32_t entry_pir;
    103  1.3  matt 	uint64_t entry_r6;
    104  1.3  matt };
    105  1.3  matt 
    106  1.2  matt #endif /* _KERNEL */
    107  1.2  matt 
    108  1.2  matt #endif /* !_POWERPC_BOOKE_E500VAR_H_ */
    109