From 5d695e27729179457a5f3b97f2c2613d35f69cca Mon Sep 17 00:00:00 2001 From: Nathaniel Graff Date: Wed, 5 Jun 2019 11:38:20 -0700 Subject: fixup-dts takes first matching port Signed-off-by: Nathaniel Graff --- scripts/fixup-dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/fixup-dts b/scripts/fixup-dts index 278b835..835eeaf 100755 --- a/scripts/fixup-dts +++ b/scripts/fixup-dts @@ -129,7 +129,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 -- cgit v1.2.3 From 293a200f3397947c805eacc6eb47573cda68820d Mon Sep 17 00:00:00 2001 From: Nathaniel Graff Date: Wed, 5 Jun 2019 11:45:01 -0700 Subject: Look for hex digits, not decimal digits in fixup-dts Signed-off-by: Nathaniel Graff --- scripts/fixup-dts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts') 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 -- cgit v1.2.3