]> git.sur5r.net Git - u-boot/commitdiff
New board SMN42 branch
authorPeter Pearse <peter.pearse@arm.com>
Wed, 9 May 2007 10:37:56 +0000 (11:37 +0100)
committerPeter Pearse <peter.pearse@arm.com>
Wed, 9 May 2007 10:37:56 +0000 (11:37 +0100)
MAKEALL
Makefile
board/lpc2292sodimm/Makefile
board/lpc2292sodimm/flash.c
common/soft_i2c.c
disk/part.c
drivers/Makefile
fs/fat/fat.c
include/asm-arm/arch-arm720t/hardware.h
include/configs/lpc2292sodimm.h

diff --git a/MAKEALL b/MAKEALL
index d7cd8d74203b14cc629f2dff179a51face7bb0ff..17ea97ea22b15bb30513a5c8479eb256bafddd56 100755 (executable)
--- a/MAKEALL
+++ b/MAKEALL
@@ -185,7 +185,7 @@ LIST_SA="assabet dnp1110 gcplus lart shannon"
 LIST_ARM7="    \
        armadillo       B2              ep7312          evb4510         \
        impa7           integratorap    ap7             ap720t          \
-       lpc2292sodimm   modnet50                                        \
+       lpc2292sodimm   modnet50        SMN42                           \
 "
 
 #########################################################################
index ceee2c7bed3ad5ee4f7a33e23dd51a164a5e0d22..3e547fdb3064cb0ce340e0d623f6a9d5843ec4a3 100755 (executable)
--- a/Makefile
+++ b/Makefile
@@ -2100,7 +2100,10 @@ evb4510_config : unconfig
        @$(MKCONFIG) $(@:_config=) arm arm720t evb4510
 
 lpc2292sodimm_config:  unconfig
-       @$(MKCONFIG) $(@:_config=) arm arm720t lpc2292sodimm
+       @$(MKCONFIG) $(@:_config=) arm arm720t lpc2292sodimm NULL lpc2292
+
+SMN42_config   :       unconfig
+       @$(MKCONFIG) $(@:_config=) arm arm720t SMN42 siemens lpc2292
 
 #########################################################################
 ## XScale Systems
index 5a30198e21a8fc65fabdb64d379dd8e704f12203..18a95d7f9b8983ae8ebb08f977153f3f86be0279 100644 (file)
@@ -1,7 +1,6 @@
 #
-# (C) Copyright 2002
-# Sysgo Real-Time Solutions, GmbH <www.elinos.com>
-# Marius Groeger <mgroeger@sysgo.de>
+# (C) Copyright 2007
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 # project.
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := lpc2292sodimm.o flash.o mmc.o spi.o mmc_hw.o eth.o
-SOBJS  := lowlevel_init.o iap_entry.o
+COBJS  := flash.o lpc2292sodimm.o
+SOBJTS := lowlevel_init.o
 
-$(LIB):        $(OBJS) $(SOBJS)
-       $(AR) crv $@ $(OBJS) $(SOBJS)
+SRCS   := $(SOBJTS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJTS))
 
-# this MUST be compiled as thumb code!
-iap_entry.o:
-       arm-linux-gcc  -D__ASSEMBLY__ -g  -Os   -fno-strict-aliasing  \
-       -fno-common -ffixed-r8 -msoft-float  -D__KERNEL__ \
-       -DTEXT_BASE=0x81500000  -I/home/garyj/proj/LPC/u-boot/include \
-       -fno-builtin -ffreestanding -nostdinc -isystem \
-       /opt/eldk/arm/usr/bin/../lib/gcc/arm-linux/4.0.0/include -pipe  \
-       -DCONFIG_ARM -D__ARM__ -march=armv4t -mtune=arm7tdmi -mabi=apcs-gnu \
-       -c -o iap_entry.o iap_entry.S
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
+       $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
        rm -f $(SOBJS) $(OBJS)
 
 distclean:     clean
-       rm -f $(LIB) core *.bak .depend
+       rm -f $(LIB) core *.bak $(obj).depend
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 55aaabfe6f6e2bbe59bdc51036aeac246ea93e63..0fb08430c53edecfc43ad9742b4be1fbdb9eaa3f 100644 (file)
@@ -1,6 +1,9 @@
 /*
  * (C) Copyright 2006 Embedded Artists AB <www.embeddedartists.com>
  *
+ * Modified to use the routines in cpu/arm720t/lpc2292/flash.c by
+ * Gary Jennejohn <garyj@denx,de>
+ *
  * 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
 #include <common.h>
 #include <asm/arch/hardware.h>
 
-/* IAP commands use 32 bytes at the top of CPU internal sram, we
-   use 512 bytes below that */
-#define COPY_BUFFER_LOCATION 0x40003de0
-
-#define IAP_LOCATION 0x7ffffff1
-#define IAP_CMD_PREPARE 50
-#define IAP_CMD_COPY 51
-#define IAP_CMD_ERASE 52
-#define IAP_CMD_CHECK 53
-#define IAP_CMD_ID 54
-#define IAP_CMD_VERSION 55
-#define IAP_CMD_COMPARE 56
-
-#define IAP_RET_CMD_SUCCESS 0
-
 #define SST_BASEADDR 0x80000000
 #define SST_ADDR1 ((volatile ushort*)(SST_BASEADDR + (0x5555 << 1)))
 #define SST_ADDR2 ((volatile ushort*)(SST_BASEADDR + (0x2AAA << 1)))
 
 
