]> git.sur5r.net Git - u-boot/commitdiff
x86: ivybridge: Measure the MRC code execution time
authorSimon Glass <sjg@chromium.org>
Sun, 18 Oct 2015 21:55:36 +0000 (15:55 -0600)
committerSimon Glass <sjg@chromium.org>
Wed, 21 Oct 2015 13:46:51 +0000 (07:46 -0600)
This code takes about 450ms without the MRC cache and about 27ms with the
cache. Add a debug timer so that this time can be displayed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
arch/x86/cpu/ivybridge/sdram.c

index e63790963c9c73d3aa4f60fb60de865c9f2fe6a4..d9b3dfc12cdfdee761b80a3a494f269461f863a0 100644 (file)
@@ -336,9 +336,11 @@ int sdram_initialise(struct pei_data *pei_data)
        if (data) {
                int rv;
                int (*func)(struct pei_data *);
+               ulong start;
 
                debug("Calling MRC at %p\n", data);
                post_code(POST_PRE_MRC);
+               start = get_timer(0);
                func = (int (*)(struct pei_data *))data;
                rv = func(pei_data);
                post_code(POST_MRC);
@@ -356,6 +358,7 @@ int sdram_initialise(struct pei_data *pei_data)
                        printf("Nonzero MRC return value.\n");
                        return -EFAULT;
                }
+               debug("MRC execution time %lu ms\n", get_timer(start));
        } else {
                printf("UEFI PEI System Agent not found.\n");
                return -ENOSYS;