mvme7100.c 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Motload compatibility for the Emerson/Artesyn MVME7100
  3. *
  4. * Copyright 2016 Elettra-Sincrotrone Trieste S.C.p.A.
  5. *
  6. * Author: Alessio Igor Bogani <alessio.bogani@elettra.eu>
  7. *
  8. * This program is free software; you can redistribute it and/or modify it
  9. * under the terms of the GNU General Public License as published by the
  10. * Free Software Foundation; either version 2 of the License, or (at your
  11. * option) any later version.
  12. *
  13. */
  14. #include "ops.h"
  15. #include "stdio.h"
  16. #include "cuboot.h"
  17. #define TARGET_86xx
  18. #define TARGET_HAS_ETH1
  19. #define TARGET_HAS_ETH2
  20. #define TARGET_HAS_ETH3
  21. #include "ppcboot.h"
  22. static bd_t bd;
  23. BSS_STACK(16384);
  24. static void mvme7100_fixups(void)
  25. {
  26. void *devp;
  27. unsigned long busfreq = bd.bi_busfreq * 1000000;
  28. dt_fixup_cpu_clocks(bd.bi_intfreq * 1000000, busfreq / 4, busfreq);
  29. devp = finddevice("/soc@f1000000");
  30. if (devp)
  31. setprop(devp, "bus-frequency", &busfreq, sizeof(busfreq));
  32. devp = finddevice("/soc/serial@4500");
  33. if (devp)
  34. setprop(devp, "clock-frequency", &busfreq, sizeof(busfreq));
  35. dt_fixup_memory(bd.bi_memstart, bd.bi_memsize);
  36. dt_fixup_mac_address_by_alias("ethernet0", bd.bi_enetaddr);
  37. dt_fixup_mac_address_by_alias("ethernet1", bd.bi_enet1addr);
  38. dt_fixup_mac_address_by_alias("ethernet2", bd.bi_enet2addr);
  39. dt_fixup_mac_address_by_alias("ethernet3", bd.bi_enet3addr);
  40. }
  41. void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
  42. unsigned long r6, unsigned long r7)
  43. {
  44. CUBOOT_INIT();
  45. fdt_init(_dtb_start);
  46. serial_console_init();
  47. platform_ops.fixups = mvme7100_fixups;
  48. }