prom.c 817 B

12345678910111213141516171819202122232425262728293031323334
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Atheros AR71XX/AR724X/AR913X specific prom routines
  4. *
  5. * Copyright (C) 2015 Laurent Fasnacht <[email protected]>
  6. * Copyright (C) 2008-2010 Gabor Juhos <[email protected]>
  7. * Copyright (C) 2008 Imre Kaloz <[email protected]>
  8. */
  9. #include <linux/kernel.h>
  10. #include <linux/init.h>
  11. #include <linux/io.h>
  12. #include <linux/string.h>
  13. #include <linux/initrd.h>
  14. #include <asm/bootinfo.h>
  15. #include <asm/addrspace.h>
  16. #include <asm/fw/fw.h>
  17. #include "common.h"
  18. void __init prom_init(void)
  19. {
  20. fw_init_cmdline();
  21. #ifdef CONFIG_BLK_DEV_INITRD
  22. /* Read the initrd address from the firmware environment */
  23. initrd_start = fw_getenvl("initrd_start");
  24. if (initrd_start) {
  25. initrd_start = KSEG0ADDR(initrd_start);
  26. initrd_end = initrd_start + fw_getenvl("initrd_size");
  27. }
  28. #endif
  29. }