-static unsigned long command[5];
-static unsigned long result[2];
-
 flash_info_t flash_info[CFG_MAX_FLASH_BANKS];
 
-extern void iap_entry(unsigned long * command, unsigned long * result);
-
-/*-----------------------------------------------------------------------
- *
- */
-int get_flash_sector(flash_info_t * info, ulong flash_addr)
-{
-       int i;
-
-       for(i=1; i < (info->sector_count); i++) {
-               if (flash_addr < (info->start[i]))
-                       break;
-       }
-
-       return (i-1);
-}
-
-/*-----------------------------------------------------------------------
- * This function assumes that flash_addr is aligned on 512 bytes boundary
- * in flash. This function also assumes that prepare have been called
- * for the sector in question.
- */
-int copy_buffer_to_flash(flash_info_t * info, ulong flash_addr)
-{
-       int first_sector;
-       int last_sector;
-
-       first_sector = get_flash_sector(info, flash_addr);
-       last_sector = get_flash_sector(info, flash_addr + 512 - 1);
-
-       /* prepare sectors for write */
-       command[0] = IAP_CMD_PREPARE;
-       command[1] = first_sector;
-       command[2] = last_sector;
-       iap_entry(command, result);
-       if (result[0] != IAP_RET_CMD_SUCCESS) {
-               printf("IAP prepare failed\n");
-               return ERR_PROG_ERROR;
-       }
-
-       command[0] = IAP_CMD_COPY;
-       command[1] = flash_addr;
-       command[2] = COPY_BUFFER_LOCATION;
-       command[3] = 512;
-       command[4] = CFG_SYS_CLK_FREQ >> 10;
-       iap_entry(command, result);
-       if (result[0] != IAP_RET_CMD_SUCCESS) {
-               printf("IAP copy failed\n");
-               return 1;
-       }
-
-       return 0;
-}
+extern int lpc2292_copy_buffer_to_flash(flash_info_t *, ulong);
+extern int lpc2292_flash_erase(flash_info_t *, int, int);
+extern int lpc2292_write_buff (flash_info_t *, uchar *, ulong, ulong);
 
 /*-----------------------------------------------------------------------
  *
@@ -220,56 +155,6 @@ void flash_print_info (flash_info_t * info)
        printf ("\n");
 }
 
-/*-----------------------------------------------------------------------
- */
-
-int flash_erase_philips (flash_info_t * info, int s_first, int s_last)
-{
-       int flag;
-       int prot;
-       int sect;
-
-       prot = 0;
-       for (sect = s_first; sect <= s_last; ++sect) {
-               if (info->protect[sect]) {
-                       prot++;
-               }
-       }
-       if (prot)
-               return ERR_PROTECTED;
-
-
-       flag = disable_interrupts();
-
-       printf ("Erasing %d sectors starting at sector %2d.\n"
-       "This make take some time ... ",
-       s_last - s_first + 1, s_first);
-
-       command[0] = IAP_CMD_PREPARE;
-       command[1] = s_first;
-       command[2] = s_last;
-       iap_entry(command, result);
-       if (result[0] != IAP_RET_CMD_SUCCESS) {
-               printf("IAP prepare failed\n");
-               return ERR_PROTECTED;
-       }
-
-       command[0] = IAP_CMD_ERASE;
-       command[1] = s_first;
-       command[2] = s_last;
-       command[3] = CFG_SYS_CLK_FREQ >> 10;
-       iap_entry(command, result);
-       if (result[0] != IAP_RET_CMD_SUCCESS) {
-               printf("IAP erase failed\n");
-               return ERR_PROTECTED;
-       }
-
-       if (flag)
-               enable_interrupts();
-
-       return ERR_OK;
-}
-
 int flash_erase_sst (flash_info_t * info, int s_first, int s_last)
 {
        int i;
@@ -294,7 +179,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
                case (SST_MANUFACT & FLASH_VENDMASK):
                        return flash_erase_sst(info, s_first, s_last);
                case (PHILIPS_LPC2292 & FLASH_VENDMASK):
-                       return flash_erase_philips(info, s_first, s_last);
+                       return lpc2292_flash_erase(info, s_first, s_last);
                default:
                        return ERR_PROTECTED;
        }
