| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * OPAL IMC interface detection driver |
|---|
| 3 | 4 | * Supported on POWERNV platform |
|---|
| .. | .. |
|---|
| 5 | 6 | * Copyright (C) 2017 Madhavan Srinivasan, IBM Corporation. |
|---|
| 6 | 7 | * (C) 2017 Anju T Sudhakar, IBM Corporation. |
|---|
| 7 | 8 | * (C) 2017 Hemant K Shaw, IBM Corporation. |
|---|
| 8 | | - * |
|---|
| 9 | | - * This program is free software; you can redistribute it and/or |
|---|
| 10 | | - * modify it under the terms of the GNU General Public License |
|---|
| 11 | | - * as published by the Free Software Foundation; either version |
|---|
| 12 | | - * 2 of the License, or later version. |
|---|
| 13 | 9 | */ |
|---|
| 14 | 10 | #include <linux/kernel.h> |
|---|
| 15 | 11 | #include <linux/platform_device.h> |
|---|
| .. | .. |
|---|
| 39 | 35 | } |
|---|
| 40 | 36 | DEFINE_DEBUGFS_ATTRIBUTE(fops_imc_x64, imc_mem_get, imc_mem_set, "0x%016llx\n"); |
|---|
| 41 | 37 | |
|---|
| 42 | | -static struct dentry *imc_debugfs_create_x64(const char *name, umode_t mode, |
|---|
| 43 | | - struct dentry *parent, u64 *value) |
|---|
| 38 | +static void imc_debugfs_create_x64(const char *name, umode_t mode, |
|---|
| 39 | + struct dentry *parent, u64 *value) |
|---|
| 44 | 40 | { |
|---|
| 45 | | - return debugfs_create_file_unsafe(name, mode, parent, |
|---|
| 46 | | - value, &fops_imc_x64); |
|---|
| 41 | + debugfs_create_file_unsafe(name, mode, parent, value, &fops_imc_x64); |
|---|
| 47 | 42 | } |
|---|
| 48 | 43 | |
|---|
| 49 | 44 | /* |
|---|
| .. | .. |
|---|
| 63 | 58 | |
|---|
| 64 | 59 | imc_debugfs_parent = debugfs_create_dir("imc", powerpc_debugfs_root); |
|---|
| 65 | 60 | |
|---|
| 66 | | - if (!imc_debugfs_parent) |
|---|
| 67 | | - return; |
|---|
| 68 | | - |
|---|
| 69 | 61 | if (of_property_read_u32(node, "cb_offset", &cb_offset)) |
|---|
| 70 | 62 | cb_offset = IMC_CNTL_BLK_OFFSET; |
|---|
| 71 | 63 | |
|---|
| .. | .. |
|---|
| 73 | 65 | loc = (u64)(ptr->vbase) + cb_offset; |
|---|
| 74 | 66 | imc_mode_addr = (u64 *)(loc + IMC_CNTL_BLK_MODE_OFFSET); |
|---|
| 75 | 67 | sprintf(mode, "imc_mode_%d", (u32)(ptr->id)); |
|---|
| 76 | | - if (!imc_debugfs_create_x64(mode, 0600, imc_debugfs_parent, |
|---|
| 77 | | - imc_mode_addr)) |
|---|
| 78 | | - goto err; |
|---|
| 68 | + imc_debugfs_create_x64(mode, 0600, imc_debugfs_parent, |
|---|
| 69 | + imc_mode_addr); |
|---|
| 79 | 70 | |
|---|
| 80 | 71 | imc_cmd_addr = (u64 *)(loc + IMC_CNTL_BLK_CMD_OFFSET); |
|---|
| 81 | 72 | sprintf(cmd, "imc_cmd_%d", (u32)(ptr->id)); |
|---|
| 82 | | - if (!imc_debugfs_create_x64(cmd, 0600, imc_debugfs_parent, |
|---|
| 83 | | - imc_cmd_addr)) |
|---|
| 84 | | - goto err; |
|---|
| 73 | + imc_debugfs_create_x64(cmd, 0600, imc_debugfs_parent, |
|---|
| 74 | + imc_cmd_addr); |
|---|
| 85 | 75 | ptr++; |
|---|
| 86 | 76 | } |
|---|
| 87 | | - return; |
|---|
| 88 | | - |
|---|
| 89 | | -err: |
|---|
| 90 | | - debugfs_remove_recursive(imc_debugfs_parent); |
|---|
| 91 | 77 | } |
|---|
| 92 | 78 | |
|---|
| 93 | 79 | /* |
|---|
| .. | .. |
|---|
| 281 | 267 | case IMC_TYPE_THREAD: |
|---|
| 282 | 268 | domain = IMC_DOMAIN_THREAD; |
|---|
| 283 | 269 | break; |
|---|
| 270 | + case IMC_TYPE_TRACE: |
|---|
| 271 | + domain = IMC_DOMAIN_TRACE; |
|---|
| 272 | + break; |
|---|
| 284 | 273 | default: |
|---|
| 285 | 274 | pr_warn("IMC Unknown Device type \n"); |
|---|
| 286 | 275 | domain = -1; |
|---|