reg.h (1c358fedecd1f0121ba21d3b2a2144145ae24326) reg.h (97b05cfb68aef12c649c5f8b6e787d143c9e5c8f)
1/* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */
2/* Copyright (c) 2015-2018 Mellanox Technologies. All rights reserved */
3
4#ifndef _MLXSW_REG_H
5#define _MLXSW_REG_H
6
7#include <linux/kernel.h>
8#include <linux/string.h>

--- 10333 unchanged lines hidden (view full) ---

10342 */
10343#define MLXSW_REG_MTUTC_ID 0x9055
10344#define MLXSW_REG_MTUTC_LEN 0x1C
10345
10346MLXSW_REG_DEFINE(mtutc, MLXSW_REG_MTUTC_ID, MLXSW_REG_MTUTC_LEN);
10347
10348enum mlxsw_reg_mtutc_operation {
10349 MLXSW_REG_MTUTC_OPERATION_SET_TIME_AT_NEXT_SEC = 0,
1/* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */
2/* Copyright (c) 2015-2018 Mellanox Technologies. All rights reserved */
3
4#ifndef _MLXSW_REG_H
5#define _MLXSW_REG_H
6
7#include <linux/kernel.h>
8#include <linux/string.h>

--- 10333 unchanged lines hidden (view full) ---

10342 */
10343#define MLXSW_REG_MTUTC_ID 0x9055
10344#define MLXSW_REG_MTUTC_LEN 0x1C
10345
10346MLXSW_REG_DEFINE(mtutc, MLXSW_REG_MTUTC_ID, MLXSW_REG_MTUTC_LEN);
10347
10348enum mlxsw_reg_mtutc_operation {
10349 MLXSW_REG_MTUTC_OPERATION_SET_TIME_AT_NEXT_SEC = 0,
10350 MLXSW_REG_MTUTC_OPERATION_SET_TIME_IMMEDIATE = 1,
10351 MLXSW_REG_MTUTC_OPERATION_ADJUST_TIME = 2,
10350 MLXSW_REG_MTUTC_OPERATION_ADJUST_FREQ = 3,
10351};
10352
10353/* reg_mtutc_operation
10354 * Operation.
10355 * Access: OP
10356 */
10357MLXSW_ITEM32(reg, mtutc, operation, 0x00, 0, 4);
10358
10359/* reg_mtutc_freq_adjustment
10360 * Frequency adjustment: Every PPS the HW frequency will be
10361 * adjusted by this value. Units of HW clock, where HW counts
10352 MLXSW_REG_MTUTC_OPERATION_ADJUST_FREQ = 3,
10353};
10354
10355/* reg_mtutc_operation
10356 * Operation.
10357 * Access: OP
10358 */
10359MLXSW_ITEM32(reg, mtutc, operation, 0x00, 0, 4);
10360
10361/* reg_mtutc_freq_adjustment
10362 * Frequency adjustment: Every PPS the HW frequency will be
10363 * adjusted by this value. Units of HW clock, where HW counts
10362 * 10^9 HW clocks for 1 HW second.
10364 * 10^9 HW clocks for 1 HW second. Range is from -50,000,000 to +50,000,000.
10365 * In Spectrum-2, the field is reversed, positive values mean to decrease the
10366 * frequency.
10363 * Access: RW
10364 */
10365MLXSW_ITEM32(reg, mtutc, freq_adjustment, 0x04, 0, 32);
10366
10367 * Access: RW
10368 */
10369MLXSW_ITEM32(reg, mtutc, freq_adjustment, 0x04, 0, 32);
10370
10371#define MLXSW_REG_MTUTC_MAX_FREQ_ADJ (50 * 1000 * 1000)
10372
10367/* reg_mtutc_utc_sec
10368 * UTC seconds.
10369 * Access: WO
10370 */
10371MLXSW_ITEM32(reg, mtutc, utc_sec, 0x10, 0, 32);
10372
10373/* reg_mtutc_utc_sec
10374 * UTC seconds.
10375 * Access: WO
10376 */
10377MLXSW_ITEM32(reg, mtutc, utc_sec, 0x10, 0, 32);
10378
10379/* reg_mtutc_utc_nsec
10380 * UTC nSecs.
10381 * Range 0..(10^9-1)
10382 * Updated when operation is SET_TIME_IMMEDIATE.
10383 * Reserved on Spectrum-1.
10384 * Access: WO
10385 */
10386MLXSW_ITEM32(reg, mtutc, utc_nsec, 0x14, 0, 30);
10387
10388/* reg_mtutc_time_adjustment
10389 * Time adjustment.
10390 * Units of nSec.
10391 * Range is from -32768 to +32767.
10392 * Updated when operation is ADJUST_TIME.
10393 * Reserved on Spectrum-1.
10394 * Access: WO
10395 */
10396MLXSW_ITEM32(reg, mtutc, time_adjustment, 0x18, 0, 32);
10397
10373static inline void
10374mlxsw_reg_mtutc_pack(char *payload, enum mlxsw_reg_mtutc_operation oper,
10398static inline void
10399mlxsw_reg_mtutc_pack(char *payload, enum mlxsw_reg_mtutc_operation oper,
10375 u32 freq_adj, u32 utc_sec)
10400 u32 freq_adj, u32 utc_sec, u32 utc_nsec, u32 time_adj)
10376{
10377 MLXSW_REG_ZERO(mtutc, payload);
10378 mlxsw_reg_mtutc_operation_set(payload, oper);
10379 mlxsw_reg_mtutc_freq_adjustment_set(payload, freq_adj);
10380 mlxsw_reg_mtutc_utc_sec_set(payload, utc_sec);
10401{
10402 MLXSW_REG_ZERO(mtutc, payload);
10403 mlxsw_reg_mtutc_operation_set(payload, oper);
10404 mlxsw_reg_mtutc_freq_adjustment_set(payload, freq_adj);
10405 mlxsw_reg_mtutc_utc_sec_set(payload, utc_sec);
10406 mlxsw_reg_mtutc_utc_nsec_set(payload, utc_nsec);
10407 mlxsw_reg_mtutc_time_adjustment_set(payload, time_adj);
10381}
10382
10383/* MCQI - Management Component Query Information
10384 * ---------------------------------------------
10385 * This register allows querying information about firmware components.
10386 */
10387#define MLXSW_REG_MCQI_ID 0x9061
10388#define MLXSW_REG_MCQI_BASE_LEN 0x18

--- 2461 unchanged lines hidden ---
10408}
10409
10410/* MCQI - Management Component Query Information
10411 * ---------------------------------------------
10412 * This register allows querying information about firmware components.
10413 */
10414#define MLXSW_REG_MCQI_ID 0x9061
10415#define MLXSW_REG_MCQI_BASE_LEN 0x18

--- 2461 unchanged lines hidden ---