aboutsummaryrefslogtreecommitdiff
path: root/sys/arm
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arm')
-rw-r--r--sys/arm/allwinner/a10_codec.c12
-rw-r--r--sys/arm/allwinner/aw_i2s.c8
-rw-r--r--sys/arm/allwinner/aw_sid.c2
-rw-r--r--sys/arm/arm/debug_monitor.c34
-rw-r--r--sys/arm/arm/elf_machdep.c4
-rw-r--r--sys/arm/arm/gic.c6
-rw-r--r--sys/arm/arm/gic_common.h2
-rw-r--r--sys/arm/arm/machdep_boot.c2
-rw-r--r--sys/arm/arm/pmap-v6.c2
-rw-r--r--sys/arm/arm/unwind.c4
-rw-r--r--sys/arm/broadcom/bcm2835/bcm2835_audio.c232
-rw-r--r--sys/arm/broadcom/bcm2835/vc_vchi_audioserv_defs.h8
-rw-r--r--sys/arm/conf/GENERIC12
-rw-r--r--sys/arm/conf/NOTES5
-rw-r--r--sys/arm/conf/TEGRA1244
-rw-r--r--sys/arm/freescale/imx/imx6_ssi.c34
-rw-r--r--sys/arm/freescale/vybrid/vf_sai.c26
-rw-r--r--sys/arm/include/_limits.h3
-rw-r--r--sys/arm/include/_stdint.h23
-rw-r--r--sys/arm/include/ieeefp.h10
-rw-r--r--sys/arm/include/kexec.h38
-rw-r--r--sys/arm/include/param.h2
-rw-r--r--sys/arm/include/vmparam.h5
-rw-r--r--sys/arm/mv/mv_cp110_icu.c2
-rw-r--r--sys/arm/nvidia/tegra_ahci.c2
-rw-r--r--sys/arm/nvidia/tegra_lic.c4
-rw-r--r--sys/arm/nvidia/tegra_mc.c2
-rw-r--r--sys/arm/nvidia/tegra_xhci.c4
-rw-r--r--sys/arm/ti/clk/ti_clkctrl.c6
-rw-r--r--sys/arm/ti/cpsw/if_cpsw.c2
-rw-r--r--sys/arm/ti/ti_pruss.c1
31 files changed, 350 insertions, 151 deletions
diff --git a/sys/arm/allwinner/a10_codec.c b/sys/arm/allwinner/a10_codec.c
index 12d389d24243..d3920eddc1f1 100644
--- a/sys/arm/allwinner/a10_codec.c
+++ b/sys/arm/allwinner/a10_codec.c
@@ -159,7 +159,7 @@ struct a10codec_chinfo {
struct a10codec_info {
device_t dev;
struct resource *res[2];
- struct mtx *lock;
+ struct mtx lock;
bus_dma_tag_t dmat;
unsigned dmasize;
void *ih;
@@ -680,7 +680,7 @@ a10codec_dmaintr(void *priv)
struct a10codec_chinfo *ch = priv;
unsigned bufsize;
- bufsize = sndbuf_getsize(ch->buffer);
+ bufsize = ch->buffer->bufsize;
ch->pos += ch->blocksize;
if (ch->pos >= bufsize)
@@ -949,7 +949,7 @@ a10codec_chan_trigger(kobj_t obj, void *data, int go)
if (!PCMTRIG_COMMON(go))
return (0);
- snd_mtxlock(sc->lock);
+ mtx_lock(&sc->lock);
switch (go) {
case PCMTRIG_START:
ch->run = 1;
@@ -964,7 +964,7 @@ a10codec_chan_trigger(kobj_t obj, void *data, int go)
default:
break;
}
- snd_mtxunlock(sc->lock);
+ mtx_unlock(&sc->lock);
return (0);
}
@@ -1075,7 +1075,7 @@ a10codec_attach(device_t dev)
sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK | M_ZERO);
sc->cfg = (void *)ofw_bus_search_compatible(dev, compat_data)->ocd_data;
sc->dev = dev;
- sc->lock = snd_mtxcreate(device_get_nameunit(dev), "a10codec softc");
+ mtx_init(&sc->lock, device_get_nameunit(dev), "a10codec_softc", MTX_DEF);
if (bus_alloc_resources(dev, a10codec_spec, sc->res)) {
device_printf(dev, "cannot allocate resources for device\n");
@@ -1180,7 +1180,7 @@ a10codec_attach(device_t dev)
fail:
bus_release_resources(dev, a10codec_spec, sc->res);
- snd_mtxfree(sc->lock);
+ mtx_destroy(&sc->lock);
free(sc, M_DEVBUF);
return (ENXIO);
diff --git a/sys/arm/allwinner/aw_i2s.c b/sys/arm/allwinner/aw_i2s.c
index 87dfb109363f..31c6d9854171 100644
--- a/sys/arm/allwinner/aw_i2s.c
+++ b/sys/arm/allwinner/aw_i2s.c
@@ -530,10 +530,10 @@ aw_i2s_dai_intr(device_t dev, struct snd_dbuf *play_buf, struct snd_dbuf *rec_bu
val = I2S_READ(sc, DA_FSTA);
empty = DA_FSTA_TXE_CNT(val);
count = sndbuf_getready(play_buf);
- size = sndbuf_getsize(play_buf);
+ size = play_buf->bufsize;
readyptr = sndbuf_getreadyptr(play_buf);
- samples = (uint8_t*)sndbuf_getbuf(play_buf);
+ samples = play_buf->buf;
written = 0;
if (empty > count / 2)
empty = count / 2;
@@ -556,9 +556,9 @@ aw_i2s_dai_intr(device_t dev, struct snd_dbuf *play_buf, struct snd_dbuf *rec_bu
available = DA_FSTA_RXA_CNT(val);
count = sndbuf_getfree(rec_buf);
- size = sndbuf_getsize(rec_buf);
+ size = rec_buf->bufsize;
freeptr = sndbuf_getfreeptr(rec_buf);
- samples = (uint8_t*)sndbuf_getbuf(rec_buf);
+ samples = rec_buf->buf;
recorded = 0;
if (available > count / 2)
available = count / 2;
diff --git a/sys/arm/allwinner/aw_sid.c b/sys/arm/allwinner/aw_sid.c
index ba5faca33c5e..932c2f189e51 100644
--- a/sys/arm/allwinner/aw_sid.c
+++ b/sys/arm/allwinner/aw_sid.c
@@ -297,7 +297,7 @@ aw_sid_attach(device_t dev)
/* Register ourself so device can resolve who we are */
OF_device_register_xref(OF_xref_from_node(node), dev);
- for (i = 0; i < sc->sid_conf->nfuses ;i++) {\
+ for (i = 0; i < sc->sid_conf->nfuses; i++) {
SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
OID_AUTO, sc->sid_conf->efuses[i].name,
diff --git a/sys/arm/arm/debug_monitor.c b/sys/arm/arm/debug_monitor.c
index 7944becbae4d..a703c65f541b 100644
--- a/sys/arm/arm/debug_monitor.c
+++ b/sys/arm/arm/debug_monitor.c
@@ -83,8 +83,6 @@ static uint32_t dbg_breakpoint_num;
#define ID_DFR0_CP_DEBUG_M_SHIFT 0
#define ID_DFR0_CP_DEBUG_M_MASK (0xF << ID_DFR0_CP_DEBUG_M_SHIFT)
#define ID_DFR0_CP_DEBUG_M_NS (0x0) /* Not supported */
-#define ID_DFR0_CP_DEBUG_M_V6 (0x2) /* v6 Debug arch. CP14 access */
-#define ID_DFR0_CP_DEBUG_M_V6_1 (0x3) /* v6.1 Debug arch. CP14 access */
#define ID_DFR0_CP_DEBUG_M_V7 (0x4) /* v7 Debug arch. CP14 access */
#define ID_DFR0_CP_DEBUG_M_V7_1 (0x5) /* v7.1 Debug arch. CP14 access */
@@ -594,10 +592,6 @@ dbg_enable_monitor(void)
dbg_dscr = cp14_dbgdscrint_get();
switch (dbg_model) {
- case ID_DFR0_CP_DEBUG_M_V6:
- case ID_DFR0_CP_DEBUG_M_V6_1: /* fall through */
- cp14_dbgdscr_v6_set(dbg_dscr | DBGSCR_MDBG_EN);
- break;
case ID_DFR0_CP_DEBUG_M_V7: /* fall through */
case ID_DFR0_CP_DEBUG_M_V7_1:
cp14_dbgdscr_v7_set(dbg_dscr | DBGSCR_MDBG_EN);
@@ -820,26 +814,12 @@ dbg_get_ossr(void)
static __inline boolean_t
dbg_arch_supported(void)
{
- uint32_t dbg_didr;
-
switch (dbg_model) {
- case ID_DFR0_CP_DEBUG_M_V6:
- case ID_DFR0_CP_DEBUG_M_V6_1:
- dbg_didr = cp14_dbgdidr_get();
- /*
- * read-all-zeroes is used by QEMU
- * to indicate that ARMv6 debug support
- * is not implemented. Real hardware has at
- * least version bits set
- */
- if (dbg_didr == 0)
- return (FALSE);
- return (TRUE);
case ID_DFR0_CP_DEBUG_M_V7:
case ID_DFR0_CP_DEBUG_M_V7_1: /* fall through */
return (TRUE);
default:
- /* We only support valid v6.x/v7.x modes through CP14 */
+ /* We only support valid v7.x modes through CP14 */
return (FALSE);
}
}
@@ -875,16 +855,6 @@ dbg_reset_state(void)
err = 0;
switch (dbg_model) {
- case ID_DFR0_CP_DEBUG_M_V6:
- case ID_DFR0_CP_DEBUG_M_V6_1: /* fall through */
- /*
- * Arch needs monitor mode selected and enabled
- * to be able to access breakpoint/watchpoint registers.
- */
- err = dbg_enable_monitor();
- if (err != 0)
- return (err);
- goto vectr_clr;
case ID_DFR0_CP_DEBUG_M_V7:
/* Is core power domain powered up? */
if ((cp14_dbgprsr_get() & DBGPRSR_PU) == 0)
@@ -974,8 +944,6 @@ dbg_monitor_init(void)
if (bootverbose) {
db_printf("ARM Debug Architecture %s\n",
- (dbg_model == ID_DFR0_CP_DEBUG_M_V6) ? "v6" :
- (dbg_model == ID_DFR0_CP_DEBUG_M_V6_1) ? "v6.1" :
(dbg_model == ID_DFR0_CP_DEBUG_M_V7) ? "v7" :
(dbg_model == ID_DFR0_CP_DEBUG_M_V7_1) ? "v7.1" : "unknown");
}
diff --git a/sys/arm/arm/elf_machdep.c b/sys/arm/arm/elf_machdep.c
index ea6437f320ce..881c4fcff475 100644
--- a/sys/arm/arm/elf_machdep.c
+++ b/sys/arm/arm/elf_machdep.c
@@ -106,7 +106,7 @@ struct sysentvec elf32_freebsd_sysvec = {
};
INIT_SYSENTVEC(elf32_sysvec, &elf32_freebsd_sysvec);
-static Elf32_Brandinfo freebsd_brand_info = {
+static const Elf32_Brandinfo freebsd_brand_info = {
.brand = ELFOSABI_FREEBSD,
.machine = EM_ARM,
.compat_3_brand = "FreeBSD",
@@ -118,7 +118,7 @@ static Elf32_Brandinfo freebsd_brand_info = {
.header_supported= elf32_arm_abi_supported,
};
-SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_FIRST,
+C_SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_FIRST,
(sysinit_cfunc_t) elf32_insert_brand_entry,
&freebsd_brand_info);
diff --git a/sys/arm/arm/gic.c b/sys/arm/arm/gic.c
index b1b7aacd63ab..c1b2cf626ed8 100644
--- a/sys/arm/arm/gic.c
+++ b/sys/arm/arm/gic.c
@@ -514,6 +514,12 @@ arm_gic_read_ivar(device_t dev, device_t child, int which, uintptr_t *result)
("arm_gic_read_ivar: Invalid bus type %u", sc->gic_bus));
*result = sc->gic_bus;
return (0);
+ case GIC_IVAR_VGIC:
+ *result = 0;
+ return (0);
+ case GIC_IVAR_SUPPORT_LPIS:
+ *result = false;
+ return (0);
}
return (ENOENT);
diff --git a/sys/arm/arm/gic_common.h b/sys/arm/arm/gic_common.h
index c45832ec1782..c2d1b1340b9b 100644
--- a/sys/arm/arm/gic_common.h
+++ b/sys/arm/arm/gic_common.h
@@ -38,6 +38,7 @@ struct arm_gic_range {
#define GIC_IVAR_HW_REV 500
#define GIC_IVAR_BUS 501
#define GIC_IVAR_VGIC 502
+#define GIC_IVAR_SUPPORT_LPIS 503
/* GIC_IVAR_BUS values */
#define GIC_BUS_UNKNOWN 0
@@ -48,6 +49,7 @@ struct arm_gic_range {
__BUS_ACCESSOR(gic, hw_rev, GIC, HW_REV, u_int);
__BUS_ACCESSOR(gic, bus, GIC, BUS, u_int);
__BUS_ACCESSOR(gic, vgic, GIC, VGIC, u_int);
+__BUS_ACCESSOR(gic, support_lpis, GIC, SUPPORT_LPIS, bool);
/* Software Generated Interrupts */
#define GIC_FIRST_SGI 0 /* Irqs 0-15 are SGIs/IPIs. */
diff --git a/sys/arm/arm/machdep_boot.c b/sys/arm/arm/machdep_boot.c
index 8a6c63af3c92..9bb1f0ccae91 100644
--- a/sys/arm/arm/machdep_boot.c
+++ b/sys/arm/arm/machdep_boot.c
@@ -165,7 +165,7 @@ cmdline_set_env(char *cmdline, const char *guard)
}
/*
- * Called for armv6 and newer.
+ * Called for armv7 and newer.
*/
void arm_parse_fdt_bootargs(void)
{
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/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_audio.c b/sys/arm/broadcom/bcm2835/bcm2835_audio.c
index 13f309dd3f11..1406fcc3d952 100644
--- a/sys/arm/broadcom/bcm2835/bcm2835_audio.c
+++ b/sys/arm/broadcom/bcm2835/bcm2835_audio.c
@@ -113,6 +113,12 @@ struct bcm2835_audio_chinfo {
uint64_t retrieved_samples;
uint64_t underruns;
int starved;
+ struct bcm_log_vars {
+ unsigned int bsize ;
+ int slept_for_lack_of_space ;
+ } log_vars;
+#define DEFAULT_LOG_VALUES \
+ ((struct bcm_log_vars) { .bsize = 0 , .slept_for_lack_of_space = 0 })
};
struct bcm2835_audio_info {
@@ -132,6 +138,7 @@ struct bcm2835_audio_info {
uint32_t flags_pending;
+ int verbose_trace;
/* Worker thread state */
int worker_state;
};
@@ -140,6 +147,33 @@ struct bcm2835_audio_info {
#define BCM2835_AUDIO_LOCKED(sc) mtx_assert(&(sc)->lock, MA_OWNED)
#define BCM2835_AUDIO_UNLOCK(sc) mtx_unlock(&(sc)->lock)
+#define BCM2835_LOG_ERROR(sc,...) \
+ do { \
+ device_printf((sc)->dev, __VA_ARGS__); \
+ } while(0)
+
+#define BCM2835_LOG_INFO(sc,...) \
+ do { \
+ if (sc->verbose_trace > 0) \
+ device_printf((sc)->dev, __VA_ARGS__); \
+ } while(0)
+
+#define BCM2835_LOG_WARN(sc,...) \
+ do { \
+ if (sc->verbose_trace > 1) \
+ device_printf((sc)->dev, __VA_ARGS__); \
+ } while(0)
+
+#define BCM2835_LOG_TRACE(sc,...) \
+ do { \
+ if(sc->verbose_trace > 2) \
+ device_printf((sc)->dev, __VA_ARGS__); \
+ } while(0)
+
+/* Useful for circular buffer calcs */
+#define MOD_DIFF(front,rear,mod) (((mod) + (front) - (rear)) % (mod))
+
+
static const char *
dest_description(uint32_t dest)
{
@@ -213,10 +247,21 @@ bcm2835_audio_callback(void *param, const VCHI_CALLBACK_REASON_T reason, void *m
m.type);
}
} else if (m.type == VC_AUDIO_MSG_TYPE_COMPLETE) {
- struct bcm2835_audio_chinfo *ch = m.u.complete.cookie;
+ unsigned int signaled = 0;
+ struct bcm2835_audio_chinfo *ch ;
+#if defined(__aarch64__)
+ ch = (void *) ((((size_t)m.u.complete.callback) << 32)
+ | ((size_t)m.u.complete.cookie));
+#else
+ ch = (void *) (m.u.complete.cookie);
+#endif
int count = m.u.complete.count & 0xffff;
int perr = (m.u.complete.count & (1U << 30)) != 0;
+
+ BCM2835_LOG_TRACE(sc, "in:: count:0x%x perr:%d\n",
+ m.u.complete.count, perr);
+
ch->callbacks++;
if (perr)
ch->underruns++;
@@ -236,18 +281,38 @@ bcm2835_audio_callback(void *param, const VCHI_CALLBACK_REASON_T reason, void *m
device_printf(sc->dev, "available_space == %d, count = %d, perr=%d\n",
ch->available_space, count, perr);
device_printf(sc->dev,
- "retrieved_samples = %lld, submitted_samples = %lld\n",
- ch->retrieved_samples, ch->submitted_samples);
+ "retrieved_samples = %ju, submitted_samples = %ju\n",
+ (uintmax_t)ch->retrieved_samples,
+ (uintmax_t)ch->submitted_samples);
}
- ch->available_space += count;
- ch->retrieved_samples += count;
}
- if (perr || (ch->available_space >= VCHIQ_AUDIO_PACKET_SIZE))
- cv_signal(&sc->worker_cv);
+ ch->available_space += count;
+ ch->retrieved_samples += count;
+ /*
+ * XXXMDC
+ * Experimental: if VC says it's empty, believe it
+ * Has to come after the usual adjustments
+ */
+ if(perr){
+ ch->available_space = VCHIQ_AUDIO_BUFFER_SIZE;
+ perr = ch->retrieved_samples; // shd be != 0
+ }
+
+ if ((ch->available_space >= 1*VCHIQ_AUDIO_PACKET_SIZE)){
+ cv_signal(&sc->worker_cv);
+ signaled = 1;
+ }
}
BCM2835_AUDIO_UNLOCK(sc);
+ if(perr){
+ BCM2835_LOG_WARN(sc,
+ "VC starved; reported %u for a total of %u\n"
+ "worker %s\n", count, perr,
+ (signaled ? "signaled": "not signaled"));
+ }
} else
- printf("%s: unknown m.type: %d\n", __func__, m.type);
+ BCM2835_LOG_WARN(sc, "%s: unknown m.type: %d\n", __func__,
+ m.type);
}
/* VCHIQ stuff */
@@ -259,13 +324,13 @@ bcm2835_audio_init(struct bcm2835_audio_info *sc)
/* Initialize and create a VCHI connection */
status = vchi_initialise(&sc->vchi_instance);
if (status != 0) {
- printf("vchi_initialise failed: %d\n", status);
+ BCM2835_LOG_ERROR(sc, "vchi_initialise failed: %d\n", status);
return;
}
status = vchi_connect(NULL, 0, sc->vchi_instance);
if (status != 0) {
- printf("vchi_connect failed: %d\n", status);
+ BCM2835_LOG_ERROR(sc, "vchi_connect failed: %d\n", status);
return;
}
@@ -297,7 +362,8 @@ bcm2835_audio_release(struct bcm2835_audio_info *sc)
if (sc->vchi_handle != VCHIQ_SERVICE_HANDLE_INVALID) {
success = vchi_service_close(sc->vchi_handle);
if (success != 0)
- printf("vchi_service_close failed: %d\n", success);
+ BCM2835_LOG_ERROR(sc, "vchi_service_close failed: %d\n",
+ success);
vchi_service_release(sc->vchi_handle);
sc->vchi_handle = VCHIQ_SERVICE_HANDLE_INVALID;
}
@@ -327,7 +393,9 @@ bcm2835_audio_start(struct bcm2835_audio_chinfo *ch)
&m, sizeof m, VCHI_FLAGS_BLOCK_UNTIL_QUEUED, NULL);
if (ret != 0)
- printf("%s: vchi_msg_queue failed (err %d)\n", __func__, ret);
+ BCM2835_LOG_ERROR(sc,
+ "%s: vchi_msg_queue failed (err %d)\n", __func__,
+ ret);
}
}
@@ -342,11 +410,14 @@ bcm2835_audio_stop(struct bcm2835_audio_chinfo *ch)
m.type = VC_AUDIO_MSG_TYPE_STOP;
m.u.stop.draining = 0;
+ BCM2835_LOG_INFO(sc,"sending stop\n");
ret = vchi_msg_queue(sc->vchi_handle,
&m, sizeof m, VCHI_FLAGS_BLOCK_UNTIL_QUEUED, NULL);
if (ret != 0)
- printf("%s: vchi_msg_queue failed (err %d)\n", __func__, ret);
+ BCM2835_LOG_ERROR(sc,
+ "%s: vchi_msg_queue failed (err %d)\n", __func__,
+ ret);
}
}
@@ -362,7 +433,9 @@ bcm2835_audio_open(struct bcm2835_audio_info *sc)
&m, sizeof m, VCHI_FLAGS_BLOCK_UNTIL_QUEUED, NULL);
if (ret != 0)
- printf("%s: vchi_msg_queue failed (err %d)\n", __func__, ret);
+ BCM2835_LOG_ERROR(sc,
+ "%s: vchi_msg_queue failed (err %d)\n", __func__,
+ ret);
}
}
@@ -384,7 +457,9 @@ bcm2835_audio_update_controls(struct bcm2835_audio_info *sc, uint32_t volume, ui
&m, sizeof m, VCHI_FLAGS_BLOCK_UNTIL_QUEUED, NULL);
if (ret != 0)
- printf("%s: vchi_msg_queue failed (err %d)\n", __func__, ret);
+ BCM2835_LOG_ERROR(sc,
+ "%s: vchi_msg_queue failed (err %d)\n", __func__,
+ ret);
}
}
@@ -404,7 +479,9 @@ bcm2835_audio_update_params(struct bcm2835_audio_info *sc, uint32_t fmt, uint32_
&m, sizeof m, VCHI_FLAGS_BLOCK_UNTIL_QUEUED, NULL);
if (ret != 0)
- printf("%s: vchi_msg_queue failed (err %d)\n", __func__, ret);
+ BCM2835_LOG_ERROR(sc,
+ "%s: vchi_msg_queue failed (err %d)\n", __func__,
+ ret);
}
}
@@ -412,18 +489,25 @@ static bool
bcm2835_audio_buffer_should_sleep(struct bcm2835_audio_chinfo *ch)
{
+ ch->log_vars.slept_for_lack_of_space = 0;
if (ch->playback_state != PLAYBACK_PLAYING)
return (true);
/* Not enough data */
- if (sndbuf_getready(ch->buffer) < VCHIQ_AUDIO_PACKET_SIZE) {
- printf("starve\n");
+ /* XXXMDC Take unsubmitted stuff into account */
+ if (sndbuf_getready(ch->buffer)
+ - MOD_DIFF(
+ ch->unsubmittedptr,
+ sndbuf_getreadyptr(ch->buffer),
+ ch->buffer->bufsize
+ ) < VCHIQ_AUDIO_PACKET_SIZE) {
ch->starved++;
return (true);
}
/* Not enough free space */
if (ch->available_space < VCHIQ_AUDIO_PACKET_SIZE) {
+ ch->log_vars.slept_for_lack_of_space = 1;
return (true);
}
@@ -444,22 +528,28 @@ bcm2835_audio_write_samples(struct bcm2835_audio_chinfo *ch, void *buf, uint32_t
m.type = VC_AUDIO_MSG_TYPE_WRITE;
m.u.write.count = count;
m.u.write.max_packet = VCHIQ_AUDIO_PACKET_SIZE;
- m.u.write.callback = NULL;
- m.u.write.cookie = ch;
+#if defined(__aarch64__)
+ m.u.write.callback = (uint32_t)(((size_t) ch) >> 32) & 0xffffffff;
+ m.u.write.cookie = (uint32_t)(((size_t) ch) & 0xffffffff);
+#else
+ m.u.write.callback = (uint32_t) NULL;
+ m.u.write.cookie = (uint32_t) ch;
+#endif
m.u.write.silence = 0;
ret = vchi_msg_queue(sc->vchi_handle,
&m, sizeof m, VCHI_FLAGS_BLOCK_UNTIL_QUEUED, NULL);
if (ret != 0)
- printf("%s: vchi_msg_queue failed (err %d)\n", __func__, ret);
+ BCM2835_LOG_ERROR(sc, "%s: vchi_msg_queue failed (err %d)\n",
+ __func__, ret);
while (count > 0) {
int bytes = MIN((int)m.u.write.max_packet, (int)count);
ret = vchi_msg_queue(sc->vchi_handle,
buf, bytes, VCHI_FLAGS_BLOCK_UNTIL_QUEUED, NULL);
if (ret != 0)
- printf("%s: vchi_msg_queue failed: %d\n",
+ BCM2835_LOG_ERROR(sc, "%s: vchi_msg_queue failed: %d\n",
__func__, ret);
buf = (char *)buf + bytes;
count -= bytes;
@@ -491,6 +581,11 @@ bcm2835_audio_worker(void *data)
while ((sc->flags_pending == 0) &&
bcm2835_audio_buffer_should_sleep(ch)) {
cv_wait_sig(&sc->worker_cv, &sc->lock);
+ if ((sc->flags_pending == 0) &&
+ (ch->log_vars.slept_for_lack_of_space)) {
+ BCM2835_LOG_TRACE(sc,
+ "slept for lack of space\n");
+ }
}
flags = sc->flags_pending;
/* Clear pending flags */
@@ -517,16 +612,25 @@ bcm2835_audio_worker(void *data)
BCM2835_AUDIO_LOCK(sc);
bcm2835_audio_reset_channel(&sc->pch);
ch->playback_state = PLAYBACK_IDLE;
+ long sub_total = ch->submitted_samples;
+ long retd = ch->retrieved_samples;
BCM2835_AUDIO_UNLOCK(sc);
+ BCM2835_LOG_INFO(sc,
+ "stopped audio. submitted a total of %lu "
+ "having been acked %lu\n", sub_total, retd);
continue;
}
/* Requested to start playback */
if ((flags & AUDIO_PLAY) &&
(ch->playback_state == PLAYBACK_IDLE)) {
+ BCM2835_LOG_INFO(sc, "starting audio\n");
+ unsigned int bsize = ch->buffer->bufsize;
BCM2835_AUDIO_LOCK(sc);
ch->playback_state = PLAYBACK_PLAYING;
+ ch->log_vars.bsize = bsize;
BCM2835_AUDIO_UNLOCK(sc);
+ BCM2835_LOG_INFO(sc, "buffer size is %u\n", bsize);
bcm2835_audio_start(ch);
}
@@ -536,29 +640,84 @@ bcm2835_audio_worker(void *data)
if (sndbuf_getready(ch->buffer) == 0)
continue;
- count = sndbuf_getready(ch->buffer);
- size = sndbuf_getsize(ch->buffer);
- readyptr = sndbuf_getreadyptr(ch->buffer);
+ uint32_t i_count;
+
+ /* XXXMDC Take unsubmitted stuff into account */
+ count = i_count = sndbuf_getready(ch->buffer)
+ - MOD_DIFF(ch->unsubmittedptr,
+ sndbuf_getreadyptr(ch->buffer),
+ ch->buffer->bufsize);
+ size = ch->buffer->bufsize;
+ readyptr = ch->unsubmittedptr;
+
+ int size_changed = 0;
+ unsigned int available;
BCM2835_AUDIO_LOCK(sc);
- if (readyptr + count > size)
+ if (size != ch->log_vars.bsize) {
+ ch->log_vars.bsize = size;
+ size_changed = 1;
+ }
+ available = ch->available_space;
+ /*
+ * XXXMDC
+ *
+ * On arm64, got into situations where
+ * readyptr was less than a packet away
+ * from the end of the buffer, which led
+ * to count being set to 0 and, inexorably, starvation.
+ * Code below tries to take that into account.
+ * The problem might have been fixed with some of the
+ * other changes that were made in the meantime,
+ * but for now this works fine.
+ */
+ if (readyptr + count > size) {
count = size - readyptr;
- count = min(count, ch->available_space);
- count -= (count % VCHIQ_AUDIO_PACKET_SIZE);
+ }
+ if(count > ch->available_space){
+ count = ch->available_space;
+ count -= (count % VCHIQ_AUDIO_PACKET_SIZE);
+ }else if (count > VCHIQ_AUDIO_PACKET_SIZE){
+ count -= (count % VCHIQ_AUDIO_PACKET_SIZE);
+ }else if (size > count + readyptr) {
+ count = 0;
+ }
BCM2835_AUDIO_UNLOCK(sc);
- if (count < VCHIQ_AUDIO_PACKET_SIZE)
+ if (count % VCHIQ_AUDIO_PACKET_SIZE != 0) {
+ BCM2835_LOG_WARN(sc, "count: %u initial count: %u "
+ "size: %u readyptr: %u available: %u\n", count,
+ i_count,size,readyptr,available);
+ }
+ if (size_changed)
+ BCM2835_LOG_INFO(sc, "bsize changed to %u\n", size);
+
+ if (count == 0) {
+ BCM2835_LOG_WARN(sc,
+ "not enough room for a packet: count %d,"
+ " i_count %d, rptr %d, size %d\n",
+ count, i_count, readyptr, size);
continue;
+ }
- buf = (uint8_t*)sndbuf_getbuf(ch->buffer) + readyptr;
+ buf = ch->buffer->buf + readyptr;
bcm2835_audio_write_samples(ch, buf, count);
BCM2835_AUDIO_LOCK(sc);
- ch->unsubmittedptr = (ch->unsubmittedptr + count) % sndbuf_getsize(ch->buffer);
+ ch->unsubmittedptr = (ch->unsubmittedptr + count) %
+ ch->buffer->bufsize;
ch->available_space -= count;
ch->submitted_samples += count;
+ long sub = count;
+ long sub_total = ch->submitted_samples;
+ long retd = ch->retrieved_samples;
KASSERT(ch->available_space >= 0, ("ch->available_space == %d\n", ch->available_space));
BCM2835_AUDIO_UNLOCK(sc);
+
+ BCM2835_LOG_TRACE(sc,
+ "submitted %lu for a total of %lu having been acked %lu; "
+ "rptr %d, had %u available\n", sub, sub_total, retd,
+ readyptr, available);
}
BCM2835_AUDIO_LOCK(sc);
@@ -577,7 +736,8 @@ bcm2835_audio_create_worker(struct bcm2835_audio_info *sc)
sc->worker_state = WORKER_RUNNING;
if (kproc_create(bcm2835_audio_worker, (void*)sc, &newp, 0, 0,
"bcm2835_audio_worker") != 0) {
- printf("failed to create bcm2835_audio_worker\n");
+ BCM2835_LOG_ERROR(sc,
+ "failed to create bcm2835_audio_worker\n");
}
}
@@ -610,6 +770,8 @@ bcmchan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, struct pcm_channel *
return NULL;
}
+ ch->log_vars = DEFAULT_LOG_VALUES;
+
BCM2835_AUDIO_LOCK(sc);
bcm2835_worker_update_params(sc);
BCM2835_AUDIO_UNLOCK(sc);
@@ -623,7 +785,7 @@ bcmchan_free(kobj_t obj, void *data)
struct bcm2835_audio_chinfo *ch = data;
void *buffer;
- buffer = sndbuf_getbuf(ch->buffer);
+ buffer = ch->buffer->buf;
if (buffer)
free(buffer, M_DEVBUF);
@@ -830,6 +992,9 @@ vchi_audio_sysctl_init(struct bcm2835_audio_info *sc)
SYSCTL_ADD_INT(ctx, tree, OID_AUTO, "starved",
CTLFLAG_RD, &sc->pch.starved,
sc->pch.starved, "number of starved conditions");
+ SYSCTL_ADD_INT(ctx, tree, OID_AUTO, "trace",
+ CTLFLAG_RW, &sc->verbose_trace,
+ sc->verbose_trace, "enable tracing of transfers");
}
static void
@@ -861,6 +1026,7 @@ bcm2835_audio_delayed_init(void *xsc)
bcm2835_audio_open(sc);
sc->volume = 75;
sc->dest = DEST_AUTO;
+ sc->verbose_trace = 0;
if (mixer_init(sc->dev, &bcmmixer_class, sc)) {
device_printf(sc->dev, "mixer_init failed\n");
diff --git a/sys/arm/broadcom/bcm2835/vc_vchi_audioserv_defs.h b/sys/arm/broadcom/bcm2835/vc_vchi_audioserv_defs.h
index 896e706ff492..ea972ff2d001 100644
--- a/sys/arm/broadcom/bcm2835/vc_vchi_audioserv_defs.h
+++ b/sys/arm/broadcom/bcm2835/vc_vchi_audioserv_defs.h
@@ -112,8 +112,8 @@ typedef struct
typedef struct
{
uint32_t count; /* in bytes */
- void *callback;
- void *cookie;
+ uint32_t callback;
+ uint32_t cookie;
uint16_t silence;
uint16_t max_packet;
} VC_AUDIO_WRITE_T;
@@ -129,8 +129,8 @@ typedef struct
typedef struct
{
int32_t count; /* Success value */
- void *callback;
- void *cookie;
+ uint32_t callback;
+ uint32_t cookie;
} VC_AUDIO_COMPLETE_T;
/* Message header for all messages in HOST->VC direction */
diff --git a/sys/arm/conf/GENERIC b/sys/arm/conf/GENERIC
index 7394f3842d43..b0a2eb92554b 100644
--- a/sys/arm/conf/GENERIC
+++ b/sys/arm/conf/GENERIC
@@ -100,7 +100,7 @@ device pci
device pci_host_generic
# PCI NICs
-device re # RealTek 8139C+/8169/8169S/8110S
+device re # Realtek 8139C+/8169/8169S/8110S
# VirtIO
device virtio
@@ -216,6 +216,12 @@ device ffec # Freescale Fast Ethernet Controller
device neta # Marvell 10/100/1000 Network controller
device smsc # SMSC LAN91C111
+# random(4)
+device tpm # Trusted Platform Module
+options RANDOM_ENABLE_TPM # enable entropy from TPM 2.0
+options RANDOM_ENABLE_KBD
+options RANDOM_ENABLE_MOUSE
+
# Sound support
device sound
@@ -270,7 +276,3 @@ makeoptions MODULES_EXTRA+="dtb/nvidia"
makeoptions MODULES_EXTRA+="dtb/rockchip"
makeoptions MODULES_EXTRA+="dtb/rpi"
makeoptions MODULES_EXTRA+="dtb/zynq"
-
-# SOC-specific modules
-makeoptions MODULES_EXTRA+="allwinner"
-makeoptions MODULES_EXTRA+="imx"
diff --git a/sys/arm/conf/NOTES b/sys/arm/conf/NOTES
index 920d721dc3ba..2bd41d911124 100644
--- a/sys/arm/conf/NOTES
+++ b/sys/arm/conf/NOTES
@@ -92,11 +92,6 @@ nodevice mps
nodevice bnxt
-# Build SOC-specific modules...
-
-makeoptions MODULES_EXTRA+="allwinner"
-makeoptions MODULES_EXTRA+="imx"
-
# Build dtb files...
makeoptions MODULES_EXTRA+="dtb/allwinner"
diff --git a/sys/arm/conf/TEGRA124 b/sys/arm/conf/TEGRA124
index ff23e63f77bd..86462841f24e 100644
--- a/sys/arm/conf/TEGRA124
+++ b/sys/arm/conf/TEGRA124
@@ -98,7 +98,7 @@ device ums # USB mouse
#device cdce # Generic USB over Ethernet
#device cue # CATC USB Ethernet
#device kue # Kawasaki LSI USB Ethernet
-#device rue # RealTek RTL8150 USB Ethernet
+#device rue # Realtek RTL8150 USB Ethernet
#device udav # Davicom DM9601E USB
# USB Wireless
@@ -117,7 +117,7 @@ device pci
# PCI Ethernet NICs that use the common MII bus controller code.
# NOTE: Be sure to keep the 'device miibus' line in order to use these NICs!
-device re # RealTek 8139C+/8169/8169S/8110S
+device re # Realtek 8139C+/8169/8169S/8110S
# DRM2
device fbd
diff --git a/sys/arm/freescale/imx/imx6_ssi.c b/sys/arm/freescale/imx/imx6_ssi.c
index cb77f1454e63..f4ef955761b4 100644
--- a/sys/arm/freescale/imx/imx6_ssi.c
+++ b/sys/arm/freescale/imx/imx6_ssi.c
@@ -173,7 +173,7 @@ struct sc_info {
bus_space_tag_t bst;
bus_space_handle_t bsh;
device_t dev;
- struct mtx *lock;
+ struct mtx lock;
void *ih;
int pos;
int dma_size;
@@ -242,10 +242,10 @@ ssimixer_init(struct snd_mixer *m)
mask = SOUND_MASK_PCM;
mask |= SOUND_MASK_VOLUME;
- snd_mtxlock(sc->lock);
+ mtx_lock(&sc->lock);
pcm_setflags(scp->dev, pcm_getflags(scp->dev) | SD_F_SOFTPCMVOL);
mix_setdevs(m, mask);
- snd_mtxunlock(sc->lock);
+ mtx_unlock(&sc->lock);
return (0);
}
@@ -290,14 +290,14 @@ ssichan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b,
scp = (struct sc_pcminfo *)devinfo;
sc = scp->sc;
- snd_mtxlock(sc->lock);
+ mtx_lock(&sc->lock);
ch = &scp->chan[0];
ch->dir = dir;
ch->run = 0;
ch->buffer = b;
ch->channel = c;
ch->parent = scp;
- snd_mtxunlock(sc->lock);
+ mtx_unlock(&sc->lock);
if (sndbuf_setup(ch->buffer, sc->buf_base, sc->dma_size) != 0) {
device_printf(scp->dev, "Can't setup sndbuf.\n");
@@ -318,9 +318,9 @@ ssichan_free(kobj_t obj, void *data)
device_printf(scp->dev, "ssichan_free()\n");
#endif
- snd_mtxlock(sc->lock);
+ mtx_lock(&sc->lock);
/* TODO: free channel buffer */
- snd_mtxunlock(sc->lock);
+ mtx_unlock(&sc->lock);
return (0);
}
@@ -398,7 +398,7 @@ ssichan_setblocksize(kobj_t obj, void *data, uint32_t blocksize)
setup_dma(scp);
- return (sndbuf_getblksz(ch->buffer));
+ return (ch->buffer->blksz);
}
uint32_t
@@ -415,7 +415,7 @@ ssi_dma_intr(void *arg, int chn)
sc = scp->sc;
conf = sc->conf;
- bufsize = sndbuf_getsize(ch->buffer);
+ bufsize = ch->buffer->bufsize;
sc->pos += conf->period;
if (sc->pos >= bufsize)
@@ -487,8 +487,8 @@ setup_dma(struct sc_pcminfo *scp)
conf->saddr = sc->buf_base_phys;
conf->daddr = rman_get_start(sc->res[0]) + SSI_STX0;
conf->event = sc->sdma_ev_tx; /* SDMA TX event */
- conf->period = sndbuf_getblksz(ch->buffer);
- conf->num_bd = sndbuf_getblkcnt(ch->buffer);
+ conf->period = ch->buffer->blksz;
+ conf->num_bd = ch->buffer->blkcnt;
/*
* Word Length
@@ -497,7 +497,7 @@ setup_dma(struct sc_pcminfo *scp)
* SSI supports 24 at max.
*/
- fmt = sndbuf_getfmt(ch->buffer);
+ fmt = ch->buffer->fmt;
if (fmt & AFMT_16BIT) {
conf->word_length = 16;
@@ -565,7 +565,7 @@ ssichan_trigger(kobj_t obj, void *data, int go)
scp = ch->parent;
sc = scp->sc;
- snd_mtxlock(sc->lock);
+ mtx_lock(&sc->lock);
switch (go) {
case PCMTRIG_START:
@@ -590,7 +590,7 @@ ssichan_trigger(kobj_t obj, void *data, int go)
break;
}
- snd_mtxunlock(sc->lock);
+ mtx_unlock(&sc->lock);
return (0);
}
@@ -736,11 +736,7 @@ ssi_attach(device_t dev)
sc->pos = 0;
sc->conf = malloc(sizeof(struct sdma_conf), M_DEVBUF, M_WAITOK | M_ZERO);
- sc->lock = snd_mtxcreate(device_get_nameunit(dev), "ssi softc");
- if (sc->lock == NULL) {
- device_printf(dev, "Can't create mtx\n");
- return (ENXIO);
- }
+ mtx_init(&sc->lock, device_get_nameunit(dev), "ssi softc", MTX_DEF);
if (bus_alloc_resources(dev, ssi_spec, sc->res)) {
device_printf(dev, "could not allocate resources\n");
diff --git a/sys/arm/freescale/vybrid/vf_sai.c b/sys/arm/freescale/vybrid/vf_sai.c
index e895529c4810..d3a3ab93fe80 100644
--- a/sys/arm/freescale/vybrid/vf_sai.c
+++ b/sys/arm/freescale/vybrid/vf_sai.c
@@ -138,7 +138,7 @@ struct sc_info {
bus_space_tag_t bst;
bus_space_handle_t bsh;
device_t dev;
- struct mtx *lock;
+ struct mtx lock;
uint32_t speed;
uint32_t period;
void *ih;
@@ -206,10 +206,10 @@ saimixer_init(struct snd_mixer *m)
mask = SOUND_MASK_PCM;
- snd_mtxlock(sc->lock);
+ mtx_lock(&sc->lock);
pcm_setflags(scp->dev, pcm_getflags(scp->dev) | SD_F_SOFTPCMVOL);
mix_setdevs(m, mask);
- snd_mtxunlock(sc->lock);
+ mtx_unlock(&sc->lock);
return (0);
}
@@ -252,14 +252,14 @@ saichan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b,
scp = (struct sc_pcminfo *)devinfo;
sc = scp->sc;
- snd_mtxlock(sc->lock);
+ mtx_lock(&sc->lock);
ch = &scp->chan[0];
ch->dir = dir;
ch->run = 0;
ch->buffer = b;
ch->channel = c;
ch->parent = scp;
- snd_mtxunlock(sc->lock);
+ mtx_unlock(&sc->lock);
if (sndbuf_setup(ch->buffer, sc->buf_base, sc->dma_size) != 0) {
device_printf(scp->dev, "Can't setup sndbuf.\n");
@@ -280,9 +280,9 @@ saichan_free(kobj_t obj, void *data)
device_printf(scp->dev, "saichan_free()\n");
#endif
- snd_mtxlock(sc->lock);
+ mtx_lock(&sc->lock);
/* TODO: free channel buffer */
- snd_mtxunlock(sc->lock);
+ mtx_unlock(&sc->lock);
return (0);
}
@@ -369,7 +369,7 @@ saichan_setblocksize(kobj_t obj, void *data, uint32_t blocksize)
sndbuf_resize(ch->buffer, sc->dma_size / blocksize, blocksize);
- sc->period = sndbuf_getblksz(ch->buffer);
+ sc->period = ch->buffer->blksz;
return (sc->period);
}
@@ -513,7 +513,7 @@ saichan_trigger(kobj_t obj, void *data, int go)
struct sc_pcminfo *scp = ch->parent;
struct sc_info *sc = scp->sc;
- snd_mtxlock(sc->lock);
+ mtx_lock(&sc->lock);
switch (go) {
case PCMTRIG_START:
@@ -532,7 +532,7 @@ saichan_trigger(kobj_t obj, void *data, int go)
break;
}
- snd_mtxunlock(sc->lock);
+ mtx_unlock(&sc->lock);
return (0);
}
@@ -691,11 +691,7 @@ sai_attach(device_t dev)
sc->sr = &rate_map[0];
sc->pos = 0;
- sc->lock = snd_mtxcreate(device_get_nameunit(dev), "sai softc");
- if (sc->lock == NULL) {
- device_printf(dev, "Cant create mtx\n");
- return (ENXIO);
- }
+ mtx_init(&sc->lock, device_get_nameunit(dev), "sai softc", MTX_DEF);
if (bus_alloc_resources(dev, sai_spec, sc->res)) {
device_printf(dev, "could not allocate resources\n");
diff --git a/sys/arm/include/_limits.h b/sys/arm/include/_limits.h
index 8cd48337508e..d6bcb09bda84 100644
--- a/sys/arm/include/_limits.h
+++ b/sys/arm/include/_limits.h
@@ -42,6 +42,9 @@
*/
#define __CHAR_BIT 8 /* number of bits in a char */
+#define __SHRT_BIT 16 /* number of bits in a short */
+#define __INT_BIT 32 /* number of bits in an int */
+#define __LLONG_BIT 64 /* number of bits in a long long */
#define __SCHAR_MAX 0x7f /* max value for a signed char */
#define __SCHAR_MIN (-0x7f - 1) /* min value for a signed char */
diff --git a/sys/arm/include/_stdint.h b/sys/arm/include/_stdint.h
index 9931f8b56ef5..2ebc6ea4f89f 100644
--- a/sys/arm/include/_stdint.h
+++ b/sys/arm/include/_stdint.h
@@ -153,6 +153,29 @@
#define WINT_MIN INT32_MIN
#define WINT_MAX INT32_MAX
+#if __ISO_C_VISIBLE >= 2023
+/*
+ * ISO/IEC 9899:2023
+ * 7.22.2 Widths of specified-width integer types
+ */
+#define INT_FAST8_WIDTH INT32_WIDTH
+#define INT_FAST16_WIDTH INT32_WIDTH
+#define INT_FAST32_WIDTH INT32_WIDTH
+#define INT_FAST64_WIDTH INT64_WIDTH
+#define INTPTR_WIDTH INT32_WIDTH
+#define INTMAX_WIDTH INT64_WIDTH
+
+/*
+ * ISO/IEC 9899:2023
+ * 7.22.3 Width of other integer types
+ */
+#define PTRDIFF_WIDTH INT32_WIDTH
+#define SIG_ATOMIC_WIDTH INT32_WIDTH
+#define SIZE_WIDTH INT32_WIDTH
+#define WCHAR_WIDTH INT32_WIDTH
+#define WINT_WIDTH INT32_WIDTH
+#endif /* __ISO_C_VISIBLE >= 2023 */
+
#endif /* !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) */
#endif /* !_MACHINE__STDINT_H_ */
diff --git a/sys/arm/include/ieeefp.h b/sys/arm/include/ieeefp.h
index 57dd058b8a95..57719b883d58 100644
--- a/sys/arm/include/ieeefp.h
+++ b/sys/arm/include/ieeefp.h
@@ -49,4 +49,14 @@ typedef enum {
#define fp_except_t int
+/* Augment the userland declarations. */
+__BEGIN_DECLS
+extern fp_rnd_t fpgetround(void);
+extern fp_rnd_t fpsetround(fp_rnd_t);
+extern fp_except_t fpgetmask(void);
+extern fp_except_t fpsetmask(fp_except_t);
+extern fp_except_t fpgetsticky(void);
+extern fp_except_t fpsetsticky(fp_except_t);
+__END_DECLS
+
#endif /* _MACHINE_IEEEFP_H_ */
diff --git a/sys/arm/include/kexec.h b/sys/arm/include/kexec.h
new file mode 100644
index 000000000000..50391d32812a
--- /dev/null
+++ b/sys/arm/include/kexec.h
@@ -0,0 +1,38 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2025 Juniper Networks, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef _ARM_KEXEC_H_
+#define _ARM_KEXEC_H_
+
+int
+kexec_load_md(struct kexec_image *image)
+{
+ return (ENOSYS);
+}
+
+#define kexec_reboot_md(x) do {} while (0)
+#endif /* _ARM_KEXEC_H_ */
diff --git a/sys/arm/include/param.h b/sys/arm/include/param.h
index 67f49ec14a99..79c9bc09c284 100644
--- a/sys/arm/include/param.h
+++ b/sys/arm/include/param.h
@@ -78,8 +78,6 @@
* This does not reflect the optimal alignment, just the possibility
* (within reasonable limits).
*
- * armv4 and v5 require alignment to the type's size. armv6 requires 8-byte
- * alignment for the ldrd/strd instructions, but otherwise follows armv7 rules.
* armv7 requires that an 8-byte type be aligned to at least a 4-byte boundary;
* access to smaller types can be unaligned, except that the compiler may
* optimize access to adjacent uint32_t values into a single load/store-multiple
diff --git a/sys/arm/include/vmparam.h b/sys/arm/include/vmparam.h
index 15807923cefb..03145d7e322a 100644
--- a/sys/arm/include/vmparam.h
+++ b/sys/arm/include/vmparam.h
@@ -73,10 +73,7 @@
#endif
/*
- * The virtual address the kernel is linked to run at. For armv4/5 platforms
- * the low-order 30 bits of this must match the low-order bits of the physical
- * address the kernel is loaded at, so the value is most often provided as a
- * kernel config option in the std.platform file. For armv6/7 the kernel can
+ * The virtual address the kernel is linked to run at. For armv7 the kernel can
* be loaded at any 2MB boundary, and KERNVIRTADDR can also be set to any 2MB
* boundary. It is typically overridden in the std.platform file only when
* KERNBASE is also set to a lower address to provide more KVA.
diff --git a/sys/arm/mv/mv_cp110_icu.c b/sys/arm/mv/mv_cp110_icu.c
index 25ec19bee575..d30f337f56fc 100644
--- a/sys/arm/mv/mv_cp110_icu.c
+++ b/sys/arm/mv/mv_cp110_icu.c
@@ -257,7 +257,7 @@ mv_cp110_icu_init(struct mv_cp110_icu_softc *sc, uint64_t addr)
WR4(sc, ICU_SETSPI_SEI_AH, (addr >> 32) & UINT32_MAX);
break;
default:
- panic("Unkown ICU type.");
+ panic("Unknown ICU type.");
}
sc->initialized = true;
diff --git a/sys/arm/nvidia/tegra_ahci.c b/sys/arm/nvidia/tegra_ahci.c
index 30e28dd33235..efbad6ae618c 100644
--- a/sys/arm/nvidia/tegra_ahci.c
+++ b/sys/arm/nvidia/tegra_ahci.c
@@ -526,7 +526,7 @@ tegra_ahci_ctrl_init(struct tegra_ahci_sc *sc)
rv = sc->soc->init(sc);
if (rv != 0) {
device_printf(sc->dev,
- "SOC specific intialization failed: %d\n", rv);
+ "SOC specific initialization failed: %d\n", rv);
return (rv);
}
}
diff --git a/sys/arm/nvidia/tegra_lic.c b/sys/arm/nvidia/tegra_lic.c
index e1d641635351..6956dc0ca849 100644
--- a/sys/arm/nvidia/tegra_lic.c
+++ b/sys/arm/nvidia/tegra_lic.c
@@ -213,12 +213,12 @@ tegra_lic_attach(device_t dev)
}
sc->parent = OF_device_from_xref(parent_xref);
if (sc->parent == NULL) {
- device_printf(dev, "Cannott find parent controller\n");
+ device_printf(dev, "Cannot find parent controller\n");
goto fail;
}
if (bus_alloc_resources(dev, lic_spec, sc->mem_res)) {
- device_printf(dev, "Cannott allocate resources\n");
+ device_printf(dev, "Cannot allocate resources\n");
goto fail;
}
diff --git a/sys/arm/nvidia/tegra_mc.c b/sys/arm/nvidia/tegra_mc.c
index 2568ff8324af..5703d768e505 100644
--- a/sys/arm/nvidia/tegra_mc.c
+++ b/sys/arm/nvidia/tegra_mc.c
@@ -157,7 +157,7 @@ tegra_mc_intr(void *arg)
if (stat & MC_INT_DECERR_VPR)
printf(" - VPR requirements violated\n");
if (stat & MC_INT_INVALID_APB_ASID_UPDATE)
- printf(" - ivalid APB ASID update\n");
+ printf(" - invalid APB ASID update\n");
if (stat & MC_INT_INVALID_SMMU_PAGE)
printf(" - SMMU address translation error\n");
if (stat & MC_INT_ARBITRATION_EMEM)
diff --git a/sys/arm/nvidia/tegra_xhci.c b/sys/arm/nvidia/tegra_xhci.c
index 474e31981770..b9dac91cccd8 100644
--- a/sys/arm/nvidia/tegra_xhci.c
+++ b/sys/arm/nvidia/tegra_xhci.c
@@ -818,7 +818,7 @@ load_fw(struct tegra_xhci_softc *sc)
DELAY(100);
}
if (i <= 0) {
- device_printf(sc->dev, "Timedout while wating for DMA, "
+ device_printf(sc->dev, "Timedout while waiting for DMA, "
"state: 0x%08X\n",
CSB_RD4(sc, XUSB_CSB_MEMPOOL_L2IMEMOP_RESULT));
return (ETIMEDOUT);
@@ -835,7 +835,7 @@ load_fw(struct tegra_xhci_softc *sc)
DELAY(100);
}
if (i <= 0) {
- device_printf(sc->dev, "Timedout while wating for FALCON cpu, "
+ device_printf(sc->dev, "Timedout while waiting for FALCON cpu, "
"state: 0x%08X\n", CSB_RD4(sc, XUSB_FALCON_CPUCTL));
return (ETIMEDOUT);
}
diff --git a/sys/arm/ti/clk/ti_clkctrl.c b/sys/arm/ti/clk/ti_clkctrl.c
index 72fa8548d4f8..06e558d140f2 100644
--- a/sys/arm/ti/clk/ti_clkctrl.c
+++ b/sys/arm/ti/clk/ti_clkctrl.c
@@ -284,9 +284,9 @@ create_clkctrl(struct ti_clkctrl_softc *sc, cell_t *reg, uint32_t index, uint32_
/*
* Check out XX_CLKCTRL-INDEX(offset)-macro dance in
- * sys/gnu/dts/dts/include/dt-bindings/clock/am3.h
- * sys/gnu/dts/dts/include/dt-bindings/clock/am4.h
- * sys/gnu/dts/dts/include/dt-bindings/clock/dra7.h
+ * sys/contrib/device-tree/include/dt-bindings/clock/am3.h
+ * sys/contrib/device-tree/include/dt-bindings/clock/am4.h
+ * sys/contrib/device-tree/include/dt-bindings/clock/dra7.h
* reg[0] are in practice the same as the offset described in the dts.
*/
/* special_gdbclk_reg are 0 or 1 */
diff --git a/sys/arm/ti/cpsw/if_cpsw.c b/sys/arm/ti/cpsw/if_cpsw.c
index dc3d8b1f9023..e2cc9ee0d7b2 100644
--- a/sys/arm/ti/cpsw/if_cpsw.c
+++ b/sys/arm/ti/cpsw/if_cpsw.c
@@ -1646,7 +1646,7 @@ cpsw_rx_dequeue(struct cpsw_softc *sc)
port = (bd.flags & CPDMA_BD_PORT_MASK) - 1;
KASSERT(port >= 0 && port <= 1,
- ("patcket received with invalid port: %d", port));
+ ("packet received with invalid port: %d", port));
psc = device_get_softc(sc->port[port].dev);
/* Set up mbuf */
diff --git a/sys/arm/ti/ti_pruss.c b/sys/arm/ti/ti_pruss.c
index 4e9f2022240c..bae1de9f2ddf 100644
--- a/sys/arm/ti/ti_pruss.c
+++ b/sys/arm/ti/ti_pruss.c
@@ -793,6 +793,7 @@ static const struct filterops ti_pruss_kq_read = {
.f_isfd = 1,
.f_detach = ti_pruss_irq_kqread_detach,
.f_event = ti_pruss_irq_kqevent,
+ .f_copy = knote_triv_copy,
};
static void