setup.c 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * linux/arch/sh/boards/hp6xx/hp680/setup.c
  3. *
  4. * Copyright (C) 2002 Andriy Skulysh
  5. *
  6. * May be copied or modified under the terms of the GNU General Public
  7. * License. See linux/COPYING for more information.
  8. *
  9. * Setup code for an HP680 (internal peripherials only)
  10. */
  11. #include <linux/types.h>
  12. #include <linux/init.h>
  13. #include <asm/hd64461.h>
  14. #include <asm/io.h>
  15. #include <asm/irq.h>
  16. #include <asm/hp6xx/hp6xx.h>
  17. #include <asm/cpu/dac.h>
  18. #define SCPCR 0xa4000116
  19. #define SCPDR 0xa4000136
  20. const char *get_system_type(void)
  21. {
  22. return "HP6xx";
  23. }
  24. int __init platform_setup(void)
  25. {
  26. u8 v8;
  27. u16 v;
  28. v = inw(HD64461_STBCR);
  29. v |= HD64461_STBCR_SURTST | HD64461_STBCR_SIRST |
  30. HD64461_STBCR_STM1ST | HD64461_STBCR_STM0ST |
  31. HD64461_STBCR_SAFEST | HD64461_STBCR_SPC0ST |
  32. HD64461_STBCR_SMIAST | HD64461_STBCR_SAFECKE_OST |
  33. HD64461_STBCR_SAFECKE_IST;
  34. #ifndef CONFIG_HD64461_ENABLER
  35. v |= HD64461_STBCR_SPC1ST;
  36. #endif
  37. outw(v, HD64461_STBCR);
  38. v = inw(HD64461_GPADR);
  39. v |= HD64461_GPADR_SPEAKER | HD64461_GPADR_PCMCIA0;
  40. outw(v, HD64461_GPADR);
  41. outw(HD64461_PCCGCR_VCC0 | HD64461_PCCSCR_VCC1, HD64461_PCC0GCR);
  42. #ifndef CONFIG_HD64461_ENABLER
  43. outw(HD64461_PCCGCR_VCC0 | HD64461_PCCSCR_VCC1, HD64461_PCC1GCR);
  44. #endif
  45. sh_dac_output(0, DAC_SPEAKER_VOLUME);
  46. sh_dac_disable(DAC_SPEAKER_VOLUME);
  47. v8 = ctrl_inb(DACR);
  48. v8 &= ~DACR_DAE;
  49. ctrl_outb(v8,DACR);
  50. v8 = ctrl_inb(SCPDR);
  51. v8 |= SCPDR_TS_SCAN_X | SCPDR_TS_SCAN_Y;
  52. v8 &= ~SCPDR_TS_SCAN_ENABLE;
  53. ctrl_outb(v8, SCPDR);
  54. v = ctrl_inw(SCPCR);
  55. v &= ~SCPCR_TS_MASK;
  56. v |= SCPCR_TS_ENABLE;
  57. ctrl_outw(v, SCPCR);
  58. return 0;
  59. }