-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the jesd driver for line rate change. Add support for jesd phy. Signed-off-by: Shubhrajyoti Datta <shubhraj@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com> State: pending
- Loading branch information
Shubhrajyoti Datta
authored and
Michal Simek
committed
May 27, 2021
1 parent
ff3a772
commit 99ac99c
Showing
10 changed files
with
823 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
obj-$(CONFIG_XILINX_JESD204B_PHY) += jesd204b_phy.o | ||
jesd204b_phy-y += jesd_phy.o gtx7s_cpll_bands.o \ | ||
gtx7s_qpll_bands.o | ||
obj-$(CONFIG_XILINX_JESD204B) += jesd204b.o | ||
jesd204b-y += xilinx_jesd204b.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
/* | ||
* Copyright (C) 2014 - 2015 Xilinx, Inc. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
#include <linux/types.h> | ||
#include "s7_gtxe2_drp.h" | ||
#include "gtx7s_cpll_bands.h" | ||
|
||
static const u32 gtx7s_cpll_channel_address_lut | ||
[GTX7S_CPLL_NUM_CHANNEL_DRP_REGS] = { | ||
RXCDR_CFG0_ADDR, | ||
RXCDR_CFG1_ADDR, | ||
RXCDR_CFG2_ADDR, | ||
RXCDR_CFG3_ADDR, | ||
RXCDR_CFG4_ADDR, | ||
RXOUT_DIV_ADDR, | ||
TXOUT_DIV_ADDR, | ||
RX_DFE_LPM_CFG_ADDR | ||
}; | ||
|
||
static const u32 gtx7s_cpll_channel_offset_lut | ||
[GTX7S_CPLL_NUM_CHANNEL_DRP_REGS] = { | ||
RXCDR_CFG0_OFFSET, | ||
RXCDR_CFG1_OFFSET, | ||
RXCDR_CFG2_OFFSET, | ||
RXCDR_CFG3_OFFSET, | ||
RXCDR_CFG4_OFFSET, | ||
RXOUT_DIV_OFFSET, | ||
TXOUT_DIV_OFFSET, | ||
RX_DFE_LPM_CFG_OFFSET | ||
}; | ||
|
||
static const u32 gtx7s_cpll_channel_mask_lut | ||
[GTX7S_CPLL_NUM_CHANNEL_DRP_REGS] = { | ||
RXCDR_CFG0_MASK, | ||
RXCDR_CFG1_MASK, | ||
RXCDR_CFG2_MASK, | ||
RXCDR_CFG3_MASK, | ||
RXCDR_CFG4_MASK, | ||
RXOUT_DIV_MASK, | ||
TXOUT_DIV_MASK, | ||
RX_DFE_LPM_CFG_MASK | ||
}; | ||
|
||
/* Note bands run vertically from 1 to 4 */ | ||
static const u16 gtx7s_cpll_channel_param_lut[GTX7S_CPLL_NUM_CHANNEL_DRP_REGS] | ||
[GTX7S_CPLL_NUM_LINE_RATE_BANDS] = { | ||
{0x20, 0x20, 0x20, 0x20 },/* RXCDR_CFG0 */ | ||
{0x1010, 0x1020, 0x1040, 0x1040 },/* RXCDR_CFG1 */ | ||
{0x23ff, 0x23ff, 0x23ff, 0x23ff },/* RXCDR_CFG2 */ | ||
{0x0, 0x0, 0x0, 0x0 },/* RXCDR_CFG3 */ | ||
{0x3, 0x3, 0x3, 0x3 },/* RXCDR_CFG4 */ | ||
{0x3, 0x2, 0x1, 0x1 },/* RXOUT_DIV */ | ||
{0x3, 0x2, 0x1, 0x1 },/* TXOUT_DIV */ | ||
{0x904, 0x904, 0x904, 0x104 } /* RX_DFE_LPM_CFG */ | ||
}; | ||
|
||
u32 get_gtx7s_cpll_address_lut(u32 lut_address) | ||
{ | ||
return gtx7s_cpll_channel_address_lut[lut_address]; | ||
} | ||
|
||
u32 get_gtx7s_cpll_offset_lut(u32 lut_address) | ||
{ | ||
return gtx7s_cpll_channel_offset_lut[lut_address]; | ||
} | ||
|
||
u32 get_gtx7s_cpll_mask_lut(u32 lut_address) | ||
{ | ||
return gtx7s_cpll_channel_mask_lut[lut_address]; | ||
} | ||
|
||
u16 get_gtx7s_cpll_param_lut(u32 param_address, u32 band_address) | ||
{ | ||
return gtx7s_cpll_channel_param_lut[param_address][band_address]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright (C) 2014 - 2015 Xilinx, Inc. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include <linux/types.h> | ||
|
||
#ifndef GTX7S_CPLL_BANDS_H_ | ||
#define GTX7S_CPLL_BANDS_H_ | ||
|
||
#define GTX7S_CPLL_NUM_CHANNEL_DRP_REGS 8 | ||
#define GTX7S_CPLL_NUM_LINE_RATE_BANDS 4 | ||
|
||
u32 get_gtx7s_cpll_address_lut(u32); | ||
u32 get_gtx7s_cpll_offset_lut(u32); | ||
u32 get_gtx7s_cpll_mask_lut(u32); | ||
u16 get_gtx7s_cpll_param_lut(u32, u32); | ||
|
||
#endif /* GTX7S_CPLL_BANDS_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
/* | ||
* Copyright (C) 2014 - 2015 Xilinx, Inc. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
#include <linux/types.h> | ||
#include "s7_gtxe2_drp.h" | ||
#include "gtx7s_qpll_bands.h" | ||
|
||
static const u32 gtx7s_qpll_channel_address_lut | ||
[GTX7S_QPLL_NUM_CHANNEL_DRP_REGS] = { | ||
RXCDR_CFG0_ADDR, | ||
RXCDR_CFG1_ADDR, | ||
RXCDR_CFG2_ADDR, | ||
RXCDR_CFG3_ADDR, | ||
RXCDR_CFG4_ADDR, | ||
RXOUT_DIV_ADDR, | ||
TXOUT_DIV_ADDR, | ||
RX_DFE_LPM_CFG_ADDR, | ||
QPLL_CFG0_ADDR, | ||
QPLL_CFG1_ADDR | ||
}; | ||
|
||
static const u32 gtx7s_qpll_channel_offset_lut | ||
[GTX7S_QPLL_NUM_CHANNEL_DRP_REGS] = { | ||
RXCDR_CFG0_OFFSET, | ||
RXCDR_CFG1_OFFSET, | ||
RXCDR_CFG2_OFFSET, | ||
RXCDR_CFG3_OFFSET, | ||
RXCDR_CFG4_OFFSET, | ||
RXOUT_DIV_OFFSET, | ||
TXOUT_DIV_OFFSET, | ||
RX_DFE_LPM_CFG_OFFSET, | ||
QPLL_CFG0_OFFSET, | ||
QPLL_CFG1_OFFSET | ||
}; | ||
|
||
static const u32 gtx7s_qpll_channel_mask_lut | ||
[GTX7S_QPLL_NUM_CHANNEL_DRP_REGS] = { | ||
RXCDR_CFG0_MASK, | ||
RXCDR_CFG1_MASK, | ||
RXCDR_CFG2_MASK, | ||
RXCDR_CFG3_MASK, | ||
RXCDR_CFG4_MASK, | ||
RXOUT_DIV_MASK, | ||
TXOUT_DIV_MASK, | ||
RX_DFE_LPM_CFG_MASK, | ||
QPLL_CFG0_MASK, | ||
QPLL_CFG1_MASK | ||
}; | ||
|
||
/* Note bands run vertically from 1 to 10 */ | ||
static const u16 gtx7s_qpll_channel_param_lut[GTX7S_QPLL_NUM_CHANNEL_DRP_REGS] | ||
[GTX7S_QPLL_NUM_LINE_RATE_BANDS] = { | ||
{0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20},/* RXCDR_CFG0 */ | ||
{0x1008, 0x1010, 0x1020, 0x1010, 0x1020, 0x1040, 0x1020, 0x1040, 0x1040, 0x1040},/* RXCDR_CFG1 */ | ||
{0x23ff, 0x23ff, 0x23ff, 0x23ff, 0x23ff, 0x23ff, 0x23ff, 0x23ff, 0x23ff, 0x23ff},/* RXCDR_CFG2 */ | ||
{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, /* RXCDR_CFG3 */ | ||
{0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3},/* RXCDR_CFG4 */ | ||
{0x3e8, 0x4, 0x2, 0x3, 0x2, 0x1, 0x2, 0x1, 0x1, 0x1},/* RXOUT_DIV */ | ||
{0x3e8, 0x4, 0x2, 0x3, 0x2, 0x1, 0x2, 0x1, 0x1, 0x1},/* TXOUT_DIV */ | ||
{0x904, 0x904, 0x904, 0x904, 0x904, 0x904, 0x904, 0x904, 0x104, 0x104},/* RX_DFE_LPM_CFG */ | ||
{0x1c1, 0x1c1, 0x1c1, 0x181, 0x1c1, 0x1c1, 0x181, 0x1c1, 0x1c1, 0x181},/* QPLL_CFG0 */ | ||
{0x68, 0x68, 0x68, 0x68, 0x68, 0x68, 0x68, 0x68, 0x68, 0x68} /* QPLL_CFG1 */ | ||
}; | ||
|
||
u32 get_gtx7s_qpll_address_lut(u32 lut_address) | ||
{ | ||
return gtx7s_qpll_channel_address_lut[lut_address]; | ||
} | ||
|
||
u32 get_gtx7s_qpll_offset_lut(u32 lut_address) | ||
{ | ||
return gtx7s_qpll_channel_offset_lut[lut_address]; | ||
} | ||
|
||
u32 get_gtx7s_qpll_mask_lut(u32 lut_address) | ||
{ | ||
return gtx7s_qpll_channel_mask_lut[lut_address]; | ||
} | ||
|
||
u16 get_gtx7s_qpll_param_lut(u32 param_address, u32 band_address) | ||
{ | ||
return gtx7s_qpll_channel_param_lut[param_address][band_address]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright (C) 2014 - 2015 Xilinx, Inc. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
#include <linux/types.h> | ||
|
||
#ifndef GTX7S_QPLL_BANDS_H_ | ||
#define GTX7S_QPLL_BANDS_H_ | ||
|
||
#define GTX7S_QPLL_NUM_CHANNEL_DRP_REGS 10 | ||
#define GTX7S_QPLL_NUM_LINE_RATE_BANDS 10 | ||
|
||
u32 get_gtx7s_qpll_address_lut(u32); | ||
u32 get_gtx7s_qpll_offset_lut(u32); | ||
u32 get_gtx7s_qpll_mask_lut(u32); | ||
u16 get_gtx7s_qpll_param_lut(u32, u32); | ||
|
||
#endif /* GTX7S_QPLL_BANDS_H_ */ |
Oops, something went wrong.