diff options
author | Fathi Boudra <fathi.boudra@linaro.org> | 2013-03-25 17:28:58 +0200 |
---|---|---|
committer | Fathi Boudra <fathi.boudra@linaro.org> | 2013-03-25 17:28:58 +0200 |
commit | c6080b9226103616ad1bd9c339f1edab070a32ae (patch) | |
tree | d211b38d30029b8385e6eb8e3cfa3ce6c9b6e35d /linaro_image_tools/media_create | |
parent | 60e5edb71b528936696b7c8eeda89d726b8ccb2f (diff) | |
parent | 873a852567f6e05b1561db3cdaa0a5cead6ca28a (diff) |
Merge trunk
Diffstat (limited to 'linaro_image_tools/media_create')
4 files changed, 64 insertions, 9 deletions
diff --git a/linaro_image_tools/media_create/android_boards.py b/linaro_image_tools/media_create/android_boards.py index 008cad3..668872f 100644 --- a/linaro_image_tools/media_create/android_boards.py +++ b/linaro_image_tools/media_create/android_boards.py @@ -35,6 +35,7 @@ from linaro_image_tools import cmd_runner 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 @@ from linaro_image_tools.media_create.boards import ( align_up, install_mx5_boot_loader, make_boot_script, + _dd, + BoardException, ) from linaro_image_tools.utils import DEFAULT_LOGGER_NAME @@ -496,6 +499,42 @@ class AndroidVexpressConfig(AndroidBoardConfig, VexpressConfig): 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 @@ class AndroidVexpressConfig(AndroidBoardConfig, VexpressConfig): # 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, diff --git a/linaro_image_tools/media_create/boards.py b/linaro_image_tools/media_create/boards.py index d5bf4dc..30fe9a1 100644 --- a/linaro_image_tools/media_create/boards.py +++ b/linaro_image_tools/media_create/boards.py @@ -536,14 +536,14 @@ class BoardConfig(object): "%(kernel_addr)s %(uimage_path)suImage; ")) % replacements if i_img_data is not None: boot_script += ( - ("%(fatload_command)s %(load_interface)s %(mmc_option)s " + + ("%(fatload_command)s %(load_interface)s %(mmc_option)s " "%(initrd_addr)s %(uimage_path)suInitrd; ")) % replacements 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 %(load_interface)s %(mmc_option)s " + - "%(dtb_addr)s board.dtb; ")) % replacements + boot_script += (("%(fatload_command)s %(load_interface)s " + "%(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 diff --git a/linaro_image_tools/media_create/tests/test_android_boards.py b/linaro_image_tools/media_create/tests/test_android_boards.py index babfc66..758aa94 100644 --- a/linaro_image_tools/media_create/tests/test_android_boards.py +++ b/linaro_image_tools/media_create/tests/test_android_boards.py @@ -481,3 +481,18 @@ class TestAndroidBoardsHwpack(TestCaseWithFixtures): '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') diff --git a/linaro_image_tools/media_create/tests/test_media_create.py b/linaro_image_tools/media_create/tests/test_media_create.py index d14464c..03b8f82 100644 --- a/linaro_image_tools/media_create/tests/test_media_create.py +++ b/linaro_image_tools/media_create/tests/test_media_create.py @@ -2002,7 +2002,7 @@ class TestGetBootCmd(TestCase): '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 @@ class TestGetBootCmd(TestCase): '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 @@ class TestGetBootCmd(TestCase): '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 @@ class TestGetBootCmd(TestCase): '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 @@ class TestGetBootCmd(TestCase): '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'} |