Alberto Embedded & Open experience

Notes on my experience on Open Source Embedded Systems

Archive for December 2009

Git clone with local references

leave a comment »

In this post I explain how to clone a remote git repository basing it on a local one.

If you work with the Linux kernel  there are so many different repositories for developing, so when you are asked to base your patch series on branch x of repo y, if you follow those rules you don’t have the need to re download the n-est Linux kernel repository!

First: You must have a clean linus repository!

Saying the project root dir for developing is $PRJROOT we can setup a clean linus repo with:

$ cd $PRJROOT
$ mkdir kernel-linus
$ cd kernel-linus
$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git

Second: clone a remote repository referencing the local linus one:

The parameter –reference in the git clone command make what we need

$ cd $PRJROOT
$ mkdir kernel-mfd
$ cd kernel-mfd
$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6.git \
  --reference ../kernel-linus/linux-2.6/

Pay attention that the default behaviour for git in local referencing is to setup a .git/objects/info/alternates to share the objects with the source repository, resulting in much more space occupied but deleting old objects  in the new one, deletes the same in the old one that is not always a good thing.

So only go ahead in referenced local repositories 🙂

Bye!

Alberto!

Advertisements

Written by Alberto!

11/12/2009 at 6:03 pm

Posted in Git

Tagged with , ,

NAND Flash Support

leave a comment »

In the CPU board there is a 2 Gb NAND Flash chip organized in :

1 Device = (2K+64)Bytes x 64Pages x 2048 Blocks = 2112Mbits

This chip is connected to the i.MX31 Application Processor through the Nand Flash Controller Interface with an 8 bit data bus. The in kernel driver “drivers/mtd/nand/mxc_nand.c” can easily support it registering the nand device in the machine code with the follow platform data:

static struct mxc_nand_platform_data imx31pdk_nand_flash_pdata = {
       .width          = 1, /* 1 Byte data bus */
       .hw_ecc         = 1, /* No suppress hardware ECC */
};

The mxc_nand.c driver is enabled by default with a $ make mx3_defconfig

What can be enabled is the MTD Partitioning support with support for RedBoot partition table parsing where the Location of RedBoot partition table is the number of the Flash page where it is stored the RedBoot “FIS directory” that for me start at 0x80000, so it is the fourth page (4).

The resulting patch:

Subject: [PATCH 2/2] MXC: imx31pdk: Add support for on board NAND Flash.

Signed-off-by: Alberto Panizzo <alberto.panizzo@gmail.com>
---
arch/arm/mach-mx3/mx31pdk.c |   10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-mx3/mx31pdk.c b/arch/arm/mach-mx3/mx31pdk.c
index 0f7a2f0..ca1fe5d 100644
--- a/arch/arm/mach-mx3/mx31pdk.c
+++ b/arch/arm/mach-mx3/mx31pdk.c
@@ -34,6 +34,7 @@
#include <mach/board-mx31pdk.h>
#include <mach/imx-uart.h>
#include <mach/iomux-mx3.h>
+#include <mach/mxc_nand.h>
#include "devices.h"

/*!
@@ -53,6 +54,14 @@ static int mx31pdk_pins[] = {
IOMUX_MODE(MX31_PIN_GPIO1_1, IOMUX_CONFIG_GPIO),
};

+/*
+ * NAND Flash
+ */
+static struct mxc_nand_platform_data imx31pdk_nand_flash_pdata = {
+    .width        = 1,
+    .hw_ecc        = 1,
+};
+
static struct imxuart_platform_data uart_pdata = {
.flags = IMXUART_HAVE_RTSCTS,
};
@@ -241,6 +250,7 @@ static void __init mxc_board_init(void)
"mx31pdk");

mxc_register_device(&mxc_uart_device0, &uart_pdata);
+    mxc_register_device(&mxc_nand_device, &imx31pdk_nand_flash_pdata);

if (!mx31pdk_init_expio())
platform_device_register(&smsc911x_device);
--
1.6.3.3

Written by Alberto!

04/12/2009 at 4:45 pm

Posted in imx31pdk

Tagged with , ,

imx31pdk Initial Support path

leave a comment »

On the imx31 PDK CPU board there are mainly those chips:

Device Description Connected through
Application processor:
i.MX31
RAM Memory:
128 MB (1 Gb) DDR
iMX31 EMI
NAND Flash:
256 MB (2 Gb)
iMX31 NFC
Power Management and Audio IC:
MC13783
iMX31 SPI2
USB transceiver:
ISP 1504
iMX31 USB OTG

RAM memory is native managed by the iMX31 External Memory Interface, then the first chip that can be supported is the NAND Flash. Then we must to go through the support for the Power management chip to go ahead with all other devices because MC13783 hold the entire power supply management, with its Regulator interface.

Written by Alberto!

04/12/2009 at 4:12 pm

Posted in imx31pdk

Tagged with , , ,

i.MX 31 PDK developing

leave a comment »

In those days I am involved in supporting the Freescale i.MX PDK developing board in the mainline kernel.

This is not a simple job because there are (at first seeing) a lot of holes in mainline kernel.

Stay tuned for news!

Written by Alberto!

04/12/2009 at 11:12 am

Posted in imx31pdk

Tagged with ,