2002-10-17 21:52:26 +00:00
|
|
|
#
|
2006-09-01 17:49:50 +00:00
|
|
|
# (C) Copyright 2004-2006
|
2002-10-17 21:52:26 +00:00
|
|
|
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
|
|
|
#
|
|
|
|
# See file CREDITS for list of people who contributed to this
|
|
|
|
# project.
|
|
|
|
#
|
|
|
|
# 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 2 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
|
2004-03-12 00:14:09 +00:00
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2002-10-17 21:52:26 +00:00
|
|
|
# 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, write to the Free Software
|
|
|
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
|
|
# MA 02111-1307 USA
|
|
|
|
#
|
|
|
|
|
|
|
|
include $(TOPDIR)/config.mk
|
|
|
|
|
2006-09-01 17:49:50 +00:00
|
|
|
LIB = $(obj)libcommon.a
|
2002-10-17 21:52:26 +00:00
|
|
|
|
|
|
|
AOBJS =
|
|
|
|
|
2008-08-29 19:53:57 +00:00
|
|
|
# core
|
2007-09-24 15:05:30 +00:00
|
|
|
COBJS-y += main.o
|
|
|
|
COBJS-y += circbuf.o
|
2008-08-29 19:53:57 +00:00
|
|
|
COBJS-y += console.o
|
|
|
|
COBJS-y += command.o
|
|
|
|
COBJS-y += dlmalloc.o
|
|
|
|
COBJS-y += exports.o
|
2009-02-06 02:04:36 +00:00
|
|
|
COBJS-$(CONFIG_SYS_HUSH_PARSER) += hush.o
|
2008-08-29 19:53:57 +00:00
|
|
|
COBJS-y += image.o
|
|
|
|
COBJS-y += memsize.o
|
|
|
|
COBJS-y += s_record.o
|
2009-02-06 02:04:36 +00:00
|
|
|
COBJS-$(CONFIG_SERIAL_MULTI) += serial.o
|
2009-05-16 10:14:54 +00:00
|
|
|
COBJS-y += stdio.o
|
2008-08-29 19:53:57 +00:00
|
|
|
COBJS-y += xyzModem.o
|
|
|
|
|
2008-10-31 11:12:12 +00:00
|
|
|
# core command
|
2008-08-30 21:47:38 +00:00
|
|
|
COBJS-y += cmd_boot.o
|
|
|
|
COBJS-y += cmd_bootm.o
|
|
|
|
COBJS-y += cmd_nvedit.o
|
|
|
|
|
2008-08-29 19:53:57 +00:00
|
|
|
# environment
|
|
|
|
COBJS-y += env_common.o
|
2008-09-10 20:47:58 +00:00
|
|
|
COBJS-$(CONFIG_ENV_IS_IN_DATAFLASH) += env_dataflash.o
|
2008-09-05 07:19:54 +00:00
|
|
|
COBJS-$(CONFIG_ENV_IS_IN_EEPROM) += env_eeprom.o
|
2009-03-13 23:54:27 +00:00
|
|
|
COBJS-$(CONFIG_ENV_IS_EMBEDDED) += env_embedded.o
|
2009-04-04 22:18:44 +00:00
|
|
|
COBJS-$(CONFIG_ENV_IS_IN_EEPROM) += env_embedded.o
|
2009-04-04 14:10:40 +00:00
|
|
|
COBJS-$(CONFIG_ENV_IS_IN_FLASH) += env_embedded.o
|
2009-04-04 22:18:44 +00:00
|
|
|
COBJS-$(CONFIG_ENV_IS_IN_NVRAM) += env_embedded.o
|
2008-09-10 20:48:04 +00:00
|
|
|
COBJS-$(CONFIG_ENV_IS_IN_FLASH) += env_flash.o
|
2009-02-25 02:31:24 +00:00
|
|
|
COBJS-$(CONFIG_ENV_IS_IN_MG_DISK) += env_mgdisk.o
|
2008-09-10 20:47:59 +00:00
|
|
|
COBJS-$(CONFIG_ENV_IS_IN_NAND) += env_nand.o
|
2008-09-10 20:47:59 +00:00
|
|
|
COBJS-$(CONFIG_ENV_IS_IN_NVRAM) += env_nvram.o
|
2008-09-10 20:48:00 +00:00
|
|
|
COBJS-$(CONFIG_ENV_IS_IN_ONENAND) += env_onenand.o
|
2008-09-10 20:48:00 +00:00
|
|
|
COBJS-$(CONFIG_ENV_IS_IN_SPI_FLASH) += env_sf.o
|
2008-09-10 20:48:01 +00:00
|
|
|
COBJS-$(CONFIG_ENV_IS_NOWHERE) += env_nowhere.o
|
2008-08-29 19:53:57 +00:00
|
|
|
|
|
|
|
# command
|
2008-03-26 22:00:38 +00:00
|
|
|
COBJS-$(CONFIG_CMD_AMBAPP) += cmd_ambapp.o
|
2009-04-01 21:34:12 +00:00
|
|
|
COBJS-$(CONFIG_SOURCE) += cmd_source.o
|
|
|
|
COBJS-$(CONFIG_CMD_SOURCE) += cmd_source.o
|
2007-09-24 15:05:31 +00:00
|
|
|
COBJS-$(CONFIG_CMD_BDI) += cmd_bdinfo.o
|
2008-08-29 19:53:57 +00:00
|
|
|
COBJS-$(CONFIG_CMD_BEDBUG) += bedbug.o cmd_bedbug.o
|
2007-09-24 15:05:31 +00:00
|
|
|
COBJS-$(CONFIG_CMD_BMP) += cmd_bmp.o
|
2008-02-16 12:40:36 +00:00
|
|
|
COBJS-$(CONFIG_CMD_BOOTLDR) += cmd_bootldr.o
|
2007-09-24 15:05:31 +00:00
|
|
|
COBJS-$(CONFIG_CMD_CACHE) += cmd_cache.o
|
|
|
|
COBJS-$(CONFIG_CMD_CONSOLE) += cmd_console.o
|
2008-02-19 05:35:17 +00:00
|
|
|
COBJS-$(CONFIG_CMD_CPLBINFO) += cmd_cplbinfo.o
|
2009-03-27 22:26:42 +00:00
|
|
|
COBJS-$(CONFIG_DATAFLASH_MMC_SELECT) += cmd_dataflash_mmc_mux.o
|
2007-09-24 15:05:31 +00:00
|
|
|
COBJS-$(CONFIG_CMD_DATE) += cmd_date.o
|
|
|
|
ifdef CONFIG_4xx
|
|
|
|
COBJS-$(CONFIG_CMD_SETGETDCR) += cmd_dcr.o
|
|
|
|
endif
|
|
|
|
ifdef CONFIG_POST
|
|
|
|
COBJS-$(CONFIG_CMD_DIAG) += cmd_diag.o
|
|
|
|
endif
|
|
|
|
COBJS-$(CONFIG_CMD_DISPLAY) += cmd_display.o
|
|
|
|
COBJS-$(CONFIG_CMD_DTT) += cmd_dtt.o
|
2008-09-10 20:47:52 +00:00
|
|
|
COBJS-$(CONFIG_ENV_IS_IN_EEPROM) += cmd_eeprom.o
|
|
|
|
COBJS-$(CONFIG_CMD_EEPROM) += cmd_eeprom.o
|
2007-09-24 15:05:31 +00:00
|
|
|
COBJS-$(CONFIG_CMD_ELF) += cmd_elf.o
|
|
|
|
COBJS-$(CONFIG_CMD_EXT2) += cmd_ext2.o
|
|
|
|
COBJS-$(CONFIG_CMD_FAT) += cmd_fat.o
|
2008-08-30 21:47:41 +00:00
|
|
|
COBJS-$(CONFIG_CMD_FDC)$(CONFIG_CMD_FDOS) += cmd_fdc.o
|
2007-11-26 17:19:12 +00:00
|
|
|
COBJS-$(CONFIG_OF_LIBFDT) += cmd_fdt.o fdt_support.o
|
2007-09-24 15:05:31 +00:00
|
|
|
COBJS-$(CONFIG_CMD_FDOS) += cmd_fdos.o
|
|
|
|
COBJS-$(CONFIG_CMD_FLASH) += cmd_flash.o
|
|
|
|
ifdef CONFIG_FPGA
|
|
|
|
COBJS-$(CONFIG_CMD_FPGA) += cmd_fpga.o
|
|
|
|
endif
|
|
|
|
COBJS-$(CONFIG_CMD_I2C) += cmd_i2c.o
|
|
|
|
COBJS-$(CONFIG_CMD_IDE) += cmd_ide.o
|
|
|
|
COBJS-$(CONFIG_CMD_IMMAP) += cmd_immap.o
|
2008-08-15 13:24:33 +00:00
|
|
|
COBJS-$(CONFIG_CMD_IRQ) += cmd_irq.o
|
2007-09-24 15:05:31 +00:00
|
|
|
COBJS-$(CONFIG_CMD_ITEST) += cmd_itest.o
|
|
|
|
COBJS-$(CONFIG_CMD_JFFS2) += cmd_jffs2.o
|
2008-07-09 14:30:30 +00:00
|
|
|
COBJS-$(CONFIG_CMD_LICENSE) += cmd_license.o
|
2007-09-24 15:05:30 +00:00
|
|
|
COBJS-y += cmd_load.o
|
2007-09-24 15:05:31 +00:00
|
|
|
COBJS-$(CONFIG_LOGBUFFER) += cmd_log.o
|
2008-08-30 21:54:58 +00:00
|
|
|
COBJS-$(CONFIG_ID_EEPROM) += cmd_mac.o
|
2008-09-10 20:48:05 +00:00
|
|
|
COBJS-$(CONFIG_CMD_MEMORY) += cmd_mem.o
|
2008-08-29 19:53:57 +00:00
|
|
|
COBJS-$(CONFIG_CMD_MFSL) += cmd_mfsl.o
|
2009-02-25 02:31:24 +00:00
|
|
|
COBJS-$(CONFIG_CMD_MG_DISK) += cmd_mgdisk.o
|
2008-09-09 13:45:18 +00:00
|
|
|
COBJS-$(CONFIG_MII) += miiphyutil.o
|
|
|
|
COBJS-$(CONFIG_CMD_MII) += miiphyutil.o
|
2007-09-24 15:05:31 +00:00
|
|
|
COBJS-$(CONFIG_CMD_MII) += cmd_mii.o
|
|
|
|
COBJS-$(CONFIG_CMD_MISC) += cmd_misc.o
|
|
|
|
COBJS-$(CONFIG_CMD_MMC) += cmd_mmc.o
|
2008-08-29 19:53:57 +00:00
|
|
|
COBJS-$(CONFIG_MP) += cmd_mp.o
|
2009-03-19 12:30:36 +00:00
|
|
|
COBJS-$(CONFIG_CMD_MTDPARTS) += cmd_mtdparts.o
|
2007-09-24 15:05:30 +00:00
|
|
|
COBJS-y += cmd_nand.o
|
2007-09-24 15:05:31 +00:00
|
|
|
COBJS-$(CONFIG_CMD_NET) += cmd_net.o
|
2008-08-12 23:40:38 +00:00
|
|
|
COBJS-$(CONFIG_CMD_ONENAND) += cmd_onenand.o
|
2008-02-05 00:26:57 +00:00
|
|
|
COBJS-$(CONFIG_CMD_OTP) += cmd_otp.o
|
2007-09-24 15:05:31 +00:00
|
|
|
ifdef CONFIG_PCI
|
|
|
|
COBJS-$(CONFIG_CMD_PCI) += cmd_pci.o
|
|
|
|
endif
|
2007-09-24 15:05:30 +00:00
|
|
|
COBJS-y += cmd_pcmcia.o
|
2007-09-24 15:05:31 +00:00
|
|
|
COBJS-$(CONFIG_CMD_PORTIO) += cmd_portio.o
|
|
|
|
COBJS-$(CONFIG_CMD_REGINFO) += cmd_reginfo.o
|
|
|
|
COBJS-$(CONFIG_CMD_REISER) += cmd_reiser.o
|
2008-03-26 14:49:44 +00:00
|
|
|
COBJS-$(CONFIG_CMD_SATA) += cmd_sata.o
|
2008-08-29 19:53:57 +00:00
|
|
|
COBJS-$(CONFIG_CMD_SF) += cmd_sf.o
|
2007-09-24 15:05:31 +00:00
|
|
|
COBJS-$(CONFIG_CMD_SCSI) += cmd_scsi.o
|
2008-02-15 02:44:42 +00:00
|
|
|
COBJS-$(CONFIG_CMD_SETEXPR) += cmd_setexpr.o
|
2007-09-24 15:05:31 +00:00
|
|
|
COBJS-$(CONFIG_CMD_SPI) += cmd_spi.o
|
2008-11-27 21:50:32 +00:00
|
|
|
COBJS-$(CONFIG_CMD_SPIBOOTLDR) += cmd_spibootldr.o
|
2008-02-05 00:26:57 +00:00
|
|
|
COBJS-$(CONFIG_CMD_STRINGS) += cmd_strings.o
|
2007-12-19 13:14:47 +00:00
|
|
|
COBJS-$(CONFIG_CMD_TERMINAL) += cmd_terminal.o
|
2008-11-19 10:47:05 +00:00
|
|
|
COBJS-$(CONFIG_CMD_UBI) += cmd_ubi.o
|
2009-03-19 14:35:50 +00:00
|
|
|
COBJS-$(CONFIG_CMD_UBIFS) += cmd_ubifs.o
|
2007-09-24 15:05:31 +00:00
|
|
|
COBJS-$(CONFIG_CMD_UNIVERSE) += cmd_universe.o
|
2008-08-29 19:53:57 +00:00
|
|
|
ifdef CONFIG_CMD_USB
|
|
|
|
COBJS-y += cmd_usb.o
|
|
|
|
COBJS-y += usb.o
|
|
|
|
COBJS-$(CONFIG_USB_STORAGE) += usb_storage.o
|
|
|
|
endif
|
2008-01-31 12:19:58 +00:00
|
|
|
COBJS-$(CONFIG_CMD_XIMG) += cmd_ximg.o
|
2007-11-15 11:23:57 +00:00
|
|
|
COBJS-$(CONFIG_YAFFS2) += cmd_yaffs2.o
|
2008-08-30 21:29:57 +00:00
|
|
|
COBJS-$(CONFIG_VFD) += cmd_vfd.o
|
2008-10-31 11:12:12 +00:00
|
|
|
|
|
|
|
# others
|
|
|
|
COBJS-$(CONFIG_DDR_SPD) += ddr_spd.o
|
Add simple hwconfig infrastructure
This patch implements simple hwconfig infrastructure: an
interface for software knobs to control a hardware.
This is very simple implementation, i.e. it is implemented
via `hwconfig' environment variable. Later we could write
some "hwconfig <enable|disable|list>" commands, ncurses
interface for Award BIOS-like interface, and frame-buffer
interface for AMI GUI[1] BIOS-like interface with mouse
support[2].
Current implementation details/limitations:
1. Doesn't support options dependencies and mutual exclusion.
We can implement this by integrating apt-get[3] into the
u-boot. But I didn't bother yet.
2. Since we don't implement hwconfig command, i.e. we're working
with the environement directly, there is no way to tell that
toggling a particular option will need a reboot to take
an effect. So, for now it's advised to always reboot the
target after modifying hwconfig variable.
3. We support hwconfig options with arguments. For example,
set hwconfig dr_usb:mode=peripheral,phy_type=ulpi
That means:
- dr_usb - enable Dual-Role USB controller;
- dr_usb:mode=peripheral - USB in Function mode;
- dr_usb:phy_type=ulpi - USB should work with ULPI PHYs;
The purpose of this simple implementation is to define some
internal API and then we can continue improving user experience
by adding more mature interface, like hwconfig command with
bells and whistles. Or not adding, if we feel that current
interface fits its needs.
[1] http://en.wikipedia.org/wiki/American_Megatrends
[2] Regarding ncurses and GUI with mouse support -- I'm just
kidding.
[3] The comment regarding apt-get is also a joke, meaning that
dependency tracking could be non-trivial. For example, for
enabling HW feature X we may need to disable Y, and turn Z
into reduced mode (like RMII-only interface for ethernet,
no MII).
It's quite trivial to implement simple cases though.
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Acked-by: Kim Phillips <kim.phillips@freescale.com>
2009-06-09 20:25:27 +00:00
|
|
|
COBJS-$(CONFIG_HWCONFIG) += hwconfig.o
|
2008-11-06 14:04:23 +00:00
|
|
|
COBJS-$(CONFIG_CONSOLE_MUX) += iomux.o
|
2007-09-24 15:05:30 +00:00
|
|
|
COBJS-y += flash.o
|
2009-02-06 02:04:36 +00:00
|
|
|
COBJS-$(CONFIG_CMD_KGDB) += kgdb.o
|
2009-05-20 08:35:14 +00:00
|
|
|
COBJS-$(CONFIG_KALLSYMS) += kallsyms.o
|
2008-08-12 23:40:38 +00:00
|
|
|
COBJS-$(CONFIG_LCD) += lcd.o
|
|
|
|
COBJS-$(CONFIG_LYNXKDI) += lynxkdi.o
|
2009-04-25 12:57:52 +00:00
|
|
|
COBJS-$(CONFIG_MODEM_SUPPORT) += modem.o
|
2008-10-01 13:26:31 +00:00
|
|
|
COBJS-$(CONFIG_UPDATE_TFTP) += update.o
|
2008-08-12 23:40:38 +00:00
|
|
|
COBJS-$(CONFIG_USB_KEYBOARD) += usb_kbd.o
|
2008-10-31 11:12:12 +00:00
|
|
|
|
2002-10-17 21:52:26 +00:00
|
|
|
|
2008-09-09 14:55:47 +00:00
|
|
|
COBJS := $(sort $(COBJS-y))
|
2006-09-01 17:49:50 +00:00
|
|
|
SRCS := $(AOBJS:.o=.S) $(COBJS:.o=.c)
|
|
|
|
OBJS := $(addprefix $(obj),$(AOBJS) $(COBJS))
|
2002-10-17 21:52:26 +00:00
|
|
|
|
|
|
|
CPPFLAGS += -I..
|
|
|
|
|
|
|
|
all: $(LIB) $(AOBJS)
|
|
|
|
|
2006-09-01 17:49:50 +00:00
|
|
|
$(LIB): $(obj).depend $(OBJS)
|
2006-10-08 23:02:05 +00:00
|
|
|
$(AR) $(ARFLAGS) $@ $(OBJS)
|
2002-10-17 21:52:26 +00:00
|
|
|
|
2008-09-10 20:48:01 +00:00
|
|
|
$(obj)env_embedded.o: $(src)env_embedded.c $(obj)../tools/envcrc
|
2002-10-17 21:52:26 +00:00
|
|
|
$(CC) $(AFLAGS) -Wa,--no-warn \
|
2006-09-01 17:49:50 +00:00
|
|
|
-DENV_CRC=$(shell $(obj)../tools/envcrc) \
|
2008-09-10 20:48:01 +00:00
|
|
|
-c -o $@ $(src)env_embedded.c
|
2002-10-17 21:52:26 +00:00
|
|
|
|
2006-09-01 17:49:50 +00:00
|
|
|
$(obj)../tools/envcrc:
|
2003-12-06 19:49:23 +00:00
|
|
|
$(MAKE) -C ../tools
|
|
|
|
|
2002-10-17 21:52:26 +00:00
|
|
|
#########################################################################
|
|
|
|
|
2006-09-01 17:49:50 +00:00
|
|
|
# defines $(obj).depend target
|
|
|
|
include $(SRCTREE)/rules.mk
|
2002-10-17 21:52:26 +00:00
|
|
|
|
2006-09-01 17:49:50 +00:00
|
|
|
sinclude $(obj).depend
|
2002-10-17 21:52:26 +00:00
|
|
|
|
|
|
|
#########################################################################
|