diff options
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/u-boot/u-boot-1.2.0/dm355-leopard.diff | 48455 | ||||
| -rw-r--r-- | packages/u-boot/u-boot_1.2.0.bb | 2 |
2 files changed, 48457 insertions, 0 deletions
diff --git a/packages/u-boot/u-boot-1.2.0/dm355-leopard.diff b/packages/u-boot/u-boot-1.2.0/dm355-leopard.diff new file mode 100644 index 0000000000..b614522f42 --- /dev/null +++ b/packages/u-boot/u-boot-1.2.0/dm355-leopard.diff @@ -0,0 +1,48455 @@ + Makefile | 36 + board/davinci/Makefile | 47 + board/davinci/config.mk | 27 + board/davinci/davinci.c | 417 + + board/davinci/dm644x_emac.c | 491 + + board/davinci/dm644x_emac.h | 290 + board/davinci/flash.c | 686 + + board/davinci/flash_params.h | 319 + board/davinci/lowlevel_init.S | 764 ++ + board/davinci/nand.c | 111 + board/davinci/soc.h | 339 + board/davinci/timer.c | 73 + board/davinci/timer.h | 51 + board/davinci/types.h | 46 + board/davinci/u-boot.lds | 52 + board/dm355_evm/Makefile | 47 + board/dm355_evm/config.mk | 25 + board/dm355_evm/dm355_evm.c | 598 + + board/dm355_evm/flash.c | 758 ++ + board/dm355_evm/flash_params.h | 319 + board/dm355_evm/lowlevel_init.S | 766 ++ + board/dm355_evm/nand.c | 805 ++ + board/dm355_evm/timer.c | 72 + board/dm355_evm/timer.h | 51 + board/dm355_evm/types.h | 46 + board/dm355_evm/u-boot.lds | 52 + board/dm355_ipnc/Makefile | 47 + board/dm355_ipnc/config.mk | 25 + board/dm355_ipnc/dm355_ipnc.c | 671 + + board/dm355_ipnc/flash.c | 758 ++ + board/dm355_ipnc/flash_params.h | 319 + board/dm355_ipnc/lowlevel_init.S | 766 ++ + board/dm355_ipnc/nand.c | 830 ++ + board/dm355_ipnc/timer.c | 72 + board/dm355_ipnc/timer.h | 51 + board/dm355_ipnc/types.h | 46 + board/dm355_ipnc/u-boot.lds | 52 + board/dm355_leopard/Makefile | 47 + board/dm355_leopard/config.mk | 25 + board/dm355_leopard/dm355_leopard.c | 671 + + board/dm355_leopard/flash.c | 758 ++ + board/dm355_leopard/flash_params.h | 319 + board/dm355_leopard/lowlevel_init.S | 766 ++ + board/dm355_leopard/nand.c | 830 ++ + board/dm355_leopard/timer.c | 72 + board/dm355_leopard/timer.h | 51 + board/dm355_leopard/types.h | 46 + board/dm355_leopard/u-boot.lds | 52 + board/dm700/Makefile | 47 + board/dm700/config.mk | 26 + board/dm700/davinci_hd.c | 203 + board/dm700/dm646x_emac.c | 506 + + board/dm700/dm646x_emac.h | 321 + board/dm700/flash.c | 686 + + board/dm700/flash_params.h | 319 + board/dm700/lowlevel_init.S | 725 ++ + board/dm700/nand.c | 111 + board/dm700/soc.h | 349 + + board/dm700/timer.c | 73 + board/dm700/timer.h | 51 + board/dm700/types.h | 46 + board/dm700/u-boot.lds | 52 + common/cmd_nand.c | 11 + common/env_nand.c | 14 + cpu/arm926ejs/config.mk | 4 + cpu/arm926ejs/interrupts.c | 148 + cpu/arm926ejs/interrupts.c.orig | 191 + doc/README.SBC8560 | 57 + doc/README.sbc8560 | 53 + drivers/Makefile | 4 + drivers/davinci_i2c.c | 296 + drivers/davinci_i2c.h | 87 + drivers/dm9000.c | 370 + + drivers/dm9000.h | 181 + drivers/dm9000x.c | 124 + drivers/nand/nand_base.c | 1404 ++-- + drivers/nand/nand_bbt.c | 17 + drivers/nand/nand_ids.c | 44 + drivers/nand/nand_util.c | 3 + examples/hello_world.bin |binary + examples/hello_world.srec | 36 + include/asm-arm/arch-arm926ejs/emif_defs.h | 59 + include/asm-arm/arch-arm926ejs/nand_defs.h | 92 + include/asm-arm/arch-arm926ejs/types.h | 31 + include/asm-arm/arch/emif_defs.h | 59 + include/asm-arm/arch/nand_defs.h | 92 + include/asm-arm/arch/sizes.h | 51 + include/asm-arm/arch/types.h | 31 + include/asm-arm/proc/domain.h | 50 + include/asm-arm/proc/processor.h | 74 + include/asm-arm/proc/ptrace.h | 109 + include/asm-arm/proc/system.h | 199 + include/asm/arch-arm1136/bits.h | 48 + include/asm/arch-arm1136/clocks.h | 112 + include/asm/arch-arm1136/i2c.h | 107 + include/asm/arch-arm1136/mem.h | 156 + include/asm/arch-arm1136/mux.h | 158 + include/asm/arch-arm1136/omap2420.h | 221 + include/asm/arch-arm1136/sizes.h | 49 + include/asm/arch-arm1136/sys_info.h | 82 + include/asm/arch-arm1136/sys_proto.h | 54 + include/asm/arch-arm720t/hardware.h | 43 + include/asm/arch-arm720t/netarm_dma_module.h | 182 + include/asm/arch-arm720t/netarm_eni_module.h | 121 + include/asm/arch-arm720t/netarm_eth_module.h | 160 + include/asm/arch-arm720t/netarm_gen_module.h | 186 + include/asm/arch-arm720t/netarm_mem_module.h | 184 + include/asm/arch-arm720t/netarm_registers.h | 96 + include/asm/arch-arm720t/netarm_ser_module.h | 347 + include/asm/arch-arm720t/s3c4510b.h | 272 + include/asm/arch-arm925t/sizes.h | 50 + include/asm/arch-arm926ejs/emif_defs.h | 59 + include/asm/arch-arm926ejs/nand_defs.h | 92 + include/asm/arch-arm926ejs/sizes.h | 51 + include/asm/arch-arm926ejs/types.h | 31 + include/asm/arch-at91rm9200/AT91RM9200.h | 762 ++ + include/asm/arch-at91rm9200/hardware.h | 77 + include/asm/arch-imx/imx-regs.h | 577 + + include/asm/arch-ixp/ixp425.h | 543 + + include/asm/arch-ixp/ixp425pci.h | 312 + include/asm/arch-ks8695/platform.h | 306 + include/asm/arch-omap/sizes.h | 52 + include/asm/arch-pxa/bitfield.h | 112 + include/asm/arch-pxa/hardware.h | 158 + include/asm/arch-pxa/mmc.h | 200 + include/asm/arch-pxa/pxa-regs.h | 2399 ++++++ + include/asm/arch-s3c24x0/memory.h | 162 + include/asm/arch-s3c44b0/hardware.h | 281 + include/asm/arch-sa1100/bitfield.h | 112 + include/asm/arch/emif_defs.h | 59 + include/asm/arch/nand_defs.h | 92 + include/asm/arch/sizes.h | 51 + include/asm/arch/types.h | 31 + include/asm/atomic.h | 113 + include/asm/bitops.h | 144 + include/asm/byteorder.h | 32 + include/asm/errno.h | 138 + include/asm/global_data.h | 66 + include/asm/hardware.h | 18 + include/asm/io.h | 307 + include/asm/mach-types.h | 9415 +++++++++++++++++++++++++++ + include/asm/memory.h | 137 + include/asm/posix_types.h | 79 + include/asm/proc-armv/domain.h | 50 + include/asm/proc-armv/processor.h | 74 + include/asm/proc-armv/ptrace.h | 109 + include/asm/proc-armv/system.h | 199 + include/asm/proc/domain.h | 50 + include/asm/proc/processor.h | 74 + include/asm/proc/ptrace.h | 109 + include/asm/proc/system.h | 199 + include/asm/processor.h | 134 + include/asm/ptrace.h | 33 + include/asm/setup.h | 269 + include/asm/sizes.h | 52 + include/asm/string.h | 47 + include/asm/types.h | 50 + include/asm/u-boot-arm.h | 62 + include/asm/u-boot.h | 60 + include/config.h | 2 + include/config.mk | 3 + include/configs/SBC8560.h | 410 - + include/configs/davinci.h | 222 + include/configs/dm355_evm.h | 227 + include/configs/dm355_ipnc.h | 234 + include/configs/dm355_leopard.h | 234 + include/configs/dm700.h | 204 + include/configs/omap2420h4.h | 2 + include/configs/sbc8560.h | 408 + + include/flash.h | 2 + include/linux/mtd/nand.h | 190 + include/linux/mtd/nand_ids.h | 1 + include/version_autogenerated.h | 1 + lib_arm/board.c | 8 + tools/crc32.c | 198 + tools/environment.c | 214 + 176 files changed, 44713 insertions(+), 982 deletions(-) +diff -Nurd u-boot-1.2.0/Makefile u-boot-1.2.0-leopard/Makefile +--- u-boot-1.2.0/Makefile 2007-01-06 20:13:11.000000000 -0300 ++++ u-boot-1.2.0-leopard/Makefile 2009-03-10 02:16:35.000000000 -0300 +@@ -125,7 +125,7 @@ + CROSS_COMPILE = powerpc-linux- + endif + ifeq ($(ARCH),arm) +-CROSS_COMPILE = arm-linux- ++CROSS_COMPILE = arm_v5t_le- + endif + ifeq ($(ARCH),i386) + ifeq ($(HOSTARCH),i386) +@@ -233,10 +233,12 @@ + __OBJS := $(subst $(obj),,$(OBJS)) + __LIBS := $(subst $(obj),,$(LIBS)) + ++U-BOOT = u-boot-1.2.0-$(BOARD).bin ++ + ######################################################################### + ######################################################################### + +-ALL = $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map $(U_BOOT_NAND) ++ALL = $(obj)u-boot.srec $(obj)$(U-BOOT) $(obj)System.map $(U_BOOT_NAND) + + all: $(ALL) + +@@ -249,7 +251,10 @@ + $(obj)u-boot.bin: $(obj)u-boot + $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@ + +-$(obj)u-boot.img: $(obj)u-boot.bin ++$(obj)$(U-BOOT): $(obj)u-boot ++ $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@ ++ ++$(obj)u-boot.img: $(obj)$(U-BOOT) + ./tools/mkimage -A $(ARCH) -T firmware -C none \ + -a $(TEXT_BASE) -e 0 \ + -n $(shell sed -n -e 's/.*U_BOOT_VERSION//p' $(VERSION_FILE) | \ +@@ -277,8 +282,8 @@ + $(NAND_SPL): version + $(MAKE) -C nand_spl/board/$(BOARDDIR) all + +-$(U_BOOT_NAND): $(NAND_SPL) $(obj)u-boot.bin +- cat $(obj)nand_spl/u-boot-spl-16k.bin $(obj)u-boot.bin > $(obj)u-boot-nand.bin ++$(U_BOOT_NAND): $(NAND_SPL) $(obj)$(U-BOOT) ++ cat $(obj)nand_spl/u-boot-spl-16k.bin $(obj)$(U-BOOT) > $(obj)u-boot-nand.bin + + version: + @echo -n "#define U_BOOT_VERSION \"U-Boot " > $(VERSION_FILE); \ +@@ -320,7 +325,7 @@ + + ######################################################################### + else +-all $(obj)u-boot.hex $(obj)u-boot.srec $(obj)u-boot.bin \ ++all $(obj)u-boot.hex $(obj)u-boot.srec $(obj)$(U-BOOT) \ + $(obj)u-boot.img $(obj)u-boot.dis $(obj)u-boot \ + $(SUBDIRS) version gdbtools updater env depend \ + dep tags ctags etags $(obj)System.map: +@@ -336,7 +341,7 @@ + ######################################################################### + + unconfig: +- @rm -f $(obj)include/config.h $(obj)include/config.mk \ ++ @rm -rf $(obj)include/config.h $(obj)include/config.mk \ + $(obj)board/*/config.tmp $(obj)board/*/*/config.tmp + + #======================================================================== +@@ -1858,6 +1863,21 @@ + mx1fs2_config : unconfig + @$(MKCONFIG) $(@:_config=) arm arm920t mx1fs2 NULL imx + ++davinci_config : unconfig ++ @$(MKCONFIG) $(@:_config=) arm arm926ejs davinci ++ ++dm700_config : unconfig ++ @$(MKCONFIG) $(@:_config=) arm arm926ejs dm700 ++ ++dm355_evm_config : unconfig ++ @$(MKCONFIG) $(@:_config=) arm arm926ejs dm355_evm ++ ++dm355_ipnc_config : unconfig ++ @$(MKCONFIG) $(@:_config=) arm arm926ejs dm355_ipnc ++ ++dm355_leopard_config: unconfig ++ @$(MKCONFIG) $(@:_config=) arm arm926ejs dm355_leopard ++ + netstar_32_config \ + netstar_config: unconfig + @mkdir -p $(obj)include +@@ -2333,7 +2353,7 @@ + rm -f $(obj)u-boot $(obj)u-boot.map $(obj)u-boot.hex $(ALL) + rm -f $(obj)tools/crc32.c $(obj)tools/environment.c $(obj)tools/env/crc32.c + rm -f $(obj)tools/inca-swap-bytes $(obj)cpu/mpc824x/bedbug_603e.c +- rm -f $(obj)include/asm/proc $(obj)include/asm/arch $(obj)include/asm ++ rm -rf $(obj)include/asm/proc $(obj)include/asm/arch $(obj)include/asm + [ ! -d $(OBJTREE)/nand_spl ] || find $(obj)nand_spl -lname "*" -print | xargs rm -f + + ifeq ($(OBJTREE),$(SRCTREE)) +diff -Nurd u-boot-1.2.0/board/davinci/Makefile u-boot-1.2.0-leopard/board/davinci/Makefile +--- u-boot-1.2.0/board/davinci/Makefile 1969-12-31 21:00:00.000000000 -0300 ++++ u-boot-1.2.0-leopard/board/davinci/Makefile 2007-12-04 07:50:28.000000000 -0300 +@@ -0,0 +1,47 @@ ++# ++# (C) Copyright 2000, 2001, 2002 ++# 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 = lib$(BOARD).a ++ ++OBJS := davinci.o flash.o timer.o dm644x_emac.o nand.o ++SOBJS := lowlevel_init.o ++ ++$(LIB): $(OBJS) $(SOBJS) ++ $(AR) crv $@ $^ ++ ++clean: ++ rm -f $(SOBJS) $(OBJS) ++ ++distclean: clean ++ rm -f $(LIB) core *.bak .depend ++ ++######################################################################### ++ ++.depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c) ++ $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@ ++ ++-include .depend ++ ++######################################################################### +diff -Nurd u-boot-1.2.0/board/davinci/config.mk u-boot-1.2.0-leopard/board/davinci/config.mk +--- u-boot-1.2.0/board/davinci/config.mk 1969-12-31 21:00:00.000000000 -0300 ++++ u-boot-1.2.0-leopard/board/davinci/config.mk 2007-12-04 07:50:28.000000000 -0300 +@@ -0,0 +1,27 @@ ++# ++# (C) Copyright 2002 ++# Gary Jennejohn, DENX Software Engineering, <gj@denx.de> ++# David Mueller, ELSOFT AG, <d.mueller@elsoft.ch> ++# ++# (C) Copyright 2003 ++# Texas Instruments, <www.ti.com> ++# Swaminathan <swami.iyer@ti.com> ++# ++# Davinci EVM board (ARM925EJS) cpu ++# see http://www.ti.com/ for more information on Texas Instruments ++# ++# Davinci EVM has 1 bank of 256 MB DDR RAM ++# Physical Address: ++# 8000'0000 to 9000'0000 ++# ++# ++# Linux-Kernel is expected to be at 8000'8000, entry 8000'8000 ++# (mem base + reserved) ++# ++# we load ourself to 8100 '0000 ++# ++# ++ ++#Provide a atleast 16MB spacing between us and the Linux Kernel image ++TEXT_BASE = 0x81080000 ++BOARDLIBS = drivers/nand/libnand.a +diff -Nurd u-boot-1.2.0/board/davinci/davinci.c u-boot-1.2.0-leopard/board/davinci/davinci.c +--- u-boot-1.2.0/board/davinci/davinci.c 1969-12-31 21:00:00.000000000 -0300 ++++ u-boot-1.2.0-leopard/board/davinci/davinci.c 2007-12-04 07:50:28.000000000 -0300 +@@ -0,0 +1,417 @@ ++/* ++ * ++ * Copyright (C) 2004 Texas Instruments. ++ * ++ * ---------------------------------------------------------------------------- ++ * ++ * 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., 675 Mass Ave, Cambridge, MA 02139, USA. ++ * ---------------------------------------------------------------------------- ++ Modifications: ++ ver. 1.0: Oct 2005, Swaminathan S ++ * ++ */ ++ ++#include <common.h> ++#include <i2c.h> ++ ++#if 0 ++void flash__init (void); ++void ether__init (void); ++#endif ++#define PLL1_PLLM *(volatile unsigned int *)0x01c40910 ++#define PLL2_PLLM *(volatile unsigned int *)0x01c40D10 ++#define PLL2_DIV2 *(volatile unsigned char *)0x01c40D1C ++ ++void davinci_psc_all_enable(void); ++ ++/******************************************* ++ Routine: delay ++ Description: Delay function ++*******************************************/ ++static inline void delay (unsigned long loops) ++{ ++ __asm__ volatile ("1:\n" ++ "subs %0, %1, #1\n" ++ "bne 1b":"=r" (loops):"0" (loops)); ++} ++ ++/******************************************* ++ Routine: board_init ++ Description: Board Initialization routine ++*******************************************/ ++int board_init (void) ++{ ++ DECLARE_GLOBAL_DATA_PTR; ++ ++ /* arch number of DaVinci DVDP-Board */ ++ gd->bd->bi_arch_number = 901; ++ ++ /* adress of boot parameters */ ++ gd->bd->bi_boot_params = LINUX_BOOT_PARAM_ADDR; ++ /* Configure MUX settings */ ++ ++ /* Power on required peripherals */ ++ davinci_psc_all_enable(); ++#if 0 ++ /* this speeds up your boot a quite a bit. However to make it ++ * work, you need make sure your kernel startup flush bug is fixed. ++ * ... rkw ... ++ */ ++ icache_enable (); ++#endif ++ inittimer (); ++ ++ return 0; ++} ++ ++/* PSC Domains */ ++#define LPSC_VPSSMSTR 0 // VPSS Master LPSC ++#define LPSC_VPSSSLV 1 // VPSS Slave LPSC ++#define LPSC_TPCC 2 // TPCC LPSC ++#define LPSC_TPTC0 3 // TPTC0 LPSC ++#define LPSC_TPTC1 4 // TPTC1 LPSC ++#define LPSC_EMAC 5 // EMAC LPSC ++#define LPSC_EMAC_WRAPPER 6 // EMAC WRAPPER LPSC ++#define LPSC_MDIO 7 // MDIO LPSC ++#define LPSC_IEEE1394 8 // IEEE1394 LPSC ++#define LPSC_USB 9 // USB LPSC ++#define LPSC_ATA 10 // ATA LPSC ++#define LPSC_VLYNQ 11 // VLYNQ LPSC ++#define LPSC_UHPI 12 // UHPI LPSC ++#define LPSC_DDR_EMIF 13 // DDR_EMIF LPSC ++#define LPSC_AEMIF 14 // AEMIF LPSC ++#define LPSC_MMC_SD 15 // MMC_SD LPSC ++#define LPSC_MEMSTICK 16 // MEMSTICK LPSC ++#define LPSC_McBSP 17 // McBSP LPSC ++#define LPSC_I2C 18 // I2C LPSC ++#define LPSC_UART0 19 // UART0 LPSC ++#define LPSC_UART1 20 // UART1 LPSC ++#define LPSC_UART2 21 // UART2 LPSC ++#define LPSC_SPI 22 // SPI LPSC ++#define LPSC_PWM0 23 // PWM0 LPSC ++#define LPSC_PWM1 24 // PWM1 LPSC ++#define LPSC_PWM2 25 // PWM2 LPSC ++#define LPSC_GPIO 26 // GPIO LPSC ++#define LPSC_TIMER0 27 // TIMER0 LPSC ++#define LPSC_TIMER1 28 // TIMER1 LPSC ++#define LPSC_TIMER2 29 // TIMER2 LPSC ++#define LPSC_SYSTEM_SUBSYS 30 // SYSTEM SUBSYSTEM LPSC ++#define LPSC_ARM 31 // ARM LPSC ++#define LPSC_SCR2 32 // SCR2 LPSC ++#define LPSC_SCR3 33 // SCR3 LPSC ++#define LPSC_SCR4 34 // SCR4 LPSC ++#define LPSC_CROSSBAR 35 // CROSSBAR LPSC ++#define LPSC_CFG27 36 // CFG27 LPSC ++#define LPSC_CFG3 37 // CFG3 LPSC ++#define LPSC_CFG5 38 // CFG5 LPSC ++#define LPSC_GEM 39 // GEM LPSC ++#define LPSC_IMCOP 40 // IMCOP LPSC ++ ++#define CHP_SHRTSW *( volatile unsigned int* )( 0x01C40038 ) ++#define GBLCTL *( volatile unsigned int* )( 0x01C41010 ) ++#define EPCPR *( volatile unsigned int* )( 0x01C41070 ) ++#define EPCCR *( volatile unsigned int* )( 0x01C41078 ) ++#define PTCMD *( volatile unsigned int* )( 0x01C41120 ) ++#define PTSTAT *( volatile unsigned int* )( 0x01C41128 ) ++#define PDSTAT *( volatile unsigned int* )( 0x01C41200 ) ++#define PDSTAT1 *( volatile unsigned int* )( 0x01C41204 ) ++#define PDCTL *( volatile unsigned int* )( 0x01C41300 ) ++#define PDCTL1 *( volatile unsigned int* )( 0x01C41304 ) ++#define VBPR *( volatile unsigned int* )( 0x20000020 ) ++ ++/************************************** ++ Routine: board_setup_psc_on ++ Description: Enable a PSC domain ++**************************************/ ++void board_setup_psc_on( unsigned int domain, unsigned int id ) ++{ ++ volatile unsigned int* mdstat = ( unsigned int* )( 0x01C41800 + 4 * id ); ++ volatile unsigned int* mdctl = ( unsigned int* )( 0x01C41A00 + 4 * id ); ++ ++ *mdctl |= 0x00000003; // Set PowerDomain to turn on ++ ++ if ( ( PDSTAT & 0x00000001 ) == 0 ) ++ { ++ PDCTL1 |= 0x1; ++ PTCMD = ( 1 << domain ); ++ while ( ( ( ( EPCPR >> domain ) & 1 ) == 0 ) ); ++ ++ PDCTL1 |= 0x100 ; ++ while( ! ( ( ( PTSTAT >> domain ) & 1 ) == 0 ) ); ++ } ++ else ++ { ++ PTCMD = ( 1<<domain ); ++ while( ! ( ( ( PTSTAT >> domain ) & 1 ) == 0 ) ); ++ } ++ ++ while( ! ( ( *mdstat & 0x0000001F ) == 0x3 ) ); ++} ++ ++/************************************** ++ Routine: davinci_psc_all_enable ++ Description: Enable all PSC domains ++**************************************/ ++void davinci_psc_all_enable(void) ++{ ++#define PSC_ADDR 0x01C41000 ++#define PTCMD (PSC_ADDR+0x120) ++#define PTSTAT (PSC_ADDR+0x128) ++ ++ unsigned int alwaysOnPdNum = 0, dspPdNum = 1, i; ++ int waiting; ++ unsigned int state; ++ ++ /* This function turns on all clocks in the ALWAYSON and DSP Power ++ * Domains. Note this function assumes that the Power Domains are ++ * already on. ++ */ ++#if 0 ++ /* Write ENABLE (0x3) to all 41 MDCTL[i].NEXT bit fields. */ ++ for( i = 0; i < 41; i++){ ++ *(volatile unsigned int*) (PSC_ADDR+0xA00+4*i) = ++ *(volatile unsigned int*) (PSC_ADDR+0xA00+4*i) | 0x3; ++ } ++ ++ /* For special workaround: Set MDCTL[i].EMURSTIE to 0x1 for all of the ++ * following Modules. VPSSSLV, EMAC, EMACCTRL, MDIO, USB, ATA, VLYNQ, ++ * HPI, DDREMIF, AEMIF, MMCSD, MEMSTICK, ASP, GPIO, IMCOP. ++ */ ++ /**(unsigned int*) (PSC_ADDR+0xA00+4*1) = *(unsigned int*) (PSC_ADDR+0xA00+4*1) | 0x203;*/ ++ *(unsigned int*) (PSC_ADDR+0xA00+4*5) = *(unsigned int*) (PSC_ADDR+0xA00+4*5) | 0x203; ++ *(unsigned int*) (PSC_ADDR+0xA00+4*6) = *(unsigned int*) (PSC_ADDR+0xA00+4*6) | 0x203; ++ *(unsigned int*) (PSC_ADDR+0xA00+4*7) = *(unsigned int*) (PSC_ADDR+0xA00+4*7) | 0x203; ++ /**(unsigned int*) (PSC_ADDR+0xA00+4*9) = *(unsigned int*) (PSC_ADDR+0xA00+4*9) | 0x203; ++ *(unsigned int*) (PSC_ADDR+0xA00+4*10) = *(unsigned int*) (PSC_ADDR+0xA00+4*10) | 0x203; ++ *(unsigned int*) (PSC_ADDR+0xA00+4*11) = *(unsigned int*) (PSC_ADDR+0xA00+4*11) | 0x203; ++ *(unsigned int*) (PSC_ADDR+0xA00+4*12) = *(unsigned int*) (PSC_ADDR+0xA00+4*12) | 0x203;*/ ++ *(unsigned int*) (PSC_ADDR+0xA00+4*13) = *(unsigned int*) (PSC_ADDR+0xA00+4*13) | 0x203; ++ *(unsigned int*) (PSC_ADDR+0xA00+4*14) = *(unsigned int*) (PSC_ADDR+0xA00+4*14) | 0x203; ++ /**(unsigned int*) (PSC_ADDR+0xA00+4*15) = *(unsigned int*) (PSC_ADDR+0xA00+4*15) | 0x203; ++ *(unsigned int*) (PSC_ADDR+0xA00+4*16) = *(unsigned int*) (PSC_ADDR+0xA00+4*16) | 0x203; ++ *(unsigned int*) (PSC_ADDR+0xA00+4*17) = *(unsigned int*) (PSC_ADDR+0xA00+4*17) | 0x203;*/ ++ *(unsigned int*) (PSC_ADDR+0xA00+4*19) = *(unsigned int*) (PSC_ADDR+0xA00+4*19) | 0x203; ++ /**(unsigned int*) (PSC_ADDR+0xA00+4*26) = *(unsigned int*) (PSC_ADDR+0xA00+4*26) | 0x203; ++ *(unsigned int*) (PSC_ADDR+0xA00+4*40) = *(unsigned int*) (PSC_ADDR+0xA00+4*40) | 0x203;*/ ++#endif ++ ++ /* For special workaround: Clear MDCTL[i].EMURSTIE to 0x0 for all of the following Modules. ++ * VPSSSLV, EMAC, EMACCTRL, MDIO, USB, ATA, VLYNQ, ++ * HPI, DDREMIF, AEMIF, MMCSD, MEMSTICK, ASP, GPIO, IMCOP. ++ */ ++ /**(unsigned int*) (PSC_ADDR+0xA00+4*1) = *(unsigned int*) (PSC_ADDR+0xA00+4*1) & 0x003;*/ ++ *(volatile unsigned int*) (PSC_ADDR+0xA00+4*5) = *(unsigned int*) (PSC_ADDR+0xA00+4*5) | 0x003; ++ *(volatile unsigned int*) (PSC_ADDR+0xA00+4*6) = *(unsigned int*) (PSC_ADDR+0xA00+4*6) | 0x003; ++ *(volatile unsigned int*) (PSC_ADDR+0xA00+4*7) = *(unsigned int*) (PSC_ADDR+0xA00+4*7) | 0x003; ++ /**(unsigned int*) (PSC_ADDR+0xA00+4*9) = *(unsigned int*) (PSC_ADDR+0xA00+4*9) & 0x003; ++ *(unsigned int*) (PSC_ADDR+0xA00+4*10) = *(unsigned int*) (PSC_ADDR+0xA00+4*10) & 0x003; ++ *(unsigned int*) (PSC_ADDR+0xA00+4*11) = *(unsigned int*) (PSC_ADDR+0xA00+4*11) & 0x003; ++ *(unsigned int*) (PSC_ADDR+0xA00+4*12) = *(unsigned int*) (PSC_ADDR+0xA00+4*12) & 0x003;*/ ++ *(volatile unsigned int*) (PSC_ADDR+0xA00+4*13) = *(unsigned int*) (PSC_ADDR+0xA00+4*13) | 0x003; ++ *(volatile unsigned int*) (PSC_ADDR+0xA00+4*14) = *(unsigned int*) (PSC_ADDR+0xA00+4*14) | 0x003; ++ /**(unsigned int*) (PSC_ADDR+0xA00+4*15) = *(unsigned int*) (PSC_ADDR+0xA00+4*15) & 0x003; ++ *(unsigned int*) (PSC_ADDR+0xA00+4*16) = *(unsigned int*) (PSC_ADDR+0xA00+4*16) & 0x003; ++ *(unsigned int*) (PSC_ADDR+0xA00+4*17) = *(unsigned int*) (PSC_ADDR+0xA00+4*17) & 0x003;*/ ++ *(volatile unsigned int*) (PSC_ADDR+0xA00+4*19) = *(unsigned int*) (PSC_ADDR+0xA00+4*19) | 0x003; ++ *(volatile unsigned int*) (PSC_ADDR+0xA00+4*18) = *(unsigned int*) (PSC_ADDR+0xA00+4*18) | 0x003; ++ *(volatile unsigned int*) (PSC_ADDR+0xA00+4*28) = *(unsigned int*) (PSC_ADDR+0xA00+4*28) | 0x003; ++ /**(unsigned int*) (PSC_ADDR+0xA00+4*26) = *(unsigned int*) (PSC_ADDR+0xA00+4*26) & 0x003; ++ *(unsigned int*) (PSC_ADDR+0xA00+4*40) = *(unsigned int*) (PSC_ADDR+0xA00+4*40) & 0x003;*/ ++ ++ /* Set PTCMD.GO0 to 0x1 to initiate the state transtion for Modules in ++ * the ALWAYSON Power Domain ++ */ ++ *(volatile unsigned int*) PTCMD = (1<<alwaysOnPdNum); ++ ++ /* Wait for PTSTAT.GOSTAT0 to clear to 0x0 */ ++ while(! (((*(volatile unsigned int*) PTSTAT >> alwaysOnPdNum) & 0x00000001) == 0)); ++ ++ /* DO GEM AND IMCOP INITIALIZATION, ONLY IF DSP POWER DOMAIN IS OFF... */ ++ /* NOTE: this is a precise and refined sequence - use extreme care if modifying! */ ++ if ((PDSTAT1 & 0x1F) == 0) { ++ ++ /* set PSC FORCE mode; may not be necessary, added per reference code */ ++ GBLCTL = GBLCTL | 0x01; ++ ++ /* set DSP power domain next state to ON */ ++ PDCTL1 = PDCTL1 | 0x01; ++ ++ /* ensure external power indicator is cleared */ ++ PDCTL1 = PDCTL1 & 0xFFFFFEFF; ++ ++ /* enable DSP module */ ++ *(volatile unsigned int*) (PSC_ADDR+0xA00+4*LPSC_GEM) = ++ (*(volatile unsigned int*) (PSC_ADDR+0xA00+4*LPSC_GEM) & 0xFFFFFFE0) | 0x3; ++ ++ /* hold DSP in reset on next power ON */ ++ *(volatile unsigned int*) (PSC_ADDR+0xA00+4*LPSC_GEM) = ++ *(volatile unsigned int*) (PSC_ADDR+0xA00+4*LPSC_GEM) & 0xFFFFFEFF; ++ ++ /* set IMCOP to enable state */ ++ *(volatile unsigned int*) (PSC_ADDR+0xA00+4*LPSC_IMCOP) = ++ (*(volatile unsigned int*) (PSC_ADDR+0xA00+4*LPSC_IMCOP) & 0xFFFFFFE0) | 0x3; ++ ++ /* hold IMCOP in reset on next power ON */ ++ *(volatile unsigned int*) (PSC_ADDR+0xA00+4*LPSC_IMCOP) = ++ *(volatile unsigned int*) (PSC_ADDR+0xA00+4*LPSC_IMCOP) & 0xFFFFFEFF; ++ ++ /* start power state transitions for DSP power domain */ ++ *(volatile unsigned int*) PTCMD = (1<<dspPdNum); ++ ++ /* wait for external power control pending to assert */ ++ for (i = 0, waiting = 1; (i < 100) && waiting; i++) { ++ if (((EPCPR >> dspPdNum) & 0x00000001) == 1) { ++ waiting = 0; ++ } ++ } ++ ++ /* close rail shorting switch */ ++ CHP_SHRTSW = 0x1; ++ ++ /* set external power good indicator */ ++ PDCTL1 = PDCTL1 | 0x0100; ++ ++ /* clear external power control pending register bit */ ++ EPCCR = (1 << dspPdNum); ++ ++ /* wait for DSP domain transitions to complete */ ++ for (i = 0, waiting = 1; (i < 100) && waiting; i++) { ++ state = *(volatile unsigned int*) PTSTAT; ++ if (((state >> dspPdNum) & 0x00000001) == 0) { ++ waiting = 0; ++ } ++ } ++ ++ /* turn off PSC FORCE mode */ ++ GBLCTL = GBLCTL & 0xFFFFFFFE; ++ ++ } /* END GEM AND IMCOP INITIALIZATION */ ++ ++ /* Bringup UART out of reset here since NS16650 code that we are using from uBoot ++ * will not do it ++ */ ++#define UARTPWREMU_MGMT 0x01c20030 ++ *(volatile unsigned int*) UARTPWREMU_MGMT = 0x0000E003; ++ ++ /* Enable GIO3.3V cells used for EMAC */ ++#define VDD3P3V_PWDN 0x01c40048 ++ *(volatile unsigned int*) VDD3P3V_PWDN = 0; ++ ++#define PINMUX0 0x01C40000 ++#define PINMUX4 0x01C40004 ++ ++ /* Enable UART0 MUX lines */ ++ *(volatile unsigned int *)PINMUX4 |= 1; ++ /* Enable EMAC and AEMIF pins */ ++#if (CONFIG_COMMANDS & CFG_CMD_NAND) ++ *(volatile unsigned int*) PINMUX0 = 0x80000000; ++#else ++ *(volatile unsigned int*) PINMUX0 = 0x80000C1F; ++#endif ++ ++ /* Enable I2C pin Mux */ ++ *(volatile unsigned int *)PINMUX4 |= (1 << 7); ++ ++ /* Set the Bus Priority Register to appropriate value */ ++ VBPR = 0x20; ++} ++ ++/****************************** ++ Routine: misc_init_r ++ Description: Misc. init ++******************************/ ++int misc_init_r (void) ++{ ++ char temp[20]; ++ char rtcdata[10] = { 2, 1, 0, 0, 0, 0, 0, 0, 0, 0}; ++ char emac_read_addr [10] = { 0x7f, 0 }, i= 0; ++ int clk = 0; ++ ++ clk = ((PLL2_PLLM + 1) * 27) / (PLL2_DIV2 + 1); ++ ++ printf ("ARM Clock :- %dMHz\n", ((((PLL1_PLLM + 1) * 27 ) / 2)) ); ++ printf ("DDR Clock :- %dMHz\n", (clk/2)); ++ ++ i2c_write (0x50, 0x00, 1, emac_read_addr, 2); ++ i2c_read (0x50, 0x00, 1, emac_read_addr, 6); ++ temp[0] = (emac_read_addr[0] & 0xF0) >> 4; ++ temp[1] = (emac_read_addr[0] & 0x0F); ++ temp[2] = ':'; ++ temp[3] = (emac_read_addr[1] & 0xF0) >> 4; ++ temp[4] = (emac_read_addr[1] & 0x0F); ++ temp[5] = ':'; ++ temp[6] = (emac_read_addr[2] & 0xF0) >> 4; ++ temp[7] = (emac_read_addr[2] & 0x0F); ++ temp[8] = ':'; ++ temp[9] = (emac_read_addr[3] & 0xF0) >> 4; ++ temp[10]= (emac_read_addr[3] & 0x0F); ++ temp[11]= ':'; ++ temp[12]= (emac_read_addr[4] & 0xF0) >> 4; ++ temp[13]= (emac_read_addr[4] & 0x0F); ++ temp[14]= ':'; ++ temp[15]= (emac_read_addr[5] & 0xF0) >> 4; ++ temp[16]= (emac_read_addr[5] & 0x0F); ++ ++ for (i = 0; i < 17; i++) ++ { ++ if (temp[i] == ':') ++ continue; ++ else if (temp[i] >= 0 && temp[i] <= 9) ++ temp[i] = temp[i] + 48; ++ else ++ temp[i] = temp[i] + 87; ++ } ++ ++ temp [17] = 0; ++ if ((emac_read_addr [0] != 0xFF) || ++ (emac_read_addr [1] != 0xFF) || ++ (emac_read_addr [2] != 0xFF) || ++ (emac_read_addr [3] != 0xFF) || ++ (emac_read_addr [4] != 0xFF) || ++ (emac_read_addr [5] != 0xFF)) ++ { ++ setenv ("ethaddr", temp); ++ } ++ ++ i2c_read (0x39, 0x00, 1, &i, 1); ++ ++ if ( !getenv("videostd") ) ++ setenv ("videostd", ((i & 0x80)?"pal":"ntsc")); ++ ++ i2c_write (0x23, 0x00, 1, rtcdata, 2); ++ i2c_read (0x23, 0x00, 1, rtcdata, 1); ++ ++ if (rtcdata[0] == 10) ++ printf ("MSP430 Firmware supports AM/PM Feature\n"); ++ else ++ printf ("MSP430 Firmware does not support AM/PM Feature\n"); ++ ++ return (0); ++} ++ ++/****************************** ++ Routine: dram_init ++ Description: Memory Info ++******************************/ ++int dram_init (void) ++{ ++ DECLARE_GLOBAL_DATA_PTR; ++ ++ gd->bd->bi_dram[0].start = PHYS_SDRAM_1; ++ gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE; ++ ++ return 0; ++} ++ +diff -Nurd u-boot-1.2.0/board/davinci/dm644x_emac.c u-boot-1.2.0-leopard/board/davinci/dm644x_emac.c +--- u-boot-1.2.0/board/davinci/dm644x_emac.c 1969-12-31 21:00:00.000000000 -0300 ++++ u-boot-1.2.0-leopard/board/davinci/dm644x_emac.c 2007-12-04 07:50:28.000000000 -0300 +@@ -0,0 +1,491 @@ ++/* ++ * dm644x_emac.c ++ * ++ * TI DaVinci (DM644X) EMAC peripheral driver source for DV-EVM ++ * ++ * Copyright (C) 2005 Texas Instruments. ++ * ++ * ---------------------------------------------------------------------------- ++ * ++ * 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., 675 Mass Ave, Cambridge, MA 02139, USA. ++ * ---------------------------------------------------------------------------- ++ ++ * Modifications: ++ * ver. 1.0: Sep 2005, Anant Gole - Created EMAC version for uBoot. ++ * ver 1.1: Nov 2005, Anant Gole - Extended the RX logic for multiple descriptors ++ * ++ */ ++ ++#include <common.h> ++#include <command.h> ++#include <net.h> ++#include "dm644x_emac.h" ++ ++#ifdef CONFIG_DRIVER_TI_EMAC ++ ++#if (CONFIG_COMMANDS & CFG_CMD_NET) ++ ++unsigned int emac_dbg = 0; ++#define debug_emac(fmt,args...) if (emac_dbg) printf (fmt ,##args) ++ ++/* EMAC internal functions - called when eth_xxx functions are invoked by the kernel */ ++static int emac_hw_init (void); ++static int emac_open (void); ++static int emac_close (void); ++static int emac_send_packet (volatile void *packet, int length); ++static int emac_rcv_packet (void); ++ ++/* The driver can be entered at any of the following entry points */ ++extern int eth_init (bd_t * bd); ++extern void eth_halt (void); ++extern int eth_rx (void); ++extern int eth_send (volatile void *packet, int length); ++ ++int eth_hw_init (void) ++{ ++ return emac_hw_init(); ++} ++ ++int eth_init (bd_t * bd) ++{ ++ return emac_open (); ++} ++ ++void eth_halt () ++{ ++ emac_close (); ++} ++ ++int eth_send (volatile void *packet, int length) ++{ ++ return emac_send_packet (packet, length); ++} ++ ++int eth_rx () ++{ ++ return emac_rcv_packet (); ++} ++ ++ ++static char emac_mac_addr[] = { 0x00, 0x00, 0x5b, 0xee, 0xde, 0xad }; ++ ++/* ++ * This function must be called before emac_open() if you want to override ++ * the default mac address. ++ */ ++ ++void emac_set_mac_addr (const char *addr) ++{ ++ int i; ++ ++ for (i = 0; i < sizeof (emac_mac_addr); i++) { ++ emac_mac_addr[i] = addr[i]; ++ } ++} ++ ++/*************************** ++ * EMAC Global variables ++ ***************************/ ++ ++/* EMAC Addresses */ ++static volatile emac_regs* adap_emac = (emac_regs *) EMAC_BASE_ADDR; ++static volatile ewrap_regs* adap_ewrap = (ewrap_regs *) EMAC_WRAPPER_BASE_ADDR; ++static volatile mdio_regs* adap_mdio = (mdio_regs *) EMAC_MDIO_BASE_ADDR; ++ ++/* EMAC descriptors */ ++static volatile emac_desc *emac_rx_desc = (emac_desc *) (EMAC_WRAPPER_RAM_ADDR + EMAC_RX_DESC_BASE); ++static volatile emac_desc *emac_tx_desc = (emac_desc *) (EMAC_WRAPPER_RAM_ADDR + EMAC_TX_DESC_BASE); ++static volatile emac_desc *emac_rx_active_head = 0; ++static volatile emac_desc *emac_rx_active_tail = 0; ++static int emac_rx_queue_active = 0; ++ ++/* EMAC link status */ ++static int emac_link_status = 0; /* 0 = link down, 1 = link up */ ++ ++/* Receive packet buffers */ ++static unsigned char emac_rx_buffers[EMAC_MAX_RX_BUFFERS * (EMAC_MAX_ETHERNET_PKT_SIZE + EMAC_PKT_ALIGN)]; ++ ++/* This function initializes the emac hardware */ ++static int emac_hw_init (void) ++{ ++ /* Enabling power and reset from outside the module is required */ ++ return (0); ++} ++ ++/* Read a PHY register via MDIO inteface */ ++static int mdio_read(int phy_addr, int reg_num) ++{ ++ adap_mdio->USERACCESS0 = MDIO_USERACCESS0_GO | MDIO_ |
