From patchwork Thu Apr 4 09:33:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fathi Boudra X-Patchwork-Id: 15900 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 40BF723DEE for ; Thu, 4 Apr 2013 09:33:17 +0000 (UTC) Received: from mail-vb0-f72.google.com (mail-vb0-f72.google.com [209.85.212.72]) by fiordland.canonical.com (Postfix) with ESMTP id B3BDDA180A3 for ; Thu, 4 Apr 2013 09:33:16 +0000 (UTC) Received: by mail-vb0-f72.google.com with SMTP id 11sf2211999vbe.11 for ; Thu, 04 Apr 2013 02:33:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-beenthere:x-received:received-spf:x-received :x-forwarded-to:x-forwarded-for:delivered-to:x-received:received-spf :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:x-original-sender :x-original-authentication-results:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe :content-type; bh=JgYz5Q8LvzmxYmCAsKFSMP9SHDd1IYwq2PbqfbSCleg=; b=Zr+6uwn68EySscQc2ey5qnlY+4sWhjcpfJ02o224FgdV7yLc5ziMcbp3PaOGjhBzyj bVYR6R4WcDRtyCaiRvh2hMmZ+65QYAIj9uQ3h3r+Rkjp75we7NeeqnephYivHilJLE1e 5RDPix9zQNJn3DWpx3xB/ZcPOFahjA9SqnteivQEBcdjxbKTaGPLIGMbUYJrpY5Xg7cI /XofCmoCzAPFprTUWx4aPinNtFwPjciW7atG2DCdHNn4wopfd+nPnbF/WcXCVcRJ1Wbq MkYDVnJ06hIkYvwpoBM+f25PQTimmvyN4xRs4szTvJxF67W3ESi81VmCopqDm3EZO5ua SMmQ== X-Received: by 10.224.110.68 with SMTP id m4mr2973568qap.2.1365067996239; Thu, 04 Apr 2013 02:33:16 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.61.105 with SMTP id o9ls1393461qer.70.gmail; Thu, 04 Apr 2013 02:33:16 -0700 (PDT) X-Received: by 10.58.143.116 with SMTP id sd20mr4073754veb.39.1365067996098; Thu, 04 Apr 2013 02:33:16 -0700 (PDT) Received: from mail-vb0-x22e.google.com (mail-vb0-x22e.google.com [2607:f8b0:400c:c02::22e]) by mx.google.com with ESMTPS id cr8si7695542vdc.116.2013.04.04.02.33.15 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 04 Apr 2013 02:33:16 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::22e is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c02::22e; Received: by mail-vb0-f46.google.com with SMTP id 11so1120368vbe.5 for ; Thu, 04 Apr 2013 02:33:15 -0700 (PDT) X-Received: by 10.59.4.101 with SMTP id cd5mr4128031ved.14.1365067995826; Thu, 04 Apr 2013 02:33:15 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.85.136 with SMTP id h8csp207557vez; Thu, 4 Apr 2013 02:33:15 -0700 (PDT) X-Received: by 10.180.13.233 with SMTP id k9mr3557582wic.6.1365067994749; Thu, 04 Apr 2013 02:33:14 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id i16si8210410wiw.105.2013.04.04.02.33.14 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 04 Apr 2013 02:33:14 -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; Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1UNgXi-00012U-5n for ; Thu, 04 Apr 2013 09:33:14 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 0D285E00A8 for ; Thu, 4 Apr 2013 09:33:14 +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: 619 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-image-tools/linaro-image-tools/trunk] Rev 619: Add Highbank (Calxeda) support Message-Id: <20130404093314.720.83201.launchpad@ackee.canonical.com> Date: Thu, 04 Apr 2013 09:33:14 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: list X-Generated-By: Launchpad (canonical.com); Revision="16550"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 39ebff611f445031c54b7a03bb065a0b68e30bc6 X-Gm-Message-State: ALoCoQmsPpHgy0uhGhJQfEYBbDgiKXTh5ZwG7NaqxwOUOGX1QtLUlOyRNHekybSd7nUUP65dKb/Q X-Original-Sender: noreply@launchpad.net X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::22e is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Merge authors: Fathi Boudra (fboudra) Related merge proposals: https://code.launchpad.net/~fboudra/linaro-image-tools/highbank-support/+merge/157044 proposed by: Fathi Boudra (fboudra) review: Approve - Milo Casagrande (milo) ------------------------------------------------------------ revno: 619 [merge] committer: Fathi Boudra branch nick: linaro-image-tools timestamp: Thu 2013-04-04 12:31:47 +0300 message: Add Highbank (Calxeda) support modified: linaro_image_tools/media_create/boards.py linaro_image_tools/media_create/partitions.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/boards.py' --- linaro_image_tools/media_create/boards.py 2013-04-03 15:12:24 +0000 +++ linaro_image_tools/media_create/boards.py 2013-04-04 08:12:38 +0000 @@ -169,6 +169,8 @@ self.extra_boot_args_options = None self.fat_size = 32 self.fatload_command = 'fatload' + self.load_interface = 'mmc' + self.bootfs_type = 'vfat' self.fdt_high = '0xffffffff' self.hardwarepack_handler = None self.hwpack_format = None @@ -448,13 +450,17 @@ :param should_align_boot_part: Whether to align the boot partition too. - This returns a boot vfat partition of type FAT16 - or FAT32, followed by a root partition. + This returns a boot partition of type FAT16 or FAT32 or Linux, + followed by a root partition. """ - if self.fat_size == 32: - partition_type = '0x0C' + + if self.bootfs_type == 'vfat': + if self.fat_size == 32: + partition_type = '0x0C' + else: + partition_type = '0x0E' else: - partition_type = '0x0E' + partition_type = '0x83' # align on sector 63 for compatibility with broken versions of x-loader # unless align_boot_part is set @@ -522,23 +528,26 @@ replacements = dict( fatload_command=self.fatload_command, uimage_path=self.uimage_path, mmc_option=self.mmc_option, kernel_addr=self.kernel_addr, - initrd_addr=self.initrd_addr, dtb_addr=self.dtb_addr) + initrd_addr=self.initrd_addr, dtb_addr=self.dtb_addr, + load_interface=self.load_interface) + boot_script = ( - ("%(fatload_command)s mmc %(mmc_option)s %(kernel_addr)s " + - "%(uimage_path)suImage; ")) % replacements + ("%(fatload_command)s %(load_interface)s %(mmc_option)s " + "%(kernel_addr)s %(uimage_path)suImage; ")) % replacements if i_img_data is not None: boot_script += ( - ("%(fatload_command)s mmc %(mmc_option)s %(initrd_addr)s " + - "%(uimage_path)suInitrd; ")) % replacements + ("%(fatload_command)s %(load_interface)s %(mmc_option)s " + "%(initrd_addr)s %(uimage_path)suInitrd; ")) % replacements 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 %(load_interface)s %(mmc_option)s " + "%(dtb_addr)s board.dtb; ")) % replacements boot_script += (("bootm %(kernel_addr)s")) % replacements if i_img_data is not None: boot_script += ((" %(initrd_addr)s")) % replacements - if d_img_data is not None: + if self.dtb_addr is not None: boot_script += ((" %(dtb_addr)s")) % replacements return boot_script @@ -1317,7 +1326,8 @@ class Mx53Config(Mx5Config): def __init__(self): super(Mx53Config, self).__init__() - self.dtb_addr = '0x71ff0000' + # XXX: Is dtb_addr really needed? + #self.dtb_addr = '0x71ff0000' self.initrd_addr = '0x72000000' self.kernel_addr = '0x70000000' self.kernel_flavors = ['linaro-lt-mx53', 'linaro-lt-mx5'] @@ -1680,6 +1690,22 @@ return bl0_file +class HighBankConfig(BoardConfig): + def __init__(self): + super(HighBankConfig, self).__init__() + self.boot_script = 'boot.scr' + self.bootloader_flavor = 'highbank' + self.kernel_flavors = ['highbank'] + self.serial_tty = 'ttyAMA0' + self.fatload_command = 'ext2load' + self.load_interface = 'scsi' + self.bootfs_type = 'ext2' + self.dtb_addr = '0x00001000' + self.initrd_addr = '0x01000000' + self.kernel_addr = '0x00800000' + self.load_addr = '0x00000000' + + class I386Config(BoardConfig): # define bootloader BOOTLOADER_CMD = 'grub-install' @@ -1751,6 +1777,7 @@ 'efikamx': EfikamxConfig, 'efikasb': EfikasbConfig, 'fastmodel': FastModelConfig, + 'highbank': HighBankConfig, 'i386': I386Config, 'igep': IgepConfig, 'mx51evk': Mx51evkConfig, === modified file 'linaro_image_tools/media_create/partitions.py' --- linaro_image_tools/media_create/partitions.py 2013-02-17 13:53:41 +0000 +++ linaro_image_tools/media_create/partitions.py 2013-03-25 13:14:15 +0000 @@ -164,10 +164,15 @@ if should_format_bootfs: print "\nFormating boot partition\n" - proc = cmd_runner.run( - ['mkfs.vfat', '-F', str(board_config.fat_size), bootfs, '-n', - bootfs_label], - as_root=True) + mkfs = 'mkfs.%s' % board_config.bootfs_type + if board_config.bootfs_type == 'vfat': + proc = cmd_runner.run( + [mkfs, '-F', str(board_config.fat_size), bootfs, '-n', + bootfs_label], + as_root=True) + else: + proc = cmd_runner.run( + [mkfs, bootfs, '-L', bootfs_label], as_root=True) proc.wait() if should_format_rootfs: === modified file 'linaro_image_tools/media_create/tests/test_media_create.py' --- linaro_image_tools/media_create/tests/test_media_create.py 2013-04-03 15:12:24 +0000 +++ linaro_image_tools/media_create/tests/test_media_create.py 2013-04-04 08:12:38 +0000 @@ -1423,6 +1423,12 @@ 'make_dtb', 'make_boot_script', 'make_boot_ini'] self.assertEqual(expected, self.funcs_calls) + def test_highbank_steps(self): + board_conf = boards.HighBankConfig() + board_conf.hwpack_format = HardwarepackHandler.FORMAT_1 + expected = [] + self.assertEqual(expected, self.funcs_calls) + class TestPopulateRawPartition(TestCaseWithFixtures): @@ -1544,6 +1550,11 @@ expected = [] self.assertEqual(expected, self.funcs_calls) + def test_highbank_raw(self): + self.populate_raw_partition(boards.HighBankConfig()) + expected = [] + self.assertEqual(expected, self.funcs_calls) + class TestPopulateRawPartitionAndroid(TestCaseWithFixtures): @@ -1843,6 +1854,13 @@ '1,8191,0xDA\n8192,106496,0x0C,*\n114688,,,-', board_conf.get_sfdisk_cmd()) + def test_highbank(self): + board_conf = get_board_config('highbank') + self.set_up_config(board_conf) + self.assertEquals( + '63,106432,0x83,*\n106496,,,-', + board_conf.get_sfdisk_cmd()) + def test_panda_android(self): self.assertEqual( '63,270272,0x0C,*\n270336,1048576,L\n1318912,524288,L\n' @@ -1958,6 +1976,13 @@ '1,8191,0xDA\n8192,106496,0x0C,*\n114688,,,-', board_conf.get_sfdisk_cmd()) + def test_highbank(self): + board_conf = get_board_config('highbank') + board_conf.partition_layout = 'bootfs_rootfs' + self.assertEquals( + '63,106432,0x83,*\n106496,,,-', + board_conf.get_sfdisk_cmd()) + class TestGetBootCmd(TestCase): @@ -2202,6 +2227,20 @@ 'initrd_high': '0xffffffff'} self.assertEqual(expected, boot_commands) + def test_highbank(self): + board_conf = get_board_config('highbank') + boot_commands = board_conf._get_boot_env( + is_live=False, is_lowmem=False, consoles=[], + rootfs_id="UUID=deadbeef", i_img_data="initrd", d_img_data=None) + expected = { + 'bootargs': 'root=UUID=deadbeef rootwait ro', + 'bootcmd': 'ext2load scsi 0:1 0x00800000 uImage; ' + 'ext2load scsi 0:1 0x01000000 uInitrd; ' + 'bootm 0x00800000 0x01000000 0x00001000', + 'fdt_high': '0xffffffff', + 'initrd_high': '0xffffffff'} + self.assertEqual(expected, boot_commands) + class TestExtraBootCmd(TestCaseWithFixtures):