Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
DIOT Zynq Ultrascale-based System Board
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
8
Issues
8
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Projects
DIOT Zynq Ultrascale-based System Board
Commits
e6e095b3
Commit
e6e095b3
authored
Jun 28, 2022
by
Adam Wujek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sw/petalinux/diot-util: use magic values for reset and fw mode switch of monimod
Signed-off-by:
Adam Wujek
<
dev_public@wujek.eu
>
parent
66de1d15
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
diot_util_fantray.c
...eta-user/recipes-apps/diot-util/files/diot_util_fantray.c
+7
-3
No files found.
sw/petalinux/project-spec/meta-user/recipes-apps/diot-util/files/diot_util_fantray.c
View file @
e6e095b3
...
...
@@ -28,6 +28,8 @@
#include "util.h"
#define FANTRAY_FW_MAX_SIZE 0x3E000
#define UC_RESET_MAGIC 0x5A
#define BOOT_NEW_FW_MAGIC 0xAD
static
int
cmd_fantray_status
(
char
*
params
);
static
int
cmd_fantray_reset
(
char
*
params
);
...
...
@@ -124,7 +126,8 @@ static int fantray_i2c_reset(void)
goto
out
;
}
ret
=
i2c_smbus_write_byte_data
(
i2c_file
,
FANTRAY_I2C_REG_RESET
,
1
);
ret
=
i2c_smbus_write_byte_data
(
i2c_file
,
FANTRAY_I2C_REG_RESET
,
UC_RESET_MAGIC
);
out:
close
(
i2c_file
);
...
...
@@ -583,7 +586,7 @@ static int cmd_fantray_load_fw(char *params)
/* Switch to boot loader */
ret
=
i2c_smbus_write_byte_data
(
i2c_file
,
FANTRAY_I2C_REG_BOOT_NEW_FW
,
1
);
BOOT_NEW_FW_MAGIC
);
if
(
ret
<
0
)
{
printf
(
"Error: unable to set boot mode of the Fantray!
\n
"
);
goto
close_i2c
;
...
...
@@ -616,7 +619,8 @@ static int cmd_fantray_load_fw(char *params)
printf
(
"Switching Fantray to main firmware mode
\n
"
);
/* Switch to main firmware */
ret
=
i2c_smbus_write_byte_data
(
i2c_file
,
FANTRAY_I2C_REG_BOOT_NEW_FW
,
1
);
ret
=
i2c_smbus_write_byte_data
(
i2c_file
,
FANTRAY_I2C_REG_BOOT_NEW_FW
,
BOOT_NEW_FW_MAGIC
);
if
(
ret
<
0
)
{
printf
(
"Error: unable to set the boot mode of the Fantray!
\n
"
);
goto
close_i2c
;
...
...
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