Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
86
Issues
86
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
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
White Rabbit Switch - Software
Commits
3a5e9a35
Commit
3a5e9a35
authored
Mar 01, 2016
by
Grzegorz Daniluk
Committed by
Adam Wujek
Mar 02, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libwr: cleanup in log messages - logs and content
parent
804afb15
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
25 additions
and
27 deletions
+25
-27
fan.c
userspace/libwr/fan.c
+7
-8
fpga_io.c
userspace/libwr/fpga_io.c
+2
-2
i2c.c
userspace/libwr/i2c.c
+1
-1
i2c_bitbang.c
userspace/libwr/i2c_bitbang.c
+1
-1
i2c_io.c
userspace/libwr/i2c_io.c
+4
-6
i2c_sfp.c
userspace/libwr/i2c_sfp.c
+2
-1
init.c
userspace/libwr/init.c
+2
-2
pio.c
userspace/libwr/pio.c
+2
-2
shw_io.c
userspace/libwr/shw_io.c
+4
-4
No files found.
userspace/libwr/fan.c
View file @
3a5e9a35
...
...
@@ -200,8 +200,7 @@ static float tmp100_read_temp(int dev_addr)
static
int
shw_init_i2c_sensors
(
void
)
{
if
(
i2c_init_bus
(
&
fpga_sensors_i2c
)
<
0
)
{
pr_error
(
"can't initialize temperature sensors I2C bus.
\n
"
);
pr_error
(
"Can't initialize temperature sensors I2C bus.
\n
"
);
return
-
1
;
}
return
0
;
...
...
@@ -266,7 +265,7 @@ int shw_init_fans(void)
config_item
=
libwr_cfg_get
(
"FAN_HYSTERESIS"
);
if
((
config_item
)
&&
!
strcmp
(
config_item
,
"y"
))
{
fan_hysteresis
=
1
;
pr_info
(
"
enable
fan hysteresis
\n
"
);
pr_info
(
"
Enabling
fan hysteresis
\n
"
);
config_item
=
libwr_cfg_get
(
"FAN_HYSTERESIS_T_ENABLE"
);
if
(
config_item
)
{
fan_hysteresis_t_enable
=
atoi
(
config_item
);
...
...
@@ -290,11 +289,11 @@ int shw_init_fans(void)
fan_hysteresis_pwm_val
=
4
;
}
pr_info
(
"
set temp enable to %d for fan hysteresis
\n
"
,
fan_hysteresis_t_enable
);
pr_info
(
"
set temp disable to %d for fan hysteresis
\n
"
,
fan_hysteresis_t_disable
);
pr_info
(
"
set
pwm value to %d for fan hysteresis
\n
"
,
pr_info
(
"
Setting upper temperature threshold to %d for fan "
"hysteresis
\n
"
,
fan_hysteresis_t_enable
);
pr_info
(
"
Setting lower temperature threshold to %d for fan "
"hysteresis
\n
"
,
fan_hysteresis_t_disable
);
pr_info
(
"
Setting
pwm value to %d for fan hysteresis
\n
"
,
fan_hysteresis_pwm_val
);
}
...
...
userspace/libwr/fpga_io.c
View file @
3a5e9a35
...
...
@@ -25,7 +25,7 @@ int shw_fpga_mmap_init()
{
int
fd
;
pr_
info
(
"Initializing FPGA memory mapping.
\n
"
);
pr_
debug
(
"Initializing FPGA memory mapping.
\n
"
);
fd
=
open
(
"/dev/mem"
,
O_RDWR
|
O_SYNC
);
if
(
fd
<
0
)
{
...
...
@@ -42,7 +42,7 @@ int shw_fpga_mmap_init()
return
-
1
;
}
pr_
info
(
"FPGA virtual base = %p
\n
"
,
_fpga_base_virt
);
pr_
debug
(
"FPGA virtual base = %p
\n
"
,
_fpga_base_virt
);
return
0
;
...
...
userspace/libwr/i2c.c
View file @
3a5e9a35
...
...
@@ -70,6 +70,6 @@ int32_t i2c_scan(struct i2c_bus * bus, uint8_t * data)
found
++
;
}
}
pr_
info
(
"%s (%p): ndev=%d
\n
"
,
bus
->
name
,
bus
,
found
);
pr_
debug
(
"%s (%p): ndev=%d
\n
"
,
bus
->
name
,
bus
,
found
);
return
found
;
}
userspace/libwr/i2c_bitbang.c
View file @
3a5e9a35
...
...
@@ -24,7 +24,7 @@ int i2c_bitbang_init_bus(struct i2c_bus *bus)
priv
=
(
struct
i2c_bitbang
*
)
bus
->
type_specific
;
pr_
info
(
"init: %s (%p)
\n
"
,
bus
->
name
,
bus
);
pr_
debug
(
"init: %s (%p)
\n
"
,
bus
->
name
,
bus
);
shw_pio_configure
(
priv
->
scl
);
shw_pio_configure
(
priv
->
sda
);
shw_pio_setdir
(
priv
->
scl
,
0
);
...
...
userspace/libwr/i2c_io.c
View file @
3a5e9a35
...
...
@@ -68,13 +68,12 @@ struct i2c_bus i2c_io_bus = {
int
shw_i2c_io_init
(
void
)
{
pr_info
(
"Initializing IO I2C bus...%s
\n
"
,
__TIME__
);
if
(
i2c_init_bus
(
&
i2c_io_bus
)
<
0
)
{
pr_error
(
"
init failed:
%s
\n
"
,
i2c_io_bus
.
name
);
pr_error
(
"
I2C I/O init failed for bus
%s
\n
"
,
i2c_io_bus
.
name
);
return
-
1
;
}
pr_info
(
"
init: success:
%s
\n
"
,
i2c_io_bus
.
name
);
pr_info
(
"
I2C I/O init success for bus
%s
\n
"
,
i2c_io_bus
.
name
);
return
0
;
}
...
...
@@ -112,9 +111,8 @@ int shw_get_hw_ver(void)
case
2
:
return
341
;
default:
pr_error
(
"Unknown HW version (0x%x), check the DIP switch under the SCB
\n
"
,
(
ret
>>
1
)
&
0x7
);
pr_error
(
"Unknown HW version (0x%x), check the DIP "
"switch under the SCB
\n
"
,
(
ret
>>
1
)
&
0x7
);
return
-
1
;
}
...
...
userspace/libwr/i2c_sfp.c
View file @
3a5e9a35
...
...
@@ -194,7 +194,8 @@ int shw_sfp_buses_init(void)
pr_info
(
"Initializing SFP I2C busses...
\n
"
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
i2c_buses
);
i
++
)
{
if
(
i2c_init_bus
(
&
i2c_buses
[
i
])
<
0
)
{
pr_error
(
"init failed: %s
\n
"
,
i2c_buses
[
i
].
name
);
pr_error
(
"I2C SFP init failed for bus %s
\n
"
,
i2c_buses
[
i
].
name
);
return
-
1
;
}
// printf("init: success: %s\n", i2c_buses[i].name);
...
...
userspace/libwr/init.c
View file @
3a5e9a35
...
...
@@ -10,7 +10,7 @@
int
shw_init
()
{
pr_
info
(
"%s
\n
======================================================
\n
"
,
pr_
debug
(
"%s
\n
======================================================
\n
"
,
__TIME__
);
/* Init input/output (GPIO & CPU I2C) */
...
...
@@ -37,6 +37,6 @@ int shw_init()
int
shw_exit_fatal
(
void
)
{
pr_error
(
"
e
xiting due to fatal error.
\n
"
);
pr_error
(
"
E
xiting due to fatal error.
\n
"
);
exit
(
-
1
);
}
userspace/libwr/pio.c
View file @
3a5e9a35
...
...
@@ -48,12 +48,12 @@ int shw_pio_mmap_init()
AT91C_BASE_SYS_RAW
);
if
(
_sys_base
==
NULL
)
{
pr_error
(
"Can't mmap CPU GPIO regs
\n
"
);
pr_error
(
"Can't mmap CPU GPIO reg
ister
s
\n
"
);
close
(
fd
);
exit
(
-
1
);
}
pr_
info
(
"AT91_SYS virtual base = %p
\n
"
,
_sys_base
);
pr_
debug
(
"AT91_SYS virtual base = %p
\n
"
,
_sys_base
);
pmc_enable_clock
(
2
);
/* enable PIO clocks */
pmc_enable_clock
(
3
);
...
...
userspace/libwr/shw_io.c
View file @
3a5e9a35
...
...
@@ -112,7 +112,7 @@ int shw_io_init()
I2C_shw_io_led_state_o
);
}
pr_info
(
"
version=
%d (CPUPWN=%d)
\n
"
,
ver
,
ver
<
330
);
pr_info
(
"
Hardware version is
%d (CPUPWN=%d)
\n
"
,
ver
,
ver
<
330
);
return
0
;
}
...
...
@@ -140,7 +140,7 @@ int shw_io_configure_all()
//Do nothing for undefined type
break
;
default:
pr_
info
(
pr_
debug
(
"Config not implemented for type %d for io #%d
\n
"
,
io
->
type
,
i
);
break
;
...
...
@@ -192,7 +192,7 @@ uint32_t shw_io_read(shw_io_id_t id)
shift
);
}
case
SHW_UNDEF
:
pr_error
(
"IO #%d is undef
\n
"
,
id
);
pr_error
(
"IO #%d is undef
ined
\n
"
,
id
);
break
;
default:
pr_error
(
"Unknow type %d for io #%d
\n
"
,
...
...
@@ -232,7 +232,7 @@ int shw_io_write(shw_io_id_t id, uint32_t value)
i32data
);
}
case
SHW_UNDEF
:
pr_error
(
"Pin #%d is undef
\n
"
,
id
);
pr_error
(
"Pin #%d is undef
ined
\n
"
,
id
);
break
;
default:
pr_error
(
"Unknow type %d for io #%d
\n
"
,
...
...
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