public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 19/41] common: Move wait_ticks functions out of common.h
Date: Mon, 11 Nov 2019 09:34:22 -0500	[thread overview]
Message-ID: <20191111143422.GM19317@bill-the-cat> (raw)
In-Reply-To: <20191108125120.v2.19.Iaa061cc6a0a856a9300b6b03c2f5bb21d81565ff@changeid>

On Fri, Nov 08, 2019 at 12:53:26PM -0700, Simon Glass wrote:

> This function belongs in time.h so move it over and add a comment.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
> 
> Changes in v2: None
> 
>  arch/arm/cpu/pxa/pxa2xx.c     | 1 +
>  drivers/timer/mpc83xx_timer.c | 1 +
>  include/common.h              | 1 -
>  include/time.h                | 9 +++++++++
>  4 files changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/cpu/pxa/pxa2xx.c b/arch/arm/cpu/pxa/pxa2xx.c
> index 0b28f0a3ef..43c206b245 100644
> --- a/arch/arm/cpu/pxa/pxa2xx.c
> +++ b/arch/arm/cpu/pxa/pxa2xx.c
> @@ -10,6 +10,7 @@
>   */
>  
>  #include <common.h>
> +#include <time.h>
>  #include <asm/arch/pxa-regs.h>
>  #include <asm/io.h>
>  #include <asm/system.h>
> diff --git a/drivers/timer/mpc83xx_timer.c b/drivers/timer/mpc83xx_timer.c
> index dfbc8672b2..69949d5333 100644
> --- a/drivers/timer/mpc83xx_timer.c
> +++ b/drivers/timer/mpc83xx_timer.c
> @@ -9,6 +9,7 @@
>  #include <clk.h>
>  #include <dm.h>
>  #include <status_led.h>
> +#include <time.h>
>  #include <timer.h>
>  #include <watchdog.h>
>  
> diff --git a/include/common.h b/include/common.h
> index 20d143deb8..091b54787f 100644
> --- a/include/common.h
> +++ b/include/common.h
> @@ -286,7 +286,6 @@ int cleanup_before_linux_select(int flags);
>  
>  /* arch/$(ARCH)/lib/ticks.S */
>  uint64_t get_ticks(void);
> -void	wait_ticks    (unsigned long);
>  
>  /* lib/uuid.c */
>  #include <uuid.h>
> diff --git a/include/time.h b/include/time.h
> index a1bdefc164..0b3835f053 100644
> --- a/include/time.h
> +++ b/include/time.h
> @@ -86,4 +86,13 @@ ulong usec2ticks(unsigned long usec);
>   */
>  ulong ticks2usec(unsigned long ticks);
>  
> +/**
> + * wait_ticks() - waits a given number of ticks
> + *
> + * This is an internal funciton. Normally you should use udelay() or mdelay()
> + *
> + * @ticks: Number of ticks to wait
> + */
> +void wait_ticks(unsigned long ticks);
> +
>  #endif /* _TIME_H */

OK, so pxa has "pxa_wait_ticks" not "wait_ticks", so maybe you need to
check your scripts and re-run the series to catch any other similar
cases?  As an aside, pxa_wait_ticks should be static inline'd and since
it's a one-time-use function perhaps just moved in to the caller.

Next, wait_ticks exists on m68k but is unused and could be dropped.  But
in this case I see it's guarded on CONFIG_MCFPIT which is unset, so I'll
follow up and clean that all out.

Which brings us to PowerPC, where we have the asm version (as implied by
the common.h comment) and then mpc83xx has a specific timer driver that
provides it, and then wait_ticks is used to implement udelay on PowerPC
so perhaps the comment should read more like:
"This is an internal function typically used to implement udelay() and
similar".

Thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191111/5691abef/attachment.sig>

  reply	other threads:[~2019-11-11 14:34 UTC|newest]

