Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FPGA Configuration Space
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
FPGA Configuration Space
Commits
32b9b353
Commit
32b9b353
authored
Feb 21, 2020
by
A. Hahn
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/pcie_pci_kernelv4'
parents
380f57ba
f0e89e63
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
380 additions
and
218 deletions
+380
-218
.gitmodules
.gitmodules
+1
-1
legacy-vme64x-core
legacy-vme64x-core
+1
-1
Makefile
pcie-wb/Makefile
+1
-1
pcie_wb.c
pcie-wb/pcie_wb.c
+199
-88
pcie_wb.h
pcie-wb/pcie_wb.h
+31
-20
wishbone-serial.c
pcie-wb/wishbone-serial.c
+1
-1
wishbone.c
pcie-wb/wishbone.c
+141
-101
vme_wb_external.c
vme-wb/vme_wb_external.c
+5
-5
No files found.
.gitmodules
View file @
32b9b353
[submodule "legacy-vme64x-core"]
path = legacy-vme64x-core
url =
git://ohwr.org/hdl-core-lib/vme64x-core
/legacy-vme64x-core.git
url =
https://ohwr.org/project
/legacy-vme64x-core.git
legacy-vme64x-core
@
10a1d1d8
Subproject commit
64d9fb0c837b95723cd64a264505c242852ba831
Subproject commit
10a1d1d8eb5bff6da7a1defc9e450640b0f0d80c
pcie-wb/Makefile
View file @
32b9b353
...
...
@@ -3,7 +3,7 @@ ifneq ($(KERNELRELEASE),)
ccflags-y
+=
-DGIT_REVISION
=
"
$(
shell
git --git-dir=
$(src)
/../.git log -n1 --pretty='format:%h (%ci
)
'
)
"
obj-m
+=
pcie_wb.o wishbone.o
spec_wb.o
obj-m
+=
pcie_wb.o wishbone.o
# Only build wishbone-serial if it was missing
ifneq
($(CONFIG_USB_SERIAL_WISHBONE),m)
ifneq
($(CONFIG_USB_SERIAL_WISHBONE),y)
...
...
pcie-wb/pcie_wb.c
View file @
32b9b353
This diff is collapsed.
Click to expand it.
pcie-wb/pcie_wb.h
View file @
32b9b353
...
...
@@ -6,28 +6,39 @@
#define PCIE_WB "pcie_wb"
#define PCIE_WB_VERSION "0.1"
#define PCIE_WB_VENDOR_ID 0x10dc
#define PCIE_WB_DEVICE_ID 0x019a
#define CONTROL_REGISTER_HIGH 0
#define CONTROL_REGISTER_LOW 4
#define ERROR_FLAG_HIGH 8
#define ERROR_FLAG_LOW 12
#define WINDOW_OFFSET_HIGH 16
#define WINDOW_OFFSET_LOW 20
#define SDWB_ADDRESS_HIGH 24
#define SDWB_ADDRESS_LOW 28
#define MASTER_CTL_HIGH 64
#define MASTER_CTL_LOW 68
#define MASTER_ADR_HIGH 72
#define MASTER_ADR_LOW 76
#define MASTER_DAT_HIGH 80
#define MASTER_DAT_LOW 84
#define PCIE_WB_VENDOR_ID 0x10dc
#define PCIE_WB_DEVICE_ID 0x019a
/* PCIe FTRNs (PEXARIA, EXPLODER, AMC, SCU, ...) */
#define PMC_WB_DEVICE_ID 0xc570
/* PCI FTRN (PMC) */
#define CONTROL_REGISTER_HIGH 0
#define CONTROL_REGISTER_LOW 4
#define ERROR_FLAG_HIGH 8
#define ERROR_FLAG_LOW 12
#define WINDOW_OFFSET_HIGH 16
#define WINDOW_OFFSET_LOW 20
#define SDWB_ADDRESS_HIGH 24
#define SDWB_ADDRESS_LOW 28
#define PMC_IRQ_CONTROL 32
#define MASTER_CTL_HIGH 64
#define MASTER_CTL_LOW 68
#define MASTER_ADR_HIGH 72
#define MASTER_ADR_LOW 76
#define MASTER_DAT_HIGH 80
#define MASTER_DAT_LOW 84
#define WINDOW_HIGH 0xFFFF0000UL
#define WINDOW_LOW 0x0000FFFCUL
/* PCI core control and status registers in BAR0 */
#define PCI_STATUS_REG 0x04
#define PCI_CONF_IRQ 0x3C
#define WB_CONF_IRQ_STATUS_MASK 0x00000001
#define WB_CONF_INT_ACK_REG 0x1E8
/* PCI core WB interrupt Acknowledge register */
#define WB_CONF_ICR_REG 0x1EC
/* PCI core WB interrupt Control register */
#define WB_CONF_ISR_REG 0x1F0
/* PCI core WB interrupt Status register */
/* One per BAR */
struct
pcie_wb_resource
{
unsigned
long
start
;
/* start addr of BAR */
...
...
@@ -39,9 +50,9 @@ struct pcie_wb_resource {
/* One per physical card */
struct
pcie_wb_dev
{
struct
pci_dev
*
pci_dev
;
struct
pcie_wb_resource
pci_res
[
2
];
struct
pcie_wb_resource
pci_res
[
3
];
int
msi
;
struct
wishbone
wb
;
unsigned
int
window_offset
;
unsigned
int
low_addr
,
width
,
shift
;
...
...
pcie-wb/wishbone-serial.c
View file @
32b9b353
...
...
@@ -43,7 +43,7 @@
#define API 8
#endif
#if API <=
7
#if API <=
8
static
const
struct
usb_device_id
id_table
[]
=
{
{
USB_DEVICE_AND_INTERFACE_INFO
(
0x1D50
,
0x6062
,
0xFF
,
0xFF
,
0xFF
)
},
...
...
pcie-wb/wishbone.c
View file @
32b9b353
This diff is collapsed.
Click to expand it.
vme-wb/vme_wb_external.c
View file @
32b9b353
...
...
@@ -342,7 +342,7 @@ void vme_setup_csr_fa0(void *base, u32 wb_vme, unsigned vector, unsigned level)
fa
[
0
]
=
(
wb_add
>>
24
)
&
0xFF
;
fa
[
1
]
=
(
wb_add
>>
16
)
&
0xFF
;
fa
[
2
]
=
(
wb_add
>>
8
)
&
0xFF
;
fa
[
3
]
=
(
VME_A32_USER_
MBL
T
&
0x3F
)
<<
2
;
/* or VME_A32_USER_DATA_SCT */
fa
[
3
]
=
(
VME_A32_USER_
DATA_SC
T
&
0x3F
)
<<
2
;
/* or VME_A32_USER_DATA_SCT */
vme_csr_write
(
fa
[
0
],
base
,
FUN0ADER
);
vme_csr_write
(
fa
[
1
],
base
,
FUN0ADER
+
4
);
...
...
@@ -353,7 +353,7 @@ void vme_setup_csr_fa0(void *base, u32 wb_vme, unsigned vector, unsigned level)
fa
[
0
]
=
(
wb_ctrl_add
>>
24
)
&
0xFF
;
fa
[
1
]
=
(
wb_ctrl_add
>>
16
)
&
0xFF
;
fa
[
2
]
=
(
wb_ctrl_add
>>
8
)
&
0xFF
;
fa
[
3
]
=
(
VME_A24_USER_
MBL
T
&
0x3F
)
<<
2
;
/* or VME_A24_USER_DATA_SCT */
fa
[
3
]
=
(
VME_A24_USER_
DATA_SC
T
&
0x3F
)
<<
2
;
/* or VME_A24_USER_DATA_SCT */
vme_csr_write
(
fa
[
0
],
base
,
FUN1ADER
);
vme_csr_write
(
fa
[
1
],
base
,
FUN1ADER
+
4
);
...
...
@@ -372,7 +372,7 @@ static int vme_remove(struct device *pdev, unsigned int ndev)
vme_unmap_window
(
dev
,
MAP_REG
);
vme_unmap_window
(
dev
,
MAP_CTRL
);
wishbone_unregister
(
&
dev
->
wb
);
vme_free_irq
(
vector_num
);
vme_free_irq
(
dev
->
vme_res
.
vector
);
kfree
(
dev
);
dev_info
(
pdev
,
"removed
\n
"
);
...
...
@@ -485,7 +485,7 @@ static int vme_probe(struct device *pdev, unsigned int ndev)
}
/* register interrupt handler */
if
(
vme_request_irq
(
vector_num
,
irq_handler
,
dev
,
"wb_irq"
)
!=
0
)
{
if
(
vme_request_irq
(
dev
->
vme_res
.
vector
,
irq_handler
,
dev
,
"wb_irq"
)
!=
0
)
{
printk
(
KERN_ALERT
VME_WB
": could not register interrupt handler
\n
"
);
goto
fail_irq
;
...
...
@@ -496,7 +496,7 @@ static int vme_probe(struct device *pdev, unsigned int ndev)
return
0
;
fail_irq:
{
vme_free_irq
(
vector_num
);
vme_free_irq
(
dev
->
vme_res
.
vector
);
vme_unmap_window
(
dev
,
MAP_REG
);
vme_unmap_window
(
dev
,
MAP_CR_CSR
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment