diff --git a/.gitignore b/.gitignore index e12c3a506d43c118e59d078c93ceb60b07839c95..6372b6613fce1d365957091124da9f5e7fc01635 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ upload upload_update .idea build/ +pi4_upload_release diff --git a/Cargo.toml b/Cargo.toml index 3ced8b6a53b3a5b948b66c97cc32df704110e8ce..bcfbb3a4f3e805b6efbb3b5ae3812e3a0c4116da 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,6 +23,9 @@ lto = true panic = "abort" debug = true +[build-dependencies] +cmake = "0.1" + [dependencies] vm-fdt = { git = "https://github.com/OhmR/vm-fdt" } #nostd_async = "0.6.0" diff --git a/Makefile b/Makefile index 4f99b16f5ad7234bb3c68fbdbb95e0748e22bf39..61edf73955f3f1e3444f150bb18c39402b91d809 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ ARCH ?= aarch64 BUILD_STD = core,alloc # Toolchain -TOOLCHAIN=aarch64-linux-gnu +TOOLCHAIN=aarch64-none-elf QEMU = /usr/share/qemu/bin/qemu-system-aarch64 GDB = ${TOOLCHAIN}-gdb OBJDUMP = ${TOOLCHAIN}-objdump diff --git a/build.rs b/build.rs index 788a65507057a9e42e3c8e82cdce110381b4761e..4b5d03faa918c41c6bfac261212e6117697891aa 100644 --- a/build.rs +++ b/build.rs @@ -8,11 +8,16 @@ // MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. // See the Mulan PSL v2 for more details. -use std::env::var; use std::process::Command; +use cmake::Config; fn main() { - println!("cargo:rustc-link-search=native={}/lib", var("PWD").unwrap()); + let dst = Config::new("libfdt-binding") + .profile("release") + .build_target("all") + .build() + .join("build"); + println!("cargo:rustc-link-search=native={}", dst.display()); println!("cargo:rustc-link-lib=static=fdt-binding"); // note: add error checking yourself. let output = Command::new("date").arg("+\"%Y-%m-%d %H:%M:%S %Z\"").output().unwrap(); diff --git a/lib/libfdt-binding.a b/lib/libfdt-binding.a deleted file mode 100644 index e582b27180f38def26de3e69c9aa3529159e8953..0000000000000000000000000000000000000000 Binary files a/lib/libfdt-binding.a and /dev/null differ diff --git a/lib/libtegra.a b/lib/libtegra.a deleted file mode 100644 index 3500a618de3e1085b19b8a26cdcb5c2122371f83..0000000000000000000000000000000000000000 Binary files a/lib/libtegra.a and /dev/null differ diff --git a/lib/tegra186_emmc.c.o b/lib/tegra186_emmc.c.o deleted file mode 100644 index 3670f357ba5390e42cb84cb068844d4c3ab56bc1..0000000000000000000000000000000000000000 Binary files a/lib/tegra186_emmc.c.o and /dev/null differ diff --git a/libfdt-binding/CMakeLists.txt b/libfdt-binding/CMakeLists.txt index 0d27691a898c6bd5313984fb9f526910335b147e..a3a2458fea2037108e637fe1f6d718ce36f60644 100644 --- a/libfdt-binding/CMakeLists.txt +++ b/libfdt-binding/CMakeLists.txt @@ -1,11 +1,11 @@ cmake_minimum_required(VERSION 3.9) project(libfdt-binding) -# set(CMAKE_BUILD_TYPE "Release") +set(CMAKE_BUILD_TYPE "Release") set(CMAKE_C_STANDARD 11) -set(CMAKE_C_COMPILER aarch64-elf-gcc) -set(CMAKE_ASM_COMPILER aarch64-elf-gcc) +set(CMAKE_C_COMPILER aarch64-none-elf-gcc) +set(CMAKE_ASM_COMPILER aarch64-none-elf-gcc) # set(CMAKE_C_FLAGS_RELEASE "-O3") include_directories(.) diff --git a/libfdt-binding/build.rs b/libfdt-binding/build.rs index 9269360ae475e23c0b685840d910abc14a8891a4..9d8991ffb1a6ea088b16bf64c422c24381a5b296 100644 --- a/libfdt-binding/build.rs +++ b/libfdt-binding/build.rs @@ -14,11 +14,9 @@ use std::env; use std::path::PathBuf; fn main() { - println!("cargo:rerun-if-changed=wrapper.h"); + println!("cargo:rerun-if-changed=./"); let bindings = bindgen::Builder::default() - .clang_arg("-target") - .clang_arg("aarch64") .use_core() .ctypes_prefix("myctypes") .header("wrapper.h") diff --git a/pi4_upload_release b/pi4_upload_release deleted file mode 100644 index 46e3dcc21b2d491c7f984f4cdcab194981e97b91..0000000000000000000000000000000000000000 --- a/pi4_upload_release +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -bin="./target/aarch64-pi4/release" -tftp="root@192.168.106.153:/tftp" - -rust-objcopy ${bin}/rust_shyper -O binary ${bin}/shyper.bin -mkimage -n shyper -A arm64 -O linux -T kernel -C none -a 0xF0080000 -e 0xF0080000 \ --d ${bin}/shyper.bin ${bin}/shyperImage -echo "*** Upload Image Rust_Image_pi ***" - -scp ${bin}/shyperImage ${tftp}/Rust_Image_pi -scp ./image/pi4_fin.dtb ${tftp}/pi4_dtb \ No newline at end of file