Revert "knfsd: avoid overloading the CPU scheduler with enormous load averages"
[safe/jmp/linux-2.6] / drivers / serial / sh-sci.h
index 84cc651..3e2fcf9 100644 (file)
 #elif defined(CONFIG_H8S2678)
 # define SCSCR_INIT(port)          0x30 /* TIE=0,RIE=0,TE=1,RE=1 */
 # define H8300_SCI_DR(ch) *(volatile char *)(P1DR + h8300_sci_pins[ch].port)
+#elif defined(CONFIG_CPU_SUBTYPE_SH7757)
+# define SCSPTR0 0xfe4b0020
+# define SCSPTR1 0xfe4b0020
+# define SCSPTR2 0xfe4b0020
+# define SCIF_ORER 0x0001
+# define SCSCR_INIT(port)      0x38
+# define SCIF_ONLY
 #elif defined(CONFIG_CPU_SUBTYPE_SH7763)
 # define SCSPTR0 0xffe00024 /* 16 bit SCIF */
 # define SCSPTR1 0xffe08024 /* 16 bit SCIF */
     }                                                                  \
   }
 
-#define CPU_SCIF_FNS(name, scif_offset, scif_size)                             \
+#ifdef CONFIG_H8300
+/* h8300 don't have SCIF */
+#define CPU_SCIF_FNS(name)                                             \
+  static inline unsigned int sci_##name##_in(struct uart_port *port)   \
+  {                                                                    \
+    return 0;                                                          \
+  }                                                                    \
+  static inline void sci_##name##_out(struct uart_port *port, unsigned int value) \
+  {                                                                    \
+  }
+#else
+#define CPU_SCIF_FNS(name, scif_offset, scif_size)                     \
   static inline unsigned int sci_##name##_in(struct uart_port *port)   \
   {                                                                    \
     SCI_IN(scif_size, scif_offset);                                    \
   {                                                                    \
     SCI_OUT(scif_size, scif_offset, value);                            \
   }
+#endif
 
 #define CPU_SCI_FNS(name, sci_offset, sci_size)                                \
   static inline unsigned int sci_##name##_in(struct uart_port* port)   \
                 sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size, \
                  h8_sci_offset, h8_sci_size) \
   CPU_SCI_FNS(name, h8_sci_offset, h8_sci_size)
-#define SCIF_FNS(name, sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size)
+#define SCIF_FNS(name, sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size) \
+  CPU_SCIF_FNS(name)
 #elif defined(CONFIG_CPU_SUBTYPE_SH7723) ||\
       defined(CONFIG_CPU_SUBTYPE_SH7724)
         #define SCIx_FNS(name, sh4_scifa_offset, sh4_scifa_size, sh4_scif_offset, sh4_scif_size) \
@@ -549,6 +569,16 @@ static inline int sci_rxd_in(struct uart_port *port)
                return ctrl_inw(SCSPTR2)&0x0001 ? 1 : 0; /* SCIF */
        return 1;
 }
+#elif defined(CONFIG_CPU_SUBTYPE_SH7757)
+static inline int sci_rxd_in(struct uart_port *port)
+{
+       if (port->mapbase == 0xfe4b0000)
+               return ctrl_inw(SCSPTR0) & 0x0001 ? 1 : 0;
+       if (port->mapbase == 0xfe4c0000)
+               return ctrl_inw(SCSPTR1) & 0x0001 ? 1 : 0;
+       if (port->mapbase == 0xfe4d0000)
+               return ctrl_inw(SCSPTR2) & 0x0001 ? 1 : 0;
+}
 #elif defined(CONFIG_CPU_SUBTYPE_SH7760)
 static inline int sci_rxd_in(struct uart_port *port)
 {
@@ -623,7 +653,7 @@ static inline int sci_rxd_in(struct uart_port *port)
 #elif defined(CONFIG_CPU_SUBTYPE_SH5_101) || defined(CONFIG_CPU_SUBTYPE_SH5_103)
 static inline int sci_rxd_in(struct uart_port *port)
 {
-         return sci_in(port, SCSPTR2)&0x0001 ? 1 : 0; /* SCIF */
+         return sci_in(port, SCSPTR)&0x0001 ? 1 : 0; /* SCIF */
 }
 #elif defined(__H8300H__) || defined(__H8300S__)
 static inline int sci_rxd_in(struct uart_port *port)