Skip to content

Commit

Permalink
odroid-m1: add public key in rockchip-u-boot.dtsi
Browse files Browse the repository at this point in the history
Signed-off-by: Michał Iwanicki <[email protected]>
  • Loading branch information
m-iwanicki committed Apr 10, 2024
1 parent d7cb37f commit 0d637a3
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1124,7 +1124,7 @@ endef
ifeq ($(CONFIG_BINMAN),y)
$(call if_changed,binman)
ifeq ($(CONFIG_SIGN_UBOOT),y)
$(objtree)/tools/mkimage -F -k $(CONFIG_KEY_DIRECTORY) u-boot.itb
$(objtree)/tools/mkimage -F -k $(objtree) u-boot.itb
endif
endif
@touch $@
Expand Down
15 changes: 15 additions & 0 deletions arch/arm/dts/rockchip-u-boot.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,21 @@
};
#endif
u-boot-spl {
#ifdef CONFIG_SPL_ADD_PUBLIC_KEY
type = "section";

u-boot-spl-nodtb {
};
u-boot-spl-pubkey-dtb {
algo = CONFIG_SIGN_SIGNING_ALGORITHM;
key-name-hint = CONFIG_KEY_HINT_NAME;
#ifdef CONFIG_SIGN_UBOOT_IMAGES
required = "image";
#else
required = "conf";
#endif
};
#endif
};
};

Expand Down
10 changes: 2 additions & 8 deletions arch/arm/mach-rockchip/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -534,18 +534,12 @@ menuconfig SIGN_UBOOT

if SIGN_UBOOT

config KEY_DIRECTORY
string "Key directory"
default "."
help
Directory in which to look for keys

config KEY_HINT_NAME
string "Key hint name"
default "dev"
help
Private key: CONFIG_KEY_NAME.key
Certificate: CONFIG_KEY_NAME.crt
Private key: CONFIG_KEY_HINT_NAME.key
Certificate: CONFIG_KEY_HINT_NAME.crt

choice
prompt "Which part of U-Boot to sign"
Expand Down
1 change: 0 additions & 1 deletion configs/odroid-m1-sb-rk3568_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ CONFIG_ROCKCHIP_RK3568=y
CONFIG_SPL_ROCKCHIP_COMMON_BOARD=y
CONFIG_ROCKCHIP_SPI_IMAGE=y
CONFIG_SIGN_UBOOT=y
CONFIG_KEY_DIRECTORY="keys"
CONFIG_SPL_ADD_PUBLIC_KEY=y
CONFIG_SPL_SERIAL=y
CONFIG_SPL_STACK_R_ADDR=0x600000
Expand Down
3 changes: 0 additions & 3 deletions dts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ endif
$(obj)/dt-$(SPL_NAME).dtb: dts/dt.dtb $(objtree)/tools/fdtgrep FORCE
mkdir -p $(dir $@)
$(call if_changed,fdtgrep)
ifeq ($(CONFIG_SPL_ADD_PUBLIC_KEY),y)
$(call if_changed,fdt_add_pubkey)
endif

ifeq ($(CONFIG_OF_DTB_PROPS_REMOVE),y)
$(obj)/dt.dtb: $(DTB) $(objtree)/tools/fdtgrep FORCE
Expand Down
11 changes: 0 additions & 11 deletions scripts/Makefile.lib
Original file line number Diff line number Diff line change
Expand Up @@ -691,14 +691,3 @@ define filechk_offsets
echo ""; \
echo "#endif" )
endef

ifeq ($(CONFIG_SIGN_UBOOT_IMAGES),y)
spl_require_value=image
else
spl_require_value=conf
endif

quiet_cmd_fdt_add_pubkey = FDT_ADD_PUBKEY $@
cmd_fdt_add_pubkey = $(objtree)/tools/fdt_add_pubkey \
-a $(CONFIG_SIGN_SIGNING_ALGORITHM) -k $(CONFIG_KEY_DIRECTORY) \
-r $(spl_require_value) -n $(CONFIG_KEY_HINT_NAME) $@

0 comments on commit 0d637a3

Please sign in to comment.