display_options.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * Copyright (c) 2015 Google, Inc
  3. *
  4. * (C) Copyright 2000-2002
  5. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  6. *
  7. * SPDX-License-Identifier: GPL-2.0+
  8. */
  9. #ifndef __DISPLAY_OPTIONS_H
  10. #define __DISPLAY_OPTIONS_H
  11. /**
  12. * print_size() - Print a size with a suffix
  13. *
  14. * Print sizes as "xxx KiB", "xxx.y KiB", "xxx MiB", "xxx.y MiB",
  15. * xxx GiB, xxx.y GiB, etc as needed; allow for optional trailing string
  16. * (like "\n")
  17. *
  18. * @size: Size to print
  19. * @suffix String to print after the size
  20. */
  21. void print_size(uint64_t size, const char *suffix);
  22. /**
  23. * print_freq() - Print a frequency with a suffix
  24. *
  25. * Print frequencies as "x.xx GHz", "xxx KHz", etc as needed; allow for
  26. * optional trailing string (like "\n")
  27. *
  28. * @freq: Frequency to print in Hz
  29. * @suffix String to print after the frequency
  30. */
  31. void print_freq(uint64_t freq, const char *suffix);
  32. /**
  33. * print_buffer() - Print data buffer in hex and ascii form
  34. *
  35. * Data reads are buffered so that each memory address is only read once.
  36. * This is useful when displaying the contents of volatile registers.
  37. *
  38. * @addr: Starting address to display at start of line
  39. * @data: pointer to data buffer
  40. * @width: data value width. May be 1, 2, or 4.
  41. * @count: number of values to display
  42. * @linelen: Number of values to print per line; specify 0 for default length
  43. */
  44. int print_buffer(ulong addr, const void *data, uint width, uint count,
  45. uint linelen);
  46. /**
  47. * display_options() - display the version string / build tag
  48. *
  49. * This displays the U-Boot version string. If a build tag is available this
  50. * is displayed also.
  51. */
  52. int display_options(void);
  53. #endif