1#!/bin/sh 2# SPDX-License-Identifier: GPL-2.0-only 3 4bct_cfg2inc() { 5 local in_file="$1" 6 local out_file="$2" 7 echo "{ /* generated from ${in_file}; do not edit. */" >"${out_file}" 8 # Note currently we can only handle DDR3 type memory, even in C 9 # implementation. 10 sed "/^#.*$/d; s/^SDRAM.0./ /; s/\r$//; s/;$/,/;" \ 11 "${in_file}" >> "${out_file}" 12 echo "}," >>"${out_file}" 13} 14 15for file in $@; do 16 echo "Generating $file => ${file%cfg}inc..." 17 bct_cfg2inc "${file}" "${file%cfg}inc" 18done 19