1
0
mirror of git://projects.qi-hardware.com/nn-usb-fpga.git synced 2024-12-05 04:31:52 +02:00

make create rootfs and reflash automatic a little

Signed-off-by: Xiangfu Liu <xiangfu@sharism.cc>
This commit is contained in:
Xiangfu Liu 2010-08-12 14:07:43 +08:00
parent de6f53a94a
commit 18e79c4816
2 changed files with 112 additions and 0 deletions

53
binaries/reflash/Makefile Normal file
View File

@ -0,0 +1,53 @@
#
# Written 2010, by Xiangfu Liu.
#
LOADER=openwrt-xburst-qi_lb60-u-boot.bin
KERNEL=openwrt-xburst-qi_lb60-uImage.bin
ROOTFS=openwrt-xburst-qi_lb60-root.ubi
UBIFS =openwrt-xburst-qi_lb60-root.ubifs
QI_IMAGE_URL=http://downloads.qi-hardware.com/software/images/Ben_NanoNote_2GB_NAND/latest/
QI_MIRKO_URL=http://downloads.qi-hardware.com/people/mirko/testing/
DL=$(if $(wildcard ../dl/.),../dl,dl)
.PHONY: all clean reflash_rootfs reflash_kernel reflash_uboot
all: reflash_rootfs reflash_kernel reflash_uboot
$(DL)/$(ROOTFS).ok:
mkdir -p dl
wget -c -O $(DL)/$(ROOTFS) $(QI_IMAGE_URL)/$(ROOTFS)
touch $@
$(DL)/$(KERNEL).ok:
mkdir -p dl
wget -c -O $(DL)/$(KERNEL) $(QI_MIRKO_URL)/$(KERNEL)
touch $@
$(DL)/$(LOADER).ok:
mkdir -p dl
wget -c -O $(DL)/$(LOADER) $(QI_MIRKO_URL)/$(LOADER)
touch $@
$(DL)/create_rootfs.ok: $(DL)/$(ROOTFS).ok
mkdir -p $(DL)/rootfs_tmp
tar zxf ./dl/openwrt-xburst-qi_lb60-rootfs.tar.gz -C ./$(DL)/rootfs_tmp/
cp -rf ../sie_rootfs_files/* ./$(DL)/rootfs_tmp/
mkfs.ubifs -r $(DL)/rootfs_tmp/ -m 4096 -e 516096 -c 4095 -o $(UBIFS)
ubinize -o $(ROOTFS) -m 4096 -p 512KiB ubinize.cfg
touch $@
reflash_rootfs: $(DL)/create_rootfs.ok
sudo usbboot -f ./usbboot_2gb_nand.cfg -c "boot;nerase 16 512 0 0;nprog 2048 $(DL)/$(ROOTFS) 0 0 -n"
reflash_kernel: $(DL)/$(KERNEL).ok
sudo usbboot -f ./usbboot_2gb_nand.cfg -c "boot;nprog 1024 $(DL)/$(KERNEL) 0 0 -n"
reflash_uboot: $(DL)/$(LOADER).ok
sudo usbboot -f ./usbboot_2gb_nand.cfg -c "boot;nprog 0 $(DL)/$(LOADER) 0 0 -n"
clean:
rm -rf $(DL)

View File

@ -0,0 +1,59 @@
#
# usbboot configuration file
#
# Utility to respond to the Ingenic XBurst USB boot protocol, provide
# initial boot stages and ability to access NAND on device.
#
# Authors: Ingenic Semiconductor, Inc.
# Xiangfu Liu <xiangfu@qi-hardware.com>
# Marek Lindner <lindner_marek@yahoo.de>
# Wolfgang Spraul <wolfgang@qi-hardware.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# [PLL]
EXTCLK = 12 #Define the external crystal in MHz
CPUSPEED = 252 #Define the PLL output frequency
PHMDIV = 3 #Define the frequency divider ratio of PLL=CCLK:PCLK=HCLK=MCLK
BOUDRATE = 57600 #Define the uart boudrate
USEUART = 0 #Use which uart, 0/1 for jz4740,0/1/2/3 for jz4750
# [SDRAM]
BUSWIDTH = 16 #The bus width of the SDRAM in bits (16|32)
BANKS = 4 #The bank number (2|4)
ROWADDR = 13 #Row address width in bits (11-13)
COLADDR = 9 #Column address width in bits (8-12)
ISMOBILE = 0 #Define whether SDRAM is mobile SDRAM, this only valid for Jz4750 ,1:yes 0:no
ISBUSSHARE = 1 #Define whether SDRAM bus share with NAND 1:shared 0:unshared
DEBUGOPS = 0
# [NAND]
NAND_BUSWIDTH = 8 #The width of the NAND flash chip in bits (8|16|32)
NAND_ROWCYCLES = 3 #The row address cycles (2|3)
NAND_PAGESIZE = 4096 #The page size of the NAND chip in bytes(512|2048|4096)
NAND_PAGEPERBLOCK = 128 #The page number per block
NAND_FORCEERASE = 1 #The force to erase flag (0|1)
NAND_OOBSIZE = 128 #oob size in byte
NAND_ECCPOS = 12 #Specify the ECC offset inside the oob data (0-[oobsize-1])
NAND_BADBLOCKPOS = 0 #Specify the badblock flag offset inside the oob (0-[oobsize-1])
NAND_BADBLOCKPAGE = 127 #Specify the page number of badblock flag inside a block(0-[PAGEPERBLOCK-1])
NAND_PLANENUM = 1 #The planes number of target nand flash
NAND_BCHBIT = 4 #Specify the hardware BCH algorithm for 4750 (4|8)
NAND_WPPIN = 0 #Specify the write protect pin number
NAND_BLOCKPERCHIP = 0 #Specify the block number per chip,0 means ignore
#The program will calculate the total SDRAM size by : size = 2^(ROWADDR + COLADDR) * BANKNUM * (SDRAMWIDTH / 4)
#The CPUSPEED has restriction as: ( CPUSPEED % EXTCLK == 0 ) && ( CPUSPEED % 12 == 0 )
#For jz4750, the program just init BANK0(DSC0).
#Beware all variables must be set correct!