2010年11月16日火曜日

mini2440で最新Kernelを使う

新しいカーネルを使いたくなって色々調べてみた。

1.まず、今現在のmini2440ターゲットでビルド成功してるか確認してみる。
http://armlinux.simtec.co.uk/kautobuild/mini2440_defconfig.html

2.新Kernelについて話題の上がっているスレッドに
Mini2440用のパッチ1~11まで抜き出した添付ファイルがあるので眺めてみる。
http://www.friendlyarm.net/forum/topic/1094

(何箇所か重複してる箇所はあるので注意)
http://lkml.org/lkml/2010/11/8/121
http://lkml.org/lkml/2010/11/8/114
http://lkml.org/lkml/2010/11/8/106
http://lists.infradead.org/pipermail/linux-arm-kernel/2010-November/030950.html
http://lists.infradead.org/pipermail/linux-arm-kernel/2010-November/030848.html
http://lists.infradead.org/pipermail/linux-arm-kernel/2010-November/030861.html

---
0001-S3C-Add-a-flag-to-allow-leds-to-start-on.patch
0002-MINI2440-Enable-the-backlight-LED-earlier-at-boot-ti.patch
0003-920T-Use-specific-920t-mtune.patch
0004-S3C-Backported-the-s3c2410-touchscreen-from-openmoko.patch
0005-S3C-Backported-openmoko-s-touchscreen-filters.patch
0006-MINI2440-Updated-machine-defconfig-for-2.6.32.patch
0007-MINI2440-Added-missing-config-flag.patch
0008-MINI2440-Added-new-T35-QVGA-and-Innolux-5.6-VGA-TFTs.patch
0009-MINI2440-Rename-the-SoC-tty-names.patch
0010-MINI2440-Add-touchscreen-support.patch
0011-MINI2440-remove-__initdata-from-some-structs.patch
---

3.パッチ当て
http://www.kernel.org/pub/linux/kernel/v2.6/testing/ChangeLog-2.6.37-rc1
これを見る限りメインラインにもMini2440用パッチが何かしら入っているので、
1つずつ自分で当てていく。
・パッチメモ
マージする:1~3
(OpenMokoのライセンス知らないので)マージしない:4~5
パッチ済:7
マージする:8~11


4.ビルド
$ CROSS_COMPILE=arm-linux- ARCH=arm make O=../kernel-bin/ mini2440_defconfig
$ CROSS_COMPILE=arm-linux- ARCH=arm make O=../kernel-bin/ menuconfig
$ CROSS_COMPILE=arm-linux- ARCH=arm make O=../kernel-bin/
$ ~/emv/uboot/mini2440/tools/mkimage -A arm -O linux -T kernel -C none -a 0x30008000 -e 0x30008000 -d ../kernel-bin/arch/arm/boot/zImage uImage
$ CROSS_COMPILE=arm-linux- ARCH=arm make O=../kernel-bin/ INSTALL_MOD_PATH=../kernel-modules modules_install

Kernelイメージ作成完了。

確認したKernelバージョンは2.6.36、2.6.37-rc1

-----
追記
2.6.37RC2が出たので早速ビルド。
細かいパッチはタッチパネル以外
1~3、9、11と、メインラインに報告済みパッチを当てた。
当たっていないパッチは4~6,10で6はdefconfigなのであまり気にしなくておk。

今回あてたパッチ内容はこんな感じ。
・T35液晶と5.6インチ液晶対応
・起動時バックライトON
・シリアルコンソールのデバイス名変更(ttySAC)
・__initdataの削除
(タッチパネル対応パッチは除いてある)

diff -crN ./linux-2.6.37-rc2-orig/arch/arm/Makefile ./linux-2.6.37-rc2/arch/arm/Makefile
*** ./linux-2.6.37-rc2-orig/arch/arm/Makefile 2010-11-15 18:31:02.000000000 -0800
--- ./linux-2.6.37-rc2/arch/arm/Makefile 2010-11-16 23:52:28.904009998 -0800
***************
*** 78,84 ****
  tune-$(CONFIG_CPU_ARM9TDMI) :=-mtune=arm9tdmi
  tune-$(CONFIG_CPU_ARM940T) :=-mtune=arm9tdmi
  tune-$(CONFIG_CPU_ARM946E) :=$(call cc-option,-mtune=arm9e,-mtune=arm9tdmi)
! tune-$(CONFIG_CPU_ARM920T) :=-mtune=arm9tdmi
  tune-$(CONFIG_CPU_ARM922T) :=-mtune=arm9tdmi
  tune-$(CONFIG_CPU_ARM925T) :=-mtune=arm9tdmi
  tune-$(CONFIG_CPU_ARM926T) :=-mtune=arm9tdmi
--- 78,84 ----
  tune-$(CONFIG_CPU_ARM9TDMI) :=-mtune=arm9tdmi
  tune-$(CONFIG_CPU_ARM940T) :=-mtune=arm9tdmi
  tune-$(CONFIG_CPU_ARM946E) :=$(call cc-option,-mtune=arm9e,-mtune=arm9tdmi)
! tune-$(CONFIG_CPU_ARM920T) :=-mtune=arm920t
  tune-$(CONFIG_CPU_ARM922T) :=-mtune=arm9tdmi
  tune-$(CONFIG_CPU_ARM925T) :=-mtune=arm9tdmi
  tune-$(CONFIG_CPU_ARM926T) :=-mtune=arm9tdmi
diff -crN ./linux-2.6.37-rc2-orig/arch/arm/mach-s3c2410/include/mach/leds-gpio.h ./linux-2.6.37-rc2/arch/arm/mach-s3c2410/include/mach/leds-gpio.h
*** ./linux-2.6.37-rc2-orig/arch/arm/mach-s3c2410/include/mach/leds-gpio.h 2010-11-15 18:31:02.000000000 -0800
--- ./linux-2.6.37-rc2/arch/arm/mach-s3c2410/include/mach/leds-gpio.h 2010-11-16 23:58:02.868010000 -0800
***************
*** 16,21 ****
--- 16,22 ----
  
  #define S3C24XX_LEDF_ACTLOW (1<<0)  /* LED is on when GPIO low */
  #define S3C24XX_LEDF_TRISTATE (1<<1)  /* tristate to turn off */
+ #define S3C24XX_LEDF_STARTON (1<<2)  /* Initialise 'on' */
  
  struct s3c24xx_led_platdata {
   unsigned int   gpio;
diff -crN ./linux-2.6.37-rc2-orig/arch/arm/mach-s3c2440/mach-mini2440.c ./linux-2.6.37-rc2/arch/arm/mach-s3c2440/mach-mini2440.c
*** ./linux-2.6.37-rc2-orig/arch/arm/mach-s3c2440/mach-mini2440.c 2010-11-15 18:31:02.000000000 -0800
--- ./linux-2.6.37-rc2/arch/arm/mach-s3c2440/mach-mini2440.c 2010-11-17 02:01:55.304009999 -0800
***************
*** 47,52 ****
--- 47,53 ----
  #include <plat/iic.h>
  #include <plat/mci.h>
  #include <plat/udc.h>
+ #include <plat/ts.h>
  
  #include <linux/mtd/mtd.h>
  #include <linux/mtd/nand.h>
***************
*** 62,68 ****
  
  #define MACH_MINI2440_DM9K_BASE (S3C2410_CS4 + 0x300)
  
! static struct map_desc mini2440_iodesc[] __initdata = {
   /* nothing to declare, move along */
  };
  
--- 63,69 ----
  
  #define MACH_MINI2440_DM9K_BASE (S3C2410_CS4 + 0x300)
  
! static struct map_desc mini2440_iodesc[] = {
   /* nothing to declare, move along */
  };
  
***************
*** 71,77 ****
  #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
  
  
! static struct s3c2410_uartcfg mini2440_uartcfgs[] __initdata = {
   [0] = {
    .hwport      = 0,
    .flags      = 0,
--- 72,78 ----
  #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
  
  
! static struct s3c2410_uartcfg mini2440_uartcfgs[] = {
   [0] = {
    .hwport      = 0,
    .flags      = 0,
***************
*** 115,121 ****
   }
  }
  
! static struct s3c2410_udc_mach_info mini2440_udc_cfg __initdata = {
   .udc_command  = mini2440_udc_pullup,
  };
  
--- 116,122 ----
   }
  }
  
! static struct s3c2410_udc_mach_info mini2440_udc_cfg = {
   .udc_command  = mini2440_udc_pullup,
  };
  
***************
*** 185,190 ****
--- 186,215 ----
    .lcdcon5 = (S3C2410_LCDCON5_FRM565 |
         S3C2410_LCDCON5_HWSWP),
   },
+  [3] = { /* mini2440 + 3.5" TFT + TS -- New model as Nov 2009 "T35" */  
+   _LCD_DECLARE(  
+    7,   /* The 3.5 is quite fast */  
+    240, 21, 25, 6,  /* x timing */  
+    320, 2, 4, 2,  /* y timing */  
+    40),   /* refresh rate */  
+   .lcdcon5 = (S3C2410_LCDCON5_FRM565 |  
+     S3C2410_LCDCON5_INVVLINE |  
+     S3C2410_LCDCON5_INVVFRAME |  
+     S3C2410_LCDCON5_INVVDEN |  
+     S3C2410_LCDCON5_PWREN),  
+  },  
+  [4] = { /* mini2440 + 5.6" TFT + touchscreen -- Innolux AT056TN52 */  
+   /* be sure the "power" jumper is set accordingly ! */  
+   _LCD_DECLARE(  
+    10,   /* the 5.3" runs slower */  
+    640, 41, 68, 22, /* x timing */  
+    480, 26, 6, 2,  /* y timing */  
+    40),   /* refresh rate */  
+   .lcdcon5 = (S3C2410_LCDCON5_FRM565 |  
+     S3C2410_LCDCON5_INVVLINE |  
+     S3C2410_LCDCON5_INVVFRAME |  
+     S3C2410_LCDCON5_PWREN),  
+  },  
  };
  
  /* todo - put into gpio header */
***************
*** 234,240 ****
  
  /* MMC/SD  */
  
