linux-2.6.28: make it bootable and usefull on nokia900
authorDenis 'GNUtoo' Carikli <GNUtoo@no-log.org>
Sat, 25 Sep 2010 20:16:27 +0000 (22:16 +0200)
committerMartin Jansa <Martin.Jansa@gmail.com>
Wed, 27 Oct 2010 21:30:23 +0000 (23:30 +0200)
*crucial boot support(mmc,mmc block devices,and filesystems) are now builtin
*a CMDLINE is now set in the recipe(there is a custom nokia bootloader on the nokia900),
  That is also necessary to boot on microsd
*g_ether is now built, which is required for usbnet
*ondemand cpufreq governor is now the default

*the inconsistent-mmc-fix-2.6.28-20094803.3.diff patch comes from:
    https://bugs.maemo.org/show_bug.cgi?id=2747
  and is necessary to be able to boot on microsd

*there is also a patch that reports the battery capacity which comes from:
    http://my.arava.co.il/~matan/770/n900/bq27x00_battery.c
  That patch should be temporary,and be replcaed by somwthing like that:
Sep 24 18:48:06 <DocScrutinizer51> the bq27200 kernel module is rather rudimentary
Sep 24 18:48:09 <DocScrutinizer51> should be easy to adapt FR bq2700 module to provide same szsfs nodes and just use I2C instead of FIQ+HDQ
Sep 24 18:48:11 <DocScrutinizer51> and that's exactly what I'd recommend to do
(from #openmoko-cdevel on Freenode)

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@no-log.org>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
conf/machine/nokia900.conf
recipes/linux/linux-2.6.28/nokia900/0001-Fix-CPU-frequency-driver-so-that-it-loads-before-the.patch [new file with mode: 0644]
recipes/linux/linux-2.6.28/nokia900/bq27x00_readings.patch [new file with mode: 0644]
recipes/linux/linux-2.6.28/nokia900/defconfig
recipes/linux/linux-2.6.28/nokia900/inconsistent-mmc-fix-2.6.28-20094803.3.diff [new file with mode: 0644]
recipes/linux/linux_2.6.28.bb

index f7543b6..98b46a3 100644 (file)
@@ -41,4 +41,4 @@ module_autoload_g_ether = "g_ether"
 # Copied from include/omap3.inc (as we do not use linux-omap recipes):
 #
 # Increase this everytime you change something in the kernel
-MACHINE_KERNEL_PR = "r53"
+MACHINE_KERNEL_PR = "r54"
diff --git a/recipes/linux/linux-2.6.28/nokia900/0001-Fix-CPU-frequency-driver-so-that-it-loads-before-the.patch b/recipes/linux/linux-2.6.28/nokia900/0001-Fix-CPU-frequency-driver-so-that-it-loads-before-the.patch
new file mode 100644 (file)
index 0000000..df306f7
--- /dev/null
@@ -0,0 +1,26 @@
+From 30b1d92216154c9da2c9c33b6add9c458f98df44 Mon Sep 17 00:00:00 2001
+From: Alistair Buxton <a.j.buxton@gmail.com>
+Date: Wed, 8 Sep 2010 11:51:21 +0100
+Subject: [PATCH] Fix CPU frequency driver so that it loads *before* the things that use it.
+
+Signed-off-by: Alistair Buxton <a.j.buxton@gmail.com>
+---
+ arch/arm/plat-omap/cpu-omap.c |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/arch/arm/plat-omap/cpu-omap.c b/arch/arm/plat-omap/cpu-omap.c
+index 3974680..033a2bb 100644
+--- a/arch/arm/plat-omap/cpu-omap.c
++++ b/arch/arm/plat-omap/cpu-omap.c
+@@ -188,7 +188,7 @@ static int __init omap_cpufreq_init(void)
+       return cpufreq_register_driver(&omap_driver);
+ }
+-late_initcall(omap_cpufreq_init);
++arch_initcall(omap_cpufreq_init);
+ /*
+  * if ever we want to remove this, upon cleanup call:
+-- 
+1.7.0.4
+
diff --git a/recipes/linux/linux-2.6.28/nokia900/bq27x00_readings.patch b/recipes/linux/linux-2.6.28/nokia900/bq27x00_readings.patch
new file mode 100644 (file)
index 0000000..3f91944
--- /dev/null
@@ -0,0 +1,35 @@
+Index: linux-2.6.28/drivers/power/bq27x00_battery.c
+===================================================================
+--- linux-2.6.28.orig/drivers/power/bq27x00_battery.c  2010-09-25 16:57:27.659097996 +0200
++++ linux-2.6.28/drivers/power/bq27x00_battery.c       2010-04-01 16:01:16.000000000 +0200
+@@ -358,6 +358,22 @@
+       .id_table = bq27200_id,
+ };
++struct bq27200_platform_data {
++      int dummy;
++};
++
++static struct bq27200_platform_data bq27200_config = {
++      .dummy = 0,
++};
++
++static struct i2c_board_info rx51_camera_board_info_2 = 
++      {
++              I2C_BOARD_INFO("bq27200", 0x55),
++              .platform_data = &bq27200_config,
++      };
++
++static struct i2c_client *client;
++
+ static int __init bq27x00_battery_init(void)
+ {
+       int ret;
+@@ -365,6 +381,7 @@
+       ret = i2c_add_driver(&bq27200_battery_driver);
+       if (ret)
+               printk(KERN_ERR "Unable to register BQ27200 driver\n");
++      client = i2c_new_device(i2c_get_adapter(2), &rx51_camera_board_info_2);
+       return ret;
+ }
index 88d1e07..d00580f 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
 # Linux kernel version: 2.6.28-omap1
-# Thu Jul  9 09:32:52 2009
+# Sat Oct  9 15:29:13 2010
 #
 CONFIG_ARM=y
 CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -36,7 +36,7 @@ CONFIG_BROKEN_ON_SMP=y
 CONFIG_LOCK_KERNEL=y
 CONFIG_INIT_ENV_ARG_LIMIT=32
 CONFIG_LOCALVERSION=""
-CONFIG_LOCALVERSION_AUTO=y
+# CONFIG_LOCALVERSION_AUTO is not set
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
 CONFIG_SYSVIPC_SYSCTL=y
@@ -45,7 +45,8 @@ CONFIG_BSD_PROCESS_ACCT=y
 # CONFIG_BSD_PROCESS_ACCT_V3 is not set
 # CONFIG_TASKSTATS is not set
 # CONFIG_AUDIT is not set
-# CONFIG_IKCONFIG is not set
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_CGROUPS=y
 # CONFIG_CGROUP_DEBUG is not set
@@ -61,8 +62,7 @@ CONFIG_CGROUP_SCHED=y
 CONFIG_RESOURCE_COUNTERS=y
 CONFIG_MM_OWNER=y
 CONFIG_CGROUP_MEM_RES_CTLR=y
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 # CONFIG_NAMESPACES is not set
 CONFIG_BLK_DEV_INITRD=y
@@ -319,7 +319,7 @@ CONFIG_ALIGNMENT_TRAP=y
 #
 CONFIG_ZBOOT_ROM_TEXT=0x0
 CONFIG_ZBOOT_ROM_BSS=0x0
-CONFIG_CMDLINE="init=/sbin/preinit ubi.mtd=rootfs root=ubi0:rootfs rootfstype=ubifs rootflags=bulk_read,no_chk_data_crc rw console=ttyMTD,log console=tty0 snd-soc-rx51.hp_lim=42 snd-soc-tlv320aic3x.hp_dac_lim=6"
+CONFIG_CMDLINE=" quiet "
 # CONFIG_XIP_KERNEL is not set
 CONFIG_KEXEC=y
 CONFIG_ATAGS_PROC=y
@@ -337,11 +337,11 @@ CONFIG_CPU_FREQ_STAT=y
 CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
 # CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
 # CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
-# CONFIG_CPU_FREQ_GOV_PERFORMANCE is not set
-# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+CONFIG_CPU_FREQ_GOV_POWERSAVE=y
 CONFIG_CPU_FREQ_GOV_USERSPACE=y
 CONFIG_CPU_FREQ_GOV_ONDEMAND=y
-# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
+CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
 CONFIG_CPU_IDLE=y
 CONFIG_CPU_IDLE_GOV_LADDER=y
 CONFIG_CPU_IDLE_GOV_MENU=y
@@ -1250,9 +1250,10 @@ CONFIG_I2C_BCM2048=m
 # Graphics support
 #
 CONFIG_PVR=m
-# CONFIG_DRM_VER_ORIG is not set
-# CONFIG_DRM_VER_TUNGSTEN is not set
-# CONFIG_DRM_TUNGSTEN is not set
+CONFIG_PVR_RELEASE=y
+# CONFIG_PVR_DEBUG is not set
+# CONFIG_PVR_TIMING is not set
+# CONFIG_PVR_EXAMPLES is not set
 # CONFIG_VGASTATE is not set
 # CONFIG_VIDEO_OUTPUT_CONTROL is not set
 CONFIG_FB=y
@@ -1535,8 +1536,9 @@ CONFIG_USB_GADGET_SELECTED=y
 CONFIG_USB_GADGET_DUALSPEED=y
 CONFIG_USB_ZERO=m
 # CONFIG_USB_ZERO_HNPTEST is not set
-# CONFIG_USB_ETH is not set
-# CONFIG_USB_GADGETFS is not set
+CONFIG_USB_ETH=m
+CONFIG_USB_ETH_RNDIS=y
+CONFIG_USB_GADGETFS=m
 CONFIG_USB_FILE_STORAGE=m
 CONFIG_USB_FILE_STORAGE_TEST=y
 # CONFIG_USB_G_SERIAL is not set
@@ -1553,14 +1555,14 @@ CONFIG_USB_OTG_UTILS=y
 # CONFIG_USB_GPIO_VBUS is not set
 # CONFIG_ISP1301_OMAP is not set
 CONFIG_TWL4030_USB=y
-CONFIG_MMC=m
+CONFIG_MMC=y
 # CONFIG_MMC_DEBUG is not set
 CONFIG_MMC_UNSAFE_RESUME=y
 
 #
 # MMC/SD/SDIO Card Drivers
 #
-CONFIG_MMC_BLOCK=m
+CONFIG_MMC_BLOCK=y
 # CONFIG_MMC_BLOCK_BOUNCE is not set
 # CONFIG_SDIO_UART is not set
 # CONFIG_MMC_TEST is not set
@@ -1569,7 +1571,7 @@ CONFIG_MMC_BLOCK=m
 # MMC/SD/SDIO Host Controller Drivers
 #
 # CONFIG_MMC_SDHCI is not set
-CONFIG_MMC_OMAP_HS=m
+CONFIG_MMC_OMAP_HS=y
 # CONFIG_MMC_SPI is not set
 # CONFIG_MEMSTICK is not set
 # CONFIG_ACCESSIBILITY is not set
@@ -1675,13 +1677,13 @@ CONFIG_BRIDGE_MEMPOOL_SIZE=0x412800
 #
 # File systems
 #
-CONFIG_EXT2_FS=m
+CONFIG_EXT2_FS=y
 # CONFIG_EXT2_FS_XATTR is not set
 # CONFIG_EXT2_FS_XIP is not set
-CONFIG_EXT3_FS=m
+CONFIG_EXT3_FS=y
 # CONFIG_EXT3_FS_XATTR is not set
 # CONFIG_EXT4_FS is not set
-CONFIG_JBD=m
+CONFIG_JBD=y
 # CONFIG_JBD_DEBUG is not set
 # CONFIG_REISERFS_FS is not set
 # CONFIG_JFS_FS is not set
diff --git a/recipes/linux/linux-2.6.28/nokia900/inconsistent-mmc-fix-2.6.28-20094803.3.diff b/recipes/linux/linux-2.6.28/nokia900/inconsistent-mmc-fix-2.6.28-20094803.3.diff
new file mode 100644 (file)
index 0000000..0d8b4da
--- /dev/null
@@ -0,0 +1,79 @@
+--- kernel-2.6.28-20094803.3/arch/arm/mach-omap2/board-rx51-flash.c    2010-01-24 23:23:10.000000000 +0100
++++ kernel-2.6.28-20094803.3-fanoush/arch/arm/mach-omap2/board-rx51-flash.c    2010-01-24 22:22:02.000000000 +0100
+@@ -59,6 +59,7 @@ static struct platform_device *rx51_flas
+ static struct twl4030_hsmmc_info mmc[] __initdata = {
+       {
+               .name           = "external",
++              .mmcblk_devidx  = 1,
+               .mmc            = 1,
+               .wires          = 4,
+               .cover_only     = true,
+@@ -69,6 +70,7 @@ static struct twl4030_hsmmc_info mmc[] _
+       },
+       {
+               .name           = "internal",
++              .mmcblk_devidx  = 0,
+               .mmc            = 2,
+               .wires          = 8,
+               .gpio_cd        = -EINVAL,
+--- kernel-2.6.28-20094803.3/arch/arm/mach-omap2/mmc-twl4030.c 2010-01-24 23:23:10.000000000 +0100
++++ kernel-2.6.28-20094803.3-fanoush/arch/arm/mach-omap2/mmc-twl4030.c 2010-01-24 22:59:35.000000000 +0100
+@@ -745,6 +745,7 @@ void __init twl4030_mmc_init(struct twl4
+               else
+                       sprintf(twl->name, "mmc%islot%i", c->mmc, 1);
+               mmc->slots[0].name = twl->name;
++              mmc->slots[0].mmcblk_devidx = c->mmcblk_devidx;
+               mmc->nr_slots = 1;
+               mmc->slots[0].wires = c->wires;
+               mmc->slots[0].internal_clock = !c->ext_clock;
+--- kernel-2.6.28-20094803.3/arch/arm/mach-omap2/mmc-twl4030.h 2010-01-24 23:23:10.000000000 +0100
++++ kernel-2.6.28-20094803.3-fanoush/arch/arm/mach-omap2/mmc-twl4030.h 2010-01-24 22:20:51.000000000 +0100
+@@ -19,6 +19,7 @@ struct twl4030_hsmmc_info {
+       int     gpio_cd;        /* or -EINVAL */
+       int     gpio_wp;        /* or -EINVAL */
+       char    *name;          /* or NULL for default */
++      int     mmcblk_devidx;  /* preferred mmcblkX device index */
+ };
+ #if   defined(CONFIG_TWL4030_CORE) && \
+--- kernel-2.6.28-20094803.3/arch/arm/plat-omap/include/mach/mmc.h     2010-01-24 23:23:10.000000000 +0100
++++ kernel-2.6.28-20094803.3-fanoush/arch/arm/plat-omap/include/mach/mmc.h     2010-01-24 22:53:59.000000000 +0100
+@@ -110,6 +110,7 @@ struct omap_mmc_platform_data {
+               int (* get_cover_state)(struct device *dev, int slot);
+               const char *name;
++              int mmcblk_devidx; /* preferred mmcblkX index for this slot */
+               u32 ocr_mask;
+               /* Card detection IRQs */
+--- kernel-2.6.28-20094803.3/drivers/mmc/card/block.c  2010-01-24 23:23:09.000000000 +0100
++++ kernel-2.6.28-20094803.3-fanoush/drivers/mmc/card/block.c  2010-01-24 22:14:12.000000000 +0100
+@@ -479,7 +479,7 @@ static struct mmc_blk_data *mmc_blk_allo
+       struct mmc_blk_data *md;
+       int devidx, ret;
+-      devidx = find_first_zero_bit(dev_use, MMC_NUM_MINORS);
++      devidx = find_next_zero_bit(dev_use, MMC_NUM_MINORS, card->host->mmcblk_devidx);
+       if (devidx >= MMC_NUM_MINORS)
+               return ERR_PTR(-ENOSPC);
+       __set_bit(devidx, dev_use);
+--- kernel-2.6.28-20094803.3/drivers/mmc/host/omap_hsmmc.c     2010-01-24 23:23:09.000000000 +0100
++++ kernel-2.6.28-20094803.3-fanoush/drivers/mmc/host/omap_hsmmc.c     2010-01-25 12:27:07.000000000 +0100
+@@ -1710,6 +1710,7 @@ static int __init omap_hsmmc_probe(struc
+       mmc->max_seg_size = mmc->max_req_size;
+       mmc->ocr_avail = mmc_slot(host).ocr_mask;
++      mmc->mmcblk_devidx = mmc_slot(host).mmcblk_devidx;
+       mmc->caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED;
+       if (mmc_slot(host).wires >= 8)
+--- kernel-2.6.28-20094803.3/include/linux/mmc/host.h  2010-01-24 23:23:10.000000000 +0100
++++ kernel-2.6.28-20094803.3-fanoush/include/linux/mmc/host.h  2010-01-24 22:12:20.000000000 +0100
+@@ -207,7 +207,7 @@ struct mmc_host {
+ #endif
+       struct dentry           *debugfs_root;
+-
++      unsigned int            mmcblk_devidx; /* preferred mmc block device index (mmcblkX) */
+       unsigned long           private[0] ____cacheline_aligned;
+ };
index 0a24bcb..04cd548 100644 (file)
@@ -57,7 +57,10 @@ SRC_URI_mini6410 = "${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-2.6.28.tar.b
 SRC_URI_nokia900 = "${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-2.6.28.tar.bz2;name=kernel \
                    http://repository.maemo.org/pool/maemo5.0/free/k/kernel/kernel_2.6.28-20101501+0m5.diff.gz;name=nokiapatch \
                    file://gcc_4.4_endianess_macros.patch \
-                   file://defconfig"
+                   file://inconsistent-mmc-fix-2.6.28-20094803.3.diff \        
+                   file://0001-Fix-CPU-frequency-driver-so-that-it-loads-before-the.patch \
+                   file://bq27x00_readings.patch \     
+                   file://defconfig"
 
 SRC_URI_smartqv7 = "${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-2.6.28.tar.bz2;name=kernel \
        http://gitorious.org/mer-smartq/mer-smartq-kernel/blobs/raw/9714361dc936f8948179df93a5241c46092bde71/drivers/block/tcc/libtnftl/libtnftl_V7014_TCC8900.o_shipped;name=libtnftl \
@@ -73,6 +76,8 @@ do_configure_append_smartqv7 () {
 
 S = "${WORKDIR}/linux-2.6.28/"
 
+CMDLINE_nokia900_shr = "snd-soc-rx51.hp_lim=42 snd-soc-tlv320aic3x.hp_dac_lim=6 console=tty1 root=/dev/mmcblk1p1 rootdelay=10 panic=20"
+
 SRC_URI[kernel.md5sum] = "d351e44709c9810b85e29b877f50968a"
 SRC_URI[kernel.sha256sum] = "ae0d97c55efe7fce01273c97f8152af0deff5541e3bbf5b9ad98689112b54380"
 SRC_URI[stablepatch.md5sum] = "64e6b226f1dc469755d82d0d8b677feb"