summaryrefslogtreecommitdiff
path: root/scripts/fixup-dts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/fixup-dts')
-rwxr-xr-xscripts/fixup-dts8
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/fixup-dts b/scripts/fixup-dts
index 835eeaf..a3fd2da 100755
--- a/scripts/fixup-dts
+++ b/scripts/fixup-dts
@@ -140,19 +140,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