From patchwork Mon Mar 25 15:14:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fathi Boudra X-Patchwork-Id: 15600 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 D9BB723E0E for ; Mon, 25 Mar 2013 15:14:14 +0000 (UTC) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com [209.85.215.42]) by fiordland.canonical.com (Postfix) with ESMTP id 60FD0A19421 for ; Mon, 25 Mar 2013 15:14:14 +0000 (UTC) Received: by mail-la0-f42.google.com with SMTP id fe20so11632425lab.1 for ; Mon, 25 Mar 2013 08:14:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:content-type:mime-version:x-launchpad-project :x-launchpad-branch:x-launchpad-message-rationale :x-launchpad-branch-revision-number:x-launchpad-notification-type:to :from:subject:message-id:date:reply-to:sender:errors-to:precedence :x-generated-by:x-launchpad-hash:x-gm-message-state; bh=ETcMDN/0/Ab8UjY72NgML+FKe6i5CIJz7iXBXyk7MRQ=; b=Tfug1YbmOxnqhsQSNYV5iIad+NI92PDyK9Fk87vyu3qnrjqzPJXInPsqtEKcnb9Osu rwPJY3D76/M+oc0f58wrTPVM3VEq4g4YK/Ht1yeBV+ItgbOy3wbt6GhDkTGurj3dvMis vCs2pXat3MLUPi3BuS6FUknqcVq2yCju/GLrheOuw7KwSbrLMRPmma7vHluuhlREQKzo YPBXRn4XolGN7XAtjccFxSX7GesFa0475MHAGB8t7JMBPRu5r608Y8bzWP4Q1E9cvEx7 lDXgCNc4WaRoxTuF0y+AFhSOL2ZjxMUb1BQjfqsL8kAkyChLUMobWsn8UFjlRp1vI3Mr ltAg== X-Received: by 10.112.79.1 with SMTP id f1mr6433847lbx.114.1364224453932; Mon, 25 Mar 2013 08:14:13 -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.112.147.5 with SMTP id tg5csp52994lbb; Mon, 25 Mar 2013 08:14:13 -0700 (PDT) X-Received: by 10.180.7.133 with SMTP id j5mr18298453wia.15.1364224453113; Mon, 25 Mar 2013 08:14:13 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id jc8si7189473wic.58.2013.03.25.08.14.12 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 25 Mar 2013 08:14:13 -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 1UK96C-0006ld-Gd for ; Mon, 25 Mar 2013 15:14:12 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 6ECD4E04E7 for ; Mon, 25 Mar 2013 15:14:12 +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: 612 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-image-tools/linaro-image-tools/trunk] Rev 612: Added support for Arndale board on android Message-Id: <20130325151412.23661.26020.launchpad@ackee.canonical.com> Date: Mon, 25 Mar 2013 15:14:12 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="16540"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 017c976cc936a855d1765e5f61443ed42ba0b43c X-Gm-Message-State: ALoCoQlv8KpyG/5jY8oE6QoWsgWoHnINI7GgfwfRtyUcpCzN2XXlGo4KkuSQ0IYikg4MyzI57hpD Merge authors: Milo Casagrande (milo) Related merge proposals: https://code.launchpad.net/~milo/linaro-image-tools/bug1158772/+merge/155231 proposed by: Milo Casagrande (milo) review: Approve - Fathi Boudra (fboudra) review: Approve - James Tunnicliffe (dooferlad) ------------------------------------------------------------ revno: 612 [merge] committer: Fathi Boudra branch nick: linaro-image-tools timestamp: Mon 2013-03-25 17:12:37 +0200 message: Added support for Arndale board on android modified: linaro_image_tools/media_create/android_boards.py linaro_image_tools/media_create/boards.py linaro_image_tools/media_create/tests/test_android_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 2013-02-17 13:53:41 +0000 +++ linaro_image_tools/media_create/android_boards.py 2013-03-25 12:51:45 +0000 @@ -35,6 +35,7 @@ from linaro_image_tools.hwpack.hwpack_fields import FORMAT_FIELD from linaro_image_tools.media_create.partitions import SECTOR_SIZE from linaro_image_tools.media_create.boards import ( + ArndaleConfig, BeagleConfig, BoardConfig, BoardConfigException, @@ -51,6 +52,8 @@ align_up, install_mx5_boot_loader, make_boot_script, + _dd, + BoardException, ) from linaro_image_tools.utils import DEFAULT_LOGGER_NAME @@ -496,6 +499,42 @@ self._android_specific_args = 'init=/init androidboot.console=ttyAMA0' +class AndroidArndaleConfig(AndroidSamsungConfig, ArndaleConfig): + """Placeholder class for Arndale configuration inheritance.""" + def __init__(self): + super(AndroidArndaleConfig, self).__init__() + self.mmc_option = '0:1' + self.kernel_addr = '0x40007000' + self.initrd_addr = '0x41000000' + self.dtb_addr = '0x41f00000' + self.dtb_name = 'exynos5250-arndale.dtb' + self._android_specific_args = ('init=/init ' + 'androidboot.console=ttySAC2 console=ttySAC2 ' + 'initrd=%s' % self.initrd_addr) + self._extra_serial_options = 'ttySAC2,115200n8' + self._extra_boot_args_options = 'rootdelay=3' + + def populate_raw_partition(self, boot_device_or_file, chroot_dir): + boot_bin_0 = {'name': 'arndale-bl1.bin', 'seek': 1} + boot_bin_1 = {'name': 'u-boot-mmc-spl.bin', 'seek': 17} + boot_bin_2 = {'name': 'u-boot.bin', 'seek': 49} + boot_bins = [boot_bin_0, boot_bin_1, boot_bin_2] + + boot_partition = 'boot' + + # Zero the env so that the boot_script will get loaded + _dd("/dev/zero", boot_device_or_file, count=self.samsung_env_len, + seek=self.samsung_env_start) + + for boot_bin in boot_bins: + name = boot_bin['name'] + file_path = os.path.join(chroot_dir, boot_partition, name) + if not os.path.exists(file_path): + raise BoardException("File '%s' does not exists. Cannot " + "proceed." % name) + _dd(file_path, boot_device_or_file, seek=boot_bin['seek']) + + # This dictionary is composed as follows: # : # The is the command line argument passed to l-a-m-c, the @@ -503,6 +542,7 @@ # If a new device does not have special needs, it is possible to use the # general AndroidBoardConfig class. android_board_configs = { + 'arndale': AndroidArndaleConfig, 'beagle': AndroidBeagleConfig, 'iMX53': AndroidMx53LoCoConfig, 'mx53loco': AndroidMx53LoCoConfig, === modified file 'linaro_image_tools/media_create/boards.py' --- linaro_image_tools/media_create/boards.py 2013-03-21 10:50:08 +0000 +++ linaro_image_tools/media_create/boards.py 2013-03-25 12:52:08 +0000 @@ -533,9 +533,9 @@ if d_img_data is not None: assert self.dtb_addr is not None, ( "Need a dtb_addr when passing d_img_data") - boot_script += ( - ("%(fatload_command)s mmc %(mmc_option)s %(dtb_addr)s " + - "board.dtb; ")) % replacements + boot_script += (("%(fatload_command)s mmc %(mmc_option)s " + "%(dtb_addr)s ")) % replacements + boot_script += "%s; " % d_img_data boot_script += (("bootm %(kernel_addr)s")) % replacements if i_img_data is not None: boot_script += ((" %(initrd_addr)s")) % replacements === modified file 'linaro_image_tools/media_create/tests/test_android_boards.py' --- linaro_image_tools/media_create/tests/test_android_boards.py 2013-02-18 13:05:58 +0000 +++ linaro_image_tools/media_create/tests/test_android_boards.py 2013-03-25 12:52:28 +0000 @@ -481,3 +481,18 @@ 'fdt_high': '0xffffffff', 'initrd_high': '0xffffffff'} self.assertBootEnv(expected, board='mx53loco') + + def test_android_arndale_old(self): + """Test that uses values taken directly from the class. """ + expected = { + 'bootargs': 'ttySAC2,115200n8 rootwait ro rootdelay=3 ' + 'init=/init androidboot.console=ttySAC2 ' + 'console=ttySAC2 initrd=0x41000000', + 'bootcmd': 'fatload mmc 0:1 0x40007000 uImage; fatload mmc 0:1 ' + '0x41000000 uInitrd; fatload mmc 0:1 0x41f00000 ' + 'exynos5250-arndale.dtb; bootm 0x40007000 0x41000000 ' + '0x41f00000', + 'fdt_high': '0xffffffff', + 'initrd_high': '0xffffffff', + } + self.assertBootEnv(expected, board='arndale') === modified file 'linaro_image_tools/media_create/tests/test_media_create.py' --- linaro_image_tools/media_create/tests/test_media_create.py 2013-03-21 10:50:08 +0000 +++ linaro_image_tools/media_create/tests/test_media_create.py 2013-03-25 12:52:28 +0000 @@ -2002,7 +2002,7 @@ 'root=UUID=deadbeef rootwait ro', 'bootcmd': 'fatload mmc 0:2 0x90000000 uImage; ' 'fatload mmc 0:2 0x92000000 uInitrd; ' - 'fatload mmc 0:2 0x91ff0000 board.dtb; ' + 'fatload mmc 0:2 0x91ff0000 mx51.dtb; ' 'bootm 0x90000000 0x92000000 0x91ff0000', 'fdt_high': '0xffffffff', 'initrd_high': '0xffffffff'} @@ -2126,7 +2126,7 @@ 'mem=456M@0x80000000 mem=512M@0xA0000000', 'bootcmd': 'fatload mmc 0:1 0x80200000 uImage; ' 'fatload mmc 0:1 0x81600000 uInitrd; ' - 'fatload mmc 0:1 0x815f0000 board.dtb; ' + 'fatload mmc 0:1 0x815f0000 panda.dtb; ' 'bootm 0x80200000 0x81600000 0x815f0000', 'fdt_high': '0xffffffff', 'initrd_high': '0xffffffff'} @@ -2149,7 +2149,7 @@ 'omapfb.mode=dvi:1280x720MR-16@60 mpurate=${mpurate}', 'bootcmd': 'fatload mmc 0:1 0x80000000 uImage; ' 'fatload mmc 0:1 0x81600000 uInitrd; ' - 'fatload mmc 0:1 0x815f0000 board.dtb; ' + 'fatload mmc 0:1 0x815f0000 beagle.dtb; ' 'bootm 0x80000000 0x81600000 0x815f0000', 'fdt_high': '0xffffffff', 'initrd_high': '0xffffffff'} @@ -2172,7 +2172,7 @@ 'omapfb.mode=dvi:1280x720MR-16@60 mpurate=${mpurate}', 'bootcmd': 'fatload mmc 0:1 0x80000000 uImage; ' 'fatload mmc 0:1 0x81600000 uInitrd; ' - 'fatload mmc 0:1 0x815f0000 board.dtb; ' + 'fatload mmc 0:1 0x815f0000 igep.dtb; ' 'bootm 0x80000000 0x81600000 0x815f0000', 'fdt_high': '0xffffffff', 'initrd_high': '0xffffffff'} @@ -2196,7 +2196,7 @@ 'omapfb.mode=dvi:${dvimode}', 'bootcmd': 'fatload mmc 0:1 0x80000000 uImage; ' 'fatload mmc 0:1 0x81600000 uInitrd; ' - 'fatload mmc 0:1 0x815f0000 board.dtb; ' + 'fatload mmc 0:1 0x815f0000 overo.dtb; ' 'bootm 0x80000000 0x81600000 0x815f0000', 'fdt_high': '0xffffffff', 'initrd_high': '0xffffffff'}