From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jagan Teki Subject: [PATCH v2 4/9] rockchip: rk3399: Get bl31.elf via BL31 Date: Sun, 28 Apr 2019 14:39:08 +0530 Message-ID: <20190428090913.10568-5-jagan@amarulasolutions.com> References: <20190428090913.10568-1-jagan@amarulasolutions.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20190428090913.10568-1-jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+glpar-linux-rockchip=m.gmane.org-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org To: Simon Glass , Philipp Tomsich , Kever Yang , Akash Gajjar , Tom Rini , Manivannan Sadhasivam Cc: Emmanuel Vadot , u-boot-0aAXYlwwYIKGBzrmiIFOJg@public.gmane.org, Paul Kocialkowski , linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, Jagan Teki , linux-amarula-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org List-Id: linux-rockchip.vger.kernel.org Right now rockchip platform need to copy bl31.elf into u-boot source directory to make use of building u-boot.itb. So, add environment variable BL31 like Allwinner SoC so-that the bl31.elf would available via BL31. If the builds are not exporting BL31 env, the make_fit_atf.py explicitly create dummy bl31.elf in u-boot root directory to satisfy travis builds and it will show the warning on console as WARNING: BL31 file bl31.elf NOT found, resulting binary is non-functional WARNING: Please read Building section in doc/README.rockchip Note, that the dummy bl31 files were created during not exporting BL31 case would be removed via clean target in Makefile. Cc: Emmanuel Vadot Signed-off-by: Jagan Teki --- Makefile | 2 +- arch/arm/mach-rockchip/make_fit_atf.py | 11 ++++++++++- doc/README.rockchip | 4 ++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index ba0cce9f33..2471340c71 100644 --- a/Makefile +++ b/Makefile @@ -1782,7 +1782,7 @@ clean: $(clean-dirs) -o -name 'dsdt.aml' -o -name 'dsdt.asl.tmp' -o -name 'dsdt.c' \ -o -name '*.efi' -o -name '*.gcno' -o -name '*.so' \) \ -type f -print | xargs rm -f \ - bl31_*.bin image.map + bl31.c bl31.elf bl31_*.bin image.map # mrproper - Delete all generated files, including .config # diff --git a/arch/arm/mach-rockchip/make_fit_atf.py b/arch/arm/mach-rockchip/make_fit_atf.py index d1faff1957..327875d87b 100755 --- a/arch/arm/mach-rockchip/make_fit_atf.py +++ b/arch/arm/mach-rockchip/make_fit_atf.py @@ -10,6 +10,7 @@ usage: $0 [ [ bl31.c") + os.system("${CROSS_COMPILE}gcc -c bl31.c -o bl31.elf") + bl31_elf="./bl31.elf" + logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.DEBUG) + logging.warning(' BL31 file bl31.elf NOT found, resulting binary is non-functional') + logging.warning(' Please read Building section in doc/README.rockchip') opts, args = getopt.getopt(sys.argv[1:], "o:u:b:h") for opt, val in opts: diff --git a/doc/README.rockchip b/doc/README.rockchip index ca4d6473b0..98a3824e2c 100644 --- a/doc/README.rockchip +++ b/doc/README.rockchip @@ -149,8 +149,8 @@ For example: => make realclean => make CROSS_COMPILE=aarch64-linux-gnu- PLAT=rk3399 - (copy bl31.elf into U-Boot root dir) - => cp build/rk3399/release/bl31/bl31.elf /path/to/u-boot + (export bl31.elf) + => export BL31=/path/to/arm-trusted-firmware/build/rk3399/release/bl31/bl31.elf - Compile PMU M0 firmware -- 2.18.0.321.gffc6fa0e3 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jagan Teki Date: Sun, 28 Apr 2019 14:39:08 +0530 Subject: [U-Boot] [PATCH v2 4/9] rockchip: rk3399: Get bl31.elf via BL31 In-Reply-To: <20190428090913.10568-1-jagan@amarulasolutions.com> References: <20190428090913.10568-1-jagan@amarulasolutions.com> Message-ID: <20190428090913.10568-5-jagan@amarulasolutions.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Right now rockchip platform need to copy bl31.elf into u-boot source directory to make use of building u-boot.itb. So, add environment variable BL31 like Allwinner SoC so-that the bl31.elf would available via BL31. If the builds are not exporting BL31 env, the make_fit_atf.py explicitly create dummy bl31.elf in u-boot root directory to satisfy travis builds and it will show the warning on console as WARNING: BL31 file bl31.elf NOT found, resulting binary is non-functional WARNING: Please read Building section in doc/README.rockchip Note, that the dummy bl31 files were created during not exporting BL31 case would be removed via clean target in Makefile. Cc: Emmanuel Vadot Signed-off-by: Jagan Teki --- Makefile | 2 +- arch/arm/mach-rockchip/make_fit_atf.py | 11 ++++++++++- doc/README.rockchip | 4 ++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index ba0cce9f33..2471340c71 100644 --- a/Makefile +++ b/Makefile @@ -1782,7 +1782,7 @@ clean: $(clean-dirs) -o -name 'dsdt.aml' -o -name 'dsdt.asl.tmp' -o -name 'dsdt.c' \ -o -name '*.efi' -o -name '*.gcno' -o -name '*.so' \) \ -type f -print | xargs rm -f \ - bl31_*.bin image.map + bl31.c bl31.elf bl31_*.bin image.map # mrproper - Delete all generated files, including .config # diff --git a/arch/arm/mach-rockchip/make_fit_atf.py b/arch/arm/mach-rockchip/make_fit_atf.py index d1faff1957..327875d87b 100755 --- a/arch/arm/mach-rockchip/make_fit_atf.py +++ b/arch/arm/mach-rockchip/make_fit_atf.py @@ -10,6 +10,7 @@ usage: $0 [ [ bl31.c") + os.system("${CROSS_COMPILE}gcc -c bl31.c -o bl31.elf") + bl31_elf="./bl31.elf" + logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.DEBUG) + logging.warning(' BL31 file bl31.elf NOT found, resulting binary is non-functional') + logging.warning(' Please read Building section in doc/README.rockchip') opts, args = getopt.getopt(sys.argv[1:], "o:u:b:h") for opt, val in opts: diff --git a/doc/README.rockchip b/doc/README.rockchip index ca4d6473b0..98a3824e2c 100644 --- a/doc/README.rockchip +++ b/doc/README.rockchip @@ -149,8 +149,8 @@ For example: => make realclean => make CROSS_COMPILE=aarch64-linux-gnu- PLAT=rk3399 - (copy bl31.elf into U-Boot root dir) - => cp build/rk3399/release/bl31/bl31.elf /path/to/u-boot + (export bl31.elf) + => export BL31=/path/to/arm-trusted-firmware/build/rk3399/release/bl31/bl31.elf - Compile PMU M0 firmware -- 2.18.0.321.gffc6fa0e3