diff mbox

[Branch,~linaro-image-tools/linaro-image-tools/trunk] Rev 400: Add SMDKV310 support to linaro-android-media-create.

Message ID 20110804135914.12058.30273.launchpad@loganberry.canonical.com
State Accepted
Headers show

Commit Message

James Westby Aug. 4, 2011, 1:59 p.m. UTC
Merge authors:
  Angus Ainslie (angus-akkea)
Related merge proposals:
  https://code.launchpad.net/~linaro-landing-team-samsung/linaro-image-tools/add-smdkv310-android-support/+merge/69535
  proposed by: Angus Ainslie (angus-akkea)
  review: Needs Information - James Westby (james-w)
------------------------------------------------------------
revno: 400 [merge]
committer: James Westby <james.westby@linaro.org>
branch nick: trunk
timestamp: Thu 2011-08-04 14:58:02 +0100
message:
  Add SMDKV310 support to linaro-android-media-create.
modified:
  linaro_image_tools/media_create/android_boards.py
  linaro_image_tools/media_create/boards.py


--
lp:linaro-image-tools
https://code.launchpad.net/~linaro-image-tools/linaro-image-tools/trunk

You are subscribed to branch lp:linaro-image-tools.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-image-tools/linaro-image-tools/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'linaro_image_tools/media_create/android_boards.py'
--- linaro_image_tools/media_create/android_boards.py	2011-07-28 00:14:53 +0000
+++ linaro_image_tools/media_create/android_boards.py	2011-08-04 13:58:02 +0000
@@ -26,11 +26,15 @@ 
 
 from linaro_image_tools.media_create.partitions import SECTOR_SIZE
 from linaro_image_tools.media_create.boards import PART_ALIGN_S
+from linaro_image_tools.media_create.boards import SAMSUNG_V310_BL1_START
+from linaro_image_tools.media_create.boards import SAMSUNG_V310_BL2_START
+from linaro_image_tools.media_create.boards import SAMSUNG_V310_BL2_LEN
 from linaro_image_tools.media_create.boards import BeagleConfig
 from linaro_image_tools.media_create.boards import PandaConfig
 from linaro_image_tools.media_create.boards import Mx53LoCoConfig
 from linaro_image_tools.media_create.boards import SnowballSdConfig
 from linaro_image_tools.media_create.boards import SnowballEmmcConfig
+from linaro_image_tools.media_create.boards import SMDKV310Config
 from linaro_image_tools.media_create.boards import (
     align_up,
     align_partition,
@@ -240,10 +244,33 @@ 
     def install_boot_loader(cls, boot_partition, boot_device_or_file):
         install_mx5_boot_loader(os.path.join(boot_device_or_file, "u-boot.imx"), boot_partition, cls.LOADER_MIN_SIZE_S)
 
+
+class AndroidSMDKV310Config(AndroidBoardConfig, SMDKV310Config):
+    _extra_serial_opts = 'console=tty0 console=ttySAC1,115200n8'
+    android_specific_args = 'init=/init androidboot.console=ttySAC1'
+
+    @classmethod
+    def get_sfdisk_cmd(cls, should_align_boot_part=False):
+        loaders_min_len = (
+            SAMSUNG_V310_BL2_START + SAMSUNG_V310_BL2_LEN -
+            SAMSUNG_V310_BL1_START)
+
+        loader_start, loader_end, loader_len = align_partition(
+            1, loaders_min_len, 1, PART_ALIGN_S)
+
+        command = super(AndroidSMDKV310Config, cls).get_sfdisk_cmd(
+            should_align_boot_part=False, start_addr=loader_end,
+            extra_part=True)
+
+        return '%s,%s,0xDA\n%s' % (
+            loader_start, loader_len, command)
+
+
 android_board_configs = {
     'beagle': AndroidBeagleConfig,
     'panda': AndroidPandaConfig,
     'snowball_sd': AndroidSnowballSdConfig,
     'snowball_emmc': AndroidSnowballEmmcConfig,
+    'smdkv310': AndroidSMDKV310Config,
     'iMX53': AndroidMx53LoCoConfig,
     }

=== modified file 'linaro_image_tools/media_create/boards.py'
--- linaro_image_tools/media_create/boards.py	2011-07-26 15:20:56 +0000
+++ linaro_image_tools/media_create/boards.py	2011-07-28 01:02:24 +0000
@@ -1042,6 +1042,20 @@ 
             'u-boot.bin')
         return uboot_file
 
+
+    @classmethod
+    def populate_raw_partition(cls, chroot_dir, boot_device_or_file):
+        # Populate created raw partition with BL1, env and u-boot
+        spl_file = os.path.join(chroot_dir, 'boot', 'u-boot-mmc-spl.bin')
+        assert os.path.getsize(spl_file) <= (SAMSUNG_V310_BL1_LEN * SECTOR_SIZE), (
+            "%s is larger than SAMSUNG_V310_BL1_LEN" % spl_file)
+        _dd(spl_file, boot_device_or_file, seek=SAMSUNG_V310_BL1_START)
+        uboot_file = os.path.join(chroot_dir, 'boot', 'u-boot.bin')
+        assert os.path.getsize(uboot_file) <= (SAMSUNG_V310_BL2_LEN * SECTOR_SIZE), (
+            "%s is larger than SAMSUNG_V310_BL2_LEN" % uboot_file)
+        _dd(uboot_file, boot_device_or_file, seek=SAMSUNG_V310_BL2_START)
+
+
     @classmethod
     def install_samsung_boot_loader(cls, chroot_dir, boot_device_or_file):
         spl_file = cls._get_samsung_spl(chroot_dir)