io.c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. #include <asm/arch/clock.h>
  18. extern void davinci_check_revision(void);
  19. /*
  20. * The machine specific code may provide the extra mapping besides the
  21. * default mapping provided here.
  22. */
  23. static struct map_desc davinci_io_desc[] __initdata = {
  24. {
  25. .virtual = IO_VIRT,
  26. .pfn = __phys_to_pfn(IO_PHYS),
  27. .length = IO_SIZE,
  28. .type = MT_DEVICE
  29. },
  30. };
  31. void __init davinci_map_common_io(void)
  32. {
  33. iotable_init(davinci_io_desc, ARRAY_SIZE(davinci_io_desc));
  34. /* Normally devicemaps_init() would flush caches and tlb after
  35. * mdesc->map_io(), but we must also do it here because of the CPU
  36. * revision check below.
  37. */
  38. local_flush_tlb_all();
  39. flush_cache_all();
  40. /* We want to check CPU revision early for cpu_is_xxxx() macros.
  41. * IO space mapping must be initialized before we can do that.
  42. */
  43. davinci_check_revision();
  44. }
  45. void __init davinci_init_common_hw(void)
  46. {
  47. davinci_clk_init();
  48. }