From 7a80de464167ec45fdb70f63d83d07f7c2c57b82 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 24 Feb 2016 09:14:42 -0700 Subject: image: Correct the OS location code to work on sandbox A recent change broke the 'bootm' command on sandbox. The root cause is using a pointer as an address. Conversion from pointer to address needs to use map_to_sysmem() so that sandbox can do the right thing. The problem was pre-existing but uncovered by a recent commit. Fix this. Also move fit_get_end() to the C file to avoid needing to include mapmem.h (and thus asm/io.h) everywhere. Fixes: 1fec3c5d (common/image.c: Make boot_get_ramdisk() perform a check for Android images) Signed-off-by: Simon Glass --- include/image.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'include') diff --git a/include/image.h b/include/image.h index 299d6d2a13..518a4f5291 100644 --- a/include/image.h +++ b/include/image.h @@ -818,10 +818,7 @@ static inline ulong fit_get_size(const void *fit) * returns: * end address of the FIT image (blob) in memory */ -static inline ulong fit_get_end(const void *fit) -{ - return (ulong)fit + fdt_totalsize(fit); -} +ulong fit_get_end(const void *fit); /** * fit_get_name - get FIT node name -- cgit v1.2.1 From c95fec31928d7e2596364ee1d226b52ffd7793f2 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 24 Feb 2016 09:14:49 -0700 Subject: timer: Provide an early timer In some cases the timer must be accessible before driver model is active. Examples include when using CONFIG_TRACE to trace U-Boot's execution before driver model is set up. Enable this option to use an early timer. These functions must be supported by your timer driver: timer_early_get_count() and timer_early_get_rate(). Signed-off-by: Simon Glass --- include/timer.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'include') diff --git a/include/timer.h b/include/timer.h index f14725cc28..dcc803c392 100644 --- a/include/timer.h +++ b/include/timer.h @@ -67,4 +67,25 @@ struct timer_dev_priv { unsigned long clock_rate; }; +/** + * timer_early_get_count() - Implement timer_get_count() before driver model + * + * If CONFIG_TIMER_EARLY is enabled, this function wil be called to return + * the current timer value before the proper driver model timer is ready. + * It should be implemented by one of the timer values. This is mostly useful + * for tracing. + */ +u64 timer_early_get_count(void); + +/** + * timer_early_get_rate() - Get the timer rate before driver model + * + * If CONFIG_TIMER_EARLY is enabled, this function wil be called to return + * the current timer rate in Hz before the proper driver model timer is ready. + * It should be implemented by one of the timer values. This is mostly useful + * for tracing. This corresponds to the clock_rate value in struct + * timer_dev_priv. + */ +unsigned long timer_early_get_rate(void); + #endif /* _TIMER_H_ */ -- cgit v1.2.1