add rb532 support
[openwrt.git] / target / linux / image / rb532 / Makefile
1 include ../image.mk
2
3 LOADADDR = 0x81000000 # RAM start + 16M
4 KERNEL_ENTRY = 0x80101000
5 RAMSIZE = 0x00100000 # 1MB
6 IMAGE_COPY = 1
7
8 LOADER_MAKEOPTS= \
9 KDIR=$(KDIR) \
10 LOADADDR=$(LOADADDR) \
11 KERNEL_ENTRY=$(KERNEL_ENTRY) \
12 RAMSIZE=$(RAMSIZE) \
13 IMAGE_COPY=$(IMAGE_COPY)
14
15 define Build/Clean
16 $(MAKE) -C ../generic/lzma-loader $(LOADER_MAKEOPTS) clean
17 endef
18
19 define Image/Prepare
20 cat $(KDIR)/vmlinux | $(STAGING_DIR)/bin/lzma e -si -so -eos -lc1 -lp2 -pb2 > $(KDIR)/vmlinux.lzma
21 $(MAKE) -C ../generic/lzma-loader $(LOADER_MAKEOPTS) clean compile
22 endef
23
24 define Image/BuildKernel
25 $(CP) $(KDIR)/loader.elf $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-vmlinux
26 endef
27
28 PARTITION1=\x80\x01\x01\x00\x27\x01\x20\x7b\x20\x00\x00\x00\xe0\x1e\x00\x00# 4 MB (kernel part)
29 PARTITION2=\x00\x00\x01\x7c\x83\x01\xa0\x64\x00\x1f\x00\x00\x40\x7a\x00\x00# 16 MB (rootfs part)
30
31 define Image/Build/jffs2-128k
32 ( \
33 echo -ne OWRT | dd bs=$$$$((0x1be)) conv=sync; \
34 ( \
35 echo -ne '$(strip $(PARTITION1))'; \
36 echo -ne '$(strip $(PARTITION2))'; \
37 ) | dd bs=$$$$((0x40)) conv=sync; \
38 echo -ne '\x55\xaa'; \
39 dd if=/dev/zero bs=$$$$((0x3e00)) conv=sync count=1; \
40 dd if=$(KDIR)/loader.elf bs=$$$$((0x3dc000)) conv=sync; \
41 cat $(KDIR)/root.$(1); \
42 echo -ne '\xde\xad\xc0\xde'; \
43 ) > $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(1).bin
44 endef
45
46 define Image/Build
47 $(call Image/Build/$(1),$(1))
48 endef
49
50 $(eval $(call BuildImage))
This page took 0.051548 seconds and 5 git commands to generate.