]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
Merge branch 'agust@denx.de-next' of git://git.denx.de/u-boot-staging
authorTom Rini <trini@ti.com>
Mon, 15 Oct 2012 20:37:22 +0000 (13:37 -0700)
committerTom Rini <trini@ti.com>
Mon, 15 Oct 2012 20:37:22 +0000 (13:37 -0700)
1  2 
README
arch/arm/lib/bootm.c
common/Makefile
include/bootstage.h

diff --combined README
index 9804cea91447ec52e76e90289c8cfe05586dc4ee,32e64d618c7a5a0f033ec75494be4ef6e177c0a9..df4aed14e4ed35f6e0d6f7a448b15b0c8240a164
--- 1/README
--- 2/README
+++ b/README
@@@ -704,8 -704,6 +704,8 @@@ The following options need to be config
  - Boot Delay: CONFIG_BOOTDELAY - in seconds
                Delay before automatically booting the default image;
                set to -1 to disable autoboot.
 +              set to -2 to autoboot with no delay and not check for abort
 +              (even when CONFIG_ZERO_BOOTDELAY_CHECK is defined).
  
                See doc/README.autoboot for these options that
                work with CONFIG_BOOTDELAY. None are required.
                CONFIG_CMD_IMLS           List all found images
                CONFIG_CMD_IMMAP        * IMMR dump support
                CONFIG_CMD_IMPORTENV    * import an environment
 +              CONFIG_CMD_INI          * import data from an ini file into the env
                CONFIG_CMD_IRQ          * irqinfo
                CONFIG_CMD_ITEST          Integer/string test of 2 values
                CONFIG_CMD_JFFS2        * JFFS2 Support
                CONFIG_CMD_SPI          * SPI serial bus support
                CONFIG_CMD_TFTPSRV      * TFTP transfer in server mode
                CONFIG_CMD_TFTPPUT      * TFTP put command (upload)
 -              CONFIG_CMD_TIME         * run command and report execution time
 +              CONFIG_CMD_TIME         * run command and report execution time (ARM specific)
 +              CONFIG_CMD_TIMER        * access to the system tick timer
                CONFIG_CMD_USB          * USB support
                CONFIG_CMD_CDP          * Cisco Discover Protocol support
                CONFIG_CMD_MFSL         * Microblaze FSL support
                viewport is supported.
                To enable the ULPI layer support, define CONFIG_USB_ULPI and
                CONFIG_USB_ULPI_VIEWPORT in your board configuration file.
 +              If your ULPI phy needs a different reference clock than the
 +              standard 24 MHz then you have to define CONFIG_ULPI_REF_CLK to
 +              the appropriate value in Hz.
  
  - MMC Support:
                The MMC controller on the Intel PXA is supported. To
                 29,916,167 26,005,792  bootm_start
                 30,361,327    445,160  start_kernel
  
+               CONFIG_CMD_BOOTSTAGE
+               Add a 'bootstage' command which supports printing a report
+               and un/stashing of bootstage data.
+               CONFIG_BOOTSTAGE_FDT
+               Stash the bootstage information in the FDT. A root 'bootstage'
+               node is created with each bootstage id as a child. Each child
+               has a 'name' property and either 'mark' containing the
+               mark time in microsecond, or 'accum' containing the
+               accumulated time for that bootstage id in microseconds.
+               For example:
+               bootstage {
+                       154 {
+                               name = "board_init_f";
+                               mark = <3575678>;
+                       };
+                       170 {
+                               name = "lcd";
+                               accum = <33482>;
+                       };
+               };
+               Code in the Linux kernel can find this in /proc/devicetree.
  Legacy uImage format:
  
    Arg Where                   When
