Skip to content

Bspi updates#420

Merged
jepler merged 3 commits intoLinuxCNC:masterfrom
sleepybishop:bspi_updates
Mar 17, 2018
Merged

Bspi updates#420
jepler merged 3 commits intoLinuxCNC:masterfrom
sleepybishop:bspi_updates

Conversation

@sleepybishop
Copy link
Contributor

been working on bspi driver, found a few bugs.

for context:
https://forum.linuxcnc.org/24-hal-components/34049-bspi-problems#106773

@andypugh
Copy link
Collaborator

Why reduce the maximum number of bspi interfaces?

@sleepybishop
Copy link
Contributor Author

not reducing, according to regmap the base addresses for bspi modules are
0x5500 BSPI FIFO port 0
0x5540 BSPI FIFO port 1
0x5580 BSPI FIFO port 2
0x55C0 BSPI FIFO port 3

and then
0x5600 BSPI channel descriptor setup registor 0

so theres only room for 4 bspi interfaces

unless we do a big refactor and resuse the dbspi address space, as far as i cant tell the only difference is one parameter in hostmot2.vhd (gatedcs= true) for dbspi. if we set that via other means then there is enough address space for 4 more bspi instances. but that would be a pretty big change

@andypugh
Copy link
Collaborator

so theres only room for 4 bspi interfaces

4 interfaces per FPGA card. But a system can have many FPGA cards.

@sleepybishop
Copy link
Contributor Author

right, ok ill revert that change.

@sleepybishop sleepybishop force-pushed the bspi_updates branch 2 times, most recently from f2f38bd to 7766b65 Compare March 16, 2018 18:36
@jepler
Copy link
Contributor

jepler commented Mar 16, 2018

Also the memory map file is really just a guideline for how things typically are. A firmware could move those to any other address and have room for more BSPI instances. The hostmot2 driver will read the correct addresses from the IDROM, and does not use the addresses and ranges shown in the regmap.txt.

@sleepybishop
Copy link
Contributor Author

i removed all commits that deal with addresses of the registers, i have more work to do to sort all that out.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This added function appears to be unused. If that is correct, can you please remove it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you change the function signature here, but don't change the declaration or use sites until a later commit. Please move to the appropriate commit.

Symptom: Compiling at this ref,

hal/drivers/mesa-hostmot2/bspi.c:213:5: error: conflicting types for ‘hm2_bspi_setup_chan’
 int hm2_bspi_setup_chan(char *name, int chan, int cs, int bits, float mhz,
     ^~~~~~~~~~~~~~~~~~~
In file included from hal/drivers/mesa-hostmot2/bspi.c:25:0:
hal/drivers/mesa-hostmot2/hostmot2.h:1304:5: note: previous declaration of ‘hm2_bspi_setup_chan’ was here
 int hm2_bspi_setup_chan(char *name, int chan, int cs, int bits, float mhz,
     ^~~~~~~~~~~~~~~~~~~
Makefile:1005: recipe for target 'objects/rthal/drivers/mesa-hostmot2/bspi.o' failed

Signed-off-by: joseph calderon <calderon.joe@gmail.com>
@sleepybishop sleepybishop force-pushed the bspi_updates branch 2 times, most recently from 8991dea to c325860 Compare March 17, 2018 01:30
Signed-off-by: joseph calderon <calderon.joe@gmail.com>
Signed-off-by: joseph calderon <calderon.joe@gmail.com>
@sleepybishop
Copy link
Contributor Author

@jepler, those two issues should be addressed now, thank you.

@jepler jepler merged commit 0511631 into LinuxCNC:master Mar 17, 2018
@jepler
Copy link
Contributor

jepler commented Mar 17, 2018

@sleepybishop thank you for these fixes.

@sleepybishop sleepybishop deleted the bspi_updates branch March 17, 2018 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants