chip_id.h 725 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Copyright (c) 2017 - 2020, Broadcom
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef CHIP_ID_H
  7. #define CHIP_ID_H
  8. #include <lib/mmio.h>
  9. #include <platform_def.h>
  10. #define CHIP_REV_MAJOR_MASK 0xF0
  11. #define CHIP_REV_MAJOR_AX 0x00
  12. #define CHIP_REV_MAJOR_BX 0x10
  13. #define CHIP_REV_MAJOR_CX 0x20
  14. #define CHIP_REV_MAJOR_DX 0x30
  15. /* Get Chip ID (product number) of the chip */
  16. static inline unsigned int chip_get_product_id(void)
  17. {
  18. return PLAT_CHIP_ID_GET;
  19. }
  20. /* Get Revision ID (major and minor) number of the chip */
  21. static inline unsigned int chip_get_rev_id(void)
  22. {
  23. return PLAT_CHIP_REV_GET;
  24. }
  25. static inline unsigned int chip_get_rev_id_major(void)
  26. {
  27. return (chip_get_rev_id() & CHIP_REV_MAJOR_MASK);
  28. }
  29. #endif