@@ -353,122 +238,13 @@ int write_buff_sst (flash_info_t * info, uchar * src, ulong addr, ulong cnt)
        return ret;
 }
 
-int write_buff_philips (flash_info_t * info,
-                       uchar * src,
-                       ulong addr,
-                       ulong cnt)
-{
-       int first_copy_size;
-       int last_copy_size;
-       int first_block;
-       int last_block;
-       int nbr_mid_blocks;
-       uchar memmap_value;
-       ulong i;
-       uchar* src_org;
-       uchar* dst_org;
-       int ret = ERR_OK;
-
-       src_org = src;
-       dst_org = (uchar*)addr;
-
-       first_block = addr / 512;
-       last_block = (addr + cnt) / 512;
-       nbr_mid_blocks = last_block - first_block - 1;
-
-       first_copy_size = 512 - (addr % 512);
-       last_copy_size = (addr + cnt) % 512;
-
-#if 0
-       printf("\ncopy first block: (1) %lX -> %lX 0x200 bytes, "
-               "(2) %lX -> %lX 0x%X bytes, (3) %lX -> %lX 0x200 bytes\n",
-       (ulong)(first_block * 512),
-       (ulong)COPY_BUFFER_LOCATION,
-       (ulong)src,
-       (ulong)(COPY_BUFFER_LOCATION + 512 - first_copy_size),
-       first_copy_size,
-       (ulong)COPY_BUFFER_LOCATION,
-       (ulong)(first_block * 512));
-#endif
-
-       /* copy first block */
-       memcpy((void*)COPY_BUFFER_LOCATION,
-               (void*)(first_block * 512), 512);
-       memcpy((void*)(COPY_BUFFER_LOCATION + 512 - first_copy_size),
-               src, first_copy_size);
-       copy_buffer_to_flash(info, first_block * 512);
-       src += first_copy_size;
-       addr += first_copy_size;
-
-       /* copy middle blocks */
-       for (i = 0; i < nbr_mid_blocks; i++) {
-#if 0
-               printf("copy middle block: %lX -> %lX 512 bytes, "
-               "%lX -> %lX 512 bytes\n",
-               (ulong)src,
-               (ulong)COPY_BUFFER_LOCATION,
-               (ulong)COPY_BUFFER_LOCATION,
-               (ulong)addr);
-#endif
-               memcpy((void*)COPY_BUFFER_LOCATION, src, 512);
-               copy_buffer_to_flash(info, addr);
-               src += 512;
-               addr += 512;
-       }
-
-
-       if (last_copy_size > 0) {
-#if 0
-               printf("copy last block: (1) %lX -> %lX 0x200 bytes, "
-               "(2) %lX -> %lX 0x%X bytes, (3) %lX -> %lX x200 bytes\n",
-               (ulong)(last_block * 512),
-               (ulong)COPY_BUFFER_LOCATION,
-               (ulong)src,
-               (ulong)(COPY_BUFFER_LOCATION),
-               last_copy_size,
-               (ulong)COPY_BUFFER_LOCATION,
-               (ulong)addr);
-#endif
-               /* copy last block */
-               memcpy((void*)COPY_BUFFER_LOCATION,
-                       (void*)(last_block * 512), 512);
-               memcpy((void*)COPY_BUFFER_LOCATION,
-                       src, last_copy_size);
-               copy_buffer_to_flash(info, addr);
-       }
-
-       /* verify write */
-       memmap_value = GET8(MEMMAP);
-
-       disable_interrupts();
-
-       PUT8(MEMMAP, 01);               /* we must make sure that initial 64
-                                                          bytes are taken from flash when we
-                                                          do the compare */
-
-       for (i = 0; i < cnt; i++) {
-               if (*dst_org != *src_org){
-                       printf("Write failed. Byte %lX differs\n", i);
-                       ret = ERR_PROG_ERROR;
-                       break;
-               }
-               dst_org++;
-               src_org++;
-       }
-
-       PUT8(MEMMAP, memmap_value);
-       enable_interrupts();
-
-       return ret;
-}
-
 int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt)
 {
        switch (info->flash_id & FLASH_VENDMASK) {
                case (SST_MANUFACT & FLASH_VENDMASK):
                        return write_buff_sst(info, src, addr, cnt);
                case (PHILIPS_LPC2292 & FLASH_VENDMASK):
-                       return write_buff_philips(info, src, addr, cnt);
+                       return lpc2292_write_buff(info, src, addr, cnt);
                default:
                        return ERR_PROG_ERROR;
        }
index edad51bc4180517a2093622296ce18bf0b27f2b4..0f6e3a938d270f45eeab76e4752e97ea6bf53578 100644 (file)
@@ -36,6 +36,9 @@
 #ifdef CONFIG_IXP425                   /* only valid for IXP425 */
 #include <asm/arch/ixp425.h>
 #endif
+#ifdef CONFIG_LPC2292
+#include <asm/arch/hardware.h>
+#endif
 #include <i2c.h>
 
 #if defined(CONFIG_SOFT_I2C)
index acc1a748e44e524ea65848470188dca833f2df4d..54de737c3bae9ed4d12ba41234d6f19ec6b6b217 100644 (file)
@@ -180,6 +180,7 @@ void dev_print (block_dev_desc_t *dev_desc)
      (CONFIG_COMMANDS & CFG_CMD_SCSI)  || \
      (CONFIG_COMMANDS & CFG_CMD_USB)   || \
      defined(CONFIG_MMC)               || \
+     (defined(CONFIG_MMC) && defined(CONFIG_LPC2292)) || \
      defined(CONFIG_SYSTEMACE)          )
 
 #if defined(CONFIG_MAC_PARTITION) || \
