Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
Bare Metal Firmware
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
3
Issues
3
List
Boards
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kestrel Collaboration
Kestrel Firmware
Bare Metal Firmware
Commits
1c05bf82
Commit
1c05bf82
authored
May 05, 2021
by
Raptor Engineering Development Team
Committed by
Evan Lojewski
May 06, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rework CPU regulator data structures for additional
clarity on configuration.
parent
2ea7ae62
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
8 deletions
+20
-8
main.c
main.c
+20
-8
No files found.
main.c
View file @
1c05bf82
...
...
@@ -108,7 +108,11 @@ typedef struct
uint8_t
*
i2c_master
;
uint32_t
i2c_frequency
;
uint8_t
vdd_regulator_addr
;
uint8_t
vdd_regulator_page
;
uint8_t
vcs_regulator_addr
;
uint8_t
vcs_regulator_page
;
uint8_t
vdn_regulator_addr
;
uint8_t
vdn_regulator_page
;
uint8_t
vdd_smbus_addr
;
uint8_t
vdn_smbus_addr
;
}
cpu_info_t
;
...
...
@@ -118,7 +122,11 @@ static const cpu_info_t g_cpu_info[] = {
.
i2c_master
=
(
uint8_t
*
)
I2CMASTER1_BASE
,
.
i2c_frequency
=
100000
,
.
vdd_regulator_addr
=
0x70
,
.
vdd_regulator_page
=
0x00
,
.
vcs_regulator_addr
=
0x70
,
.
vcs_regulator_page
=
0x01
,
.
vdn_regulator_addr
=
0x73
,
.
vdn_regulator_page
=
0x00
,
.
vdd_smbus_addr
=
0x28
,
.
vdn_smbus_addr
=
0x2b
,
...
...
@@ -129,7 +137,11 @@ static const cpu_info_t g_cpu_info[] = {
.
i2c_master
=
(
uint8_t
*
)
I2CMASTER2_BASE
,
.
i2c_frequency
=
100000
,
.
vdd_regulator_addr
=
0x70
,
.
vdd_regulator_page
=
0x00
,
.
vcs_regulator_addr
=
0x70
,
.
vcs_regulator_page
=
0x01
,
.
vdn_regulator_addr
=
0x73
,
.
vdn_regulator_page
=
0x00
,
.
vdd_smbus_addr
=
0x28
,
.
vdn_smbus_addr
=
0x2b
,
},
...
...
@@ -1465,7 +1477,7 @@ static int apply_avsbus_workarounds(const cpu_info_t *cpu_info, int cpu_count)
static
int
enable_avsbus_pmbus_cpu
(
const
cpu_info_t
*
cpu
)
{
printf
(
"
\t
VDD %d: Placing device in AVSBus voltage command mode
\n
"
,
cpu
->
index
);
if
(
i2c_write_register_byte
(
cpu
->
i2c_master
,
cpu
->
vdd_regulator_addr
,
0x00
,
0x00
))
if
(
i2c_write_register_byte
(
cpu
->
i2c_master
,
cpu
->
vdd_regulator_addr
,
0x00
,
cpu
->
vdd_regulator_page
))
{
return
-
1
;
}
...
...
@@ -1475,17 +1487,17 @@ static int enable_avsbus_pmbus_cpu(const cpu_info_t *cpu)
}
printf
(
"
\t
VCS %d: Placing device in AVSBus voltage command mode
\n
"
,
cpu
->
index
);
if
(
i2c_write_register_byte
(
cpu
->
i2c_master
,
cpu
->
v
dd_regulator_addr
,
0x00
,
0x01
))
if
(
i2c_write_register_byte
(
cpu
->
i2c_master
,
cpu
->
v
cs_regulator_addr
,
0x00
,
cpu
->
vcs_regulator_page
))
{
return
-
1
;
}
if
(
i2c_write_register_byte
(
cpu
->
i2c_master
,
cpu
->
v
dd
_regulator_addr
,
0x01
,
0xb0
))
if
(
i2c_write_register_byte
(
cpu
->
i2c_master
,
cpu
->
v
cs
_regulator_addr
,
0x01
,
0xb0
))
{
return
-
1
;
}
printf
(
"
\t
VDN %d: Placing device in AVSBus voltage command mode
\n
"
,
cpu
->
index
);
if
(
i2c_write_register_byte
(
cpu
->
i2c_master
,
cpu
->
vdn_regulator_addr
,
0x00
,
0x00
))
if
(
i2c_write_register_byte
(
cpu
->
i2c_master
,
cpu
->
vdn_regulator_addr
,
0x00
,
cpu
->
vdn_regulator_page
))
{
return
-
1
;
}
...
...
@@ -1516,7 +1528,7 @@ static int enable_avsbus_pmbus(const cpu_info_t *cpu_info, int cpu_count)
static
int
disable_avsbus_pmbus_cpu
(
const
cpu_info_t
*
cpu
)
{
printf
(
"
\t
VDD %d: Placing device in immediate off mode
\n
"
,
cpu
->
index
);
if
(
i2c_write_register_byte
(
cpu
->
i2c_master
,
cpu
->
vdd_regulator_addr
,
0x00
,
0x00
))
if
(
i2c_write_register_byte
(
cpu
->
i2c_master
,
cpu
->
vdd_regulator_addr
,
0x00
,
cpu
->
vdd_regulator_page
))
{
return
-
1
;
}
...
...
@@ -1526,17 +1538,17 @@ static int disable_avsbus_pmbus_cpu(const cpu_info_t *cpu)
}
printf
(
"
\t
VCS %d: Placing device in immediate off mode
\n
"
,
cpu
->
index
);
if
(
i2c_write_register_byte
(
cpu
->
i2c_master
,
cpu
->
v
dd_regulator_addr
,
0x00
,
0x01
))
if
(
i2c_write_register_byte
(
cpu
->
i2c_master
,
cpu
->
v
cs_regulator_addr
,
0x00
,
cpu
->
vcs_regulator_page
))
{
return
-
1
;
}
if
(
i2c_write_register_byte
(
cpu
->
i2c_master
,
cpu
->
v
dd
_regulator_addr
,
0x01
,
0xb0
))
if
(
i2c_write_register_byte
(
cpu
->
i2c_master
,
cpu
->
v
cs
_regulator_addr
,
0x01
,
0xb0
))
{
return
-
1
;
}
printf
(
"
\t
VDN %d: Placing device in immediate off mode
\n
"
,
cpu
->
index
);
if
(
i2c_write_register_byte
(
cpu
->
i2c_master
,
cpu
->
vdn_regulator_addr
,
0x00
,
0x00
))
if
(
i2c_write_register_byte
(
cpu
->
i2c_master
,
cpu
->
vdn_regulator_addr
,
0x00
,
cpu
->
vdn_regulator_page
))
{
return
-
1
;
}
...
...
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