Home | History | Annotate | Line # | Download | only in loongson
autoconf.h revision 1.2.12.1
      1       1.1    bouyer /*	$OpenBSD: autoconf.h,v 1.8 2010/08/31 10:24:46 pirofti Exp $ */
      2       1.1    bouyer 
      3       1.1    bouyer /*
      4       1.1    bouyer  * Copyright (c) 2001-2003 Opsycon AB  (www.opsycon.se / www.opsycon.com)
      5       1.1    bouyer  *
      6       1.1    bouyer  * Redistribution and use in source and binary forms, with or without
      7       1.1    bouyer  * modification, are permitted provided that the following conditions
      8       1.1    bouyer  * are met:
      9       1.1    bouyer  * 1. Redistributions of source code must retain the above copyright
     10       1.1    bouyer  *    notice, this list of conditions and the following disclaimer.
     11       1.1    bouyer  * 2. Redistributions in binary form must reproduce the above copyright
     12       1.1    bouyer  *    notice, this list of conditions and the following disclaimer in the
     13       1.1    bouyer  *    documentation and/or other materials provided with the distribution.
     14       1.1    bouyer  *
     15       1.1    bouyer  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
     16       1.1    bouyer  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
     17       1.1    bouyer  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     18       1.1    bouyer  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
     19       1.1    bouyer  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     20       1.1    bouyer  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     21       1.1    bouyer  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     22       1.1    bouyer  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     23       1.1    bouyer  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     24       1.1    bouyer  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     25       1.1    bouyer  * SUCH DAMAGE.
     26       1.1    bouyer  *
     27       1.1    bouyer  */
     28       1.1    bouyer 
     29       1.1    bouyer /*
     30       1.1    bouyer  * Definitions used by autoconfiguration.
     31       1.1    bouyer  */
     32       1.1    bouyer 
     33       1.1    bouyer #ifndef _MACHINE_AUTOCONF_H_
     34       1.1    bouyer #define _MACHINE_AUTOCONF_H_
     35       1.1    bouyer 
     36       1.1    bouyer #include <sys/bus.h>
     37       1.1    bouyer #include <sys/kcore.h>
     38       1.1    bouyer #include <mips/bonito/bonitovar.h>
     39       1.1    bouyer 
     40       1.1    bouyer struct bonito_config;
     41       1.1    bouyer struct mips_isa_chipset;
     42       1.1    bouyer struct bonito_irqmap;
     43       1.1    bouyer 
     44       1.1    bouyer /*
     45       1.1    bouyer  * List of legacy I/O ranges.
     46       1.1    bouyer  */
     47       1.1    bouyer struct legacy_io_range {
     48       1.1    bouyer 	bus_addr_t	start;
     49       1.1    bouyer 	bus_size_t	end;	/* inclusive */
     50       1.1    bouyer };
     51       1.1    bouyer 
     52       1.1    bouyer /*
     53       1.1    bouyer  * Per platform information.
     54       1.1    bouyer  */
     55       1.1    bouyer 
     56       1.1    bouyer struct platform {
     57       1.1    bouyer 	const int			 system_type;
     58       1.1    bouyer 	const char			*vendor;
     59       1.1    bouyer 	const char			*product;
     60       1.1    bouyer 
     61       1.1    bouyer 	const struct bonito_config	*bonito_config;
     62       1.1    bouyer 	struct mips_isa_chipset		*isa_chipset;
     63       1.1    bouyer 	const struct legacy_io_range	*legacy_io_ranges;
     64       1.1    bouyer 	int				bonito_mips_intr;
     65       1.1    bouyer 	int				isa_mips_intr;
     66       1.1    bouyer 	void				(*isa_intr)(int, vaddr_t, uint32_t);
     67       1.1    bouyer 	int				(*p_pci_intr_map)(int, int, int, pci_intr_handle_t *);
     68       1.1    bouyer 	const struct bonito_irqmap	*irq_map;
     69       1.1    bouyer 
     70       1.1    bouyer 	void				(*setup)(void);
     71  1.2.12.1       tls 	void				(*device_register)(device_t , void *);
     72       1.1    bouyer 
     73       1.1    bouyer 	void				(*powerdown)(void);
     74       1.1    bouyer 	void				(*reset)(void);
     75       1.1    bouyer 	int				(*suspend)(void);
     76       1.1    bouyer 	int				(*resume)(void);
     77       1.1    bouyer };
     78       1.1    bouyer 
     79       1.1    bouyer #define LOONGSON_CLASS		0x0060	/* Loongson + PMON2000 class */
     80       1.1    bouyer #define LOONGSON_2E		0x0060	/* Generic Loongson 2E system */
     81       1.1    bouyer #define LOONGSON_YEELOONG	0x0061	/* Lemote Yeeloong */
     82       1.1    bouyer #define LOONGSON_GDIUM		0x0062	/* EMTEC Gdium Liberty */
     83       1.1    bouyer #define LOONGSON_FULOONG	0x0063	/* Lemote Fuloong */
     84       1.1    bouyer #define LOONGSON_LYNLOONG	0x0064	/* Lemote Lynloong */
     85       1.1    bouyer 
     86       1.1    bouyer extern const struct platform *sys_platform;
     87       1.1    bouyer extern uint loongson_ver;
     88       1.1    bouyer 
     89       1.1    bouyer struct mainbus_attach_args {
     90       1.1    bouyer 	const char	*maa_name;
     91       1.1    bouyer };
     92       1.1    bouyer 
     93       1.1    bouyer extern char bootdev[];
     94       1.1    bouyer extern enum devclass bootdev_class;
     95       1.1    bouyer 
     96       1.1    bouyer void	loongson2e_setup(paddr_t, paddr_t, vaddr_t, vaddr_t, bus_dma_tag_t);
     97       1.1    bouyer void	loongson2f_setup(paddr_t, paddr_t, vaddr_t, vaddr_t, bus_dma_tag_t);
     98       1.1    bouyer 
     99       1.1    bouyer extern bus_space_tag_t comconsiot;
    100       1.1    bouyer extern bus_addr_t comconsaddr;
    101       1.1    bouyer extern int comconsrate;
    102       1.1    bouyer 
    103       1.1    bouyer extern phys_ram_seg_t mem_clusters[];
    104       1.1    bouyer extern int mem_cluster_cnt;
    105       1.1    bouyer 
    106       1.2  macallan int gdium_cnattach(bus_space_tag_t, bus_space_tag_t,
    107       1.2  macallan     pci_chipset_tag_t, pcitag_t, pcireg_t);
    108       1.2  macallan 
    109       1.1    bouyer #endif /* _MACHINE_AUTOCONF_H_ */
    110