Deleted Added
full compact
aml8726_machdep.c (282812) aml8726_machdep.c (283057)
1/*-
2 * Copyright 2013-2015 John Wehle <john@feith.com>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include "opt_global.h"
28
29#include <sys/cdefs.h>
1/*-
2 * Copyright 2013-2015 John Wehle <john@feith.com>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include "opt_global.h"
28
29#include <sys/cdefs.h>
30__FBSDID("$FreeBSD: head/sys/arm/amlogic/aml8726/aml8726_machdep.c 282812 2015-05-12 08:53:54Z ganbold $");
30__FBSDID("$FreeBSD: head/sys/arm/amlogic/aml8726/aml8726_machdep.c 283057 2015-05-18 11:04:07Z andrew $");
31
32#define _ARM32_BUS_DMA_PRIVATE
33#include <sys/param.h>
34#include <sys/systm.h>
35#include <sys/bus.h>
36
37#include <vm/vm.h>
38#include <vm/pmap.h>
39
40#include <machine/bus.h>
41#include <machine/cpufunc.h>
42#include <machine/devmap.h>
31
32#define _ARM32_BUS_DMA_PRIVATE
33#include <sys/param.h>
34#include <sys/systm.h>
35#include <sys/bus.h>
36
37#include <vm/vm.h>
38#include <vm/pmap.h>
39
40#include <machine/bus.h>
41#include <machine/cpufunc.h>
42#include <machine/devmap.h>
43#include <machine/intr.h>
43#include <machine/machdep.h>
44#include <machine/platform.h>
45
46#include <dev/fdt/fdt_common.h>
47
48#include <arm/amlogic/aml8726/aml8726_soc.h>
49#include <arm/amlogic/aml8726/aml8726_clkmsr.h>
50

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

176
177 return (0);
178}
179
180struct fdt_fixup_entry fdt_fixup_table[] = {
181 { NULL, NULL }
182};
183
44#include <machine/machdep.h>
45#include <machine/platform.h>
46
47#include <dev/fdt/fdt_common.h>
48
49#include <arm/amlogic/aml8726/aml8726_soc.h>
50#include <arm/amlogic/aml8726/aml8726_clkmsr.h>
51

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

177
178 return (0);
179}
180
181struct fdt_fixup_entry fdt_fixup_table[] = {
182 { NULL, NULL }
183};
184
185#ifndef DEV_GIC
184static int
185fdt_pic_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig,
186 int *pol)
187{
188
189 /*
186static int
187fdt_pic_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig,
188 int *pol)
189{
190
191 /*
190 * The single core chips have just an Amlogic PIC. However the
191 * multi core chips also have a GIC.
192 * The single core chips have just an Amlogic PIC.
192 */
193 */
193#ifdef SMP
194 if (!fdt_is_compatible_strict(node, "arm,cortex-a9-gic"))
195#else
196 if (!fdt_is_compatible_strict(node, "amlogic,aml8726-pic"))
194 if (!fdt_is_compatible_strict(node, "amlogic,aml8726-pic"))
197#endif
198 return (ENXIO);
199
200 *interrupt = fdt32_to_cpu(intr[1]);
201 *trig = INTR_TRIGGER_EDGE;
202 *pol = INTR_POLARITY_HIGH;
203
195 return (ENXIO);
196
197 *interrupt = fdt32_to_cpu(intr[1]);
198 *trig = INTR_TRIGGER_EDGE;
199 *pol = INTR_POLARITY_HIGH;
200
204 switch (*interrupt) {
205 case 30: /* INT_USB_A */
206 case 31: /* INT_USB_B */
207 *trig = INTR_TRIGGER_LEVEL;
208 break;
209 default:
210 break;
211 }
212
213#ifdef SMP
214 *interrupt += 32;
215#endif
216
217 return (0);
218}
201 return (0);
202}
203#endif
219
220fdt_pic_decode_t fdt_pic_table[] = {
204
205fdt_pic_decode_t fdt_pic_table[] = {
206#ifdef DEV_GIC
207 &gic_decode_fdt,
208#else
221 &fdt_pic_decode_ic,
209 &fdt_pic_decode_ic,
210#endif
222 NULL
223};
211 NULL
212};