Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
seL4
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Panda
seL4
Commits
b45de785
Commit
b45de785
authored
6 years ago
by
Simon Shields
Browse files
Options
Downloads
Patches
Plain Diff
hardware_gen: use "ranges" property for cpu-addressable buses
This removes the need for the buses array in the hardware YAML
parent
2193ee4e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tools/hardware.yml
+0
-3
0 additions, 3 deletions
tools/hardware.yml
tools/hardware_gen.py
+21
-5
21 additions, 5 deletions
tools/hardware_gen.py
tools/hardware_schema.yml
+0
-6
0 additions, 6 deletions
tools/hardware_schema.yml
with
21 additions
and
14 deletions
tools/hardware.yml
+
0
−
3
View file @
b45de785
...
...
@@ -11,9 +11,6 @@
#
# Documentation for bindings is relative to Documentation/devicetree/bindings in Linux,
# unless otherwise noted.
buses
:
-
simple-bus
-
qcom,gsbi-v1.0.0
devices
:
# ARM GIC (interrupt-controller/arm,gic.txt)
-
compatible
:
...
...
This diff is collapsed.
Click to expand it.
tools/hardware_gen.py
+
21
−
5
View file @
b45de785
...
...
@@ -344,7 +344,13 @@ class Device:
# will stay within one "ranges" entry.
data
=
list
(
self
.
props
[
'
ranges
'
].
words
)
while
len
(
data
)
>
0
:
cbase
=
make_number
(
child_addr_cells
,
data
)
# for PCI, skip the high cell (per of_bus_pci_map in linux/drivers/of/address.c).
if
'
device_type
'
in
self
and
self
[
'
device_type
'
].
strings
[
0
]
==
'
pci
'
:
addr
&=
(
1
<<
(
4
*
child_addr_cells
))
-
1
data
.
pop
(
0
)
cbase
=
make_number
(
child_addr_cells
-
1
,
data
)
else
:
cbase
=
make_number
(
child_addr_cells
,
data
)
pbase
=
make_number
(
parent_addr_cells
,
data
)
length
=
make_number
(
size_cells
,
data
)
...
...
@@ -394,7 +400,6 @@ class Config:
self
.
blob
=
blob
self
.
chosen
=
None
self
.
aliases
=
None
self
.
buses
=
blob
[
'
buses
'
]
# wrangle the json a little so it's easier
# to figure out which rules apply to a given device
for
dev
in
blob
[
'
devices
'
]:
...
...
@@ -547,11 +552,22 @@ def is_compatible(node, compatibles):
return
True
return
False
def
should_parse_regions
(
root
,
node
,
buses
):
def
should_parse_regions
(
root
,
node
):
"""
returns True if we should parse regions found in this node.
"""
parent
=
node
.
get_parent_node
()
return
parent
==
root
or
is_compatible
(
parent
,
buses
)
if
parent
==
root
:
return
True
try
:
# a ranges property indicates that children of the parent node
# are accessible by the grandparent node. If this property holds
# all the way up the tree, children of the parent will be addressable
# by the CPU.
idx
=
parent
.
index
(
'
ranges
'
)
return
should_parse_regions
(
root
,
parent
)
except
ValueError
:
return
False
def
find_devices
(
dtb
,
cfg
):
devices
=
{}
...
...
@@ -571,7 +587,7 @@ def find_devices(dtb, cfg):
cfg
.
set_chosen
(
Device
(
child
,
None
,
name
))
elif
name
==
'
/aliases
'
:
cfg
.
set_aliases
(
Device
(
child
,
None
,
name
))
if
should_parse_regions
(
root
,
child
,
cfg
.
buses
):
if
should_parse_regions
(
root
,
child
):
devices
[
child
.
name
]
=
Device
(
child
,
devices
[
child
.
get_parent_node
().
name
],
name
)
nodes
[
child
.
name
]
=
devices
[
child
.
name
]
else
:
...
...
This diff is collapsed.
Click to expand it.
tools/hardware_schema.yml
+
0
−
6
View file @
b45de785
...
...
@@ -15,12 +15,6 @@ description: Schema for seL4 hardware.yml
type
:
object
additionalProperties
:
false
properties
:
buses
:
type
:
array
uniqueItems
:
true
description
:
list of compatibles to treat as MMIO buses
items
:
type
:
string
devices
:
type
:
array
uniqueItems
:
true
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment