Thursday, April 7, 2011

Linux kernel 2.6.37.2 on a UTU2440-S

  • S3C2440 clone board from youtiyou. Basically made by YC corporation. Low cost board around 120$ (without LCD) and comes with standard Linux 2.6.2x . Specification available here S3C2440 Board.
  • The good part is this board comes with both a USB host and a slave. Requirement was to investigate some USB client devices ie USB HID devices like Keyboard, mouse,etc.
  • Linux kernel 2.6.37.2  has updated USB GHID drivers and more stable stuff.
  • Porting is usually a big exercise, sometimes involves a couple of months for all drivers, etc.
  • Downloaded gcc from CodeSourcery version 4.5.1 (gcc version 4.5.1  Sourcery G++ Lite 2010.09-50) 
  • Downloaded the latest 37 kernel and tried a make s3c2410_defconfig
  • Setup a tftp server and downloaded the uImage that was generated. The kernel failed to boot saying unknown machine type. Basically the machine type is reported by the bootloader, in this case uboot.
  • In /include/generated/mach-types.h, changed MACH_TYPE_SMDK2410 from 193 to 5244, the type UTU is as defined in the uboot.
  • Recompiled and copied a few of the init code snippets into linux/arch/arm/mach-s3c2410
    • file mach-smdk2410.c: stuff like flash partition information, nand configuration, usb device config, registering the USB gadget platform code (as specified in the USB gadget readme in linux/doc). 
    • Had to comment out smdk_machine_init which tries to configure flash in an smdk standard way
    • Did not put in the ethernet or the lcd parts, as there was no interest in it. 
  • Used tftp to download the image thus: tftp 30000000 uImage and followed by a bootm.
  • And  Linux 2.6.37  booted and finally gave up cos it did not find the yaffs2 filesystem support that the utu board has as default. Root is yaffs2 based.
  • Used git to clone yaffs2. yaffs2 isnt part of the standard kernel. Used a script called "patch-ker.sh" from the yaffs2 git code to patch the  kernel and enabled yaffs2 in the kernel filesystem.
  • Recompiled and Linux kernel 2.6.37.2 with rootfs booted and was able to login to the machine and use it for my needs.
  • A teeny bit of happiness in under 30 minutes !

No comments:

Post a Comment