nspire.c 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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 <asm/hardware/timer-sp.h>
  24. #include "mmio.h"
  25. #include "clcd.h"
  26. static const char *nspire_dt_match[] __initconst = {
  27. "ti,nspire",
  28. "ti,nspire-cx",
  29. "ti,nspire-tp",
  30. "ti,nspire-clp",
  31. NULL,
  32. };
  33. static void __init nspire_map_io(void)
  34. {
  35. debug_ll_io_init();
  36. }
  37. static struct clcd_board nspire_clcd_data = {
  38. .name = "LCD",
  39. .caps = CLCD_CAP_5551 | CLCD_CAP_565,
  40. .check = clcdfb_check,
  41. .decode = clcdfb_decode,
  42. .setup = nspire_clcd_setup,
  43. .mmap = nspire_clcd_mmap,
  44. .remove = nspire_clcd_remove,
  45. };
  46. static struct of_dev_auxdata nspire_auxdata[] __initdata = {
  47. OF_DEV_AUXDATA("arm,pl111", NSPIRE_LCD_PHYS_BASE,
  48. NULL, &nspire_clcd_data),
  49. { }
  50. };
  51. static void __init nspire_init(void)
  52. {
  53. of_platform_populate(NULL, of_default_bus_match_table,
  54. nspire_auxdata, NULL);
  55. }
  56. static void nspire_restart(char mode, const char *cmd)
  57. {
  58. void __iomem *base = ioremap(NSPIRE_MISC_PHYS_BASE, SZ_4K);
  59. if (!base)
  60. return;
  61. writel(2, base + NSPIRE_MISC_HWRESET);
  62. }
  63. DT_MACHINE_START(NSPIRE, "TI-NSPIRE")
  64. .dt_compat = nspire_dt_match,
  65. .map_io = nspire_map_io,
  66. .init_machine = nspire_init,
  67. .restart = nspire_restart,
  68. MACHINE_END