Thread overview: 85+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-08 19:53 [U-Boot] [PATCH v2 00/41] common: Further reduce common.h Simon Glass
2019-11-08 19:53 ` [U-Boot] [PATCH v2 01/41] common: Move legacy CPU functions to their own header Simon Glass
2019-11-08 19:53 ` [U-Boot] [PATCH v2 02/41] Drop CONFIG_SHOW_ACTIVITY Simon Glass
2019-11-08 19:53 ` [U-Boot] [PATCH v2 03/41] common: Drop global inclusion of status_led.h Simon Glass
2019-11-11 14:17   ` Tom Rini
2019-11-08 19:53 ` [U-Boot] [PATCH v2 04/41] status_led: Tidy up the code style Simon Glass
2019-11-11 14:17   ` Tom Rini
2019-11-08 19:53 ` [U-Boot] [PATCH v2 05/41] common: Move random-number functions into their own header Simon Glass
2019-11-11 14:18   ` Tom Rini
2019-11-12 13:49     ` Simon Glass
2019-11-12 13:54       ` Tom Rini
2019-11-08 19:53 ` [U-Boot] [PATCH v2 06/41] common: Drop linux/crc8.h Simon Glass
2019-11-11 14:18   ` Tom Rini
2019-11-08 19:53 ` [U-Boot] [PATCH v2 07/41] crc: Fix code style with crc functions Simon Glass
2019-11-11 14:18   ` Tom Rini
2019-11-08 19:53 ` [U-Boot] [PATCH v2 08/41] crc32: Use the crc.h header for " Simon Glass
2019-11-11 14:18   ` Tom Rini
2019-11-08 19:53 ` [U-Boot] [PATCH v2 09/41] spl: bootcount: Move code out of header file Simon Glass
2019-11-11 14:15   ` Tom Rini
2019-11-08 19:53 ` [U-Boot] [PATCH v2 10/41] common: Move bootcount functions to their " Simon Glass
2019-11-11 14:18   ` Tom Rini
2019-11-08 19:53 ` [U-Boot] [PATCH v2 11/41] common: Move sorting functions to their own " Simon Glass
2019-11-11 14:18   ` Tom Rini
2019-11-08 19:53 ` [U-Boot] [PATCH v2 12/41] Move strtomhz() to vsprintf.h Simon Glass
2019-11-11 14:17   ` Tom Rini
2019-11-08 19:53 ` [U-Boot] [PATCH v2 13/41] common: Move env_get_ip() to net.h Simon Glass
2019-11-11 14:19   ` Tom Rini
2019-11-08 19:53 ` [U-Boot] [PATCH v2 14/41] serial: usb: Correct the usbtty_...() prototypes Simon Glass
2019-11-11 14:19   ` Tom Rini
2019-11-08 19:53 ` [U-Boot] [PATCH v2 15/41] common: Move serial_printf() to the serial header Simon Glass
2019-11-11 14:20   ` Tom Rini
2019-11-08 19:53 ` [U-Boot] [PATCH v2 16/41] common: Move serial functions out of common.h Simon Glass
2019-11-11 14:20   ` Tom Rini
2019-11-08 19:53 ` [U-Boot] [PATCH v2 17/41] common: Add a new lz4.h header file Simon Glass
2019-11-11 14:21   ` Tom Rini
2019-11-08 19:53 ` [U-Boot] [PATCH v2 18/41] common: Move some time functions out of common.h Simon Glass
2019-11-11 14:21   ` Tom Rini
2019-11-08 19:53 ` [U-Boot] [PATCH v2 19/41] common: Move wait_ticks " Simon Glass
2019-11-11 14:34   ` Tom Rini [this message]
2019-11-08 19:53 ` [U-Boot] [PATCH v2 20/41] common: Move timer_get_us() function " Simon Glass
2019-11-11 14:39   ` Tom Rini
2019-11-08 19:53 ` [U-Boot] [PATCH v2 21/41] common: Move get_ticks() " Simon Glass
2019-11-11 14:39   ` Tom Rini
2019-11-08 19:53 ` [U-Boot] [PATCH v2 22/41] common: Move mii_init() " Simon Glass
2019-11-11 14:39   ` Tom Rini
2019-11-08 19:53 ` [U-Boot] [PATCH v2 23/41] common: Move some CPU functions " Simon Glass
2019-11-08 19:53 ` [U-Boot] [PATCH v2 24/41] common: Drop cpu_init() Simon Glass
2019-11-11 14:40   ` Tom Rini
2019-11-08 19:53 ` [U-Boot] [PATCH v2 25/41] common: Move checkcpu() out of common.h Simon Glass
2019-11-11 14:40   ` Tom Rini
2019-11-08 19:53 ` [U-Boot] [PATCH v2 26/41] common: Move some SMP functions " Simon Glass
2019-11-08 19:53 ` [U-Boot] [PATCH v2 27/41] arm: powerpc: Tidy up code style for cache functions Simon Glass
2019-11-11 14:41   ` Tom Rini
2019-11-08 19:53 ` [U-Boot] [PATCH v2 28/41] common: Move some cache and MMU functions out of common.h Simon Glass
2019-11-08 19:53 ` [U-Boot] [PATCH v2 29/41] common: Drop checkicache() and checkdcache() Simon Glass
2019-11-11 14:41   ` Tom Rini
2019-11-08 19:53 ` [U-Boot] [PATCH v2 30/41] common: Move ARM cache operations out of common.h Simon Glass
2019-11-08 19:53 ` [U-Boot] [PATCH v2 31/41] arm: powerpc: Tidy up code style for interrupt functions Simon Glass
2019-11-11 14:42   ` Tom Rini
2019-11-08 19:53 ` [U-Boot] [PATCH v2 32/41] common: Move interrupt functions into a new header Simon Glass
2019-11-11 14:51   ` Tom Rini
2019-11-12 14:10     ` Simon Glass
2019-11-12 14:13       ` Tom Rini
2019-11-08 19:53 ` [U-Boot] [PATCH v2 33/41] common: Move enable/disable_interrupts out of common.h Simon Glass
2019-11-11 14:56   ` Tom Rini
2019-11-08 19:53 ` [U-Boot] [PATCH v2 34/41] common: Move command functions " Simon Glass
2019-11-11 14:56   ` Tom Rini
2019-11-08 19:53 ` [U-Boot] [PATCH v2 35/41] common: Drop board_show_dram() Simon Glass
2019-11-11 15:00   ` Tom Rini
2019-11-08 19:53 ` [U-Boot] [PATCH v2 36/41] common: Move board_get_usable_ram_top() out of common.h Simon Glass
2019-11-11 15:01   ` Tom Rini
2019-11-08 19:53 ` [U-Boot] [PATCH v2 37/41] common: Move some board functions " Simon Glass
2019-11-11 15:01   ` Tom Rini
2019-11-08 19:53 ` [U-Boot] [PATCH v2 38/41] common: Move pci_init_board() " Simon Glass
2019-11-11 15:01   ` Tom Rini
2019-11-08 19:53 ` [U-Boot] [PATCH v2 39/41] common: Move trap_init() " Simon Glass
2019-11-11 15:02   ` Tom Rini
2019-11-08 19:53 ` [U-Boot] [PATCH v2 40/41] common: Drop get_endaddr() Simon Glass
2019-11-11 15:02   ` Tom Rini
2019-11-08 19:53 ` [U-Boot] [PATCH v2 41/41] common: Move old EEPROM functions into a new header Simon Glass
2019-11-11 15:08   ` Tom Rini
2019-11-08 20:40 ` [U-Boot] [PATCH v2 00/41] common: Further reduce common.h Simon Glass
2019-11-08 21:02   ` Tom Rini
2019-11-08 21:03     ` Simon Glass
2019-11-08 21:10       ` Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191111143422.GM19317@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox