setup.c 749 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. /*
  3. * Copyright (C) 2007 Lemote Inc. & Institute of Computing Technology
  4. * Author: Fuxin Zhang, [email protected]
  5. */
  6. #include <linux/export.h>
  7. #include <linux/init.h>
  8. #include <asm/wbflush.h>
  9. #include <asm/bootinfo.h>
  10. #include <linux/libfdt.h>
  11. #include <linux/of_fdt.h>
  12. #include <asm/prom.h>
  13. #include <loongson.h>
  14. void *loongson_fdt_blob;
  15. static void wbflush_loongson(void)
  16. {
  17. asm(".set\tpush\n\t"
  18. ".set\tnoreorder\n\t"
  19. ".set mips3\n\t"
  20. "sync\n\t"
  21. "nop\n\t"
  22. ".set\tpop\n\t"
  23. ".set mips0\n\t");
  24. }
  25. void (*__wbflush)(void) = wbflush_loongson;
  26. EXPORT_SYMBOL(__wbflush);
  27. void __init plat_mem_setup(void)
  28. {
  29. if (loongson_fdt_blob)
  30. __dt_setup_arch(loongson_fdt_blob);
  31. }