Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
Production Test Suite - base
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
1
Merge Requests
1
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
Production Test Suite - base
Commits
2f668901
Commit
2f668901
authored
Aug 09, 2019
by
Dimitris Lampridis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update sources to work with recent Linux kernels, libc, etc
parent
0914937e
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
40 additions
and
53 deletions
+40
-53
ipmi.c
common/fmceeprom/libipmi/ipmi.c
+23
-29
.gitignore
gnurabbit/.gitignore
+1
-0
loader.c
gnurabbit/kernel/loader.c
+2
-2
rawrabbit-core.c
gnurabbit/kernel/rawrabbit-core.c
+3
-2
Makefile
gnurabbit/python/Makefile
+1
-1
rr_loader_lib.c
gnurabbit/python/rr_loader_lib.c
+0
-2
Makefile
gnurabbit/user/Makefile
+1
-1
fpga_loader.c
gnurabbit/user/fpga_loader.c
+0
-1
gpio.c
gnurabbit/user/gpio.c
+5
-7
rr_io.c
gnurabbit/user/rr_io.c
+3
-7
rrcmd.c
gnurabbit/user/rrcmd.c
+1
-1
No files found.
common/fmceeprom/libipmi/ipmi.c
View file @
2f668901
...
...
@@ -63,13 +63,11 @@ int internal_use_area_get_size(void)
int
ipmi_common_header_write
(
void
)
{
int
ret
;
if
(
!
ch
||
!
f
)
return
-
1
;
ch
->
checksum
=
checksum
((
uint8_t
*
)
ch
,
sizeof
(
struct
common_header
)
-
1
);
ret
=
fwrite
(
ch
,
1
,
sizeof
(
struct
common_header
),
f
);
fwrite
(
ch
,
1
,
sizeof
(
struct
common_header
),
f
);
return
0
;
}
...
...
@@ -114,7 +112,6 @@ int ipmi_board_info_area_write(void)
{
int
i
;
int
len
;
int
ret
;
uint8_t
pad
=
0
;
uint8_t
checksum
;
...
...
@@ -122,30 +119,30 @@ int ipmi_board_info_area_write(void)
return
-
1
;
/* Write upto the mfgr_data */
ret
=
fwrite
(
bia
,
6
,
1
,
f
);
fwrite
(
bia
,
6
,
1
,
f
);
len
=
bia
->
mfgr_typelen
&
0x3f
;
ret
=
fwrite
(
&
bia
->
mfgr_typelen
,
1
,
sizeof
(
uint8_t
),
f
);
ret
=
fwrite
(
bia
->
mfgr_data
,
len
,
1
,
f
);
fwrite
(
&
bia
->
mfgr_typelen
,
1
,
sizeof
(
uint8_t
),
f
);
fwrite
(
bia
->
mfgr_data
,
len
,
1
,
f
);
len
=
bia
->
product_typelen
&
0x3f
;
ret
=
fwrite
(
&
bia
->
product_typelen
,
1
,
sizeof
(
uint8_t
),
f
);
ret
=
fwrite
(
bia
->
product_data
,
len
,
1
,
f
);
fwrite
(
&
bia
->
product_typelen
,
1
,
sizeof
(
uint8_t
),
f
);
fwrite
(
bia
->
product_data
,
len
,
1
,
f
);
len
=
bia
->
serial_typelen
&
0x3f
;
ret
=
fwrite
(
&
bia
->
serial_typelen
,
1
,
sizeof
(
uint8_t
),
f
);
ret
=
fwrite
(
bia
->
serial_data
,
len
,
1
,
f
);
fwrite
(
&
bia
->
serial_typelen
,
1
,
sizeof
(
uint8_t
),
f
);
fwrite
(
bia
->
serial_data
,
len
,
1
,
f
);
len
=
bia
->
partnum_typelen
&
0x3f
;
ret
=
fwrite
(
&
bia
->
partnum_typelen
,
1
,
sizeof
(
uint8_t
),
f
);
ret
=
fwrite
(
bia
->
partnum_data
,
len
,
1
,
f
);
fwrite
(
&
bia
->
partnum_typelen
,
1
,
sizeof
(
uint8_t
),
f
);
fwrite
(
bia
->
partnum_data
,
len
,
1
,
f
);
len
=
bia
->
fru_fid_typelen
&
0x3f
;
ret
=
fwrite
(
&
bia
->
fru_fid_typelen
,
1
,
sizeof
(
uint8_t
),
f
);
ret
=
fwrite
(
bia
->
fru_fid_data
,
len
,
1
,
f
);
fwrite
(
&
bia
->
fru_fid_typelen
,
1
,
sizeof
(
uint8_t
),
f
);
fwrite
(
bia
->
fru_fid_data
,
len
,
1
,
f
);
bia
->
typelen_end
=
0xc1
;
ret
=
fwrite
(
&
bia
->
typelen_end
,
1
,
sizeof
(
uint8_t
),
f
);
fwrite
(
&
bia
->
typelen_end
,
1
,
sizeof
(
uint8_t
),
f
);
/* calculate checksum here */
checksum
=
0
;
...
...
@@ -185,15 +182,14 @@ int ipmi_board_info_area_write(void)
uint8_t
nul
=
0
;
board_info_area_get_size
(
&
pad
);
for
(
i
=
0
;
i
<
pad
;
i
++
)
ret
=
fwrite
(
&
nul
,
1
,
sizeof
(
uint8_t
),
f
);
ret
=
fwrite
(
&
bia
->
checksum
,
1
,
sizeof
(
uint8_t
),
f
);
fwrite
(
&
nul
,
1
,
sizeof
(
uint8_t
),
f
);
fwrite
(
&
bia
->
checksum
,
1
,
sizeof
(
uint8_t
),
f
);
return
0
;
}
int
ipmi_dc_load_record_write
(
int
end
)
{
int
ret
;
struct
dc_load_list
*
t
;
if
(
!
dcll
||
!
f
)
...
...
@@ -212,9 +208,9 @@ int ipmi_dc_load_record_write(int end)
head
.
header_checksum
=
checksum
((
uint8_t
*
)
&
head
,
sizeof
(
struct
multirecord_header
)
-
1
);
ret
=
fwrite
(
&
head
,
1
,
sizeof
(
struct
multirecord_header
),
f
);
ret
=
fwrite
(
&
t
->
rec
->
voltage_required
,
1
,
1
,
f
);
ret
=
fwrite
(
&
t
->
rec
->
nominal_voltage
,
1
,
12
,
f
);
fwrite
(
&
head
,
1
,
sizeof
(
struct
multirecord_header
),
f
);
fwrite
(
&
t
->
rec
->
voltage_required
,
1
,
1
,
f
);
fwrite
(
&
t
->
rec
->
nominal_voltage
,
1
,
12
,
f
);
t
=
t
->
next
;
}
...
...
@@ -223,7 +219,6 @@ int ipmi_dc_load_record_write(int end)
int
ipmi_dc_output_record_write
(
int
end
)
{
int
ret
;
struct
dc_output_list
*
t
;
if
(
!
dcol
||
!
f
)
...
...
@@ -242,9 +237,9 @@ int ipmi_dc_output_record_write(int end)
head
.
header_checksum
=
checksum
((
uint8_t
*
)
&
head
,
sizeof
(
struct
multirecord_header
)
-
1
);
ret
=
fwrite
(
&
head
,
1
,
sizeof
(
struct
multirecord_header
),
f
);
ret
=
fwrite
(
&
t
->
rec
->
output_info
,
1
,
1
,
f
);
ret
=
fwrite
(
&
t
->
rec
->
nominal_voltage
,
1
,
12
,
f
);
fwrite
(
&
head
,
1
,
sizeof
(
struct
multirecord_header
),
f
);
fwrite
(
&
t
->
rec
->
output_info
,
1
,
1
,
f
);
fwrite
(
&
t
->
rec
->
nominal_voltage
,
1
,
12
,
f
);
t
=
t
->
next
;
}
...
...
@@ -253,7 +248,6 @@ int ipmi_dc_output_record_write(int end)
int
ipmi_oem_record_write
(
int
end
)
{
int
ret
;
struct
multirecord_header
head
;
if
(
!
oem
||
!
f
)
...
...
@@ -274,8 +268,8 @@ int ipmi_oem_record_write(int end)
head
.
header_checksum
=
checksum
((
uint8_t
*
)
&
head
,
sizeof
(
struct
multirecord_header
)
-
1
);
ret
=
fwrite
(
&
head
,
1
,
sizeof
(
struct
multirecord_header
),
f
);
ret
=
fwrite
(
oem
,
1
,
sizeof
(
struct
oem_record
),
f
);
fwrite
(
&
head
,
1
,
sizeof
(
struct
multirecord_header
),
f
);
fwrite
(
oem
,
1
,
sizeof
(
struct
oem_record
),
f
);
return
0
;
}
...
...
gnurabbit/.gitignore
View file @
2f668901
*.o
*~
*.o.d
gnurabbit/kernel/loader.c
View file @
2f668901
...
...
@@ -144,7 +144,7 @@ static void rr_loader_complete(const struct firmware *fw, void *context)
__rr_report_env
(
__func__
);
/* Here, preempt count is 0: good! */
if
(
fw
)
{
pr_info
(
"%s: %p: size %
i (0x%
x), data %p
\n
"
,
__func__
,
fw
,
pr_info
(
"%s: %p: size %
li (0x%l
x), data %p
\n
"
,
__func__
,
fw
,
fw
?
fw
->
size
:
0
,
fw
?
fw
->
size
:
0
,
fw
?
fw
->
data
:
0
);
}
else
{
...
...
@@ -231,7 +231,7 @@ static int __rr_gennum_load(struct rr_dev *dev, const void *data, int size8)
unsigned
long
j
;
void
__iomem
*
bar4
=
dev
->
remap
[
2
];
/* remap == bar0, bar2, bar4 */
printk
(
"programming with bar4 @ %x, vaddr %p
\n
"
,
printk
(
"programming with bar4 @ %
ll
x, vaddr %p
\n
"
,
dev
->
area
[
2
]
->
start
,
bar4
);
/* Ok, now call register access, which lived elsewhere */
...
...
gnurabbit/kernel/rawrabbit-core.c
View file @
2f668901
...
...
@@ -24,7 +24,8 @@
#include <linux/vmalloc.h>
#include <linux/mm.h>
#include <linux/mutex.h>
#include <asm/uaccess.h>
#include <linux/uaccess.h>
#include <linux/sched/signal.h>
#include "rawrabbit.h"
#include "compat.h"
...
...
@@ -806,7 +807,7 @@ static int rr_init(void)
struct
rr_dev
*
dev
=
&
rr_dev
;
/* always use dev as pointer */
if
(
rr_bufsize
>
RR_MAX_BUFSIZE
)
{
printk
(
KERN_WARNING
"rawrabbit: too big a size, using 0x%x
\n
"
,
printk
(
KERN_WARNING
"rawrabbit: too big a size, using 0x%
l
x
\n
"
,
RR_MAX_BUFSIZE
);
rr_bufsize
=
RR_MAX_BUFSIZE
;
}
...
...
gnurabbit/python/Makefile
View file @
2f668901
CFLAGS
=
-Wall
-ggdb
-I
../kernel
CFLAGS
=
-Wall
-ggdb
-I
../kernel
-fPIC
AS
=
$(CROSS_COMPILE)
as
LD
=
$(CROSS_COMPILE)
ld
...
...
gnurabbit/python/rr_loader_lib.c
View file @
2f668901
...
...
@@ -430,7 +430,6 @@ static int __do_load_mcs_to_flash(const uint8_t *data, uint32_t size)
int
limit
=
0
;
int
num_pages
=
0
;
unsigned
int
addr
=
0
;
int
not_done
;
bulk_erase
();
...
...
@@ -464,7 +463,6 @@ static int __do_load_mcs_to_flash(const uint8_t *data, uint32_t size)
gpio_set1
(
GPIO_OUTPUT_VALUE
,
GPIO_FLASH_CS
);
addr
+=
256
;
not_done
=
1
;
//usleep(SPI_DELAY);
wait_completion
();
...
...
gnurabbit/user/Makefile
View file @
2f668901
CFLAGS
=
-Wall
-ggdb
-I
../kernel
CFLAGS
=
-Wall
-ggdb
-I
../kernel
-fPIC
AS
=
$(CROSS_COMPILE)
as
LD
=
$(CROSS_COMPILE)
ld
...
...
gnurabbit/user/fpga_loader.c
View file @
2f668901
...
...
@@ -9,7 +9,6 @@
int
main
(
int
argc
,
char
*
argv
[])
{
uint32_t
i
=
0
;
if
(
argc
!=
2
){
printf
(
"usage: %s filename
\n
"
,
argv
[
0
]);
...
...
gnurabbit/user/gpio.c
View file @
2f668901
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/time.h>
#include "rr_io.h"
...
...
@@ -192,8 +193,6 @@ static void wait_completion()
static
void
bulk_erase
()
{
int
not_done
;
//printf("Erasing flash memory.....");
gpio_bootselect
(
GENNUM_FLASH
);
...
...
@@ -218,7 +217,6 @@ static int __do_load_mcs_to_flash(const uint8_t *data, uint32_t size)
int
limit
=
0
;
int
num_pages
=
0
;
unsigned
int
addr
=
0
;
int
not_done
,
tmp
;
bulk_erase
();
...
...
@@ -252,7 +250,6 @@ static int __do_load_mcs_to_flash(const uint8_t *data, uint32_t size)
gpio_set1
(
GPIO_OUTPUT_VALUE
,
GPIO_FLASH_CS
);
addr
+=
256
;
not_done
=
1
;
// usleep(SPI_DELAY);
wait_completion
();
...
...
@@ -299,8 +296,6 @@ int readback_flash(char *filename, uint32_t size, uint32_t addr)
data
=
malloc
(
size
);
if
(
!
f
)
return
-
1
;
gpio_bootselect
(
GENNUM_FLASH
);
gpio_set0
(
GPIO_OUTPUT_VALUE
,
GPIO_FLASH_CS
);
...
...
@@ -317,6 +312,8 @@ int readback_flash(char *filename, uint32_t size, uint32_t addr)
gpio_set1
(
GPIO_OUTPUT_VALUE
,
GPIO_FLASH_CS
);
f
=
fopen
(
filename
,
"wb"
);
if
(
!
f
)
return
-
1
;
fwrite
(
data
,
1
,
size
,
f
);
fclose
(
f
);
...
...
@@ -330,5 +327,6 @@ int force_load_fpga_from_flash ()
gpio_bootselect
(
FPGA_FLASH
);
gennum_writel
(
0
,
SPRI_CONFIG
);
usleep
(
100
);
gennum_writel
(
1
,
SPRI_CONFIG
);
gennum_writel
(
1
,
SPRI_CONFIG
);
return
0
;
}
gnurabbit/user/rr_io.c
View file @
2f668901
...
...
@@ -20,10 +20,6 @@ static int fd;
int
rr_init
()
{
struct
rr_devsel
devsel
;
int
ret
=
-
EINVAL
;
fd
=
open
(
DEVNAME
,
O_RDWR
);
if
(
fd
<
0
)
{
return
-
1
;
...
...
@@ -40,6 +36,7 @@ int rr_writel(uint32_t data, uint32_t addr)
iocmd
.
address
|=
__RR_SET_BAR
(
0
);
iocmd
.
data32
=
data
;
ioctl
(
fd
,
RR_WRITE
,
&
iocmd
);
return
0
;
}
uint32_t
rr_readl
(
uint32_t
addr
)
...
...
@@ -83,7 +80,6 @@ static inline int64_t get_tics()
int
rr_load_bitstream
(
const
void
*
data
,
int
size8
)
{
int
i
,
ctrl
,
done
=
0
,
wrote
=
0
;
unsigned
long
j
;
uint8_t
val8
;
const
uint8_t
*
data8
=
data
;
const
uint32_t
*
data32
=
data
;
...
...
@@ -118,7 +114,7 @@ int rr_load_bitstream(const void *data, int size8)
i
=
gennum_readl
(
FCL_CTRL
);
if
(
i
!=
0x40
)
{
fprintf
(
stderr
,
"%s: %i: error
\n
"
,
__func__
,
__LINE__
);
return
;
return
-
1
;
}
gennum_writel
(
0x00
,
FCL_CTRL
);
...
...
@@ -195,7 +191,7 @@ int rr_load_bitstream(const void *data, int size8)
if
(
get_tics
()
-
tstart
>
1000000LL
)
{
fprintf
(
stderr
,
"Loader: DONE timeout. Did you choose proper bitgen options?
\n
"
);
return
;
return
-
1
;
}
/*if (time_after(jiffies, j)) {
printk("%s: %i: tout after %i\n", __func__, __LINE__,
...
...
gnurabbit/user/rrcmd.c
View file @
2f668901
...
...
@@ -182,7 +182,7 @@ int do_getplist(int fd)
return
-
errno
;
for
(
i
=
0
;
i
<
size
/
RR_PLIST_SIZE
;
i
++
)
printf
(
"buf 0x%08x: pfn 0x%08x, addr 0x%012llx
\n
"
,
printf
(
"buf 0x%08x: pfn 0x%08
l
x, addr 0x%012llx
\n
"
,
i
*
RR_PLIST_SIZE
,
plist
[
i
],
(
unsigned
long
long
)
plist
[
i
]
<<
12
);
return
0
;
...
...
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