Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mailbox WIP to discuss how we will implement RTKit #6

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion drivers/irqchip/irq-apple-aic.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ static void aic_irq_eoi(struct irq_data *d)
* Reading the interrupt reason automatically acknowledges and masks
* the IRQ, so we just unmask it here if needed.
*/
if (!irqd_irq_disabled(d) && !irqd_irq_masked(d))
if (!irqd_irq_masked(d))
aic_irq_unmask(d);
}

Expand Down
5 changes: 5 additions & 0 deletions drivers/mailbox/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ menuconfig MAILBOX

if MAILBOX

config APPLE_MBOX
tristate "Apple RTKit Mailbox"
depends on ARM64
default ARCH_APPLE

config ARM_MHU
tristate "ARM MHU Mailbox"
depends on ARM_AMBA
Expand Down
4 changes: 4 additions & 0 deletions drivers/mailbox/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,7 @@ obj-$(CONFIG_SUN6I_MSGBOX) += sun6i-msgbox.o
obj-$(CONFIG_SPRD_MBOX) += sprd-mailbox.o

obj-$(CONFIG_QCOM_IPCC) += qcom-ipcc.o

obj-$(CONFIG_APPLE_MBOX) += apple-asc-mailbox.o

CFLAGS_apple-asc-mailbox.o := -I$(src)
81 changes: 81 additions & 0 deletions drivers/mailbox/apple-asc-mailbox-trace.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
#undef TRACE_SYSTEM
#define TRACE_SYSTEM apple_asc

#if !defined(__APPLE_ASC_MAILBOX_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
#define __APPLE_ASC_MAILBOX_TRACE_H

#include <linux/types.h>
#include <linux/tracepoint.h>

#include "apple-asc-mailbox.h"

DECLARE_EVENT_CLASS(apple_rtkit_log_msg,
TP_PROTO(struct apple_mbox *mbox, u64 msg0, u64 msg1),
TP_ARGS(mbox, msg0, msg1),
TP_STRUCT__entry(
__string(name, dev_name(mbox->dev))
__field(u64, msg0)
__field(u64, msg1)
),
TP_fast_assign(
__assign_str(name, dev_name(mbox->dev));
__entry->msg0 = msg0;
__entry->msg1 = msg1;
),
TP_printk("%s: %016llx %016llx (ep: 0x%02x)",
__get_str(name),
__entry->msg0,
__entry->msg1,
((u8)__entry->msg1&0xff))
);

DEFINE_EVENT(apple_rtkit_log_msg, apple_mbox_hw_send,
TP_PROTO(struct apple_mbox *mbox, u64 msg0, u64 msg1),
TP_ARGS(mbox, msg0, msg1)
);

DEFINE_EVENT(apple_rtkit_log_msg, apple_mbox_hw_recv,
TP_PROTO(struct apple_mbox *mbox, u64 msg0, u64 msg1),
TP_ARGS(mbox, msg0, msg1)
);

DEFINE_EVENT(apple_rtkit_log_msg, apple_mbox_send_fifo_put,
TP_PROTO(struct apple_mbox *mbox, u64 msg0, u64 msg1),
TP_ARGS(mbox, msg0, msg1)
);

DECLARE_EVENT_CLASS(apple_rtkit_irq_endis,
TP_PROTO(struct apple_mbox *mbox, bool enable),
TP_ARGS(mbox, enable),
TP_STRUCT__entry(
__string(name, dev_name(mbox->dev))
__field(bool, enable)
),
TP_fast_assign(
__assign_str(name, dev_name(mbox->dev));
__entry->enable = enable;
),
TP_printk("%s: %d",
__get_str(name),
__entry->enable)
);

DEFINE_EVENT(apple_rtkit_irq_endis, apple_mbox_can_recv_irq_enable,
TP_PROTO(struct apple_mbox *mbox, bool enable),
TP_ARGS(mbox, enable)
);

DEFINE_EVENT(apple_rtkit_irq_endis, apple_mbox_can_send_irq_enable,
TP_PROTO(struct apple_mbox *mbox, bool enable),
TP_ARGS(mbox, enable)
);

#endif

#undef TRACE_INCLUDE_PATH
#define TRACE_INCLUDE_PATH .

#undef TRACE_INCLUDE_FILE
#define TRACE_INCLUDE_FILE apple-asc-mailbox-trace

#include <trace/define_trace.h>
Loading