bv07.c 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. * arch/arm/mach-vt8500/bv07.c
  3. *
  4. * Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
  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 as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  19. */
  20. #include <linux/io.h>
  21. #include <linux/pm.h>
  22. #include <asm/mach-types.h>
  23. #include <asm/mach/arch.h>
  24. #include <mach/restart.h>
  25. #include "devices.h"
  26. static void __iomem *pmc_hiber;
  27. static struct platform_device *devices[] __initdata = {
  28. &vt8500_device_uart0,
  29. &vt8500_device_lcdc,
  30. &vt8500_device_ehci,
  31. &vt8500_device_ge_rops,
  32. &vt8500_device_pwm,
  33. &vt8500_device_pwmbl,
  34. &vt8500_device_rtc,
  35. };
  36. static void vt8500_power_off(void)
  37. {
  38. local_irq_disable();
  39. writew(5, pmc_hiber);
  40. asm("mcr%? p15, 0, %0, c7, c0, 4" : : "r" (0));
  41. }
  42. void __init bv07_init(void)
  43. {
  44. #ifdef CONFIG_FB_VT8500
  45. void __iomem *gpio_mux_reg = ioremap(wmt_gpio_base + 0x200, 4);
  46. if (gpio_mux_reg) {
  47. writel(readl(gpio_mux_reg) | 1, gpio_mux_reg);
  48. iounmap(gpio_mux_reg);
  49. } else {
  50. printk(KERN_ERR "Could not remap the GPIO mux register, display may not work properly!\n");
  51. }
  52. #endif
  53. pmc_hiber = ioremap(wmt_pmc_base + 0x12, 2);
  54. if (pmc_hiber)
  55. pm_power_off = &vt8500_power_off;
  56. else
  57. printk(KERN_ERR "PMC Hibernation register could not be remapped, not enabling power off!\n");
  58. wmt_setup_restart();
  59. vt8500_set_resources();
  60. platform_add_devices(devices, ARRAY_SIZE(devices));
  61. vt8500_gpio_init();
  62. }
  63. MACHINE_START(BV07, "Benign BV07 Mini Netbook")
  64. .atag_offset = 0x100,
  65. .restart = wmt_restart,
  66. .reserve = vt8500_reserve_mem,
  67. .map_io = vt8500_map_io,
  68. .init_irq = vt8500_init_irq,
  69. .timer = &vt8500_timer,
  70. .init_machine = bv07_init,
  71. MACHINE_END