1. DRAMADJUSTMENT = yes
ifeq ($(DRAMADJUSTMENT), y)
loader-flash.bin : loader-flash-xtra0.bin loader-flash-xtra-stage0.bin loader.bin
    cat loader-flash-xtra0.bin /dev/zero | dd count=1024 bs=1 > $@
    cat loader-flash-xtra-stage0.bin /dev/zero | dd count=$(STAGE0_XTRA_IMAGE_SIZE) bs=1 >> $@
    cat loader.bin >> $@

loader-flash-xtra-stage0.bin : loader-flash-xtra-stage0.elf
    $(OBJCOPY) -Obinary $< $@
    chmod a-x $@

loader-flash-xtra-stage0.elf : $(XTRA_STAGE0_OBJS)
    $(LD) --gc-section -e xtra_stage0 -Ttext 0x46000400 -o $@ $(XTRA_STAGE0_OBJS)
    $(OBJDUMP) -d -S -x $@ > loader-flash-xtra-stage0.map

loader-flash-xtra0.bin : loader-flash-xtra0.elf
    $(OBJCOPY) -Obinary $< $@
    chmod a-x $@

loader-flash-xtra0.elf : loader-flash-xtra0.o
    $(LD) --gc-section -e stage0_start -Ttext 0x46000000 -o $@ $<
    $(OBJDUMP) -d -S -x $@ > loader-flash-xtra0.map

loader-flash-xtra0.o : loader-flash-xtra0.s
    $(CC) $(CFLAGS) -c -o $@ $<

loader-flash-xtra0.s : loader-stage0.S config.h $(RTCONFIG) Makefile
    $(CPP) $(CPPFLAGS) -DCONFIG_BOOTFROM_FLASH -DCONFIG_DRAMADJUSTMENT -DSTAGE0_XTRA_IMAGE_SIZE=$(STAGE0_XTRA_IMAGE_SIZE) $< > $@
endif

2. loader-stage0.S and -DCONFIG_DRAMADJUSTMENT
#ifdef CONFIG_DRAMADJUSTMENT
    uart_putc_io #'M', r10, r11

    @ setup stack for C codes
    @ EM86XX has internal memory at REG_BASE_CPU
    @ use internal memory for stack of C functions
    ldr r1, =(REG_BASE_CPU + STAGE0_XTRA_STACK_SIZE)
    mov sp, r1

    @ call xtra_stage0() function
    ldr r0, =(STAGE0_CONFIG_ADDR)       @ first parameter
    ldr r1, =(STAGE0_XTRA_IMAGE_START)  @ new PC
    orr r1, r1, #0x80000000        @ jump to cache-on area
    mov lr, pc
    mov pc, r1                          @ emulate 'bl' instruction

    uart_putc #'m', r10, r11
#endif

3. em86xx_dram.c
void xtra_stage0(unsigned int configaddr)

下面這一行根本沒有用,不要被誤導了。
ifeq ($(DRAMADJUSTMENT), y)

    @echo "#define CONFIG_DRAM_ADJUSTMENT" >> $@
endif

台南小新 發表在 痞客邦 PIXNET 留言(0) 人氣()