From patchwork Thu Aug 25 10:03:11 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mattias Backman X-Patchwork-Id: 3670 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 89CA523FA2 for ; Thu, 25 Aug 2011 10:03:16 +0000 (UTC) Received: from mail-yx0-f180.google.com (mail-yx0-f180.google.com [209.85.213.180]) by fiordland.canonical.com (Postfix) with ESMTP id 37860A184FB for ; Thu, 25 Aug 2011 10:03:16 +0000 (UTC) Received: by yxi11 with SMTP id 11so2267254yxi.11 for ; Thu, 25 Aug 2011 03:03:15 -0700 (PDT) Received: by 10.150.98.4 with SMTP id v4mr2006ybb.326.1314266594504; Thu, 25 Aug 2011 03:03:14 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.151.27.20 with SMTP id e20cs231369ybj; Thu, 25 Aug 2011 03:03:13 -0700 (PDT) Received: by 10.227.195.8 with SMTP id ea8mr1358338wbb.91.1314266592110; Thu, 25 Aug 2011 03:03:12 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com [91.189.90.7]) by mx.google.com with ESMTPS id b20si1085459wbh.92.2011.08.25.03.03.11 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 25 Aug 2011 03:03:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) smtp.mail=bounces@canonical.com Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1QwWmF-00017k-AO for ; Thu, 25 Aug 2011 10:03:11 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 46362E0286 for ; Thu, 25 Aug 2011 10:03:11 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: linaro-image-tools X-Launchpad-Branch: ~linaro-image-tools/linaro-image-tools/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 427 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-image-tools/linaro-image-tools/trunk] Rev 427: Add Origen support to linaro-android-media-create and also zero the u-boot env area on the SD car... Message-Id: <20110825100311.25169.67709.launchpad@ackee.canonical.com> Date: Thu, 25 Aug 2011 10:03:11 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="13779"; Instance="initZopeless config overlay" X-Launchpad-Hash: 2945b19c0936c6804aeb4c2c090d424ed862978b Merge authors: Angus Ainslie (angus-akkea) Mattias Backman (mabac) Related merge proposals: https://code.launchpad.net/~linaro-landing-team-samsung/linaro-image-tools/add-origen-android-support/+merge/72465 proposed by: Angus Ainslie (angus-akkea) review: Needs Fixing - Mattias Backman (mabac) ------------------------------------------------------------ revno: 427 [merge] committer: Mattias Backman branch nick: linaro-image-tools timestamp: Thu 2011-08-25 11:57:46 +0200 message: Add Origen support to linaro-android-media-create and also zero the u-boot env area on the SD card so that an old env doesn't get used. modified: linaro_image_tools/media_create/android_boards.py linaro_image_tools/media_create/boards.py linaro_image_tools/media_create/tests/test_media_create.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 === modified file 'linaro_image_tools/media_create/android_boards.py' --- linaro_image_tools/media_create/android_boards.py 2011-08-04 13:58:02 +0000 +++ linaro_image_tools/media_create/android_boards.py 2011-08-24 14:47:20 +0000 @@ -35,6 +35,7 @@ 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 OrigenConfig from linaro_image_tools.media_create.boards import ( align_up, align_partition, @@ -245,9 +246,7 @@ 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' +class AndroidSamsungConfig(AndroidBoardConfig): @classmethod def get_sfdisk_cmd(cls, should_align_boot_part=False): @@ -258,7 +257,7 @@ loader_start, loader_end, loader_len = align_partition( 1, loaders_min_len, 1, PART_ALIGN_S) - command = super(AndroidSMDKV310Config, cls).get_sfdisk_cmd( + command = super(AndroidSamsungConfig, cls).get_sfdisk_cmd( should_align_boot_part=False, start_addr=loader_end, extra_part=True) @@ -266,6 +265,16 @@ loader_start, loader_len, command) +class AndroidSMDKV310Config(AndroidSamsungConfig, SMDKV310Config): + _extra_serial_opts = 'console=tty0 console=ttySAC1,115200n8' + android_specific_args = 'init=/init androidboot.console=ttySAC1' + + +class AndroidOrigenConfig(AndroidSamsungConfig, OrigenConfig): + _extra_serial_opts = 'console=tty0 console=ttySAC2,115200n8' + android_specific_args = 'init=/init androidboot.console=ttySAC2' + + android_board_configs = { 'beagle': AndroidBeagleConfig, 'panda': AndroidPandaConfig, @@ -273,4 +282,5 @@ 'snowball_emmc': AndroidSnowballEmmcConfig, 'smdkv310': AndroidSMDKV310Config, 'iMX53': AndroidMx53LoCoConfig, + 'origen': AndroidOrigenConfig, } === modified file 'linaro_image_tools/media_create/boards.py' --- linaro_image_tools/media_create/boards.py 2011-08-24 14:05:56 +0000 +++ linaro_image_tools/media_create/boards.py 2011-08-25 09:57:46 +0000 @@ -1089,7 +1089,10 @@ @classmethod def populate_raw_partition(cls, chroot_dir, boot_device_or_file): - # Populate created raw partition with BL1, env and u-boot + # Zero the env so that the boot_script will get loaded + _dd("/dev/zero", boot_device_or_file, count=SAMSUNG_V310_ENV_LEN, + seek=SAMSUNG_V310_ENV_START) + # Populate created raw partition with BL1 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) === modified file 'linaro_image_tools/media_create/tests/test_media_create.py' --- linaro_image_tools/media_create/tests/test_media_create.py 2011-08-24 14:04:45 +0000 +++ linaro_image_tools/media_create/tests/test_media_create.py 2011-08-25 09:57:46 +0000 @@ -1130,6 +1130,12 @@ '1318912,-,E\n1318912,1048576,L\n2367488,,,-', android_boards.AndroidPandaConfig.get_sfdisk_cmd()) + def test_origen_android(self): + self.assertEqual( + '1,8191,0xDA\n8253,270274,0x0C,*\n278528,524288,L\n' \ + '802816,-,E\n802816,524288,L\n1327104,1048576,L\n2375680,,,-', + android_boards.AndroidOrigenConfig.get_sfdisk_cmd()) + def test_snowball_emmc_android(self): self.assertEqual( '256,7936,0xDA\n8192,262144,0x0C,*\n270336,524288,L\n' \ @@ -1340,6 +1346,18 @@ self.assertEqual(expected, boot_commands) + def test_android_origen(self): + boot_commands = (android_boards.AndroidOrigenConfig. + _get_boot_env(consoles=[])) + expected = { + 'bootargs': 'console=tty0 console=ttySAC2,115200n8 ' + 'rootwait ro init=/init androidboot.console=ttySAC2', + 'bootcmd': 'fatload mmc 0:2 0x40007000 uImage; ' + 'fatload mmc 0:2 0x42000000 uInitrd; ' + 'bootm 0x40007000 0x42000000'} + self.assertEqual(expected, boot_commands) + + class TestUnpackBinaryTarball(TestCaseWithFixtures): def setUp(self):