I made a l-m-c patch to add imx51 support.  I need your help to review
and merge the code.

-- 
Regards,
Shawn


# Begin patch
=== modified file 'linaro-media-create'
--- linaro-media-create 2010-09-28 18:53:19 +0000
+++ linaro-media-create 2010-09-30 00:36:30 +0000
@@ -62,6 +62,7 @@
     * beagle
     * igep
     * vexpress
+    * imx51

 Additional/Optional options:
 -h --help
@@ -274,7 +275,16 @@
 }

 install_hwpack() {
-  ensure_command qemu-arm-static qemu-arm-static
+  # Check host architecture
+  arch_is_arm=false
+  arch_str=`uname -m`
+  if [[ "$arch_str" == arm* ]]; then
+    arch_is_arm=true
+  fi
+
+  if [ ! $arch_is_arm ]; then
+    ensure_command qemu-arm-static qemu-arm-static
+  fi

   chroot=${DIR}/binary
   # Make sure we unmount /proc in the chroot or else it can't be moved to the
@@ -291,7 +301,9 @@
   sudo mv -f ${chroot}/etc/hosts ${TMP_DIR}/hosts.orig
   sudo cp /etc/hosts ${chroot}/etc/hosts

-  sudo cp /usr/bin/qemu-arm-static ${chroot}/usr/bin
+  if [ ! $arch_is_arm ]; then
+    sudo cp /usr/bin/qemu-arm-static ${chroot}/usr/bin
+  fi
   sudo cp $LINARO_HWPACK_INSTALL ${chroot}/usr/bin
   sudo cp "$HWPACK_FILE" "$chroot"

@@ -304,7 +316,9 @@
   sudo umount ${chroot}/proc
   sudo mv -f ${TMP_DIR}/resolv.conf.orig ${chroot}/etc/resolv.conf
   sudo mv -f ${TMP_DIR}/hosts.orig ${chroot}/etc/hosts
-  sudo rm -f ${chroot}/usr/bin/qemu-arm-static
+  if [ ! $arch_is_arm ]; then
+    sudo rm -f ${chroot}/usr/bin/qemu-arm-static
+  fi
   sudo rm -f ${chroot}/usr/bin/linaro-hwpack-install
   sudo rm -f ${chroot}/$(basename "$HWPACK_FILE")
 }
@@ -371,10 +385,17 @@

   # Create a VFAT or FAT16 partition of 9 cylinders which is about 64M
   # and a linux partition of the rest
+  if [ "$DEVIMAGE" = imx51 ]; then
+  sudo sfdisk -D -H $HEADS -S $SECTORS $CYLINDER_ARG $partdev << THEEND
+1,9,$PARTITION_TYPE,*
+10,,,-
+THEEND
+  else
   sudo sfdisk -D -H $HEADS -S $SECTORS $CYLINDER_ARG $partdev << THEEND
 ,9,$PARTITION_TYPE,*
 ,,,-
 THEEND
+  fi

   if [ "${IMAGE_FILE}" ]; then
   VFATOFFSET=$(($(fdisk -l -u $IMAGE_FILE | grep FAT | awk '{print $3}')*512))
@@ -458,6 +479,24 @@
            "${BOOT_DISK}/uInitrd"
       ;;

+    imx51)
+      sudo dd if=binary/usr/lib/u-boot/mx51evk/u-boot.imx
of=/dev/mmcblk0 bs=512 seek=2
+      sync
+      sudo mkimage -A arm -O linux -T kernel -C none -a 0x90008000 -e
0x90008000 \
+           -n Linux -d "${DIR}/binary/${parts_dir}"/vmlinuz*-mx51
"${BOOT_DISK}/uImage"
+      sudo mkimage -A arm -O linux -T ramdisk -C none -a 0 \
+           -e 0 -n initramfs \
+           -d "${DIR}/binary/${parts_dir}"/initrd.img-*-linaro-mx51 \
+           "${BOOT_DISK}/uInitrd"
+      cat > ${TMP_DIR}/boot.cmd << BOOTCMD
+setenv bootcmd 'fatload mmc 0:1 0x90000000 uImage; fatload mmc 0:1
0x90800000 uInitrd; bootm 0x90000000 0x90800000'
+setenv bootargs '${serial_opts} ${splash_opts} ${lowmem_opt}
${boot_snippet} rootwait ro'
+boot
+BOOTCMD
+      sudo mkimage -A arm -O linux -T script -C none -a 0 \
+           -e 0 -n "$CODENAME 10.05" -d "${TMP_DIR}/boot.cmd" \
+           "${BOOT_DISK}/boot.scr"
+      ;;
     *)
       echo "Internal error; missing support for $DEVIMAGE" >&2
       exit 1
@@ -561,7 +600,7 @@
 fi

 case "$DEVIMAGE" in
-  beagle|igep|vexpress)
+  beagle|igep|vexpress|imx51)
     :
   ;;
   "")
@@ -591,6 +630,12 @@
       # only allows for FAT16
       FAT_SIZE=16
       ;;
+    imx51)
+      serial_opts="$serial_opts console=tty0 console=ttymxc0,115200n8"
+      if [ "$IS_LIVE" ]; then
+        serial_opts="$serial_opts serialtty=ttymxc0"
+      fi
+      ;;
     *)
       echo "Internal error; missing support for $DEVIMAGE" >&2
       exit 1

Attachment: lmc-imx51-support.bundle
Description: Binary data

_______________________________________________
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev

Reply via email to