Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Simple VME FMC Carrier SVEC
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
14
Issues
14
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
Simple VME FMC Carrier SVEC
Commits
e7859e87
Commit
e7859e87
authored
Jan 05, 2021
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sw: create userspace API header file
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
1974d2cc
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
35 deletions
+54
-35
svec.h
software/include/uapi/linux/svec.h
+52
-0
Kbuild
software/kernel/Kbuild
+1
-0
svec-core-fpga.c
software/kernel/svec-core-fpga.c
+0
-8
svec.h
software/kernel/svec.h
+1
-27
No files found.
software/include/uapi/linux/svec.h
0 → 100644
View file @
e7859e87
// Copyright (C) 2020 CERN (www.cern.ch)
// SPDX-FileCopyrightText: 2020 CERN (home.cern)
//
// SPDX-License-Identifier: GPL-2.0-or-later
// Author: Federico Vaga <federico.vaga@cern.ch>
#ifndef __LINUX_UAPI_SVEC_H
#define __LINUX_UAPI_SVEC_H
#ifndef __KERNEL__
#include <stdint.h>
#endif
#define SVEC_FMC_SLOTS 2
#define SVEC_FUNC_NR 1
#define PCI_VENDOR_ID_CERN (0x10DC)
#define SVEC_META_VENDOR_ID PCI_VENDOR_ID_CERN
#define SVEC_META_DEVICE_ID 0x53564543
#define SVEC_META_BOM_BE 0xFFFE0000
#define SVEC_META_BOM_END_MASK 0xFFFF0000
#define SVEC_META_BOM_VER_MASK 0x0000FFFF
#define SVEC_META_VERSION_MASK 0xFFFF0000
#define SVEC_META_VERSION_1_4 0x01040000
#ifndef BIT
#define BIT(_b) (1 << _b)
#endif
#define SVEC_META_CAP_VIC BIT(0)
#define SVEC_META_CAP_THERM BIT(1)
#define SVEC_META_CAP_SPI BIT(2)
#define SVEC_META_CAP_WR BIT(3)
#define SVEC_META_CAP_BLD BIT(4)
/**
* struct svec_meta_id Metadata
*/
struct
svec_meta_id
{
uint32_t
vendor
;
uint32_t
device
;
uint32_t
version
;
uint32_t
bom
;
uint32_t
src
[
4
];
uint32_t
cap
;
uint32_t
uuid
[
4
];
};
#define SVEC_META_VERSION_MAJ(_v) ((_v >> 24) & 0xFF)
#define SVEC_META_VERSION_MIN(_v) ((_v >> 16) & 0xFF)
#define SVEC_META_VERSION_PATCH(_v) (_v & 0xFFFF)
#endif
/* __LINUX_UAPI_SVEC_H */
software/kernel/Kbuild
View file @
e7859e87
...
...
@@ -19,6 +19,7 @@ ccflags-$(CONFIG_FPGA_MGR_BACKPORT) += -DCONFIG_FPGA_MGR_BACKPORT
ccflags-y += -I$(FMC_ABS)/include
ccflags-y += -I$(I2C_ABS)/include
ccflags-y += -I$(SPI_ABS)/include
ccflags-y += -I$(src)/../include
# priority to I2C headers from our sources
LINUXINCLUDE := -I$(FMC_ABS)/include -I$(FMC_ABS)/include/linux -I$(I2C_ABS)/include -I$(I2C_ABS)/include/linux -I$(SPI_ABS)/include -I$(SPI_ABS)/include/linux $(LINUXINCLUDE)
...
...
software/kernel/svec-core-fpga.c
View file @
e7859e87
...
...
@@ -42,14 +42,6 @@ enum svec_fpga_therm_offsets {
SVEC_FPGA_THERM_TEMP
=
SVEC_BASE_REGS_THERM_ID
+
0x8
,
};
enum
svec_fpga_meta_cap_mask
{
SVEC_META_CAP_VIC
=
BIT
(
0
),
SVEC_META_CAP_THERM
=
BIT
(
1
),
SVEC_META_CAP_SPI
=
BIT
(
2
),
SVEC_META_CAP_WR
=
BIT
(
3
),
SVEC_META_CAP_BLD
=
BIT
(
4
),
};
static
void
svec_fpga_metadata_get
(
struct
svec_meta_id
*
meta
,
void
__iomem
*
fpga
)
{
...
...
software/kernel/svec.h
View file @
e7859e87
...
...
@@ -11,13 +11,11 @@
#include <linux/fmc.h>
#include <linux/spinlock.h>
#include <vmebus.h>
#include <uapi/linux/svec.h>
#include "svec-core-fpga.h"
#define PCI_VENDOR_ID_CERN (0x10DC)
#define SVEC_BASE_LOADER 0x70000
#define SVEC_FMC_SLOTS 2
/* On FPGA components */
#define SVEC_GOLDEN_ADDR 0x10000
...
...
@@ -60,30 +58,6 @@ enum {
SVEC_META_UUID
=
SVEC_META_BASE
+
FPGA_META_UUID
,
};
#define SVEC_META_VENDOR_ID PCI_VENDOR_ID_CERN
#define SVEC_META_DEVICE_ID 0x53564543
#define SVEC_META_BOM_BE 0xFFFE0000
#define SVEC_META_BOM_END_MASK 0xFFFF0000
#define SVEC_META_BOM_VER_MASK 0x0000FFFF
#define SVEC_META_VERSION_MASK 0xFFFF0000
#define SVEC_META_VERSION_1_4 0x01040000
/**
* struct svec_meta_id Metadata
*/
struct
svec_meta_id
{
uint32_t
vendor
;
uint32_t
device
;
uint32_t
version
;
uint32_t
bom
;
uint32_t
src
[
4
];
uint32_t
cap
;
uint32_t
uuid
[
4
];
};
#define SVEC_FUNC_NR 1
#define SVEC_FMC_SLOTS 2
struct
svec_fpga
{
struct
device
dev
;
struct
svec_meta_id
meta_app
;
...
...
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