Deleted Added
full compact
ti_common.c (281085) ti_common.c (283276)
1/*-
2 * Copyright (C) 2008-2011 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-2011 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/ti/ti_common.c 281085 2015-04-04 21:34:26Z andrew $");
33__FBSDID("$FreeBSD: head/sys/arm/ti/ti_common.c 283276 2015-05-22 03:16:18Z gonzo $");
34
35#include <sys/param.h>
36#include <sys/systm.h>
37#include <sys/bus.h>
38#include <sys/kernel.h>
39#include <sys/malloc.h>
40#include <sys/kdb.h>
41#include <sys/reboot.h>
42
43#include <dev/fdt/fdt_common.h>
44#include <dev/ofw/openfirm.h>
45
46#include <machine/bus.h>
34
35#include <sys/param.h>
36#include <sys/systm.h>
37#include <sys/bus.h>
38#include <sys/kernel.h>
39#include <sys/malloc.h>
40#include <sys/kdb.h>
41#include <sys/reboot.h>
42
43#include <dev/fdt/fdt_common.h>
44#include <dev/ofw/openfirm.h>
45
46#include <machine/bus.h>
47#include <machine/intr.h>
47#include <machine/vmparam.h>
48
49struct fdt_fixup_entry fdt_fixup_table[] = {
50 { NULL, NULL }
51};
52
48#include <machine/vmparam.h>
49
50struct fdt_fixup_entry fdt_fixup_table[] = {
51 { NULL, NULL }
52};
53
53#ifdef SOC_OMAP4
54static int
55fdt_gic_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig,
56 int *pol)
57{
58
59 if (!fdt_is_compatible(node, "arm,gic"))
60 return (ENXIO);
61
62 *interrupt = fdt32_to_cpu(intr[0]);
63 *trig = INTR_TRIGGER_CONFORM;
64 *pol = INTR_POLARITY_CONFORM;
65
66 return (0);
67}
68#endif
69
70#ifdef SOC_TI_AM335X
71static int
72fdt_aintc_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig,
73 int *pol)
74{
75
54#ifdef SOC_TI_AM335X
55static int
56fdt_aintc_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig,
57 int *pol)
58{
59
76 if (!fdt_is_compatible(node, "ti,aintc"))
60 if (!fdt_is_compatible(node, "ti,aintc") &&
61 !fdt_is_compatible(node, "ti,am33xx-intc"))
77 return (ENXIO);
78
79 *interrupt = fdt32_to_cpu(intr[0]);
80 *trig = INTR_TRIGGER_CONFORM;
81 *pol = INTR_POLARITY_CONFORM;
82
83 return (0);
84}
85#endif
86
87fdt_pic_decode_t fdt_pic_table[] = {
88#ifdef SOC_OMAP4
62 return (ENXIO);
63
64 *interrupt = fdt32_to_cpu(intr[0]);
65 *trig = INTR_TRIGGER_CONFORM;
66 *pol = INTR_POLARITY_CONFORM;
67
68 return (0);
69}
70#endif
71
72fdt_pic_decode_t fdt_pic_table[] = {
73#ifdef SOC_OMAP4
89 &fdt_gic_decode_ic,
74 &gic_decode_fdt,
90#endif
91#ifdef SOC_TI_AM335X
92 &fdt_aintc_decode_ic,
93#endif
94 NULL
95};
75#endif
76#ifdef SOC_TI_AM335X
77 &fdt_aintc_decode_ic,
78#endif
79 NULL
80};