diff mbox

[Branch,~linaro-image-tools/linaro-image-tools/trunk] Rev 461: Add VExpress support in linaro-android-media-create.

Message ID 20111117090613.2838.90881.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Mattias Backman Nov. 17, 2011, 9:06 a.m. UTC
Merge authors:
  Tixy (Jon Medhurst) (tixy)
Related merge proposals:
  https://code.launchpad.net/~tixy/linaro-image-tools/vexpress-a9-support/+merge/82372
  proposed by: Tixy (Jon Medhurst) (tixy)
------------------------------------------------------------
revno: 461 [merge]
committer: Mattias Backman <mattias.backman@linaro.org>
branch nick: linaro-image-tools
timestamp: Thu 2011-11-17 10:03:31 +0100
message:
  Add VExpress support in linaro-android-media-create.
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
diff mbox

Patch

=== modified file 'linaro_image_tools/media_create/android_boards.py'
--- linaro_image_tools/media_create/android_boards.py	2011-11-14 15:14:29 +0000
+++ linaro_image_tools/media_create/android_boards.py	2011-11-17 09:03:31 +0000
@@ -33,6 +33,7 @@ 
 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 VexpressA9Config
 from linaro_image_tools.media_create.boards import (
     align_up,
     align_partition,
@@ -167,6 +168,7 @@ 
     def install_boot_loader(cls, boot_partition, boot_device_or_file):
         pass
 
+
 class AndroidOmapConfig(AndroidBoardConfig):
     pass
 
@@ -228,6 +230,7 @@ 
         return '%s,%s,0xDA\n%s' % (
             loader_start, loader_len, command)
 
+
 class AndroidMx53LoCoConfig(AndroidBoardConfig, Mx53LoCoConfig):
     extra_boot_args_options = (
         'earlyprintk rootdelay=1 fixrtc nocompcache di1_primary tve')
@@ -282,6 +285,11 @@ 
     android_specific_args = 'init=/init androidboot.console=ttySAC2'
 
 
+class AndroidVexpressA9Config(AndroidBoardConfig, VexpressA9Config):
+    _extra_serial_opts = 'console=tty0 console=ttyAMA0,38400n8'
+    android_specific_args = 'init=/init androidboot.console=ttyAMA0'
+
+
 android_board_configs = {
     'beagle': AndroidBeagleConfig,
     'panda': AndroidPandaConfig,
@@ -291,4 +299,5 @@ 
     'mx53loco': AndroidMx53LoCoConfig,
     'iMX53': AndroidMx53LoCoConfig,
     'origen': AndroidOrigenConfig,
+    'vexpress-a9': AndroidVexpressA9Config,
     }

=== modified file 'linaro_image_tools/media_create/boards.py'
--- linaro_image_tools/media_create/boards.py	2011-11-09 17:39:45 +0000
+++ linaro_image_tools/media_create/boards.py	2011-11-16 09:01:55 +0000
@@ -1266,7 +1266,7 @@ 
     initrd_addr = '0x81000000'
     load_addr = kernel_addr
     kernel_flavors = ['linaro-vexpress']
-    boot_script = None
+    boot_script = 'boot.scr'
     # ARM Boot Monitor is used to load u-boot, uImage etc. into flash and
     # only allows for FAT16
     fat_size = 16
@@ -1287,6 +1287,13 @@ 
         make_uInitrd(i_img_data, boot_dir)
 
 
+class VexpressA9Config(VexpressConfig):
+    # For now, this is a duplicate of VexpressConfig.
+    # In future, there will also be A5 and A15 variants.
+    # For all of these, there should never be any V1 hardware packs.
+    pass
+
+
 class SamsungConfig(BoardConfig):
     @classproperty
     def extra_serial_opts(cls):
@@ -1430,6 +1437,7 @@ 
     'igep': IgepConfig,
     'panda': PandaConfig,
     'vexpress': VexpressConfig,
+    'vexpress-a9': VexpressA9Config,
     'ux500': Ux500Config,
     'snowball_sd': SnowballSdConfig,
     'snowball_emmc': SnowballEmmcConfig,

=== modified file 'linaro_image_tools/media_create/tests/test_media_create.py'
--- linaro_image_tools/media_create/tests/test_media_create.py	2011-11-15 08:07:46 +0000
+++ linaro_image_tools/media_create/tests/test_media_create.py	2011-11-17 09:03:31 +0000
@@ -919,6 +919,11 @@ 
         expected = ['make_uImage', 'make_uInitrd']
         self.assertEqual(expected, self.funcs_calls)
 
+    def test_vexpress_a9_steps(self):
+        self.make_boot_files(boards.VexpressA9Config)
+        expected = ['make_uImage', 'make_uInitrd']
+        self.assertEqual(expected, self.funcs_calls)
+
     def test_mx5_steps(self):
         class SomeMx5Config(boards.Mx5Config):
             uboot_flavor = 'uboot_flavor'
@@ -1165,6 +1170,12 @@ 
                 '794624,-,E\n794624,524288,L\n1318912,1048576,L\n2367488,,,-', 
                 android_boards.AndroidSnowballEmmcConfig.get_sfdisk_cmd())
 
+    def test_vexpress_android(self):
+        self.assertEqual(
+            '63,270272,0x0E,*\n270336,524288,L\n794624,524288,L\n' \
+                '1318912,-,E\n1318912,1048576,L\n2367488,,,-', 
+                android_boards.AndroidVexpressA9Config.get_sfdisk_cmd())
+
 class TestGetSfdiskCmdV2(TestCase):
 
     def test_mx5(self):
@@ -1224,6 +1235,18 @@ 
                        'bootm 0x60008000 0x81000000'}
         self.assertEqual(expected, boot_commands)
 
+    def test_vexpress_a9(self):
+        boot_commands = board_configs['vexpress-a9']._get_boot_env(
+            is_live=False, is_lowmem=False, consoles=['ttyXXX'],
+            rootfs_uuid="deadbeef", d_img_data=None)
+        expected = {
+            'bootargs': 'console=tty0 console=ttyAMA0,38400n8 '
+                        'console=ttyXXX  root=UUID=deadbeef rootwait ro',
+            'bootcmd': 'fatload mmc 0:1 0x60008000 uImage; '
+                       'fatload mmc 0:1 0x81000000 uInitrd; '
+                       'bootm 0x60008000 0x81000000'}
+        self.assertEqual(expected, boot_commands)
+
     def test_mx51(self):
         boot_commands = boards.Mx51Config._get_boot_env(
             is_live=False, is_lowmem=False, consoles=[],
@@ -1436,6 +1459,17 @@ 
                        'bootm 0x40007000 0x42000000'}
         self.assertEqual(expected, boot_commands)
 
+    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 0x60008000 uImage; '
+                       'fatload mmc 0:1 0x81000000 uInitrd; '
+                       'bootm 0x60008000 0x81000000'}
+        self.assertEqual(expected, boot_commands)
+
 
 class TestUnpackBinaryTarball(TestCaseWithFixtures):