Merge lp:~milo/linaro-image-tools/bug1158772 into lp:linaro-image-tools/11.11

Proposed by Milo Casagrande
Status: Merged
Approved by: Fathi Boudra
Approved revision: 615
Merged at revision: 612
Proposed branch: lp:~milo/linaro-image-tools/bug1158772
Merge into: lp:linaro-image-tools/11.11
Diff against target: 160 lines (+63/-8)
4 files modified
linaro_image_tools/media_create/android_boards.py (+40/-0)
linaro_image_tools/media_create/boards.py (+3/-3)
linaro_image_tools/media_create/tests/test_android_boards.py (+15/-0)
linaro_image_tools/media_create/tests/test_media_create.py (+5/-5)
To merge this branch: bzr merge lp:~milo/linaro-image-tools/bug1158772
Reviewer Review Type Date Requested Status
Fathi Boudra Approve
James Tunnicliffe (community) Approve
Review via email: mp+155231@code.launchpad.net

Commit message

Added support for Arndale in l-a-m-c. fixed problem with _get_bootcmd.

Description of the change

Added support for Arndale in android boards with its own test.

Fixed also a bug with the _get_bootcmd method, where the dtb file name, if passed, was not used and it always defaulted to board.dtb. Fixed also the tests that made that assumption.

To post a comment you must log in.
Revision history for this message
vishal (vishalbhoj) wrote :

Looks good.

Revision history for this message
James Tunnicliffe (dooferlad) wrote :

Good stuff.

