]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
* Add support for ext2 filesystems and image timestamps to TQM5200 board
authorwdenk <wdenk>
Thu, 24 Feb 2005 22:44:16 +0000 (22:44 +0000)
committerwdenk <wdenk>
Thu, 24 Feb 2005 22:44:16 +0000 (22:44 +0000)
* Add reset code for Coral-P on INKA4x0 board

* Patch by Martin Krause, 28 Jun 2004:
  Update for TRAB board.

* Fix some missing "volatile"s in MPC5xxx FEC driver

CHANGELOG
README
board/inka4x0/inka4x0.c
board/trab/auto_update.c
board/trab/cmd_trab.c
board/trab/tsc2000.c
cpu/mpc5xxx/fec.c
include/configs/TQM5200.h
include/configs/inka4x0.h
include/configs/trab.h

index 720ecaaedff27c5c911af06a1daf67ce3c634f45..e655482e1fd0a24467b9bfc718c7d5bd4ef1b4ab 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -2,6 +2,15 @@
 Changes for U-Boot 1.1.3:
 ======================================================================
 
+* Add support for ext2 filesystems and image timestamps to TQM5200 board
+
+* Add reset code for Coral-P on INKA4x0 board
+
+* Patch by Martin Krause, 28 Jun 2004:
+  Update for TRAB board.
+
+* Fix some missing "volatile"s in MPC5xxx FEC driver
+
 * Fix cirrus voltage detection (for CPC45)
 
 * Fix byteorder problem in usbboot and scsiboot commands.
diff --git a/README b/README
index 50e58dc534b40c5bd7c8b182693a898a26dadc2e..a9c052c0592ff4aaa5e1ba03e992ee9d6a6b7adb 100644 (file)
--- a/README
+++ b/README
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000 - 2004
+# (C) Copyright 2000 - 2005
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
index a33251021f5d772793c0b069f94c29321462c8fd..08a1b7f00bc65dd2cd290588b497c6ac3ef36fd8 100644 (file)
@@ -177,6 +177,19 @@ void flash_preinit(void)
        *(vu_long *)MPC5XXX_BOOTCS_CFG &= ~0x1; /* clear RO */
 }
 
+#define GPIO_PSC3_9     0x04000000UL
+
+int misc_init_f (void)
+{
+       /*
+        * Reset Coral-P graphics controller
+        */
+        *(vu_long *) MPC5XXX_WU_GPIO_ENABLE |= GPIO_PSC3_9;
+        *(vu_long *) MPC5XXX_WU_GPIO_DIR    |= GPIO_PSC3_9;
+        *(vu_long *) MPC5XXX_WU_GPIO_DATA   |= GPIO_PSC3_9;
+        return 0;
+}
+
 #ifdef  CONFIG_PCI
 static struct pci_controller hose;
 
@@ -187,5 +200,3 @@ void pci_init_board(void)
         pci_mpc5xxx_init(&hose);
 }
 #endif
-
-
index 393e094d8a5096b141ad5e5ed24213c3cd7c0700..0399fe86ac70bbe0c7d25d93e2f948ec573b67ed 100644 (file)
@@ -416,6 +416,13 @@ au_update_eeprom(int idx)
        int off;
        uint32_t val;
 
+       /* special case for prepare.img */
+       if (idx == IDX_PREPARE) {
+               /* enable the power switch */
+               *CPLD_VFD_BK &= ~POWER_OFF;
+               return 0;
+       }
+
        hdr = (image_header_t *)LOAD_ADDR;
        /* write the time field into EEPROM */
        off = auee_off[idx].time;
index 794c5271869e14fa3fb2e58c185ab5516b097f67..00eb385fdf1cdff7a23445df46d92bb50ef7c051 100644 (file)
@@ -26,6 +26,7 @@
 #include <common.h>
 #include <command.h>
 #include <s3c2400.h>
+#include <rtc.h>
 
 /*
  * TRAB board specific commands. Especially commands for burn-in and function
@@ -117,6 +118,7 @@ int i2c_write_multiple (uchar chip, uint addr, int alen,
                        uchar *buffer, int len);
 int i2c_read_multiple (uchar chip, uint addr, int alen,
                        uchar *buffer, int len);
+int do_temp_log (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
 
 /* helper functions */
 static void adc_init (void);
