diff mbox

[Branch,~linaro-image-tools/linaro-image-tools/trunk] Rev 427: Add Origen support to linaro-android-media-create and also zero the u-boot env area on the SD car...

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

Commit Message

Mattias Backman Aug. 25, 2011, 10:03 a.m. UTC
Merge authors:
  Angus Ainslie (angus-akkea)
  Mattias Backman (mabac)
Related merge proposals:
  https://code.launchpad.net/~linaro-landing-team-samsung/linaro-image-tools/add-origen-android-support/+merge/72465
  proposed by: Angus Ainslie (angus-akkea)
  review: Needs Fixing - Mattias Backman (mabac)
------------------------------------------------------------
revno: 427 [merge]
committer: Mattias Backman <mattias.backman@linaro.org>
branch nick: linaro-image-tools
timestamp: Thu 2011-08-25 11:57:46 +0200
message:
  Add Origen support to linaro-android-media-create and also zero the u-boot env area on the SD card so that an old env doesn't get used.
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-08-04 13:58:02 +0000
+++ linaro_image_tools/media_create/android_boards.py	2011-08-24 14:47:20 +0000
@@ -35,6 +35,7 @@ 
 from linaro_image_tools.media_create.boards import SnowballSdConfig
 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 (
     align_up,
     align_partition,
@@ -245,9 +246,7 @@ 
         install_mx5_boot_loader(os.path.join(boot_device_or_file, "u-boot.imx"), boot_partition, cls.LOADER_MIN_SIZE_S)
 
 
-class AndroidSMDKV310Config(AndroidBoardConfig, SMDKV310Config):
-    _extra_serial_opts = 'console=tty0 console=ttySAC1,115200n8'
-    android_specific_args = 'init=/init androidboot.console=ttySAC1'
+class AndroidSamsungConfig(AndroidBoardConfig):
 
     @classmethod
     def get_sfdisk_cmd(cls, should_align_boot_part=False):
@@ -258,7 +257,7 @@ 
         loader_start, loader_end, loader_len = align_partition(
             1, loaders_min_len, 1, PART_ALIGN_S)
 
-        command = super(AndroidSMDKV310Config, cls).get_sfdisk_cmd(
+        command = super(AndroidSamsungConfig, cls).get_sfdisk_cmd(
             should_align_boot_part=False, start_addr=loader_end,
             extra_part=True)
 
@@ -266,6 +265,16 @@ 
             loader_start, loader_len, command)
 
 
+class AndroidSMDKV310Config(AndroidSamsungConfig, SMDKV310Config):
+    _extra_serial_opts = 'console=tty0 console=ttySAC1,115200n8'
+    android_specific_args = 'init=/init androidboot.console=ttySAC1'
+
+
+class AndroidOrigenConfig(AndroidSamsungConfig, OrigenConfig):
+    _extra_serial_opts = 'console=tty0 console=ttySAC2,115200n8'
+    android_specific_args = 'init=/init androidboot.console=ttySAC2'
+
+
 android_board_configs = {
     'beagle': AndroidBeagleConfig,
     'panda': AndroidPandaConfig,
@@ -273,4 +282,5 @@ 
     'snowball_emmc': AndroidSnowballEmmcConfig,
     'smdkv310': AndroidSMDKV310Config,
     'iMX53': AndroidMx53LoCoConfig,
+    'origen': AndroidOrigenConfig,
     }

=== modified file 'linaro_image_tools/media_create/boards.py'
--- linaro_image_tools/media_create/boards.py	2011-08-24 14:05:56 +0000
+++ linaro_image_tools/media_create/boards.py	2011-08-25 09:57:46 +0000
@@ -1089,7 +1089,10 @@ 
 
     @classmethod
     def populate_raw_partition(cls, chroot_dir, boot_device_or_file):
-        # Populate created raw partition with BL1, env and u-boot
+        # Zero the env so that the boot_script will get loaded
+        _dd("/dev/zero", boot_device_or_file, count=SAMSUNG_V310_ENV_LEN,
+            seek=SAMSUNG_V310_ENV_START)
+        # Populate created raw partition with BL1 and u-boot
         spl_file = os.path.join(chroot_dir, 'boot', 'u-boot-mmc-spl.bin')
         assert os.path.getsize(spl_file) <= (SAMSUNG_V310_BL1_LEN * SECTOR_SIZE), (
             "%s is larger than SAMSUNG_V310_BL1_LEN" % spl_file)

=== modified file 'linaro_image_tools/media_create/tests/test_media_create.py'
--- linaro_image_tools/media_create/tests/test_media_create.py	2011-08-24 14:04:45 +0000
+++ linaro_image_tools/media_create/tests/test_media_create.py	2011-08-25 09:57:46 +0000
@@ -1130,6 +1130,12 @@ 
                 '1318912,-,E\n1318912,1048576,L\n2367488,,,-', 
                 android_boards.AndroidPandaConfig.get_sfdisk_cmd())
 
+    def test_origen_android(self):
+        self.assertEqual(
+            '1,8191,0xDA\n8253,270274,0x0C,*\n278528,524288,L\n' \
+                '802816,-,E\n802816,524288,L\n1327104,1048576,L\n2375680,,,-',
+                android_boards.AndroidOrigenConfig.get_sfdisk_cmd())
+
     def test_snowball_emmc_android(self):
         self.assertEqual(
             '256,7936,0xDA\n8192,262144,0x0C,*\n270336,524288,L\n' \
@@ -1340,6 +1346,18 @@ 
         self.assertEqual(expected, boot_commands)
 
 
+    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)
+
+
 class TestUnpackBinaryTarball(TestCaseWithFixtures):
 
     def setUp(self):