-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
48 changed files
with
3,655 additions
and
246 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
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
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,22 @@ | ||
TOP=../.. | ||
include $(TOP)/configure/CONFIG | ||
#---------------------------------------- | ||
# ADD MACRO DEFINITIONS AFTER THIS LINE | ||
|
||
#---------------------------------------------------- | ||
# Optimization of db files using dbst (DEFAULT: NO) | ||
#DB_OPT = YES | ||
|
||
#---------------------------------------------------- | ||
# Create and install (or just install) into <top>/db | ||
# databases, templates, substitutions like this | ||
DB += frib-flash.db | ||
|
||
#---------------------------------------------------- | ||
# If <anyname>.db template is not named <anyname>*.template add | ||
# <anyname>_template = <templatename> | ||
|
||
include $(TOP)/configure/RULES | ||
#---------------------------------------- | ||
# ADD RULES AFTER THIS LINE | ||
|
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,35 @@ | ||
record(waveform, "$(P)bitfile") { | ||
field(DTYP, "Explore FRIB Flash") | ||
field(INP , "@$(DEV) pci_offset=$(offset=0x2004) flash_offset=$(location=0) flash_size=$(size=16777216)") | ||
field(FTVL, "UCHAR") | ||
field(NELM, "$(NELM=4194304)") | ||
} | ||
|
||
record(mbbi, "$(P)sts") { | ||
field(DTYP, "Explore FRIB Flash") | ||
field(INP , "@$(DEV) pci_offset=$(offset=0x2004) flash_offset=$(location=0)") | ||
field(SCAN, "I/O Intr") | ||
field(PINI, "YES") | ||
field(ZRVL, "0") | ||
field(ONVL, "1") | ||
field(TWVL, "2") | ||
field(THVL, "3") | ||
field(FRVL, "4") | ||
field(FVVL, "5") | ||
field(ZRST, "Idle") | ||
field(ONST, "Erase") | ||
field(TWST, "Program") | ||
field(THST, "Verify") | ||
field(FRST, "Success") | ||
field(FVST, "Failure") | ||
field(FVSV, "MAJOR") | ||
} | ||
|
||
# Write 1 to start sequence | ||
# Write 0 to abort sequence | ||
record(longout, "$(P)ctrl") { | ||
field(DTYP, "Explore FRIB Flash") | ||
field(OUT , "@$(DEV) pci_offset=$(offset=0x2004) flash_offset=$(location=0)") | ||
# set TPRO to 2 or 3 to enable debugging prints | ||
# field(TPRO, "2") | ||
} |
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,8 @@ | ||
TOP = .. | ||
include $(TOP)/configure/CONFIG | ||
DIRS := $(DIRS) $(filter-out $(DIRS), $(wildcard *src*)) | ||
DIRS := $(DIRS) $(filter-out $(DIRS), $(wildcard *Src*)) | ||
DIRS := $(DIRS) $(filter-out $(DIRS), $(wildcard *db*)) | ||
DIRS := $(DIRS) $(filter-out $(DIRS), $(wildcard *Db*)) | ||
include $(TOP)/configure/RULES_DIRS | ||
|
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,129 @@ | ||
Record recipies for PCI "explorer" IOC | ||
====================================== | ||
|
||
INP/OUT field values | ||
-------------------- | ||
|
||
All records with DTYP="Explore ..." should begin the INP or OUT string | ||
in one of the following formats. | ||
|
||
* "@BB:DD.FF" | ||
* "@slot=#" | ||
|
||
Where "BB:DD.FF" is a PCI geographic address (bus, device, function), | ||
and "slot=SN" gives a PCI slot number (when OS support is present). | ||
|
||
A space seperated list of the following may follow. | ||
|
||
* "bar=#" (default: 0) | ||
* "offset=#" in bytes (default: 0) | ||
* "mask=#" bit mask (default: 0 aka. no mask) | ||
* "shift=#" in bits (default: 0) | ||
* "step=#" in bytes (default: read size. eg Read32 defaults to step=4) | ||
* "initread=1|0" bool (default: 1 for .OUT recordtypes, 0 otherwise) | ||
|
||
``` | ||
field(INP , "@8:0.0 bar=1 offset=0x14") | ||
... or ... | ||
field(OUT , "@8:0.0 bar=1 offset=0x14") | ||
``` | ||
|
||
Selects device "8:0.0" BAR 1 starting with byte offset 0x14. | ||
|
||
Numbers prefixed with '0x' are hexidecimal. Numbers w/o a prefix are decimal. | ||
|
||
Optional for all input/read records | ||
----------------------------------- | ||
|
||
``` | ||
field(PINI, "YES") | ||
``` | ||
|
||
Read once on IOC startup | ||
|
||
``` | ||
field(SCAN, "1 second") | ||
``` | ||
|
||
Read periodically, ever 1 second. Other options are ".1 second", ".2 second", | ||
".5 second", "2 second", "5 second", and "10 second". | ||
|
||
|
||
Read a scalar value | ||
------------------- | ||
|
||
Reading a 32-bit register as an scalar integer in little endian byte order. | ||
Reads periodically at 1Hz. | ||
|
||
``` | ||
record(longin, "pcitest0") { | ||
field(DTYP, "Explore Read32 LSB") | ||
field(INP , "@8:0.0 bar=0 offset=0") | ||
field(SCAN, "1 second") | ||
} | ||
``` | ||
|
||
Read an array of values | ||
----------------------- | ||
|
||
``` | ||
record(waveform, "pcitest0_10") { | ||
field(DTYP, "Explore Read32 LSB") | ||
field(INP , "@8:0.0 bar=0 offset=8 step=4") | ||
field(FTVL, "ULONG") | ||
field(NELM, "16") | ||
field(SCAN, "1 second") | ||
} | ||
``` | ||
|
||
Makes 16 sequential reads of 4 bytes each. | ||
The first read is of address 8. | ||
|
||
The number of elements to read is determined by the NELM field. | ||
|
||
Write a scalar value | ||
-------------------- | ||
|
||
``` | ||
record(longout, "pcitestout") { | ||
field(DTYP, "Explore Write32 LSB") | ||
field(OUT , "@8:0.0 bar=0 offset=0xc") | ||
} | ||
``` | ||
|
||
Make a single 4 byte write to address 0xc | ||
|
||
Bit-field access | ||
---------------- | ||
|
||
A read-modify-write operation to address 0xc. | ||
|
||
``` | ||
record(longout, "pcitestout") { | ||
field(DTYP, "Explore Write32 LSB") | ||
field(OUT , "@8:0.0 0 offset=0xc mask=0xff00 shift=8") | ||
} | ||
``` | ||
|
||
Equivlant pseudo-code. | ||
|
||
``` | ||
u32 newval = read()&~mask | ||
newval |= (VAL<<shift)&mask | ||
write(newval) | ||
``` | ||
|
||
A masked read | ||
|
||
``` | ||
record(longin, "pcitestin") { | ||
field(DTYP, "Explore Read32 LSB") | ||
field(OUT , "@8:0.0 0 offset=0xc mask=0xff00 shift=8") | ||
} | ||
``` | ||
|
||
Equivlant pseudo-code. | ||
|
||
``` | ||
VAL = (read()&mask)>>shift | ||
``` |
Oops, something went wrong.