首页 > 代码库 > 裁剪U-boot
裁剪U-boot
U-boot:V1.1.5
为了减小U-boot文件,我们需要把不用的裁掉!
主要从下面几个地方裁剪:
- Makefile U-boot根目录下的Makefile
- 公共文件夹 common
- 驱动 drivers
- RTC
1. 主Makefile
(1)删除examples
Ln217:
examples\
Ln2230-2234:
rm -f $(obj)examples/hello_world $(obj)examples/timer $(obj)examples/eepro100_eeprom $(obj)examples/sched $(obj)examples/mem_to_mem_idma2intr $(obj)examples/82559_eeprom $(obj)examples/smc91111_eeprom $(obj)examples/interrupt $(obj)examples/test_burst
(2) 删除sk98lin支持
sk98lin is the Gigabit Ethernet driver for Marvell and SysKonnectnetwork adapter cards. It supports SysKonnect SK-98xx/SK-95xx compliant GigabitEthernet Adapter and any Yukon compliant chipset.
Ln203、Ln300、Ln307;
(3) 保留jffs2
删除cramfs、fat、fdos、reiserfs、ext2
Ln194:
LIBS+= fs/jffs2/libjffs2.a
Ln299:
fs/jffs2
Ln306:
fs/jffs2
(4) 删除dtt
DigitalThermometer and Thermostat
数字温度计和恒温器
Ln199、Ln300、Ln307
(5) 删除disk
Harddisk
Ln197、Ln300、Ln307
2. 公共文件
在删除文件后,还要修改common下Makefile.2.1 公共支持
(1) 删除Xilinx
..\common\
xilinx.c
Spartan
..\common\
spartan2.c
spartan3.c
Virtex2
..\common\
virtex2.c
修改common下fpga.c中关于xilinx的引用
#include<xilinx.h>
(2) 删除LCD
..\common\
lcd.c
(3) 删除USB keyboard
..\common\
usb_kbd.c
(4) 删除ACEX
ACEX device family
..\common\
ACEX1K.c
altera.c
(5) 删除FPGA
..\common\
fpga.c
(6) 删除S-Record
Motorola S-Record Format
..\common\
s_record.c
(7) 删除serial
Serial for MPC
..\common\
serial.c
(8) 删除soft
I2C and spi for soft
..\common\
soft_i2c.c
soft_spi.c
2.2 命令支持
删除除了LOADB,FLASH,MEMORY,NET,ENV,BOOTD,NAND以外的命令支持
(1) 配置定义
cmd_confdefs.h
所有解除定义在(Ln98)
#define CFG_CMD_ALL 0xFFFFFFFFFFFFFFFFULL /* ALL commands */
语句之后。
#undef CFG_CMD_BDI #undef CFG_CMD_LOADS #undef CFG_CMD_IMI #undef CFG_CMD_CACHE #undef CFG_CMD_KGDB #undef CFG_CMD_PCMCIA #undef CFG_CMD_IDE #undef CFG_CMD_PCI #undef CFG_CMD_IRQ #undef CFG_CMD_CONSOLE #undef CFG_CMD_EEPROM #undef CFG_CMD_ASKENV #undef CFG_CMD_RUN #undef CFG_CMD_ECHO #undef CFG_CMD_I2C #undef CFG_CMD_REGINFO #undef CFG_CMD_IMMAP #undef CFG_CMD_DATE #undef CFG_CMD_DHCP #undef CFG_CMD_BEDBUG #undef CFG_CMD_FDC #undef CFG_CMD_SCSI #undef CFG_CMD_AUTOSCRIPT #undef CFG_CMD_MII #undef CFG_CMD_SETGETDCR #undef CFG_CMD_BSP #undef CFG_CMD_ELF #undef CFG_CMD_MISC #undef CFG_CMD_USB #undef CFG_CMD_DOC #undef CFG_CMD_JFFS2 #undef CFG_CMD_DTT #undef CFG_CMD_SDRAM #undef CFG_CMD_DIAG #undef CFG_CMD_FPGA #undef CFG_CMD_HWFLOW #undef CFG_CMD_SAVES #undef CFG_CMD_SPI #undef CFG_CMD_FDOS #undef CFG_CMD_VFD #undef CFG_CMD_BMP #undef CFG_CMD_PORTIO #undef CFG_CMD_PING #undef CFG_CMD_MMC #undef CFG_CMD_FAT #undef CFG_CMD_IMLS #undef CFG_CMD_ITEST #undef CFG_CMD_NFS #undef CFG_CMD_REISER #undef CFG_CMD_CDP #undef CFG_CMD_XIMG #undef CFG_CMD_UNIVERSE #undef CFG_CMD_EXT2 #undef CFG_CMD_SNTP #undef CFG_CMD_DISPLAY
(2) cmd_*.c
..\common\
cmd_autoscript.c cmd_bdinfo.c cmd_bmp.c cmd_boot.c cmd_cache.c cmd_console.c cmd_date.c cmd_dcr.c cmd_diag.c cmd_display.c cmd_doc.c cmd_elf.c cmd_fdc.c cmd_i2c.c cmd_immap.c cmd_itest.c cmd_jffs2.c cmd_log.c cmd_mii.c cmd_misc.c cmd_portio.c cmd_reginfo.c cmd_reiser.c cmd_spi.c cmd_vfd.c cmd_ximg.c
1) load_addr等全局变量
2) getenv/setenv等函数
cmd_nvedit.c
2.3 引用
(1) 删除ppc_asm.tmpl
#include<ppc_asm.tmpl>
..\common\
miiphybb.c
(2) 删除part.h
..\common\
common.h
Ln100:
#include<part.h>
3. 驱动
同时修改drivers下Makefile.
3.1 网卡
1) tsec
Freescale Three Speed Ethernet Controller driver
..\drivers\
tsec.c
tsec.h
2) rtl8019
Realtek 8019AS Ethernet
..\drivers\
rtl8019.c
rtl8019.h
3) rtl8139
RealTek RTL8139 Ethernet
..\drivers\
rtl8139.c
4) rtl8169
RealTek RTL8169 Ethernet
..\drivers\
rtl8169.c
5) ne2000
ne2000 Ethernet
..\drivers\
ne2000.c
ne2000.h
6) lan91c96
LAN91C96 single-chip Ethernet
..\drivers\
lan91c96.c
lan91c96.h
7) dm9000x
DM9000 ISA NIC fast Ethernet
..\drivers\
dm9000x.c
dm9000x.h
8) BCM570x
PCI-X10/100/1000BASE-T
..\drivers\
bcm570x.c
bcm570x_autoneg.c
bcm570x_autoneg.h
bcm570x_bits.h
bcm570x_debug.h
bcm570x_lm.h
bcm570x_mm.h
bcm570x_queue.h
tigon3.c
tigon3.h
9) ns8382x
NatSemi DP8382 Ethernet
..\drivers\
ns8382x.c
10) CS8900A
Cirrus Logic CS8900A Ethernet
..\drivers\
cs8900.c
cs8900.h
11) KS8695
KS8695 LAN ethernet
..\drivers\
ks8695eth.c
12) e1000
e1000base driver for Intel? Gigabit Network Connections
..\drivers\
e1000.c
e1000.h
13) eepro100
Intel eepro100 ethernet
..\drivers\
eepro100.c
14) DP8381x
NatSemi DP8381x series
..\drivers\
natsemi.c
15) DP8382
NatSemi DP8382
..\drivers\
ns8382x.c
16) PCnet
AMD PCnet network controllers
..\drivers\
pcnet.c
17) plb2800
plb2800 ethernet
..\drivers\
plb2800_eth.c
18) Netarm
Netarm Ethernet Driver
..\drivers\
netarm_eth.c
netarm_eth.h
19) 8390
National Semiconductor NS8390 Ethernet
..\drivers\
8390.h
20) nicext
Broadcom Network Interface Card Extension (NICE)
..\drivers\
nicext.h
21) smc91111
SMC‘s LAN91C111 Ethernet Driver
..\drivers\
smc91111.c
smc91111.h
22) BCM5701
Broadcom BCM5701 Network Driver
..\drivers\
5701rls.c
5701rls.h
23) 3c589
3Com‘s 3C589 (Etherlink III) PCMCIA Ethernet device
..\drivers\
3c589.c
3c589.h
3.2 pcmcia
Personal Computer Memory Card International Association
..\drivers\
ti_pci1410a.c
mpc8xx_pcmcia.c
tqm8xx_pcmcia.c
rpx_pcmcia.c
pxa_pcmcia.c
Intel82365
i82365.c
3.3 video
..\drivers\
sed156x.c
videomodes.c
videomodes.h
ct69000.c
Video support for Epson SED13806 chipset
sed13806.c
ColorFramebuffer Console driver for 8/15/16/24/32 bits per pixel
cfb_console.c
Basicvideo support for SMI SM501 "Voyager" graphic controller
sm501.c
Silicon Motion graphic interface forsm810/sm710/sm712 accelerator
smiLynxEM.c
3.4 S3C4510B
..\drivers\
s3c4510b_eth.c
s3c4510b_eth.h
s3c4510b_uart.c
s3c4510b_uart.h
3.5 NetSilicon
1) ns7520
..\drivers\
ns7520_eth.c
2) ns9750
..\drivers\
ns9750_eth.c
ns9750_serial.c
3.6 USB
..\drivers\
usbdcore.c
(1) sl811
sl811_usb.c
sl811.h
3.7 PCI
..\drivers\
pci.c
pci_auto.c
pci_indirect.c
(1) w83c553f
Winbond 83C553
w83c553f.c
(2) dc2114x
DEC PCI complexcard
dc2114x.c
3.8 keyboard
..\drivers\
keyboard.c
pc_keyb.c
PS/2multiplexer driver
ps2mult.c
Simple16550A serial driver
ps2ser.c
Intel8042 keyboard driver routines
i8042.c
3.9 i2c外设
OMAP2420, OMAP1510
..\drivers\
omap24xx_i2c.c
omap1510_i2c.c
3.10 ip-swtich
INCA-IP internal switch ethernet driver
..\drivers\
inca-ip_sw.c
3.11 EEPROM
Three-wire (MicroWire) serial eeprom driver(for 93C46 and compatibles)
..\drivers\
mw_eeprom.c
3.12 IC
ALI M5123 Logical device
..\drivers\
ali512x.c
3.13 SCSI
SCSI support based on the chip sym53C810
..\drivers\
sym53c8xx.c
3.14 DTT
The DS1722 Digital Thermometer andThermostat with SPI/3-Wire Interface provides temperature readings whichindicate the temperature of the device.
..\drivers\
ds1722.c
3.15 serial
..\drivers\
PrimeCell PL011
serial_pl010.c
PrimeCellPL011 UARTs on the IntegratorCP
serial_pl011.c
serial_pl011.h
MAX3100
serial_max3100.c
serial_xuartlite.c
(1) ns
ns16550.c
ns87308.c
serial.c
4. rtc
时钟芯片使用PCF8563(根据自己使用的开发板而定)
删除除pcf8563.c和date.c外的所有文件
../rtc
bf533_rtc.c ds164x.c ds174x.c ds1302.c ds1306.c ds1307.c ds1337.c ds1374.c ds1556.c ds12887.c m41t11.c m48t35ax.c max6900.c mc146818.c mk48t59.c mpc5xxx.c mpc8xx.c rs5c372.c s3c24x0_rtc.c
同时修改rtc下Makefile.
裁剪U-boot