mpp.c 809 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * arch/arm/mach-orion5x/mpp.c
  4. *
  5. * MPP functions for Marvell Orion 5x SoCs
  6. */
  7. #include <linux/kernel.h>
  8. #include <linux/init.h>
  9. #include <linux/io.h>
  10. #include <plat/mpp.h>
  11. #include "orion5x.h"
  12. #include "mpp.h"
  13. #include "common.h"
  14. static unsigned int __init orion5x_variant(void)
  15. {
  16. u32 dev;
  17. u32 rev;
  18. orion5x_pcie_id(&dev, &rev);
  19. if (dev == MV88F5181_DEV_ID)
  20. return MPP_F5181_MASK;
  21. if (dev == MV88F5182_DEV_ID)
  22. return MPP_F5182_MASK;
  23. if (dev == MV88F5281_DEV_ID)
  24. return MPP_F5281_MASK;
  25. printk(KERN_ERR "MPP setup: unknown orion5x variant "
  26. "(dev %#x rev %#x)\n", dev, rev);
  27. return 0;
  28. }
  29. void __init orion5x_mpp_conf(unsigned int *mpp_list)
  30. {
  31. orion_mpp_conf(mpp_list, orion5x_variant(),
  32. MPP_MAX, ORION5X_DEV_BUS_VIRT_BASE);
  33. }