probe.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * arch/sh/kernel/cpu/sh2/probe.c
  3. *
  4. * CPU Subtype Probing for SH-2.
  5. *
  6. * Copyright (C) 2002 Paul Mundt
  7. *
  8. * This file is subject to the terms and conditions of the GNU General Public
  9. * License. See the file "COPYING" in the main directory of this archive
  10. * for more details.
  11. */
  12. #include <linux/init.h>
  13. #include <asm/processor.h>
  14. #include <asm/cache.h>
  15. int __init detect_cpu_and_cache_system(void)
  16. {
  17. #if defined(CONFIG_CPU_SUBTYPE_SH7604)
  18. cpu_data->type = CPU_SH7604;
  19. cpu_data->dcache.ways = 4;
  20. cpu_data->dcache.way_incr = (1<<10);
  21. cpu_data->dcache.sets = 64;
  22. cpu_data->dcache.entry_shift = 4;
  23. cpu_data->dcache.linesz = L1_CACHE_BYTES;
  24. cpu_data->dcache.flags = 0;
  25. #elif defined(CONFIG_CPU_SUBTYPE_SH7619)
  26. cpu_data->type = CPU_SH7619;
  27. cpu_data->dcache.ways = 4;
  28. cpu_data->dcache.way_incr = (1<<12);
  29. cpu_data->dcache.sets = 256;
  30. cpu_data->dcache.entry_shift = 4;
  31. cpu_data->dcache.linesz = L1_CACHE_BYTES;
  32. cpu_data->dcache.flags = 0;
  33. #endif
  34. /*
  35. * SH-2 doesn't have separate caches
  36. */
  37. cpu_data->dcache.flags |= SH_CACHE_COMBINED;
  38. cpu_data->icache = cpu_data->dcache;
  39. return 0;
  40. }