cpc700_memory.c 748 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * arch/ppc/boot/common/cpc700_memory.c
  3. *
  4. * Find memory based upon settings in the CPC700 bridge
  5. *
  6. * Author: Dan Cox
  7. *
  8. * 2001-2002 (c) MontaVista, Software, Inc. This file is licensed under
  9. * the terms of the GNU General Public License version 2. This program
  10. * is licensed "as is" without any warranty of any kind, whether express
  11. * or implied.
  12. */
  13. #include <asm/types.h>
  14. #include <asm/io.h>
  15. #include "cpc700.h"
  16. unsigned long
  17. cpc700_get_mem_size(void)
  18. {
  19. int i;
  20. unsigned long len, amt;
  21. /* Start at MB1EA, since MB0EA will most likely be the ending address
  22. for ROM space. */
  23. for(len = 0, i = CPC700_MB1EA; i <= CPC700_MB4EA; i+=4) {
  24. amt = cpc700_read_memreg(i);
  25. if (amt == 0)
  26. break;
  27. len = amt;
  28. }
  29. return len;
  30. }