Received: by 10.223.164.202 with SMTP id h10csp297022wrb; Wed, 8 Nov 2017 16:53:01 -0800 (PST) X-Google-Smtp-Source: ABhQp+QuBoe5F6En6OC2ZDn2QQnntK+cx1uBwISF9NUZrfVybvObSNFLJDVZlTzG4tD8JphAYODN X-Received: by 10.99.185.18 with SMTP id z18mr2226003pge.212.1510188780913; Wed, 08 Nov 2017 16:53:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510188780; cv=none; d=google.com; s=arc-20160816; b=RYkUIwPN7buTVpkpFyHvuGFGG8yjVHLoEnn9sbcZfArOKz2Av8U/nkEkXy2yL0TM1F rE5ou6dWFRaT5VgyjL1gKmAxYCmVwWzCv67FuS+mYOCyxhaybCgdcy0uheh/JBqCh64+ vQP1uIrYHXKEYw1Kxy7031qVkoxpGBaVb0o2WkZevwK0ahZmZO+yxvhlkLOG43f3N/bN h61GHf3SfU3mzGQa5RyPqdus/OA+41cy1wJ0JvgBdBK5PHlvkOaCK48VTUDV+Kmb2rU0 2Tojs3y1Rj8WtGn6xQTZ4OC/uzYkrKcTzY0ntOF6DZhHvjQZNXihEUNxfnmF7tbuCim2 moyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:arc-authentication-results; bh=H5nBmSZoi7F4q+THjhmGDsxL1SaBD1ybpCKXd/Hxa5g=; b=Wx2NjjBKmGcznO/KhQZzsk69IEVU7/7cAkiO0tWUWEDgVMSiznsKXz/enf8TWQj877 qydWyih17RCNmPeqaaTMMuFn61l1s1ySN56DGXOY889R35ktrsoYfMjnkjKpG7c1uaSc 7SE1YWWZjJDCM2EJvK2Wg00MsNIiCSZ8t9O+Mv35pX6whX2tNDR94QAik1nZ6Gc0ZuGK xKx7T2CQJg/RHl/s2umJ4WvkLsA2N4zv3pCOD/7sgQnxONZTpTyGnDY01JeR4H39EQif E0/vqSR3zSlvqKMI3N9EIZ1yzizt6onuEX8QFPamdtFd6IyILZDSALIpVpR2eRpdSkuK /k7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@CAVIUMNETWORKS.onmicrosoft.com header.s=selector1-cavium-com header.b=SX3H8Igc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 62si4539663ply.467.2017.11.08.16.52.48; Wed, 08 Nov 2017 16:53:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@CAVIUMNETWORKS.onmicrosoft.com header.s=selector1-cavium-com header.b=SX3H8Igc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753360AbdKIAv7 (ORCPT + 84 others); Wed, 8 Nov 2017 19:51:59 -0500 Received: from mail-by2nam01on0050.outbound.protection.outlook.com ([104.47.34.50]:11264 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753259AbdKIAvy (ORCPT ); Wed, 8 Nov 2017 19:51:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=H5nBmSZoi7F4q+THjhmGDsxL1SaBD1ybpCKXd/Hxa5g=; b=SX3H8Igch3hPHPC8TdgVtWRy3YhnV8KDqw9lAWAcqxH+knNTeIYj27yaLk3ELFoQZIlyRPVb/H8QlK2EywDng0NSHSeCx/QRalC3qiEjhqpaT2s1g7YyliwTclMEnMjRrAhLVZSp3EGB5Q2OPZg9rWbUL8gqI9Ia8SD007RRe1I= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=David.Daney@cavium.com; Received: from ddl.caveonetworks.com (50.233.148.156) by CY4PR07MB3495.namprd07.prod.outlook.com (10.171.252.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.218.12; Thu, 9 Nov 2017 00:51:45 +0000 From: David Daney To: linux-mips@linux-mips.org, ralf@linux-mips.org, James Hogan , netdev@vger.kernel.org, "David S. Miller" , Rob Herring , Mark Rutland , devel@driverdev.osuosl.org, Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, "Steven J. Hill" , devicetree@vger.kernel.org, Andrew Lunn , Florian Fainelli , Carlos Munoz , "Steven J . Hill" , David Daney Subject: [PATCH v2 2/8] MIPS: Octeon: Enable LMTDMA/LMTST operations. Date: Wed, 8 Nov 2017 16:51:20 -0800 Message-Id: <20171109005126.21341-3-david.daney@cavium.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171109005126.21341-1-david.daney@cavium.com> References: <20171109005126.21341-1-david.daney@cavium.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [50.233.148.156] X-ClientProxiedBy: SN4PR0701CA0022.namprd07.prod.outlook.com (10.161.192.160) To CY4PR07MB3495.namprd07.prod.outlook.com (10.171.252.152) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2b355bc3-4471-4bb8-cace-08d5270c10ce X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603199);SRVR:CY4PR07MB3495; X-Microsoft-Exchange-Diagnostics: 1;CY4PR07MB3495;3:pJ0wCHH5l+ihh3gOc9NITI2wgQEn6dcVDOQmXP68gU7LcIEGoH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BlvQAhSYJgcWcVtKBZZJZNBiW38dcJm/jQAiFvg7rvGMj2XfEcjBXfHE1vQX09CuxRdwHP9dj++lISKbWQT+H6tJvSFNSfBboFux1lpUgiY2FKZZqTTwgF5X+hd8sJqDp8iDOuV75wa6Go09SK47oRT4qySbZ9Sv2uhrxa33OtTWjzUDh3Q2+xRgzA5s6ih0zk7drCx4EdltqoUSQ8dG2mu3EcUV5VlFPmfo3AS0VloGq3ID07ru9ykorLM4blBFAZVij3tiFg/ipO7GdfmzBBUu/IpPn7sdjOx2;4:H3w/p5s5Lxfmhwe5Uw4nH2OlR4u3HZw+sTqvSaPG+IzTxGcAoQwwSAORTOQxCdX7X69vX0+/tDcyaNE9VhYEAaNNHQ2guc8byKXXPqA8HElR8vj3Pi+Q0/vwteer7/LItj5krZkgVZBRkadYThLJn7wXR7dRkoZv+98T2jrjG41p9HasW6CNb2+bSnDHwUVuM4oczxufogAlZkP9B+upgBzEi4dg8ZfLqVw6QbAaaSyjCrtErI8L6hCs78GX2UXX5mYBHQ1r6sbk0w5p4QDTcw== X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(10201501046)(3231021)(93006095)(93001095)(3002001)(100000703101)(100105400095)(6041248)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123558100)(20161123562025)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY4PR07MB3495;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY4PR07MB3495; X-Forefront-PRVS: 0486A0CB86 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6009001)(346002)(376002)(189002)(199003)(53936002)(6486002)(50466002)(6506006)(110136005)(2950100002)(36756003)(33646002)(7736002)(54906003)(50986999)(106356001)(189998001)(66066001)(2906002)(25786009)(305945005)(7416002)(97736004)(76176999)(1076002)(48376002)(47776003)(105586002)(16526018)(3846002)(81156014)(6512007)(81166006)(6116002)(8936002)(5003940100001)(101416001)(8676002)(478600001)(53416004)(316002)(6666003)(50226002)(72206003)(4326008)(69596002)(5660300001)(68736007)(16586007)(39060400002)(86362001)(107886003)(575784001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR07MB3495;H:ddl.caveonetworks.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY4PR07MB3495;23:qbYZ4tFvelCoAOKFhtvp+7AF/6m2IvyJKMjvFahT/?= =?us-ascii?Q?IHYcLF4kbZrBFenl3CoCY2zi5dNuG3Rd/QrS9Ih4FsUGRpK6pC5nHsC9oTH8?= =?us-ascii?Q?Cb6uFbvIIySOOitJpK/zAe7ZcXNHw0JeToJHCb4mLCFcP8ckIBycfq4iUURb?= =?us-ascii?Q?XB88zKhxM76GpdjzS9uDc4V5I0dPz9FqZ8IQqjoFvfQhCCZNjWP7wvhS2OV5?= =?us-ascii?Q?NTQgNIR8trID1tRceuvtzJmp+4bNY8NZHEnCL9yUo+2QQq9tJ06HfPkM2xkV?= =?us-ascii?Q?nbJVa82hgBETX0Nr3LMyJXjZE1J6RdFhiuSHtj3bGgK/Pi1Zn8JzO9SNlBHG?= =?us-ascii?Q?YH3bw8LBx5zPXEouoyVIQluus7e9RnHYS2oIQl/R1WBWJ/6LOug865Y6eozE?= =?us-ascii?Q?XKlpXwg+0Pvfvz/csp1uUwEvHBY4WXY4r1aHFn8OVxnrVf/yudldDMQmdFKz?= =?us-ascii?Q?NeA7cST+0GHcERD+j2RQfM16ObVt5tE0hTqST8VziXMVjbpFmf5V1UKp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wL1LzGZ4JN++ps5jWfn2K6xtuQp29lVoFzZjy/w6xuBIk9KUKKdZ5W6JFgfh8UVb69FSvqQIK5BjbMWaSBfCsL6FBVU+QmofO8u+/LGPHM60B0QlxQf3EIjFHwGrKe9LD0zyVOsjNFtatF+8+Wn06FbmO1RIzzxlN1rJR6a3AcZz+VNMyAiEgwang2Fh/SKbR376xyosGN/YklQvz7PjXJwn7G3hX+aAlJQtZlv6N9y3KRkfMv+L074aMHlgIjV2F/ZpVKWjI=;5:XN/SQOhxQ879VQtmgMVjOeM3MSCmhO4qB2LTZG/8Sdo4nlK8l4cnzpkq3jZKYYJKkiV6spk0dHm22g7qSf9P04q9QNnWz5kuDiKj1DtsxCA2bolwiV4vdIijJynXFIre0pxKnKEwDkTDBtN/OCxfnj/+leKISvKy0XCdW762kM0=;24:7d0GJNafs2OldaFb6tIz92yQsU9Oh0IKocFKI2kPwnKPbqr1ha5h9TPrw6Am5X8B6O51i9Xjv0b3KN5K4Mp4UznueXjvAZCPWBFPi8t4M4g=;7:R6CS36Jf/M+NB6l3K00TqTYYa9JQHshO3E99gXNf7c5SFUYy08wcx3oHKLuqT7IBXsrHT/ORgDsLRI3jkqCoXGSsxF2MDa9Sl5MATDrw9ZbZrmVDytWQVzE24ct5jnAfIqySfkKwfIE1UMhUWPSnDsfEfUkpnD/y+4EyNntaBNoLgx//0uS8kLSiRSYkRIWubBxDVzPyEk8if60jHtHkbOE9Y8YZLKXlP0H5QK3nJljyMhe09DjAvRUaC+GkLrRf SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Nov 2017 00:51:45.5061 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2b355bc3-4471-4bb8-cace-08d5270c10ce X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3495 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Carlos Munoz LMTDMA/LMTST operations move data between cores and I/O devices: * LMTST operations can send an address and a variable length (up to 128 bytes) of data to an I/O device. * LMTDMA operations can send an address and a variable length (up to 128) of data to the I/O device and then return a variable length (up to 128 bytes) response from the IOI device. Signed-off-by: Carlos Munoz Signed-off-by: Steven J. Hill Signed-off-by: David Daney --- arch/mips/cavium-octeon/setup.c | 6 ++++++ arch/mips/include/asm/octeon/octeon.h | 12 ++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/arch/mips/cavium-octeon/setup.c b/arch/mips/cavium-octeon/setup.c index a8034d0dcade..99e6a68bc652 100644 --- a/arch/mips/cavium-octeon/setup.c +++ b/arch/mips/cavium-octeon/setup.c @@ -609,6 +609,12 @@ void octeon_user_io_init(void) #else cvmmemctl.s.cvmsegenak = 0; #endif + if (OCTEON_IS_OCTEON3()) { + /* Enable LMTDMA */ + cvmmemctl.s.lmtena = 1; + /* Scratch line to use for LMT operation */ + cvmmemctl.s.lmtline = 2; + } /* R/W If set, CVMSEG is available for loads/stores in * supervisor mode. */ cvmmemctl.s.cvmsegenas = 0; diff --git a/arch/mips/include/asm/octeon/octeon.h b/arch/mips/include/asm/octeon/octeon.h index c99c4b6a79f4..92a17d67c1fa 100644 --- a/arch/mips/include/asm/octeon/octeon.h +++ b/arch/mips/include/asm/octeon/octeon.h @@ -179,7 +179,15 @@ union octeon_cvmemctl { /* RO 1 = BIST fail, 0 = BIST pass */ __BITFIELD_FIELD(uint64_t wbfbist:1, /* Reserved */ - __BITFIELD_FIELD(uint64_t reserved:17, + __BITFIELD_FIELD(uint64_t reserved_52_57:6, + /* When set, LMTDMA/LMTST operations are permitted */ + __BITFIELD_FIELD(uint64_t lmtena:1, + /* Selects the CVMSEG LM cacheline used by LMTDMA + * LMTST and wide atomic store operations. + */ + __BITFIELD_FIELD(uint64_t lmtline:6, + /* Reserved */ + __BITFIELD_FIELD(uint64_t reserved_41_44:4, /* OCTEON II - TLB replacement policy: 0 = bitmask LRU; 1 = NLU. * This field selects between the TLB replacement policies: * bitmask LRU or NLU. Bitmask LRU maintains a mask of @@ -275,7 +283,7 @@ union octeon_cvmemctl { /* R/W Size of local memory in cache blocks, 54 (6912 * bytes) is max legal value. */ __BITFIELD_FIELD(uint64_t lmemsz:6, - ;))))))))))))))))))))))))))))))))) + ;)))))))))))))))))))))))))))))))))))) } s; }; -- 2.13.6 From 1583614133647616553@xxx Thu Nov 09 18:28:46 +0000 2017 X-GM-THRID: 1583548959067315589 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread