[Balloon-svn] r1911 - balloon/branches/menuconfig2/package/k…

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: subversion@balloonboard.org
Date:  
To: balloon-svn
Subject: [Balloon-svn] r1911 - balloon/branches/menuconfig2/package/kernel/patches/2.6.39.4
Author: nick
Date: 2012-06-22 14:18:23 +0100 (Fri, 22 Jun 2012)
New Revision: 1911

Modified:
balloon/branches/menuconfig2/package/kernel/patches/2.6.39.4/spi_tt.patch
Log:
add sl40b options to spi interface

Modified: balloon/branches/menuconfig2/package/kernel/patches/2.6.39.4/spi_tt.patch
===================================================================
--- balloon/branches/menuconfig2/package/kernel/patches/2.6.39.4/spi_tt.patch    2012-06-22 13:16:05 UTC (rev 1910)
+++ balloon/branches/menuconfig2/package/kernel/patches/2.6.39.4/spi_tt.patch    2012-06-22 13:18:23 UTC (rev 1911)
@@ -1,8 +1,8 @@
 Index: linux-2.6.39.4/drivers/spi/Kconfig
 ===================================================================
---- linux-2.6.39.4.orig/drivers/spi/Kconfig    2012-06-01 13:17:47.000000000 +0100
-+++ linux-2.6.39.4/drivers/spi/Kconfig    2012-06-01 13:18:00.000000000 +0100
-@@ -386,6 +386,21 @@
+--- linux-2.6.39.4.orig/drivers/spi/Kconfig    2011-08-03 20:43:28.000000000 +0100
++++ linux-2.6.39.4/drivers/spi/Kconfig    2012-06-21 16:54:51.000000000 +0100
+@@ -386,6 +386,26 @@
        SPI driver for the Topcliff PCH (Platform Controller Hub) SPI bus
        used in some x86 embedded processors.


@@ -21,13 +21,18 @@
 +    depends on SPI_TT
 +    default n
 +
++config SPI_SL40
++    bool "SPI controller for SL40"
++    depends on SPI_TT
++    default n
++
  config SPI_TXX9
      tristate "Toshiba TXx9 SPI controller"
      depends on GENERIC_GPIO && CPU_TX49XX
 Index: linux-2.6.39.4/drivers/spi/Makefile
 ===================================================================
---- linux-2.6.39.4.orig/drivers/spi/Makefile    2012-06-01 13:17:47.000000000 +0100
-+++ linux-2.6.39.4/drivers/spi/Makefile    2012-06-01 13:18:00.000000000 +0100
+--- linux-2.6.39.4.orig/drivers/spi/Makefile    2011-08-03 20:43:28.000000000 +0100
++++ linux-2.6.39.4/drivers/spi/Makefile    2012-06-21 16:16:05.000000000 +0100
 @@ -54,6 +54,7 @@
  obj-$(CONFIG_SPI_SH_MSIOF)        += spi_sh_msiof.o
  obj-$(CONFIG_SPI_STMP3XXX)        += spi_stmp.o
@@ -39,7 +44,7 @@
 Index: linux-2.6.39.4/drivers/spi/spi_tt.c
 ===================================================================
 --- /dev/null    1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.39.4/drivers/spi/spi_tt.c    2012-06-01 13:18:00.000000000 +0100
++++ linux-2.6.39.4/drivers/spi/spi_tt.c    2012-06-22 09:22:08.000000000 +0100
 @@ -0,0 +1,293 @@
 +/*
 + * Copyright 20011 Toby Churchill Ltd
@@ -101,10 +106,10 @@
 +    int n = SPI_MAX_WAIT;
 +
 +    if ( spi->chip_select == SPI_TT_DEVICE_RTC) {
-+        while(n & !(samosa_read8(SAMOSA_ADDR_SPI_STATUS) & RTC_SPI_STATUS_READY_BIT))
++        while(n & !(samosa_read8(SAMOSA_ADDR_SPI_STATUS) & (1 << RTC_SPI_STATUS_READY_BIT)))
 +            n--; }
 +    else {
-+        while(n & !(samosa_read8(SAMOSA_ADDR_SPI_STATUS) & SPI_STATUS_READY_BIT))
++        while(n & !(samosa_read8(SAMOSA_ADDR_SPI_STATUS) & (1 << SPI_STATUS_READY_BIT)))
 +            n--;
 +    }
 +    if (!n)
@@ -337,13 +342,33 @@
 Index: linux-2.6.39.4/include/linux/spi/spi_tt.h
 ===================================================================
 --- /dev/null    1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.39.4/include/linux/spi/spi_tt.h    2012-06-01 13:18:00.000000000 +0100
-@@ -0,0 +1,69 @@
++++ linux-2.6.39.4/include/linux/spi/spi_tt.h    2012-06-21 16:55:55.000000000 +0100
+@@ -0,0 +1,92 @@
 +#ifndef SPI_TT_H
 +#define SPI_TT_H
 +
 +#include "mach/balloon3.h"
 +
++#ifdef CONFIG_SPI_SL40
++
++#define SAMOSA_ADDR_SPI_DATA 0x046
++#define SAMOSA_ADDR_SPI_STATUS 0x047
++#define SAMOSA_ADDR_RTC_SPI_DATA 0x049
++#define SAMOSA_ADDR_CONTROL_REG_2_CLR 0x52
++#define SAMOSA_ADDR_CONTROL_REG_2_SET 0x53
++#define SAMOSA_ADDR_CONTROL_REG_3_CLR 0x54
++#define SAMOSA_ADDR_CONTROL_REG_3_SET 0x55
++#define SAMOSA_ADDR_USB_CHG_REG_CLR 0x56
++#define SAMOSA_ADDR_USB_CHG_REG_SET 0x57
++#define SAMOSA_ADDR_USB_CHG_REG_STATUS 0x56
++
++#define SAMOSA_ADDR_INT_DISABLE 0x04c
++#define SAMOSA_ADDR_INT_ENABLE 0x04d
++#define SAMOSA_ADDR_INT_STATUS 0x04f
++#define SAMOSA_ADDR_INT_CLEAR 0x04f
++
++#else
++
 +#define SAMOSA_ADDR_SPI_DATA 0x06
 +#define SAMOSA_ADDR_SPI_STATUS 0x07
 +#define SAMOSA_ADDR_RTC_SPI_DATA 0x09
@@ -354,13 +379,16 @@
 +#define SAMOSA_ADDR_USB_CHG_REG_CLR 0x16
 +#define SAMOSA_ADDR_USB_CHG_REG_SET 0x17
 +#define SAMOSA_ADDR_USB_CHG_REG_STATUS 0x16
-+#define SAMOSA_ADDR_VERSION_REG 0xff
 +
 +#define SAMOSA_ADDR_INT_DISABLE 0x0c
 +#define SAMOSA_ADDR_INT_ENABLE 0x0d
 +#define SAMOSA_ADDR_INT_STATUS 0x0f
 +#define SAMOSA_ADDR_INT_CLEAR 0x0f
 +
++#endif
++
++#define SAMOSA_ADDR_VERSION_REG 0xff
++
 +#define SAMOSA_SPI_INT_MASK 7
 +
 +// SAMOSA_ADDR_SPI_STATUS
@@ -410,8 +438,8 @@
 +#endif
 Index: linux-2.6.39.4/arch/arm/mach-pxa/balloon3.c
 ===================================================================
---- linux-2.6.39.4.orig/arch/arm/mach-pxa/balloon3.c    2012-06-01 13:18:00.000000000 +0100
-+++ linux-2.6.39.4/arch/arm/mach-pxa/balloon3.c    2012-06-01 13:18:00.000000000 +0100
+--- linux-2.6.39.4.orig/arch/arm/mach-pxa/balloon3.c    2012-06-21 16:16:04.000000000 +0100
++++ linux-2.6.39.4/arch/arm/mach-pxa/balloon3.c    2012-06-22 09:54:44.000000000 +0100
 @@ -54,6 +54,12 @@
  #include <mach/irda.h>
  #include <mach/ohci.h>
@@ -464,14 +492,14 @@
  /******************************************************************************
   * FPGA IRQ
   ******************************************************************************/
-+#if defined(CONFIG_SPI_TT) || defined(CONFIG_SPI_TT_MODULE)
 +static void balloon3_ack_irq(struct irq_data *d)
 +{
 +    int balloon3_irq = (d->irq - BALLOON3_IRQ(0));
++#if defined(CONFIG_SPI_TT) || defined(CONFIG_SPI_TT_MODULE)
 +//    pr_info("%s: irq %d, writing %d to %d\n",__func__,balloon3_irq, (1 <<balloon3_irq), SAMOSA_ADDR_INT_CLEAR);
 +    samosa_write8(SAMOSA_ADDR_INT_CLEAR ,1 << balloon3_irq);
++#endif // CONFIG_SPI_TT
 +}
-+#endif // CONFIG_SPI_TT
 +
  static void balloon3_mask_irq(struct irq_data *d)
  {
@@ -555,7 +583,7 @@
  }


/******************************************************************************
-@@ -1006,6 +1077,60 @@
+@@ -1006,6 +1077,64 @@
static inline void balloon3_pmic_init(void) {}
#endif

@@ -592,6 +620,7 @@
 +    },
 +};
 +
++#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
 +static struct spi_board_info spi_lcd_info[] __initdata = {
 +    {
 +        .modalias    = "s6d04k1-spi",
@@ -603,12 +632,15 @@
 +        .mode        = SPI_MODE_3,
 +    },
 +};
++#endif
 +
 +static void __init balloon3_spi_init(void)
 +{
 +    spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
++#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
 +    if (strcmp(lcd,"tt") == 0)
 +        spi_register_board_info(spi_lcd_info, ARRAY_SIZE(spi_lcd_info));
++#endif
 +}
 +#else
 +static void __init balloon3_spi_init(void) {}
@@ -616,7 +648,7 @@


//#define PAC_REG_POWERCONTROL __REG(0x4050024c)

-@@ -1077,6 +1202,19 @@
+@@ -1077,6 +1206,19 @@

      /* switch off RS232 */
      gpio_set_value(BALLOON3_GPIO_RUN_232, 0);
@@ -636,7 +668,7 @@
      asm ( "mov r0,#0x7\n"
          "mcr p14, 0, r0, c7, c0, 0\n"
      );
-@@ -1167,6 +1305,7 @@
+@@ -1167,6 +1309,7 @@
      balloon3_uhc_init();
      balloon3_cf_init();
      balloon3_power_fault_init();