diff options
author | Nathaniel Graff <nathaniel.graff@sifive.com> | 2019-06-05 11:45:01 -0700 |
---|---|---|
committer | Nathaniel Graff <nathaniel.graff@sifive.com> | 2019-06-05 11:46:24 -0700 |
commit | 293a200f3397947c805eacc6eb47573cda68820d (patch) | |
tree | cd431ea368a02a5396f978e9d27b2ddf09bcd722 /scripts | |
parent | 5d695e27729179457a5f3b97f2c2613d35f69cca (diff) |
Look for hex digits, not decimal digits in fixup-dts
Signed-off-by: Nathaniel Graff <nathaniel.graff@sifive.com>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/fixup-dts | 8 |
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 |