! static struct s3c24xx_mci_pdata mini2440_mmc_cfg __initdata = {
     .gpio_detect   = S3C2410_GPG(8),
     .gpio_wprotect = S3C2410_GPH(8),
     .set_power     = NULL,
--- 259,265 ----
  
  /* MMC/SD  */
  
! static struct s3c24xx_mci_pdata mini2440_mmc_cfg = {
     .gpio_detect   = S3C2410_GPG(8),
     .gpio_wprotect = S3C2410_GPH(8),
     .set_power     = NULL,
***************
*** 243,249 ****
  
  /* NAND Flash on MINI2440 board */
  
! static struct mtd_partition mini2440_default_nand_part[] __initdata = {
   [0] = {
    .name = "u-boot",
    .size = SZ_256K,
--- 268,274 ----
  
  /* NAND Flash on MINI2440 board */
  
! static struct mtd_partition mini2440_default_nand_part[] = {
   [0] = {
    .name = "u-boot",
    .size = SZ_256K,
***************
*** 268,274 ****
   },
  };
  
! static struct s3c2410_nand_set mini2440_nand_sets[] __initdata = {
   [0] = {
    .name  = "nand",
    .nr_chips = 1,
--- 293,299 ----
   },
  };
  
! static struct s3c2410_nand_set mini2440_nand_sets[] = {
   [0] = {
    .name  = "nand",
    .nr_chips = 1,
***************
*** 431,436 ****
--- 456,462 ----
  static struct s3c24xx_led_platdata mini2440_led_backlight_pdata = {
   .name  = "backlight",
   .gpio  = S3C2410_GPG(4),
+  .flags  = S3C24XX_LEDF_STARTON,
   .def_trigger = "backlight",
  };
  
***************
*** 499,512 ****
   .page_size = 16,
  };
  
! static struct i2c_board_info mini2440_i2c_devs[] __initdata = {
   {
    I2C_BOARD_INFO("24c08", 0x50),
    .platform_data = &at24c08,
   },
  };
  
! static struct platform_device *mini2440_devices[] __initdata = {
   &s3c_device_ohci,
   &s3c_device_wdt,
   &s3c_device_i2c0,
--- 525,543 ----
   .page_size = 16,
  };
  
! static struct i2c_board_info mini2440_i2c_devs[] = {
   {
    I2C_BOARD_INFO("24c08", 0x50),
    .platform_data = &at24c08,
   },
  };
  
! static struct s3c2410_ts_mach_info mini2440_ts_cfg = {  
!  .delay = 10000,  
!  .presc = 0xff, /* slow as we can go */  
! };  
! 
! static struct platform_device *mini2440_devices[] = {
   &s3c_device_ohci,
   &s3c_device_wdt,
   &s3c_device_i2c0,
***************
*** 522,527 ****
--- 553,559 ----
   &s3c_device_sdi,
   &s3c_device_iis,
   &mini2440_audio,
+  &s3c_device_adc,
  };
  
  static void __init mini2440_map_io(void)
***************
*** 605,612 ****
     features->done |= FEATURE_BACKLIGHT;
     break;
    case 't':
!    printk(KERN_INFO "MINI2440: '%c' ignored, "
!     "touchscreen not compiled in\n", f);
     break;
    case 'c':
     if (features->done & FEATURE_CAMERA)
--- 637,649 ----
     features->done |= FEATURE_BACKLIGHT;
     break;
    case 't':
!       if (features->done & FEATURE_TOUCH)  
!         printk(KERN_INFO "MINI2440: '%c' ignored, "  
!           "touchscreen already set\n", f);  
!       else  
!         features->optional[features->count++] =  
!            &s3c_device_ts;  
!       features->done |= FEATURE_TOUCH; 
     break;
    case 'c':
     if (features->done & FEATURE_CAMERA)
***************
*** 677,682 ****
--- 714,720 ----
   s3c24xx_mci_set_platdata(&mini2440_mmc_cfg);
   s3c_nand_set_platdata(&mini2440_nand_info);
   s3c_i2c0_set_platdata(NULL);
+  s3c24xx_ts_set_platdata(&mini2440_ts_cfg);
  
   i2c_register_board_info(0, mini2440_i2c_devs,
      ARRAY_SIZE(mini2440_i2c_devs));
diff -crN ./linux-2.6.37-rc2-orig/drivers/leds/leds-s3c24xx.c ./linux-2.6.37-rc2/drivers/leds/leds-s3c24xx.c
*** ./linux-2.6.37-rc2-orig/drivers/leds/leds-s3c24xx.c 2010-11-15 18:31:02.000000000 -0800
--- ./linux-2.6.37-rc2/drivers/leds/leds-s3c24xx.c 2010-11-16 23:51:47.716010000 -0800
***************
*** 85,90 ****
--- 85,91 ----
   led->cdev.default_trigger = pdata->def_trigger;
   led->cdev.name = pdata->name;
   led->cdev.flags |= LED_CORE_SUSPENDRESUME;
+  led->cdev.brightness = pdata->flags & S3C24XX_LEDF_STARTON ? 1 : 0;
  
   led->pdata = pdata;
  
***************
*** 95,101 ****
    s3c2410_gpio_cfgpin(pdata->gpio, S3C2410_GPIO_INPUT);
   } else {
    s3c2410_gpio_pullup(pdata->gpio, 0);
!   s3c2410_gpio_setpin(pdata->gpio, 0);
    s3c2410_gpio_cfgpin(pdata->gpio, S3C2410_GPIO_OUTPUT);
   }
  
--- 96,103 ----
    s3c2410_gpio_cfgpin(pdata->gpio, S3C2410_GPIO_INPUT);
   } else {
    s3c2410_gpio_pullup(pdata->gpio, 0);
!   /* backlight led needs to be turned on early on */
!   s3c2410_gpio_setpin(pdata->gpio, led->cdev.brightness);
    s3c2410_gpio_cfgpin(pdata->gpio, S3C2410_GPIO_OUTPUT);
   }
  
diff -crN ./linux-2.6.37-rc2-orig/drivers/serial/samsung.c ./linux-2.6.37-rc2/drivers/serial/samsung.c
*** ./linux-2.6.37-rc2-orig/drivers/serial/samsung.c 2010-11-15 18:31:02.000000000 -0800
--- ./linux-2.6.37-rc2/drivers/serial/samsung.c 2010-11-17 01:54:39.248009997 -0800
***************
*** 883,889 ****
  
  static struct uart_driver s3c24xx_uart_drv = {
   .owner  = THIS_MODULE,
!  .dev_name = "s3c2410_serial",
   .nr  = CONFIG_SERIAL_SAMSUNG_UARTS,
   .cons  = S3C24XX_SERIAL_CONSOLE,
   .driver_name = S3C24XX_SERIAL_NAME,
--- 883,889 ----
  
  static struct uart_driver s3c24xx_uart_drv = {
   .owner  = THIS_MODULE,
!  .dev_name = S3C24XX_SERIAL_NAME,
   .nr  = CONFIG_SERIAL_SAMSUNG_UARTS,
   .cons  = S3C24XX_SERIAL_CONSOLE,
   .driver_name = S3C24XX_SERIAL_NAME,
diff -crN ./linux-2.6.37-rc2-orig/sound/soc/s3c24xx/Kconfig ./linux-2.6.37-rc2/sound/soc/s3c24xx/Kconfig
*** ./linux-2.6.37-rc2-orig/sound/soc/s3c24xx/Kconfig 2010-11-15 18:31:02.000000000 -0800
--- ./linux-2.6.37-rc2/sound/soc/s3c24xx/Kconfig 2010-11-16 17:32:14.572010082 -0800
***************
*** 2,7 ****
--- 2,8 ----
   tristate "SoC Audio for the Samsung S3CXXXX chips"
   depends on ARCH_S3C2410 || ARCH_S3C64XX || ARCH_S5PC100 || ARCH_S5PV210
   select S3C64XX_DMA if ARCH_S3C64XX
+  select S3C2410_DMA if ARCH_S3C2410
   help
     Say Y or M if you want to add support for codecs attached to
     the S3C24XX AC97 or I2S interfaces. You will also need to
コメントを投稿

Androider