]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
Merge git://www.denx.de/git/u-boot
authorNobuhiro Iwamatsu <iwamatsu@nigauri.org>
Thu, 6 Dec 2007 16:20:16 +0000 (01:20 +0900)
committerNobuhiro Iwamatsu <iwamatsu@nigauri.org>
Thu, 6 Dec 2007 16:20:16 +0000 (01:20 +0900)
Conflicts:

drivers/Makefile

295 files changed:
CHANGELOG
MAKEALL
Makefile
board/cds/mpc8541cds/u-boot.lds
board/cds/mpc8548cds/u-boot.lds
board/cds/mpc8555cds/u-boot.lds
board/cm5200/cm5200.c
board/freescale/mpc832xemds/pci.c
board/freescale/mpc8349emds/pci.c
board/freescale/mpc8349itx/pci.c
board/freescale/mpc8360emds/pci.c
board/mpl/vcma9/cmd_vcma9.c
board/netstar/eeprom.c
board/voiceblue/eeprom.c
common/Makefile
common/cmd_bdinfo.c
common/cmd_bedbug.c
common/cmd_bmp.c
common/cmd_console.c
common/cmd_date.c
common/cmd_dcr.c
common/cmd_diag.c
common/cmd_display.c
common/cmd_doc.c
common/cmd_dtt.c
common/cmd_elf.c
common/cmd_ext2.c
common/cmd_fat.c
common/cmd_fdos.c
common/cmd_fdt.c
common/cmd_flash.c
common/cmd_fpga.c
common/cmd_i2c.c
common/cmd_ide.c
common/cmd_immap.c
common/cmd_itest.c
common/cmd_jffs2.c
common/cmd_log.c
common/cmd_mfsl.c
common/cmd_mii.c
common/cmd_misc.c
common/cmd_mmc.c
common/cmd_net.c
common/cmd_pci.c
common/cmd_portio.c
common/cmd_reginfo.c
common/cmd_reiser.c
common/cmd_scsi.c
common/cmd_spi.c
common/cmd_universe.c
common/cmd_usb.c
common/fdt_support.c
config.mk
cpu/mpc5xxx/cpu.c
cpu/mpc8260/cpu.c
cpu/mpc83xx/cpu.c
cpu/mpc83xx/pci.c
drivers/Makefile [deleted file]
drivers/block/Makefile [new file with mode: 0644]
drivers/block/ahci.c [moved from drivers/ahci.c with 100% similarity]
drivers/block/ata_piix.c [moved from drivers/ata_piix.c with 100% similarity]
drivers/block/sil680.c [moved from drivers/sil680.c with 100% similarity]
drivers/block/sym53c8xx.c [moved from drivers/sym53c8xx.c with 100% similarity]
drivers/block/systemace.c [moved from drivers/systemace.c with 100% similarity]
drivers/hwmon/Makefile [moved from dtt/Makefile with 97% similarity]
drivers/hwmon/adm1021.c [moved from dtt/adm1021.c with 100% similarity]
drivers/hwmon/ds1621.c [moved from dtt/ds1621.c with 100% similarity]
drivers/hwmon/ds1722.c [moved from drivers/ds1722.c with 100% similarity]
drivers/hwmon/ds1775.c [moved from dtt/ds1775.c with 100% similarity]
drivers/hwmon/lm75.c [moved from dtt/lm75.c with 100% similarity]
drivers/hwmon/lm81.c [moved from dtt/lm81.c with 100% similarity]
drivers/i2c/Makefile [new file with mode: 0644]
drivers/i2c/fsl_i2c.c [moved from drivers/fsl_i2c.c with 100% similarity]
drivers/i2c/omap1510_i2c.c [moved from drivers/omap1510_i2c.c with 100% similarity]
drivers/i2c/omap24xx_i2c.c [moved from drivers/omap24xx_i2c.c with 100% similarity]
drivers/i2c/tsi108_i2c.c [moved from drivers/tsi108_i2c.c with 100% similarity]
drivers/input/Makefile [new file with mode: 0644]
drivers/input/i8042.c [moved from drivers/i8042.c with 100% similarity]
drivers/input/keyboard.c [moved from drivers/keyboard.c with 100% similarity]
drivers/input/pc_keyb.c [moved from drivers/pc_keyb.c with 100% similarity]
drivers/input/ps2mult.c [moved from drivers/ps2mult.c with 100% similarity]
drivers/input/ps2ser.c [moved from drivers/ps2ser.c with 100% similarity]
drivers/misc/Makefile [new file with mode: 0644]
drivers/misc/ali512x.c [moved from drivers/ali512x.c with 100% similarity]
drivers/misc/ns87308.c [moved from drivers/ns87308.c with 100% similarity]
drivers/misc/status_led.c [moved from drivers/status_led.c with 100% similarity]
drivers/mtd/Makefile [new file with mode: 0644]
drivers/mtd/at45.c [moved from drivers/at45.c with 100% similarity]
drivers/mtd/cfi_flash.c [moved from drivers/cfi_flash.c with 100% similarity]
drivers/mtd/dataflash.c [moved from drivers/dataflash.c with 100% similarity]
drivers/mtd/mw_eeprom.c [moved from drivers/mw_eeprom.c with 100% similarity]
drivers/mtd/nand/Makefile [moved from drivers/nand/Makefile with 100% similarity]
drivers/mtd/nand/diskonchip.c [moved from drivers/nand/diskonchip.c with 100% similarity]
drivers/mtd/nand/nand.c [moved from drivers/nand/nand.c with 100% similarity]
drivers/mtd/nand/nand_base.c [moved from drivers/nand/nand_base.c with 100% similarity]
drivers/mtd/nand/nand_bbt.c [moved from drivers/nand/nand_bbt.c with 100% similarity]
drivers/mtd/nand/nand_ecc.c [moved from drivers/nand/nand_ecc.c with 100% similarity]
drivers/mtd/nand/nand_ids.c [moved from drivers/nand/nand_ids.c with 100% similarity]
drivers/mtd/nand/nand_util.c [moved from drivers/nand/nand_util.c with 100% similarity]
drivers/mtd/nand_legacy/Makefile [moved from drivers/nand_legacy/Makefile with 100% similarity]
drivers/mtd/nand_legacy/nand_legacy.c [moved from drivers/nand_legacy/nand_legacy.c with 100% similarity]
drivers/mtd/onenand/Makefile [moved from drivers/onenand/Makefile with 100% similarity]
drivers/mtd/onenand/onenand_base.c [moved from drivers/onenand/onenand_base.c with 100% similarity]
drivers/mtd/onenand/onenand_bbt.c [moved from drivers/onenand/onenand_bbt.c with 100% similarity]
drivers/net/3c589.c [moved from drivers/3c589.c with 100% similarity]
drivers/net/3c589.h [moved from drivers/3c589.h with 100% similarity]
drivers/net/5701rls.c [moved from drivers/5701rls.c with 100% similarity]
drivers/net/5701rls.h [moved from drivers/5701rls.h with 100% similarity]
drivers/net/8390.h [moved from drivers/8390.h with 100% similarity]
drivers/net/Makefile
drivers/net/bcm570x.c [moved from drivers/bcm570x.c with 100% similarity]
drivers/net/bcm570x_autoneg.c [moved from drivers/bcm570x_autoneg.c with 100% similarity]
drivers/net/bcm570x_autoneg.h [moved from drivers/bcm570x_autoneg.h with 100% similarity]
drivers/net/bcm570x_bits.h [moved from drivers/bcm570x_bits.h with 100% similarity]
drivers/net/bcm570x_debug.h [moved from drivers/bcm570x_debug.h with 100% similarity]
drivers/net/bcm570x_lm.h [moved from drivers/bcm570x_lm.h with 100% similarity]
drivers/net/bcm570x_mm.h [moved from drivers/bcm570x_mm.h with 100% similarity]
drivers/net/bcm570x_queue.h [moved from drivers/bcm570x_queue.h with 100% similarity]
drivers/net/cs8900.c [moved from drivers/cs8900.c with 100% similarity]
drivers/net/cs8900.h [moved from drivers/cs8900.h with 100% similarity]
drivers/net/dc2114x.c [moved from drivers/dc2114x.c with 100% similarity]
drivers/net/dm9000x.c [moved from drivers/dm9000x.c with 100% similarity]
drivers/net/dm9000x.h [moved from drivers/dm9000x.h with 100% similarity]
drivers/net/e1000.c [moved from drivers/e1000.c with 100% similarity]
drivers/net/e1000.h [moved from drivers/e1000.h with 100% similarity]
drivers/net/eepro100.c [moved from drivers/eepro100.c with 100% similarity]
drivers/net/enc28j60.c [moved from drivers/enc28j60.c with 100% similarity]
drivers/net/inca-ip_sw.c [moved from drivers/inca-ip_sw.c with 100% similarity]
drivers/net/ks8695eth.c [moved from drivers/ks8695eth.c with 100% similarity]
drivers/net/lan91c96.c [moved from drivers/lan91c96.c with 100% similarity]
drivers/net/lan91c96.h [moved from drivers/lan91c96.h with 100% similarity]
drivers/net/macb.c [moved from drivers/macb.c with 100% similarity]
drivers/net/macb.h [moved from drivers/macb.h with 100% similarity]
drivers/net/natsemi.c [moved from drivers/natsemi.c with 100% similarity]
drivers/net/ne2000.c [moved from drivers/ne2000.c with 100% similarity]
drivers/net/ne2000.h [moved from drivers/ne2000.h with 100% similarity]
drivers/net/netarm_eth.c [moved from drivers/netarm_eth.c with 100% similarity]
drivers/net/netarm_eth.h [moved from drivers/netarm_eth.h with 100% similarity]
drivers/net/netconsole.c [moved from drivers/netconsole.c with 100% similarity]
drivers/net/nicext.h [moved from drivers/nicext.h with 100% similarity]
drivers/net/ns7520_eth.c [moved from drivers/ns7520_eth.c with 100% similarity]
drivers/net/ns8382x.c [moved from drivers/ns8382x.c with 100% similarity]
drivers/net/ns9750_eth.c [moved from drivers/ns9750_eth.c with 100% similarity]
drivers/net/pcnet.c [moved from drivers/pcnet.c with 100% similarity]
drivers/net/plb2800_eth.c [moved from drivers/plb2800_eth.c with 100% similarity]
drivers/net/rtl8019.c [moved from drivers/rtl8019.c with 100% similarity]
drivers/net/rtl8019.h [moved from drivers/rtl8019.h with 100% similarity]
drivers/net/rtl8139.c [moved from drivers/rtl8139.c with 100% similarity]
drivers/net/rtl8169.c [moved from drivers/rtl8169.c with 100% similarity]
drivers/net/s3c4510b_eth.c [moved from drivers/s3c4510b_eth.c with 100% similarity]
drivers/net/s3c4510b_eth.h [moved from drivers/s3c4510b_eth.h with 100% similarity]
drivers/net/sk98lin/Makefile [moved from drivers/sk98lin/Makefile with 100% similarity]
drivers/net/sk98lin/h/lm80.h [moved from drivers/sk98lin/h/lm80.h with 100% similarity]
drivers/net/sk98lin/h/skaddr.h [moved from drivers/sk98lin/h/skaddr.h with 100% similarity]
drivers/net/sk98lin/h/skcsum.h [moved from drivers/sk98lin/h/skcsum.h with 100% similarity]
drivers/net/sk98lin/h/skdebug.h [moved from drivers/sk98lin/h/skdebug.h with 100% similarity]
drivers/net/sk98lin/h/skdrv1st.h [moved from drivers/sk98lin/h/skdrv1st.h with 100% similarity]
drivers/net/sk98lin/h/skdrv2nd.h [moved from drivers/sk98lin/h/skdrv2nd.h with 100% similarity]
drivers/net/sk98lin/h/skerror.h [moved from drivers/sk98lin/h/skerror.h with 100% similarity]
drivers/net/sk98lin/h/skgedrv.h [moved from drivers/sk98lin/h/skgedrv.h with 100% similarity]
drivers/net/sk98lin/h/skgehw.h [moved from drivers/sk98lin/h/skgehw.h with 100% similarity]
drivers/net/sk98lin/h/skgehwt.h [moved from drivers/sk98lin/h/skgehwt.h with 100% similarity]
drivers/net/sk98lin/h/skgei2c.h [moved from drivers/sk98lin/h/skgei2c.h with 100% similarity]
drivers/net/sk98lin/h/skgeinit.h [moved from drivers/sk98lin/h/skgeinit.h with 100% similarity]
drivers/net/sk98lin/h/skgepnm2.h [moved from drivers/sk98lin/h/skgepnm2.h with 100% similarity]
drivers/net/sk98lin/h/skgepnmi.h [moved from drivers/sk98lin/h/skgepnmi.h with 100% similarity]
drivers/net/sk98lin/h/skgesirq.h [moved from drivers/sk98lin/h/skgesirq.h with 100% similarity]
drivers/net/sk98lin/h/ski2c.h [moved from drivers/sk98lin/h/ski2c.h with 100% similarity]
drivers/net/sk98lin/h/skqueue.h [moved from drivers/sk98lin/h/skqueue.h with 100% similarity]
drivers/net/sk98lin/h/skrlmt.h [moved from drivers/sk98lin/h/skrlmt.h with 100% similarity]
drivers/net/sk98lin/h/sktimer.h [moved from drivers/sk98lin/h/sktimer.h with 100% similarity]
drivers/net/sk98lin/h/sktypes.h [moved from drivers/sk98lin/h/sktypes.h with 100% similarity]
drivers/net/sk98lin/h/skversion.h [moved from drivers/sk98lin/h/skversion.h with 100% similarity]
drivers/net/sk98lin/h/skvpd.h [moved from drivers/sk98lin/h/skvpd.h with 100% similarity]
drivers/net/sk98lin/h/xmac_ii.h [moved from drivers/sk98lin/h/xmac_ii.h with 100% similarity]
drivers/net/sk98lin/skaddr.c [moved from drivers/sk98lin/skaddr.c with 100% similarity]
drivers/net/sk98lin/skcsum.c [moved from drivers/sk98lin/skcsum.c with 100% similarity]
drivers/net/sk98lin/skge.c [moved from drivers/sk98lin/skge.c with 100% similarity]
drivers/net/sk98lin/skgehwt.c [moved from drivers/sk98lin/skgehwt.c with 100% similarity]
drivers/net/sk98lin/skgeinit.c [moved from drivers/sk98lin/skgeinit.c with 100% similarity]
drivers/net/sk98lin/skgemib.c [moved from drivers/sk98lin/skgemib.c with 100% similarity]
drivers/net/sk98lin/skgepnmi.c [moved from drivers/sk98lin/skgepnmi.c with 100% similarity]
drivers/net/sk98lin/skgesirq.c [moved from drivers/sk98lin/skgesirq.c with 100% similarity]
drivers/net/sk98lin/ski2c.c [moved from drivers/sk98lin/ski2c.c with 100% similarity]
drivers/net/sk98lin/sklm80.c [moved from drivers/sk98lin/sklm80.c with 100% similarity]
drivers/net/sk98lin/skproc.c [moved from drivers/sk98lin/skproc.c with 100% similarity]
drivers/net/sk98lin/skqueue.c [moved from drivers/sk98lin/skqueue.c with 100% similarity]
drivers/net/sk98lin/skrlmt.c [moved from drivers/sk98lin/skrlmt.c with 100% similarity]
drivers/net/sk98lin/sktimer.c [moved from drivers/sk98lin/sktimer.c with 100% similarity]
drivers/net/sk98lin/skvpd.c [moved from drivers/sk98lin/skvpd.c with 100% similarity]
drivers/net/sk98lin/skxmac2.c [moved from drivers/sk98lin/skxmac2.c with 100% similarity]
drivers/net/sk98lin/u-boot_compat.h [moved from drivers/sk98lin/u-boot_compat.h with 100% similarity]
drivers/net/sk98lin/uboot_drv.c [moved from drivers/sk98lin/uboot_drv.c with 100% similarity]
drivers/net/sk98lin/uboot_skb.c [moved from drivers/sk98lin/uboot_skb.c with 100% similarity]
drivers/net/smc91111.c [moved from drivers/smc91111.c with 100% similarity]
drivers/net/smc91111.h [moved from drivers/smc91111.h with 100% similarity]
drivers/net/tigon3.c [moved from drivers/tigon3.c with 100% similarity]
drivers/net/tigon3.h [moved from drivers/tigon3.h with 100% similarity]
drivers/net/tsec.c [moved from drivers/tsec.c with 100% similarity]
drivers/net/tsec.h [moved from drivers/tsec.h with 100% similarity]
drivers/net/tsi108_eth.c [moved from drivers/tsi108_eth.c with 100% similarity]
drivers/net/uli526x.c [moved from drivers/uli526x.c with 100% similarity]
drivers/pci/Makefile [new file with mode: 0644]
drivers/pci/fsl_pci_init.c [moved from drivers/fsl_pci_init.c with 100% similarity]
drivers/pci/pci.c [moved from drivers/pci.c with 100% similarity]
drivers/pci/pci_auto.c [moved from drivers/pci_auto.c with 100% similarity]
drivers/pci/pci_indirect.c [moved from drivers/pci_indirect.c with 100% similarity]
drivers/pci/tsi108_pci.c [moved from drivers/tsi108_pci.c with 100% similarity]
drivers/pci/w83c553f.c [moved from drivers/w83c553f.c with 100% similarity]
drivers/pcmcia/Makefile [new file with mode: 0644]
drivers/pcmcia/i82365.c [moved from drivers/i82365.c with 100% similarity]
drivers/pcmcia/mpc8xx_pcmcia.c [moved from drivers/mpc8xx_pcmcia.c with 100% similarity]
drivers/pcmcia/pxa_pcmcia.c [moved from drivers/pxa_pcmcia.c with 100% similarity]
drivers/pcmcia/rpx_pcmcia.c [moved from drivers/rpx_pcmcia.c with 100% similarity]
drivers/pcmcia/ti_pci1410a.c [moved from drivers/ti_pci1410a.c with 100% similarity]
drivers/pcmcia/tqm8xx_pcmcia.c [moved from drivers/tqm8xx_pcmcia.c with 100% similarity]
drivers/rtc/Makefile [moved from rtc/Makefile with 100% similarity]
drivers/rtc/bf5xx_rtc.c [moved from rtc/bf5xx_rtc.c with 100% similarity]
drivers/rtc/date.c [moved from rtc/date.c with 100% similarity]
drivers/rtc/ds12887.c [moved from rtc/ds12887.c with 100% similarity]
drivers/rtc/ds1302.c [moved from rtc/ds1302.c with 100% similarity]
drivers/rtc/ds1306.c [moved from rtc/ds1306.c with 100% similarity]
drivers/rtc/ds1307.c [moved from rtc/ds1307.c with 100% similarity]
drivers/rtc/ds1337.c [moved from rtc/ds1337.c with 100% similarity]
drivers/rtc/ds1374.c [moved from rtc/ds1374.c with 100% similarity]
drivers/rtc/ds1556.c [moved from rtc/ds1556.c with 100% similarity]
drivers/rtc/ds164x.c [moved from rtc/ds164x.c with 100% similarity]
drivers/rtc/ds174x.c [moved from rtc/ds174x.c with 100% similarity]
drivers/rtc/ds3231.c [moved from rtc/ds3231.c with 100% similarity]
drivers/rtc/m41t11.c [moved from rtc/m41t11.c with 100% similarity]
drivers/rtc/m48t35ax.c [moved from rtc/m48t35ax.c with 100% similarity]
drivers/rtc/max6900.c [moved from rtc/max6900.c with 100% similarity]
drivers/rtc/mc146818.c [moved from rtc/mc146818.c with 100% similarity]
drivers/rtc/mcfrtc.c [moved from rtc/mcfrtc.c with 100% similarity]
drivers/rtc/mk48t59.c [moved from rtc/mk48t59.c with 100% similarity]
drivers/rtc/mpc5xxx.c [moved from rtc/mpc5xxx.c with 100% similarity]
drivers/rtc/mpc8xx.c [moved from rtc/mpc8xx.c with 100% similarity]
drivers/rtc/pcf8563.c [moved from rtc/pcf8563.c with 100% similarity]
drivers/rtc/rs5c372.c [moved from rtc/rs5c372.c with 100% similarity]
drivers/rtc/s3c24x0_rtc.c [moved from rtc/s3c24x0_rtc.c with 100% similarity]
drivers/serial/Makefile
drivers/serial/atmel_usart.c [moved from drivers/atmel_usart.c with 100% similarity]
drivers/serial/atmel_usart.h [moved from drivers/atmel_usart.h with 100% similarity]
drivers/serial/ns16550.c [moved from drivers/ns16550.c with 100% similarity]
drivers/serial/ns9750_serial.c [moved from drivers/ns9750_serial.c with 100% similarity]
drivers/serial/s3c4510b_uart.c [moved from drivers/s3c4510b_uart.c with 100% similarity]
drivers/serial/s3c4510b_uart.h [moved from drivers/s3c4510b_uart.h with 100% similarity]
drivers/serial/serial.c [moved from drivers/serial.c with 100% similarity]
drivers/serial/serial_max3100.c [moved from drivers/serial_max3100.c with 100% similarity]
drivers/serial/serial_xuartlite.c [moved from drivers/serial_xuartlite.c with 100% similarity]
drivers/serial/usbtty.c [moved from drivers/usbtty.c with 100% similarity]
drivers/serial/usbtty.h [moved from drivers/usbtty.h with 100% similarity]
drivers/usb/Makefile [new file with mode: 0644]
drivers/usb/isp116x-hcd.c [moved from drivers/isp116x-hcd.c with 100% similarity]
drivers/usb/isp116x.h [moved from drivers/isp116x.h with 100% similarity]
drivers/usb/sl811.h [moved from drivers/sl811.h with 100% similarity]
drivers/usb/sl811_usb.c [moved from drivers/sl811_usb.c with 99% similarity]
drivers/usb/usb_ohci.c [moved from drivers/usb_ohci.c with 100% similarity]
drivers/usb/usb_ohci.h [moved from drivers/usb_ohci.h with 100% similarity]
drivers/usb/usbdcore.c [moved from drivers/usbdcore.c with 100% similarity]
drivers/usb/usbdcore_ep0.c [moved from drivers/usbdcore_ep0.c with 100% similarity]
drivers/usb/usbdcore_mpc8xx.c [moved from drivers/usbdcore_mpc8xx.c with 100% similarity]
drivers/usb/usbdcore_omap1510.c [moved from drivers/usbdcore_omap1510.c with 100% similarity]
drivers/video/Makefile [new file with mode: 0644]
drivers/video/ati_ids.h [moved from drivers/ati_ids.h with 100% similarity]
drivers/video/ati_radeon_fb.c [moved from drivers/ati_radeon_fb.c with 99% similarity]
drivers/video/ati_radeon_fb.h [moved from drivers/ati_radeon_fb.h with 100% similarity]
drivers/video/cfb_console.c [moved from drivers/cfb_console.c with 100% similarity]
drivers/video/ct69000.c [moved from drivers/ct69000.c with 100% similarity]
drivers/video/sed13806.c [moved from drivers/sed13806.c with 100% similarity]
drivers/video/sed156x.c [moved from drivers/sed156x.c with 100% similarity]
drivers/video/sm501.c [moved from drivers/sm501.c with 100% similarity]
drivers/video/smiLynxEM.c [moved from drivers/smiLynxEM.c with 100% similarity]
drivers/video/videomodes.c [moved from drivers/videomodes.c with 100% similarity]
drivers/video/videomodes.h [moved from drivers/videomodes.h with 100% similarity]
examples/smc91111_eeprom.c
include/configs/sbc2410x.h
include/configs/smdk2410.h
include/fdt.h
include/fdt_support.h
include/libfdt.h
lib_arm/board.c
lib_blackfin/board.c
libfdt/Makefile
libfdt/fdt.c
libfdt/fdt_ro.c
libfdt/fdt_rw.c
libfdt/fdt_strerror.c
libfdt/fdt_sw.c
libfdt/fdt_wip.c
libfdt/libfdt_internal.h
nand_spl/board/amcc/acadia/Makefile
nand_spl/board/amcc/bamboo/Makefile
nand_spl/board/amcc/sequoia/Makefile
tools/scripts/define2mk.sed [new file with mode: 0644]

