diff mbox series

uboot-mediatek: clean up build dependencies

Message ID Y3Zo9xgpedx/PDzf@makrotopia.org
State Not Applicable
Delegated to: Daniel Golle
Headers show
Series uboot-mediatek: clean up build dependencies | expand

Commit Message

Daniel Golle Nov. 17, 2022, 5:01 p.m. UTC
Conditionally depend on arm-trusted-firmware-tools as it is only needed
on Cortex-A based systems, hence do not depend on it when building for
MIPSel based SoCs.
Add swig/host to build dependencies.

Reported-by: Peter Naulls <peter@chocky.org>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
 package/boot/uboot-mediatek/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Josef Schlehofer Nov. 17, 2022, 6:40 p.m. UTC | #1
On 17. 11. 22 18:01, Daniel Golle wrote:
> Conditionally depend on arm-trusted-firmware-tools as it is only needed
> on Cortex-A based systems, hence do not depend on it when building for
> MIPSel based SoCs.
> Add swig/host to build dependencies.
>
> Reported-by: Peter Naulls <peter@chocky.org>
> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
> ---
>   package/boot/uboot-mediatek/Makefile | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/package/boot/uboot-mediatek/Makefile b/package/boot/uboot-mediatek/Makefile
> index 9d823ec698..cab5c83f3e 100644
> --- a/package/boot/uboot-mediatek/Makefile
> +++ b/package/boot/uboot-mediatek/Makefile
> @@ -3,7 +3,7 @@ include $(INCLUDE_DIR)/kernel.mk
>   
>   PKG_VERSION:=2022.10
>   PKG_HASH:=50b4482a505bc281ba8470c399a3c26e145e29b23500bc35c50debd7fa46bdf8
> -PKG_BUILD_DEPENDS:=arm-trusted-firmware-tools/host
> +PKG_BUILD_DEPENDS:=!TARGET_ramips:arm-trusted-firmware-tools/host swig/host
I am not sure if this is wanted, but swig host package is located in the 
packages repository.
>   
>   include $(INCLUDE_DIR)/u-boot.mk
>   include $(INCLUDE_DIR)/package.mk
Petr Štetiar Nov. 17, 2022, 7:33 p.m. UTC | #2
Daniel Golle <daniel@makrotopia.org> [2022-11-17 17:01:43]:

Hi,

> Add swig/host to build dependencies.

this doesn't looks like a cleanup as commit subject suggests, but rather
contrary :-)

Anyway, IIRC we've added swig as a "soft host" requirement on buildbots after
this mail[2], so perhaps we should revisit that now and make it a hard host
build prereq instead? Something like we do for `mkisofs` in
target/linux/x86/Makefile?

Otherwise it looks like we would need to move swig from packages feed into
main repository and I'm not sure if we really want to do that.

1. https://git.openwrt.org/3776a9157532e694
2. http://lists.openwrt.org/pipermail/openwrt-devel/2021-January/033605.html

Cheers,

Petr
Peter Naulls Nov. 18, 2022, 2:38 p.m. UTC | #3
On 11/17/22 14:33, Petr Štetiar wrote:
> Daniel Golle <daniel@makrotopia.org> [2022-11-17 17:01:43]:
> 
> Hi,
> 
>> Add swig/host to build dependencies.
> 
> this doesn't looks like a cleanup as commit subject suggests, but rather
> contrary :-)

