Skip to content

Commit 2cecf03

Browse files
Matthew Forneromhennerich
authored andcommitted
misc: mathworks: capture reset reg from DT
Signed-off-by: Matt Fornero <matt.fornero@mathworks.com>
1 parent 085ba37 commit 2cecf03

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

drivers/misc/mathworks/mathworks_ipcore.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ static int mathworks_ipcore_of_probe(struct platform_device *op)
4646
return -ENOENT;
4747
}
4848

49+
status = of_property_read_u32(dev->of_node, "mathworks,rst-reg", &mwdev->rst_reg);
50+
if(status) {
51+
/* Fall back to 0 if the property does not exist */
52+
mwdev->rst_reg = 0;
53+
}
54+
4955
mwdev->mw_ip_info->private = mwdev;
5056

5157
status = devm_mathworks_ip_register(mwdev->mw_ip_info);

drivers/misc/mathworks/mathworks_ipcore.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151

5252
struct mathworks_ipcore_dev {
5353
struct mathworks_ip_info *mw_ip_info;
54+
u32 rst_reg;
5455
void *private;
5556
};
5657

drivers/misc/mathworks/mw_stream_channel.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,7 @@ static int mw_axidma_setupchannel(struct mwadma_dev *mwdev,
10371037

10381038
/* Write to the IPCore_PacketSize_AXI4_Stream_Master 0x8 to specify the length*/
10391039
/*reset pcore*/
1040-
mw_ip_write32(MWDEV_TO_MWIP(mwdev), 0x0, 0x1);
1040+
mw_ip_write32(MWDEV_TO_MWIP(mwdev), mwdev->mw_ipcore_dev->rst_reg, 0x1);
10411041
/*reset pcore*/
10421042
mw_ip_write32(MWDEV_TO_MWIP(mwdev), 0x8, usrbuf->counter);
10431043
buf = MWDEV_TO_MWIP(mwdev)->dma_info.virt;

0 commit comments

Comments
 (0)