Samsung scores up to $6.4bn to build US chip plants