uncompress.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:1k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /*
  2.  * linux/include/asm-arm/arch-nexuspci/uncompress.h
  3.  *
  4.  * Copyright (C) 1998, 1999, 2000 Philip Blundell
  5.  */
  6. /*
  7.  * This program is free software; you can redistribute it and/or
  8.  * modify it under the terms of the GNU General Public License
  9.  * as published by the Free Software Foundation; either version
  10.  * 2 of the License, or (at your option) any later version.
  11.  */
  12. #include <asm/hardware.h>
  13. #include <asm/io.h>
  14. /*
  15.  * Write a character to the UART
  16.  */
  17. void _ll_write_char(char c)
  18. {
  19. while (!(__raw_readb(DUART_START + 0x4) & 0x4))
  20. barrier();
  21. __raw_writeb(c, DUART_START + 0xc);
  22. }
  23. /*
  24.  * This does not append a newline
  25.  */
  26. static void puts(const char *s)
  27. {
  28. while (*s) {
  29. if (*s == 'n')
  30. _ll_write_char('r');
  31. _ll_write_char(*(s++));
  32. }
  33. }
  34. /*
  35.  * Set up for decompression
  36.  */
  37. static void arch_decomp_setup(void)
  38. {
  39. /* LED off */
  40. __raw_writel(INTCONT_LED, INTCONT_START);
  41. /* Set up SCC */
  42. __raw_writeb(42, DUART_START + 8);
  43. __raw_writeb(48, DUART_START + 8);
  44. __raw_writeb(16, DUART_START + 8);
  45. __raw_writeb(0x93, DUART_START);
  46. __raw_writeb(0x17, DUART_START);
  47. __raw_writeb(0xbb, DUART_START + 4);
  48. __raw_writeb(0x78, DUART_START + 16);
  49. __raw_writeb(0xa0, DUART_START + 8);
  50. __raw_writeb(5, DUART_START + 8);
  51. }
  52. /*
  53.  * Stroke the watchdog so we don't get reset during decompression.
  54.  */
  55. static inline void arch_decomp_wdog(void)
  56. {
  57. __raw_writel(INTCONT_WATCHDOG, INTCONT_START);
  58. __raw_writel(INTCONT_WATCHDOG | 1, INTCONT_START);
  59. }