(struct socfpga_sdr_reg_file *)SDR_PHYGRP_REGFILEGRP_ADDRESS;
static struct socfpga_sdr_scc_mgr *sdr_scc_mgr =
- (struct socfpga_sdr_scc_mgr *)(BASE_SCC_MGR + 0x0E00);
+ (struct socfpga_sdr_scc_mgr *)(SDR_PHYGRP_SCCGRP_ADDRESS | 0xe00);
static struct socfpga_phy_mgr_cmd *phy_mgr_cmd =
(struct socfpga_phy_mgr_cmd *)(BASE_PHY_MGR);
scc_mgr_set_dqs_en_phase(read_group, phase);
if (update_scan_chains) {
- addr = sdr_get_addr(&sdr_scc_mgr->dqs_ena);
+ addr = (u32)&sdr_scc_mgr->dqs_ena;
writel(read_group, SOCFPGA_SDR_ADDRESS + addr);
- addr = sdr_get_addr(&sdr_scc_mgr->update);
+ addr = (u32)&sdr_scc_mgr->update;
writel(0, SOCFPGA_SDR_ADDRESS + addr);
}
}
scc_mgr_set_dqdqs_output_phase(write_group, phase);
if (update_scan_chains) {
- addr = sdr_get_addr(&sdr_scc_mgr->dqs_ena);
+ addr = (u32)&sdr_scc_mgr->dqs_ena;
writel(write_group, SOCFPGA_SDR_ADDRESS + addr);
- addr = sdr_get_addr(&sdr_scc_mgr->update);
+ addr = (u32)&sdr_scc_mgr->update;
writel(0, SOCFPGA_SDR_ADDRESS + addr);
}
}
r += NUM_RANKS_PER_SHADOW_REG) {
scc_mgr_set_dqs_en_delay(read_group, delay);
- addr = sdr_get_addr(&sdr_scc_mgr->dqs_ena);
+ addr = (u32)&sdr_scc_mgr->dqs_ena;
writel(read_group, SOCFPGA_SDR_ADDRESS + addr);
/*
* In shadow register mode, the T11 settings are stored in
* select_shadow_regs_for_update with update_scan_chains
* set to 0.
*/
- addr = sdr_get_addr(&sdr_scc_mgr->update);
+ addr = (u32)&sdr_scc_mgr->update;
writel(0, SOCFPGA_SDR_ADDRESS + addr);
}
/*
* select_shadow_regs_for_update with update_scan_chains
* set to 0.
*/
- addr = sdr_get_addr(&sdr_scc_mgr->update);
+ addr = (u32)&sdr_scc_mgr->update;
writel(0, SOCFPGA_SDR_ADDRESS + addr);
}
}
/* multicast to all DQS group enables */
- addr = sdr_get_addr(&sdr_scc_mgr->dqs_ena);
+ addr = (u32)&sdr_scc_mgr->dqs_ena;
writel(0xff, SOCFPGA_SDR_ADDRESS + addr);
- addr = sdr_get_addr(&sdr_scc_mgr->update);
+ addr = (u32)&sdr_scc_mgr->update;
writel(0, SOCFPGA_SDR_ADDRESS + addr);
}
__func__, __LINE__);
}
/* multicast to all DQ enables */
- addr = sdr_get_addr(&sdr_scc_mgr->dq_ena);
+ addr = (u32)&sdr_scc_mgr->dq_ena;
writel(0xff, SOCFPGA_SDR_ADDRESS + addr);
- addr = sdr_get_addr(&sdr_scc_mgr->dm_ena);
+ addr = (u32)&sdr_scc_mgr->dm_ena;
writel(0xff, SOCFPGA_SDR_ADDRESS + addr);
/* update current DQS IO enable */
- addr = sdr_get_addr(&sdr_scc_mgr->dqs_io_ena);
+ addr = (u32)&sdr_scc_mgr->dqs_io_ena;
writel(0, SOCFPGA_SDR_ADDRESS + addr);
/* update the DQS logic */
- addr = sdr_get_addr(&sdr_scc_mgr->dqs_ena);
+ addr = (u32)&sdr_scc_mgr->dqs_ena;
writel(write_group, SOCFPGA_SDR_ADDRESS + addr);
/* hit update */
- addr = sdr_get_addr(&sdr_scc_mgr->update);
+ addr = (u32)&sdr_scc_mgr->update;
writel(0, SOCFPGA_SDR_ADDRESS + addr);
}
}
/* multicast to all DQ enables */
- addr = sdr_get_addr(&sdr_scc_mgr->dq_ena);
+ addr = (u32)&sdr_scc_mgr->dq_ena;
writel(0xff, SOCFPGA_SDR_ADDRESS + addr);
/* Zero all DM config settings */
}
/* multicast to all DM enables */
- addr = sdr_get_addr(&sdr_scc_mgr->dm_ena);
+ addr = (u32)&sdr_scc_mgr->dm_ena;
writel(0xff, SOCFPGA_SDR_ADDRESS + addr);
/* zero all DQS io settings */
scc_mgr_load_dqs_for_write_group(write_group);
/* multicast to all DQS IO enables (only 1) */
- addr = sdr_get_addr(&sdr_scc_mgr->dqs_io_ena);
+ addr = (u32)&sdr_scc_mgr->dqs_io_ena;
writel(0, SOCFPGA_SDR_ADDRESS + addr);
/* hit update to zero everything */
- addr = sdr_get_addr(&sdr_scc_mgr->update);
+ addr = (u32)&sdr_scc_mgr->update;
writel(0, SOCFPGA_SDR_ADDRESS + addr);
}
}
/* load up dqs config settings */
static void scc_mgr_load_dqs(uint32_t dqs)
{
- uint32_t addr = sdr_get_addr(&sdr_scc_mgr->dqs_ena);
+ uint32_t addr = (u32)&sdr_scc_mgr->dqs_ena;
writel(dqs, SOCFPGA_SDR_ADDRESS + addr);
}
static void scc_mgr_load_dqs_for_write_group(uint32_t write_group)
{
uint32_t read_group;
- uint32_t addr = sdr_get_addr(&sdr_scc_mgr->dqs_ena);
+ uint32_t addr = (u32)&sdr_scc_mgr->dqs_ena;
/*
* Although OCT affects only write data, the OCT delay is controlled
* by the DQS logic block which is instantiated once per read group.
/* load up dqs io config settings */
static void scc_mgr_load_dqs_io(void)
{
- uint32_t addr = sdr_get_addr(&sdr_scc_mgr->dqs_io_ena);
+ uint32_t addr = (u32)&sdr_scc_mgr->dqs_io_ena;
writel(0, SOCFPGA_SDR_ADDRESS + addr);
}
/* load up dq config settings */
static void scc_mgr_load_dq(uint32_t dq_in_group)
{
- uint32_t addr = sdr_get_addr(&sdr_scc_mgr->dq_ena);
+ uint32_t addr = (u32)&sdr_scc_mgr->dq_ena;
writel(dq_in_group, SOCFPGA_SDR_ADDRESS + addr);
}
/* load up dm config settings */
static void scc_mgr_load_dm(uint32_t dm)
{
- uint32_t addr = sdr_get_addr(&sdr_scc_mgr->dm_ena);
+ uint32_t addr = (u32)&sdr_scc_mgr->dm_ena;
writel(dm, SOCFPGA_SDR_ADDRESS + addr);
}
uint32_t write_group, uint32_t group_bgn, uint32_t delay)
{
uint32_t r;
- uint32_t addr = sdr_get_addr(&sdr_scc_mgr->update);
+ uint32_t addr = (u32)&sdr_scc_mgr->update;
for (r = 0; r < RW_MGR_MEM_NUMBER_OF_RANKS;
r += NUM_RANKS_PER_SHADOW_REG) {
scc_mgr_set_dq_in_delay(write_group, p, d);
scc_mgr_load_dq(p);
}
- addr = sdr_get_addr(&sdr_scc_mgr->update);
+ addr = (u32)&sdr_scc_mgr->update;
writel(0, SOCFPGA_SDR_ADDRESS + addr);
}
scc_mgr_set_dq_in_delay(write_group, p, 0);
scc_mgr_load_dq(p);
}
- addr = sdr_get_addr(&sdr_scc_mgr->update);
+ addr = (u32)&sdr_scc_mgr->update;
writel(0, SOCFPGA_SDR_ADDRESS + addr);
}
right_edge[i] = IO_IO_IN_DELAY_MAX + 1;
}
- addr = sdr_get_addr(&sdr_scc_mgr->update);
+ addr = (u32)&sdr_scc_mgr->update;
/* Search for the left edge of the window for each bit */
for (d = 0; d <= IO_IO_IN_DELAY_MAX; d++) {
scc_mgr_apply_group_dq_in_delay(write_group, test_bgn, d);
break;
}
- addr = sdr_get_addr(&sdr_scc_mgr->update);
+ addr = (u32)&sdr_scc_mgr->update;
/* Search for the right edge of the window for each bit */
for (d = 0; d <= IO_DQS_IN_DELAY_MAX - start_dqs; d++) {
scc_mgr_set_dqs_bus_in_delay(read_group, d + start_dqs);
}
/* Check that all bits have a window */
- addr = sdr_get_addr(&sdr_scc_mgr->update);
+ addr = (u32)&sdr_scc_mgr->update;
for (i = 0; i < RW_MGR_MEM_DQ_PER_READ_DQS; i++) {
debug_cond(DLEVEL == 2, "%s:%d vfifo_center: left_edge[%u]: \
%d right_edge[%u]: %d", __func__, __LINE__,
* Do not remove this line as it makes sure all of our decisions
* have been applied. Apply the update bit.
*/
- addr = sdr_get_addr(&sdr_scc_mgr->update);
+ addr = (u32)&sdr_scc_mgr->update;
writel(0, SOCFPGA_SDR_ADDRESS + addr);
return (dq_margin >= 0) && (dqs_margin >= 0);
}
/* Search for the left edge of the window for each bit */
- addr = sdr_get_addr(&sdr_scc_mgr->update);
+ addr = (u32)&sdr_scc_mgr->update;
for (d = 0; d <= IO_IO_OUT1_DELAY_MAX; d++) {
scc_mgr_apply_group_dq_out1_delay(write_group, test_bgn, d);
}
/* Search for the right edge of the window for each bit */
- addr = sdr_get_addr(&sdr_scc_mgr->update);
+ addr = (u32)&sdr_scc_mgr->update;
for (d = 0; d <= IO_IO_OUT1_DELAY_MAX - start_dqs; d++) {
scc_mgr_apply_group_dqs_io_and_oct_out1(write_group,
d + start_dqs);
/* Move DQS */
scc_mgr_apply_group_dqs_io_and_oct_out1(write_group, new_dqs);
- addr = sdr_get_addr(&sdr_scc_mgr->update);
+ addr = (u32)&sdr_scc_mgr->update;
writel(0, SOCFPGA_SDR_ADDRESS + addr);
/* Centre DM */
int32_t win_best = 0;
/* Search for the/part of the window with DM shift */
- addr = sdr_get_addr(&sdr_scc_mgr->update);
+ addr = (u32)&sdr_scc_mgr->update;
for (d = IO_IO_OUT1_DELAY_MAX; d >= 0; d -= DELTA_D) {
scc_mgr_apply_group_dm_out1_delay(write_group, d);
writel(0, SOCFPGA_SDR_ADDRESS + addr);
}
/* Search for the/part of the window with DQS shifts */
- addr = sdr_get_addr(&sdr_scc_mgr->update);
+ addr = (u32)&sdr_scc_mgr->update;
for (d = 0; d <= IO_IO_OUT1_DELAY_MAX - new_dqs; d += DELTA_D) {
/*
* Note: This only shifts DQS, so are we limiting ourselve to
dm_margin = left_edge[0] - mid;
scc_mgr_apply_group_dm_out1_delay(write_group, mid);
- addr = sdr_get_addr(&sdr_scc_mgr->update);
+ addr = (u32)&sdr_scc_mgr->update;
writel(0, SOCFPGA_SDR_ADDRESS + addr);
debug_cond(DLEVEL == 2, "%s:%d dm_calib: left=%d right=%d mid=%d \
* Do not remove this line as it makes sure all of our
* decisions have been applied.
*/
- addr = sdr_get_addr(&sdr_scc_mgr->update);
+ addr = (u32)&sdr_scc_mgr->update;
writel(0, SOCFPGA_SDR_ADDRESS + addr);
return (dq_margin >= 0) && (dqs_margin >= 0) && (dm_margin >= 0);
}
scc_mgr_set_dqdqs_output_phase(i, (1.25 *
IO_DLL_CHAIN_LENGTH - 2));
}
- addr = sdr_get_addr(&sdr_scc_mgr->dqs_ena);
+ addr = (u32)&sdr_scc_mgr->dqs_ena;
writel(0xff, SOCFPGA_SDR_ADDRESS + addr);
- addr = sdr_get_addr(&sdr_scc_mgr->dqs_io_ena);
+ addr = (u32)&sdr_scc_mgr->dqs_io_ena;
writel(0xff, SOCFPGA_SDR_ADDRESS + addr);
addr = sdr_get_addr((u32 *)SCC_MGR_GROUP_COUNTER);
for (i = 0; i < RW_MGR_MEM_IF_WRITE_DQS_WIDTH; i++) {
writel(i, SOCFPGA_SDR_ADDRESS + addr);
}
- addr = sdr_get_addr(&sdr_scc_mgr->dq_ena);
+ addr = (u32)&sdr_scc_mgr->dq_ena;
writel(0xff, SOCFPGA_SDR_ADDRESS + addr);
- addr = sdr_get_addr(&sdr_scc_mgr->dm_ena);
+ addr = (u32)&sdr_scc_mgr->dm_ena;
writel(0xff, SOCFPGA_SDR_ADDRESS + addr);
- addr = sdr_get_addr(&sdr_scc_mgr->update);
+ addr = (u32)&sdr_scc_mgr->update;
writel(0, SOCFPGA_SDR_ADDRESS + addr);
}
scc_mgr_set_dqs_bus_in_delay(i, 10);
scc_mgr_load_dqs(i);
}
- addr = sdr_get_addr(&sdr_scc_mgr->update);
+ addr = (u32)&sdr_scc_mgr->update;
writel(0, SOCFPGA_SDR_ADDRESS + addr);
/*
* Do not remove this line as it makes sure all of our decisions
* have been applied.
*/
- addr = sdr_get_addr(&sdr_scc_mgr->update);
+ addr = (u32)&sdr_scc_mgr->update;
writel(0, SOCFPGA_SDR_ADDRESS + addr);
return 1;
}