]> www.infradead.org Git - users/rw/ppcboot.git/commitdiff
* ARM: Do not include BSS segment in the calculation of the size of
authorwdenk <wdenk>
Sun, 27 Oct 2002 11:54:39 +0000 (11:54 +0000)
committerwdenk <wdenk>
Sun, 27 Oct 2002 11:54:39 +0000 (11:54 +0000)
  the write-protected part of the flash memory.

* Allow printing of image timestamps even when no RTC support is
  available (option CONFIG_TIMESTAMP); fix byteorder problems in
  timestamp code.

* Enable Modem Support on TRAB

42 files changed:
CHANGELOG
README
board/cradle/flash.c
board/cradle/ppcboot.lds
board/csb226/flash.c
board/csb226/ppcboot.lds
board/dnp1110/flash.c
board/dnp1110/ppcboot.lds
board/ep7312/flash.c
board/ep7312/ppcboot.lds
board/impa7/flash.c
board/impa7/ppcboot.lds
board/lart/flash.c
board/lart/ppcboot.lds
board/lubbock/flash.c
board/lubbock/ppcboot.lds
board/shannon/flash.c
board/shannon/ppcboot.lds
board/smdk2400/flash.c
board/smdk2400/ppcboot.lds
board/smdk2410/flash.c
board/smdk2410/ppcboot.lds
board/trab/flash.c
board/trab/ppcboot.lds
common/cmd_bootm.c
common/cmd_i2c.c
cpu/arm720t/start.S
cpu/arm920t/Makefile
cpu/arm920t/interrupts.c
cpu/arm920t/serial.c
cpu/arm920t/speed.c [new file with mode: 0644]
cpu/arm920t/start.S
cpu/sa1100/start.S
cpu/xscale/start.S
include/asm-arm/ppcboot-arm.h
include/common.h
include/configs/smdk2400.h
include/configs/smdk2410.h
include/configs/trab.h
include/version.h
lib_arm/board.c
rtc/date.c

index 75fbda9f0b813a2e6885d3da88ca6014d64edb81..cbeadd6a9ec1c5912b36704bde0f75432ca9eaea 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,42 @@
+======================================================================
+Modifications since 1.2.1:
+======================================================================
+
+* ARM: Do not include BSS segment in the calculation of the size of
+  the write-protected part of the flash memory.
+
+* Allow printing of image timestamps even when no RTC support is
+  available (option CONFIG_TIMESTAMP); fix byteorder problems in
+  timestamp code.
+
+* Patch by David Müller, 12 Oct 2002:
+  - common/cmd_i2c.c
+    endian problem on ARM platform fixed (Not sure if i found all)
+
+  - cpu/arm920t/Makefile
+  - cpu/arm920t/speed.c
+    provide interface to "clock maschine" of S3C24xx chips
+
+  - cpu/arm920t/interrupts.c
+    make use of new "clocks" interface to simpifiy things
+
+  - cpu/arm920t/serial.c
+    make use of new "clocks" interface to simplifiy things
+
+  - lib_arm/board.c
+    move interrupt_init() up in table so udelay() is available
+    in env_init()
+
+  - include/common.h
+    added "noreturn" attribute to hang() ->  fixes compiler warning
+    added prototypes for functions defined in cpu/arm920t/speed.c
+
+  - include/configs/smdk2400.h
+  - include/configs/smdk2410.h
+  - include/configs/trab.h
+    added CONFIG_PLL_INPUT_FREQ value used by cpu/arm920t/speed.c
+
+
 ======================================================================
 Modifications for 1.2.1:
 ======================================================================
diff --git a/README b/README
index 617b17f2458b81af6bab979ea8c0bf918b844c7f..ae5114b04d7a32d8002da5eb3d19fc2cabd9d9d7 100644 (file)
--- a/README
+++ b/README
@@ -581,6 +581,13 @@ The following options need to be configured:
                CONFIG_RTC_MC146818     - use MC146818 RTC
                CONFIG_RTC_DS1337       - use Maxim, Inc. DS1337 RTC
 
+- Timestamp Support:
+
+                When CONFIG_TIMESTAMP is selected, the timestamp
+                (date and time) of an image is printed by image
+                commands like bootm or iminfo. This option is
+                automatically enabled when you select CFG_CMD_DATE .
+
 - Partition Support:
                CONFIG_MAC_PARTITION and/or CONFIG_DOS_PARTITION
                and/or CONFIG_ISO_PARTITION
