Fork of the vendor (Boundary Devices) u-boot for Reform 2, with minor tweaks. The goal is to migrate to mainstream u-boot or barebox ASAP. The main impediment so far is the 4GB RAM config.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 
 
 
 

35 lines
747 B

  1. /*
  2. * (C) Copyright 2001
  3. * Murray Jensen <Murray.Jensen@cmst.csiro.au>
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. #include <stdio.h>
  8. #include <stdlib.h>
  9. #include <unistd.h>
  10. #include <time.h>
  11. int
  12. main(int argc, char *argv[])
  13. {
  14. unsigned long ethaddr_low, ethaddr_high;
  15. srand(time(0) + (getpid() << 8));
  16. /*
  17. * setting the 2nd LSB in the most significant byte of
  18. * the address makes it a locally administered ethernet
  19. * address
  20. */
  21. ethaddr_high = (rand() & 0xfeff) | 0x0200;
  22. ethaddr_low = rand();
  23. printf("%02lx:%02lx:%02lx:%02lx:%02lx:%02lx\n",
  24. ethaddr_high >> 8, ethaddr_high & 0xff,
  25. ethaddr_low >> 24, (ethaddr_low >> 16) & 0xff,
  26. (ethaddr_low >> 8) & 0xff, ethaddr_low & 0xff);
  27. return (0);
  28. }