cpc700_memory.c 705 B

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