setup.c 1.3 KB

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