mvvar.h (373bbe25ffaa3b5e75d1edefe47d26eaf9ae4242) mvvar.h (6975124c23e9314a1e0eaa111cc0fe829ea102bd)
1/*-
2 * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
3 * All rights reserved.
4 *
5 * Written by Jason R. Thorpe for Wasabi Systems, Inc.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 28 unchanged lines hidden (view full) ---

37 * $FreeBSD$
38 */
39
40#ifndef _MVVAR_H_
41#define _MVVAR_H_
42
43#include <sys/rman.h>
44
1/*-
2 * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
3 * All rights reserved.
4 *
5 * Written by Jason R. Thorpe for Wasabi Systems, Inc.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 28 unchanged lines hidden (view full) ---

37 * $FreeBSD$
38 */
39
40#ifndef _MVVAR_H_
41#define _MVVAR_H_
42
43#include <sys/rman.h>
44
45#define MV_TYPE_PCI 0
46#define MV_TYPE_PCIE 1
47#define MV_TYPE_PCIE_AGGR_LANE 2 /* Additional PCIE lane to aggregate */
48
45struct obio_softc {
46 bus_space_tag_t obio_bst; /* bus space tag */
47 struct rman obio_mem;
48 struct rman obio_irq;
49 struct rman obio_gpio;
50};
51
52struct obio_device {
53 const char *od_name;
54 u_long od_base;
55 u_long od_size;
56 u_int od_irqs[7 + 1]; /* keep additional entry for -1 sentinel */
57 u_int od_gpio[2 + 1]; /* as above for IRQ */
58 u_int od_pwr_mask;
59 struct resource_list od_resources;
60};
61
49struct obio_softc {
50 bus_space_tag_t obio_bst; /* bus space tag */
51 struct rman obio_mem;
52 struct rman obio_irq;
53 struct rman obio_gpio;
54};
55
56struct obio_device {
57 const char *od_name;
58 u_long od_base;
59 u_long od_size;
60 u_int od_irqs[7 + 1]; /* keep additional entry for -1 sentinel */
61 u_int od_gpio[2 + 1]; /* as above for IRQ */
62 u_int od_pwr_mask;
63 struct resource_list od_resources;
64};
65
66typedef int (*obio_get_irq_t)(u_int bus, u_int slot, u_int func, u_int pin);
67
68struct obio_pci {
69 int op_type;
70
71 bus_addr_t op_base;
72 u_long op_size;
73
74 /* Note IO/MEM regions are assumed VA == PA */
75 bus_addr_t op_io_base;
76 u_long op_io_size;
77 int op_io_win_target;
78 int op_io_win_attr;
79
80 bus_addr_t op_mem_base;
81 u_long op_mem_size;
82 int op_mem_win_target;
83 int op_mem_win_attr;
84
85 obio_get_irq_t op_get_irq; /* IRQ Mapping callback */
86 int op_irq; /* used if callback is NULL */
87};
88
62struct decode_win {
63 int target; /* Mbus unit ID */
64 int attr; /* Attributes of the target interface */
65 vm_paddr_t base; /* Physical base addr */
66 uint32_t size;
67 int remap;
68};
69
89struct decode_win {
90 int target; /* Mbus unit ID */
91 int attr; /* Attributes of the target interface */
92 vm_paddr_t base; /* Physical base addr */
93 uint32_t size;
94 int remap;
95};
96
97extern const struct obio_pci mv_pci_info[];
70extern bus_space_tag_t obio_tag;
71extern struct obio_device obio_devices[];
72extern const struct decode_win *cpu_wins;
73extern const struct decode_win *idma_wins;
74extern int cpu_wins_no;
75extern int idma_wins_no;
76
77/* Function prototypes */

--- 7 unchanged lines hidden (view full) ---

85
86int platform_pmap_init(void);
87int soc_decode_win(void);
88void soc_id(uint32_t *dev, uint32_t *rev);
89void soc_identify(void);
90void soc_dump_decode_win(void);
91uint32_t soc_power_ctrl_get(uint32_t mask);
92
98extern bus_space_tag_t obio_tag;
99extern struct obio_device obio_devices[];
100extern const struct decode_win *cpu_wins;
101extern const struct decode_win *idma_wins;
102extern int cpu_wins_no;
103extern int idma_wins_no;
104
105/* Function prototypes */

--- 7 unchanged lines hidden (view full) ---

113
114int platform_pmap_init(void);
115int soc_decode_win(void);
116void soc_id(uint32_t *dev, uint32_t *rev);
117void soc_identify(void);
118void soc_dump_decode_win(void);
119uint32_t soc_power_ctrl_get(uint32_t mask);
120
121int decode_win_cpu_set(int target, int attr, vm_paddr_t base, uint32_t size,
122 int remap);
93int decode_win_overlap(int, int, const struct decode_win *);
94int win_cpu_can_remap(int);
95
96void decode_win_idma_dump(void);
97void decode_win_idma_setup(void);
98int decode_win_idma_valid(void);
99
100int ddr_is_active(int i);

--- 22 unchanged lines hidden ---
123int decode_win_overlap(int, int, const struct decode_win *);
124int win_cpu_can_remap(int);
125
126void decode_win_idma_dump(void);
127void decode_win_idma_setup(void);
128int decode_win_idma_valid(void);
129
130int ddr_is_active(int i);

--- 22 unchanged lines hidden ---