diff mbox

[Branch,~linaro-image-tools/linaro-image-tools/trunk] Rev 612: Added support for Arndale board on android

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

Commit Message

Fathi Boudra March 25, 2013, 3:14 p.m. UTC
Merge authors:
  Milo Casagrande (milo)
Related merge proposals:
  https://code.launchpad.net/~milo/linaro-image-tools/bug1158772/+merge/155231
  proposed by: Milo Casagrande (milo)
  review: Approve - Fathi Boudra (fboudra)
  review: Approve - James Tunnicliffe (dooferlad)
------------------------------------------------------------
revno: 612 [merge]
committer: Fathi Boudra <fathi.boudra@linaro.org>
branch nick: linaro-image-tools
timestamp: Mon 2013-03-25 17:12:37 +0200
message:
  Added support for Arndale board on android
modified:
  linaro_image_tools/media_create/android_boards.py
  linaro_image_tools/media_create/boards.py
  linaro_image_tools/media_create/tests/test_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
diff mbox

Patch

=== modified file 'linaro_image_tools/media_create/android_boards.py'
--- linaro_image_tools/media_create/android_boards.py	2013-02-17 13:53:41 +0000
+++ linaro_image_tools/media_create/android_boards.py	2013-03-25 12:51:45 +0000
@@ -35,6 +35,7 @@ 
 from linaro_image_tools.hwpack.hwpack_fields import FORMAT_FIELD
 from linaro_image_tools.media_create.partitions import SECTOR_SIZE
 from linaro_image_tools.media_create.boards import (
+    ArndaleConfig,
     BeagleConfig,
     BoardConfig,
     BoardConfigException,
@@ -51,6 +52,8 @@ 
     align_up,
     install_mx5_boot_loader,
     make_boot_script,
+    _dd,
+    BoardException,
 )
 from linaro_image_tools.utils import DEFAULT_LOGGER_NAME
 
@@ -496,6 +499,42 @@ 
         self._android_specific_args = 'init=/init androidboot.console=ttyAMA0'
 
 
+class AndroidArndaleConfig(AndroidSamsungConfig, ArndaleConfig):
+    """Placeholder class for Arndale configuration inheritance."""
+    def __init__(self):
+        super(AndroidArndaleConfig, self).__init__()
+        self.mmc_option = '0:1'
+        self.kernel_addr = '0x40007000'
+        self.initrd_addr = '0x41000000'
+        self.dtb_addr = '0x41f00000'
+        self.dtb_name = 'exynos5250-arndale.dtb'
+        self._android_specific_args = ('init=/init '
+                'androidboot.console=ttySAC2 console=ttySAC2 '
+                'initrd=%s' % self.initrd_addr)
+        self._extra_serial_options = 'ttySAC2,115200n8'
+        self._extra_boot_args_options = 'rootdelay=3'
+
+    def populate_raw_partition(self, boot_device_or_file, chroot_dir):
+        boot_bin_0 = {'name': 'arndale-bl1.bin', 'seek': 1}
+        boot_bin_1 = {'name': 'u-boot-mmc-spl.bin', 'seek': 17}
+        boot_bin_2 = {'name': 'u-boot.bin', 'seek': 49}
+        boot_bins = [boot_bin_0, boot_bin_1, boot_bin_2]
+
+        boot_partition = 'boot'
+
+        # Zero the env so that the boot_script will get loaded
+        _dd("/dev/zero", boot_device_or_file, count=self.samsung_env_len,
+            seek=self.samsung_env_start)
+
+        for boot_bin in boot_bins:
+            name = boot_bin['name']
+            file_path = os.path.join(chroot_dir, boot_partition, name)
+            if not os.path.exists(file_path):
+                raise BoardException("File '%s' does not exists. Cannot "
+                        "proceed." % name)
+            _dd(file_path, boot_device_or_file, seek=boot_bin['seek'])
+
+
 # This dictionary is composed as follows:
 # <device_name>: <class>
 # The <device_name> is the command line argument passed to l-a-m-c, the
@@ -503,6 +542,7 @@ 
 # If a new device does not have special needs, it is possible to use the
 # general AndroidBoardConfig class.
 android_board_configs = {
+    'arndale': AndroidArndaleConfig,
     'beagle': AndroidBeagleConfig,
     'iMX53': AndroidMx53LoCoConfig,
     'mx53loco': AndroidMx53LoCoConfig,

=== modified file 'linaro_image_tools/media_create/boards.py'
--- linaro_image_tools/media_create/boards.py	2013-03-21 10:50:08 +0000
+++ linaro_image_tools/media_create/boards.py	2013-03-25 12:52:08 +0000
@@ -533,9 +533,9 @@ 
             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 mmc %(mmc_option)s "
+                    "%(dtb_addr)s ")) % replacements
+                boot_script += "%s; " % d_img_data
         boot_script += (("bootm %(kernel_addr)s")) % replacements
         if i_img_data is not None:
             boot_script += ((" %(initrd_addr)s")) % replacements

