summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorNathaniel Graff <nathaniel.graff@sifive.com>2019-06-06 23:05:23 +0000
committerGitHub <noreply@github.com>2019-06-06 23:05:23 +0000
commit55322c92d7028f98ff3be82009cb163a11c6b14f (patch)
tree83bf614ca79c2fbe18b721c73bd741c39b28d339 /scripts
parentca87ff63573b3faf4c8999b7d0095e8dddac9e50 (diff)
parent293a200f3397947c805eacc6eb47573cda68820d (diff)
Merge pull request #269 from sifive/fixup-bug-fixes
DTS Fixup bug fixes
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/fixup-dts10
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/fixup-dts b/scripts/fixup-dts
index 37c2105..7192aea 100755
--- a/scripts/fixup-dts
+++ b/scripts/fixup-dts
@@ -154,7 +154,7 @@ if [ `grep -c 'sifive,testram0' ${dts}` -eq 0 ]; then
if [ `grep -c "${protocol}-${port_type}-port" ${dts}` -ne 0 ]; then
# Build the node name
- port_node_name=`egrep -o "${protocol}-${port_type}-port@[a-fA-F0-9]+" ${dts}`
+ port_node_name=`egrep -o "${protocol}-${port_type}-port@[a-fA-F0-9]+" ${dts} | head -n 1`
echo -e "$0: \tUsing node \t${port_node_name}"
# Get the address and size cells
@@ -165,19 +165,19 @@ if [ `grep -c 'sifive,testram0' ${dts}` -eq 0 ]; then
# Get the base address and size
if [ ${address_cells} -eq 1 -a ${size_cells} -eq 1 ]; then
- address_and_size=(`cat ${dts} | tr -d '\n\t' | grep -oP "${port_node_name}.*?ranges = <0x\d+ \K(0x\d+ 0x\d+)"`)
+ address_and_size=(`cat ${dts} | tr -d '\n\t' | grep -oP "${port_node_name}.*?ranges = <0x[[:xdigit:]]+ \K(0x[[:xdigit:]]+ 0x[[:xdigit:]]+)"`)
base_address=${address_and_size[0]}
size=${address_and_size[1]}
elif [ ${address_cells} -eq 1 -a ${size_cells} -eq 2 ]; then
- address_and_size=(`cat ${dts} | tr -d '\n\t' | grep -oP "${port_node_name}.*?ranges = <0x\d+ \K(0x\d+ 0x\d+ 0x\d+)"`)
+ address_and_size=(`cat ${dts} | tr -d '\n\t' | grep -oP "${port_node_name}.*?ranges = <0x[[:xdigit:]]+ \K(0x[[:xdigit:]]+ 0x[[:xdigit:]]+ 0x[[:xdigit:]]+)"`)
base_address=${address_and_size[0]}
size="${address_and_size[1]} ${address_and_size[2]}"
elif [ ${address_cells} -eq 2 -a ${size_cells} -eq 1 ]; then
- address_and_size=(`cat ${dts} | tr -d '\n\t' | grep -oP "${port_node_name}.*?ranges = <0x\d+ 0x\d+ \K(0x\d+ 0x\d+ 0x\d+)"`)
+ address_and_size=(`cat ${dts} | tr -d '\n\t' | grep -oP "${port_node_name}.*?ranges = <0x[[:xdigit:]]+ 0x[[:xdigit:]]+ \K(0x[[:xdigit:]]+ 0x[[:xdigit:]]+ 0x[[:xdigit:]]+)"`)
base_address="${address_and_size[0]} ${address_and_size[1]}"
size=${address_and_size[2]}
elif [ ${address_cells} -eq 2 -a ${size_cells} -eq 2 ]; then
- address_and_size=(`cat ${dts} | tr -d '\n\t' | grep -oP "${port_node_name}.*?ranges = <0x\d+ 0x\d+ \K(0x\d+ 0x\d+ 0x\d+ 0x\d+)"`)
+ address_and_size=(`cat ${dts} | tr -d '\n\t' | grep -oP "${port_node_name}.*?ranges = <0x[[:xdigit:]]+ 0x[[:xdigit:]]+ \K(0x[[:xdigit:]]+ 0x[[:xdigit:]]+ 0x[[:xdigit:]]+ 0x[[:xdigit:]]+)"`)
base_address="${address_and_size[0]} ${address_and_size[1]}"
size="${address_and_size[2]} ${address_and_size[3]}"
fi