@ -14,43 +14,73 @@ define Build/calculate-ep
$( eval KERNEL_ENTRY = $( shell $( KERNEL_CROSS) readelf -h $( LINUX_DIR) /vmlinux | grep "Entry point address" | grep -o 0x.*) )
e n d e f
d e f i n e B u i l d / p a t c h - d t b
$( call Image/BuildDTB,$( DTS_DIR) /$( DEVICE_DTS) .dts,$@ .dtb)
$( STAGING_DIR_HOST) /bin/patch-dtb $@ $@ .dtb
d e f i n e B u i l d / b u i l d - d t b
$( call Image/BuildDTB,$( DTS_DIR) /$( DEVICE_DTS) .dts,$( DTS_DIR) /$( DEVICE_DTS) .dtb)
e n d e f
# Shared device definition: applies to every defined device
d e f i n e D e v i c e / D e f a u l t
PROFILES = Default $$ ( DEVICE_PROFILE)
KERNEL_DEPENDS = $$ ( wildcard ../dts/$$ ( DEVICE_DTS) .dts)
DEVICE_PROFILE :=
d e f i n e B u i l d / p a t c h - d t b
$( STAGING_DIR_HOST) /bin/patch-dtb $@ $( DTS_DIR) /$( DEVICE_DTS) .dtb
e n d e f
DEVICE_VARS += DEVICE_PROFILE
i f n e q ( $( CONFIG_TARGET_ROOTFS_INITRAMFS ) , )
# Root FS built-in
d e f i n e D e v i c e / v m l i n u x
KERNEL_SUFFIX := .elf
KERNEL_INITRAMFS := kernel-bin | patch-dtb
KERNEL_INITRAMFS_NAME = vmlinux-initramfs.elf
e n d e f
d e f i n e D e v i c e / u I m a g e
KERNEL_SUFFIX := -uImage
KERNEL_INITRAMFS := kernel-bin | patch-dtb | calculate-ep | uImage none
KERNEL_LOADADDR := 0x80000000
KERNEL_SUFFIX := .elf
KERNEL := kernel-bin | build-dtb | patch-dtb
KERNEL_INITRAMFS_NAME = vmlinux-initramfs.elf
e n d e f
d e f i n e D e v i c e / a x s 1 0 3
$( call Device/uImage)
DEVICE_PROFILE := axs103
DEVICE_DTS := axs103_idu
e n d e f
TARGET_DEVICES += axs103
d e f i n e D e v i c e / n s i m _ h s
$( call Device/vmlinux)
DEVICE_PROFILE := nsim_hs
DEVICE_DTS := nsim_hs_idu
e n d e f
TARGET_DEVICES += nsim_hs
e l s e
# Root FS on SD-card
KERNEL_LOADADDR := 0x80000000
DEVICE_DTS_LIST := axs103_idu
FAT32_BLOCK_SIZE = 1024
FAT32_BLOCKS = $( shell echo $$ ( ( $( CONFIG_AXS10X_SD_BOOT_PARTSIZE) *1024*1024/$( FAT32_BLOCK_SIZE) ) ) )
d e f i n e I m a g e / B u i l d / S D C a r d
rm -f $( KDIR_TMP) /$( IMG_PREFIX) -$( PROFILE) -boot.img
mkdosfs $( KDIR_TMP) /$( IMG_PREFIX) -$( PROFILE) -boot.img -C $( FAT32_BLOCKS)
mkimage -C none -A arc -T script -d uEnv.txt $( BIN_DIR) /uEnv.scr
mcopy -i $( KDIR_TMP) /$( IMG_PREFIX) -$( PROFILE) -boot.img $( BIN_DIR) /uEnv.scr ::boot.scr
mcopy -i $( KDIR_TMP) /$( IMG_PREFIX) -$( PROFILE) -boot.img $( DTS_DIR) /*.dtb ::
mcopy -i $( KDIR_TMP) /$( IMG_PREFIX) -$( PROFILE) -boot.img $( BIN_DIR) /$( IMG_PREFIX) -uImage ::uImage
./gen_axs10x_sdcard_img.sh \
$( BIN_DIR) /$( IMG_PREFIX) -$( PROFILE) -sdcard-vfat-$( 1) .img \
$( KDIR_TMP) /$( IMG_PREFIX) -$( PROFILE) -boot.img \
$( KDIR) /root.$( 1) \
$( CONFIG_AXS10X_SD_BOOT_PARTSIZE) \
$( CONFIG_TARGET_ROOTFS_PARTSIZE)
i f n e q ( $( CONFIG_TARGET_IMAGES_GZIP ) , )
gzip -f9n $( BIN_DIR) /$( IMG_PREFIX) -$( PROFILE) -sdcard-vfat-$( 1) .img
e n d i f
e n d e f
d e f i n e I m a g e / B u i l d K e r n e l
# Build unified uImage
$( call Build/calculate-ep)
$( call Image/BuildKernel/MkuImage, \
none, $( KERNEL_LOADADDR) , $( KERNEL_ENTRY) , \
$( KDIR) /vmlinux, \
$( BIN_DIR) /$( IMG_PREFIX) -uImage \
)
# Build .dtb for all boards we may run on
$( foreach DEVICE_DTS,$( shell echo $( DEVICE_DTS_LIST) ) , $( call Build/build-dtb) )
e n d e f
d e f i n e I m a g e / B u i l d
$( call Image/Build/$( 1) ,$( 1) )
$( call Image/Build/SDCard,$( 1) )
dd if = $( KDIR) /root.$( 1) of = $( BIN_DIR) /$( IMG_PREFIX) -root.$( 1) bs = 128k conv = sync
e n d e f
e n d i f
$( eval $ ( call BuildImage ) )