From patchwork Mon Feb 20 18:37:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guilherme Salgado X-Patchwork-Id: 6836 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 22B2923EA7 for ; Mon, 20 Feb 2012 18:37:16 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id BF5C1A184A5 for ; Mon, 20 Feb 2012 18:37:15 +0000 (UTC) Received: by iabz7 with SMTP id z7so10975927iab.11 for ; Mon, 20 Feb 2012 10:37:15 -0800 (PST) Received: from mr.google.com ([10.42.131.129]) by 10.42.131.129 with SMTP id z1mr22868934ics.53.1329763035306 (num_hops = 1); Mon, 20 Feb 2012 10:37:15 -0800 (PST) Received: by 10.42.131.129 with SMTP id z1mr18275438ics.53.1329763035246; Mon, 20 Feb 2012 10:37:15 -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.231.11.10 with SMTP id r10csp54547ibr; Mon, 20 Feb 2012 10:37:14 -0800 (PST) Received: by 10.216.136.17 with SMTP id v17mr4069992wei.26.1329763033409; Mon, 20 Feb 2012 10:37:13 -0800 (PST) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id p6si6136496wia.36.2012.02.20.10.37.12 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 20 Feb 2012 10:37:13 -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 1RzY6q-0003Fb-D4 for ; Mon, 20 Feb 2012 18:37:12 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 574F7E04CF for ; Mon, 20 Feb 2012 18:37: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: 491 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-image-tools/linaro-image-tools/trunk] Rev 491: Add support for Android on the Mx6QSabrelite board Message-Id: <20120220183712.20724.8641.launchpad@ackee.canonical.com> Date: Mon, 20 Feb 2012 18:37: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="14833"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 0bdba4ff16f1f6e9eed37f0a39dba32564d483a7 X-Gm-Message-State: ALoCoQmnPFTYBEY5SPWm00Ztup3jzCTtmPA23V2oiw8bGnBGfXELNtr3UQB5I9SYluxXEDGPDu0c Merge authors: Bernhard Rosenkraenzer (berolinux) Bernhard Rosenkraenzer (berolinux) Guilherme Salgado (salgado) Related merge proposals: https://code.launchpad.net/~berolinux/linaro-image-tools/android-mx6qsabrelite/+merge/93139 proposed by: Bernhard Rosenkraenzer (berolinux) review: Approve - Guilherme Salgado (salgado) ------------------------------------------------------------ revno: 491 [merge] committer: Guilherme Salgado branch nick: trunk timestamp: Mon 2012-02-20 15:35:13 -0300 message: Add support for Android on the Mx6QSabrelite board modified: linaro-android-media-create linaro_image_tools/media_create/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-android-media-create' --- linaro-android-media-create 2012-01-19 06:31:50 +0000 +++ linaro-android-media-create 2012-02-20 18:32:21 +0000 @@ -25,14 +25,14 @@ from linaro_image_tools import cmd_runner -from linaro_image_tools.media_create.android_boards import android_board_configs +from linaro_image_tools.media_create.android_boards import ( + android_board_configs, + ) from linaro_image_tools.media_create.check_device import ( confirm_device_selection_and_ensure_it_is_ready) from linaro_image_tools.media_create.partitions import ( Media, - setup_partitions, setup_android_partitions, - get_uuid, partition_mounted, ) from linaro_image_tools.media_create.rootfs import populate_partition === modified file 'linaro_image_tools/media_create/android_boards.py' --- linaro_image_tools/media_create/android_boards.py 2012-02-08 19:34:27 +0000 +++ linaro_image_tools/media_create/android_boards.py 2012-02-20 18:32:21 +0000 @@ -76,7 +76,10 @@ """ boot_env = {} boot_env["bootargs"] = cls._get_bootargs(consoles) - boot_env["bootcmd"] = cls._get_bootcmd(None) + # On Android, the DTB file is always built as part of the kernel it + # comes from - and lives in the same directory in the boot tarball, so + # here we don't need to pass the whole path to it. + boot_env["bootcmd"] = cls._get_bootcmd(cls.dtb_name) return boot_env @classmethod @@ -170,12 +173,13 @@ class AndroidOmapConfig(AndroidBoardConfig): - pass + dtb_name = None class AndroidBeagleConfig(AndroidOmapConfig, BeagleConfig): _extra_serial_opts = 'console=tty0 console=ttyO2,115200n8' android_specific_args = 'init=/init androidboot.console=ttyO2' + dtb_name = None class AndroidPandaConfig(AndroidOmapConfig, PandaConfig): @@ -184,6 +188,7 @@ 'earlyprintk fixrtc nocompcache vram=48M ' 'omapfb.vram=0:24M,1:24M mem=456M@0x80000000 mem=512M@0xA0000000') android_specific_args = 'init=/init androidboot.console=ttyO2' + dtb_name = None class AndroidSnowballSdConfig(AndroidBoardConfig, SnowballSdConfig): @@ -198,6 +203,7 @@ # needs uImage/uInitrd prefixed with / fatload_command = 'fat load' uimage_path = '/' + dtb_name = None class AndroidSnowballEmmcConfig(AndroidBoardConfig, SnowballEmmcConfig): @@ -213,6 +219,7 @@ # needs uImage/uInitrd prefixed with / fatload_command = 'fat load' uimage_path = '/' + dtb_name = None @classmethod def get_sfdisk_cmd(cls, should_align_boot_part=False): @@ -239,6 +246,7 @@ Mx53LoCoConfig.serial_tty) android_specific_args = 'init=/init androidboot.console=%s' % ( Mx53LoCoConfig.serial_tty) + dtb_name = None @classmethod def get_sfdisk_cmd(cls, should_align_boot_part=False): @@ -257,7 +265,17 @@ install_mx5_boot_loader(os.path.join(boot_device_or_file, "u-boot.imx"), boot_partition, cls.LOADER_MIN_SIZE_S) +class AndroidMx6QSabreliteConfig(AndroidMx53LoCoConfig): + uboot_flavor = 'mx6qsabrelite' + kernel_addr = '0x10000000' + initrd_addr = '0x12000000' + load_addr = '0x10008000' + dtb_addr = '0x11ff0000' + dtb_name = 'board.dtb' + + class AndroidSamsungConfig(AndroidBoardConfig): + dtb_name = None @classmethod def get_sfdisk_cmd(cls, should_align_boot_part=False): @@ -279,16 +297,19 @@ class AndroidSMDKV310Config(AndroidSamsungConfig, SMDKV310Config): _extra_serial_opts = 'console=tty0 console=ttySAC1,115200n8' android_specific_args = 'init=/init androidboot.console=ttySAC1' + dtb_name = None class AndroidOrigenConfig(AndroidSamsungConfig, OrigenConfig): _extra_serial_opts = 'console=tty0 console=ttySAC2,115200n8' android_specific_args = 'init=/init androidboot.console=ttySAC2' + dtb_name = None class AndroidVexpressA9Config(AndroidBoardConfig, VexpressA9Config): _extra_serial_opts = 'console=tty0 console=ttyAMA0,38400n8' android_specific_args = 'init=/init androidboot.console=ttyAMA0' + dtb_name = None android_board_configs = { @@ -299,6 +320,7 @@ 'smdkv310': AndroidSMDKV310Config, 'mx53loco': AndroidMx53LoCoConfig, 'iMX53': AndroidMx53LoCoConfig, + 'mx6qsabrelite': AndroidMx6QSabreliteConfig, 'origen': AndroidOrigenConfig, 'vexpress-a9': AndroidVexpressA9Config, } === modified file 'linaro_image_tools/media_create/tests/test_media_create.py' --- linaro_image_tools/media_create/tests/test_media_create.py 2012-02-08 22:47:59 +0000 +++ linaro_image_tools/media_create/tests/test_media_create.py 2012-02-20 18:32:21 +0000 @@ -1187,6 +1187,12 @@ '1318912,-,E\n1318912,524288,L\n1843200,1048576,L\n2891776,,,-', android_boards.AndroidMx53LoCoConfig.get_sfdisk_cmd()) + def test_mx6_android(self): + self.assertEqual( + '1,8191,0xDA\n8192,262144,0x0C,*\n270336,1048576,L\n' + '1318912,-,E\n1318912,524288,L\n1843200,1048576,L\n2891776,,,-', + android_boards.AndroidMx6QSabreliteConfig.get_sfdisk_cmd()) + class TestGetSfdiskCmdV2(TestCase): @@ -1481,13 +1487,13 @@ class TestGetBootCmdAndroid(TestCase): + def test_panda(self): # XXX: To fix bug 697824 we have to change class attributes of our # OMAP board configs, and some tests do that so to make sure they # don't interfere with us we'll reset that before doing anything. config = android_board_configs['panda'] config.serial_tty = config._serial_tty - boot_commands = config._get_boot_env(consoles=[]) expected = { 'bootargs': 'console=ttyO2,115200n8 ' 'rootwait ro earlyprintk fixrtc ' @@ -1497,11 +1503,9 @@ 'bootcmd': 'fatload mmc 0:1 0x80200000 uImage; ' 'fatload mmc 0:1 0x81600000 uInitrd; ' 'bootm 0x80200000 0x81600000'} - self.assertEqual(expected, boot_commands) + self.assertBootEnv(config, expected) def test_android_snowball_sd(self): - boot_commands = (android_boards.AndroidSnowballSdConfig. - _get_boot_env(consoles=[])) expected = { 'bootargs': 'console=ttyAMA2,115200n8 ' 'rootwait ro earlyprintk ' @@ -1511,11 +1515,10 @@ 'bootcmd': 'fat load mmc 1:1 0x00100000 /uImage; ' 'fat load mmc 1:1 0x05000000 /uInitrd; ' 'bootm 0x00100000 0x05000000'} - self.assertEqual(expected, boot_commands) + self.assertBootEnv( + android_boards.AndroidSnowballSdConfig, expected) def test_android_snowball_emmc(self): - boot_commands = (android_boards.AndroidSnowballEmmcConfig. - _get_boot_env(consoles=[])) expected = { 'bootargs': 'console=ttyAMA2,115200n8 ' 'rootwait ro earlyprintk ' @@ -1525,33 +1528,30 @@ 'bootcmd': 'fat load mmc 0:2 0x00100000 /uImage; ' 'fat load mmc 0:2 0x05000000 /uInitrd; ' 'bootm 0x00100000 0x05000000'} - self.assertEqual(expected, boot_commands) + self.assertBootEnv( + android_boards.AndroidSnowballEmmcConfig, expected) 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) + self.assertBootEnv( + android_boards.AndroidOrigenConfig, expected) def test_android_vexpress_a9(self): - boot_commands = (android_boards.AndroidVexpressA9Config. - _get_boot_env(consoles=[])) expected = { 'bootargs': 'console=tty0 console=ttyAMA0,38400n8 ' 'rootwait ro init=/init androidboot.console=ttyAMA0', 'bootcmd': 'fatload mmc 0:1 0x60000000 uImage; ' 'fatload mmc 0:1 0x62000000 uInitrd; ' 'bootm 0x60000000 0x62000000'} - self.assertEqual(expected, boot_commands) + self.assertBootEnv( + android_boards.AndroidVexpressA9Config, expected) def test_android_mx5(self): - boot_commands = (android_boards.AndroidMx53LoCoConfig. - _get_boot_env(consoles=[])) expected = { 'bootargs': 'console=ttymxc0,115200n8 ' 'rootwait ro earlyprintk rootdelay=1 fixrtc ' @@ -1560,7 +1560,24 @@ 'bootcmd': 'fatload mmc 0:2 0x70000000 uImage; ' 'fatload mmc 0:2 0x72000000 uInitrd; ' 'bootm 0x70000000 0x72000000'} - self.assertEqual(expected, boot_commands) + self.assertBootEnv( + android_boards.AndroidMx53LoCoConfig, expected) + + def test_android_mx6(self): + expected = { + 'bootargs': 'console=ttymxc0,115200n8 ' + 'rootwait ro earlyprintk rootdelay=1 fixrtc ' + 'nocompcache di1_primary tve init=/init ' + 'androidboot.console=ttymxc0', + 'bootcmd': 'fatload mmc 0:2 0x10000000 uImage; ' + 'fatload mmc 0:2 0x12000000 uInitrd; ' + 'fatload mmc 0:2 0x11ff0000 board.dtb; ' + 'bootm 0x10000000 0x12000000 0x11ff0000'} + self.assertBootEnv( + android_boards.AndroidMx6QSabreliteConfig, expected) + + def assertBootEnv(self, config, expected): + self.assertEqual(expected, config._get_boot_env(consoles=[])) class TestUnpackBinaryTarball(TestCaseWithFixtures):