import G96xFXXU8DTC5 OSRC

Signed-off-by: FAROVITUS <farovitus@gmail.com>
This commit is contained in:
FAROVITUS 2020-04-22 21:12:51 +03:00
parent 1e617f8576
commit e74e8cdc8d
268 changed files with 5581 additions and 1228 deletions

View file

@ -117,6 +117,16 @@
samsung,pin-val = <1>;
};
uart1_bus_tx_dat: uart1-bus-tx-dat {
samsung,pins = "gpq0-1";
samsung,pin-val = <1>;
};
uart1_bus_tx_con: uart1-bus-tx-con {
samsung,pins = "gpq0-1";
samsung,pin-function = <1>;
};
dwmmc2_cd_ext_irq: dwmmc2_cd_ext_irq {
samsung,pins = "gpa1-5";
samsung,pin-function = <0xf>;

View file

@ -33,6 +33,11 @@
reg = <0x0 0xF9200000 0x2000000>;
};
zswap_debug {
compatible = "exynos,zswap_debug";
reg = <0x0 0x91300000 0x1000>;
};
sec_debug_magic {
compatible = "exynos,sec_debug_magic";
reg = <0x0 0x80000000 0x1000>;

View file

@ -1433,6 +1433,7 @@ CONFIG_CP_RAM_LOGGING=y
# CONFIG_HW_REV_DETECT is not set
CONFIG_MODEM_IF_QOS=y
CONFIG_MODEM_IF_NET_GRO=y
CONFIG_KLAT=y
#
# Samsung Modem Interface Driver for Memory-type Interface

View file

@ -1433,6 +1433,7 @@ CONFIG_CP_RAM_LOGGING=y
# CONFIG_HW_REV_DETECT is not set
CONFIG_MODEM_IF_QOS=y
CONFIG_MODEM_IF_NET_GRO=y
CONFIG_KLAT=y
#
# Samsung Modem Interface Driver for Memory-type Interface

View file

@ -475,12 +475,12 @@ static struct binder_buffer *binder_alloc_new_buf_locked(
buffer->extra_buffers_size = extra_buffers_size;
if (is_async) {
alloc->free_async_space -= size + sizeof(struct binder_buffer);
if ((system_server_pid == alloc->pid) && (alloc->free_async_space <= 102400)) { // 100K
pr_info("%d: [free_size<100K] binder_alloc_buf size %zd async free %zd\n",
if ((system_server_pid == alloc->pid) && (alloc->free_async_space <= 153600)) { // 150K
pr_info("%d: [free_size<150K] binder_alloc_buf size %zd async free %zd\n",
alloc->pid, size, alloc->free_async_space);
}
if ((system_server_pid == alloc->pid) && (size >= 204800)) { // 200K
pr_info("%d: [alloc_size>200K] binder_alloc_buf size %zd async free %zd\n",
if ((system_server_pid == alloc->pid) && (size >= 122880)) { // 120K
pr_info("%d: [alloc_size>120K] binder_alloc_buf size %zd async free %zd\n",
alloc->pid, size, alloc->free_async_space);
}
binder_alloc_debug(BINDER_DEBUG_BUFFER_ALLOC_ASYNC,

View file

@ -75,13 +75,20 @@ static int axff_init(struct hid_device *hid)
{
struct axff_device *axff;
struct hid_report *report;
struct hid_input *hidinput = list_first_entry(&hid->inputs, struct hid_input, list);
struct hid_input *hidinput;
struct list_head *report_list =&hid->report_enum[HID_OUTPUT_REPORT].report_list;
struct input_dev *dev = hidinput->input;
struct input_dev *dev;
int field_count = 0;
int i, j;
int error;
if (list_empty(&hid->inputs)) {
hid_err(hid, "no inputs found\n");
return -ENODEV;
}
hidinput = list_first_entry(&hid->inputs, struct hid_input, list);
dev = hidinput->input;
if (list_empty(report_list)) {
hid_err(hid, "no output reports found\n");
return -ENODEV;

View file

@ -87,13 +87,19 @@ static int drff_init(struct hid_device *hid)
{
struct drff_device *drff;
struct hid_report *report;
struct hid_input *hidinput = list_first_entry(&hid->inputs,
struct hid_input, list);
struct hid_input *hidinput;
struct list_head *report_list =
&hid->report_enum[HID_OUTPUT_REPORT].report_list;
struct input_dev *dev = hidinput->input;
struct input_dev *dev;
int error;
if (list_empty(&hid->inputs)) {
hid_err(hid, "no inputs found\n");
return -ENODEV;
}
hidinput = list_first_entry(&hid->inputs, struct hid_input, list);
dev = hidinput->input;
if (list_empty(report_list)) {
hid_err(hid, "no output reports found\n");
return -ENODEV;

View file

@ -59,13 +59,19 @@ static int emsff_init(struct hid_device *hid)
{
struct emsff_device *emsff;
struct hid_report *report;
struct hid_input *hidinput = list_first_entry(&hid->inputs,
struct hid_input, list);
struct hid_input *hidinput;
struct list_head *report_list =
&hid->report_enum[HID_OUTPUT_REPORT].report_list;
struct input_dev *dev = hidinput->input;
struct input_dev *dev;
int error;
if (list_empty(&hid->inputs)) {
hid_err(hid, "no inputs found\n");
return -ENODEV;
}
hidinput = list_first_entry(&hid->inputs, struct hid_input, list);
dev = hidinput->input;
if (list_empty(report_list)) {
hid_err(hid, "no output reports found\n");
return -ENODEV;

View file

@ -77,14 +77,20 @@ static int gaff_init(struct hid_device *hid)
{
struct gaff_device *gaff;
struct hid_report *report;
struct hid_input *hidinput = list_entry(hid->inputs.next,
struct hid_input, list);
struct hid_input *hidinput;
struct list_head *report_list =
&hid->report_enum[HID_OUTPUT_REPORT].report_list;
struct list_head *report_ptr = report_list;
struct input_dev *dev = hidinput->input;
struct input_dev *dev;
int error;
if (list_empty(&hid->inputs)) {
hid_err(hid, "no inputs found\n");
return -ENODEV;
}
hidinput = list_entry(hid->inputs.next, struct hid_input, list);
dev = hidinput->input;
if (list_empty(report_list)) {
hid_err(hid, "no output reports found\n");
return -ENODEV;

View file

@ -140,13 +140,19 @@ static int holtekff_init(struct hid_device *hid)
{
struct holtekff_device *holtekff;
struct hid_report *report;
struct hid_input *hidinput = list_entry(hid->inputs.next,
struct hid_input, list);
struct hid_input *hidinput;
struct list_head *report_list =
&hid->report_enum[HID_OUTPUT_REPORT].report_list;
struct input_dev *dev = hidinput->input;
struct input_dev *dev;
int error;
if (list_empty(&hid->inputs)) {
hid_err(hid, "no inputs found\n");
return -ENODEV;
}
hidinput = list_entry(hid->inputs.next, struct hid_input, list);
dev = hidinput->input;
if (list_empty(report_list)) {
hid_err(hid, "no output report found\n");
return -ENODEV;

View file

@ -62,11 +62,17 @@ int lg2ff_init(struct hid_device *hid)
{
struct lg2ff_device *lg2ff;
struct hid_report *report;
struct hid_input *hidinput = list_entry(hid->inputs.next,
struct hid_input, list);
struct input_dev *dev = hidinput->input;
struct hid_input *hidinput;
struct input_dev *dev;
int error;
if (list_empty(&hid->inputs)) {
hid_err(hid, "no inputs found\n");
return -ENODEV;
}
hidinput = list_entry(hid->inputs.next, struct hid_input, list);
dev = hidinput->input;
/* Check that the report looks ok */
report = hid_validate_values(hid, HID_OUTPUT_REPORT, 0, 0, 7);
if (!report)

View file

@ -129,12 +129,19 @@ static const signed short ff3_joystick_ac[] = {
int lg3ff_init(struct hid_device *hid)
{
struct hid_input *hidinput = list_entry(hid->inputs.next, struct hid_input, list);
struct input_dev *dev = hidinput->input;
struct hid_input *hidinput;
struct input_dev *dev;
const signed short *ff_bits = ff3_joystick_ac;
int error;
int i;
if (list_empty(&hid->inputs)) {
hid_err(hid, "no inputs found\n");
return -ENODEV;
}
hidinput = list_entry(hid->inputs.next, struct hid_input, list);
dev = hidinput->input;
/* Check that the report looks ok */
if (!hid_validate_values(hid, HID_OUTPUT_REPORT, 0, 0, 35))
return -ENODEV;

View file

@ -1261,8 +1261,8 @@ static int lg4ff_handle_multimode_wheel(struct hid_device *hid, u16 *real_produc
int lg4ff_init(struct hid_device *hid)
{
struct hid_input *hidinput = list_entry(hid->inputs.next, struct hid_input, list);
struct input_dev *dev = hidinput->input;
struct hid_input *hidinput;
struct input_dev *dev;
struct list_head *report_list = &hid->report_enum[HID_OUTPUT_REPORT].report_list;
struct hid_report *report = list_entry(report_list->next, struct hid_report, list);
const struct usb_device_descriptor *udesc = &(hid_to_usb_dev(hid)->descriptor);
@ -1274,6 +1274,13 @@ int lg4ff_init(struct hid_device *hid)
int mmode_ret, mmode_idx = -1;
u16 real_product_id;
if (list_empty(&hid->inputs)) {
hid_err(hid, "no inputs found\n");
return -ENODEV;
}
hidinput = list_entry(hid->inputs.next, struct hid_input, list);
dev = hidinput->input;
/* Check that the report looks ok */
if (!hid_validate_values(hid, HID_OUTPUT_REPORT, 0, 0, 7))
return -1;

View file

@ -127,12 +127,19 @@ static void hid_lgff_set_autocenter(struct input_dev *dev, u16 magnitude)
int lgff_init(struct hid_device* hid)
{
struct hid_input *hidinput = list_entry(hid->inputs.next, struct hid_input, list);
struct input_dev *dev = hidinput->input;
struct hid_input *hidinput;
struct input_dev *dev;
const signed short *ff_bits = ff_joystick;
int error;
int i;
if (list_empty(&hid->inputs)) {
hid_err(hid, "no inputs found\n");
return -ENODEV;
}
hidinput = list_entry(hid->inputs.next, struct hid_input, list);
dev = hidinput->input;
/* Check that the report looks ok */
if (!hid_validate_values(hid, HID_OUTPUT_REPORT, 0, 0, 7))
return -ENODEV;

View file

@ -1229,8 +1229,8 @@ static void hidpp_ff_destroy(struct ff_device *ff)
static int hidpp_ff_init(struct hidpp_device *hidpp, u8 feature_index)
{
struct hid_device *hid = hidpp->hid_dev;
struct hid_input *hidinput = list_entry(hid->inputs.next, struct hid_input, list);
struct input_dev *dev = hidinput->input;
struct hid_input *hidinput;
struct input_dev *dev;
const struct usb_device_descriptor *udesc = &(hid_to_usb_dev(hid)->descriptor);
const u16 bcdDevice = le16_to_cpu(udesc->bcdDevice);
struct ff_device *ff;
@ -1239,6 +1239,13 @@ static int hidpp_ff_init(struct hidpp_device *hidpp, u8 feature_index)
int error, j, num_slots;
u8 version;
if (list_empty(&hid->inputs)) {
hid_err(hid, "no inputs found\n");
return -ENODEV;
}
hidinput = list_entry(hid->inputs.next, struct hid_input, list);
dev = hidinput->input;
if (!dev) {
hid_err(hid, "Struct input_dev not set!\n");
return -EINVAL;

View file

@ -2159,9 +2159,15 @@ static int sony_play_effect(struct input_dev *dev, void *data,
static int sony_init_ff(struct sony_sc *sc)
{
struct hid_input *hidinput = list_entry(sc->hdev->inputs.next,
struct hid_input, list);
struct input_dev *input_dev = hidinput->input;
struct hid_input *hidinput;
struct input_dev *input_dev;
if (list_empty(&sc->hdev->inputs)) {
hid_err(sc->hdev, "no inputs found\n");
return -ENODEV;
}
hidinput = list_entry(sc->hdev->inputs.next, struct hid_input, list);
input_dev = hidinput->input;
input_set_capability(input_dev, EV_FF, FF_RUMBLE);
return input_ff_create_memless(input_dev, NULL, sony_play_effect);

View file

@ -126,12 +126,18 @@ static int tmff_init(struct hid_device *hid, const signed short *ff_bits)
struct tmff_device *tmff;
struct hid_report *report;
struct list_head *report_list;
struct hid_input *hidinput = list_entry(hid->inputs.next,
struct hid_input, list);
struct input_dev *input_dev = hidinput->input;
struct hid_input *hidinput;
struct input_dev *input_dev;
int error;
int i;
if (list_empty(&hid->inputs)) {
hid_err(hid, "no inputs found\n");
return -ENODEV;
}
hidinput = list_entry(hid->inputs.next, struct hid_input, list);
input_dev = hidinput->input;
tmff = kzalloc(sizeof(struct tmff_device), GFP_KERNEL);
if (!tmff)
return -ENOMEM;

View file

@ -66,11 +66,17 @@ static int zpff_init(struct hid_device *hid)
{
struct zpff_device *zpff;
struct hid_report *report;
struct hid_input *hidinput = list_entry(hid->inputs.next,
struct hid_input, list);
struct input_dev *dev = hidinput->input;
struct hid_input *hidinput;
struct input_dev *dev;
int i, error;
if (list_empty(&hid->inputs)) {
hid_err(hid, "no inputs found\n");
return -ENODEV;
}
hidinput = list_entry(hid->inputs.next, struct hid_input, list);
dev = hidinput->input;
for (i = 0; i < 4; i++) {
report = hid_validate_values(hid, HID_OUTPUT_REPORT, 0, i, 1);
if (!report)

View file

@ -193,7 +193,7 @@ static int __uhid_report_queue_and_wait(struct uhid_device *uhid,
ret = wait_event_interruptible_timeout(uhid->report_wait,
!uhid->report_running || !uhid->running,
10/*5 * HZ*/); // from 5000 to 10 due to BT stuck when connecting apple magic mouse
5 * HZ);
if (!ret || !uhid->running || uhid->report_running)
ret = -EIO;
else if (ret < 0)

View file

@ -308,6 +308,14 @@ static int hiddev_open(struct inode *inode, struct file *file)
spin_unlock_irq(&list->hiddev->list_lock);
mutex_lock(&hiddev->existancelock);
/*
* recheck exist with existance lock held to
* avoid opening a disconnected device
*/
if (!list->hiddev->exist) {
res = -ENODEV;
goto bail_unlock;
}
if (!list->hiddev->open++)
if (list->hiddev->exist) {
struct hid_device *hid = hiddev->hid;
@ -322,6 +330,10 @@ static int hiddev_open(struct inode *inode, struct file *file)
return 0;
bail_unlock:
mutex_unlock(&hiddev->existancelock);
spin_lock_irq(&list->hiddev->list_lock);
list_del(&list->node);
spin_unlock_irq(&list->hiddev->list_lock);
bail:
file->private_data = NULL;
vfree(list);

View file

@ -501,6 +501,15 @@ static void ml_ff_destroy(struct ff_device *ff)
{
struct ml_device *ml = ff->private;
/*
* Even though we stop all playing effects when tearing down
* an input device (via input_device_flush() that calls into
* input_ff_flush() that stops and erases all effects), we
* do not actually stop the timer, and therefore we should
* do it here.
*/
del_timer_sync(&ml->timer);
kfree(ml->private);
}

View file

@ -3202,7 +3202,7 @@ out:
static int sec_ts_pm_suspend(struct device *dev)
{
struct sec_ts_data *ts = dev_get_drvdata(dev);
#ifdef USE_OPEN_CLOSE
#if 0//def USE_OPEN_CLOSE
int retval;
if (ts->input_dev) {

View file

@ -3482,7 +3482,7 @@ out:
static int sec_ts_pm_suspend(struct device *dev)
{
struct sec_ts_data *ts = dev_get_drvdata(dev);
#ifdef USE_OPEN_CLOSE
#if 0//def USE_OPEN_CLOSE
int retval;
if (ts->input_dev) {

View file

@ -1064,7 +1064,10 @@ struct camera2_aa_ctl {
float vendor_objectDistanceCm;
int32_t vendor_colorTempKelvin;
int32_t vendor_enableDynamicShotDm;
uint32_t vendor_reserved[8];
uint32_t vendor_captureHint;
int32_t vendor_captureEV;
uint32_t vendor_ssrmHint;
uint32_t vendor_reserved[5];
};
struct camera2_aa_dm {

View file

@ -179,6 +179,19 @@ static int s5p_mfc_dec_buf_init(struct vb2_buffer *vb)
if (ret < 0)
return ret;
if (dec->dynamic_used & (1 << buf->vb.vb2_buf.index)) {
for (i = 0; i < ctx->dst_fmt->mem_planes; i++) {
mfc_err_dev("ref buf[%d] plane[%d] %#08llx->%#08llx\n",
buf->vb.vb2_buf.index,
i, buf->planes.raw[i],
s5p_mfc_mem_get_daddr_vb(vb, i));
MFC_TRACE_DEV("ref buf[%d] plane[%d] %#08llx->%#08llx\n",
buf->vb.vb2_buf.index,
i, buf->planes.raw[i],
s5p_mfc_mem_get_daddr_vb(vb, i));
}
}
start_raw = s5p_mfc_mem_get_daddr_vb(vb, 0);
if (ctx->dst_fmt->fourcc == V4L2_PIX_FMT_NV12N) {
buf->planes.raw[0] = start_raw;

View file

@ -345,6 +345,64 @@ static void mfc_print_trace_longterm(struct s5p_mfc_dev *dev)
dev->mfc_trace_longterm[cnt].time, dev->mfc_trace_longterm[cnt].str);
}
}
static void mfc_print_dpb_queue(struct s5p_mfc_dev *dev)
{
struct s5p_mfc_ctx *ctx = dev->ctx[dev->curr_ctx];
struct s5p_mfc_dec *dec = NULL;
struct s5p_mfc_buf *mfc_buf = NULL;
int i, index = 0;
if (!ctx)
return;
dec = ctx->dec_priv;
if (ctx->type != MFCINST_DECODER || dec == NULL)
return;
pr_err("-----------dumping MFC DPB queue (used flag: %#x)\n",
s5p_mfc_get_dec_used_flag());
pr_err("used %#x, set %#x, avail %#lx\n",
dec->dynamic_used, dec->dynamic_set, dec->available_dpb);
if (!list_empty(&ctx->dst_buf_queue.head)) {
list_for_each_entry(mfc_buf, &ctx->dst_buf_queue.head, list) {
index = mfc_buf->vb.vb2_buf.index;
pr_err("dst[%d]: Plane[0] fd:%d Addr:%#llx / Plane[1] fd:%d Addr:%#llx\n",
index,
mfc_buf->vb.vb2_buf.planes[0].m.fd,
mfc_buf->planes.raw[0],
mfc_buf->vb.vb2_buf.planes[1].m.fd,
mfc_buf->planes.raw[1]);
}
}
if (!list_empty(&ctx->ref_buf_queue.head)) {
list_for_each_entry(mfc_buf, &ctx->ref_buf_queue.head, list) {
index = mfc_buf->vb.vb2_buf.index;
pr_err("ref[%d]: Plane[0] fd:%d Addr:%#llx / Plane[1] fd:%d Addr:%#llx\n",
index,
mfc_buf->vb.vb2_buf.planes[0].m.fd,
mfc_buf->planes.raw[0],
mfc_buf->vb.vb2_buf.planes[1].m.fd,
mfc_buf->planes.raw[1]);
}
}
if (!list_empty(&ctx->dst_buf_nal_queue.head)) {
list_for_each_entry(mfc_buf, &ctx->dst_buf_nal_queue.head, list) {
index = mfc_buf->vb.vb2_buf.index;
pr_err("dst nal[%d]: Plane[0] fd:%d Addr:%#llx / Plane[1] fd:%d Addr:%#llx\n",
index,
mfc_buf->vb.vb2_buf.planes[0].m.fd,
mfc_buf->planes.raw[0],
mfc_buf->vb.vb2_buf.planes[1].m.fd,
mfc_buf->planes.raw[1]);
}
}
for (i = 0; i < MFC_MAX_DPBS; i++)
if (ctx->dec_priv->assigned_fd[i] != MFC_INFO_INIT_FD)
pr_err("fd[%d]: %d\n", i, ctx->dec_priv->assigned_fd[i]);
}
void s5p_mfc_dump_buffer_info(struct s5p_mfc_dev *dev, unsigned long addr)
{
@ -432,6 +490,7 @@ void s5p_mfc_dump_info_and_stop_hw(struct s5p_mfc_dev *dev)
MFC_TRACE_DEV("** mfc will stop!!!\n");
mfc_display_state(dev);
mfc_print_trace(dev);
mfc_print_dpb_queue(dev);
mfc_save_logging_sfr(dev);
mfc_dump_regs(dev);
exynos_sysmmu_show_status(dev->device);

View file

@ -72,6 +72,11 @@ int hwfc_request_buffer(struct shared_buffer_info *info, int owner)
info->pixel_format = ctx->info.pixel_format;
info->width = ctx->info.width;
info->height = ctx->info.height;
if (ctx->info.buffer_count > MAX_SHARED_BUF_NUM) {
print_repeater_debug(RPT_ERROR, "%s, buffer_count is invalid %d",
__func__, ctx->info.buffer_count);
ctx->info.buffer_count = MAX_SHARED_BUF_NUM;
}
info->buffer_count = ctx->info.buffer_count;
buf_fd = ctx->info.buf_fd;
@ -356,7 +361,8 @@ void encoding_work_handler(struct work_struct *work)
print_repeater_debug(RPT_INT_INFO, "%s--\n", __func__);
}
int repeater_ioctl_map_buf(struct repeater_context *ctx)
int repeater_ioctl_map_buf(
struct repeater_context *ctx, struct repeater_info *info)
{
int ret = 0;
unsigned long flags;
@ -366,6 +372,8 @@ int repeater_ioctl_map_buf(struct repeater_context *ctx)
spin_lock_irqsave(&repeater_spinlock, flags);
memcpy(&ctx->info, info, sizeof(struct repeater_info));
if (ctx->info.buffer_count > MAX_SHARED_BUF_NUM) {
print_repeater_debug(RPT_ERROR, "%s, buffer_count is invalid %d",
__func__, ctx->info.buffer_count);
@ -391,6 +399,8 @@ int repeater_ioctl_map_buf(struct repeater_context *ctx)
__func__, ctx->ctx_status);
}
memcpy(info, &ctx->info, sizeof(struct repeater_info));
spin_unlock_irqrestore(&repeater_spinlock, flags);
print_repeater_debug(RPT_INT_INFO, "%s--\n", __func__);
@ -684,6 +694,7 @@ static long repeater_ioctl(struct file *filp,
{
int ret = 0;
struct repeater_context *ctx;
struct repeater_info info;
print_repeater_debug(RPT_INT_INFO, "%s++\n", __func__);
@ -696,17 +707,17 @@ static long repeater_ioctl(struct file *filp,
switch (cmd) {
case REPEATER_IOCTL_MAP_BUF:
if (copy_from_user(&ctx->info,
if (copy_from_user(&info,
(struct repeater_info __user *)arg,
sizeof(struct repeater_info))) {
ret = -EFAULT;
break;
}
ret = repeater_ioctl_map_buf(ctx);
ret = repeater_ioctl_map_buf(ctx, &info);
if (copy_to_user((struct repeater_info __user *)arg,
&ctx->info,
&info,
sizeof(struct repeater_info))) {
ret = -EFAULT;
break;

View file

@ -0,0 +1,81 @@
/*
* copyright (c) 2019 Samsung Electronics Co., Ltd.
* http://www.samsung.com
*
* Core file for Samsung EXYNOS TSMUX driver
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#ifndef EXYNOS9810_CMU_MFC_H
#define EXYNOS9810_CMU_MFC_H
/* CMU_MFC_SFR is for debugging */
#define TSMUX_CMU_MFC_DESC(_sfr_name, _base_pa, _offset) { \
.sfr_name = _sfr_name, \
.base_pa = _base_pa, \
.offset = _offset, \
}
struct tsmux_cmu_mfc_sfr {
char *sfr_name;
phys_addr_t base_pa;
u32 offset;
};
struct tsmux_cmu_mfc_sfr tsmux_cmu_mfc_sfr_list[] = {
TSMUX_CMU_MFC_DESC("CLK_CON_DIV_DIV_CLK_MFC_BUSP", 0x17800000, 0x1804),
TSMUX_CMU_MFC_DESC("PLL_CON0_MUX_CLKCMU_MFC_WFD_USER", 0x17800000, 0x120),
TSMUX_CMU_MFC_DESC("PLL_CON0_MUX_CLKCMU_MFC_BUS_USER", 0x17800000, 0x100),
TSMUX_CMU_MFC_DESC("DBG_NFO_QCH_CON_WFD_QCH", 0x17800000, 0x705c),
TSMUX_CMU_MFC_DESC("DBG_NFO_QCH_CON_SYSREG_MFC_QCH", 0x17800000, 0x7058),
TSMUX_CMU_MFC_DESC("DBG_NFO_QCH_CON_SYSMMU_MFCD1_QCH", 0x17800000, 0x7054),
TSMUX_CMU_MFC_DESC("DBG_NFO_QCH_CON_SYSMMU_MFCD0_QCH", 0x17800000, 0x7050),
TSMUX_CMU_MFC_DESC("DBG_NFO_QCH_CON_RSTNSYNC_CLK_MFC_BUSD_WFD_SW_RESET_QCH", 0x17800000, 0x704c),
TSMUX_CMU_MFC_DESC("DBG_NFO_QCH_CON_RSTNSYNC_CLK_MFC_BUSD_MFC_SW_RESET_QCH", 0x17800000, 0x7048),
TSMUX_CMU_MFC_DESC("DBG_NFO_QCH_CON_RSTNSYNC_CLK_MFC_BUSD_LH_ATB_SI_SW_RESET_QCH", 0x17800000, 0x7044),
TSMUX_CMU_MFC_DESC("DBG_NFO_QCH_CON_RSTNSYNC_CLK_MFC_BUSD_LH_ATB_MI_SW_RESET_QCH", 0x17800000, 0x7040),
TSMUX_CMU_MFC_DESC("DBG_NFO_QCH_CON_PPMU_MFCD2_QCH", 0x17800000, 0x703c),
TSMUX_CMU_MFC_DESC("DBG_NFO_QCH_CON_PPMU_MFCD1_QCH", 0x17800000, 0x7038),
TSMUX_CMU_MFC_DESC("DBG_NFO_QCH_CON_PPMU_MFCD0_QCH", 0x17800000, 0x7034),
TSMUX_CMU_MFC_DESC("DBG_NFO_QCH_CON_PGEN100_LITE_MFC_QCH", 0x17800000, 0x7030),
TSMUX_CMU_MFC_DESC("DBG_NFO_QCH_CON_MFC_QCH", 0x17800000, 0x702c),
TSMUX_CMU_MFC_DESC("DBG_NFO_QCH_CON_MFC_CMU_MFC_QCH", 0x17800000, 0x7028),
TSMUX_CMU_MFC_DESC("DBG_NFO_QCH_CON_LH_ATB_QCH_SI", 0x17800000, 0x7024),
TSMUX_CMU_MFC_DESC("DBG_NFO_QCH_CON_LH_ATB_QCH_MI", 0x17800000, 0x7020),
TSMUX_CMU_MFC_DESC("DBG_NFO_QCH_CON_LHS_AXI_D1_MFC_QCH", 0x17800000, 0x701c),
TSMUX_CMU_MFC_DESC("DBG_NFO_QCH_CON_LHS_AXI_D0_MFC_QCH", 0x17800000, 0x7018),
TSMUX_CMU_MFC_DESC("DBG_NFO_QCH_CON_LHM_AXI_P_MFC_QCH", 0x17800000, 0x7014),
TSMUX_CMU_MFC_DESC("DBG_NFO_QCH_CON_BTM_MFCD1_QCH", 0x17800000, 0x7010),
TSMUX_CMU_MFC_DESC("DBG_NFO_QCH_CON_BTM_MFCD0_QCH", 0x17800000, 0x700c),
TSMUX_CMU_MFC_DESC("QCH_CON_WFD_QCH", 0x17800000, 0x305c),
TSMUX_CMU_MFC_DESC("QCH_CON_SYSREG_MFC_QCH", 0x17800000, 0x3058),
TSMUX_CMU_MFC_DESC("QCH_CON_SYSMMU_MFCD1_QCH", 0x17800000, 0x3054),
TSMUX_CMU_MFC_DESC("QCH_CON_SYSMMU_MFCD0_QCH", 0x17800000, 0x3050),
TSMUX_CMU_MFC_DESC("QCH_CON_RSTNSYNC_CLK_MFC_BUSD_WFD_SW_RESET_QCH", 0x17800000, 0x304c),
TSMUX_CMU_MFC_DESC("QCH_CON_RSTNSYNC_CLK_MFC_BUSD_MFC_SW_RESET_QCH", 0x17800000, 0x3048),
TSMUX_CMU_MFC_DESC("QCH_CON_RSTNSYNC_CLK_MFC_BUSD_LH_ATB_SI_SW_RESET_QCH", 0x17800000, 0x3044),
TSMUX_CMU_MFC_DESC("QCH_CON_RSTNSYNC_CLK_MFC_BUSD_LH_ATB_MI_SW_RESET_QCH", 0x17800000, 0x3040),
TSMUX_CMU_MFC_DESC("QCH_CON_PPMU_MFCD2_QCH", 0x17800000, 0x303c),
TSMUX_CMU_MFC_DESC("QCH_CON_PPMU_MFCD1_QCH", 0x17800000, 0x3038),
TSMUX_CMU_MFC_DESC("QCH_CON_PPMU_MFCD0_QCH", 0x17800000, 0x3034),
TSMUX_CMU_MFC_DESC("QCH_CON_PGEN100_LITE_MFC_QCH", 0x17800000, 0x3030),
TSMUX_CMU_MFC_DESC("QCH_CON_MFC_QCH", 0x17800000, 0x302c),
TSMUX_CMU_MFC_DESC("QCH_CON_MFC_CMU_MFC_QCH", 0x17800000, 0x3028),
TSMUX_CMU_MFC_DESC("QCH_CON_LH_ATB_QCH_SI", 0x17800000, 0x3024),
TSMUX_CMU_MFC_DESC("QCH_CON_LH_ATB_QCH_MI", 0x17800000, 0x3020),
TSMUX_CMU_MFC_DESC("QCH_CON_LHS_AXI_D1_MFC_QCH", 0x17800000, 0x301c),
TSMUX_CMU_MFC_DESC("QCH_CON_LHS_AXI_D0_MFC_QCH", 0x17800000, 0x3018),
TSMUX_CMU_MFC_DESC("QCH_CON_LHM_AXI_P_MFC_QCH", 0x17800000, 0x3014),
TSMUX_CMU_MFC_DESC("QCH_CON_BTM_MFCD1_QCH", 0x17800000, 0x3010),
TSMUX_CMU_MFC_DESC("QCH_CON_BTM_MFCD0_QCH", 0x17800000, 0x300c),
TSMUX_CMU_MFC_DESC("MFC_CMU_MFC_CONTROLLER_OPTION", 0x17800000, 0x0800),
TSMUX_CMU_MFC_DESC("BUS_COMPONENT_DRCG_EN", 0x17810000, 0x0104),
};
u32 tsmux_cmu_mfc_sfr_list_size = ARRAY_SIZE(tsmux_cmu_mfc_sfr_list);
#endif

View file

@ -38,6 +38,9 @@
#define RTP_HEADER_SIZE 12
#define TS_PACKET_SIZE 188
#define WATCHDOG_INTERVAL 1000
#define MAX_WATCHDOG_TICK_CNT 5
static struct tsmux_device *g_tsmux_dev;
int g_tsmux_debug_level;
module_param(g_tsmux_debug_level, int, 0600);
@ -139,9 +142,11 @@ static int tsmux_iommu_fault_handler(
struct iommu_domain *domain, struct device *dev,
unsigned long fault_addr, int fault_flags, void *token)
{
print_tsmux(TSMUX_COMMON, "%s++\n", __func__);
print_tsmux(TSMUX_ERR, "%s++\n", __func__);
print_tsmux(TSMUX_COMMON, "%s--\n", __func__);
tsmux_sfr_dump();
print_tsmux(TSMUX_ERR, "%s--\n", __func__);
return 0;
}
@ -183,6 +188,99 @@ static int increment_rtp_sequence_number(
return rtp_packet_count;
}
void tsmux_watchdog_tick_start(struct tsmux_device *tsmux_dev, int job_id)
{
struct tsmux_watchdog_tick *watchdog_tick;
print_tsmux(TSMUX_COMMON, "%s++\n", __func__);
if (job_id >= 0 && job_id < TSMUX_MAX_CMD_QUEUE_NUM) {
watchdog_tick = &tsmux_dev->watchdog_tick[job_id];
if (atomic_read(&watchdog_tick->watchdog_tick_running)) {
print_tsmux(TSMUX_COMMON, "job id %d tick was already running\n", job_id);
} else {
print_tsmux(TSMUX_COMMON, "job id %d tick is now running\n", job_id);
atomic_set(&watchdog_tick->watchdog_tick_running, 1);
}
/* Reset the timeout watchdog */
atomic_set(&watchdog_tick->watchdog_tick_count, 0);
} else
print_tsmux(TSMUX_ERR, "invalid job id(%d)\n", job_id);
print_tsmux(TSMUX_COMMON, "%s--\n", __func__);
}
void tsmux_watchdog_tick_stop(struct tsmux_device *tsmux_dev, int job_id)
{
struct tsmux_watchdog_tick *watchdog_tick;
print_tsmux(TSMUX_COMMON, "%s++\n", __func__);
if (job_id >= 0 && job_id < TSMUX_MAX_CMD_QUEUE_NUM) {
watchdog_tick = &tsmux_dev->watchdog_tick[job_id];
if (atomic_read(&watchdog_tick->watchdog_tick_running)) {
print_tsmux(TSMUX_COMMON, "job id %d tick is now stopped\n", job_id);
atomic_set(&watchdog_tick->watchdog_tick_running, 0);
} else {
print_tsmux(TSMUX_COMMON, "job id %d tick was already stopped\n", job_id);
}
/* Reset the timeout watchdog */
atomic_set(&watchdog_tick->watchdog_tick_count, 0);
} else
print_tsmux(TSMUX_ERR, "invalid job id(%d)\n", job_id);
print_tsmux(TSMUX_COMMON, "%s--\n", __func__);
}
void tsmux_watchdog_work_handler(struct work_struct *work)
{
struct tsmux_device *tsmux_dev;
print_tsmux(TSMUX_COMMON, "%s++\n", __func__);
tsmux_dev = container_of(work, struct tsmux_device, watchdog_work);
tsmux_sfr_dump();
/* If OTF job exists, MFC device driver generates kernel panic */
/* Otherwise, TSMUX device driver generates kernel panic */
if (atomic_read(&tsmux_dev->watchdog_tick[0].watchdog_tick_running) == 0)
BUG();
print_tsmux(TSMUX_COMMON, "%s--\n", __func__);
}
void tsmux_watchdog(unsigned long data)
{
struct tsmux_device *tsmux_dev = g_tsmux_dev;
int i = 0;
if (tsmux_dev == NULL) {
print_tsmux(TSMUX_ERR, "g_tsmux_dev is NULL\n");
return;
}
print_tsmux(TSMUX_COMMON, "%s++\n", __func__);
for (i = 0; i < TSMUX_MAX_CMD_QUEUE_NUM; i++) {
if (atomic_read(&tsmux_dev->watchdog_tick[i].watchdog_tick_running))
atomic_inc(&tsmux_dev->watchdog_tick[i].watchdog_tick_count);
else
atomic_set(&tsmux_dev->watchdog_tick[i].watchdog_tick_count, 0);
if (atomic_read(&tsmux_dev->watchdog_tick[i].watchdog_tick_count) >= MAX_WATCHDOG_TICK_CNT) {
/* TSMUX H/W is running, but interrupt was not generated */
schedule_work(&tsmux_dev->watchdog_work);
}
}
mod_timer(&tsmux_dev->watchdog_timer, jiffies + msecs_to_jiffies(WATCHDOG_INTERVAL));
print_tsmux(TSMUX_COMMON, "%s--\n", __func__);
}
irqreturn_t tsmux_irq(int irq, void *priv)
{
struct tsmux_device *tsmux_dev = priv;
@ -220,6 +318,7 @@ irqreturn_t tsmux_irq(int irq, void *priv)
} else
print_tsmux(TSMUX_ERR, "wrong index: %d\n", i);
tsmux_watchdog_tick_stop(tsmux_dev, job_id);
wake_up_interruptible(&ctx->otf_wait_queue);
}
@ -228,6 +327,7 @@ irqreturn_t tsmux_irq(int irq, void *priv)
print_tsmux(TSMUX_COMMON, "Job ID %d is done\n", job_id);
tsmux_clear_job_done(tsmux_dev, job_id);
ctx->m2m_job_done[get_m2m_buffer_idx(job_id)] = true;
tsmux_watchdog_tick_stop(tsmux_dev, job_id);
}
if (tsmux_is_job_done_id_2(tsmux_dev)) {
@ -235,6 +335,7 @@ irqreturn_t tsmux_irq(int irq, void *priv)
print_tsmux(TSMUX_COMMON, "Job ID %d is done\n", job_id);
tsmux_clear_job_done(tsmux_dev, job_id);
ctx->m2m_job_done[get_m2m_buffer_idx(job_id)] = true;
tsmux_watchdog_tick_stop(tsmux_dev, job_id);
}
if (tsmux_is_job_done_id_3(tsmux_dev)) {
@ -242,6 +343,7 @@ irqreturn_t tsmux_irq(int irq, void *priv)
print_tsmux(TSMUX_COMMON, "Job ID %d is done\n", job_id);
tsmux_clear_job_done(tsmux_dev, job_id);
ctx->m2m_job_done[get_m2m_buffer_idx(job_id)] = true;
tsmux_watchdog_tick_stop(tsmux_dev, job_id);
}
spin_unlock(&tsmux_dev->device_spinlock);
@ -322,6 +424,8 @@ static int tsmux_open(struct inode *inode, struct file *filp)
init_waitqueue_head(&ctx->m2m_wait_queue);
init_waitqueue_head(&ctx->otf_wait_queue);
ctx->otf_buf_mapped = false;
//print_tsmux_sfr(tsmux_dev);
//print_dbg_info_all(tsmux_dev);
@ -330,6 +434,11 @@ static int tsmux_open(struct inode *inode, struct file *filp)
//print_tsmux_sfr(tsmux_dev);
//print_dbg_info_all(tsmux_dev);
tsmux_dev->hw_version = tsmux_get_hw_version(tsmux_dev);
if (tsmux_dev->ctx_cnt == 1)
mod_timer(&tsmux_dev->watchdog_timer, jiffies + msecs_to_jiffies(1000));
print_tsmux(TSMUX_COMMON, "%s--\n", __func__);
return ret;
@ -356,6 +465,9 @@ static int tsmux_release(struct inode *inode, struct file *filp)
#endif
spin_lock_irqsave(&tsmux_dev->device_spinlock, flags);
if (tsmux_dev->ctx_cnt == 1)
del_timer(&tsmux_dev->watchdog_timer);
ctx->tsmux_dev->ctx_cnt--;
kfree(ctx);
filp->private_data = NULL;
@ -420,6 +532,21 @@ int tsmux_job_queue(struct tsmux_context *ctx,
tsmux_dev = ctx->tsmux_dev;
/* m2m only */
if (pkt_ctrl->mode == 0) {
if (IS_ERR(inbuf->dmabuf) || IS_ERR(inbuf->dmabuf_att) ||
IS_ERR_VALUE(inbuf->dma_addr) || inbuf->dma_addr == 0) {
print_tsmux(TSMUX_ERR, "tsmux_job_queue() inbuf is invalid\n");
return -ENOMEM;
}
}
if (IS_ERR(outbuf->dmabuf) || IS_ERR(outbuf->dmabuf_att) ||
IS_ERR_VALUE(outbuf->dma_addr) || outbuf->dma_addr == 0) {
print_tsmux(TSMUX_ERR, "tsmux_job_queue() outbuf is invalid\n");
return -ENOMEM;
}
/* set pck_ctrl */
tsmux_set_pkt_ctrl(tsmux_dev, pkt_ctrl);
@ -444,8 +571,7 @@ int tsmux_job_queue(struct tsmux_context *ctx,
/* set pkt_ctrl_reg */
tsmux_job_queue_pkt_ctrl(tsmux_dev);
//print_tsmux_sfr(tsmux_dev);
//print_dbg_info_all(tsmux_dev);
tsmux_watchdog_tick_start(tsmux_dev, pkt_ctrl->id);
print_tsmux(TSMUX_COMMON, "%s--\n", __func__);
@ -457,6 +583,10 @@ int tsmux_ioctl_m2m_map_buf(struct tsmux_context *ctx, int buf_fd, int buf_size,
{
int ret = 0;
struct tsmux_device *tsmux_dev;
unsigned long flags;
struct dma_buf *temp_dmabuf;
struct dma_buf_attachment *temp_dmabuf_att;
dma_addr_t temp_dma_addr;
print_tsmux(TSMUX_M2M, "%s++\n", __func__);
@ -467,27 +597,42 @@ int tsmux_ioctl_m2m_map_buf(struct tsmux_context *ctx, int buf_fd, int buf_size,
print_tsmux(TSMUX_M2M, "map m2m in_buf\n");
buf_info->dmabuf = dma_buf_get(buf_fd);
temp_dmabuf = dma_buf_get(buf_fd);
print_tsmux(TSMUX_M2M, "dma_buf_get(%d) ret dmabuf %pK\n",
buf_fd, buf_info->dmabuf);
buf_fd, temp_dmabuf);
if (IS_ERR(buf_info->dmabuf)) {
buf_info->dmabuf_att = ERR_PTR(-EINVAL);
if (IS_ERR(temp_dmabuf)) {
temp_dmabuf_att = ERR_PTR(-EINVAL);
print_tsmux(TSMUX_ERR, "m2m dma_buf_get() error\n");
ret = -ENOMEM;
} else {
buf_info->dmabuf_att = dma_buf_attach(buf_info->dmabuf, tsmux_dev->dev);
temp_dmabuf_att = dma_buf_attach(temp_dmabuf, tsmux_dev->dev);
print_tsmux(TSMUX_M2M, "dma_buf_attach() ret dmabuf_att %pK\n",
buf_info->dmabuf_att);
temp_dmabuf_att);
}
if (IS_ERR(buf_info->dmabuf_att)) {
buf_info->dma_addr = -EINVAL;
if (IS_ERR(temp_dmabuf_att)) {
temp_dma_addr = -EINVAL;
print_tsmux(TSMUX_ERR, "m2m dma_buf_attach() error\n");
ret = -ENOMEM;
} else {
buf_info->dma_addr = ion_iovmm_map(buf_info->dmabuf_att, 0, buf_size,
temp_dma_addr = ion_iovmm_map(temp_dmabuf_att, 0, buf_size,
DMA_TO_DEVICE, 0);
print_tsmux(TSMUX_M2M, "ion_iovmm_map() ret dma_addr_t 0x%llx\n",
buf_info->dma_addr);
temp_dma_addr);
}
if (IS_ERR_VALUE(temp_dma_addr) || temp_dma_addr == 0) {
print_tsmux(TSMUX_ERR, "m2m ion_iovmm_map() error\n");
ret = -ENOMEM;
}
spin_lock_irqsave(&tsmux_dev->device_spinlock, flags);
buf_info->dmabuf = temp_dmabuf;
buf_info->dmabuf_att = temp_dmabuf_att;
buf_info->dma_addr = temp_dma_addr;
spin_unlock_irqrestore(&tsmux_dev->device_spinlock, flags);
print_tsmux(TSMUX_M2M, "%s--\n", __func__);
return ret;
@ -499,6 +644,10 @@ int tsmux_ioctl_m2m_unmap_buf(struct tsmux_context *ctx,
int ret = 0;
struct tsmux_device *tsmux_dev;
struct ion_client *client;
unsigned long flags;
struct dma_buf *temp_dmabuf;
struct dma_buf_attachment *temp_dmabuf_att;
dma_addr_t temp_dma_addr;
print_tsmux(TSMUX_M2M, "%s++\n", __func__);
@ -510,24 +659,30 @@ int tsmux_ioctl_m2m_unmap_buf(struct tsmux_context *ctx,
print_tsmux(TSMUX_M2M, "unmap m2m in_buf\n");
if (!IS_ERR_VALUE(buf_info->dma_addr) && buf_info->dma_addr) {
print_tsmux(TSMUX_M2M, "ion_iovmm_unmap(%pK, %pK)\n",
buf_info->dmabuf_att, (void *)buf_info->dma_addr);
ion_iovmm_unmap(buf_info->dmabuf_att, buf_info->dma_addr);
buf_info->dma_addr = 0;
spin_lock_irqsave(&tsmux_dev->device_spinlock, flags);
temp_dma_addr = buf_info->dma_addr;
temp_dmabuf_att = buf_info->dmabuf_att;
temp_dmabuf = buf_info->dmabuf;
buf_info->dma_addr = 0;
buf_info->dmabuf_att = 0;
buf_info->dmabuf = 0;
spin_unlock_irqrestore(&tsmux_dev->device_spinlock, flags);
if (!IS_ERR_VALUE(temp_dma_addr) && temp_dma_addr) {
print_tsmux(TSMUX_M2M, "ion_iovmm_unmap(%pK, %llx)\n",
temp_dmabuf_att, temp_dma_addr);
ion_iovmm_unmap(temp_dmabuf_att, temp_dma_addr);
}
if (!IS_ERR_OR_NULL(buf_info->dmabuf_att)) {
if (!IS_ERR_OR_NULL(temp_dmabuf_att)) {
print_tsmux(TSMUX_M2M, "dma_buf_detach(%pK, %pK)\n",
buf_info->dmabuf, buf_info->dmabuf_att);
dma_buf_detach(buf_info->dmabuf, buf_info->dmabuf_att);
buf_info->dmabuf_att = 0;
temp_dmabuf, temp_dmabuf_att);
dma_buf_detach(temp_dmabuf, temp_dmabuf_att);
}
if (!IS_ERR_OR_NULL(buf_info->dmabuf)) {
print_tsmux(TSMUX_M2M, "dma_buf_put(%pK)\n", buf_info->dmabuf);
dma_buf_put(buf_info->dmabuf);
buf_info->dmabuf = 0;
if (!IS_ERR_OR_NULL(temp_dmabuf)) {
print_tsmux(TSMUX_M2M, "dma_buf_put(%pK)\n", temp_dmabuf);
dma_buf_put(temp_dmabuf);
}
print_tsmux(TSMUX_M2M, "%s--\n", __func__);
@ -630,14 +785,14 @@ int tsmux_ioctl_m2m_run(struct tsmux_context *ctx)
m2m_job->pkt_ctrl.rtp_size = TS_PKT_COUNT_PER_RTP;
print_tsmux(TSMUX_COMMON, "m2m job_queue, a_cc %.2x\n", ctx->rtp_ts_info.ts_audio_cc);
tsmux_job_queue(ctx,
&m2m_job->pkt_ctrl,
&m2m_job->pes_hdr,
&m2m_job->ts_hdr,
&m2m_job->rtp_hdr,
m2m_job->in_buf.actual_size,
&ctx->m2m_inbuf_info[i],
&ctx->m2m_outbuf_info[i]);
ret = tsmux_job_queue(ctx, &m2m_job->pkt_ctrl,
&m2m_job->pes_hdr, &m2m_job->ts_hdr,
&m2m_job->rtp_hdr, m2m_job->in_buf.actual_size,
&ctx->m2m_inbuf_info[i], &ctx->m2m_outbuf_info[i]);
if (ret) {
print_tsmux(TSMUX_ERR, "tsmux_job_queue() failed\n");
break;
}
}
}
@ -851,6 +1006,13 @@ int packetize(struct packetizing_param *param)
}
}
if (ctx->otf_buf_mapped == false) {
print_tsmux(TSMUX_ERR, "otf_buf_mapped is false\n");
ret = -1;
spin_unlock_irqrestore(&g_tsmux_dev->device_spinlock, flags);
return ret;
}
if (ctx->otf_outbuf_info[0].dma_addr == 0) {
print_tsmux(TSMUX_ERR, "otf_out_buf is NULL\n");
ret = -1;
@ -982,6 +1144,91 @@ void set_es_size(unsigned int size) {
print_tsmux(TSMUX_OTF, "es_size: %d\n", size);
}
void tsmux_print_context_info(struct tsmux_context *ctx)
{
int i = 0;
struct tsmux_buffer_info *buf_info = NULL;
struct tsmux_buffer *buf = NULL;
if (ctx == NULL) {
print_tsmux(TSMUX_ERR, "tsmux ctx is null\n");
return;
}
for (i = 0; i < TSMUX_OUT_BUF_CNT; i++) {
buf_info = &ctx->otf_outbuf_info[i];
buf = &ctx->otf_cmd_queue.out_buf[i];
print_tsmux(TSMUX_ERR,
"otf_outbuf_info[%d] buf_state: %d\n",
i, buf_info->buf_state);
print_tsmux(TSMUX_ERR,
"otf_outbuf_info[%d] fd: %d, buffer_size: %d, actual_size: %d, offset: %d\n",
i, buf->ion_buf_fd, buf->buffer_size,
buf->actual_size, buf->offset);
print_tsmux(TSMUX_ERR,
"otf_outbuf_info[%d] job_done: %d, part_done: %d, timestamp: %lld\n",
i, buf->job_done, buf->partial_done, buf->time_stamp);
print_tsmux(TSMUX_ERR,
"otf_psi_enabled[%d]: %d\n", i, ctx->otf_psi_enabled[i]);
}
print_tsmux(TSMUX_ERR, "otf_job_queued: %d, set_hex_info: %d\n",
ctx->otf_job_queued, ctx->set_hex_info);
for (i = 0; i < TSMUX_MAX_M2M_CMD_QUEUE_NUM; i++) {
buf = &ctx->m2m_cmd_queue.m2m_job[i].in_buf;
print_tsmux(TSMUX_ERR,
"m2m_inbuf_info[%d] fd: %d, buffer_size: %d, actual_size: %d\n",
i, buf->ion_buf_fd, buf->buffer_size, buf->actual_size);
buf = &ctx->m2m_cmd_queue.m2m_job[i].out_buf;
print_tsmux(TSMUX_ERR,
"m2m_outbuf_info[%d] fd: %d, buffer_size: %d, actual_size: %d, time_stamp: %lld\n",
i, buf->ion_buf_fd, buf->buffer_size, buf->actual_size, buf->time_stamp);
print_tsmux(TSMUX_ERR,
"m2m_job_done[%d]: %d\n", i, ctx->m2m_job_done[i]);
}
print_tsmux(TSMUX_ERR,
"rtp_ts_info: rtp 0x%x, overr %d, pat_cc 0x%x, pmt_cc 0x%x, v_cc 0x%x, a_cc 0x%x\n",
ctx->rtp_ts_info.rtp_seq_number, ctx->rtp_ts_info.rtp_seq_override,
ctx->rtp_ts_info.ts_pat_cc, ctx->rtp_ts_info.ts_pmt_cc,
ctx->rtp_ts_info.ts_video_cc, ctx->rtp_ts_info.ts_audio_cc);
print_tsmux(TSMUX_ERR, "audio_frame_cnt: %lld, video_frame_cnt: %lld\n",
ctx->audio_frame_count, ctx->video_frame_count);
}
void tsmux_sfr_dump(void)
{
struct tsmux_context *ctx = NULL;
struct tsmux_device *tsmux_dev = NULL;
int prev_tsmux_debug_level;
print_tsmux(TSMUX_ERR, "%s++\n", __func__);
if (g_tsmux_dev == NULL) {
print_tsmux(TSMUX_ERR, "g_tsmux_dev is null\n");
return;
}
ctx = g_tsmux_dev->ctx[g_tsmux_dev->ctx_cur];
if (ctx == NULL || ctx->tsmux_dev == NULL) {
print_tsmux(TSMUX_ERR, "tsmux ctx is null\n");
return;
}
tsmux_dev = ctx->tsmux_dev;
prev_tsmux_debug_level = g_tsmux_debug_level;
g_tsmux_debug_level |= TSMUX_SFR;
g_tsmux_debug_level |= TSMUX_DBG_SFR;
tsmux_print_tsmux_sfr(tsmux_dev);
tsmux_print_dbg_info_all(tsmux_dev);
tsmux_print_context_info(ctx);
tsmux_print_cmu_mfc_sfr(tsmux_dev);
g_tsmux_debug_level = prev_tsmux_debug_level;
print_tsmux(TSMUX_ERR, "%s--\n", __func__);
}
static int get_job_done_buf(struct tsmux_context *ctx)
{
struct tsmux_buffer_info *out_buf_info = NULL;
@ -1203,14 +1450,13 @@ void add_null_ts_packet(uint8_t *ptr, int out_buf_size, struct tsmux_ts_hdr *ts_
{
uint8_t payload_unit_start_indicator = 1;
/* Adaptation_field, payload */
uint8_t adapt_ctrl = 0x3;
uint8_t adapt_ctrl = 0x2;
/* When the adaptation_field_control value is 'b10' */
/* the value of the adaptation_field_length shall be 183 */
uint8_t adapt_field_length = 183 - (9 + 8);
uint8_t adapt_field_length = 183;
uint8_t last_ts_continuity_counter = 0;
uint32_t last_rtp_size = 0;
uint8_t *ts_data = 0;
int pes_packet_len = 0;
last_ts_continuity_counter = *(ptr + out_buf_size - (TS_PACKET_SIZE - 3));
last_ts_continuity_counter = last_ts_continuity_counter & 0xf;
@ -1237,26 +1483,6 @@ void add_null_ts_packet(uint8_t *ptr, int out_buf_size, struct tsmux_ts_hdr *ts_
/* stuffing bytes */
memset(ptr, 0xff, adapt_field_length);
ptr += adapt_field_length;
/* PES header */
*ptr++ = 0x0;
*ptr++ = 0x0;
*ptr++ = 0x1;
*ptr++ = 0xe0;
pes_packet_len = 3 + 8;
*ptr++ = pes_packet_len >> 8;
*ptr++ = pes_packet_len & 0xff;
*ptr++ = 0x80; /* markder bit b10, 5 flags */
*ptr++ = 0x0; /* 7 flags */
*ptr++ = 0x0; /* PES header data length */
/* filler data NAL unit 8 bytes */
*ptr++ = 0x0;
*ptr++ = 0x0;
*ptr++ = 0x0;
*ptr++ = 0x1;
*ptr++ = 0xc;
*ptr++ = 0xff;
*ptr++ = 0xff;
*ptr++ = 0x80;
print_tsmux(TSMUX_COMMON, "ts data %.2x %.2x %.2x %.2x %.2x %.2x %.2x %.2x\n",
ts_data[0], ts_data[1], ts_data[2], ts_data[3],
@ -1352,6 +1578,7 @@ static bool tsmux_ioctl_otf_dq_buf(struct tsmux_context *ctx)
ctx->otf_cmd_queue.out_buf[index].actual_size += TS_PACKET_SIZE;
#endif
ctx->video_frame_count++;
spin_unlock_irqrestore(&tsmux_dev->device_spinlock, flags);
} else {
print_tsmux(TSMUX_ERR, "time out: wait_time: %ld\n", wait_time);
@ -1402,12 +1629,18 @@ static bool tsmux_ioctl_otf_q_buf(struct tsmux_context *ctx)
return true;
}
static bool tsmux_ioctl_otf_map_buf(struct tsmux_context *ctx)
static int tsmux_ioctl_otf_map_buf(struct tsmux_context *ctx)
{
int i = 0;
int ret = 0;
unsigned long flags;
struct tsmux_buffer_info *out_buf_info = NULL;
struct tsmux_buffer *user_info = NULL;
struct tsmux_device *tsmux_dev = NULL;
struct dma_buf *temp_dmabuf;
struct dma_buf_attachment *temp_dmabuf_att;
dma_addr_t temp_dma_addr;
void *temp_vaddr;
if (ctx == NULL || ctx->tsmux_dev == NULL)
return -ENOMEM;
@ -1420,44 +1653,61 @@ static bool tsmux_ioctl_otf_map_buf(struct tsmux_context *ctx)
out_buf_info = &ctx->otf_outbuf_info[i];
user_info = &ctx->otf_cmd_queue.out_buf[i];
out_buf_info->dmabuf =
temp_dmabuf =
dma_buf_get(user_info->ion_buf_fd);
print_tsmux(TSMUX_OTF, "dma_buf_get(%d) ret dmabuf %pK\n",
user_info->ion_buf_fd, out_buf_info->dmabuf);
user_info->ion_buf_fd, temp_dmabuf);
if (IS_ERR(out_buf_info->dmabuf)) {
out_buf_info->dmabuf_att = ERR_PTR(-EINVAL);
if (IS_ERR(temp_dmabuf)) {
temp_dmabuf_att = ERR_PTR(-EINVAL);
print_tsmux(TSMUX_ERR, "otf dma_buf_get() error\n");
ret = -ENOMEM;
} else {
out_buf_info->dmabuf_att =
dma_buf_attach(out_buf_info->dmabuf, tsmux_dev->dev);
temp_dmabuf_att = dma_buf_attach(temp_dmabuf, tsmux_dev->dev);
print_tsmux(TSMUX_OTF, "dma_buf_attach() ret dmabuf_att %pK\n",
out_buf_info->dmabuf_att);
temp_dmabuf_att);
}
if (IS_ERR(out_buf_info->dmabuf_att)) {
out_buf_info->dma_addr = -EINVAL;
if (IS_ERR(temp_dmabuf_att)) {
temp_dma_addr = -EINVAL;
print_tsmux(TSMUX_ERR, "otf dma_buf_attach() error\n");
ret = -ENOMEM;
} else {
out_buf_info->dma_addr =
ion_iovmm_map(out_buf_info->dmabuf_att,
0, user_info->buffer_size,
DMA_TO_DEVICE, 0);
temp_dma_addr = ion_iovmm_map(
temp_dmabuf_att, 0, user_info->buffer_size, DMA_TO_DEVICE, 0);
print_tsmux(TSMUX_OTF, "ion_iovmm_map() ret dma_addr_t 0x%llx\n",
out_buf_info->dma_addr);
temp_dma_addr);
}
if (IS_ERR_VALUE(out_buf_info->dma_addr) || out_buf_info->dma_addr == 0) {
out_buf_info->vaddr = NULL;
if (IS_ERR_VALUE(temp_dma_addr) || temp_dma_addr == 0) {
temp_vaddr = NULL;
print_tsmux(TSMUX_ERR, "otf ion_iovmm_map() error\n");
ret = -ENOMEM;
} else {
out_buf_info->vaddr =
dma_buf_vmap(out_buf_info->dmabuf);
temp_vaddr = dma_buf_vmap(temp_dmabuf);
print_tsmux(TSMUX_OTF, "dma_buf_vmap(%pK) ret vaddr %pK\n",
out_buf_info->dmabuf, out_buf_info->vaddr);
temp_dmabuf, temp_vaddr);
}
if (temp_vaddr == NULL) {
print_tsmux(TSMUX_ERR, "otf dma_buf_vmap() error\n");
ret = -ENOMEM;
}
spin_lock_irqsave(&tsmux_dev->device_spinlock, flags);
out_buf_info->dmabuf = temp_dmabuf;
out_buf_info->dmabuf_att = temp_dmabuf_att;
out_buf_info->dma_addr = temp_dma_addr;
out_buf_info->vaddr = temp_vaddr;
out_buf_info->buf_state = BUF_FREE;
spin_unlock_irqrestore(&tsmux_dev->device_spinlock, flags);
}
return true;
spin_lock_irqsave(&tsmux_dev->device_spinlock, flags);
ctx->otf_buf_mapped = true;
spin_unlock_irqrestore(&tsmux_dev->device_spinlock, flags);
return ret;
}
int tsmux_ioctl_otf_unmap_buf(struct tsmux_context *ctx)
@ -1465,53 +1715,75 @@ int tsmux_ioctl_otf_unmap_buf(struct tsmux_context *ctx)
int i = 0;
struct tsmux_buffer_info *out_buf_info = NULL;
int ret = 0;
unsigned long flags;
bool otf_job_queued = false;
int64_t wait_us = 0;
struct dma_buf *temp_dmabuf;
struct dma_buf_attachment *temp_dmabuf_att;
dma_addr_t temp_dma_addr;
void *temp_vaddr;
print_tsmux(TSMUX_OTF, "%s++\n", __func__);
if (ctx == NULL || ctx->tsmux_dev == NULL)
return -ENOMEM;
do {
spin_lock_irqsave(&ctx->tsmux_dev->device_spinlock, flags);
otf_job_queued = ctx->otf_job_queued;
if (!otf_job_queued)
ctx->otf_buf_mapped = false;
spin_unlock_irqrestore(&ctx->tsmux_dev->device_spinlock, flags);
if (otf_job_queued) {
udelay(1000);
wait_us += 1000;
if (wait_us > 1000000) {
print_tsmux(TSMUX_ERR, "%s, unmap buf failed\n", __func__);
return -EBUSY;
}
}
} while (otf_job_queued);
/* free otf buffer */
print_tsmux(TSMUX_OTF, "unmap otf out_buf\n");
for (i = 0; i < TSMUX_OUT_BUF_CNT; i++) {
out_buf_info = &ctx->otf_outbuf_info[i];
spin_lock_irqsave(&ctx->tsmux_dev->device_spinlock, flags);
temp_dma_addr = out_buf_info->dma_addr;
temp_dmabuf_att = out_buf_info->dmabuf_att;
temp_dmabuf = out_buf_info->dmabuf;
temp_vaddr = out_buf_info->vaddr;
out_buf_info->dma_addr = 0;
out_buf_info->dmabuf_att = 0;
out_buf_info->dmabuf = 0;
out_buf_info->vaddr = 0;
spin_unlock_irqrestore(&ctx->tsmux_dev->device_spinlock, flags);
if (out_buf_info->vaddr) {
if (temp_vaddr) {
print_tsmux(TSMUX_OTF, "dma_buf_vunmap(%pK, %pK)\n",
out_buf_info->dmabuf,
out_buf_info->vaddr);
dma_buf_vunmap(out_buf_info->dmabuf,
out_buf_info->vaddr);
out_buf_info->vaddr = 0;
temp_dmabuf, temp_vaddr);
dma_buf_vunmap(temp_dmabuf, temp_vaddr);
}
if (!IS_ERR_VALUE(out_buf_info->dma_addr) && out_buf_info->dma_addr) {
print_tsmux(TSMUX_OTF, "ion_iovmm_unmmap(%pK, %pK)\n",
out_buf_info->dmabuf_att,
(void *)out_buf_info->dma_addr);
ion_iovmm_unmap(out_buf_info->dmabuf_att,
out_buf_info->dma_addr);
out_buf_info->dma_addr = 0;
if (!IS_ERR_VALUE(temp_dma_addr) && temp_dma_addr) {
print_tsmux(TSMUX_OTF, "ion_iovmm_unmmap(%pK, %llx)\n",
temp_dmabuf_att, temp_dma_addr);
ion_iovmm_unmap(temp_dmabuf_att, temp_dma_addr);
}
print_tsmux(TSMUX_OTF, "ion_iovmm_unmap() ok\n");
if (!IS_ERR_OR_NULL(out_buf_info->dmabuf_att)) {
if (!IS_ERR_OR_NULL(temp_dmabuf_att)) {
print_tsmux(TSMUX_OTF, "dma_buf_detach(%pK, %pK)\n",
out_buf_info->dmabuf,
out_buf_info->dmabuf_att);
dma_buf_detach(out_buf_info->dmabuf,
out_buf_info->dmabuf_att);
out_buf_info->dmabuf_att = 0;
temp_dmabuf, temp_dmabuf_att);
dma_buf_detach(temp_dmabuf, temp_dmabuf_att);
}
print_tsmux(TSMUX_OTF, "dma_buf_detach() ok\n");
if (!IS_ERR_OR_NULL(out_buf_info->dmabuf)) {
print_tsmux(TSMUX_OTF, "dma_buf_put(%pK)\n",
out_buf_info->dmabuf);
dma_buf_put(out_buf_info->dmabuf);
out_buf_info->dmabuf = 0;
if (!IS_ERR_OR_NULL(temp_dmabuf)) {
print_tsmux(TSMUX_OTF, "dma_buf_put(%pK)\n", temp_dmabuf);
dma_buf_put(temp_dmabuf);
}
print_tsmux(TSMUX_OTF, "dma_buf_put() ok\n");
@ -1534,6 +1806,10 @@ static long tsmux_ioctl(struct file *filp,
unsigned long flags;
struct tsmux_psi_info temp_psi_info;
struct tsmux_otf_config temp_otf_config;
struct tsmux_m2m_cmd_queue temp_m2m_cmd_queue;
struct tsmux_otf_cmd_queue temp_otf_cmd_queue;
int32_t temp_cur_buf_num;
struct tsmux_rtp_ts_info temp_rtp_ts_info;
print_tsmux(TSMUX_COMMON, "%s++\n", __func__);
@ -1566,13 +1842,18 @@ static long tsmux_ioctl(struct file *filp,
case TSMUX_IOCTL_M2M_MAP_BUF:
print_tsmux(TSMUX_M2M, "TSMUX_IOCTL_M2M_MAP_BUF\n");
if (copy_from_user(&ctx->m2m_cmd_queue,
if (copy_from_user(&temp_m2m_cmd_queue,
(struct tsmux_m2m_cmd_queue __user *)arg,
sizeof(struct tsmux_m2m_cmd_queue))) {
ret = -EFAULT;
break;
}
spin_lock_irqsave(&tsmux_dev->device_spinlock, flags);
memcpy(&ctx->m2m_cmd_queue, &temp_m2m_cmd_queue,
sizeof(struct tsmux_m2m_cmd_queue));
spin_unlock_irqrestore(&tsmux_dev->device_spinlock, flags);
for (i = 0; i < TSMUX_MAX_M2M_CMD_QUEUE_NUM; i++) {
buf_fd = ctx->m2m_cmd_queue.m2m_job[i].in_buf.ion_buf_fd;
buf_size = ctx->m2m_cmd_queue.m2m_job[i].in_buf.buffer_size;
@ -1625,13 +1906,18 @@ static long tsmux_ioctl(struct file *filp,
case TSMUX_IOCTL_M2M_RUN:
print_tsmux(TSMUX_M2M, "TSMUX_IOCTL_M2M_RUN\n");
if (copy_from_user(&ctx->m2m_cmd_queue,
if (copy_from_user(&temp_m2m_cmd_queue,
(struct tsmux_m2m_cmd_queue __user *)arg,
sizeof(struct tsmux_m2m_cmd_queue))) {
ret = -EFAULT;
break;
}
spin_lock_irqsave(&tsmux_dev->device_spinlock, flags);
memcpy(&ctx->m2m_cmd_queue, &temp_m2m_cmd_queue,
sizeof(struct tsmux_m2m_cmd_queue));
spin_unlock_irqrestore(&tsmux_dev->device_spinlock, flags);
ret = tsmux_ioctl_m2m_run(ctx);
if (copy_to_user((struct tsmux_m2m_cmd_queue __user *)arg,
@ -1644,18 +1930,19 @@ static long tsmux_ioctl(struct file *filp,
case TSMUX_IOCTL_OTF_MAP_BUF:
print_tsmux(TSMUX_OTF, "TSMUX_IOCTL_OTF_MAP_BUF\n");
if (copy_from_user(&ctx->otf_cmd_queue,
if (copy_from_user(&temp_otf_cmd_queue,
(struct tsmux_otf_cmd_queue __user *)arg,
sizeof(struct tsmux_otf_cmd_queue))) {
ret = -EFAULT;
break;
}
if (!tsmux_ioctl_otf_map_buf(ctx)) {
print_tsmux(TSMUX_ERR, "map fail for dst buf\n");
ret = -EFAULT;
break;
}
spin_lock_irqsave(&tsmux_dev->device_spinlock, flags);
memcpy(&ctx->otf_cmd_queue, &temp_otf_cmd_queue,
sizeof(struct tsmux_otf_cmd_queue));
spin_unlock_irqrestore(&tsmux_dev->device_spinlock, flags);
ret = tsmux_ioctl_otf_map_buf(ctx);
if (copy_to_user((struct tsmux_otf_cmd_queue __user *) arg,
&ctx->otf_cmd_queue, sizeof(struct tsmux_otf_cmd_queue))) {
@ -1688,13 +1975,17 @@ static long tsmux_ioctl(struct file *filp,
case TSMUX_IOCTL_OTF_Q_BUF:
print_tsmux(TSMUX_OTF, "TSMUX_IOCTL_OTF_Q_BUF\n");
if (copy_from_user(&ctx->otf_cmd_queue.cur_buf_num,
if (copy_from_user(&temp_cur_buf_num,
(int32_t *)arg,
sizeof(int32_t))) {
ret = -EFAULT;
break;
}
spin_lock_irqsave(&tsmux_dev->device_spinlock, flags);
ctx->otf_cmd_queue.cur_buf_num = temp_cur_buf_num;
spin_unlock_irqrestore(&tsmux_dev->device_spinlock, flags);
if (!tsmux_ioctl_otf_q_buf(ctx))
ret = -EFAULT;
break;
@ -1715,12 +2006,16 @@ static long tsmux_ioctl(struct file *filp,
break;
case TSMUX_IOCTL_SET_RTP_TS_INFO:
if (copy_from_user(&ctx->rtp_ts_info,
if (copy_from_user(&temp_rtp_ts_info,
(struct tsmux_rtp_ts_info __user *)arg,
sizeof(struct tsmux_rtp_ts_info))) {
ret = -EFAULT;
break;
}
spin_lock_irqsave(&tsmux_dev->device_spinlock, flags);
memcpy(&ctx->rtp_ts_info, &temp_rtp_ts_info, sizeof(struct tsmux_rtp_ts_info));
spin_unlock_irqrestore(&tsmux_dev->device_spinlock, flags);
print_tsmux(TSMUX_COMMON, "set, rtp 0x%x, overr %d, pat_cc 0x%x, pmt_cc 0x%x, v_cc 0x%x, a_cc 0x%x\n",
ctx->rtp_ts_info.rtp_seq_number, ctx->rtp_ts_info.rtp_seq_override,
ctx->rtp_ts_info.ts_pat_cc, ctx->rtp_ts_info.ts_pmt_cc,
@ -1757,11 +2052,40 @@ static const struct file_operations tsmux_fops = {
.compat_ioctl = tsmux_ioctl,
};
#ifdef CONFIG_EXYNOS_ITMON
static int tsmux_itmon_notifier(struct notifier_block *nb, unsigned long action, void *nb_data)
{
struct tsmux_device *tsmux_dev;
struct itmon_notifier *itmon_info = nb_data;
int is_port = 0, is_master = 0, is_dest = 0;
tsmux_dev = container_of(nb, struct tsmux_device, itmon_nb);
if (IS_ERR_OR_NULL(itmon_info))
return NOTIFY_DONE;
if (itmon_info->port && strncmp("WFD", itmon_info->port, sizeof("WFD") - 1) == 0)
is_port = 1;
if (itmon_info->master && strncmp("WFD", itmon_info->master, sizeof("WFD") - 1) == 0)
is_master = 1;
if (itmon_info->dest && strncmp("WFD", itmon_info->dest, sizeof("WFD") - 1) == 0)
is_dest = 1;
if (is_port || is_master || is_dest) {
tsmux_sfr_dump();
return NOTIFY_BAD;
} else {
return NOTIFY_DONE;
}
}
#endif
static int tsmux_probe(struct platform_device *pdev)
{
int ret = 0;
struct tsmux_device *tsmux_dev;
struct resource *res;
int i;
print_tsmux(TSMUX_COMMON, "%s++\n", __func__);
@ -1795,6 +2119,8 @@ static int tsmux_probe(struct platform_device *pdev)
goto err_ioremap;
}
tsmux_ioremap_cmu_mfc_sfr(tsmux_dev);
pm_runtime_enable(&pdev->dev);
if (ret < 0) {
print_tsmux(TSMUX_ERR, "Failed to pm_runtime_enable (%d)\n", ret);
@ -1851,7 +2177,17 @@ static int tsmux_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, tsmux_dev);
tsmux_dev->hw_version = tsmux_get_hw_version(tsmux_dev);
#ifdef CONFIG_EXYNOS_ITMON
tsmux_dev->itmon_nb.notifier_call = tsmux_itmon_notifier;
itmon_notifier_chain_register(&tsmux_dev->itmon_nb);
#endif
setup_timer(&tsmux_dev->watchdog_timer, tsmux_watchdog, 0);
INIT_WORK(&tsmux_dev->watchdog_work, tsmux_watchdog_work_handler);
for (i = 0; i < TSMUX_MAX_CMD_QUEUE_NUM; i++) {
atomic_set(&tsmux_dev->watchdog_tick[i].watchdog_tick_running, 0);
atomic_set(&tsmux_dev->watchdog_tick[i].watchdog_tick_count, 0);
}
print_tsmux(TSMUX_COMMON, "%s--\n", __func__);
@ -1885,6 +2221,10 @@ static int tsmux_remove(struct platform_device *pdev)
ion_client_destroy(tsmux_dev->tsmux_ion_client);
free_irq(tsmux_dev->irq, tsmux_dev);
if (tsmux_dev->regs_base_cmu_mfc)
iounmap(tsmux_dev->regs_base_cmu_mfc);
iounmap(tsmux_dev->regs_base);
if (tsmux_dev) {

View file

@ -24,6 +24,9 @@
#include <linux/exynos_ion.h>
#include <linux/wait.h>
#include <media/exynos_tsmux.h>
#ifdef CONFIG_EXYNOS_ITMON
#include <soc/samsung/exynos-itmon.h>
#endif
#include "tsmux.h"
@ -45,12 +48,18 @@ struct tsmux_buffer_info {
enum otf_buf_state buf_state;
};
struct tsmux_watchdog_tick {
atomic_t watchdog_tick_running;
atomic_t watchdog_tick_count;
};
struct tsmux_device {
struct miscdevice misc_dev;
struct device *dev;
uint32_t hw_version;
void __iomem *regs_base;
void __iomem *regs_base_cmu_mfc;
struct resource *tsmux_mem;
struct clk *tsmux_clock;
int irq;
@ -60,6 +69,13 @@ struct tsmux_device {
int ctx_cnt;
int ctx_cur;
#ifdef CONFIG_EXYNOS_ITMON
struct notifier_block itmon_nb;
#endif
struct timer_list watchdog_timer;
struct work_struct watchdog_work;
struct tsmux_watchdog_tick watchdog_tick[TSMUX_MAX_CMD_QUEUE_NUM];
struct tsmux_context *ctx[TSMUX_MAX_CONTEXTS_NUM];
struct ion_client *tsmux_ion_client;
};
@ -82,6 +98,7 @@ struct tsmux_context {
bool otf_psi_enabled[TSMUX_OUT_BUF_CNT];
bool otf_job_queued;
bool otf_buf_mapped;
wait_queue_head_t m2m_wait_queue;
wait_queue_head_t otf_wait_queue;

View file

@ -28,6 +28,8 @@
#define TSMUX_PKT_CTRL_SW_RESET_MASK (0x80000000)
#define TSMUX_PKT_CTRL_PSI_EN_SHIFT (28)
#define TSMUX_PKT_CTRL_PSI_EN_MASK (0x10000000)
#define TSMUX_PKT_CTRL_TSP_CONTINUITY_CNT_INIT_SHIFT (27)
#define TSMUX_PKT_CTRL_TSP_CONTINUITY_CNT_INIT_MASK (0x8000000)
#define TSMUX_PKT_CTRL_RTP_SIZE_SHIFT (11)
#define TSMUX_PKT_CTRL_RTP_SIZE_MASK (0x07FFF800)
#define TSMUX_PKT_CTRL_RTP_SEQ_OVER_SHIFT (10)
@ -247,6 +249,53 @@
#define TSMUX_HEX_DBG_CTRL (TSMUX_HEX_BASE_ADDR + 0xC00)
#ifdef CONFIG_SOC_EXYNOS9810
#include "cmu_mfc/exynos9810_cmu_mfc.h"
#endif
#define MAX_OFFSET_CMU_MFC_SFR 0x8000
#define TSMUX_CMU_MFC_READL(offset) \
(readl(tsmux_dev->regs_base_cmu_mfc + (offset)))
void tsmux_ioremap_cmu_mfc_sfr(struct tsmux_device *tsmux_dev) {
if (tsmux_dev == NULL) {
print_tsmux(TSMUX_ERR, "tsmux_dev is NULL\n");
return;
}
tsmux_dev->regs_base_cmu_mfc = ioremap(
tsmux_cmu_mfc_sfr_list[0].base_pa, MAX_OFFSET_CMU_MFC_SFR);
if (tsmux_dev->regs_base_cmu_mfc == NULL)
print_tsmux(TSMUX_ERR, "ioremap(tsmux_cmu_mfc_sfr_list[0].base_pa) failed\n");
}
void tsmux_print_cmu_mfc_sfr(struct tsmux_device *tsmux_dev) {
int i;
u32 cmu_mfc_sfr;
if (tsmux_dev == NULL) {
print_tsmux(TSMUX_ERR, "tsmux_dev is NULL\n");
return;
}
if (tsmux_dev->regs_base_cmu_mfc == NULL) {
print_tsmux(TSMUX_ERR, "regs_base_cmu_mfc is null\n");
return;
}
print_tsmux(TSMUX_SFR, "tsmux_cmu_mfc_sfr_list_size %d\n", tsmux_cmu_mfc_sfr_list_size);
print_tsmux(TSMUX_SFR, "cmu_mfc base addr: offset: value, name\n");
for (i = 0; i < tsmux_cmu_mfc_sfr_list_size; i++) {
cmu_mfc_sfr = TSMUX_CMU_MFC_READL(tsmux_cmu_mfc_sfr_list[i].offset);
print_tsmux(TSMUX_SFR, "%.8x: %.8x: %.8x, %s\n",
(uint32_t)tsmux_cmu_mfc_sfr_list[i].base_pa,
tsmux_cmu_mfc_sfr_list[i].offset,
cmu_mfc_sfr,
tsmux_cmu_mfc_sfr_list[i].sfr_name);
}
}
uint32_t tsmux_get_hw_version(struct tsmux_device *tsmux_dev)
{
uint32_t version = 0;
@ -391,6 +440,7 @@ void tsmux_set_pkt_ctrl(struct tsmux_device *tsmux_dev,
struct tsmux_pkt_ctrl *pkt_ctrl)
{
u32 pkt_ctrl_reg;
int32_t tsp_continuity_cnt_init = 1;
print_tsmux(TSMUX_SFR, "%s++\n", __func__);
@ -407,6 +457,12 @@ void tsmux_set_pkt_ctrl(struct tsmux_device *tsmux_dev,
print_tsmux(TSMUX_SFR, "PKT_CTRL_PSI_EN %d\n", pkt_ctrl->psi_en);
print_tsmux(TSMUX_SFR, "pkt_ctrl_reg 0x%x\n", pkt_ctrl_reg);
pkt_ctrl_reg &= ~(TSMUX_PKT_CTRL_TSP_CONTINUITY_CNT_INIT_MASK);
pkt_ctrl_reg |= TSMUX_PKT_CTRL_TSP_CONTINUITY_CNT_INIT_MASK &
(tsp_continuity_cnt_init << TSMUX_PKT_CTRL_TSP_CONTINUITY_CNT_INIT_SHIFT);
print_tsmux(TSMUX_SFR, "PKT_CTRL_TSP_CONTINUITY_CNT_INIT %d\n", tsp_continuity_cnt_init);
print_tsmux(TSMUX_SFR, "pkt_ctrl_reg 0x%x\n", pkt_ctrl_reg);
pkt_ctrl_reg &= ~(TSMUX_PKT_CTRL_RTP_SIZE_MASK);
pkt_ctrl_reg |= TSMUX_PKT_CTRL_RTP_SIZE_MASK &
(pkt_ctrl->rtp_size << TSMUX_PKT_CTRL_RTP_SIZE_SHIFT);

View file

@ -16,6 +16,10 @@
#include "tsmux_dev.h"
void tsmux_ioremap_cmu_mfc_sfr(struct tsmux_device *tsmux_dev);
void tsmux_print_cmu_mfc_sfr(struct tsmux_device *tsmux_dev);
uint32_t tsmux_get_hw_version(struct tsmux_device *tsmux_dev);
void tsmux_print_dbg_info_all(struct tsmux_device *tsmux_dev);

View file

@ -12,6 +12,7 @@ config SEC_MODEM_SS310AP
select LINK_DEVICE_SHMEM
select CP_SECURE_BOOT
select CP_RAM_LOGGING
select KLAT
default y
config CP_ZEROCOPY
@ -119,5 +120,8 @@ config MODEM_IF_NET_GRO
---help---
This enables GRO(Generic Receive Offload) feature
config KLAT
bool "kernel CLAT"
default n
endmenu
endif

View file

@ -28,3 +28,5 @@ ifeq ($(CONFIG_ARGOS), y)
obj-y += modem_argos_notifier.o
endif
endif
obj-$(CONFIG_KLAT) += modem_klat.o

View file

@ -31,6 +31,7 @@
#include "modem_prj.h"
#include "modem_utils.h"
#include "modem_klat.h"
static u8 sipc5_build_config(struct io_device *iod, struct link_device *ld,
unsigned int count);
@ -371,6 +372,9 @@ static int rx_multi_pdp(struct sk_buff *skb)
skb_reset_network_header(skb);
skb_reset_mac_header(skb);
/* klat */
klat_rx(skb, skbpriv(skb)->sipc_ch - SIPC_CH_ID_PDP_0);
if (check_gro_support(skb)) {
ret = napi_gro_receive(napi_get_current(), skb);
if (ret == GRO_DROP) {

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,65 @@
/*
* Copyright (C) 2019 Samsung Electronics.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef __MODEM_KLAT_H__
#define __MODEM_KLAT_H__
#include <linux/types.h>
#include <linux/inet.h>
#include "modem_prj.h"
#ifdef CONFIG_KLAT
/* for supporting max 4 rmnets (rmnet0, rmnet1 ...) */
#define KLAT_MAX_NDEV 4
struct klat {
int use[KLAT_MAX_NDEV];
struct in_addr xlat_v4_addrs[KLAT_MAX_NDEV]; /* CLAT -> ipv4_local_subnet */
struct in6_addr xlat_addrs[KLAT_MAX_NDEV]; /* CLAT -> ipv6_local_subnet */
struct in6_addr plat_subnet; /* CLAT -> plat_subnet */
struct net_device *tun_device[KLAT_MAX_NDEV];
struct net_device *rmnet_device[KLAT_MAX_NDEV];
};
extern struct klat klat_obj;
int klat_rx(struct sk_buff *skb, int ndev_index);
int klat_tx(struct sk_buff *skb, int ndev_index);
ssize_t klat_plat_store(struct kobject *kobj, struct kobj_attribute *attr,
const char *buf, size_t count);
ssize_t klat_addrs_store(struct kobject *kobj, struct kobj_attribute *attr,
const char *buf, size_t count);
ssize_t klat_v4_addrs_store(struct kobject *kobj, struct kobj_attribute *attr,
const char *buf, size_t count);
#else
static inline int klat_rx(struct sk_buff *skb, int ndev_index) { return -1; }
static inline int klat_tx(struct sk_buff *skb, int ndev_index) { return -1; }
static inline
ssize_t klat_plat_store(struct kobject *kobj,
struct kobj_attribute *attr,
const char *buf, size_t count) { return 0; }
static inline
ssize_t klat_addrs_store(struct kobject *kobj, struct kobj_attribute *attr,
const char *buf, size_t count) { return 0; }
static inline
ssize_t klat_v4_addrs_store(struct kobject *kobj, struct kobj_attribute *attr,
const char *buf, size_t count) { return 0; }
#endif /* CONFIG_KLAT */
#endif /*__MODEM_KLAT_H__*/

View file

@ -1,5 +1,5 @@
#
# Copyright (C) 1999-2019, Broadcom.
# Copyright (C) 1999-2020, Broadcom.
#
# Unless you and Broadcom execute a separate written software license
# agreement governing use of this software, this software is licensed to you

View file

@ -1,5 +1,5 @@
#
# Copyright (C) 1999-2019, Broadcom.
# Copyright (C) 1999-2020, Broadcom.
#
# Unless you and Broadcom execute a separate written software license
# agreement governing use of this software, this software is licensed to you

View file

@ -1,5 +1,5 @@
#
# Copyright (C) 1999-2019, Broadcom.
# Copyright (C) 1999-2020, Broadcom.
#
# Unless you and Broadcom execute a separate written software license
# agreement governing use of this software, this software is licensed to you

View file

@ -2,7 +2,7 @@
* Misc utility routines for accessing chip-specific features
* of the SiliconBackplane-based Broadcom chips.
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -3,7 +3,7 @@
* Contents are wifi-specific, used by any kernel or app-level
* software that might want wifi things as it grows.
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -1,7 +1,7 @@
/*
* Bloom filter support
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -1,7 +1,7 @@
/*
* bcmevent read-only data shared by kernel or app layers
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -2,7 +2,7 @@
* BCMSDH interface glue
* implement bcmsdh API for SDIOH driver
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -1,7 +1,7 @@
/*
* SDIO access interface for drivers - linux specific (pci only)
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -1,7 +1,7 @@
/*
* BCMSDH Function Driver for the native SDIO/MMC driver in the Linux Kernel
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -1,7 +1,7 @@
/*
* BCMSDH Function Driver for the native SDIO/MMC driver in the Linux Kernel
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -1,7 +1,7 @@
/*
* Broadcom Secure Standard Library.
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -1,7 +1,7 @@
/*
* Driver O/S-independent utility routines
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -3,7 +3,7 @@
* Contents are wifi-specific, used by any kernel or app-level
* software that might want wifi things as it grows.
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -3,7 +3,7 @@
* This header file housing the define and function prototype use by
* both the wl driver, tools & Apps.
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -1,7 +1,7 @@
/*
* Indices for 802.11 a/b/g/n/ac 1-3 chain symmetric transmit rates
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -1,7 +1,7 @@
/*
* Common OS-independent driver header for rate management.
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -1,7 +1,7 @@
/*
* Driver O/S-independent utility routines
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -4,7 +4,7 @@
* Provides type definitions and function prototypes used to link the
* DHD OS, bus, and protocol modules.
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
@ -27,7 +27,7 @@
*
* <<Broadcom-WL-IPTag/Open:>>
*
* $Id: dhd.h 851174 2019-11-18 12:13:55Z $
* $Id: dhd.h 860004 2020-01-20 02:39:12Z $
*/
/****************
@ -1578,6 +1578,8 @@ extern void dhd_pm_wake_lock_timeout(dhd_pub_t *pub, int val);
extern void dhd_pm_wake_unlock(dhd_pub_t *pub);
extern void dhd_txfl_wake_lock_timeout(dhd_pub_t *pub, int val);
extern void dhd_txfl_wake_unlock(dhd_pub_t *pub);
extern void dhd_nan_wake_lock_timeout(dhd_pub_t *pub, int val);
extern void dhd_nan_wake_unlock(dhd_pub_t *pub);
extern int dhd_os_wake_lock_timeout(dhd_pub_t *pub);
extern int dhd_os_wake_lock_rx_timeout_enable(dhd_pub_t *pub, int val);
extern int dhd_os_wake_lock_ctrl_timeout_enable(dhd_pub_t *pub, int val);
@ -1651,6 +1653,16 @@ inline static void MUTEX_UNLOCK_SOFTAP_SET(dhd_pub_t * dhdp)
printf("call pm_wake unlock\n"); \
dhd_txfl_wake_unlock(pub); \
} while (0)
#define DHD_NAN_WAKE_LOCK_TIMEOUT(pub, val) \
do { \
printf("call pm_wake_timeout enable\n"); \
dhd_nan_wake_lock_timeout(pub, val); \
} while (0)
#define DHD_NAN_WAKE_UNLOCK(pub) \
do { \
printf("call pm_wake unlock\n"); \
dhd_nan_wake_unlock(pub); \
} while (0)
#define DHD_OS_WAKE_LOCK_TIMEOUT(pub) \
do { \
printf("call wake_lock_timeout: %s %d\n", \
@ -1708,6 +1720,8 @@ inline static void MUTEX_UNLOCK_SOFTAP_SET(dhd_pub_t * dhdp)
#define DHD_PM_WAKE_UNLOCK(pub) dhd_pm_wake_unlock(pub)
#define DHD_TXFL_WAKE_LOCK_TIMEOUT(pub, val) dhd_txfl_wake_lock_timeout(pub, val)
#define DHD_TXFL_WAKE_UNLOCK(pub) dhd_txfl_wake_unlock(pub)
#define DHD_NAN_WAKE_LOCK_TIMEOUT(pub, val) dhd_nan_wake_lock_timeout(pub, val)
#define DHD_NAN_WAKE_UNLOCK(pub) dhd_nan_wake_unlock(pub)
#define DHD_OS_WAKE_LOCK_TIMEOUT(pub) dhd_os_wake_lock_timeout(pub)
#define DHD_OS_WAKE_LOCK_RX_TIMEOUT_ENABLE(pub, val) \
dhd_os_wake_lock_rx_timeout_enable(pub, val)
@ -2073,11 +2087,13 @@ void dhd_schedule_cto_recovery(dhd_pub_t *dhdp);
#define DHD_IP4BCAST_DROP_FILTER_NUM 7
#define DHD_LLC_STP_DROP_FILTER_NUM 8
#define DHD_LLC_XID_DROP_FILTER_NUM 9
#define DHD_UDPNETBIOS_DROP_FILTER_NUM 10
#define DISCARD_IPV4_MCAST "102 1 6 IP4_H:16 0xf0 0xe0"
#define DISCARD_IPV6_MCAST "103 1 6 IP6_H:24 0xff 0xff"
#define DISCARD_IPV4_BCAST "107 1 6 IP4_H:16 0xffffffff 0xffffffff"
#define DISCARD_LLC_STP "108 1 6 ETH_H:14 0xFFFFFFFFFFFF 0xAAAA0300000C"
#define DISCARD_LLC_XID "109 1 6 ETH_H:14 0xFFFFFF 0x0001AF"
#define DISCARD_UDPNETBIOS "110 1 6 UDP_H:2 0xffff 0x0089"
extern int dhd_os_enable_packet_filter(dhd_pub_t *dhdp, int val);
extern void dhd_enable_packet_filter(int value, dhd_pub_t *dhd);
extern int dhd_packet_filter_add_remove(dhd_pub_t *dhdp, int add_remove, int num);

View file

@ -1,7 +1,7 @@
/*
* Bit packing and Base64 utils for EWP
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -1,7 +1,7 @@
/*
* Bit packing and Base64 utils for EWP
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -4,7 +4,7 @@
* Provides type definitions and function prototypes used to link the
* DHD OS, bus, and protocol modules.
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -1,7 +1,7 @@
/*
* DHD Protocol Module for CDC and BDC.
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -1,7 +1,7 @@
/*
* Linux cfg80211 driver - Dongle Host Driver (DHD) related
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -1,7 +1,7 @@
/*
* Linux cfg80211 driver - Dongle Host Driver (DHD) related
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -1,7 +1,7 @@
/*
* Broadcom Dongle Host Driver (DHD), common DHD core.
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -2,7 +2,7 @@
* Process CIS information from OTP for customer platform
* (Handle the MAC address and module information)
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -1,7 +1,7 @@
/*
* Platform Dependent file for Samsung Exynos
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -1,7 +1,7 @@
/*
* Customer code to add GPIO control during WLAN start/stop
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -1,7 +1,7 @@
/*
* Platform Dependent file for usage of Preallocted Memory
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -1,7 +1,7 @@
/*
* Platform Dependent file for Qualcomm MSM/APQ
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -1,7 +1,7 @@
/*
* Customer HW 4 dependant file
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -1,7 +1,7 @@
/*
* Debug/trace/assert driver definitions for Dongle Host Driver.
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -3,7 +3,7 @@
*
* <<Broadcom-WL-IPTag/Open:>>
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -3,7 +3,7 @@
*
* <<Broadcom-WL-IPTag/Open:>>
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -3,7 +3,7 @@
*
* <<Broadcom-WL-IPTag/Open:>>
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -3,7 +3,7 @@
*
* <<Broadcom-WL-IPTag/Open:>>
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -3,7 +3,7 @@
*
* <<Broadcom-WL-IPTag/Open:>>
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -1,7 +1,7 @@
/*
* Wifi dongle status Filter and Report
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -1,7 +1,7 @@
/*
* Wifi dongle status Filter and Report
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -4,7 +4,7 @@
* Flow rings are transmit traffic (=propagating towards antenna) related entities
*
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -6,7 +6,7 @@
* Provides type definitions and function prototypes used to create, delete and manage flow rings at
* high level.
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -1,7 +1,7 @@
/*
* IP Packet Parser Module.
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -3,7 +3,7 @@
*
* Provides type definitions and function prototypes used to parse ip packet.
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -2,7 +2,7 @@
* Broadcom Dongle Host Driver (DHD), Linux-specific network interface
* Basically selected code segments from usb-cdc.c and usb-rndis.c
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
@ -25,7 +25,7 @@
*
* <<Broadcom-WL-IPTag/Open:>>
*
* $Id: dhd_linux.c 854462 2019-12-09 02:29:44Z $
* $Id: dhd_linux.c 864043 2020-02-12 07:34:04Z $
*/
#include <typedefs.h>
@ -11134,7 +11134,9 @@ dhd_preinit_ioctls(dhd_pub_t *dhd)
dhd->pktfilter[DHD_LLC_STP_DROP_FILTER_NUM] = DISCARD_LLC_STP;
/* Immediately pkt filter TYPE 6 Dicard Cisco XID protocol */
dhd->pktfilter[DHD_LLC_XID_DROP_FILTER_NUM] = DISCARD_LLC_XID;
dhd->pktfilter_count = 10;
/* Immediately pkt filter TYPE 6 Dicard NETBIOS packet(port 137) */
dhd->pktfilter[DHD_UDPNETBIOS_DROP_FILTER_NUM] = DISCARD_UDPNETBIOS;
dhd->pktfilter_count = 11;
}
#ifdef GAN_LITE_NAT_KEEPALIVE_FILTER
@ -16308,6 +16310,18 @@ dhd_txfl_wake_lock_timeout(dhd_pub_t *pub, int val)
#endif /* CONFIG_HAS_WAKE_LOCK */
}
void
dhd_nan_wake_lock_timeout(dhd_pub_t *pub, int val)
{
#ifdef CONFIG_HAS_WAKELOCK
dhd_info_t *dhd = (dhd_info_t *)(pub->info);
if (dhd) {
wake_lock_timeout(&dhd->wl_nanwake, msecs_to_jiffies(val));
}
#endif /* CONFIG_HAS_WAKE_LOCK */
}
int net_os_wake_lock(struct net_device *dev)
{
dhd_info_t *dhd = DHD_DEV_INFO(dev);
@ -16390,6 +16404,20 @@ void dhd_txfl_wake_unlock(dhd_pub_t *pub)
#endif /* CONFIG_HAS_WAKELOCK */
}
void dhd_nan_wake_unlock(dhd_pub_t *pub)
{
#ifdef CONFIG_HAS_WAKELOCK
dhd_info_t *dhd = (dhd_info_t *)(pub->info);
if (dhd) {
/* if wl_nanwake is active, unlock it */
if (wake_lock_active(&dhd->wl_nanwake)) {
wake_unlock(&dhd->wl_nanwake);
}
}
#endif /* CONFIG_HAS_WAKELOCK */
}
int dhd_os_check_wakelock(dhd_pub_t *pub)
{
#if defined(CONFIG_HAS_WAKELOCK) || defined(BCMSDIO)
@ -16417,7 +16445,7 @@ dhd_os_check_wakelock_all(dhd_pub_t *pub)
{
#if defined(CONFIG_HAS_WAKELOCK) || defined(BCMSDIO)
#if defined(CONFIG_HAS_WAKELOCK)
int l1, l2, l3, l4, l7, l8, l9;
int l1, l2, l3, l4, l7, l8, l9, l10;
int l5 = 0, l6 = 0;
int c, lock_active;
#endif /* CONFIG_HAS_WAKELOCK */
@ -16447,13 +16475,14 @@ dhd_os_check_wakelock_all(dhd_pub_t *pub)
#endif /* DHD_USE_SCAN_WAKELOCK */
l8 = wake_lock_active(&dhd->wl_pmwake);
l9 = wake_lock_active(&dhd->wl_txflwake);
lock_active = (l1 || l2 || l3 || l4 || l5 || l6 || l7 || l8 || l9);
l10 = wake_lock_active(&dhd->wl_nanwake);
lock_active = (l1 || l2 || l3 || l4 || l5 || l6 || l7 || l8 || l9 || l10);
/* Indicate to the Host to avoid going to suspend if internal locks are up */
if (lock_active) {
DHD_ERROR(("%s wakelock c-%d wl-%d wd-%d rx-%d "
"ctl-%d intr-%d scan-%d evt-%d, pm-%d, txfl-%d\n",
__FUNCTION__, c, l1, l2, l3, l4, l5, l6, l7, l8, l9));
"ctl-%d intr-%d scan-%d evt-%d, pm-%d, txfl-%d nan-%d\n",
__FUNCTION__, c, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10));
return 1;
}
#elif defined(BCMSDIO)
@ -16671,6 +16700,7 @@ void dhd_os_wake_lock_init(struct dhd_info *dhd)
#ifdef DHD_USE_SCAN_WAKELOCK
wake_lock_init(&dhd->wl_scanwake, WAKE_LOCK_SUSPEND, "wlan_scan_wake");
#endif /* DHD_USE_SCAN_WAKELOCK */
wake_lock_init(&dhd->wl_nanwake, WAKE_LOCK_SUSPEND, "wlan_nan_wake");
#endif /* CONFIG_HAS_WAKELOCK */
#ifdef DHD_TRACE_WAKE_LOCK
dhd_wk_lock_trace_init(dhd);
@ -16696,6 +16726,7 @@ void dhd_os_wake_lock_destroy(struct dhd_info *dhd)
#ifdef DHD_USE_SCAN_WAKELOCK
wake_lock_destroy(&dhd->wl_scanwake);
#endif /* DHD_USE_SCAN_WAKELOCK */
wake_lock_destroy(&dhd->wl_nanwake);
#ifdef DHD_TRACE_WAKE_LOCK
dhd_wk_lock_trace_deinit(dhd);
#endif /* DHD_TRACE_WAKE_LOCK */
@ -16714,6 +16745,7 @@ bool dhd_os_check_if_up(dhd_pub_t *pub)
void dhd_set_version_info(dhd_pub_t *dhdp, char *fw)
{
int i;
uint chip;
i = snprintf(info_string, sizeof(info_string),
" Driver: %s\n Firmware: %s ", EPI_VERSION_STR, fw);
@ -16721,9 +16753,14 @@ void dhd_set_version_info(dhd_pub_t *dhdp, char *fw)
if (!dhdp)
return;
chip = dhd_bus_chip_id(dhdp);
if (chip == BCM4347_CHIP_ID) {
chip = BCM4361_CHIP_ID;
}
i = snprintf(&info_string[i], sizeof(info_string) - i,
"\n Chip: %x Rev %x Pkg %x", dhd_bus_chip_id(dhdp),
dhd_bus_chiprev_id(dhdp), dhd_bus_chippkg_id(dhdp));
"\n Chip: %x Rev %x Pkg %x", chip, dhd_bus_chiprev_id(dhdp),
dhd_bus_chippkg_id(dhdp));
}
#endif /* BCMSDIO || BCMPCIE */
int dhd_ioctl_entry_local(struct net_device *net, wl_ioctl_t *ioc, int cmd)

View file

@ -1,7 +1,7 @@
/*
* DHD Linux header file (dhd_linux exports for cfg80211 and other components)
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -2,7 +2,7 @@
* Broadcom Dongle Host Driver (DHD), Linux-specific network interface
* Basically selected code segments from usb-cdc.c and usb-rndis.c
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -2,7 +2,7 @@
* Broadcom Dongle Host Driver (DHD), Linux-specific network interface
* Basically selected code segments from usb-cdc.c and usb-rndis.c
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -1,7 +1,7 @@
/*
* Packet dump helper functions
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -1,7 +1,7 @@
/*
* Header file for the Packet dump helper functions
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -1,7 +1,7 @@
/*
* Linux platform device for DHD WLAN adapter
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -1,7 +1,7 @@
/*
* DHD Linux header file - contains private structure definition of the Linux specific layer
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
@ -24,7 +24,7 @@
*
* <<Broadcom-WL-IPTag/Open:>>
*
* $Id: dhd_linux_priv.h 842211 2019-09-20 10:52:20Z $
* $Id: dhd_linux_priv.h 860004 2020-01-20 02:39:12Z $
*/
#ifndef __DHD_LINUX_PRIV_H__
@ -123,6 +123,7 @@ typedef struct dhd_info {
#ifdef DHD_USE_SCAN_WAKELOCK
struct wake_lock wl_scanwake; /* Wifi scan wakelock */
#endif /* DHD_USE_SCAN_WAKELOCK */
struct wake_lock wl_nanwake; /* NAN wakelock */
#endif /* CONFIG_HAS_WAKELOCK */
/* net_device interface lock, prevent race conditions among net_dev interface

View file

@ -1,7 +1,7 @@
/*
* Expose some of the kernel scheduler routines
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -2,7 +2,7 @@
* Broadcom Dongle Host Driver (DHD), Generic work queue framework
* Generic interface to handle dhd deferred work events
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -2,7 +2,7 @@
* Broadcom Dongle Host Driver (DHD), Generic work queue framework
* Generic interface to handle dhd deferred work events
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -3,7 +3,7 @@
*
* <<Broadcom-WL-IPTag/Open:>>
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -3,7 +3,7 @@
*
* <<Broadcom-WL-IPTag/Open:>>
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -3,7 +3,7 @@
* Provides type definitions and function prototypes used to link the
* DHD OS, bus, and protocol modules.
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -1,7 +1,7 @@
/*
* DHD Bus Module for PCIE
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -1,7 +1,7 @@
/*
* Linux DHD Bus Module for PCIE
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -1,7 +1,7 @@
/*
* Linux DHD Bus Module for PCIE
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -1,7 +1,7 @@
/*
* DHD debugability packet logging support
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

View file

@ -1,7 +1,7 @@
/*
* DHD debugability packet logging header file
*
* Copyright (C) 1999-2019, Broadcom.
* Copyright (C) 1999-2020, Broadcom.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you

Some files were not shown because too many files have changed in this diff Show more