index bc8c01e4084e8ea7729cbaab46b292e8a7503265..015a4ac01b56d96c30a23d21c632063437aac53e 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,311 @@
+commit a5f601fd1b1278deae5aa9fc27a232b0d1c1c788
+Author: Wolfgang Denk <wd@denx.de>
+Date:  Mon Nov 26 19:18:21 2007 +0100
+
+    Cleanup coding style; update CHANGELOG
+
+    Signed-off-by: Wolfgang Denk <wd@denx.de>
+
+commit 3deca9d44767efd1b83f4b701f0dbf21a7595f7b
+Author: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+Date:  Sun Nov 25 22:39:25 2007 +0100
+
+    MAKEALL: add missing 512x boards in ppc
+
+    Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+
+commit a340c325e668ca7386c2276387681720be9c3757
+Author: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+Date:  Sun Nov 25 18:45:47 2007 +0100
+
+    Makefile : fix tags ctags etags with new drivers organization
+
+    Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+
+commit 87ddedd6ad804427ce125ceaa076d7a4f74e9d5d
+Author: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+Date:  Sun Nov 25 18:45:47 2007 +0100
+
+    Makefile : fix tags ctags etags with new drivers organization
+
+    Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+
+commit 59829cc189378c142c13d2aa8d9a897d8bef3961
+Author: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+Date:  Sat Nov 24 21:26:56 2007 +0100
+
+    drivers/mtd : move mtd drivers to drivers/mtd
+
+    Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+
+commit 318c0b90431f2648552e5ade78833f42652ce859
+Author: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+Date:  Sat Nov 24 21:17:55 2007 +0100
+
+    drivers/misc : move misc drivers to drivers/misc
+
+    Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+
+commit 33daf5b7858807cb4ce4158c2c56524671c14c08
+Author: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+Date:  Sat Nov 24 21:13:59 2007 +0100
+
+    drivers/block : move block drivers to drivers/block
+
+    Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+
+commit 0c698dcaa70275eb8814f665b545547cee013892
+Author: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+Date:  Sat Nov 24 20:59:50 2007 +0100
+
+    drivers/rtc : move rtc drivers to drivers/rtc
+
+    Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+
+commit f868cc5a50757d94f36c312395481cb0f187d9e6
+Author: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+Date:  Sat Nov 24 20:14:44 2007 +0100
+
+    drivers/hwmon : move hardware monitor drviers to drivers/hwmon
+
+    Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+
+commit 16b195c82a18cbfd164800f17a1ef9db2e48331a
+Author: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+Date:  Sat Nov 24 19:46:45 2007 +0100
+
+    drivers/input : move input drivers to drivers/input
+
+    Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+
+commit e4558666293364fc3af1c1d9381ca933fa0f1275
+Author: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+Date:  Sat Nov 24 19:40:11 2007 +0100
+
+    drivers/usb : move usb drivers to drivers/usb
+
+    Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+
+commit 1378df792a7ff3abd1bf54a63f5475784f5b083c
+Author: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+Date:  Sat Nov 24 19:33:38 2007 +0100
+
+    drivers/serial : move serial drivers to drivers/serial
+
+    Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+
+commit 2439e4bfa111babf4bc07ba20efbf3e36036813e
+Author: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+Date:  Wed Nov 21 21:19:24 2007 +0100
+
+    drivers/net : move net drivers to drivers/net
+
+    Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+
+commit 352d259130b349fe9593b8dada641bd78a9659e5
+Author: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+Date:  Tue Nov 20 20:41:48 2007 +0100
+
+    drivers/video : move video drivers to drivers/video
+
+    Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+
+commit 73646217186aa17afc8e305c5f06f06dd335eaad
+Author: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+Date:  Tue Nov 20 20:33:09 2007 +0100
+
+    drivers/pcmcia : move pcmcia drivers to drivers/pcmcia
+
+    Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+
+commit 93a686ee9c5ddc6fa368c32cfbfde6f6724599fc
+Author: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+Date:  Tue Nov 20 20:28:09 2007 +0100
+
+    drivers/pci : move pci drivers to drivers/pci
+
+    Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+
+commit 9162352817579840d7802da6d85872b3ca003c97
+Author: Gerald Van Baren <vanbaren@cideas.com>
+Date:  Thu Nov 22 17:23:23 2007 -0500
+
+    Fix fdt printing for updated libfdt
+
+    Also improve printing (adopt dtc v1 "c style" hex format), whitespace cleanup.
+
+    Signed-off-by: Gerald Van Baren <vanbaren@cideas.com>
+
+commit 9eb77cea1fa12d5969eb26a1d1d81da381bd6b1c
+Author: Kumar Gala <galak@kernel.crashing.org>
+Date:  Wed Nov 21 13:30:15 2007 -0600
+
+    Add additional fdt fixup helper functions
+
+    Added the following fdt fixup helpers:
+     * do_fixup_by_prop{_u32} - Find matching nodes by property name/value
+     * do_fixup_by_compat{_u32} - Find matching nodes by compat
+
+    The _u32 variants work the same only the property they are setting
+    is know to be a 32-bit integer instead of a byte buffer.
+
+    Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
+
+commit ab544633abdd14f4dd5d92e500b73eb59ef57e67
+Author: Kumar Gala <galak@kernel.crashing.org>
+Date:  Wed Nov 21 11:11:03 2007 -0600
+
+    Add fdt_fixup_ethernet helper to set mac addresses
+
+    Added a fixup helper that uses aliases to set mac addresses
+    in the device tree based on the bd_t
+
+    Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
+
+commit dbaf07ce620aab249e3502b20a986234a6af1d3a
+Author: Kumar Gala <galak@kernel.crashing.org>
+Date:  Wed Nov 21 14:07:46 2007 -0600
+
+    Fix warnings from import of libfdt
+
+    cmd_fdt.c: In function fdt_print:
+    cmd_fdt.c:586: warning: assignment discards qualifiers from pointer target type
+    cmd_fdt.c:613: warning: assignment discards qualifiers from pointer target type
+    cmd_fdt.c:635: warning: assignment discards qualifiers from pointer target type
+    cmd_fdt.c:636: warning: assignment discards qualifiers from pointer target type
+
+    Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
+
+commit 8d04f02f6224e6983f4812ea4da704950ec8539c
+Author: Kumar Gala <galak@kernel.crashing.org>
+Date:  Wed Oct 24 11:04:22 2007 -0500
+
+    Update libfdt from device tree compiler (dtc)
+
+    Update libfdt to commit 8eaf5e358366017aa2e846c5038d1aa19958314e from
+    the device tree compiler (dtc) project.
+
+    Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
+
+commit e93becf80d732b64aef81b23e8b6ece02c40533d
+Author: Kumar Gala <galak@kernel.crashing.org>
+Date:  Sat Nov 3 19:46:28 2007 -0500
+
+    Move do_fixup* for libfdt into common code
+
+    Moved the generic fixup handling code out of cpu/mpc5xxx and cpu/mpc8260
+    into common/fdt_support.c and renamed:
+
+    do_fixup() -> do_fixup_by_path()
+    do_fixup_u32()     -> do_fixup_by_path_u32()
+
+    Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
+
+commit f738b4a75998f42a7408defadc9baac7a31c92db
+Author: Kumar Gala <galak@kernel.crashing.org>
+Date:  Thu Oct 25 16:15:07 2007 -0500
+
+    Make no options to fdt print default to '/'
+
+    Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
+
+commit a3c2933e02503fe36ade2c1b65af46f2b7a168e7
+Author: Kumar Gala <galak@kernel.crashing.org>
+Date:  Wed Oct 24 10:21:57 2007 -0500
+
+    Removed some nonused fdt functions and moved fdt_find_and_setprop out of libfdt
+
+    Removed:
+       fdt_node_is_compatible
+       fdt_find_node_by_type
+       fdt_find_compatible_node
+
+    To ease merge of newer libfdt as we aren't using them anywhere at this time.
+
+    Also moved fdt_find_and_setprop out of libfdt into fdt_support.c for the same
+    reason.
+
+    Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
+
+commit 98e2867cc85409b919f862e6c16026461ec955df
+Author: Grant Likely <grant.likely@secretlab.ca>
+Date:  Wed Nov 21 09:19:37 2007 -0700
+
+    [BUILD] Remove libraries when updating autoconf.mk
+
+    Fix library problems caused by conditional compilation.  Using
+    autoconf.mk to decide which files to compile has caused a problem when
+    changing configuration from one board to another without clearing out
+    the library (*.a) files.
+
+    It used to be that the linker was always passed the same list of .o
+    files when building the .a files.  However, that is not longer true
+    with conditional compilation.  Now, a different board config will have
+    a different file list passed to the linker.  The problem occurs when
+    a library has already been built and the board config is changed.
+
+    Since the linker will update instead of replace a preexisting library,
+    then if the file list changes to remove some object files the old
+    objects will still exist in the library.
+
+    The solution is to remove all old library files when autoconf.mk is
+    made.
+
+    Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
+
+commit ed1353d74b9ce8a7fcd660570b848a184d614b5f
+Author: Kumar Gala <galak@kernel.crashing.org>
+Date:  Wed Nov 21 08:49:50 2007 -0600
+
+    [BUILD] conditionally compile libfdt/*.c in libfdt/Makefile
+
+    Modify libfdt/Makefile to conditionally compile the *.c files based
+    on the board config.
+
+    Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
+
+commit 4a43719a7738712811d822ca8125427b27a55cdc
+Author: Grant Likely <grant.likely@secretlab.ca>
+Date:  Mon Sep 24 09:05:31 2007 -0600
+
+    [BUILD] conditionally compile common/cmd_*.c in common/Makefile
+
+    Modify common/Makefile to conditionally compile the cmd_*.c files based
+    on the board config.
+
+    Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
+
+commit 2f155f6c0a1f5e9a306a3f1f4fbe067db7ced3b1
+Author: Grant Likely <grant.likely@secretlab.ca>
+Date:  Mon Sep 24 09:05:31 2007 -0600
+
+    [BUILD] Generate include/autoconf.mk from board config files
+
+    Use cpp and sed to postprocess config.h and import the defined values
+    into include/autoconf.mk.  autoconf.mk is then included by config.mk to
+    give 'make' access to the board configuration.
+
+    Doing this enables conditional compilation at the Makefile level instead
+    of by wrapping every .c file with #ifdef/#endif wrappers.
+
+    Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
+
+commit 080c646dbf474a109c3f85718fb01ce042a38c45
+Author: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+Date:  Tue Nov 20 20:14:18 2007 +0100
+
+    drivers/i2c : move i2c drivers to drivers/i2c
+
+    Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+
+commit 9a337ddc154a10a26f117fd147b009abcdeba75a
+Author: Wolfgang Denk <wd@denx.de>
+Date:  Mon Nov 19 22:20:24 2007 +0100
+
+    Prepare for 1.3.0 release.
+
+    Signed-off-by: Wolfgang Denk <wd@denx.de>
+
 commit f30ad49b16bf998b03c1a5228b6c86369d61c258
 Author: Haiying Wang <Haiying.Wang@freescale.com>
 Date:  Mon Nov 19 10:02:13 2007 -0500
@@ -345,6 +653,76 @@ Date:      Wed Nov 7 08:19:19 2007 +0100
 
     Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
 
+commit 4d4faae65e115e327425cd514c1a35146a85166b
+Author: Grant Likely <grant.likely@secretlab.ca>
+Date:  Mon Sep 24 09:05:31 2007 -0600
+
+    Group PCI and PCMCIA drivers in drivers/Makefile
+
+    Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
+
+commit 5798f87dc10a496d79d3177b9f5a76488987fd35
+Author: Grant Likely <grant.likely@secretlab.ca>
+Date:  Mon Sep 24 09:05:31 2007 -0600
+
+    Group block/flash drivers in drivers/Makefile
+
+    Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
+
+commit df58c81551700f058b44cacf55a7997fa63bfe0a
+Author: Grant Likely <grant.likely@secretlab.ca>
+Date:  Mon Sep 24 09:05:31 2007 -0600
+
+    Group USB drivers in drivers/Makefile
+
+    Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
+
+commit 5dbb6ed622e539b0c8493ef7e578d3a533181d29
+Author: Grant Likely <grant.likely@secretlab.ca>
+Date:  Mon Sep 24 09:05:30 2007 -0600
+
+    Group i2c drivers in drivers/Makefile
+
+    Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
+
+commit ec00c76de0e5971273905998d62d6bb119324218
+Author: Grant Likely <grant.likely@secretlab.ca>
+Date:  Mon Sep 24 09:05:30 2007 -0600
+
+    Group console drivers in drivers/Makefile
+
+    Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
+
+commit 754f230aa01b8c789fc31f8013c2487954073300
+Author: Grant Likely <grant.likely@secretlab.ca>
+Date:  Mon Sep 24 09:05:30 2007 -0600
+
+    Group network drivers in drivers/Makefile
+
+    Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
+
+commit f0037c56b0d12cd46215124667b9f83d60ef9391
+Author: Grant Likely <grant.likely@secretlab.ca>
+Date:  Mon Sep 24 09:05:30 2007 -0600
+
+    Build: split COBJS value into multiple lines
+
+    This change is in preparation for condtitionial compile support in the
+    build system.  By spliting them all into seperate lines now, subsequent
+    patches that change 'COBJS-y += ' into 'COBJS-$(CONFIG_<blah>) += ' will
+    be less invasive and easier to review
+
+    Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
+
+commit 1b4aaffe4fb2a5e95d9111a5d94fd1f89215dce4
+Author: Grant Likely <grant.likely@secretlab.ca>
+Date:  Mon Sep 24 09:05:30 2007 -0600
+
+    Add .gitignore files
+
+    Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
+    Acked-by: Kim Phillips <kim.phillips@freescale.com>
+
 commit 955413f35f054a82e40042f1dbcf501c6a05719b
 Author: Grant Likely <grant.likely@secretlab.ca>
 Date:  Thu Nov 15 08:27:52 2007 -0700
diff --git a/MAKEALL b/MAKEALL
index 7543d70d731c0a3945a3c5a425ac8eb8a6518b32..fce70eb233b12d602bf1487ab2581aca6f733ee5 100755 (executable)
--- a/MAKEALL
+++ b/MAKEALL
@@ -378,6 +378,7 @@ LIST_7xx="          \
 
 LIST_ppc="             \
        ${LIST_5xx}     \
+       ${LIST_512x}    \
        ${LIST_5xxx}    \
        ${LIST_8xx}     \
        ${LIST_8220}    \
index fd973f873023338e1501b804ec6fe8b133dd614f..76f35a4d17cd6cea6cbaee08517cb44beeb6a23e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -23,8 +23,8 @@
 
 VERSION = 1
 PATCHLEVEL = 3
-SUBLEVEL = 0
-EXTRAVERSION =
+SUBLEVEL = 1
+EXTRAVERSION = -rc1
 U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 VERSION_FILE = $(obj)include/version_autogenerated.h
 
@@ -208,22 +208,30 @@ LIBS += fs/cramfs/libcramfs.a fs/fat/libfat.a fs/fdos/libfdos.a fs/jffs2/libjffs
        fs/reiserfs/libreiserfs.a fs/ext2/libext2fs.a
 LIBS += net/libnet.a
 LIBS += disk/libdisk.a
-LIBS += rtc/librtc.a
-LIBS += dtt/libdtt.a
-LIBS += drivers/libdrivers.a
 LIBS += drivers/bios_emulator/libatibiosemu.a
-LIBS += drivers/nand/libnand.a
-LIBS += drivers/nand_legacy/libnand_legacy.a
-LIBS += drivers/onenand/libonenand.a
+LIBS += drivers/block/libblock.a
+LIBS += drivers/hwmon/libhwmon.a
+LIBS += drivers/i2c/libi2c.a
+LIBS += drivers/input/libinput.a
+LIBS += drivers/misc/libmisc.a
+LIBS += drivers/mtd/libmtd.a
+LIBS += drivers/mtd/nand/libnand.a
+LIBS += drivers/mtd/nand_legacy/libnand_legacy.a
+LIBS += drivers/mtd/onenand/libonenand.a
 LIBS += drivers/net/libnet.a
+LIBS += drivers/net/sk98lin/libsk98lin.a
+LIBS += drivers/pci/libpci.a
+LIBS += drivers/pcmcia/libpcmcia.a
 ifeq ($(CPU),mpc83xx)
 LIBS += drivers/qe/qe.a
 endif
 ifeq ($(CPU),mpc85xx)
 LIBS += drivers/qe/qe.a
 endif
+LIBS += drivers/rtc/librtc.a
 LIBS += drivers/serial/libserial.a
-LIBS += drivers/sk98lin/libsk98lin.a
+LIBS += drivers/usb/libusb.a
+LIBS += drivers/video/libvideo.a
 LIBS += post/libpost.a post/drivers/libpostdrivers.a
 LIBS += $(shell if [ -d post/lib_$(ARCH) ]; then echo \
        "post/lib_$(ARCH)/libpost$(ARCH).a"; fi)
@@ -326,25 +334,65 @@ env:
 depend dep:    version
                for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir _depend ; done
 
+TAG_SUBDIRS += include
+TAG_SUBDIRS += lib_generic board/$(BOARDDIR)
+TAG_SUBDIRS += cpu/$(CPU)
+TAG_SUBDIRS += lib_$(ARCH)
+TAG_SUBDIRS += fs/cramfs
+TAG_SUBDIRS += fs/fat
+TAG_SUBDIRS += fs/fdos
+TAG_SUBDIRS += fs/jffs2
+TAG_SUBDIRS += net
+TAG_SUBDIRS += disk
+TAG_SUBDIRS += common
+TAG_SUBDIRS += drivers/bios_emulator
+TAG_SUBDIRS += drivers/block
+TAG_SUBDIRS += drivers/hwmon
+TAG_SUBDIRS += drivers/i2c
+TAG_SUBDIRS += drivers/input
+TAG_SUBDIRS += drivers/misc
+TAG_SUBDIRS += drivers/mtd
+TAG_SUBDIRS += drivers/mtd/nand
+TAG_SUBDIRS += drivers/mtd/nand_legacy
+TAG_SUBDIRS += drivers/mtd/onenand
+TAG_SUBDIRS += drivers/net
+TAG_SUBDIRS += drivers/net/sk98lin
+TAG_SUBDIRS += drivers/pci
+TAG_SUBDIRS += drivers/pcmcia
+TAG_SUBDIRS += drivers/qe
+TAG_SUBDIRS += drivers/rtc
+TAG_SUBDIRS += drivers/serial
+TAG_SUBDIRS += drivers/usb
+TAG_SUBDIRS += drivers/video
+
 tags ctags:
-               ctags -w -o $(OBJTREE)/ctags `find $(SUBDIRS) include \
-                               lib_generic board/$(BOARDDIR) cpu/$(CPU) lib_$(ARCH) \
-                               fs/cramfs fs/fat fs/fdos fs/jffs2 \
-                               net disk rtc dtt drivers drivers/sk98lin common \
-                       \( -name CVS -prune \) -o \( -name '*.[ch]' -print \)`
+               ctags -w -o $(OBJTREE)/ctags `find $(SUBDIRS) $(TAG_SUBDIRS) \
+                                               -name '*.[ch]' -print`
 
 etags:
-               etags -a -o $(OBJTREE)/etags `find $(SUBDIRS) include \
-                               lib_generic board/$(BOARDDIR) cpu/$(CPU) lib_$(ARCH) \
-                               fs/cramfs fs/fat fs/fdos fs/jffs2 \
-                               net disk rtc dtt drivers drivers/sk98lin common \
-                       \( -name CVS -prune \) -o \( -name '*.[ch]' -print \)`
+               etags -a -o $(OBJTREE)/etags `find $(SUBDIRS) $(TAG_SUBDIRS) \
+                                               -name '*.[ch]' -print`
 
 $(obj)System.map:      $(obj)u-boot
                @$(NM) $< | \
                grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
                sort > $(obj)System.map
 
+#
+# Auto-generate the autoconf.mk file (which is included by all makefiles)
+#
+# This target actually generates 2 files; autoconf.mk and autoconf.mk.dep.
+# the dep file is only include in this top level makefile to determine when
+# to regenerate the autoconf.mk file.
+$(OBJTREE)/include/autoconf.mk: $(obj)include/config.h
+       @echo Generating include/autoconf.mk
+       @# Generate the dependancies
+       @$(CC) -M $(HOST_CFLAGS) $(CPPFLAGS) -MQ $@ include/common.h > $@.dep
+       @# Extract the config macros
+       @$(CPP) $(CFLAGS) -dM include/common.h | sed -n -f tools/scripts/define2mk.sed >> $@
+
+sinclude $(OBJTREE)/include/autoconf.mk.dep
+
 #########################################################################
 else
 all $(obj)u-boot.hex $(obj)u-boot.srec $(obj)u-boot.bin \
@@ -364,7 +412,8 @@ CHANGELOG:
 
 unconfig:
        @rm -f $(obj)include/config.h $(obj)include/config.mk \
-               $(obj)board/*/config.tmp $(obj)board/*/*/config.tmp
+               $(obj)board/*/config.tmp $(obj)board/*/*/config.tmp \
+               $(obj)include/autoconf.mk $(obj)include/autoconf.mk.dep
 
 #========================================================================
 # PowerPC
index dc87a122a100621e88138fe34b5f1a709b96d524..7a5daefeb752f7b9318444d0125cde0650b41fad 100644 (file)
@@ -69,7 +69,7 @@ SECTIONS
     cpu/mpc85xx/interrupts.o (.text)
     cpu/mpc85xx/cpu_init.o (.text)
     cpu/mpc85xx/cpu.o (.text)
-    drivers/tsec.o (.text)
+    drivers/net/tsec.o (.text)
     cpu/mpc85xx/speed.o (.text)
     cpu/mpc85xx/pci.o (.text)
     common/dlmalloc.o (.text)
index 530ba5a721de26669b2de97e81697f03c5191c94..b19c481a96af3e1325b1f2a4d064859ad99d5cf6 100644 (file)
@@ -69,7 +69,7 @@ SECTIONS
     cpu/mpc85xx/interrupts.o (.text)
     cpu/mpc85xx/cpu_init.o (.text)
     cpu/mpc85xx/cpu.o (.text)
-    drivers/tsec.o (.text)
+    drivers/net/tsec.o (.text)
     cpu/mpc85xx/speed.o (.text)
     common/dlmalloc.o (.text)
     lib_generic/crc32.o (.text)
index 9285928dc428d89171745c1701628cb566dd0c7c..de0923a0d8b1e60c9104bf13292c9409a0fc036d 100644 (file)
@@ -69,7 +69,7 @@ SECTIONS
     cpu/mpc85xx/interrupts.o (.text)
     cpu/mpc85xx/cpu_init.o (.text)
     cpu/mpc85xx/cpu.o (.text)
-    drivers/tsec.o (.text)
+    drivers/net/tsec.o (.text)
     cpu/mpc85xx/speed.o (.text)
     cpu/mpc85xx/pci.o (.text)
     common/dlmalloc.o (.text)
index e2ab5b8e265faf1853ae1dfd84391679253b0c1b..4a86d3c5527b652ec2c339f32a7072010d67a745 100644 (file)
@@ -276,7 +276,7 @@ static void ft_blob_update(void *blob, bd_t *bd)
        memory_data[0] = cpu_to_be32(bd->bi_memstart);
        memory_data[1] = cpu_to_be32(bd->bi_memsize);
 
