rockchip: Reduce prerequisites from the host
cover rockchip: Reduce prerequisites from the host
From: Vicente Bergas <[email protected]>
This patch series remove the dependency on python and dtc from the host for the Sapphire board.
It does not conform to the U-Boot coding style. It has been posted here for informational purposes only. If there is interest in merging it, feel free to modify it at will, it is in the public domain.
Vicente Bergas (4):
[U-Boot] add make_fit_atf in tools
[U-Boot] rockchip: rk3399: use make_fit_atf instead of make_fit_atf.py [U-Boot] rockchip: rk3399: disable CONFIG_SPL_OF_PLATDATA [U-Boot] rockchip: rk3399: set CONFIG_MKIMAGE_DTC_PATH
configs/evb-rk3399_defconfig | 4 +- tools/Makefile | 2 + tools/make_fit_atf.c | 360 +++++++++++++++++++++++++++++++++++ 3 files changed, 364 insertions(+), 2 deletions(-) create mode 100644 tools/make_fit_atf.c
Signature · 1 line
2.17.1
PATCH 1/4 add make_fit_atf in tools
From: Vicente Bergas <[email protected]>
make_fit_atf generates an .its file based on U-Boot and ATF .elf files. It also extracts all loadable sections from ATF.
It tries to somewhat mimic the behaviour ofarch/arm/mach-rockchip/make_fit_atf.py
--- tools/Makefile | 2 + tools/make_fit_atf.c | 360 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 362 insertions(+) create mode 100644 tools/make_fit_atf.c
tools/Makefile +2 -0
@@ -56,6 +56,8 @@ mkenvimage-objs := mkenvimage.o os_support.o lib/crc32.o hostprogs-y += dumpimage mkimage hostprogs-$(CONFIG_FIT_SIGNATURE) += fit_info fit_check_sign +hostprogs-$(CONFIG_SPL_ATF) += make_fit_atf + hostprogs-$(CONFIG_CMD_BOOTEFI_SELFTEST) += file2include FIT_SIG_OBJS-$(CONFIG_FIT_SIGNATURE) := common/image-sig.o
tools/make_fit_atf.c new file +360 -0
360 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH 2/4 rockchip: rk3399: use make_fit_atf instead of make_fit_atf.py
In reply to Vicente BergasFrom: Vicente Bergas <[email protected]>
--- configs/evb-rk3399_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
configs/evb-rk3399_defconfig +1 -1
@@ -11,7 +11,7 @@ CONFIG_DEFAULT_DEVICE_TREE="rk3399-evb" CONFIG_DEBUG_UART=y CONFIG_FIT=y CONFIG_SPL_LOAD_FIT=y -CONFIG_SPL_FIT_GENERATOR="arch/arm/mach-rockchip/make_fit_atf.py" +CONFIG_SPL_FIT_GENERATOR="tools/make_fit_atf" # CONFIG_DISPLAY_CPUINFO is not set CONFIG_DISPLAY_BOARDINFO_LATE=y CONFIG_SPL_STACK_R=y
Signature · 1 line
2.17.1
PATCH 3/4 rockchip: rk3399: disable CONFIG_SPL_OF_PLATDATA
In reply to Vicente BergasFrom: Vicente Bergas <[email protected]>
It has been tested with this option disabled and it works fine. The benefit of doing so is that this is the last dependency on python to build U-Boot for the Sapphire board.
--- configs/evb-rk3399_defconfig | 1 - 1 file changed, 1 deletion(-)
configs/evb-rk3399_defconfig +0 -1
@@ -27,7 +27,6 @@ CONFIG_CMD_USB=y CONFIG_CMD_TIME=y CONFIG_SPL_OF_CONTROL=y CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" -CONFIG_SPL_OF_PLATDATA=y CONFIG_ENV_IS_IN_MMC=y CONFIG_NET_RANDOM_ETHADDR=y CONFIG_REGMAP=y
Signature · 1 line
2.17.1
PATCH 3/4 rockchip: rk3399: disable CONFIG_SPL_OF_PLATDATA
Hi Vicente,
Quoted 5 lines · Vicente Bergas
From: Vicente Bergas <[email protected]>
It has been tested with this option disabled and it works fine. The benefit of doing so is that this is the last dependency on python to build U-Boot for the Sapphire board.
I just not understand why remove the dependency on python is so important, there already many modules depend on python.
The most important is I would like to enable "CONFIG_SPL_OF_PLATDATA" instead
of remove it. Yes, it works fine without it, but I believe it works better/faster with it.
Thanks,
- Kever
Quoted 18 lines
Signed-off-by Vicente Bergas <[email protected]>--- configs/evb-rk3399_defconfig | 1 - 1 file changed, 1 deletion(-)configs/evb-rk3399_defconfig +0
-1@@ -27,7 +27,6 @@ CONFIG_CMD_USB=y CONFIG_CMD_TIME=y CONFIG_SPL_OF_CONTROL=y CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" -CONFIG_SPL_OF_PLATDATA=y CONFIG_ENV_IS_IN_MMC=y CONFIG_NET_RANDOM_ETHADDR=y CONFIG_REGMAP=y
PATCH 4/4 rockchip: rk3399: set CONFIG_MKIMAGE_DTC_PATH
In reply to Vicente BergasFrom: Vicente Bergas <[email protected]>
U-Boot has a built-in dtc. Using it removes one dependency from the host.
--- configs/evb-rk3399_defconfig | 1 + 1 file changed, 1 insertion(+)
configs/evb-rk3399_defconfig +1 -0
@@ -27,6 +27,7 @@ CONFIG_CMD_USB=y CONFIG_CMD_TIME=y CONFIG_SPL_OF_CONTROL=y CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" +CONFIG_MKIMAGE_DTC_PATH="scripts/dtc/dtc" CONFIG_ENV_IS_IN_MMC=y CONFIG_NET_RANDOM_ETHADDR=y CONFIG_REGMAP=y
Signature · 1 line
2.17.1
PATCH 4/4 rockchip: rk3399: set CONFIG_MKIMAGE_DTC_PATH
Hi Vicente,
Quoted 5 lines · Vicente Bergas
From: Vicente Bergas <[email protected]>
U-Boot has a built-in dtc. Using it removes one dependency from the host.
Signed-off-by Vicente Bergas <[email protected]>
Looks good to me, thanks.
Thanks,
- Kever
Quoted 16 lines
--- configs/evb-rk3399_defconfig | 1 + 1 file changed, 1 insertion(+)configs/evb-rk3399_defconfig +1
-0@@ -27,6 +27,7 @@ CONFIG_CMD_USB=y CONFIG_CMD_TIME=y CONFIG_SPL_OF_CONTROL=y CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" +CONFIG_MKIMAGE_DTC_PATH="scripts/dtc/dtc" CONFIG_ENV_IS_IN_MMC=y CONFIG_NET_RANDOM_ETHADDR=y CONFIG_REGMAP=y
cover rockchip: Reduce prerequisites from the host
In reply to Vicente BergasHi Vicente,
Could you share why you don't want to use python, can convert the script to C?
Thanks,
- Kever
Quoted 21 lines · Vicente Bergas
From: Vicente Bergas <[email protected]>
This patch series remove the dependency on python and dtc from the host for the Sapphire board.
It does not conform to the U-Boot coding style. It has been posted here for informational purposes only. If there is interest in merging it, feel free to modify it at will, it is in the public domain.
Vicente Bergas (4):
[U-Boot] addmake_fit_atfin tools
[U-Boot] rockchip: rk3399: usemake_fit_atfinstead ofmake_fit_atf.py[U-Boot] rockchip: rk3399: disableCONFIG_SPL_OF_PLATDATA[U-Boot] rockchip: rk3399: setCONFIG_MKIMAGE_DTC_PATHconfigs/evb-rk3399_defconfig | 4 +- tools/Makefile | 2 + tools/make_fit_atf.c | 360 +++++++++++++++++++++++++++++++++++ 3 files changed, 364 insertions(+), 2 deletions(-) create mode 100644 tools/make_fit_atf.c
cover rockchip: Reduce prerequisites from the host
Quoted 3 lines · kever.yang at rock-chips.com
(snip)
I just not understand why remove the dependency on python is so important, there already many modules depend on python.
Quoted 3 lines · kever.yang at rock-chips.com
(snip)
Could you share why you don't want to use python, can convert the script to C?
Hi Kever,
there are several reasons, here are the ones I can think of:
1.- Python is a ~100MB weight dependency.
2.- Because of (1) I don not have it installed by default. 3.- My Linux distribution of choice defaults to python3 but
u-boot requires 'python' to be python2.
4.- "Shall use C language whenever possible."
http://www.denx.de/wiki/U-Boot/DesignRequirements
5.- It is not just a dependency on what needs to be installed
on the host, is also a dependency on which programming languages u-boot's contributors need to know about. So, it can be considered an entry barrier.
I don not have strong feelings on this getting merged and certainly will not get upset if it does not. It is entirely your decision.
I have submitted this patch series mostly "for your information" and because Philipp thought that it "looks worthwhile":
Quoted 8 lines · philipp.tomsich at theobroma-systems.com
(snip)
Quoted 1 line · Vicente Bergas
(snip)
Quoted 5 lines
SPL_FIT_GENERATORandSPL_OF_PLATDATArequire python. In order to remove this dependency:
1.- I have written a C version forSPL_FIT_GENERATOR. 2.- DisabledSPL_OF_PLATDATA, it just works.
Quoted 6 lines
Quoted 4 lines
MKIMAGE_DTC_PATHrequires dtc in the PATH.
In order to remove this dependency, I have changed it to use the built-in one.If there is interest in those changes, I can post the full patch.
Please submit a patch--it certainly looks worthwhile.
Regards,
Vicenç.
cover rockchip: Reduce prerequisites from the host
Vicente,
Quoted 12 lines · Vicente Bergas
Quoted 3 lines · kever.yang at rock-chips.com
(snip)
I just not understand why remove the dependency on python is so important, there already many modules depend on python.Quoted 3 lines · kever.yang at rock-chips.com
(snip)
Could you share why you don't want to use python, can convert the script to C?
Quoted 12 lines
Hi Kever,
there are several reasons, here are the ones I can think of:
1.- Python is a ~100MB weight dependency.
2.- Because of (1) I don not have it installed by default. 3.- My Linux distribution of choice defaults to python3 but
u-boot requires 'python' to be python2.
4.- "Shall use C language whenever possible."
http://www.denx.de/wiki/U-Boot/DesignRequirements
5.- It is not just a dependency on what needs to be installed
on the host, is also a dependency on which programming languages u-boot's contributors need to know about. So, it can be considered an entry barrier.
Given that most of the recent FDT infrastructure (e.g. tools/dtoc) and binman are Python, the overall opinion on Python seems to have changed (and no-one bothered to update the Wiki).
That said: the original python-implementation (i.e. the .py tool in the rockchip subdirectory) is a bit unfortunate as well, as any processing of binaries to build a final bootable image should nowadays be included in binman.
Quoted 5 lines
I don not have strong feelings on this getting merged and certainly will not get upset if it does not. It is entirely your decision.
I have submitted this patch series mostly "for your information" and because Philipp thought that it "looks worthwhile”:
Just for the record: I want to have this patch in the mailing-list archive, so it is archived and can be found by anyone working on this aspect of our bootup in the future.
I still stand by my initial assessment that it’s worthwhile to not lose this info and make sure it’s archived ;-)
Thanks,
Philipp.
Quoted 19 lines
Quoted 8 lines · philipp.tomsich at theobroma-systems.com
(snip)
Quoted 1 line · Vicente Bergas
(snip)
Quoted 5 lines
SPL_FIT_GENERATORandSPL_OF_PLATDATArequire python. In order to remove this dependency:
1.- I have written a C version forSPL_FIT_GENERATOR. 2.- DisabledSPL_OF_PLATDATA, it just works.Quoted 6 lines
Quoted 4 lines
MKIMAGE_DTC_PATHrequires dtc in the PATH.
In order to remove this dependency, I have changed it to use the built-in one.If there is interest in those changes, I can post the full patch.
Please submit a patch--it certainly looks worthwhile.
Regards,
Vicenç.