setup.c 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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/init.h>
  12. #include <asm/io.h>
  13. #include <asm/hd64461.h>
  14. #include <asm/hp6xx/hp6xx.h>
  15. #include <asm/cpu/dac.h>
  16. #define SCPCR 0xa4000116
  17. #define SCPDR 0xa4000136
  18. const char *get_system_type(void)
  19. {
  20. return "HP6xx";
  21. }
  22. int __init platform_setup(void)
  23. {
  24. u8 v8;
  25. u16 v;
  26. v = inw(HD64461_STBCR);
  27. v |= HD64461_STBCR_SURTST | HD64461_STBCR_SIRST |
  28. HD64461_STBCR_STM1ST | HD64461_STBCR_STM0ST |
  29. HD64461_STBCR_SAFEST | HD64461_STBCR_SPC0ST |
  30. HD64461_STBCR_SMIAST | HD64461_STBCR_SAFECKE_OST |
  31. HD64461_STBCR_SAFECKE_IST;
  32. #ifndef CONFIG_HD64461_ENABLER
  33. v |= HD64461_STBCR_SPC1ST;
  34. #endif
  35. outw(v, HD64461_STBCR);
  36. v = inw(HD64461_GPADR);
  37. v |= HD64461_GPADR_SPEAKER | HD64461_GPADR_PCMCIA0;
  38. outw(v, HD64461_GPADR);
  39. outw(HD64461_PCCGCR_VCC0 | HD64461_PCCSCR_VCC1, HD64461_PCC0GCR);
  40. #ifndef CONFIG_HD64461_ENABLER
  41. outw(HD64461_PCCGCR_VCC0 | HD64461_PCCSCR_VCC1, HD64461_PCC1GCR);
  42. #endif
  43. sh_dac_output(0, DAC_SPEAKER_VOLUME);
  44. sh_dac_disable(DAC_SPEAKER_VOLUME);
  45. v8 = ctrl_inb(DACR);
  46. v8 &= ~DACR_DAE;
  47. ctrl_outb(v8,DACR);
  48. v8 = ctrl_inb(SCPDR);
  49. v8 |= SCPDR_TS_SCAN_X | SCPDR_TS_SCAN_Y;
  50. v8 &= ~SCPDR_TS_SCAN_ENABLE;
  51. ctrl_outb(v8, SCPDR);
  52. v = ctrl_inw(SCPCR);
  53. v &= ~SCPCR_TS_MASK;
  54. v |= SCPCR_TS_ENABLE;
  55. ctrl_outw(v, SCPCR);
  56. return 0;
  57. }