Changeset 42121


Ignore:
Timestamp:
2014-08-11T13:36:55+02:00 (3 years ago)
Author:
jogo
Message:

brcm63xx: add support for attaching dtbs to lzma kernels

In preparation for switching to dtb based board identification, add
support for building lzma-loader and lzma cfe kernels with dtb
appended.

Signed-off-by: Jonas Gorski <jogo@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/brcm63xx/image/Makefile

    r41940 r42121  
    3131$(shell expr substr "$(1)" 1 16) 
    3232endef 
     33 
     34TARGET_DTBS:= 
    3335 
    3436define Image/Build/CFE 
     
    162164endef 
    163165 
    164 define Image/Prepare 
    165  
     166define Image/PrepareLoaderDTB 
     167        # append dtb to vmlinux, then build a standard LZMA loader 
     168        cat $(KDIR)/vmlinux$(1) $(DTS_DIR)/$(2).dtb > $(KDIR)/vmlinux$(1)-$(2) 
     169        $(call Image/PrepareLoader,$(1)-$(2)) 
     170endef 
     171 
     172define Image/PrepareCFELzmaKernel 
    166173        # CFE is a LZMA nazi! It took me hours to find out the parameters! 
    167174        # Also I think lzma has a bug cause it generates different output depending on 
    168175        # if you use stdin / stdout or not. Use files instead of stdio here, cause 
    169176        # otherwise CFE will complain and not boot the image. 
    170         $(STAGING_DIR_HOST)/bin/lzma e -d22 -fb64 -a1 $(KDIR)/vmlinux $(KDIR)/vmlinux.lzma.tmp 
     177        $(STAGING_DIR_HOST)/bin/lzma e -d22 -fb64 -a1 $(KDIR)/vmlinux$(1) $(KDIR)/vmlinux$(1).lzma.tmp 
    171178 
    172179        # Strip out the length, CFE doesn't like this 
    173         dd if=$(KDIR)/vmlinux.lzma.tmp of=$(KDIR)/vmlinux.lzma.cfe bs=5 count=1 
    174         dd if=$(KDIR)/vmlinux.lzma.tmp of=$(KDIR)/vmlinux.lzma.cfe ibs=13 obs=5 skip=1 seek=1 conv=notrunc 
    175         rm -f $(KDIR)/vmlinux.lzma.tmp 
     180        dd if=$(KDIR)/vmlinux$(1).lzma.tmp of=$(KDIR)/vmlinux$(1).lzma.cfe bs=5 count=1 
     181        dd if=$(KDIR)/vmlinux$(1).lzma.tmp of=$(KDIR)/vmlinux$(1).lzma.cfe ibs=13 obs=5 skip=1 seek=1 conv=notrunc 
     182        rm -f $(KDIR)/vmlinux$(1).lzma.tmp 
     183endef 
     184 
     185define Image/PrepareCFELzmaKernelDTB 
     186        # compile the dts (the dtb will be later reused for the lzma loader) 
     187        $(LINUX_DIR)/scripts/dtc/dtc -O dtb -o $(DTS_DIR)/$(1).dtb ../dts/$(1).dts 
     188        cat $(KDIR)/vmlinux $(DTS_DIR)/$(1).dtb > $(KDIR)/vmlinux-$(1) 
     189        $(call Image/PrepareCFELzmaKernel,-$(1)) 
     190endef 
     191 
     192define Image/Prepare 
     193        $(call Image/PrepareCFELzmaKernel,) 
     194 
     195        $(foreach board,$(sort $(TARGET_DTBS)), $(call Image/PrepareCFELzmaKernelDTB,$(board))) 
    176196 
    177197 ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y) 
    178198        $(call Image/PrepareLoader,-initramfs) 
     199        $(foreach board,$(sort $(TARGET_DTBS)), $(call Image/PrepareLoaderDTB,-initramfs,$(board))) 
    179200 endif 
    180201        rm -f $(KDIR)/fs_mark 
Note: See TracChangeset for help on using the changeset viewer.