aboutsummaryrefslogtreecommitdiff
path: root/sys/arm
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arm')
-rw-r--r--sys/arm/allwinner/aw_gpio.c4
-rw-r--r--sys/arm/arm/generic_timer.c54
-rw-r--r--sys/arm/arm/pmap-v6.c2
-rw-r--r--sys/arm/arm/pmu_fdt.c4
-rw-r--r--sys/arm/arm/unwind.c4
-rw-r--r--sys/arm/broadcom/bcm2835/bcm2835_gpio.c4
-rw-r--r--sys/arm/conf/TEGRA1242
-rw-r--r--sys/arm/freescale/imx/imx_gpio.c4
-rw-r--r--sys/arm/include/atomic.h8
-rw-r--r--sys/arm/mv/mvebu_gpio.c4
-rw-r--r--sys/arm/nvidia/tegra_gpio.c4
-rw-r--r--sys/arm/ti/ti_gpio.c4
12 files changed, 75 insertions, 23 deletions
diff --git a/sys/arm/allwinner/aw_gpio.c b/sys/arm/allwinner/aw_gpio.c
index f1b6f0bc9193..c90d61f7b45e 100644
--- a/sys/arm/allwinner/aw_gpio.c
+++ b/sys/arm/allwinner/aw_gpio.c
@@ -1531,6 +1531,10 @@ static device_method_t aw_gpio_methods[] = {
DEVMETHOD(device_attach, aw_gpio_attach),
DEVMETHOD(device_detach, aw_gpio_detach),
+ /* Bus interface */
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
/* Interrupt controller interface */
DEVMETHOD(pic_disable_intr, aw_gpio_pic_disable_intr),
DEVMETHOD(pic_enable_intr, aw_gpio_pic_enable_intr),
diff --git a/sys/arm/arm/generic_timer.c b/sys/arm/arm/generic_timer.c
index a8c779dcba6d..e3ba56a6f6ac 100644
--- a/sys/arm/arm/generic_timer.c
+++ b/sys/arm/arm/generic_timer.c
@@ -231,6 +231,25 @@ get_cntxct(bool physical)
return (val);
}
+#ifdef __aarch64__
+/*
+ * Read the self-syncronized counter. These cannot be read speculatively so
+ * don't need an isb before them.
+ */
+static uint64_t
+get_cntxctss(bool physical)
+{
+ uint64_t val;
+
+ if (physical)
+ val = READ_SPECIALREG(CNTPCTSS_EL0_REG);
+ else
+ val = READ_SPECIALREG(CNTVCTSS_EL0_REG);
+
+ return (val);
+}
+#endif
+
static int
set_ctrl(uint32_t val, bool physical)
{
@@ -631,6 +650,7 @@ arm_tmr_attach(device_t dev)
pcell_t clock;
#endif
#ifdef __aarch64__
+ uint64_t id_aa64mmfr0_el1;
int user_phys;
#endif
int error;
@@ -641,6 +661,11 @@ arm_tmr_attach(device_t dev)
return (ENXIO);
sc->get_cntxct = &get_cntxct;
+#ifdef __aarch64__
+ if (get_kernel_reg(ID_AA64MMFR0_EL1, &id_aa64mmfr0_el1) &&
+ ID_AA64MMFR0_ECV_VAL(id_aa64mmfr0_el1) >= ID_AA64MMFR0_ECV_IMPL)
+ sc->get_cntxct = &get_cntxctss;
+#endif
#ifdef FDT
/* Get the base clock frequency */
node = ofw_bus_get_node(dev);
@@ -882,32 +907,39 @@ DELAY(int usec)
TSEXIT();
}
-static bool
+static cpu_feat_en
wfxt_check(const struct cpu_feat *feat __unused, u_int midr __unused)
{
uint64_t id_aa64isar2;
if (!get_kernel_reg(ID_AA64ISAR2_EL1, &id_aa64isar2))
- return (false);
- return (ID_AA64ISAR2_WFxT_VAL(id_aa64isar2) != ID_AA64ISAR2_WFxT_NONE);
+ return (FEAT_ALWAYS_DISABLE);
+ if (ID_AA64ISAR2_WFxT_VAL(id_aa64isar2) >= ID_AA64ISAR2_WFxT_IMPL)
+ return (FEAT_DEFAULT_ENABLE);
+
+ return (FEAT_ALWAYS_DISABLE);
}
-static void
+static bool
wfxt_enable(const struct cpu_feat *feat __unused,
cpu_feat_errata errata_status __unused, u_int *errata_list __unused,
u_int errata_count __unused)
{
/* will be called if wfxt_check returns true */
enable_wfxt = true;
+ return (true);
}
-static struct cpu_feat feat_wfxt = {
- .feat_name = "FEAT_WFXT",
- .feat_check = wfxt_check,
- .feat_enable = wfxt_enable,
- .feat_flags = CPU_FEAT_AFTER_DEV | CPU_FEAT_SYSTEM,
-};
-DATA_SET(cpu_feat_set, feat_wfxt);
+static void
+wfxt_disabled(const struct cpu_feat *feat __unused)
+{
+ if (PCPU_GET(cpuid) == 0)
+ update_special_reg(ID_AA64ISAR2_EL1, ID_AA64ISAR2_WFxT_MASK, 0);
+}
+
+CPU_FEAT(feat_wfxt, "WFE and WFI instructions with timeout",
+ wfxt_check, NULL, wfxt_enable, wfxt_disabled,
+ CPU_FEAT_AFTER_DEV | CPU_FEAT_SYSTEM);
#endif
static uint32_t
diff --git a/sys/arm/arm/pmap-v6.c b/sys/arm/arm/pmap-v6.c
index 78883296c5b7..6a0ece1e4d98 100644
--- a/sys/arm/arm/pmap-v6.c
+++ b/sys/arm/arm/pmap-v6.c
@@ -1246,7 +1246,7 @@ pmap_bootstrap(vm_offset_t firstaddr)
}
static void
-pmap_init_reserved_pages(void)
+pmap_init_reserved_pages(void *dummy __unused)
{
struct pcpu *pc;
vm_offset_t pages;
diff --git a/sys/arm/arm/pmu_fdt.c b/sys/arm/arm/pmu_fdt.c
index 3e733f3e1b18..dd6087652e38 100644
--- a/sys/arm/arm/pmu_fdt.c
+++ b/sys/arm/arm/pmu_fdt.c
@@ -152,7 +152,7 @@ pmu_parse_intr(device_t dev, struct pmu_softc *sc)
if (intr_is_per_cpu(sc->irq[0].res)) {
if (has_affinity) {
device_printf(dev,
- "Per CPU interupt have declared affinity\n");
+ "Per CPU interrupt have declared affinity\n");
err = ENXIO;
goto done;
}
@@ -179,7 +179,7 @@ pmu_parse_intr(device_t dev, struct pmu_softc *sc)
if (intr_is_per_cpu(sc->irq[i].res))
{
- device_printf(dev, "Unexpected per CPU interupt\n");
+ device_printf(dev, "Unexpected per CPU interrupt\n");
err = ENXIO;
goto done;
}
diff --git a/sys/arm/arm/unwind.c b/sys/arm/arm/unwind.c
index 7ad91a3e01a5..0d77074fae34 100644
--- a/sys/arm/arm/unwind.c
+++ b/sys/arm/arm/unwind.c
@@ -278,7 +278,7 @@ unwind_module_unloaded(struct linker_file *lf)
* the unwind tables might be stripped, so instead we have to use the
* _exidx_start/end symbols created by ldscript.arm.
*/
-static int
+static void
module_info_init(void *arg __unused)
{
struct linker_file thekernel;
@@ -291,8 +291,6 @@ module_info_init(void *arg __unused)
thekernel.exidx_addr = CADDR(&_exidx_start);
thekernel.exidx_size = UADDR(&_exidx_end) - UADDR(&_exidx_start);
populate_module_info(create_module_info(), &thekernel);
-
- return (0);
}
SYSINIT(unwind_init, SI_SUB_KMEM, SI_ORDER_ANY, module_info_init, NULL);
diff --git a/sys/arm/broadcom/bcm2835/bcm2835_gpio.c b/sys/arm/broadcom/bcm2835/bcm2835_gpio.c
index 93ee5d7c8bd3..ff5c4043dd86 100644
--- a/sys/arm/broadcom/bcm2835/bcm2835_gpio.c
+++ b/sys/arm/broadcom/bcm2835/bcm2835_gpio.c
@@ -1321,6 +1321,10 @@ static device_method_t bcm_gpio_methods[] = {
DEVMETHOD(device_attach, bcm_gpio_attach),
DEVMETHOD(device_detach, bcm_gpio_detach),
+ /* Bus interface */
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
/* GPIO protocol */
DEVMETHOD(gpio_get_bus, bcm_gpio_get_bus),
DEVMETHOD(gpio_pin_max, bcm_gpio_pin_max),
diff --git a/sys/arm/conf/TEGRA124 b/sys/arm/conf/TEGRA124
index ad5532427eda..ff23e63f77bd 100644
--- a/sys/arm/conf/TEGRA124
+++ b/sys/arm/conf/TEGRA124
@@ -107,9 +107,9 @@ device ums # USB mouse
# Wireless NIC cards
#device wlan # 802.11 support
#device wlan_wep # 802.11 WEP support
+#device wlan_tkip # 802.11 TKIP support
#device wlan_ccmp # 802.11 CCMP support
#device wlan_gcmp # 802.11 GCMP support
-#device wlan_tkip # 802.11 TKIP support
#device wlan_amrr # AMRR transmit rate control algorithm
# PCI
diff --git a/sys/arm/freescale/imx/imx_gpio.c b/sys/arm/freescale/imx/imx_gpio.c
index 3b19ef1b5e67..60b8d79ab27e 100644
--- a/sys/arm/freescale/imx/imx_gpio.c
+++ b/sys/arm/freescale/imx/imx_gpio.c
@@ -918,6 +918,10 @@ static device_method_t imx51_gpio_methods[] = {
DEVMETHOD(device_detach, imx51_gpio_detach),
#ifdef INTRNG
+ /* Bus interface */
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
/* Interrupt controller interface */
DEVMETHOD(pic_disable_intr, gpio_pic_disable_intr),
DEVMETHOD(pic_enable_intr, gpio_pic_enable_intr),
diff --git a/sys/arm/include/atomic.h b/sys/arm/include/atomic.h
index f3313b136656..f66953710615 100644
--- a/sys/arm/include/atomic.h
+++ b/sys/arm/include/atomic.h
@@ -1103,11 +1103,9 @@ atomic_thread_fence_seq_cst(void)
#define atomic_store_rel_int atomic_store_rel_32
#define atomic_swap_int atomic_swap_32
-/*
- * For:
- * - atomic_load_acq_8
- * - atomic_load_acq_16
- */
#include <sys/_atomic_subword.h>
+#define atomic_set_short atomic_set_16
+#define atomic_clear_short atomic_clear_16
+
#endif /* _MACHINE_ATOMIC_H_ */
diff --git a/sys/arm/mv/mvebu_gpio.c b/sys/arm/mv/mvebu_gpio.c
index 4cc9b7030a65..c27d5a204052 100644
--- a/sys/arm/mv/mvebu_gpio.c
+++ b/sys/arm/mv/mvebu_gpio.c
@@ -839,6 +839,10 @@ static device_method_t mvebu_gpio_methods[] = {
DEVMETHOD(device_attach, mvebu_gpio_attach),
DEVMETHOD(device_detach, mvebu_gpio_detach),
+ /* Bus interface */
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
/* Interrupt controller interface */
DEVMETHOD(pic_disable_intr, mvebu_gpio_pic_disable_intr),
DEVMETHOD(pic_enable_intr, mvebu_gpio_pic_enable_intr),
diff --git a/sys/arm/nvidia/tegra_gpio.c b/sys/arm/nvidia/tegra_gpio.c
index aa34537352be..ce24fccd3a40 100644
--- a/sys/arm/nvidia/tegra_gpio.c
+++ b/sys/arm/nvidia/tegra_gpio.c
@@ -853,6 +853,10 @@ static device_method_t tegra_gpio_methods[] = {
DEVMETHOD(device_attach, tegra_gpio_attach),
DEVMETHOD(device_detach, tegra_gpio_detach),
+ /* Bus interface */
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
/* Interrupt controller interface */
DEVMETHOD(pic_disable_intr, tegra_gpio_pic_disable_intr),
DEVMETHOD(pic_enable_intr, tegra_gpio_pic_enable_intr),
diff --git a/sys/arm/ti/ti_gpio.c b/sys/arm/ti/ti_gpio.c
index 01b9597a4418..b7e9909b8548 100644
--- a/sys/arm/ti/ti_gpio.c
+++ b/sys/arm/ti/ti_gpio.c
@@ -1048,6 +1048,10 @@ static device_method_t ti_gpio_methods[] = {
DEVMETHOD(device_attach, ti_gpio_attach),
DEVMETHOD(device_detach, ti_gpio_detach),
+ /* Bus interface */
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
/* GPIO protocol */
DEVMETHOD(gpio_get_bus, ti_gpio_get_bus),
DEVMETHOD(gpio_pin_max, ti_gpio_pin_max),