review: Approve
Revision history for this message
Fathi Boudra (fboudra) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== 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 13:55:25 +0000
@@ -35,6 +35,7 @@
35from linaro_image_tools.hwpack.hwpack_fields import FORMAT_FIELD35from linaro_image_tools.hwpack.hwpack_fields import FORMAT_FIELD
36from linaro_image_tools.media_create.partitions import SECTOR_SIZE36from linaro_image_tools.media_create.partitions import SECTOR_SIZE
37from linaro_image_tools.media_create.boards import (37from linaro_image_tools.media_create.boards import (
38 ArndaleConfig,
38 BeagleConfig,39 BeagleConfig,
39 BoardConfig,40 BoardConfig,
40 BoardConfigException,41 BoardConfigException,
@@ -51,6 +52,8 @@
51 align_up,52 align_up,
52 install_mx5_boot_loader,53 install_mx5_boot_loader,
53 make_boot_script,54 make_boot_script,
55 _dd,
56 BoardException,
54)57)
55from linaro_image_tools.utils import DEFAULT_LOGGER_NAME58from linaro_image_tools.utils import DEFAULT_LOGGER_NAME
5659
@@ -496,6 +499,42 @@
496 self._android_specific_args = 'init=/init androidboot.console=ttyAMA0'499 self._android_specific_args = 'init=/init androidboot.console=ttyAMA0'
497500
498501
502class AndroidArndaleConfig(AndroidSamsungConfig, ArndaleConfig):
503 """Placeholder class for Arndale configuration inheritance."""
504 def __init__(self):
505 super(AndroidArndaleConfig, self).__init__()
506 self.mmc_option = '0:1'
507 self.kernel_addr = '0x40007000'
508 self.initrd_addr = '0x41000000'
509 self.dtb_addr = '0x41f00000'
510 self.dtb_name = 'exynos5250-arndale.dtb'
511 self._android_specific_args = ('init=/init '
512 'androidboot.console=ttySAC2 console=ttySAC2 '
513 'initrd=%s' % self.initrd_addr)
514 self._extra_serial_options = 'ttySAC2,115200n8'
515 self._extra_boot_args_options = 'rootdelay=3'
516
517 def populate_raw_partition(self, boot_device_or_file, chroot_dir):
518 boot_bin_0 = {'name': 'arndale-bl1.bin', 'seek': 1}
519 boot_bin_1 = {'name': 'u-boot-mmc-spl.bin', 'seek': 17}
520 boot_bin_2 = {'name': 'u-boot.bin', 'seek': 49}
521 boot_bins = [boot_bin_0, boot_bin_1, boot_bin_2]
522
523 boot_partition = 'boot'
524
525 # Zero the env so that the boot_script will get loaded
526 _dd("/dev/zero", boot_device_or_file, count=self.samsung_env_len,
527 seek=self.samsung_env_start)
528
529 for boot_bin in boot_bins:
530 name = boot_bin['name']
531 file_path = os.path.join(chroot_dir, boot_partition, name)
532 if not os.path.exists(file_path):
533 raise BoardException("File '%s' does not exists. Cannot "
534 "proceed." % name)
535 _dd(file_path, boot_device_or_file, seek=boot_bin['seek'])
536
537
499# This dictionary is composed as follows:538# This dictionary is composed as follows:
500# <device_name>: <class>539# <device_name>: <class>
501# The <device_name> is the command line argument passed to l-a-m-c, the540# The <device_name> is the command line argument passed to l-a-m-c, the
@@ -503,6 +542,7 @@
503# If a new device does not have special needs, it is possible to use the542# If a new device does not have special needs, it is possible to use the
504# general AndroidBoardConfig class.543# general AndroidBoardConfig class.
505android_board_configs = {544android_board_configs = {
545 'arndale': AndroidArndaleConfig,
506 'beagle': AndroidBeagleConfig,546 'beagle': AndroidBeagleConfig,
507 'iMX53': AndroidMx53LoCoConfig,547 'iMX53': AndroidMx53LoCoConfig,
508 'mx53loco': AndroidMx53LoCoConfig,548 'mx53loco': AndroidMx53LoCoConfig,
509549
=== 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 13:55:25 +0000
@@ -533,9 +533,9 @@
533 if d_img_data is not None:533 if d_img_data is not None:
534 assert self.dtb_addr is not None, (534 assert self.dtb_addr is not None, (
535 "Need a dtb_addr when passing d_img_data")535 "Need a dtb_addr when passing d_img_data")
536 boot_script += (536 boot_script += (("%(fatload_command)s mmc %(mmc_option)s "
537 ("%(fatload_command)s mmc %(mmc_option)s %(dtb_addr)s " +537 "%(dtb_addr)s ")) % replacements
538 "board.dtb; ")) % replacements538 boot_script += "%s; " % d_img_data
539 boot_script += (("bootm %(kernel_addr)s")) % replacements539 boot_script += (("bootm %(kernel_addr)s")) % replacements
540 if i_img_data is not None:540 if i_img_data is not None:
541 boot_script += ((" %(initrd_addr)s")) % replacements541 boot_script += ((" %(initrd_addr)s")) % replacements
542542
=== 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 13:55:25 +0000
@@ -481,3 +481,18 @@
481 'fdt_high': '0xffffffff',481 'fdt_high': '0xffffffff',
482 'initrd_high': '0xffffffff'}482 'initrd_high': '0xffffffff'}
483 self.assertBootEnv(expected, board='mx53loco')483 self.assertBootEnv(expected, board='mx53loco')
484
485 def test_android_arndale_old(self):
486 """Test that uses values taken directly from the class. """
487 expected = {
488 'bootargs': 'ttySAC2,115200n8 rootwait ro rootdelay=3 '
489 'init=/init androidboot.console=ttySAC2 '
490 'console=ttySAC2 initrd=0x41000000',
491 'bootcmd': 'fatload mmc 0:1 0x40007000 uImage; fatload mmc 0:1 '
492 '0x41000000 uInitrd; fatload mmc 0:1 0x41f00000 '
493 'exynos5250-arndale.dtb; bootm 0x40007000 0x41000000 '
494 '0x41f00000',
495 'fdt_high': '0xffffffff',
496 'initrd_high': '0xffffffff',
497 }
498 self.assertBootEnv(expected, board='arndale')
484499
=== 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 13:55:25 +0000
@@ -2002,7 +2002,7 @@
2002 'root=UUID=deadbeef rootwait ro',2002 'root=UUID=deadbeef rootwait ro',
2003 'bootcmd': 'fatload mmc 0:2 0x90000000 uImage; '2003 'bootcmd': 'fatload mmc 0:2 0x90000000 uImage; '
2004 'fatload mmc 0:2 0x92000000 uInitrd; '2004 'fatload mmc 0:2 0x92000000 uInitrd; '
2005 'fatload mmc 0:2 0x91ff0000 board.dtb; '2005 'fatload mmc 0:2 0x91ff0000 mx51.dtb; '
2006 'bootm 0x90000000 0x92000000 0x91ff0000',2006 'bootm 0x90000000 0x92000000 0x91ff0000',
2007 'fdt_high': '0xffffffff',2007 'fdt_high': '0xffffffff',
2008 'initrd_high': '0xffffffff'}2008 'initrd_high': '0xffffffff'}
@@ -2126,7 +2126,7 @@
2126 'mem=456M@0x80000000 mem=512M@0xA0000000',2126 'mem=456M@0x80000000 mem=512M@0xA0000000',
2127 'bootcmd': 'fatload mmc 0:1 0x80200000 uImage; '2127 'bootcmd': 'fatload mmc 0:1 0x80200000 uImage; '
2128 'fatload mmc 0:1 0x81600000 uInitrd; '2128 'fatload mmc 0:1 0x81600000 uInitrd; '
2129 'fatload mmc 0:1 0x815f0000 board.dtb; '2129 'fatload mmc 0:1 0x815f0000 panda.dtb; '
2130 'bootm 0x80200000 0x81600000 0x815f0000',2130 'bootm 0x80200000 0x81600000 0x815f0000',
2131 'fdt_high': '0xffffffff',2131 'fdt_high': '0xffffffff',
2132 'initrd_high': '0xffffffff'}2132 'initrd_high': '0xffffffff'}
@@ -2149,7 +2149,7 @@
2149 'omapfb.mode=dvi:1280x720MR-16@60 mpurate=${mpurate}',2149 'omapfb.mode=dvi:1280x720MR-16@60 mpurate=${mpurate}',
2150 'bootcmd': 'fatload mmc 0:1 0x80000000 uImage; '2150 'bootcmd': 'fatload mmc 0:1 0x80000000 uImage; '
2151 'fatload mmc 0:1 0x81600000 uInitrd; '2151 'fatload mmc 0:1 0x81600000 uInitrd; '
2152 'fatload mmc 0:1 0x815f0000 board.dtb; '2152 'fatload mmc 0:1 0x815f0000 beagle.dtb; '
2153 'bootm 0x80000000 0x81600000 0x815f0000',2153 'bootm 0x80000000 0x81600000 0x815f0000',
2154 'fdt_high': '0xffffffff',2154 'fdt_high': '0xffffffff',
2155 'initrd_high': '0xffffffff'}2155 'initrd_high': '0xffffffff'}
@@ -2172,7 +2172,7 @@
2172 'omapfb.mode=dvi:1280x720MR-16@60 mpurate=${mpurate}',2172 'omapfb.mode=dvi:1280x720MR-16@60 mpurate=${mpurate}',
2173 'bootcmd': 'fatload mmc 0:1 0x80000000 uImage; '2173 'bootcmd': 'fatload mmc 0:1 0x80000000 uImage; '
2174 'fatload mmc 0:1 0x81600000 uInitrd; '2174 'fatload mmc 0:1 0x81600000 uInitrd; '
2175 'fatload mmc 0:1 0x815f0000 board.dtb; '2175 'fatload mmc 0:1 0x815f0000 igep.dtb; '
2176 'bootm 0x80000000 0x81600000 0x815f0000',2176 'bootm 0x80000000 0x81600000 0x815f0000',
2177 'fdt_high': '0xffffffff',2177 'fdt_high': '0xffffffff',
2178 'initrd_high': '0xffffffff'}2178 'initrd_high': '0xffffffff'}
@@ -2196,7 +2196,7 @@
2196 'omapfb.mode=dvi:${dvimode}',2196 'omapfb.mode=dvi:${dvimode}',
2197 'bootcmd': 'fatload mmc 0:1 0x80000000 uImage; '2197 'bootcmd': 'fatload mmc 0:1 0x80000000 uImage; '
2198 'fatload mmc 0:1 0x81600000 uInitrd; '2198 'fatload mmc 0:1 0x81600000 uInitrd; '
2199 'fatload mmc 0:1 0x815f0000 board.dtb; '2199 'fatload mmc 0:1 0x815f0000 overo.dtb; '
2200 'bootm 0x80000000 0x81600000 0x815f0000',2200 'bootm 0x80000000 0x81600000 0x815f0000',
2201 'fdt_high': '0xffffffff',2201 'fdt_high': '0xffffffff',
2202 'initrd_high': '0xffffffff'}2202 'initrd_high': '0xffffffff'}

Subscribers

People subscribed via source and target branches