bcm2836.c (876d357fa7bc8aeb8d050dd8fe227dd4fd8ed4df) bcm2836.c (59c3cb81c1769fdb6c840c971df129b52f4a848d)
1/*
2 * Copyright 2015 Andrew Turner.
3 * Copyright 2016 Svatopluk Kraus
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met:

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

48#include <machine/resource.h>
49#ifdef SMP
50#include <machine/smp.h>
51#endif
52
53#include <dev/ofw/ofw_bus_subr.h>
54#include <dev/ofw/ofw_bus.h>
55
1/*
2 * Copyright 2015 Andrew Turner.
3 * Copyright 2016 Svatopluk Kraus
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met:

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

48#include <machine/resource.h>
49#ifdef SMP
50#include <machine/smp.h>
51#endif
52
53#include <dev/ofw/ofw_bus_subr.h>
54#include <dev/ofw/ofw_bus.h>
55
56#ifdef ARM_INTRNG
56#ifdef INTRNG
57#include "pic_if.h"
58#else
59#include <arm/broadcom/bcm2835/bcm2836.h>
60
61#define ARM_LOCAL_BASE 0x40000000
62#define ARM_LOCAL_SIZE 0x00001000
63
64#define ARM_LOCAL_CONTROL 0x00
65#define ARM_LOCAL_PRESCALER 0x08
66#define PRESCALER_19_2 0x80000000 /* 19.2 MHz */
67#define ARM_LOCAL_INT_TIMER(n) (0x40 + (n) * 4)
68#define ARM_LOCAL_INT_MAILBOX(n) (0x50 + (n) * 4)
69#define ARM_LOCAL_INT_PENDING(n) (0x60 + (n) * 4)
70#define INT_PENDING_MASK 0x011f
71#define MAILBOX0_IRQ 4
72#define MAILBOX0_IRQEN (1 << 0)
73#endif
74
57#include "pic_if.h"
58#else
59#include <arm/broadcom/bcm2835/bcm2836.h>
60
61#define ARM_LOCAL_BASE 0x40000000
62#define ARM_LOCAL_SIZE 0x00001000
63
64#define ARM_LOCAL_CONTROL 0x00
65#define ARM_LOCAL_PRESCALER 0x08
66#define PRESCALER_19_2 0x80000000 /* 19.2 MHz */
67#define ARM_LOCAL_INT_TIMER(n) (0x40 + (n) * 4)
68#define ARM_LOCAL_INT_MAILBOX(n) (0x50 + (n) * 4)
69#define ARM_LOCAL_INT_PENDING(n) (0x60 + (n) * 4)
70#define INT_PENDING_MASK 0x011f
71#define MAILBOX0_IRQ 4
72#define MAILBOX0_IRQEN (1 << 0)
73#endif
74
75#ifdef ARM_INTRNG
75#ifdef INTRNG
76#define BCM_LINTC_CONTROL_REG 0x00
77#define BCM_LINTC_PRESCALER_REG 0x08
78#define BCM_LINTC_GPU_ROUTING_REG 0x0c
79#define BCM_LINTC_PMU_ROUTING_SET_REG 0x10
80#define BCM_LINTC_PMU_ROUTING_CLR_REG 0x14
81#define BCM_LINTC_TIMER_CFG_REG(n) (0x40 + (n) * 4)
82#define BCM_LINTC_MBOX_CFG_REG(n) (0x50 + (n) * 4)
83#define BCM_LINTC_PENDING_REG(n) (0x60 + (n) * 4)

--- 826 unchanged lines hidden ---
76#define BCM_LINTC_CONTROL_REG 0x00
77#define BCM_LINTC_PRESCALER_REG 0x08
78#define BCM_LINTC_GPU_ROUTING_REG 0x0c
79#define BCM_LINTC_PMU_ROUTING_SET_REG 0x10
80#define BCM_LINTC_PMU_ROUTING_CLR_REG 0x14
81#define BCM_LINTC_TIMER_CFG_REG(n) (0x40 + (n) * 4)
82#define BCM_LINTC_MBOX_CFG_REG(n) (0x50 + (n) * 4)
83#define BCM_LINTC_PENDING_REG(n) (0x60 + (n) * 4)

--- 826 unchanged lines hidden ---