=== modified file 'linaro_image_tools/media_create/tests/test_android_boards.py'
--- linaro_image_tools/media_create/tests/test_android_boards.py	2013-02-18 13:05:58 +0000
+++ linaro_image_tools/media_create/tests/test_android_boards.py	2013-03-25 12:52:28 +0000
@@ -481,3 +481,18 @@ 
             'fdt_high': '0xffffffff',
             'initrd_high': '0xffffffff'}
         self.assertBootEnv(expected, board='mx53loco')
+
+    def test_android_arndale_old(self):
+        """Test that uses values taken directly from the class. """
+        expected = {
+            'bootargs': 'ttySAC2,115200n8 rootwait ro rootdelay=3 '
+                        'init=/init androidboot.console=ttySAC2 '
+                        'console=ttySAC2 initrd=0x41000000',
+            'bootcmd': 'fatload mmc 0:1 0x40007000 uImage; fatload mmc 0:1 '
+                        '0x41000000 uInitrd; fatload mmc 0:1 0x41f00000 '
+                        'exynos5250-arndale.dtb; bootm 0x40007000 0x41000000 '
+                        '0x41f00000',
+            'fdt_high': '0xffffffff',
+            'initrd_high': '0xffffffff',
+            }
+        self.assertBootEnv(expected, board='arndale')

=== modified file 'linaro_image_tools/media_create/tests/test_media_create.py'
--- linaro_image_tools/media_create/tests/test_media_create.py	2013-03-21 10:50:08 +0000
+++ linaro_image_tools/media_create/tests/test_media_create.py	2013-03-25 12:52:28 +0000
@@ -2002,7 +2002,7 @@ 
                         'root=UUID=deadbeef rootwait ro',
             'bootcmd': 'fatload mmc 0:2 0x90000000 uImage; '
                        'fatload mmc 0:2 0x92000000 uInitrd; '
-                       'fatload mmc 0:2 0x91ff0000 board.dtb; '
+                       'fatload mmc 0:2 0x91ff0000 mx51.dtb; '
                        'bootm 0x90000000 0x92000000 0x91ff0000',
             'fdt_high': '0xffffffff',
             'initrd_high': '0xffffffff'}
@@ -2126,7 +2126,7 @@ 
                         'mem=456M@0x80000000 mem=512M@0xA0000000',
             'bootcmd': 'fatload mmc 0:1 0x80200000 uImage; '
                        'fatload mmc 0:1 0x81600000 uInitrd; '
-                       'fatload mmc 0:1 0x815f0000 board.dtb; '
+                       'fatload mmc 0:1 0x815f0000 panda.dtb; '
                        'bootm 0x80200000 0x81600000 0x815f0000',
             'fdt_high': '0xffffffff',
             'initrd_high': '0xffffffff'}
@@ -2149,7 +2149,7 @@ 
                         'omapfb.mode=dvi:1280x720MR-16@60 mpurate=${mpurate}',
             'bootcmd': 'fatload mmc 0:1 0x80000000 uImage; '
                        'fatload mmc 0:1 0x81600000 uInitrd; '
-                       'fatload mmc 0:1 0x815f0000 board.dtb; '
+                       'fatload mmc 0:1 0x815f0000 beagle.dtb; '
                        'bootm 0x80000000 0x81600000 0x815f0000',
             'fdt_high': '0xffffffff',
             'initrd_high': '0xffffffff'}
@@ -2172,7 +2172,7 @@ 
                         'omapfb.mode=dvi:1280x720MR-16@60 mpurate=${mpurate}',
             'bootcmd': 'fatload mmc 0:1 0x80000000 uImage; '
                        'fatload mmc 0:1 0x81600000 uInitrd; '
-                       'fatload mmc 0:1 0x815f0000 board.dtb; '
+                       'fatload mmc 0:1 0x815f0000 igep.dtb; '
                        'bootm 0x80000000 0x81600000 0x815f0000',
             'fdt_high': '0xffffffff',
             'initrd_high': '0xffffffff'}
@@ -2196,7 +2196,7 @@ 
                         'omapfb.mode=dvi:${dvimode}',
             'bootcmd': 'fatload mmc 0:1 0x80000000 uImage; '
                        'fatload mmc 0:1 0x81600000 uInitrd; '
-                       'fatload mmc 0:1 0x815f0000 board.dtb; '
+                       'fatload mmc 0:1 0x815f0000 overo.dtb; '
                        'bootm 0x80000000 0x81600000 0x815f0000',
             'fdt_high': '0xffffffff',
             'initrd_high': '0xffffffff'}