Thanks all in any case for looking at this. We have a possible need to modify
our vendor (or vendor's vendor, hard to be sure) U-Boot.  On our MT7621 boards 
we have vendor versions 2.0.0 aka Ralink version 2.0.0 and 1.1.3 aka Ralink
version 4.3.0.0.  And I have the Mediatek SDK with source for what claims to
be version 5.0.0.0.

Attempts to clarify with the vendor what's going on or get exact sources
or history have proven challenging due to timezones and language barriers,
and I think they simply may not know.

Obviously using the OpenWrt version is going to be probably more satisfactory,
although there may well be vendor changes to support MCU etc.

It's been many many years since I did u-boot work, but is there some magic to
load u-boot image into RAM on mt7621 and run it to try it out before flashing?
I know there are configuration options for DDR and CPU frequency, etc, but 
tftping the u-boot binaries variously and using 'go' result in an apparently
stopped system.

This is the only meaningful documentation I have found.

https://u-boot.readthedocs.io/en/latest/board/mediatek/mt7621.html

Thanks!
Daniel Golle Nov. 18, 2022, 4:11 p.m. UTC | #4
On Fri, Nov 18, 2022 at 09:38:55AM -0500, Peter Naulls wrote:
> On 11/17/22 14:33, Petr Štetiar wrote:
> > Daniel Golle <daniel@makrotopia.org> [2022-11-17 17:01:43]:
> > 
> > Hi,
> > 
> > > Add swig/host to build dependencies.
> > 
> > this doesn't looks like a cleanup as commit subject suggests, but rather
> > contrary :-)
> 
> Thanks all in any case for looking at this. We have a possible need to modify
> our vendor (or vendor's vendor, hard to be sure) U-Boot.  On our MT7621
> boards we have vendor versions 2.0.0 aka Ralink version 2.0.0 and 1.1.3 aka
> Ralink
> version 4.3.0.0.  And I have the Mediatek SDK with source for what claims to
> be version 5.0.0.0.
> 
> Attempts to clarify with the vendor what's going on or get exact sources
> or history have proven challenging due to timezones and language barriers,
> and I think they simply may not know.
> 
> Obviously using the OpenWrt version is going to be probably more satisfactory,
> although there may well be vendor changes to support MCU etc.
> 
> It's been many many years since I did u-boot work, but is there some magic to
> load u-boot image into RAM on mt7621 and run it to try it out before flashing?
> I know there are configuration options for DDR and CPU frequency, etc, but
> tftping the u-boot binaries variously and using 'go' result in an apparently
> stopped system.

@lynxis has done this on Aarch64 MediaTek SoC just a few days ago and
wrote a nice blog post summarizing the process. Probably most of it is
the same on MIPS-based targets:

https://lunarius.fe80.eu/blog/openwrt-u-boot-boot-u-boot.html


> 
> This is the only meaningful documentation I have found.
> 
> https://u-boot.readthedocs.io/en/latest/board/mediatek/mt7621.html
> 
> Thanks!
> 
> 
>
Chuanhong Guo Nov. 25, 2022, 12:37 p.m. UTC | #5
Hi!

On Fri, Nov 18, 2022 at 10:54 PM Peter Naulls <peter@chocky.org> wrote:
> It's been many many years since I did u-boot work, but is there some magic to
> load u-boot image into RAM on mt7621 and run it to try it out before flashing?
> I know there are configuration options for DDR and CPU frequency, etc, but
> tftping the u-boot binaries variously and using 'go' result in an apparently
> stopped system.

After building the upstream u-boot for mt7621 there are u-boot-dtb.img,
u-boot-dtb.img and u-boot-lzma.img. Some of them can be started using
bootm but I forgot which one it is.
You can't test u-boot-spl from memory though, because you can't
initialize ram when the code itself is in ram.
diff mbox series

Patch

diff --git a/package/boot/uboot-mediatek/Makefile b/package/boot/uboot-mediatek/Makefile
index 9d823ec698..cab5c83f3e 100644
--- a/package/boot/uboot-mediatek/Makefile
+++ b/package/boot/uboot-mediatek/Makefile
@@ -3,7 +3,7 @@  include $(INCLUDE_DIR)/kernel.mk
 
 PKG_VERSION:=2022.10
 PKG_HASH:=50b4482a505bc281ba8470c399a3c26e145e29b23500bc35c50debd7fa46bdf8
-PKG_BUILD_DEPENDS:=arm-trusted-firmware-tools/host
+PKG_BUILD_DEPENDS:=!TARGET_ramips:arm-trusted-firmware-tools/host swig/host
 
 include $(INCLUDE_DIR)/u-boot.mk
 include $(INCLUDE_DIR)/package.mk