-       nodeoffset = fdt_find_node_by_path (blob, "/memory");
+       nodeoffset = fdt_path_offset (blob, "/memory");
        if (nodeoffset >= 0) {
                ret = fdt_setprop(blob, nodeoffset, "reg", memory_data,
                                        sizeof(memory_data));
index 6bc35c70f2d4fff16c663021e53d1303a7310d81..7818a2e1ee9c709d7c486f76a93949766dc81755 100644 (file)
@@ -269,7 +269,7 @@ ft_pci_setup(void *blob, bd_t *bd)
        int err;
        int tmp[2];
 
-       nodeoffset = fdt_find_node_by_path(blob, "/" OF_SOC "/pci@8500");
+       nodeoffset = fdt_path_offset(blob, "/" OF_SOC "/pci@8500");
        if (nodeoffset >= 0) {
                tmp[0] = cpu_to_be32(hose[0].first_busno);
                tmp[1] = cpu_to_be32(hose[0].last_busno);
index ae94a2f384f77fecf1c86cda180ff889ddfb3bac..7bcdccbcc6780094cd3b219bbe00ca670a7d76c8 100644 (file)
@@ -396,7 +396,7 @@ ft_pci_setup(void *blob, bd_t *bd)
        int err;
        int tmp[2];
 
-       nodeoffset = fdt_find_node_by_path(blob, "/" OF_SOC "/pci@8500");
+       nodeoffset = fdt_path_offset(blob, "/" OF_SOC "/pci@8500");
        if (nodeoffset >= 0) {
                tmp[0] = cpu_to_be32(pci_hose[0].first_busno);
                tmp[1] = cpu_to_be32(pci_hose[0].last_busno);
@@ -408,7 +408,7 @@ ft_pci_setup(void *blob, bd_t *bd)
                                  tmp, sizeof(tmp[0]));
        }
 #ifdef CONFIG_MPC83XX_PCI2
-       nodeoffset = fdt_find_node_by_path(blob, "/" OF_SOC "/pci@8600");
+       nodeoffset = fdt_path_offset(blob, "/" OF_SOC "/pci@8600");
        if (nodeoffset >= 0) {
                tmp[0] = cpu_to_be32(pci_hose[1].first_busno);
                tmp[1] = cpu_to_be32(pci_hose[1].last_busno);
index 5ca094d4cbcc52d3b6217631f061b8ab11138de9..a764a61867a58f4ca6f8e9a13552dbc8db1884f1 100644 (file)
@@ -342,7 +342,7 @@ ft_pci_setup(void *blob, bd_t *bd)
        int err;
        int tmp[2];
 
-       nodeoffset = fdt_find_node_by_path(blob, "/" OF_SOC "/pci@8500");
+       nodeoffset = fdt_path_offset(blob, "/" OF_SOC "/pci@8500");
        if (nodeoffset >= 0) {
                tmp[0] = cpu_to_be32(pci_hose[0].first_busno);
                tmp[1] = cpu_to_be32(pci_hose[0].last_busno);
@@ -354,7 +354,7 @@ ft_pci_setup(void *blob, bd_t *bd)
                                  tmp, sizeof(tmp[0]));
        }
 #ifdef CONFIG_MPC83XX_PCI2
-       nodeoffset = fdt_find_node_by_path(blob, "/" OF_SOC "/pci@8500");
+       nodeoffset = fdt_path_offset(blob, "/" OF_SOC "/pci@8500");
        if (nodeoffset >= 0) {
                tmp[0] = cpu_to_be32(pci_hose[1].first_busno);
                tmp[1] = cpu_to_be32(pci_hose[1].last_busno);
index cf7ef90443f7e97c7de11a43a456bfeae78db913..f18e532ef5fcdd38968592083245bc72b9422085 100644 (file)
@@ -269,7 +269,7 @@ ft_pci_setup(void *blob, bd_t *bd)
        int err;
        int tmp[2];
 
-       nodeoffset = fdt_find_node_by_path(blob, "/" OF_SOC "/pci@8500");
+       nodeoffset = fdt_path_offset(blob, "/" OF_SOC "/pci@8500");
        if (nodeoffset >= 0) {
                tmp[0] = cpu_to_be32(hose[0].first_busno);
                tmp[1] = cpu_to_be32(hose[0].last_busno);
index 227c49272cef347b406202c658b1a3f53734a66a..90a1b08e24996955ecf0e5ec23e27fbfb37de022 100644 (file)
@@ -31,7 +31,7 @@
 #include "../common/common_util.h"
 
 #if defined(CONFIG_DRIVER_CS8900)
-#include <../drivers/cs8900.h>
+#include <../drivers/net/cs8900.h>
 
 static uchar cs8900_chksum(ushort data)
 {
index fef3822aae2c2a9206e7b4a72b3799651f185a7c..0de594b65f27161b33039e22aa311bd6446d5dc4 100644 (file)
@@ -26,7 +26,7 @@
 
 #include <common.h>
 #include <exports.h>
-#include "../drivers/smc91111.h"
+#include "../drivers/net/smc91111.h"
 
 #define SMC_BASE_ADDRESS CONFIG_SMC91111_BASE
 
index 0ad1b666b917baf9dca15c1a51eb51a998cec447..d8ea6e5731c32d172f043fd3622349473c1cd639 100644 (file)
@@ -26,7 +26,7 @@
 
 #include <common.h>
 #include <exports.h>
-#include "../drivers/smc91111.h"
+#include "../drivers/net/smc91111.h"
 
 #define SMC_BASE_ADDRESS CONFIG_SMC91111_BASE
 
index 5c2592f5216383e4b9f5d385d8e6aa947b7a27a3..ace8cc7edc0663cd250c5ffebaab57aa344676e5 100644 (file)
@@ -33,53 +33,61 @@ COBJS-y += altera.o
 COBJS-y += bedbug.o
 COBJS-y += circbuf.o
 COBJS-y += cmd_autoscript.o
-COBJS-y += cmd_bdinfo.o
-COBJS-y += cmd_bedbug.o
-COBJS-y += cmd_bmp.o
+COBJS-$(CONFIG_CMD_BDI) += cmd_bdinfo.o
+COBJS-$(CONFIG_CMD_BEDBUG) += cmd_bedbug.o
+COBJS-$(CONFIG_CMD_BMP) += cmd_bmp.o
 COBJS-y += cmd_boot.o
 COBJS-y += cmd_bootm.o
-COBJS-y += cmd_cache.o
-COBJS-y += cmd_console.o
-COBJS-y += cmd_date.o
-COBJS-y += cmd_dcr.o
-COBJS-y += cmd_diag.o
-COBJS-y += cmd_display.o
-COBJS-y += cmd_doc.o
-COBJS-y += cmd_dtt.o
+COBJS-$(CONFIG_CMD_CACHE) += cmd_cache.o
+COBJS-$(CONFIG_CMD_CONSOLE) += cmd_console.o
+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_DOC) += cmd_doc.o
+COBJS-$(CONFIG_CMD_DTT) += cmd_dtt.o
 COBJS-y += cmd_eeprom.o
-COBJS-y += cmd_elf.o
-COBJS-y += cmd_ext2.o
-COBJS-y += cmd_fat.o
+COBJS-$(CONFIG_CMD_ELF) += cmd_elf.o
+COBJS-$(CONFIG_CMD_EXT2) += cmd_ext2.o
+COBJS-$(CONFIG_CMD_FAT) += cmd_fat.o
 COBJS-y += cmd_fdc.o
-COBJS-y += cmd_fdt.o
-COBJS-y += cmd_fdos.o
-COBJS-y += cmd_flash.o
-COBJS-y += cmd_fpga.o
-COBJS-y += cmd_i2c.o
-COBJS-y += cmd_ide.o
-COBJS-y += cmd_immap.o
-COBJS-y += cmd_itest.o
-COBJS-y += cmd_jffs2.o
+COBJS-$(CONFIG_OF_LIBFDT) += cmd_fdt.o
+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
+COBJS-$(CONFIG_CMD_ITEST) += cmd_itest.o
+COBJS-$(CONFIG_CMD_JFFS2) += cmd_jffs2.o
 COBJS-y += cmd_load.o
-COBJS-y += cmd_log.o
+COBJS-$(CONFIG_LOGBUFFER) += cmd_log.o
 COBJS-y += cmd_mem.o
-COBJS-y += cmd_mii.o
-COBJS-y += cmd_misc.o
-COBJS-y += cmd_mmc.o
+COBJS-$(CONFIG_CMD_MII) += cmd_mii.o
+COBJS-$(CONFIG_CMD_MISC) += cmd_misc.o
+COBJS-$(CONFIG_CMD_MMC) += cmd_mmc.o
 COBJS-y += cmd_nand.o
-COBJS-y += cmd_net.o
+COBJS-$(CONFIG_CMD_NET) += cmd_net.o
 COBJS-y += cmd_nvedit.o
 COBJS-y += cmd_onenand.o
-COBJS-y += cmd_pci.o
+ifdef CONFIG_PCI
+COBJS-$(CONFIG_CMD_PCI) += cmd_pci.o
+endif
 COBJS-y += cmd_pcmcia.o
-COBJS-y += cmd_portio.o
-COBJS-y += cmd_reginfo.o
-COBJS-y += cmd_reiser.o
+COBJS-$(CONFIG_CMD_PORTIO) += cmd_portio.o
+COBJS-$(CONFIG_CMD_REGINFO) += cmd_reginfo.o
+COBJS-$(CONFIG_CMD_REISER) += cmd_reiser.o
 COBJS-y += cmd_sata.o
-COBJS-y += cmd_scsi.o
-COBJS-y += cmd_spi.o
-COBJS-y += cmd_universe.o
-COBJS-y += cmd_usb.o
+COBJS-$(CONFIG_CMD_SCSI) += cmd_scsi.o
+COBJS-$(CONFIG_CMD_SPI) += cmd_spi.o
+COBJS-$(CONFIG_CMD_UNIVERSE) += cmd_universe.o
+COBJS-$(CONFIG_CMD_USB) += cmd_usb.o
 COBJS-y += cmd_vfd.o
 COBJS-y += command.o
 COBJS-y += console.o
@@ -123,7 +131,7 @@ COBJS-y += xilinx.o
 COBJS-y += crc16.o
 COBJS-y += xyzModem.o
 COBJS-y += cmd_mac.o
-COBJS-y += cmd_mfsl.o
+COBJS-$(CONFIG_CMD_MFSL) += cmd_mfsl.o
 
 COBJS  := $(COBJS-y)
 SRCS   := $(AOBJS:.o=.S) $(COBJS:.o=.c)
index ef15a006cd19af522fd51b311c3dfeeecddf9550..d05998366b150e82f6200f249c017c2c989c052d 100644 (file)
@@ -30,7 +30,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#if defined(CONFIG_CMD_BDI)
 static void print_num(const char *, ulong);
 
 #ifndef CONFIG_ARM     /* PowerPC and other */
@@ -350,4 +349,3 @@ U_BOOT_CMD(
        "bdinfo  - print Board Info structure\n",
        NULL
 );
-#endif
index 1c3547a1fcc680247d4401c244d7ef55b4f22916..94f7e0847b4b63b07bc5b224d2355dd3d228bee3 100644 (file)
@@ -13,8 +13,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#if defined(CONFIG_CMD_BEDBUG)
-
 #ifndef MAX
 #define MAX(a,b) ((a) > (b) ? (a) : (b))
 #endif
@@ -413,7 +411,6 @@ int do_bedbug_rdump (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 U_BOOT_CMD (rdump, 1, 1, do_bedbug_rdump,
            "rdump   - Show registers.\n", " - Show registers.\n");
 /* ====================================================================== */
-#endif
 
 
 /*
index 241aa8357a3ce3ccea7e3fee4f137c53b1dcd128..907f9a2db7e15da815fa5273e4cdb26f9428cd2b 100644 (file)
@@ -31,8 +31,6 @@
 #include <asm/byteorder.h>
 #include <malloc.h>
 
-#if defined(CONFIG_CMD_BMP)
-
 static int bmp_info (ulong addr);
 static int bmp_display (ulong addr, int x, int y);
 
@@ -187,5 +185,3 @@ static int bmp_display(ulong addr, int x, int y)
 # error bmp_display() requires CONFIG_LCD or CONFIG_VIDEO
 #endif
 }
-
-#endif /* defined(CONFIG_CMD_BMP) */
index 5e0f990723b371c013fe315af27811db812fc2e4..50ddb011cd402d81dd9a6a19efed26f3baf6cb00 100644 (file)
@@ -28,8 +28,6 @@
 #include <command.h>
 #include <devices.h>
 
-#if defined(CONFIG_CMD_CONSOLE)
-
 extern void _do_coninfo (void);
 int do_coninfo (cmd_tbl_t * cmd, int flag, int argc, char *argv[])
 {
@@ -67,5 +65,3 @@ U_BOOT_CMD(
        "coninfo - print console devices and information\n",
        ""
 );
-
-#endif
index 4a42534900a78c90ee6945874e437afa24ba5258..751159847a487da0fd3c034d355417eed03ca646 100644 (file)
@@ -31,8 +31,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#if defined(CONFIG_CMD_DATE)
-
 const char *weekdays[] = {
        "Sun", "Mon", "Tues", "Wednes", "Thurs", "Fri", "Satur",
 };
@@ -210,5 +208,3 @@ U_BOOT_CMD(
        "  - with numeric argument: set the system date & time\n"
        "  - with 'reset' argument: reset the RTC\n"
 );
-
-#endif
index 12fa9db08d07bcd5037467c65f1f3d329beb503d..a053343abe872c5098c19b5a43320413bf69f65f 100644 (file)
@@ -29,8 +29,6 @@
 #include <config.h>
 #include <command.h>
 
-#if defined(CONFIG_4xx) && defined(CONFIG_CMD_SETGETDCR)
-
 unsigned long get_dcr (unsigned short);
 unsigned long set_dcr (unsigned short, unsigned long);
 
@@ -245,5 +243,3 @@ U_BOOT_CMD(
        "setidcr - Set a register value via indirect DCR addressing\n",
        "adr_dcrn[.dat_dcrn] offset value - write offset to adr_dcrn, write value to dat_dcrn.\n"
 );
-
-#endif
index cb99b7700f7770dd8b014202544bb3e447231119..82d5ad313478f5b1985ec143d484553b74a35386 100644 (file)
@@ -28,8 +28,6 @@
 #include <command.h>
 #include <post.h>
 
-#if defined(CONFIG_CMD_DIAG) && defined(CONFIG_POST)
-
 int do_diag (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 {
        unsigned int i;
@@ -76,5 +74,3 @@ U_BOOT_CMD(
        "diag run [test1 [test2]]\n"
        "         - run specified tests\n"
 );
-
-#endif
index d19f412819d2aba58a364122b8c714b6940bcba5..a29345c6ba11c7d3527b4e2c42747b420e081d4d 100644 (file)
@@ -24,8 +24,6 @@
 #include <common.h>
 #include <command.h>
 
-#if defined(CONFIG_CMD_DISPLAY)
-
 #undef DEBUG_DISP
 
 #define DISP_SIZE      8
@@ -78,5 +76,3 @@ U_BOOT_CMD(
        "    - with <string> argument: display <string> on dot matrix display\n"
        "    - without arguments: clear dot matrix display\n"
 );
-
-#endif
index d6d3aff8c875757e62067455643a94ad01a40194..3d717c039d444a54c3cd756d8a8c44e0474abbc0 100644 (file)
@@ -11,9 +11,6 @@
 #include <command.h>
 #include <malloc.h>
 #include <asm/io.h>
-
-#if defined(CONFIG_CMD_DOC)
-
 #include <linux/mtd/nftl.h>
 #include <linux/mtd/doc2000.h>
 
@@ -1607,5 +1604,3 @@ void doc_probe(unsigned long physadr)
                puts ("No DiskOnChip found\n");
        }
 }
-
-#endif
index 804d467f251f3aaa13fd4c00e642454d23c67f3b..956dc69daecbd3736f86b94096c41669c06fd4ed 100644 (file)
@@ -25,8 +25,6 @@
 #include <config.h>
 #include <command.h>
 
-#if defined(CONFIG_CMD_DTT)
-
 #include <dtt.h>
 #include <i2c.h>
 
@@ -60,5 +58,3 @@ U_BOOT_CMD(
          "dtt     - Digital Thermometer and Thermostat\n",
          "        - Read temperature from digital thermometer and thermostat.\n"
 );
-
-#endif
index 63a5593e4343ae16964f4cb369b00cedbeaff6c4..2eb745315602afa86b351255844d5d636b4a2a0e 100644 (file)
@@ -23,8 +23,6 @@
 DECLARE_GLOBAL_DATA_PTR;
 #endif
 
-#if defined(CONFIG_CMD_ELF)
-
 #ifndef MAX
 #define MAX(a,b) ((a) > (b) ? (a) : (b))
 #endif
@@ -323,5 +321,3 @@ U_BOOT_CMD(
        "bootvx  - Boot vxWorks from an ELF image\n",
        " [address] - load address of vxWorks ELF image.\n"
 );
-
-#endif
index 8bd2b476e5448f2067f19b839194380cda93337c..f569406432264f0a61eba2182d1ecd89ebb9d126 100644 (file)
@@ -34,8 +34,6 @@
  */
 #include <common.h>
 #include <part.h>
-
-#if defined(CONFIG_CMD_EXT2)
 #include <config.h>
 #include <command.h>
 #include <image.h>
@@ -259,5 +257,3 @@ U_BOOT_CMD(
        "    - load binary file 'filename' from 'dev' on 'interface'\n"
        "      to address 'addr' from ext2 filesystem\n"
 );
-
-#endif
index 54f0f9f9cec7f82a938888679212b9134d0c892a..9576cdf389df838323d32d3c005cc0fdb0d96e3f 100644 (file)
 #include <net.h>
 #include <ata.h>
 #include <part.h>
-
-#if defined(CONFIG_CMD_FAT)
-
-#undef DEBUG
-
 #include <fat.h>
 
 
@@ -323,5 +318,3 @@ void hexdump (int cnt, unsigned char *data)
        }
 }
 #endif /* NOT_IMPLEMENTED_YET */
-
-#endif
index f9da98ddcc7e9491345435aedfa752fad4d861a6..b3dbd19faea952f448f8c03e1f56f39e7bf96997 100644 (file)
@@ -31,8 +31,6 @@
 #include <command.h>
 #include <fdc.h>
 
-#if defined(CONFIG_CMD_FDOS)
-
 /*-----------------------------------------------------------------------------
  * do_fdosboot --
  *-----------------------------------------------------------------------------
@@ -153,5 +151,3 @@ U_BOOT_CMD(
        "fdosls  - list files in a directory\n",
        "[directory]\n"
 );
-
-#endif
index 571b8f14d56f3bc97dcd49eb8465cfdc9988d786..629c9b413ea6524cfebd565240ef098ace230ca8 100644 (file)
@@ -28,9 +28,6 @@
 #include <command.h>
 #include <linux/ctype.h>
 #include <linux/types.h>
-
-#ifdef CONFIG_OF_LIBFDT
-
 #include <asm/global_data.h>
 #include <fdt.h>
 #include <libfdt.h>
@@ -47,7 +44,7 @@ DECLARE_GLOBAL_DATA_PTR;
 static int fdt_valid(void);
 static int fdt_parse_prop(char *pathp, char *prop, char *newval,
        char *data, int *len);
-static int fdt_print(char *pathp, char *prop, int depth);
+static int fdt_print(const char *pathp, char *prop, int depth);
 
 /*
  * Flattened Device Tree command, see the help for parameter definitions.
@@ -78,7 +75,7 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
                        /*
                         * Optional new length
                         */
-                       len =  simple_strtoul(argv[3], NULL, 16);
+                       len = simple_strtoul(argv[3], NULL, 16);
                        if (len < fdt_totalsize(fdt)) {
                                printf ("New length %d < existing length %d, "
                                        "ignoring.\n",
@@ -165,12 +162,12 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
                pathp = argv[2];
                nodep = argv[3];
 
-               nodeoffset = fdt_find_node_by_path (fdt, pathp);
+               nodeoffset = fdt_path_offset (fdt, pathp);
                if (nodeoffset < 0) {
                        /*
                         * Not found or something else bad happened.
                         */
-                       printf ("libfdt fdt_find_node_by_path() returned %s\n",
+                       printf ("libfdt fdt_path_offset() returned %s\n",
                                fdt_strerror(nodeoffset));
                        return 1;
                }
@@ -205,12 +202,12 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
                prop   = argv[3];
                newval = argv[4];
 
-               nodeoffset = fdt_find_node_by_path (fdt, pathp);
+               nodeoffset = fdt_path_offset (fdt, pathp);
                if (nodeoffset < 0) {
                        /*
                         * Not found or something else bad happened.
                         */
-                       printf ("libfdt fdt_find_node_by_path() returned %s\n",
+                       printf ("libfdt fdt_path_offset() returned %s\n",
                                fdt_strerror(nodeoffset));
                        return 1;
                }
@@ -232,6 +229,7 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
                char *pathp;            /* path */
                char *prop;             /* property */
                int  ret;               /* return value */
+               static char root[2] = "/";
 
                /*
                 * list is an alias for print, but limited to 1 level
@@ -244,7 +242,10 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
                 * Get the starting path.  The root node is an oddball,
                 * the offset is zero and has no name.
                 */
-               pathp = argv[2];
+               if (argc == 2)
+                       pathp = root;
+               else
+                       pathp = argv[2];
                if (argc > 3)
                        prop = argv[3];
                else
@@ -265,12 +266,12 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
                 * Get the path.  The root node is an oddball, the offset
                 * is zero and has no name.
                 */
-               nodeoffset = fdt_find_node_by_path (fdt, argv[2]);
+               nodeoffset = fdt_path_offset (fdt, argv[2]);
                if (nodeoffset < 0) {
                        /*
                         * Not found or something else bad happened.
                         */
-                       printf ("libfdt fdt_find_node_by_path() returned %s\n",
+                       printf ("libfdt fdt_path_offset() returned %s\n",
                                fdt_strerror(nodeoffset));
                        return 1;
                }
@@ -521,21 +522,21 @@ static void print_data(const void *data, int len)
 
        switch (len) {
        case 1:  /* byte */
-               printf("<%02x>", (*(u8 *) data) & 0xff);
+               printf("<0x%02x>", (*(u8 *) data) & 0xff);
                break;
        case 2:  /* half-word */
-               printf("<%04x>", be16_to_cpu(*(u16 *) data) & 0xffff);
+               printf("<0x%04x>", be16_to_cpu(*(u16 *) data) & 0xffff);
                break;
        case 4:  /* word */
-               printf("<%08x>", be32_to_cpu(*(u32 *) data) & 0xffffffffU);
+               printf("<0x%08x>", be32_to_cpu(*(u32 *) data) & 0xffffffffU);
                break;
        case 8:  /* double-word */
 #if __WORDSIZE == 64
-               printf("<%016llx>", be64_to_cpu(*(uint64_t *) data));
+               printf("<0x%016llx>", be64_to_cpu(*(uint64_t *) data));
 #else
-               printf("<%08x ", be32_to_cpu(*(u32 *) data) & 0xffffffffU);
+               printf("<0x%08x ", be32_to_cpu(*(u32 *) data) & 0xffffffffU);
                data += 4;
-               printf("%08x>", be32_to_cpu(*(u32 *) data) & 0xffffffffU);
+               printf("0x%08x>", be32_to_cpu(*(u32 *) data) & 0xffffffffU);
 #endif
                break;
        default:                /* anything else... hexdump */
@@ -554,25 +555,25 @@ static void print_data(const void *data, int len)
  * Recursively print (a portion of) the fdt.  The depth parameter
  * determines how deeply nested the fdt is printed.
  */
-static int fdt_print(char *pathp, char *prop, int depth)
+static int fdt_print(const char *pathp, char *prop, int depth)
 {
-       static int offstack[MAX_LEVEL];
        static char tabs[MAX_LEVEL+1] =
                "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"
                "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t";
-       void *nodep;            /* property node pointer */
+       const void *nodep;      /* property node pointer */
        int  nodeoffset;        /* node offset from libfdt */
        int  nextoffset;        /* next node offset from libfdt */
        uint32_t tag;           /* tag */
        int  len;               /* length of the property */
        int  level = 0;         /* keep track of nesting level */
+       const struct fdt_property *fdt_prop;
 
-       nodeoffset = fdt_find_node_by_path (fdt, pathp);
+       nodeoffset = fdt_path_offset (fdt, pathp);
        if (nodeoffset < 0) {
                /*
                 * Not found or something else bad happened.
                 */
-               printf ("libfdt fdt_find_node_by_path() returned %s\n",
+               printf ("libfdt fdt_path_offset() returned %s\n",
                        fdt_strerror(nodeoffset));
                return 1;
        }
@@ -602,45 +603,52 @@ static int fdt_print(char *pathp, char *prop, int depth)
         * The user passed in a node path and no property,
         * print the node and all subnodes.
         */
-       offstack[0] = nodeoffset;
-
        while(level >= 0) {
-               tag = fdt_next_tag(fdt, nodeoffset, &nextoffset, &pathp);
+               tag = fdt_next_tag(fdt, nodeoffset, &nextoffset);
                switch(tag) {
                case FDT_BEGIN_NODE:
-                       if(level <= depth)
+                       pathp = fdt_get_name(fdt, nodeoffset, NULL);
+                       if (level <= depth) {
+                               if (pathp == NULL)
+                                       pathp = "/* NULL pointer error */";
+                               if (*pathp == '\0')
+                                       pathp = "/";    /* root is nameless */
                                printf("%s%s {\n",
                                        &tabs[MAX_LEVEL - level], pathp);
+                       }
                        level++;
-                       offstack[level] = nodeoffset;
                        if (level >= MAX_LEVEL) {
-                               printf("Aaaiii <splat> nested too deep. "
-                                       "Aborting.\n");
+                               printf("Nested too deep, aborting.\n");
                                return 1;
                        }
                        break;
                case FDT_END_NODE:
                        level--;
-                       if(level <= depth)
+                       if (level <= depth)
                                printf("%s};\n", &tabs[MAX_LEVEL - level]);
                        if (level == 0) {
                                level = -1;             /* exit the loop */
                        }
                        break;
                case FDT_PROP:
-                       nodep = fdt_getprop (fdt, offstack[level], pathp, &len);
+                       fdt_prop = fdt_offset_ptr(fdt, nodeoffset,
+                                       sizeof(*fdt_prop));
+                       pathp    = fdt_string(fdt,
+                                       fdt32_to_cpu(fdt_prop->nameoff));
+                       len      = fdt32_to_cpu(fdt_prop->len);
+                       nodep    = fdt_prop->data;
                        if (len < 0) {
                                printf ("libfdt fdt_getprop(): %s\n",
                                        fdt_strerror(len));
                                return 1;
                        } else if (len == 0) {
                                /* the property has no value */
-                               if(level <= depth)
+                               if (level <= depth)
                                        printf("%s%s;\n",
                                                &tabs[MAX_LEVEL - level],
                                                pathp);
                        } else {
-                               if(level <= depth) {
+                               if (level <= depth) {
                                        printf("%s%s=",
                                                &tabs[MAX_LEVEL - level],
                                                pathp);
@@ -650,11 +658,12 @@ static int fdt_print(char *pathp, char *prop, int depth)
                        }
                        break;
                case FDT_NOP:
+                       printf("/* NOP */\n", &tabs[MAX_LEVEL - level]);
                        break;
                case FDT_END:
                        return 1;
                default:
-                       if(level <= depth)
+                       if (level <= depth)
                                printf("Unknown tag 0x%08X\n", tag);
                        return 1;
                }
@@ -692,5 +701,3 @@ U_BOOT_CMD(
        "          fdt print /cpus \"#address-cells\"\n"
        "          fdt set   /cpus \"#address-cells\" \"[00 00 00 01]\"\n"
 );
-
-#endif /* CONFIG_OF_LIBFDT */
index 11c8857313b42d2e0c95fb8b2b7d82ab4be6511a..f56443e25e3a80ef03b0a46a17369d55a1c0665f 100644 (file)
@@ -31,8 +31,6 @@
 #include <dataflash.h>
 #endif
 
-#if defined(CONFIG_CMD_FLASH)
-
 #if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
 #include <jffs2/jffs2.h>
 
@@ -731,5 +729,3 @@ U_BOOT_CMD(
 #undef TMP_ERASE
 #undef TMP_PROT_ON
 #undef TMP_PROT_OFF
-
-#endif
index cce23ad70d78ce4e316583d71f40d23c41bbc8dd..377a692f7dc3b2810500e020df420f91aaee30ee 100644 (file)
@@ -43,8 +43,6 @@
 #define PRINTF(fmt,args...)
 #endif
 
-#if defined (CONFIG_FPGA) && defined(CONFIG_CMD_FPGA)
-
 /* Local functions */
 static void fpga_usage (cmd_tbl_t * cmdtp);
 static int fpga_get_op (char *opstr);
@@ -321,4 +319,3 @@ U_BOOT_CMD (fpga, 6, 1, do_fpga,
            "\tloadb\tLoad device from bitstream buffer (Xilinx devices only)\n"
            "\tloadmk\tLoad device generated with mkimage\n"
            "\tdump\tLoad device to memory buffer\n");
-#endif
index a684a580e6edc24f54f057ad0a93de8d40659d95..10cab4609a5da87c2d7a1fc67db302d40f4991b9 100644 (file)
@@ -86,9 +86,6 @@
 #include <i2c.h>
 #include <asm/byteorder.h>
 
-#if defined(CONFIG_CMD_I2C)
-
-
 /* Display values from last command.
  * Memory modify remembered values are different from display memory.
  */
@@ -1024,5 +1021,3 @@ U_BOOT_CMD(
        "      (valid chip values 50..57)\n"
 );
 #endif
-
-#endif
index 2e45b7044224651a2d39600e0a75eb496e7e1cf7..c38be4f1a7d0d0c36335f44e6ab7e190326393c9 100644 (file)
@@ -68,8 +68,6 @@ DECLARE_GLOBAL_DATA_PTR;
 # define SYNC          /* nothing */
 #endif
 
-#if defined(CONFIG_CMD_IDE)
-
 #ifdef CONFIG_IDE_8xx_DIRECT
 /* Timings for IDE Interface
  *
@@ -2081,5 +2079,3 @@ U_BOOT_CMD(
        "diskboot- boot from IDE device\n",
        "loadAddr dev:part\n"
 );
-
-#endif
index ae95758247d5e15cd26da5aca3b36ea45cdba7f8..d758269777324da5bceb0da1d54bd751898beb17 100644 (file)
@@ -28,8 +28,7 @@
 #include <common.h>
 #include <command.h>
 
-#if defined(CONFIG_CMD_IMMAP) && \
-    (defined(CONFIG_8xx) || defined(CONFIG_8260))
+#if defined(CONFIG_8xx) || defined(CONFIG_8260)
 
 #if defined(CONFIG_8xx)
 #include <asm/8xx_immap.h>
@@ -41,9 +40,7 @@
 #include <asm/iopin_8260.h>
 #endif
 
-#if defined(CONFIG_8xx) || defined(CONFIG_8260)
 DECLARE_GLOBAL_DATA_PTR;
-#endif
 
 static void
 unimplemented ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
index 8e2051714ce6e441c808bd1e1136e328c41497f9..ce988723c02d18733d79410dddb385746c9a06e7 100644 (file)
@@ -32,8 +32,6 @@
 #include <config.h>
 #include <command.h>
 
-#if defined(CONFIG_CMD_ITEST)
-
 #define EQ     0
 #define NE     1
 #define LT     2
@@ -197,4 +195,3 @@ U_BOOT_CMD(
        "itest\t- return true/false on integer compare\n",
        "[.b, .w, .l, .s] [*]value1 <op> [*]value2\n"
 );
-#endif
index 513a226c43113db0aea70df980b7464859883237..efe9eb7be4ca1b1b46e8122b306ec3124478295f 100644 (file)
@@ -93,9 +93,6 @@
 #include <jffs2/jffs2.h>
 #include <linux/list.h>
 #include <linux/ctype.h>
-
-#if defined(CONFIG_CMD_JFFS2)
-
 #include <cramfs/cramfs_fs.h>
 
 #if defined(CONFIG_CMD_NAND)
@@ -2191,5 +2188,3 @@ U_BOOT_CMD(
 #endif /* #ifdef CONFIG_JFFS2_CMDLINE */
 
 /***************************************************/
-
-#endif
index fba8bd8bf5c51a3e39ecbaa0fd8ccb3d8f639eec..e593dbedd374c74fe2d5b61f3dbeaba189b56151 100644 (file)
@@ -48,8 +48,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#if defined(CONFIG_LOGBUFFER)
-
 /* Local prototypes */
 static void logbuff_putc (const char c);
 static void logbuff_puts (const char *s);
@@ -287,5 +285,3 @@ static int logbuff_printk(const char *line)
        }
        return i;
 }
-
-#endif /* (CONFIG_LOGBUFFER) */
index 9d1d87551a5b130a5b74e3fd142e2a7ce4bf66ca..5982b76e6e9ca0bc6c220485878cb8a51fbde87d 100644 (file)
@@ -29,8 +29,6 @@
 #include <common.h>
 #include <config.h>
 #include <command.h>
-
-#if defined(CONFIG_CMD_MFSL)
 #include <asm/asm.h>
 
 int do_frd (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
@@ -413,5 +411,3 @@ U_BOOT_CMD (rspr, 3, 1, do_rspr,
                " 1 - MSR - Machine status register\n"
                " 3 - EAR - Exception address register\n"
                " 5 - ESR - Exception status register\n");
-
-#endif
index 3b4dc8ae09874f3efd9b78dd1615858af13ae265..f530a38421e04b61169ee60e6804a027fa2a213b 100644 (file)
@@ -27,8 +27,6 @@
 
 #include <common.h>
 #include <command.h>
-
-#if defined(CONFIG_CMD_MII)
 #include <miiphy.h>
 
 #ifdef CONFIG_TERSE_MII
@@ -598,5 +596,3 @@ U_BOOT_CMD(
 );
 
 #endif /* CONFIG_TERSE_MII */
-
-#endif
index c0c6b8f05af54ae683dcfd102514657e6863dda8..126b538ce8d551ecf5e0e1df85e9d0e5924bc932 100644 (file)
@@ -27,8 +27,6 @@
 #include <common.h>
 #include <command.h>
 
-#if defined(CONFIG_CMD_MISC)
-
 int do_sleep (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
        ulong start = get_timer(0);
@@ -68,5 +66,3 @@ U_BOOT_CMD(
        "N\n"
        "    - delay execution for N seconds (N is _decimal_ !!!)\n"
 );
-
-#endif
index 069c6d02a066ab5a6a010cd0c3df883cd8b1bfe4..25c970257d0b34844bcfc6734a65aaaaca0afe98 100644 (file)
@@ -23,9 +23,6 @@
 
 #include <common.h>
 #include <command.h>
-
-#if defined(CONFIG_CMD_MMC)
-
 #include <mmc.h>
 
 int do_mmc (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
@@ -42,5 +39,3 @@ U_BOOT_CMD(
        "mmcinit - init mmc card\n",
        NULL
 );
-
-#endif
index 0715fbc203ce06fc8fa2c61af5db240ec9de50b3..21682c09e93393aa3ac5a89f8f6e9a54279c685f 100644 (file)
@@ -28,8 +28,6 @@
 #include <command.h>
 #include <net.h>
 
-#if defined(CONFIG_CMD_NET)
-
 extern int do_bootm (cmd_tbl_t *, int, int, char *[]);
 
 static int netboot_common (proto_t, cmd_tbl_t *, int , char *[]);
@@ -343,5 +341,3 @@ U_BOOT_CMD(
        "[NTP server IP]\n"
 );
 #endif
-
-#endif
index 8be6da93f936a4ca6d3353b9f9b3ac6c0041d4de..82d97178f5dd24ad1482e6c8450b62ce110a8b84 100644 (file)
  */
 
 #include <common.h>
-
-#ifdef CONFIG_PCI
-
 #include <command.h>
 #include <asm/processor.h>
 #include <asm/io.h>
 #include <pci.h>
 
-#if defined(CONFIG_CMD_PCI)
-
 extern int cmd_get_data_size(char* arg, int default_size);
 
 unsigned char  ShortPCIListing = 1;
@@ -564,7 +559,3 @@ U_BOOT_CMD(
        "pci write[.b, .w, .l] b.d.f address value\n"
        "    - write to CFG address\n"
 );
-
-#endif
-
-#endif /* CONFIG_PCI */
index bfe33e3a8cbd5f0166dcf4bf29fc4fcd568695b9..a06cac01663b914038a4ef90ac83159f84f0d798 100644 (file)
@@ -30,8 +30,6 @@
 #include <common.h>
 #include <command.h>
 
-#if defined(CONFIG_CMD_PORTIO)
-
 extern int cmd_get_data_size (char *arg, int default_size);
 
 /* Display values from last command.
@@ -165,5 +163,3 @@ U_BOOT_CMD(
        "[.b, .w, .l] port\n"
        "    - read datum from IO port\n"
 );
-
-#endif
index 17e9cd9072aa8cfbab4e11c75377db850af3403c..bb6aa30d18a3ba7ae8aa0247296a38012a8af3eb 100644 (file)
@@ -33,8 +33,6 @@
 #include <mpc5xxx.h>
 #endif
 
-#if defined(CONFIG_CMD_REGINFO)
-
 int do_reginfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
 #if defined(CONFIG_8xx)
@@ -335,9 +333,6 @@ int do_reginfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        return 0;
 }
 
-#endif
-
-
  /**************************************************/
 
 #if ( defined(CONFIG_8xx)   || defined(CONFIG_405GP) || \
index 1ba392990067ec384ab08d619f87b5b14fcd191a..b7395d7959f366ac9d756b815e48e216abf40b0d 100644 (file)
@@ -27,8 +27,6 @@
  * Reiserfs support
  */
 #include <common.h>
-
-#if defined(CONFIG_CMD_REISER)
 #include <config.h>
 #include <command.h>
 #include <image.h>
@@ -239,5 +237,3 @@ U_BOOT_CMD(
        "    - load binary file 'filename' from 'dev' on 'interface'\n"
        "      to address 'addr' from dos filesystem\n"
 );
-
-#endif
index b2d4eb635c7500a6340a655fe7f7408293536449..1cdec159f5a8d71aef09a73292a4bc21dcb48355 100644 (file)
@@ -34,8 +34,6 @@
 #include <image.h>
 #include <pci.h>
 
-#if defined(CONFIG_CMD_SCSI)
-
 #ifdef CONFIG_SCSI_SYM53C8XX
 #define SCSI_VEND_ID   0x1000
 #ifndef CONFIG_SCSI_DEV_ID
@@ -611,5 +609,3 @@ U_BOOT_CMD(
        "scsiboot- boot from SCSI device\n",
        "loadAddr dev:part\n"
 );
-
-#endif
index 3118d279b97dcea25658f561b06d6b1bfde7ff29..76044221416c9fbd194828b6f4c6bd35fdd461fd 100644 (file)
@@ -29,8 +29,6 @@
 #include <command.h>
 #include <spi.h>
 
-#if defined(CONFIG_CMD_SPI)
-
 /*-----------------------------------------------------------------------
  * Definitions
  */
@@ -139,5 +137,3 @@ U_BOOT_CMD(
        "<bit_len> - Number of bits to send (base 10)\n"
        "<dout>    - Hexadecimal string that gets sent\n"
 );
-
-#endif
index 8bf0b1f1e28da4d93233a9665fbc63e811ef4cf2..ea977828a05e35c359c4b3765e86f03601d3a3ee 100644 (file)
@@ -28,8 +28,6 @@
 
 #include <universe.h>
 
-#if defined(CONFIG_CMD_UNIVERSE)
-
 #define PCI_VENDOR PCI_VENDOR_ID_TUNDRA
 #define PCI_DEVICE PCI_DEVICE_ID_TUNDRA_CA91C042
 
@@ -386,5 +384,3 @@ U_BOOT_CMD(
        "                                      02 -> D16 Data Width\n"
        "                                      03 -> D32 Data Width\n"
 );
-
-#endif
index 45e07f175c8792b6c5814c776e51207aa1b482f2..c6b17c2ab7ad2af8d74ac4ce4c55c63e07f60dac 100644 (file)
@@ -29,9 +29,6 @@
 #include <command.h>
 #include <asm/byteorder.h>
 #include <part.h>
-
-#if defined(CONFIG_CMD_USB)
-
 #include <usb.h>
 
 #ifdef CONFIG_USB_STORAGE
@@ -608,12 +605,6 @@ int do_usb (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        return 1;
 }
 
-
-#endif
-
-
-#if defined(CONFIG_CMD_USB)
-
 #ifdef CONFIG_USB_STORAGE
 U_BOOT_CMD(
        usb,    5,      1,      do_usb,
@@ -645,4 +636,3 @@ U_BOOT_CMD(
        "usb  info [dev] - show available USB devices\n"
 );
 #endif
-#endif
index 175d59eb99432ccb36078a766043c0722eb9c2ec..c67bb3d390f4f4524679bbec4c450b605c347a2a 100644 (file)
@@ -44,6 +44,32 @@ struct fdt_header *fdt;
 
 /********************************************************************/
 
+/**
+ * fdt_find_and_setprop: Find a node and set it's property
+ *
+ * @fdt: ptr to device tree
+ * @node: path of node
+ * @prop: property name
+ * @val: ptr to new value
+ * @len: length of new property value
+ * @create: flag to create the property if it doesn't exist
+ *
+ * Convenience function to directly set a property given the path to the node.
+ */
+int fdt_find_and_setprop(void *fdt, const char *node, const char *prop,
+                        const void *val, int len, int create)
+{
+       int nodeoff = fdt_path_offset(fdt, node);
+
+       if (nodeoff < 0)
+               return nodeoff;
+
+       if ((!create) && (fdt_get_property(fdt, nodeoff, prop, 0) == NULL))
+               return 0; /* create flag not set; so exit quietly */
+
+       return fdt_setprop(fdt, nodeoff, prop, val, len);
+}
+
 int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force)
 {
        int   nodeoffset;
@@ -58,34 +84,23 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force)
        }
 
        if (initrd_start && initrd_end) {
-               struct fdt_reserve_entry re;
-               int  used;
-               int  total;
+               uint64_t addr, size;
+               int  total = fdt_num_mem_rsv(fdt);
                int  j;
 
-               err = fdt_num_reservemap(fdt, &used, &total);
-               if (err < 0) {
-                       printf("fdt_chosen: %s\n", fdt_strerror(err));
-                       return err;
-               }
-               if (used >= total) {
-                       printf("WARNING: "
-                               "no room in the reserved map (%d of %d)\n",
-                               used, total);
-                       return -1;
-               }
                /*
                 * Look for an existing entry and update it.  If we don't find
                 * the entry, we will j be the next available slot.
                 */
-               for (j = 0; j < used; j++) {
-                       err = fdt_get_reservemap(fdt, j, &re);
-                       if (re.address == initrd_start) {
+               for (j = 0; j < total; j++) {
+                       err = fdt_get_mem_rsv(fdt, j, &addr, &size);
+                       if (addr == initrd_start) {
+                               fdt_del_mem_rsv(fdt, j);
                                break;
                        }
                }
-               err = fdt_replace_reservemap_entry(fdt, j,
-                       initrd_start, initrd_end - initrd_start + 1);
+
+               err = fdt_add_mem_rsv(fdt, initrd_start, initrd_end - initrd_start + 1);
                if (err < 0) {
                        printf("fdt_chosen: %s\n", fdt_strerror(err));
                        return err;
@@ -95,7 +110,7 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force)
        /*
         * Find the "chosen" node.
         */
-       nodeoffset = fdt_find_node_by_path (fdt, "/chosen");
+       nodeoffset = fdt_path_offset (fdt, "/chosen");
 
        /*
         * If we have a "chosen" node already the "force the writing"
@@ -182,7 +197,7 @@ int fdt_env(void *fdt)
         * See if we already have a "u-boot-env" node, delete it if so.
         * Then create a new empty node.
         */
-       nodeoffset = fdt_find_node_by_path (fdt, "/u-boot-env");
+       nodeoffset = fdt_path_offset (fdt, "/u-boot-env");
        if (nodeoffset >= 0) {
                err = fdt_del_node(fdt, nodeoffset);
                if (err < 0) {
@@ -304,7 +319,7 @@ int fdt_bd_t(void *fdt)
         * See if we already have a "bd_t" node, delete it if so.
         * Then create a new empty node.
         */
-       nodeoffset = fdt_find_node_by_path (fdt, "/bd_t");
+       nodeoffset = fdt_path_offset (fdt, "/bd_t");
        if (nodeoffset >= 0) {
                err = fdt_del_node(fdt, nodeoffset);
                if (err < 0) {
@@ -348,4 +363,128 @@ int fdt_bd_t(void *fdt)
 }
 #endif /* ifdef CONFIG_OF_HAS_BD_T */
 
+void do_fixup_by_path(void *fdt, const char *path, const char *prop,
+                     const void *val, int len, int create)
+{
+#if defined(DEBUG)
+       int i;
+       debug("Updating property '%s/%s' = ", node, prop);
+       for (i = 0; i < len; i++)
+               debug(" %.2x", *(u8*)(val+i));
+       debug("\n");
+#endif
+       int rc = fdt_find_and_setprop(fdt, path, prop, val, len, create);
+       if (rc)
+               printf("Unable to update property %s:%s, err=%s\n",
+                       path, prop, fdt_strerror(rc));
+}
+
+void do_fixup_by_path_u32(void *fdt, const char *path, const char *prop,
+                         u32 val, int create)
+{
+       val = cpu_to_fdt32(val);
+       do_fixup_by_path(fdt, path, prop, &val, sizeof(val), create);
+}
+
+void do_fixup_by_prop(void *fdt,
+                     const char *pname, const void *pval, int plen,
+                     const char *prop, const void *val, int len,
+                     int create)
+{
+       int off;
+#if defined(DEBUG)
+       int i;
+       debug("Updating property '%s/%s' = ", node, prop);
+       for (i = 0; i < len; i++)
+               debug(" %.2x", *(u8*)(val+i));
+       debug("\n");
+#endif
+       off = fdt_node_offset_by_prop_value(fdt, -1, pname, pval, plen);
+       while (off != -FDT_ERR_NOTFOUND) {
+               if (create || (fdt_get_property(fdt, off, prop, 0) != NULL))
+                       fdt_setprop(fdt, off, prop, val, len);
+               off = fdt_node_offset_by_prop_value(fdt, off, pname, pval, plen);
+       }
+}
+
+void do_fixup_by_prop_u32(void *fdt,
+                         const char *pname, const void *pval, int plen,
+                         const char *prop, u32 val, int create)
+{
+       val = cpu_to_fdt32(val);
+       do_fixup_by_prop(fdt, pname, pval, plen, prop, &val, 4, create);
+}
+
+void do_fixup_by_compat(void *fdt, const char *compat,
+                       const char *prop, const void *val, int len, int create)
+{
+       int off = -1;
+#if defined(DEBUG)
+       int i;
+       debug("Updating property '%s/%s' = ", node, prop);
+       for (i = 0; i < len; i++)
+               debug(" %.2x", *(u8*)(val+i));
+       debug("\n");
+#endif
+       off = fdt_node_offset_by_compatible(fdt, -1, compat);
+       while (off != -FDT_ERR_NOTFOUND) {
+               if (create || (fdt_get_property(fdt, off, prop, 0) != NULL))
+                       fdt_setprop(fdt, off, prop, val, len);
+               off = fdt_node_offset_by_compatible(fdt, off, compat);
+       }
+}
+
+void do_fixup_by_compat_u32(void *fdt, const char *compat,
+                           const char *prop, u32 val, int create)
+{
+       val = cpu_to_fdt32(val);
+       do_fixup_by_compat(fdt, compat, prop, &val, 4, create);
+}
+
+void fdt_fixup_ethernet(void *fdt, bd_t *bd)
+{
+       int node;
+       const char *path;
+
+       node = fdt_path_offset(fdt, "/aliases");
+       if (node >= 0) {
+#if defined(CONFIG_HAS_ETH0)
+               path = fdt_getprop(fdt, node, "ethernet0", NULL);
+               if (path) {
+                       do_fixup_by_path(fdt, path, "mac-address",
+                               bd->bi_enetaddr, 6, 0);
+                       do_fixup_by_path(fdt, path, "local-mac-address",
+                               bd->bi_enetaddr, 6, 1);
+               }
+#endif
+#if defined(CONFIG_HAS_ETH1)
+               path = fdt_getprop(fdt, node, "ethernet1", NULL);
+               if (path) {
+                       do_fixup_by_path(fdt, path, "mac-address",
+                               bd->bi_enet1addr, 6, 0);
+                       do_fixup_by_path(fdt, path, "local-mac-address",
+                               bd->bi_enet1addr, 6, 1);
+               }
+#endif
+#if defined(CONFIG_HAS_ETH2)
+               path = fdt_getprop(fdt, node, "ethernet2", NULL);
+               if (path) {
+                       do_fixup_by_path(fdt, path, "mac-address",
+                               bd->bi_enet2addr, 6, 0);
+                       do_fixup_by_path(fdt, path, "local-mac-address",
+                               bd->bi_enet2addr, 6, 1);
+               }
+#endif
+#if defined(CONFIG_HAS_ETH3)
+               path = fdt_getprop(fdt, node, "ethernet3", NULL);
+               if (path) {
+                       do_fixup_by_path(fdt, path, "mac-address",
+                               bd->bi_enet3addr, 6, 0);
+                       do_fixup_by_path(fdt, path, "local-mac-address",
+                               bd->bi_enet3addr, 6, 1);
+               }
+#endif
+       }
+}
+
 #endif /* CONFIG_OF_LIBFDT */
index 37d61a0c86844df7e124515b3d63d94a88ebc1ae..79e5a31b72a6599f027eb0b45df9f95e526b563b 100644 (file)
--- a/config.mk
+++ b/config.mk
@@ -87,6 +87,9 @@ ifdef BOARD
 sinclude $(TOPDIR)/board/$(BOARDDIR)/config.mk # include board specific rules
 endif
 
+# Load generated board configuration
+sinclude $(OBJTREE)/include/autoconf.mk
+
 #########################################################################
 
 CONFIG_SHELL   := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
index 7f16b92a6cac06af26f00a9a267f7bd6c371323a..e4d6168224825ae9ba9c09d864e1348ad05397bc 100644 (file)
@@ -35,6 +35,7 @@
 #if defined(CONFIG_OF_LIBFDT)
 #include <libfdt.h>
 #include <libfdt_env.h>
+#include <fdt_support.h>
 #endif
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -114,42 +115,19 @@ unsigned long get_tbclk (void)
 /* ------------------------------------------------------------------------- */
 
 #ifdef CONFIG_OF_LIBFDT
-static void do_fixup(void *fdt, const char *node, const char *prop,
-                    const void *val, int len, int create)
-{
-#if defined(DEBUG)
-       int i;
-       debug("Updating property '%s/%s' = ", node, prop);
-       for (i = 0; i < len; i++)
-               debug(" %.2x", *(u8*)(val+i));
-       debug("\n");
-#endif
-       int rc = fdt_find_and_setprop(fdt, node, prop, val, len, create);
-       if (rc)
-               printf("Unable to update property %s:%s, err=%s\n",
-                      node, prop, fdt_strerror(rc));
-}
-
-static void do_fixup_u32(void *fdt, const char *node, const char *prop,
-                        u32 val, int create)
-{
-       val = cpu_to_fdt32(val);
-       do_fixup(fdt, node, prop, &val, sizeof(val), create);
-}
-
 void ft_cpu_setup(void *blob, bd_t *bd)
 {
        int div = in_8((void*)CFG_MBAR + 0x204) & 0x0020 ? 8 : 4;
        char * cpu_path = "/cpus/" OF_CPU;
        char * eth_path = "/" OF_SOC "/ethernet@3000";
 
-       do_fixup_u32(blob, cpu_path, "timebase-frequency", OF_TBCLK, 1);
-       do_fixup_u32(blob, cpu_path, "bus-frequency", bd->bi_busfreq, 1);
-       do_fixup_u32(blob, cpu_path, "clock-frequency", bd->bi_intfreq, 1);
-       do_fixup_u32(blob, "/" OF_SOC, "bus-frequency", bd->bi_ipbfreq, 1);
-       do_fixup_u32(blob, "/" OF_SOC, "system-frequency",
-                       bd->bi_busfreq*div, 1);
-       do_fixup(blob, eth_path, "mac-address", bd->bi_enetaddr, 6, 0);
-       do_fixup(blob, eth_path, "local-mac-address", bd->bi_enetaddr, 6, 0);
+       do_fixup_by_path_u32(blob, cpu_path, "timebase-frequency", OF_TBCLK, 1);
+       do_fixup_by_path_u32(blob, cpu_path, "bus-frequency", bd->bi_busfreq, 1);
+       do_fixup_by_path_u32(blob, cpu_path, "clock-frequency", bd->bi_intfreq, 1);
+       do_fixup_by_path_u32(blob, "/" OF_SOC, "bus-frequency", bd->bi_ipbfreq, 1);
+       do_fixup_by_path_u32(blob, "/" OF_SOC, "system-frequency",
+                               bd->bi_busfreq*div, 1);
+       do_fixup_by_path(blob, eth_path, "mac-address", bd->bi_enetaddr, 6, 0);
+       do_fixup_by_path(blob, eth_path, "local-mac-address", bd->bi_enetaddr, 6, 0);
 }
 #endif
index c2b753d6bd2e8ac4c73124aeea53566f416d8ff6..55e61a1887586ab0e76048e3d749d32a5078c85d 100644 (file)
@@ -50,6 +50,7 @@
 #if defined(CONFIG_OF_LIBFDT)
 #include <libfdt.h>
 #include <libfdt_env.h>
+#include <fdt_support.h>
 #endif
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -300,35 +301,12 @@ void watchdog_reset (void)
 
 /* ------------------------------------------------------------------------- */
 #if defined(CONFIG_OF_LIBFDT)
-static void do_fixup(void *fdt, const char *node, const char *prop,
-                       const void *val, int len, int create)
-{
-#if defined(DEBUG)
-       int i;
-       debug("Updating property '%s/%s' = ", node, prop);
-       for (i = 0; i < len; i++)
-               debug(" %.2x", *(u8*)(val+i));
-       debug("\n");
-#endif
-       int rc = fdt_find_and_setprop(fdt, node, prop, val, len, create);
-       if (rc)
-               printf("Unable to update property %s:%s, err=%s\n",
-                       node, prop, fdt_strerror(rc));
-}
-
-static void do_fixup_u32(void *fdt, const char *node, const char *prop,
-                        u32 val, int create)
-{
-       val = cpu_to_fdt32(val);
-       do_fixup(fdt, node, prop, &val, sizeof(val), create);
-}
-
 void ft_cpu_setup (void *blob, bd_t *bd)
 {
        char * cpu_path = "/cpus/" OF_CPU;
 
-       do_fixup_u32(blob, cpu_path, "bus-frequency", bd->bi_busfreq, 1);
-       do_fixup_u32(blob, cpu_path, "timebase-frequency", OF_TBCLK, 1);
-       do_fixup_u32(blob, cpu_path, "clock-frequency", bd->bi_intfreq, 1);
+       do_fixup_by_path_u32(blob, cpu_path, "bus-frequency", bd->bi_busfreq, 1);
+       do_fixup_by_path_u32(blob, cpu_path, "timebase-frequency", OF_TBCLK, 1);
+       do_fixup_by_path_u32(blob, cpu_path, "clock-frequency", bd->bi_intfreq, 1);
 }
 #endif /* CONFIG_OF_LIBFDT */
index e634f0a25b25597f89b47cfe96a4f99d83d564c5..b2c35d3007c6dfe360f950c48893a69afe6a9204 100644 (file)
@@ -529,7 +529,7 @@ ft_cpu_setup(void *blob, bd_t *bd)
        int tmp[2];
 
        for (j = 0; j < (sizeof(fixup_props) / sizeof(fixup_props[0])); j++) {
-               nodeoffset = fdt_find_node_by_path(blob, fixup_props[j].node);
+               nodeoffset = fdt_path_offset(blob, fixup_props[j].node);
                if (nodeoffset >= 0) {
                        err = fixup_props[j].set_fn(blob, nodeoffset,
                                                    fixup_props[j].prop, bd);
@@ -544,7 +544,7 @@ ft_cpu_setup(void *blob, bd_t *bd)
        }
 
        /* update, or add and update /memory node */
-       nodeoffset = fdt_find_node_by_path(blob, "/memory");
+       nodeoffset = fdt_path_offset(blob, "/memory");
        if (nodeoffset < 0) {
                nodeoffset = fdt_add_subnode(blob, 0, "memory");
                if (nodeoffset < 0)
index 5675afe9710009ebc571c96a6215afc97b91f80e..0defb0ec89094612d6b66fb9d2843e9ea6749b0e 100644 (file)
@@ -179,7 +179,7 @@ void ft_pci_setup(void *blob, bd_t *bd)
        if (pci_num_buses < 1)
                return;
 
-       nodeoffset = fdt_find_node_by_path(blob, "/" OF_SOC "/pci@8500");
+       nodeoffset = fdt_path_offset(blob, "/" OF_SOC "/pci@8500");
        if (nodeoffset >= 0) {
                tmp[0] = cpu_to_be32(pci_hose[0].first_busno);
                tmp[1] = cpu_to_be32(pci_hose[0].last_busno);
@@ -194,7 +194,7 @@ void ft_pci_setup(void *blob, bd_t *bd)
        if (pci_num_buses < 2)
                return;
 
-       nodeoffset = fdt_find_node_by_path(blob, "/" OF_SOC "/pci@8600");
+       nodeoffset = fdt_path_offset(blob, "/" OF_SOC "/pci@8600");
        if (nodeoffset >= 0) {
                tmp[0] = cpu_to_be32(pci_hose[0].first_busno);
                tmp[1] = cpu_to_be32(pci_hose[0].last_busno);
diff --git a/drivers/Makefile b/drivers/Makefile
deleted file mode 100755 (executable)
index bd4349e..0000000
+++ /dev/null
@@ -1,164 +0,0 @@
-#
-# (C) Copyright 2000-2007
-# 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
-# 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, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-# MA 02111-1307 USA
-#
-
-include $(TOPDIR)/config.mk
-
-# CFLAGS += -DET_DEBUG -DDEBUG
-
-LIB    = $(obj)libdrivers.a
-
-COBJS-y += ali512x.o
-COBJS-y += ds1722.o
-COBJS-y += ns87308.o
-COBJS-y += status_led.o
-
-#
-# Block and Flash Drivers
-#
-COBJS-y += ahci.o
-COBJS-y += at45.o
-COBJS-y += ata_piix.o
-COBJS-y += cfi_flash.o
-COBJS-y += dataflash.o
-COBJS-y += mw_eeprom.o
-COBJS-y += sil680.o
-COBJS-y += sym53c8xx.o
-COBJS-y += systemace.o
-
-#
-# Console Drivers
-#
-COBJS-y += ati_radeon_fb.o
-COBJS-y += atmel_usart.o
-COBJS-y += cfb_console.o
-COBJS-y += ct69000.o
-COBJS-y += i8042.o
-COBJS-y += keyboard.o
-COBJS-y += netconsole.o
-COBJS-y += ns16550.o
-COBJS-y += pc_keyb.o
-COBJS-y += ps2ser.o
-COBJS-y += ps2mult.o
-COBJS-y += s3c4510b_uart.o
-COBJS-y += sed13806.o
-COBJS-y += sed156x.o
-COBJS-y += serial.o
-COBJS-y += serial_max3100.o
-COBJS-y += serial_xuartlite.o
-COBJS-y += serial_sh.o
-COBJS-y += sm501.o
-COBJS-y += smiLynxEM.o
-COBJS-y += usbtty.o
-COBJS-y += videomodes.o
-
-#
-# I2C Drivers
-#
-COBJS-y += omap1510_i2c.o
-COBJS-y += omap24xx_i2c.o
-COBJS-y += tsi108_i2c.o
-COBJS-y += fsl_i2c.o
-
-#
-# Network Drivers
-#
-COBJS-y += 3c589.o
-COBJS-y += bcm570x.o bcm570x_autoneg.o 5701rls.o
-COBJS-y += cs8900.o
-COBJS-y += dc2114x.o
-COBJS-y += dm9000x.o
-COBJS-y += e1000.o
-COBJS-y += eepro100.o
-COBJS-y += enc28j60.o
-COBJS-y += inca-ip_sw.o
-COBJS-y += ks8695eth.o
-COBJS-y += lan91c96.o
-COBJS-y += macb.o
-COBJS-y += natsemi.o
-COBJS-y += ne2000.o
-COBJS-y += netarm_eth.o
-COBJS-y += ns7520_eth.o
-COBJS-y += ns8382x.o
-COBJS-y += pcnet.o
-COBJS-y += plb2800_eth.o
-COBJS-y += rtl8019.o
-COBJS-y += rtl8139.o
-COBJS-y += rtl8169.o
-COBJS-y += s3c4510b_eth.o
-COBJS-y += smc91111.o
-COBJS-y += tigon3.o
-COBJS-y += tsec.o
-COBJS-y += tsi108_eth.o
-COBJS-y += uli526x.o
-
-#
-# PCI/PCMCIA device drivers
-#
-COBJS-y += fsl_pci_init.o
-COBJS-y += mpc8xx_pcmcia.o
-COBJS-y += pci.o
-COBJS-y += pci_auto.o
-COBJS-y += pci_indirect.o
-COBJS-y += pxa_pcmcia.o
-COBJS-y += rpx_pcmcia.o
-COBJS-y += ti_pci1410a.o
-COBJS-y += tqm8xx_pcmcia.o
-COBJS-y += tsi108_pci.o
-COBJS-y += w83c553f.o
-COBJS-y += marubun_pcmcia.o
-
-#
-# USB Drivers
-#
-COBJS-y += isp116x-hcd.o
-COBJS-y += sl811_usb.o
-COBJS-y += usb_ohci.o
-COBJS-y += usbdcore.o
-COBJS-y += usbdcore_ep0.o
-COBJS-y += usbdcore_mpc8xx.o
-COBJS-y += usbdcore_omap1510.o
-
-#
-# Miscellaneous Drivers
-#
-COBJS-y += ali512x.o
-COBJS-y += ns87308.o
-COBJS-y += status_led.o
-
-COBJS  := $(COBJS-y)
-SRCS   := $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS))
-
-all:   $(LIB)
-
-$(LIB): $(obj).depend $(OBJS)
-       $(AR) $(ARFLAGS) $@ $(OBJS)
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
diff --git a/drivers/block/Makefile b/drivers/block/Makefile
new file mode 100644 (file)
index 0000000..e069969
--- /dev/null
@@ -0,0 +1,50 @@
+#
+# (C) Copyright 2000-2007
+# 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
+# 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, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB    := $(obj)libblock.a
+
+COBJS-y += ahci.o
+COBJS-y += ata_piix.o
+COBJS-y += sil680.o
+COBJS-y += sym53c8xx.o
+COBJS-y += systemace.o
+
+COBJS  := $(COBJS-y)
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+
+all:   $(LIB)
+
+$(LIB):        $(obj).depend $(OBJS)
+       $(AR) $(ARFLAGS) $@ $(OBJS)
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
similarity index 100%
rename from drivers/ahci.c
rename to drivers/block/ahci.c
similarity index 100%
rename from drivers/ata_piix.c
rename to drivers/block/ata_piix.c
similarity index 100%
rename from drivers/sil680.c
rename to drivers/block/sil680.c
similarity index 97%
rename from dtt/Makefile
rename to drivers/hwmon/Makefile
index 72e5c88bd4f68f7c19626f375062090a805eb879..cebb2ba6353dfc328b5e5fb6692b9af08ced4ee4 100644 (file)
@@ -28,13 +28,14 @@ include $(TOPDIR)/config.mk
 
 #CFLAGS += -DDEBUG
 
-LIB    = $(obj)libdtt.a
+LIB    = $(obj)libhwmon.a
 
-COBJS-y += lm75.o
-COBJS-y += ds1621.o
 COBJS-y += adm1021.o
-COBJS-y += lm81.o
+COBJS-y += ds1621.o
+COBJS-y += ds1722.o
 COBJS-y += ds1775.o
+COBJS-y += lm75.o
+COBJS-y += lm81.o
 
 COBJS  := $(COBJS-y)
 SRCS   := $(COBJS:.o=.c)
similarity index 100%
rename from dtt/adm1021.c
rename to drivers/hwmon/adm1021.c
similarity index 100%
rename from dtt/ds1621.c
rename to drivers/hwmon/ds1621.c
similarity index 100%
rename from drivers/ds1722.c
rename to drivers/hwmon/ds1722.c
similarity index 100%
rename from dtt/ds1775.c
rename to drivers/hwmon/ds1775.c
similarity index 100%
rename from dtt/lm75.c
rename to drivers/hwmon/lm75.c
similarity index 100%
rename from dtt/lm81.c
rename to drivers/hwmon/lm81.c
diff --git a/drivers/i2c/Makefile b/drivers/i2c/Makefile
new file mode 100644 (file)
index 0000000..29d6c03
--- /dev/null
@@ -0,0 +1,49 @@
+#
+# (C) Copyright 2000-2007
+# 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
+# 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, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB    := $(obj)libi2c.a
+
+COBJS-y += fsl_i2c.o
+COBJS-y += omap1510_i2c.o
+COBJS-y += omap24xx_i2c.o
+COBJS-y += tsi108_i2c.o
+
+COBJS  := $(COBJS-y)
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+
+all:   $(LIB)
+
+$(LIB):        $(obj).depend $(OBJS)
+       $(AR) $(ARFLAGS) $@ $(OBJS)
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
similarity index 100%
rename from drivers/fsl_i2c.c
rename to drivers/i2c/fsl_i2c.c
diff --git a/drivers/input/Makefile b/drivers/input/Makefile
new file mode 100644 (file)
index 0000000..df22cf9
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# (C) Copyright 2000-2007
+# 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
+# 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, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB    := $(obj)libinput.a
+
+COBJS-y += i8042.o
+COBJS-y += keyboard.o
+COBJS-y += pc_keyb.o ps2ser.o ps2mult.o
+
+COBJS  := $(COBJS-y)
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+
+all:   $(LIB)
+
+$(LIB):        $(obj).depend $(OBJS)
+       $(AR) $(ARFLAGS) $@ $(OBJS)
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
similarity index 100%
rename from drivers/i8042.c
rename to drivers/input/i8042.c
similarity index 100%
rename from drivers/keyboard.c
rename to drivers/input/keyboard.c
similarity index 100%
rename from drivers/pc_keyb.c
rename to drivers/input/pc_keyb.c
similarity index 100%
rename from drivers/ps2mult.c
rename to drivers/input/ps2mult.c
similarity index 100%
rename from drivers/ps2ser.c
rename to drivers/input/ps2ser.c
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
new file mode 100644 (file)
index 0000000..78cec21
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# (C) Copyright 2000-2007
+# 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
+# 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, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB    := $(obj)libmisc.a
+
+COBJS-y += ali512x.o
+COBJS-y += ns87308.o
+COBJS-y += status_led.o
+
+COBJS  := $(COBJS-y)
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+
+all:   $(LIB)
+
+$(LIB):        $(obj).depend $(OBJS)
+       $(AR) $(ARFLAGS) $@ $(OBJS)
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
similarity index 100%
rename from drivers/ali512x.c
rename to drivers/misc/ali512x.c
similarity index 100%
rename from drivers/ns87308.c
rename to drivers/misc/ns87308.c
diff --git a/drivers/mtd/Makefile b/drivers/mtd/Makefile
new file mode 100644 (file)
index 0000000..95c5e02
--- /dev/null
@@ -0,0 +1,49 @@
+#
+# (C) Copyright 2000-2007
+# 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
+# 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, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB    := $(obj)libmtd.a
+
+COBJS-y += at45.o
+COBJS-y += cfi_flash.o
+COBJS-y += dataflash.o
+COBJS-y += mw_eeprom.o
+
+COBJS  := $(COBJS-y)
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+
+all:   $(LIB)
+
+$(LIB):        $(obj).depend $(OBJS)
+       $(AR) $(ARFLAGS) $@ $(OBJS)
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
similarity index 100%
rename from drivers/at45.c
rename to drivers/mtd/at45.c
similarity index 100%
rename from drivers/cfi_flash.c
rename to drivers/mtd/cfi_flash.c
similarity index 100%
rename from drivers/dataflash.c
rename to drivers/mtd/dataflash.c
similarity index 100%
rename from drivers/mw_eeprom.c
rename to drivers/mtd/mw_eeprom.c
similarity index 100%
rename from drivers/nand/nand.c
rename to drivers/mtd/nand/nand.c
similarity index 100%
rename from drivers/3c589.c
rename to drivers/net/3c589.c
similarity index 100%
rename from drivers/3c589.h
rename to drivers/net/3c589.h
similarity index 100%
rename from drivers/5701rls.c
rename to drivers/net/5701rls.c
similarity index 100%
rename from drivers/5701rls.h
rename to drivers/net/5701rls.h
similarity index 100%
rename from drivers/8390.h
rename to drivers/net/8390.h
index 37d69b9949bd94d6a97d272f32c6cc626d8b6a99..41e1bdeb3bc227513581b66dbc3170d26e3255ce 100644 (file)
@@ -25,8 +25,39 @@ include $(TOPDIR)/config.mk
 
 LIB    := $(obj)libnet.a
 
-COBJS  := mcffec.o
+COBJS-y += 3c589.o
+COBJS-y += bcm570x.o bcm570x_autoneg.o 5701rls.o
+COBJS-y += cs8900.o
+COBJS-y += dc2114x.o
+COBJS-y += dm9000x.o
+COBJS-y += e1000.o
+COBJS-y += eepro100.o
+COBJS-y += enc28j60.o
+COBJS-y += inca-ip_sw.o
+COBJS-y += ks8695eth.o
+COBJS-y += lan91c96.o
+COBJS-y += macb.o
+COBJS-y += mcffec.o
+COBJS-y += natsemi.o
+COBJS-y += ne2000.o
+COBJS-y += netarm_eth.o
+COBJS-y += netconsole.o
+COBJS-y += ns7520_eth.o
+COBJS-y += ns8382x.o
+COBJS-y += ns9750_eth.o
+COBJS-y += pcnet.o
+COBJS-y += plb2800_eth.o
+COBJS-y += rtl8019.o
+COBJS-y += rtl8139.o
+COBJS-y += rtl8169.o
+COBJS-y += s3c4510b_eth.o
+COBJS-y += smc91111.o
+COBJS-y += tigon3.o
+COBJS-y += tsec.o
+COBJS-y += tsi108_eth.o
+COBJS-y += uli526x.o
 
+COBJS  := $(COBJS-y)
 SRCS   := $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS))
 
similarity index 100%
rename from drivers/bcm570x.c
rename to drivers/net/bcm570x.c
similarity index 100%
rename from drivers/cs8900.c
rename to drivers/net/cs8900.c
similarity index 100%
rename from drivers/cs8900.h
rename to drivers/net/cs8900.h
similarity index 100%
rename from drivers/dc2114x.c
rename to drivers/net/dc2114x.c
similarity index 100%
rename from drivers/dm9000x.c
rename to drivers/net/dm9000x.c
similarity index 100%
rename from drivers/dm9000x.h
rename to drivers/net/dm9000x.h
similarity index 100%
rename from drivers/e1000.c
rename to drivers/net/e1000.c
similarity index 100%
rename from drivers/e1000.h
rename to drivers/net/e1000.h
similarity index 100%
rename from drivers/eepro100.c
rename to drivers/net/eepro100.c
similarity index 100%
rename from drivers/enc28j60.c
rename to drivers/net/enc28j60.c
similarity index 100%
rename from drivers/ks8695eth.c
rename to drivers/net/ks8695eth.c
similarity index 100%
rename from drivers/lan91c96.c
rename to drivers/net/lan91c96.c
similarity index 100%
rename from drivers/lan91c96.h
rename to drivers/net/lan91c96.h
similarity index 100%
rename from drivers/macb.c
rename to drivers/net/macb.c
similarity index 100%
rename from drivers/macb.h
rename to drivers/net/macb.h
similarity index 100%
rename from drivers/natsemi.c
rename to drivers/net/natsemi.c
similarity index 100%
rename from drivers/ne2000.c
rename to drivers/net/ne2000.c
similarity index 100%
rename from drivers/ne2000.h
rename to drivers/net/ne2000.h
similarity index 100%
rename from drivers/nicext.h
rename to drivers/net/nicext.h
similarity index 100%
rename from drivers/ns8382x.c
rename to drivers/net/ns8382x.c
similarity index 100%
rename from drivers/pcnet.c
rename to drivers/net/pcnet.c
similarity index 100%
rename from drivers/rtl8019.c
rename to drivers/net/rtl8019.c
similarity index 100%
rename from drivers/rtl8019.h
rename to drivers/net/rtl8019.h
similarity index 100%
rename from drivers/rtl8139.c
rename to drivers/net/rtl8139.c
similarity index 100%
rename from drivers/rtl8169.c
rename to drivers/net/rtl8169.c
similarity index 100%
rename from drivers/smc91111.c
rename to drivers/net/smc91111.c
similarity index 100%
rename from drivers/smc91111.h
rename to drivers/net/smc91111.h
similarity index 100%
rename from drivers/tigon3.c
rename to drivers/net/tigon3.c
similarity index 100%
rename from drivers/tigon3.h
rename to drivers/net/tigon3.h
similarity index 100%
rename from drivers/tsec.c
rename to drivers/net/tsec.c
similarity index 100%
rename from drivers/tsec.h
rename to drivers/net/tsec.h
similarity index 100%
rename from drivers/uli526x.c
rename to drivers/net/uli526x.c
diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile
new file mode 100644 (file)
index 0000000..fe45839
--- /dev/null
@@ -0,0 +1,51 @@
+#
+# (C) Copyright 2000-2007
+# 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
+# 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, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB    := $(obj)libpci.a
+
+COBJS-y += fsl_pci_init.o
+COBJS-y += pci.o
+COBJS-y += pci_auto.o
+COBJS-y += pci_indirect.o
+COBJS-y += tsi108_pci.o
+COBJS-y += w83c553f.o
+
+COBJS  := $(COBJS-y)
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+
+all:   $(LIB)
+
+$(LIB):        $(obj).depend $(OBJS)
+       $(AR) $(ARFLAGS) $@ $(OBJS)
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
similarity index 100%
rename from drivers/pci.c
rename to drivers/pci/pci.c
similarity index 100%
rename from drivers/pci_auto.c
rename to drivers/pci/pci_auto.c
similarity index 100%
rename from drivers/w83c553f.c
rename to drivers/pci/w83c553f.c
diff --git a/drivers/pcmcia/Makefile b/drivers/pcmcia/Makefile
new file mode 100644 (file)
index 0000000..55528c8
--- /dev/null
@@ -0,0 +1,50 @@
+#
+# (C) Copyright 2000-2007
+# 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
+# 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, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB    := $(obj)libpcmcia.a
+
+COBJS-y += mpc8xx_pcmcia.o
+COBJS-y += pxa_pcmcia.o
+COBJS-y += rpx_pcmcia.o
+COBJS-y += ti_pci1410a.o
+COBJS-y += tqm8xx_pcmcia.o
+
+COBJS  := $(COBJS-y)
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+
+all:   $(LIB)
+
+$(LIB):        $(obj).depend $(OBJS)
+       $(AR) $(ARFLAGS) $@ $(OBJS)
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
similarity index 100%
rename from drivers/i82365.c
rename to drivers/pcmcia/i82365.c
similarity index 100%
rename from rtc/Makefile
rename to drivers/rtc/Makefile
similarity index 100%
rename from rtc/bf5xx_rtc.c
rename to drivers/rtc/bf5xx_rtc.c
similarity index 100%
rename from rtc/date.c
rename to drivers/rtc/date.c
similarity index 100%
rename from rtc/ds12887.c
rename to drivers/rtc/ds12887.c
similarity index 100%
rename from rtc/ds1302.c
rename to drivers/rtc/ds1302.c
similarity index 100%
rename from rtc/ds1306.c
rename to drivers/rtc/ds1306.c
similarity index 100%
rename from rtc/ds1307.c
rename to drivers/rtc/ds1307.c
similarity index 100%
rename from rtc/ds1337.c
rename to drivers/rtc/ds1337.c
similarity index 100%
rename from rtc/ds1374.c
rename to drivers/rtc/ds1374.c
similarity index 100%
rename from rtc/ds1556.c
rename to drivers/rtc/ds1556.c
similarity index 100%
rename from rtc/ds164x.c
rename to drivers/rtc/ds164x.c
similarity index 100%
rename from rtc/ds174x.c
rename to drivers/rtc/ds174x.c
similarity index 100%
rename from rtc/ds3231.c
rename to drivers/rtc/ds3231.c
similarity index 100%
rename from rtc/m41t11.c
rename to drivers/rtc/m41t11.c
similarity index 100%
rename from rtc/m48t35ax.c
rename to drivers/rtc/m48t35ax.c
similarity index 100%
rename from rtc/max6900.c
rename to drivers/rtc/max6900.c
similarity index 100%
rename from rtc/mc146818.c
rename to drivers/rtc/mc146818.c
similarity index 100%
rename from rtc/mcfrtc.c
rename to drivers/rtc/mcfrtc.c
similarity index 100%
rename from rtc/mk48t59.c
rename to drivers/rtc/mk48t59.c
similarity index 100%
rename from rtc/mpc5xxx.c
rename to drivers/rtc/mpc5xxx.c
similarity index 100%
rename from rtc/mpc8xx.c
rename to drivers/rtc/mpc8xx.c
similarity index 100%
rename from rtc/pcf8563.c
rename to drivers/rtc/pcf8563.c
similarity index 100%
rename from rtc/rs5c372.c
rename to drivers/rtc/rs5c372.c
similarity index 100%
rename from rtc/s3c24x0_rtc.c
rename to drivers/rtc/s3c24x0_rtc.c
index 40f3d672ec9e9361a56af944e02fd6b276df3346..735c630006bd4751561cbc043ed5a1355a595523 100644 (file)
@@ -25,8 +25,19 @@ include $(TOPDIR)/config.mk
 
 LIB    := $(obj)libserial.a
 
-COBJS  := mcfuart.o serial_pl010.o serial_pl011.o
-
+COBJS-y += atmel_usart.o
+COBJS-y += mcfuart.o
+COBJS-y += ns9750_serial.o
+COBJS-y += ns16550.o
+COBJS-y += s3c4510b_uart.o
+COBJS-y += serial.o
+COBJS-y += serial_max3100.o
+COBJS-y += serial_pl010.o
+COBJS-y += serial_pl011.o
+COBJS-y += serial_xuartlite.o
+COBJS-y += usbtty.o
+
+COBJS  := $(COBJS-y)
 SRCS   := $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS))
 
similarity index 100%
rename from drivers/ns16550.c
rename to drivers/serial/ns16550.c
similarity index 100%
rename from drivers/serial.c
rename to drivers/serial/serial.c
similarity index 100%
rename from drivers/usbtty.c
rename to drivers/serial/usbtty.c
similarity index 100%
rename from drivers/usbtty.h
rename to drivers/serial/usbtty.h
diff --git a/drivers/usb/Makefile b/drivers/usb/Makefile
new file mode 100644 (file)
index 0000000..f8ea167
--- /dev/null
@@ -0,0 +1,52 @@
+#
+# (C) Copyright 2000-2007
+# 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
+# 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, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB    := $(obj)libusb.a
+
+COBJS-y += isp116x-hcd.o
+COBJS-y += sl811_usb.o
+COBJS-y += usb_ohci.o
+COBJS-y += usbdcore.o
+COBJS-y += usbdcore_ep0.o
+COBJS-y += usbdcore_mpc8xx.o
+COBJS-y += usbdcore_omap1510.o
+
+COBJS  := $(COBJS-y)
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+
+all:   $(LIB)
+
+$(LIB):        $(obj).depend $(OBJS)
+       $(AR) $(ARFLAGS) $@ $(OBJS)
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
similarity index 100%
rename from drivers/isp116x.h
rename to drivers/usb/isp116x.h
similarity index 100%
rename from drivers/sl811.h
rename to drivers/usb/sl811.h
similarity index 99%
rename from drivers/sl811_usb.c
rename to drivers/usb/sl811_usb.c
index b0cdf0bc2c77d270c63ec9e9c18940b2736290da..c1f8427c965866867327e576a835d628bf14b76d 100644 (file)
@@ -41,7 +41,7 @@
 #include <usb.h>
 #include "sl811.h"
 
-#include "../board/kup/common/kup.h"
+#include "../../board/kup/common/kup.h"
 
 #ifdef __PPC__
 # define EIEIO         __asm__ volatile ("eieio")
similarity index 100%
rename from drivers/usb_ohci.c
rename to drivers/usb/usb_ohci.c
similarity index 100%
rename from drivers/usb_ohci.h
rename to drivers/usb/usb_ohci.h
similarity index 100%
rename from drivers/usbdcore.c
rename to drivers/usb/usbdcore.c
diff --git a/drivers/video/Makefile b/drivers/video/Makefile
new file mode 100644 (file)
index 0000000..36611ec
--- /dev/null
@@ -0,0 +1,53 @@
+#
+# (C) Copyright 2000-2007
+# 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
+# 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, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB    := $(obj)libvideo.a
+
+COBJS-y += ati_radeon_fb.o
+COBJS-y += cfb_console.o
+COBJS-y += ct69000.o
+COBJS-y += sed13806.o
+COBJS-y += sed156x.o
+COBJS-y += sm501.o
+COBJS-y += smiLynxEM.o
+COBJS-y += videomodes.o
+
+COBJS  := $(COBJS-y)
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+
+all:   $(LIB)
+
+$(LIB):        $(obj).depend $(OBJS)
+       $(AR) $(ARFLAGS) $@ $(OBJS)
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
similarity index 100%
rename from drivers/ati_ids.h
rename to drivers/video/ati_ids.h
similarity index 99%
rename from drivers/ati_radeon_fb.c
rename to drivers/video/ati_radeon_fb.c
index 9613d80cc85e5f9452bc009c5a4174880c1665c5..0bdaa1c04d7dbc987a0ffccdd3d682199bc02d2f 100644 (file)
@@ -350,7 +350,7 @@ void radeon_setmode(void)
        radeon_write_pll_regs(rinfo, mode);
 }
 
-#include "bios_emulator/include/biosemu.h"
+#include "../bios_emulator/include/biosemu.h"
 extern int BootVideoCardBIOS(pci_dev_t pcidev, BE_VGAInfo ** pVGAInfo, int cleanUp);
 
 int radeon_probe(struct radeonfb_info *rinfo)
similarity index 100%
rename from drivers/ct69000.c
rename to drivers/video/ct69000.c
similarity index 100%
rename from drivers/sed13806.c
rename to drivers/video/sed13806.c
similarity index 100%
rename from drivers/sed156x.c
rename to drivers/video/sed156x.c
similarity index 100%
rename from drivers/sm501.c
rename to drivers/video/sm501.c
index 98e3e86ffa555906b0eb34c2cd3fff40fb425767..b8a3594e9e546f901af9449849d239834dcc9cf1 100644 (file)
@@ -29,7 +29,7 @@
 
 #include <common.h>
 #include <exports.h>
-#include "../drivers/smc91111.h"
+#include "../drivers/net/smc91111.h"
 
 #define SMC_BASE_ADDRESS CONFIG_SMC91111_BASE
 #define EEPROM         0x1;
index b4a063a1d4c6ad3c199b0b41e917dc4e27265aa6..9b05bd6c8c24cfa92926188af76f8e7ca2438a56 100644 (file)
 #define CONFIG_CMD_DHCP
 #define CONFIG_CMD_ELF
 #define CONFIG_CMD_PING
-#define CONFIG_CMD_REGINFO
 
 
 #define CONFIG_BOOTDELAY       3
index ca404ff452a5ec0b7bb12a5130f59761660a2264..18a036c2b64af1fb15fa81a36cd3e122cf1caf2d 100644 (file)
@@ -88,7 +88,6 @@
 #include <config_cmd_default.h>
 
 #define CONFIG_CMD_CACHE
-#define CONFIG_CMD_REGINFO
 #define CONFIG_CMD_DATE
 #define CONFIG_CMD_ELF
 
index 3dd3aca3b6aaa53803b402be79f451313f18604e..48ccfd9100002deb3aff35ee4f17bc7d232b25b2 100644 (file)
@@ -1,22 +1,3 @@
-/*
- * libfdt - Flat Device Tree manipulation
- * Copyright (C) 2006 David Gibson, IBM Corporation.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
 #ifndef _FDT_H
 #define _FDT_H
 
index 60fa423b334ead6a60eb26fce036617f1a72b7ff..8f781d4405bf59f15f923949ead5d7ab1533887a 100644 (file)
 #include <fdt.h>
 
 int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force);
+void do_fixup_by_path(void *fdt, const char *path, const char *prop,
+                     const void *val, int len, int create);
+void do_fixup_by_path_u32(void *fdt, const char *path, const char *prop,
+                         u32 val, int create);
+void do_fixup_by_prop(void *fdt,
+                     const char *pname, const void *pval, int plen,
+                     const char *prop, const void *val, int len,
+                     int create);
+void do_fixup_by_prop_u32(void *fdt,
+                         const char *pname, const void *pval, int plen,
+                         const char *prop, u32 val, int create);
+void do_fixup_by_compat(void *fdt, const char *compat,
+                       const char *prop, const void *val, int len, int create);
+void do_fixup_by_compat_u32(void *fdt, const char *compat,
+                           const char *prop, u32 val, int create);
+void fdt_fixup_ethernet(void *fdt, bd_t *bd);
 
 #ifdef CONFIG_OF_HAS_UBOOT_ENV
 int fdt_env(void *fdt);
index 38c65a9899e41ff01c63c511f8fc9ecf86d97f2c..6b2fb92ea3578b7a4b6fb5c49ee2c1d8f4ecee5a 100644 (file)
+#ifndef _LIBFDT_H
+#define _LIBFDT_H
 /*
  * libfdt - Flat Device Tree manipulation
  * Copyright (C) 2006 David Gibson, IBM Corporation.
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
+ * libfdt is dual licensed: you can use it either under the terms of
+ * the GPL, or the BSD license, at your option.
+ *
+ *  a) This library 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 library 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 library; if not, write to the Free
+ *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ *     MA 02110-1301 USA
+ *
+ * Alternatively,
+ *
+ *  b) Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
  *
- * This library 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
- * Lesser General Public License for more details.
+ *     1. Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *     2. Redistributions in binary form must reproduce the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer in the documentation and/or other materials
+ *        provided with the distribution.
  *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ *     CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ *     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ *     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ *     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ *     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ *     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ *     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ *     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ *     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ *     OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ *     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef _LIBFDT_H
-#define _LIBFDT_H
-
-#include <fdt.h>
 #include <libfdt_env.h>
+#include <fdt.h>
 
 #define FDT_FIRST_SUPPORTED_VERSION    0x10
 #define FDT_LAST_SUPPORTED_VERSION     0x11
 
 /* Error codes: informative error codes */
 #define FDT_ERR_NOTFOUND       1
+       /* FDT_ERR_NOTFOUND: The requested node or property does not exist */
 #define FDT_ERR_EXISTS         2
+       /* FDT_ERR_EXISTS: Attemped to create a node or property which
+        * already exists */
 #define FDT_ERR_NOSPACE                3
+       /* FDT_ERR_NOSPACE: Operation needed to expand the device
+        * tree, but its buffer did not have sufficient space to
+        * contain the expanded tree. Use fdt_open_into() to move the
+        * device tree to a buffer with more space. */
 
 /* Error codes: codes for bad parameters */
 #define FDT_ERR_BADOFFSET      4
+       /* FDT_ERR_BADOFFSET: Function was passed a structure block
+        * offset which is out-of-bounds, or which points to an
+        * unsuitable part of the structure for the operation. */
 #define FDT_ERR_BADPATH                5
-#define FDT_ERR_BADSTATE       6
+       /* FDT_ERR_BADPATH: Function was passed a badly formatted path
+        * (e.g. missing a leading / for a function which requires an
+        * absolute path) */
+#define FDT_ERR_BADPHANDLE     6
+       /* FDT_ERR_BADPHANDLE: Function was passed an invalid phandle
+        * value.  phandle values of 0 and -1 are not permitted. */
+#define FDT_ERR_BADSTATE       7
+       /* FDT_ERR_BADSTATE: Function was passed an incomplete device
+        * tree created by the sequential-write functions, which is
+        * not sufficiently complete for the requested operation. */
 
 /* Error codes: codes for bad device tree blobs */
-#define FDT_ERR_TRUNCATED      7
-#define FDT_ERR_BADMAGIC       8
-#define FDT_ERR_BADVERSION     9
-#define FDT_ERR_BADSTRUCTURE   10
-#define FDT_ERR_BADLAYOUT      11
+#define FDT_ERR_TRUNCATED      8
+       /* FDT_ERR_TRUNCATED: Structure block of the given device tree
+        * ends without an FDT_END tag. */
+#define FDT_ERR_BADMAGIC       9
+       /* FDT_ERR_BADMAGIC: Given "device tree" appears not to be a
+        * device tree at all - it is missing the flattened device
+        * tree magic number. */
+#define FDT_ERR_BADVERSION     10
+       /* FDT_ERR_BADVERSION: Given device tree has a version which
+        * can't be handled by the requested operation.  For
+        * read-write functions, this may mean that fdt_open_into() is
+        * required to convert the tree to the expected version. */
+#define FDT_ERR_BADSTRUCTURE   11
+       /* FDT_ERR_BADSTRUCTURE: Given device tree has a corrupt
+        * structure block or other serious error (e.g. misnested
+        * nodes, or subnodes preceding properties). */
+#define FDT_ERR_BADLAYOUT      12
+       /* FDT_ERR_BADLAYOUT: For read-write functions, the given
+        * device tree has it's sub-blocks in an order that the
+        * function can't handle (memory reserve map, then structure,
+        * then strings).  Use fdt_open_into() to reorganize the tree
+        * into a form suitable for the read-write operations. */
+
+/* "Can't happen" error indicating a bug in libfdt */
+#define FDT_ERR_INTERNAL       13
+       /* FDT_ERR_INTERNAL: libfdt has failed an internal assertion.
+        * Should never be returned, if it is, it indicates a bug in
+        * libfdt itself. */
 
-#define FDT_ERR_MAX            11
+#define FDT_ERR_MAX            13
+
+/**********************************************************************/
+/* Low-level functions (you probably don't need these)                */
+/**********************************************************************/
+
+const void *fdt_offset_ptr(const void *fdt, int offset, int checklen);
+static inline void *fdt_offset_ptr_w(void *fdt, int offset, int checklen)
+{
+       return (void *)fdt_offset_ptr(fdt, offset, checklen);
+}
+
+uint32_t fdt_next_tag(const void *fdt, int offset, int *nextoffset);
+
+/**********************************************************************/
+/* General functions                                                  */
+/**********************************************************************/
 
 #define fdt_get_header(fdt, field) \
-       (fdt32_to_cpu(((struct fdt_header *)(fdt))->field))
-#define fdt_magic(fdt)                 (fdt_get_header(fdt, magic))
+       (fdt32_to_cpu(((const struct fdt_header *)(fdt))->field))
+#define fdt_magic(fdt)                         (fdt_get_header(fdt, magic))
 #define fdt_totalsize(fdt)             (fdt_get_header(fdt, totalsize))
 #define fdt_off_dt_struct(fdt)         (fdt_get_header(fdt, off_dt_struct))
 #define fdt_off_dt_strings(fdt)                (fdt_get_header(fdt, off_dt_strings))
 #define fdt_off_mem_rsvmap(fdt)                (fdt_get_header(fdt, off_mem_rsvmap))
 #define fdt_version(fdt)               (fdt_get_header(fdt, version))
-#define fdt_last_comp_version(fdt)     (fdt_get_header(fdt, last_comp_version))
-#define fdt_boot_cpuid_phys(fdt)       (fdt_get_header(fdt, boot_cpuid_phys))
-#define fdt_size_dt_strings(fdt)       (fdt_get_header(fdt, size_dt_strings))
+#define fdt_last_comp_version(fdt)     (fdt_get_header(fdt, last_comp_version))
+#define fdt_boot_cpuid_phys(fdt)       (fdt_get_header(fdt, boot_cpuid_phys))
+#define fdt_size_dt_strings(fdt)       (fdt_get_header(fdt, size_dt_strings))
 #define fdt_size_dt_struct(fdt)                (fdt_get_header(fdt, size_dt_struct))
 
-#define fdt_set_header(fdt, field, val) \
-       ((struct fdt_header *)(fdt))->field = cpu_to_fdt32(val)
+#define __fdt_set_hdr(name) \
+       static inline void fdt_set_##name(void *fdt, uint32_t val) \
+       { \
+               struct fdt_header *fdth = fdt; \
+               fdth->name = cpu_to_fdt32(val); \
+       }
+__fdt_set_hdr(magic);
+__fdt_set_hdr(totalsize);
+__fdt_set_hdr(off_dt_struct);
+__fdt_set_hdr(off_dt_strings);
+__fdt_set_hdr(off_mem_rsvmap);
+__fdt_set_hdr(version);
+__fdt_set_hdr(last_comp_version);
+__fdt_set_hdr(boot_cpuid_phys);
+__fdt_set_hdr(size_dt_strings);
+__fdt_set_hdr(size_dt_struct);
+#undef __fdt_set_hdr
 
+/**
+ * fdt_check_header - sanity check a device tree or possible device tree
+ * @fdt: pointer to data which might be a flattened device tree
+ *
+ * fdt_check_header() checks that the given buffer contains what
+ * appears to be a flattened device tree with sane information in its
+ * header.
+ *
+ * returns:
+ *     0, if the buffer appears to contain a valid device tree
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE, standard meanings, as above
+ */
 int fdt_check_header(const void *fdt);
 
-void *fdt_offset_ptr(const void *fdt, int offset, int checklen);
+/**
+ * fdt_move - move a device tree around in memory
+ * @fdt: pointer to the device tree to move
+ * @buf: pointer to memory where the device is to be moved
+ * @bufsize: size of the memory space at buf
+ *
+ * fdt_move() relocates, if possible, the device tree blob located at
+ * fdt to the buffer at buf of size bufsize.  The buffer may overlap
+ * with the existing device tree blob at fdt.  Therefore,
+ *     fdt_move(fdt, fdt, fdt_totalsize(fdt))
+ * should always succeed.
+ *
+ * returns:
+ *     0, on success
+ *     -FDT_ERR_NOSPACE, bufsize is insufficient to contain the device tree
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE, standard meanings
+ */
+int fdt_move(const void *fdt, void *buf, int bufsize);
 
-#define fdt_offset_ptr_typed(fdt, offset, var) \
-       ((typeof(var))(fdt_offset_ptr((fdt), (offset), sizeof(*(var)))))
+/**********************************************************************/
+/* Read-only functions                                                */
+/**********************************************************************/
 
-int fdt_move(const void *fdt, void *buf, int bufsize);
+/**
+ * fdt_string - retreive a string from the strings block of a device tree
+ * @fdt: pointer to the device tree blob
+ * @stroffset: offset of the string within the strings block (native endian)
+ *
+ * fdt_string() retrieves a pointer to a single string from the
+ * strings block of the device tree blob at fdt.
+ *
+ * returns:
+ *     a pointer to the string, on success
+ *     NULL, if stroffset is out of bounds
+ */
+const char *fdt_string(const void *fdt, int stroffset);
 
-/* Read-only functions */
-char *fdt_string(const void *fdt, int stroffset);
+/**
+ * fdt_num_mem_rsv - retreive the number of memory reserve map entries
+ * @fdt: pointer to the device tree blob
+ *
+ * Returns the number of entries in the device tree blob's memory
+ * reservation map.  This does not include the terminating 0,0 entry
+ * or any other (0,0) entries reserved for expansion.
+ *
+ * returns:
+ *     the number of entries
+ */
+int fdt_num_mem_rsv(const void *fdt);
 
+/**
+ * fdt_get_mem_rsv - retreive one memory reserve map entry
+ * @fdt: pointer to the device tree blob
+ * @address, @size: pointers to 64-bit variables
+ *
+ * On success, *address and *size will contain the address and size of
+ * the n-th reserve map entry from the device tree blob, in
+ * native-endian format.
+ *
+ * returns:
+ *     0, on success
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE, standard meanings
+ */
+int fdt_get_mem_rsv(const void *fdt, int n, uint64_t *address, uint64_t *size);
+
+/**
+ * fdt_subnode_offset_namelen - find a subnode based on substring
+ * @fdt: pointer to the device tree blob
+ * @parentoffset: structure block offset of a node
+ * @name: name of the subnode to locate
+ * @namelen: number of characters of name to consider
+ *
+ * Identical to fdt_subnode_offset(), but only examine the first
+ * namelen characters of name for matching the subnode name.  This is
+ * useful for finding subnodes based on a portion of a larger string,
+ * such as a full path.
+ */
 int fdt_subnode_offset_namelen(const void *fdt, int parentoffset,
                               const char *name, int namelen);
+/**
+ * fdt_subnode_offset - find a subnode of a given node
+ * @fdt: pointer to the device tree blob
+ * @parentoffset: structure block offset of a node
+ * @name: name of the subnode to locate
+ *
+ * fdt_subnode_offset() finds a subnode of the node at structure block
+ * offset parentoffset with the given name.  name may include a unit
+ * address, in which case fdt_subnode_offset() will find the subnode
+ * with that unit address, or the unit address may be omitted, in
+ * which case fdt_subnode_offset() will find an arbitrary subnode
+ * whose name excluding unit address matches the given name.
+ *
+ * returns:
+ *     structure block offset of the requested subnode (>=0), on success
+ *     -FDT_ERR_NOTFOUND, if the requested subnode does not exist
+ *     -FDT_ERR_BADOFFSET, if parentoffset did not point to an FDT_BEGIN_NODE tag
+ *      -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_BADSTRUCTURE,
+ *     -FDT_ERR_TRUNCATED, standard meanings.
+ */
 int fdt_subnode_offset(const void *fdt, int parentoffset, const char *name);
 
-int fdt_find_node_by_path(const void *fdt, const char *path);
-int fdt_find_node_by_type(const void *fdt, int nodeoffset, const char *type);
+/**
+ * fdt_path_offset - find a tree node by its full path
+ * @fdt: pointer to the device tree blob
+ * @path: full path of the node to locate
+ *
+ * fdt_path_offset() finds a node of a given path in the device tree.
+ * Each path component may omit the unit address portion, but the
+ * results of this are undefined if any such path component is
+ * ambiguous (that is if there are multiple nodes at the relevant
+ * level matching the given component, differentiated only by unit
+ * address).
+ *
+ * returns:
+ *     structure block offset of the node with the requested path (>=0), on success
+ *     -FDT_ERR_BADPATH, given path does not begin with '/' or is invalid
+ *     -FDT_ERR_NOTFOUND, if the requested node does not exist
+ *      -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_BADSTRUCTURE,
+ *     -FDT_ERR_TRUNCATED, standard meanings.
+ */
+int fdt_path_offset(const void *fdt, const char *path);
 
-int fdt_node_is_compatible(const void *fdt, int nodeoffset,
-                          const char *compat);
-int fdt_find_compatible_node(const void *fdt, int nodeoffset,
-                            const char *type, const char *compat);
+/**
+ * fdt_get_name - retreive the name of a given node
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: structure block offset of the starting node
+ * @lenp: pointer to an integer variable (will be overwritten) or NULL
+ *
+ * fdt_get_name() retrieves the name (including unit address) of the
+ * device tree node at structure block offset nodeoffset.  If lenp is
+ * non-NULL, the length of this name is also returned, in the integer
+ * pointed to by lenp.
+ *
+ * returns:
+ *     pointer to the node's name, on success
+ *             If lenp is non-NULL, *lenp contains the length of that name (>=0)
+ *     NULL, on error
+ *             if lenp is non-NULL *lenp contains an error code (<0):
+ *             -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *             -FDT_ERR_BADMAGIC,
+ *             -FDT_ERR_BADVERSION,
+ *             -FDT_ERR_BADSTATE, standard meanings
+ */
+const char *fdt_get_name(const void *fdt, int nodeoffset, int *lenp);
 
-struct fdt_property *fdt_get_property(const void *fdt, int nodeoffset,
-                                     const char *name, int *lenp);
-void *fdt_getprop(const void *fdt, int nodeoffset,
-                 const char *name, int *lenp);
+/**
+ * fdt_get_property - find a given property in a given node
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to find
+ * @name: name of the property to find
+ * @lenp: pointer to an integer variable (will be overwritten) or NULL
+ *
+ * fdt_get_property() retrieves a pointer to the fdt_property
+ * structure within the device tree blob corresponding to the property
+ * named 'name' of the node at offset nodeoffset.  If lenp is
+ * non-NULL, the length of the property value also returned, in the
+ * integer pointed to by lenp.
+ *
+ * returns:
+ *     pointer to the structure representing the property
+ *             if lenp is non-NULL, *lenp contains the length of the property
+ *             value (>=0)
+ *     NULL, on error
+ *             if lenp is non-NULL, *lenp contains an error code (<0):
+ *             -FDT_ERR_NOTFOUND, node does not have named property
+ *             -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *             -FDT_ERR_BADMAGIC,
+ *             -FDT_ERR_BADVERSION,
+ *             -FDT_ERR_BADSTATE,
+ *             -FDT_ERR_BADSTRUCTURE,
+ *             -FDT_ERR_TRUNCATED, standard meanings
+ */
+const struct fdt_property *fdt_get_property(const void *fdt, int nodeoffset,
+                                           const char *name, int *lenp);
+static inline struct fdt_property *fdt_get_property_w(void *fdt, int nodeoffset,
+                                                     const char *name,
+                                                     int *lenp)
+{
+       return (struct fdt_property *)fdt_get_property(fdt, nodeoffset,
+                                                      name, lenp);
+}
 
-uint32_t fdt_next_tag(const void *fdt, int offset,
-                     int *nextoffset, char **namep);
-int fdt_num_reservemap(void *fdt, int *used, int *total);
-int fdt_get_reservemap(void *fdt, int n, struct fdt_reserve_entry *re);
+/**
+ * fdt_getprop - retrieve the value of a given property
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to find
+ * @name: name of the property to find
+ * @lenp: pointer to an integer variable (will be overwritten) or NULL
+ *
+ * fdt_getprop() retrieves a pointer to the value of the property
+ * named 'name' of the node at offset nodeoffset (this will be a
+ * pointer to within the device blob itself, not a copy of the value).
+ * If lenp is non-NULL, the length of the property value also
+ * returned, in the integer pointed to by lenp.
+ *
+ * returns:
+ *     pointer to the property's value
+ *             if lenp is non-NULL, *lenp contains the length of the property
+ *             value (>=0)
+ *     NULL, on error
+ *             if lenp is non-NULL, *lenp contains an error code (<0):
+ *             -FDT_ERR_NOTFOUND, node does not have named property
+ *             -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *             -FDT_ERR_BADMAGIC,
+ *             -FDT_ERR_BADVERSION,
+ *             -FDT_ERR_BADSTATE,
+ *             -FDT_ERR_BADSTRUCTURE,
+ *             -FDT_ERR_TRUNCATED, standard meanings
+ */
+const void *fdt_getprop(const void *fdt, int nodeoffset,
+                       const char *name, int *lenp);
+static inline void *fdt_getprop_w(void *fdt, int nodeoffset,
+                                 const char *name, int *lenp)
+{
+       return (void *)fdt_getprop(fdt, nodeoffset, name, lenp);
+}
+
+/**
+ * fdt_get_phandle - retreive the phandle of a given node
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: structure block offset of the node
+ *
+ * fdt_get_phandle() retrieves the phandle of the device tree node at
+ * structure block offset nodeoffset.
+ *
+ * returns:
+ *     the phandle of the node at nodeoffset, on succes (!= 0, != -1)
+ *     0, if the node has no phandle, or another error occurs
+ */
+uint32_t fdt_get_phandle(const void *fdt, int nodeoffset);
+
+/**
+ * fdt_get_path - determine the full path of a node
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose path to find
+ * @buf: character buffer to contain the returned path (will be overwritten)
+ * @buflen: size of the character buffer at buf
+ *
+ * fdt_get_path() computes the full path of the node at offset
+ * nodeoffset, and records that path in the buffer at buf.
+ *
+ * NOTE: This function is expensive, as it must scan the device tree
+ * structure from the start to nodeoffset.
+ *
+ * returns:
+ *     0, on success
+ *             buf contains the absolute path of the node at
+ *             nodeoffset, as a NUL-terminated string.
+ *     -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
+ *     -FDT_ERR_NOSPACE, the path of the given node is longer than (bufsize-1)
+ *             characters and will not fit in the given buffer.
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_BADSTRUCTURE, standard meanings
+ */
+int fdt_get_path(const void *fdt, int nodeoffset, char *buf, int buflen);
+
+/**
+ * fdt_supernode_atdepth_offset - find a specific ancestor of a node
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose parent to find
+ * @supernodedepth: depth of the ancestor to find
+ * @nodedepth: pointer to an integer variable (will be overwritten) or NULL
+ *
+ * fdt_supernode_atdepth_offset() finds an ancestor of the given node
+ * at a specific depth from the root (where the root itself has depth
+ * 0, its immediate subnodes depth 1 and so forth).  So
+ *     fdt_supernode_atdepth_offset(fdt, nodeoffset, 0, NULL);
+ * will always return 0, the offset of the root node.  If the node at
+ * nodeoffset has depth D, then:
+ *     fdt_supernode_atdepth_offset(fdt, nodeoffset, D, NULL);
+ * will return nodeoffset itself.
+ *
+ * NOTE: This function is expensive, as it must scan the device tree
+ * structure from the start to nodeoffset.
+ *
+ * returns:
+
+ *     structure block offset of the node at node offset's ancestor
+ *             of depth supernodedepth (>=0), on success
+ *     -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
+*      -FDT_ERR_NOTFOUND, supernodedepth was greater than the depth of nodeoffset
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_BADSTRUCTURE, standard meanings
+ */
+int fdt_supernode_atdepth_offset(const void *fdt, int nodeoffset,
+                                int supernodedepth, int *nodedepth);
+
+/**
+ * fdt_node_depth - find the depth of a given node
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose parent to find
+ *
+ * fdt_node_depth() finds the depth of a given node.  The root node
+ * has depth 0, its immediate subnodes depth 1 and so forth.
+ *
+ * NOTE: This function is expensive, as it must scan the device tree
+ * structure from the start to nodeoffset.
+ *
+ * returns:
+ *     depth of the node at nodeoffset (>=0), on success
+ *     -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_BADSTRUCTURE, standard meanings
+ */
+int fdt_node_depth(const void *fdt, int nodeoffset);
+
+/**
+ * fdt_parent_offset - find the parent of a given node
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose parent to find
+ *
+ * fdt_parent_offset() locates the parent node of a given node (that
+ * is, it finds the offset of the node which contains the node at
+ * nodeoffset as a subnode).
+ *
+ * NOTE: This function is expensive, as it must scan the device tree
+ * structure from the start to nodeoffset, *twice*.
+ *
+ * returns:
+ *     stucture block offset of the parent of the node at nodeoffset
+ *             (>=0), on success
+ *     -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_BADSTRUCTURE, standard meanings
+ */
+int fdt_parent_offset(const void *fdt, int nodeoffset);
+
+/**
+ * fdt_node_offset_by_prop_value - find nodes with a given property value
+ * @fdt: pointer to the device tree blob
+ * @startoffset: only find nodes after this offset
+ * @propname: property name to check
+ * @propval: property value to search for
+ * @proplen: length of the value in propval
+ *
+ * fdt_node_offset_by_prop_value() returns the offset of the first
+ * node after startoffset, which has a property named propname whose
+ * value is of length proplen and has value equal to propval; or if
+ * startoffset is -1, the very first such node in the tree.
+ *
+ * To iterate through all nodes matching the criterion, the following
+ * idiom can be used:
+ *     offset = fdt_node_offset_by_prop_value(fdt, -1, propname,
+ *                                            propval, proplen);
+ *     while (offset != -FDT_ERR_NOTFOUND) {
+ *             // other code here
+ *             offset = fdt_node_offset_by_prop_value(fdt, offset, propname,
+ *                                                    propval, proplen);
+ *     }
+ *
+ * Note the -1 in the first call to the function, if 0 is used here
+ * instead, the function will never locate the root node, even if it
+ * matches the criterion.
+ *
+ * returns:
+ *     structure block offset of the located node (>= 0, >startoffset),
+ *              on success
+ *     -FDT_ERR_NOTFOUND, no node matching the criterion exists in the
+ *             tree after startoffset
+ *     -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_BADSTRUCTURE, standard meanings
+ */
+int fdt_node_offset_by_prop_value(const void *fdt, int startoffset,
+                                 const char *propname,
+                                 const void *propval, int proplen);
+
+/**
+ * fdt_node_offset_by_phandle - find the node with a given phandle
+ * @fdt: pointer to the device tree blob
+ * @phandle: phandle value
+ *
+ * fdt_node_offset_by_prop_value() returns the offset of the node
+ * which has the given phandle value.  If there is more than one node
+ * in the tree with the given phandle (an invalid tree), results are
+ * undefined.
+ *
+ * returns:
+ *     structure block offset of the located node (>= 0), on success
+ *     -FDT_ERR_NOTFOUND, no node with that phandle exists
+ *     -FDT_ERR_BADPHANDLE, given phandle value was invalid (0 or -1)
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_BADSTRUCTURE, standard meanings
+ */
+int fdt_node_offset_by_phandle(const void *fdt, uint32_t phandle);
+
+/**
+ * fdt_node_check_compatible: check a node's compatible property
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of a tree node
+ * @compatible: string to match against
+ *
+ *
+ * fdt_node_check_compatible() returns 0 if the given node contains a
+ * 'compatible' property with the given string as one of its elements,
+ * it returns non-zero otherwise, or on error.
+ *
+ * returns:
+ *     0, if the node has a 'compatible' property listing the given string
+ *     1, if the node has a 'compatible' property, but it does not list
+ *             the given string
+ *     -FDT_ERR_NOTFOUND, if the given node has no 'compatible' property
+ *     -FDT_ERR_BADOFFSET, if nodeoffset does not refer to a BEGIN_NODE tag
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_BADSTRUCTURE, standard meanings
+ */
+int fdt_node_check_compatible(const void *fdt, int nodeoffset,
+                             const char *compatible);
+
+/**
+ * fdt_node_offset_by_compatible - find nodes with a given 'compatible' value
+ * @fdt: pointer to the device tree blob
+ * @startoffset: only find nodes after this offset
+ * @compatible: 'compatible' string to match against
+ *
+ * fdt_node_offset_by_compatible() returns the offset of the first
+ * node after startoffset, which has a 'compatible' property which
+ * lists the given compatible string; or if startoffset is -1, the
+ * very first such node in the tree.
+ *
+ * To iterate through all nodes matching the criterion, the following
+ * idiom can be used:
+ *     offset = fdt_node_offset_by_compatible(fdt, -1, compatible);
+ *     while (offset != -FDT_ERR_NOTFOUND) {
+ *             // other code here
+ *             offset = fdt_node_offset_by_compatible(fdt, offset, compatible);
+ *     }
+ *
+ * Note the -1 in the first call to the function, if 0 is used here
+ * instead, the function will never locate the root node, even if it
+ * matches the criterion.
+ *
+ * returns:
+ *     structure block offset of the located node (>= 0, >startoffset),
+ *              on success
+ *     -FDT_ERR_NOTFOUND, no node matching the criterion exists in the
+ *             tree after startoffset
+ *     -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_BADSTRUCTURE, standard meanings
+ */
+int fdt_node_offset_by_compatible(const void *fdt, int startoffset,
+                                 const char *compatible);
+
+/**********************************************************************/
+/* Write-in-place functions                                           */
+/**********************************************************************/
 
-/* Write-in-place functions */
 int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name,
                        const void *val, int len);
-
-#define fdt_setprop_inplace_typed(fdt, nodeoffset, name, val) \
-       ({ \
-               typeof(val) x = val; \
-               fdt_setprop_inplace(fdt, nodeoffset, name, &x, sizeof(x)); \
-       })
+static inline int fdt_setprop_inplace_cell(void *fdt, int nodeoffset,
+                                          const char *name, uint32_t val)
+{
+       val = cpu_to_fdt32(val);
+       return fdt_setprop_inplace(fdt, nodeoffset, name, &val, sizeof(val));
+}
 
 int fdt_nop_property(void *fdt, int nodeoffset, const char *name);
 int fdt_nop_node(void *fdt, int nodeoffset);
-int fdt_insert_reservemap_entry(void *fdt, int n, uint64_t addr, uint64_t size);
 
+/**********************************************************************/
+/* Sequential write functions                                         */
+/**********************************************************************/
 
-/* Sequential-write functions */
 int fdt_create(void *buf, int bufsize);
 int fdt_add_reservemap_entry(void *fdt, uint64_t addr, uint64_t size);
 int fdt_finish_reservemap(void *fdt);
 int fdt_begin_node(void *fdt, const char *name);
 int fdt_property(void *fdt, const char *name, const void *val, int len);
-#define fdt_property_typed(fdt, name, val) \
-       ({ \
-               typeof(val) x = (val); \
-               fdt_property((fdt), (name), &x, sizeof(x)); \
-       })
+static inline int fdt_property_cell(void *fdt, const char *name, uint32_t val)
+{
+       val = cpu_to_fdt32(val);
+       return fdt_property(fdt, name, &val, sizeof(val));
+}
 #define fdt_property_string(fdt, name, str) \
        fdt_property(fdt, name, str, strlen(str)+1)
 int fdt_end_node(void *fdt);
 int fdt_finish(void *fdt);
-int fdt_replace_reservemap_entry(void *fdt, int n, uint64_t addr, uint64_t size);
 
-/* Read-write functions */
-int fdt_open_into(void *fdt, void *buf, int bufsize);
+/**********************************************************************/
+/* Read-write functions                                               */
+/**********************************************************************/
+
+int fdt_open_into(const void *fdt, void *buf, int bufsize);
 int fdt_pack(void *fdt);
 
+int fdt_add_mem_rsv(void *fdt, uint64_t address, uint64_t size);
+int fdt_del_mem_rsv(void *fdt, int n);
+
 int fdt_setprop(void *fdt, int nodeoffset, const char *name,
                const void *val, int len);
-#define fdt_setprop_typed(fdt, nodeoffset, name, val) \
-       ({ \
-               typeof(val) x = (val); \
-               fdt_setprop((fdt), (nodeoffset), (name), &x, sizeof(x)); \
-       })
+static inline int fdt_setprop_cell(void *fdt, int nodeoffset, const char *name,
+                                  uint32_t val)
+{
+       val = cpu_to_fdt32(val);
+       return fdt_setprop(fdt, nodeoffset, name, &val, sizeof(val));
+}
 #define fdt_setprop_string(fdt, nodeoffset, name, str) \
        fdt_setprop((fdt), (nodeoffset), (name), (str), strlen(str)+1)
-int fdt_find_and_setprop(void *fdt, const char *node, const char *prop,
-                        const void *val, int len, int create);
 int fdt_delprop(void *fdt, int nodeoffset, const char *name);
 int fdt_add_subnode_namelen(void *fdt, int parentoffset,
                            const char *name, int namelen);
 int fdt_add_subnode(void *fdt, int parentoffset, const char *name);
 int fdt_del_node(void *fdt, int nodeoffset);
 
-/* Extra functions */
+/**********************************************************************/
+/* Debugging / informational functions                                */
+/**********************************************************************/
+
 const char *fdt_strerror(int errval);
 
 #endif /* _LIBFDT_H */
index 7e97f13476d8c8ec84426a5f7072a7bd5739f579..6f35aa06bf981b0594f9951eaf08b7ec7d1f6dd7 100644 (file)
 #include <net.h>
 
 #ifdef CONFIG_DRIVER_SMC91111
-#include "../drivers/smc91111.h"
+#include "../drivers/net/smc91111.h"
 #endif
 #ifdef CONFIG_DRIVER_LAN91C96
-#include "../drivers/lan91c96.h"
+#include "../drivers/net/lan91c96.h"
 #endif
 
 DECLARE_GLOBAL_DATA_PTR;
index 7c9990f8e0d2b583b1abbadb7bdbeb004645b70c..86a3b67c9899b2cba04c3979435f13e2d30cd5b9 100644 (file)
@@ -35,7 +35,7 @@
 #include <i2c.h>
 #include "blackfin_board.h"
 #include <asm/cplb.h>
-#include "../drivers/smc91111.h"
+#include "../drivers/net/smc91111.h"
 
 #if defined(CONFIG_BF537)&&defined(CONFIG_POST)
 #include <post.h>
index 126fa2c02f7a8f5b7d4df4479bf767f1eac47154..d166cce7968feb9ba45a01dd166176e4771fbb05 100644 (file)
@@ -27,7 +27,7 @@ LIB   = $(obj)libfdt.a
 
 SOBJS  =
 
-COBJS-y += fdt.o fdt_ro.o fdt_rw.o fdt_strerror.o fdt_sw.o fdt_wip.o
+COBJS-$(CONFIG_OF_LIBFDT) += fdt.o fdt_ro.o fdt_rw.o fdt_strerror.o fdt_sw.o fdt_wip.o
 
 COBJS  := $(COBJS-y)
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
index 1ee67ad19cd8ba118bf5d1c85f4c5f2f1ac75b41..586a36136db215fbffb450cfa475403d6755c311 100644 (file)
@@ -2,23 +2,52 @@
  * libfdt - Flat Device Tree manipulation
  * Copyright (C) 2006 David Gibson, IBM Corporation.
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
+ * libfdt is dual licensed: you can use it either under the terms of
+ * the GPL, or the BSD license, at your option.
  *
- * This library 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
- * Lesser General Public License for more details.
+ *  a) This library 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.
  *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *     This library 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 library; if not, write to the Free
+ *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ *     MA 02110-1301 USA
+ *
+ * Alternatively,
+ *
+ *  b) Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *     1. Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *     2. Redistributions in binary form must reproduce the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer in the documentation and/or other materials
+ *        provided with the distribution.
+ *
+ *     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ *     CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ *     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ *     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ *     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ *     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ *     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ *     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ *     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ *     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ *     OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ *     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-#include "config.h"
-#if CONFIG_OF_LIBFDT
-
 #include "libfdt_env.h"
 
 #include <fdt.h>
@@ -45,9 +74,9 @@ int fdt_check_header(const void *fdt)
        return 0;
 }
 
-void *fdt_offset_ptr(const void *fdt, int offset, int len)
+const void *fdt_offset_ptr(const void *fdt, int offset, int len)
 {
-       void *p;
+       const void *p;
 
        if (fdt_version(fdt) >= 0x11)
                if (((offset + len) < offset)
@@ -61,6 +90,45 @@ void *fdt_offset_ptr(const void *fdt, int offset, int len)
        return p;
 }
 
+uint32_t fdt_next_tag(const void *fdt, int offset, int *nextoffset)
+{
+       const uint32_t *tagp, *lenp;
+       uint32_t tag;
+       const char *p;
+
+       if (offset % FDT_TAGSIZE)
+               return -1;
+
+       tagp = fdt_offset_ptr(fdt, offset, FDT_TAGSIZE);
+       if (! tagp)
+               return FDT_END; /* premature end */
+       tag = fdt32_to_cpu(*tagp);
+       offset += FDT_TAGSIZE;
+
+       switch (tag) {
+       case FDT_BEGIN_NODE:
+               /* skip name */
+               do {
+                       p = fdt_offset_ptr(fdt, offset++, 1);
+               } while (p && (*p != '\0'));
+               if (! p)
+                       return FDT_END;
+               break;
+       case FDT_PROP:
+               lenp = fdt_offset_ptr(fdt, offset, sizeof(*lenp));
+               if (! lenp)
+                       return FDT_END;
+               /* skip name offset, length and value */
+               offset += 2*FDT_TAGSIZE + fdt32_to_cpu(*lenp);
+               break;
+       }
+
+       if (nextoffset)
+               *nextoffset = ALIGN(offset, FDT_TAGSIZE);
+
+       return tag;
+}
+
 const char *_fdt_find_string(const char *strtab, int tabsize, const char *s)
 {
        int len = strlen(s) + 1;
@@ -86,5 +154,3 @@ int fdt_move(const void *fdt, void *buf, int bufsize)
        memmove(buf, fdt, fdt_totalsize(fdt));
        return 0;
 }
-
-#endif /* CONFIG_OF_LIBFDT */
index 46d525db1453ad29caad64890039008a373754af..12a37d59f96eba267235cf06962f7ccc7a6c2259 100644 (file)
@@ -2,23 +2,52 @@
  * libfdt - Flat Device Tree manipulation
  * Copyright (C) 2006 David Gibson, IBM Corporation.
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
+ * libfdt is dual licensed: you can use it either under the terms of
+ * the GPL, or the BSD license, at your option.
  *
- * This library 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
- * Lesser General Public License for more details.
+ *  a) This library 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.
  *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *     This library 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 library; if not, write to the Free
+ *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ *     MA 02110-1301 USA
+ *
+ * Alternatively,
+ *
+ *  b) Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *     1. Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *     2. Redistributions in binary form must reproduce the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer in the documentation and/or other materials
+ *        provided with the distribution.
+ *
+ *     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ *     CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ *     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ *     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ *     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ *     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ *     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ *     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ *     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ *     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ *     OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ *     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-#include "config.h"
-#if CONFIG_OF_LIBFDT
-
 #include "libfdt_env.h"
 
 #include <fdt.h>
 
 #include "libfdt_internal.h"
 
-#define CHECK_HEADER(fdt)      { \
-       int err; \
-       if ((err = fdt_check_header(fdt)) != 0) \
-               return err; \
-}
+#define CHECK_HEADER(fdt) \
+       { \
+               int err; \
+               if ((err = fdt_check_header(fdt)) != 0) \
+                       return err; \
+       }
 
-static int offset_streq(const void *fdt, int offset,
-                       const char *s, int len)
+static int nodename_eq(const void *fdt, int offset,
+                      const char *s, int len)
 {
        const char *p = fdt_offset_ptr(fdt, offset, len+1);
 
@@ -44,169 +74,36 @@ static int offset_streq(const void *fdt, int offset,
        if (memcmp(p, s, len) != 0)
                return 0;
 
-       if (p[len] != '\0')
+       if (p[len] == '\0')
+               return 1;
+       else if (!memchr(s, '@', len) && (p[len] == '@'))
+               return 1;
+       else
                return 0;
-
-       return 1;
 }
 
-/*
- * Checks if the property name matches.
- */
-static int prop_name_eq(const void *fdt, int offset, const char *name,
-                       struct fdt_property **prop, int *lenp)
-{
-       int namestroff, len;
-
-       *prop = fdt_offset_ptr_typed(fdt, offset, *prop);
-       if (! *prop)
-               return -FDT_ERR_BADSTRUCTURE;
-
-       namestroff = fdt32_to_cpu((*prop)->nameoff);
-       if (streq(fdt_string(fdt, namestroff), name)) {
-               len = fdt32_to_cpu((*prop)->len);
-               *prop = fdt_offset_ptr(fdt, offset,
-                                      sizeof(**prop) + len);
-               if (*prop) {
-                       if (lenp)
-                               *lenp = len;
-                       return 1;
-               } else
-                       return -FDT_ERR_BADSTRUCTURE;
-       }
-       return 0;
-}
-
-/*
- * Return a pointer to the string at the given string offset.
- */
-char *fdt_string(const void *fdt, int stroffset)
+const char *fdt_string(const void *fdt, int stroffset)
 {
        return (char *)fdt + fdt_off_dt_strings(fdt) + stroffset;
 }
 
-/*
- * Check if the specified node is compatible by comparing the tokens
- * in its "compatible" property with the specified string:
- *
- *   nodeoffset - starting place of the node
- *   compat     - the string to match to one of the tokens in the
- *                "compatible" list.
- */
-int fdt_node_is_compatible(const void *fdt, int nodeoffset,
-                          const char *compat)
+int fdt_get_mem_rsv(const void *fdt, int n, uint64_t *address, uint64_t *size)
 {
-       const char* cp;
-       int cplen, len;
-
-       cp = fdt_getprop(fdt, nodeoffset, "compatible", &cplen);
-       if (cp == NULL)
-               return 0;
-       while (cplen > 0) {
-               if (strncmp(cp, compat, strlen(compat)) == 0)
-                       return 1;
-               len = strlen(cp) + 1;
-               cp += len;
-               cplen -= len;
-       }
-
-       return 0;
-}
-
-/*
- * Find a node by its device type property. On success, the offset of that
- * node is returned or an error code otherwise:
- *
- *   nodeoffset - the node to start searching from or 0, the node you pass
- *                will not be searched, only the next one will; typically,
- *                you pass 0 to start the search and then what the previous
- *                call returned.
- *   type       - the device type string to match against.
- */
-int fdt_find_node_by_type(const void *fdt, int nodeoffset, const char *type)
-{
-       int offset, nextoffset;
-       struct fdt_property *prop;
-       uint32_t tag;
-       int len, ret;
-
        CHECK_HEADER(fdt);
-
-       tag = fdt_next_tag(fdt, nodeoffset, &nextoffset, NULL);
-       if (tag != FDT_BEGIN_NODE)
-               return -FDT_ERR_BADOFFSET;
-       if (nodeoffset)
-               nodeoffset = 0; /* start searching with next node */
-
-       while (1) {
-               offset = nextoffset;
-               tag = fdt_next_tag(fdt, offset, &nextoffset, NULL);
-
-               switch (tag) {
-               case FDT_BEGIN_NODE:
-                       nodeoffset = offset;
-                       break;
-
-               case FDT_PROP:
-                       if (nodeoffset == 0)
-                               break;
-                       ret = prop_name_eq(fdt, offset, "device_type",
-                                          &prop, &len);
-                       if (ret < 0)
-                               return ret;
-                       else if (ret > 0 &&
-                                strncmp(prop->data, type, len - 1) == 0)
-                           return nodeoffset;
-                       break;
-
-               case FDT_END_NODE:
-               case FDT_NOP:
-                       break;
-
-               case FDT_END:
-                       return -FDT_ERR_NOTFOUND;
-
-               default:
-                       return -FDT_ERR_BADSTRUCTURE;
-               }
-       }
+       *address = fdt64_to_cpu(_fdt_mem_rsv(fdt, n)->address);
+       *size = fdt64_to_cpu(_fdt_mem_rsv(fdt, n)->size);
+       return 0;
 }
 
-/*
- * Find a node based on its device type and one of the tokens in its its
- * "compatible" property. On success, the offset of that node is returned
- * or an error code otherwise:
- *
- *   nodeoffset - the node to start searching from or 0, the node you pass
- *                will not be searched, only the next one will; typically,
- *                you pass 0 to start the search and then what the previous
- *                call returned.
- *   type       - the device type string to match against.
- *   compat     - the string to match to one of the tokens in the
- *                "compatible" list.
- */
-int fdt_find_compatible_node(const void *fdt, int nodeoffset,
-                            const char *type, const char *compat)
+int fdt_num_mem_rsv(const void *fdt)
 {
-       int offset;
+       int i = 0;
 
-       offset = fdt_find_node_by_type(fdt, nodeoffset, type);
-       if (offset < 0 || fdt_node_is_compatible(fdt, offset, compat))
-               return offset;
-
-       return -FDT_ERR_NOTFOUND;
+       while (fdt64_to_cpu(_fdt_mem_rsv(fdt, i)->size) != 0)
+               i++;
+       return i;
 }
 
-/*
- * Return the node offset of the node specified by:
- *   parentoffset - starting place (0 to start at the root)
- *   name         - name being searched for
- *   namelen      - length of the name: typically strlen(name)
- *
- * Notes:
- *   If the start node has subnodes, the subnodes are _not_ searched for the
- *     requested name.
- */
 int fdt_subnode_offset_namelen(const void *fdt, int parentoffset,
                               const char *name, int namelen)
 {
@@ -216,13 +113,13 @@ int fdt_subnode_offset_namelen(const void *fdt, int parentoffset,
 
        CHECK_HEADER(fdt);
 
-       tag = fdt_next_tag(fdt, parentoffset, &nextoffset, NULL);
+       tag = fdt_next_tag(fdt, parentoffset, &nextoffset);
        if (tag != FDT_BEGIN_NODE)
                return -FDT_ERR_BADOFFSET;
 
        do {
                offset = nextoffset;
-               tag = fdt_next_tag(fdt, offset, &nextoffset, NULL);
+               tag = fdt_next_tag(fdt, offset, &nextoffset);
 
                switch (tag) {
                case FDT_END:
@@ -230,15 +127,10 @@ int fdt_subnode_offset_namelen(const void *fdt, int parentoffset,
 
                case FDT_BEGIN_NODE:
                        level++;
-                       /*
-                        * If we are nested down levels, ignore the strings
-                        * until we get back to the proper level.
-                        */
                        if (level != 1)
                                continue;
-
-                       /* Return the offset if this is "our" string. */
-                       if (offset_streq(fdt, offset+FDT_TAGSIZE, name, namelen))
+                       if (nodename_eq(fdt, offset+FDT_TAGSIZE, name, namelen))
+                               /* Found it! */
                                return offset;
                        break;
 
@@ -258,20 +150,13 @@ int fdt_subnode_offset_namelen(const void *fdt, int parentoffset,
        return -FDT_ERR_NOTFOUND;
 }
 
-/*
- * See fdt_subnode_offset_namelen()
- */
 int fdt_subnode_offset(const void *fdt, int parentoffset,
                       const char *name)
 {
        return fdt_subnode_offset_namelen(fdt, parentoffset, name, strlen(name));
 }
 
-/*
- * Searches for the node corresponding to the given path and returns the
- * offset of that node.
- */
-int fdt_find_node_by_path(const void *fdt, const char *path)
+int fdt_path_offset(const void *fdt, const char *path)
 {
        const char *end = path + strlen(path);
        const char *p = path;
@@ -279,37 +164,21 @@ int fdt_find_node_by_path(const void *fdt, const char *path)
 
        CHECK_HEADER(fdt);
 
-       /* Paths must be absolute */
        if (*path != '/')
                return -FDT_ERR_BADPATH;
 
-       /* Handle the root path: root offset is 0 */
-       if (strcmp(path, "/") == 0)
-               return 0;
-
        while (*p) {
                const char *q;
 
-               /* Skip path separator(s) */
                while (*p == '/')
                        p++;
                if (! *p)
-                       return -FDT_ERR_BADPATH;
-
-               /*
-                * Find the next path separator.  The characters between
-                * p and q are the next segment of the the path to find.
-                */
+                       return offset;
                q = strchr(p, '/');
                if (! q)
                        q = end;
 
-               /*
-                * Find the offset corresponding to the this path segment.
-                */
                offset = fdt_subnode_offset_namelen(fdt, offset, p, q-p);
-
-               /* Oops, error, abort abort abort */
                if (offset < 0)
                        return offset;
 
@@ -319,17 +188,37 @@ int fdt_find_node_by_path(const void *fdt, const char *path)
        return offset;
 }
 
-/*
- * Given the offset of a node and a name of a property in that node, return
- * a pointer to the property struct.
- */
-struct fdt_property *fdt_get_property(const void *fdt,
-                                     int nodeoffset,
-                                     const char *name, int *lenp)
+const char *fdt_get_name(const void *fdt, int nodeoffset, int *len)
+{
+       const struct fdt_node_header *nh;
+       int err;
+
+       if ((err = fdt_check_header(fdt)) != 0)
+               goto fail;
+
+       err = -FDT_ERR_BADOFFSET;
+       nh = fdt_offset_ptr(fdt, nodeoffset, sizeof(*nh));
+       if (!nh || (fdt32_to_cpu(nh->tag) != FDT_BEGIN_NODE))
+               goto fail;
+
+       if (len)
+               *len = strlen(nh->name);
+
+       return nh->name;
+
+ fail:
+       if (len)
+               *len = err;
+       return NULL;
+}
+
+const struct fdt_property *fdt_get_property(const void *fdt,
+                                           int nodeoffset,
+                                           const char *name, int *lenp)
 {
-       int level = 0;
        uint32_t tag;
-       struct fdt_property *prop;
+       const struct fdt_property *prop;
+       int namestroff;
        int offset, nextoffset;
        int err;
 
@@ -340,63 +229,59 @@ struct fdt_property *fdt_get_property(const void *fdt,
        if (nodeoffset % FDT_TAGSIZE)
                goto fail;
 
-       tag = fdt_next_tag(fdt, nodeoffset, &nextoffset, NULL);
+       tag = fdt_next_tag(fdt, nodeoffset, &nextoffset);
        if (tag != FDT_BEGIN_NODE)
                goto fail;
 
        do {
                offset = nextoffset;
 
-               tag = fdt_next_tag(fdt, offset, &nextoffset, NULL);
+               tag = fdt_next_tag(fdt, offset, &nextoffset);
                switch (tag) {
                case FDT_END:
                        err = -FDT_ERR_TRUNCATED;
                        goto fail;
 
                case FDT_BEGIN_NODE:
-                       level++;
-                       break;
-
                case FDT_END_NODE:
-                       level--;
+               case FDT_NOP:
                        break;
 
                case FDT_PROP:
-                       /*
-                        * If we are nested down levels, ignore the strings
-                        * until we get back to the proper level.
-                        */
-                       if (level != 0)
-                               continue;
-
-                       err = prop_name_eq(fdt, offset, name, &prop, lenp);
-                       if (err > 0)
-                               return prop;
-                       else if (err < 0)
+                       err = -FDT_ERR_BADSTRUCTURE;
+                       prop = fdt_offset_ptr(fdt, offset, sizeof(*prop));
+                       if (! prop)
                                goto fail;
-                       break;
+                       namestroff = fdt32_to_cpu(prop->nameoff);
+                       if (streq(fdt_string(fdt, namestroff), name)) {
+                               /* Found it! */
+                               int len = fdt32_to_cpu(prop->len);
+                               prop = fdt_offset_ptr(fdt, offset,
+                                                     sizeof(*prop)+len);
+                               if (! prop)
+                                       goto fail;
+
+                               if (lenp)
+                                       *lenp = len;
 
-               case FDT_NOP:
+                               return prop;
+                       }
                        break;
 
                default:
                        err = -FDT_ERR_BADSTRUCTURE;
                        goto fail;
                }
-       } while (level >= 0);
+       } while ((tag != FDT_BEGIN_NODE) && (tag != FDT_END_NODE));
 
        err = -FDT_ERR_NOTFOUND;
-fail:
+ fail:
        if (lenp)
                *lenp = err;
        return NULL;
 }
 
-/*
- * Given the offset of a node and a name of a property in that node, return
- * a pointer to the property data (ONLY).
- */
-void *fdt_getprop(const void *fdt, int nodeoffset,
+const void *fdt_getprop(const void *fdt, int nodeoffset,
                  const char *name, int *lenp)
 {
        const struct fdt_property *prop;
@@ -405,132 +290,294 @@ void *fdt_getprop(const void *fdt, int nodeoffset,
        if (! prop)
                return NULL;
 
-       return (void *)prop->data;
+       return prop->data;
 }
 
+uint32_t fdt_get_phandle(const void *fdt, int nodeoffset)
+{
+       const uint32_t *php;
+       int len;
+
+       php = fdt_getprop(fdt, nodeoffset, "linux,phandle", &len);
+       if (!php || (len != sizeof(*php)))
+               return 0;
+
+       return fdt32_to_cpu(*php);
+}
 
-uint32_t fdt_next_tag(const void *fdt, int offset, int *nextoffset, char **namep)
+int fdt_get_path(const void *fdt, int nodeoffset, char *buf, int buflen)
 {
-       const uint32_t *tagp, *lenp;
        uint32_t tag;
-       const char *p;
-
-       if (offset % FDT_TAGSIZE)
-               return -1;
-
-       tagp = fdt_offset_ptr(fdt, offset, FDT_TAGSIZE);
-       if (! tagp)
-               return FDT_END; /* premature end */
-       tag = fdt32_to_cpu(*tagp);
-       offset += FDT_TAGSIZE;
-
-       switch (tag) {
-       case FDT_BEGIN_NODE:
-               if(namep)
-                       *namep = fdt_offset_ptr(fdt, offset, 1);
-
-               /* skip name */
-               do {
-                       p = fdt_offset_ptr(fdt, offset++, 1);
-               } while (p && (*p != '\0'));
-               if (! p)
-                       return FDT_END;
-               break;
-       case FDT_PROP:
-               lenp = fdt_offset_ptr(fdt, offset, sizeof(*lenp));
-               if (! lenp)
-                       return FDT_END;
-               /*
-                * Get the property and set the namep to the name.
-                */
-               if(namep) {
-                       struct fdt_property *prop;
-
-                       prop = fdt_offset_ptr_typed(fdt, offset - FDT_TAGSIZE, prop);
-                       if (! prop)
-                               return -FDT_ERR_BADSTRUCTURE;
-                       *namep = fdt_string(fdt, fdt32_to_cpu(prop->nameoff));
+       int p = 0, overflow = 0;
+       int offset, nextoffset, namelen;
+       const char *name;
+
+       CHECK_HEADER(fdt);
+
+       tag = fdt_next_tag(fdt, 0, &nextoffset);
+       if (tag != FDT_BEGIN_NODE)
+               return -FDT_ERR_BADSTRUCTURE;
+
+       if (buflen < 2)
+               return -FDT_ERR_NOSPACE;
+       buf[0] = '/';
+       p = 1;
+
+       while (nextoffset <= nodeoffset) {
+               offset = nextoffset;
+               tag = fdt_next_tag(fdt, offset, &nextoffset);
+               switch (tag) {
+               case FDT_END:
+                       return -FDT_ERR_BADOFFSET;
+
+               case FDT_BEGIN_NODE:
+                       name = fdt_get_name(fdt, offset, &namelen);
+                       if (!name)
+                               return namelen;
+                       if (overflow || ((p + namelen + 1) > buflen)) {
+                               overflow++;
+                               break;
+                       }
+                       memcpy(buf + p, name, namelen);
+                       p += namelen;
+                       buf[p++] = '/';
+                       break;
+
+               case FDT_END_NODE:
+                       if (overflow) {
+                               overflow--;
+                               break;
+                       }
+                       do {
+                               p--;
+                       } while  (buf[p-1] != '/');
+                       break;
+
+               case FDT_PROP:
+               case FDT_NOP:
+                       break;
+
+               default:
+                       return -FDT_ERR_BADSTRUCTURE;
                }
-               /* skip name offset, length and value */
-               offset += 2*FDT_TAGSIZE + fdt32_to_cpu(*lenp);
-               break;
        }
 
-       if (nextoffset)
-               *nextoffset = ALIGN(offset, FDT_TAGSIZE);
+       if (overflow)
+               return -FDT_ERR_NOSPACE;
 
-       return tag;
+       if (p > 1) /* special case so that root path is "/", not "" */
+               p--;
+       buf[p] = '\0';
+       return p;
 }
 
-/*
- * Return the number of used reserve map entries and total slots available.
- */
-int fdt_num_reservemap(void *fdt, int *used, int *total)
+int fdt_supernode_atdepth_offset(const void *fdt, int nodeoffset,
+                                int supernodedepth, int *nodedepth)
 {
-       struct fdt_reserve_entry *re;
-       int  start;
-       int  end;
-       int  err = fdt_check_header(fdt);
-
-       if (err != 0)
-               return err;
-
-       start = fdt_off_mem_rsvmap(fdt);
-
-       /*
-        * Convention is that the reserve map is before the dt_struct,
-        * but it does not have to be.
-        */
-       end = fdt_totalsize(fdt);
-       if (end > fdt_off_dt_struct(fdt))
-               end = fdt_off_dt_struct(fdt);
-       if (end > fdt_off_dt_strings(fdt))
-               end = fdt_off_dt_strings(fdt);
-
-       /*
-        * Since the reserved area list is zero terminated, you get one fewer.
-        */
-       if (total)
-               *total = ((end - start) / sizeof(struct fdt_reserve_entry)) - 1;
-
-       if (used) {
-               *used = 0;
-               while (start < end) {
-                       re = (struct fdt_reserve_entry *)(fdt + start);
-                       if (re->size == 0)
-                               return 0;       /* zero size terminates the list */
-
-                       *used += 1;
-                       start += sizeof(struct fdt_reserve_entry);
+       int level = -1;
+       uint32_t tag;
+       int offset, nextoffset = 0;
+       int supernodeoffset = -FDT_ERR_INTERNAL;
+
+       CHECK_HEADER(fdt);
+
+       if (supernodedepth < 0)
+               return -FDT_ERR_NOTFOUND;
+
+       do {
+               offset = nextoffset;
+               tag = fdt_next_tag(fdt, offset, &nextoffset);
+               switch (tag) {
+               case FDT_END:
+                       return -FDT_ERR_BADOFFSET;
+
+               case FDT_BEGIN_NODE:
+                       level++;
+                       if (level == supernodedepth)
+                               supernodeoffset = offset;
+                       break;
+
+               case FDT_END_NODE:
+                       level--;
+                       break;
+
+               case FDT_PROP:
+               case FDT_NOP:
+                       break;
+
+               default:
+                       return -FDT_ERR_BADSTRUCTURE;
                }
-               /*
-                * If we get here, there was no zero size termination.
-                */
-               return -FDT_ERR_BADLAYOUT;
+       } while (offset < nodeoffset);
+
+       if (nodedepth)
+               *nodedepth = level;
+
+       if (supernodedepth > level)
+               return -FDT_ERR_NOTFOUND;
+       return supernodeoffset;
+}
+
+int fdt_node_depth(const void *fdt, int nodeoffset)
+{
+       int nodedepth;
+       int err;
+
+       err = fdt_supernode_atdepth_offset(fdt, nodeoffset, 0, &nodedepth);
+       if (err)
+               return (err < 0) ? err : -FDT_ERR_INTERNAL;
+       return nodedepth;
+}
+
+int fdt_parent_offset(const void *fdt, int nodeoffset)
+{
+       int nodedepth = fdt_node_depth(fdt, nodeoffset);
+
+       if (nodedepth < 0)
+               return nodedepth;
+       return fdt_supernode_atdepth_offset(fdt, nodeoffset,
+                                           nodedepth - 1, NULL);
+}
+
+int fdt_node_offset_by_prop_value(const void *fdt, int startoffset,
+                                 const char *propname,
+                                 const void *propval, int proplen)
+{
+       uint32_t tag;
+       int offset, nextoffset;
+       const void *val;
+       int len;
+
+       CHECK_HEADER(fdt);
+
+       if (startoffset >= 0) {
+               tag = fdt_next_tag(fdt, startoffset, &nextoffset);
+               if (tag != FDT_BEGIN_NODE)
+                       return -FDT_ERR_BADOFFSET;
+       } else {
+               nextoffset = 0;
        }
-       return 0;
+
+       /* FIXME: The algorithm here is pretty horrible: we scan each
+        * property of a node in fdt_getprop(), then if that didn't
+        * find what we want, we scan over them again making our way
+        * to the next node.  Still it's the easiest to implement
+        * approach; performance can come later. */
+       do {
+               offset = nextoffset;
+               tag = fdt_next_tag(fdt, offset, &nextoffset);
+
+               switch (tag) {
+               case FDT_BEGIN_NODE:
+                       val = fdt_getprop(fdt, offset, propname, &len);
+                       if (val
+                           && (len == proplen)
+                           && (memcmp(val, propval, len) == 0))
+                               return offset;
+                       break;
+
+               case FDT_PROP:
+               case FDT_END:
+               case FDT_END_NODE:
+               case FDT_NOP:
+                       break;
+
+               default:
+                       return -FDT_ERR_BADSTRUCTURE;
+               }
+       } while (tag != FDT_END);
+
+       return -FDT_ERR_NOTFOUND;
 }
 
-/*
- * Return the nth reserve map entry.
- */
-int fdt_get_reservemap(void *fdt, int n, struct fdt_reserve_entry *re)
+int fdt_node_offset_by_phandle(const void *fdt, uint32_t phandle)
 {
-       int  used;
-       int  total;
-       int  err;
+       if ((phandle == 0) || (phandle == -1))
+               return -FDT_ERR_BADPHANDLE;
+       phandle = cpu_to_fdt32(phandle);
+       return fdt_node_offset_by_prop_value(fdt, -1, "linux,phandle",
+                                            &phandle, sizeof(phandle));
+}
 
-       err = fdt_num_reservemap(fdt, &used, &total);
-       if (err != 0)
-               return err;
+int _stringlist_contains(const void *strlist, int listlen, const char *str)
+{
+       int len = strlen(str);
+       const void *p;
 
-       if (n >= total)
-               return -FDT_ERR_NOSPACE;
-       if (re) {
-               *re = *(struct fdt_reserve_entry *)
-                       _fdt_offset_ptr(fdt, n * sizeof(struct fdt_reserve_entry));
+       while (listlen >= len) {
+               if (memcmp(str, strlist, len+1) == 0)
+                       return 1;
+               p = memchr(strlist, '\0', listlen);
+               if (!p)
+                       return 0; /* malformed strlist.. */
+               listlen -= (p-strlist) + 1;
+               strlist = p + 1;
        }
        return 0;
 }
 
-#endif /* CONFIG_OF_LIBFDT */
+int fdt_node_check_compatible(const void *fdt, int nodeoffset,
+                             const char *compatible)
+{
+       const void *prop;
+       int len;
+
+       prop = fdt_getprop(fdt, nodeoffset, "compatible", &len);
+       if (!prop)
+               return len;
+       if (_stringlist_contains(prop, len, compatible))
+               return 0;
+       else
+               return 1;
+}
+
+int fdt_node_offset_by_compatible(const void *fdt, int startoffset,
+                                 const char *compatible)
+{
+       uint32_t tag;
+       int offset, nextoffset;
+       int err;
+
+       CHECK_HEADER(fdt);
+
+       if (startoffset >= 0) {
+               tag = fdt_next_tag(fdt, startoffset, &nextoffset);
+               if (tag != FDT_BEGIN_NODE)
+                       return -FDT_ERR_BADOFFSET;
+       } else {
+               nextoffset = 0;
+       }
+
+       /* FIXME: The algorithm here is pretty horrible: we scan each
+        * property of a node in fdt_node_check_compatible(), then if
+        * that didn't find what we want, we scan over them again
+        * making our way to the next node.  Still it's the easiest to
+        * implement approach; performance can come later. */
+       do {
+               offset = nextoffset;
+               tag = fdt_next_tag(fdt, offset, &nextoffset);
+
+               switch (tag) {
+               case FDT_BEGIN_NODE:
+                       err = fdt_node_check_compatible(fdt, offset,
+                                                       compatible);
+                       if ((err < 0)
+                           && (err != -FDT_ERR_NOTFOUND))
+                               return err;
+                       else if (err == 0)
+                               return offset;
+                       break;
+
+               case FDT_PROP:
+               case FDT_END:
+               case FDT_END_NODE:
+               case FDT_NOP:
+                       break;
+
+               default:
+                       return -FDT_ERR_BADSTRUCTURE;
+               }
+       } while (tag != FDT_END);
+
+       return -FDT_ERR_NOTFOUND;
+}
index 55fcc41d1a2abd2852878b9d9760d17a57998799..dfe5628a33a011b37dd43c3c849c52b0110f01d5 100644 (file)
@@ -2,23 +2,52 @@
  * libfdt - Flat Device Tree manipulation
  * Copyright (C) 2006 David Gibson, IBM Corporation.
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
+ * libfdt is dual licensed: you can use it either under the terms of
+ * the GPL, or the BSD license, at your option.
  *
- * This library 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
- * Lesser General Public License for more details.
+ *  a) This library 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.
  *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *     This library 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 library; if not, write to the Free
+ *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ *     MA 02110-1301 USA
+ *
+ * Alternatively,
+ *
+ *  b) Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *     1. Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *     2. Redistributions in binary form must reproduce the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer in the documentation and/or other materials
+ *        provided with the distribution.
+ *
+ *     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ *     CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ *     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ *     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ *     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ *     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ *     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ *     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ *     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ *     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ *     OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ *     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-#include "config.h"
-#if CONFIG_OF_LIBFDT
-
 #include "libfdt_env.h"
 
 #include <fdt.h>
 
 #include "libfdt_internal.h"
 
+static int _blocks_misordered(const void *fdt,
+                             int mem_rsv_size, int struct_size)
+{
+       return (fdt_off_mem_rsvmap(fdt) < ALIGN(sizeof(struct fdt_header), 8))
+               || (fdt_off_dt_struct(fdt) <
+                   (fdt_off_mem_rsvmap(fdt) + mem_rsv_size))
+               || (fdt_off_dt_strings(fdt) <
+                   (fdt_off_dt_struct(fdt) + struct_size))
+               || (fdt_totalsize(fdt) <
+                   (fdt_off_dt_strings(fdt) + fdt_size_dt_strings(fdt)));
+}
+
 static int rw_check_header(void *fdt)
 {
        int err;
 
        if ((err = fdt_check_header(fdt)))
                return err;
-       if (fdt_version(fdt) < 0x11)
+       if (fdt_version(fdt) < 17)
                return -FDT_ERR_BADVERSION;
-       if (fdt_off_mem_rsvmap(fdt) < ALIGN(sizeof(struct fdt_header), 8))
-               return -FDT_ERR_BADLAYOUT;
-       if (fdt_off_dt_struct(fdt) <
-           (fdt_off_mem_rsvmap(fdt) + sizeof(struct fdt_reserve_entry)))
-               return -FDT_ERR_BADLAYOUT;
-       if (fdt_off_dt_strings(fdt) <
-           (fdt_off_dt_struct(fdt) + fdt_size_dt_struct(fdt)))
-               return -FDT_ERR_BADLAYOUT;
-       if (fdt_totalsize(fdt) <
-           (fdt_off_dt_strings(fdt) + fdt_size_dt_strings(fdt)))
+       if (_blocks_misordered(fdt, sizeof(struct fdt_reserve_entry),
+                              fdt_size_dt_struct(fdt)))
                return -FDT_ERR_BADLAYOUT;
+       if (fdt_version(fdt) > 17)
+               fdt_set_version(fdt, 17);
+
        return 0;
 }
 
@@ -72,6 +108,19 @@ static int _blob_splice(void *fdt, void *p, int oldlen, int newlen)
        return 0;
 }
 
+static int _blob_splice_mem_rsv(void *fdt, struct fdt_reserve_entry *p,
+                               int oldn, int newn)
+{
+       int delta = (newn - oldn) * sizeof(*p);
+       int err;
+       err = _blob_splice(fdt, p, oldn * sizeof(*p), newn * sizeof(*p));
+       if (err)
+               return err;
+       fdt_set_off_dt_struct(fdt, fdt_off_dt_struct(fdt) + delta);
+       fdt_set_off_dt_strings(fdt, fdt_off_dt_strings(fdt) + delta);
+       return 0;
+}
+
 static int _blob_splice_struct(void *fdt, void *p,
                               int oldlen, int newlen)
 {
@@ -81,8 +130,8 @@ static int _blob_splice_struct(void *fdt, void *p,
        if ((err = _blob_splice(fdt, p, oldlen, newlen)))
                return err;
 
-       fdt_set_header(fdt, size_dt_struct, fdt_size_dt_struct(fdt) + delta);
-       fdt_set_header(fdt, off_dt_strings, fdt_off_dt_strings(fdt) + delta);
+       fdt_set_size_dt_struct(fdt, fdt_size_dt_struct(fdt) + delta);
+       fdt_set_off_dt_strings(fdt, fdt_off_dt_strings(fdt) + delta);
        return 0;
 }
 
@@ -94,7 +143,7 @@ static int _blob_splice_string(void *fdt, int newlen)
        if ((err = _blob_splice(fdt, p, 0, newlen)))
                return err;
 
-       fdt_set_header(fdt, size_dt_strings, fdt_size_dt_strings(fdt) + newlen);
+       fdt_set_size_dt_strings(fdt, fdt_size_dt_strings(fdt) + newlen);
        return 0;
 }
 
@@ -120,13 +169,47 @@ static int _find_add_string(void *fdt, const char *s)
        return (new - strtab);
 }
 
+int fdt_add_mem_rsv(void *fdt, uint64_t address, uint64_t size)
+{
+       struct fdt_reserve_entry *re;
+       int err;
+
+       if ((err = rw_check_header(fdt)))
+               return err;
+
+       re = _fdt_mem_rsv_w(fdt, fdt_num_mem_rsv(fdt));
+       err = _blob_splice_mem_rsv(fdt, re, 0, 1);
+       if (err)
+               return err;
+
+       re->address = cpu_to_fdt64(address);
+       re->size = cpu_to_fdt64(size);
+       return 0;
+}
+
+int fdt_del_mem_rsv(void *fdt, int n)
+{
+       struct fdt_reserve_entry *re = _fdt_mem_rsv_w(fdt, n);
+       int err;
+
+       if ((err = rw_check_header(fdt)))
+               return err;
+       if (n >= fdt_num_mem_rsv(fdt))
+               return -FDT_ERR_NOTFOUND;
+
+       err = _blob_splice_mem_rsv(fdt, re, 1, 0);
+       if (err)
+               return err;
+       return 0;
+}
+
 static int _resize_property(void *fdt, int nodeoffset, const char *name, int len,
                            struct fdt_property **prop)
 {
        int oldlen;
        int err;
 
-       *prop = fdt_get_property(fdt, nodeoffset, name, &oldlen);
+       *prop = fdt_get_property_w(fdt, nodeoffset, name, &oldlen);
        if (! (*prop))
                return oldlen;
 
@@ -148,7 +231,7 @@ static int _add_property(void *fdt, int nodeoffset, const char *name, int len,
        int namestroff;
        int err;
 
-       tag = fdt_next_tag(fdt, nodeoffset, &nextoffset, NULL);
+       tag = fdt_next_tag(fdt, nodeoffset, &nextoffset);
        if (tag != FDT_BEGIN_NODE)
                return -FDT_ERR_BADOFFSET;
 
@@ -156,7 +239,7 @@ static int _add_property(void *fdt, int nodeoffset, const char *name, int len,
        if (namestroff < 0)
                return namestroff;
 
-       *prop = _fdt_offset_ptr(fdt, nextoffset);
+       *prop = _fdt_offset_ptr_w(fdt, nextoffset);
        proplen = sizeof(**prop) + ALIGN(len, FDT_TAGSIZE);
 
        err = _blob_splice_struct(fdt, *prop, 0, proplen);
@@ -188,32 +271,6 @@ int fdt_setprop(void *fdt, int nodeoffset, const char *name,
        return 0;
 }
 
-/**
- * fdt_find_and_setprop: Find a node and set it's property
- *
- * @fdt: ptr to device tree
- * @node: path of node
- * @prop: property name
- * @val: ptr to new value
- * @len: length of new property value
- * @create: flag to create the property if it doesn't exist
- *
- * Convenience function to directly set a property given the path to the node.
- */
-int fdt_find_and_setprop(void *fdt, const char *node, const char *prop,
-                        const void *val, int len, int create)
-{
-       int nodeoff = fdt_find_node_by_path(fdt, node);
-
-       if (nodeoff < 0)
-               return nodeoff;
-
-       if ((!create) && (fdt_get_property(fdt, nodeoff, prop, 0) == NULL))
-               return 0; /* create flag not set; so exit quietly */
-
-       return fdt_setprop(fdt, nodeoff, prop, val, len);
-}
-
 int fdt_delprop(void *fdt, int nodeoffset, const char *name)
 {
        struct fdt_property *prop;
@@ -221,7 +278,7 @@ int fdt_delprop(void *fdt, int nodeoffset, const char *name)
 
        RW_CHECK_HEADER(fdt);
 
-       prop = fdt_get_property(fdt, nodeoffset, name, &len);
+       prop = fdt_get_property_w(fdt, nodeoffset, name, &len);
        if (! prop)
                return len;
 
@@ -248,13 +305,13 @@ int fdt_add_subnode_namelen(void *fdt, int parentoffset,
                return offset;
 
        /* Try to place the new node after the parent's properties */
-       fdt_next_tag(fdt, parentoffset, &nextoffset, NULL); /* skip the BEGIN_NODE */
+       fdt_next_tag(fdt, parentoffset, &nextoffset); /* skip the BEGIN_NODE */
        do {
                offset = nextoffset;
-               tag = fdt_next_tag(fdt, offset, &nextoffset, NULL);
+               tag = fdt_next_tag(fdt, offset, &nextoffset);
        } while (tag == FDT_PROP);
 
-       nh = _fdt_offset_ptr(fdt, offset);
+       nh = _fdt_offset_ptr_w(fdt, offset);
        nodelen = sizeof(*nh) + ALIGN(namelen+1, FDT_TAGSIZE) + FDT_TAGSIZE;
 
        err = _blob_splice_struct(fdt, nh, 0, nodelen);
@@ -279,46 +336,112 @@ int fdt_del_node(void *fdt, int nodeoffset)
 {
        int endoffset;
 
+       RW_CHECK_HEADER(fdt);
+
        endoffset = _fdt_node_end_offset(fdt, nodeoffset);
        if (endoffset < 0)
                return endoffset;
 
-       return _blob_splice_struct(fdt, _fdt_offset_ptr(fdt, nodeoffset),
+       return _blob_splice_struct(fdt, _fdt_offset_ptr_w(fdt, nodeoffset),
                                   endoffset - nodeoffset, 0);
 }
 
-int fdt_open_into(void *fdt, void *buf, int bufsize)
+static void _packblocks(const void *fdt, void *buf,
+                      int mem_rsv_size, int struct_size)
+{
+       int mem_rsv_off, struct_off, strings_off;
+
+       mem_rsv_off = ALIGN(sizeof(struct fdt_header), 8);
+       struct_off = mem_rsv_off + mem_rsv_size;
+       strings_off = struct_off + struct_size;
+
+       memmove(buf + mem_rsv_off, fdt + fdt_off_mem_rsvmap(fdt), mem_rsv_size);
+       fdt_set_off_mem_rsvmap(buf, mem_rsv_off);
+
+       memcpy(buf + struct_off, fdt + fdt_off_dt_struct(fdt), struct_size);
+       fdt_set_off_dt_struct(buf, struct_off);
+       fdt_set_size_dt_struct(buf, struct_size);
+
+       memcpy(buf + strings_off, fdt + fdt_off_dt_strings(fdt),
+              fdt_size_dt_strings(fdt));
+       fdt_set_off_dt_strings(buf, strings_off);
+       fdt_set_size_dt_strings(buf, fdt_size_dt_strings(fdt));
+}
+
+int fdt_open_into(const void *fdt, void *buf, int bufsize)
 {
        int err;
+       int mem_rsv_size, struct_size;
+       int newsize;
+       void *tmp;
 
-       err = fdt_move(fdt, buf, bufsize);
+       err = fdt_check_header(fdt);
        if (err)
                return err;
 
-       fdt = buf;
+       mem_rsv_size = (fdt_num_mem_rsv(fdt)+1)
+               * sizeof(struct fdt_reserve_entry);
 
-       fdt_set_header(fdt, totalsize, bufsize);
+       if (fdt_version(fdt) >= 17) {
+               struct_size = fdt_size_dt_struct(fdt);
+       } else {
+               struct_size = 0;
+               while (fdt_next_tag(fdt, struct_size, &struct_size) != FDT_END)
+                       ;
+       }
 
-       /* FIXME: re-order if necessary */
+       if (!_blocks_misordered(fdt, mem_rsv_size, struct_size)) {
+               /* no further work necessary */
+               err = fdt_move(fdt, buf, bufsize);
+               if (err)
+                       return err;
+               fdt_set_version(buf, 17);
+               fdt_set_size_dt_struct(buf, struct_size);
+               fdt_set_totalsize(buf, bufsize);
+               return 0;
+       }
 
-       err = rw_check_header(fdt);
-       if (err)
-               return err;
+       /* Need to reorder */
+       newsize = ALIGN(sizeof(struct fdt_header), 8) + mem_rsv_size
+               + struct_size + fdt_size_dt_strings(fdt);
+
+       if (bufsize < newsize)
+               return -FDT_ERR_NOSPACE;
+
+       if (((buf + newsize) <= fdt)
+           || (buf >= (fdt + fdt_totalsize(fdt)))) {
+               tmp = buf;
+       } else {
+               tmp = (void *)fdt + fdt_totalsize(fdt);
+               if ((tmp + newsize) > (buf + bufsize))
+                       return -FDT_ERR_NOSPACE;
+       }
+
+       _packblocks(fdt, tmp, mem_rsv_size, struct_size);
+       memmove(buf, tmp, newsize);
+
+       fdt_set_magic(buf, FDT_MAGIC);
+       fdt_set_totalsize(buf, bufsize);
+       fdt_set_version(buf, 17);
+       fdt_set_last_comp_version(buf, 16);
+       fdt_set_boot_cpuid_phys(buf, fdt_boot_cpuid_phys(fdt));
 
        return 0;
 }
 
 int fdt_pack(void *fdt)
 {
+       int mem_rsv_size;
        int err;
 
        err = rw_check_header(fdt);
        if (err)
                return err;
 
-       /* FIXME: pack components */
-       fdt_set_header(fdt, totalsize, _blob_data_size(fdt));
+       mem_rsv_size = (fdt_num_mem_rsv(fdt)+1)
+               * sizeof(struct fdt_reserve_entry);
+       _packblocks(fdt, fdt, mem_rsv_size, fdt_size_dt_struct(fdt));
+       fdt_set_totalsize(fdt, _blob_data_size(fdt));
+
        return 0;
 }
-
-#endif /* CONFIG_OF_LIBFDT */
index b49c952f346023d4e5441f39c7f2b51ed394f995..f9d32ef5360ab7acc84f23df066621b18f01f646 100644 (file)
@@ -2,23 +2,52 @@
  * libfdt - Flat Device Tree manipulation
  * Copyright (C) 2006 David Gibson, IBM Corporation.
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
+ * libfdt is dual licensed: you can use it either under the terms of
+ * the GPL, or the BSD license, at your option.
  *
- * This library 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
- * Lesser General Public License for more details.
+ *  a) This library 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.
  *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *     This library 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 library; if not, write to the Free
+ *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ *     MA 02110-1301 USA
+ *
+ * Alternatively,
+ *
+ *  b) Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *     1. Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *     2. Redistributions in binary form must reproduce the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer in the documentation and/or other materials
+ *        provided with the distribution.
+ *
+ *     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ *     CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ *     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ *     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ *     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ *     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ *     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ *     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ *     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ *     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ *     OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ *     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-#include "config.h"
-#if CONFIG_OF_LIBFDT
-
 #include "libfdt_env.h"
 
 #include <fdt.h>
@@ -65,5 +94,3 @@ const char *fdt_strerror(int errval)
 
        return "<unknown error>";
 }
-
-#endif /* CONFIG_OF_LIBFDT */
index c7eea8ff39e524139df44154645509d9de0693a6..dda2de34b2e0a968463cf808b669b37e226620df 100644 (file)
@@ -2,23 +2,52 @@
  * libfdt - Flat Device Tree manipulation
  * Copyright (C) 2006 David Gibson, IBM Corporation.
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
+ * libfdt is dual licensed: you can use it either under the terms of
+ * the GPL, or the BSD license, at your option.
  *
- * This library 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
- * Lesser General Public License for more details.
+ *  a) This library 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.
  *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *     This library 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 library; if not, write to the Free
+ *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ *     MA 02110-1301 USA
+ *
+ * Alternatively,
+ *
+ *  b) Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *     1. Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *     2. Redistributions in binary form must reproduce the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer in the documentation and/or other materials
+ *        provided with the distribution.
+ *
+ *     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ *     CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ *     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ *     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ *     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ *     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ *     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ *     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ *     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ *     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ *     OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ *     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-#include "config.h"
-#if CONFIG_OF_LIBFDT
-
 #include "libfdt_env.h"
 
 #include <fdt.h>
@@ -44,8 +73,8 @@ static void *grab_space(void *fdt, int len)
        if ((offset + len < offset) || (offset + len > spaceleft))
                return NULL;
 
-       fdt_set_header(fdt, size_dt_struct, offset + len);
-       return fdt_offset_ptr(fdt, offset, len);
+       fdt_set_size_dt_struct(fdt, offset + len);
+       return fdt_offset_ptr_w(fdt, offset, len);
 }
 
 int fdt_create(void *buf, int bufsize)
@@ -57,15 +86,15 @@ int fdt_create(void *buf, int bufsize)
 
        memset(buf, 0, bufsize);
 
-       fdt_set_header(fdt, magic, SW_MAGIC);
-       fdt_set_header(fdt, version, FDT_LAST_SUPPORTED_VERSION);
-       fdt_set_header(fdt, last_comp_version, FDT_FIRST_SUPPORTED_VERSION);
-       fdt_set_header(fdt, totalsize, bufsize);
+       fdt_set_magic(fdt, SW_MAGIC);
+       fdt_set_version(fdt, FDT_LAST_SUPPORTED_VERSION);
+       fdt_set_last_comp_version(fdt, FDT_FIRST_SUPPORTED_VERSION);
+       fdt_set_totalsize(fdt,  bufsize);
 
-       fdt_set_header(fdt, off_mem_rsvmap, ALIGN(sizeof(struct fdt_header),
-                                             sizeof(struct fdt_reserve_entry)));
-       fdt_set_header(fdt, off_dt_struct, fdt_off_mem_rsvmap(fdt));
-       fdt_set_header(fdt, off_dt_strings, bufsize);
+       fdt_set_off_mem_rsvmap(fdt, ALIGN(sizeof(struct fdt_header),
+                                         sizeof(struct fdt_reserve_entry)));
+       fdt_set_off_dt_struct(fdt, fdt_off_mem_rsvmap(fdt));
+       fdt_set_off_dt_strings(fdt, bufsize);
 
        return 0;
 }
@@ -85,11 +114,11 @@ int fdt_add_reservemap_entry(void *fdt, uint64_t addr, uint64_t size)
        if ((offset + sizeof(*re)) > fdt_totalsize(fdt))
                return -FDT_ERR_NOSPACE;
 
-       re = (struct fdt_reserve_entry *)((void *)fdt + offset);
+       re = (struct fdt_reserve_entry *)(fdt + offset);
        re->address = cpu_to_fdt64(addr);
        re->size = cpu_to_fdt64(size);
 
-       fdt_set_header(fdt, off_dt_struct, offset + sizeof(*re));
+       fdt_set_off_dt_struct(fdt, offset + sizeof(*re));
 
        return 0;
 }
@@ -152,7 +181,7 @@ static int find_add_string(void *fdt, const char *s)
                return 0; /* no more room :( */
 
        memcpy(strtab + offset, s, len);
-       fdt_set_header(fdt, size_dt_strings, strtabsize + len);
+       fdt_set_size_dt_strings(fdt, strtabsize + len);
        return offset;
 }
 
@@ -202,14 +231,14 @@ int fdt_finish(void *fdt)
        oldstroffset = fdt_totalsize(fdt) - fdt_size_dt_strings(fdt);
        newstroffset = fdt_off_dt_struct(fdt) + fdt_size_dt_struct(fdt);
        memmove(p + newstroffset, p + oldstroffset, fdt_size_dt_strings(fdt));
-       fdt_set_header(fdt, off_dt_strings, newstroffset);
+       fdt_set_off_dt_strings(fdt, newstroffset);
 
        /* Walk the structure, correcting string offsets */
        offset = 0;
-       while ((tag = fdt_next_tag(fdt, offset, &nextoffset, NULL)) != FDT_END) {
+       while ((tag = fdt_next_tag(fdt, offset, &nextoffset)) != FDT_END) {
                if (tag == FDT_PROP) {
-                       struct fdt_property *prop = fdt_offset_ptr(fdt, offset,
-                                                                  sizeof(*prop));
+                       struct fdt_property *prop =
+                               fdt_offset_ptr_w(fdt, offset, sizeof(*prop));
                        int nameoff;
 
                        if (! prop)
@@ -223,9 +252,7 @@ int fdt_finish(void *fdt)
        }
 
        /* Finally, adjust the header */
-       fdt_set_header(fdt, totalsize, newstroffset + fdt_size_dt_strings(fdt));
-       fdt_set_header(fdt, magic, FDT_MAGIC);
+       fdt_set_totalsize(fdt, newstroffset + fdt_size_dt_strings(fdt));
+       fdt_set_magic(fdt, FDT_MAGIC);
        return 0;
 }
-
-#endif /* CONFIG_OF_LIBFDT */
index 2d39aabe1fe9872c2a9e5e441979426244e063fd..88e24b8318f449e4ab7902fc27b4e7345948299d 100644 (file)
@@ -2,23 +2,52 @@
  * libfdt - Flat Device Tree manipulation
  * Copyright (C) 2006 David Gibson, IBM Corporation.
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
+ * libfdt is dual licensed: you can use it either under the terms of
+ * the GPL, or the BSD license, at your option.
  *
- * This library 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
- * Lesser General Public License for more details.
+ *  a) This library 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.
  *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *     This library 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 library; if not, write to the Free
+ *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ *     MA 02110-1301 USA
+ *
+ * Alternatively,
+ *
+ *  b) Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *     1. Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *     2. Redistributions in binary form must reproduce the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer in the documentation and/or other materials
+ *        provided with the distribution.
+ *
+ *     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ *     CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ *     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ *     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ *     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ *     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ *     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ *     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ *     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ *     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ *     OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ *     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-#include "config.h"
-#if CONFIG_OF_LIBFDT
-
 #include "libfdt_env.h"
 
 #include <fdt.h>
@@ -32,7 +61,7 @@ int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name,
        void *propval;
        int proplen;
 
-       propval = fdt_getprop(fdt, nodeoffset, name, &proplen);
+       propval = fdt_getprop_w(fdt, nodeoffset, name, &proplen);
        if (! propval)
                return proplen;
 
@@ -56,7 +85,7 @@ int fdt_nop_property(void *fdt, int nodeoffset, const char *name)
        struct fdt_property *prop;
        int len;
 
-       prop = fdt_get_property(fdt, nodeoffset, name, &len);
+       prop = fdt_get_property_w(fdt, nodeoffset, name, &len);
        if (! prop)
                return len;
 
@@ -71,12 +100,12 @@ int _fdt_node_end_offset(void *fdt, int nodeoffset)
        uint32_t tag;
        int offset, nextoffset;
 
-       tag = fdt_next_tag(fdt, nodeoffset, &nextoffset, NULL);
+       tag = fdt_next_tag(fdt, nodeoffset, &nextoffset);
        if (tag != FDT_BEGIN_NODE)
                return -FDT_ERR_BADOFFSET;
        do {
                offset = nextoffset;
-               tag = fdt_next_tag(fdt, offset, &nextoffset, NULL);
+               tag = fdt_next_tag(fdt, offset, &nextoffset);
 
                switch (tag) {
                case FDT_END:
@@ -110,33 +139,6 @@ int fdt_nop_node(void *fdt, int nodeoffset)
        if (endoffset < 0)
                return endoffset;
 
-       nop_region(fdt_offset_ptr(fdt, nodeoffset, 0), endoffset - nodeoffset);
+       nop_region(fdt_offset_ptr_w(fdt, nodeoffset, 0), endoffset - nodeoffset);
        return 0;
 }
-
-/*
- * Replace a reserve map entry in the nth slot.
- */
-int fdt_replace_reservemap_entry(void *fdt, int n, uint64_t addr, uint64_t size)
-{
-       struct fdt_reserve_entry *re;
-       int  used;
-       int  total;
-       int  err;
-
-       err = fdt_num_reservemap(fdt, &used, &total);
-       if (err != 0)
-               return err;
-
-       if (n >= total)
-               return -FDT_ERR_NOSPACE;
-       re = (struct fdt_reserve_entry *)
-               (fdt + fdt_off_mem_rsvmap(fdt) +
-                (n * sizeof(struct fdt_reserve_entry)));
-       re->address = cpu_to_fdt64(addr);
-       re->size    = cpu_to_fdt64(size);
-
-       return 0;
-}
-
-#endif /* CONFIG_OF_LIBFDT */
index cc9633c9e149a206f4f94c3daa72642bf0678a7e..1e60936beb5bbff7d609fc55011430fdadc8bd82 100644 (file)
@@ -4,19 +4,51 @@
  * libfdt - Flat Device Tree manipulation
  * Copyright (C) 2006 David Gibson, IBM Corporation.
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * libfdt is dual licensed: you can use it either under the terms of
+ * the GPL, or the BSD license, at your option.
+ *
+ *  a) This library 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 library 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 library; if not, write to the Free
+ *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ *     MA 02110-1301 USA
+ *
+ * Alternatively,
+ *
+ *  b) Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *     1. Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *     2. Redistributions in binary form must reproduce the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer in the documentation and/or other materials
+ *        provided with the distribution.
+ *
+ *     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ *     CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ *     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ *     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ *     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ *     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ *     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ *     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ *     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ *     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ *     OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ *     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #include <fdt.h>
 
 #define memeq(p, q, n) (memcmp((p), (q), (n)) == 0)
 #define streq(p, q)    (strcmp((p), (q)) == 0)
 
-int _fdt_check_header(const void *fdt);
+uint32_t _fdt_next_tag(const void *fdt, int startoffset, int *nextoffset);
 const char *_fdt_find_string(const char *strtab, int tabsize, const char *s);
 int _fdt_node_end_offset(void *fdt, int nodeoffset);
 
-static inline void *_fdt_offset_ptr(const struct fdt_header *fdt, int offset)
+static inline const void *_fdt_offset_ptr(const void *fdt, int offset)
+{
+       return fdt + fdt_off_dt_struct(fdt) + offset;
+}
+
+static inline void *_fdt_offset_ptr_w(void *fdt, int offset)
+{
+       return (void *)_fdt_offset_ptr(fdt, offset);
+}
+
+static inline const struct fdt_reserve_entry *_fdt_mem_rsv(const void *fdt, int n)
+{
+       const struct fdt_reserve_entry *rsv_table =
+               fdt + fdt_off_mem_rsvmap(fdt);
+
+       return rsv_table + n;
+}
+static inline struct fdt_reserve_entry *_fdt_mem_rsv_w(void *fdt, int n)
 {
-       return (void *)fdt + fdt_off_dt_struct(fdt) + offset;
+       return (void *)_fdt_mem_rsv(fdt, n);
 }
 
 #define SW_MAGIC               (~FDT_MAGIC)
index 926476f91b02f2c238a02793e64b3e3784a01d52..2d4d6016ebd6f99483849f56ccc89fcf3c250036 100644 (file)
@@ -96,7 +96,7 @@ $(obj)nand_boot.c:
 # from drivers/nand directory
 $(obj)nand_ecc.c:
        @rm -f $(obj)nand_ecc.c
-       ln -s $(SRCTREE)/drivers/nand/nand_ecc.c $(obj)nand_ecc.c
+       ln -s $(SRCTREE)/drivers/mtd/nand/nand_ecc.c $(obj)nand_ecc.c
 
 #########################################################################
 
index 8b5461dcf4cea9bb696fddf48702d4bb491a3005..3a633fb8871c6b00c3840a8bf4cabc71fbdc4132 100644 (file)
@@ -82,7 +82,7 @@ $(obj)nand_boot.c:
 # from drivers/nand directory
 $(obj)nand_ecc.c:
        @rm -f $(obj)nand_ecc.c
-       ln -s $(SRCTREE)/drivers/nand/nand_ecc.c $(obj)nand_ecc.c
+       ln -s $(SRCTREE)/drivers/mtd/nand/nand_ecc.c $(obj)nand_ecc.c
 
 ifneq ($(OBJTREE), $(SRCTREE))
 $(obj)sdram.c:
index ec1be5a768a5a228570aa5488353bba56a23b32a..78bf071f591df479ca9f6a7ce4622edd8f125430 100644 (file)
@@ -88,7 +88,7 @@ $(obj)nand_boot.c:
 # from drivers/nand directory
 $(obj)nand_ecc.c:
        @rm -f $(obj)nand_ecc.c
-       ln -s $(SRCTREE)/drivers/nand/nand_ecc.c $(obj)nand_ecc.c
+       ln -s $(SRCTREE)/drivers/mtd/nand/nand_ecc.c $(obj)nand_ecc.c
 
 #########################################################################
 
diff --git a/tools/scripts/define2mk.sed b/tools/scripts/define2mk.sed
new file mode 100644 (file)
index 0000000..6464627
--- /dev/null
@@ -0,0 +1,29 @@
+#
+# Sed script to parse CPP macros and generate output usable by make
+#
+# It is expected that this script is fed the output of 'gpp -dM'
+# which preprocesses the common.h header files and outputs the final
+# list of CPP macros (and whitespace is sanitized)
+#
+
+# Only process values prefixed with #define CONFIG_
+/^#define CONFIG_[A-Za-z0-9_]\+/ {
+       # Strip the #define prefix
+       s/#define *//;
+       # Change to form CONFIG_*=VALUE
+       s/ \+/=/;
+       # Drop trailing spaces
+       s/ *$//;
+       # drop quotes around string values
+       s/="\(.*\)"$/=\1/;
+       # Concatenate string values
+       s/" *"//g;
+       # Wrap non-numeral values with quotes
+       s/=\(.*\?[^0-9].*\)$/=\"\1\"/;
+       # Change '1' and empty values to "y" (not perfect, but
+       # supports conditional compilation in the makefiles
+       s/=$/=y/;
+       s/=1$/=y/;
+       # print the line
+       p
+}