mcap: linux: Dump all registers option (-d) Returns "Failed Reading Registers"
when -d option is used to dump all the registers, It should ignore the Data register if it's empty or Not set and should not return a failure in reading those registers. Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com> Reviewed-by: Srikanth Vemula <svemula@xilinx.com>
This commit is contained in:
parent
d9904389a5
commit
554c3f5dd2
1 changed files with 14 additions and 5 deletions
|
@ -423,8 +423,12 @@ static int MCapReadDataRegisters(struct mcap_dev *mdev, u32 *data)
|
|||
MCapRegWrite(mdev, MCAP_CONTROL, set);
|
||||
read_cnt = GetRegReadCount(mdev);
|
||||
|
||||
if (IsErrSet(mdev) || IsFifoOverflow(mdev) ||
|
||||
!(read_cnt) || !(IsRegReadComplete(mdev))) {
|
||||
if (!(read_cnt) || !(IsRegReadComplete(mdev))) {
|
||||
MCapRegWrite(mdev, MCAP_CONTROL, restore);
|
||||
return EMCAPREAD;
|
||||
}
|
||||
|
||||
if (IsErrSet(mdev) || IsFifoOverflow(mdev)) {
|
||||
pr_err("Read Register Set Configuration Failed\n");
|
||||
MCapRegWrite(mdev, MCAP_CONTROL, restore);
|
||||
return -EMCAPREAD;
|
||||
|
@ -454,11 +458,16 @@ static int MCapReadDataRegisters(struct mcap_dev *mdev, u32 *data)
|
|||
void MCapDumpReadRegs(struct mcap_dev *mdev)
|
||||
{
|
||||
u32 data[4];
|
||||
u32 status;
|
||||
|
||||
if (MCapReadDataRegisters(mdev, data)) {
|
||||
status = MCapReadDataRegisters(mdev, data);
|
||||
if (status == EMCAPREAD)
|
||||
return;
|
||||
|
||||
if (status) {
|
||||
pr_err("Failed Reading Registers.. This may be");
|
||||
pr_err("due to inappropriate FPGA configuration.");
|
||||
pr_err("Make sure you downloaded the correct bitstream\n");
|
||||
pr_err(" due to inappropriate FPGA configuration.");
|
||||
pr_err(" Make sure you downloaded the correct bitstream\n");
|
||||
return;
|
||||
}
|
||||
pr_info("Register Read Data 0:\t0x%08x\n", data[0]);
|
||||
|
|
Loading…
Add table
Reference in a new issue