io.c 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * DaVinci I/O mapping code
  3. *
  4. * Copyright (C) 2005-2006 Texas Instruments
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #include <linux/module.h>
  11. #include <linux/kernel.h>
  12. #include <linux/init.h>
  13. #include <asm/tlb.h>
  14. #include <asm/io.h>
  15. #include <asm/memory.h>
  16. #include <asm/mach/map.h>
  17. extern void davinci_check_revision(void);
  18. /*
  19. * The machine specific code may provide the extra mapping besides the
  20. * default mapping provided here.
  21. */
  22. static struct map_desc davinci_io_desc[] __initdata = {
  23. {
  24. .virtual = IO_VIRT,
  25. .pfn = __phys_to_pfn(IO_PHYS),
  26. .length = IO_SIZE,
  27. .type = MT_DEVICE
  28. },
  29. };
  30. void __init davinci_map_common_io(void)
  31. {
  32. iotable_init(davinci_io_desc, ARRAY_SIZE(davinci_io_desc));
  33. /* Normally devicemaps_init() would flush caches and tlb after
  34. * mdesc->map_io(), but we must also do it here because of the CPU
  35. * revision check below.
  36. */
  37. local_flush_tlb_all();
  38. flush_cache_all();
  39. /* We want to check CPU revision early for cpu_is_xxxx() macros.
  40. * IO space mapping must be initialized before we can do that.
  41. */
  42. davinci_check_revision();
  43. }