Deleted Added
full compact
db88f5xxx.c (186909) db88f5xxx.c (186932)
1/*-
2 * Copyright (C) 2008 MARVELL INTERNATIONAL LTD.
3 * All rights reserved.
4 *
5 * Developed by Semihalf.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

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

25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE.
30 */
31
32#include <sys/cdefs.h>
1/*-
2 * Copyright (C) 2008 MARVELL INTERNATIONAL LTD.
3 * All rights reserved.
4 *
5 * Developed by Semihalf.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

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

25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE.
30 */
31
32#include <sys/cdefs.h>
33__FBSDID("$FreeBSD: head/sys/arm/mv/orion/db88f5xxx.c 186909 2009-01-08 18:31:43Z raj $");
33__FBSDID("$FreeBSD: head/sys/arm/mv/orion/db88f5xxx.c 186932 2009-01-09 10:20:51Z raj $");
34
35#include <sys/param.h>
36#include <sys/systm.h>
37#include <sys/bus.h>
38#include <sys/kernel.h>
39
40#include <vm/vm.h>
41#include <vm/pmap.h>

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

118 MV_DEV_CS0_PHYS_BASE,
119 MV_DEV_CS0_SIZE,
120 VM_PROT_READ | VM_PROT_WRITE,
121 PTE_NOCACHE,
122 },
123 { 0, 0, 0, 0, 0, }
124};
125
34
35#include <sys/param.h>
36#include <sys/systm.h>
37#include <sys/bus.h>
38#include <sys/kernel.h>
39
40#include <vm/vm.h>
41#include <vm/pmap.h>

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

118 MV_DEV_CS0_PHYS_BASE,
119 MV_DEV_CS0_SIZE,
120 VM_PROT_READ | VM_PROT_WRITE,
121 PTE_NOCACHE,
122 },
123 { 0, 0, 0, 0, 0, }
124};
125
126int platform_pci_get_irq(u_int bus, u_int slot, u_int func, u_int pin)
127{
128 int irq;
126/*
127 * The pci_irq_map table consists of 3 columns:
128 * - PCI slot number (less than zero means ANY).
129 * - PCI IRQ pin (less than zero means ANY).
130 * - PCI IRQ (less than zero marks end of table).
131 *
132 * IRQ number from the first matching entry is used to configure PCI device
133 */
129
134
130 switch (slot) {
131 case 7:
132 irq = GPIO2IRQ(12); /* GPIO 0 for DB-88F5182 */
133 break; /* GPIO 12 for DB-88F5281 */
134 case 8:
135 case 9:
136 irq = GPIO2IRQ(13); /* GPIO 1 for DB-88F5182 */
137 break; /* GPIO 13 for DB-88F5281 */
138 default:
139 irq = -1;
140 break;
141 };
135/* PCI IRQ Map for DB-88F5281 */
136const struct obio_pci_irq_map pci_irq_map[] = {
137 { 7, -1, GPIO2IRQ(12) },
138 { 8, -1, GPIO2IRQ(13) },
139 { 9, -1, GPIO2IRQ(13) },
140 { -1, -1, -1 }
141};
142
142
143 /*
144 * XXX This isn't the right place to setup GPIO, but it makes sure
145 * that PCI works on 5XXX targets where U-Boot doesn't set up the GPIO
146 * correctly to handle PCI IRQs (e.g., on 5182). This code will go
147 * away once we set up GPIO in a generic way in a proper place (TBD).
148 */
149 if (irq >= 0)
150 mv_gpio_configure(IRQ2GPIO(irq), MV_GPIO_POLAR_LOW |
151 MV_GPIO_LEVEL, ~0u);
143#if 0
144/* PCI IRQ Map for DB-88F5182 */
145const struct obio_pci_irq_map pci_irq_map[] = {
146 { 7, -1, GPIO2IRQ(0) },
147 { 8, -1, GPIO2IRQ(1) },
148 { 9, -1, GPIO2IRQ(1) },
149 { -1, -1, -1 }
150};
151#endif
152
152
153 return (irq);
154}
155
156/*
157 * mv_gpio_config row structure:
158 * <GPIO number>, <GPIO flags>, <GPIO mode>
159 *
160 * - GPIO pin number (less than zero marks end of table)
161 * - GPIO flags:
162 * MV_GPIO_BLINK
163 * MV_GPIO_POLAR_LOW

--- 103 unchanged lines hidden ---
153/*
154 * mv_gpio_config row structure:
155 * <GPIO number>, <GPIO flags>, <GPIO mode>
156 *
157 * - GPIO pin number (less than zero marks end of table)
158 * - GPIO flags:
159 * MV_GPIO_BLINK
160 * MV_GPIO_POLAR_LOW

--- 103 unchanged lines hidden ---