index bcaa82c90afdce4219b563d7d3907d21d40fe244..265b609648b2e6aa7d94ee5b0d21f9cbff6de109 100644 (file)
@@ -73,7 +73,7 @@ ulong flash_init(void)
     */
    flash_protect(FLAG_PROTECT_SET,
                   CFG_FLASH_BASE,
-                  CFG_FLASH_BASE + _armboot_end - _armboot_start,
+                  CFG_FLASH_BASE + _armboot_end_data - _armboot_start,
                   &flash_info[0]);
 
    flash_protect(FLAG_PROTECT_SET,
index 2825f90d05020ccad9ebdfe66710f01d7fd4abac..0a89b3288d2b80caf2addbb13d9eb701822a005e 100644 (file)
@@ -44,6 +44,8 @@ SECTIONS
         . = ALIGN(4);
         .got : { *(.got) }
 
+       armboot_end_data = .;
+
         . = ALIGN(4);
         .bss : { *(.bss) }
 
index a54e0433274a4b46aba109b640b2545db57d7af2..68f5fcb98816c1ad7239d7f1e5f5bcf88ce6e22d 100644 (file)
@@ -70,7 +70,7 @@ ulong flash_init(void)
      */
     flash_protect(FLAG_PROTECT_SET,
                  CFG_FLASH_BASE,
-                 CFG_FLASH_BASE + _armboot_end - _armboot_start,
+                 CFG_FLASH_BASE + _armboot_end_data - _armboot_start,
                  &flash_info[0]);
 
     flash_protect(FLAG_PROTECT_SET,
index 2825f90d05020ccad9ebdfe66710f01d7fd4abac..0a89b3288d2b80caf2addbb13d9eb701822a005e 100644 (file)
@@ -44,6 +44,8 @@ SECTIONS
         . = ALIGN(4);
         .got : { *(.got) }
 
+       armboot_end_data = .;
+
         . = ALIGN(4);
         .bss : { *(.bss) }
 
index ecc154e9db5a39cf5cb701a3a09b651cca91b3b1..ca9aff957b20a8d1045312dd981e2958ea5a426e 100644 (file)
@@ -105,7 +105,7 @@ ulong flash_init(void)
      */
     flash_protect(FLAG_PROTECT_SET,
                  CFG_FLASH_BASE,
-                 CFG_FLASH_BASE + _armboot_end - _armboot_start,
+                 CFG_FLASH_BASE + _armboot_end_data - _armboot_start,
                  &flash_info[0]);
 
     flash_protect(FLAG_PROTECT_SET,
index 775987a7682ad2ea97f524f61969256a6f810902..db329c5614410af6496d61797806fe55c83e902e 100644 (file)
@@ -44,6 +44,8 @@ SECTIONS
         . = ALIGN(4);
         .got : { *(.got) }
 
+       armboot_end_data = .;
+
         . = ALIGN(4);
         .bss : { *(.bss) }
        
index aec16372bfe149ca65c3980ee9ad1683aa0f3ff1..f15ca9cd2c33add04b416037408e840378c12a9e 100644 (file)
@@ -59,14 +59,14 @@ ulong flash_init (void)
 
        /* Protect monitor and environment sectors
         */
-       flash_protect (FLAG_PROTECT_SET,
-                                  CFG_FLASH_BASE,
-                                  CFG_FLASH_BASE + _armboot_end - _armboot_start,
-                                  &flash_info[0]);
-
-       flash_protect (FLAG_PROTECT_SET,
-                                  CFG_ENV_ADDR,
-                                  CFG_ENV_ADDR + CFG_ENV_SIZE - 1, &flash_info[0]);
+       flash_protect ( FLAG_PROTECT_SET,
+                       CFG_FLASH_BASE,
+                       CFG_FLASH_BASE + _armboot_end_data - _armboot_start,
+                       &flash_info[0]);
+
+       flash_protect ( FLAG_PROTECT_SET,
+                       CFG_ENV_ADDR,
+                       CFG_ENV_ADDR + CFG_ENV_SIZE - 1, &flash_info[0]);
 
        return size;
 }
index 2daf04705c985f106caf1b8b7f79eaa3966bd7e5..e47e7b6b19e76b53c9605466755bb65a29ad451f 100644 (file)
@@ -44,6 +44,8 @@ SECTIONS
         . = ALIGN(4);
         .got : { *(.got) }
 
+       armboot_end_data = .;
+
         . = ALIGN(4);
         .bss : { *(.bss) }
        
index e90ae338630c1dfc01f8f6bd34578af8655d3213..e6494b83cae8e3a6db02eeb3729c87b353954cd1 100644 (file)
@@ -72,7 +72,7 @@ ulong flash_init(void)
      */
     flash_protect(FLAG_PROTECT_SET,
                  CFG_FLASH_BASE,
-                 CFG_FLASH_BASE + _armboot_end - _armboot_start,
+                 CFG_FLASH_BASE + _armboot_end_data - _armboot_start,
                  &flash_info[0]);
     
     flash_protect(FLAG_PROTECT_SET,
index 2daf04705c985f106caf1b8b7f79eaa3966bd7e5..e47e7b6b19e76b53c9605466755bb65a29ad451f 100644 (file)
@@ -44,6 +44,8 @@ SECTIONS
         . = ALIGN(4);
         .got : { *(.got) }
 
+       armboot_end_data = .;
+
         . = ALIGN(4);
         .bss : { *(.bss) }
        
index 351b3e1cbebe3fe62ead4abef85bbce5bf1c3616..7b195241393e684b39b42bfb239dff28bfeb6b18 100644 (file)
@@ -105,7 +105,7 @@ ulong flash_init(void)
      */
     flash_protect(FLAG_PROTECT_SET,
                  CFG_FLASH_BASE,
-                 CFG_FLASH_BASE + _armboot_end - _armboot_start,
+                 CFG_FLASH_BASE + _armboot_end_data - _armboot_start,
                  &flash_info[0]);
 
     flash_protect(FLAG_PROTECT_SET,
index 775987a7682ad2ea97f524f61969256a6f810902..db329c5614410af6496d61797806fe55c83e902e 100644 (file)
@@ -44,6 +44,8 @@ SECTIONS
         . = ALIGN(4);
         .got : { *(.got) }
 
+       armboot_end_data = .;
+
         . = ALIGN(4);
         .bss : { *(.bss) }
        
index 06625977f742a80ece219deabdfff0aa4706580b..84c09a853c7152e404dbd02afbe3ce0374269420 100644 (file)
@@ -73,7 +73,7 @@ ulong flash_init(void)
      */
     flash_protect(FLAG_PROTECT_SET,
                  CFG_FLASH_BASE,
-                 CFG_FLASH_BASE + _armboot_end - _armboot_start,
+                 CFG_FLASH_BASE + _armboot_end_data - _armboot_start,
                  &flash_info[0]);
 
     flash_protect(FLAG_PROTECT_SET,
index 2825f90d05020ccad9ebdfe66710f01d7fd4abac..0a89b3288d2b80caf2addbb13d9eb701822a005e 100644 (file)
@@ -44,6 +44,8 @@ SECTIONS
         . = ALIGN(4);
         .got : { *(.got) }
 
+       armboot_end_data = .;
+
         . = ALIGN(4);
         .bss : { *(.bss) }
 
index b11036e0c7b8d4b23004c9a277aae730e97e2a6b..8e0f7521939230066dc3ea0cb2d7d31066651b03 100644 (file)
@@ -124,7 +124,7 @@ ulong flash_init(void)
 #else
     flash_protect(FLAG_PROTECT_SET,
                  CFG_FLASH_BASE,
-                 CFG_FLASH_BASE + _armboot_end - _armboot_start,
+                 CFG_FLASH_BASE + _armboot_end_data - _armboot_start,
                  &flash_info[0]);
 
     flash_protect(FLAG_PROTECT_SET,
index 775987a7682ad2ea97f524f61969256a6f810902..db329c5614410af6496d61797806fe55c83e902e 100644 (file)
@@ -44,6 +44,8 @@ SECTIONS
         . = ALIGN(4);
         .got : { *(.got) }
 
+       armboot_end_data = .;
+
         . = ALIGN(4);
         .bss : { *(.bss) }
        
index 31cef07802ce48144b7e788747de418b3a40d036..c4d6bae8f2b394513508ae8e5943dd635859f1af 100644 (file)
@@ -28,6 +28,7 @@
 /* #define DEBUG */
 
 #include <common.h>
+#include <environment.h>
 
 #define FLASH_BANK_SIZE 0x1000000      /* 2 x   8 MB */
 #define MAIN_SECT_SIZE  0x40000                /* 2 x 128 kB */
@@ -92,7 +93,7 @@ ulong flash_init (void)
         */
        flash_protect ( FLAG_PROTECT_SET,
                        CFG_FLASH_BASE,
-                       CFG_FLASH_BASE + _armboot_end - _armboot_start,
+                       CFG_FLASH_BASE + _armboot_end_data - _armboot_start,
                        &flash_info[0]);
 
        flash_protect ( FLAG_PROTECT_SET,
index 1ac7596adfa435fadadd2b82b794cbc3aeb58cb7..94fda749e759320e437e5620d84444c7b877c41c 100644 (file)
@@ -45,6 +45,8 @@ SECTIONS
         . = ALIGN(4);
         .got : { *(.got) }
 
+       armboot_end_data = .;
+
         . = ALIGN(4);
         .bss : { *(.bss) }
        
index 3f12dac7d3de21229e51286fdb92a9c918ed860f..c2ec2354b6d922ab9be39c7cfd9eeada57ee554b 100644 (file)
@@ -113,7 +113,7 @@ ulong flash_init(void)
 
     flash_protect(FLAG_PROTECT_SET,
                  CFG_FLASH_BASE,
-                 CFG_FLASH_BASE + _armboot_end - _armboot_start,
+                 CFG_FLASH_BASE + _armboot_end_data - _armboot_start,
                  &flash_info[0]);
 
     flash_protect(FLAG_PROTECT_SET,
index e25d26188a47b034dad1685468f5aa86bc995fb6..8c9c218ccab3ee4701ae8636bbf9c361e7854cc3 100644 (file)
@@ -45,6 +45,8 @@ SECTIONS
         . = ALIGN(4);
         .got : { *(.got) }
 
+       armboot_end_data = .;
+
         . = ALIGN(4);
         .bss : { *(.bss) }
 
index 31ac57139142671918b8ea0953a8ba27fd85a941..2443777ae18fb0529cf91588324915c9bd25cfb8 100644 (file)
@@ -24,6 +24,7 @@
 /* #define DEBUG */
 
 #include <common.h>
+#include <environment.h>
 
 ulong myflush (void);
 
@@ -91,7 +92,7 @@ ulong flash_init (void)
         */
        flash_protect ( FLAG_PROTECT_SET,
                        CFG_FLASH_BASE,
-                       CFG_FLASH_BASE + _armboot_end - _armboot_start,
+                       CFG_FLASH_BASE + _armboot_end_data - _armboot_start,
                        &flash_info[0]);
 
        flash_protect ( FLAG_PROTECT_SET,
index 9dc8f7350b1567b77f73bbed33627dfa442a37ab..567447c787e067c71c1722646da0c01498899a85 100644 (file)
@@ -55,6 +55,8 @@ SECTIONS
         . = ALIGN(4);
         .got : { *(.got) }
 
+       armboot_end_data = .;
+
         . = ALIGN(4);
         .bss : { *(.bss) }
        
index 8c4699c3eb8256fc34626869fcac2871274b110f..7940ff8fdb7e6821e74c5d6456c670007677bfb8 100644 (file)
@@ -32,7 +32,7 @@
 #include <malloc.h>
 #include <zlib.h>
 #include <asm/byteorder.h>
-#if (CONFIG_COMMANDS & CFG_CMD_DATE)
+#if (CONFIG_COMMANDS & CFG_CMD_DATE) || defined(CONFIG_TIMESTAMP)
 #include <rtc.h>
 #endif
 
@@ -736,18 +736,18 @@ static int image_info (ulong addr)
 void
 print_image_hdr (image_header_t *hdr)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_DATE)
-       time_t timestamp = (time_t)hdr->ih_time;
+#if (CONFIG_COMMANDS & CFG_CMD_DATE) || defined(CONFIG_TIMESTAMP)
+       time_t timestamp = (time_t)ntohl(hdr->ih_time);
        struct rtc_time tm;
 #endif
 
        printf ("   Image Name:   %.*s\n", IH_NMLEN, hdr->ih_name);
-#if (CONFIG_COMMANDS & CFG_CMD_DATE)
+#if (CONFIG_COMMANDS & CFG_CMD_DATE) || defined(CONFIG_TIMESTAMP)
        to_tm (timestamp, &tm);
        printf ("   Created:      %4d-%02d-%02d  %2d:%02d:%02d UTC\n",
                tm.tm_year, tm.tm_mon, tm.tm_mday,
                tm.tm_hour, tm.tm_min, tm.tm_sec);
-#endif /* CFG_CMD_DATE */
+#endif /* CFG_CMD_DATE, CONFIG_TIMESTAMP */
        printf ("   Image Type:   "); print_type(hdr); printf ("\n");
        printf ("   Data Size:    %d Bytes = ", ntohl(hdr->ih_size));
        print_size (ntohl(hdr->ih_size), "\n");
index 91e04642f07c5f2c80eec7c8333a82bc546ba166..fe5841e6bacd7d3607e6c12cf828ac67e6c1b588 100644 (file)
@@ -85,6 +85,7 @@
 #include <command.h>
 #include <cmd_i2c.h>
 #include <i2c.h>
+#include <asm/byteorder.h>
 
 #if (CONFIG_COMMANDS & CFG_CMD_I2C)
 
@@ -458,6 +459,7 @@ mod_i2c_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char *argv[])
                if(i2c_read(chip, addr, alen, (char *)&data, size) != 0) {
                        printf("\nError reading the chip,\n");
                } else {
+                       data = cpu_to_be32(data);
                        if(size == 1) {
                                printf(" %02lx", (data >> 24) & 0x000000FF);
                        } else if(size == 2) {
@@ -494,6 +496,7 @@ mod_i2c_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char *argv[])
                        } else if(size == 2) {
                                data = data << 16;
                        }
+                       data = be32_to_cpu(data);
                        nbytes = endp - console_buffer;
                        if (nbytes) {
 #ifdef CONFIG_BOOT_RETRY_TIME
index e10255acf8312e959eb00be238d7463a9c8fa53c..17ebc5471d83bfbb4def30ef5656327b2bcbc038 100644 (file)
@@ -83,8 +83,13 @@ _armboot_start:
        .word _start
 
 /*
- * Note: armboot_end is defined by the (board-dependent) linker script
+ * Note: _armboot_end_data and _armboot_end are defined
+ * by the (board-dependent) linker script.
+ * _armboot_end_data is the first usable FLASH address after armboot
  */
+.globl _armboot_end_data
+_armboot_end_data:
+       .word armboot_end_data
 .globl _armboot_end
 _armboot_end:
        .word armboot_end
index 6926d7e438e89b55095d6d3c9efd3e8fa5bdfc7f..1d853ea40e69503431392d26c4f6c42bca88c374 100644 (file)
@@ -26,7 +26,7 @@ include $(TOPDIR)/config.mk
 LIB    = lib$(CPU).a
 
 START  = start.o
-OBJS   = serial.o interrupts.o cpu.o
+OBJS   = serial.o interrupts.o cpu.o speed.o
          
 all:   .depend $(START) $(LIB)
 
index 4a622ab93e23b1e5c1dce5e33568932e78d9f03d..7e4329a89c011609c6bf7fd3ff1038c3f2b52f64 100644 (file)
 #include <asm/proc-armv/ptrace.h>
 
 extern void reset_cpu(ulong addr);
-#if defined(CONFIG_SMDK2400) || defined(CONFIG_TRAB)
-extern void samsung_get_fclk(void);
-/* this is the same as PCLK, needed to calculate timer_load_val */
-extern unsigned int samsung_uartclk;
 int timer_load_val = 0;
-#endif
-
-/* for 10 ms clock period @ 50 MHz with 4 bit divider = 1/2 (default) */
-/* and prescaler = 16 */
-#define TIMER_LOAD_VAL 15625
 
 /* macro to read the 16 bit timer */
 #define READ_TIMER (rTCNTO4 & 0xffff)
@@ -196,24 +187,17 @@ int interrupt_init (void)
        /* use PWM Timer 4 because it has no output */
        /* prescaler for Timer 4 is 16 */
        rTCFG0 = 0x0f00;
-#if defined(CONFIG_SMDK2400) || defined(CONFIG_TRAB)
        if (timer_load_val == 0)
        {
-               if (samsung_uartclk == 0)
-                       samsung_get_fclk();
                /*
                 * for 10 ms clock period @ PCLK with 4 bit divider = 1/2
                 * (default) and prescaler = 16. Should be 10390
                 * @33.25MHz and 15625 @ 50 MHz
                 */
-               timer_load_val = samsung_uartclk/(2 * 16 * 100);
+               timer_load_val = get_PCLK()/(2 * 16 * 100);
        }
        /* load value for 10 ms timeout */
        lastdec = rTCNTB4 = timer_load_val;
-#elif defined(CONFIG_SMDK2410)
-       /* load value for 10 ms timeout, assumes PCLK is 30 MHz !! */
-       lastdec = rTCNTB4 = TIMER_LOAD_VAL;
-#endif
        /* auto load, manual update of Timer 4 */
        rTCON = 0x600000;
        /* auto load, start Timer 4 */
@@ -247,11 +231,7 @@ void udelay (unsigned long usec)
        ulong tmo;
 
        tmo = usec / 1000;
-#if defined(CONFIG_SMDK2400) || defined(CONFIG_TRAB)
        tmo *= (timer_load_val * 100);
-#elif defined(CONFIG_SMDK2410)
-       tmo *= CFG_HZ;
-#endif
        tmo /= 1000;
 
        tmo += get_timer (0);
@@ -276,11 +256,7 @@ ulong get_timer_masked (void)
                timestamp += lastdec - now;
        } else {
                /* we have an overflow ... */
-#if defined(CONFIG_SMDK2400) || defined(CONFIG_TRAB)
                timestamp += lastdec + timer_load_val - now;
-#elif defined(CONFIG_SMDK2410)
-               timestamp += lastdec + TIMER_LOAD_VAL - now;
-#endif
        }
        lastdec = now;
 
@@ -292,11 +268,7 @@ void udelay_masked (unsigned long usec)
        ulong tmo;
 
        tmo = usec / 1000;
-#if defined(CONFIG_SMDK2400) || defined(CONFIG_TRAB)
        tmo *= (timer_load_val * 100);
-#elif defined(CONFIG_SMDK2410)
-       tmo *= CFG_HZ;
-#endif
        tmo /= 1000;
 
        reset_timer_masked ();
index 7cba3f2ec0613e87bc2f611e798ccaf66e0d34dd..2c1a9489babbc811d7b7e859181d241bce4889c2 100644 (file)
  */
 
 #include <common.h>
-#include <arm920t.h>
 #if defined(CONFIG_S3C2400) || defined(CONFIG_TRAB)
 #include <s3c2400.h>
 #elif defined(CONFIG_S3C2410)
 #include <s3c2410.h>
 #endif
 
-unsigned int br[] = { 1562, 780, 390, 194, 32, 15 };
-
-#if defined(CONFIG_SMDK2400) || defined(CONFIG_TRAB)
-/* dynamically determine the clock values */
-static unsigned int samsung_fclk = 0;
-unsigned int samsung_uartclk;
-void samsung_get_fclk(void)
-{
-       unsigned int mpllcon = rMPLLCON;
-       unsigned int clkdivn = rCLKDIVN & 3;
-       int clk_factor[4] = {1, 2, 2, 4};
-
-       /* the S3C2400 uses a 12 MHz xtal */
-       /* formula from page 6-22 */
-       samsung_fclk = ((12000000 * (8 + ((mpllcon & 0xff000) >> 12)))/((2 + ((mpllcon & 0x1f0) >> 4)) * (1 << (mpllcon & 3))));
-       samsung_uartclk = samsung_fclk/clk_factor[clkdivn];
-}
-#endif
 
 void serial_setbrg (void)
 {
@@ -52,32 +33,8 @@ void serial_setbrg (void)
        int i;
        unsigned int reg = 0;
 
-#if defined(CONFIG_SMDK2400) || defined(CONFIG_TRAB)
-       if (samsung_fclk == 0 || samsung_uartclk == 0)
-       samsung_get_fclk();
-
-       /* value is calculated so : (int)(PCLK/16./baudrate) -1 */
-       reg = samsung_uartclk/(16 * gd->baudrate) - 1;
-#elif defined(CONFIG_SMDK2410)
-       /* this assumes a PCLK of 50.7 MHz */
        /* value is calculated so : (int)(PCLK/16./baudrate) -1 */
-       if (gd->baudrate == 1200)
-               reg = 2639;
-       else if (gd->baudrate == 9600)
-               reg = 329;
-       else if (gd->baudrate == 19200)
-               reg = 164;
-       else if (gd->baudrate == 38400)
-               reg = 82;
-       else if (gd->baudrate == 57600)
-               reg = 54;
-       else if (gd->baudrate == 115200)
-               reg = 27;
-       else
-               hang ();
-#else
-# error Bord config missing
-#endif
+       reg = get_PCLK() / (16 * gd->baudrate) - 1;
 
 #ifdef CONFIG_SERIAL1
        /* FIFO enable, Tx/Rx FIFO clear */
diff --git a/cpu/arm920t/speed.c b/cpu/arm920t/speed.c
new file mode 100644 (file)
index 0000000..4901d9a
--- /dev/null
@@ -0,0 +1,96 @@
+/*
+ * (C) Copyright 2001-2002
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * (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 PLL and clock machinery 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
+
+#define MPLL 0
+#define UPLL 1
+
+/* ------------------------------------------------------------------------- */
+/* NOTE: This describes the proper use of this file.
+ *
+ * CONFIG_PLL_INPUT_FREQ should be defined as the input frequency of the PLL.
+ *
+ * get_FCLK(), get_HCLK(), get_PCLK() and get_UCLK() return the clock of 
+ * the specified bus in HZ.
+ */
+/* ------------------------------------------------------------------------- */
+
+static ulong get_PLLCLK(int pllreg)
+{
+    ulong r, m, p, s;
+
+    if (pllreg == MPLL)
+       r = rMPLLCON;
+    else if (pllreg == UPLL)
+       r = rUPLLCON;
+    else
+       hang();
+       
+    m = ((r & 0xFF000) >> 12) + 8;
+    p = ((r & 0x003F0) >> 4) + 2;
+    s = r & 0x3;
+    
+    return((CONFIG_PLL_INPUT_FREQ * m) / (p << s));
+}
+/* return FCLK frequency */
+ulong get_FCLK(void)
+{
+    return(get_PLLCLK(MPLL));    
+}
+
+/* return HCLK frequency */
+ulong get_HCLK(void)
+{
+    ulong clkdiv = rCLKDIVN;
+    
+    return((clkdiv & 0x2) ? get_FCLK()/2 : get_FCLK());
+}
+
+/* return PCLK frequency */
+ulong get_PCLK(void)
+{
+    ulong clkdiv = rCLKDIVN;
+    
+    return((clkdiv & 0x1) ? get_HCLK()/2 : get_HCLK());    
+}
+
+/* return UCLK frequency */
+ulong get_UCLK(void)
+{
+    return(get_PLLCLK(UPLL));    
+}
index 6208ba35a78f6eb99426071d6f124d927d41f9d8..00b3082938a6a907d93f295ba8e98a96dc5f49be 100644 (file)
@@ -84,8 +84,13 @@ _armboot_start:
        .word _start
 
 /*
- * Note: armboot_end is defined by the (board-dependent) linker script
+ * Note: _armboot_end_data and _armboot_end are defined
+ * by the (board-dependent) linker script.
+ * _armboot_end_data is the first usable FLASH address after armboot
  */
+.globl _armboot_end_data
+_armboot_end_data:
+       .word armboot_end_data
 .globl _armboot_end
 _armboot_end:
        .word armboot_end
index b9e542e7cd1fb7062e4c368387f55da116b76c1d..6be0cef66e5995b8af669038a96db6ef04e6f3be 100644 (file)
@@ -85,8 +85,13 @@ _armboot_start:
        .word _start
 
 /*
- * Note: armboot_end is defined by the (board-dependent) linker script
+ * Note: _armboot_end_data and _armboot_end are defined
+ * by the (board-dependent) linker script.
+ * _armboot_end_data is the first usable FLASH address after armboot
  */
+.globl _armboot_end_data
+_armboot_end_data:
+       .word armboot_end_data
 .globl _armboot_end
 _armboot_end:
        .word armboot_end
index c667f611e37872b61b1dc357a15faf12700cbded..e491e2660ca9434549a1d37b8017ae69f1dedbf5 100644 (file)
@@ -76,8 +76,13 @@ _armboot_start:
        .word _start
 
 /*
- * Note: armboot_end is defined by the (board-dependent) linker script
+ * Note: _armboot_end_data and _armboot_end are defined
+ * by the (board-dependent) linker script.
+ * _armboot_end_data is the first usable FLASH address after armboot
  */
+.globl _armboot_end_data
+_armboot_end_data:
+       .word armboot_end_data
 .globl _armboot_end
 _armboot_end:
        .word armboot_end
index b0adb509af5b27042ba1355d68af4bc68f7b27e6..536d3124f05d116f3d66c3c428072b43d42b0873 100644 (file)
 #define _PPCBOOT_ARM_H_        1
 
 /* for the following variables, see start.S */
-extern ulong _armboot_start; /* code start */
-extern ulong _armboot_end;   /* code end */ 
-extern ulong IRQ_STACK_START; /* top of IRQ stack */
-extern ulong FIQ_STACK_START; /* top of FIQ stack */
-extern ulong _armboot_real_end; /* first usable RAM address */
+extern ulong _armboot_start;   /* code start */
+extern ulong _armboot_end_data;        /* code + data end */ 
+extern ulong _armboot_end;     /* BSS end */ 
+extern ulong IRQ_STACK_START;  /* top of IRQ stack */
+extern ulong FIQ_STACK_START;  /* top of FIQ stack */
+extern ulong _armboot_real_end;        /* first usable RAM address */
 
 /* cpu/.../cpu.c */
 int    cpu_init(void);
index 16cd3217a46120edd00d1d1a25c399edec3b6fde..3c78d1caf3a8470fed4a5fcc4bd790fded2b20de 100644 (file)
@@ -92,7 +92,7 @@ int   serial_buffered_getc (void);
 int    serial_buffered_tstc (void);
 #endif /* CONFIG_SERIAL_SOFTWARE_FIFO */
 
-void   hang          (void);
+void   hang          (void) __attribute__ ((noreturn));
 
 /* */
 long int initdram (int);
@@ -286,7 +286,12 @@ int        prt_8260_clks (void);
 ulong  get_OPB_freq (void);
 ulong  get_PCI_freq (void);
 #endif
-
+#if defined(CONFIG_S3C2400) || defined(CONFIG_S3C2410)
+ulong  get_FCLK (void);
+ulong  get_HCLK (void);
+ulong  get_PCLK (void);
+ulong  get_UCLK (void);
+#endif
 ulong  get_bus_freq  (ulong);
 
 #if defined(CONFIG_4xx) || defined(CONFIG_IOP480)
index 1f0e39c00f8fe855ff7170a2cc958326ae9fb449..0cd6e7faca0d75277c7a6257bc1b9d6ead7b9ee3 100644 (file)
@@ -42,6 +42,8 @@
 #define CONFIG_S3C2400         1       /* in a SAMSUNG S3C2400 SoC     */
 #define CONFIG_SMDK2400                1       /* on an SAMSUNG SMDK2400 Board */
 
+/* input clock of PLL */
+#define CONFIG_PLL_INPUT_FREQ  12000000 /* SMDK2400 has 12 MHz input clock */
 #undef CONFIG_USE_IRQ                  /* we don't need IRQ/FIQ stuff  */
 
 #define CONFIG_CMDLINE_TAG      1      /* enable passing of ATAGs      */
@@ -82,6 +84,8 @@
 
 #define CONFIG_BAUDRATE                115200
 
+#define        CONFIG_TIMESTAMP        1       /* Print timestamp info for images */
+
 #ifndef USE_920T_MMU
 #define CONFIG_COMMANDS_tmp    (CONFIG_CMD_DFL & ~CFG_CMD_CACHE)
 #else
index 3603f4a95a33661d0244425140d2b6f625b85511..8cebbec1f5392d692c3c1dca10d79c142a2abad6 100644 (file)
 #define        CONFIG_S3C2410          1       /* in a SAMSUNG S3C2410 SoC     */
 #define CONFIG_SMDK2410                1       /* on a SAMSUNG SMDK2410 Board  */
 
+/* input clock of PLL */
+#define CONFIG_PLL_INPUT_FREQ  12000000/* the SMDK2410 has 12MHz input clock */
+
+
 #define USE_920T_MMU           1
 #undef CONFIG_USE_IRQ                  /* we don't need IRQ/FIQ stuff */
 
index 1cc9008f2993b7a33d4568b0ac22aa111f691e91..b2046a7e01972fe49ef9fefcb179fc546c6ece89 100644 (file)
@@ -41,6 +41,9 @@
 #define CONFIG_TRAB            1       /* on a TRAB Board      */
 #undef CONFIG_TRAB_50MHZ               /* run the CPU at 50 MHz */
 
+/* input clock of PLL */
+#define CONFIG_PLL_INPUT_FREQ  12000000 /* TRAB has 12 MHz input clock */
 #undef CONFIG_USE_IRQ                  /* we don't need IRQ/FIQ stuff */
 
 #define CONFIG_CMDLINE_TAG      1      /* enable passing of ATAGs      */
@@ -69,7 +72,7 @@
 
 #define CONFIG_HWFLOW                  /* include RTS/CTS flow control support */
 
-#undef CONFIG_MODEM_SUPPORT            /* enable modem initialization stuff */
+#define CONFIG_MODEM_SUPPORT           /* enable modem initialization stuff */
 
 #define        CONFIG_MODEM_KEY_MAGIC  "23"    /* hold down these keys to enable modem */
 
@@ -85,6 +88,8 @@
 
 #define CONFIG_BAUDRATE                115200
 
+#define        CONFIG_TIMESTAMP        1       /* Print timestamp info for images */
+
 #ifdef CONFIG_HWFLOW
 #define CONFIG_COMMANDS_ADD_HWFLOW     CFG_CMD_HWFLOW
 #else
 
 #ifndef USE_920T_MMU
 #define CONFIG_COMMANDS                ((CONFIG_CMD_DFL & ~CFG_CMD_CACHE) | \
-                                CFG_CMD_BSP | \
+                                CFG_CMD_BSP                    | \
                                 CONFIG_COMMANDS_ADD_HWFLOW     | \
                                 CONFIG_COMMANDS_ADD_VFD        )
 #else
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL | \
-                                CFG_CMD_BSP    | \
+#define CONFIG_COMMANDS                (CONFIG_CMD_DFL                 | \
+                                CFG_CMD_BSP                    | \
                                 CONFIG_COMMANDS_ADD_HWFLOW     | \
                                 CONFIG_COMMANDS_ADD_VFD        )
 #endif
index 197f8c5cc53679585d5380c95d6fbd175b5e5244..40ea9b1b59ea08b9540a4bafbd73ea5f96dbbeb4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2000
+ * (C) Copyright 2000-2002
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  *
  * See file CREDITS for list of people who contributed to this
@@ -24,6 +24,6 @@
 #ifndef        __VERSION_H__
 #define        __VERSION_H__
 
-#define        PPCBOOT_VERSION "PPCBoot 1.2.1"
+#define        PPCBOOT_VERSION "PPCBoot 1.2.2"
 
 #endif /* __VERSION_H__ */
index 7da0b1dff9eeb2d93dfbc98d08b315ed87e76952..9ee6dc958a425b816040049dbc273cff0569979c 100644 (file)
@@ -95,8 +95,8 @@ static int display_banner (void)
 {
 
        printf ("\n\n%s\n\n", version_string);
-       printf ("ARMBoot code: %08lx -> %08lx\n",
-               _armboot_start, _armboot_end);
+       printf ("ARMBoot code: %08lX -> %08lX  BSS: -> %08lX\n",
+               _armboot_start, _armboot_end_data, _armboot_end);
 #ifdef CONFIG_USE_IRQ
        printf ("IRQ Stack: %08lx\n", IRQ_STACK_START);
        printf ("FIQ Stack: %08lx\n", FIQ_STACK_START);
@@ -162,11 +162,11 @@ typedef int (init_fnc_t) (void);
 init_fnc_t *init_sequence[] = {
        cpu_init,               /* basic cpu dependent setup */
        board_init,             /* basic board dependent setup */
+       interrupt_init,         /* set up exceptions */
        env_init,               /* initialize environment */
        init_baudrate,          /* initialze baudrate settings */
        serial_init,            /* serial communications setup */
        display_banner,
-       interrupt_init,         /* set up exceptions */
        dram_init,              /* configure available RAM banks */
        display_dram_config,
 
index 579af4da32dfddaf56bc7855e241c71e1b84ba44..b5f8c48eb357075d380d063a1cfa214610fc8c22 100644 (file)
@@ -29,7 +29,7 @@
 #include <command.h>
 #include <rtc.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_DATE)
+#if (CONFIG_COMMANDS & CFG_CMD_DATE) || defined(CONFIG_TIMESTAMP)
 
 #define FEBRUARY               2
 #define        STARTOFTIME             1970