@@ -173,6 +175,7 @@ int do_burn_in (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        led_init ();
        global_vars_init ();
        test_function_table_init ();
+       spi_init ();
 
        if (global_vars_write_to_eeprom () != 0) {
                printf ("%s: error writing global_vars to eeprom\n",
@@ -334,7 +337,6 @@ int do_contact_temp (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        }
 
        spi_init ();
-       tsc2000_reg_init ();
 
        contact_temp = tsc2000_contact_temp();
        printf ("%d degree C * 100\n", contact_temp) ;
@@ -577,7 +579,6 @@ static int test_contact_temp (void)
 {
        int contact_temp;
 
-       spi_init ();
        contact_temp = tsc2000_contact_temp ();
 
        if ((contact_temp < MIN_CONTACT_TEMP)
@@ -840,4 +841,55 @@ static int dummy(void)
        return (0);
 }
 
+int do_temp_log (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+{
+       int contact_temp;
+       int delay = 0;
+#if (CONFIG_COMMANDS & CFG_CMD_DATE)
+       struct rtc_time tm;
+#endif
+
+       if (argc > 2) {
+               printf ("Usage:\n%s\n", cmdtp->usage);
+               return 1;
+       }
+
+       if (argc > 1) {
+               delay = simple_strtoul(argv[1], NULL, 10);
+       }
+
+       spi_init ();
+       while (1) {
+
+#if (CONFIG_COMMANDS & CFG_CMD_DATE)
+               rtc_get (&tm);
+               printf ("%4d-%02d-%02d %2d:%02d:%02d - ",
+                       tm.tm_year, tm.tm_mon, tm.tm_mday,
+                       tm.tm_hour, tm.tm_min, tm.tm_sec);
+#endif
+
+               contact_temp = tsc2000_contact_temp();
+               printf ("%d\n", contact_temp) ;
+
+               if (delay != 0)
+                       /*
+                        * reset timer to avoid timestamp overflow problem
+                        * after about 68 minutes of udelay() time.
+                        */
+                       reset_timer_masked ();
+                       sdelay (delay);
+       }
+
+       return 0;
+}
+
+U_BOOT_CMD(
+       tlog,   2,      1,      do_temp_log,
+       "tlog    - log contact temperature [1/100 C] to console (endlessly)\n",
+       "delay\n"
+       "    - contact temperature [1/100 C] is printed endlessly to console\n"
+       "      <delay> specifies the seconds to wait between two measurements\n"
+       "      For each measurment a timestamp is printeted\n"
+);
+
 #endif /* CFG_CMD_BSP */
index df2d87f5c23e6ecf581461a7db2664f71cec6575..ca6868212eadb9a4ea45c3513602029b61ac1daa 100644 (file)
 
 #include "Pt1000_temp_data.h"
 
+/* helper function */
+#define abs(value) (((value) < 0) ? ((value)*-1) : (value))
+
+/*
+ * Maximal allowed deviation between two immediate meassurments of an analog
+ * thermo channel. 1 DIGIT = 0.0276 °C. This is used to filter sporadic
+ * "jumps" in measurment.
+ */
+#define MAX_DEVIATION  18      /* unit: DIGITs of adc; 18 DIGIT = 0.5 °C */
+
 void spi_init(void)
 {
        S3C24X0_GPIO * const gpio = S3C24X0_GetBase_GPIO();
@@ -227,15 +237,48 @@ s32 tsc2000_contact_temp (void)
        long adc_pt1000, offset;
        long u_pt1000;
        long contact_temp;
-
+       long temp1, temp2;
 
        tsc2000_reg_init ();
        tsc2000_set_range (3);
 
-       adc_pt1000 = tsc2000_read_channel (14);
+       /*
+        * Because of sporadic "jumps" in the measured adc values every
+        * channel is read two times. If there is a significant difference
+        * between the two measurements, then print an error and do a third
+        * measurement, because it is very unlikely that a successive third
+        * measurement goes also wrong.
+        */
+       temp1 = tsc2000_read_channel (14);
+       temp2 = tsc2000_read_channel (14);
+       if (abs(temp2 - temp1) < MAX_DEVIATION)
+               adc_pt1000 = temp2;
+       else {
+               printf ("%s: read adc value (channel 14) exceeded max allowed "
+                       "deviation: %d * 0.0276 °C\n",
+                       __FUNCTION__, MAX_DEVIATION);
+               printf ("adc value 1: %ld DIGITs\nadc value 2: %ld DIGITs\n",
+                       temp1, temp2);
+               adc_pt1000 = tsc2000_read_channel (14);
+               printf ("use (third read) adc value: adc_pt1000 = "
+                       "%ld DIGITs\n", adc_pt1000);
+       }
        debug ("read channel 14 (pt1000 adc value): %ld\n", adc_pt1000);
 
-       offset = tsc2000_read_channel (15);
+       temp1 = tsc2000_read_channel (15);
+       temp2 = tsc2000_read_channel (15);
+       if (abs(temp2 - temp1) < MAX_DEVIATION)
+               offset = temp2;
+       else {
+               printf ("%s: read adc value (channel 15) exceeded max allowed "
+                       "deviation: %d * 0.0276 °C\n",
+                       __FUNCTION__, MAX_DEVIATION);
+               printf ("adc value 1: %ld DIGITs\nadc value 2: %ld DIGITs\n",
+                       temp1, temp2);
+               offset = tsc2000_read_channel (15);
+               printf ("use (third read) adc value: offset = %ld DIGITs\n",
+                       offset);
+       }
        debug ("read channel 15 (offset): %ld\n", offset);
 
        /*
index 935fee8ca7d7a90c364704c4838ba216037d96b7..21632722d3f4cbbb958effb5d6d36df874af0f91 100644 (file)
@@ -115,7 +115,7 @@ static void mpc5xxx_fec_tbd_init(mpc5xxx_fec_priv *fec)
 }
 
 /********************************************************************/
-static void mpc5xxx_fec_rbd_clean(mpc5xxx_fec_priv *fec, FEC_RBD * pRbd)
+static void mpc5xxx_fec_rbd_clean(mpc5xxx_fec_priv *fec, volatile FEC_RBD * pRbd)
 {
        /*
         * Reset buffer descriptor as empty
@@ -141,7 +141,7 @@ static void mpc5xxx_fec_rbd_clean(mpc5xxx_fec_priv *fec, FEC_RBD * pRbd)
 /********************************************************************/
 static void mpc5xxx_fec_tbd_scrub(mpc5xxx_fec_priv *fec)
 {
-       FEC_TBD *pUsedTbd;
+       volatile FEC_TBD *pUsedTbd;
 
 #if (DEBUG & 0x1)
        printf ("tbd_scrub: fec->cleanTbdNum = %d, fec->usedTbdIndex = %d\n",
@@ -354,10 +354,10 @@ static int mpc5xxx_fec_init(struct eth_device *dev, bd_t * bis)
        /*
         * Initialize SmartDMA parameters stored in SRAM
         */
-       *(int *)FEC_TBD_BASE = (int)fec->tbdBase;
-       *(int *)FEC_RBD_BASE = (int)fec->rbdBase;
-       *(int *)FEC_TBD_NEXT = (int)fec->tbdBase;
-       *(int *)FEC_RBD_NEXT = (int)fec->rbdBase;
+       *(volatile int *)FEC_TBD_BASE = (int)fec->tbdBase;
+       *(volatile int *)FEC_RBD_BASE = (int)fec->rbdBase;
+       *(volatile int *)FEC_TBD_NEXT = (int)fec->tbdBase;
+       *(volatile int *)FEC_RBD_NEXT = (int)fec->rbdBase;
 
        /*
         * Enable FEC-Lite controller
@@ -688,7 +688,7 @@ static int mpc5xxx_fec_send(struct eth_device *dev, volatile void *eth_data,
         * 6-byte Ethernet addresses.
         */
        mpc5xxx_fec_priv *fec = (mpc5xxx_fec_priv *)dev->priv;
-       FEC_TBD *pTbd;
+       volatile FEC_TBD *pTbd;
 
 #if (DEBUG & 0x20)
        printf("tbd status: 0x%04x\n", fec->tbdBase[0].status);
@@ -779,7 +779,7 @@ static int mpc5xxx_fec_recv(struct eth_device *dev)
         * This command pulls one frame from the card
         */
        mpc5xxx_fec_priv *fec = (mpc5xxx_fec_priv *)dev->priv;
-       FEC_RBD *pRbd = &fec->rbdBase[fec->rbdIndex];
+       volatile FEC_RBD *pRbd = &fec->rbdBase[fec->rbdIndex];
        unsigned long ievent;
        int frame_length, len = 0;
        NBUF *frame;
index 595bd292b55b013fa68bc07b2aa515fdef73d63e..6be47877d0742e8e3699e9c7c048dcdf4f1f13d7 100644 (file)
 
 /* IDE */
 #if defined (CONFIG_MINIFAP) || defined (CONFIG_STK52XX)
-#define ADD_IDE_CMD            CFG_CMD_IDE | CFG_CMD_FAT
+#define ADD_IDE_CMD            (CFG_CMD_IDE | CFG_CMD_FAT | CFG_CMD_EXT2)
 #else
 #define ADD_IDE_CMD            0
 #endif
  * Supported commands
  */
 #define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_I2C     | \
+                               ADD_IDE_CMD     | \
                                ADD_PCI_CMD     | \
                                ADD_USB_CMD     | \
-                               CFG_CMD_POST_DIAG | \
+                               CFG_CMD_ASKENV  | \
                                CFG_CMD_DATE    | \
-                               CFG_CMD_REGINFO | \
+                               CFG_CMD_DHCP    | \
+                               CFG_CMD_ECHO    | \
+                               CFG_CMD_EEPROM  | \
+                               CFG_CMD_I2C     | \
                                CFG_CMD_MII     | \
                                CFG_CMD_PING    | \
-                               ADD_IDE_CMD)
+                               CFG_CMD_POST_DIAG | \
+                               CFG_CMD_REGINFO )
 
 /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
 #include <cmd_confdefs.h>
 
+#define        CONFIG_TIMESTAMP                /* display image timestamps */
+
 #if (TEXT_BASE == 0xFC000000)          /* Boot low */
 #   define CFG_LOWBOOT         1
 #endif
index eb1256a5d87e9bfb322686c7cb77a24febd93bd3..da2e37d21b53e0916a2efd72192a4b5489117bc2 100644 (file)
  * (easy to change)
  */
 
-#define CONFIG_MPC5xxx         1       /* This is an MPC5xxx CPU */
-#define CONFIG_MPC5200         1       /* (more precisely an MPC5200 CPU) */
-#define CONFIG_INKA4X0         1       /* INKA4x0 board */
+#define CONFIG_MPC5xxx         1       /* This is an MPC5xxx CPU               */
+#define CONFIG_MPC5200         1       /* (more precisely an MPC5200 CPU)      */
+#define CONFIG_INKA4X0         1       /* INKA4x0 board                        */
 
-#define CFG_MPC5XXX_CLKIN      33000000 /* ... running at 33.000000MHz */
+#define CFG_MPC5XXX_CLKIN      33000000 /* ... running at 33.000000MHz         */
 
-#define BOOTFLAG_COLD          0x01    /* Normal Power-On: Boot from FLASH  */
-#define BOOTFLAG_WARM          0x02    /* Software reboot           */
+#define BOOTFLAG_COLD          0x01    /* Normal Power-On: Boot from FLASH     */
+#define BOOTFLAG_WARM          0x02    /* Software reboot                      */
 
-#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs */
+#define CONFIG_MISC_INIT_F     1       /* Use misc_init_f()                    */
+
+#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs                     */
 #if (CONFIG_COMMANDS & CFG_CMD_KGDB)
-#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
+#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value        */
 #endif
 
 /*
  * Serial console configuration
  */
-#define CONFIG_PSC_CONSOLE     1       /* console is on PSC1 */
-#define CONFIG_BAUDRATE                115200  /* ... at 115200 bps */
+#define CONFIG_PSC_CONSOLE     1       /* console is on PSC1   */
+#define CONFIG_BAUDRATE                115200  /* ... at 115200 bps    */
 #define CFG_BAUDRATE_TABLE     { 9600, 19200, 38400, 57600, 115200, 230400 }
 
 /*
  *-----------------------------------------------------------------------
  */
 #define CONFIG_USB_OHCI
-#define CONFIG_USB_CLOCK        0x00015555
-#define CONFIG_USB_CONFIG       0x00001000
+#define CONFIG_USB_CLOCK       0x00015555
+#define CONFIG_USB_CONFIG      0x00001000
 
 #endif /* __CONFIG_H */
index 55a6f69fca1cb5e9e16f96eaea8e8ed7d4ab1f3c..59cd1d4ff737d9473677b20eb0bbc0df3de2cb86 100644 (file)
 #endif /* CFG_HUSH_PARSER */
 #endif /* CONFIG_FLASH_8MB */
 
-#if 0  /* disabled for development */
+#if 1  /* feel free to disable for development */
 #define        CONFIG_AUTOBOOT_KEYED           /* Enable password protection   */
 #define CONFIG_AUTOBOOT_PROMPT "\nEnter password - autoboot in %d sec...\n"
-#define CONFIG_AUTOBOOT_DELAY_STR      "system"        /* 1st password */
+#define CONFIG_AUTOBOOT_DELAY_STR      "R"     /* 1st "password"       */
 #endif
 
 #if (CONFIG_COMMANDS & CFG_CMD_KGDB)