cuboot-ebony.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Old U-boot compatibility for Ebony
  3. *
  4. * Author: David Gibson <david@gibson.dropbear.id.au>
  5. *
  6. * Copyright 2007 David Gibson, IBM Corporatio.
  7. * Based on cuboot-83xx.c, which is:
  8. * Copyright (c) 2007 Freescale Semiconductor, Inc.
  9. *
  10. * This program is free software; you can redistribute it and/or modify it
  11. * under the terms of the GNU General Public License version 2 as published
  12. * by the Free Software Foundation.
  13. */
  14. #include "ops.h"
  15. #include "stdio.h"
  16. #include "44x.h"
  17. #define TARGET_44x
  18. #include "ppcboot.h"
  19. static bd_t bd;
  20. extern char _end[];
  21. BSS_STACK(4096);
  22. void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
  23. unsigned long r6, unsigned long r7)
  24. {
  25. unsigned long end_of_ram = bd.bi_memstart + bd.bi_memsize;
  26. unsigned long avail_ram = end_of_ram - (unsigned long)_end;
  27. memcpy(&bd, (bd_t *)r3, sizeof(bd));
  28. loader_info.initrd_addr = r4;
  29. loader_info.initrd_size = r4 ? r5 : 0;
  30. loader_info.cmdline = (char *)r6;
  31. loader_info.cmdline_len = r7 - r6;
  32. simple_alloc_init(_end, avail_ram, 32, 64);
  33. ebony_init(&bd.bi_enetaddr, &bd.bi_enet1addr);
  34. }