Merge branch 'master' of git://git.denx.de/u-boot-arm
authorWolfgang Denk <wd@denx.de>
Wed, 1 Apr 2009 22:24:33 +0000 (00:24 +0200)
committerWolfgang Denk <wd@denx.de>
Wed, 1 Apr 2009 22:24:33 +0000 (00:24 +0200)
145 files changed:
Makefile
board/netstar/Makefile
board/netstar/crcit.c
board/netstar/flash.c [deleted file]
board/netstar/nand.c [deleted file]
board/netstar/netstar.c
cpu/arm1136/mx31/Makefile
cpu/arm1136/mx31/serial.c [deleted file]
cpu/arm1136/omap24xx/interrupts.c
cpu/arm1176/s3c64xx/Makefile
cpu/arm1176/s3c64xx/usb.c [deleted file]
cpu/arm720t/Makefile
cpu/arm720t/cpu.c
cpu/arm720t/s3c4510b/Makefile [new file with mode: 0644]
cpu/arm720t/s3c4510b/cache.c [new file with mode: 0644]
cpu/arm720t/serial.c [deleted file]
cpu/arm720t/serial_netarm.c [deleted file]
cpu/arm920t/imx/Makefile
cpu/arm920t/imx/serial.c [deleted file]
cpu/arm920t/ks8695/Makefile
cpu/arm920t/ks8695/serial.c [deleted file]
cpu/arm920t/s3c24x0/Makefile
cpu/arm920t/s3c24x0/i2c.c [deleted file]
cpu/arm920t/s3c24x0/nand.c [deleted file]
cpu/arm920t/s3c24x0/serial.c [deleted file]
cpu/arm925t/interrupts.c
cpu/arm926ejs/davinci/Makefile
cpu/arm926ejs/davinci/i2c.c [deleted file]
cpu/arm926ejs/davinci/nand.c [deleted file]
cpu/arm926ejs/omap/timer.c
cpu/arm_cortexa8/omap3/interrupts.c
cpu/s3c44b0/Makefile
cpu/s3c44b0/cache.c [new file with mode: 0644]
cpu/s3c44b0/cpu.c
cpu/s3c44b0/serial.c [deleted file]
cpu/sa1100/Makefile
cpu/sa1100/serial.c [deleted file]
drivers/i2c/Makefile
drivers/i2c/davinci_i2c.c [new file with mode: 0644]
drivers/i2c/s3c24x0_i2c.c [new file with mode: 0644]
drivers/i2c/s3c44b0_i2c.c [new file with mode: 0644]
drivers/mtd/nand/Makefile
drivers/mtd/nand/davinci_nand.c [new file with mode: 0644]
drivers/mtd/nand/s3c2410_nand.c [new file with mode: 0644]
drivers/rtc/Makefile
drivers/rtc/s3c44b0_rtc.c [new file with mode: 0644]
drivers/serial/Makefile
drivers/serial/serial_clps7111.c [new file with mode: 0644]
drivers/serial/serial_imx.c [new file with mode: 0644]
drivers/serial/serial_ks8695.c [new file with mode: 0644]
drivers/serial/serial_lpc2292.c [new file with mode: 0644]
drivers/serial/serial_mx31.c [new file with mode: 0644]
drivers/serial/serial_netarm.c [new file with mode: 0644]
drivers/serial/serial_s3c24x0.c [new file with mode: 0644]
drivers/serial/serial_s3c44b0.c [new file with mode: 0644]
drivers/serial/serial_sa1100.c [new file with mode: 0644]
drivers/usb/Makefile
drivers/usb/s3c64xx_usb.c [new file with mode: 0644]
include/asm-arm/arch-arm720t/hardware.h
include/asm-arm/arch-arm720t/s3c4510b.h [deleted file]
include/asm-arm/arch-s3c4510b/hardware.h [new file with mode: 0644]
include/configs/ADNPESC1.h
include/configs/B2.h
include/configs/DK1C20.h
include/configs/DK1S10.h
include/configs/EXBITGEN.h
include/configs/SMN42.h
include/configs/SX1.h
include/configs/VCMA9.h
include/configs/W7OLMC.h
include/configs/W7OLMG.h
include/configs/actux1.h
include/configs/actux2.h
include/configs/actux3.h
include/configs/actux4.h
include/configs/apollon.h
include/configs/armadillo.h
include/configs/assabet.h
include/configs/cerf250.h
include/configs/cm4008.h
include/configs/cm41xx.h
include/configs/cradle.h
include/configs/csb226.h
include/configs/csb272.h
include/configs/csb472.h
include/configs/davinci_dvevm.h
include/configs/davinci_schmoogie.h
include/configs/davinci_sffsdr.h
include/configs/davinci_sonata.h
include/configs/delta.h
include/configs/dnp1110.h
include/configs/eNET.h
include/configs/ep7312.h
include/configs/evb4510.h
include/configs/gcplus.h
include/configs/hymod.h
include/configs/impa7.h
include/configs/innokom.h
include/configs/integratorap.h
include/configs/integratorcp.h
include/configs/ixdp425.h
include/configs/ixdpg425.h
include/configs/lart.h
include/configs/logodl.h
include/configs/lpc2292sodimm.h
include/configs/lpd7a400.h
include/configs/lpd7a404.h
include/configs/lubbock.h
include/configs/modnet50.h
include/configs/mx1ads.h
include/configs/mx1fs2.h
include/configs/netstar.h
include/configs/nmdk8815.h
include/configs/ns9750dev.h
include/configs/omap1510inn.h
include/configs/omap1610h2.h
include/configs/omap1610inn.h
include/configs/omap2420h4.h
include/configs/omap3_beagle.h
include/configs/omap3_evm.h
include/configs/omap3_overo.h
include/configs/omap3_pandora.h
include/configs/omap3_zoom1.h
include/configs/omap5912osk.h
include/configs/omap730p2.h
include/configs/pdnb3.h
include/configs/pleb2.h
include/configs/pxa255_idp.h
include/configs/sbc2410x.h
include/configs/sc520_cdp.h
include/configs/sc520_spunk.h
include/configs/scb9328.h
include/configs/shannon.h
include/configs/smdk2400.h
include/configs/smdk2410.h
include/configs/smdk6400.h
include/configs/trab.h
include/configs/trizepsiv.h
include/configs/versatile.h
include/configs/voiceblue.h
include/configs/wepep250.h
include/configs/xaeniax.h
include/configs/xm250.h
include/configs/xsengine.h
include/configs/zylonite.h

index 31671aa10cb96c73debe076092e76054709b2a8e..f857641341e4a07a24e641cfcefa86cc264e0040 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2947,7 +2947,7 @@ modnet50_config : unconfig
        @$(MKCONFIG) $(@:_config=) arm arm720t modnet50
 
 evb4510_config :       unconfig
-       @$(MKCONFIG) $(@:_config=) arm arm720t evb4510
+       @$(MKCONFIG) $(@:_config=) arm arm720t evb4510 NULL s3c4510b
 
 lpc2292sodimm_config:  unconfig
        @$(MKCONFIG) $(@:_config=) arm arm720t lpc2292sodimm NULL lpc2292
index 8d911b845bd48f1b54c2e24333ac3a263635337b..11a952b9b7d752cce89057c7333dc0fc919b6253 100644 (file)
@@ -28,7 +28,7 @@ include $(TOPDIR)/config.mk
 
 LIB    = $(obj)lib$(BOARD).a
 
-COBJS  := netstar.o flash.o nand.o
+COBJS  := netstar.o
 SOBJS  := setup.o crcek.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c) eeprom.c \
index ce98e2026782bbdb5a3ce1130897147ff8ec1a8e..e0cea9b3fb6e12f2e6ac0fe3cb123f4b153862eb 100644 (file)
 #include <sys/stat.h>
 #include "crcek.h"
 
-extern unsigned long crc32(unsigned long, const unsigned char *, unsigned int);
+extern uint32_t crc32(uint32_t, const unsigned char *, uint);
 
-uint32_t data[LOADER_SIZE/4 + 3];
+static uint32_t data[LOADER_SIZE/4 + 3];
 
-int doit(char *path, unsigned version)
+static int do_crc(char *path, unsigned version)
 {
        uint32_t *p;
        ssize_t size;
@@ -56,10 +56,10 @@ int doit(char *path, unsigned version)
                fprintf(stderr, "File too large\n");
                return EXIT_FAILURE;
        }
-       size = (((size - 1) >> 2) + 1) << 2;
+       size = (size + 3) & ~3; /* round up to 4 bytes */
        data[0] = size + 4;     /* add size of version field */
        data[1] = version;
-       data[(size >> 2) + 2] = crc32(0, (unsigned char *)(data + 1), data[0]);
+       data[2 + (size >> 2)] = crc32(0, (unsigned char *)(data + 1), data[0]);
        close(fd);
 
        if (write(STDOUT_FILENO, data, size + 3*4) == -1) {
@@ -73,12 +73,12 @@ int doit(char *path, unsigned version)
 int main(int argc, char **argv)
 {
        if (argc == 2) {
-               return doit(argv[1], 0);
+               return do_crc(argv[1], 0);
        } else if ((argc == 4) && (strcmp(argv[1], "-v") == 0)) {
                char *endptr, *nptr = argv[2];
                unsigned ver = strtoul(nptr, &endptr, 0);
                if (*nptr != '\0' && *endptr == '\0')
-                       return doit(argv[3], ver);
+                       return do_crc(argv[3], ver);
        }
        fprintf(stderr, "Usage: crcit [-v version] <image>\n");
 
diff --git a/board/netstar/flash.c b/board/netstar/flash.c
deleted file mode 100644 (file)
index e9eca35..0000000
+++ /dev/null
@@ -1,343 +0,0 @@
-/*
- * (C) Copyright 2002
- * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
- * Alex Zuepke <azu@sysgo.de>
- *
- * (C) Copyright 2005
- * 2N Telekomunikace, a.s. <www.2n.cz>
- * Ladislav Michl <michl@2n.cz>
- *
- * 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 <common.h>
-
-/*#if 0 */
-#if (PHYS_SDRAM_1_SIZE != SZ_32M)
-
-#include "crcek.h"
-
-#if (CONFIG_SYS_MAX_FLASH_BANKS > 1)
-#error There is always only _one_ flash chip
-#endif
-
-flash_info_t flash_info[CONFIG_SYS_MAX_FLASH_BANKS];
-
-#define CMD_READ_ARRAY         0x000000f0
-#define CMD_UNLOCK1            0x000000aa
-#define CMD_UNLOCK2            0x00000055
-#define CMD_ERASE_SETUP                0x00000080
-#define CMD_ERASE_CONFIRM      0x00000030
-#define CMD_PROGRAM            0x000000a0
-#define CMD_UNLOCK_BYPASS      0x00000020
-
-#define MEM_FLASH_ADDR1                (*(volatile u16 *)(CONFIG_SYS_FLASH_BASE + (0x00000555 << 1)))
-#define MEM_FLASH_ADDR2                (*(volatile u16 *)(CONFIG_SYS_FLASH_BASE + (0x000002aa << 1)))
-
-#define BIT_ERASE_DONE         0x00000080
-#define BIT_RDY_MASK           0x00000080
-#define BIT_PROGRAM_ERROR      0x00000020
-#define BIT_TIMEOUT            0x80000000      /* our flag */
-
-/*-----------------------------------------------------------------------
- */
-
-ulong flash_init(void)
-{
-       int i;
-
-       flash_info[0].flash_id = (AMD_MANUFACT & FLASH_VENDMASK) |
-                                (AMD_ID_LV800B & FLASH_TYPEMASK);
-       flash_info[0].size = PHYS_FLASH_1_SIZE;
-       flash_info[0].sector_count = CONFIG_SYS_MAX_FLASH_SECT;
-       memset(flash_info[0].protect, 0, CONFIG_SYS_MAX_FLASH_SECT);
-
-       for (i = 0; i < flash_info[0].sector_count; i++) {
-               switch (i) {
-               case 0: /* 16kB */
-                       flash_info[0].start[0] = CONFIG_SYS_FLASH_BASE;
-                       break;
-               case 1: /* 8kB */
-                       flash_info[0].start[1] = CONFIG_SYS_FLASH_BASE + 0x4000;
-                       break;
-               case 2: /* 8kB */
-                       flash_info[0].start[2] = CONFIG_SYS_FLASH_BASE + 0x4000 +
-                                                0x2000;
-                       break;
-               case 3: /* 32 KB */
-                       flash_info[0].start[3] = CONFIG_SYS_FLASH_BASE + 0x4000 +
-                                                2 * 0x2000;
-                       break;
-               case 4:
-                       flash_info[0].start[4] = CONFIG_SYS_FLASH_BASE + 0x4000 +
-                                                2 * 0x2000 + 0x8000;
-                       break;
-               default: /* 64kB */
-                       flash_info[0].start[i] = flash_info[0].start[i-1] +
-                                                0x10000;
-                       break;
-               }
-       }
-
-       /* U-Boot */
-       flash_protect(FLAG_PROTECT_SET,
-                     LOADER1_OFFSET,
-                     LOADER1_OFFSET + LOADER_SIZE - 1, flash_info);
-       /* Protect crcek, env and r_env as well */
-       flash_protect(FLAG_PROTECT_SET, 0, 0x8000 - 1, flash_info);
-
-       return flash_info[0].size;
-}
-
-/*-----------------------------------------------------------------------
- */
-void flash_print_info(flash_info_t *info)
-{
-       int i;
-
-       switch (info->flash_id & FLASH_VENDMASK) {
-       case (AMD_MANUFACT & FLASH_VENDMASK):
-               puts("AMD: ");
-               break;
-       default:
-               puts("Unknown vendor ");
-               break;
-       }
-
-       switch (info->flash_id & FLASH_TYPEMASK) {
-       case (AMD_ID_LV800B & FLASH_TYPEMASK):
-               puts("AM29LV800BB (8Mb)\n");
-               break;
-       default:
-               puts("Unknown chip type\n");
-               return;
-       }
-
-       printf("  Size: %ld MB in %d sectors\n",
-              info->size >> 20, info->sector_count);
-
-       puts("  Sector start addresses:");
-       for (i = 0; i < info->sector_count; i++) {
-               if ((i % 5) == 0)
-                       puts("\n   ");
-
-               printf(" %08lX%s", info->start[i],
-                      info->protect[i] ? " (RO)" : "     ");
-       }
-       puts("\n");
-}
-
-/*-----------------------------------------------------------------------
- */
-
-int flash_erase(flash_info_t *info, int s_first, int s_last)
-{
-       ushort result;
-       int prot, sect;
-       int rc = ERR_OK;
-
-       /* first look for protection bits */
-
-       if (info->flash_id == FLASH_UNKNOWN)
-               return ERR_UNKNOWN_FLASH_TYPE;
-
-       if ((s_first < 0) || (s_first > s_last))
-               return ERR_INVAL;
-
-       if ((info->flash_id & FLASH_VENDMASK) !=
-           (AMD_MANUFACT & FLASH_VENDMASK))
-               return ERR_UNKNOWN_FLASH_VENDOR;
-
-       prot = 0;
-       for (sect = s_first; sect <= s_last; ++sect)
-               if (info->protect[sect])
-                       prot++;
-
-       if (prot)
-               printf("- Warning: %d protected sectors will not be erased!\n",
-                      prot);
-       else
-               putc('\n');
-
-       /* Start erase on unprotected sectors */
-       for (sect = s_first; sect <= s_last && !ctrlc (); sect++) {
-               if (info->protect[sect] == 0) { /* not protected */
-                       vu_short *addr = (vu_short *) (info->start[sect]);
-
-                       /* arm simple, non interrupt dependent timer */
-                       reset_timer_masked();
-
-                       MEM_FLASH_ADDR1 = CMD_UNLOCK1;
-                       MEM_FLASH_ADDR2 = CMD_UNLOCK2;
-                       MEM_FLASH_ADDR1 = CMD_ERASE_SETUP;
-
-                       MEM_FLASH_ADDR1 = CMD_UNLOCK1;
-                       MEM_FLASH_ADDR2 = CMD_UNLOCK2;
-                       *addr = CMD_ERASE_CONFIRM;
-
-                       /* wait until flash is ready */
-                       while (1) {
-                               result = *addr;
-
-                               /* check timeout */
-                               if (get_timer_masked() > CONFIG_SYS_FLASH_ERASE_TOUT) {
-                                       MEM_FLASH_ADDR1 = CMD_READ_ARRAY;
-                                       rc = ERR_TIMOUT;
-                                       break;
-                               }
-
-                               if ((result & 0xfff) & BIT_ERASE_DONE)
-                                       break;
-
-                               if ((result & 0xffff) & BIT_PROGRAM_ERROR) {
-                                       rc = ERR_PROG_ERROR;
-                                       break;
-                               }
-                       }
-
-                       MEM_FLASH_ADDR1 = CMD_READ_ARRAY;
-
-                       if (rc != ERR_OK)
-                               goto out;
-
-                       putc('.');
-               }
-       }
-out:
-       /* allow flash to settle - wait 10 ms */
-       udelay_masked(10000);
-
-       return rc;
-}
-
-/*-----------------------------------------------------------------------
- * Copy memory to flash
- */
-
-static int write_hword(flash_info_t *info, ulong dest, ushort data)
-{
-       vu_short *addr = (vu_short *) dest;
-       ushort result;
-       int rc = ERR_OK;
-
-       /* check if flash is (sufficiently) erased */
-       result = *addr;
-       if ((result & data) != data)
-               return ERR_NOT_ERASED;
-
-       MEM_FLASH_ADDR1 = CMD_UNLOCK1;
-       MEM_FLASH_ADDR2 = CMD_UNLOCK2;
-       MEM_FLASH_ADDR1 = CMD_PROGRAM;
-       *addr = data;
-
-       /* arm simple, non interrupt dependent timer */
-       reset_timer_masked();
-
-       /* wait until flash is ready */
-       while (1) {
-               result = *addr;
-
-               /* check timeout */
-               if (get_timer_masked () > CONFIG_SYS_FLASH_ERASE_TOUT) {
-                       rc = ERR_TIMOUT;
-                       break;
-               }
-
-               if ((result & 0x80) == (data & 0x80))
-                       break;
-
-               if ((result & 0xffff) & BIT_PROGRAM_ERROR) {
-                       result = *addr;
-
-                       if ((result & 0x80) != (data & 0x80))
-                               rc = ERR_PROG_ERROR;
-               }
-       }
-
-       *addr = CMD_READ_ARRAY;
-
-       if (*addr != data)
-               rc = ERR_PROG_ERROR;
-
-       return rc;
-}
-
-/*-----------------------------------------------------------------------
- * Copy memory to flash.
- */
-
-int write_buff(flash_info_t *info, uchar *src, ulong addr, ulong cnt)
-{
-       ulong cp, wp;
-       int l;
-       int i, rc;
-       ushort data;
-
-       wp = (addr & ~1);       /* get lower word aligned address */
-
-       /*
-        * handle unaligned start bytes
-        */
-       if ((l = addr - wp) != 0) {
-               data = 0;
-               for (i = 0, cp = wp; i < l; ++i, ++cp)
-                       data = (data >> 8) | (*(uchar *) cp << 8);
-               for (; i < 2 && cnt > 0; ++i) {
-                       data = (data >> 8) | (*src++ << 8);
-                       --cnt;
-                       ++cp;
-               }
-               for (; cnt == 0 && i < 2; ++i, ++cp)
-                       data = (data >> 8) | (*(uchar *) cp << 8);
-
-               if ((rc = write_hword(info, wp, data)) != 0)
-                       return (rc);
-               wp += 2;
-       }
-
-       /*
-        * handle word aligned part
-        */
-       while (cnt >= 2) {
-               data = *((vu_short *) src);
-               if ((rc = write_hword(info, wp, data)) != 0)
-                       return (rc);
-               src += 2;
-               wp += 2;
-               cnt -= 2;
-       }
-
-       if (cnt == 0)
-               return ERR_OK;
-
-       /*
-        * handle unaligned tail bytes
-        */
-       data = 0;
-       for (i = 0, cp = wp; i < 2 && cnt > 0; ++i, ++cp) {
-               data = (data >> 8) | (*src++ << 8);
-               --cnt;
-       }
-       for (; i < 2; ++i, ++cp)
-               data = (data >> 8) | (*(uchar *) cp << 8);
-
-       return write_hword(info, wp, data);
-}
-
-#endif
diff --git a/board/netstar/nand.c b/board/netstar/nand.c
deleted file mode 100644 (file)
index e3ab66f..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * (C) Copyright 2005 2N TELEKOMUNIKACE, Ladislav Michl
- *
- * 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 <common.h>
-#include <asm/io.h>
-
-#if defined(CONFIG_CMD_NAND)
-
-#include <nand.h>
-
-/*
- *     hardware specific access to control-lines
- */
-#define        MASK_CLE        0x02
-#define        MASK_ALE        0x04
-
-static void netstar_nand_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl)
-{
-       struct nand_chip *this = mtd->priv;
-       ulong IO_ADDR_W = (ulong) this->IO_ADDR_W;
-
-       IO_ADDR_W &= ~(MASK_ALE|MASK_CLE);
-       if (ctrl & NAND_CTRL_CHANGE) {
-               if ( ctrl & NAND_CLE )
-                       IO_ADDR_W |= MASK_CLE;
-               if ( ctrl & NAND_ALE )
-                       IO_ADDR_W |= MASK_ALE;
-       }
-       this->IO_ADDR_W = (void __iomem *) IO_ADDR_W;
-
-       if (cmd != NAND_CMD_NONE)
-               writeb(cmd, this->IO_ADDR_W);
-}
-
-int board_nand_init(struct nand_chip *nand)
-{
-       nand->options = NAND_SAMSUNG_LP_OPTIONS;
-       nand->ecc.mode = NAND_ECC_SOFT;
-       nand->cmd_ctrl = netstar_nand_hwcontrol;
-       nand->chip_delay = 400;
-       return 0;
-}
-#endif
index f52afe50c7e3add8bc3ea0c6f68df56e9df8e481..ee4f2cdca7f624fe4843d8cc40930c93e33c68bb 100644 (file)
  */
 
 #include <common.h>
+#include <i2c.h>
+#include <flash.h>
+#include <nand.h>
+
+#include <asm/io.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -52,6 +57,10 @@ int dram_init(void)
 
 int misc_init_r(void)
 {
+#if defined(CONFIG_RTC_DS1307)
+       /* enable trickle charge */
+       i2c_reg_write(CONFIG_SYS_I2C_RTC_ADDR, 0x10, 0xaa);
+#endif
        return 0;
 }
 
@@ -59,3 +68,50 @@ int board_late_init(void)
 {
        return 0;
 }
+
+#if defined(CONFIG_CMD_FLASH)
+ulong board_flash_get_legacy(ulong base, int banknum, flash_info_t * info)
+{
+       if (banknum == 0) {     /* AM29LV800 boot flash */
+               info->portwidth = FLASH_CFI_16BIT;
+               info->chipwidth = FLASH_CFI_BY16;
+               info->interface = FLASH_CFI_X16;
+               return 1;
+       }
+
+       return 0;
+}
+#endif
+
+#if defined(CONFIG_CMD_NAND)
+/*
+ *     hardware specific access to control-lines
+ *
+ *     NAND_NCE: bit 0 - don't care
+ *     NAND_CLE: bit 1 -> bit 1  (0x0002)
+ *     NAND_ALE: bit 2 -> bit 2  (0x0004)
+ */
+static void netstar_nand_hwcontrol(struct mtd_info *mtd, int cmd,
+       unsigned int ctrl)
+{
+       struct nand_chip *chip = mtd->priv;
+       unsigned long mask;
+
+       if (cmd == NAND_CMD_NONE)
+               return;
+
+       mask = (ctrl & NAND_CLE) ? 0x02 : 0;
+       if (ctrl & NAND_ALE)
+               mask |= 0x04;
+       writeb(cmd, (unsigned long)chip->IO_ADDR_W | mask);
+}
+
+int board_nand_init(struct nand_chip *nand)
+{
+       nand->options = NAND_SAMSUNG_LP_OPTIONS;
+       nand->ecc.mode = NAND_ECC_SOFT;
+       nand->cmd_ctrl = netstar_nand_hwcontrol;
+       nand->chip_delay = 400;
+       return 0;
+}
+#endif
index b648ffd6ffcf5dc58160da7034d60f18b0627496..0e06f0a2b21043485f9d7d922698840080f85623 100644 (file)
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB    = $(obj)lib$(SOC).a
 
-COBJS  = interrupts.o serial.o generic.o
+COBJS  = interrupts.o generic.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
diff --git a/cpu/arm1136/mx31/serial.c b/cpu/arm1136/mx31/serial.c
deleted file mode 100644 (file)
index e025e94..0000000
+++ /dev/null
@@ -1,232 +0,0 @@
-/*
- * (c) 2007 Sascha Hauer <s.hauer@pengutronix.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 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 <common.h>
-
-#if defined CONFIG_MX31_UART
-
-#include <asm/arch/mx31.h>
-
-#define __REG(x)     (*((volatile u32 *)(x)))
-
-#ifdef CONFIG_SYS_MX31_UART1
-#define UART_PHYS 0x43f90000
-#elif defined(CONFIG_SYS_MX31_UART2)
-#define UART_PHYS 0x43f94000
-#elif defined(CONFIG_SYS_MX31_UART3)
-#define UART_PHYS 0x5000c000
-#elif defined(CONFIG_SYS_MX31_UART4)
-#define UART_PHYS 0x43fb0000
-#elif defined(CONFIG_SYS_MX31_UART5)
-#define UART_PHYS 0x43fb4000
-#else
-#error "define CONFIG_SYS_MX31_UARTx to use the mx31 UART driver"
-#endif
-
-/* Register definitions */
-#define URXD  0x0  /* Receiver Register */
-#define UTXD  0x40 /* Transmitter Register */
-#define UCR1  0x80 /* Control Register 1 */
-#define UCR2  0x84 /* Control Register 2 */
-#define UCR3  0x88 /* Control Register 3 */
-#define UCR4  0x8c /* Control Register 4 */
-#define UFCR  0x90 /* FIFO Control Register */
-#define USR1  0x94 /* Status Register 1 */
-#define USR2  0x98 /* Status Register 2 */
-#define UESC  0x9c /* Escape Character Register */
-#define UTIM  0xa0 /* Escape Timer Register */
-#define UBIR  0xa4 /* BRM Incremental Register */
-#define UBMR  0xa8 /* BRM Modulator Register */
-#define UBRC  0xac /* Baud Rate Count Register */
-#define UTS   0xb4 /* UART Test Register (mx31) */
-
-/* UART Control Register Bit Fields.*/
-#define  URXD_CHARRDY    (1<<15)
-#define  URXD_ERR        (1<<14)
-#define  URXD_OVRRUN     (1<<13)
-#define  URXD_FRMERR     (1<<12)
-#define  URXD_BRK        (1<<11)
-#define  URXD_PRERR      (1<<10)
-#define  URXD_RX_DATA    (0xFF)
-#define  UCR1_ADEN       (1<<15) /* Auto dectect interrupt */
-#define  UCR1_ADBR       (1<<14) /* Auto detect baud rate */
-#define  UCR1_TRDYEN     (1<<13) /* Transmitter ready interrupt enable */
-#define  UCR1_IDEN       (1<<12) /* Idle condition interrupt */
-#define  UCR1_RRDYEN     (1<<9)         /* Recv ready interrupt enable */
-#define  UCR1_RDMAEN     (1<<8)         /* Recv ready DMA enable */
-#define  UCR1_IREN       (1<<7)         /* Infrared interface enable */
-#define  UCR1_TXMPTYEN   (1<<6)         /* Transimitter empty interrupt enable */
-#define  UCR1_RTSDEN     (1<<5)         /* RTS delta interrupt enable */
-#define  UCR1_SNDBRK     (1<<4)         /* Send break */
-#define  UCR1_TDMAEN     (1<<3)         /* Transmitter ready DMA enable */
-#define  UCR1_UARTCLKEN  (1<<2)         /* UART clock enabled */
-#define  UCR1_DOZE       (1<<1)         /* Doze */
-#define  UCR1_UARTEN     (1<<0)         /* UART enabled */
-#define  UCR2_ESCI      (1<<15) /* Escape seq interrupt enable */
-#define  UCR2_IRTS      (1<<14) /* Ignore RTS pin */
-#define  UCR2_CTSC      (1<<13) /* CTS pin control */
-#define  UCR2_CTS        (1<<12) /* Clear to send */
-#define  UCR2_ESCEN      (1<<11) /* Escape enable */
-#define  UCR2_PREN       (1<<8)  /* Parity enable */
-#define  UCR2_PROE       (1<<7)  /* Parity odd/even */
-#define  UCR2_STPB       (1<<6)         /* Stop */
-#define  UCR2_WS         (1<<5)         /* Word size */
-#define  UCR2_RTSEN      (1<<4)         /* Request to send interrupt enable */
-#define  UCR2_TXEN       (1<<2)         /* Transmitter enabled */
-#define  UCR2_RXEN       (1<<1)         /* Receiver enabled */
-#define  UCR2_SRST      (1<<0)  /* SW reset */
-#define  UCR3_DTREN     (1<<13) /* DTR interrupt enable */
-#define  UCR3_PARERREN   (1<<12) /* Parity enable */
-#define  UCR3_FRAERREN   (1<<11) /* Frame error interrupt enable */
-#define  UCR3_DSR        (1<<10) /* Data set ready */
-#define  UCR3_DCD        (1<<9)  /* Data carrier detect */
-#define  UCR3_RI         (1<<8)  /* Ring indicator */
-#define  UCR3_TIMEOUTEN  (1<<7)  /* Timeout interrupt enable */
-#define  UCR3_RXDSEN    (1<<6)  /* Receive status interrupt enable */
-#define  UCR3_AIRINTEN   (1<<5)  /* Async IR wake interrupt enable */
-#define  UCR3_AWAKEN    (1<<4)  /* Async wake interrupt enable */
-#define  UCR3_REF25     (1<<3)  /* Ref freq 25 MHz */
-#define  UCR3_REF30     (1<<2)  /* Ref Freq 30 MHz */
-#define  UCR3_INVT      (1<<1)  /* Inverted Infrared transmission */
-#define  UCR3_BPEN      (1<<0)  /* Preset registers enable */
-#define  UCR4_CTSTL_32   (32<<10) /* CTS trigger level (32 chars) */
-#define  UCR4_INVR      (1<<9)  /* Inverted infrared reception */
-#define  UCR4_ENIRI     (1<<8)  /* Serial infrared interrupt enable */
-#define  UCR4_WKEN      (1<<7)  /* Wake interrupt enable */
-#define  UCR4_REF16     (1<<6)  /* Ref freq 16 MHz */
-#define  UCR4_IRSC      (1<<5)  /* IR special case */
-#define  UCR4_TCEN      (1<<3)  /* Transmit complete interrupt enable */
-#define  UCR4_BKEN      (1<<2)  /* Break condition interrupt enable */
-#define  UCR4_OREN      (1<<1)  /* Receiver overrun interrupt enable */
-#define  UCR4_DREN      (1<<0)  /* Recv data ready interrupt enable */
-#define  UFCR_RXTL_SHF   0       /* Receiver trigger level shift */
-#define  UFCR_RFDIV      (7<<7)  /* Reference freq divider mask */
-#define  UFCR_TXTL_SHF   10      /* Transmitter trigger level shift */
-#define  USR1_PARITYERR  (1<<15) /* Parity error interrupt flag */
-#define  USR1_RTSS      (1<<14) /* RTS pin status */
-#define  USR1_TRDY      (1<<13) /* Transmitter ready interrupt/dma flag */
-#define  USR1_RTSD      (1<<12) /* RTS delta */
-#define  USR1_ESCF      (1<<11) /* Escape seq interrupt flag */
-#define  USR1_FRAMERR    (1<<10) /* Frame error interrupt flag */
-#define  USR1_RRDY       (1<<9)         /* Receiver ready interrupt/dma flag */
-#define  USR1_TIMEOUT    (1<<7)         /* Receive timeout interrupt status */
-#define  USR1_RXDS      (1<<6)  /* Receiver idle interrupt flag */
-#define  USR1_AIRINT    (1<<5)  /* Async IR wake interrupt flag */
-#define  USR1_AWAKE     (1<<4)  /* Aysnc wake interrupt flag */
-#define  USR2_ADET      (1<<15) /* Auto baud rate detect complete */
-#define  USR2_TXFE      (1<<14) /* Transmit buffer FIFO empty */
-#define  USR2_DTRF      (1<<13) /* DTR edge interrupt flag */
-#define  USR2_IDLE      (1<<12) /* Idle condition */
-#define  USR2_IRINT     (1<<8)  /* Serial infrared interrupt flag */
-#define  USR2_WAKE      (1<<7)  /* Wake */
-#define  USR2_RTSF      (1<<4)  /* RTS edge interrupt flag */
-#define  USR2_TXDC      (1<<3)  /* Transmitter complete */
-#define  USR2_BRCD      (1<<2)  /* Break condition */
-#define  USR2_ORE        (1<<1)         /* Overrun error */
-#define  USR2_RDR        (1<<0)         /* Recv data ready */
-#define  UTS_FRCPERR    (1<<13) /* Force parity error */
-#define  UTS_LOOP        (1<<12) /* Loop tx and rx */
-#define  UTS_TXEMPTY    (1<<6)  /* TxFIFO empty */
-#define  UTS_RXEMPTY    (1<<5)  /* RxFIFO empty */
-#define  UTS_TXFULL     (1<<4)  /* TxFIFO full */
-#define  UTS_RXFULL     (1<<3)  /* RxFIFO full */
-#define  UTS_SOFTRST    (1<<0)  /* Software reset */
-
-DECLARE_GLOBAL_DATA_PTR;
-
-void serial_setbrg (void)
-{
-       u32 clk = mx31_get_ipg_clk();
-
-       if (!gd->baudrate)
-               gd->baudrate = CONFIG_BAUDRATE;
-
-       __REG(UART_PHYS + UFCR) = 4 << 7; /* divide input clock by 2 */
-       __REG(UART_PHYS + UBIR) = 0xf;
-       __REG(UART_PHYS + UBMR) = clk / (2 * gd->baudrate);
-
-}
-
-int serial_getc (void)
-{
-       while (__REG(UART_PHYS + UTS) & UTS_RXEMPTY);
-       return (__REG(UART_PHYS + URXD) & URXD_RX_DATA); /* mask out status from upper word */
-}
-
-void serial_putc (const char c)
-{
-       __REG(UART_PHYS + UTXD) = c;
-
-       /* wait for transmitter to be ready */
-       while(!(__REG(UART_PHYS + UTS) & UTS_TXEMPTY));
-
-       /* If \n, also do \r */
-       if (c == '\n')
-               serial_putc ('\r');
-}
-
-/*
- * Test whether a character is in the RX buffer
- */
-int serial_tstc (void)
-{
-       /* If receive fifo is empty, return false */
-       if (__REG(UART_PHYS + UTS) & UTS_RXEMPTY)
-               return 0;
-       return 1;
-}
-
-void
-serial_puts (const char *s)
-{
-       while (*s) {
-               serial_putc (*s++);
-       }
-}
-
-/*
- * Initialise the serial port with the given baudrate. The settings
- * are always 8 data bits, no parity, 1 stop bit, no start bits.
- *
- */
-int serial_init (void)
-{
-       __REG(UART_PHYS + UCR1) = 0x0;
-       __REG(UART_PHYS + UCR2) = 0x0;
-
-       while (!(__REG(UART_PHYS + UCR2) & UCR2_SRST));
-
-       __REG(UART_PHYS + UCR3) = 0x0704;
-       __REG(UART_PHYS + UCR4) = 0x8000;
-       __REG(UART_PHYS + UESC) = 0x002b;
-       __REG(UART_PHYS + UTIM) = 0x0;
-
-       __REG(UART_PHYS + UTS) = 0x0;
-
-       serial_setbrg();
-
-       __REG(UART_PHYS + UCR2) = UCR2_WS | UCR2_IRTS | UCR2_RXEN | UCR2_TXEN | UCR2_SRST;
-
-       __REG(UART_PHYS + UCR1) = UCR1_UARTEN;
-
-       return 0;
-}
-
-
-#endif /* CONFIG_MX31 */
index fb02a49be7aab968861f03c0a8d6f66c18799433..6be1262f3a3b1e1161187d23bd1f7089fadd0960 100644 (file)
@@ -49,7 +49,7 @@ int interrupt_init (void)
 
        /* Start the counter ticking up */
        *((int32_t *) (CONFIG_SYS_TIMERBASE + TLDR)) = TIMER_LOAD_VAL;  /* reload value on overflow*/
-       val = (CONFIG_SYS_PVT << 2) | BIT5 | BIT1 | BIT0;               /* mask to enable timer*/
+       val = (CONFIG_SYS_PTV << 2) | BIT5 | BIT1 | BIT0;               /* mask to enable timer*/
        *((int32_t *) (CONFIG_SYS_TIMERBASE + TCLR)) = val;     /* start timer */
 
        reset_timer_masked(); /* init the timestamp and lastinc value */
index 4ab181159a91cab9dfc5b087023da81b81327769..fa4ee3f24e2309efd7e29365b032dd2bb4652cd0 100644 (file)
@@ -30,7 +30,6 @@ LIB   = $(obj)lib$(SOC).a
 
 COBJS-y        = interrupts.o
 COBJS-$(CONFIG_S3C6400)        += cpu_init.o speed.o
-COBJS-$(CONFIG_USB_OHCI_NEW) += usb.o
 
 OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS-y))
 
diff --git a/cpu/arm1176/s3c64xx/usb.c b/cpu/arm1176/s3c64xx/usb.c
deleted file mode 100644 (file)
index 274a4ed..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * URB OHCI HCD (Host Controller Driver) initialization for USB on the S3C64XX.
- *
- * Copyright (C) 2008,
- * Guennadi Liakhovetski, DENX Software Engineering <lg@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 <common.h>
-#include <s3c6400.h>
-
-int usb_cpu_init(void)
-{
-       OTHERS_REG |= 0x10000;
-       return 0;
-}
-
-int usb_cpu_stop(void)
-{
-       OTHERS_REG &= ~0x10000;
-       return 0;
-}
-
-void usb_cpu_init_fail(void)
-{
-       OTHERS_REG &= ~0x10000;
-}
index c97f329638e58980532ada29d60b86c154745c5c..d5ac7d3fd980e66e909bbe55dadaf3c3906c3737 100644 (file)
@@ -26,7 +26,7 @@ include $(TOPDIR)/config.mk
 LIB    = $(obj)lib$(CPU).a
 
 START  = start.o
-COBJS  = serial.o serial_netarm.o interrupts.o cpu.o
+COBJS  = interrupts.o cpu.o
 
 SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS) $(SOBJS))
index 5ac8f59ab3caf2f1b551fc919b0ff64d3e814d52..8166982e6a7d0ab0892247c2dbb77a24930a4509 100644 (file)
@@ -188,71 +188,9 @@ int dcache_status (void)
 {
        return (read_p15_c1 () & C1_IDC) != 0;
 }
-
-#elif defined(CONFIG_S3C4510B)
-
-void icache_enable (void)
-{
-       s32 i;
-
-       /* disable all cache bits */
-       CLR_REG( REG_SYSCFG, 0x3F);
-
-       /* 8KB cache, write enable */
-       SET_REG( REG_SYSCFG, CACHE_WRITE_BUFF | CACHE_MODE_01);
-
-       /* clear TAG RAM bits */
-       for ( i = 0; i < 256; i++)
-         PUT_REG( CACHE_TAG_RAM + 4*i, 0x00000000);
-
-       /* clear SET0 RAM */
-       for(i=0; i < 1024; i++)
-         PUT_REG( CACHE_SET0_RAM + 4*i, 0x00000000);
-
-       /* clear SET1 RAM */
-       for(i=0; i < 1024; i++)
-         PUT_REG( CACHE_SET1_RAM + 4*i, 0x00000000);
-
-       /* enable cache */
-       SET_REG( REG_SYSCFG, CACHE_ENABLE);
-
-}
-
-void icache_disable (void)
-{
-       /* disable all cache bits */
-       CLR_REG( REG_SYSCFG, 0x3F);
-}
-
-int icache_status (void)
-{
-       return GET_REG( REG_SYSCFG) & CACHE_ENABLE;
-}
-
-void dcache_enable (void)
-{
-       /* we don't have seperate instruction/data caches */
-       icache_enable();
-}
-
-void dcache_disable (void)
-{
-       /* we don't have seperate instruction/data caches */
-       icache_disable();
-}
-
-int dcache_status (void)
-{
-       /* we don't have seperate instruction/data caches */
-       return icache_status();
-}
-
 #elif defined(CONFIG_INTEGRATOR) && defined(CONFIG_ARCH_INTEGRATOR)
        /* No specific cache setup for IntegratorAP/CM720T as yet */
        void icache_enable (void)
        {
        }
-#elif defined(CONFIG_LPC2292) /* just to satisfy the compiler */
-#else
-#error No icache/dcache enable/disable functions defined for this CPU type
 #endif
diff --git a/cpu/arm720t/s3c4510b/Makefile b/cpu/arm720t/s3c4510b/Makefile
new file mode 100644 (file)
index 0000000..c9520b6
--- /dev/null
@@ -0,0 +1,46 @@
+#
+# (C) Copyright 2000-2008
+# 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)lib$(SOC).a
+
+COBJS-y        += cache.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS-y))
+
+all:   $(obj).depend $(LIB)
+
+$(LIB):        $(OBJS)
+       $(AR) $(ARFLAGS) $@ $(OBJS)
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
+
diff --git a/cpu/arm720t/s3c4510b/cache.c b/cpu/arm720t/s3c4510b/cache.c
new file mode 100644 (file)
index 0000000..104d287
--- /dev/null
@@ -0,0 +1,86 @@
+/*
+ * (C) Copyright 2002
+ * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
+ * Marius Groeger <mgroeger@sysgo.de>
+ *
+ * (C) Copyright 2002
+ * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
+ * Alex Zuepke <azu@sysgo.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 <common.h>
+#include <asm/hardware.h>
+
+void icache_enable (void)
+{
+       s32 i;
+
+       /* disable all cache bits */
+       CLR_REG( REG_SYSCFG, 0x3F);
+
+       /* 8KB cache, write enable */
+       SET_REG( REG_SYSCFG, CACHE_WRITE_BUFF | CACHE_MODE_01);
+
+       /* clear TAG RAM bits */
+       for ( i = 0; i < 256; i++)
+         PUT_REG( CACHE_TAG_RAM + 4*i, 0x00000000);
+
+       /* clear SET0 RAM */
+       for(i=0; i < 1024; i++)
+         PUT_REG( CACHE_SET0_RAM + 4*i, 0x00000000);
+
+       /* clear SET1 RAM */
+       for(i=0; i < 1024; i++)
+         PUT_REG( CACHE_SET1_RAM + 4*i, 0x00000000);
+
+       /* enable cache */
+       SET_REG( REG_SYSCFG, CACHE_ENABLE);
+
+}
+
+void icache_disable (void)
+{
+       /* disable all cache bits */
+       CLR_REG( REG_SYSCFG, 0x3F);
+}
+
+int icache_status (void)
+{
+       return GET_REG( REG_SYSCFG) & CACHE_ENABLE;
+}
+
+void dcache_enable (void)
+{
+       /* we don't have seperate instruction/data caches */
+       icache_enable();
+}
+
+void dcache_disable (void)
+{
+       /* we don't have seperate instruction/data caches */
+       icache_disable();
+}
+
+int dcache_status (void)
+{
+       /* we don't have seperate instruction/data caches */
+       return icache_status();
+}
diff --git a/cpu/arm720t/serial.c b/cpu/arm720t/serial.c
deleted file mode 100644 (file)
index 54a9b31..0000000
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * (C) Copyright 2002-2004
- * Wolfgang Denk, DENX Software Engineering, <wd@denx.de>
- *
- * (C) Copyright 2002
- * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
- * Marius Groeger <mgroeger@sysgo.de>
- *
- * (C) Copyright 2002
- * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
- * Alex Zuepke <azu@sysgo.de>
- *
- * Copyright (C) 1999 2000 2001 Erik Mouw (J.A.K.Mouw@its.tudelft.nl)
- *
- * 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 <common.h>
-
-#if defined(CONFIG_IMPA7) || defined(CONFIG_EP7312) || defined(CONFIG_ARMADILLO)
-
-#include <clps7111.h>
-
-DECLARE_GLOBAL_DATA_PTR;
-
-void serial_setbrg (void)
-{
-       unsigned int reg = 0;
-
-       switch (gd->baudrate) {
-       case   1200:    reg = 191;      break;
-       case   9600:    reg =  23;      break;
-       case  19200:    reg =  11;      break;
-       case  38400:    reg =   5;      break;
-       case  57600:    reg =   3;      break;
-       case 115200:    reg =   1;      break;
-       default:        hang ();        break;
-       }
-
-       /* init serial serial 1,2 */
-       IO_SYSCON1 = SYSCON1_UART1EN;
-       IO_SYSCON2 = SYSCON2_UART2EN;
-
-       reg |= UBRLCR_WRDLEN8;
-
-       IO_UBRLCR1 = reg;
-       IO_UBRLCR2 = reg;
-}
-
-
-/*
- * Initialise the serial port with the given baudrate. The settings
- * are always 8 data bits, no parity, 1 stop bit, no start bits.
- *
- */
-int serial_init (void)
-{
-       serial_setbrg ();
-
-       return (0);
-}
-
-
-/*
- * Output a single byte to the serial port.
- */
-void serial_putc (const char c)
-{
-       int tmo;
-
-       /* If \n, also do \r */
-       if (c == '\n')
-               serial_putc ('\r');
-
-       tmo = get_timer (0) + 1 * CONFIG_SYS_HZ;
-       while (IO_SYSFLG1 & SYSFLG1_UTXFF)
-               if (get_timer (0) > tmo)
-                       break;
-
-       IO_UARTDR1 = c;
-}
-
-/*
- * Read a single byte from the serial port. Returns 1 on success, 0
- * otherwise. When the function is succesfull, the character read is
- * written into its argument c.
- */
-int serial_tstc (void)
-{
-       return !(IO_SYSFLG1 & SYSFLG1_URXFE);
-}
-
-/*
- * Read a single byte from the serial port. Returns 1 on success, 0
- * otherwise. When the function is succesfull, the character read is
- * written into its argument c.
- */
-int serial_getc (void)
-{
-       while (IO_SYSFLG1 & SYSFLG1_URXFE);
-
-       return IO_UARTDR1 & 0xff;
-}
-
-void
-serial_puts (const char *s)
-{
-       while (*s) {
-               serial_putc (*s++);
-       }
-}
-
-#elif defined(CONFIG_LPC2292)
-
-DECLARE_GLOBAL_DATA_PTR;
-
-#include <asm/arch/hardware.h>
-
-void serial_setbrg (void)
-{
-       unsigned short divisor = 0;
-
-       switch (gd->baudrate) {
-       case   1200:    divisor = 3072; break;
-       case   9600:    divisor =  384; break;
-       case  19200:    divisor =  192; break;
-       case  38400:    divisor =   96; break;
-       case  57600:    divisor =   64; break;
-       case 115200:    divisor =   32; break;
-       default:        hang ();        break;
-       }
-
-       /* init serial UART0 */
-       PUT8(U0LCR, 0);
-       PUT8(U0IER, 0);
-       PUT8(U0LCR, 0x80);      /* DLAB=1 */
-       PUT8(U0DLL, (unsigned char)(divisor & 0x00FF));
-       PUT8(U0DLM, (unsigned char)(divisor >> 8));
-       PUT8(U0LCR, 0x03);      /* 8N1, DLAB=0  */
-       PUT8(U0FCR, 1);         /* Enable RX and TX FIFOs */
-}
-
-int serial_init (void)
-{
-       unsigned long pinsel0;
-
-       serial_setbrg ();
-
-       pinsel0 = GET32(PINSEL0);
-       pinsel0 &= ~(0x00000003);
-       pinsel0 |= 5;
-       PUT32(PINSEL0, pinsel0);
-
-       return (0);
-}
-
-void serial_putc (const char c)
-{
-       if (c == '\n')
-       {
-               while((GET8(U0LSR) & (1<<5)) == 0); /* Wait for empty U0THR */
-               PUT8(U0THR, '\r');
-       }
-
-       while((GET8(U0LSR) & (1<<5)) == 0); /* Wait for empty U0THR */
-       PUT8(U0THR, c);
-}
-
-int serial_getc (void)
-{
-       while((GET8(U0LSR) & 1) == 0);
-       return GET8(U0RBR);
-}
-
-void
-serial_puts (const char *s)
-{
-       while (*s) {
-               serial_putc (*s++);
-       }
-}
-
-/* Test if there is a byte to read */
-int serial_tstc (void)
-{
-       return (GET8(U0LSR) & 1);
-}
-
-#endif
diff --git a/cpu/arm720t/serial_netarm.c b/cpu/arm720t/serial_netarm.c
deleted file mode 100644 (file)
index 1a1b2db..0000000
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * Serial Port stuff - taken from Linux
- *
- * (C) Copyright 2002
- * MAZeT GmbH <www.mazet.de>
- * Stephan Linz <linz@mazet.de>, <linz@li-pro.net>
- *
- * (c) 2004
- * IMMS gGmbH <www.imms.de>
- * Thomas Elste <info@elste.org>
- *
- * 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 <common.h>
-
-#ifdef CONFIG_NETARM
-
-#include <asm/hardware.h>
-
-DECLARE_GLOBAL_DATA_PTR;
-
-#define PORTA  (*(volatile unsigned int *)(NETARM_GEN_MODULE_BASE + NETARM_GEN_PORTA))
-#if !defined(CONFIG_NETARM_NS7520)
-#define PORTB  (*(volatile unsigned int *)(NETARM_GEN_MODULE_BASE + NETARM_GEN_PORTB))
-#else
-#define PORTC  (*(volatile unsigned int *)(NETARM_GEN_MODULE_BASE + NETARM_GEN_PORTC))
-#endif
-
-/* wait until transmitter is ready for another character */
-#define TXWAITRDY(registers)                                                   \
-{                                                                              \
-       ulong tmo = get_timer(0) + 1 * CONFIG_SYS_HZ;                                   \
-       while (((registers)->status_a & NETARM_SER_STATA_TX_RDY) == 0 ) {       \
-               if (get_timer(0) > tmo)                                         \
-                       break;                                                  \
-       }                                                                       \
-}
-
-
-#ifndef CONFIG_UART1_CONSOLE
-volatile netarm_serial_channel_t *serial_reg_ch1 = get_serial_channel(0);
-volatile netarm_serial_channel_t *serial_reg_ch2 = get_serial_channel(1);
-#else
-volatile netarm_serial_channel_t *serial_reg_ch1 = get_serial_channel(1);
-volatile netarm_serial_channel_t *serial_reg_ch2 = get_serial_channel(0);
-#endif
-
-extern void _netarm_led_FAIL1(void);
-
-/*
- * Setup both serial i/f with given baudrate
- */
-void serial_setbrg (void)
-{
-       /* set 0 ... make sure pins are configured for serial */
-#if !defined(CONFIG_NETARM_NS7520)
-       PORTA = PORTB =
-               NETARM_GEN_PORT_MODE (0xef) | NETARM_GEN_PORT_DIR (0xe0);
-#else
-       PORTA = NETARM_GEN_PORT_MODE (0xef) | NETARM_GEN_PORT_DIR (0xe0);
-       PORTC = NETARM_GEN_PORT_CSF (0xef) | NETARM_GEN_PORT_MODE (0xef) | NETARM_GEN_PORT_DIR (0xe0);
-#endif
-
-       /* first turn em off */
-       serial_reg_ch1->ctrl_a = serial_reg_ch2->ctrl_a = 0;
-
-       /* clear match register, we don't need it */
-       serial_reg_ch1->rx_match = serial_reg_ch2->rx_match = 0;
-
-       /* setup bit rate generator and rx buffer gap timer (1 byte only) */
-       if ((gd->baudrate >= MIN_BAUD_RATE)
-           && (gd->baudrate <= MAX_BAUD_RATE)) {
-               serial_reg_ch1->bitrate = serial_reg_ch2->bitrate =
-                       NETARM_SER_BR_X16 (gd->baudrate);
-               serial_reg_ch1->rx_buf_timer = serial_reg_ch2->rx_buf_timer =
-                       0;
-               serial_reg_ch1->rx_char_timer = serial_reg_ch2->rx_char_timer =
-                       NETARM_SER_RXGAP (gd->baudrate);
-       } else {
-               hang ();
-       }
-
-       /* setup port mode */
-       serial_reg_ch1->ctrl_b = serial_reg_ch2->ctrl_b =
-               ( NETARM_SER_CTLB_RCGT_EN |
-                 NETARM_SER_CTLB_UART_MODE);
-       serial_reg_ch1->ctrl_a = serial_reg_ch2->ctrl_a =
-               ( NETARM_SER_CTLA_ENABLE |
-                 NETARM_SER_CTLA_P_NONE |
-                 /* see errata */
-                 NETARM_SER_CTLA_2STOP |
-                 NETARM_SER_CTLA_8BITS |
-                 NETARM_SER_CTLA_DTR_EN |
-                 NETARM_SER_CTLA_RTS_EN);
-}
-
-
-/*
- * Initialise the serial port with the given baudrate. The settings
- * are always 8 data bits, no parity, 1 stop bit, no start bits.
- */
-int serial_init (void)
-{
-       serial_setbrg ();
-       return 0;
-}
-
-
-/*
- * Output a single byte to the serial port.
- */
-void serial_putc (const char c)
-{
-       volatile unsigned char *fifo;
-
-       /* If \n, also do \r */
-       if (c == '\n')
-               serial_putc ('\r');
-
-       fifo = (volatile unsigned char *) &(serial_reg_ch1->fifo);
-       TXWAITRDY (serial_reg_ch1);
-       *fifo = c;
-}
-
-/*
- * Test of a single byte from the serial port. Returns 1 on success, 0
- * otherwise.
- */
-int serial_tstc(void)
-{
-       return serial_reg_ch1->status_a & NETARM_SER_STATA_RX_RDY;
-}
-
-/*
- * Read a single byte from the serial port. Returns 1 on success, 0
- * otherwise.
- */
-int serial_getc (void)
-{
-       unsigned int ch_uint;
-       volatile unsigned int *fifo;
-       volatile unsigned char *fifo_char = NULL;
-       int buf_count = 0;
-
-       while (!(serial_reg_ch1->status_a & NETARM_SER_STATA_RX_RDY))
-               /* NOP */ ;
-
-       fifo = (volatile unsigned int *) &(serial_reg_ch1->fifo);
-       fifo_char = (unsigned char *) &ch_uint;
-       ch_uint = *fifo;
-
-       buf_count = NETARM_SER_STATA_RXFDB (serial_reg_ch1->status_a);
-       switch (buf_count) {
-       case NETARM_SER_STATA_RXFDB_4BYTES:
-               buf_count = 4;
-               break;
-       case NETARM_SER_STATA_RXFDB_3BYTES:
-               buf_count = 3;
-               break;
-       case NETARM_SER_STATA_RXFDB_2BYTES:
-               buf_count = 2;
-               break;
-       case NETARM_SER_STATA_RXFDB_1BYTES:
-               buf_count = 1;
-               break;
-       default:
-               /* panic, be never here */
-               break;
-       }
-
-       serial_reg_ch1->status_a |= NETARM_SER_STATA_RX_CLOSED;
-
-       return ch_uint & 0xff;
-}
-
-void serial_puts (const char *s)
-{
-       while (*s) {
-               serial_putc (*s++);
-       }
-}
-
-#endif /* CONFIG_NETARM */
index 9207ec1bcb33b06ade146a222778816d991642ed..d3352deb4b67539c08b2666824885159de2ad9ff 100644 (file)
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB    = $(obj)lib$(SOC).a
 
-COBJS  = generic.o interrupts.o serial.o speed.o
+COBJS  = generic.o interrupts.o speed.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
diff --git a/cpu/arm920t/imx/serial.c b/cpu/arm920t/imx/serial.c
deleted file mode 100644 (file)
index 85f1167..0000000
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
- * (c) 2004 Sascha Hauer <sascha@saschahauer.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 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 <common.h>
-#if defined (CONFIG_IMX)
-
-#include <asm/arch/imx-regs.h>
-
-#ifndef CONFIG_IMX_SERIAL_NONE
-
-#if defined CONFIG_IMX_SERIAL1
-#define UART_BASE IMX_UART1_BASE
-#elif defined CONFIG_IMX_SERIAL2
-#define UART_BASE IMX_UART2_BASE
-#else
-#error "define CONFIG_IMX_SERIAL1, CONFIG_IMX_SERIAL2 or CONFIG_IMX_SERIAL_NONE"
-#endif
-
-struct imx_serial {
-       volatile uint32_t urxd[16];
-       volatile uint32_t utxd[16];
-       volatile uint32_t ucr1;
-       volatile uint32_t ucr2;
-       volatile uint32_t ucr3;
-       volatile uint32_t ucr4;
-       volatile uint32_t ufcr;
-       volatile uint32_t usr1;
-       volatile uint32_t usr2;
-       volatile uint32_t uesc;
-       volatile uint32_t utim;
-       volatile uint32_t ubir;
-       volatile uint32_t ubmr;
-       volatile uint32_t ubrc;
-       volatile uint32_t bipr[4];
-       volatile uint32_t bmpr[4];
-       volatile uint32_t uts;
-};
-
-DECLARE_GLOBAL_DATA_PTR;
-
-void serial_setbrg (void)
-{
-       serial_init();
-}
-
-extern void imx_gpio_mode(int gpio_mode);
-
-/*
- * Initialise the serial port with the given baudrate. The settings
- * are always 8 data bits, no parity, 1 stop bit, no start bits.
- *
- */
-int serial_init (void)
-{
-       volatile struct imx_serial* base = (struct imx_serial *)UART_BASE;
-       unsigned int ufcr_rfdiv;
-       unsigned int refclk;
-
-#ifdef CONFIG_IMX_SERIAL1
-       imx_gpio_mode(PC11_PF_UART1_TXD);
-       imx_gpio_mode(PC12_PF_UART1_RXD);
-#else
-       imx_gpio_mode(PB30_PF_UART2_TXD);
-       imx_gpio_mode(PB31_PF_UART2_RXD);
-#endif
-
-       /* Disable UART */
-       base->ucr1 &= ~UCR1_UARTEN;
-
-       /* Set to default POR state */
-
-       base->ucr1 = 0x00000004;
-       base->ucr2 = 0x00000000;
-       base->ucr3 = 0x00000000;
-       base->ucr4 = 0x00008040;
-       base->uesc = 0x0000002B;
-       base->utim = 0x00000000;
-       base->ubir = 0x00000000;
-       base->ubmr = 0x00000000;
-       base->uts  = 0x00000000;
-       /* Set clocks */
-       base->ucr4 |= UCR4_REF16;
-
-       /* Configure FIFOs */
-       base->ufcr = 0xa81;
-
-       /* set the baud rate.
-        *
-        * baud * 16   x
-        * --------- = -
-        *  refclk     y
-        *
-        * x - 1 = UBIR
-        * y - 1 = UBMR
-        *
-        * each register is 16 bits wide. refclk max is 96 MHz
-        *
-        */
-
-       ufcr_rfdiv = ((base->ufcr) & UFCR_RFDIV) >> 7;
-       if (ufcr_rfdiv == 6)
-               ufcr_rfdiv = 7;
-       else
-               ufcr_rfdiv = 6 - ufcr_rfdiv;
-
-       refclk = get_PERCLK1();
-       refclk /= ufcr_rfdiv;
-
-       /* Set the numerator value minus one of the BRM ratio */
-       base->ubir = (gd->baudrate / 100) - 1;
-
-       /* Set the denominator value minus one of the BRM ratio */
-       base->ubmr = (refclk/(16 * 100)) - 1;
-
-       /* Set to 8N1 */
-       base->ucr2 &= ~UCR2_PREN;
-       base->ucr2 |= UCR2_WS;
-       base->ucr2 &= ~UCR2_STPB;
-
-       /* Ignore RTS */
-       base->ucr2 |= UCR2_IRTS;
-
-       /* Enable UART */
-       base->ucr1 |= UCR1_UARTEN | UCR1_UARTCLKEN;
-
-       /* Enable FIFOs */
-       base->ucr2 |= UCR2_SRST | UCR2_RXEN | UCR2_TXEN;
-
-       /* Clear status flags */
-       base->usr2 |= USR2_ADET  |
-                     USR2_DTRF  |
-                     USR2_IDLE  |
-                     USR2_IRINT |
-                     USR2_WAKE  |
-                     USR2_RTSF  |
-                     USR2_BRCD  |
-                     USR2_ORE;
-
-       /* Clear status flags */
-       base->usr1 |= USR1_PARITYERR |
-                     USR1_RTSD      |
-                     USR1_ESCF      |
-                     USR1_FRAMERR   |
-                     USR1_AIRINT    |
-                     USR1_AWAKE;
-       return (0);
-}
-
-/*
- * Read a single byte from the serial port. Returns 1 on success, 0
- * otherwise. When the function is successful, the character read is
- * written into its argument c.
- */
-int serial_getc (void)
-{
-       volatile struct imx_serial* base = (struct imx_serial *)UART_BASE;
-       unsigned char ch;
-
-       while(base->uts & UTS_RXEMPTY);
-
-       ch = (char)base->urxd[0];
-
-       return ch;
-}
-
-#ifdef CONFIG_HWFLOW
-static int hwflow = 0; /* turned off by default */
-int hwflow_onoff(int on)
-{
-}
-#endif
-
-/*
- * Output a single byte to the serial port.
- */
-void serial_putc (const char c)
-{
-       volatile struct imx_serial* base = (struct imx_serial *)UART_BASE;
-
-       /* Wait for Tx FIFO not full */
-       while (base->uts & UTS_TXFULL);
-
-       base->utxd[0] = c;
-
-       /* If \n, also do \r */
-       if (c == '\n')
-               serial_putc ('\r');
-}
-
-/*
- * Test whether a character is in the RX buffer
- */
-int serial_tstc (void)
-{
-       volatile struct imx_serial* base = (struct imx_serial *)UART_BASE;
-
-       /* If receive fifo is empty, return false */
-       if (base->uts & UTS_RXEMPTY)
-               return 0;
-       return 1;
-}
-
-void
-serial_puts (const char *s)
-{
-       while (*s) {
-               serial_putc (*s++);
-       }
-}
-#endif /* CONFIG_IMX_SERIAL_NONE */
-#endif /* defined CONFIG_IMX */
index 7db9473524a208c04d838c2d9c561ab374656984..f6b006300b120efa2128ae35e224a1ba8d3c247a 100644 (file)
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB    = $(obj)lib$(SOC).a
 
-COBJS  = interrupts.o serial.o
+COBJS  = interrupts.o
 SOBJS  = lowlevel_init.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
diff --git a/cpu/arm920t/ks8695/serial.c b/cpu/arm920t/ks8695/serial.c
deleted file mode 100644 (file)
index aacd1be..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * serial.c -- KS8695 serial driver
- *
- * (C) Copyright 2004, Greg Ungerer <greg.ungerer@opengear.com>
- *
- * 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 <common.h>
-#include <asm/arch/platform.h>
-
-#ifndef CONFIG_SERIAL1
-#error "Bad: you didn't configure serial ..."
-#endif
-
-DECLARE_GLOBAL_DATA_PTR;
-
-/*
- *     Define the UART hardware register access structure.
- */
-struct ks8695uart {
-       unsigned int    RX;             /* 0x00 - Receive data (r) */
-       unsigned int    TX;             /* 0x04 - Transmit data (w) */
-       unsigned int    FCR;            /* 0x08 - Fifo Control (r/w) */
-       unsigned int    LCR;            /* 0x0c - Line Control (r/w) */
-       unsigned int    MCR;            /* 0x10 - Modem Control (r/w) */
-       unsigned int    LSR;            /* 0x14 - Line Status (r/w) */
-       unsigned int    MSR;            /* 0x18 - Modem Status (r/w) */
-       unsigned int    BD;             /* 0x1c - Baud Rate (r/w) */
-       unsigned int    SR;             /* 0x20 - Status (r/w) */
-};
-
-#define        KS8695_UART_ADDR        ((void *) (KS8695_IO_BASE + KS8695_UART_RX_BUFFER))
-#define        KS8695_UART_CLK         25000000
-
-
-/*
- * Under some circumstances we want to be "quiet" and not issue any
- * serial output - though we want u-boot to otherwise work and behave
- * the same. By default be noisy.
- */
-int serial_console = 1;
-
-
-void serial_setbrg(void)
-{
-       volatile struct ks8695uart *uartp = KS8695_UART_ADDR;
-
-       /* Set to global baud rate and 8 data bits, no parity, 1 stop bit*/
-       uartp->BD = KS8695_UART_CLK / gd->baudrate;
-       uartp->LCR = KS8695_UART_LINEC_WLEN8;
-}
-
-int serial_init(void)
-{
-       serial_console = 1;
-       serial_setbrg();
-       return 0;
-}
-
-void serial_raw_putc(const char c)
-{
-       volatile struct ks8695uart *uartp = KS8695_UART_ADDR;
-       int i;
-
-       for (i = 0; (i < 0x100000); i++) {
-               if (uartp->LSR & KS8695_UART_LINES_TXFE)
-                       break;
-       }
-
-       uartp->TX = c;
-}
-
-void serial_putc(const char c)
-{
-       if (serial_console) {
-               serial_raw_putc(c);
-               if (c == '\n')
-                       serial_raw_putc('\r');
-       }
-}
-
-int serial_tstc(void)
-{
-       volatile struct ks8695uart *uartp = KS8695_UART_ADDR;
-       if (serial_console)
-               return ((uartp->LSR & KS8695_UART_LINES_RXFE) ? 1 : 0);
-       return 0;
-}
-
-void serial_puts(const char *s)
-{
-       char c;
-       while ((c = *s++) != 0)
-               serial_putc(c);
-}
-
-int serial_getc(void)
-{
-       volatile struct ks8695uart *uartp = KS8695_UART_ADDR;
-
-       while ((uartp->LSR & KS8695_UART_LINES_RXFE) == 0)
-               ;
-       return (uartp->RX);
-}
index 676492025ae81b6abc8f7e5576d787f2a4dec259..3afe19ce9c76e26c91f29a30cd611019a8329ad3 100644 (file)
@@ -25,8 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB    = $(obj)lib$(SOC).a
 
-COBJS  = i2c.o interrupts.o serial.o speed.o \
-         usb.o usb_ohci.o nand.o
+COBJS  = interrupts.o speed.o usb.o usb_ohci.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
diff --git a/cpu/arm920t/s3c24x0/i2c.c b/cpu/arm920t/s3c24x0/i2c.c
deleted file mode 100644 (file)
index fba5cd1..0000000
+++ /dev/null
@@ -1,447 +0,0 @@
-/*
- * (C) Copyright 2002
- * David Mueller, ELSOFT AG, d.mueller@elsoft.ch
- *
- * 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
- */
-
-/* This code should work for both the S3C2400 and the S3C2410
- * as they seem to have the same I2C controller inside.
- * The different address mapping is handled by the s3c24xx.h files below.
- */
-
-#include <common.h>
-
-#ifdef CONFIG_DRIVER_S3C24X0_I2C
-
-#if defined(CONFIG_S3C2400)
-#include <s3c2400.h>
-#elif defined(CONFIG_S3C2410)
-#include <s3c2410.h>
-#endif
-#include <i2c.h>
-
-#ifdef CONFIG_HARD_I2C
-
-#define        I2C_WRITE       0
-#define I2C_READ       1
-
-#define I2C_OK         0
-#define I2C_NOK                1
-#define I2C_NACK       2
-#define I2C_NOK_LA     3               /* Lost arbitration */
-#define I2C_NOK_TOUT   4               /* time out */
-
-#define I2CSTAT_BSY    0x20            /* Busy bit */
-#define I2CSTAT_NACK   0x01            /* Nack bit */
-#define I2CCON_IRPND   0x10            /* Interrupt pending bit */
-#define I2C_MODE_MT    0xC0            /* Master Transmit Mode */
-#define I2C_MODE_MR    0x80            /* Master Receive Mode */
-#define I2C_START_STOP 0x20            /* START / STOP */
-#define I2C_TXRX_ENA   0x10            /* I2C Tx/Rx enable */
-
-#define I2C_TIMEOUT 1                  /* 1 second */
-
-
-static int GetI2CSDA(void)
-{
-       S3C24X0_GPIO * const gpio = S3C24X0_GetBase_GPIO();
-
-#ifdef CONFIG_S3C2410
-       return (gpio->GPEDAT & 0x8000) >> 15;
-#endif
-#ifdef CONFIG_S3C2400
-       return (gpio->PGDAT & 0x0020) >> 5;
-#endif
-}
-
-#if 0
-static void SetI2CSDA(int x)
-{
-       rGPEDAT = (rGPEDAT & ~0x8000) | (x&1) << 15;
-}
-#endif
-
-static void SetI2CSCL(int x)
-{
-       S3C24X0_GPIO * const gpio = S3C24X0_GetBase_GPIO();
-
-#ifdef CONFIG_S3C2410
-       gpio->GPEDAT = (gpio->GPEDAT & ~0x4000) | (x&1) << 14;
-#endif
-#ifdef CONFIG_S3C2400
-       gpio->PGDAT = (gpio->PGDAT & ~0x0040) | (x&1) << 6;
-#endif
-}
-
-
-static int WaitForXfer (void)
-{
-       S3C24X0_I2C *const i2c = S3C24X0_GetBase_I2C ();
-       int i, status;
-
-       i = I2C_TIMEOUT * 10000;
-       status = i2c->IICCON;
-       while ((i > 0) && !(status & I2CCON_IRPND)) {
-               udelay (100);
-               status = i2c->IICCON;
-               i--;
-       }
-
-       return (status & I2CCON_IRPND) ? I2C_OK : I2C_NOK_TOUT;
-}
-
-static int IsACK (void)
-{
-       S3C24X0_I2C *const i2c = S3C24X0_GetBase_I2C ();
-
-       return (!(i2c->IICSTAT & I2CSTAT_NACK));
-}
-
-static void ReadWriteByte (void)
-{
-       S3C24X0_I2C *const i2c = S3C24X0_GetBase_I2C ();
-
-       i2c->IICCON &= ~I2CCON_IRPND;
-}
-
-void i2c_init (int speed, int slaveadd)
-{
-       S3C24X0_I2C *const i2c = S3C24X0_GetBase_I2C ();
-       S3C24X0_GPIO *const gpio = S3C24X0_GetBase_GPIO ();
-       ulong freq, pres = 16, div;
-       int i, status;
-
-       /* wait for some time to give previous transfer a chance to finish */
-
-       i = I2C_TIMEOUT * 1000;
-       status = i2c->IICSTAT;
-       while ((i > 0) && (status & I2CSTAT_BSY)) {
-               udelay (1000);
-               status = i2c->IICSTAT;
-               i--;
-       }
-
-       if ((status & I2CSTAT_BSY) || GetI2CSDA () == 0) {
-#ifdef CONFIG_S3C2410
-               ulong old_gpecon = gpio->GPECON;
-#endif
-#ifdef CONFIG_S3C2400
-               ulong old_gpecon = gpio->PGCON;
-#endif
-               /* bus still busy probably by (most) previously interrupted transfer */
-
-#ifdef CONFIG_S3C2410
-               /* set I2CSDA and I2CSCL (GPE15, GPE14) to GPIO */
-               gpio->GPECON = (gpio->GPECON & ~0xF0000000) | 0x10000000;
-#endif
-#ifdef CONFIG_S3C2400
-               /* set I2CSDA and I2CSCL (PG5, PG6) to GPIO */
-               gpio->PGCON = (gpio->PGCON & ~0x00003c00) | 0x00001000;
-#endif
-
-               /* toggle I2CSCL until bus idle */
-               SetI2CSCL (0);
-               udelay (1000);
-               i = 10;
-               while ((i > 0) && (GetI2CSDA () != 1)) {
-                       SetI2CSCL (1);
-                       udelay (1000);
-                       SetI2CSCL (0);
-                       udelay (1000);
-                       i--;
-               }
-               SetI2CSCL (1);
-               udelay (1000);
-
-               /* restore pin functions */
-#ifdef CONFIG_S3C2410
-               gpio->GPECON = old_gpecon;
-#endif
-#ifdef CONFIG_S3C2400
-               gpio->PGCON = old_gpecon;
-#endif
-       }
-
-       /* calculate prescaler and divisor values */
-       freq = get_PCLK ();
-       if ((freq / pres / (16 + 1)) > speed)
-               /* set prescaler to 512 */
-               pres = 512;
-
-       div = 0;
-       while ((freq / pres / (div + 1)) > speed)
-               div++;
-
-       /* set prescaler, divisor according to freq, also set
-        * ACKGEN, IRQ */
-       i2c->IICCON = (div & 0x0F) | 0xA0 | ((pres == 512) ? 0x40 : 0);
-
-       /* init to SLAVE REVEIVE and set slaveaddr */
-       i2c->IICSTAT = 0;
-       i2c->IICADD = slaveadd;
-       /* program Master Transmit (and implicit STOP) */
-       i2c->IICSTAT = I2C_MODE_MT | I2C_TXRX_ENA;
-
-}
-
-/*
- * cmd_type is 0 for write, 1 for read.
- *
- * addr_len can take any value from 0-255, it is only limited
- * by the char, we could make it larger if needed. If it is
- * 0 we skip the address write cycle.
- */
-static
-int i2c_transfer (unsigned char cmd_type,
-                 unsigned char chip,
-                 unsigned char addr[],
-                 unsigned char addr_len,
-                 unsigned char data[], unsigned short data_len)
-{
-       S3C24X0_I2C *const i2c = S3C24X0_GetBase_I2C ();
-       int i, status, result;
-
-       if (data == 0 || data_len == 0) {
-               /*Don't support data transfer of no length or to address 0 */
-               printf ("i2c_transfer: bad call\n");
-               return I2C_NOK;
-       }
-
-       /* Check I2C bus idle */
-       i = I2C_TIMEOUT * 1000;
-       status = i2c->IICSTAT;
-       while ((i > 0) && (status & I2CSTAT_BSY)) {
-               udelay (1000);
-               status = i2c->IICSTAT;
-               i--;
-       }
-
-       if (status & I2CSTAT_BSY)
-               return I2C_NOK_TOUT;
-
-       i2c->IICCON |= 0x80;
-       result = I2C_OK;
-
-       switch (cmd_type) {
-       case I2C_WRITE:
-               if (addr && addr_len) {
-                       i2c->IICDS = chip;
-                       /* send START */
-                       i2c->IICSTAT = I2C_MODE_MT | I2C_TXRX_ENA | I2C_START_STOP;
-                       i = 0;
-                       while ((i < addr_len) && (result == I2C_OK)) {
-                               result = WaitForXfer ();
-                               i2c->IICDS = addr[i];
-                               ReadWriteByte ();
-                               i++;
-                       }
-                       i = 0;
-                       while ((i < data_len) && (result == I2C_OK)) {
-                               result = WaitForXfer ();
-                               i2c->IICDS = data[i];
-                               ReadWriteByte ();
-                               i++;
-                       }
-               } else {
-                       i2c->IICDS = chip;
-                       /* send START */
-                       i2c->IICSTAT = I2C_MODE_MT | I2C_TXRX_ENA | I2C_START_STOP;
-                       i = 0;
-                       while ((i < data_len) && (result = I2C_OK)) {
-                               result = WaitForXfer ();
-                               i2c->IICDS = data[i];
-                               ReadWriteByte ();
-                               i++;
-                       }
-               }
-
-               if (result == I2C_OK)
-                       result = WaitForXfer ();
-
-               /* send STOP */
-               i2c->IICSTAT = I2C_MODE_MR | I2C_TXRX_ENA;
-               ReadWriteByte ();
-               break;
-
-       case I2C_READ:
-               if (addr && addr_len) {
-                       i2c->IICSTAT = I2C_MODE_MT | I2C_TXRX_ENA;
-                       i2c->IICDS = chip;
-                       /* send START */
-                       i2c->IICSTAT |= I2C_START_STOP;
-                       result = WaitForXfer ();
-                       if (IsACK ()) {
-                               i = 0;
-                               while ((i < addr_len) && (result == I2C_OK)) {
-                                       i2c->IICDS = addr[i];
-                                       ReadWriteByte ();
-                                       result = WaitForXfer ();
-                                       i++;
-                               }
-
-                               i2c->IICDS = chip;
-                               /* resend START */
-                               i2c->IICSTAT =  I2C_MODE_MR | I2C_TXRX_ENA |
-                                               I2C_START_STOP;
-                               ReadWriteByte ();
-                               result = WaitForXfer ();
-                               i = 0;
-                               while ((i < data_len) && (result == I2C_OK)) {
-                                       /* disable ACK for final READ */
-                                       if (i == data_len - 1)
-                                               i2c->IICCON &= ~0x80;
-                                       ReadWriteByte ();
-                                       result = WaitForXfer ();
-                                       data[i] = i2c->IICDS;
-                                       i++;
-                               }
-                       } else {
-                               result = I2C_NACK;
-                       }
-
-               } else {
-                       i2c->IICSTAT = I2C_MODE_MR | I2C_TXRX_ENA;
-                       i2c->IICDS = chip;
-                       /* send START */
-                       i2c->IICSTAT |= I2C_START_STOP;
-                       result = WaitForXfer ();
-
-                       if (IsACK ()) {
-                               i = 0;
-                               while ((i < data_len) && (result == I2C_OK)) {
-                                       /* disable ACK for final READ */
-                                       if (i == data_len - 1)
-                                               i2c->IICCON &= ~0x80;
-                                       ReadWriteByte ();
-                                       result = WaitForXfer ();
-                                       data[i] = i2c->IICDS;
-                                       i++;
-                               }
-                       } else {
-                               result = I2C_NACK;
-                       }
-               }
-
-               /* send STOP */
-               i2c->IICSTAT = I2C_MODE_MR | I2C_TXRX_ENA;
-               ReadWriteByte ();
-               break;
-
-       default:
-               printf ("i2c_transfer: bad call\n");
-               result = I2C_NOK;
-               break;
-       }
-
-       return (result);
-}
-
-int i2c_probe (uchar chip)
-{
-       uchar buf[1];
-
-       buf[0] = 0;
-
-       /*
-        * What is needed is to send the chip address and verify that the
-        * address was <ACK>ed (i.e. there was a chip at that address which
-        * drove the data line low).
-        */
-       return (i2c_transfer (I2C_READ, chip << 1, 0, 0, buf, 1) != I2C_OK);
-}
-
-int i2c_read (uchar chip, uint addr, int alen, uchar * buffer, int len)
-{
-       uchar xaddr[4];
-       int ret;
-
-       if (alen > 4) {
-               printf ("I2C read: addr len %d not supported\n", alen);
-               return 1;
-       }
-
-       if (alen > 0) {
-               xaddr[0] = (addr >> 24) & 0xFF;
-               xaddr[1] = (addr >> 16) & 0xFF;
-               xaddr[2] = (addr >> 8) & 0xFF;
-               xaddr[3] = addr & 0xFF;
-       }
-
-#ifdef CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW
-       /*
-        * EEPROM chips that implement "address overflow" are ones
-        * like Catalyst 24WC04/08/16 which has 9/10/11 bits of
-        * address and the extra bits end up in the "chip address"
-        * bit slots. This makes a 24WC08 (1Kbyte) chip look like
-        * four 256 byte chips.
-        *
-        * Note that we consider the length of the address field to
-        * still be one byte because the extra address bits are
-        * hidden in the chip address.
-        */
-       if (alen > 0)
-               chip |= ((addr >> (alen * 8)) & CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW);
-#endif
-       if ((ret =
-            i2c_transfer (I2C_READ, chip << 1, &xaddr[4 - alen], alen,
-                          buffer, len)) != 0) {
-               printf ("I2c read: failed %d\n", ret);
-               return 1;
-       }
-       return 0;
-}
-
-int i2c_write (uchar chip, uint addr, int alen, uchar * buffer, int len)
-{
-       uchar xaddr[4];
-
-       if (alen > 4) {
-               printf ("I2C write: addr len %d not supported\n", alen);
-               return 1;
-       }
-
-       if (alen > 0) {
-               xaddr[0] = (addr >> 24) & 0xFF;
-               xaddr[1] = (addr >> 16) & 0xFF;
-               xaddr[2] = (addr >> 8) & 0xFF;
-               xaddr[3] = addr & 0xFF;
-       }
-#ifdef CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW
-       /*
-        * EEPROM chips that implement "address overflow" are ones
-        * like Catalyst 24WC04/08/16 which has 9/10/11 bits of
-        * address and the extra bits end up in the "chip address"
-        * bit slots. This makes a 24WC08 (1Kbyte) chip look like
-        * four 256 byte chips.
-        *
-        * Note that we consider the length of the address field to
-        * still be one byte because the extra address bits are
-        * hidden in the chip address.
-        */
-       if (alen > 0)
-               chip |= ((addr >> (alen * 8)) & CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW);
-#endif
-       return (i2c_transfer
-               (I2C_WRITE, chip << 1, &xaddr[4 - alen], alen, buffer,
-                len) != 0);
-}
-#endif /* CONFIG_HARD_I2C */
-
-#endif /* CONFIG_DRIVER_S3C24X0_I2C */
diff --git a/cpu/arm920t/s3c24x0/nand.c b/cpu/arm920t/s3c24x0/nand.c
deleted file mode 100644 (file)
index 60174fb..0000000
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * (C) Copyright 2006 OpenMoko, Inc.
- * Author: Harald Welte <laforge@openmoko.org>
- *
- * 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 <common.h>
-
-#if 0
-#define DEBUGN printf
-#else
-#define DEBUGN(x, args ...) {}
-#endif
-
-#if defined(CONFIG_CMD_NAND)
-#if !defined(CONFIG_NAND_LEGACY)
-
-#include <nand.h>
-#include <s3c2410.h>
-#include <asm/io.h>
-
-#define __REGb(x)      (*(volatile unsigned char *)(x))
-#define __REGi(x)      (*(volatile unsigned int *)(x))
-
-#define        NF_BASE         0x4e000000
-#define        NFCONF          __REGi(NF_BASE + 0x0)
-#define        NFCMD           __REGb(NF_BASE + 0x4)
-#define        NFADDR          __REGb(NF_BASE + 0x8)
-#define        NFDATA          __REGb(NF_BASE + 0xc)
-#define        NFSTAT          __REGb(NF_BASE + 0x10)
-#define NFECC0         __REGb(NF_BASE + 0x14)
-#define NFECC1         __REGb(NF_BASE + 0x15)
-#define NFECC2         __REGb(NF_BASE + 0x16)
-
-#define S3C2410_NFCONF_EN          (1<<15)
-#define S3C2410_NFCONF_512BYTE     (1<<14)
-#define S3C2410_NFCONF_4STEP       (1<<13)
-#define S3C2410_NFCONF_INITECC     (1<<12)
-#define S3C2410_NFCONF_nFCE        (1<<11)
-#define S3C2410_NFCONF_TACLS(x)    ((x)<<8)
-#define S3C2410_NFCONF_TWRPH0(x)   ((x)<<4)
-#define S3C2410_NFCONF_TWRPH1(x)   ((x)<<0)
-
-#define S3C2410_ADDR_NALE 4
-#define S3C2410_ADDR_NCLE 8
-
-static void s3c2410_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl)
-{
-       struct nand_chip *chip = mtd->priv;
-
-       DEBUGN("hwcontrol(): 0x%02x 0x%02x\n", cmd, ctrl);
-
-       if (ctrl & NAND_CTRL_CHANGE) {
-               ulong IO_ADDR_W = NF_BASE;
-
-               if (!(ctrl & NAND_CLE))
-                       IO_ADDR_W |= S3C2410_ADDR_NCLE;
-               if (!(ctrl & NAND_ALE))
-                       IO_ADDR_W |= S3C2410_ADDR_NALE;
-
-               chip->IO_ADDR_W = (void *)IO_ADDR_W;
-
-               if (ctrl & NAND_NCE)
-                       NFCONF &= ~S3C2410_NFCONF_nFCE;
-               else
-                       NFCONF |= S3C2410_NFCONF_nFCE;
-       }
-
-       if (cmd != NAND_CMD_NONE)
-               writeb(cmd, chip->IO_ADDR_W);
-}
-
-static int s3c2410_dev_ready(struct mtd_info *mtd)
-{
-       DEBUGN("dev_ready\n");
-       return (NFSTAT & 0x01);
-}
-
-#ifdef CONFIG_S3C2410_NAND_HWECC
-void s3c2410_nand_enable_hwecc(struct mtd_info *mtd, int mode)
-{
-       DEBUGN("s3c2410_nand_enable_hwecc(%p, %d)\n", mtd, mode);
-       NFCONF |= S3C2410_NFCONF_INITECC;
-}
-
-static int s3c2410_nand_calculate_ecc(struct mtd_info *mtd, const u_char *dat,
-                                     u_char *ecc_code)
-{
-       ecc_code[0] = NFECC0;
-       ecc_code[1] = NFECC1;
-       ecc_code[2] = NFECC2;
-       DEBUGN("s3c2410_nand_calculate_hwecc(%p,): 0x%02x 0x%02x 0x%02x\n",
-               mtd , ecc_code[0], ecc_code[1], ecc_code[2]);
-
-       return 0;
-}
-
-static int s3c2410_nand_correct_data(struct mtd_info *mtd, u_char *dat,
-                                    u_char *read_ecc, u_char *calc_ecc)
-{
-       if (read_ecc[0] == calc_ecc[0] &&
-           read_ecc[1] == calc_ecc[1] &&
-           read_ecc[2] == calc_ecc[2])
-               return 0;
-
-       printf("s3c2410_nand_correct_data: not implemented\n");
-       return -1;
-}
-#endif
-
-int board_nand_init(struct nand_chip *nand)
-{
-       u_int32_t cfg;
-       u_int8_t tacls, twrph0, twrph1;
-       S3C24X0_CLOCK_POWER * const clk_power = S3C24X0_GetBase_CLOCK_POWER();
-
-       DEBUGN("board_nand_init()\n");
-
-       clk_power->CLKCON |= (1 << 4);
-
-       /* initialize hardware */
-       twrph0 = 3; twrph1 = 0; tacls = 0;
-
-       cfg = S3C2410_NFCONF_EN;
-       cfg |= S3C2410_NFCONF_TACLS(tacls - 1);
-       cfg |= S3C2410_NFCONF_TWRPH0(twrph0 - 1);
-       cfg |= S3C2410_NFCONF_TWRPH1(twrph1 - 1);
-
-       NFCONF = cfg;
-
-       /* initialize nand_chip data structure */
-       nand->IO_ADDR_R = nand->IO_ADDR_W = (void *)0x4e00000c;
-
-       /* read_buf and write_buf are default */
-       /* read_byte and write_byte are default */
-
-       /* hwcontrol always must be implemented */
-       nand->cmd_ctrl = s3c2410_hwcontrol;
-
-       nand->dev_ready = s3c2410_dev_ready;
-
-#ifdef CONFIG_S3C2410_NAND_HWECC
-       nand->ecc.hwctl = s3c2410_nand_enable_hwecc;
-       nand->ecc.calculate = s3c2410_nand_calculate_ecc;
-       nand->ecc.correct = s3c2410_nand_correct_data;
-       nand->ecc.mode = NAND_ECC_HW3_512;
-#else
-       nand->ecc.mode = NAND_ECC_SOFT;
-#endif
-
-#ifdef CONFIG_S3C2410_NAND_BBT
-       nand->options = NAND_USE_FLASH_BBT;
-#else
-       nand->options = 0;
-#endif
-
-       DEBUGN("end of nand_init\n");
-
-       return 0;
-}
-
-#else
- #error "U-Boot legacy NAND support not available for S3C2410"
-#endif
-#endif
diff --git a/cpu/arm920t/s3c24x0/serial.c b/cpu/arm920t/s3c24x0/serial.c
deleted file mode 100644 (file)
index 064b998..0000000
+++ /dev/null
@@ -1,304 +0,0 @@
-/*
- * (C) Copyright 2002
- * Gary Jennejohn, DENX Software Engineering, <gj@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 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 <common.h>
-#if defined(CONFIG_S3C2400) || defined (CONFIG_S3C2410) || defined (CONFIG_TRAB)
-
-#if defined(CONFIG_S3C2400) || defined(CONFIG_TRAB)
-#include <s3c2400.h>
-#elif defined(CONFIG_S3C2410)
-#include <s3c2410.h>
-#endif
-
-DECLARE_GLOBAL_DATA_PTR;
-
-#ifdef CONFIG_SERIAL1
-#define UART_NR        S3C24X0_UART0
-
-#elif defined(CONFIG_SERIAL2)
-# if defined(CONFIG_TRAB)
-#  error "TRAB supports only CONFIG_SERIAL1"
-# endif
-#define UART_NR        S3C24X0_UART1
-
-#elif defined(CONFIG_SERIAL3)
-# if defined(CONFIG_TRAB)
-#  #error "TRAB supports only CONFIG_SERIAL1"
-# endif
-#define UART_NR        S3C24X0_UART2
-
-#else
-#error "Bad: you didn't configure serial ..."
-#endif
-
-#if defined(CONFIG_SERIAL_MULTI)
-#include <serial.h>
-
-/* Multi serial device functions */
-#define DECLARE_S3C_SERIAL_FUNCTIONS(port) \
-    int  s3serial##port##_init (void) {\
-       return serial_init_dev(port);}\
-    void s3serial##port##_setbrg (void) {\
-       serial_setbrg_dev(port);}\
-    int  s3serial##port##_getc (void) {\
-       return serial_getc_dev(port);}\
-    int  s3serial##port##_tstc (void) {\
-       return serial_tstc_dev(port);}\
-    void s3serial##port##_putc (const char c) {\
-       serial_putc_dev(port, c);}\
-    void s3serial##port##_puts (const char *s) {\
-       serial_puts_dev(port, s);}
-
-#define INIT_S3C_SERIAL_STRUCTURE(port,name,bus) {\
-       name,\
-       bus,\
-       s3serial##port##_init,\
-       s3serial##port##_setbrg,\
-       s3serial##port##_getc,\
-       s3serial##port##_tstc,\
-       s3serial##port##_putc,\
-       s3serial##port##_puts, }
-
-#endif /* CONFIG_SERIAL_MULTI */
-
-void _serial_setbrg(const int dev_index)
-{
-       S3C24X0_UART * const uart = S3C24X0_GetBase_UART(dev_index);
-       unsigned int reg = 0;
-       int i;
-
-       /* value is calculated so : (int)(PCLK/16./baudrate) -1 */
-       reg = get_PCLK() / (16 * gd->baudrate) - 1;
-
-       uart->UBRDIV = reg;
-       for (i = 0; i < 100; i++);
-}
-#if defined(CONFIG_SERIAL_MULTI)
-static inline void
-serial_setbrg_dev(unsigned int dev_index)
-{
-       _serial_setbrg(dev_index);
-}
-#else
-void serial_setbrg(void)
-{
-       _serial_setbrg(UART_NR);
-}
-#endif
-
-
-/* Initialise the serial port. The settings are always 8 data bits, no parity,
- * 1 stop bit, no start bits.
- */
-static int serial_init_dev(const int dev_index)
-{
-       S3C24X0_UART * const uart = S3C24X0_GetBase_UART(dev_index);
-
-       /* FIFO enable, Tx/Rx FIFO clear */
-       uart->UFCON = 0x07;
-       uart->UMCON = 0x0;
-
-       /* Normal,No parity,1 stop,8 bit */
-       uart->ULCON = 0x3;
-       /*
-        * tx=level,rx=edge,disable timeout int.,enable rx error int.,
-        * normal,interrupt or polling
-        */
-       uart->UCON = 0x245;
-
-#ifdef CONFIG_HWFLOW
-       uart->UMCON = 0x1; /* RTS up */
-#endif
-
-       /* FIXME: This is sooooooooooooooooooo ugly */
-#if defined(CONFIG_ARCH_GTA02_v1) || defined(CONFIG_ARCH_GTA02_v2)
-       /* we need auto hw flow control on the gsm and gps port */
-       if (dev_index == 0 || dev_index == 1)
-               uart->UMCON = 0x10;
-#endif
-       _serial_setbrg(dev_index);
-
-       return (0);
-}
-
-#if !defined(CONFIG_SERIAL_MULTI)
-/* Initialise the serial port. The settings are always 8 data bits, no parity,
- * 1 stop bit, no start bits.
- */
-int serial_init (void)
-{
-       return serial_init_dev(UART_NR);
-}
-#endif
-
-/*
- * Read a single byte from the serial port. Returns 1 on success, 0
- * otherwise. When the function is succesfull, the character read is
- * written into its argument c.
- */
-int _serial_getc (const int dev_index)
-{
-       S3C24X0_UART * const uart = S3C24X0_GetBase_UART(dev_index);
-
-       /* wait for character to arrive */
-       while (!(uart->UTRSTAT & 0x1));
-
-       return uart->URXH & 0xff;
-}
-#if defined(CONFIG_SERIAL_MULTI)
-static inline int serial_getc_dev(unsigned int dev_index)
-{
-       return _serial_getc(dev_index);
-}
-#else
-int serial_getc (void)
-{
-       return _serial_getc(UART_NR);
-}
-#endif
-
-#ifdef CONFIG_HWFLOW
-static int hwflow = 0; /* turned off by default */
-int hwflow_onoff(int on)
-{
-       switch(on) {
-       case 0:
-       default:
-               break; /* return current */
-       case 1:
-               hwflow = 1; /* turn on */
-               break;
-       case -1:
-               hwflow = 0; /* turn off */
-               break;
-       }
-       return hwflow;
-}
-#endif
-
-#ifdef CONFIG_MODEM_SUPPORT
-static int be_quiet = 0;
-void disable_putc(void)
-{
-       be_quiet = 1;
-}
-
-void enable_putc(void)
-{
-       be_quiet = 0;
-}
-#endif
-
-
-/*
- * Output a single byte to the serial port.
- */
-void _serial_putc (const char c, const int dev_index)
-{
-       S3C24X0_UART * const uart = S3C24X0_GetBase_UART(dev_index);
-#ifdef CONFIG_MODEM_SUPPORT
-       if (be_quiet)
-               return;
-#endif
-
-       /* wait for room in the tx FIFO */
-       while (!(uart->UTRSTAT & 0x2));
-
-#ifdef CONFIG_HWFLOW
-       /* Wait for CTS up */
-       while(hwflow && !(uart->UMSTAT & 0x1))
-               ;
-#endif
-
-       uart->UTXH = c;
-
-       /* If \n, also do \r */
-       if (c == '\n')
-               serial_putc ('\r');
-}
-#if defined(CONFIG_SERIAL_MULTI)
-static inline void serial_putc_dev(unsigned int dev_index, const char c)
-{
-       _serial_putc(c, dev_index);
-}
-#else
-void serial_putc(const char c)
-{
-       _serial_putc(c, UART_NR);
-}
-#endif
-
-
-/*
- * Test whether a character is in the RX buffer
- */
-int _serial_tstc(const int dev_index)
-{
-       S3C24X0_UART * const uart = S3C24X0_GetBase_UART(dev_index);
-
-       return uart->UTRSTAT & 0x1;
-}
-#if defined(CONFIG_SERIAL_MULTI)
-static inline int
-serial_tstc_dev(unsigned int dev_index)
-{
-       return _serial_tstc(dev_index);
-}
-#else
-int serial_tstc(void)
-{
-       return _serial_tstc(UART_NR);
-}
-#endif
-
-void _serial_puts(const char *s, const int dev_index)
-{
-       while (*s) {
-               _serial_putc (*s++, dev_index);
-       }
-}
-#if defined(CONFIG_SERIAL_MULTI)
-static inline void
-serial_puts_dev(int dev_index, const char *s)
-{
-       _serial_puts(s, dev_index);
-}
-#else
-void
-serial_puts (const char *s)
-{
-       _serial_puts(s, UART_NR);
-}
-#endif
-
-#if defined(CONFIG_SERIAL_MULTI)
-DECLARE_S3C_SERIAL_FUNCTIONS(0);
-struct serial_device s3c24xx_serial0_device =
-       INIT_S3C_SERIAL_STRUCTURE(0, "s3ser0", "S3UART1");
-DECLARE_S3C_SERIAL_FUNCTIONS(1);
-struct serial_device s3c24xx_serial1_device =
-       INIT_S3C_SERIAL_STRUCTURE(1, "s3ser1", "S3UART2");
-DECLARE_S3C_SERIAL_FUNCTIONS(2);
-struct serial_device s3c24xx_serial2_device =
-       INIT_S3C_SERIAL_STRUCTURE(2, "s3ser2", "S3UART3");
-
-#endif /* CONFIG_SERIAL_MULTI */
-
-#endif /* defined(CONFIG_S3C2400) || defined (CONFIG_S3C2410) || defined (CONFIG_TRAB) */
index 3ef455447cf81138cc772f3f6e0ad0fb47fd8bd5..e5c77f7a0fcae8825b6eb1aab35751fded0c1ae8 100644 (file)
 #include <common.h>
 #include <arm925t.h>
 #include <configs/omap1510.h>
+#include <asm/io.h>
 
 #define TIMER_LOAD_VAL 0xffffffff
 
-/* macro to read the 32 bit timer */
-#define READ_TIMER (*(volatile ulong *)(CONFIG_SYS_TIMERBASE+8))
-
-static ulong timestamp;
-static ulong lastdec;
+static uint32_t timestamp;
+static uint32_t lastdec;
 
 /* nothing really to do with interrupts, just starts up a counter. */
 int interrupt_init (void)
 {
-       int32_t val;
-
        /* Start the decrementer ticking down from 0xffffffff */
-       *((int32_t *) (CONFIG_SYS_TIMERBASE + LOAD_TIM)) = TIMER_LOAD_VAL;
-       val = MPUTIM_ST | MPUTIM_AR | MPUTIM_CLOCK_ENABLE | (CONFIG_SYS_PVT << MPUTIM_PTV_BIT);
-       *((int32_t *) (CONFIG_SYS_TIMERBASE + CNTL_TIMER)) = val;
+       __raw_writel(TIMER_LOAD_VAL, CONFIG_SYS_TIMERBASE + LOAD_TIM);
+       __raw_writel(MPUTIM_ST | MPUTIM_AR | MPUTIM_CLOCK_ENABLE |
+               (CONFIG_SYS_PTV << MPUTIM_PTV_BIT),
+               CONFIG_SYS_TIMERBASE + CNTL_TIMER);
 
        /* init the timestamp and lastdec value */
        reset_timer_masked();
 
-       return (0);
+       return 0;
 }
 
 /*
@@ -84,17 +81,17 @@ void udelay (unsigned long usec)
 {
        ulong tmo, tmp;
 
-       if(usec >= 1000){               /* if "big" number, spread normalization to seconds */
+       if (usec >= 1000) {             /* if "big" number, spread normalization to seconds */
                tmo = usec / 1000;      /* start to normalize for usec to ticks per sec */
-               tmo *= CONFIG_SYS_HZ;           /* find number of "ticks" to wait to achieve target */
+               tmo *= CONFIG_SYS_HZ;   /* find number of "ticks" to wait to achieve target */
                tmo /= 1000;            /* finish normalize. */
-       }else{                          /* else small number, don't kill it prior to HZ multiply */
+       } else {                        /* else small number, don't kill it prior to HZ multiply */
                tmo = usec * CONFIG_SYS_HZ;
                tmo /= (1000*1000);
        }
 
        tmp = get_timer (0);            /* get current timestamp */
-       if( (tmo + tmp + 1) < tmp )     /* if setting this fordward will roll time stamp */
+       if ((tmo + tmp + 1) < tmp)      /* if setting this fordward will roll time stamp */
                reset_timer_masked ();  /* reset "advancing" timestamp to 0, set lastdec value */
        else
                tmo += tmp;             /* else, set advancing stamp wake up time */
@@ -106,13 +103,13 @@ void udelay (unsigned long usec)
 void reset_timer_masked (void)
 {
        /* reset time */
-       lastdec = READ_TIMER;  /* capure current decrementer value time */
+       lastdec = __raw_readl(CONFIG_SYS_TIMERBASE + READ_TIM);
        timestamp = 0;         /* start "advancing" time stamp from 0 */
 }
 
 ulong get_timer_masked (void)
 {
-       ulong now = READ_TIMER;         /* current tick value */
+       uint32_t now = __raw_readl(CONFIG_SYS_TIMERBASE + READ_TIM);
 
        if (lastdec >= now) {           /* normal mode (non roll) */
                /* normal mode */
@@ -136,7 +133,7 @@ void udelay_masked (unsigned long usec)
 #ifdef CONFIG_INNOVATOROMAP1510
        #define LOOPS_PER_MSEC 60 /* tuned on omap1510 */
        volatile int i, time_remaining = LOOPS_PER_MSEC*usec;
-    for (i=time_remaining; i>0; i--) { }
+       for (i=time_remaining; i>0; i--) { }
 #else
 
        ulong tmo;
@@ -145,7 +142,7 @@ void udelay_masked (unsigned long usec)
 
        if (usec >= 1000) {             /* if "big" number, spread normalization to seconds */
                tmo = usec / 1000;      /* start to normalize for usec to ticks per sec */
-               tmo *= CONFIG_SYS_HZ;           /* find number of "ticks" to wait to achieve target */
+               tmo *= CONFIG_SYS_HZ;   /* find number of "ticks" to wait to achieve target */
                tmo /= 1000;            /* finish normalize. */
        } else {                        /* else small number, don't kill it prior to HZ multiply */
                tmo = usec * CONFIG_SYS_HZ;
@@ -176,8 +173,5 @@ unsigned long long get_ticks(void)
  */
 ulong get_tbclk (void)
 {
-       ulong tbclk;
-
-       tbclk = CONFIG_SYS_HZ;
-       return tbclk;
+       return CONFIG_SYS_HZ;
 }
index 0f77f402ed83bd7aa51edf695c619423c77fd503..ed24e6569f1a1d8fe90184be7f2b03b236c4542a 100644 (file)
@@ -27,7 +27,7 @@ include $(TOPDIR)/config.mk
 
 LIB    = $(obj)lib$(SOC).a
 
-COBJS  = timer.o ether.o lxt972.o dp83848.o i2c.o nand.o
+COBJS  = timer.o ether.o lxt972.o dp83848.o
 SOBJS  = lowlevel_init.o reset.o
 
 SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
diff --git a/cpu/arm926ejs/davinci/i2c.c b/cpu/arm926ejs/davinci/i2c.c
deleted file mode 100644 (file)
index 3ba20ef..0000000
+++ /dev/null
@@ -1,334 +0,0 @@
-/*
- * TI DaVinci (TMS320DM644x) I2C driver.
- *
- * Copyright (C) 2007 Sergey Kubushyn <ksi@koi8.net>
- *
- * --------------------------------------------------------
- *
- * 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 <common.h>
-
-#ifdef CONFIG_DRIVER_DAVINCI_I2C
-
-#include <i2c.h>
-#include <asm/arch/hardware.h>
-#include <asm/arch/i2c_defs.h>
-
-#define CHECK_NACK() \
-       do {\
-               if (tmp & (I2C_TIMEOUT | I2C_STAT_NACK)) {\
-                       REG(I2C_CON) = 0;\
-                       return(1);\
-               }\
-       } while (0)
-
-
-static int wait_for_bus(void)
-{
-       int     stat, timeout;
-
-       REG(I2C_STAT) = 0xffff;
-
-       for (timeout = 0; timeout < 10; timeout++) {
-               if (!((stat = REG(I2C_STAT)) & I2C_STAT_BB)) {
-                       REG(I2C_STAT) = 0xffff;
-                       return(0);
-               }
-
-               REG(I2C_STAT) = stat;
-               udelay(50000);
-       }
-
-       REG(I2C_STAT) = 0xffff;
-       return(1);
-}
-
-
-static int poll_i2c_irq(int mask)
-{
-       int     stat, timeout;
-
-       for (timeout = 0; timeout < 10; timeout++) {
-               udelay(1000);
-               stat = REG(I2C_STAT);
-               if (stat & mask) {
-                       return(stat);
-               }
-       }
-
-       REG(I2C_STAT) = 0xffff;
-       return(stat | I2C_TIMEOUT);
-}
-
-
-void flush_rx(void)
-{
-       int     dummy;
-
-       while (1) {
-               if (!(REG(I2C_STAT) & I2C_STAT_RRDY))
-                       break;
-
-               dummy = REG(I2C_DRR);
-               REG(I2C_STAT) = I2C_STAT_RRDY;
-               udelay(1000);
-       }
-}
-
-
-void i2c_init(int speed, int slaveadd)
-{
-       u_int32_t       div, psc;
-
-       if (REG(I2C_CON) & I2C_CON_EN) {
-               REG(I2C_CON) = 0;
-               udelay (50000);
-       }
-
-       psc = 2;
-       div = (CONFIG_SYS_HZ_CLOCK / ((psc + 1) * speed)) - 10; /* SCLL + SCLH */
-       REG(I2C_PSC) = psc;                     /* 27MHz / (2 + 1) = 9MHz */
-       REG(I2C_SCLL) = (div * 50) / 100;       /* 50% Duty */
-       REG(I2C_SCLH) = div - REG(I2C_SCLL);
-
-       REG(I2C_OA) = slaveadd;
-       REG(I2C_CNT) = 0;
-
-       /* Interrupts must be enabled or I2C module won't work */
-       REG(I2C_IE) = I2C_IE_SCD_IE | I2C_IE_XRDY_IE |
-               I2C_IE_RRDY_IE | I2C_IE_ARDY_IE | I2C_IE_NACK_IE;
-
-       /* Now enable I2C controller (get it out of reset) */
-       REG(I2C_CON) = I2C_CON_EN;
-
-       udelay(1000);
-}
-
-
-int i2c_probe(u_int8_t chip)
-{
-       int     rc = 1;
-
-       if (chip == REG(I2C_OA)) {
-               return(rc);
-       }
-
-       REG(I2C_CON) = 0;
-       if (wait_for_bus()) {return(1);}
-
-       /* try to read one byte from current (or only) address */
-       REG(I2C_CNT) = 1;
-       REG(I2C_SA) = chip;
-       REG(I2C_CON) = (I2C_CON_EN | I2C_CON_MST | I2C_CON_STT | I2C_CON_STP);
-       udelay (50000);
-
-       if (!(REG(I2C_STAT) & I2C_STAT_NACK)) {
-               rc = 0;
-               flush_rx();
-               REG(I2C_STAT) = 0xffff;
-       } else {
-               REG(I2C_STAT) = 0xffff;
-               REG(I2C_CON) |= I2C_CON_STP;
-               udelay(20000);
-               if (wait_for_bus()) {return(1);}
-       }
-
-       flush_rx();
-       REG(I2C_STAT) = 0xffff;
-       REG(I2C_CNT) = 0;
-       return(rc);
-}
-
-
-int i2c_read(u_int8_t chip, u_int32_t addr, int alen, u_int8_t *buf, int len)
-{
-       u_int32_t       tmp;
-       int             i;
-
-       if ((alen < 0) || (alen > 2)) {
-               printf("%s(): bogus address length %x\n", __FUNCTION__, alen);
-               return(1);
-       }
-
-       if (wait_for_bus()) {return(1);}
-
-       if (alen != 0) {
-               /* Start address phase */
-               tmp = I2C_CON_EN | I2C_CON_MST | I2C_CON_STT | I2C_CON_TRX;
-               REG(I2C_CNT) = alen;
-               REG(I2C_SA) = chip;
-               REG(I2C_CON) = tmp;
-
-               tmp = poll_i2c_irq(I2C_STAT_XRDY | I2C_STAT_NACK);
-
-               CHECK_NACK();
-
-               switch (alen) {
-                       case 2:
-                               /* Send address MSByte */
-                               if (tmp & I2C_STAT_XRDY) {
-                                       REG(I2C_DXR) = (addr >> 8) & 0xff;
-                               } else {
-                                       REG(I2C_CON) = 0;
-                                       return(1);
-                               }
-
-                               tmp = poll_i2c_irq(I2C_STAT_XRDY | I2C_STAT_NACK);
-
-                               CHECK_NACK();
-                               /* No break, fall through */
-                       case 1:
-                               /* Send address LSByte */
-                               if (tmp & I2C_STAT_XRDY) {
-                                       REG(I2C_DXR) = addr & 0xff;
-                               } else {
-                                       REG(I2C_CON) = 0;
-                                       return(1);
-                               }
-
-                               tmp = poll_i2c_irq(I2C_STAT_XRDY | I2C_STAT_NACK | I2C_STAT_ARDY);
-
-                               CHECK_NACK();
-
-                               if (!(tmp & I2C_STAT_ARDY)) {
-                                       REG(I2C_CON) = 0;
-                                       return(1);
-                               }
-               }
-       }
-
-       /* Address phase is over, now read 'len' bytes and stop */
-       tmp = I2C_CON_EN | I2C_CON_MST | I2C_CON_STT | I2C_CON_STP;
-       REG(I2C_CNT) = len & 0xffff;
-       REG(I2C_SA) = chip;
-       REG(I2C_CON) = tmp;
-
-       for (i = 0; i < len; i++) {
-               tmp = poll_i2c_irq(I2C_STAT_RRDY | I2C_STAT_NACK | I2C_STAT_ROVR);
-
-               CHECK_NACK();
-
-               if (tmp & I2C_STAT_RRDY) {
-                       buf[i] = REG(I2C_DRR);
-               } else {
-                       REG(I2C_CON) = 0;
-                       return(1);
-               }
-       }
-
-       tmp = poll_i2c_irq(I2C_STAT_SCD | I2C_STAT_NACK);
-
-       CHECK_NACK();
-
-       if (!(tmp & I2C_STAT_SCD)) {
-               REG(I2C_CON) = 0;
-               return(1);
-       }
-
-       flush_rx();
-       REG(I2C_STAT) = 0xffff;
-       REG(I2C_CNT) = 0;
-       REG(I2C_CON) = 0;
-
-       return(0);
-}
-
-
-int i2c_write(u_int8_t chip, u_int32_t addr, int alen, u_int8_t *buf, int len)
-{
-       u_int32_t       tmp;
-       int             i;
-
-       if ((alen < 0) || (alen > 2)) {
-               printf("%s(): bogus address length %x\n", __FUNCTION__, alen);
-               return(1);
-       }
-       if (len < 0) {
-               printf("%s(): bogus length %x\n", __FUNCTION__, len);
-               return(1);
-       }
-
-       if (wait_for_bus()) {return(1);}
-
-       /* Start address phase */
-       tmp = I2C_CON_EN | I2C_CON_MST | I2C_CON_STT | I2C_CON_TRX | I2C_CON_STP;
-       REG(I2C_CNT) = (alen == 0) ? len & 0xffff : (len & 0xffff) + alen;
-       REG(I2C_SA) = chip;
-       REG(I2C_CON) = tmp;
-
-       switch (alen) {
-               case 2:
-                       /* Send address MSByte */
-                       tmp = poll_i2c_irq(I2C_STAT_XRDY | I2C_STAT_NACK);
-
-                       CHECK_NACK();
-
-                       if (tmp & I2C_STAT_XRDY) {
-                               REG(I2C_DXR) = (addr >> 8) & 0xff;
-                       } else {
-                               REG(I2C_CON) = 0;
-                               return(1);
-                       }
-                       /* No break, fall through */
-               case 1:
-                       /* Send address LSByte */
-                       tmp = poll_i2c_irq(I2C_STAT_XRDY | I2C_STAT_NACK);
-
-                       CHECK_NACK();
-
-                       if (tmp & I2C_STAT_XRDY) {
-                               REG(I2C_DXR) = addr & 0xff;
-                       } else {
-                               REG(I2C_CON) = 0;
-                               return(1);
-                       }
-       }
-
-       for (i = 0; i < len; i++) {
-               tmp = poll_i2c_irq(I2C_STAT_XRDY | I2C_STAT_NACK);
-
-               CHECK_NACK();
-
-               if (tmp & I2C_STAT_XRDY) {
-                       REG(I2C_DXR) = buf[i];
-               } else {
-                       return(1);
-               }
-       }
-
-       tmp = poll_i2c_irq(I2C_STAT_SCD | I2C_STAT_NACK);
-
-       CHECK_NACK();
-
-       if (!(tmp & I2C_STAT_SCD)) {
-               REG(I2C_CON) = 0;
-               return(1);
-       }
-
-       flush_rx();
-       REG(I2C_STAT) = 0xffff;
-       REG(I2C_CNT) = 0;
-       REG(I2C_CON) = 0;
-
-       return(0);
-}
-
-#endif /* CONFIG_DRIVER_DAVINCI_I2C */
diff --git a/cpu/arm926ejs/davinci/nand.c b/cpu/arm926ejs/davinci/nand.c
deleted file mode 100644 (file)
index 014e2b0..0000000
+++ /dev/null
@@ -1,475 +0,0 @@
-/*
- * NAND driver for TI DaVinci based boards.
- *
- * Copyright (C) 2007 Sergey Kubushyn <ksi@koi8.net>
- *
- * Based on Linux DaVinci NAND driver by TI. Original copyright follows:
- */
-
-/*
- *
- * linux/drivers/mtd/nand/nand_davinci.c
- *
- * NAND Flash Driver
- *
- * Copyright (C) 2006 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.
- * ----------------------------------------------------------------------------
- *
- *  Overview:
- *   This is a device driver for the NAND flash device found on the
- *   DaVinci board which utilizes the Samsung k9k2g08 part.
- *
- Modifications:
- ver. 1.0: Feb 2005, Vinod/Sudhakar
- -
- *
- */
-
-#include <common.h>
-#include <asm/io.h>
-
-#ifdef CONFIG_SYS_USE_NAND
-#if !defined(CONFIG_NAND_LEGACY)
-
-#include <nand.h>
-#include <asm/arch/nand_defs.h>
-#include <asm/arch/emif_defs.h>
-
-extern struct nand_chip nand_dev_desc[CONFIG_SYS_MAX_NAND_DEVICE];
-
-static void nand_davinci_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl)
-{
-       struct          nand_chip *this = mtd->priv;
-       u_int32_t       IO_ADDR_W = (u_int32_t)this->IO_ADDR_W;
-
-       IO_ADDR_W &= ~(MASK_ALE|MASK_CLE);
-
-       if (ctrl & NAND_CTRL_CHANGE) {
-               if ( ctrl & NAND_CLE )
-                       IO_ADDR_W |= MASK_CLE;
-               if ( ctrl & NAND_ALE )
-                       IO_ADDR_W |= MASK_ALE;
-               this->IO_ADDR_W = (void __iomem *) IO_ADDR_W;
-       }
-
-       if (cmd != NAND_CMD_NONE)
-               writeb(cmd, this->IO_ADDR_W);
-}
-
-/* Set WP on deselect, write enable on select */
-static void nand_davinci_select_chip(struct mtd_info *mtd, int chip)
-{
-#define GPIO_SET_DATA01        0x01c67018
-#define GPIO_CLR_DATA01        0x01c6701c
-#define GPIO_NAND_WP   (1 << 4)
-#ifdef SONATA_BOARD_GPIOWP
-       if (chip < 0) {
-               REG(GPIO_CLR_DATA01) |= GPIO_NAND_WP;
-       } else {
-               REG(GPIO_SET_DATA01) |= GPIO_NAND_WP;
-       }
-#endif
-}
-
-#ifdef CONFIG_SYS_NAND_HW_ECC
-#ifdef CONFIG_SYS_DAVINCI_BROKEN_ECC
-/* Linux-compatible ECC uses MTD defaults. */
-/* These layouts are not compatible with Linux or RBL/UBL. */
-#ifdef CONFIG_SYS_NAND_LARGEPAGE
-static struct nand_ecclayout davinci_nand_ecclayout = {
-       .eccbytes = 12,
-       .eccpos = {8, 9, 10, 24, 25, 26, 40, 41, 42, 56, 57, 58},
-       .oobfree = {
-               {.offset = 2, .length = 6},
-               {.offset = 12, .length = 12},
-               {.offset = 28, .length = 12},
-               {.offset = 44, .length = 12},
-               {.offset = 60, .length = 4}
-       }
-};
-#elif defined(CONFIG_SYS_NAND_SMALLPAGE)
-static struct nand_ecclayout davinci_nand_ecclayout = {
-       .eccbytes = 3,
-       .eccpos = {0, 1, 2},
-       .oobfree = {
-               {.offset = 6, .length = 2},
-               {.offset = 8, .length = 8}
-       }
-};
-#else
-#error "Either CONFIG_SYS_NAND_LARGEPAGE or CONFIG_SYS_NAND_SMALLPAGE must be defined!"
-#endif
-#endif /* CONFIG_SYS_DAVINCI_BROKEN_ECC */
-
-static void nand_davinci_enable_hwecc(struct mtd_info *mtd, int mode)
-{
-       emifregs        emif_addr;
-       int             dummy;
-
-       emif_addr = (emifregs)DAVINCI_ASYNC_EMIF_CNTRL_BASE;
-
-       dummy = emif_addr->NANDF1ECC;
-       dummy = emif_addr->NANDF2ECC;
-       dummy = emif_addr->NANDF3ECC;
-       dummy = emif_addr->NANDF4ECC;
-
-       emif_addr->NANDFCR |= (1 << 8);
-}
-
-static u_int32_t nand_davinci_readecc(struct mtd_info *mtd, u_int32_t region)
-{
-       u_int32_t       ecc = 0;
-       emifregs        emif_base_addr;
-
-       emif_base_addr = (emifregs)DAVINCI_ASYNC_EMIF_CNTRL_BASE;
-
-       if (region == 1)
-               ecc = emif_base_addr->NANDF1ECC;
-       else if (region == 2)
-               ecc = emif_base_addr->NANDF2ECC;
-       else if (region == 3)
-               ecc = emif_base_addr->NANDF3ECC;
-       else if (region == 4)
-               ecc = emif_base_addr->NANDF4ECC;
-
-       return(ecc);
-}
-
-static int nand_davinci_calculate_ecc(struct mtd_info *mtd, const u_char *dat, u_char *ecc_code)
-{
-       u_int32_t               tmp;
-#ifdef CONFIG_SYS_DAVINCI_BROKEN_ECC
-       /*
-        * This is not how you should read ECCs on large page Davinci devices.
-        * The region parameter gets you ECCs for flash chips on different chip
-        * selects, not the 4x512 byte pages in a 2048 byte page.
-        *
-        * Preserved for backwards compatibility though.
-        */
-
-       int                     region, n;
-       struct nand_chip        *this = mtd->priv;
-
-       n = (this->ecc.size/512);
-
-       region = 1;
-       while (n--) {
-               tmp = nand_davinci_readecc(mtd, region);
-               *ecc_code++ = tmp;
-               *ecc_code++ = tmp >> 16;
-               *ecc_code++ = ((tmp >> 8) & 0x0f) | ((tmp >> 20) & 0xf0);
-               region++;
-       }
-#else
-       const int region = 1;
-
-       tmp = nand_davinci_readecc(mtd, region);
-
-       /* Squeeze 4 bytes ECC into 3 bytes by removing RESERVED bits
-        * and shifting. RESERVED bits are 31 to 28 and 15 to 12. */
-       tmp = (tmp & 0x00000fff) | ((tmp & 0x0fff0000) >> 4);
-
-       /* Invert so that erased block ECC is correct */
-       tmp = ~tmp;
-
-       *ecc_code++ = tmp;
-       *ecc_code++ = tmp >>  8;
-       *ecc_code++ = tmp >> 16;
-#endif /* CONFIG_SYS_DAVINCI_BROKEN_ECC */
-       return(0);
-}
-
-#ifdef CONFIG_SYS_DAVINCI_BROKEN_ECC
-static void nand_davinci_gen_true_ecc(u_int8_t *ecc_buf)
-{
-       u_int32_t       tmp = ecc_buf[0] | (ecc_buf[1] << 16) | ((ecc_buf[2] & 0xf0) << 20) | ((ecc_buf[2] & 0x0f) << 8);
-
-       ecc_buf[0] = ~(P64o(tmp) | P64e(tmp) | P32o(tmp) | P32e(tmp) | P16o(tmp) | P16e(tmp) | P8o(tmp) | P8e(tmp));
-       ecc_buf[1] = ~(P1024o(tmp) | P1024e(tmp) | P512o(tmp) | P512e(tmp) | P256o(tmp) | P256e(tmp) | P128o(tmp) | P128e(tmp));
-       ecc_buf[2] = ~( P4o(tmp) | P4e(tmp) | P2o(tmp) | P2e(tmp) | P1o(tmp) | P1e(tmp) | P2048o(tmp) | P2048e(tmp));
-}
-
-static int nand_davinci_compare_ecc(u_int8_t *ecc_nand, u_int8_t *ecc_calc, u_int8_t *page_data)
-{
-       u_int32_t       i;
-       u_int8_t        tmp0_bit[8], tmp1_bit[8], tmp2_bit[8];
-       u_int8_t        comp0_bit[8], comp1_bit[8], comp2_bit[8];
-       u_int8_t        ecc_bit[24];
-       u_int8_t        ecc_sum = 0;
-       u_int8_t        find_bit = 0;
-       u_int32_t       find_byte = 0;
-       int             is_ecc_ff;
-
-       is_ecc_ff = ((*ecc_nand == 0xff) && (*(ecc_nand + 1) == 0xff) && (*(ecc_nand + 2) == 0xff));
-
-       nand_davinci_gen_true_ecc(ecc_nand);
-       nand_davinci_gen_true_ecc(ecc_calc);
-
-       for (i = 0; i <= 2; i++) {
-               *(ecc_nand + i) = ~(*(ecc_nand + i));
-               *(ecc_calc + i) = ~(*(ecc_calc + i));
-       }
-
-       for (i = 0; i < 8; i++) {
-               tmp0_bit[i] = *ecc_nand % 2;
-               *ecc_nand = *ecc_nand / 2;
-       }
-
-       for (i = 0; i < 8; i++) {
-               tmp1_bit[i] = *(ecc_nand + 1) % 2;
-               *(ecc_nand + 1) = *(ecc_nand + 1) / 2;
-       }
-
-       for (i = 0; i < 8; i++) {
-               tmp2_bit[i] = *(ecc_nand + 2) % 2;
-               *(ecc_nand + 2) = *(ecc_nand + 2) / 2;
-       }
-
-       for (i = 0; i < 8; i++) {
-               comp0_bit[i] = *ecc_calc % 2;
-               *ecc_calc = *ecc_calc / 2;
-       }
-
-       for (i = 0; i < 8; i++) {
-               comp1_bit[i] = *(ecc_calc + 1) % 2;
-               *(ecc_calc + 1) = *(ecc_calc + 1) / 2;
-       }
-
-       for (i = 0; i < 8; i++) {
-               comp2_bit[i] = *(ecc_calc + 2) % 2;
-               *(ecc_calc + 2) = *(ecc_calc + 2) / 2;
-       }
-
-       for (i = 0; i< 6; i++)
-               ecc_bit[i] = tmp2_bit[i + 2] ^ comp2_bit[i + 2];
-
-       for (i = 0; i < 8; i++)
-               ecc_bit[i + 6] = tmp0_bit[i] ^ comp0_bit[i];
-
-       for (i = 0; i < 8; i++)
-               ecc_bit[i + 14] = tmp1_bit[i] ^ comp1_bit[i];
-
-       ecc_bit[22] = tmp2_bit[0] ^ comp2_bit[0];
-       ecc_bit[23] = tmp2_bit[1] ^ comp2_bit[1];
-
-       for (i = 0; i < 24; i++)
-               ecc_sum += ecc_bit[i];
-
-       switch (ecc_sum) {
-               case 0:
-                       /* Not reached because this function is not called if
-                          ECC values are equal */
-                       return 0;
-               case 1:
-                       /* Uncorrectable error */
-                       MTDDEBUG (MTD_DEBUG_LEVEL0,
-                                 "ECC UNCORRECTED_ERROR 1\n");
-                       return(-1);
-               case 12:
-                       /* Correctable error */
-                       find_byte = (ecc_bit[23] << 8) +
-                               (ecc_bit[21] << 7) +
-                               (ecc_bit[19] << 6) +
-                               (ecc_bit[17] << 5) +
-                               (ecc_bit[15] << 4) +
-                               (ecc_bit[13] << 3) +
-                               (ecc_bit[11] << 2) +
-                               (ecc_bit[9]  << 1) +
-                               ecc_bit[7];
-
-                       find_bit = (ecc_bit[5] << 2) + (ecc_bit[3] << 1) + ecc_bit[1];
-
-                       MTDDEBUG (MTD_DEBUG_LEVEL0, "Correcting single bit ECC "
-                                 "error at offset: %d, bit: %d\n",
-                                 find_byte, find_bit);
-
-                       page_data[find_byte] ^= (1 << find_bit);
-
-                       return(0);
-               default:
-                       if (is_ecc_ff) {
-                               if (ecc_calc[0] == 0 && ecc_calc[1] == 0 && ecc_calc[2] == 0)
-                                       return(0);
-                       }
-                       MTDDEBUG (MTD_DEBUG_LEVEL0,
-                                 "UNCORRECTED_ERROR default\n");
-                       return(-1);
-       }
-}
-#endif /* CONFIG_SYS_DAVINCI_BROKEN_ECC */
-
-static int nand_davinci_correct_data(struct mtd_info *mtd, u_char *dat, u_char *read_ecc, u_char *calc_ecc)
-{
-       struct nand_chip *this = mtd->priv;
-#ifdef CONFIG_SYS_DAVINCI_BROKEN_ECC
-       int                     block_count = 0, i, rc;
-
-       block_count = (this->ecc.size/512);
-       for (i = 0; i < block_count; i++) {
-               if (memcmp(read_ecc, calc_ecc, 3) != 0) {
-                       rc = nand_davinci_compare_ecc(read_ecc, calc_ecc, dat);
-                       if (rc < 0) {
-                               return(rc);
-                       }
-               }
-               read_ecc += 3;
-               calc_ecc += 3;
-               dat += 512;
-       }
-#else
-       u_int32_t ecc_nand = read_ecc[0] | (read_ecc[1] << 8) |
-                                         (read_ecc[2] << 16);
-       u_int32_t ecc_calc = calc_ecc[0] | (calc_ecc[1] << 8) |
-                                         (calc_ecc[2] << 16);
-       u_int32_t diff = ecc_calc ^ ecc_nand;
-
-       if (diff) {
-               if ((((diff >> 12) ^ diff) & 0xfff) == 0xfff) {
-                       /* Correctable error */
-                       if ((diff >> (12 + 3)) < this->ecc.size) {
-                               uint8_t find_bit = 1 << ((diff >> 12) & 7);
-                               uint32_t find_byte = diff >> (12 + 3);
-
-                               dat[find_byte] ^= find_bit;
-                               MTDDEBUG(MTD_DEBUG_LEVEL0, "Correcting single "
-                                        "bit ECC error at offset: %d, bit: "
-                                        "%d\n", find_byte, find_bit);
-                               return 1;
-                       } else {
-                               return -1;
-                       }
-               } else if (!(diff & (diff - 1))) {
-                       /* Single bit ECC error in the ECC itself,
-                          nothing to fix */
-                       MTDDEBUG(MTD_DEBUG_LEVEL0, "Single bit ECC error in "
-                                "ECC.\n");
-                       return 1;
-               } else {
-                       /* Uncorrectable error */
-                       MTDDEBUG(MTD_DEBUG_LEVEL0, "ECC UNCORRECTED_ERROR 1\n");
-                       return -1;
-               }
-       }
-#endif /* CONFIG_SYS_DAVINCI_BROKEN_ECC */
-       return(0);
-}
-#endif /* CONFIG_SYS_NAND_HW_ECC */
-
-static int nand_davinci_dev_ready(struct mtd_info *mtd)
-{
-       emifregs        emif_addr;
-
-       emif_addr = (emifregs)DAVINCI_ASYNC_EMIF_CNTRL_BASE;
-
-       return(emif_addr->NANDFSR & 0x1);
-}
-
-static int nand_davinci_waitfunc(struct mtd_info *mtd, struct nand_chip *this)
-{
-       while(!nand_davinci_dev_ready(mtd)) {;}
-       *NAND_CE0CLE = NAND_STATUS;
-       return(*NAND_CE0DATA);
-}
-
-static void nand_flash_init(void)
-{
-       u_int32_t       acfg1 = 0x3ffffffc;
-       u_int32_t       acfg2 = 0x3ffffffc;
-       u_int32_t       acfg3 = 0x3ffffffc;
-       u_int32_t       acfg4 = 0x3ffffffc;
-       emifregs        emif_regs;
-
-       /*------------------------------------------------------------------*
-        *  NAND FLASH CHIP TIMEOUT @ 459 MHz                               *
-        *                                                                  *
-        *  AEMIF.CLK freq   = PLL1/6 = 459/6 = 76.5 MHz                    *
-        *  AEMIF.CLK period = 1/76.5 MHz = 13.1 ns                         *
-        *                                                                  *
-        *------------------------------------------------------------------*/
-        acfg1 = 0
-               | (0 << 31 )    /* selectStrobe */
-               | (0 << 30 )    /* extWait */
-               | (1 << 26 )    /* writeSetup   10 ns */
-               | (3 << 20 )    /* writeStrobe  40 ns */
-               | (1 << 17 )    /* writeHold    10 ns */
-               | (1 << 13 )    /* readSetup    10 ns */
-               | (5 << 7 )     /* readStrobe   60 ns */
-               | (1 << 4 )     /* readHold     10 ns */
-               | (3 << 2 )     /* turnAround   ?? ns */
-               | (0 << 0 )     /* asyncSize    8-bit bus */
-               ;
-
-       emif_regs = (emifregs)DAVINCI_ASYNC_EMIF_CNTRL_BASE;
-
-       emif_regs->AWCCR |= 0x10000000;
-       emif_regs->AB1CR = acfg1;       /* 0x08244128 */;
-       emif_regs->AB2CR = acfg2;
-       emif_regs->AB3CR = acfg3;
-       emif_regs->AB4CR = acfg4;
-       emif_regs->NANDFCR = 0x00000101;
-}
-
-int board_nand_init(struct nand_chip *nand)
-{
-       nand->IO_ADDR_R   = (void  __iomem *)NAND_CE0DATA;
-       nand->IO_ADDR_W   = (void  __iomem *)NAND_CE0DATA;
-       nand->chip_delay  = 0;
-       nand->select_chip = nand_davinci_select_chip;
-#ifdef CONFIG_SYS_NAND_USE_FLASH_BBT
-       nand->options     = NAND_USE_FLASH_BBT;
-#endif
-#ifdef CONFIG_SYS_NAND_HW_ECC
-       nand->ecc.mode = NAND_ECC_HW;
-#ifdef CONFIG_SYS_DAVINCI_BROKEN_ECC
-       nand->ecc.layout  = &davinci_nand_ecclayout;
-#ifdef CONFIG_SYS_NAND_LARGEPAGE
-       nand->ecc.size = 2048;
-       nand->ecc.bytes = 12;
-#elif defined(CONFIG_SYS_NAND_SMALLPAGE)
-       nand->ecc.size = 512;
-       nand->ecc.bytes = 3;
-#else
-#error "Either CONFIG_SYS_NAND_LARGEPAGE or CONFIG_SYS_NAND_SMALLPAGE must be defined!"
-#endif
-#else
-       nand->ecc.size = 512;
-       nand->ecc.bytes = 3;
-#endif /* CONFIG_SYS_DAVINCI_BROKEN_ECC */
-       nand->ecc.calculate = nand_davinci_calculate_ecc;
-       nand->ecc.correct  = nand_davinci_correct_data;
-       nand->ecc.hwctl  = nand_davinci_enable_hwecc;
-#else
-       nand->ecc.mode = NAND_ECC_SOFT;
-#endif /* CONFIG_SYS_NAND_HW_ECC */
-
-       /* Set address of hardware control function */
-       nand->cmd_ctrl = nand_davinci_hwcontrol;
-
-       nand->dev_ready = nand_davinci_dev_ready;
-       nand->waitfunc = nand_davinci_waitfunc;
-
-       nand_flash_init();
-
-       return(0);
-}
-
-#else
-#error "U-Boot legacy NAND support not available for DaVinci chips"
-#endif
-#endif /* CONFIG_SYS_USE_NAND */
index 49e74abb3b3bd4bb3e81d867cc55bdb1d2576eac..bedc2e75442c1ec91b60da92cdfbe0f16ad9738c 100644 (file)
@@ -52,7 +52,7 @@ int timer_init (void)
 
        /* Start the decrementer ticking down from 0xffffffff */
        *((int32_t *) (CONFIG_SYS_TIMERBASE + LOAD_TIM)) = TIMER_LOAD_VAL;
-       val = MPUTIM_ST | MPUTIM_AR | MPUTIM_CLOCK_ENABLE | (CONFIG_SYS_PVT << MPUTIM_PTV_BIT);
+       val = MPUTIM_ST | MPUTIM_AR | MPUTIM_CLOCK_ENABLE | (CONFIG_SYS_PTV << MPUTIM_PTV_BIT);
        *((int32_t *) (CONFIG_SYS_TIMERBASE + CNTL_TIMER)) = val;
 
        /* init the timestamp and lastdec value */
index 9e9817de64ddeef83d8a1a84c95b42cb3022af7f..5d9c4e32c2e1da6865fa9bb6b0a709096b8b15e5 100644 (file)
@@ -175,7 +175,7 @@ int interrupt_init(void)
        /* start the counter ticking up, reload value on overflow */
        writel(TIMER_LOAD_VAL, &timer_base->tldr);
        /* enable timer */
-       writel((CONFIG_SYS_PVT << 2) | TCLR_PRE | TCLR_AR | TCLR_ST,
+       writel((CONFIG_SYS_PTV << 2) | TCLR_PRE | TCLR_AR | TCLR_ST,
                &timer_base->tclr);
 
        reset_timer_masked();   /* init the timestamp and lastinc value */
index 790faebd3977910c9ed2bf8f00ea7235ccb8e6ca..ae909a699f6b483b04479aa552c2622b0812aa2c 100644 (file)
@@ -26,7 +26,7 @@ include $(TOPDIR)/config.mk
 LIB    = $(obj)lib$(CPU).a
 
 START  = start.o
-COBJS  = serial.o interrupts.o cpu.o
+COBJS  = cache.o cpu.o interrupts.o
 
 SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
diff --git a/cpu/s3c44b0/cache.c b/cpu/s3c44b0/cache.c
new file mode 100644 (file)
index 0000000..bc10171
--- /dev/null
@@ -0,0 +1,91 @@
+/*
+ * (C) Copyright 2004
+ * DAVE Srl
+ * http://www.dave-tech.it
+ * http://www.wawnet.biz
+ * mailto:info@wawnet.biz
+ *
+ * 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 <common.h>
+#include <command.h>
+#include <asm/hardware.h>
+
+static void s3c44b0_flush_cache(void)
+{
+       volatile int i;
+       /* flush cycle */
+       for(i=0x10002000;i<0x10004800;i+=16)
+       {
+               *((int *)i)=0x0;
+       }
+}
+
+void icache_enable (void)
+{
+       ulong reg;
+
+       s3c44b0_flush_cache();
+
+       /*
+               Init cache
+               Non-cacheable area (everything outside RAM)
+               0x0000:0000 - 0x0C00:0000
+        */
+       NCACHBE0 = 0xC0000000;
+       NCACHBE1 = 0x00000000;
+
+       /*
+               Enable chache
+       */
+       reg = SYSCFG;
+       reg |= 0x00000006; /* 8kB */
+       SYSCFG = reg;
+}
+
+void icache_disable (void)
+{
+       ulong reg;
+
+       reg = SYSCFG;
+       reg &= ~0x00000006; /* 8kB */
+       SYSCFG = reg;
+}
+
+int icache_status (void)
+{
+       return 0;
+}
+
+void dcache_enable (void)
+{
+       icache_enable();
+}
+
+void dcache_disable (void)
+{
+       icache_disable();
+}
+
+int dcache_status (void)
+{
+       return dcache_status();
+}
+
index 2960f2f3af9858a1275e88d6064e92593f01f4c6..e4cdb823b4a6300ffba4eac439f9bc4b6638a1e0 100644 (file)
 #include <command.h>
 #include <asm/hardware.h>
 
-static void s3c44b0_flush_cache(void)
-{
-       volatile int i;
-       /* flush cycle */
-       for(i=0x10002000;i<0x10004800;i+=16)
-       {
-               *((int *)i)=0x0;
-       }
-}
-
-
 int cpu_init (void)
 {
        icache_enable();
@@ -92,422 +81,3 @@ int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        /*NOTREACHED*/
        return (0);
 }
-
-void icache_enable (void)
-{
-       ulong reg;
-
-       s3c44b0_flush_cache();
-
-       /*
-               Init cache
-               Non-cacheable area (everything outside RAM)
-               0x0000:0000 - 0x0C00:0000
-        */
-       NCACHBE0 = 0xC0000000;
-       NCACHBE1 = 0x00000000;
-
-       /*
-               Enable chache
-       */
-       reg = SYSCFG;
-       reg |= 0x00000006; /* 8kB */
-       SYSCFG = reg;
-}
-
-void icache_disable (void)
-{
-       ulong reg;
-
-       reg = SYSCFG;
-       reg &= ~0x00000006; /* 8kB */
-       SYSCFG = reg;
-}
-
-int icache_status (void)
-{
-       return 0;
-}
-
-void dcache_enable (void)
-{
-       icache_enable();
-}
-
-void dcache_disable (void)
-{
-       icache_disable();
-}
-
-int dcache_status (void)
-{
-       return dcache_status();
-}
-
-/*
-       RTC stuff
-*/
-#include <rtc.h>
-#ifndef BCD2HEX
-       #define BCD2HEX(n)  ((n>>4)*10+(n&0x0f))
-#endif
-#ifndef HEX2BCD
-       #define HEX2BCD(x) ((((x) / 10) << 4) + (x) % 10)
-#endif
-
-int rtc_get (struct rtc_time* tm)
-{
-       RTCCON |= 1;
-       tm->tm_year  = BCD2HEX(BCDYEAR);
-       tm->tm_mon   = BCD2HEX(BCDMON);
-       tm->tm_wday   = BCD2HEX(BCDDATE);
-       tm->tm_mday   = BCD2HEX(BCDDAY);
-       tm->tm_hour  = BCD2HEX(BCDHOUR);
-       tm->tm_min  = BCD2HEX(BCDMIN);
-       tm->tm_sec  = BCD2HEX(BCDSEC);
-
-       if (tm->tm_sec==0) {
-               /* we have to re-read the rtc data because of the "one second deviation" problem */
-               /* see RTC datasheet for more info about it */
-               tm->tm_year  = BCD2HEX(BCDYEAR);
-               tm->tm_mon   = BCD2HEX(BCDMON);
-               tm->tm_mday   = BCD2HEX(BCDDAY);
-               tm->tm_wday   = BCD2HEX(BCDDATE);
-               tm->tm_hour  = BCD2HEX(BCDHOUR);
-               tm->tm_min  = BCD2HEX(BCDMIN);
-               tm->tm_sec  = BCD2HEX(BCDSEC);
-       }
-
-       RTCCON &= ~1;
-
-       if(tm->tm_year >= 70)
-               tm->tm_year += 1900;
-       else
-               tm->tm_year += 2000;
-
-       return 0;
-}
-
-int rtc_set (struct rtc_time* tm)
-{
-       if(tm->tm_year < 2000)
-               tm->tm_year -= 1900;
-       else
-               tm->tm_year -= 2000;
-
-       RTCCON |= 1;
-       BCDYEAR = HEX2BCD(tm->tm_year);
-       BCDMON = HEX2BCD(tm->tm_mon);
-       BCDDAY = HEX2BCD(tm->tm_mday);
-       BCDDATE = HEX2BCD(tm->tm_wday);
-       BCDHOUR = HEX2BCD(tm->tm_hour);
-       BCDMIN = HEX2BCD(tm->tm_min);
-       BCDSEC = HEX2BCD(tm->tm_sec);
-       RTCCON &= 1;
-
-       return 0;
-}
-
-void rtc_reset (void)
-{
-       RTCCON |= 1;
-       BCDYEAR = 0;
-       BCDMON = 0;
-       BCDDAY = 0;
-       BCDDATE = 0;
-       BCDHOUR = 0;
-       BCDMIN = 0;
-       BCDSEC = 0;
-       RTCCON &= 1;
-}
-
-
-/*
-       I2C stuff
-*/
-
-/*
- * Initialization, must be called once on start up, may be called
- * repeatedly to change the speed and slave addresses.
- */
-void i2c_init(int speed, int slaveaddr)
-{
-       /*
-               setting up I2C support
-       */
-       unsigned int save_F,save_PF,rIICCON,rPCONA,rPDATA,rPCONF,rPUPF;
-
-       save_F = PCONF;
-       save_PF = PUPF;
-
-       rPCONF = ((save_F & ~(0xF))| 0xa);
-       rPUPF = (save_PF | 0x3);
-       PCONF = rPCONF; /*PF0:IICSCL, PF1:IICSDA*/
-       PUPF = rPUPF; /* Disable pull-up */
-
-       /* Configuring pin for WC pin of EEprom */
-       rPCONA = PCONA;
-       rPCONA &= ~(1<<9);
-       PCONA = rPCONA;
-
-       rPDATA = PDATA;
-       rPDATA &= ~(1<<9);
-       PDATA = rPDATA;
-
-       /*
-               Enable ACK, IICCLK=MCLK/16, enable interrupt
-               75MHz/16/(12+1) = 390625 Hz
-       */
-       rIICCON=(1<<7)|(0<<6)|(1<<5)|(0xC);
-       IICCON = rIICCON;
-
-       IICADD = slaveaddr;
-}
-
-/*
- * Probe the given I2C chip address.  Returns 0 if a chip responded,
- * not 0 on failure.
- */
-int i2c_probe(uchar chip)
-{
-       /*
-               not implemented
-       */
-
-       printf("i2c_probe chip %d\n", (int) chip);
-       return -1;
-}
-
-/*
- * Read/Write interface:
- *   chip:    I2C chip address, range 0..127
- *   addr:    Memory (register) address within the chip
- *   alen:    Number of bytes to use for addr (typically 1, 2 for larger
- *              memories, 0 for register type devices with only one
- *              register)
- *   buffer:  Where to read/write the data
- *   len:     How many bytes to read/write
- *
- *   Returns: 0 on success, not 0 on failure
- */
-
-#define S3C44B0X_rIIC_INTPEND               (1<<4)
-#define S3C44B0X_rIIC_LAST_RECEIV_BIT       (1<<0)
-#define S3C44B0X_rIIC_INTERRUPT_ENABLE      (1<<5)
-#define S3C44B0_IIC_TIMEOUT 100
-
-int i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len)
-{
-
-       int k, j, temp;
-       u32 rIICSTAT;
-
-       /*
-               send the device offset
-       */
-
-       rIICSTAT = 0xD0;
-       IICSTAT = rIICSTAT;
-
-       IICDS = chip;   /* this is a write operation... */
-
-       rIICSTAT |= (1<<5);
-       IICSTAT = rIICSTAT;
-
-       for(k=0; k<S3C44B0_IIC_TIMEOUT; k++) {
-               temp = IICCON;
-               if( (temp & S3C44B0X_rIIC_INTPEND) == S3C44B0X_rIIC_INTPEND)
-               break;
-               udelay(2000);
-       }
-       if (k==S3C44B0_IIC_TIMEOUT)
-               return -1;
-
-       /* wait and check ACK */
-       temp = IICSTAT;
-       if ((temp & S3C44B0X_rIIC_LAST_RECEIV_BIT) == S3C44B0X_rIIC_LAST_RECEIV_BIT )
-               return -1;
-
-       IICDS = addr;
-       IICCON = IICCON & ~(S3C44B0X_rIIC_INTPEND);
-
-       /* wait and check ACK */
-       for(k=0; k<S3C44B0_IIC_TIMEOUT; k++) {
-               temp = IICCON;
-               if( (temp & S3C44B0X_rIIC_INTPEND) == S3C44B0X_rIIC_INTPEND)
-               break;
-               udelay(2000);
-       }
-       if (k==S3C44B0_IIC_TIMEOUT)
-               return -1;
-
-       temp = IICSTAT;
-       if ((temp & S3C44B0X_rIIC_LAST_RECEIV_BIT) == S3C44B0X_rIIC_LAST_RECEIV_BIT )
-               return -1;
-
-       /*
-               now we can start with the read operation...
-       */
-
-       IICDS = chip | 0x01;    /* this is a read operation... */
-
-       rIICSTAT = 0x90; /*master recv*/
-       rIICSTAT |= (1<<5);
-       IICSTAT = rIICSTAT;
-
-       IICCON = IICCON & ~(S3C44B0X_rIIC_INTPEND);
-
-       /* wait and check ACK */
-       for(k=0; k<S3C44B0_IIC_TIMEOUT; k++) {
-               temp = IICCON;
-               if( (temp & S3C44B0X_rIIC_INTPEND) == S3C44B0X_rIIC_INTPEND)
-               break;
-               udelay(2000);
-       }
-       if (k==S3C44B0_IIC_TIMEOUT)
-               return -1;
-
-       temp = IICSTAT;
-       if ((temp & S3C44B0X_rIIC_LAST_RECEIV_BIT) == S3C44B0X_rIIC_LAST_RECEIV_BIT )
-               return -1;
-
-       for (j=0; j<len-1; j++) {
-
-       /*clear pending bit to resume */
-
-       temp = IICCON & ~(S3C44B0X_rIIC_INTPEND);
-       IICCON = temp;
-
-       /* wait and check ACK */
-       for(k=0; k<S3C44B0_IIC_TIMEOUT; k++) {
-               temp = IICCON;
-               if( (temp & S3C44B0X_rIIC_INTPEND) == S3C44B0X_rIIC_INTPEND)
-               break;
-               udelay(2000);
-       }
-       if (k==S3C44B0_IIC_TIMEOUT)
-               return -1;
-
-
-               buffer[j] = IICDS; /*save readed data*/
-
-    } /*end for(j)*/
-
-       /*
-               reading the last data
-               unset ACK generation
-       */
-       temp = IICCON & ~(S3C44B0X_rIIC_INTPEND | (1<<7));
-       IICCON = temp;
-
-       /* wait but NOT check ACK */
-       for(k=0; k<S3C44B0_IIC_TIMEOUT; k++) {
-               temp = IICCON;
-               if( (temp & S3C44B0X_rIIC_INTPEND) == S3C44B0X_rIIC_INTPEND)
-               break;
-               udelay(2000);
-       }
-       if (k==S3C44B0_IIC_TIMEOUT)
-               return -1;
-
-       buffer[j] = IICDS; /*save readed data*/
-
-       rIICSTAT = 0x90; /*master recv*/
-
-       /* Write operation Terminate sending STOP */
-       IICSTAT = rIICSTAT;
-       /*Clear Int Pending Bit to RESUME*/
-       temp = IICCON;
-       IICCON = temp & (~S3C44B0X_rIIC_INTPEND);
-
-       IICCON = IICCON | (1<<7);       /*restore ACK generation*/
-
-       return 0;
-}
-
-int i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len)
-{
-       int j, k;
-       u32 rIICSTAT, temp;
-
-
-       /*
-               send the device offset
-       */
-
-       rIICSTAT = 0xD0;
-       IICSTAT = rIICSTAT;
-
-       IICDS = chip;   /* this is a write operation... */
-
-       rIICSTAT |= (1<<5);
-       IICSTAT = rIICSTAT;
-
-       IICCON = IICCON & ~(S3C44B0X_rIIC_INTPEND);
-
-       /* wait and check ACK */
-       for(k=0; k<S3C44B0_IIC_TIMEOUT; k++) {
-               temp = IICCON;
-               if( (temp & S3C44B0X_rIIC_INTPEND) == S3C44B0X_rIIC_INTPEND)
-               break;
-               udelay(2000);
-       }
-       if (k==S3C44B0_IIC_TIMEOUT)
-               return -1;
-
-       temp = IICSTAT;
-       if ((temp & S3C44B0X_rIIC_LAST_RECEIV_BIT) == S3C44B0X_rIIC_LAST_RECEIV_BIT )
-               return -1;
-
-       IICDS = addr;
-       IICCON = IICCON & ~(S3C44B0X_rIIC_INTPEND);
-
-       /* wait and check ACK */
-       for(k=0; k<S3C44B0_IIC_TIMEOUT; k++) {
-               temp = IICCON;
-               if( (temp & S3C44B0X_rIIC_INTPEND) == S3C44B0X_rIIC_INTPEND)
-               break;
-               udelay(2000);
-       }
-       if (k==S3C44B0_IIC_TIMEOUT)
-         return -1;
-
-       temp = IICSTAT;
-       if ((temp & S3C44B0X_rIIC_LAST_RECEIV_BIT) == S3C44B0X_rIIC_LAST_RECEIV_BIT )
-               return -1;
-
-       /*
-               now we can start with the read write operation
-       */
-       for (j=0; j<len; j++) {
-
-               IICDS = buffer[j]; /*prerare data to write*/
-
-               /*clear pending bit to resume*/
-
-               temp = IICCON & ~(S3C44B0X_rIIC_INTPEND);
-               IICCON = temp;
-
-               /* wait but NOT check ACK */
-               for(k=0; k<S3C44B0_IIC_TIMEOUT; k++) {
-                       temp = IICCON;
-                       if( (temp & S3C44B0X_rIIC_INTPEND) == S3C44B0X_rIIC_INTPEND)
-                       break;
-
-                       udelay(2000);
-               }
-
-               if (k==S3C44B0_IIC_TIMEOUT)
-                       return -1;
-
-       } /* end for(j) */
-
-       /* sending stop to terminate */
-       rIICSTAT = 0xD0;  /*master send*/
-       IICSTAT = rIICSTAT;
-       /*Clear Int Pending Bit to RESUME*/
-       temp = IICCON;
-       IICCON = temp & (~S3C44B0X_rIIC_INTPEND);
-
-       return 0;
-}
diff --git a/cpu/s3c44b0/serial.c b/cpu/s3c44b0/serial.c
deleted file mode 100644 (file)
index 95d0266..0000000
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * (C) Copyright 2004
- * DAVE Srl
- * http://www.dave-tech.it
- * http://www.wawnet.biz
- * mailto:info@wawnet.biz
- *
- * (C) Copyright 2002-2004
- * Wolfgang Denk, DENX Software Engineering, <wd@denx.de>
- *
- * (C) Copyright 2002
- * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
- * Marius Groeger <mgroeger@sysgo.de>
- *
- * (C) Copyright 2002
- * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
- * Alex Zuepke <azu@sysgo.de>
- *
- * Copyright (C) 1999 2000 2001 Erik Mouw (J.A.K.Mouw@its.tudelft.nl)
- *
- * 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 <common.h>
-#include <asm/hardware.h>
-
-DECLARE_GLOBAL_DATA_PTR;
-
-/* flush serial input queue. returns 0 on success or negative error
- * number otherwise
- */
-static int serial_flush_input(void)
-{
-       volatile u32 tmp;
-
-       /* keep on reading as long as the receiver is not empty */
-       while(UTRSTAT0&0x01) {
-               tmp = REGB(URXH0);
-       }
-
-       return 0;
-}
-
-
-/* flush output queue. returns 0 on success or negative error number
- * otherwise
- */
-static int serial_flush_output(void)
-{
-       /* wait until the transmitter is no longer busy */
-       while(!(UTRSTAT0 & 0x02)) {
-       }
-
-       return 0;
-}
-
-
-void serial_setbrg (void)
-{
-       u32 divisor = 0;
-
-       /* get correct divisor */
-       switch(gd->baudrate) {
-
-       case 1200:
-#if CONFIG_S3C44B0_CLOCK_SPEED==66
-               divisor = 3124;
-#elif CONFIG_S3C44B0_CLOCK_SPEED==75
-               divisor = 3905;
-#else
-# error CONFIG_S3C44B0_CLOCK_SPEED undefined
-#endif
-               break;
-
-       case 9600:
-#if CONFIG_S3C44B0_CLOCK_SPEED==66
-               divisor = 390;
-#elif CONFIG_S3C44B0_CLOCK_SPEED==75
-               divisor = 487;
-#else
-# error CONFIG_S3C44B0_CLOCK_SPEED undefined
-#endif
-               break;
-
-       case 19200:
-#if CONFIG_S3C44B0_CLOCK_SPEED==66
-               divisor = 194;
-#elif CONFIG_S3C44B0_CLOCK_SPEED==75
-               divisor = 243;
-#else
-# error CONFIG_S3C44B0_CLOCK_SPEED undefined
-#endif
-               break;
-
-       case 38400:
-#if CONFIG_S3C44B0_CLOCK_SPEED==66
-               divisor = 97;
-#elif CONFIG_S3C44B0_CLOCK_SPEED==75
-               divisor = 121;
-#else
-# error CONFIG_S3C44B0_CLOCK_SPEED undefined
-#endif /* break; */
-
-       case 57600:
-#if CONFIG_S3C44B0_CLOCK_SPEED==66
-               divisor = 64;
-#elif CONFIG_S3C44B0_CLOCK_SPEED==75
-               divisor = 80;
-#else
-# error CONFIG_S3C44B0_CLOCK_SPEED undefined
-#endif /* break; */
-
-       case 115200:
-#if CONFIG_S3C44B0_CLOCK_SPEED==66
-               divisor = 32;
-#elif CONFIG_S3C44B0_CLOCK_SPEED==75
-               divisor = 40;
-#else
-# error CONFIG_S3C44B0_CLOCK_SPEED undefined
-#endif /* break; */
-       }
-
-       serial_flush_output();
-       serial_flush_input();
-       UFCON0 = 0x0;
-       ULCON0 = 0x03;
-       UCON0 = 0x05;
-       UBRDIV0 = divisor;
-
-       UFCON1 = 0x0;
-       ULCON1 = 0x03;
-       UCON1 = 0x05;
-       UBRDIV1 = divisor;
-
-       for(divisor=0; divisor<100; divisor++) {
-               /* NOP */
-       }
-}
-
-
-/*
- * Initialise the serial port with the given baudrate. The settings
- * are always 8 data bits, no parity, 1 stop bit, no start bits.
- *
- */
-int serial_init (void)
-{
-       serial_setbrg ();
-
-       return (0);
-}
-
-
-/*
- * Output a single byte to the serial port.
- */
-void serial_putc (const char c)
-{
-       /* wait for room in the transmit FIFO */
-       while(!(UTRSTAT0 & 0x02));
-
-       UTXH0 = (unsigned char)c;
-
-       /*
-               to be polite with serial console add a line feed
-               to the carriage return character
-       */
-       if (c=='\n')
-               serial_putc('\r');
-}
-
-/*
- * Read a single byte from the serial port. Returns 1 on success, 0
- * otherwise. When the function is succesfull, the character read is
- * written into its argument c.
- */
-int serial_tstc (void)
-{
-       return (UTRSTAT0 & 0x01);
-}
-
-/*
- * Read a single byte from the serial port. Returns 1 on success, 0
- * otherwise. When the function is succesfull, the character read is
- * written into its argument c.
- */
-int serial_getc (void)
-{
-       int rv;
-
-       for(;;) {
-               rv = serial_tstc();
-
-               if(rv > 0)
-                       return URXH0;
-       }
-}
-
-void
-serial_puts (const char *s)
-{
-       while (*s) {
-               serial_putc (*s++);
-       }
-}
index 790faebd3977910c9ed2bf8f00ea7235ccb8e6ca..fd696f7efb194948f591671d4c192f6c4140d59a 100644 (file)
@@ -26,7 +26,7 @@ include $(TOPDIR)/config.mk
 LIB    = $(obj)lib$(CPU).a
 
 START  = start.o
-COBJS  = serial.o interrupts.o cpu.o
+COBJS  = interrupts.o cpu.o
 
 SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
diff --git a/cpu/sa1100/serial.c b/cpu/sa1100/serial.c
deleted file mode 100644 (file)
index 5d18875..0000000
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * (C) Copyright 2002
- * Wolfgang Denk, DENX Software Engineering, <wd@denx.de>
- *
- * (C) Copyright 2002
- * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
- * Marius Groeger <mgroeger@sysgo.de>
- *
- * (C) Copyright 2002
- * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
- * Alex Zuepke <azu@sysgo.de>
- *
- * Copyright (C) 1999 2000 2001 Erik Mouw (J.A.K.Mouw@its.tudelft.nl)
- *
- * 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 <common.h>
-#include <SA-1100.h>
-
-DECLARE_GLOBAL_DATA_PTR;
-
-void serial_setbrg (void)
-{
-       unsigned int reg = 0;
-
-       if (gd->baudrate == 1200)
-               reg = 191;
-       else if (gd->baudrate == 9600)
-               reg = 23;
-       else if (gd->baudrate == 19200)
-               reg = 11;
-       else if (gd->baudrate == 38400)
-               reg = 5;
-       else if (gd->baudrate == 57600)
-               reg = 3;
-       else if (gd->baudrate == 115200)
-               reg = 1;
-       else
-               hang ();
-
-#ifdef CONFIG_SERIAL1
-       /* SA1110 uart function */
-       Ser1SDCR0 |= SDCR0_SUS;
-
-       /* Wait until port is ready ... */
-       while(Ser1UTSR1 & UTSR1_TBY) {}
-
-       /* init serial serial 1 */
-       Ser1UTCR3 = 0x00;
-       Ser1UTSR0 = 0xff;
-       Ser1UTCR0 = ( UTCR0_1StpBit | UTCR0_8BitData );
-       Ser1UTCR1 = 0;
-       Ser1UTCR2 = (u32)reg;
-       Ser1UTCR3 = ( UTCR3_RXE | UTCR3_TXE );
-#elif defined(CONFIG_SERIAL3)
-       /* Wait until port is ready ... */
-       while (Ser3UTSR1 & UTSR1_TBY) {
-       }
-
-       /* init serial serial 3 */
-       Ser3UTCR3 = 0x00;
-       Ser3UTSR0 = 0xff;
-       Ser3UTCR0 = (UTCR0_1StpBit | UTCR0_8BitData);
-       Ser3UTCR1 = 0;
-       Ser3UTCR2 = (u32) reg;
-       Ser3UTCR3 = (UTCR3_RXE | UTCR3_TXE);
-#else
-#error "Bad: you didn't configured serial ..."
-#endif
-}
-
-
-/*
- * Initialise the serial port with the given baudrate. The settings
- * are always 8 data bits, no parity, 1 stop bit, no start bits.
- *
- */
-int serial_init (void)
-{
-       serial_setbrg ();
-
-       return (0);
-}
-
-
-/*
- * Output a single byte to the serial port.
- */
-void serial_putc (const char c)
-{
-#ifdef CONFIG_SERIAL1
-       /* wait for room in the tx FIFO on SERIAL1 */
-       while ((Ser1UTSR0 & UTSR0_TFS) == 0);
-
-       Ser1UTDR = c;
-#elif defined(CONFIG_SERIAL3)
-       /* wait for room in the tx FIFO on SERIAL3 */
-       while ((Ser3UTSR0 & UTSR0_TFS) == 0);
-
-       Ser3UTDR = c;
-#endif
-
-       /* If \n, also do \r */
-       if (c == '\n')
-               serial_putc ('\r');
-}
-
-/*
- * Read a single byte from the serial port. Returns 1 on success, 0
- * otherwise. When the function is succesfull, the character read is
- * written into its argument c.
- */
-int serial_tstc (void)
-{
-#ifdef CONFIG_SERIAL1
-       return Ser1UTSR1 & UTSR1_RNE;
-#elif defined(CONFIG_SERIAL3)
-       return Ser3UTSR1 & UTSR1_RNE;
-#endif
-}
-
-/*
- * Read a single byte from the serial port. Returns 1 on success, 0
- * otherwise. When the function is succesfull, the character read is
- * written into its argument c.
- */
-int serial_getc (void)
-{
-#ifdef CONFIG_SERIAL1
-       while (!(Ser1UTSR1 & UTSR1_RNE));
-
-       return (char) Ser1UTDR & 0xff;
-#elif defined(CONFIG_SERIAL3)
-       while (!(Ser3UTSR1 & UTSR1_RNE));
-
-       return (char) Ser3UTDR & 0xff;
-#endif
-}
-
-void
-serial_puts (const char *s)
-{
-       while (*s) {
-               serial_putc (*s++);
-       }
-}
index 9c74657dad1004efd15f028c00ba0a34bf5109cb..ef32f13377616a6d1afee7d16dd308abb39181fb 100644 (file)
@@ -26,11 +26,14 @@ include $(TOPDIR)/config.mk
 LIB    := $(obj)libi2c.a
 
 COBJS-$(CONFIG_BFIN_TWI_I2C) += bfin-twi_i2c.o
+COBJS-$(CONFIG_DRIVER_DAVINCI_I2C) += davinci_i2c.o
 COBJS-$(CONFIG_FSL_I2C) += fsl_i2c.o
 COBJS-$(CONFIG_I2C_MXC) += mxc_i2c.o
 COBJS-$(CONFIG_DRIVER_OMAP1510_I2C) += omap1510_i2c.o
 COBJS-$(CONFIG_DRIVER_OMAP24XX_I2C) += omap24xx_i2c.o
 COBJS-$(CONFIG_DRIVER_OMAP34XX_I2C) += omap24xx_i2c.o
+COBJS-$(CONFIG_DRIVER_S3C24X0_I2C) += s3c24x0_i2c.o
+COBJS-$(CONFIG_S3C44B0_I2C) += s3c44b0_i2c.o
 COBJS-$(CONFIG_SOFT_I2C) += soft_i2c.o
 COBJS-$(CONFIG_TSI108_I2C) += tsi108_i2c.o
 
diff --git a/drivers/i2c/davinci_i2c.c b/drivers/i2c/davinci_i2c.c
new file mode 100644 (file)
index 0000000..eee1cbd
--- /dev/null
@@ -0,0 +1,329 @@
+/*
+ * TI DaVinci (TMS320DM644x) I2C driver.
+ *
+ * Copyright (C) 2007 Sergey Kubushyn <ksi@koi8.net>
+ *
+ * --------------------------------------------------------
+ *
+ * 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 <common.h>
+#include <i2c.h>
+#include <asm/arch/hardware.h>
+#include <asm/arch/i2c_defs.h>
+
+#define CHECK_NACK() \
+       do {\
+               if (tmp & (I2C_TIMEOUT | I2C_STAT_NACK)) {\
+                       REG(I2C_CON) = 0;\
+                       return(1);\
+               }\
+       } while (0)
+
+
+static int wait_for_bus(void)
+{
+       int     stat, timeout;
+
+       REG(I2C_STAT) = 0xffff;
+
+       for (timeout = 0; timeout < 10; timeout++) {
+               if (!((stat = REG(I2C_STAT)) & I2C_STAT_BB)) {
+                       REG(I2C_STAT) = 0xffff;
+                       return(0);
+               }
+
+               REG(I2C_STAT) = stat;
+               udelay(50000);
+       }
+
+       REG(I2C_STAT) = 0xffff;
+       return(1);
+}
+
+
+static int poll_i2c_irq(int mask)
+{
+       int     stat, timeout;
+
+       for (timeout = 0; timeout < 10; timeout++) {
+               udelay(1000);
+               stat = REG(I2C_STAT);
+               if (stat & mask) {
+                       return(stat);
+               }
+       }
+
+       REG(I2C_STAT) = 0xffff;
+       return(stat | I2C_TIMEOUT);
+}
+
+
+void flush_rx(void)
+{
+       int     dummy;
+
+       while (1) {
+               if (!(REG(I2C_STAT) & I2C_STAT_RRDY))
+                       break;
+
+               dummy = REG(I2C_DRR);
+               REG(I2C_STAT) = I2C_STAT_RRDY;
+               udelay(1000);
+       }
+}
+
+
+void i2c_init(int speed, int slaveadd)
+{
+       u_int32_t       div, psc;
+
+       if (REG(I2C_CON) & I2C_CON_EN) {
+               REG(I2C_CON) = 0;
+               udelay (50000);
+       }
+
+       psc = 2;
+       div = (CONFIG_SYS_HZ_CLOCK / ((psc + 1) * speed)) - 10; /* SCLL + SCLH */
+       REG(I2C_PSC) = psc;                     /* 27MHz / (2 + 1) = 9MHz */
+       REG(I2C_SCLL) = (div * 50) / 100;       /* 50% Duty */
+       REG(I2C_SCLH) = div - REG(I2C_SCLL);
+
+       REG(I2C_OA) = slaveadd;
+       REG(I2C_CNT) = 0;
+
+       /* Interrupts must be enabled or I2C module won't work */
+       REG(I2C_IE) = I2C_IE_SCD_IE | I2C_IE_XRDY_IE |
+               I2C_IE_RRDY_IE | I2C_IE_ARDY_IE | I2C_IE_NACK_IE;
+
+       /* Now enable I2C controller (get it out of reset) */
+       REG(I2C_CON) = I2C_CON_EN;
+
+       udelay(1000);
+}
+
+
+int i2c_probe(u_int8_t chip)
+{
+       int     rc = 1;
+
+       if (chip == REG(I2C_OA)) {
+               return(rc);
+       }
+
+       REG(I2C_CON) = 0;
+       if (wait_for_bus()) {return(1);}
+
+       /* try to read one byte from current (or only) address */
+       REG(I2C_CNT) = 1;
+       REG(I2C_SA) = chip;
+       REG(I2C_CON) = (I2C_CON_EN | I2C_CON_MST | I2C_CON_STT | I2C_CON_STP);
+       udelay (50000);
+
+       if (!(REG(I2C_STAT) & I2C_STAT_NACK)) {
+               rc = 0;
+               flush_rx();
+               REG(I2C_STAT) = 0xffff;
+       } else {
+               REG(I2C_STAT) = 0xffff;
+               REG(I2C_CON) |= I2C_CON_STP;
+               udelay(20000);
+               if (wait_for_bus()) {return(1);}
+       }
+
+       flush_rx();
+       REG(I2C_STAT) = 0xffff;
+       REG(I2C_CNT) = 0;
+       return(rc);
+}
+
+
+int i2c_read(u_int8_t chip, u_int32_t addr, int alen, u_int8_t *buf, int len)
+{
+       u_int32_t       tmp;
+       int             i;
+
+       if ((alen < 0) || (alen > 2)) {
+               printf("%s(): bogus address length %x\n", __FUNCTION__, alen);
+               return(1);
+       }
+
+       if (wait_for_bus()) {return(1);}
+
+       if (alen != 0) {
+               /* Start address phase */
+               tmp = I2C_CON_EN | I2C_CON_MST | I2C_CON_STT | I2C_CON_TRX;
+               REG(I2C_CNT) = alen;
+               REG(I2C_SA) = chip;
+               REG(I2C_CON) = tmp;
+
+               tmp = poll_i2c_irq(I2C_STAT_XRDY | I2C_STAT_NACK);
+
+               CHECK_NACK();
+
+               switch (alen) {
+                       case 2:
+                               /* Send address MSByte */
+                               if (tmp & I2C_STAT_XRDY) {
+                                       REG(I2C_DXR) = (addr >> 8) & 0xff;
+                               } else {
+                                       REG(I2C_CON) = 0;
+                                       return(1);
+                               }
+
+                               tmp = poll_i2c_irq(I2C_STAT_XRDY | I2C_STAT_NACK);
+
+                               CHECK_NACK();
+                               /* No break, fall through */
+                       case 1:
+                               /* Send address LSByte */
+                               if (tmp & I2C_STAT_XRDY) {
+                                       REG(I2C_DXR) = addr & 0xff;
+                               } else {
+                                       REG(I2C_CON) = 0;
+                                       return(1);
+                               }
+
+                               tmp = poll_i2c_irq(I2C_STAT_XRDY | I2C_STAT_NACK | I2C_STAT_ARDY);
+
+                               CHECK_NACK();
+
+                               if (!(tmp & I2C_STAT_ARDY)) {
+                                       REG(I2C_CON) = 0;
+                                       return(1);
+                               }
+               }
+       }
+
+       /* Address phase is over, now read 'len' bytes and stop */
+       tmp = I2C_CON_EN | I2C_CON_MST | I2C_CON_STT | I2C_CON_STP;
+       REG(I2C_CNT) = len & 0xffff;
+       REG(I2C_SA) = chip;
+       REG(I2C_CON) = tmp;
+
+       for (i = 0; i < len; i++) {
+               tmp = poll_i2c_irq(I2C_STAT_RRDY | I2C_STAT_NACK | I2C_STAT_ROVR);
+
+               CHECK_NACK();
+
+               if (tmp & I2C_STAT_RRDY) {
+                       buf[i] = REG(I2C_DRR);
+               } else {
+                       REG(I2C_CON) = 0;
+                       return(1);
+               }
+       }
+
+       tmp = poll_i2c_irq(I2C_STAT_SCD | I2C_STAT_NACK);
+
+       CHECK_NACK();
+
+       if (!(tmp & I2C_STAT_SCD)) {
+               REG(I2C_CON) = 0;
+               return(1);
+       }
+
+       flush_rx();
+       REG(I2C_STAT) = 0xffff;
+       REG(I2C_CNT) = 0;
+       REG(I2C_CON) = 0;
+
+       return(0);
+}
+
+
+int i2c_write(u_int8_t chip, u_int32_t addr, int alen, u_int8_t *buf, int len)
+{
+       u_int32_t       tmp;
+       int             i;
+
+       if ((alen < 0) || (alen > 2)) {
+               printf("%s(): bogus address length %x\n", __FUNCTION__, alen);
+               return(1);
+       }
+       if (len < 0) {
+               printf("%s(): bogus length %x\n", __FUNCTION__, len);
+               return(1);
+       }
+
+       if (wait_for_bus()) {return(1);}
+
+       /* Start address phase */
+       tmp = I2C_CON_EN | I2C_CON_MST | I2C_CON_STT | I2C_CON_TRX | I2C_CON_STP;
+       REG(I2C_CNT) = (alen == 0) ? len & 0xffff : (len & 0xffff) + alen;
+       REG(I2C_SA) = chip;
+       REG(I2C_CON) = tmp;
+
+       switch (alen) {
+               case 2:
+                       /* Send address MSByte */
+                       tmp = poll_i2c_irq(I2C_STAT_XRDY | I2C_STAT_NACK);
+
+                       CHECK_NACK();
+
+                       if (tmp & I2C_STAT_XRDY) {
+                               REG(I2C_DXR) = (addr >> 8) & 0xff;
+                       } else {
+                               REG(I2C_CON) = 0;
+                               return(1);
+                       }
+                       /* No break, fall through */
+               case 1:
+                       /* Send address LSByte */
+                       tmp = poll_i2c_irq(I2C_STAT_XRDY | I2C_STAT_NACK);
+
+                       CHECK_NACK();
+
+                       if (tmp & I2C_STAT_XRDY) {
+                               REG(I2C_DXR) = addr & 0xff;
+                       } else {
+                               REG(I2C_CON) = 0;
+                               return(1);
+                       }
+       }
+
+       for (i = 0; i < len; i++) {
+               tmp = poll_i2c_irq(I2C_STAT_XRDY | I2C_STAT_NACK);
+
+               CHECK_NACK();
+
+               if (tmp & I2C_STAT_XRDY) {
+                       REG(I2C_DXR) = buf[i];
+               } else {
+                       return(1);
+               }
+       }
+
+       tmp = poll_i2c_irq(I2C_STAT_SCD | I2C_STAT_NACK);
+
+       CHECK_NACK();
+
+       if (!(tmp & I2C_STAT_SCD)) {
+               REG(I2C_CON) = 0;
+               return(1);
+       }
+
+       flush_rx();
+       REG(I2C_STAT) = 0xffff;
+       REG(I2C_CNT) = 0;
+       REG(I2C_CON) = 0;
+
+       return(0);
+}
diff --git a/drivers/i2c/s3c24x0_i2c.c b/drivers/i2c/s3c24x0_i2c.c
new file mode 100644 (file)
index 0000000..f0c1aa3
--- /dev/null
@@ -0,0 +1,442 @@
+/*
+ * (C) Copyright 2002
+ * David Mueller, ELSOFT AG, d.mueller@elsoft.ch
+ *
+ * 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
+ */
+
+/* This code should work for both the S3C2400 and the S3C2410
+ * as they seem to have the same I2C controller inside.
+ * The different address mapping is handled by the s3c24xx.h files below.
+ */
+
+#include <common.h>
+#if defined(CONFIG_S3C2400)
+#include <s3c2400.h>
+#elif defined(CONFIG_S3C2410)
+#include <s3c2410.h>
+#endif
+#include <i2c.h>
+
+#ifdef CONFIG_HARD_I2C
+
+#define        I2C_WRITE       0
+#define I2C_READ       1
+
+#define I2C_OK         0
+#define I2C_NOK                1
+#define I2C_NACK       2
+#define I2C_NOK_LA     3               /* Lost arbitration */
+#define I2C_NOK_TOUT   4               /* time out */
+
+#define I2CSTAT_BSY    0x20            /* Busy bit */
+#define I2CSTAT_NACK   0x01            /* Nack bit */
+#define I2CCON_IRPND   0x10            /* Interrupt pending bit */
+#define I2C_MODE_MT    0xC0            /* Master Transmit Mode */
+#define I2C_MODE_MR    0x80            /* Master Receive Mode */
+#define I2C_START_STOP 0x20            /* START / STOP */
+#define I2C_TXRX_ENA   0x10            /* I2C Tx/Rx enable */
+
+#define I2C_TIMEOUT 1                  /* 1 second */
+
+
+static int GetI2CSDA(void)
+{
+       S3C24X0_GPIO * const gpio = S3C24X0_GetBase_GPIO();
+
+#ifdef CONFIG_S3C2410
+       return (gpio->GPEDAT & 0x8000) >> 15;
+#endif
+#ifdef CONFIG_S3C2400
+       return (gpio->PGDAT & 0x0020) >> 5;
+#endif
+}
+
+#if 0
+static void SetI2CSDA(int x)
+{
+       rGPEDAT = (rGPEDAT & ~0x8000) | (x&1) << 15;
+}
+#endif
+
+static void SetI2CSCL(int x)
+{
+       S3C24X0_GPIO * const gpio = S3C24X0_GetBase_GPIO();
+
+#ifdef CONFIG_S3C2410
+       gpio->GPEDAT = (gpio->GPEDAT & ~0x4000) | (x&1) << 14;
+#endif
+#ifdef CONFIG_S3C2400
+       gpio->PGDAT = (gpio->PGDAT & ~0x0040) | (x&1) << 6;
+#endif
+}
+
+
+static int WaitForXfer (void)
+{
+       S3C24X0_I2C *const i2c = S3C24X0_GetBase_I2C ();
+       int i, status;
+
+       i = I2C_TIMEOUT * 10000;
+       status = i2c->IICCON;
+       while ((i > 0) && !(status & I2CCON_IRPND)) {
+               udelay (100);
+               status = i2c->IICCON;
+               i--;
+       }
+
+       return (status & I2CCON_IRPND) ? I2C_OK : I2C_NOK_TOUT;
+}
+
+static int IsACK (void)
+{
+       S3C24X0_I2C *const i2c = S3C24X0_GetBase_I2C ();
+
+       return (!(i2c->IICSTAT & I2CSTAT_NACK));
+}
+
+static void ReadWriteByte (void)
+{
+       S3C24X0_I2C *const i2c = S3C24X0_GetBase_I2C ();
+
+       i2c->IICCON &= ~I2CCON_IRPND;
+}
+
+void i2c_init (int speed, int slaveadd)
+{
+       S3C24X0_I2C *const i2c = S3C24X0_GetBase_I2C ();
+       S3C24X0_GPIO *const gpio = S3C24X0_GetBase_GPIO ();
+       ulong freq, pres = 16, div;
+       int i, status;
+
+       /* wait for some time to give previous transfer a chance to finish */
+
+       i = I2C_TIMEOUT * 1000;
+       status = i2c->IICSTAT;
+       while ((i > 0) && (status & I2CSTAT_BSY)) {
+               udelay (1000);
+               status = i2c->IICSTAT;
+               i--;
+       }
+
+       if ((status & I2CSTAT_BSY) || GetI2CSDA () == 0) {
+#ifdef CONFIG_S3C2410
+               ulong old_gpecon = gpio->GPECON;
+#endif
+#ifdef CONFIG_S3C2400
+               ulong old_gpecon = gpio->PGCON;
+#endif
+               /* bus still busy probably by (most) previously interrupted transfer */
+
+#ifdef CONFIG_S3C2410
+               /* set I2CSDA and I2CSCL (GPE15, GPE14) to GPIO */
+               gpio->GPECON = (gpio->GPECON & ~0xF0000000) | 0x10000000;
+#endif
+#ifdef CONFIG_S3C2400
+               /* set I2CSDA and I2CSCL (PG5, PG6) to GPIO */
+               gpio->PGCON = (gpio->PGCON & ~0x00003c00) | 0x00001000;
+#endif
+
+               /* toggle I2CSCL until bus idle */
+               SetI2CSCL (0);
+               udelay (1000);
+               i = 10;
+               while ((i > 0) && (GetI2CSDA () != 1)) {
+                       SetI2CSCL (1);
+                       udelay (1000);
+                       SetI2CSCL (0);
+                       udelay (1000);
+                       i--;
+               }
+               SetI2CSCL (1);
+               udelay (1000);
+
+               /* restore pin functions */
+#ifdef CONFIG_S3C2410
+               gpio->GPECON = old_gpecon;
+#endif
+#ifdef CONFIG_S3C2400
+               gpio->PGCON = old_gpecon;
+#endif
+       }
+
+       /* calculate prescaler and divisor values */
+       freq = get_PCLK ();
+       if ((freq / pres / (16 + 1)) > speed)
+               /* set prescaler to 512 */
+               pres = 512;
+
+       div = 0;
+       while ((freq / pres / (div + 1)) > speed)
+               div++;
+
+       /* set prescaler, divisor according to freq, also set
+        * ACKGEN, IRQ */
+       i2c->IICCON = (div & 0x0F) | 0xA0 | ((pres == 512) ? 0x40 : 0);
+
+       /* init to SLAVE REVEIVE and set slaveaddr */
+       i2c->IICSTAT = 0;
+       i2c->IICADD = slaveadd;
+       /* program Master Transmit (and implicit STOP) */
+       i2c->IICSTAT = I2C_MODE_MT | I2C_TXRX_ENA;
+
+}
+
+/*
+ * cmd_type is 0 for write, 1 for read.
+ *
+ * addr_len can take any value from 0-255, it is only limited
+ * by the char, we could make it larger if needed. If it is
+ * 0 we skip the address write cycle.
+ */
+static
+int i2c_transfer (unsigned char cmd_type,
+                 unsigned char chip,
+                 unsigned char addr[],
+                 unsigned char addr_len,
+                 unsigned char data[], unsigned short data_len)
+{
+       S3C24X0_I2C *const i2c = S3C24X0_GetBase_I2C ();
+       int i, status, result;
+
+       if (data == 0 || data_len == 0) {
+               /*Don't support data transfer of no length or to address 0 */
+               printf ("i2c_transfer: bad call\n");
+               return I2C_NOK;
+       }
+
+       /* Check I2C bus idle */
+       i = I2C_TIMEOUT * 1000;
+       status = i2c->IICSTAT;
+       while ((i > 0) && (status & I2CSTAT_BSY)) {
+               udelay (1000);
+               status = i2c->IICSTAT;
+               i--;
+       }
+
+       if (status & I2CSTAT_BSY)
+               return I2C_NOK_TOUT;
+
+       i2c->IICCON |= 0x80;
+       result = I2C_OK;
+
+       switch (cmd_type) {
+       case I2C_WRITE:
+               if (addr && addr_len) {
+                       i2c->IICDS = chip;
+                       /* send START */
+                       i2c->IICSTAT = I2C_MODE_MT | I2C_TXRX_ENA | I2C_START_STOP;
+                       i = 0;
+                       while ((i < addr_len) && (result == I2C_OK)) {
+                               result = WaitForXfer ();
+                               i2c->IICDS = addr[i];
+                               ReadWriteByte ();
+                               i++;
+                       }
+                       i = 0;
+                       while ((i < data_len) && (result == I2C_OK)) {
+                               result = WaitForXfer ();
+                               i2c->IICDS = data[i];
+                               ReadWriteByte ();
+                               i++;
+                       }
+               } else {
+                       i2c->IICDS = chip;
+                       /* send START */
+                       i2c->IICSTAT = I2C_MODE_MT | I2C_TXRX_ENA | I2C_START_STOP;
+                       i = 0;
+                       while ((i < data_len) && (result = I2C_OK)) {
+                               result = WaitForXfer ();
+                               i2c->IICDS = data[i];
+                               ReadWriteByte ();
+                               i++;
+                       }
+               }
+
+               if (result == I2C_OK)
+                       result = WaitForXfer ();
+
+               /* send STOP */
+               i2c->IICSTAT = I2C_MODE_MR | I2C_TXRX_ENA;
+               ReadWriteByte ();
+               break;
+
+       case I2C_READ:
+               if (addr && addr_len) {
+                       i2c->IICSTAT = I2C_MODE_MT | I2C_TXRX_ENA;
+                       i2c->IICDS = chip;
+                       /* send START */
+                       i2c->IICSTAT |= I2C_START_STOP;
+                       result = WaitForXfer ();
+                       if (IsACK ()) {
+                               i = 0;
+                               while ((i < addr_len) && (result == I2C_OK)) {
+                                       i2c->IICDS = addr[i];
+                                       ReadWriteByte ();
+                                       result = WaitForXfer ();
+                                       i++;
+                               }
+
+                               i2c->IICDS = chip;
+                               /* resend START */
+                               i2c->IICSTAT =  I2C_MODE_MR | I2C_TXRX_ENA |
+                                               I2C_START_STOP;
+                               ReadWriteByte ();
+                               result = WaitForXfer ();
+                               i = 0;
+                               while ((i < data_len) && (result == I2C_OK)) {
+                                       /* disable ACK for final READ */
+                                       if (i == data_len - 1)
+                                               i2c->IICCON &= ~0x80;
+                                       ReadWriteByte ();
+                                       result = WaitForXfer ();
+                                       data[i] = i2c->IICDS;
+                                       i++;
+                               }
+                       } else {
+                               result = I2C_NACK;
+                       }
+
+               } else {
+                       i2c->IICSTAT = I2C_MODE_MR | I2C_TXRX_ENA;
+                       i2c->IICDS = chip;
+                       /* send START */
+                       i2c->IICSTAT |= I2C_START_STOP;
+                       result = WaitForXfer ();
+
+                       if (IsACK ()) {
+                               i = 0;
+                               while ((i < data_len) && (result == I2C_OK)) {
+                                       /* disable ACK for final READ */
+                                       if (i == data_len - 1)
+                                               i2c->IICCON &= ~0x80;
+                                       ReadWriteByte ();
+                                       result = WaitForXfer ();
+                                       data[i] = i2c->IICDS;
+                                       i++;
+                               }
+                       } else {
+                               result = I2C_NACK;
+                       }
+               }
+
+               /* send STOP */
+               i2c->IICSTAT = I2C_MODE_MR | I2C_TXRX_ENA;
+               ReadWriteByte ();
+               break;
+
+       default:
+               printf ("i2c_transfer: bad call\n");
+               result = I2C_NOK;
+               break;
+       }
+
+       return (result);
+}
+
+int i2c_probe (uchar chip)
+{
+       uchar buf[1];
+
+       buf[0] = 0;
+
+       /*
+        * What is needed is to send the chip address and verify that the
+        * address was <ACK>ed (i.e. there was a chip at that address which
+        * drove the data line low).
+        */
+       return (i2c_transfer (I2C_READ, chip << 1, 0, 0, buf, 1) != I2C_OK);
+}
+
+int i2c_read (uchar chip, uint addr, int alen, uchar * buffer, int len)
+{
+       uchar xaddr[4];
+       int ret;
+
+       if (alen > 4) {
+               printf ("I2C read: addr len %d not supported\n", alen);
+               return 1;
+       }
+
+       if (alen > 0) {
+               xaddr[0] = (addr >> 24) & 0xFF;
+               xaddr[1] = (addr >> 16) & 0xFF;
+               xaddr[2] = (addr >> 8) & 0xFF;
+               xaddr[3] = addr & 0xFF;
+       }
+
+#ifdef CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW
+       /*
+        * EEPROM chips that implement "address overflow" are ones
+        * like Catalyst 24WC04/08/16 which has 9/10/11 bits of
+        * address and the extra bits end up in the "chip address"
+        * bit slots. This makes a 24WC08 (1Kbyte) chip look like
+        * four 256 byte chips.
+        *
+        * Note that we consider the length of the address field to
+        * still be one byte because the extra address bits are
+        * hidden in the chip address.
+        */
+       if (alen > 0)
+               chip |= ((addr >> (alen * 8)) & CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW);
+#endif
+       if ((ret =
+            i2c_transfer (I2C_READ, chip << 1, &xaddr[4 - alen], alen,
+                          buffer, len)) != 0) {
+               printf ("I2c read: failed %d\n", ret);
+               return 1;
+       }
+       return 0;
+}
+
+int i2c_write (uchar chip, uint addr, int alen, uchar * buffer, int len)
+{
+       uchar xaddr[4];
+
+       if (alen > 4) {
+               printf ("I2C write: addr len %d not supported\n", alen);
+               return 1;
+       }
+
+       if (alen > 0) {
+               xaddr[0] = (addr >> 24) & 0xFF;
+               xaddr[1] = (addr >> 16) & 0xFF;
+               xaddr[2] = (addr >> 8) & 0xFF;
+               xaddr[3] = addr & 0xFF;
+       }
+#ifdef CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW
+       /*
+        * EEPROM chips that implement "address overflow" are ones
+        * like Catalyst 24WC04/08/16 which has 9/10/11 bits of
+        * address and the extra bits end up in the "chip address"
+        * bit slots. This makes a 24WC08 (1Kbyte) chip look like
+        * four 256 byte chips.
+        *
+        * Note that we consider the length of the address field to
+        * still be one byte because the extra address bits are
+        * hidden in the chip address.
+        */
+       if (alen > 0)
+               chip |= ((addr >> (alen * 8)) & CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW);
+#endif
+       return (i2c_transfer
+               (I2C_WRITE, chip << 1, &xaddr[4 - alen], alen, buffer,
+                len) != 0);
+}
+#endif /* CONFIG_HARD_I2C */
diff --git a/drivers/i2c/s3c44b0_i2c.c b/drivers/i2c/s3c44b0_i2c.c
new file mode 100644 (file)
index 0000000..b4d904b
--- /dev/null
@@ -0,0 +1,315 @@
+/*
+ * (C) Copyright 2004
+ * DAVE Srl
+ * http://www.dave-tech.it
+ * http://www.wawnet.biz
+ * mailto:info@wawnet.biz
+ *
+ * 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 <common.h>
+#include <command.h>
+#include <asm/hardware.h>
+
+/*
+ * Initialization, must be called once on start up, may be called
+ * repeatedly to change the speed and slave addresses.
+ */
+void i2c_init(int speed, int slaveaddr)
+{
+       /*
+               setting up I2C support
+       */
+       unsigned int save_F,save_PF,rIICCON,rPCONA,rPDATA,rPCONF,rPUPF;
+
+       save_F = PCONF;
+       save_PF = PUPF;
+
+       rPCONF = ((save_F & ~(0xF))| 0xa);
+       rPUPF = (save_PF | 0x3);
+       PCONF = rPCONF; /*PF0:IICSCL, PF1:IICSDA*/
+       PUPF = rPUPF; /* Disable pull-up */
+
+       /* Configuring pin for WC pin of EEprom */
+       rPCONA = PCONA;
+       rPCONA &= ~(1<<9);
+       PCONA = rPCONA;
+
+       rPDATA = PDATA;
+       rPDATA &= ~(1<<9);
+       PDATA = rPDATA;
+
+       /*
+               Enable ACK, IICCLK=MCLK/16, enable interrupt
+               75MHz/16/(12+1) = 390625 Hz
+       */
+       rIICCON=(1<<7)|(0<<6)|(1<<5)|(0xC);
+       IICCON = rIICCON;
+
+       IICADD = slaveaddr;
+}
+
+/*
+ * Probe the given I2C chip address.  Returns 0 if a chip responded,
+ * not 0 on failure.
+ */
+int i2c_probe(uchar chip)
+{
+       /*
+               not implemented
+       */
+
+       printf("i2c_probe chip %d\n", (int) chip);
+       return -1;
+}
+
+/*
+ * Read/Write interface:
+ *   chip:    I2C chip address, range 0..127
+ *   addr:    Memory (register) address within the chip
+ *   alen:    Number of bytes to use for addr (typically 1, 2 for larger
+ *              memories, 0 for register type devices with only one
+ *              register)
+ *   buffer:  Where to read/write the data
+ *   len:     How many bytes to read/write
+ *
+ *   Returns: 0 on success, not 0 on failure
+ */
+
+#define S3C44B0X_rIIC_INTPEND               (1<<4)
+#define S3C44B0X_rIIC_LAST_RECEIV_BIT       (1<<0)
+#define S3C44B0X_rIIC_INTERRUPT_ENABLE      (1<<5)
+#define S3C44B0_IIC_TIMEOUT 100
+
+int i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len)
+{
+
+       int k, j, temp;
+       u32 rIICSTAT;
+
+       /*
+               send the device offset
+       */
+
+       rIICSTAT = 0xD0;
+       IICSTAT = rIICSTAT;
+
+       IICDS = chip;   /* this is a write operation... */
+
+       rIICSTAT |= (1<<5);
+       IICSTAT = rIICSTAT;
+
+       for(k=0; k<S3C44B0_IIC_TIMEOUT; k++) {
+               temp = IICCON;
+               if( (temp & S3C44B0X_rIIC_INTPEND) == S3C44B0X_rIIC_INTPEND)
+               break;
+               udelay(2000);
+       }
+       if (k==S3C44B0_IIC_TIMEOUT)
+               return -1;
+
+       /* wait and check ACK */
+       temp = IICSTAT;
+       if ((temp & S3C44B0X_rIIC_LAST_RECEIV_BIT) == S3C44B0X_rIIC_LAST_RECEIV_BIT )
+               return -1;
+
+       IICDS = addr;
+       IICCON = IICCON & ~(S3C44B0X_rIIC_INTPEND);
+
+       /* wait and check ACK */
+       for(k=0; k<S3C44B0_IIC_TIMEOUT; k++) {
+               temp = IICCON;
+               if( (temp & S3C44B0X_rIIC_INTPEND) == S3C44B0X_rIIC_INTPEND)
+               break;
+               udelay(2000);
+       }
+       if (k==S3C44B0_IIC_TIMEOUT)
+               return -1;
+
+       temp = IICSTAT;
+       if ((temp & S3C44B0X_rIIC_LAST_RECEIV_BIT) == S3C44B0X_rIIC_LAST_RECEIV_BIT )
+               return -1;
+
+       /*
+               now we can start with the read operation...
+       */
+
+       IICDS = chip | 0x01;    /* this is a read operation... */
+
+       rIICSTAT = 0x90; /*master recv*/
+       rIICSTAT |= (1<<5);
+       IICSTAT = rIICSTAT;
+
+       IICCON = IICCON & ~(S3C44B0X_rIIC_INTPEND);
+
+       /* wait and check ACK */
+       for(k=0; k<S3C44B0_IIC_TIMEOUT; k++) {
+               temp = IICCON;
+               if( (temp & S3C44B0X_rIIC_INTPEND) == S3C44B0X_rIIC_INTPEND)
+               break;
+               udelay(2000);
+       }
+       if (k==S3C44B0_IIC_TIMEOUT)
+               return -1;
+
+       temp = IICSTAT;
+       if ((temp & S3C44B0X_rIIC_LAST_RECEIV_BIT) == S3C44B0X_rIIC_LAST_RECEIV_BIT )
+               return -1;
+
+       for (j=0; j<len-1; j++) {
+
+       /*clear pending bit to resume */
+
+       temp = IICCON & ~(S3C44B0X_rIIC_INTPEND);
+       IICCON = temp;
+
+       /* wait and check ACK */
+       for(k=0; k<S3C44B0_IIC_TIMEOUT; k++) {
+               temp = IICCON;
+               if( (temp & S3C44B0X_rIIC_INTPEND) == S3C44B0X_rIIC_INTPEND)
+               break;
+               udelay(2000);
+       }
+       if (k==S3C44B0_IIC_TIMEOUT)
+               return -1;
+
+
+               buffer[j] = IICDS; /*save readed data*/
+
+    } /*end for(j)*/
+
+       /*
+               reading the last data
+               unset ACK generation
+       */
+       temp = IICCON & ~(S3C44B0X_rIIC_INTPEND | (1<<7));
+       IICCON = temp;
+
+       /* wait but NOT check ACK */
+       for(k=0; k<S3C44B0_IIC_TIMEOUT; k++) {
+               temp = IICCON;
+               if( (temp & S3C44B0X_rIIC_INTPEND) == S3C44B0X_rIIC_INTPEND)
+               break;
+               udelay(2000);
+       }
+       if (k==S3C44B0_IIC_TIMEOUT)
+               return -1;
+
+       buffer[j] = IICDS; /*save readed data*/
+
+       rIICSTAT = 0x90; /*master recv*/
+
+       /* Write operation Terminate sending STOP */
+       IICSTAT = rIICSTAT;
+       /*Clear Int Pending Bit to RESUME*/
+       temp = IICCON;
+       IICCON = temp & (~S3C44B0X_rIIC_INTPEND);
+
+       IICCON = IICCON | (1<<7);       /*restore ACK generation*/
+
+       return 0;
+}
+
+int i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len)
+{
+       int j, k;
+       u32 rIICSTAT, temp;
+
+
+       /*
+               send the device offset
+       */
+
+       rIICSTAT = 0xD0;
+       IICSTAT = rIICSTAT;
+
+       IICDS = chip;   /* this is a write operation... */
+
+       rIICSTAT |= (1<<5);
+       IICSTAT = rIICSTAT;
+
+       IICCON = IICCON & ~(S3C44B0X_rIIC_INTPEND);
+
+       /* wait and check ACK */
+       for(k=0; k<S3C44B0_IIC_TIMEOUT; k++) {
+               temp = IICCON;
+               if( (temp & S3C44B0X_rIIC_INTPEND) == S3C44B0X_rIIC_INTPEND)
+               break;
+               udelay(2000);
+       }
+       if (k==S3C44B0_IIC_TIMEOUT)
+               return -1;
+
+       temp = IICSTAT;
+       if ((temp & S3C44B0X_rIIC_LAST_RECEIV_BIT) == S3C44B0X_rIIC_LAST_RECEIV_BIT )
+               return -1;
+
+       IICDS = addr;
+       IICCON = IICCON & ~(S3C44B0X_rIIC_INTPEND);
+
+       /* wait and check ACK */
+       for(k=0; k<S3C44B0_IIC_TIMEOUT; k++) {
+               temp = IICCON;
+               if( (temp & S3C44B0X_rIIC_INTPEND) == S3C44B0X_rIIC_INTPEND)
+               break;
+               udelay(2000);
+       }
+       if (k==S3C44B0_IIC_TIMEOUT)
+         return -1;
+
+       temp = IICSTAT;
+       if ((temp & S3C44B0X_rIIC_LAST_RECEIV_BIT) == S3C44B0X_rIIC_LAST_RECEIV_BIT )
+               return -1;
+
+       /*
+               now we can start with the read write operation
+       */
+       for (j=0; j<len; j++) {
+
+               IICDS = buffer[j]; /*prerare data to write*/
+
+               /*clear pending bit to resume*/
+
+               temp = IICCON & ~(S3C44B0X_rIIC_INTPEND);
+               IICCON = temp;
+
+               /* wait but NOT check ACK */
+               for(k=0; k<S3C44B0_IIC_TIMEOUT; k++) {
+                       temp = IICCON;
+                       if( (temp & S3C44B0X_rIIC_INTPEND) == S3C44B0X_rIIC_INTPEND)
+                       break;
+
+                       udelay(2000);
+               }
+
+               if (k==S3C44B0_IIC_TIMEOUT)
+                       return -1;
+
+       } /* end for(j) */
+
+       /* sending stop to terminate */
+       rIICSTAT = 0xD0;  /*master send*/
+       IICSTAT = rIICSTAT;
+       /*Clear Int Pending Bit to RESUME*/
+       temp = IICCON;
+       IICCON = temp & (~S3C44B0X_rIIC_INTPEND);
+
+       return 0;
+}
index 03b0028e7c6510bf60c18b97fc3b8b7abd53b008..471cd6bcf741694046a1f650c0f2322f644a1c75 100644 (file)
@@ -37,9 +37,11 @@ endif
 
 COBJS-$(CONFIG_NAND_ATMEL) += atmel_nand.o
 COBJS-$(CONFIG_DRIVER_NAND_BFIN) += bfin_nand.o
+COBJS-$(CONFIG_NAND_DAVINCI) += davinci_nand.o
 COBJS-$(CONFIG_NAND_FSL_ELBC) += fsl_elbc_nand.o
 COBJS-$(CONFIG_NAND_FSL_UPM) += fsl_upm.o
 COBJS-$(CONFIG_NAND_NOMADIK) += nomadik.o
+COBJS-$(CONFIG_NAND_S3C2410) += s3c2410_nand.c
 COBJS-$(CONFIG_NAND_S3C64XX) += s3c64xx.o
 COBJS-$(CONFIG_NAND_OMAP_GPMC) += omap_gpmc.o
 endif
diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c
new file mode 100644 (file)
index 0000000..a974667
--- /dev/null
@@ -0,0 +1,466 @@
+/*
+ * NAND driver for TI DaVinci based boards.
+ *
+ * Copyright (C) 2007 Sergey Kubushyn <ksi@koi8.net>
+ *
+ * Based on Linux DaVinci NAND driver by TI. Original copyright follows:
+ */
+
+/*
+ *
+ * linux/drivers/mtd/nand/nand_davinci.c
+ *
+ * NAND Flash Driver
+ *
+ * Copyright (C) 2006 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.
+ * ----------------------------------------------------------------------------
+ *
+ *  Overview:
+ *   This is a device driver for the NAND flash device found on the
+ *   DaVinci board which utilizes the Samsung k9k2g08 part.
+ *
+ Modifications:
+ ver. 1.0: Feb 2005, Vinod/Sudhakar
+ -
+ *
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <nand.h>
+#include <asm/arch/nand_defs.h>
+#include <asm/arch/emif_defs.h>
+
+extern struct nand_chip nand_dev_desc[CONFIG_SYS_MAX_NAND_DEVICE];
+
+static void nand_davinci_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl)
+{
+       struct          nand_chip *this = mtd->priv;
+       u_int32_t       IO_ADDR_W = (u_int32_t)this->IO_ADDR_W;
+
+       IO_ADDR_W &= ~(MASK_ALE|MASK_CLE);
+
+       if (ctrl & NAND_CTRL_CHANGE) {
+               if ( ctrl & NAND_CLE )
+                       IO_ADDR_W |= MASK_CLE;
+               if ( ctrl & NAND_ALE )
+                       IO_ADDR_W |= MASK_ALE;
+               this->IO_ADDR_W = (void __iomem *) IO_ADDR_W;
+       }
+
+       if (cmd != NAND_CMD_NONE)
+               writeb(cmd, this->IO_ADDR_W);
+}
+
+/* Set WP on deselect, write enable on select */
+static void nand_davinci_select_chip(struct mtd_info *mtd, int chip)
+{
+#define GPIO_SET_DATA01        0x01c67018
+#define GPIO_CLR_DATA01        0x01c6701c
+#define GPIO_NAND_WP   (1 << 4)
+#ifdef SONATA_BOARD_GPIOWP
+       if (chip < 0) {
+               REG(GPIO_CLR_DATA01) |= GPIO_NAND_WP;
+       } else {
+               REG(GPIO_SET_DATA01) |= GPIO_NAND_WP;
+       }
+#endif
+}
+
+#ifdef CONFIG_SYS_NAND_HW_ECC
+#ifdef CONFIG_SYS_DAVINCI_BROKEN_ECC
+/* Linux-compatible ECC uses MTD defaults. */
+/* These layouts are not compatible with Linux or RBL/UBL. */
+#ifdef CONFIG_SYS_NAND_LARGEPAGE
+static struct nand_ecclayout davinci_nand_ecclayout = {
+       .eccbytes = 12,
+       .eccpos = {8, 9, 10, 24, 25, 26, 40, 41, 42, 56, 57, 58},
+       .oobfree = {
+               {.offset = 2, .length = 6},
+               {.offset = 12, .length = 12},
+               {.offset = 28, .length = 12},
+               {.offset = 44, .length = 12},
+               {.offset = 60, .length = 4}
+       }
+};
+#elif defined(CONFIG_SYS_NAND_SMALLPAGE)
+static struct nand_ecclayout davinci_nand_ecclayout = {
+       .eccbytes = 3,
+       .eccpos = {0, 1, 2},
+       .oobfree = {
+               {.offset = 6, .length = 2},
+               {.offset = 8, .length = 8}
+       }
+};
+#else
+#error "Either CONFIG_SYS_NAND_LARGEPAGE or CONFIG_SYS_NAND_SMALLPAGE must be defined!"
+#endif
+#endif /* CONFIG_SYS_DAVINCI_BROKEN_ECC */
+
+static void nand_davinci_enable_hwecc(struct mtd_info *mtd, int mode)
+{
+       emifregs        emif_addr;
+       int             dummy;
+
+       emif_addr = (emifregs)DAVINCI_ASYNC_EMIF_CNTRL_BASE;
+
+       dummy = emif_addr->NANDF1ECC;
+       dummy = emif_addr->NANDF2ECC;
+       dummy = emif_addr->NANDF3ECC;
+       dummy = emif_addr->NANDF4ECC;
+
+       emif_addr->NANDFCR |= (1 << 8);
+}
+
+static u_int32_t nand_davinci_readecc(struct mtd_info *mtd, u_int32_t region)
+{
+       u_int32_t       ecc = 0;
+       emifregs        emif_base_addr;
+
+       emif_base_addr = (emifregs)DAVINCI_ASYNC_EMIF_CNTRL_BASE;
+
+       if (region == 1)
+               ecc = emif_base_addr->NANDF1ECC;
+       else if (region == 2)
+               ecc = emif_base_addr->NANDF2ECC;
+       else if (region == 3)
+               ecc = emif_base_addr->NANDF3ECC;
+       else if (region == 4)
+               ecc = emif_base_addr->NANDF4ECC;
+
+       return(ecc);
+}
+
+static int nand_davinci_calculate_ecc(struct mtd_info *mtd, const u_char *dat, u_char *ecc_code)
+{
+       u_int32_t               tmp;
+#ifdef CONFIG_SYS_DAVINCI_BROKEN_ECC
+       /*
+        * This is not how you should read ECCs on large page Davinci devices.
+        * The region parameter gets you ECCs for flash chips on different chip
+        * selects, not the 4x512 byte pages in a 2048 byte page.
+        *
+        * Preserved for backwards compatibility though.
+        */
+
+       int                     region, n;
+       struct nand_chip        *this = mtd->priv;
+
+       n = (this->ecc.size/512);
+
+       region = 1;
+       while (n--) {
+               tmp = nand_davinci_readecc(mtd, region);
+               *ecc_code++ = tmp;
+               *ecc_code++ = tmp >> 16;
+               *ecc_code++ = ((tmp >> 8) & 0x0f) | ((tmp >> 20) & 0xf0);
+               region++;
+       }
+#else
+       const int region = 1;
+
+       tmp = nand_davinci_readecc(mtd, region);
+
+       /* Squeeze 4 bytes ECC into 3 bytes by removing RESERVED bits
+        * and shifting. RESERVED bits are 31 to 28 and 15 to 12. */
+       tmp = (tmp & 0x00000fff) | ((tmp & 0x0fff0000) >> 4);
+
+       /* Invert so that erased block ECC is correct */
+       tmp = ~tmp;
+
+       *ecc_code++ = tmp;
+       *ecc_code++ = tmp >>  8;
+       *ecc_code++ = tmp >> 16;
+#endif /* CONFIG_SYS_DAVINCI_BROKEN_ECC */
+       return(0);
+}
+
+#ifdef CONFIG_SYS_DAVINCI_BROKEN_ECC
+static void nand_davinci_gen_true_ecc(u_int8_t *ecc_buf)
+{
+       u_int32_t       tmp = ecc_buf[0] | (ecc_buf[1] << 16) | ((ecc_buf[2] & 0xf0) << 20) | ((ecc_buf[2] & 0x0f) << 8);
+
+       ecc_buf[0] = ~(P64o(tmp) | P64e(tmp) | P32o(tmp) | P32e(tmp) | P16o(tmp) | P16e(tmp) | P8o(tmp) | P8e(tmp));
+       ecc_buf[1] = ~(P1024o(tmp) | P1024e(tmp) | P512o(tmp) | P512e(tmp) | P256o(tmp) | P256e(tmp) | P128o(tmp) | P128e(tmp));
+       ecc_buf[2] = ~( P4o(tmp) | P4e(tmp) | P2o(tmp) | P2e(tmp) | P1o(tmp) | P1e(tmp) | P2048o(tmp) | P2048e(tmp));
+}
+
+static int nand_davinci_compare_ecc(u_int8_t *ecc_nand, u_int8_t *ecc_calc, u_int8_t *page_data)
+{
+       u_int32_t       i;
+       u_int8_t        tmp0_bit[8], tmp1_bit[8], tmp2_bit[8];
+       u_int8_t        comp0_bit[8], comp1_bit[8], comp2_bit[8];
+       u_int8_t        ecc_bit[24];
+       u_int8_t        ecc_sum = 0;
+       u_int8_t        find_bit = 0;
+       u_int32_t       find_byte = 0;
+       int             is_ecc_ff;
+
+       is_ecc_ff = ((*ecc_nand == 0xff) && (*(ecc_nand + 1) == 0xff) && (*(ecc_nand + 2) == 0xff));
+
+       nand_davinci_gen_true_ecc(ecc_nand);
+       nand_davinci_gen_true_ecc(ecc_calc);
+
+       for (i = 0; i <= 2; i++) {
+               *(ecc_nand + i) = ~(*(ecc_nand + i));
+               *(ecc_calc + i) = ~(*(ecc_calc + i));
+       }
+
+       for (i = 0; i < 8; i++) {
+               tmp0_bit[i] = *ecc_nand % 2;
+               *ecc_nand = *ecc_nand / 2;
+       }
+
+       for (i = 0; i < 8; i++) {
+               tmp1_bit[i] = *(ecc_nand + 1) % 2;
+               *(ecc_nand + 1) = *(ecc_nand + 1) / 2;
+       }
+
+       for (i = 0; i < 8; i++) {
+               tmp2_bit[i] = *(ecc_nand + 2) % 2;
+               *(ecc_nand + 2) = *(ecc_nand + 2) / 2;
+       }
+
+       for (i = 0; i < 8; i++) {
+               comp0_bit[i] = *ecc_calc % 2;
+               *ecc_calc = *ecc_calc / 2;
+       }
+
+       for (i = 0; i < 8; i++) {
+               comp1_bit[i] = *(ecc_calc + 1) % 2;
+               *(ecc_calc + 1) = *(ecc_calc + 1) / 2;
+       }
+
+       for (i = 0; i < 8; i++) {
+               comp2_bit[i] = *(ecc_calc + 2) % 2;
+               *(ecc_calc + 2) = *(ecc_calc + 2) / 2;
+       }
+
+       for (i = 0; i< 6; i++)
+               ecc_bit[i] = tmp2_bit[i + 2] ^ comp2_bit[i + 2];
+
+       for (i = 0; i < 8; i++)
+               ecc_bit[i + 6] = tmp0_bit[i] ^ comp0_bit[i];
+
+       for (i = 0; i < 8; i++)
+               ecc_bit[i + 14] = tmp1_bit[i] ^ comp1_bit[i];
+
+       ecc_bit[22] = tmp2_bit[0] ^ comp2_bit[0];
+       ecc_bit[23] = tmp2_bit[1] ^ comp2_bit[1];
+
+       for (i = 0; i < 24; i++)
+               ecc_sum += ecc_bit[i];
+
+       switch (ecc_sum) {
+               case 0:
+                       /* Not reached because this function is not called if
+                          ECC values are equal */
+                       return 0;
+               case 1:
+                       /* Uncorrectable error */
+                       MTDDEBUG (MTD_DEBUG_LEVEL0,
+                                 "ECC UNCORRECTED_ERROR 1\n");
+                       return(-1);
+               case 12:
+                       /* Correctable error */
+                       find_byte = (ecc_bit[23] << 8) +
+                               (ecc_bit[21] << 7) +
+                               (ecc_bit[19] << 6) +
+                               (ecc_bit[17] << 5) +
+                               (ecc_bit[15] << 4) +
+                               (ecc_bit[13] << 3) +
+                               (ecc_bit[11] << 2) +
+                               (ecc_bit[9]  << 1) +
+                               ecc_bit[7];
+
+                       find_bit = (ecc_bit[5] << 2) + (ecc_bit[3] << 1) + ecc_bit[1];
+
+                       MTDDEBUG (MTD_DEBUG_LEVEL0, "Correcting single bit ECC "
+                                 "error at offset: %d, bit: %d\n",
+                                 find_byte, find_bit);
+
+                       page_data[find_byte] ^= (1 << find_bit);
+
+                       return(0);
+               default:
+                       if (is_ecc_ff) {
+                               if (ecc_calc[0] == 0 && ecc_calc[1] == 0 && ecc_calc[2] == 0)
+                                       return(0);
+                       }
+                       MTDDEBUG (MTD_DEBUG_LEVEL0,
+                                 "UNCORRECTED_ERROR default\n");
+                       return(-1);
+       }
+}
+#endif /* CONFIG_SYS_DAVINCI_BROKEN_ECC */
+
+static int nand_davinci_correct_data(struct mtd_info *mtd, u_char *dat, u_char *read_ecc, u_char *calc_ecc)
+{
+       struct nand_chip *this = mtd->priv;
+#ifdef CONFIG_SYS_DAVINCI_BROKEN_ECC
+       int                     block_count = 0, i, rc;
+
+       block_count = (this->ecc.size/512);
+       for (i = 0; i < block_count; i++) {
+               if (memcmp(read_ecc, calc_ecc, 3) != 0) {
+                       rc = nand_davinci_compare_ecc(read_ecc, calc_ecc, dat);
+                       if (rc < 0) {
+                               return(rc);
+                       }
+               }
+               read_ecc += 3;
+               calc_ecc += 3;
+               dat += 512;
+       }
+#else
+       u_int32_t ecc_nand = read_ecc[0] | (read_ecc[1] << 8) |
+                                         (read_ecc[2] << 16);
+       u_int32_t ecc_calc = calc_ecc[0] | (calc_ecc[1] << 8) |
+                                         (calc_ecc[2] << 16);
+       u_int32_t diff = ecc_calc ^ ecc_nand;
+
+       if (diff) {
+               if ((((diff >> 12) ^ diff) & 0xfff) == 0xfff) {
+                       /* Correctable error */
+                       if ((diff >> (12 + 3)) < this->ecc.size) {
+                               uint8_t find_bit = 1 << ((diff >> 12) & 7);
+                               uint32_t find_byte = diff >> (12 + 3);
+
+                               dat[find_byte] ^= find_bit;
+                               MTDDEBUG(MTD_DEBUG_LEVEL0, "Correcting single "
+                                        "bit ECC error at offset: %d, bit: "
+                                        "%d\n", find_byte, find_bit);
+                               return 1;
+                       } else {
+                               return -1;
+                       }
+               } else if (!(diff & (diff - 1))) {
+                       /* Single bit ECC error in the ECC itself,
+                          nothing to fix */
+                       MTDDEBUG(MTD_DEBUG_LEVEL0, "Single bit ECC error in "
+                                "ECC.\n");
+                       return 1;
+               } else {
+                       /* Uncorrectable error */
+                       MTDDEBUG(MTD_DEBUG_LEVEL0, "ECC UNCORRECTED_ERROR 1\n");
+                       return -1;
+               }
+       }
+#endif /* CONFIG_SYS_DAVINCI_BROKEN_ECC */
+       return(0);
+}
+#endif /* CONFIG_SYS_NAND_HW_ECC */
+
+static int nand_davinci_dev_ready(struct mtd_info *mtd)
+{
+       emifregs        emif_addr;
+
+       emif_addr = (emifregs)DAVINCI_ASYNC_EMIF_CNTRL_BASE;
+
+       return(emif_addr->NANDFSR & 0x1);
+}
+
+static int nand_davinci_waitfunc(struct mtd_info *mtd, struct nand_chip *this)
+{
+       while(!nand_davinci_dev_ready(mtd)) {;}
+       *NAND_CE0CLE = NAND_STATUS;
+       return(*NAND_CE0DATA);
+}
+
+static void nand_flash_init(void)
+{
+       u_int32_t       acfg1 = 0x3ffffffc;
+       u_int32_t       acfg2 = 0x3ffffffc;
+       u_int32_t       acfg3 = 0x3ffffffc;
+       u_int32_t       acfg4 = 0x3ffffffc;
+       emifregs        emif_regs;
+
+       /*------------------------------------------------------------------*
+        *  NAND FLASH CHIP TIMEOUT @ 459 MHz                               *
+        *                                                                  *
+        *  AEMIF.CLK freq   = PLL1/6 = 459/6 = 76.5 MHz                    *
+        *  AEMIF.CLK period = 1/76.5 MHz = 13.1 ns                         *
+        *                                                                  *
+        *------------------------------------------------------------------*/
+        acfg1 = 0
+               | (0 << 31 )    /* selectStrobe */
+               | (0 << 30 )    /* extWait */
+               | (1 << 26 )    /* writeSetup   10 ns */
+               | (3 << 20 )    /* writeStrobe  40 ns */
+               | (1 << 17 )    /* writeHold    10 ns */
+               | (1 << 13 )    /* readSetup    10 ns */
+               | (5 << 7 )     /* readStrobe   60 ns */
+               | (1 << 4 )     /* readHold     10 ns */
+               | (3 << 2 )     /* turnAround   ?? ns */
+               | (0 << 0 )     /* asyncSize    8-bit bus */
+               ;
+
+       emif_regs = (emifregs)DAVINCI_ASYNC_EMIF_CNTRL_BASE;
+
+       emif_regs->AWCCR |= 0x10000000;
+       emif_regs->AB1CR = acfg1;       /* 0x08244128 */;
+       emif_regs->AB2CR = acfg2;
+       emif_regs->AB3CR = acfg3;
+       emif_regs->AB4CR = acfg4;
+       emif_regs->NANDFCR = 0x00000101;
+}
+
+int board_nand_init(struct nand_chip *nand)
+{
+       nand->IO_ADDR_R   = (void  __iomem *)NAND_CE0DATA;
+       nand->IO_ADDR_W   = (void  __iomem *)NAND_CE0DATA;
+       nand->chip_delay  = 0;
+       nand->select_chip = nand_davinci_select_chip;
+#ifdef CONFIG_SYS_NAND_USE_FLASH_BBT
+       nand->options     = NAND_USE_FLASH_BBT;
+#endif
+#ifdef CONFIG_SYS_NAND_HW_ECC
+       nand->ecc.mode = NAND_ECC_HW;
+#ifdef CONFIG_SYS_DAVINCI_BROKEN_ECC
+       nand->ecc.layout  = &davinci_nand_ecclayout;
+#ifdef CONFIG_SYS_NAND_LARGEPAGE
+       nand->ecc.size = 2048;
+       nand->ecc.bytes = 12;
+#elif defined(CONFIG_SYS_NAND_SMALLPAGE)
+       nand->ecc.size = 512;
+       nand->ecc.bytes = 3;
+#else
+#error "Either CONFIG_SYS_NAND_LARGEPAGE or CONFIG_SYS_NAND_SMALLPAGE must be defined!"
+#endif
+#else
+       nand->ecc.size = 512;
+       nand->ecc.bytes = 3;
+#endif /* CONFIG_SYS_DAVINCI_BROKEN_ECC */
+       nand->ecc.calculate = nand_davinci_calculate_ecc;
+       nand->ecc.correct  = nand_davinci_correct_data;
+       nand->ecc.hwctl  = nand_davinci_enable_hwecc;
+#else
+       nand->ecc.mode = NAND_ECC_SOFT;
+#endif /* CONFIG_SYS_NAND_HW_ECC */
+
+       /* Set address of hardware control function */
+       nand->cmd_ctrl = nand_davinci_hwcontrol;
+
+       nand->dev_ready = nand_davinci_dev_ready;
+       nand->waitfunc = nand_davinci_waitfunc;
+
+       nand_flash_init();
+
+       return(0);
+}
diff --git a/drivers/mtd/nand/s3c2410_nand.c b/drivers/mtd/nand/s3c2410_nand.c
new file mode 100644 (file)
index 0000000..d27a625
--- /dev/null
@@ -0,0 +1,171 @@
+/*
+ * (C) Copyright 2006 OpenMoko, Inc.
+ * Author: Harald Welte <laforge@openmoko.org>
+ *
+ * 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 <common.h>
+
+#if 0
+#define DEBUGN printf
+#else
+#define DEBUGN(x, args ...) {}
+#endif
+
+#include <nand.h>
+#include <s3c2410.h>
+#include <asm/io.h>
+
+#define __REGb(x)      (*(volatile unsigned char *)(x))
+#define __REGi(x)      (*(volatile unsigned int *)(x))
+
+#define        NF_BASE         0x4e000000
+#define        NFCONF          __REGi(NF_BASE + 0x0)
+#define        NFCMD           __REGb(NF_BASE + 0x4)
+#define        NFADDR          __REGb(NF_BASE + 0x8)
+#define        NFDATA          __REGb(NF_BASE + 0xc)
+#define        NFSTAT          __REGb(NF_BASE + 0x10)
+#define NFECC0         __REGb(NF_BASE + 0x14)
+#define NFECC1         __REGb(NF_BASE + 0x15)
+#define NFECC2         __REGb(NF_BASE + 0x16)
+
+#define S3C2410_NFCONF_EN          (1<<15)
+#define S3C2410_NFCONF_512BYTE     (1<<14)
+#define S3C2410_NFCONF_4STEP       (1<<13)
+#define S3C2410_NFCONF_INITECC     (1<<12)
+#define S3C2410_NFCONF_nFCE        (1<<11)
+#define S3C2410_NFCONF_TACLS(x)    ((x)<<8)
+#define S3C2410_NFCONF_TWRPH0(x)   ((x)<<4)
+#define S3C2410_NFCONF_TWRPH1(x)   ((x)<<0)
+
+#define S3C2410_ADDR_NALE 4
+#define S3C2410_ADDR_NCLE 8
+
+static void s3c2410_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl)
+{
+       struct nand_chip *chip = mtd->priv;
+
+       DEBUGN("hwcontrol(): 0x%02x 0x%02x\n", cmd, ctrl);
+
+       if (ctrl & NAND_CTRL_CHANGE) {
+               ulong IO_ADDR_W = NF_BASE;
+
+               if (!(ctrl & NAND_CLE))
+                       IO_ADDR_W |= S3C2410_ADDR_NCLE;
+               if (!(ctrl & NAND_ALE))
+                       IO_ADDR_W |= S3C2410_ADDR_NALE;
+
+               chip->IO_ADDR_W = (void *)IO_ADDR_W;
+
+               if (ctrl & NAND_NCE)
+                       NFCONF &= ~S3C2410_NFCONF_nFCE;
+               else
+                       NFCONF |= S3C2410_NFCONF_nFCE;
+       }
+
+       if (cmd != NAND_CMD_NONE)
+               writeb(cmd, chip->IO_ADDR_W);
+}
+
+static int s3c2410_dev_ready(struct mtd_info *mtd)
+{
+       DEBUGN("dev_ready\n");
+       return (NFSTAT & 0x01);
+}
+
+#ifdef CONFIG_S3C2410_NAND_HWECC
+void s3c2410_nand_enable_hwecc(struct mtd_info *mtd, int mode)
+{
+       DEBUGN("s3c2410_nand_enable_hwecc(%p, %d)\n", mtd, mode);
+       NFCONF |= S3C2410_NFCONF_INITECC;
+}
+
+static int s3c2410_nand_calculate_ecc(struct mtd_info *mtd, const u_char *dat,
+                                     u_char *ecc_code)
+{
+       ecc_code[0] = NFECC0;
+       ecc_code[1] = NFECC1;
+       ecc_code[2] = NFECC2;
+       DEBUGN("s3c2410_nand_calculate_hwecc(%p,): 0x%02x 0x%02x 0x%02x\n",
+               mtd , ecc_code[0], ecc_code[1], ecc_code[2]);
+
+       return 0;
+}
+
+static int s3c2410_nand_correct_data(struct mtd_info *mtd, u_char *dat,
+                                    u_char *read_ecc, u_char *calc_ecc)
+{
+       if (read_ecc[0] == calc_ecc[0] &&
+           read_ecc[1] == calc_ecc[1] &&
+           read_ecc[2] == calc_ecc[2])
+               return 0;
+
+       printf("s3c2410_nand_correct_data: not implemented\n");
+       return -1;
+}
+#endif
+
+int board_nand_init(struct nand_chip *nand)
+{
+       u_int32_t cfg;
+       u_int8_t tacls, twrph0, twrph1;
+       S3C24X0_CLOCK_POWER * const clk_power = S3C24X0_GetBase_CLOCK_POWER();
+
+       DEBUGN("board_nand_init()\n");
+
+       clk_power->CLKCON |= (1 << 4);
+
+       /* initialize hardware */
+       twrph0 = 3; twrph1 = 0; tacls = 0;
+
+       cfg = S3C2410_NFCONF_EN;
+       cfg |= S3C2410_NFCONF_TACLS(tacls - 1);
+       cfg |= S3C2410_NFCONF_TWRPH0(twrph0 - 1);
+       cfg |= S3C2410_NFCONF_TWRPH1(twrph1 - 1);
+
+       NFCONF = cfg;
+
+       /* initialize nand_chip data structure */
+       nand->IO_ADDR_R = nand->IO_ADDR_W = (void *)0x4e00000c;
+
+       /* read_buf and write_buf are default */
+       /* read_byte and write_byte are default */
+
+       /* hwcontrol always must be implemented */
+       nand->cmd_ctrl = s3c2410_hwcontrol;
+
+       nand->dev_ready = s3c2410_dev_ready;
+
+#ifdef CONFIG_S3C2410_NAND_HWECC
+       nand->ecc.hwctl = s3c2410_nand_enable_hwecc;
+       nand->ecc.calculate = s3c2410_nand_calculate_ecc;
+       nand->ecc.correct = s3c2410_nand_correct_data;
+       nand->ecc.mode = NAND_ECC_HW3_512;
+#else
+       nand->ecc.mode = NAND_ECC_SOFT;
+#endif
+
+#ifdef CONFIG_S3C2410_NAND_BBT
+       nand->options = NAND_USE_FLASH_BBT;
+#else
+       nand->options = 0;
+#endif
+
+       DEBUGN("end of nand_init\n");
+
+       return 0;
+}
index 6adece23cc0f89955a3f5eeadbf4e69f363887b4..822dc1a0e17fc8f4e983ddc49f27e2362b84699f 100644 (file)
@@ -58,6 +58,7 @@ COBJS-$(CONFIG_RTC_RS5C372A) += rs5c372.o
 COBJS-$(CONFIG_RTC_RTC4543) += rtc4543.o
 COBJS-$(CONFIG_RTC_RX8025) += rx8025.o
 COBJS-$(CONFIG_RTC_S3C24X0) += s3c24x0_rtc.o
+COBJS-$(CONFIG_RTC_S3C44B0) += s3c44b0_rtc.o
 COBJS-$(CONFIG_RTC_X1205) += x1205.o
 
 COBJS  := $(sort $(COBJS-y))
diff --git a/drivers/rtc/s3c44b0_rtc.c b/drivers/rtc/s3c44b0_rtc.c
new file mode 100644 (file)
index 0000000..489536f
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ * (C) Copyright 2004
+ * DAVE Srl
+ * http://www.dave-tech.it
+ * http://www.wawnet.biz
+ * mailto:info@wawnet.biz
+ *
+ * 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
+ */
+
+/*
+ * S3C44B0 CPU specific code
+ */
+
+#include <common.h>
+#include <command.h>
+#include <asm/hardware.h>
+#include <rtc.h>
+#include <bcd.h>
+
+int rtc_get (struct rtc_time* tm)
+{
+       RTCCON |= 1;
+       tm->tm_year  = BCD2BIN(BCDYEAR);
+       tm->tm_mon   = BCD2BIN(BCDMON);
+       tm->tm_wday   = BCD2BIN(BCDDATE);
+       tm->tm_mday   = BCD2BIN(BCDDAY);
+       tm->tm_hour  = BCD2BIN(BCDHOUR);
+       tm->tm_min  = BCD2BIN(BCDMIN);
+       tm->tm_sec  = BCD2BIN(BCDSEC);
+
+       if (tm->tm_sec==0) {
+               /* we have to re-read the rtc data because of the "one second deviation" problem */
+               /* see RTC datasheet for more info about it */
+               tm->tm_year  = BCD2BIN(BCDYEAR);
+               tm->tm_mon   = BCD2BIN(BCDMON);
+               tm->tm_mday   = BCD2BIN(BCDDAY);
+               tm->tm_wday   = BCD2BIN(BCDDATE);
+               tm->tm_hour  = BCD2BIN(BCDHOUR);
+               tm->tm_min  = BCD2BIN(BCDMIN);
+               tm->tm_sec  = BCD2BIN(BCDSEC);
+       }
+
+       RTCCON &= ~1;
+
+       if(tm->tm_year >= 70)
+               tm->tm_year += 1900;
+       else
+               tm->tm_year += 2000;
+
+       return 0;
+}
+
+int rtc_set (struct rtc_time* tm)
+{
+       if(tm->tm_year < 2000)
+               tm->tm_year -= 1900;
+       else
+               tm->tm_year -= 2000;
+
+       RTCCON |= 1;
+       BCDYEAR = BIN2BCD(tm->tm_year);
+       BCDMON = BIN2BCD(tm->tm_mon);
+       BCDDAY = BIN2BCD(tm->tm_mday);
+       BCDDATE = BIN2BCD(tm->tm_wday);
+       BCDHOUR = BIN2BCD(tm->tm_hour);
+       BCDMIN = BIN2BCD(tm->tm_min);
+       BCDSEC = BIN2BCD(tm->tm_sec);
+       RTCCON &= 1;
+
+       return 0;
+}
+
+void rtc_reset (void)
+{
+       RTCCON |= 1;
+       BCDYEAR = 0;
+       BCDMON = 0;
+       BCDDAY = 0;
+       BCDDATE = 0;
+       BCDHOUR = 0;
+       BCDMIN = 0;
+       BCDSEC = 0;
+       RTCCON &= 1;
+}
+
index d0efd73c5bbca3d257ac950a3ab2046e86105ede..696d5fbbba91ad83fe4e21d55d05250f6a8a6cc2 100644 (file)
@@ -33,10 +33,19 @@ COBJS-$(CONFIG_SYS_NS16550) += ns16550.o
 COBJS-$(CONFIG_DRIVER_S3C4510_UART) += s3c4510b_uart.o
 COBJS-$(CONFIG_S3C64XX) += s3c64xx.o
 COBJS-$(CONFIG_SYS_NS16550_SERIAL) += serial.o
+COBJS-$(CONFIG_CLPS7111_SERIAL) += serial_clps7111.o
+COBJS-$(CONFIG_IMX_SERIAL) += serial_imx.o
 COBJS-$(CONFIG_IXP_SERIAL) += serial_ixp.o
+COBJS-$(CONFIG_KS8695_SERIAL) += serial_ks8695.o
+COBJS-$(CONFIG_LPC2292_SERIAL) += serial_lpc2292.o
 COBJS-$(CONFIG_MAX3100_SERIAL) += serial_max3100.o
+COBJS-$(CONFIG_MX31_UART) += serial_mx31.o
+COBJS-$(CONFIG_NETARM_SERIAL) += serial_netarm.o
 COBJS-$(CONFIG_PL010_SERIAL) += serial_pl01x.o
 COBJS-$(CONFIG_PL011_SERIAL) += serial_pl01x.o
+COBJS-$(CONFIG_SA1100_SERIAL) += serial_sa1100.o
+COBJS-$(CONFIG_S3C24X0_SERIAL) += serial_s3c24x0.o
+COBJS-$(CONFIG_S3C44B0_SERIAL) += serial_s3c44b0.o
 COBJS-$(CONFIG_XILINX_UARTLITE) += serial_xuartlite.o
 COBJS-$(CONFIG_SCIF_CONSOLE) += serial_sh.o
 COBJS-$(CONFIG_USB_TTY) += usbtty.o
diff --git a/drivers/serial/serial_clps7111.c b/drivers/serial/serial_clps7111.c
new file mode 100644 (file)
index 0000000..a6aecad
--- /dev/null
@@ -0,0 +1,121 @@
+/*
+ * (C) Copyright 2002-2004
+ * Wolfgang Denk, DENX Software Engineering, <wd@denx.de>
+ *
+ * (C) Copyright 2002
+ * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
+ * Marius Groeger <mgroeger@sysgo.de>
+ *
+ * (C) Copyright 2002
+ * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
+ * Alex Zuepke <azu@sysgo.de>
+ *
+ * Copyright (C) 1999 2000 2001 Erik Mouw (J.A.K.Mouw@its.tudelft.nl)
+ *
+ * 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 <common.h>
+#include <clps7111.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+void serial_setbrg (void)
+{
+       unsigned int reg = 0;
+
+       switch (gd->baudrate) {
+       case   1200:    reg = 191;      break;
+       case   9600:    reg =  23;      break;
+       case  19200:    reg =  11;      break;
+       case  38400:    reg =   5;      break;
+       case  57600:    reg =   3;      break;
+       case 115200:    reg =   1;      break;
+       default:        hang ();        break;
+       }
+
+       /* init serial serial 1,2 */
+       IO_SYSCON1 = SYSCON1_UART1EN;
+       IO_SYSCON2 = SYSCON2_UART2EN;
+
+       reg |= UBRLCR_WRDLEN8;
+
+       IO_UBRLCR1 = reg;
+       IO_UBRLCR2 = reg;
+}
+
+
+/*
+ * Initialise the serial port with the given baudrate. The settings
+ * are always 8 data bits, no parity, 1 stop bit, no start bits.
+ *
+ */
+int serial_init (void)
+{
+       serial_setbrg ();
+
+       return (0);
+}
+
+
+/*
+ * Output a single byte to the serial port.
+ */
+void serial_putc (const char c)
+{
+       int tmo;
+
+       /* If \n, also do \r */
+       if (c == '\n')
+               serial_putc ('\r');
+
+       tmo = get_timer (0) + 1 * CONFIG_SYS_HZ;
+       while (IO_SYSFLG1 & SYSFLG1_UTXFF)
+               if (get_timer (0) > tmo)
+                       break;
+
+       IO_UARTDR1 = c;
+}
+
+/*
+ * Read a single byte from the serial port. Returns 1 on success, 0
+ * otherwise. When the function is succesfull, the character read is
+ * written into its argument c.
+ */
+int serial_tstc (void)
+{
+       return !(IO_SYSFLG1 & SYSFLG1_URXFE);
+}
+
+/*
+ * Read a single byte from the serial port. Returns 1 on success, 0
+ * otherwise. When the function is succesfull, the character read is
+ * written into its argument c.
+ */
+int serial_getc (void)
+{
+       while (IO_SYSFLG1 & SYSFLG1_URXFE);
+
+       return IO_UARTDR1 & 0xff;
+}
+
+void
+serial_puts (const char *s)
+{
+       while (*s) {
+               serial_putc (*s++);
+       }
+}
diff --git a/drivers/serial/serial_imx.c b/drivers/serial/serial_imx.c
new file mode 100644 (file)
index 0000000..b9ca748
--- /dev/null
@@ -0,0 +1,221 @@
+/*
+ * (c) 2004 Sascha Hauer <sascha@saschahauer.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 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 <common.h>
+#include <asm/arch/imx-regs.h>
+
+#if defined CONFIG_IMX_SERIAL1
+#define UART_BASE IMX_UART1_BASE
+#elif defined CONFIG_IMX_SERIAL2
+#define UART_BASE IMX_UART2_BASE
+#else
+#error "define CONFIG_IMX_SERIAL1, CONFIG_IMX_SERIAL2 or CONFIG_IMX_SERIAL_NONE"
+#endif
+
+struct imx_serial {
+       volatile uint32_t urxd[16];
+       volatile uint32_t utxd[16];
+       volatile uint32_t ucr1;
+       volatile uint32_t ucr2;
+       volatile uint32_t ucr3;
+       volatile uint32_t ucr4;
+       volatile uint32_t ufcr;
+       volatile uint32_t usr1;
+       volatile uint32_t usr2;
+       volatile uint32_t uesc;
+       volatile uint32_t utim;
+       volatile uint32_t ubir;
+       volatile uint32_t ubmr;
+       volatile uint32_t ubrc;
+       volatile uint32_t bipr[4];
+       volatile uint32_t bmpr[4];
+       volatile uint32_t uts;
+};
+
+DECLARE_GLOBAL_DATA_PTR;
+
+void serial_setbrg (void)
+{
+       serial_init();
+}
+
+extern void imx_gpio_mode(int gpio_mode);
+
+/*
+ * Initialise the serial port with the given baudrate. The settings
+ * are always 8 data bits, no parity, 1 stop bit, no start bits.
+ *
+ */
+int serial_init (void)
+{
+       volatile struct imx_serial* base = (struct imx_serial *)UART_BASE;
+       unsigned int ufcr_rfdiv;
+       unsigned int refclk;
+
+#ifdef CONFIG_IMX_SERIAL1
+       imx_gpio_mode(PC11_PF_UART1_TXD);
+       imx_gpio_mode(PC12_PF_UART1_RXD);
+#else
+       imx_gpio_mode(PB30_PF_UART2_TXD);
+       imx_gpio_mode(PB31_PF_UART2_RXD);
+#endif
+
+       /* Disable UART */
+       base->ucr1 &= ~UCR1_UARTEN;
+
+       /* Set to default POR state */
+
+       base->ucr1 = 0x00000004;
+       base->ucr2 = 0x00000000;
+       base->ucr3 = 0x00000000;
+       base->ucr4 = 0x00008040;
+       base->uesc = 0x0000002B;
+       base->utim = 0x00000000;
+       base->ubir = 0x00000000;
+       base->ubmr = 0x00000000;
+       base->uts  = 0x00000000;
+       /* Set clocks */
+       base->ucr4 |= UCR4_REF16;
+
+       /* Configure FIFOs */
+       base->ufcr = 0xa81;
+
+       /* set the baud rate.
+        *
+        * baud * 16   x
+        * --------- = -
+        *  refclk     y
+        *
+        * x - 1 = UBIR
+        * y - 1 = UBMR
+        *
+        * each register is 16 bits wide. refclk max is 96 MHz
+        *
+        */
+
+       ufcr_rfdiv = ((base->ufcr) & UFCR_RFDIV) >> 7;
+       if (ufcr_rfdiv == 6)
+               ufcr_rfdiv = 7;
+       else
+               ufcr_rfdiv = 6 - ufcr_rfdiv;
+
+       refclk = get_PERCLK1();
+       refclk /= ufcr_rfdiv;
+
+       /* Set the numerator value minus one of the BRM ratio */
+       base->ubir = (gd->baudrate / 100) - 1;
+
+       /* Set the denominator value minus one of the BRM ratio */
+       base->ubmr = (refclk/(16 * 100)) - 1;
+
+       /* Set to 8N1 */
+       base->ucr2 &= ~UCR2_PREN;
+       base->ucr2 |= UCR2_WS;
+       base->ucr2 &= ~UCR2_STPB;
+
+       /* Ignore RTS */
+       base->ucr2 |= UCR2_IRTS;
+
+       /* Enable UART */
+       base->ucr1 |= UCR1_UARTEN | UCR1_UARTCLKEN;
+
+       /* Enable FIFOs */
+       base->ucr2 |= UCR2_SRST | UCR2_RXEN | UCR2_TXEN;
+
+       /* Clear status flags */
+       base->usr2 |= USR2_ADET  |
+                     USR2_DTRF  |
+                     USR2_IDLE  |
+                     USR2_IRINT |
+                     USR2_WAKE  |
+                     USR2_RTSF  |
+                     USR2_BRCD  |
+                     USR2_ORE;
+
+       /* Clear status flags */
+       base->usr1 |= USR1_PARITYERR |
+                     USR1_RTSD      |
+                     USR1_ESCF      |
+                     USR1_FRAMERR   |
+                     USR1_AIRINT    |
+                     USR1_AWAKE;
+       return (0);
+}
+
+/*
+ * Read a single byte from the serial port. Returns 1 on success, 0
+ * otherwise. When the function is successful, the character read is
+ * written into its argument c.
+ */
+int serial_getc (void)
+{
+       volatile struct imx_serial* base = (struct imx_serial *)UART_BASE;
+       unsigned char ch;
+
+       while(base->uts & UTS_RXEMPTY);
+
+       ch = (char)base->urxd[0];
+
+       return ch;
+}
+
+#ifdef CONFIG_HWFLOW
+static int hwflow = 0; /* turned off by default */
+int hwflow_onoff(int on)
+{
+}
+#endif
+
+/*
+ * Output a single byte to the serial port.
+ */
+void serial_putc (const char c)
+{
+       volatile struct imx_serial* base = (struct imx_serial *)UART_BASE;
+
+       /* Wait for Tx FIFO not full */
+       while (base->uts & UTS_TXFULL);
+
+       base->utxd[0] = c;
+
+       /* If \n, also do \r */
+       if (c == '\n')
+               serial_putc ('\r');
+}
+
+/*
+ * Test whether a character is in the RX buffer
+ */
+int serial_tstc (void)
+{
+       volatile struct imx_serial* base = (struct imx_serial *)UART_BASE;
+
+       /* If receive fifo is empty, return false */
+       if (base->uts & UTS_RXEMPTY)
+               return 0;
+       return 1;
+}
+
+void
+serial_puts (const char *s)
+{
+       while (*s) {
+               serial_putc (*s++);
+       }
+}
diff --git a/drivers/serial/serial_ks8695.c b/drivers/serial/serial_ks8695.c
new file mode 100644 (file)
index 0000000..aacd1be
--- /dev/null
@@ -0,0 +1,117 @@
+/*
+ * serial.c -- KS8695 serial driver
+ *
+ * (C) Copyright 2004, Greg Ungerer <greg.ungerer@opengear.com>
+ *
+ * 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 <common.h>
+#include <asm/arch/platform.h>
+
+#ifndef CONFIG_SERIAL1
+#error "Bad: you didn't configure serial ..."
+#endif
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/*
+ *     Define the UART hardware register access structure.
+ */
+struct ks8695uart {
+       unsigned int    RX;             /* 0x00 - Receive data (r) */
+       unsigned int    TX;             /* 0x04 - Transmit data (w) */
+       unsigned int    FCR;            /* 0x08 - Fifo Control (r/w) */
+       unsigned int    LCR;            /* 0x0c - Line Control (r/w) */
+       unsigned int    MCR;            /* 0x10 - Modem Control (r/w) */
+       unsigned int    LSR;            /* 0x14 - Line Status (r/w) */
+       unsigned int    MSR;            /* 0x18 - Modem Status (r/w) */
+       unsigned int    BD;             /* 0x1c - Baud Rate (r/w) */
+       unsigned int    SR;             /* 0x20 - Status (r/w) */
+};
+
+#define        KS8695_UART_ADDR        ((void *) (KS8695_IO_BASE + KS8695_UART_RX_BUFFER))
+#define        KS8695_UART_CLK         25000000
+
+
+/*
+ * Under some circumstances we want to be "quiet" and not issue any
+ * serial output - though we want u-boot to otherwise work and behave
+ * the same. By default be noisy.
+ */
+int serial_console = 1;
+
+
+void serial_setbrg(void)
+{
+       volatile struct ks8695uart *uartp = KS8695_UART_ADDR;
+
+       /* Set to global baud rate and 8 data bits, no parity, 1 stop bit*/
+       uartp->BD = KS8695_UART_CLK / gd->baudrate;
+       uartp->LCR = KS8695_UART_LINEC_WLEN8;
+}
+
+int serial_init(void)
+{
+       serial_console = 1;
+       serial_setbrg();
+       return 0;
+}
+
+void serial_raw_putc(const char c)
+{
+       volatile struct ks8695uart *uartp = KS8695_UART_ADDR;
+       int i;
+
+       for (i = 0; (i < 0x100000); i++) {
+               if (uartp->LSR & KS8695_UART_LINES_TXFE)
+                       break;
+       }
+
+       uartp->TX = c;
+}
+
+void serial_putc(const char c)
+{
+       if (serial_console) {
+               serial_raw_putc(c);
+               if (c == '\n')
+                       serial_raw_putc('\r');
+       }
+}
+
+int serial_tstc(void)
+{
+       volatile struct ks8695uart *uartp = KS8695_UART_ADDR;
+       if (serial_console)
+               return ((uartp->LSR & KS8695_UART_LINES_RXFE) ? 1 : 0);
+       return 0;
+}
+
+void serial_puts(const char *s)
+{
+       char c;
+       while ((c = *s++) != 0)
+               serial_putc(c);
+}
+
+int serial_getc(void)
+{
+       volatile struct ks8695uart *uartp = KS8695_UART_ADDR;
+
+       while ((uartp->LSR & KS8695_UART_LINES_RXFE) == 0)
+               ;
+       return (uartp->RX);
+}
diff --git a/drivers/serial/serial_lpc2292.c b/drivers/serial/serial_lpc2292.c
new file mode 100644 (file)
index 0000000..87b7d5f
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+ * (C) Copyright 2002-2004
+ * Wolfgang Denk, DENX Software Engineering, <wd@denx.de>
+ *
+ * (C) Copyright 2002
+ * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
+ * Marius Groeger <mgroeger@sysgo.de>
+ *
+ * (C) Copyright 2002
+ * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
+ * Alex Zuepke <azu@sysgo.de>
+ *
+ * Copyright (C) 1999 2000 2001 Erik Mouw (J.A.K.Mouw@its.tudelft.nl)
+ *
+ * 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 <common.h>
+#include <asm/arch/hardware.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+void serial_setbrg (void)
+{
+       unsigned short divisor = 0;
+
+       switch (gd->baudrate) {
+       case   1200:    divisor = 3072; break;
+       case   9600:    divisor =  384; break;
+       case  19200:    divisor =  192; break;
+       case  38400:    divisor =   96; break;
+       case  57600:    divisor =   64; break;
+       case 115200:    divisor =   32; break;
+       default:        hang ();        break;
+       }
+
+       /* init serial UART0 */
+       PUT8(U0LCR, 0);
+       PUT8(U0IER, 0);
+       PUT8(U0LCR, 0x80);      /* DLAB=1 */
+       PUT8(U0DLL, (unsigned char)(divisor & 0x00FF));
+       PUT8(U0DLM, (unsigned char)(divisor >> 8));
+       PUT8(U0LCR, 0x03);      /* 8N1, DLAB=0  */
+       PUT8(U0FCR, 1);         /* Enable RX and TX FIFOs */
+}
+
+int serial_init (void)
+{
+       unsigned long pinsel0;
+
+       serial_setbrg ();
+
+       pinsel0 = GET32(PINSEL0);
+       pinsel0 &= ~(0x00000003);
+       pinsel0 |= 5;
+       PUT32(PINSEL0, pinsel0);
+
+       return (0);
+}
+
+void serial_putc (const char c)
+{
+       if (c == '\n')
+       {
+               while((GET8(U0LSR) & (1<<5)) == 0); /* Wait for empty U0THR */
+               PUT8(U0THR, '\r');
+       }
+
+       while((GET8(U0LSR) & (1<<5)) == 0); /* Wait for empty U0THR */
+       PUT8(U0THR, c);
+}
+
+int serial_getc (void)
+{
+       while((GET8(U0LSR) & 1) == 0);
+       return GET8(U0RBR);
+}
+
+void
+serial_puts (const char *s)
+{
+       while (*s) {
+               serial_putc (*s++);
+       }
+}
+
+/* Test if there is a byte to read */
+int serial_tstc (void)
+{
+       return (GET8(U0LSR) & 1);
+}
+
diff --git a/drivers/serial/serial_mx31.c b/drivers/serial/serial_mx31.c
new file mode 100644 (file)
index 0000000..7c0682a
--- /dev/null
@@ -0,0 +1,226 @@
+/*
+ * (c) 2007 Sascha Hauer <s.hauer@pengutronix.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 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 <common.h>
+#include <asm/arch/mx31.h>
+
+#define __REG(x)     (*((volatile u32 *)(x)))
+
+#ifdef CONFIG_SYS_MX31_UART1
+#define UART_PHYS 0x43f90000
+#elif defined(CONFIG_SYS_MX31_UART2)
+#define UART_PHYS 0x43f94000
+#elif defined(CONFIG_SYS_MX31_UART3)
+#define UART_PHYS 0x5000c000
+#elif defined(CONFIG_SYS_MX31_UART4)
+#define UART_PHYS 0x43fb0000
+#elif defined(CONFIG_SYS_MX31_UART5)
+#define UART_PHYS 0x43fb4000
+#else
+#error "define CONFIG_SYS_MX31_UARTx to use the mx31 UART driver"
+#endif
+
+/* Register definitions */
+#define URXD  0x0  /* Receiver Register */
+#define UTXD  0x40 /* Transmitter Register */
+#define UCR1  0x80 /* Control Register 1 */
+#define UCR2  0x84 /* Control Register 2 */
+#define UCR3  0x88 /* Control Register 3 */
+#define UCR4  0x8c /* Control Register 4 */
+#define UFCR  0x90 /* FIFO Control Register */
+#define USR1  0x94 /* Status Register 1 */
+#define USR2  0x98 /* Status Register 2 */
+#define UESC  0x9c /* Escape Character Register */
+#define UTIM  0xa0 /* Escape Timer Register */
+#define UBIR  0xa4 /* BRM Incremental Register */
+#define UBMR  0xa8 /* BRM Modulator Register */
+#define UBRC  0xac /* Baud Rate Count Register */
+#define UTS   0xb4 /* UART Test Register (mx31) */
+
+/* UART Control Register Bit Fields.*/
+#define  URXD_CHARRDY    (1<<15)
+#define  URXD_ERR        (1<<14)
+#define  URXD_OVRRUN     (1<<13)
+#define  URXD_FRMERR     (1<<12)
+#define  URXD_BRK        (1<<11)
+#define  URXD_PRERR      (1<<10)
+#define  URXD_RX_DATA    (0xFF)
+#define  UCR1_ADEN       (1<<15) /* Auto dectect interrupt */
+#define  UCR1_ADBR       (1<<14) /* Auto detect baud rate */
+#define  UCR1_TRDYEN     (1<<13) /* Transmitter ready interrupt enable */
+#define  UCR1_IDEN       (1<<12) /* Idle condition interrupt */
+#define  UCR1_RRDYEN     (1<<9)         /* Recv ready interrupt enable */
+#define  UCR1_RDMAEN     (1<<8)         /* Recv ready DMA enable */
+#define  UCR1_IREN       (1<<7)         /* Infrared interface enable */
+#define  UCR1_TXMPTYEN   (1<<6)         /* Transimitter empty interrupt enable */
+#define  UCR1_RTSDEN     (1<<5)         /* RTS delta interrupt enable */
+#define  UCR1_SNDBRK     (1<<4)         /* Send break */
+#define  UCR1_TDMAEN     (1<<3)         /* Transmitter ready DMA enable */
+#define  UCR1_UARTCLKEN  (1<<2)         /* UART clock enabled */
+#define  UCR1_DOZE       (1<<1)         /* Doze */
+#define  UCR1_UARTEN     (1<<0)         /* UART enabled */
+#define  UCR2_ESCI      (1<<15) /* Escape seq interrupt enable */
+#define  UCR2_IRTS      (1<<14) /* Ignore RTS pin */
+#define  UCR2_CTSC      (1<<13) /* CTS pin control */
+#define  UCR2_CTS        (1<<12) /* Clear to send */
+#define  UCR2_ESCEN      (1<<11) /* Escape enable */
+#define  UCR2_PREN       (1<<8)  /* Parity enable */
+#define  UCR2_PROE       (1<<7)  /* Parity odd/even */
+#define  UCR2_STPB       (1<<6)         /* Stop */
+#define  UCR2_WS         (1<<5)         /* Word size */
+#define  UCR2_RTSEN      (1<<4)         /* Request to send interrupt enable */
+#define  UCR2_TXEN       (1<<2)         /* Transmitter enabled */
+#define  UCR2_RXEN       (1<<1)         /* Receiver enabled */
+#define  UCR2_SRST      (1<<0)  /* SW reset */
+#define  UCR3_DTREN     (1<<13) /* DTR interrupt enable */
+#define  UCR3_PARERREN   (1<<12) /* Parity enable */
+#define  UCR3_FRAERREN   (1<<11) /* Frame error interrupt enable */
+#define  UCR3_DSR        (1<<10) /* Data set ready */
+#define  UCR3_DCD        (1<<9)  /* Data carrier detect */
+#define  UCR3_RI         (1<<8)  /* Ring indicator */
+#define  UCR3_TIMEOUTEN  (1<<7)  /* Timeout interrupt enable */
+#define  UCR3_RXDSEN    (1<<6)  /* Receive status interrupt enable */
+#define  UCR3_AIRINTEN   (1<<5)  /* Async IR wake interrupt enable */
+#define  UCR3_AWAKEN    (1<<4)  /* Async wake interrupt enable */
+#define  UCR3_REF25     (1<<3)  /* Ref freq 25 MHz */
+#define  UCR3_REF30     (1<<2)  /* Ref Freq 30 MHz */
+#define  UCR3_INVT      (1<<1)  /* Inverted Infrared transmission */
+#define  UCR3_BPEN      (1<<0)  /* Preset registers enable */
+#define  UCR4_CTSTL_32   (32<<10) /* CTS trigger level (32 chars) */
+#define  UCR4_INVR      (1<<9)  /* Inverted infrared reception */
+#define  UCR4_ENIRI     (1<<8)  /* Serial infrared interrupt enable */
+#define  UCR4_WKEN      (1<<7)  /* Wake interrupt enable */
+#define  UCR4_REF16     (1<<6)  /* Ref freq 16 MHz */
+#define  UCR4_IRSC      (1<<5)  /* IR special case */
+#define  UCR4_TCEN      (1<<3)  /* Transmit complete interrupt enable */
+#define  UCR4_BKEN      (1<<2)  /* Break condition interrupt enable */
+#define  UCR4_OREN      (1<<1)  /* Receiver overrun interrupt enable */
+#define  UCR4_DREN      (1<<0)  /* Recv data ready interrupt enable */
+#define  UFCR_RXTL_SHF   0       /* Receiver trigger level shift */
+#define  UFCR_RFDIV      (7<<7)  /* Reference freq divider mask */
+#define  UFCR_TXTL_SHF   10      /* Transmitter trigger level shift */
+#define  USR1_PARITYERR  (1<<15) /* Parity error interrupt flag */
+#define  USR1_RTSS      (1<<14) /* RTS pin status */
+#define  USR1_TRDY      (1<<13) /* Transmitter ready interrupt/dma flag */
+#define  USR1_RTSD      (1<<12) /* RTS delta */
+#define  USR1_ESCF      (1<<11) /* Escape seq interrupt flag */
+#define  USR1_FRAMERR    (1<<10) /* Frame error interrupt flag */
+#define  USR1_RRDY       (1<<9)         /* Receiver ready interrupt/dma flag */
+#define  USR1_TIMEOUT    (1<<7)         /* Receive timeout interrupt status */
+#define  USR1_RXDS      (1<<6)  /* Receiver idle interrupt flag */
+#define  USR1_AIRINT    (1<<5)  /* Async IR wake interrupt flag */
+#define  USR1_AWAKE     (1<<4)  /* Aysnc wake interrupt flag */
+#define  USR2_ADET      (1<<15) /* Auto baud rate detect complete */
+#define  USR2_TXFE      (1<<14) /* Transmit buffer FIFO empty */
+#define  USR2_DTRF      (1<<13) /* DTR edge interrupt flag */
+#define  USR2_IDLE      (1<<12) /* Idle condition */
+#define  USR2_IRINT     (1<<8)  /* Serial infrared interrupt flag */
+#define  USR2_WAKE      (1<<7)  /* Wake */
+#define  USR2_RTSF      (1<<4)  /* RTS edge interrupt flag */
+#define  USR2_TXDC      (1<<3)  /* Transmitter complete */
+#define  USR2_BRCD      (1<<2)  /* Break condition */
+#define  USR2_ORE        (1<<1)         /* Overrun error */
+#define  USR2_RDR        (1<<0)         /* Recv data ready */
+#define  UTS_FRCPERR    (1<<13) /* Force parity error */
+#define  UTS_LOOP        (1<<12) /* Loop tx and rx */
+#define  UTS_TXEMPTY    (1<<6)  /* TxFIFO empty */
+#define  UTS_RXEMPTY    (1<<5)  /* RxFIFO empty */
+#define  UTS_TXFULL     (1<<4)  /* TxFIFO full */
+#define  UTS_RXFULL     (1<<3)  /* RxFIFO full */
+#define  UTS_SOFTRST    (1<<0)  /* Software reset */
+
+DECLARE_GLOBAL_DATA_PTR;
+
+void serial_setbrg (void)
+{
+       u32 clk = mx31_get_ipg_clk();
+
+       if (!gd->baudrate)
+               gd->baudrate = CONFIG_BAUDRATE;
+
+       __REG(UART_PHYS + UFCR) = 4 << 7; /* divide input clock by 2 */
+       __REG(UART_PHYS + UBIR) = 0xf;
+       __REG(UART_PHYS + UBMR) = clk / (2 * gd->baudrate);
+
+}
+
+int serial_getc (void)
+{
+       while (__REG(UART_PHYS + UTS) & UTS_RXEMPTY);
+       return (__REG(UART_PHYS + URXD) & URXD_RX_DATA); /* mask out status from upper word */
+}
+
+void serial_putc (const char c)
+{
+       __REG(UART_PHYS + UTXD) = c;
+
+       /* wait for transmitter to be ready */
+       while(!(__REG(UART_PHYS + UTS) & UTS_TXEMPTY));
+
+       /* If \n, also do \r */
+       if (c == '\n')
+               serial_putc ('\r');
+}
+
+/*
+ * Test whether a character is in the RX buffer
+ */
+int serial_tstc (void)
+{
+       /* If receive fifo is empty, return false */
+       if (__REG(UART_PHYS + UTS) & UTS_RXEMPTY)
+               return 0;
+       return 1;
+}
+
+void
+serial_puts (const char *s)
+{
+       while (*s) {
+               serial_putc (*s++);
+       }
+}
+
+/*
+ * Initialise the serial port with the given baudrate. The settings
+ * are always 8 data bits, no parity, 1 stop bit, no start bits.
+ *
+ */
+int serial_init (void)
+{
+       __REG(UART_PHYS + UCR1) = 0x0;
+       __REG(UART_PHYS + UCR2) = 0x0;
+
+       while (!(__REG(UART_PHYS + UCR2) & UCR2_SRST));
+
+       __REG(UART_PHYS + UCR3) = 0x0704;
+       __REG(UART_PHYS + UCR4) = 0x8000;
+       __REG(UART_PHYS + UESC) = 0x002b;
+       __REG(UART_PHYS + UTIM) = 0x0;
+
+       __REG(UART_PHYS + UTS) = 0x0;
+
+       serial_setbrg();
+
+       __REG(UART_PHYS + UCR2) = UCR2_WS | UCR2_IRTS | UCR2_RXEN | UCR2_TXEN | UCR2_SRST;
+
+       __REG(UART_PHYS + UCR1) = UCR1_UARTEN;
+
+       return 0;
+}
diff --git a/drivers/serial/serial_netarm.c b/drivers/serial/serial_netarm.c
new file mode 100644 (file)
index 0000000..2eb5393
--- /dev/null
@@ -0,0 +1,195 @@
+/*
+ * Serial Port stuff - taken from Linux
+ *
+ * (C) Copyright 2002
+ * MAZeT GmbH <www.mazet.de>
+ * Stephan Linz <linz@mazet.de>, <linz@li-pro.net>
+ *
+ * (c) 2004
+ * IMMS gGmbH <www.imms.de>
+ * Thomas Elste <info@elste.org>
+ *
+ * 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 <common.h>
+#include <asm/hardware.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#define PORTA  (*(volatile unsigned int *)(NETARM_GEN_MODULE_BASE + NETARM_GEN_PORTA))
+#if !defined(CONFIG_NETARM_NS7520)
+#define PORTB  (*(volatile unsigned int *)(NETARM_GEN_MODULE_BASE + NETARM_GEN_PORTB))
+#else
+#define PORTC  (*(volatile unsigned int *)(NETARM_GEN_MODULE_BASE + NETARM_GEN_PORTC))
+#endif
+
+/* wait until transmitter is ready for another character */
+#define TXWAITRDY(registers)                                                   \
+{                                                                              \
+       ulong tmo = get_timer(0) + 1 * CONFIG_SYS_HZ;                                   \
+       while (((registers)->status_a & NETARM_SER_STATA_TX_RDY) == 0 ) {       \
+               if (get_timer(0) > tmo)                                         \
+                       break;                                                  \
+       }                                                                       \
+}
+
+
+#ifndef CONFIG_UART1_CONSOLE
+volatile netarm_serial_channel_t *serial_reg_ch1 = get_serial_channel(0);
+volatile netarm_serial_channel_t *serial_reg_ch2 = get_serial_channel(1);
+#else
+volatile netarm_serial_channel_t *serial_reg_ch1 = get_serial_channel(1);
+volatile netarm_serial_channel_t *serial_reg_ch2 = get_serial_channel(0);
+#endif
+
+extern void _netarm_led_FAIL1(void);
+
+/*
+ * Setup both serial i/f with given baudrate
+ */
+void serial_setbrg (void)
+{
+       /* set 0 ... make sure pins are configured for serial */
+#if !defined(CONFIG_NETARM_NS7520)
+       PORTA = PORTB =
+               NETARM_GEN_PORT_MODE (0xef) | NETARM_GEN_PORT_DIR (0xe0);
+#else
+       PORTA = NETARM_GEN_PORT_MODE (0xef) | NETARM_GEN_PORT_DIR (0xe0);
+       PORTC = NETARM_GEN_PORT_CSF (0xef) | NETARM_GEN_PORT_MODE (0xef) | NETARM_GEN_PORT_DIR (0xe0);
+#endif
+
+       /* first turn em off */
+       serial_reg_ch1->ctrl_a = serial_reg_ch2->ctrl_a = 0;
+
+       /* clear match register, we don't need it */
+       serial_reg_ch1->rx_match = serial_reg_ch2->rx_match = 0;
+
+       /* setup bit rate generator and rx buffer gap timer (1 byte only) */
+       if ((gd->baudrate >= MIN_BAUD_RATE)
+           && (gd->baudrate <= MAX_BAUD_RATE)) {
+               serial_reg_ch1->bitrate = serial_reg_ch2->bitrate =
+                       NETARM_SER_BR_X16 (gd->baudrate);
+               serial_reg_ch1->rx_buf_timer = serial_reg_ch2->rx_buf_timer =
+                       0;
+               serial_reg_ch1->rx_char_timer = serial_reg_ch2->rx_char_timer =
+                       NETARM_SER_RXGAP (gd->baudrate);
+       } else {
+               hang ();
+       }
+
+       /* setup port mode */
+       serial_reg_ch1->ctrl_b = serial_reg_ch2->ctrl_b =
+               ( NETARM_SER_CTLB_RCGT_EN |
+                 NETARM_SER_CTLB_UART_MODE);
+       serial_reg_ch1->ctrl_a = serial_reg_ch2->ctrl_a =
+               ( NETARM_SER_CTLA_ENABLE |
+                 NETARM_SER_CTLA_P_NONE |
+                 /* see errata */
+                 NETARM_SER_CTLA_2STOP |
+                 NETARM_SER_CTLA_8BITS |
+                 NETARM_SER_CTLA_DTR_EN |
+                 NETARM_SER_CTLA_RTS_EN);
+}
+
+
+/*
+ * Initialise the serial port with the given baudrate. The settings
+ * are always 8 data bits, no parity, 1 stop bit, no start bits.
+ */
+int serial_init (void)
+{
+       serial_setbrg ();
+       return 0;
+}
+
+
+/*
+ * Output a single byte to the serial port.
+ */
+void serial_putc (const char c)
+{
+       volatile unsigned char *fifo;
+
+       /* If \n, also do \r */
+       if (c == '\n')
+               serial_putc ('\r');
+
+       fifo = (volatile unsigned char *) &(serial_reg_ch1->fifo);
+       TXWAITRDY (serial_reg_ch1);
+       *fifo = c;
+}
+
+/*
+ * Test of a single byte from the serial port. Returns 1 on success, 0
+ * otherwise.
+ */
+int serial_tstc(void)
+{
+       return serial_reg_ch1->status_a & NETARM_SER_STATA_RX_RDY;
+}
+
+/*
+ * Read a single byte from the serial port. Returns 1 on success, 0
+ * otherwise.
+ */
+int serial_getc (void)
+{
+       unsigned int ch_uint;
+       volatile unsigned int *fifo;
+       volatile unsigned char *fifo_char = NULL;
+       int buf_count = 0;
+
+       while (!(serial_reg_ch1->status_a & NETARM_SER_STATA_RX_RDY))
+               /* NOP */ ;
+
+       fifo = (volatile unsigned int *) &(serial_reg_ch1->fifo);
+       fifo_char = (unsigned char *) &ch_uint;
+       ch_uint = *fifo;
+
+       buf_count = NETARM_SER_STATA_RXFDB (serial_reg_ch1->status_a);
+       switch (buf_count) {
+       case NETARM_SER_STATA_RXFDB_4BYTES:
+               buf_count = 4;
+               break;
+       case NETARM_SER_STATA_RXFDB_3BYTES:
+               buf_count = 3;
+               break;
+       case NETARM_SER_STATA_RXFDB_2BYTES:
+               buf_count = 2;
+               break;
+       case NETARM_SER_STATA_RXFDB_1BYTES:
+               buf_count = 1;
+               break;
+       default:
+               /* panic, be never here */
+               break;
+       }
+
+       serial_reg_ch1->status_a |= NETARM_SER_STATA_RX_CLOSED;
+
+       return ch_uint & 0xff;
+}
+
+void serial_puts (const char *s)
+{
+       while (*s) {
+               serial_putc (*s++);
+       }
+}
diff --git a/drivers/serial/serial_s3c24x0.c b/drivers/serial/serial_s3c24x0.c
new file mode 100644 (file)
index 0000000..1b1b7a6
--- /dev/null
@@ -0,0 +1,300 @@
+/*
+ * (C) Copyright 2002
+ * Gary Jennejohn, DENX Software Engineering, <gj@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 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 <common.h>
+#if defined(CONFIG_S3C2400) || defined(CONFIG_TRAB)
+#include <s3c2400.h>
+#elif defined(CONFIG_S3C2410)
+#include <s3c2410.h>
+#endif
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#ifdef CONFIG_SERIAL1
+#define UART_NR        S3C24X0_UART0
+
+#elif defined(CONFIG_SERIAL2)
+# if defined(CONFIG_TRAB)
+#  error "TRAB supports only CONFIG_SERIAL1"
+# endif
+#define UART_NR        S3C24X0_UART1
+
+#elif defined(CONFIG_SERIAL3)
+# if defined(CONFIG_TRAB)
+#  #error "TRAB supports only CONFIG_SERIAL1"
+# endif
+#define UART_NR        S3C24X0_UART2
+
+#else
+#error "Bad: you didn't configure serial ..."
+#endif
+
+#if defined(CONFIG_SERIAL_MULTI)
+#include <serial.h>
+
+/* Multi serial device functions */
+#define DECLARE_S3C_SERIAL_FUNCTIONS(port) \
+    int  s3serial##port##_init (void) {\
+       return serial_init_dev(port);}\
+    void s3serial##port##_setbrg (void) {\
+       serial_setbrg_dev(port);}\
+    int  s3serial##port##_getc (void) {\
+       return serial_getc_dev(port);}\
+    int  s3serial##port##_tstc (void) {\
+       return serial_tstc_dev(port);}\
+    void s3serial##port##_putc (const char c) {\
+       serial_putc_dev(port, c);}\
+    void s3serial##port##_puts (const char *s) {\
+       serial_puts_dev(port, s);}
+
+#define INIT_S3C_SERIAL_STRUCTURE(port,name,bus) {\
+       name,\
+       bus,\
+       s3serial##port##_init,\
+       s3serial##port##_setbrg,\
+       s3serial##port##_getc,\
+       s3serial##port##_tstc,\
+       s3serial##port##_putc,\
+       s3serial##port##_puts, }
+
+#endif /* CONFIG_SERIAL_MULTI */
+
+void _serial_setbrg(const int dev_index)
+{
+       S3C24X0_UART * const uart = S3C24X0_GetBase_UART(dev_index);
+       unsigned int reg = 0;
+       int i;
+
+       /* value is calculated so : (int)(PCLK/16./baudrate) -1 */
+       reg = get_PCLK() / (16 * gd->baudrate) - 1;
+
+       uart->UBRDIV = reg;
+       for (i = 0; i < 100; i++);
+}
+#if defined(CONFIG_SERIAL_MULTI)
+static inline void
+serial_setbrg_dev(unsigned int dev_index)
+{
+       _serial_setbrg(dev_index);
+}
+#else
+void serial_setbrg(void)
+{
+       _serial_setbrg(UART_NR);
+}
+#endif
+
+
+/* Initialise the serial port. The settings are always 8 data bits, no parity,
+ * 1 stop bit, no start bits.
+ */
+static int serial_init_dev(const int dev_index)
+{
+       S3C24X0_UART * const uart = S3C24X0_GetBase_UART(dev_index);
+
+       /* FIFO enable, Tx/Rx FIFO clear */
+       uart->UFCON = 0x07;
+       uart->UMCON = 0x0;
+
+       /* Normal,No parity,1 stop,8 bit */
+       uart->ULCON = 0x3;
+       /*
+        * tx=level,rx=edge,disable timeout int.,enable rx error int.,
+        * normal,interrupt or polling
+        */
+       uart->UCON = 0x245;
+
+#ifdef CONFIG_HWFLOW
+       uart->UMCON = 0x1; /* RTS up */
+#endif
+
+       /* FIXME: This is sooooooooooooooooooo ugly */
+#if defined(CONFIG_ARCH_GTA02_v1) || defined(CONFIG_ARCH_GTA02_v2)
+       /* we need auto hw flow control on the gsm and gps port */
+       if (dev_index == 0 || dev_index == 1)
+               uart->UMCON = 0x10;
+#endif
+       _serial_setbrg(dev_index);
+
+       return (0);
+}
+
+#if !defined(CONFIG_SERIAL_MULTI)
+/* Initialise the serial port. The settings are always 8 data bits, no parity,
+ * 1 stop bit, no start bits.
+ */
+int serial_init (void)
+{
+       return serial_init_dev(UART_NR);
+}
+#endif
+
+/*
+ * Read a single byte from the serial port. Returns 1 on success, 0
+ * otherwise. When the function is succesfull, the character read is
+ * written into its argument c.
+ */
+int _serial_getc (const int dev_index)
+{
+       S3C24X0_UART * const uart = S3C24X0_GetBase_UART(dev_index);
+
+       /* wait for character to arrive */
+       while (!(uart->UTRSTAT & 0x1));
+
+       return uart->URXH & 0xff;
+}
+#if defined(CONFIG_SERIAL_MULTI)
+static inline int serial_getc_dev(unsigned int dev_index)
+{
+       return _serial_getc(dev_index);
+}
+#else
+int serial_getc (void)
+{
+       return _serial_getc(UART_NR);
+}
+#endif
+
+#ifdef CONFIG_HWFLOW
+static int hwflow = 0; /* turned off by default */
+int hwflow_onoff(int on)
+{
+       switch(on) {
+       case 0:
+       default:
+               break; /* return current */
+       case 1:
+               hwflow = 1; /* turn on */
+               break;
+       case -1:
+               hwflow = 0; /* turn off */
+               break;
+       }
+       return hwflow;
+}
+#endif
+
+#ifdef CONFIG_MODEM_SUPPORT
+static int be_quiet = 0;
+void disable_putc(void)
+{
+       be_quiet = 1;
+}
+
+void enable_putc(void)
+{
+       be_quiet = 0;
+}
+#endif
+
+
+/*
+ * Output a single byte to the serial port.
+ */
+void _serial_putc (const char c, const int dev_index)
+{
+       S3C24X0_UART * const uart = S3C24X0_GetBase_UART(dev_index);
+#ifdef CONFIG_MODEM_SUPPORT
+       if (be_quiet)
+               return;
+#endif
+
+       /* wait for room in the tx FIFO */
+       while (!(uart->UTRSTAT & 0x2));
+
+#ifdef CONFIG_HWFLOW
+       /* Wait for CTS up */
+       while(hwflow && !(uart->UMSTAT & 0x1))
+               ;
+#endif
+
+       uart->UTXH = c;
+
+       /* If \n, also do \r */
+       if (c == '\n')
+               serial_putc ('\r');
+}
+#if defined(CONFIG_SERIAL_MULTI)
+static inline void serial_putc_dev(unsigned int dev_index, const char c)
+{
+       _serial_putc(c, dev_index);
+}
+#else
+void serial_putc(const char c)
+{
+       _serial_putc(c, UART_NR);
+}
+#endif
+
+
+/*
+ * Test whether a character is in the RX buffer
+ */
+int _serial_tstc(const int dev_index)
+{
+       S3C24X0_UART * const uart = S3C24X0_GetBase_UART(dev_index);
+
+       return uart->UTRSTAT & 0x1;
+}
+#if defined(CONFIG_SERIAL_MULTI)
+static inline int
+serial_tstc_dev(unsigned int dev_index)
+{
+       return _serial_tstc(dev_index);
+}
+#else
+int serial_tstc(void)
+{
+       return _serial_tstc(UART_NR);
+}
+#endif
+
+void _serial_puts(const char *s, const int dev_index)
+{
+       while (*s) {
+               _serial_putc (*s++, dev_index);
+       }
+}
+#if defined(CONFIG_SERIAL_MULTI)
+static inline void
+serial_puts_dev(int dev_index, const char *s)
+{
+       _serial_puts(s, dev_index);
+}
+#else
+void
+serial_puts (const char *s)
+{
+       _serial_puts(s, UART_NR);
+}
+#endif
+
+#if defined(CONFIG_SERIAL_MULTI)
+DECLARE_S3C_SERIAL_FUNCTIONS(0);
+struct serial_device s3c24xx_serial0_device =
+       INIT_S3C_SERIAL_STRUCTURE(0, "s3ser0", "S3UART1");
+DECLARE_S3C_SERIAL_FUNCTIONS(1);
+struct serial_device s3c24xx_serial1_device =
+       INIT_S3C_SERIAL_STRUCTURE(1, "s3ser1", "S3UART2");
+DECLARE_S3C_SERIAL_FUNCTIONS(2);
+struct serial_device s3c24xx_serial2_device =
+       INIT_S3C_SERIAL_STRUCTURE(2, "s3ser2", "S3UART3");
+
+#endif /* CONFIG_SERIAL_MULTI */
diff --git a/drivers/serial/serial_s3c44b0.c b/drivers/serial/serial_s3c44b0.c
new file mode 100644 (file)
index 0000000..95d0266
--- /dev/null
@@ -0,0 +1,218 @@
+/*
+ * (C) Copyright 2004
+ * DAVE Srl
+ * http://www.dave-tech.it
+ * http://www.wawnet.biz
+ * mailto:info@wawnet.biz
+ *
+ * (C) Copyright 2002-2004
+ * Wolfgang Denk, DENX Software Engineering, <wd@denx.de>
+ *
+ * (C) Copyright 2002
+ * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
+ * Marius Groeger <mgroeger@sysgo.de>
+ *
+ * (C) Copyright 2002
+ * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
+ * Alex Zuepke <azu@sysgo.de>
+ *
+ * Copyright (C) 1999 2000 2001 Erik Mouw (J.A.K.Mouw@its.tudelft.nl)
+ *
+ * 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 <common.h>
+#include <asm/hardware.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/* flush serial input queue. returns 0 on success or negative error
+ * number otherwise
+ */
+static int serial_flush_input(void)
+{
+       volatile u32 tmp;
+
+       /* keep on reading as long as the receiver is not empty */
+       while(UTRSTAT0&0x01) {
+               tmp = REGB(URXH0);
+       }
+
+       return 0;
+}
+
+
+/* flush output queue. returns 0 on success or negative error number
+ * otherwise
+ */
+static int serial_flush_output(void)
+{
+       /* wait until the transmitter is no longer busy */
+       while(!(UTRSTAT0 & 0x02)) {
+       }
+
+       return 0;
+}
+
+
+void serial_setbrg (void)
+{
+       u32 divisor = 0;
+
+       /* get correct divisor */
+       switch(gd->baudrate) {
+
+       case 1200:
+#if CONFIG_S3C44B0_CLOCK_SPEED==66
+               divisor = 3124;
+#elif CONFIG_S3C44B0_CLOCK_SPEED==75
+               divisor = 3905;
+#else
+# error CONFIG_S3C44B0_CLOCK_SPEED undefined
+#endif
+               break;
+
+       case 9600:
+#if CONFIG_S3C44B0_CLOCK_SPEED==66
+               divisor = 390;
+#elif CONFIG_S3C44B0_CLOCK_SPEED==75
+               divisor = 487;
+#else
+# error CONFIG_S3C44B0_CLOCK_SPEED undefined
+#endif
+               break;
+
+       case 19200:
+#if CONFIG_S3C44B0_CLOCK_SPEED==66
+               divisor = 194;
+#elif CONFIG_S3C44B0_CLOCK_SPEED==75
+               divisor = 243;
+#else
+# error CONFIG_S3C44B0_CLOCK_SPEED undefined
+#endif
+               break;
+
+       case 38400:
+#if CONFIG_S3C44B0_CLOCK_SPEED==66
+               divisor = 97;
+#elif CONFIG_S3C44B0_CLOCK_SPEED==75
+               divisor = 121;
+#else
+# error CONFIG_S3C44B0_CLOCK_SPEED undefined
+#endif /* break; */
+
+       case 57600:
+#if CONFIG_S3C44B0_CLOCK_SPEED==66
+               divisor = 64;
+#elif CONFIG_S3C44B0_CLOCK_SPEED==75
+               divisor = 80;
+#else
+# error CONFIG_S3C44B0_CLOCK_SPEED undefined
+#endif /* break; */
+
+       case 115200:
+#if CONFIG_S3C44B0_CLOCK_SPEED==66
+               divisor = 32;
+#elif CONFIG_S3C44B0_CLOCK_SPEED==75
+               divisor = 40;
+#else
+# error CONFIG_S3C44B0_CLOCK_SPEED undefined
+#endif /* break; */
+       }
+
+       serial_flush_output();
+       serial_flush_input();
+       UFCON0 = 0x0;
+       ULCON0 = 0x03;
+       UCON0 = 0x05;
+       UBRDIV0 = divisor;
+
+       UFCON1 = 0x0;
+       ULCON1 = 0x03;
+       UCON1 = 0x05;
+       UBRDIV1 = divisor;
+
+       for(divisor=0; divisor<100; divisor++) {
+               /* NOP */
+       }
+}
+
+
+/*
+ * Initialise the serial port with the given baudrate. The settings
+ * are always 8 data bits, no parity, 1 stop bit, no start bits.
+ *
+ */
+int serial_init (void)
+{
+       serial_setbrg ();
+
+       return (0);
+}
+
+
+/*
+ * Output a single byte to the serial port.
+ */
+void serial_putc (const char c)
+{
+       /* wait for room in the transmit FIFO */
+       while(!(UTRSTAT0 & 0x02));
+
+       UTXH0 = (unsigned char)c;
+
+       /*
+               to be polite with serial console add a line feed
+               to the carriage return character
+       */
+       if (c=='\n')
+               serial_putc('\r');
+}
+
+/*
+ * Read a single byte from the serial port. Returns 1 on success, 0
+ * otherwise. When the function is succesfull, the character read is
+ * written into its argument c.
+ */
+int serial_tstc (void)
+{
+       return (UTRSTAT0 & 0x01);
+}
+
+/*
+ * Read a single byte from the serial port. Returns 1 on success, 0
+ * otherwise. When the function is succesfull, the character read is
+ * written into its argument c.
+ */
+int serial_getc (void)
+{
+       int rv;
+
+       for(;;) {
+               rv = serial_tstc();
+
+               if(rv > 0)
+                       return URXH0;
+       }
+}
+
+void
+serial_puts (const char *s)
+{
+       while (*s) {
+               serial_putc (*s++);
+       }
+}
diff --git a/drivers/serial/serial_sa1100.c b/drivers/serial/serial_sa1100.c
new file mode 100644 (file)
index 0000000..5d18875
--- /dev/null
@@ -0,0 +1,160 @@
+/*
+ * (C) Copyright 2002
+ * Wolfgang Denk, DENX Software Engineering, <wd@denx.de>
+ *
+ * (C) Copyright 2002
+ * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
+ * Marius Groeger <mgroeger@sysgo.de>
+ *
+ * (C) Copyright 2002
+ * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
+ * Alex Zuepke <azu@sysgo.de>
+ *
+ * Copyright (C) 1999 2000 2001 Erik Mouw (J.A.K.Mouw@its.tudelft.nl)
+ *
+ * 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 <common.h>
+#include <SA-1100.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+void serial_setbrg (void)
+{
+       unsigned int reg = 0;
+
+       if (gd->baudrate == 1200)
+               reg = 191;
+       else if (gd->baudrate == 9600)
+               reg = 23;
+       else if (gd->baudrate == 19200)
+               reg = 11;
+       else if (gd->baudrate == 38400)
+               reg = 5;
+       else if (gd->baudrate == 57600)
+               reg = 3;
+       else if (gd->baudrate == 115200)
+               reg = 1;
+       else
+               hang ();
+
+#ifdef CONFIG_SERIAL1
+       /* SA1110 uart function */
+       Ser1SDCR0 |= SDCR0_SUS;
+
+       /* Wait until port is ready ... */
+       while(Ser1UTSR1 & UTSR1_TBY) {}
+
+       /* init serial serial 1 */
+       Ser1UTCR3 = 0x00;
+       Ser1UTSR0 = 0xff;
+       Ser1UTCR0 = ( UTCR0_1StpBit | UTCR0_8BitData );
+       Ser1UTCR1 = 0;
+       Ser1UTCR2 = (u32)reg;
+       Ser1UTCR3 = ( UTCR3_RXE | UTCR3_TXE );
+#elif defined(CONFIG_SERIAL3)
+       /* Wait until port is ready ... */
+       while (Ser3UTSR1 & UTSR1_TBY) {
+       }
+
+       /* init serial serial 3 */
+       Ser3UTCR3 = 0x00;
+       Ser3UTSR0 = 0xff;
+       Ser3UTCR0 = (UTCR0_1StpBit | UTCR0_8BitData);
+       Ser3UTCR1 = 0;
+       Ser3UTCR2 = (u32) reg;
+       Ser3UTCR3 = (UTCR3_RXE | UTCR3_TXE);
+#else
+#error "Bad: you didn't configured serial ..."
+#endif
+}
+
+
+/*
+ * Initialise the serial port with the given baudrate. The settings
+ * are always 8 data bits, no parity, 1 stop bit, no start bits.
+ *
+ */
+int serial_init (void)
+{
+       serial_setbrg ();
+
+       return (0);
+}
+
+
+/*
+ * Output a single byte to the serial port.
+ */
+void serial_putc (const char c)
+{
+#ifdef CONFIG_SERIAL1
+       /* wait for room in the tx FIFO on SERIAL1 */
+       while ((Ser1UTSR0 & UTSR0_TFS) == 0);
+
+       Ser1UTDR = c;
+#elif defined(CONFIG_SERIAL3)
+       /* wait for room in the tx FIFO on SERIAL3 */
+       while ((Ser3UTSR0 & UTSR0_TFS) == 0);
+
+       Ser3UTDR = c;
+#endif
+
+       /* If \n, also do \r */
+       if (c == '\n')
+               serial_putc ('\r');
+}
+
+/*
+ * Read a single byte from the serial port. Returns 1 on success, 0
+ * otherwise. When the function is succesfull, the character read is
+ * written into its argument c.
+ */
+int serial_tstc (void)
+{
+#ifdef CONFIG_SERIAL1
+       return Ser1UTSR1 & UTSR1_RNE;
+#elif defined(CONFIG_SERIAL3)
+       return Ser3UTSR1 & UTSR1_RNE;
+#endif
+}
+
+/*
+ * Read a single byte from the serial port. Returns 1 on success, 0
+ * otherwise. When the function is succesfull, the character read is
+ * written into its argument c.
+ */
+int serial_getc (void)
+{
+#ifdef CONFIG_SERIAL1
+       while (!(Ser1UTSR1 & UTSR1_RNE));
+
+       return (char) Ser1UTDR & 0xff;
+#elif defined(CONFIG_SERIAL3)
+       while (!(Ser3UTSR1 & UTSR1_RNE));
+
+       return (char) Ser3UTDR & 0xff;
+#endif
+}
+
+void
+serial_puts (const char *s)
+{
+       while (*s) {
+               serial_putc (*s++);
+       }
+}
index b306a65a981f59b47aad0c427814f0f7935cd65f..7ddb72a0e146ad47c4903a0521a060fbc267ef6a 100644 (file)
@@ -33,6 +33,7 @@ COBJS-$(CONFIG_USB_EHCI) += usb_ehci_core.o
 # host
 COBJS-$(CONFIG_USB_ISP116X_HCD) += isp116x-hcd.o
 COBJS-$(CONFIG_USB_R8A66597_HCD) += r8a66597-hcd.o
+COBJS-$(CONFIG_USB_S3C64XX) += s3c64xx_usb.o
 COBJS-$(CONFIG_USB_SL811HS) += sl811_usb.o
 COBJS-$(CONFIG_USB_EHCI_FSL) += usb_ehci_fsl.o
 COBJS-$(CONFIG_USB_EHCI_PCI) += usb_ehci_pci.o
diff --git a/drivers/usb/s3c64xx_usb.c b/drivers/usb/s3c64xx_usb.c
new file mode 100644 (file)
index 0000000..274a4ed
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * URB OHCI HCD (Host Controller Driver) initialization for USB on the S3C64XX.
+ *
+ * Copyright (C) 2008,
+ * Guennadi Liakhovetski, DENX Software Engineering <lg@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 <common.h>
+#include <s3c6400.h>
+
+int usb_cpu_init(void)
+{
+       OTHERS_REG |= 0x10000;
+       return 0;
+}
+
+int usb_cpu_stop(void)
+{
+       OTHERS_REG &= ~0x10000;
+       return 0;
+}
+
+void usb_cpu_init_fail(void)
+{
+       OTHERS_REG &= ~0x10000;
+}
index 3056ca7f673ad919f170e6083eb5026122853e25..ec053c9912d7f614cbc7ff50e87014b536d37f48 100644 (file)
@@ -24,9 +24,7 @@
  * MA 02111-1307 USA
  */
 
-#if defined(CONFIG_S3C4510B)
-#include <asm-arm/arch-arm720t/s3c4510b.h>
-#elif defined(CONFIG_NETARM)
+#if defined(CONFIG_NETARM)
 #include <asm-arm/arch-arm720t/netarm_registers.h>
 #elif defined(CONFIG_IMPA7)
 /* include IMPA7 specific hardware file if there was one */
diff --git a/include/asm-arm/arch-arm720t/s3c4510b.h b/include/asm-arm/arch-arm720t/s3c4510b.h
deleted file mode 100644 (file)
index 6b8c8ed..0000000
+++ /dev/null
@@ -1,272 +0,0 @@
-#ifndef __HW_S3C4510_H
-#define __HW_S3C4510_H
-
-/*
- * Copyright (c) 2004  Cucy Systems (http://www.cucy.com)
- * Curt Brune <curt@cucy.com>
- *
- * 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
- *
- * Description:   Samsung S3C4510B register layout
- */
-
-/*------------------------------------------------------------------------
- *       ASIC Address Definition
- *----------------------------------------------------------------------*/
-
-/* L1 8KB on chip SRAM base address */
-#define SRAM_BASE       (0x03fe0000)
-
-/* Special Register Start Address After System Reset */
-#define REG_BASE       (0x03ff0000)
-#define SPSTR          (REG_BASE)
-
-/* *********************** */
-/* System Manager Register */
-/* *********************** */
-#define REG_SYSCFG     (REG_BASE+0x0000)
-
-#define REG_CLKCON      (REG_BASE+0x3000)
-#define REG_EXTACON0   (REG_BASE+0x3008)
-#define REG_EXTACON1   (REG_BASE+0x300c)
-#define REG_EXTDBWTH   (REG_BASE+0x3010)
-#define REG_ROMCON0    (REG_BASE+0x3014)
-#define REG_ROMCON1    (REG_BASE+0x3018)
-#define REG_ROMCON2    (REG_BASE+0x301c)
-#define REG_ROMCON3    (REG_BASE+0x3020)
-#define REG_ROMCON4    (REG_BASE+0x3024)
-#define REG_ROMCON5    (REG_BASE+0x3028)
-#define REG_DRAMCON0   (REG_BASE+0x302c)
-#define REG_DRAMCON1   (REG_BASE+0x3030)
-#define REG_DRAMCON2   (REG_BASE+0x3034)
-#define REG_DRAMCON3   (REG_BASE+0x3038)
-#define REG_REFEXTCON  (REG_BASE+0x303c)
-
-/* *********************** */
-/* Ethernet BDMA Register  */
-/* *********************** */
-#define REG_BDMATXCON  (REG_BASE+0x9000)
-#define REG_BDMARXCON  (REG_BASE+0x9004)
-#define REG_BDMATXPTR  (REG_BASE+0x9008)
-#define REG_BDMARXPTR  (REG_BASE+0x900c)
-#define REG_BDMARXLSZ  (REG_BASE+0x9010)
-#define REG_BDMASTAT   (REG_BASE+0x9014)
-
-/* Content Address Memory */
-#define REG_CAM_BASE   (REG_BASE+0x9100)
-
-#define REG_BDMATXBUF  (REG_BASE+0x9200)
-#define REG_BDMARXBUF  (REG_BASE+0x9800)
-
-/* *********************** */
-/* Ethernet MAC Register   */
-/* *********************** */
-#define REG_MACCON     (REG_BASE+0xa000)
-#define REG_CAMCON     (REG_BASE+0xa004)
-#define REG_MACTXCON   (REG_BASE+0xa008)
-#define REG_MACTXSTAT  (REG_BASE+0xa00c)
-#define REG_MACRXCON   (REG_BASE+0xa010)
-#define REG_MACRXSTAT  (REG_BASE+0xa014)
-#define REG_STADATA    (REG_BASE+0xa018)
-#define REG_STACON     (REG_BASE+0xa01c)
-#define REG_CAMEN      (REG_BASE+0xa028)
-#define REG_EMISSCNT   (REG_BASE+0xa03c)
-#define REG_EPZCNT     (REG_BASE+0xa040)
-#define REG_ERMPZCNT   (REG_BASE+0xa044)
-#define REG_ETXSTAT    (REG_BASE+0x9040)
-#define REG_MACRXDESTR (REG_BASE+0xa064)
-#define REG_MACRXSTATEM        (REG_BASE+0xa090)
-#define REG_MACRXFIFO  (REG_BASE+0xa200)
-
-/********************/
-/* I2C Bus Register */
-/********************/
-#define REG_I2C_CON    (REG_BASE+0xf000)
-#define REG_I2C_BUF    (REG_BASE+0xf004)
-#define REG_I2C_PS     (REG_BASE+0xf008)
-#define REG_I2C_COUNT  (REG_BASE+0xf00c)
-
-/********************/
-/*    GDMA 0        */
-/********************/
-#define REG_GDMACON0   (REG_BASE+0xb000)
-#define REG_GDMA0_RUN_ENABLE (REG_BASE+0xb020)
-#define REG_GDMASRC0   (REG_BASE+0xb004)
-#define REG_GDMADST0   (REG_BASE+0xb008)
-#define REG_GDMACNT0   (REG_BASE+0xb00c)
-
-/********************/
-/*    GDMA 1        */
-/********************/
-#define REG_GDMACON1   (REG_BASE+0xc000)
-#define REG_GDMA1_RUN_ENABLE (REG_BASE+0xc020)
-#define REG_GDMASRC1   (REG_BASE+0xc004)
-#define REG_GDMADST1   (REG_BASE+0xc008)
-#define REG_GDMACNT1   (REG_BASE+0xc00c)
-
-/********************/
-/*      UART 0      */
-/********************/
-#define UART0_BASE       (REG_BASE+0xd000)
-#define REG_UART0_LCON   (REG_BASE+0xd000)
-#define REG_UART0_CTRL   (REG_BASE+0xd004)
-#define REG_UART0_STAT   (REG_BASE+0xd008)
-#define REG_UART0_TXB    (REG_BASE+0xd00c)
-#define REG_UART0_RXB    (REG_BASE+0xd010)
-#define REG_UART0_BAUD_DIV    (REG_BASE+0xd014)
-#define REG_UART0_BAUD_CNT    (REG_BASE+0xd018)
-#define REG_UART0_BAUD_CLK    (REG_BASE+0xd01C)
-
-/********************/
-/*     UART 1       */
-/********************/
-#define UART1_BASE       (REG_BASE+0xe000)
-#define REG_UART1_LCON   (REG_BASE+0xe000)
-#define REG_UART1_CTRL   (REG_BASE+0xe004)
-#define REG_UART1_STAT   (REG_BASE+0xe008)
-#define REG_UART1_TXB    (REG_BASE+0xe00c)
-#define REG_UART1_RXB    (REG_BASE+0xe010)
-#define REG_UART1_BAUD_DIV    (REG_BASE+0xe014)
-#define REG_UART1_BAUD_CNT    (REG_BASE+0xe018)
-#define REG_UART1_BAUD_CLK    (REG_BASE+0xe01C)
-
-/********************/
-/*  Timer Register  */
-/********************/
-#define REG_TMOD       (REG_BASE+0x6000)
-#define REG_TDATA0     (REG_BASE+0x6004)
-#define REG_TDATA1     (REG_BASE+0x6008)
-#define REG_TCNT0      (REG_BASE+0x600c)
-#define REG_TCNT1      (REG_BASE+0x6010)
-
-/**********************/
-/* I/O Port Interface */
-/**********************/
-#define REG_IOPMODE    (REG_BASE+0x5000)
-#define REG_IOPCON     (REG_BASE+0x5004)
-#define REG_IOPDATA    (REG_BASE+0x5008)
-
-/*********************************/
-/* Interrupt Controller Register */
-/*********************************/
-#define REG_INTMODE     (REG_BASE+0x4000)
-#define REG_INTPEND     (REG_BASE+0x4004)
-#define REG_INTMASK     (REG_BASE+0x4008)
-
-#define REG_INTPRI0     (REG_BASE+0x400c)
-#define REG_INTPRI1    (REG_BASE+0x4010)
-#define REG_INTPRI2    (REG_BASE+0x4014)
-#define REG_INTPRI3    (REG_BASE+0x4018)
-#define REG_INTPRI4    (REG_BASE+0x401c)
-#define REG_INTPRI5    (REG_BASE+0x4020)
-#define REG_INTOFFSET  (REG_BASE+0x4024)
-#define REG_INTPNDPRI  (REG_BASE+0x4028)
-#define REG_INTPNDTST  (REG_BASE+0x402C)
-
-/*********************************/
-/* CACHE CONTROL MASKS           */
-/*********************************/
-#define CACHE_STALL      (0x00000001)
-#define CACHE_ENABLE     (0x00000002)
-#define CACHE_WRITE_BUFF (0x00000004)
-#define CACHE_MODE       (0x00000030)
-#define CACHE_MODE_00    (0x00000000)
-#define CACHE_MODE_01    (0x00000010)
-#define CACHE_MODE_10    (0x00000020)
-
-/*********************************/
-/* CACHE RAM BASE ADDRESSES      */
-/*********************************/
-#define CACHE_SET0_RAM   (0x10000000)
-#define CACHE_SET1_RAM   (0x10800000)
-#define CACHE_TAG_RAM    (0x11000000)
-
-/*********************************/
-/* CACHE_DISABLE MASK            */
-/*********************************/
-#define CACHE_DISABLE_MASK (0x04000000)
-
-#define GET_REG(reg)       (*((volatile u32 *)(reg)))
-#define PUT_REG(reg, val)  (*((volatile u32 *)(reg)) = ((u32)(val)))
-#define SET_REG(reg, mask) (PUT_REG((reg), GET_REG((reg)) |  mask))
-#define CLR_REG(reg, mask) (PUT_REG((reg), GET_REG((reg)) & ~mask))
-#define PUT_U16(reg, val)  (*((volatile u16 *)(reg)) = ((u16)(val)))
-#define PUT__U8(reg, val)  (*((volatile u8  *)(reg)) = (( u8)((val)&0xFF)))
-#define GET__U8(reg)       (*((volatile u8  *)(reg)))
-
-#define PUT_LED(val)       (PUT_REG(REG_IOPDATA, (~val)&0xFF))
-#define GET_LED()          ((~GET_REG( REG_IOPDATA)) & 0xFF)
-#define SET_LED(val)       { u32 led = GET_LED(); led |= 1 << (val);  PUT_LED( led); }
-#define CLR_LED(val)       { u32 led = GET_LED(); led &= ~(1 << (val));  PUT_LED( led); }
-
-/***********************************/
-/* CLOCK CONSTANTS -- 50 MHz Clock */
-/***********************************/
-
-#define CLK_FREQ_MHZ       (50)
-#define t_data_us(t)       ((t)*CLK_FREQ_MHZ-1)   /* t is time tick,unit[us] */
-#define t_data_ms(t)       (t_data_us((t)*1000))  /* t is time tick,unit[ms] */
-
-/*********************************************************/
-/*            TIMER MODE REGISTER                       */
-/*********************************************************/
-#define  TM0_RUN      0x01  /* Timer 0 enable */
-#define  TM0_TOGGLE   0x02  /* 0, interval mode */
-#define  TM0_OUT_1    0x04  /* Timer 0 Initial TOUT0 value */
-#define  TM1_RUN      0x08  /* Timer 1 enable */
-#define  TM1_TOGGLE   0x10  /* 0, interval mode */
-#define  TM1_OUT_1    0x20  /* Timer 0 Initial TOUT0 value */
-
-
-/*********************************/
-/* INTERRUPT SOURCES             */
-/*********************************/
-#define INT_EXTINT0    0
-#define INT_EXTINT1    1
-#define INT_EXTINT2    2
-#define INT_EXTINT3    3
-#define INT_UARTTX0    4
-#define INT_UARTRX0    5
-#define INT_UARTTX1    6
-#define INT_UARTRX1    7
-#define INT_GDMA0      8
-#define INT_GDMA1      9
-#define INT_TIMER0     10
-#define INT_TIMER1     11
-#define INT_HDLCTXA    12
-#define INT_HDLCRXA    13
-#define INT_HDLCTXB    14
-#define INT_HDLCRXB    15
-#define INT_BDMATX     16
-#define INT_BDMARX     17
-#define INT_MACTX      18
-#define INT_MACRX      19
-#define INT_IIC                20
-#define INT_GLOBAL     21
-#define N_IRQS         (21)
-
-#ifndef __ASSEMBLER__
-struct _irq_handler {
-       void                *m_data;
-       void (*m_func)( void *data);
-};
-
-#endif
-
-#endif /* __S3C4510_h */
diff --git a/include/asm-arm/arch-s3c4510b/hardware.h b/include/asm-arm/arch-s3c4510b/hardware.h
new file mode 100644 (file)
index 0000000..6b8c8ed
--- /dev/null
@@ -0,0 +1,272 @@
+#ifndef __HW_S3C4510_H
+#define __HW_S3C4510_H
+
+/*
+ * Copyright (c) 2004  Cucy Systems (http://www.cucy.com)
+ * Curt Brune <curt@cucy.com>
+ *
+ * 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
+ *
+ * Description:   Samsung S3C4510B register layout
+ */
+
+/*------------------------------------------------------------------------
+ *       ASIC Address Definition
+ *----------------------------------------------------------------------*/
+
+/* L1 8KB on chip SRAM base address */
+#define SRAM_BASE       (0x03fe0000)
+
+/* Special Register Start Address After System Reset */
+#define REG_BASE       (0x03ff0000)
+#define SPSTR          (REG_BASE)
+
+/* *********************** */
+/* System Manager Register */
+/* *********************** */
+#define REG_SYSCFG     (REG_BASE+0x0000)
+
+#define REG_CLKCON      (REG_BASE+0x3000)
+#define REG_EXTACON0   (REG_BASE+0x3008)
+#define REG_EXTACON1   (REG_BASE+0x300c)
+#define REG_EXTDBWTH   (REG_BASE+0x3010)
+#define REG_ROMCON0    (REG_BASE+0x3014)
+#define REG_ROMCON1    (REG_BASE+0x3018)
+#define REG_ROMCON2    (REG_BASE+0x301c)
+#define REG_ROMCON3    (REG_BASE+0x3020)
+#define REG_ROMCON4    (REG_BASE+0x3024)
+#define REG_ROMCON5    (REG_BASE+0x3028)
+#define REG_DRAMCON0   (REG_BASE+0x302c)
+#define REG_DRAMCON1   (REG_BASE+0x3030)
+#define REG_DRAMCON2   (REG_BASE+0x3034)
+#define REG_DRAMCON3   (REG_BASE+0x3038)
+#define REG_REFEXTCON  (REG_BASE+0x303c)
+
+/* *********************** */
+/* Ethernet BDMA Register  */
+/* *********************** */
+#define REG_BDMATXCON  (REG_BASE+0x9000)
+#define REG_BDMARXCON  (REG_BASE+0x9004)
+#define REG_BDMATXPTR  (REG_BASE+0x9008)
+#define REG_BDMARXPTR  (REG_BASE+0x900c)
+#define REG_BDMARXLSZ  (REG_BASE+0x9010)
+#define REG_BDMASTAT   (REG_BASE+0x9014)
+
+/* Content Address Memory */
+#define REG_CAM_BASE   (REG_BASE+0x9100)
+
+#define REG_BDMATXBUF  (REG_BASE+0x9200)
+#define REG_BDMARXBUF  (REG_BASE+0x9800)
+
+/* *********************** */
+/* Ethernet MAC Register   */
+/* *********************** */
+#define REG_MACCON     (REG_BASE+0xa000)
+#define REG_CAMCON     (REG_BASE+0xa004)
+#define REG_MACTXCON   (REG_BASE+0xa008)
+#define REG_MACTXSTAT  (REG_BASE+0xa00c)
+#define REG_MACRXCON   (REG_BASE+0xa010)
+#define REG_MACRXSTAT  (REG_BASE+0xa014)
+#define REG_STADATA    (REG_BASE+0xa018)
+#define REG_STACON     (REG_BASE+0xa01c)
+#define REG_CAMEN      (REG_BASE+0xa028)
+#define REG_EMISSCNT   (REG_BASE+0xa03c)
+#define REG_EPZCNT     (REG_BASE+0xa040)
+#define REG_ERMPZCNT   (REG_BASE+0xa044)
+#define REG_ETXSTAT    (REG_BASE+0x9040)
+#define REG_MACRXDESTR (REG_BASE+0xa064)
+#define REG_MACRXSTATEM        (REG_BASE+0xa090)
+#define REG_MACRXFIFO  (REG_BASE+0xa200)
+
+/********************/
+/* I2C Bus Register */
+/********************/
+#define REG_I2C_CON    (REG_BASE+0xf000)
+#define REG_I2C_BUF    (REG_BASE+0xf004)
+#define REG_I2C_PS     (REG_BASE+0xf008)
+#define REG_I2C_COUNT  (REG_BASE+0xf00c)
+
+/********************/
+/*    GDMA 0        */
+/********************/
+#define REG_GDMACON0   (REG_BASE+0xb000)
+#define REG_GDMA0_RUN_ENABLE (REG_BASE+0xb020)
+#define REG_GDMASRC0   (REG_BASE+0xb004)
+#define REG_GDMADST0   (REG_BASE+0xb008)
+#define REG_GDMACNT0   (REG_BASE+0xb00c)
+
+/********************/
+/*    GDMA 1        */
+/********************/
+#define REG_GDMACON1   (REG_BASE+0xc000)
+#define REG_GDMA1_RUN_ENABLE (REG_BASE+0xc020)
+#define REG_GDMASRC1   (REG_BASE+0xc004)
+#define REG_GDMADST1   (REG_BASE+0xc008)
+#define REG_GDMACNT1   (REG_BASE+0xc00c)
+
+/********************/
+/*      UART 0      */
+/********************/
+#define UART0_BASE       (REG_BASE+0xd000)
+#define REG_UART0_LCON   (REG_BASE+0xd000)
+#define REG_UART0_CTRL   (REG_BASE+0xd004)
+#define REG_UART0_STAT   (REG_BASE+0xd008)
+#define REG_UART0_TXB    (REG_BASE+0xd00c)
+#define REG_UART0_RXB    (REG_BASE+0xd010)
+#define REG_UART0_BAUD_DIV    (REG_BASE+0xd014)
+#define REG_UART0_BAUD_CNT    (REG_BASE+0xd018)
+#define REG_UART0_BAUD_CLK    (REG_BASE+0xd01C)
+
+/********************/
+/*     UART 1       */
+/********************/
+#define UART1_BASE       (REG_BASE+0xe000)
+#define REG_UART1_LCON   (REG_BASE+0xe000)
+#define REG_UART1_CTRL   (REG_BASE+0xe004)
+#define REG_UART1_STAT   (REG_BASE+0xe008)
+#define REG_UART1_TXB    (REG_BASE+0xe00c)
+#define REG_UART1_RXB    (REG_BASE+0xe010)
+#define REG_UART1_BAUD_DIV    (REG_BASE+0xe014)
+#define REG_UART1_BAUD_CNT    (REG_BASE+0xe018)
+#define REG_UART1_BAUD_CLK    (REG_BASE+0xe01C)
+
+/********************/
+/*  Timer Register  */
+/********************/
+#define REG_TMOD       (REG_BASE+0x6000)
+#define REG_TDATA0     (REG_BASE+0x6004)
+#define REG_TDATA1     (REG_BASE+0x6008)
+#define REG_TCNT0      (REG_BASE+0x600c)
+#define REG_TCNT1      (REG_BASE+0x6010)
+
+/**********************/
+/* I/O Port Interface */
+/**********************/
+#define REG_IOPMODE    (REG_BASE+0x5000)
+#define REG_IOPCON     (REG_BASE+0x5004)
+#define REG_IOPDATA    (REG_BASE+0x5008)
+
+/*********************************/
+/* Interrupt Controller Register */
+/*********************************/
+#define REG_INTMODE     (REG_BASE+0x4000)
+#define REG_INTPEND     (REG_BASE+0x4004)
+#define REG_INTMASK     (REG_BASE+0x4008)
+
+#define REG_INTPRI0     (REG_BASE+0x400c)
+#define REG_INTPRI1    (REG_BASE+0x4010)
+#define REG_INTPRI2    (REG_BASE+0x4014)
+#define REG_INTPRI3    (REG_BASE+0x4018)
+#define REG_INTPRI4    (REG_BASE+0x401c)
+#define REG_INTPRI5    (REG_BASE+0x4020)
+#define REG_INTOFFSET  (REG_BASE+0x4024)
+#define REG_INTPNDPRI  (REG_BASE+0x4028)
+#define REG_INTPNDTST  (REG_BASE+0x402C)
+
+/*********************************/
+/* CACHE CONTROL MASKS           */
+/*********************************/
+#define CACHE_STALL      (0x00000001)
+#define CACHE_ENABLE     (0x00000002)
+#define CACHE_WRITE_BUFF (0x00000004)
+#define CACHE_MODE       (0x00000030)
+#define CACHE_MODE_00    (0x00000000)
+#define CACHE_MODE_01    (0x00000010)
+#define CACHE_MODE_10    (0x00000020)
+
+/*********************************/
+/* CACHE RAM BASE ADDRESSES      */
+/*********************************/
+#define CACHE_SET0_RAM   (0x10000000)
+#define CACHE_SET1_RAM   (0x10800000)
+#define CACHE_TAG_RAM    (0x11000000)
+
+/*********************************/
+/* CACHE_DISABLE MASK            */
+/*********************************/
+#define CACHE_DISABLE_MASK (0x04000000)
+
+#define GET_REG(reg)       (*((volatile u32 *)(reg)))
+#define PUT_REG(reg, val)  (*((volatile u32 *)(reg)) = ((u32)(val)))
+#define SET_REG(reg, mask) (PUT_REG((reg), GET_REG((reg)) |  mask))
+#define CLR_REG(reg, mask) (PUT_REG((reg), GET_REG((reg)) & ~mask))
+#define PUT_U16(reg, val)  (*((volatile u16 *)(reg)) = ((u16)(val)))
+#define PUT__U8(reg, val)  (*((volatile u8  *)(reg)) = (( u8)((val)&0xFF)))
+#define GET__U8(reg)       (*((volatile u8  *)(reg)))
+
+#define PUT_LED(val)       (PUT_REG(REG_IOPDATA, (~val)&0xFF))
+#define GET_LED()          ((~GET_REG( REG_IOPDATA)) & 0xFF)
+#define SET_LED(val)       { u32 led = GET_LED(); led |= 1 << (val);  PUT_LED( led); }
+#define CLR_LED(val)       { u32 led = GET_LED(); led &= ~(1 << (val));  PUT_LED( led); }
+
+/***********************************/
+/* CLOCK CONSTANTS -- 50 MHz Clock */
+/***********************************/
+
+#define CLK_FREQ_MHZ       (50)
+#define t_data_us(t)       ((t)*CLK_FREQ_MHZ-1)   /* t is time tick,unit[us] */
+#define t_data_ms(t)       (t_data_us((t)*1000))  /* t is time tick,unit[ms] */
+
+/*********************************************************/
+/*            TIMER MODE REGISTER                       */
+/*********************************************************/
+#define  TM0_RUN      0x01  /* Timer 0 enable */
+#define  TM0_TOGGLE   0x02  /* 0, interval mode */
+#define  TM0_OUT_1    0x04  /* Timer 0 Initial TOUT0 value */
+#define  TM1_RUN      0x08  /* Timer 1 enable */
+#define  TM1_TOGGLE   0x10  /* 0, interval mode */
+#define  TM1_OUT_1    0x20  /* Timer 0 Initial TOUT0 value */
+
+
+/*********************************/
+/* INTERRUPT SOURCES             */
+/*********************************/
+#define INT_EXTINT0    0
+#define INT_EXTINT1    1
+#define INT_EXTINT2    2
+#define INT_EXTINT3    3
+#define INT_UARTTX0    4
+#define INT_UARTRX0    5
+#define INT_UARTTX1    6
+#define INT_UARTRX1    7
+#define INT_GDMA0      8
+#define INT_GDMA1      9
+#define INT_TIMER0     10
+#define INT_TIMER1     11
+#define INT_HDLCTXA    12
+#define INT_HDLCRXA    13
+#define INT_HDLCTXB    14
+#define INT_HDLCRXB    15
+#define INT_BDMATX     16
+#define INT_BDMARX     17
+#define INT_MACTX      18
+#define INT_MACRX      19
+#define INT_IIC                20
+#define INT_GLOBAL     21
+#define N_IRQS         (21)
+
+#ifndef __ASSEMBLER__
+struct _irq_handler {
+       void                *m_data;
+       void (*m_func)( void *data);
+};
+
+#endif
+
+#endif /* __S3C4510_h */
index 0977bee35d859a6fae0e5860a006bd91f5d0a481..b8afc172c51f88ddc6ae77c26561b903bf03dcc1 100644 (file)
@@ -44,7 +44,6 @@
 #define        CONFIG_ADNPESC1         1               /* SSV ADNP/ESC1 board  */
 #define CONFIG_SYS_CLK_FREQ    CONFIG_SYS_NIOS_CPU_CLK/* 50 MHz core clock     */
 #define        CONFIG_SYS_HZ                   1000            /* 1 msec time tick     */
-#undef  CONFIG_SYS_CLKS_IN_HZ
 #define        CONFIG_BOARD_EARLY_INIT_F 1     /* enable early board-spec. init*/
 
 /*------------------------------------------------------------------------
index c77ea1fc471e46997491100fe131e47a5ac93d41..01b65c515d8e3c524df19d19493a8b1b0d090c73 100644 (file)
 /*
  * select serial console configuration
  */
+#define CONFIG_S3C44B0_SERIAL
 #define CONFIG_SERIAL1         1       /* we use Serial line 1 */
 
+#define CONFIG_S3C44B0_I2C
+#define CONFIG_RTC_S3C44B0
+
 /* allow to overwrite serial and ethaddr */
 #define CONFIG_ENV_OVERWRITE
 
 #define CONFIG_SYS_MEMTEST_START       0x0C400000      /* memtest works on     */
 #define CONFIG_SYS_MEMTEST_END         0x0C800000      /* 4 ... 8 MB in DRAM   */
 
-#undef  CONFIG_SYS_CLKS_IN_HZ          /* everything, incl board info, in Hz */
-
 #define        CONFIG_SYS_LOAD_ADDR            0x0c700000      /* default load address */
 
 #define        CONFIG_SYS_HZ                           1000            /* 1 kHz */
index db9c17df91372849c32d6ee81cd221cfc0d376fc..45ff2f7dbc8f61c09a0329159cc03bd4d8674752 100644 (file)
@@ -50,7 +50,6 @@
 #define        CONFIG_DK1C20           1               /* Cyclone DK-1C20 board*/
 #define CONFIG_SYS_CLK_FREQ    CONFIG_SYS_NIOS_CPU_CLK/* 50 MHz core clock     */
 #define        CONFIG_SYS_HZ                   1000            /* 1 msec time tick     */
-#undef  CONFIG_SYS_CLKS_IN_HZ
 #define        CONFIG_BOARD_EARLY_INIT_F 1     /* enable early board-spec. init*/
 
 /*------------------------------------------------------------------------
index 3bd270cdf2871ec3c8fe90c3e5a67ca931c42cd7..ae567a32b322950b1b0b47bc8da0d7641f373453 100644 (file)
@@ -48,7 +48,6 @@
 #define        CONFIG_DK1S10           1               /* Stratix DK-1S10 board*/
 #define CONFIG_SYS_CLK_FREQ    CONFIG_SYS_NIOS_CPU_CLK/* 50 MHz core clock     */
 #define        CONFIG_SYS_HZ                   1000            /* 1 msec time tick     */
-#undef  CONFIG_SYS_CLKS_IN_HZ
 #define        CONFIG_BOARD_EARLY_INIT_F 1     /* enable early board-spec. init*/
 
 /*------------------------------------------------------------------------
index 1dd6e573d2f7a929815f85542f96f3de1307f71b..4729464f21ecb464aae6405d5cac066d8dca80ec 100644 (file)
        { 300, 600, 1200, 2400, 4800, 9600, 19200, 38400,     \
         57600, 115200, 230400, 460800, 921600 }
 
-#define CONFIG_SYS_CLKS_IN_HZ          1       /* everything, incl board info, in Hz */
-
 #define CONFIG_SYS_LOAD_ADDR           0x100000        /* default load address */
 #define CONFIG_SYS_EXTBDINFO           1       /* To use extended board_into (bd_t) */
 
index 45e6a58d990367fa8013a535bf8e9d78895d1b15..05f6d9fc1af45f96054a26c58de52c2902e69048 100644 (file)
@@ -59,6 +59,7 @@
 /*
  * select serial console configuration
  */
+#define CONFIG_LPC2292_SERIAL
 #define CONFIG_SERIAL1         1       /* we use Serial line 1 */
 
 /* allow to overwrite serial and ethaddr */
 #define CONFIG_SYS_MEMTEST_START       0x81800000      /* memtest works on     */
 #define CONFIG_SYS_MEMTEST_END         0x83000000      /* 24 MB in SRAM        */
 
-#undef CONFIG_SYS_CLKS_IN_HZ           /* everything, incl board info, in Hz */
-
 #define        CONFIG_SYS_LOAD_ADDR            0x81000000      /* default load address */
                                                /* for uClinux img is here*/
 
index 78c5152e6fd488823fcac5e7d3e57e8d4da10f58..caa6592f7a83a6b288e6fb9d87b5b628aa893b51 100644 (file)
 #define CONFIG_SYS_MEMTEST_START       0x10000000      /* memtest works on     */
 #define CONFIG_SYS_MEMTEST_END         0x12000000      /* 32 MB in DRAM        */
 
-#undef CONFIG_SYS_CLKS_IN_HZ           /* everything, incl board info, in Hz */
-
 #define CONFIG_SYS_LOAD_ADDR           0x10000000      /* default load address */
 
 /* The 1510 has 3 timers, they can be driven by the RefClk (12Mhz) or by DPLL1.
  * This time is further subdivided by a local divisor.
  */
-#define CONFIG_SYS_TIMERBASE   0xFFFEC500          /* use timer 1 */
-#define CONFIG_SYS_PVT         7                   /* 2^(pvt+1), divide by 256 */
-#define CONFIG_SYS_HZ                  ((CONFIG_SYS_CLK_FREQ)/(2 << CONFIG_SYS_PVT))
+#define CONFIG_SYS_TIMERBASE   OMAP1510_TIMER1_BASE    /* use timer 1 */
+#define CONFIG_SYS_PTV         7       /* 2^(PTV+1), divide by 256 */
+#define CONFIG_SYS_HZ          ((CONFIG_SYS_CLK_FREQ)/(2 << CONFIG_SYS_PTV))
 
 /*-----------------------------------------------------------------------
  * Stack sizes
index d9bcf6b7ae6a214094cb0ff2d295e6a27f79c8f4..5e614fd8e8186bd9094f5b4b855a0933e0a32ea0 100644 (file)
 /*
  * select serial console configuration
  */
+#define CONFIG_S3C24X0_SERIAL
 #define CONFIG_SERIAL1          1      /* we use SERIAL 1 on VCMA9 */
 
 /************************************************************
 #define CONFIG_SYS_ALT_MEMTEST
 #define        CONFIG_SYS_LOAD_ADDR            0x30800000      /* default load address */
 
-
-#undef  CONFIG_SYS_CLKS_IN_HZ          /* everything, incl board info, in Hz */
-
 /* we configure PWM Timer 4 to 1us ~ 1MHz */
 /*#define      CONFIG_SYS_HZ                   1000000 */
 #define        CONFIG_SYS_HZ                   1562500
index 51d0a0a6ace23091440a7f660f09814272a00d71..ceef76eeaf67ed3d054b546d51df24db2a6a4b4d 100644 (file)
 /* The following table includes the supported baudrates */
 #define CONFIG_SYS_BAUDRATE_TABLE      {9600}
 
-#define CONFIG_SYS_CLKS_IN_HZ          1               /* everything, incl board info, in Hz */
-
 #define CONFIG_SYS_LOAD_ADDR           0x100000        /* default load address         */
 #define CONFIG_SYS_EXTBDINFO           1               /* use extended board_info (bd_t) */
 
index ca1a9d4a77bb79e0a630ecd3ea56a0efaf4d9aa1..11e063010b09dfa43136d0142a52ebf1a0b34332 100644 (file)
 /* The following table includes the supported baudrates */
 #define CONFIG_SYS_BAUDRATE_TABLE      {9600}
 
-#define CONFIG_SYS_CLKS_IN_HZ          1               /* everything, incl board info, in Hz */
-
 #define CONFIG_SYS_LOAD_ADDR           0x100000        /* default load address         */
 #define CONFIG_SYS_EXTBDINFO           1               /* use extended board_info (bd_t) */
 
index adbc39951c4ca021ca88e2d3b23675fb2b434316..91f6ff03f971b87aa8f9233f18dac3ab51b1adba 100644 (file)
@@ -95,8 +95,6 @@
 #define CONFIG_SYS_MEMTEST_START               0x00400000
 #define CONFIG_SYS_MEMTEST_END                 0x00800000
 
-/* everything, incl board info, in Hz */
-#undef  CONFIG_SYS_CLKS_IN_HZ
 /* spec says 66.666 MHz, but it appears to be 33 */
 #define CONFIG_SYS_HZ                          3333333
 
index 4c579ebe2f78977c5502cb2f1143157ba80b0c03..b9369383593c61dc28c1224ab9e50acd26e47ef2 100644 (file)
@@ -86,8 +86,6 @@
 #define CONFIG_SYS_MEMTEST_START               0x00400000
 #define CONFIG_SYS_MEMTEST_END                 0x00800000
 
-/* everything, incl board info, in Hz */
-#undef  CONFIG_SYS_CLKS_IN_HZ
 /* spec says 66.666 MHz, but it appears to be 33 */
 #define CONFIG_SYS_HZ                          3333333
 
index 694f52254a2f583e1b383f2f1f52d9ea1147fd27..f5ee8991023d3d4b0e8b9720149efb43c2960f4b 100644 (file)
@@ -84,8 +84,6 @@
 #define CONFIG_SYS_MEMTEST_START               0x00400000
 #define CONFIG_SYS_MEMTEST_END                 0x00800000
 
-/* everything, incl board info, in Hz */
-#undef  CONFIG_SYS_CLKS_IN_HZ
 /* spec says 66.666 MHz, but it appears to be 33 */
 #define CONFIG_SYS_HZ                          3333333
 
index cdc995672572cc1186677f59d93e7ab201552330..8d70a268ce54d38952b4a02e8f349ff40e167ee3 100644 (file)
@@ -83,8 +83,6 @@
 #define CONFIG_SYS_MEMTEST_START               0x00400000
 #define CONFIG_SYS_MEMTEST_END                 0x00800000
 
-/* everything, incl board info, in Hz */
-#undef  CONFIG_SYS_CLKS_IN_HZ
 /* spec says 66.666 MHz, but it appears to be 33 */
 #define CONFIG_SYS_HZ                          3333333
 
index f83dd9c2434e04a671f907f20066efe1cffcfc32..04da083e697d4234165d601c832fab57893ea8e4 100644 (file)
 #define        CONFIG_SYS_MEMTEST_START        (OMAP2420_SDRC_CS0)
 #define        CONFIG_SYS_MEMTEST_END          (OMAP2420_SDRC_CS0+SZ_31M)
 
-#undef CONFIG_SYS_CLKS_IN_HZ   /* everything, incl board info, in Hz */
 /* default load address */
 #define        CONFIG_SYS_LOAD_ADDR    (OMAP2420_SDRC_CS0)
 
  * or by 32KHz clk, or from external sig. This rate is divided by a local
  * divisor.
  */
-#define        V_PVT   7       /* use with 12MHz/128 */
-
 #define        CONFIG_SYS_TIMERBASE    OMAP2420_GPT2
-#define        CONFIG_SYS_PVT  V_PVT   /* 2^(pvt+1) */
-#define        CONFIG_SYS_HZ           ((CONFIG_SYS_CLK_FREQ)/(2 << CONFIG_SYS_PVT))
+#define        CONFIG_SYS_PTV          7       /* 2^(PTV+1) */
+#define        CONFIG_SYS_HZ           ((CONFIG_SYS_CLK_FREQ)/(2 << CONFIG_SYS_PTV))
 
 /*-----------------------------------------------------------------------
  * Stack sizes
index 5a4ceaf69f586b39fc92e073a9d1a1be0b69e994..7ba5e174e2d1f1e799dd6ff044577a972029c0b3 100644 (file)
@@ -64,6 +64,7 @@
 /*
  * select serial console configuration
  */
+#define CONFIG_CLPS7111_SERIAL
 #define CONFIG_SERIAL1         1       /* we use Serial line 1 */
 
 /* allow to overwrite serial and ethaddr */
 #define CONFIG_SYS_MEMTEST_START       0xc0400000      /* memtest works on     */
 #define CONFIG_SYS_MEMTEST_END         0xc0800000      /* 4 ... 8 MB in DRAM   */
 
-#undef  CONFIG_SYS_CLKS_IN_HZ          /* everything, incl board info, in Hz */
-
 #define        CONFIG_SYS_LOAD_ADDR            0x00040000      /* default load address for armadillo: kernel img is here*/
 
 #define        CONFIG_SYS_HZ                   2000            /* decrementer freq: 2 kHz */
index 024fa207e2cb28439837c0d2dad5512266546f0c..a6c442b51a65144d1fbb1c4a48ecea3b97159013 100644 (file)
@@ -57,6 +57,7 @@
 /*
  * select serial console configuration
  */
+#define CONFIG_SA1100_SERIAL
 #define CONFIG_SERIAL1          1      /* we use SERIAL 1 on Intel Assabet */
 
 /* allow to overwrite serial and ethaddr */
 #define CONFIG_SYS_MEMTEST_START       0xc0400000      /* memtest works on     */
 #define CONFIG_SYS_MEMTEST_END         0xc0800000      /* 4 ... 8 MB in DRAM   */
 
-#undef  CONFIG_SYS_CLKS_IN_HZ
-
 #define CONFIG_SYS_LOAD_ADDR           0xc0000000      /* default load address */
 
 #define CONFIG_SYS_HZ                  3686400 /* incrementer freq: 3.6864 MHz */
index f19374e30cb336c5a625f79502888859916dd365..751e03c13f9eb4e1407ab7ad9472b70c6ce33bf3 100644 (file)
 #define CONFIG_SYS_MEMTEST_START       0xa0400000      /* memtest works on     */
 #define CONFIG_SYS_MEMTEST_END         0xa0800000      /* 4 ... 8 MB in DRAM   */
 
-#undef CONFIG_SYS_CLKS_IN_HZ
-
 #define CONFIG_SYS_LOAD_ADDR           0xa2000000      /* default load address */
 
 #define CONFIG_SYS_HZ                  1000
index ce36a242614d818dc2dff21b6c97a6bb84c8d9c7..7ea1a46033ba2fa2ec3eabdaf7ab0afabf5e49d1 100644 (file)
@@ -53,6 +53,7 @@
  * select serial console configuration
  */
 #define CONFIG_ENV_IS_NOWHERE
+#define CONFIG_KS8695_SERIAL
 #define        CONFIG_SERIAL1
 #define CONFIG_CONS_INDEX      1
 #define CONFIG_BAUDRATE                115200
@@ -93,8 +94,6 @@
 #define CONFIG_SYS_MEMTEST_START       0x00800000      /* memtest works on     */
 #define CONFIG_SYS_MEMTEST_END         0x01000000      /* 16 MB in DRAM        */
 
-#undef CONFIG_SYS_CLKS_IN_HZ           /* everything, incl board info, in Hz */
-
 #define CONFIG_SYS_LOAD_ADDR           0x00008000      /* default load address */
 
 #define CONFIG_SYS_HZ                  (1000)          /* 1ms resolution ticks */
index 02cb1efd0fe3857fe9ffa06706cb073d42a276cf..ea374da86e88cbd5315ea0f2c2bf753e52ad18d3 100644 (file)
@@ -53,6 +53,7 @@
  * select serial console configuration
  */
 #define CONFIG_ENV_IS_NOWHERE
+#define CONFIG_KS8695_SERIAL
 #define        CONFIG_SERIAL1
 #define CONFIG_CONS_INDEX      1
 #define CONFIG_BAUDRATE                115200
@@ -93,8 +94,6 @@
 #define CONFIG_SYS_MEMTEST_START       0x00800000      /* memtest works on     */
 #define CONFIG_SYS_MEMTEST_END         0x01000000      /* 16 MB in DRAM        */
 
-#undef CONFIG_SYS_CLKS_IN_HZ           /* everything, incl board info, in Hz */
-
 #define CONFIG_SYS_LOAD_ADDR           0x00008000      /* default load address */
 
 #define CONFIG_SYS_HZ                  (1000)          /* 1ms resolution ticks */
index 5131175045fb98aaa2fb5b179d2188ab29353d29..850d93b03e128685dc2cacc3ca120aa03c0a9f49 100644 (file)
@@ -99,8 +99,6 @@
 #define CONFIG_SYS_MEMTEST_START       0xa0400000      /* memtest works on     */
 #define CONFIG_SYS_MEMTEST_END         0xa0800000      /* 4 ... 8 MB in DRAM   */
 
-#undef  CONFIG_SYS_CLKS_IN_HZ          /* everything, incl board info, in Hz */
-
 #define CONFIG_SYS_LOAD_ADDR           0xa2000000      /* default load address */
 
 #define CONFIG_SYS_HZ                  1000
index d65c14a672a1fa2213c85feb007eeae53d144ddf..d9f85f01eeccaf69b00c639f8623a3406532b1b3 100644 (file)
 #define CONFIG_SYS_MEMTEST_START       0xa0400000      /* memtest works on     */
 #define CONFIG_SYS_MEMTEST_END         0xa0800000      /* 4 ... 8 MB in DRAM   */
 
-#undef  CONFIG_SYS_CLKS_IN_HZ          /* everything, incl board info, in Hz */
-
 #define CONFIG_SYS_LOAD_ADDR           0xa3000000      /* default load address */
                                                /* RS: where is this documented? */
                                                /* RS: is this where U-Boot is  */
index 5d3b09aa3c2df06e6d55796231acb999d96095cc..204aea0e825676aa6af9541a993d72a18616a521 100644 (file)
 #define CONFIG_SYS_MEMTEST_END         0x0C00000 /* 4 ... 12 MB in DRAM */
 
 #define        CONFIG_SYS_HZ                   1000    /* decrementer freq: 1 ms ticks */
-#define CONFIG_SYS_CLKS_IN_HZ          1       /* everything, incl board info, in Hz */
 #define CONFIG_SYS_EXTBDINFO           1       /* To use extended board_info (bd_t) */
 #define CONFIG_SYS_LOAD_ADDR           0x100000 /* default load address */
 
index a33efde9fe2fff07244efc90ddf5b9ef01ba52cd..9b3a11c1ac881187a96089eda0ed74f8fce64b62 100644 (file)
 #define CONFIG_SYS_MEMTEST_END         0x0C00000 /* 4 ... 12 MB in DRAM */
 
 #define        CONFIG_SYS_HZ                   1000    /* decrementer freq: 1 ms ticks */
-#define CONFIG_SYS_CLKS_IN_HZ          1       /* everything, incl board info, in Hz */
 #define CONFIG_SYS_EXTBDINFO           1       /* To use extended board_info (bd_t) */
 #define CONFIG_SYS_LOAD_ADDR           0x100000 /* default load address */
 
index 667c0d882e034e19ea1820bc55c32a1dec60db5b..b43beaa03e8c9b5fcf5cc96b34c3d35189a26e13 100644 (file)
 /* Flash & Environment */
 /*=====================*/
 #ifdef CONFIG_SYS_USE_NAND
+#define CONFIG_NAND_DAVINCI
 #undef CONFIG_ENV_IS_IN_FLASH
 #define CONFIG_SYS_NO_FLASH
 #define CONFIG_ENV_IS_IN_NAND          /* U-Boot env in NAND Flash  */
index 22d3808a3d1ce697954bfc11d44633ae13304715..2c97a00167a6ada524263e5ce5545c44e4fe6125 100644 (file)
@@ -81,6 +81,7 @@
 /*=====================*/
 #undef CONFIG_ENV_IS_IN_FLASH
 #define CONFIG_SYS_NO_FLASH
+#define CONFIG_NAND_DAVINCI
 #define CONFIG_ENV_IS_IN_NAND          /* U-Boot env in NAND Flash  */
 #define CONFIG_ENV_SECT_SIZE   2048    /* Env sector Size */
 #define CONFIG_ENV_SIZE                SZ_128K
index 875bab6f7dd70759892f5f379201d8077e63b4cf..9354c2ffb0d87071876654eb5a2ab89e70ca1394 100644 (file)
@@ -77,6 +77,7 @@
 /* Flash & Environment */
 #undef CONFIG_ENV_IS_IN_FLASH
 #define CONFIG_SYS_NO_FLASH
+#define CONFIG_NAND_DAVINCI
 #define CONFIG_ENV_IS_IN_NAND          /* U-Boot env in NAND Flash  */
 #define CONFIG_ENV_SECT_SIZE   2048    /* Env sector Size */
 #define CONFIG_ENV_SIZE                SZ_128K
index 47ab27a8701a5143ddc289e4e56730fa82b5ec38..0865d0d33b83a7622a5713fbe0859889865b7174 100644 (file)
 /* Flash & Environment */
 /*=====================*/
 #ifdef CONFIG_SYS_USE_NAND
+#define CONFIG_NAND_DAVINCI
 #undef CONFIG_ENV_IS_IN_FLASH
 #define CONFIG_SYS_NO_FLASH
 #define CONFIG_ENV_IS_IN_NAND          /* U-Boot env in NAND Flash  */
index 001b48a7e7d2936567787a5f25bee885da48d848..f5508b7740096a340e5479d447759df3cd90fc07 100644 (file)
 #define CONFIG_SYS_MEMTEST_START       0x80400000      /* memtest works on     */
 #define CONFIG_SYS_MEMTEST_END         0x80800000      /* 4 ... 8 MB in DRAM   */
 
-#undef CONFIG_SYS_CLKS_IN_HZ           /* everything, incl board info, in Hz */
-
 #define CONFIG_SYS_LOAD_ADDR   (CONFIG_SYS_DRAM_BASE + 0x8000) /* default load address */
 
 #define CONFIG_SYS_HZ                  1000
index e329fd3a0258590da37270fbd7aa12706e897948..8f615bdb8448b071794031ec10ca82c6bb2c3e0d 100644 (file)
@@ -59,6 +59,7 @@
 /*
  * select serial console configuration
  */
+#define CONFIG_SA1100_SERIAL
 #define CONFIG_SERIAL1          1      /* we use SERIAL 1 */
 
 /* allow to overwrite serial and ethaddr */
 #define CONFIG_SYS_MEMTEST_START       0xc0400000      /* memtest works on     */
 #define CONFIG_SYS_MEMTEST_END         0xc0800000      /* 4 ... 8 MB in DRAM   */
 
-#undef  CONFIG_SYS_CLKS_IN_HZ          /* everything, incl board info, in Hz */
-
 #define        CONFIG_SYS_LOAD_ADDR            0xc0200000      /* default load address */
 
 #define        CONFIG_SYS_HZ                   3686400         /* incrementer freq: 3.6864 MHz */
index 84e1aefe1f873f53b8a5fda54e9ff403601f80d2..f7e6608baa63ddda59110d94f545ac15bab4c27e 100644 (file)
 #define CONFIG_SYS_MEMTEST_START       0x00100000      /* memtest works on     */
 #define CONFIG_SYS_MEMTEST_END         0x01000000      /* 1 ... 16 MB in DRAM  */
 
-#undef  CONFIG_SYS_CLKS_IN_HZ          /* everything, incl board info, in Hz */
-
 #define        CONFIG_SYS_LOAD_ADDR            0x100000        /* default load address */
 
 #define        CONFIG_SYS_HZ                   1024            /* incrementer freq: 1kHz */
index 322a3ca41ac478a25079b97715273dc9cc0ba7b6..630fff3903ac4dfc505ce82df4ed3f0159b23645 100644 (file)
@@ -55,6 +55,7 @@
 /*
  * select serial console configuration
  */
+#define CONFIG_CLPS7111_SERIAL
 #define CONFIG_SERIAL1         1       /* we use Serial line 1 */
 
 /* allow to overwrite serial and ethaddr */
 #define CONFIG_SYS_MEMTEST_START       0xc0400000      /* memtest works on     */
 #define CONFIG_SYS_MEMTEST_END         0xc0800000      /* 4 ... 8 MB in DRAM   */
 
-#undef  CONFIG_SYS_CLKS_IN_HZ          /* everything, incl board info, in Hz */
-
 #define        CONFIG_SYS_LOAD_ADDR            0xc0500000      /* default load address */
 
 #define        CONFIG_SYS_HZ                   2000            /* decrementer freq: 2 kHz */
index cbaae62059c92b0cba315892cca4540604bcfe51..ffc9408bc8288a957d566a1bb28e92b376dc1b38 100644 (file)
 #define CONFIG_SYS_MEMTEST_START       0x00000000      /* memtest works on     */
 #define CONFIG_SYS_MEMTEST_END         0x00780000      /* 4 ... 8 MB in DRAM   */
 
-#undef CONFIG_SYS_CLKS_IN_HZ           /* everything, incl board info, in Hz */
-
 #define CONFIG_SYS_LOAD_ADDR           0x00000000      /* default load address */
 
 #define CONFIG_SYS_SYS_CLK_FREQ        50000000        /* CPU freq: 50 MHz */
index c0b3ab91e433c74cdb9263419100b9b0bffe5ce8..77d45783c3187824b9a0ca533fdbb78019c0043a 100644 (file)
@@ -70,6 +70,7 @@
 /*
  * select serial console configuration
  */
+#define CONFIG_SA1100_SERIAL
 #define CONFIG_SERIAL3          1      /* we use SERIAL 3 on ADS GCPlus */
 
 /* allow to overwrite serial and ethaddr */
 #define CONFIG_SYS_MEMTEST_START       0xc0400000      /* memtest works on     */
 #define CONFIG_SYS_MEMTEST_END         0xc0800000      /* 4 ... 8 MB in DRAM   */
 
-#undef  CONFIG_SYS_CLKS_IN_HZ          /* everything, incl board info, in Hz */
-
 #define        CONFIG_SYS_LOAD_ADDR            0xc0000000      /* default load address */
 
 #define        CONFIG_SYS_HZ                   3686400         /* incrementer freq: 3.6864 MHz */
index 2dacfb6e074b0a7d615b7ee12ed56a4519d61fe3..284672b338f88314368c2347ba353668d81b4c7a 100644 (file)
 #define CONFIG_SYS_MEMTEST_START       0x00400000      /* memtest works on     */
 #define CONFIG_SYS_MEMTEST_END         0x03c00000      /* 4 ... 60 MB in DRAM  */
 
-#define CONFIG_SYS_CLKS_IN_HZ          1       /* everything, incl board info, in Hz */
-
 #define        CONFIG_SYS_LOAD_ADDR            0x100000        /* default load address */
 
 #define        CONFIG_SYS_HZ           1000            /* decrementer freq: 1 ms ticks */
index a3d023f630f41fe4eb2eb1e2c831b1523eba6382..c7001cc7de87c9a3152eb21c73ff53b500a13c5a 100644 (file)
@@ -54,6 +54,7 @@
 /*
  * select serial console configuration
  */
+#define CONFIG_CLPS7111_SERIAL
 #define CONFIG_SERIAL1         1       /* we use Serial line 1 */
 
 /* allow to overwrite serial and ethaddr */
 #define CONFIG_SYS_MEMTEST_START       0xc0400000      /* memtest works on     */
 #define CONFIG_SYS_MEMTEST_END         0xc0800000      /* 4 ... 8 MB in DRAM   */
 
-#undef  CONFIG_SYS_CLKS_IN_HZ          /* everything, incl board info, in Hz */
-
 #define        CONFIG_SYS_LOAD_ADDR            0xc1000000      /* default load address */
 
 #define        CONFIG_SYS_HZ                   2000            /* decrementer freq: 2 kHz */
index 043ae2f364a270f49e91cff3a880856f8aca08b2..895998adf4c685cc84b00f5dc4e3e579c7100bfc 100644 (file)
 #define CONFIG_SYS_MEMTEST_START       0xa0400000      /* memtest works on     */
 #define CONFIG_SYS_MEMTEST_END         0xa0800000      /* 4 ... 8 MB in DRAM   */
 
-#undef  CONFIG_SYS_CLKS_IN_HZ          /* everything, incl board info, in Hz */
-
 #define CONFIG_SYS_LOAD_ADDR           0xa3000000      /* load kernel to this address   */
 
 #define CONFIG_SYS_HZ                  1000
index 6ce3b4dc014ed2063677d9fb9e618a1eb9441ec1..9231e640392cfde3b84531e412d6551efa44ce67 100644 (file)
 #define CONFIG_SYS_MAXARGS     16              /* max number of command args   */
 #define CONFIG_SYS_BARGSIZE    CONFIG_SYS_CBSIZE       /* Boot Argument Buffer Size    */
 
-#undef CONFIG_SYS_CLKS_IN_HZ           /* everything, incl board info, in Hz */
 #define CONFIG_SYS_LOAD_ADDR   0x7fc0  /* default load address */
 
 /*-----------------------------------------------------------------------
index 5b4747a575becce9239eed862e998857d58f2f86..b4219d03e12676d90ddf81fff191c7b1425c1b87 100644 (file)
@@ -121,7 +121,6 @@ SIB at Block62 End Block62 address 0x24f80000
 #define CONFIG_SYS_MAXARGS     16                      /* max number of command args */
 #define CONFIG_SYS_BARGSIZE    CONFIG_SYS_CBSIZE               /* Boot Argument Buffer Size*/
 
-#undef CONFIG_SYS_CLKS_IN_HZ           /* everything, incl board info, in Hz */
 #define CONFIG_SYS_LOAD_ADDR   0x7fc0  /* default load address */
 
 /*-----------------------------------------------------------------------
index 70f39873655b647d8baac79cbdd14fc521dfef64..768e8366bda2d6a584f82f747278ad3077d0a3bb 100644 (file)
 #define CONFIG_SYS_MEMTEST_START       0x00400000      /* memtest works on     */
 #define CONFIG_SYS_MEMTEST_END         0x00800000      /* 4 ... 8 MB in DRAM   */
 
-#undef  CONFIG_SYS_CLKS_IN_HZ          /* everything, incl board info, in Hz */
-
 #define CONFIG_SYS_LOAD_ADDR           0x00010000      /* default load address */
 
 #define CONFIG_SYS_HZ                  3333333         /* spec says 66.666 MHz, but it appears to be 33 */
index 193008e0ef36b2a0e955f18c4d6c5d38105f3232..75707e597dba2af3fcd8c67ab03c2e85653ae3ee 100644 (file)
 #define CONFIG_SYS_MEMTEST_END         0x00800000      /* 4 ... 8 MB in DRAM   */
 #define CONFIG_SYS_LOAD_ADDR           0x00010000      /* default load address */
 
-#undef  CONFIG_SYS_CLKS_IN_HZ          /* everything, incl board info, in Hz */
 #define CONFIG_SYS_HZ                  1000            /* decrementer freq: 1 ms ticks */
 
                                                /* valid baudrates */
index 38b8e75f458420caea7f13d225220457962cfe03..e34ec222b890372e8a05cc27b987ac289e0c1332 100644 (file)
@@ -52,6 +52,7 @@
 /*
  * select serial console configuration
  */
+#define CONFIG_SA1100_SERIAL
 #define CONFIG_SERIAL3          1      /* we use SERIAL 3 on LART */
 
 /* allow to overwrite serial and ethaddr */
 #define CONFIG_SYS_MEMTEST_START       0xc0400000      /* memtest works on     */
 #define CONFIG_SYS_MEMTEST_END         0xc0800000      /* 4 ... 8 MB in DRAM   */
 
-#undef  CONFIG_SYS_CLKS_IN_HZ          /* everything, incl board info, in Hz */
-
 #define        CONFIG_SYS_LOAD_ADDR            0xc8000000      /* default load address */
 
 #define        CONFIG_SYS_HZ                   3686400         /* incrementer freq: 3.6864 MHz */
index cd105da313afd49647406d484a3303528c593204..9afa8001398c342363f9aa8746af86e1b0857e36 100644 (file)
 #define CONFIG_SYS_MEMTEST_START       0x08000000      /* memtest works on             */
 #define CONFIG_SYS_MEMTEST_END         0x0800ffff      /* 64 KiB                       */
 
-#undef  CONFIG_SYS_CLKS_IN_HZ          /* everything, incl board info, in Hz */
-
 #define CONFIG_SYS_LOAD_ADDR           0x08000000      /* load kernel to this address   */
 
 #define CONFIG_SYS_HZ                  1000
index 563d35b20cccd895152d640d34ab0d8098a1f700..15150387938af4a5f828fe89c96b1c683f9a416f 100644 (file)
@@ -59,6 +59,7 @@
 /*
  * select serial console configuration
  */
+#define CONFIG_LPC2292_SERIAL
 #define CONFIG_SERIAL1         1       /* we use Serial line 1 */
 
 /* allow to overwrite serial and ethaddr */
 #define CONFIG_SYS_MEMTEST_START       0x40000000      /* memtest works on     */
 #define CONFIG_SYS_MEMTEST_END         0x40000000      /* 4 ... 8 MB in DRAM   */
 
-#undef CONFIG_SYS_CLKS_IN_HZ           /* everything, incl board info, in Hz */
-
 #define        CONFIG_SYS_LOAD_ADDR            0x00040000      /* default load address for     */
                                                /* armadillo: kernel img is here*/
 
index 575f2a1c5eacc8913e8c172dc64ed7799ea6abba..b1bd74fc6fb73a6904234cbab9cbc98167460e1f 100644 (file)
@@ -99,8 +99,6 @@
 #define CONFIG_SYS_MEMTEST_START       0xc0300000      /* memtest works on     */
 #define CONFIG_SYS_MEMTEST_END         0xc0500000      /* 2 MB in DRAM */
 
-#undef  CONFIG_SYS_CLKS_IN_HZ          /* everything, incl board info, in Hz */
-
 #define        CONFIG_SYS_LOAD_ADDR            0xc0f00000      /* default load address */
 
 /* valid baudrates */
index 3e726a01deb0d5bba8099edcd118296fe28c6232..b197674d47aeb91abd066a81756e7740f92e8704 100644 (file)
@@ -99,8 +99,6 @@
 #define CONFIG_SYS_MEMTEST_START       0xc0300000      /* memtest works on     */
 #define CONFIG_SYS_MEMTEST_END         0xc0500000      /* 2 MB in DRAM */
 
-#undef  CONFIG_SYS_CLKS_IN_HZ          /* everything, incl board info, in Hz */
-
 #define        CONFIG_SYS_LOAD_ADDR            0xc0f00000      /* default load address */
 
 /* valid baudrates */
index 69774d7467fc62d8177243851424eab69ded95a2..a4b430bbc5750db00be8d13c41d765365dd5c0d2 100644 (file)
 #define CONFIG_SYS_MEMTEST_START       0xa0400000      /* memtest works on     */
 #define CONFIG_SYS_MEMTEST_END         0xa0800000      /* 4 ... 8 MB in DRAM   */
 
-#undef CONFIG_SYS_CLKS_IN_HZ           /* everything, incl board info, in Hz */
-
 #define CONFIG_SYS_LOAD_ADDR   (CONFIG_SYS_DRAM_BASE + 0x8000) /* default load address */
 
 #define CONFIG_SYS_HZ                  1000
index 27213a8d8dbeb26dd57ea6174196aa5f022eb91e..74bab5fc4c1fe0bf41d60f227f0afd24fae3a496 100644 (file)
@@ -56,6 +56,7 @@
 /*
  * select serial console configuration
  */
+#define CONFIG_NETARM_SERIAL
 #define CONFIG_SERIAL1         1       /* we use Serial line 1 */
 
 /* allow to overwrite serial and ethaddr */
 #define CONFIG_SYS_MEMTEST_START       0x00400000      /* memtest works on     */
 #define CONFIG_SYS_MEMTEST_END         0x00800000      /* 4 ... 8 MB in DRAM   */
 
-#undef  CONFIG_SYS_CLKS_IN_HZ          /* everything, incl board info, in Hz */
-
 #define        CONFIG_SYS_LOAD_ADDR            0x00500000      /* default load address */
 
 #define        CONFIG_SYS_HZ                   900             /* decrementer freq: 2 kHz */
index f136b0ca8c6e2b8487edfcdaa3086c609265b1e2..12e567bf7d4f4ca1893022685ee467e4aaf430ab 100644 (file)
@@ -40,6 +40,7 @@
 /*
  * Select serial console configuration
   */
+#define CONFIG_IMX_SERIAL
 #define CONFIG_IMX_SERIAL1             /* internal uart 1 */
 /* #define _CONFIG_UART2 */            /* internal uart 2 */
 /* #define CONFIG_SILENT_CONSOLE */    /* use this to disable output */
 #define CONFIG_SYS_MEMTEST_START       0x09000000      /* memtest works on     */
 #define CONFIG_SYS_MEMTEST_END         0x0AF00000      /* 63 MB in DRAM        */
 
-#undef CONFIG_SYS_CLKS_IN_HZ                           /* everything, incl board info, in Hz */
 #define CONFIG_SYS_LOAD_ADDR           0x08800000      /* default load address */
 /*#define      CONFIG_SYS_HZ                   1000 */
 #define CONFIG_SYS_HZ                  3686400
index a19eb78409e4d7daf11672aaf321a97b6bfadea8..431e6695e325b6d5beee2cb5c667d50ec274ef6d 100644 (file)
@@ -80,8 +80,6 @@
 #define CONFIG_SYS_MEMTEST_START       0x08100000            /* memtest test area   */
 #define CONFIG_SYS_MEMTEST_END         0x08F00000
 
-#undef CONFIG_SYS_CLKS_IN_HZ                        /* use HZ for freq. display     */
-
 #define CONFIG_SYS_HZ                  3686400      /* incrementer freq: 3.6864 MHz */
 #define CONFIG_SYS_CPUSPEED            0x141        /* core clock - register value  */
 
    0x000b00b ->3<- -> 64MHz/4=16MHz */
 
 #ifdef _CONFIG_UART1
+#define CONFIG_IMX_SERIAL
 #define CONFIG_IMX_SERIAL1
 #elif defined _CONFIG_UART2
+#define CONFIG_IMX_SERIAL
 #define CONFIG_IMX_SERIAL2
 #elif defined _CONFIG_UART3 | defined _CONFIG_UART4
-#define CONFIG_IMX_SERIAL_NONE
 #define CONFIG_SYS_NS16550
 #define CONFIG_SYS_NS16550_SERIAL
 #define CONFIG_SYS_NS16550_CLK         3686400
index 0b38549dff0d8892a6e47ecd27ca6ee2c84a73e0..39560de3c558e5a9b5984fae15e50f58c963fbf6 100644 (file)
 #define PHYS_SDRAM_1_SIZE      (64 * 1024 * 1024)
 #define PHYS_FLASH_1           0x00000000      /* Flash Bank #1 */
 
-/*
- * FLASH organization
- */
-#define CONFIG_SYS_FLASH_BASE          PHYS_FLASH_1
-#define CONFIG_SYS_MAX_FLASH_BANKS     1
-#define PHYS_FLASH_1_SIZE              (1 * 1024 * 1024)
-#define CONFIG_SYS_MAX_FLASH_SECT      19
-#define CONFIG_SYS_FLASH_ERASE_TOUT    (5*CONFIG_SYS_HZ) /* in ticks */
-#define CONFIG_SYS_FLASH_WRITE_TOUT    (5*CONFIG_SYS_HZ)
-
 #define CONFIG_SYS_MONITOR_BASE                PHYS_FLASH_1
 #define CONFIG_SYS_MONITOR_LEN         (256 * 1024)
 
 #define CONFIG_DRIVER_SMC91111
 #define CONFIG_SMC91111_BASE           0x04000300
 
+#define CONFIG_SYS_FLASH_BASE          PHYS_FLASH_1
+#define CONFIG_SYS_MAX_FLASH_BANKS     1
+#define CONFIG_SYS_MAX_FLASH_SECT      19
+
+#define CONFIG_SYS_FLASH_CFI
+#define CONFIG_FLASH_CFI_DRIVER
+#define CONFIG_SYS_FLASH_CFI_WIDTH     FLASH_CFI_16BIT
+#define CONFIG_FLASH_CFI_LEGACY
+#define CONFIG_SYS_FLASH_LEGACY_512Kx16
+
 #define CONFIG_SYS_MAX_NAND_DEVICE     1
 #define CONFIG_SYS_NAND_BASE           0x04000000 + (2 << 23)
 #define NAND_ALLOW_ERASE_ALL           1
 
+#define CONFIG_HARD_I2C
+#define CONFIG_SYS_I2C_SPEED           100000
+#define CONFIG_SYS_I2C_SLAVE           1
+#define CONFIG_DRIVER_OMAP1510_I2C
+
+#define CONFIG_RTC_DS1307
+#define CONFIG_SYS_I2C_RTC_ADDR                0x68
+
 
 #define CONFIG_CONS_INDEX              1
 #define CONFIG_BAUDRATE                        115200
  */
 #define CONFIG_CMD_BDI
 #define CONFIG_CMD_BOOTD
+#define CONFIG_CMD_DATE
 #define CONFIG_CMD_DHCP
 #define CONFIG_CMD_SAVEENV
 #define CONFIG_CMD_FLASH
 #define CONFIG_SYS_MEMTEST_END         PHYS_SDRAM_1 + PHYS_SDRAM_1_SIZE - \
                                (CONFIG_SYS_MONITOR_LEN + CONFIG_SYS_MALLOC_LEN + CONFIG_STACKSIZE)
 
-#undef CONFIG_SYS_CLKS_IN_HZ           /* everything, incl board info, in Hz */
-
 #define CONFIG_SYS_LOAD_ADDR           PHYS_SDRAM_1 + 0x400000 /* default load address */
 
 /* The 1510 has 3 timers, they can be driven by the RefClk (12Mhz) or by DPLL1.
  * This time is further subdivided by a local divisor.
  */
 #define CONFIG_SYS_TIMERBASE           OMAP1510_TIMER1_BASE
-#define CONFIG_SYS_PVT                 7               /* 2^(pvt+1), divide by 256 */
-#define CONFIG_SYS_HZ                  ((CONFIG_SYS_CLK_FREQ)/(2 << CONFIG_SYS_PVT))
+#define CONFIG_SYS_PTV                 7               /* 2^(pvt+1), divide by 256 */
+#define CONFIG_SYS_HZ                  ((CONFIG_SYS_CLK_FREQ)/(2 << CONFIG_SYS_PTV))
 
 #define OMAP5910_DPLL_DIV      1
 #define OMAP5910_DPLL_MUL      ((CONFIG_SYS_CLK_FREQ * \
index 543780d77f26c40debdae78542b00b0e27aac54d..6d7b94f9c9e9f6d925455f6e4f23df541781d1fb 100644 (file)
@@ -96,7 +96,6 @@
 /* timing informazion */
 #define CONFIG_SYS_HZ          (2400000 / 256) /* Timer0: 2.4Mhz + divider */
 #define CONFIG_SYS_TIMERBASE   0x101E2000
-#undef CONFIG_SYS_CLKS_IN_HZ
 
 /* serial port (PL011) configuration */
 #define CONFIG_PL011_SERIAL
index b22c33cc809af6ecc00d298f2e299ea834436849..79dcd647c2d14fd56ad998e31416523ef61351bb 100644 (file)
 #define CONFIG_SYS_MEMTEST_START       0x00000000      /* memtest works on     */
 #define CONFIG_SYS_MEMTEST_END         0x00780000      /* 7,5 MB in DRAM       */ /* @TODO */
 
-#undef  CONFIG_SYS_CLKS_IN_HZ          /* everything, incl board info, in Hz */
-
 #define        CONFIG_SYS_LOAD_ADDR            0x00600000      /* default load address */ /* @TODO */
 
 #define        CONFIG_SYS_HZ                   (CPU_CLK_FREQ/64)
index c7d1b6c039e4e95ab9be29be588cf5852231f3c8..6c1c5ec0d79b19e8d47e71a6be263fd825e31f5d 100644 (file)
 #define CONFIG_SYS_MEMTEST_START       0x10000000      /* memtest works on     */
 #define CONFIG_SYS_MEMTEST_END         0x12000000      /* 32 MB in DRAM        */
 
-#undef CONFIG_SYS_CLKS_IN_HZ           /* everything, incl board info, in Hz */
-
 #define CONFIG_SYS_LOAD_ADDR           0x10000000      /* default load address */
 
 /* The 1510 has 3 timers, they can be driven by the RefClk (12Mhz) or by DPLL1.
  * This time is further subdivided by a local divisor.
  */
-#define CONFIG_SYS_TIMERBASE   0xFFFEC500          /* use timer 1 */
-#define CONFIG_SYS_PVT         7                   /* 2^(pvt+1), divide by 256 */
-#define CONFIG_SYS_HZ                  ((CONFIG_SYS_CLK_FREQ)/(2 << CONFIG_SYS_PVT))
+#define CONFIG_SYS_TIMERBASE   OMAP1510_TIMER1_BASE    /* use timer 1 */
+#define CONFIG_SYS_PTV         7       /* 2^(PTV+1), divide by 256 */
+#define CONFIG_SYS_HZ          ((CONFIG_SYS_CLK_FREQ)/(2 << CONFIG_SYS_PTV))
 
 /*-----------------------------------------------------------------------
  * Stack sizes
index e2a63607c08472ea629b382dc7781c6b1b86e5b0..42e0198316682fa4c9812e75f76b95982d1b4361 100644 (file)
 #define CONFIG_SYS_MEMTEST_START       0x10000000      /* memtest works on */
 #define CONFIG_SYS_MEMTEST_END 0x12000000      /* 32 MB in DRAM */
 
-#undef CONFIG_SYS_CLKS_IN_HZ           /* everything, incl board info, in Hz */
-
 #define CONFIG_SYS_LOAD_ADDR   0x10000000      /* default load address */
 
 /* The 1610 has 6 timers, they can be driven by the RefClk (12Mhz) or by
  * DPLL1. This time is further subdivided by a local divisor.
  */
 #define CONFIG_SYS_TIMERBASE   0xFFFEC500      /* use timer 1 */
-#define CONFIG_SYS_PVT 7       /* 2^(pvt+1), divide by 256 */
-#define CONFIG_SYS_HZ  ((CONFIG_SYS_CLK_FREQ)/(2 << CONFIG_SYS_PVT))
+#define CONFIG_SYS_PTV         7       /* 2^(PTV+1), divide by 256 */
+#define CONFIG_SYS_HZ          ((CONFIG_SYS_CLK_FREQ)/(2 << CONFIG_SYS_PTV))
 
 /*-----------------------------------------------------------------------
  * Stack sizes
index 5dcfce15920da942ae1c454e3b98459a274fc57c..22c873e0ca0886075789ec33d1a5892c6aef3310 100644 (file)
 #define CONFIG_SYS_MEMTEST_START       0x10000000      /* memtest works on */
 #define CONFIG_SYS_MEMTEST_END 0x12000000      /* 32 MB in DRAM    */
 
-#undef CONFIG_SYS_CLKS_IN_HZ           /* everything, incl board info, in Hz */
-
 #define CONFIG_SYS_LOAD_ADDR   0x10000000      /* default load address */
 
 /* The 1610 has 6 timers, they can be driven by the RefClk (12Mhz) or by
  * DPLL1. This time is further subdivided by a local divisor.
  */
 #define CONFIG_SYS_TIMERBASE   0xFFFEC500      /* use timer 1 */
-#define CONFIG_SYS_PVT 7       /* 2^(pvt+1), divide by 256 */
-#define CONFIG_SYS_HZ  ((CONFIG_SYS_CLK_FREQ)/(2 << CONFIG_SYS_PVT))
+#define CONFIG_SYS_PTV         7       /* 2^(PTV+1), divide by 256 */
+#define CONFIG_SYS_HZ          ((CONFIG_SYS_CLK_FREQ)/(2 << CONFIG_SYS_PTV))
 
 /*-----------------------------------------------------------------------
  * Stack sizes
index 983b5f25172a61a682c765655a8eafccfeca9ee4..331bf4530572f4fe2e0f5513e9d79f1d07027b05 100644 (file)
 #define CONFIG_SYS_MEMTEST_START        (OMAP2420_SDRC_CS0)  /* memtest works on */
 #define CONFIG_SYS_MEMTEST_END          (OMAP2420_SDRC_CS0+SZ_31M)
 
-#undef CONFIG_SYS_CLKS_IN_HZ           /* everything, incl board info, in Hz */
-
 #define CONFIG_SYS_LOAD_ADDR            (OMAP2420_SDRC_CS0) /* default load address */
 
 /* The 2420 has 12 GP timers, they can be driven by the SysClk (12/13/19.2) or by
  * 32KHz clk, or from external sig. This rate is divided by a local divisor.
  */
 #ifdef CONFIG_APTIX
-#define V_PVT                    3
+#define V_PTV                  3
 #else
-#define V_PVT                    7  /* use with 12MHz/128 */
+#define V_PTV                  7       /* use with 12MHz/128 */
 #endif
 
-#define CONFIG_SYS_TIMERBASE            OMAP2420_GPT2
-#define CONFIG_SYS_PVT                  V_PVT  /* 2^(pvt+1) */
-#define CONFIG_SYS_HZ                   ((CONFIG_SYS_CLK_FREQ)/(2 << CONFIG_SYS_PVT))
+#define CONFIG_SYS_TIMERBASE           OMAP2420_GPT2
+#define CONFIG_SYS_PTV                 V_PTV   /* 2^(PTV+1) */
+#define CONFIG_SYS_HZ                  ((CONFIG_SYS_CLK_FREQ)/(2 << CONFIG_SYS_PTV))
 
 /*-----------------------------------------------------------------------
  * Stack sizes
index 0f9344b0c479b051f4f99566d63bab11bceb634b..7db1eb754bc9a2b9217e1bf8c23ce0c547db8d83 100644 (file)
 #define CONFIG_SYS_MEMTEST_END         (OMAP34XX_SDRC_CS0 + \
                                        0x01F00000) /* 31MB */
 
-#undef CONFIG_SYS_CLKS_IN_HZ           /* everything, incl board info, in Hz */
-
 #define CONFIG_SYS_LOAD_ADDR           (OMAP34XX_SDRC_CS0)     /* default */
                                                        /* load address */
 
  * 2430 has 12 GP timers, they can be driven by the SysClk (12/13/19.2) or by
  * 32KHz clk, or from external sig. This rate is divided by a local divisor.
  */
-#define V_PVT                          7
-
 #define CONFIG_SYS_TIMERBASE           (OMAP34XX_GPT2)
-#define CONFIG_SYS_PVT                 V_PVT   /* 2^(pvt+1) */
-#define CONFIG_SYS_HZ                  ((V_SCLK) / (2 << CONFIG_SYS_PVT))
+#define CONFIG_SYS_PTV                 7       /* 2^(PTV+1) */
+#define CONFIG_SYS_HZ                  ((V_SCLK) / (2 << CONFIG_SYS_PTV))
 
 /*-----------------------------------------------------------------------
  * Stack sizes
index f4498a9bcc32c5b6f0d5cb3eebdc753605fcacd7..2f532d5929a55da9509888eaf867734ae85ea6cc 100644 (file)
 #define CONFIG_SYS_MEMTEST_END         (OMAP34XX_SDRC_CS0 + \
                                        0x01F00000) /* 31MB */
 
-#undef CONFIG_SYS_CLKS_IN_HZ           /* everything, incl board info, */
-                                       /* in Hz */
-
 #define CONFIG_SYS_LOAD_ADDR           (OMAP34XX_SDRC_CS0) /* default load */
                                                                /* address */
 
  * 2430 has 12 GP timers, they can be driven by the SysClk (12/13/19.2) or by
  * 32KHz clk, or from external sig. This rate is divided by a local divisor.
  */
-#define V_PVT                          7
-
 #define CONFIG_SYS_TIMERBASE           OMAP34XX_GPT2
-#define CONFIG_SYS_PVT                 V_PVT   /* 2^(pvt+1) */
-#define CONFIG_SYS_HZ                  ((V_SCLK) / (2 << CONFIG_SYS_PVT))
+#define CONFIG_SYS_PTV                 7       /* 2^(PTV+1) */
+#define CONFIG_SYS_HZ                  ((V_SCLK) / (2 << CONFIG_SYS_PTV))
 
 /*-----------------------------------------------------------------------
  * Stack sizes
index dee0417de9df2ed8a1271242dcb19ec544c2a424..0c32100a0a744106a20060d6617dc824b6c41483 100644 (file)
 #define CONFIG_SYS_MEMTEST_END         (OMAP34XX_SDRC_CS0 + \
                                        0x01F00000) /* 31MB */
 
-#undef CONFIG_SYS_CLKS_IN_HZ           /* everything, incl board info, */
-                                       /* in Hz */
-
 #define CONFIG_SYS_LOAD_ADDR           (OMAP34XX_SDRC_CS0) /* default load */
                                                                /* address */
 
  * 2430 has 12 GP timers, they can be driven by the SysClk (12/13/19.2) or by
  * 32KHz clk, or from external sig. This rate is divided by a local divisor.
  */
-#define V_PVT                          7
-
 #define CONFIG_SYS_TIMERBASE           (OMAP34XX_GPT2)
-#define CONFIG_SYS_PVT                 V_PVT   /* 2^(pvt+1) */
-#define CONFIG_SYS_HZ                  ((V_SCLK) / (2 << CONFIG_SYS_PVT))
+#define CONFIG_SYS_PTV                 7       /* 2^(PTV+1) */
+#define CONFIG_SYS_HZ                  ((V_SCLK) / (2 << CONFIG_SYS_PTV))
 
 /*-----------------------------------------------------------------------
  * Stack sizes
index 00c03746444238e3911edba18e1583fd067844eb..fb4e50dbdb3e76b15618ce6b2a08b03dc2b4db49 100644 (file)
 #define CONFIG_SYS_MEMTEST_END         (OMAP34XX_SDRC_CS0 + \
                                        0x01F00000) /* 31MB */
 
-#undef CONFIG_SYS_CLKS_IN_HZ           /* everything, incl board info, */
-                                       /* in Hz */
-
 #define CONFIG_SYS_LOAD_ADDR           (OMAP34XX_SDRC_CS0) /* default load */
                                                                /* address */
 
  * 2430 has 12 GP timers, they can be driven by the SysClk (12/13/19.2) or by
  * 32KHz clk, or from external sig. This rate is divided by a local divisor.
  */
-#define V_PVT                          7
-
 #define CONFIG_SYS_TIMERBASE           (OMAP34XX_GPT2)
-#define CONFIG_SYS_PVT                 V_PVT   /* 2^(pvt+1) */
-#define CONFIG_SYS_HZ                  ((V_SCLK) / (2 << CONFIG_SYS_PVT))
+#define CONFIG_SYS_PTV                 7       /* 2^(PTV+1) */
+#define CONFIG_SYS_HZ                  ((V_SCLK) / (2 << CONFIG_SYS_PTV))
 
 /*-----------------------------------------------------------------------
  * Stack sizes
index f8ae1639478d9441d96555864d9619fe37baad66..883234a50598b9a622d90db77f754a5c85a561ea 100644 (file)
 #define CONFIG_SYS_MEMTEST_END         (OMAP34XX_SDRC_CS0 + \
                                        0x01F00000) /* 31MB */
 
-#undef CONFIG_SYS_CLKS_IN_HZ           /* everything, incl board info, in Hz */
-
 #define CONFIG_SYS_LOAD_ADDR           (OMAP34XX_SDRC_CS0)     /* default */
                                                        /* load address */
 
  * 2430 has 12 GP timers, they can be driven by the SysClk (12/13/19.2) or by
  * 32KHz clk, or from external sig. This rate is divided by a local divisor.
  */
-#define V_PVT                          7
-
 #define CONFIG_SYS_TIMERBASE           (OMAP34XX_GPT2)
-#define CONFIG_SYS_PVT                 V_PVT   /* 2^(pvt+1) */
-#define CONFIG_SYS_HZ                  ((V_SCLK) / (2 << CONFIG_SYS_PVT))
+#define CONFIG_SYS_PTV                 7       /* 2^(PTV+1) */
+#define CONFIG_SYS_HZ                  ((V_SCLK) / (2 << CONFIG_SYS_PTV))
 
 /*-----------------------------------------------------------------------
  * Stack sizes
index 63cd9c6b76378282df409004d2750408bd004cb2..d0ce9dc91564cec5ac310210602b647dd60968da 100644 (file)
 #define CONFIG_SYS_MEMTEST_START       0x10000000      /* memtest works on */
 #define CONFIG_SYS_MEMTEST_END 0x12000000      /* 32 MB in DRAM    */
 
-#undef CONFIG_SYS_CLKS_IN_HZ           /* everything, incl board info, in Hz */
-
 #define CONFIG_SYS_LOAD_ADDR   0x10000000      /* default load address */
 
 /* The 1610 has 6 timers, they can be driven by the RefClk (12Mhz) or by
  * DPLL1. This time is further subdivided by a local divisor.
  */
 #define CONFIG_SYS_TIMERBASE   0xFFFEC500      /* use timer 1 */
-#define CONFIG_SYS_PVT 7       /* 2^(pvt+1), divide by 256 */
-#define CONFIG_SYS_HZ  ((CONFIG_SYS_CLK_FREQ)/(2 << CONFIG_SYS_PVT))
+#define CONFIG_SYS_PTV         7       /* 2^(PTV+1), divide by 256 */
+#define CONFIG_SYS_HZ          ((CONFIG_SYS_CLK_FREQ)/(2 << CONFIG_SYS_PTV))
 
 /*-----------------------------------------------------------------------
  * Stack sizes
index 166d592ccdbbf5a09d0e03436ade86207843a0c0..32a9b2397b1ec3e708c3d9e3c2da6f7eb3f5b1bf 100644 (file)
 #define CONFIG_SYS_MEMTEST_START          0x10000000          /* memtest works on */
 #define CONFIG_SYS_MEMTEST_END            0x12000000          /* 32 MB in DRAM    */
 
-#undef CONFIG_SYS_CLKS_IN_HZ                /* everything, incl board info, in Hz */
-
 #define CONFIG_SYS_LOAD_ADDR              0x10000000          /* default load address */
 
 /* The OMAP730 has 3 general purpose MPU timers, they can be driven by
  * the RefClk (12Mhz) or by DPLL1. This time is further subdivided by a
  * local divisor.
  */
-
-#define CONFIG_SYS_TIMERBASE              0xFFFEC500          /* use timer 1 */
-#define CONFIG_SYS_PVT                    7                   /* 2^(pvt+1), divide by 256 */
-#define CONFIG_SYS_HZ                     ((CONFIG_SYS_CLK_FREQ)/(2 << CONFIG_SYS_PVT))
+#define CONFIG_SYS_TIMERBASE           0xFFFEC500      /* use timer 1 */
+#define CONFIG_SYS_PTV                 7       /* 2^(PTV+1), divide by 256 */
+#define CONFIG_SYS_HZ                  ((CONFIG_SYS_CLK_FREQ)/(2 << CONFIG_SYS_PTV))
 
 /*-----------------------------------------------------------------------
  * Stack sizes
index 4da401f46bc12141561b894680bd076482ad0bca..edaa81b59b0cac7cc73f65547349d633a5ca555b 100644 (file)
 #define CONFIG_SYS_MEMTEST_END         0x00800000      /* 4 ... 8 MB in DRAM   */
 #define CONFIG_SYS_LOAD_ADDR           0x00010000      /* default load address */
 
-#undef  CONFIG_SYS_CLKS_IN_HZ          /* everything, incl board info, in Hz */
 #define CONFIG_SYS_HZ                  1000            /* decrementer freq: 1 ms ticks */
                                                /* valid baudrates */
 #define CONFIG_SYS_BAUDRATE_TABLE      { 9600, 19200, 38400, 57600, 115200 }
index 59741a98f9916c1316fd7505c121f36e24e61504..ab9ea4fdee923b6623cfd57ae175abe09fa2147b 100644 (file)
 #define CONFIG_SYS_MEMTEST_START       0xa0400000      /* memtest works on     */
 #define CONFIG_SYS_MEMTEST_END         0xa0800000      /* 4 ... 8 MB in DRAM   */
 
-#undef CONFIG_SYS_CLKS_IN_HZ           /* everything, incl board info, in Hz */
-
 #define CONFIG_SYS_LOAD_ADDR           0xa2000000      /* default load address */
 
 #define CONFIG_SYS_HZ                  1000
index d1c2c650c21e0fe11dc9cccc544580d957d654f4..5e2e7cfcc83b5754a79cf62be6dc8e4968cfc8d9 100644 (file)
 #define CONFIG_SYS_MEMTEST_START       0xa0400000      /* memtest works on     */
 #define CONFIG_SYS_MEMTEST_END         0xa0800000      /* 4 ... 8 MB in DRAM   */
 
-#undef CONFIG_SYS_CLKS_IN_HZ           /* everything, incl board info, in Hz */
-
 #define CONFIG_SYS_LOAD_ADDR           0xa0800000      /* default load address */
 
 #define CONFIG_SYS_HZ                  1000
index bf4a14e00489fe3e5ca313350420ed1545498374..af0018772ce65a9bc5635c5cb0a2ae7416714904 100644 (file)
@@ -70,6 +70,7 @@
 /*
  * select serial console configuration
  */
+#define CONFIG_S3C24X0_SERIAL
 #define CONFIG_SERIAL1          1      /* we use SERIAL 1 on SBC2410X */
 
 /************************************************************
 #define CONFIG_SYS_MEMTEST_START       0x30000000      /* memtest works on     */
 #define CONFIG_SYS_MEMTEST_END         0x33F00000      /* 63 MB in DRAM        */
 
-#undef  CONFIG_SYS_CLKS_IN_HZ          /* everything, incl board info, in Hz */
-
 #define        CONFIG_SYS_LOAD_ADDR            0x33000000      /* default load address */
 
 /* the PWM TImer 4 uses a counter of 15625 for 10 ms, so we need */
  * NAND flash settings
  */
 #if defined(CONFIG_CMD_NAND)
+#define CONFIG_NAND_S3C2410
 #define CONFIG_SYS_MAX_NAND_DEVICE     1       /* Max number of NAND devices           */
 #define SECTORSIZE 512
 
index 960350c6c60b7c019377b76bee0083700681d694..3e2bb02a46226c3567fe5792c14380e31470b1bc 100644 (file)
 #define CONFIG_SYS_MEMTEST_START       0x00100000      /* memtest works on     */
 #define CONFIG_SYS_MEMTEST_END         0x01000000      /* 1 ... 16 MB in DRAM  */
 
-#undef  CONFIG_SYS_CLKS_IN_HZ          /* everything, incl board info, in Hz */
-
 #define        CONFIG_SYS_LOAD_ADDR            0x100000        /* default load address */
 
 #define        CONFIG_SYS_HZ                   1024            /* incrementer freq: 1kHz */
index 2445a341689628dfb51e64406a606ed93dae6f51..d42ef84216726a99944cfcb786dacba02324bb05 100644 (file)
 #define CONFIG_SYS_MEMTEST_START       0x00100000      /* memtest works on     */
 #define CONFIG_SYS_MEMTEST_END         0x01000000      /* 1 ... 16 MB in DRAM  */
 
-#undef  CONFIG_SYS_CLKS_IN_HZ          /* everything, incl board info, in Hz */
-
 #define        CONFIG_SYS_LOAD_ADDR            0x100000        /* default load address */
 
 #define        CONFIG_SYS_HZ                   1024            /* incrementer freq: 1kHz */
index 5971df72fcbdb1ddd8a58ae5c1359f7e58441e04..2f166c9d861051881ccc89501fba2d7e29fe027f 100644 (file)
@@ -29,6 +29,7 @@
 #define CONFIG_SCB9328         1     /* on a scb9328tronix board */
 #undef CONFIG_USE_IRQ                /* don't need use IRQ/FIQ    */
 
+#define CONFIG_IMX_SERIAL
 #define CONFIG_IMX_SERIAL1
 /*
  * Select serial console configuration
@@ -86,8 +87,6 @@
 #define CONFIG_SYS_MEMTEST_START       0x08100000            /* memtest test area   */
 #define CONFIG_SYS_MEMTEST_END         0x08F00000
 
-#undef CONFIG_SYS_CLKS_IN_HZ                        /* use HZ for freq. display     */
-
 #define CONFIG_SYS_HZ                  3686400      /* incrementer freq: 3.6864 MHz */
 #define CONFIG_SYS_CPUSPEED            0x141        /* core clock - register value  */
 
index 75ba34cdb851b90f3b4ec81654ec1412eb979a1c..c8b0b161d8cf81f641ac8e72297d66d5afe21ff4 100644 (file)
@@ -59,6 +59,7 @@
 /*
  * select serial console configuration
  */
+#define CONFIG_SA1100_SERIAL
 #define CONFIG_SERIAL3          1      /* we use SERIAL 3  */
 
 /* allow to overwrite serial and ethaddr */
 #define CONFIG_SYS_MEMTEST_START       0xc0400000      /* memtest works on     */
 #define CONFIG_SYS_MEMTEST_END         0xc0800000      /* 4 ... 8 MB in DRAM   */
 
-#undef  CONFIG_SYS_CLKS_IN_HZ          /* everything, incl board info, in Hz */
-
 #define        CONFIG_SYS_LOAD_ADDR            0xd0000000      /* default load address */
 
 #define        CONFIG_SYS_HZ                   3686400         /* incrementer freq: 3.6864 MHz */
index 6388be4d493a87d2e9f202eebc3797cc8e83d51a..ffdf21768b000e12b759552003104b92372e91fd 100644 (file)
@@ -63,6 +63,7 @@
 /*
  * select serial console configuration
  */
+#define CONFIG_S3C24X0_SERIAL
 #define CONFIG_SERIAL1          1      /* we use SERIAL 1 on SAMSUNG */
 
 #undef CONFIG_HWFLOW                   /* include RTS/CTS flow control support */
 #define CONFIG_SYS_MEMTEST_START       0x0c000000      /* memtest works on     */
 #define CONFIG_SYS_MEMTEST_END         0x0e000000      /* 32 MB in DRAM        */
 
-#undef  CONFIG_SYS_CLKS_IN_HZ          /* everything, incl board info, in Hz */
-
 #define        CONFIG_SYS_LOAD_ADDR            0x0cf00000      /* default load address */
 
 /* the PWM TImer 4 uses a counter of 15625 for 10 ms, so we need */
index ecd958b55758843f2521972606e63d7b9fdec2e8..fb437069daaa9b51a3f07889535cc90511d89963 100644 (file)
@@ -60,6 +60,7 @@
 /*
  * select serial console configuration
  */
+#define CONFIG_S3C24X0_SERIAL
 #define CONFIG_SERIAL1          1      /* we use SERIAL 1 on SMDK2410 */
 
 /************************************************************
 #define CONFIG_SYS_MEMTEST_START       0x30000000      /* memtest works on     */
 #define CONFIG_SYS_MEMTEST_END         0x33F00000      /* 63 MB in DRAM        */
 
-#undef  CONFIG_SYS_CLKS_IN_HZ          /* everything, incl board info, in Hz */
-
 #define        CONFIG_SYS_LOAD_ADDR            0x33000000      /* default load address */
 
 /* the PWM TImer 4 uses a counter of 15625 for 10 ms, so we need */
index 06d6a885920e6202e7279f1121a7f8d5e0174b66..d3cf6e58f4335fbb46cb5a1979b5893afd1d3118 100644 (file)
 
 #if !defined(CONFIG_ENABLE_MMU)
 #define CONFIG_CMD_USB                 1
+#define CONFIG_USB_S3C64XX
 #define CONFIG_USB_OHCI_NEW            1
 #define CONFIG_SYS_USB_OHCI_REGS_BASE          0x74300000
 #define CONFIG_SYS_USB_OHCI_SLOT_NAME          "s3c6400"
index 8f13c35614caba7d0b3f7a9054cd3b1a7abf4c7c..520fe368de2caff6b551af10b80a03079fd8e6eb 100644 (file)
 /*
  * select serial console configuration
  */
+#define CONFIG_S3C24X0_SERIAL
 #define CONFIG_SERIAL1         1       /* we use SERIAL 1 on TRAB */
 
 #define CONFIG_HWFLOW                  /* include RTS/CTS flow control support */
 #define CONFIG_SYS_MEMTEST_START       0x0C000000      /* memtest works on     */
 #define CONFIG_SYS_MEMTEST_END         0x0D000000      /* 16 MB in DRAM        */
 
-#undef CONFIG_SYS_CLKS_IN_HZ           /* everything, incl board info, in Hz */
-
 #define        CONFIG_SYS_LOAD_ADDR            0x0CF00000      /* default load address */
 
 #ifdef CONFIG_TRAB_50MHZ
index 70e5ce97b0951674c49fc2e59de831c8c45a0d8c..c2744b5eba501e6fe73c131384e047f81cc3b91f 100644 (file)
 #define CONFIG_SYS_MEMTEST_START       0xa0400000      /* memtest works on     */
 #define CONFIG_SYS_MEMTEST_END         0xa0800000      /* 4 ... 8 MB in DRAM   */
 
-#undef CONFIG_SYS_CLKS_IN_HZ           /* everything, incl board info, in Hz */
-
 #define CONFIG_SYS_LOAD_ADDR           0xa1000000      /* default load address */
 
 #define CONFIG_SYS_HZ                  1000
index 852becb36dcdad4a4e6bd87480b1a38f4038edfa..8f6383b051417a9540382d062b47c75f4ddf6a1b 100644 (file)
 #define CONFIG_SYS_MAXARGS     16              /* max number of command args   */
 #define CONFIG_SYS_BARGSIZE    CONFIG_SYS_CBSIZE       /* Boot Argument Buffer Size    */
 
-#undef CONFIG_SYS_CLKS_IN_HZ           /* everything, incl board info, in Hz */
 #define CONFIG_SYS_LOAD_ADDR   0x7fc0  /* default load address */
 
 /*-----------------------------------------------------------------------
index cadd90633da5d3830020a7392e5dedb29598a078..3f97843722445f06ff48c70ba38312f402a9cd84 100644 (file)
 #define CONFIG_SYS_MEMTEST_START       PHYS_SDRAM_1
 #define CONFIG_SYS_MEMTEST_END         PHYS_SDRAM_1 + PHYS_SDRAM_1_SIZE - PHYS_SDRAM_1_RESERVED
 
-#undef CONFIG_SYS_CLKS_IN_HZ           /* everything, incl board info, in Hz */
-
 /* The 1510 has 3 timers, they can be driven by the RefClk (12Mhz) or by DPLL1.
  * This time is further subdivided by a local divisor.
  */
-#define CONFIG_SYS_TIMERBASE           OMAP1510_TIMER1_BASE
-#define CONFIG_SYS_PVT                 7               /* 2^(pvt+1), divide by 256 */
-#define CONFIG_SYS_HZ                  ((CONFIG_SYS_CLK_FREQ)/(2 << CONFIG_SYS_PVT))
+#define CONFIG_SYS_TIMERBASE   OMAP1510_TIMER1_BASE
+#define CONFIG_SYS_PTV         7       /* 2^(PTV+1), divide by 256 */
+#define CONFIG_SYS_HZ          ((CONFIG_SYS_CLK_FREQ)/(2 << CONFIG_SYS_PTV))
 
 #define OMAP5910_DPLL_DIV      1
 #define OMAP5910_DPLL_MUL      ((CONFIG_SYS_CLK_FREQ * \
index d0afd29c32e15026f091cd4f5701d5d874a4951c..717577f398a95c5e480c5cf788036a9d98c1fc4b 100644 (file)
@@ -79,8 +79,6 @@
 #define CONFIG_SYS_MEMTEST_START       0xa0400000            /* memtest test area   */
 #define CONFIG_SYS_MEMTEST_END         0xa0800000
 
-#undef  CONFIG_SYS_CLKS_IN_HZ                       /* use HZ for freq. display     */
-
 #define CONFIG_SYS_HZ                  1000
 #define CONFIG_SYS_CPUSPEED            0x141        /* core clock - register value  */
 
index 250247c5ccfdbaef8ed2eea6dc73b333c3482ed9..086ca69c102462352f31ad8554db2f67332e601e 100644 (file)
 #define CONFIG_SYS_MEMTEST_START       0xa0400000      /* memtest works on     */
 #define CONFIG_SYS_MEMTEST_END         0xa0800000      /* 4 ... 8 MB in DRAM   */
 
-#undef CONFIG_SYS_CLKS_IN_HZ                           /* everything, incl board info, in Hz */
-
 #define CONFIG_SYS_LOAD_ADDR           0xa1000000      /* default load address */
 
 #define CONFIG_SYS_HZ                  1000
index 8e9d5ab7b31e92f61f8a19b9e21d7a69003c0e02..922eb2c6b01c64807808bc9f4a7e3722eb57e5c6 100644 (file)
 #define CONFIG_SYS_MEMTEST_START       0xa0400000      /* memtest works on             */
 #define CONFIG_SYS_MEMTEST_END         0xa0800000      /* 4 ... 8 MB in DRAM           */
 
-#undef CONFIG_SYS_CLKS_IN_HZ           /* everything, incl board info, in Hz */
-
 #define CONFIG_SYS_LOAD_ADDR           0xa3000000      /* default load address */
 
 #define CONFIG_SYS_HZ                  1000
index 5d13f9682e71b0498b05890cefdeec14513b4ffd..cad414c1d96dab9cb7e58907986ad2215f14c39a 100644 (file)
 #define CONFIG_SYS_BARGSIZE                    CONFIG_SYS_CBSIZE                               /* Boot Argument Buffer Size */
 #define CONFIG_SYS_MEMTEST_START               0xA0400000                              /* memtest works on     */
 #define CONFIG_SYS_MEMTEST_END                 0xA0800000                              /* 4 ... 8 MB in DRAM   */
-#undef  CONFIG_SYS_CLKS_IN_HZ                                                          /* everything, incl board info, in Hz */
 #define CONFIG_SYS_BAUDRATE_TABLE              { 9600, 19200, 38400, 57600, 115200 }   /* valid baudrates */
 #define CONFIG_SYS_LOAD_ADDR                   0xA0000000                              /* load kernel to this address   */
 
index 6febeeafabb53e2714047ba5b6b1a5175baed2f2..064740d3cc524b283175d47b69a3286344847b30 100644 (file)
 #define CONFIG_SYS_MEMTEST_START       0x9c000000      /* memtest works on     */
 #define CONFIG_SYS_MEMTEST_END         0x9c400000      /* 4 ... 8 MB in DRAM   */
 
-#undef CONFIG_SYS_CLKS_IN_HZ           /* everything, incl board info, in Hz */
-
 #define CONFIG_SYS_LOAD_ADDR   (CONFIG_SYS_DRAM_BASE + 0x8000) /* default load address */
 
 #define CONFIG_SYS_HZ                  1000