From patchwork Tue Nov 15 08:08:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mattias Backman X-Patchwork-Id: 5140 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 728CD23EF6 for ; Tue, 15 Nov 2011 08:08:16 +0000 (UTC) Received: from mail-fx0-f52.google.com (mail-fx0-f52.google.com [209.85.161.52]) by fiordland.canonical.com (Postfix) with ESMTP id 59143A18204 for ; Tue, 15 Nov 2011 08:08:16 +0000 (UTC) Received: by faaa26 with SMTP id a26so147830faa.11 for ; Tue, 15 Nov 2011 00:08:16 -0800 (PST) Received: by 10.152.104.1 with SMTP id ga1mr16197751lab.40.1321344496007; Tue, 15 Nov 2011 00:08:16 -0800 (PST) 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.152.41.198 with SMTP id h6cs29357lal; Tue, 15 Nov 2011 00:08:15 -0800 (PST) Received: by 10.180.73.107 with SMTP id k11mr29007326wiv.50.1321344494076; Tue, 15 Nov 2011 00:08:14 -0800 (PST) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id cz6si12217336wib.36.2011.11.15.00.08.13 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 15 Nov 2011 00:08:14 -0800 (PST) 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 1RQE3x-0004zl-I6 for ; Tue, 15 Nov 2011 08:08:13 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 7EFA8E003A for ; Tue, 15 Nov 2011 08:08:13 +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: 458 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-image-tools/linaro-image-tools/trunk] Rev 458: Fix Snowball Android boot parameters and support the Snowball's special uboot. Message-Id: <20111115080813.14341.26338.launchpad@ackee.canonical.com> Date: Tue, 15 Nov 2011 08:08:13 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="14291"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 478195aef43b9c7ed8465af7c8ec98f1fe24ad06 Merge authors: Bernhard Rosenkraenzer (berolinux) Mattias Backman (mabac) Related merge proposals: https://code.launchpad.net/~berolinux/linaro-image-tools/fix-snowball-boot/+merge/81762 proposed by: Bernhard Rosenkraenzer (berolinux) review: Needs Fixing - Mattias Backman (mabac) review: Approve - Bernhard Rosenkraenzer (berolinux) review: Approve - Mathieu Poirier (mathieu.poirier) ------------------------------------------------------------ revno: 458 [merge] committer: Mattias Backman branch nick: linaro-image-tools timestamp: Tue 2011-11-15 09:05:24 +0100 message: Fix Snowball Android boot parameters and support the Snowball's special uboot. 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-09-30 13:22:50 +0000 +++ linaro_image_tools/media_create/android_boards.py 2011-11-14 15:14:29 +0000 @@ -185,21 +185,31 @@ class AndroidSnowballSdConfig(AndroidBoardConfig, SnowballSdConfig): + boot_script = 'boot.scr' + initrd_addr = '0x05000000' extra_boot_args_options = ( - 'earlyprintk rootdelay=1 fixrtc nocompcache ' - 'mem=128M@0 mali.mali_mem=64M@128M mem=24M@192M hwmem=167M@216M ' - 'mem_issw=1M@383M mem=640M@384M vmalloc=256M') - _extra_serial_opts = 'console=tty0 console=ttyO2,115200n8' + 'earlyprintk mem=128M@0 mali.mali_mem=32M@128M hwmem=168M@160M mem=48M@328M mem_issw=1M@383M mem=640M@384M vmalloc=256M') + _extra_serial_opts = 'console=ttyAMA2,115200n8' android_specific_args = 'init=/init androidboot.console=ttyAMA2' + # Snowball uses a custom uboot: + # it uses "fat load" instead of fatload and + # needs uImage/uInitrd prefixed with / + fatload_command = 'fat load' + uimage_path = '/' class AndroidSnowballEmmcConfig(AndroidBoardConfig, SnowballEmmcConfig): + boot_script = 'boot.scr' + initrd_addr = '0x05000000' extra_boot_args_options = ( - 'earlyprintk rootdelay=1 fixrtc nocompcache ' - 'mem=128M@0 mali.mali_mem=64M@128M mem=24M@192M hwmem=167M@216M ' - 'mem_issw=1M@383M mem=640M@384M vmalloc=256M') - _extra_serial_opts = 'console=tty0 console=ttyAMA2,115200n8' + 'earlyprintk mem=128M@0 mali.mali_mem=32M@128M hwmem=168M@160M mem=48M@328M mem_issw=1M@383M mem=640M@384M vmalloc=256M') + _extra_serial_opts = 'console=ttyAMA2,115200n8' android_specific_args = 'init=/init androidboot.console=ttyAMA2' + # Snowball uses a custom uboot: + # it uses "fat load" instead of fatload and + # needs uImage/uInitrd prefixed with / + fatload_command = 'fat load' + uimage_path = '/' @classmethod def get_sfdisk_cmd(cls, should_align_boot_part=False): === modified file 'linaro_image_tools/media_create/boards.py' --- linaro_image_tools/media_create/boards.py 2011-10-19 12:19:33 +0000 +++ linaro_image_tools/media_create/boards.py 2011-11-09 17:39:45 +0000 @@ -202,8 +202,10 @@ spl_in_boot_part = False spl_dd = False env_dd = False + fatload_command = 'fatload' mmc_option = '0:1' mmc_part_offset = 0 + uimage_path = '' fat_size = 32 _extra_serial_opts = '' _live_serial_opts = '' @@ -552,17 +554,18 @@ In general subclasses should not have to override this. """ replacements = dict( + fatload_command=cls.fatload_command, uimage_path=cls.uimage_path, mmc_option=cls.mmc_option, kernel_addr=cls.kernel_addr, initrd_addr=cls.initrd_addr, dtb_addr=cls.dtb_addr) boot_script = ( - "fatload mmc %(mmc_option)s %(kernel_addr)s uImage; " - "fatload mmc %(mmc_option)s %(initrd_addr)s uInitrd; " + "%(fatload_command)s mmc %(mmc_option)s %(kernel_addr)s %(uimage_path)suImage; " + "%(fatload_command)s mmc %(mmc_option)s %(initrd_addr)s %(uimage_path)suInitrd; " % replacements) if d_img_data is not None: assert cls.dtb_addr is not None, ( "Need a dtb_addr when passing d_img_data") boot_script += ( - "fatload mmc %(mmc_option)s %(dtb_addr)s board.dtb; " + "%(fatload_command)s mmc %(mmc_option)s %(dtb_addr)s board.dtb; " "bootm %(kernel_addr)s %(initrd_addr)s %(dtb_addr)s" % replacements) else: === modified file 'linaro_image_tools/media_create/tests/test_media_create.py' --- linaro_image_tools/media_create/tests/test_media_create.py 2011-10-19 13:59:30 +0000 +++ linaro_image_tools/media_create/tests/test_media_create.py 2011-11-14 15:14:29 +0000 @@ -1396,23 +1396,35 @@ 'fatload mmc 0:1 0x81600000 uInitrd; ' 'bootm 0x80200000 0x81600000'} self.assertEqual(expected, boot_commands) - + + def test_android_snowball_sd(self): + boot_commands = (android_boards.AndroidSnowballSdConfig. + _get_boot_env(consoles=[])) + expected = { + 'bootargs': 'console=ttyAMA2,115200n8 ' + 'rootwait ro earlyprintk ' + 'mem=128M@0 mali.mali_mem=32M@128M hwmem=168M@160M ' + 'mem=48M@328M mem_issw=1M@383M mem=640M@384M ' + 'vmalloc=256M init=/init androidboot.console=ttyAMA2', + 'bootcmd': 'fat load mmc 1:1 0x00100000 /uImage; ' + 'fat load mmc 1:1 0x05000000 /uInitrd; ' + 'bootm 0x00100000 0x05000000'} + self.assertEqual(expected, boot_commands) + def test_android_snowball_emmc(self): boot_commands = (android_boards.AndroidSnowballEmmcConfig. _get_boot_env(consoles=[])) expected = { - 'bootargs': 'console=tty0 console=ttyAMA2,115200n8 ' + 'bootargs': 'console=ttyAMA2,115200n8 ' 'rootwait ro earlyprintk ' - 'rootdelay=1 fixrtc nocompcache ' - 'mem=128M@0 mali.mali_mem=64M@128M mem=24M@192M ' - 'hwmem=167M@216M mem_issw=1M@383M mem=640M@384M ' + 'mem=128M@0 mali.mali_mem=32M@128M hwmem=168M@160M ' + 'mem=48M@328M mem_issw=1M@383M mem=640M@384M ' 'vmalloc=256M init=/init androidboot.console=ttyAMA2', - 'bootcmd': 'fatload mmc 1:1 0x00100000 uImage; ' - 'fatload mmc 1:1 0x08000000 uInitrd; ' - 'bootm 0x00100000 0x08000000'} + 'bootcmd': 'fat load mmc 1:1 0x00100000 /uImage; ' + 'fat load mmc 1:1 0x05000000 /uInitrd; ' + 'bootm 0x00100000 0x05000000'} self.assertEqual(expected, boot_commands) - def test_android_origen(self): boot_commands = (android_boards.AndroidOrigenConfig. _get_boot_env(consoles=[]))