📄 mkimg16
字号:
#!/bin/sh
# This shell script aids in creating an image capable of being
# burned on a Pb1500/Pb1100/Pb1550 when the flash is in 32-bit
# wide mode, in order to faciliate booting from 16-bit mode.
#
# Yamon must have been compiled with yamon/init/reset/reset.S
# declaring BOOT_16BIT or DUAL_BOOT_16BIT. For just BOOT_16BIT,
# the compilation endian mode, ie -DEB or -DEL determines whether
# the resulting 16-bit YAMON image boots big or little endian.
# How reset.S is compiled is controlled by the ENDIAN= statement
# at line ~270 of makefile.
#
# Furthermore, the compilation of pad16.c below must also match
# the compilation endian of reset.S.
#
# Final image, y16.rec, should be burned by YAMON in 32-bit mode
# of the __desired__ 16-bit boot endian.
#
# See yamon/init/reset/reset.S for commentary on 16-bit boot.
#
YAMON=02.25PB1200
TOOLS=/usr/local/comp/mips-elf/gcc-3.3.2/bin
${TOOLS}/mips-elf-objcopy -O binary reset-${YAMON}.elf a.bin
${TOOLS}/mips-elf-objcopy -O binary EL/yamon-${YAMON}_el.elf b.bin
${TOOLS}/mips-elf-objcopy -O binary EB/yamon-${YAMON}_eb.elf c.bin
#build the padding tool
gcc -O2 pad16.c -o pad16
# the base addresses for each component is:
#reset at 9fc00000 - from yamon/bin/link/link.xn
#el at 9fc10000 - from yamon/bin/link/link_el.xn
#eb at 9fc90000 - from yamon/bin/link/link_eb.xn
# the offset from bfc00000/9fc00000 for each component is:
#reset at 00000000
#el at 00010000
#eb at 00090000
#pad16 address to use to accomodate for padding (offset << 1)
#reset at a0100000 (a0100000 + (00000000<<1))
#el at a0120000 (a0100000 + (00010000<<1))
#eb at a0220000 (a0100000 + (00090000<<1))
# Construct 16-bit YAMON image
# Swap EB component for programming via EL system (default YAMON)
./pad16 -l 0xa0100000 a.bin > a.rec
./pad16 -l 0xa0120000 b.bin > b.rec
./pad16 -ls 0xa0220000 c.bin > c.rec
# Swap EL components for programming via EB system
#./pad16 -ls 0xa0100000 a.bin > a.rec
#./pad16 -l 0xa0120000 b.bin > b.rec
#./pad16 -ls 0xa0220000 c.bin > c.rec
cat a.rec b.rec c.rec > y16.rec
echo "S70500000000FA" >> y16.rec
chmod 777 y16.rec
cp y16.rec /cygdrive/c/tftpboot
# Update instructions utilizing YAMON:
# Pb1500:
# 1) Boot YAMON into little-endian, 32-bit wide NOR (default)
# 2) YAMON> erase bd800000 200000
# 3) YAMON> fill a0100000 200000 ff
# 4) YAMON> load /y16.rec
# 5) YAMON> copy a0100000 bd800000 200000
# 6) Flip SWAP_BOOT (S13) and set ROM_SIZ (S15) to "dot visible"
# 7) Power-cycle for new 16-bit YAMON to take effect
# 8) NOTE: Strataflash driver doesn't work in 16-bit mode
# Pb1100:
# Exactly same as Pb1500
# Pb1550:
# 1) Boot YAMON into little-endian, 32-bit wide NOR (default)
# 2) YAMON> erase bB800000 200000
# 3) YAMON> fill a0100000 200000 ff
# 4) YAMON> load /y16.rec
# 5) YAMON> copy a0100000 bb800000 200000
# 6) Flip SWAP_BOOT (S13) and set AU_BOOT[2:0] to "On", "On", "Off".
# 7) Power-cycle for new 16-bit YAMON to take effect
# 8) NOTE: A complete working 16-bit YAMON port has not yet been done
# This requires changes to pb1000.h for Pb1550 to reduce Flash size
# and change some addresses and specify 16-bit AMD Flash driver.
rm a.bin b.bin c.bin a.rec b.rec c.rec
echo Done!!!
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -