linux/drivers/memory/tegra/tegra210-emc-cc-r21021.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (c) 2014-2020, NVIDIA CORPORATION.  All rights reserved.
 */

#include <linux/kernel.h>
#include <linux/io.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/of.h>

#include <soc/tegra/mc.h>

#include "tegra210-emc.h"
#include "tegra210-mc.h"

/*
 * Enable flags for specifying verbosity.
 */
#define INFO
#define STEPS
#define SUB_STEPS
#define PRELOCK
#define PRELOCK_STEPS
#define ACTIVE_EN
#define PRAMP_UP
#define PRAMP_DN
#define EMA_WRITES
#define EMA_UPDATES
#define PER_TRAIN
#define CC_PRINT
#define CCFIFO
#define REGS
#define REG_LISTS

#define emc_dbg(emc, flags, ...)

#define DVFS_CLOCK_CHANGE_VERSION
#define EMC_PRELOCK_VERSION

enum {};

/*
 * PTFV defines - basically just indexes into the per table PTFV array.
 */
#define PTFV_DQSOSC_MOVAVG_C0D0U0_INDEX
#define PTFV_DQSOSC_MOVAVG_C0D0U1_INDEX
#define PTFV_DQSOSC_MOVAVG_C0D1U0_INDEX
#define PTFV_DQSOSC_MOVAVG_C0D1U1_INDEX
#define PTFV_DQSOSC_MOVAVG_C1D0U0_INDEX
#define PTFV_DQSOSC_MOVAVG_C1D0U1_INDEX
#define PTFV_DQSOSC_MOVAVG_C1D1U0_INDEX
#define PTFV_DQSOSC_MOVAVG_C1D1U1_INDEX
#define PTFV_DVFS_SAMPLES_INDEX
#define PTFV_MOVAVG_WEIGHT_INDEX
#define PTFV_CONFIG_CTRL_INDEX

#define PTFV_CONFIG_CTRL_USE_PREVIOUS_EMA

/*
 * Do arithmetic in fixed point.
 */
#define MOVAVG_PRECISION_FACTOR

/*
 * The division portion of the average operation.
 */
#define __AVERAGE_PTFV(dev)

/*
 * Convert val to fixed point and add it to the temporary average.
 */
#define __INCREMENT_PTFV(dev, val)

/*
 * Convert a moving average back to integral form and return the value.
 */
#define __MOVAVG_AC(timing, dev)

/* Weighted update. */
#define __WEIGHTED_UPDATE_PTFV(dev, nval)

/* Access a particular average. */
#define __MOVAVG(timing, dev)

static bool tegra210_emc_compare_update_delay(struct tegra210_emc_timing *timing,
					      u32 measured, u32 idx)
{}

static void tegra210_emc_get_clktree_delay(struct tegra210_emc *emc,
					   u32 delay[DRAM_CLKTREE_NUM])
{}

static bool periodic_compensation_handler(struct tegra210_emc *emc, u32 type,
					  struct tegra210_emc_timing *last,
					  struct tegra210_emc_timing *next)
{}

static u32 tegra210_emc_r21021_periodic_compensation(struct tegra210_emc *emc)
{}

/*
 * Do the clock change sequence.
 */
static void tegra210_emc_r21021_set_clock(struct tegra210_emc *emc, u32 clksrc)
{}

const struct tegra210_emc_sequence tegra210_emc_r21021 =;