lanefu changed the topic of #armbian-rockchip to: Armbian - Linux for ARM development boards | Rockchip SoC | www.armbian.com | This channel is relayed to the equivalent Discord channel | this channel is logged
archetech has joined #armbian-rockchip
<DC-IRC> [Discord] <efectn> @rpardini do you know how to deal with building multiple uboot defconfigs for single board? I have done something like https://github.com/armbian/build/pull/7652/commits/c4ce534e11f8179a3a829b640d2c1d4c0cdbe963 but rkspi-loader.img still uses nanopi-m6-rk3588s_defconfig uboot i think
<DC-IRC> [Discord] <rpardini> yeah, it's tricky, as BOOTCONFIG will be as `make ... $BOOTCONFIG` - always
<DC-IRC> [Discord] <rpardini> Then as you have another defconfig in each target, it will then _change_ the config, in theory, per-target
<DC-IRC> [Discord] <rpardini> I've had similar problem in another board and had to do a stupid hack, let me find
<DC-IRC> [Discord] <rpardini> we _must_ come up with a better way than UBOOT_TARGET_MAP, really. it's hell
<DC-IRC> [Discord] <efectn> Yeah it makes the things more and more complex
<DC-IRC> [Discord] <efectn> was it odroid hc4?
<DC-IRC> [Discord] <efectn> I guess i got why you changes bootconfig with hooks now
<DC-IRC> [Discord] <efectn> I guess i got why you changed bootconfig with hooks now
<DC-IRC> [Discord] <rpardini> yeah indeed hc4. but that's only because I'm changing configs in hooks, not separate defconfig files
<DC-IRC> [Discord] <rpardini> that forced me into that `armbian_target=sd` bs
<DC-IRC> [Discord] <efectn> Yeah good idea
<DC-IRC> [Discord] <rpardini> in this case is vendor rk uboot no?
<DC-IRC> [Discord] <efectn> Yes it is vendor uboot
<DC-IRC> [Discord] <rpardini> oh maybe you've a mixup with `rkspi_loader.img` ?
<DC-IRC> [Discord] <efectn> I don't use the uboot map generated by rockchip64 common
<DC-IRC> [Discord] <efectn> I set it to UBOOT_TARGET_MAP="nanopi-m6-rk3588s_defconfig BL31=$RKBIN_DIR/$BL31_BLOB spl/u-boot-spl.bin u-boot.dtb u-boot.itb;;idbloader.img u-boot.itb
<DC-IRC> [Discord] <efectn> nanopi-m6-spi-rk3588s_defconfig BL31=$RKBIN_DIR/$BL31_BLOB;; rkspi_loader.img" using a hook
<DC-IRC> [Discord] <efectn> But it seems like i have to use the way hc4 uses
<DC-IRC> [Discord] <efectn> I set it to `UBOOT_TARGET_MAP="nanopi-m6-rk3588s_defconfig BL31=$RKBIN_DIR/$BL31_BLOB spl/u-boot-spl.bin u-boot.dtb u-boot.itb;;idbloader.img u-boot.itb
<DC-IRC> [Discord] <efectn> nanopi-m6-spi-rk3588s_defconfig BL31=$RKBIN_DIR/$BL31_BLOB;; rkspi_loader.img"` using a hook
<DC-IRC> [Discord] <rpardini> looks to me:
<DC-IRC> [Discord] <rpardini> 1) you're not specifying the targets for the spi defconfig
<DC-IRC> [Discord] <rpardini> 2) framework has a bug and uses `rkspi_loader.img` from previous target
<DC-IRC> [Discord] <rpardini> for which I'm very, very sorry if that's the case
<DC-IRC> [Discord] <rpardini> have you had to short SPI pins? 😄
<DC-IRC> [Discord] <efectn> SPI is unattachable
<DC-IRC> [Discord] <rpardini> wtf produces `rkspi_loader.img` lol
<DC-IRC> [Discord] <efectn> I think it uses wrong defconfig
<DC-IRC> [Discord] <rpardini> nope, all it does is the defconfig (only)
<DC-IRC> [Discord] <rpardini> and does not build u-boot.itb and idbloader.img that is what compose rkspi_loader.img
<DC-IRC> [Discord] <efectn> If i create idblosder and itb for spi defconfig, then it will override the default one's while packaging right?
<DC-IRC> [Discord] <efectn> If i create idbloader and itb for spi defconfig, then it will override the default one's while packaging right?
<DC-IRC> [Discord] <rpardini> you can try
<DC-IRC> [Discord] <rpardini> ```bash
<DC-IRC> [Discord] <rpardini> UBOOT_TARGET_MAP="
<DC-IRC> [Discord] <rpardini> nanopi-m6-rk3588s_defconfig BL31=$RKBIN_DIR/$BL31_BLOB spl/u-boot-spl.bin u-boot.dtb u-boot.itb;;idbloader.img u-boot.itb
<DC-IRC> [Discord] <rpardini> nanopi-m6-spi-rk3588s_defconfig BL31=$RKBIN_DIR/$BL31_BLOB spl/u-boot-spl.bin u-boot.dtb u-boot.itb;;rkspi_loader.img
<DC-IRC> [Discord] <rpardini> "
<DC-IRC> [Discord] <rpardini> ```
<DC-IRC> [Discord] <rpardini> I need to add proper cleaning before building a target
<DC-IRC> [Discord] <rpardini> so it does not inherit binaries from previous targets, also I think here maybe even across-boards/builds is interferring
<DC-IRC> [Discord] <rpardini> yeah proper cleaning (`git clean -xfd`) demonstrates the bug clearly
<DC-IRC> [Discord] <rpardini> but also does cause every build to be a full rebuild
<DC-IRC> [Discord] <rpardini> ccache helps, but still
<DC-IRC> [Discord] <rpardini> goddamn it
<DC-IRC> [Discord] <rpardini> it's still using the old `rkspi_loader.img`
<DC-IRC> [Discord] <rpardini> you _need_ `BOOT_SUPPORT_SPI="yes"` and `BOOT_SPI_RKSPI_LOADER="yes"`
<DC-IRC> [Discord] <rpardini> otherwise `rkspi_loader.img` is not created by the code in rk64_common 😐
<DC-IRC> [Discord] <rpardini> but if you do that, then it touches your `UBOOT_TARGET_MAP` 😿
<DC-IRC> [Discord] <rpardini> this is absolute hell, very sorry.
<DC-IRC> [Discord] <efectn> This uboot target map stuff is exactly awful 😅😅
<DC-IRC> [Discord] <rpardini> it's the combo of target_map being a bad idea with the postprocessor function
<DC-IRC> [Discord] <rpardini> nah in your case you're fine as you're setting `UBOOT_TARGET_MAP` in a post_family_config hook
<DC-IRC> [Discord] <rpardini> try this
<DC-IRC> [Discord] <rpardini> ```bash
<DC-IRC> [Discord] <rpardini> BOOT_SUPPORT_SPI="yes"
<DC-IRC> [Discord] <rpardini> BOOT_SPI_RKSPI_LOADER="yes"
<DC-IRC> [Discord] <rpardini> function post_family_config__nanopi_m6_support_spi_boot() {
<DC-IRC> [Discord] <rpardini> UBOOT_TARGET_MAP="nanopi-m6-rk3588s_defconfig BL31=$RKBIN_DIR/$BL31_BLOB spl/u-boot-spl.bin u-boot.dtb u-boot.itb;;idbloader.img u-boot.itb
<DC-IRC> [Discord] <rpardini> nanopi-m6-spi-rk3588s_defconfig BL31=$RKBIN_DIR/$BL31_BLOB spl/u-boot-spl.bin u-boot.dtb u-boot.itb;;rkspi_loader.img"
<DC-IRC> [Discord] <rpardini> }
<DC-IRC> [Discord] <rpardini> ```
<DC-IRC> [Discord] <rpardini> the whitespace is significant in this _crap_ `UBOOT_TARGET_MAP` string
<DC-IRC> [Discord] <efectn> Ok will try it tomorrow
<DC-IRC> [Discord] <rpardini> terribly sorry Efe, I'll fix a bit 😉
<DC-IRC> [Discord] <rpardini> 🫡
<DC-IRC> [Discord] <efectn> No problem 😄