nspire.c 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * linux/arch/arm/mach-nspire/nspire.c
  3. *
  4. * Copyright (C) 2013 Daniel Tang <tangrs@tangrs.id.au>
  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. */
  11. #include <linux/init.h>
  12. #include <linux/of_irq.h>
  13. #include <linux/of_address.h>
  14. #include <linux/of_platform.h>
  15. #include <linux/irqchip.h>
  16. #include <linux/irqchip/arm-vic.h>
  17. #include <linux/clkdev.h>
  18. #include <linux/amba/bus.h>
  19. #include <linux/amba/clcd.h>
  20. #include <asm/mach/arch.h>
  21. #include <asm/mach-types.h>
  22. #include <asm/mach/map.h>
  23. #include "mmio.h"
  24. #include "clcd.h"
  25. static const char *const nspire_dt_match[] __initconst = {
  26. "ti,nspire",
  27. "ti,nspire-cx",
  28. "ti,nspire-tp",
  29. "ti,nspire-clp",
  30. NULL,
  31. };
  32. static void __init nspire_map_io(void)
  33. {
  34. debug_ll_io_init();
  35. }
  36. static struct clcd_board nspire_clcd_data = {
  37. .name = "LCD",
  38. .caps = CLCD_CAP_5551 | CLCD_CAP_565,
  39. .check = clcdfb_check,
  40. .decode = clcdfb_decode,
  41. .setup = nspire_clcd_setup,
  42. .mmap = nspire_clcd_mmap,
  43. .remove = nspire_clcd_remove,
  44. };
  45. static struct of_dev_auxdata nspire_auxdata[] __initdata = {
  46. OF_DEV_AUXDATA("arm,pl111", NSPIRE_LCD_PHYS_BASE,
  47. NULL, &nspire_clcd_data),
  48. { }
  49. };
  50. static void __init nspire_init(void)
  51. {
  52. of_platform_default_populate(NULL, nspire_auxdata, NULL);
  53. }
  54. static void nspire_restart(enum reboot_mode mode, const char *cmd)
  55. {
  56. void __iomem *base = ioremap(NSPIRE_MISC_PHYS_BASE, SZ_4K);
  57. if (!base)
  58. return;
  59. writel(2, base + NSPIRE_MISC_HWRESET);
  60. }
  61. DT_MACHINE_START(NSPIRE, "TI-NSPIRE")
  62. .dt_compat = nspire_dt_match,
  63. .map_io = nspire_map_io,
  64. .init_machine = nspire_init,
  65. .restart = nspire_restart,
  66. MACHINE_END