index d68cba682be295949d15c3635896a6c944849531..c7fcc3f23e550650de2402ea9528aec30694a596 100644 (file)
@@ -30,7 +30,7 @@ LIB   = $(obj)libdrivers.a
 COBJS  = 3c589.o 5701rls.o ali512x.o atmel_usart.o \
          bcm570x.o bcm570x_autoneg.o cfb_console.o cfi_flash.o \
          cs8900.o ct69000.o dataflash.o dc2114x.o dm9000x.o \
-         e1000.o eepro100.o \
+         e1000.o eepro100.o enc28j60.o \
          i8042.o inca-ip_sw.o keyboard.o \
          lan91c96.o macb.o \
          natsemi.o ne2000.o netarm_eth.o netconsole.o \
index a823b5aba4089a1160480fc8f4e6b1961836b932..084ee44459e8f1bd3631c47890546caa931ad375 100644 (file)
@@ -89,8 +89,11 @@ fat_register_device(block_dev_desc_t *dev_desc, int part_no)
                part_offset=0;
        }
        else {
-#if (CONFIG_COMMANDS & CFG_CMD_IDE) || (CONFIG_COMMANDS & CFG_CMD_SCSI) || \
-    (CONFIG_COMMANDS & CFG_CMD_USB) || defined(CONFIG_SYSTEMACE)
+#if ((CONFIG_COMMANDS & CFG_CMD_IDE)   || \
+     (CONFIG_COMMANDS & CFG_CMD_SCSI)  || \
+     (CONFIG_COMMANDS & CFG_CMD_USB)   || \
+     (defined(CONFIG_MMC) && defined(CONFIG_LPC2292)) || \
+     defined(CONFIG_SYSTEMACE)          )
                disk_partition_t info;
                if(!get_partition_info(dev_desc, part_no, &info)) {
                        part_offset = info.start;
index 1e9cd41169d437b830525d8e4e5a2ff14eb81823..3056ca7f673ad919f170e6083eb5026122853e25 100644 (file)
@@ -36,8 +36,6 @@
 /* include armadillo specific hardware file if there was one */
 #elif defined(CONFIG_INTEGRATOR) && defined(CONFIG_ARCH_INTEGRATOR)
 /* include IntegratorCP/CM720T specific hardware file if there was one */
-#elif defined(CONFIG_LPC2292)
-#include <asm-arm/arch-arm720t/lpc2292_registers.h>
 #else
 #error No hardware file defined for this configuration
 #endif
index 7e515230a3342095dde6b2e718d151840e438f35..d817ea8d7363cf582b96b66de8acb8779016d984 100644 (file)
@@ -1,12 +1,8 @@
 /*
- * (C) Copyright 2000
- * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
- * Marius Groeger <mgroeger@sysgo.de>
+ * (C) Copyright 2007
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  *
- * Configuation settings for the EP7312 board.
- *
- * Modified to work on Armadillo HT1070 ARM720T board
- * (C) Copyright 2005 Rowel Atienza rowel@diwalabs.com
+ * Configuation settings for the LPC2292SODIMM board from Embedded Artists.
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -31,7 +27,7 @@
 #define __CONFIG_H
 
 /*
- * If we are developing, we might want to start armboot from ram
+ * If we are developing, we might want to start u-boot from ram
  * so we MUST NOT initialize critical regs like mem-timing ...
  */
 #undef CONFIG_INIT_CRITICAL            /* undef for developing */
 #define CONFIG_SETUP_MEMORY_TAGS
 #define CONFIG_INITRD_TAG
 #define CONFIG_MMC 1
+/* we use this ethernet chip */
+#define CONFIG_ENC28J60
 
 #endif /* __CONFIG_H */