Skip to content

Commit 088fa7a

Browse files
davidschrammelrswarbrick
authored andcommitted
[racl,racl_ctrl,doc] Allow description for RACL policies
Signed-off-by: David Schrammel <[email protected]>
1 parent c90ab5d commit 088fa7a

File tree

7 files changed

+23
-18
lines changed

7 files changed

+23
-18
lines changed

hw/ip_templates/racl_ctrl/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,19 @@ racl_mappings: {
3535
}
3636
policies: {
3737
Null: [
38-
// Standard policies allowing all roles to access a register
3938
{ name: "ALL_RD_WR"
39+
desc: "Standard policies allowing all roles to access a register"
4040
allowed_rd: [ "ROT", "ROLE1", "SOC" ]
4141
allowed_wr: [ "ROT", "ROLE1", "SOC" ]
4242
}
43-
// Standard policies allowing only the ROT role to access a register
4443
{ name: "ROT_PRIVATE"
44+
desc: "Standard policies allowing only the ROT role to access a register"
4545
rot_private: true
4646
allowed_rd: [ "ROT" ]
4747
allowed_wr: [ "ROT" ]
4848
}
49-
// Custom policy
5049
{ name: "SOC_ROT"
50+
desc: "Custom policy"
5151
allowed_rd: [ "ROT", "SOC" ]
5252
allowed_wr: [ "ROT", "SOC" ]
5353
}

hw/top_darjeeling/data/autogen/top_darjeeling.gen.hjson

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17370,6 +17370,7 @@
1737017370
[
1737117371
{
1737217372
name: ALL_RD_WR
17373+
desc: Standard policies allowing all roles to access a register
1737317374
allowed_rd:
1737417375
[
1737517376
ROT
@@ -17388,6 +17389,7 @@
1738817389
{
1738917390
name: ROT_PRIVATE
1739017391
rot_private: true
17392+
desc: Standard policies allowing only the ROT role to access a register
1739117393
allowed_rd:
1739217394
[
1739317395
ROT
@@ -17401,6 +17403,7 @@
1740117403
}
1740217404
{
1740317405
name: SOC_ROT
17406+
desc: Custom policy
1740417407
allowed_rd:
1740517408
[
1740617409
ROT

hw/top_darjeeling/data/racl/racl.hjson

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@
1818
}
1919
policies: {
2020
Null: [
21-
// Standard policies allowing all roles to access a register
2221
{ name: "ALL_RD_WR"
22+
desc: "Standard policies allowing all roles to access a register"
2323
allowed_rd: [ "ROT", "ROLE1", "SOC" ]
2424
allowed_wr: [ "ROT", "ROLE1", "SOC" ]
2525
}
26-
// Standard policies allowing only the ROT role to access a register
2726
{ name: "ROT_PRIVATE"
2827
rot_private: true
28+
desc: "Standard policies allowing only the ROT role to access a register"
2929
allowed_rd: [ "ROT" ]
3030
allowed_wr: [ "ROT" ]
3131
}
32-
// Custom policy
3332
{ name: "SOC_ROT"
33+
desc: "Custom policy"
3434
allowed_rd: [ "ROT", "SOC" ]
3535
allowed_wr: [ "ROT", "SOC" ]
3636
}

hw/top_darjeeling/ip_autogen/racl_ctrl/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,19 @@ racl_mappings: {
3535
}
3636
policies: {
3737
Null: [
38-
// Standard policies allowing all roles to access a register
3938
{ name: "ALL_RD_WR"
39+
desc: "Standard policies allowing all roles to access a register"
4040
allowed_rd: [ "ROT", "ROLE1", "SOC" ]
4141
allowed_wr: [ "ROT", "ROLE1", "SOC" ]
4242
}
43-
// Standard policies allowing only the ROT role to access a register
4443
{ name: "ROT_PRIVATE"
44+
desc: "Standard policies allowing only the ROT role to access a register"
4545
rot_private: true
4646
allowed_rd: [ "ROT" ]
4747
allowed_wr: [ "ROT" ]
4848
}
49-
// Custom policy
5049
{ name: "SOC_ROT"
50+
desc: "Custom policy"
5151
allowed_rd: [ "ROT", "SOC" ]
5252
allowed_wr: [ "ROT", "SOC" ]
5353
}

hw/top_darjeeling/ip_autogen/racl_ctrl/data/top_darjeeling_racl_ctrl.ipconfig.hjson

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
[
1515
{
1616
name: ALL_RD_WR
17+
desc: Standard policies allowing all roles to access a register
1718
allowed_rd:
1819
[
1920
ROT
@@ -32,6 +33,7 @@
3233
{
3334
name: ROT_PRIVATE
3435
rot_private: true
36+
desc: Standard policies allowing only the ROT role to access a register
3537
allowed_rd:
3638
[
3739
ROT
@@ -45,6 +47,7 @@
4547
}
4648
{
4749
name: SOC_ROT
50+
desc: Custom policy
4851
allowed_rd:
4952
[
5053
ROT

hw/top_darjeeling/ip_autogen/racl_ctrl/doc/racl_configuration.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55

66
### RACL group: Null
77

8-
| Policy Name | Index |
9-
|:--------------|--------:|
10-
| ALL_RD_WR | 0 |
11-
| ROT_PRIVATE | 1 |
12-
| SOC_ROT | 2 |
8+
| Policy Name | Index | Description |
9+
|:--------------|--------:|:------------------------------------------------------------------|
10+
| ALL_RD_WR | 0 | Standard policies allowing all roles to access a register |
11+
| ROT_PRIVATE | 1 | Standard policies allowing only the ROT role to access a register |
12+
| SOC_ROT | 2 | Custom policy |
1313

1414

1515
## RACL configuration

util/raclgen/lib.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,14 +270,13 @@ def gen_md_header(racl_config: Dict[str, object], output: TextIO = sys.stdout):
270270
output.write(title('RACL groups', 2))
271271
output.write('\n')
272272

273-
header = ['Policy Name', 'Index']
273+
header = ['Policy Name', 'Index', 'Description']
274274

275275
for racl_group in racl_config['policies']:
276276
policies_for_racl_group = racl_config['policies'][racl_group]
277-
policy_names = [policy['name'] for policy in policies_for_racl_group]
278277
rows: List[List[str]] = []
279-
for policy_idx, policy_name in enumerate(policy_names):
280-
rows.append([policy_name, str(policy_idx)])
278+
for policy_idx, policy in enumerate(policies_for_racl_group):
279+
rows.append([policy['name'], str(policy_idx), policy.get('desc', '')])
281280

282281
output.write(title(f'RACL group: {racl_group}', 3))
283282
output.write(table(header, rows))

0 commit comments

Comments
 (0)