@@@ -4695,10 -4713,7 +4720,10 @@@ Over time, many people have reported pr
  consider minicom to be broken, and recommend not to use it. Under
  Unix, I recommend to use C-Kermit for general purpose use (and
  especially for kermit binary protocol download ("loadb" command), and
 -use "cu" for S-Record download ("loads" command).
 +use "cu" for S-Record download ("loads" command).  See
 +http://www.denx.de/wiki/view/DULG/SystemSetup#Section_4.3.
 +for help with kermit.
 +
  
  Nevertheless, if you absolutely want to use it try adding this
  configuration to your "File transfer protocols" section:
diff --combined arch/arm/lib/bootm.c
index a9070d54457c44082fcf4cadeea7fba9145d5827,8d5bc589fcbdc69e89a12a4b791eb39604351932..37476cc90d5cc6a9791bb146ec023a018bd901f3
@@@ -69,8 -69,8 +69,8 @@@ void arch_lmb_reserve(struct lmb *lmb
        sp = get_sp();
        debug("## Current stack ends at 0x%08lx ", sp);
  
 -      /* adjust sp by 1K to be safe */
 -      sp -= 1024;
 +      /* adjust sp by 4K to be safe */
 +      sp -= 4096;
        lmb_reserve(lmb, sp,
                    gd->bd->bi_dram[0].start + gd->bd->bi_dram[0].size - sp);
  }
@@@ -96,6 -96,9 +96,9 @@@ static void announce_and_cleanup(void
  {
        printf("\nStarting kernel ...\n\n");
        bootstage_mark_name(BOOTSTAGE_ID_BOOTM_HANDOFF, "start_kernel");
+ #ifdef CONFIG_BOOTSTAGE_FDT
+       bootstage_fdt_add_report();
+ #endif
  #ifdef CONFIG_BOOTSTAGE_REPORT
        bootstage_report();
  #endif
@@@ -258,9 -261,6 +261,9 @@@ static int create_fdt(bootm_headers_t *
        fixup_memory_node(*of_flat_tree);
        fdt_fixup_ethernet(*of_flat_tree);
        fdt_initrd(*of_flat_tree, *initrd_start, *initrd_end, 1);
 +#ifdef CONFIG_OF_BOARD_SETUP
 +      ft_board_setup(*of_flat_tree, gd->bd);
 +#endif
  
        return 0;
  }
diff --combined common/Makefile
index abca82072665540cc1a043d77c0246fd0beddfe0,f3fc1758edf31a5ac8bc5a112152f52fe41e5e4d..fdfead79c27b952f4cde380e201c95ae85a7363c
@@@ -32,6 -32,7 +32,6 @@@ COBJS-y += command.
  COBJS-y += exports.o
  COBJS-$(CONFIG_SYS_HUSH_PARSER) += hush.o
  COBJS-y += s_record.o
 -COBJS-$(CONFIG_SERIAL_MULTI) += serial.o
  COBJS-y += xyzModem.o
  COBJS-y += cmd_disk.o
  
@@@ -68,6 -69,7 +68,7 @@@ COBJS-$(CONFIG_CMD_BDI) += cmd_bdinfo.
  COBJS-$(CONFIG_CMD_BEDBUG) += bedbug.o cmd_bedbug.o
  COBJS-$(CONFIG_CMD_BMP) += cmd_bmp.o
  COBJS-$(CONFIG_CMD_BOOTLDR) += cmd_bootldr.o
+ COBJS-$(CONFIG_CMD_BOOTSTAGE) += cmd_bootstage.o
  COBJS-$(CONFIG_CMD_CACHE) += cmd_cache.o
  COBJS-$(CONFIG_CMD_CONSOLE) += cmd_console.o
  COBJS-$(CONFIG_CMD_CPLBINFO) += cmd_cplbinfo.o
@@@ -106,7 -108,6 +107,7 @@@ COBJS-$(CONFIG_CMD_GPIO) += cmd_gpio.
  COBJS-$(CONFIG_CMD_I2C) += cmd_i2c.o
  COBJS-$(CONFIG_CMD_IDE) += cmd_ide.o
  COBJS-$(CONFIG_CMD_IMMAP) += cmd_immap.o
 +COBJS-$(CONFIG_CMD_INI) += cmd_ini.o
  COBJS-$(CONFIG_CMD_IRQ) += cmd_irq.o
  COBJS-$(CONFIG_CMD_ITEST) += cmd_itest.o
  COBJS-$(CONFIG_CMD_JFFS2) += cmd_jffs2.o
@@@ -198,10 -199,6 +199,10 @@@ endi
  
  ifdef CONFIG_SPL_BUILD
  COBJS-$(CONFIG_SPL_YMODEM_SUPPORT) += xyzModem.o
 +COBJS-$(CONFIG_SPL_NET_SUPPORT) += cmd_nvedit.o
 +COBJS-$(CONFIG_SPL_NET_SUPPORT) += env_common.o
 +COBJS-$(CONFIG_SPL_NET_SUPPORT) += env_nowhere.o
 +COBJS-$(CONFIG_SPL_NET_SUPPORT) += miiphyutil.o
  endif
  COBJS-y += console.o
  COBJS-y += dlmalloc.o
@@@ -231,10 -228,6 +232,10 @@@ $(obj)env_embedded.o: $(src)env_embedde
  $(obj)../tools/envcrc:
        $(MAKE) -C ../tools
  
 +# SEE README.arm-unaligned-accesses
 +$(obj)hush.o: CFLAGS += $(PLATFORM_NO_UNALIGNED)
 +$(obj)fdt_support.o: CFLAGS += $(PLATFORM_NO_UNALIGNED)
 +
  #########################################################################
  
  # defines $(obj).depend target
diff --combined include/bootstage.h
index db94a957e6e65ae057314fa62bfcc380808e580c,8fa13264d043a6abcbf12f658f62e1e9e86ecbc4..3b2216b8a8c8316df3dec35153947087623a905c
  #define CONFIG_BOOTSTAGE_USER_COUNT   20
  #endif
  
+ /* Flags for each bootstage record */
+ enum bootstage_flags {
+       BOOTSTAGEF_ERROR        = 1 << 0,       /* Error record */
+       BOOTSTAGEF_ALLOC        = 1 << 1,       /* Allocate an id */
+ };
  /*
   * A list of boot stages that we know about. Each of these indicates the
   * state that we are at, and the action that we are about to perform. For
@@@ -181,6 -187,7 +187,7 @@@ enum bootstage_id 
         * rough boot timing information.
         */
        BOOTSTAGE_ID_AWAKE,
+       BOOTSTAGE_ID_START_SPL,
        BOOTSTAGE_ID_START_UBOOT_F,
        BOOTSTAGE_ID_START_UBOOT_R,
        BOOTSTAGE_ID_USB_START,
        BOOTSTAGE_ID_MAIN_LOOP,
        BOOTSTAGE_KERNELREAD_START,
        BOOTSTAGE_KERNELREAD_STOP,
+       BOOTSTAGE_ID_BOARD_INIT,
+       BOOTSTAGE_ID_BOARD_INIT_DONE,
  
        BOOTSTAGE_ID_CPU_AWAKE,
        BOOTSTAGE_ID_MAIN_CPU_AWAKE,
        BOOTSTAGE_ID_MAIN_CPU_READY,
  
+       BOOTSTAGE_ID_ACCUM_LCD,
        /* a few spare for the user, from here */
        BOOTSTAGE_ID_USER,
        BOOTSTAGE_ID_COUNT = BOOTSTAGE_ID_USER + CONFIG_BOOTSTAGE_USER_COUNT,
   */
  ulong timer_get_boot_us(void);
  
 +#ifndef CONFIG_SPL_BUILD
  /*
   * Board code can implement show_boot_progress() if needed.
   *
   *            has occurred.
   */
  void show_boot_progress(int val);
 +#else
 +#define show_boot_progress(val) do {} while (0)
 +#endif
  
 -#ifdef CONFIG_BOOTSTAGE
 +#if defined(CONFIG_BOOTSTAGE) && !defined(CONFIG_SPL_BUILD)
  /* This is the full bootstage implementation */
  
+ /**
+  * Add a new bootstage record
+  *
+  * @param id  Bootstage ID to use (ignored if flags & BOOTSTAGEF_ALLOC)
+  * @param name        Name of record, or NULL for none
+  * @param flags       Flags (BOOTSTAGEF_...)
+  * @param mark        Time to record in this record, in microseconds
+  */
+ ulong bootstage_add_record(enum bootstage_id id, const char *name,
+                          int flags, ulong mark);
  /*
   * Mark a time stamp for the current boot stage.
   */
@@@ -234,9 -252,64 +256,64 @@@ ulong bootstage_error(enum bootstage_i
  
  ulong bootstage_mark_name(enum bootstage_id id, const char *name);
  
+ /**
+  * Mark the start of a bootstage activity. The end will be marked later with
+  * bootstage_accum() and at that point we accumulate the time taken. Calling
+  * this function turns the given id into a accumulator rather than and
+  * absolute mark in time. Accumulators record the total amount of time spent
+  * in an activty during boot.
+  *
+  * @param id  Bootstage id to record this timestamp against
+  * @param name        Textual name to display for this id in the report (maybe NULL)
+  * @return start timestamp in microseconds
+  */
+ uint32_t bootstage_start(enum bootstage_id id, const char *name);
+ /**
+  * Mark the end of a bootstage activity
+  *
+  * After previously marking the start of an activity with bootstage_start(),
+  * call this function to mark the end. You can call these functions in pairs
+  * as many times as you like.
+  *
+  * @param id  Bootstage id to record this timestamp against
+  * @return time spent in this iteration of the activity (i.e. the time now
+  *            less the start time recorded in the last bootstage_start() call
+  *            with this id.
+  */
+ uint32_t bootstage_accum(enum bootstage_id id);
  /* Print a report about boot time */
  void bootstage_report(void);
  
+ /**
+  * Add bootstage information to the device tree
+  *
+  * @return 0 if ok, -ve on error
+  */
+ int bootstage_fdt_add_report(void);
+ /*
+  * Stash bootstage data into memory
+  *
+  * @param base        Base address of memory buffer
+  * @param size        Size of memory buffer
+  * @return 0 if stashed ok, -1 if out of space
+  */
+ int bootstage_stash(void *base, int size);
+ /**
+  * Read bootstage data from memory
+  *
+  * Bootstage data is read from memory and placed in the bootstage table
+  * in the user records.
+  *
+  * @param base        Base address of memory buffer
+  * @param size        Size of memory buffer (-1 if unknown)
+  * @return 0 if unstashed ok, -1 if bootstage info not found, or out of space
+  */
+ int bootstage_unstash(void *base, int size);
  #else
  /*
   * This is a dummy implementation which just calls show_boot_progress(),
@@@ -260,7 -333,15 +337,15 @@@ static inline ulong bootstage_mark_name
        return 0;
  }
  
+ static inline int bootstage_stash(void *base, int size)
+ {
+       return 0;       /* Pretend to succeed */
+ }
  
+ static inline int bootstage_unstash(void *base, int size)
+ {
+       return 0;       /* Pretend to succeed */
+ }
  #endif /* CONFIG_BOOTSTAGE */
  
  #endif